-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Product Experiences #188
Conversation
…erTap/clevertap-web-sdk into task/SDK-3413/remote_config
clevertap.min.js
Outdated
@@ -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");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;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:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i)}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 finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}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 d=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),h=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),u="clear",g="Charged ID",f="WZRK_CHARGED_ID",v="WZRK_G",b="WZRK_K",m="WZRK_CAMP",y="WZRK_CAMP_G",w="WZRK_EV",C="WZRK_META",k="WZRK_PR",x="WZRK_ARP",P="WZRK_L",I="global",S="optOut",_="useIP",O="WZRK_X",E="push",A=31536e3,M="wzrk_",L="wzrk_id",T="Notification Viewed",R="Notification Clicked",z="WZRK_FPU",D="WZRK_PSD",B="$incr",j="$add",N="$remove",U="$delete",F="WZRK_INBOX_CONFIG",W="WZRK_INBOX",q=["Stayed","UTM Visited","App Launched","Notification Sent",T,R],V=e=>"string"==typeof e||e instanceof String,K=e=>"[object Object]"===Object.prototype.toString.call(e),G=e=>"object"==typeof e&&e instanceof Date,H=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},J=e=>!isNaN(parseFloat(e))&&isFinite(e),Z=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,$=e=>null!=e&&"undefined"!==e,Y=(e,t)=>{if("object"!=typeof e){let i;return V(e)?(i=Q(e,h),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=Y(e[i],t);let n;n=Q(i,d),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},Q=(e,t)=>e.replace(t,""),X=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ee=()=>Math.floor((new Date).getTime()/1e3),te=e=>"$D_"+Math.round(e.getTime()/1e3),ie=e=>{if(oe(e))return"$D_"+e},oe=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 ne{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<i.length;e++){let o=i[e];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return null}static _isLocalStorageSupported(){return"localStorage"in window&&null!==window.localStorage&&"function"==typeof window.localStorage.setItem}static saveToLSorCookie(e,t){if(null!=t)try{this._isLocalStorageSupported()?this.save(e,encodeURIComponent(JSON.stringify(t))):e===v?this.createCookie(e,encodeURIComponent(t),0,window.location.hostname):this.createCookie(e,encodeURIComponent(JSON.stringify(t)),0,window.location.hostname),se.globalCache[e]=t}catch(e){}}static readFromLSorCookie(e){let t;if(se.globalCache.hasOwnProperty(e))return se.globalCache[e];if(t=this._isLocalStorageSupported()?this.read(e):this.readCookie(e),null!=t&&("function"!=typeof t.trim||""!==t.trim())){let i;try{i=JSON.parse(decodeURIComponent(t))}catch(e){i=decodeURIComponent(t)}return se.globalCache[e]=i,i}}static createBroadCookie(e,t,i,o){if(o){let s=se.broadDomain;if(null==s){const r=o.split(".");let a="";for(let o=r.length-1;o>=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,se.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(C);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(C);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(C,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(b);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(b,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(P);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(P,o),i.debug("stored in ".concat(P," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(P);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(P,i))}}const se={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};var re=t("keyOrder"),ae=t("deleteFromObject");class le{constructor(e){Object.defineProperty(this,ae,{value:ce}),Object.defineProperty(this,re,{writable:!0,value:void 0}),this.max=e;let t=ne.readFromLSorCookie(O);if(t){const e={};i(this,re)[re]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,re)[re].push(t[o][0]));this.cache=e}else this.cache={},i(this,re)[re]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ae)[ae](e,this.cache),this.cache[e]=t,i(this,re)[re].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,re)[re];null!=o?this.cache=i(this,ae)[ae](e,this.cache):n.length===this.max&&(this.cache=i(this,ae)[ae](n[0],this.cache)),this.cache[e]=t,i(this,re)[re][i(this,re)[re]-1]!==e&&i(this,re)[re].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,re)[re];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ne.saveToLSorCookie(O,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,re)[re];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,re)[re];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,re)[re].length;if(e)return i(this,re)[re][e-1]}}var ce=function(e,t){const o=JSON.parse(JSON.stringify(i(this,re)[re])),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,re)[re]=JSON.parse(JSON.stringify(o)),n},de=t("logger"),he=t("request"),pe=t("device"),ue=t("session");class ge{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,de,{writable:!0,value:void 0}),Object.defineProperty(this,he,{writable:!0,value:void 0}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ue,{writable:!0,value:void 0}),i(this,de)[de]=t,i(this,he)[he]=o,i(this,pe)[pe]=n,i(this,ue)[ue]=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),ne.removeBackup(n,i(this,de)[de]),n>se.globalCache.REQ_N)return;if($(i(this,pe)[pe].gcookie)||e&&(a=!0),!$(i(this,pe)[pe].gcookie)||o||"boolean"==typeof s){const n=i(this,ue)[ue].getSessionCookieObject();if(window.isOULInProgress||n.s&&t<n.s)return;if(i(this,de)[de].debug("Cookie was ".concat(i(this,pe)[pe].gcookie," set to ").concat(e)),i(this,pe)[pe].gcookie=e,$(i(this,pe)[pe].gcookie)||ne.getAndClearMetaProp(_),e&&ne._isLocalStorageSupported()){null==se.LRU_CACHE&&(se.LRU_CACHE=new le(100));const t=ne.readFromLSorCookie(b);let n;null!=t&&t.id&&(n=se.LRU_CACHE.cache[t.id],o&&(n||(ne.saveToLSorCookie(z,!0),se.LRU_CACHE.set(t.id,e)))),ne.saveToLSorCookie(v,e);const s=se.LRU_CACHE.getSecondLastKey();if(ne.readFromLSorCookie(z)&&-1!==s){const e=se.LRU_CACHE.cache[s];i(this,he)[he].unregisterTokenForGuid(e)}}ne.createBroadCookie(v,e,A,window.location.hostname),ne.saveToLSorCookie(v,e)}ne._isLocalStorageSupported()&&i(this,ue)[ue].manageSession(t);const l=i(this,ue)[ue].getSessionCookieObject();(void 0===l.s||l.s<=t)&&(l.s=t,l.t=ee(),i(this,ue)[ue].setSessionCookieObject(l)),$(i(this,pe)[pe].gcookie)&&(se.blockRequest=!1),!r&&!a||i(this,he)[he].processingBackup||i(this,he)[he].processBackupEvents(),se.globalCache.RESP_N=n}}var fe=t("logger");class ve{constructor(e){let{logger:t}=e;Object.defineProperty(this,fe,{writable:!0,value:void 0}),this.gcookie=void 0,i(this,fe)[fe]=t,this.gcookie=this.getGuid()}getGuid(){let e=null;if($(this.gcookie))return this.gcookie;if(ne._isLocalStorageSupported()){const t=ne.read(v);if($(t)){try{e=JSON.parse(decodeURIComponent(t))}catch(o){i(this,fe)[fe].debug("Cannot parse Gcookie from localstorage - must be encoded "+t),32===t.length?(e=t,ne.saveToLSorCookie(v,t)):i(this,fe)[fe].error("Illegal guid "+t)}$(e)&&ne.createBroadCookie(v,e,A,window.location.hostname)}}return $(e)||(e=ne.readCookie(v),!$(e)||0!==e.indexOf("%")&&0!==e.indexOf("'")&&0!==e.indexOf('"')||(e=null),$(e)&&ne.saveToLSorCookie(v,e)),e}}const be="This property has been ignored.",me="CleverTap error:",ye="".concat(me," Incorrect embed script."),we="".concat(me," Event structure not valid. ").concat(be),Ce="".concat(me," Gender value should be either M or F. ").concat(be),ke="".concat(me," Employed value should be either Y or N. ").concat(be),xe="".concat(me," Married value should be either Y or N. ").concat(be),Pe="".concat(me," Education value should be either School, College or Graduate. ").concat(be),Ie="".concat(me," Age value should be a number. ").concat(be),Se="".concat(me," DOB value should be a Date Object"),_e="".concat(me," setEnum(value). value should be a string or a number"),Oe="".concat(me," Phone number should be formatted as +[country code][number]");let Ee;const Ae=e=>{if(K(e)){for(var t in e)if(e.hasOwnProperty(t)){if(K(e[t])||Array.isArray(e[t]))return!1;G(e[t])&&(e[t]=te(e[t]))}return!0}return!1},Me=(e,t)=>{if(K(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)&&(!K(e[i][o])||!Ae(e[i][o])))return!1}else{if(K(e[i])||Array.isArray(e[i]))return!1;G(e[i])&&(e[i]=te(e[i]))}if(V(e[g])||Z(e[g])){const i=e[g]+"";if(void 0===Ee&&(Ee=ne.readFromLSorCookie(f)),void 0!==Ee&&Ee.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Ee=i,ne.saveToLSorCookie(f,i)}return!0}return!1};var Le=t("logger"),Te=t("oldValues"),Re=t("request"),ze=t("isPersonalisationActive"),De=t("processEventArray");class Be extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,De,{value:je}),Object.defineProperty(this,Le,{writable:!0,value:void 0}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),Object.defineProperty(this,Re,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),i(this,Le)[Le]=o,i(this,Te)[Te]=t,i(this,Re)[Re]=n,i(this,ze)[ze]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,De)[De](t),0}_processOldValues(){i(this,Te)[Te]&&i(this,De)[De](i(this,Te)[Te]),i(this,Te)[Te]=null}getDetails(e){if(!i(this,ze)[ze]())return;if(void 0===se.globalEventsMap&&(se.globalEventsMap=ne.readFromLSorCookie(w)),void 0===se.globalEventsMap)return;const t=se.globalEventsMap[e],o={};return void 0!==t?(o.firstTime=new Date(1e3*t[1]),o.lastTime=new Date(1e3*t[2]),o.count=t[0],o):void 0}}var je=function(e){if(Array.isArray(e))for(;e.length>0;){var t=e.shift();if(!V(t)){i(this,Le)[Le].error(we);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,Le)[Le].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),q.includes(t)){i(this,Le)[Le].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=Q(t,d),0!==e.length){const n=e.shift();if(K(n)){if("Charged"===t){if(!Me(n,i(this,Le)[Le])){i(this,Le)[Le].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Ae(n)){i(this,Le)[Le].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Re)[Re].processEvent(o)}};const Ne=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},Ue=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Fe=()=>window.location.hostname,We=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ve(e)),qe=(()=>{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+"+/="})(),Ve=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,p="",u=0,g=0,f=String.fromCharCode;for(o=0;o<e.length;o+=1)if(r=e.charAt(o),Object.prototype.hasOwnProperty.call(n,r)||(n[r]=d++,s[r]=!0),a=l+r,Object.prototype.hasOwnProperty.call(n,a))l=a;else{if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t<h;t++)u<<=1,15==g?(g=0,p+=f(u),u=0):g++;for(i=l.charCodeAt(0),t=0;t<8;t++)u=u<<1|1&i,15==g?(g=0,p+=f(u),u=0):g++,i>>=1}else{for(i=1,t=0;t<h;t++)u=u<<1|i,15==g?(g=0,p+=f(u),u=0):g++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)u=u<<1|1&i,15==g?(g=0,p+=f(u),u=0):g++,i>>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t<h;t++)u=u<<1|1&i,15==g?(g=0,p+=f(u),u=0):g++,i>>=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<h;t++)u<<=1,15==g?(g=0,p+=f(u),u=0):g++;for(i=l.charCodeAt(0),t=0;t<8;t++)u=u<<1|1&i,15==g?(g=0,p+=f(u),u=0):g++,i>>=1}else{for(i=1,t=0;t<h;t++)u=u<<1|i,15==g?(g=0,p+=f(u),u=0):g++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)u=u<<1|1&i,15==g?(g=0,p+=f(u),u=0):g++,i>>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t<h;t++)u=u<<1|1&i,15==g?(g=0,p+=f(u),u=0):g++,i>>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t<h;t++)u=u<<1|1&i,15==g?(g=0,p+=f(u),u=0):g++,i>>=1;for(;;){if(u<<=1,15==g){p+=f(u);break}g++}return p})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1<e.length?e.charCodeAt(c/2+1)>>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2<e.length?(i=e.charCodeAt((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+qe.charAt(n)+qe.charAt(s)+qe.charAt(r)+qe.charAt(a);return l};var Ke=t("fireRequest"),Ge=t("dropRequestDueToOptOut"),He=t("addUseIPToRequest"),Je=t("addARPToRequest");class Ze{static fireRequest(e,t,o){i(this,Ke)[Ke](e,1,t,o)}}Ze.logger=void 0,Ze.device=void 0,Object.defineProperty(Ze,Ke,{value:function(e,t,o,n){var s,r;if(i(this,Ge)[Ge]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if($(this.device.gcookie)||(se.blockRequest=!0),!$(this.device.gcookie)&&se.globalCache.RESP_N<se.globalCache.REQ_N-1&&t<200)return void setTimeout((()=>{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Ke)[Ke](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:($(this.device.gcookie)&&(e=Ue(e,"gc",this.device.gcookie)),e=i(this,Je)[Je](e,o)),e=Ue(e,"tries",t),e=i(this,He)[He](e),e=Ue(e,"r",(new Date).getTime()),(null===(s=window.clevertap)||void 0===s?void 0:s.hasOwnProperty("plugin"))||(null===(r=window.wizrocket)||void 0===r?void 0:r.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ue(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var a=document.getElementsByClassName("ct-jp-cb");a[0]&&a[0].parentNode;)a[0].parentNode.removeChild(a[0]);const l=document.createElement("script");l.setAttribute("type","text/javascript"),l.setAttribute("src",e),l.setAttribute("class","ct-jp-cb"),l.setAttribute("rel","nofollow"),l.async=!0,document.getElementsByTagName("head")[0].appendChild(l),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Ze,Ge,{value:function(){return!se.isOptInRequest&&$(this.device.gcookie)&&V(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(se.isOptInRequest=!1,!1)}}),Object.defineProperty(Ze,He,{value:function(e){var t=ne.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ue(e,_,t?"true":"false")}}),Object.defineProperty(Ze,Je,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ue(e,"arp",We(JSON.stringify(t),this.logger))}return ne._isLocalStorageSupported()&&void 0!==localStorage.getItem(x)&&null!==localStorage.getItem(x)?Ue(e,"arp",We(JSON.stringify(ne.readFromLSorCookie(x)),this.logger)):e}});const $e=()=>{let e={};if(ne._isLocalStorageSupported()){let t=ne.read(m);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},Ye=e=>{if(ne._isLocalStorageSupported()){const t={...$e(),...e},i=JSON.stringify(t);ne.save(m,encodeURIComponent(i)),Qe()}},Qe=()=>{if(ne._isLocalStorageSupported()){let i=ne.read(v);if($(i))try{i=JSON.parse(decodeURIComponent(ne.read(v)));const o=ne.read(y)?JSON.parse(decodeURIComponent(ne.read(y))):{};if(i&&ne._isLocalStorageSupported()){var e={},t=$e();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=X(),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,ne.save(y,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},Xe=()=>{const e=JSON.parse(decodeURIComponent(ne.read(v)));let t={};if(ne._isLocalStorageSupported()){let i={};t=$e();const o=ne.read(y),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=X();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}},et=(e,t)=>{let{logger:i}=t,o=!1;if(K(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(Ce)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(ke)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(xe)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Pe)),"Age"===t&&null!=n&&(J(n)?e.Age=+n:(o=!1,i.error(Ie))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||G(n)||(o=!1,i.error(Se)),G(n)&&(e[t]=te(n))):G(n)&&(e[t]=te(n)),"Phone"!==t||H(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),J(n)?e.Phone=+n:(o=!1,i.error(Oe+". Removed."))):(o=!1,i.error(Oe+". Removed."))),o||delete e[t]}return o},tt=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;o<e.length;o++){const n=e[o];if(null!=n.type){const e=n.type;if("Graduate School"===e)return"Graduate";"College"===e?t="1":"High School"===e&&(i="1")}}if("1"===t)return"College";if("1"===i)return"School"}}(e.education);null!=i&&(t.Education=i);const o=null!=e.work?e.work.length:0;if(t.Employed=o>0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=ie(i[2]+i[0]+i[1])}return t},it=(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<e.emails.length;t++){const i=e.emails[t];"account"===i.type&&(o.Email=i.value)}if(null!=e.organizations){o.Employed="N";for(let t=0;t<e.organizations.length;t++){"work"===e.organizations[t].type&&(o.Employed="Y")}}if(null!=e.birthday){const t=e.birthday.split("-");o.DOB=ie(t[0]+t[1]+t[2])}return null!=e.relationshipStatus&&(o.Married="N","married"===e.relationshipStatus&&(o.Married="Y")),i.debug("gplus usr profile "+JSON.stringify(o)),o},ot=(e,t)=>{if(ne._isLocalStorageSupported()){if(null==se.globalProfileMap&&(se.globalProfileMap=ne.readFromLSorCookie(k),null==se.globalProfileMap&&(se.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(se.globalProfileMap.hasOwnProperty(i)&&!t)continue;se.globalProfileMap[i]=e[i]}null!=se.globalProfileMap._custom&&delete se.globalProfileMap._custom,ne.saveToLSorCookie(k,se.globalProfileMap)}},nt=(e,t,i)=>{if(null!=e&&"-1"!==e&&ne._isLocalStorageSupported()){const t=$e();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",Ye(t)}if(null!=se.campaignDivMap){const t=se.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var st=t("logger"),rt=t("request"),at=t("account"),lt=t("oldValues"),ct=t("isPersonalisationActive"),dt=t("processProfileArray");class ht extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,dt,{value:pt}),Object.defineProperty(this,st,{writable:!0,value:void 0}),Object.defineProperty(this,rt,{writable:!0,value:void 0}),Object.defineProperty(this,at,{writable:!0,value:void 0}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),i(this,st)[st]=o,i(this,rt)[rt]=n,i(this,at)[at]=s,i(this,lt)[lt]=t,i(this,ct)[ct]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,dt)[dt](t),0}_processOldValues(){i(this,lt)[lt]&&i(this,dt)[dt](i(this,lt)[lt]),i(this,lt)[lt]=null}getAttribute(e){if(i(this,ct)[ct]())return null==se.globalProfileMap&&(se.globalProfileMap=ne.readFromLSorCookie(k)),null!=se.globalProfileMap?se.globalProfileMap[e]:void 0}_handleIncrementDecrementValue(e,t,o){var n;if(null==se.globalProfileMap&&(se.globalProfileMap=ne.readFromLSorCookie(k)),null!=se.globalProfileMap||(null===(n=se.globalProfileMap)||void 0===n?void 0:n.hasOwnProperty(e)))if(!t||"number"!=typeof t||t<=0)console.error("Value should be a number greater than 0");else{se.globalProfileMap[e]=o===B?se.globalProfileMap[e]+t:se.globalProfileMap[e]-t,ne.saveToLSorCookie(k,se.globalProfileMap);let n={};const s={};n.type="profile",s[e]={[o]:t},null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=s,n=i(this,rt)[rt].addSystemDataToProfileObject(n,void 0),i(this,rt)[rt].addFlags(n);const r=We(JSON.stringify(n),i(this,st)[st]);let a=i(this,at)[at].dataPostURL;a=Ue(a,"type",E),a=Ue(a,"d",r),i(this,rt)[rt].saveAndFireRequest(a,se.blockRequest)}else console.error("Kindly create profile with required proprty to increment/decrement.")}_handleMultiValueSet(e,t,i){const o=[];for(let e=0;e<t.length;e++)"number"!=typeof t[e]||o.includes(t[e])?"string"!=typeof t[e]||o.includes(t[e].toLowerCase())?console.error("array supports only string or number type values"):o.push(t[e].toLowerCase()):o.push(t[e]);var n;null==se.globalProfileMap&&(se.globalProfileMap=null!==(n=ne.readFromLSorCookie(k))&&void 0!==n?n:{});se.globalProfileMap[e]=o,ne.saveToLSorCookie(k,se.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueAdd(e,t,i){var o=[];if(null==se.globalProfileMap&&(se.globalProfileMap=ne.readFromLSorCookie(k)||{}),"string"==typeof t||"number"==typeof t)se.globalProfileMap.hasOwnProperty(e)?(o=se.globalProfileMap[e]).push("number"==typeof t?t:t.toLowerCase()):se.globalProfileMap[e]=t;else{se.globalProfileMap.hasOwnProperty(e)&&(o=Array.isArray(se.globalProfileMap[e])?se.globalProfileMap[e]:[se.globalProfileMap[e]]);for(var n=0;n<t.length;n++)"number"!=typeof t[n]||o.includes(t[n])?"string"!=typeof t[n]||o.includes(t[n].toLowerCase())?"number"==typeof t[n]&&o.includes(t[n])||"string"==typeof t[n]&&o.includes(t[n].toLowerCase())?console.error("Values already included"):console.error("Array supports only string or number type values"):o.push(t[n].toLowerCase()):o.push(t[n]);se.globalProfileMap[e]=o}ne.saveToLSorCookie(k,se.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueRemove(e,t,i){var o;if(null==se.globalProfileMap&&(se.globalProfileMap=ne.readFromLSorCookie(k)),null==se||null===(o=se.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))if("string"==typeof t||"number"==typeof t){var n=se.globalProfileMap[e].indexOf(t);-1!==n&&se.globalProfileMap[e].splice(n,1)}else for(var s=0;s<t.length;s++){var r=se.globalProfileMap[e].indexOf(t[s]);-1!==r&&se.globalProfileMap[e].splice(r,1)}else console.error("The property ".concat(e," does not exist."));ne.saveToLSorCookie(k,se.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueDelete(e,t){var i;null==se.globalProfileMap&&(se.globalProfileMap=ne.readFromLSorCookie(k)),(null==se||null===(i=se.globalProfileMap)||void 0===i?void 0:i.hasOwnProperty(e))?delete se.globalProfileMap[e]:console.error("The property ".concat(e," does not exist.")),ne.saveToLSorCookie(k,se.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,o){let n={};const s={};n.type="profile",s[e]={[o]:o===U||t},null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=s,n=i(this,rt)[rt].addSystemDataToProfileObject(n,void 0),i(this,rt)[rt].addFlags(n);const r=We(JSON.stringify(n),i(this,st)[st]);let a=i(this,at)[at].dataPostURL;a=Ue(a,"type",E),a=Ue(a,"d",r),i(this,rt)[rt].saveAndFireRequest(a,se.blockRequest)}}var pt=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,H(n)||!et(n,{logger:i(this,st)[st]}))return}else if(null!=o.Facebook){const e=o.Facebook;H(e)||e.error||(n=tt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];H(e)||e.error||(n=it(e,{logger:i(this,st)[st]}))}if(null!=n&&!H(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,ot(n,!0),s=i(this,rt)[rt].addSystemDataToObject(s,void 0),i(this,rt)[rt].addFlags(s);const e=We(JSON.stringify(s),i(this,st)[st]);let t=i(this,at)[at].dataPostURL;t=Ue(t,"type",E),t=Ue(t,"d",e),i(this,rt)[rt].saveAndFireRequest(t,se.blockRequest)}}},ut=t("request"),gt=t("logger"),ft=t("account"),vt=t("session"),bt=t("oldValues"),mt=t("device"),yt=t("processOUL"),wt=t("handleCookieFromCache"),Ct=t("deleteUser"),kt=t("processLoginArray");class xt extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,kt,{value:_t}),Object.defineProperty(this,Ct,{value:St}),Object.defineProperty(this,wt,{value:It}),Object.defineProperty(this,yt,{value:Pt}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,ft,{writable:!0,value:void 0}),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}),i(this,ut)[ut]=o,i(this,ft)[ft]=n,i(this,vt)[vt]=s,i(this,gt)[gt]=r,i(this,bt)[bt]=t,i(this,mt)[mt]=a}clear(){i(this,gt)[gt].debug("clear called. Reset flag has been set."),i(this,Ct)[Ct](),ne.setMetaProp(u,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,kt)[kt](t),0}_processOldValues(){i(this,bt)[bt]&&i(this,kt)[kt](i(this,bt)[bt]),i(this,bt)[bt]=null}}var Pt=function(e){let t=!0;ne.saveToLSorCookie(z,t);const o=e=>{let o=ne.readFromLSorCookie(b);const n=ne.readFromLSorCookie(v);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==se.LRU_CACHE&&ne._isLocalStorageSupported()&&(se.LRU_CACHE=new le(100)),r)null!=n&&(se.LRU_CACHE.set(s,n),se.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(se.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==se.LRU_CACHE.getLastKey()?i(this,wt)[wt]():(t=!1,ne.saveToLSorCookie(z,t));const e=se.LRU_CACHE.get(s);se.LRU_CACHE.set(s,e),ne.saveToLSorCookie(v,e),i(this,mt)[mt].gcookie=e;const o=se.LRU_CACHE.getSecondLastKey();if(ne.readFromLSorCookie(z)&&-1!==o){const e=se.LRU_CACHE.cache[o];i(this,ut)[ut].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,mt)[mt].gcookie=n,ne.saveToLSorCookie(v,n),t=!1):this.clear(),ne.saveToLSorCookie(z,!1),s=e[0]}o.id=s,ne.saveToLSorCookie(b,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,H(r)||!et(r,{logger:i(this,gt)[gt]}))return}else if(null!=s.Facebook){const e=s.Facebook;H(e)||e.error||(r=tt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];H(e)&&!e.error&&(r=it(e,{logger:i(this,gt)[gt]}))}if(null!=r&&!H(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ne._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)),ot(r,!0),a=i(this,ut)[ut].addSystemDataToObject(a,void 0),i(this,ut)[ut].addFlags(a),t&&(a.isOUL=!0);const n=We(JSON.stringify(a),i(this,gt)[gt]);let s=i(this,ft)[ft].dataPostURL;s=Ue(s,"type",E),s=Ue(s,"d",n),i(this,ut)[ut].saveAndFireRequest(s,se.blockRequest,t)}}},It=function(){se.blockRequest=!1,console.debug("Block request is false"),ne._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),ne.removeCookie(m,Fe()),ne.removeCookie(i(this,vt)[vt].cookieName,se.broadDomain),ne.removeCookie(x,se.broadDomain),i(this,vt)[vt].setSessionCookieObject("")},St=function(){se.blockRequest=!0,i(this,gt)[gt].debug("Block request is true"),se.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ne._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),ne.removeCookie(v,se.broadDomain),ne.removeCookie(m,Fe()),ne.removeCookie(b,Fe()),ne.removeCookie(i(this,vt)[vt].cookieName,se.broadDomain),ne.removeCookie(x,se.broadDomain),i(this,mt)[mt].gcookie=null,i(this,vt)[vt].setSessionCookieObject("")},_t=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&K(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)){ne.setInstantDeleteFlagInK();try{i(this,yt)[yt]([t])}catch(e){i(this,gt)[gt].debug(e)}}else i(this,gt)[gt].error("Profile object is in incorrect format")}};class Ot 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 <style type="text/css">\n .banner {\n position: relative;\n cursor: '.concat(this.details.onClick?"pointer":"","\n }\n img {\n height: ").concat(this.divHeight?this.divHeight:"auto",";\n width: 100%;\n }\n .wrapper:is(.left, .right, .center) {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: auto;\n top: 0;\n }\n ").concat(this.details.css?this.details.css:"",'\n </style>\n <div class="banner">\n <picture>\n <source media="(min-width:480px)" srcset="').concat(this.details.desktopImageURL,'">\n <source srcset="').concat(this.details.mobileImageURL,'">\n <img src="').concat(this.details.desktopImageURL,'" alt="Please upload a picture" style="width:100%;" part="banner__img">\n </picture>\n ').concat(this.details.html?this.details.html:"","\n </div>\n ")}}class Et 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",Ot)}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 <style>\n .carousel {\n position: relative;\n }\n\n .carousel__item {\n background-color: grey;\n display: none;\n background-repeat: no-repeat;\n background-size: cover;\n }\n\n ct-web-personalisation-banner::part(banner__img) {\n height: ".concat((null==this||null===(e=this.target)||void 0===e||null===(t=e.display)||void 0===t?void 0:t.divHeight)?this.target.display.divHeight:"auto",";\n width: 100%;\n transition: 2s;\n }\n\n .carousel__item--selected {\n display: block;\n }\n ").concat(this.display.navBtnsCss,"\n ").concat(this.display.navArrowsCss,"\n </style>\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.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.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 At 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&&ne._isLocalStorageSupported()){const i=$e();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",Ye(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 Mt 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="<span>".concat(Ft(e.id.split("_")[1]),"<span>"),!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=Vt;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 Lt 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:ne.readFromLSorCookie(F)||{},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=Dt();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_ttl<i){if(e){const e=this.shadowRoot.getElementById(t[o].id);e&&e.remove(),t[o].viewed||(this.unviewedCounter--,this.updateUnviewedBadgeCounter())}delete t[o]}return t&&t.length>0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Bt(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++})),Bt(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=qt,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=qt,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 Mt(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=Dt();i[e]=t,Bt(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(se.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=Ut(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=Dt();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=Ft(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:p}=e;return'\n <style id="webInboxStyles">\n #inbox {\n width: 100%;\n position: fixed;\n background-color: #fff; \n display: none; \n box-shadow: 0px 2px 10px 0px #d7d7d791;\n background-color: '.concat(t,"; \n border: 1px solid ").concat(i,";\n top: 0;\n left: 0;\n height: 100%;\n overflow: auto;\n z-index: 1;\n box-sizing: content-box;\n border-radius: 4px;\n }\n \n #emptyInboxMsg {\n display: block;\n padding: 10px;\n text-align: center;\n color: black;\n }\n \n #header {\n height: 36px; \n width: 100%; \n display: flex; \n justify-content: center; \n align-items: center; \n background-color: ").concat(o,"; \n background-color: var(--card-bg, ").concat(o,");\n color: ").concat(n,"\n }\n \n #closeInbox {\n font-size: 20px; \n margin-right: 12px; \n color: ").concat(s,"; \n cursor: pointer;\n }\n \n #headerTitle {\n font-size: 14px; \n line-height: 20px; \n flex-grow: 1; \n font-weight: 700; \n text-align: center;\n flex-grow: 1;\n text-align: center;\n }\n \n #categoriesContainer {\n padding: 16px 16px 0 16px; \n height: 32px; \n display: flex;\n scroll-behavior: smooth;\n position: relative;\n }\n\n #categoriesWrapper {\n height: 32px; \n overflow-x: scroll;\n display: flex;\n white-space: nowrap;\n scrollbar-width: none;\n }\n\n #categoriesWrapper::-webkit-scrollbar {\n display: none;\n }\n \n #leftArrow, #rightArrow {\n height: 32px;\n align-items: center;\n font-weight: 700;\n position: absolute;\n z-index: 2;\n pointer-events: auto;\n cursor: pointer;\n display: none;\n }\n\n #leftArrow {\n left: 0;\n padding-left: 4px;\n padding-right: 16px;\n background: linear-gradient(90deg, ").concat(t," 0%, ").concat(t,"99 80%, ").concat(t,"0d 100%);\n }\n\n #rightArrow {\n right: 0;\n padding-right: 4px;\n padding-left: 16px;\n background: linear-gradient(-90deg, ").concat(t," 0%, ").concat(t,"99 80%, ").concat(t,'0d 100%);\n }\n\n [id^="category-"] {\n display: flex; \n flex: 1 1 0; \n justify-content: center; \n align-items: center; \n font-size: 14px; \n line-height: 20px; \n background-color: ').concat(r,"; \n color: ").concat(a,"; \n cursor: pointer;\n padding: 6px 24px;\n margin: 0 3px;\n border-radius: 16px;\n border: ").concat(l?"1px solid "+l:"none",';\n }\n\n [id^="category-"][selected="true"] {\n background-color: ').concat(c,"; \n color: ").concat(d,"; \n border: ").concat(h?"1px solid "+h:"none","\n }\n \n #inboxCard {\n padding: 0 16px 0 16px;\n overflow-y: auto;\n box-sizing: border-box;\n margin-top: 16px;\n }\n\n @media only screen and (min-width: 480px) {\n #inbox {\n width: var(--inbox-width, 392px);\n height: var(--inbox-height, 546px);\n position: var(--inbox-position, fixed);\n right: var(--inbox-right, unset);\n bottom: var(--inbox-bottom, unset);\n top: var(--inbox-top, unset);\n left: var(--inbox-left, unset);\n }\n \n #inboxCard {\n height: calc(var(--inbox-height, 546px) - ").concat(p,"px); \n }\n \n }\n </style>\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 <style id="messageStyles">\n ct-inbox-message::part(messageWrapper) {\n margin-bottom: 16px; \n }\n ct-inbox-message::part(message) {\n background-color: '.concat(t,"; \n border: 1px solid ").concat(i,";\n border-radius: 4px; \n overflow: hidden;\n min-height: 40px;\n }\n ct-inbox-message::part(message):hover {\n box-shadow: 0px 4px 8px rgb(0 0 0 / 10%);\n cursor: pointer;\n }\n ct-inbox-message::part(iconTitleDescWrapper) {\n display: flex; \n padding: 16px;\n }\n ct-inbox-message::part(titleDescWrapper) {\n display: flex; \n flex-direction: column;\n }\n ct-inbox-message::part(iconImgContainer) {\n display: flex; \n margin-right: 16px;\n }\n ct-inbox-message::part(mainImgContainer) {\n line-height: 0;\n }\n ct-inbox-message::part(mainImg) {\n width: 100%; \n background: #b2b1ae;\n }\n ct-inbox-message::part(iconImg) {\n height: 40px; \n width: 40px;\n }\n ct-inbox-message::part(title) {\n font-size: 14px !important; \n line-height: 20px; \n font-weight: 600; \n color: ").concat(o,"\n }\n ct-inbox-message::part(description) {\n font-size: 14px !important; \n line-height: 20px; \n font-weight: 400; \n color: ").concat(n,"\n }\n ct-inbox-message::part(button) {\n background-color: ").concat(s,"; \n color: ").concat(r,"; \n padding: 8px 16px; \n font-size: 12px; \n line-height: 16px; \n font-weight: 600; \n flex: 1; \n border-radius: 0px; \n text-transform: capitalize; \n cursor: pointer; \n border: none;\n }\n ct-inbox-message::part(buttonsContainer) {\n display: flex;\n position: relative;\n }\n ct-inbox-message::part(snackbar) {\n position: absolute;\n top: calc(-100% - 12px);\n left: 50%;\n transform: translate(-50%, 0px);\n font-size: 14px;\n font-weight: 400;\n background: #FFFFFF;\n border: 1px solid #ECEDF2;\n box-shadow: 0px 4px 8px rgb(0 0 0 / 6%), 0px 0px 2px rgb(0 0 0 / 4%);\n border-radius: 4px;\n z-index: 2;\n display: none;\n width: max-content;\n align-items: center;\n padding: 8px 16px;\n justify-content: center;\n }\n\n ct-inbox-message::part(snackbar-msg) {\n color: black;\n margin-left: 8px;\n }\n\n ct-inbox-message::part(timeStamp) {\n display: flex; \n justify-content: end; \n align-items: center; \n margin-top: 4px; \n font-size: 12px !important; \n line-height: 16px; \n color: black;\n }\n ct-inbox-message::part(unreadMarker) {\n height: 8px; \n width: 8px; \n border-radius: 50%; \n background-color: ").concat(a,"; \n margin-left: 8px;\n }\n @media only screen and (min-width: 420px) {\n ct-inbox-message::part(mainImg) {\n height: 180px;\n }\n }\n </style>\n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Tt=e=>{e.inbox_preview?se.inbox.incomingMessagesForPreview=e.inbox_notifs:se.inbox.incomingMessages=e},Rt=e=>{Nt(),se.inbox=new Lt({logger:e}),document.body.appendChild(se.inbox)},zt=e=>{const t=ne.readFromLSorCookie(W)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ne.saveToLSorCookie(W,i),i}return t},Dt=()=>{const e=JSON.parse(decodeURIComponent(ne.read(v)));if(!$(e))return{};const t=zt(e);return t.hasOwnProperty(e)?t[e]:{}},Bt=e=>{const t=JSON.parse(decodeURIComponent(ne.read(v)));if(!$(t))return;const i={...zt(t),[t]:e};ne.saveToLSorCookie(W,i)},jt=e=>new Promise(((t,i)=>{if("complete"===document.readyState)Rt(e),t();else{const i=ne.readFromLSorCookie(F)||{},o=()=>{null===se.inbox&&Rt(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)}}}))}})),Nt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",Lt),customElements.define("ct-inbox-message",Mt))},Ut=(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,p=a.top+n,u=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(u+t<=r){const e=r-(u+t);b=e>=y?u+y:u+e}else if(p-t>=n){const e=p-t;b=e>=y?p-t-y:p-t-e}else m=!0,b=c+g/2-t/2,b<n?b=n:b+t>r&&(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,v<o?v=d+i<=s?d:o:v+i>s&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Ft=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")))},Wt=()=>Object.keys(ne.readFromLSorCookie(F)||{}).length>0,qt='<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M0.258435 9.74751C-0.0478584 9.44825 -0.081891 8.98373 0.156337 8.64775L0.258435 8.52836L3.87106 5L0.258435 1.47164C-0.0478588 1.17239 -0.0818914 0.707867 0.156337 0.371887L0.258435 0.252494C0.564728 -0.0467585 1.04018 -0.0800085 1.38407 0.152743L1.50627 0.252494L5.74156 4.39042C6.04786 4.68968 6.08189 5.1542 5.84366 5.49018L5.74156 5.60957L1.50627 9.74751C1.16169 10.0842 0.603015 10.0842 0.258435 9.74751Z" fill="#63698F"/>\n</svg>\n',Vt='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C12.4183 16 16 12.4183 16 8ZM9.6839 5.93602C9.97083 5.55698 10.503 5.48833 10.8725 5.78269C11.2135 6.0544 11.2968 6.54044 11.0819 6.91173L11.0219 7.00198L8.09831 10.864C7.80581 11.2504 7.26654 11.3086 6.90323 11.0122L6.82822 10.9433L5.04597 9.10191C4.71635 8.76136 4.71826 8.21117 5.05023 7.87303C5.35666 7.5609 5.83722 7.53855 6.16859 7.80482L6.24814 7.87739L7.35133 9.01717L9.6839 5.93602Z" fill="#03A387"/>\n</svg>\n',Kt=(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=X(),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(ne._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=$e();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&&!se.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 p=s[o];if(null!=p){const e=p[i],t=p.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else p={},s[o]=p;var u=s.global;if(null!=u){const e=u[i];if(l>0&&e>=l)return!1}else u={},s.global=u}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Kt,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(p,i,d),n(u,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=p,f.global=u,Ye({[g]:f})},p=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(Ve(e+"|"+t.p+"|"+t.s))},u=(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+=p()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Ze.fireRequest(e),u(r,t),void nt("-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=T,t.evtData={[L]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},b=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Ot);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",Et);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)},C=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(se.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",At),(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(se.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;se.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 p=document.createElement("iframe"),u=!1===i.br?"0":"8";p.frameborder="0px",p.marginheight="0px",p.marginwidth="0px",p.scrolling="no",p.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='<style type="text/css">body{margin:0;padding:0;}#contentDiv.wzrk{overflow:hidden;padding:0;text-align:center;'+b+"}#contentDiv.wzrk td{padding:15px 10px;}.wzrkPPtitle{font-weight: bold;font-size: 16px;font-family:arial;padding-bottom:10px;word-break: break-word;}.wzrkPPdscr{font-size: 14px;font-family:arial;line-height:16px;word-break: break-word;display:inline-block;}.PL15{padding-left:15px;}.wzrkPPwarp{margin:20px 20px 0 5px;padding:0px;border-radius: "+u+"px;box-shadow: 1px 1px 5px #888888;}a.wzrkClose{cursor:pointer;position: absolute;top: 11px;right: 11px;z-index: 2147483647;font-size:19px;font-family:arial;font-weight:bold;text-decoration: none;width: 25px;/*height: 25px;*/text-align: center; -webkit-appearance: none; line-height: 25px;background: #353535;border: #fff 2px solid;border-radius: 100%;box-shadow: #777 2px 2px 2px;color:#fff;}a:hover.wzrkClose{background-color:#d1914a !important;color:#fff !important; -webkit-appearance: none;}td{vertical-align:top;}td.imgTd{border-top-left-radius:8px;border-bottom-left-radius:8px;}</style>";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="<td class='imgTd' style='background-color:"+a+"'><img src='"+e.msgContent.imageUrl+"' height='60' width='60'></td>");v=i+("<div class='wzrkPPwarp' style='color:"+s+";background-color:"+n+";'><a href='javascript:void(0);' onclick="+("parent.$WZRK_WR.closeIframe("+t+",'"+o+"');")+" class='wzrkClose' style='background-color:"+r+";color:"+l+"'>×</a><div id='contentDiv' class='wzrk'><table cellpadding='0' cellspacing='0' border='0'><tr>"+h+"<td style='vertical-align:top;'><div class='wzrkPPtitle' style='color:"+s+"'>"+c+"</div>")+("<div class='wzrkPPdscr' style='color:"+s+"'>"+d+"<div></td></tr></table></div>")}p.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(p);const m=(p.contentWindow?p.contentWindow:p.contentDocument.document?p.contentDocument.document:p.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)p.onload=()=>{w();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=p.contentDocument||p.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 p.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 P=!1;const I=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(!P){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+=p(),null!=i)return Ze.fireRequest(t),void u(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),P=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,C(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!==L){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=R,i.evtData={[L]: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 S;const _=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?S:t,se.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];se.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 p=i.display.onClick;let u,f="";if(""!==p&&null!=p&&(f="cursor:pointer;"),1===i.msgContent.type)u=i.msgContent.html,u=u.replace(/##campaignId##/g,o),u=u.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='<style type="text/css">body{margin:0;padding:0;}#contentDiv.wzrk{overflow:hidden;padding:0 0 20px 0;text-align:center;'+f+"}#contentDiv.wzrk td{padding:15px 10px;}.wzrkPPtitle{font-weight: bold;font-size: 24px;font-family:arial;word-break: break-word;padding-top:20px;}.wzrkPPdscr{font-size: 14px;font-family:arial;line-height:16px;word-break: break-word;display:inline-block;padding:20px 20px 0 20px;line-height:20px;}.PL15{padding-left:15px;}.wzrkPPwarp{margin:20px 20px 0 5px;padding:0px;border-radius: "+d+"px;box-shadow: 1px 1px 5px #888888;}a.wzrkClose{cursor:pointer;position: absolute;top: 11px;right: 11px;z-index: 2147483647;font-size:19px;font-family:arial;font-weight:bold;text-decoration: none;width: 25px;/*height: 25px;*/text-align: center; -webkit-appearance: none; line-height: 25px;background: #353535;border: #fff 2px solid;border-radius: 100%;box-shadow: #777 2px 2px 2px;color:#fff;}a:hover.wzrkClose{background-color:#d1914a !important;color:#fff !important; -webkit-appearance: none;}#contentDiv .button{padding-top:20px;}#contentDiv .button a{font-size: 14px;font-weight:bold;font-family:arial;text-align:center;display:inline-block;text-decoration:none;padding:0 30px;height:40px;line-height:40px;background:#ea693b;color:#fff;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;}</style>";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="<div class='button'><a href='#'>"+i.msgContent.ctaText+"</a></div>");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="<div style='padding-top:20px;'><img src='"+i.msgContent.imageUrl+"' width='500' alt="+a+" /></div>");u=e+("<div class='wzrkPPwarp' style='color:"+n+";background-color:"+t+";'><a href='javascript:void(0);' onclick="+("parent.$WZRK_WR.closeIframe("+o+",'intentPreview');")+" class='wzrkClose' style='background-color:"+s+";color:"+r+"'>×</a><div id='contentDiv' class='wzrk'><div class='wzrkPPtitle' style='color:"+n+"'>"+a+"</div>")+("<div class='wzrkPPdscr' style='color:"+n+"'>"+l+"</div>"+h+c+"</div></div>")}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(u),i.display["custom-editor"]&&k(i,v),v.close();const m=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(p,i,m,0,n)};if(!document.body)return void(d<6&&(d++,setTimeout(Kt,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?b(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i<e.inapp_notifs.length;i++){const o=e.inapp_notifs[i];if(null==o.display.wtarget_type||0===o.display.wtarget_type)I(o);else if(1===o.display.wtarget_type)S=o,window.document.body.onmouseleave=_;else if(2===o.display.wtarget_type)if(2===o.msgContent.type||3===o.msgContent.type){null!==(o.display.divId?document.getElementById(o.display.divId):document.querySelector(o.display.divSelector))?2===o.msgContent.type?b(o):m(o):t[o.wzrk_id.split("_")[0]]=o}else I(o)}Object.keys(t).length&&("complete"===document.readyState?O(t):(e=>{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)Tt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i<e.inbox_notifs.length;i++)!1!==h(e.inbox_notifs[i])&&t.push(e.inbox_notifs[i]);Tt(t)}};(e.webInboxSetting||null!=e.inbox_notifs)&&(Wt()&&Nt(),null===se.inbox?(e.webInboxSetting&&function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=ne.readFromLSorCookie(F)||{};t?(se.inbox.inboxConfigForPreview=e,se.inbox.isPreview=!0,se.inbox&&se.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ne.saveToLSorCookie(F,e),se.inbox&&se.inbox.init())}(e.webInboxSetting),jt(c).then((()=>{E()})).catch((e=>{}))):E());const A=(e,t)=>{const i=$e(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ne.read(y))){const o=JSON.parse(decodeURIComponent(ne.read(y))),n=JSON.parse(decodeURIComponent(ne.read(v)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ne.save(y,encodeURIComponent(JSON.stringify(o))))}Ye(i)};if(ne._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=ee();ne.setMetaProp("lsTime",n),ne.setMetaProp("exTs",o),(e=>{if(null!=se.globalEventsMap||(se.globalEventsMap=ne.readFromLSorCookie(w),null!=se.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=se.globalEventsMap[t],o=e[t];null!=se.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(se.globalEventsMap[t]=o):se.globalEventsMap[t]=o}}else se.globalEventsMap=e})(t),ne.saveToLSorCookie(w,se.globalEventsMap),null==se.globalProfileMap?ot(i,!0):ot(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(ne._isLocalStorageSupported())try{let i=ne.readFromLSorCookie(x);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ne.saveToLSorCookie(x,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 Gt=t("isPersonalisationActive");class Ht{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Gt,{writable:!0,value:void 0}),i(this,Gt)[Gt]=t}getTotalVisits(){if(!i(this,Gt)[Gt]())return;let e=ne.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Gt)[Gt]())return;const e=ne.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const Jt=1,Zt=2,$t=3;var Yt=t("logLevel"),Qt=t("log"),Xt=t("isLegacyDebug");class ei{constructor(e){Object.defineProperty(this,Xt,{get:ii,set:void 0}),Object.defineProperty(this,Qt,{value:ti}),Object.defineProperty(this,Yt,{writable:!0,value:void 0}),this.wzrkError={},i(this,Yt)[Yt]=null==e?e:Zt,this.wzrkError={}}get logLevel(){return i(this,Yt)[Yt]}set logLevel(e){i(this,Yt)[Yt]=e}error(e){i(this,Yt)[Yt]>=Jt&&i(this,Qt)[Qt]("error",e)}info(e){i(this,Yt)[Yt]>=Zt&&i(this,Qt)[Qt]("log",e)}debug(e){(i(this,Yt)[Yt]>=$t||i(this,Xt)[Xt])&&i(this,Qt)[Qt]("debug",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(me," ").concat(e,": ").concat(t))}}var ti=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ii=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},oi=t("logger"),ni=t("sessionId"),si=t("isPersonalisationActive");class ri{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,oi,{writable:!0,value:void 0}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),Object.defineProperty(this,si,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ne.getMetaProp("cs"),i(this,oi)[oi]=t,i(this,si)[si]=o}get sessionId(){return i(this,ni)[ni]}set sessionId(e){i(this,ni)[ni]=e}getSessionCookieObject(){let e=ne.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),K(t)){if(void 0!==t.t){const e=t.t;ee()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ne.createBroadCookie(this.cookieName,t,1200,Fe())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ne.getMetaProp("cs");if(void 0===t)ne.setMetaProp("ps",e),ne.setMetaProp("cs",e),ne.setMetaProp("sc",1);else if(t!==e){ne.setMetaProp("ps",t),ne.setMetaProp("cs",e);let i=ne.getMetaProp("sc");void 0===i&&(i=0),ne.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,si)[si]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=ee();return Math.floor(t-e)}}getPageCount(){if(i(this,si)[si]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let ai=0,li=0;var ci=t("logger"),di=t("account"),hi=t("device"),pi=t("session"),ui=t("isPersonalisationActive"),gi=t("clearCookie"),fi=t("addToLocalEventMap");class vi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,fi,{value:bi}),Object.defineProperty(this,ci,{writable:!0,value:void 0}),Object.defineProperty(this,di,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,pi,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),Object.defineProperty(this,gi,{writable:!0,value:!1}),this.processingBackup=!1,i(this,ci)[ci]=t,i(this,di)[di]=o,i(this,hi)[hi]=n,i(this,pi)[pi]=s,i(this,ui)[ui]=r,Ze.logger=t,Ze.device=n}processBackupEvents(){const e=ne.readFromLSorCookie(P);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,ci)[ci].debug("Processing backup event : "+o.q),void 0!==o.q&&Ze.fireRequest(o.q),o.fired=!0)}ne.saveToLSorCookie(P,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=Y(e,i(this,ci)[ci])),H(i(this,ci)[ci].wzrkError)||(e.wzrk_error=i(this,ci)[ci].wzrkError,i(this,ci)[ci].wzrkError={}),e.id=i(this,di)[di].id,$(i(this,hi)[hi].gcookie)&&(e.g=i(this,hi)[hi].gcookie);const o=i(this,pi)[pi].getSessionCookieObject();return e.s=o.s,e.pg=void 0===o.p?1:o.p,sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addSystemDataToProfileObject(e,t){H(i(this,ci)[ci].wzrkError)||(e.wzrk_error=i(this,ci)[ci].wzrkError,i(this,ci)[ci].wzrkError={}),e.id=i(this,di)[di].id,$(i(this,hi)[hi].gcookie)&&(e.g=i(this,hi)[hi].gcookie);const o=i(this,pi)[pi].getSessionCookieObject();return e.s=o.s,e.pg=void 0===o.p?1:o.p,sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,gi)[gi]=ne.getAndClearMetaProp(u),void 0!==i(this,gi)[gi]&&i(this,gi)[gi]&&(e.rc=!0,i(this,ci)[ci].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,ui)[ui]()){const t=ne.getMetaProp("lsTime"),i=ne.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i<ee()&&(e.dsync=!0)}}saveAndFireRequest(e,t,o){const n=ee(),s=(e=Ue(e,"rn",++se.globalCache.REQ_N))+"&i="+n+"&sn="+ai;ne.backupEvent(s,se.globalCache.REQ_N,i(this,ci)[ci]),se.offline||(t&&(void 0===i(this,gi)[gi]||!i(this,gi)[gi])||window.isOULInProgress?i(this,ci)[ci].debug("Not fired due to override - ".concat(se.blockRequest," or clearCookie - ").concat(i(this,gi)[gi]," or OUL request in progress - ").concat(window.isOULInProgress)):(n===li?ai++:(li=n,ai=0),window.oulReqN=se.globalCache.REQ_N,Ze.fireRequest(s,!1,o)))}unregisterTokenForGuid(e){const t=ne.readFromLSorCookie(D);if(t){const t={type:"data"};$(e)&&(t.g=e),t.action="unregister",t.id=i(this,di)[di].id;const o=i(this,pi)[pi].getSessionCookieObject();t.s=o.s;const n=We(JSON.stringify(t),i(this,ci)[ci]);let s=i(this,di)[di].dataPostURL;s=Ue(s,"type","data"),s=Ue(s,"d",n),Ze.fireRequest(s,!0),ne.saveToLSorCookie(z,!1)}this.registerToken(t)}registerToken(e){if(!e)return;e=this.addSystemDataToObject(e,!0),e=JSON.stringify(e);let t=i(this,di)[di].dataPostURL;t=Ue(t,"type","data"),t=Ue(t,"d",We(e,i(this,ci)[ci])),Ze.fireRequest(t),ne.save("WZRK_WPR","ok")}processEvent(e){i(this,fi)[fi](e.evtName),e=this.addSystemDataToObject(e,void 0),this.addFlags(e),e.WZRK_CAMP=Xe();const t=We(JSON.stringify(e),i(this,ci)[ci]);let o=i(this,di)[di].dataPostURL;o=Ue(o,"type",E),o=Ue(o,"d",t),this.saveAndFireRequest(o,se.blockRequest)}}var bi=function(e){if(ne._isLocalStorageSupported()){void 0===se.globalEventsMap&&(se.globalEventsMap=ne.readFromLSorCookie(w),void 0===se.globalEventsMap&&(se.globalEventsMap={}));const t=ee();let i=se.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),se.globalEventsMap[e]=i,ne.saveToLSorCookie(w,se.globalEventsMap)}},mi=t("request"),yi=t("account"),wi=t("oldValues"),Ci=t("logger"),ki=t("processPrivacyArray");class xi extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,ki,{value:Pi}),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}),i(this,Ci)[Ci]=s,i(this,mi)[mi]=o,i(this,yi)[yi]=n,i(this,wi)[wi]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return se.isPrivacyArrPushed?i(this,ki)[ki](se.privacyArray.length>0?se.privacyArray:t):se.privacyArray.push(...t),0}_processOldValues(){i(this,wi)[wi]&&i(this,ki)[ki](i(this,wi)[wi]),i(this,wi)[wi]=null}}var Pi=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(S)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,se.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ne.setMetaProp(_,t)}if(!H(s)){n.type="profile",n.profile=s,n=i(this,mi)[mi].addSystemDataToObject(n,void 0);const o=We(JSON.stringify(n),i(this,Ci)[Ci]);let r=i(this,yi)[yi].dataPostURL;r=Ue(r,"type",E),r=Ue(r,"d",o),r=Ue(r,S,t?"true":"false"),i(this,mi)[mi].saveAndFireRequest(r,se.blockRequest),e.splice(0,e.length)}}},Ii=t("oldValues"),Si=t("logger"),_i=t("request"),Oi=t("account"),Ei=t("wizAlertJSPath"),Ai=t("fcmPublicKey"),Mi=t("setUpWebPush"),Li=t("setUpWebPushNotifications"),Ti=t("setApplicationServerKey"),Ri=t("setUpSafariNotifications"),zi=t("setUpChromeFirefoxNotifications"),Di=t("addWizAlertJS"),Bi=t("removeWizAlertJS"),ji=t("handleNotificationRegistration");class Ni extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,ji,{value:Hi}),Object.defineProperty(this,Bi,{value:Gi}),Object.defineProperty(this,Di,{value:Ki}),Object.defineProperty(this,zi,{value:Vi}),Object.defineProperty(this,Ri,{value:qi}),Object.defineProperty(this,Ti,{value:Wi}),Object.defineProperty(this,Li,{value:Fi}),Object.defineProperty(this,Mi,{value:Ui}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,Ei,{writable:!0,value:void 0}),Object.defineProperty(this,Ai,{writable:!0,value:void 0}),i(this,Ei)[Ei]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,Ai)[Ai]=null,i(this,Ii)[Ii]=t,i(this,Si)[Si]=o,i(this,_i)[_i]=s,i(this,Oi)[Oi]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,Mi)[Mi](t),0}_processOldValues(){i(this,Ii)[Ii]&&i(this,Mi)[Mi](i(this,Ii)[Ii]),i(this,Ii)[Ii]=null}_enableWebPush(e,t){se.webPushEnabled=e,null!=t&&i(this,Ti)[Ti](t),se.webPushEnabled&&se.notifApi.notifEnabledFromApi?i(this,ji)[ji](se.notifApi.displayArgs):!se.webPushEnabled&&se.notifApi.notifEnabledFromApi&&i(this,Si)[Si].error("Ensure that web push notifications are fully enabled and integrated before requesting them")}}var Ui=function(e){se.webPushEnabled&&e.length>0?i(this,ji)[ji](e):null==se.webPushEnabled&&e.length>0?(se.notifApi.notifEnabledFromApi=!0,se.notifApi.displayArgs=e.slice()):!1===se.webPushEnabled&&e.length>0&&i(this,Si)[Si].error("Make sure push notifications are fully enabled and integrated")},Fi=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,zi)[zi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ri)[Ri](e,o,n)},Wi=function(e){i(this,Ai)[Ai]=e},qi=function(e,t,o){void 0===t&&i(this,Si)[Si].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,Si)[Si].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",ne.saveToLSorCookie(D,t),i(this,_i)[_i].registerToken(t),i(this,Si)[Si].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,Si)[Si].info("Error subscribing to Safari web push")}))},Vi=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,Ai)[Ai]&&(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.length;e++)o.push(i.charCodeAt(e));return new Uint8Array(o)})(i(this,Ai)[Ai])),t.pushManager.subscribe(n).then((t=>{i(this,Si)[Si].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"),ne.saveToLSorCookie(D,o),i(this,_i)[_i].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,Si)[Si].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,Si)[Si].info("Unsubscription successful")})).catch((e=>{i(this,Si)[Si].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,Si)[Si].error("error registering service worker: "+e)}))},Ki=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Ei)[Ei]),document.getElementsByTagName("body")[0].appendChild(e),e},Gi=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},Hi=function(e){let t,o,n,s,r,a,l,c,d,h,p,u,g,f,v;if(1===e.length){if(K(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,p=i.serviceWorkerPath,u=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==p&&(p="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=u&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,Si)[Si].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,Li)[Li](h,p,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Li)[Li](h,p,f,v)}if(!(t&&o&&n&&s))return void i(this,Si)[Si].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==ne.getMetaProp("notif_last_time"))ne.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ne.getMetaProp("notif_last_time")<l)return;ne.setMetaProp("notif_last_time",m)}if(b){const e=document.createElement("iframe");e.setAttribute("style","display:none;"),e.setAttribute("src",g),document.body.appendChild(e),window.addEventListener("message",(e=>{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,Di)[Di]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(u)):"function"==typeof d&&d(),i(this,Bi)[Bi]()}))})}}),!1)}else i(this,Di)[Di]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Li)[Li](h,p,f,v)):"function"==typeof d&&d(),i(this,Bi)[Bi]()}))}},Ji=t("logger"),Zi=t("api"),$i=t("onloadcalled"),Yi=t("device"),Qi=t("session"),Xi=t("account"),eo=t("request"),to=t("isSpa"),io=t("previousUrl"),oo=t("boundCheckPageChanged"),no=t("dismissSpamControl"),so=t("processOldValues"),ro=t("checkPageChanged"),ao=t("pingRequest"),lo=t("isPingContinuous"),co=t("overrideDSyncFlag");var ho=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},po=function(){this.debounce((()=>{i(this,io)[io]!==location.href&&this.pageChanged()}),300)()},uo=function(){let e=i(this,Xi)[Xi].dataPostURL,t={};t=i(this,eo)[eo].addSystemDataToObject(t,void 0),e=Ue(e,"type","ping"),e=Ue(e,"d",We(JSON.stringify(t),i(this,Ji)[Ji])),i(this,eo)[eo].saveAndFireRequest(e,se.blockRequest)},go=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},fo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const vo=new class{get spa(){return i(this,to)[to]}set spa(e){const t=!0===e;i(this,to)[to]!==t&&1===i(this,$i)[$i]&&(t?document.addEventListener("click",i(this,oo)[oo]):document.removeEventListener("click",i(this,oo)[oo])),i(this,to)[to]=t}get dismissSpamControl(){return i(this,no)[no]}set dismissSpamControl(e){const t=!0===e;i(this,no)[no]=t,se.dismissSpamControl=t}constructor(){var e,t,o,n;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,co,{value:fo}),Object.defineProperty(this,lo,{value:go}),Object.defineProperty(this,ao,{value:uo}),Object.defineProperty(this,ro,{value:po}),Object.defineProperty(this,so,{value:ho}),Object.defineProperty(this,Ji,{writable:!0,value:void 0}),Object.defineProperty(this,Zi,{writable:!0,value:void 0}),Object.defineProperty(this,$i,{writable:!0,value:void 0}),Object.defineProperty(this,Yi,{writable:!0,value:void 0}),Object.defineProperty(this,Qi,{writable:!0,value:void 0}),Object.defineProperty(this,Xi,{writable:!0,value:void 0}),Object.defineProperty(this,eo,{writable:!0,value:void 0}),Object.defineProperty(this,to,{writable:!0,value:void 0}),Object.defineProperty(this,io,{writable:!0,value:void 0}),Object.defineProperty(this,oo,{writable:!0,value:i(this,ro)[ro].bind(this)}),Object.defineProperty(this,no,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,$i)[$i]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,Ji)[Ji]=new ei(Zt),i(this,Xi)[Xi]=new c(null===(e=s.account)||void 0===e?void 0:e[0],s.region||(null===(t=s.account)||void 0===t?void 0:t[1]),s.targetDomain||(null===(o=s.account)||void 0===o?void 0:o[2])),i(this,Yi)[Yi]=new ve({logger:i(this,Ji)[Ji]}),i(this,no)[no]=s.dismissSpamControl||!1,i(this,Qi)[Qi]=new ri({logger:i(this,Ji)[Ji],isPersonalisationActive:this._isPersonalisationActive}),i(this,eo)[eo]=new vi({logger:i(this,Ji)[Ji],account:i(this,Xi)[Xi],device:i(this,Yi)[Yi],session:i(this,Qi)[Qi],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=s.enablePersonalization||!1,this.event=new Be({logger:i(this,Ji)[Ji],request:i(this,eo)[eo],isPersonalisationActive:this._isPersonalisationActive},s.event),this.profile=new ht({logger:i(this,Ji)[Ji],request:i(this,eo)[eo],account:i(this,Xi)[Xi],isPersonalisationActive:this._isPersonalisationActive},s.profile),this.onUserLogin=new xt({request:i(this,eo)[eo],account:i(this,Xi)[Xi],session:i(this,Qi)[Qi],logger:i(this,Ji)[Ji],device:i(this,Yi)[Yi]},s.onUserLogin),this.privacy=new xi({request:i(this,eo)[eo],account:i(this,Xi)[Xi],logger:i(this,Ji)[Ji]},s.privacy),this.notifications=new Ni({logger:i(this,Ji)[Ji],request:i(this,eo)[eo],account:i(this,Xi)[Xi]},s.notifications),i(this,Zi)[Zi]=new ge({logger:i(this,Ji)[Ji],request:i(this,eo)[eo],device:i(this,Yi)[Yi],session:i(this,Qi)[Qi]}),this.spa=s.spa,this.dismissSpamControl=s.dismissSpamControl,this.user=new Ht({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Qi)[Qi].getTimeElapsed(),getPageCount:()=>i(this,Qi)[Qi].getPageCount()},this.logout=()=>{i(this,Ji)[Ji].debug("logout called"),ne.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,Yi)[Yi].getGuid(),this.getAccountID=()=>i(this,Xi)[Xi].id,this.getSCDomain=()=>i(this,Xi)[Xi].finalTargetDomain,this.setLibrary=(e,t)=>{se.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,Xi)[Xi].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,Xi)[Xi].scSDKVersion};let o=i(this,Xi)[Xi].dataPostURL;o=Ue(o,"type","page"),o=Ue(o,"d",We(JSON.stringify(t),i(this,Ji)[Ji])),i(this,eo)[eo].saveAndFireRequest(o,se.blockRequest)},Wt()&&(Nt(),jt(i(this,Ji)[Ji])),this.getInboxMessageCount=()=>{const e=Dt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(se.inbox)return se.inbox.unviewedCounter;i(this,Ji)[Ji].debug("No unread messages")},this.getAllInboxMessages=()=>Dt(),this.getUnreadInboxMessages=()=>{if(se.inbox)return se.inbox.unviewedMessages;i(this,Ji)[Ji].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Dt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,Ji)[Ji].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Dt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,Ji)[Ji].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(se.inbox.unviewedCounter--,delete se.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=se.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=se.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Bt(t)}},this.markReadInboxMessage=e=>{const t=se.inbox.unviewedMessages,o=Dt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,Ji)[Ji].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}),se.inbox.unviewedCounter--,delete se.inbox.unviewedMessages[e],Bt(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t<e.length;t++)this.markReadInboxMessage(e[t])},this.markReadAllInboxMessage=()=>{const e=se.inbox.unviewedMessages,t=Dt();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",Bt(t),se.inbox.unviewedCounter=0,se.inbox.unviewedMessages={}}else i(this,Ji)[Ji].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=se.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{r(T,e)},this.renderNotificationClicked=e=>{r(R,e)};const r=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[L]: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,eo)[eo].processEvent(o)};this.setLogLevel=e=>{i(this,Ji)[Ji].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,j):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,j):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,N):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,N):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,U)};const a=(e,t,o)=>{((e,t,i,o,n)=>{const s=Ne(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=se.unsubGroups,se.updatedCategoryLong&&(s.cUsY=se.updatedCategoryLong);let c=o.emailURL;i&&(c=Ue(c,"fetchGroups",i)),t&&(c=Ue(c,"encoded",t)),c=Ue(c,"e",r),c=Ue(c,"d",We(JSON.stringify(s),n)),a&&(c=Ue(c,"p",a)),"-1"!==e&&(c=Ue(c,"sub",e)),l&&(se.globalUnsubscribe=l===I,c=Ue(c,"page_type",l)),Ze.fireRequest(c)}})(e,t,o,i(this,Xi)[Xi],i(this,Ji)[Ji])};function l(e){var t=e.coords.latitude,i=e.coords.longitude;se.location={Latitude:t,Longitude:i},this.sendLocationData({Latitude:t,Longitude:i})}function d(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");se.location={Latitude:e,Longitude:t},this.sendLocationData({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(l.bind(this),d):console.log("Geolocation is not supported by this browser.")};const h=i(this,Zi)[Zi];h.logout=this.logout,h.clear=this.clear,h.closeIframe=(e,t)=>{nt(e,0,i(this,Qi)[Qi].sessionId)},h.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},h.tr=e=>{Kt(e,{device:i(this,Yi)[Yi],session:i(this,Qi)[Qi],request:i(this,eo)[eo],logger:i(this,Ji)[Ji]})},h.setEnum=e=>{((e,t)=>{if(V(e)||Z(e))return"$E_"+e;t.error(_e)})(e,i(this,Ji)[Ji])},h.is_onloadcalled=()=>1===i(this,$i)[$i],h.subEmail=e=>{a("1",e)},h.getEmail=(e,t)=>{a("-1",e,t)},h.unSubEmail=e=>{a("0",e)},h.unsubEmailGroups=e=>{se.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e<t.length;e++){const i=t[e];if(i.name){const e={name:i.name,isUnsubscribed:i.checked};se.unsubGroups.push(e)}}a("2",e)},h.setSubscriptionGroups=e=>{se.unsubGroups=e},h.getSubscriptionGroups=()=>se.unsubGroups,h.changeSubscriptionGroups=(e,t)=>{h.setSubscriptionGroups(t),a("2",e)},h.isGlobalUnsubscribe=()=>se.globalUnsubscribe,h.setIsGlobalUnsubscribe=e=>{se.globalUnsubscribe=e},h.setUpdatedCategoryLong=e=>{e.cUsY&&(se.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=h,(null===(n=s.account)||void 0===n?void 0:n[0].id)&&this.init()}init(e,t,o){if(1===i(this,$i)[$i])return;if(ne.removeCookie("WZRK_P",window.location.hostname),!i(this,Xi)[Xi].id){if(!e)return void i(this,Ji)[Ji].error(ye);i(this,Xi)[Xi].id=e}i(this,Qi)[Qi].cookieName="WZRK_S_"+i(this,Xi)[Xi].id,t&&(i(this,Xi)[Xi].region=t),o&&(i(this,Xi)[Xi].targetDomain=o);const n=location.href,s=Ne(n.toLowerCase());if(void 0!==s.e&&"0"==s.wzrk_ex)return;se.isPrivacyArrPushed=!0,se.privacyArray.length>0&&this.privacy.push(se.privacyArray),i(this,so)[so](),this.pageChanged();const r=setInterval((()=>{i(this,Yi)[Yi].gcookie&&(clearInterval(r),i(this,eo)[eo].processBackupEvents())}),3e3);i(this,to)[to]?document.addEventListener("click",i(this,oo)[oo]):document.removeEventListener("click",i(this,oo)[oo]),i(this,$i)[$i]=1}debounce(e,t){let i;return function(){clearTimeout(i),i=setTimeout(e,t)}}pageChanged(){const e=window.location.href,t=Ne(e.toLowerCase()),o=i(this,Qi)[Qi].getSessionCookieObject();let n=void 0===o.p?0:o.p;o.p=++n,i(this,Qi)[Qi].setSessionCookieObject(o);let s={},r=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==r){const e=120;""!==r&&(r=r.length>e?r.substring(0,e):r,s.referrer=r);let i=t.utm_source||t.wzrk_source;void 0!==i&&(i=i.length>e?i.substring(0,e):i,s.us=i);let o=t.utm_medium||t.wzrk_medium;void 0!==o&&(o=o.length>e?o.substring(0,e):o,s.um=o);let n=t.utm_campaign||t.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,s.uc=n),void 0!==t.wzrk_medium){const e=t.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(s.wm=e)}}s=i(this,eo)[eo].addSystemDataToObject(s,void 0),s.cpg=e,s.WZRK_CAMP=Xe();let a=i(this,Xi)[Xi].dataPostURL;i(this,eo)[eo].addFlags(s),1===parseInt(s.pg)&&i(this,co)[co](s);let l=document.location.protocol;l=l.replace(":",""),s.af={lib:"web-sdk-v1.6.10",protocol:l,...se.flutterVersion},a=Ue(a,"type","page"),a=Ue(a,"d",We(JSON.stringify(s),i(this,Ji)[Ji])),i(this,eo)[eo].saveAndFireRequest(a,se.blockRequest),i(this,io)[io]=e,setTimeout((()=>{n<=3&&i(this,ao)[ao](),i(this,lo)[lo]()&&setInterval((()=>{i(this,ao)[ao]()}),3e5)}),12e4)}_isPersonalisationActive(){return ne._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]}))}se.location&&(t.af={...t.af,...se.location}),t=i(this,eo)[eo].addSystemDataToProfileObject(t,void 0),i(this,eo)[eo].addFlags(t);const n=We(JSON.stringify(t),i(this,Ji)[Ji]);let s=i(this,Xi)[Xi].dataPostURL;s=Ue(s,"type",E),s=Ue(s,"d",n),i(this,eo)[eo].saveAndFireRequest(s,se.blockRequest)}setOffline(e){"boolean"==typeof e?(se.offline=e,e||i(this,eo)[eo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}}(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=function(e){var t,i=Object.prototype,o=i.hasOwnProperty,n=Object.defineProperty||function(e,t,i){e[t]=i.value},r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,i){return e[t]=i}}function d(e,t,i,o){var r=t&&t.prototype instanceof v?t:v,s=Object.create(r.prototype),a=new E(o||[]);return n(s,"_invoke",{value:S(e,i,a)}),s}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var u="suspendedStart",p="executing",g="completed",f={};function v(){}function b(){}function m(){}var y={};c(y,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(A([])));C&&C!==i&&o.call(C,s)&&(y=C);var k=m.prototype=v.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function i(n,r,s,a){var l=h(e[n],e,r);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,s,a)}),(function(e){i("throw",e,s,a)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,a)}))}a(l.arg)}var r;n(this,"_invoke",{value:function(e,o){function n(){return new t((function(t,n){i(e,o,t,n)}))}return r=r?r.then(n,n):n()}})}function S(e,i,o){var n=u;return function(r,s){if(n===p)throw new Error("Generator is already running");if(n===g){if("throw"===r)throw s;return{value:t,done:!0}}for(o.method=r,o.arg=s;;){var a=o.delegate;if(a){var l=I(a,o);if(l){if(l===f)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===u)throw n=g,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=p;var c=h(e,i,o);if("normal"===c.type){if(n=o.done?g:"suspendedYield",c.arg===f)continue;return{value:c.arg,done:o.done}}"throw"===c.type&&(n=g,o.method="throw",o.arg=c.arg)}}}function I(e,i){var o=i.method,n=e.iterator[o];if(n===t)return i.delegate=null,"throw"===o&&e.iterator.return&&(i.method="return",i.arg=t,I(e,i),"throw"===i.method)||"return"!==o&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+o+"' method")),f;var r=h(n,e.iterator,i.arg);if("throw"===r.type)return i.method="throw",i.arg=r.arg,i.delegate=null,f;var s=r.arg;return s?s.done?(i[e.resultName]=s.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,f):s:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function A(e){if(null!=e){var i=e[s];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function i(){for(;++n<e.length;)if(o.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return r.next=r}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=m,n(k,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:b,configurable:!0}),b.displayName=c(m,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},x(P.prototype),c(P.prototype,a,(function(){return this})),e.AsyncIterator=P,e.async=function(t,i,o,n,r){void 0===r&&(r=Promise);var s=new P(d(t,i,o,n),r);return e.isGeneratorFunction(i)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},x(k),c(k,l,"Generator"),c(k,s,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),i=[];for(var o in t)i.push(o);return i.reverse(),function e(){for(;i.length;){var o=i.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},e.values=A,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var i in this)"t"===i.charAt(0)&&o.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(o,n){return a.type="throw",a.arg=e,i.next=o,n&&(i.method="next",i.arg=t),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var s=r?r.completion:{};return s.type=e,s.arg=t,r?(this.method="next",this.next=r.finallyLoc,f):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),_(i),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var o=i.completion;if("throw"===o.type){var n=o.arg;_(i)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,o){return this.delegate={iterator:A(e),resultName:i,nextLoc:o},"next"===this.method&&(this.arg=t),f}},e}("object"==typeof module?module.exports:{});try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}var t=0;function i(e){return"__private_"+t+++"_"+e}function o(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const n="clevertap-prod.com",r="https:";var s=i("accountId"),a=i("region"),l=i("targetDomain"),c=i("dcSdkversion"),d=i("token");class h{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]:n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:""}),Object.defineProperty(this,l,{writable:!0,value:n}),Object.defineProperty(this,c,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),o&&(this.token=o)}get id(){return o(this,s)[s]}set id(e){o(this,s)[s]=e}get region(){return o(this,a)[a]}set region(e){o(this,a)[a]=e}get dcSDKVersion(){return o(this,c)[c]}set dcSDKVersion(e){o(this,c)[c]=e}get targetDomain(){return o(this,l)[l]}set targetDomain(e){o(this,l)[l]=e}get token(){return o(this,d)[d]}set token(e){o(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===n?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(r,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(r,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(r,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(r,"//").concat(this.finalTargetDomain,"/e?r=1")}}const u=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),p=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),g=new RegExp("'","g"),f="clear",v="Charged ID",b="WZRK_CHARGED_ID",m="WZRK_G",y="WZRK_K",w="WZRK_CAMP",C="WZRK_CAMP_G",k="WZRK_EV",x="WZRK_META",P="WZRK_PR",S="WZRK_ARP",I="WZRK_L",O="global",_="optOut",E="useIP",A="WZRK_X",L="push",M=31536e3,T="wzrk_",R="wzrk_id",j="Notification Viewed",D="Notification Clicked",z="WZRK_FPU",B="WZRK_PSD",N="$incr",F="$add",U="$remove",V="$delete",q="WZRK_INBOX_CONFIG",W="WZRK_INBOX",K=1e3,G=["Stayed","UTM Visited","App Launched","Notification Sent",j,D],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,p),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,u),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),re=e=>{if(se(e))return"$D_"+e},se=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],r=new Date(n,o,i);return r.getDate()==i&&r.getMonth()==o&&r.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="",r="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(r="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+r+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e<i.length;e++){let o=i[e];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return null}static _isLocalStorageSupported(){return"localStorage"in window&&null!==window.localStorage&&"function"==typeof window.localStorage.setItem}static saveToLSorCookie(e,t){if(null!=t)try{this._isLocalStorageSupported()?this.save(e,encodeURIComponent(JSON.stringify(t))):e===m?this.createCookie(e,encodeURIComponent(t),0,window.location.hostname):this.createCookie(e,encodeURIComponent(JSON.stringify(t)),0,window.location.hostname),le.globalCache[e]=t}catch(e){}}static readFromLSorCookie(e){let t;if(le.globalCache.hasOwnProperty(e))return le.globalCache[e];if(t=this._isLocalStorageSupported()?this.read(e):this.readCookie(e),null!=t&&("function"!=typeof t.trim||""!==t.trim())){let i;try{i=JSON.parse(decodeURIComponent(t))}catch(e){i=decodeURIComponent(t)}return le.globalCache[e]=i,i}}static createBroadCookie(e,t,i,o){if(o){let r=le.broadDomain;if(null==r){const s=o.split(".");let a="";for(let o=s.length-1;o>=0;o--){if(a=0===o?s[o]+a:"."+s[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){r=a,le.broadDomain=r;break}}}else this.createCookie(e,t,i,r)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(x);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(x);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(x,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(y);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(y,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 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=i("keyOrder"),de=i("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(A);if(t){const e={};o(this,ce)[ce]=[],t=t.cache;for(const i in t)t.hasOwnProperty(i)&&(e[t[i][0]]=t[i][1],o(this,ce)[ce].push(t[i][0]));this.cache=e}else this.cache={},o(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=o(this,de)[de](e,this.cache),this.cache[e]=t,o(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const i=this.cache[e],n=o(this,ce)[ce];null!=i?this.cache=o(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=o(this,de)[de](n[0],this.cache)),this.cache[e]=t,o(this,ce)[ce][o(this,ce)[ce]-1]!==e&&o(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],i=o(this,ce)[ce];for(const o in i)if(i.hasOwnProperty(o)){const n=[];n.push(i[o]),n.push(e[i[o]]),t.push(n)}ae.saveToLSorCookie(A,{cache:t})}getKey(e){if(null===e)return null;const t=o(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=o(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=o(this,ce)[ce].length;if(e)return o(this,ce)[ce][e-1]}}var ue=function(e,t){const i=JSON.parse(JSON.stringify(o(this,ce)[ce])),n={};let r;for(const o in i)i.hasOwnProperty(o)&&(i[o]!==e?n[i[o]]=t[i[o]]:r=o);return i.splice(r,1),o(this,ce)[ce]=JSON.parse(JSON.stringify(i)),n},pe=i("logger"),ge=i("request"),fe=i("device"),ve=i("session");class be{constructor(e){let{logger:t,request:i,device:n,session:r}=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}),o(this,pe)[pe]=t,o(this,ge)[ge]=i,o(this,fe)[fe]=n,o(this,ve)[ve]=r}s(e,t,i,n,r){let s=!1,a=!1;if(window.isOULInProgress&&(i||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,s=!0),void 0===n&&(n=0),ae.removeBackup(n,o(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(o(this,fe)[fe].gcookie)||e&&(a=!0),!X(o(this,fe)[fe].gcookie)||i||"boolean"==typeof r){const n=o(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t<n.s)return;if(o(this,pe)[pe].debug("Cookie was ".concat(o(this,fe)[fe].gcookie," set to ").concat(e)),o(this,fe)[fe].gcookie=e,X(o(this,fe)[fe].gcookie)||ae.getAndClearMetaProp(E),e&&ae._isLocalStorageSupported()){null==le.LRU_CACHE&&(le.LRU_CACHE=new he(100));const t=ae.readFromLSorCookie(y);let n;null!=t&&t.id&&(n=le.LRU_CACHE.cache[t.id],i&&(n||(ae.saveToLSorCookie(z,!0),le.LRU_CACHE.set(t.id,e)))),ae.saveToLSorCookie(m,e);const r=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(z)&&-1!==r){const e=le.LRU_CACHE.cache[r];o(this,ge)[ge].unregisterTokenForGuid(e)}}ae.createBroadCookie(m,e,M,window.location.hostname),ae.saveToLSorCookie(m,e)}ae._isLocalStorageSupported()&&o(this,ve)[ve].manageSession(t);const l=o(this,ve)[ve].getSessionCookieObject();(void 0===l.s||l.s<=t)&&(l.s=t,l.t=oe(),o(this,ve)[ve].setSessionCookieObject(l)),X(o(this,fe)[fe].gcookie)&&(le.blockRequest=!1),!s&&!a||o(this,ge)[ge].processingBackup||o(this,ge)[ge].processBackupEvents(),le.globalCache.RESP_N=n}}var me=i("logger");class ye{constructor(e){let{logger:t}=e;Object.defineProperty(this,me,{writable:!0,value:void 0}),this.gcookie=void 0,o(this,me)[me]=t,this.gcookie=this.getGuid()}getGuid(){let e=null;if(X(this.gcookie))return this.gcookie;if(ae._isLocalStorageSupported()){const t=ae.read(m);if(X(t)){try{e=JSON.parse(decodeURIComponent(t))}catch(i){o(this,me)[me].debug("Cannot parse Gcookie from localstorage - must be encoded "+t),32===t.length?(e=t,ae.saveToLSorCookie(m,t)):o(this,me)[me].error("Illegal guid "+t)}X(e)&&ae.createBroadCookie(m,e,M,window.location.hostname)}}return X(e)||(e=ae.readCookie(m),!X(e)||0!==e.indexOf("%")&&0!==e.indexOf("'")&&0!==e.indexOf('"')||(e=null),X(e)&&ae.saveToLSorCookie(m,e)),e}}const we="This property has been ignored.",Ce="CleverTap error:",ke="".concat(Ce," Incorrect embed script."),xe="".concat(Ce," Event structure not valid. ").concat(we),Pe="".concat(Ce," Gender value should be either M or F. ").concat(we),Se="".concat(Ce," Employed value should be either Y or N. ").concat(we),Ie="".concat(Ce," Married value should be either Y or N. ").concat(we),Oe="".concat(Ce," Education value should be either School, College or Graduate. ").concat(we),_e="".concat(Ce," Age value should be a number. ").concat(we),Ee="".concat(Ce," DOB value should be a Date Object"),Ae="".concat(Ce," setEnum(value). value should be a string or a number"),Le="".concat(Ce," Phone number should be formatted as +[country code][number]");let Me;const Te=e=>{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[v])||Q(e[v])){const i=e[v]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(b)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(b,i)}return!0}return!1};var je=i("logger"),De=i("oldValues"),ze=i("request"),Be=i("isPersonalisationActive"),Ne=i("processEventArray");class Fe extends Array{constructor(e,t){let{logger:i,request:n,isPersonalisationActive:r}=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}),o(this,je)[je]=i,o(this,De)[De]=t,o(this,ze)[ze]=n,o(this,Be)[Be]=r}push(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return o(this,Ne)[Ne](t),0}_processOldValues(){o(this,De)[De]&&o(this,Ne)[Ne](o(this,De)[De]),o(this,De)[De]=null}getDetails(e){if(!o(this,Be)[Be]())return;if(void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(k)),void 0===le.globalEventsMap)return;const t=le.globalEventsMap[e],i={};return void 0!==t?(i.firstTime=new Date(1e3*t[1]),i.lastTime=new Date(1e3*t[2]),i.count=t[0],i):void 0}}var Ue=function(e){if(Array.isArray(e))for(;e.length>0;){var t=e.shift();if(!H(t)){o(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),o(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){o(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const i={type:"event"};if(i.evtName=te(t,u),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,o(this,je)[je])){o(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){o(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}i.evtData=n}else e.unshift(n)}o(this,ze)[ze].processEvent(i)}};const Ve=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const r=/\+/g,s=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=s.exec(o);n;)t[a(n[1])]=a(n[2]),n=s.exec(o)}return t},qe=(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,r,s,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},r={},s="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o<e.length;o+=1)if(s=e.charAt(o),Object.prototype.hasOwnProperty.call(n,s)||(n[s]=d++,r[s]=!0),a=l+s,Object.prototype.hasOwnProperty.call(n,a))l=a;else{if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t<h;t++)p<<=1,15==g?(g=0,u+=f(p),p=0):g++;for(i=l.charCodeAt(0),t=0;t<8;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1}else{for(i=1,t=0;t<h;t++)p=p<<1|i,15==g?(g=0,u+=f(p),p=0):g++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete r[l]}else for(i=n[l],t=0;t<h;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(s)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t<h;t++)p<<=1,15==g?(g=0,u+=f(p),p=0):g++;for(i=l.charCodeAt(0),t=0;t<8;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1}else{for(i=1,t=0;t<h;t++)p=p<<1|i,15==g?(g=0,u+=f(p),p=0):g++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete r[l]}else for(i=n[l],t=0;t<h;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t<h;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=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<e.length?e.charCodeAt(c/2+1)>>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2<e.length?(i=e.charCodeAt((c+1)/2)>>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,r=(3&t)<<4|i>>4,s=(15&i)<<2|o>>6,a=63&o,isNaN(i)?s=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(r)+Ge.charAt(s)+Ge.charAt(a);return l};var Je=i("fireRequest"),Ze=i("dropRequestDueToOptOut"),$e=i("addUseIPToRequest"),Ye=i("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,i,n){o(this,Je)[Je](e,1,t,i,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=K,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),K;{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=K,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,i,n,r){var s,a;if(o(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),r&&"wzrk_fetch"===r)!X(this.device.gcookie)&&le.globalCache.RESP_N<le.globalCache.REQ_N-1&&setTimeout((()=>{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),o(this,Je)[Je](e,void 0,i,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N<le.globalCache.REQ_N-1&&t<200)return void setTimeout((()=>{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),o(this,Je)[Je](e,t+1,i,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=qe(e,"gc",this.device.gcookie)),e=o(this,Ye)[Ye](e,i)),e=qe(e,"tries",t),e=o(this,$e)[$e](e),e=qe(e,"r",(new Date).getTime()),(null===(s=window.clevertap)||void 0===s?void 0:s.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=qe(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(E);return"boolean"!=typeof t&&(t=!1),qe(e,E,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return qe(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(S)&&null!==localStorage.getItem(S)?qe(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(S)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(w);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(g,'"')),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(w,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(m);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(m)));const o=ae.read(C)?JSON.parse(decodeURIComponent(ae.read(C))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const r=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},s=t[n].global,a=ie(),l=t[n][a];if(void 0!==s){const e=Object.keys(s);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!==s&&void 0!==s[a]&&(n=s[a]),i=[a,o,n],r[a]=i}}}e={...e,[n]:r}})),o[i]=e,ae.save(C,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(m)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(C),n=o?decodeURIComponent(o):null,r=n?JSON.parse(n):null,s=e&&null!=o&&r&&r[e]&&r[e].wp?Object.values(r[e].wp):[],a=e&&null!=o&&r&&r[e]&&r[e].wi?Object.values(r[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:s,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;o<e.length;o++){const n=e[o];if(null!=n.type){const e=n.type;if("Graduate School"===e)return"Graduate";"College"===e?t="1":"High School"===e&&(i="1")}}if("1"===t)return"College";if("1"===i)return"School"}}(e.education);null!=i&&(t.Education=i);const o=null!=e.work?e.work.length:0;if(t.Employed=o>0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=re(i[2]+i[0]+i[1])}return t},rt=(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<e.emails.length;t++){const i=e.emails[t];"account"===i.type&&(o.Email=i.value)}if(null!=e.organizations){o.Employed="N";for(let t=0;t<e.organizations.length;t++){"work"===e.organizations[t].type&&(o.Employed="Y")}}if(null!=e.birthday){const t=e.birthday.split("-");o.DOB=re(t[0]+t[1]+t[2])}return null!=e.relationshipStatus&&(o.Married="N","married"===e.relationshipStatus&&(o.Married="Y")),i.debug("gplus usr profile "+JSON.stringify(o)),o},st=(e,t)=>{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(P),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(P,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=i("logger"),ct=i("request"),dt=i("account"),ht=i("oldValues"),ut=i("isPersonalisationActive"),pt=i("processProfileArray");class gt extends Array{constructor(e,t){let{logger:i,request:n,account:r,isPersonalisationActive:s}=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}),o(this,lt)[lt]=i,o(this,ct)[ct]=n,o(this,dt)[dt]=r,o(this,ht)[ht]=t,o(this,ut)[ut]=s}push(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return o(this,pt)[pt](t),0}_processOldValues(){o(this,ht)[ht]&&o(this,pt)[pt](o(this,ht)[ht]),o(this,ht)[ht]=null}getAttribute(e){if(o(this,ut)[ut]())return null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(P)),null!=le.globalProfileMap?le.globalProfileMap[e]:void 0}_handleIncrementDecrementValue(e,t,i){var n;if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(P)),null!=le.globalProfileMap||(null===(n=le.globalProfileMap)||void 0===n?void 0:n.hasOwnProperty(e)))if(!t||"number"!=typeof t||t<=0)console.error("Value should be a number greater than 0");else{le.globalProfileMap[e]=i===N?le.globalProfileMap[e]+t:le.globalProfileMap[e]-t,ae.saveToLSorCookie(P,le.globalProfileMap);let n={};const r={};n.type="profile",r[e]={[i]:t},null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=r,n=o(this,ct)[ct].addSystemDataToObject(n,void 0),o(this,ct)[ct].addFlags(n);const s=Ke(JSON.stringify(n),o(this,lt)[lt]);let a=o(this,dt)[dt].dataPostURL;a=qe(a,"type",L),a=qe(a,"d",s),o(this,ct)[ct].saveAndFireRequest(a,le.blockRequest)}else console.error("Kindly create profile with required proprty to increment/decrement.")}_handleMultiValueSet(e,t,i){const o=[];for(let e=0;e<t.length;e++)"number"!=typeof t[e]||o.includes(t[e])?"string"!=typeof t[e]||o.includes(t[e].toLowerCase())?console.error("array supports only string or number type values"):o.push(t[e].toLowerCase()):o.push(t[e]);var n;null==le.globalProfileMap&&(le.globalProfileMap=null!==(n=ae.readFromLSorCookie(P))&&void 0!==n?n:{});le.globalProfileMap[e]=o,ae.saveToLSorCookie(P,le.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueAdd(e,t,i){var o=[];if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(P)||{}),"string"==typeof t||"number"==typeof t)le.globalProfileMap.hasOwnProperty(e)?(o=le.globalProfileMap[e]).push("number"==typeof t?t:t.toLowerCase()):le.globalProfileMap[e]=t;else{le.globalProfileMap.hasOwnProperty(e)&&(o=Array.isArray(le.globalProfileMap[e])?le.globalProfileMap[e]:[le.globalProfileMap[e]]);for(var n=0;n<t.length;n++)"number"!=typeof t[n]||o.includes(t[n])?"string"!=typeof t[n]||o.includes(t[n].toLowerCase())?"number"==typeof t[n]&&o.includes(t[n])||"string"==typeof t[n]&&o.includes(t[n].toLowerCase())?console.error("Values already included"):console.error("Array supports only string or number type values"):o.push(t[n].toLowerCase()):o.push(t[n]);le.globalProfileMap[e]=o}ae.saveToLSorCookie(P,le.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueRemove(e,t,i){var o;if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(P)),null==le||null===(o=le.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))if("string"==typeof t||"number"==typeof t){var n=le.globalProfileMap[e].indexOf(t);-1!==n&&le.globalProfileMap[e].splice(n,1)}else for(var r=0;r<t.length;r++){var s=le.globalProfileMap[e].indexOf(t[r]);-1!==s&&le.globalProfileMap[e].splice(s,1)}else console.error("The property ".concat(e," does not exist."));ae.saveToLSorCookie(P,le.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueDelete(e,t){var i;null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(P)),(null==le||null===(i=le.globalProfileMap)||void 0===i?void 0:i.hasOwnProperty(e))?delete le.globalProfileMap[e]:console.error("The property ".concat(e," does not exist.")),ae.saveToLSorCookie(P,le.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,i){let n={};const r={};n.type="profile",r[e]={[i]:i===V||t},null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=r,n=o(this,ct)[ct].addSystemDataToObject(n,void 0),o(this,ct)[ct].addFlags(n);const s=Ke(JSON.stringify(n),o(this,lt)[lt]);let a=o(this,dt)[dt].dataPostURL;a=qe(a,"type",L),a=qe(a,"d",s),o(this,ct)[ct].saveAndFireRequest(a,le.blockRequest)}}var ft=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];let n,r={};if(null!=i.Site){if(n=i.Site,$(n)||!ot(n,{logger:o(this,lt)[lt]}))return}else if(null!=i.Facebook){const e=i.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=i["Google Plus"]){const e=i["Google Plus"];$(e)||e.error||(n=rt(e,{logger:o(this,lt)[lt]}))}if(null!=n&&!$(n)){r.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),r.profile=n,st(n,!0),r=o(this,ct)[ct].addSystemDataToObject(r,void 0),o(this,ct)[ct].addFlags(r);const e=Ke(JSON.stringify(r),o(this,lt)[lt]);let t=o(this,dt)[dt].dataPostURL;t=qe(t,"type",L),t=qe(t,"d",e),o(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=i("request"),bt=i("logger"),mt=i("account"),yt=i("session"),wt=i("oldValues"),Ct=i("device"),kt=i("processOUL"),xt=i("handleCookieFromCache"),Pt=i("deleteUser"),St=i("processLoginArray");class It extends Array{constructor(e,t){let{request:i,account:n,session:r,logger:s,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}),o(this,vt)[vt]=i,o(this,mt)[mt]=n,o(this,yt)[yt]=r,o(this,bt)[bt]=s,o(this,wt)[wt]=t,o(this,Ct)[Ct]=a}clear(){o(this,bt)[bt].debug("clear called. Reset flag has been set."),o(this,Pt)[Pt](),ae.setMetaProp(f,!0)}push(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return o(this,St)[St](t),0}_processOldValues(){o(this,wt)[wt]&&o(this,St)[St](o(this,wt)[wt]),o(this,wt)[wt]=null}}var Ot=function(e){let t=!0;ae.saveToLSorCookie(z,t);const i=e=>{let i=ae.readFromLSorCookie(y);const n=ae.readFromLSorCookie(m);let r;if(null==i)i={},r=e;else{r=i.id;let s=!1,a=!1;if(null==r&&(r=e[0],s=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),s)null!=n&&(le.LRU_CACHE.set(r,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){r=i,a=!0;break}}if(a){r!==le.LRU_CACHE.getLastKey()?o(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(z,t));const e=le.LRU_CACHE.get(r);le.LRU_CACHE.set(r,e),ae.saveToLSorCookie(m,e),o(this,Ct)[Ct].gcookie=e;const i=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(z)&&-1!==i){const e=le.LRU_CACHE.cache[i];o(this,vt)[vt].unregisterTokenForGuid(e)}}else s?null!=n&&(o(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(m,n),t=!1):this.clear(),ae.saveToLSorCookie(z,!1),r=e[0]}i.id=r,ae.saveToLSorCookie(y,i)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const r=e[n];let s,a={};if(null!=r.Site){if(s=r.Site,$(s)||!ot(s,{logger:o(this,bt)[bt]}))return}else if(null!=r.Facebook){const e=r.Facebook;$(e)||e.error||(s=nt(e))}else if(null!=r["Google Plus"]){const e=r["Google Plus"];$(e)&&!e.error&&(s=rt(e,{logger:o(this,bt)[bt]}))}if(null!=s&&!$(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;const e=[];ae._isLocalStorageSupported()&&(s.Identity&&e.push(s.Identity),s.Email&&e.push(s.Email),s.GPID&&e.push("GP:"+s.GPID),s.FBID&&e.push("FB:"+s.FBID),e.length>0&&i(e)),st(s,!0),a=o(this,vt)[vt].addSystemDataToObject(a,void 0),o(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),o(this,bt)[bt]);let r=o(this,mt)[mt].dataPostURL;r=qe(r,"type",L),r=qe(r,"d",n),o(this,vt)[vt].saveAndFireRequest(r,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(w,We()),ae.removeCookie(o(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(S,le.broadDomain),o(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,o(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(m,le.broadDomain),ae.removeCookie(w,We()),ae.removeCookie(y,We()),ae.removeCookie(o(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(S,le.broadDomain),o(this,Ct)[Ct].gcookie=null,o(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{o(this,kt)[kt]([t])}catch(e){o(this,bt)[bt].debug(e)}}else o(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 <style type="text/css">\n .banner {\n position: relative;\n cursor: '.concat(this.details.onClick?"pointer":"","\n }\n img {\n height: ").concat(this.divHeight?this.divHeight:"auto",";\n width: 100%;\n }\n .wrapper:is(.left, .right, .center) {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: auto;\n top: 0;\n }\n ").concat(this.details.css?this.details.css:"",'\n </style>\n <div class="banner">\n <picture>\n <source media="(min-width:480px)" srcset="').concat(this.details.desktopImageURL,'">\n <source srcset="').concat(this.details.mobileImageURL,'">\n <img src="').concat(this.details.desktopImageURL,'" alt="Please upload a picture" style="width:100%;" part="banner__img">\n </picture>\n ').concat(this.details.html?this.details.html:"","\n </div>\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 <style>\n .carousel {\n position: relative;\n }\n\n .carousel__item {\n background-color: grey;\n display: none;\n background-repeat: no-repeat;\n background-size: cover;\n }\n\n ct-web-personalisation-banner::part(banner__img) {\n height: ".concat((null==this||null===(e=this.target)||void 0===e||null===(t=e.display)||void 0===t?void 0:t.divHeight)?this.target.display.divHeight:"auto",";\n width: 100%;\n transition: 2s;\n }\n\n .carousel__item--selected {\n display: block;\n }\n ").concat(this.display.navBtnsCss,"\n ").concat(this.display.navArrowsCss,"\n </style>\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.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.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="<span>".concat(Wt(e.id.split("_")[1]),"<span>"),!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_ttl<i){if(e){const e=this.shadowRoot.getElementById(t[o].id);e&&e.remove(),t[o].viewed||(this.unviewedCounter--,this.updateUnviewedBadgeCounter())}delete t[o]}return t&&t.length>0&&(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 r="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=r,e.date=i-n,e.viewed=0,t[r]=e,o[r]=e,this.unviewedMessages[r]=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},r=i.children[0],s=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(r);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(s),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 r=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;r>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),r--}const s=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=s?"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"),r=i.getPropertyValue("--inbox-left"),s=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||r||s)){const t=qt(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:r,categoriesTabColor:s,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n <style id="webInboxStyles">\n #inbox {\n width: 100%;\n position: fixed;\n background-color: #fff; \n display: none; \n box-shadow: 0px 2px 10px 0px #d7d7d791;\n background-color: '.concat(t,"; \n border: 1px solid ").concat(i,";\n top: 0;\n left: 0;\n height: 100%;\n overflow: auto;\n z-index: 1;\n box-sizing: content-box;\n border-radius: 4px;\n }\n \n #emptyInboxMsg {\n display: block;\n padding: 10px;\n text-align: center;\n color: black;\n }\n \n #header {\n height: 36px; \n width: 100%; \n display: flex; \n justify-content: center; \n align-items: center; \n background-color: ").concat(o,"; \n background-color: var(--card-bg, ").concat(o,");\n color: ").concat(n,"\n }\n \n #closeInbox {\n font-size: 20px; \n margin-right: 12px; \n color: ").concat(r,"; \n cursor: pointer;\n }\n \n #headerTitle {\n font-size: 14px; \n line-height: 20px; \n flex-grow: 1; \n font-weight: 700; \n text-align: center;\n flex-grow: 1;\n text-align: center;\n }\n \n #categoriesContainer {\n padding: 16px 16px 0 16px; \n height: 32px; \n display: flex;\n scroll-behavior: smooth;\n position: relative;\n }\n\n #categoriesWrapper {\n height: 32px; \n overflow-x: scroll;\n display: flex;\n white-space: nowrap;\n scrollbar-width: none;\n }\n\n #categoriesWrapper::-webkit-scrollbar {\n display: none;\n }\n \n #leftArrow, #rightArrow {\n height: 32px;\n align-items: center;\n font-weight: 700;\n position: absolute;\n z-index: 2;\n pointer-events: auto;\n cursor: pointer;\n display: none;\n }\n\n #leftArrow {\n left: 0;\n padding-left: 4px;\n padding-right: 16px;\n background: linear-gradient(90deg, ").concat(t," 0%, ").concat(t,"99 80%, ").concat(t,"0d 100%);\n }\n\n #rightArrow {\n right: 0;\n padding-right: 4px;\n padding-left: 16px;\n background: linear-gradient(-90deg, ").concat(t," 0%, ").concat(t,"99 80%, ").concat(t,'0d 100%);\n }\n\n [id^="category-"] {\n display: flex; \n flex: 1 1 0; \n justify-content: center; \n align-items: center; \n font-size: 14px; \n line-height: 20px; \n background-color: ').concat(s,"; \n color: ").concat(a,"; \n cursor: pointer;\n padding: 6px 24px;\n margin: 0 3px;\n border-radius: 16px;\n border: ").concat(l?"1px solid "+l:"none",';\n }\n\n [id^="category-"][selected="true"] {\n background-color: ').concat(c,"; \n color: ").concat(d,"; \n border: ").concat(h?"1px solid "+h:"none","\n }\n \n #inboxCard {\n padding: 0 16px 0 16px;\n overflow-y: auto;\n box-sizing: border-box;\n margin-top: 16px;\n }\n\n @media only screen and (min-width: 480px) {\n #inbox {\n width: var(--inbox-width, 392px);\n height: var(--inbox-height, 546px);\n position: var(--inbox-position, fixed);\n right: var(--inbox-right, unset);\n bottom: var(--inbox-bottom, unset);\n top: var(--inbox-top, unset);\n left: var(--inbox-left, unset);\n }\n \n #inboxCard {\n height: calc(var(--inbox-height, 546px) - ").concat(u,"px); \n }\n \n }\n </style>\n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:r,buttonTextColor:s,unreadMarkerColor:a}=e;return'\n <style id="messageStyles">\n ct-inbox-message::part(messageWrapper) {\n margin-bottom: 16px; \n }\n ct-inbox-message::part(message) {\n background-color: '.concat(t,"; \n border: 1px solid ").concat(i,";\n border-radius: 4px; \n overflow: hidden;\n min-height: 40px;\n }\n ct-inbox-message::part(message):hover {\n box-shadow: 0px 4px 8px rgb(0 0 0 / 10%);\n cursor: pointer;\n }\n ct-inbox-message::part(iconTitleDescWrapper) {\n display: flex; \n padding: 16px;\n }\n ct-inbox-message::part(titleDescWrapper) {\n display: flex; \n flex-direction: column;\n }\n ct-inbox-message::part(iconImgContainer) {\n display: flex; \n margin-right: 16px;\n }\n ct-inbox-message::part(mainImgContainer) {\n line-height: 0;\n }\n ct-inbox-message::part(mainImg) {\n width: 100%; \n background: #b2b1ae;\n }\n ct-inbox-message::part(iconImg) {\n height: 40px; \n width: 40px;\n }\n ct-inbox-message::part(title) {\n font-size: 14px !important; \n line-height: 20px; \n font-weight: 600; \n color: ").concat(o,"\n }\n ct-inbox-message::part(description) {\n font-size: 14px !important; \n line-height: 20px; \n font-weight: 400; \n color: ").concat(n,"\n }\n ct-inbox-message::part(button) {\n background-color: ").concat(r,"; \n color: ").concat(s,"; \n padding: 8px 16px; \n font-size: 12px; \n line-height: 16px; \n font-weight: 600; \n flex: 1; \n border-radius: 0px; \n text-transform: capitalize; \n cursor: pointer; \n border: none;\n }\n ct-inbox-message::part(buttonsContainer) {\n display: flex;\n position: relative;\n }\n ct-inbox-message::part(snackbar) {\n position: absolute;\n top: calc(-100% - 12px);\n left: 50%;\n transform: translate(-50%, 0px);\n font-size: 14px;\n font-weight: 400;\n background: #FFFFFF;\n border: 1px solid #ECEDF2;\n box-shadow: 0px 4px 8px rgb(0 0 0 / 6%), 0px 0px 2px rgb(0 0 0 / 4%);\n border-radius: 4px;\n z-index: 2;\n display: none;\n width: max-content;\n align-items: center;\n padding: 8px 16px;\n justify-content: center;\n }\n\n ct-inbox-message::part(snackbar-msg) {\n color: black;\n margin-left: 8px;\n }\n\n ct-inbox-message::part(timeStamp) {\n display: flex; \n justify-content: end; \n align-items: center; \n margin-top: 4px; \n font-size: 12px !important; \n line-height: 16px; \n color: black;\n }\n ct-inbox-message::part(unreadMarker) {\n height: 8px; \n width: 8px; \n border-radius: 50%; \n background-color: ").concat(a,"; \n margin-left: 8px;\n }\n @media only screen and (min-width: 420px) {\n ct-inbox-message::part(mainImg) {\n height: 180px;\n }\n }\n </style>\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=>{Vt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(W)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(W,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(m)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ft=e=>{const t=JSON.parse(decodeURIComponent(ae.read(m)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(W,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 r=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(r),t()):n>=20&&(clearInterval(r),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Vt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},qt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,r=window.innerWidth+o,s=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<=s){const e=s-(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,b<n?b=n:b+t>s&&(b=s-t);if(m){const e=h+i;if(e<=r){v=h+(e+y<=r?y:r-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,v<o?v=d+i<=r?d:o:v+i>r&&(v=h-i>=o?h-i:r-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='<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M0.258435 9.74751C-0.0478584 9.44825 -0.081891 8.98373 0.156337 8.64775L0.258435 8.52836L3.87106 5L0.258435 1.47164C-0.0478588 1.17239 -0.0818914 0.707867 0.156337 0.371887L0.258435 0.252494C0.564728 -0.0467585 1.04018 -0.0800085 1.38407 0.152743L1.50627 0.252494L5.74156 4.39042C6.04786 4.68968 6.08189 5.1542 5.84366 5.49018L5.74156 5.60957L1.50627 9.74751C1.16169 10.0842 0.603015 10.0842 0.258435 9.74751Z" fill="#63698F"/>\n</svg>\n',Ht='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C12.4183 16 16 12.4183 16 8ZM9.6839 5.93602C9.97083 5.55698 10.503 5.48833 10.8725 5.78269C11.2135 6.0544 11.2968 6.54044 11.0819 6.91173L11.0219 7.00198L8.09831 10.864C7.80581 11.2504 7.26654 11.3086 6.90323 11.0122L6.82822 10.9433L5.04597 9.10191C4.71635 8.76136 4.71826 8.21117 5.05023 7.87303C5.35666 7.5609 5.83722 7.53855 6.16859 7.80482L6.24814 7.87739L7.35133 9.01717L9.6839 5.93602Z" fill="#03A387"/>\n</svg>\n',Jt=(e,t)=>{let{device:i,session:o,request:n,logger:r}=t;const s=i,a=o,l=n,c=r;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 r={};const e=Xe();r=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")&&(r.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,s=-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&&(s=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=r[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={},r[a.sessionId]=h;var u=r[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(s>0&&e>=s)return!1}else u={},r[o]=u;var p=r.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},r.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(Jt,1e3*i,e,{device:s,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=s.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,r;n?o=i:null!==i&&(r=i.getElementsByClassName("jsCT_CTA"),null!=r&&1===r.length&&(o=r[0]));const s=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=s)return null==l&&Qe.fireRequest(e),p(s,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=j,t.evtData={[R]: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)},b=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,r=document.createElement("div");r.id=o;const s=window.innerHeight,l=window.innerWidth;let c=!1;if(n)r.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*s/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*s/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*s/100,n="width:50%;"),null==i.proto?(c=!0,r.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):r.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(r);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='<style type="text/css">body{margin:0;padding:0;}#contentDiv.wzrk{overflow:hidden;padding:0;text-align:center;'+b+"}#contentDiv.wzrk td{padding:15px 10px;}.wzrkPPtitle{font-weight: bold;font-size: 16px;font-family:arial;padding-bottom:10px;word-break: break-word;}.wzrkPPdscr{font-size: 14px;font-family:arial;line-height:16px;word-break: break-word;display:inline-block;}.PL15{padding-left:15px;}.wzrkPPwarp{margin:20px 20px 0 5px;padding:0px;border-radius: "+p+"px;box-shadow: 1px 1px 5px #888888;}a.wzrkClose{cursor:pointer;position: absolute;top: 11px;right: 11px;z-index: 2147483647;font-size:19px;font-family:arial;font-weight:bold;text-decoration: none;width: 25px;/*height: 25px;*/text-align: center; -webkit-appearance: none; line-height: 25px;background: #353535;border: #fff 2px solid;border-radius: 100%;box-shadow: #777 2px 2px 2px;color:#fff;}a:hover.wzrkClose{background-color:#d1914a !important;color:#fff !important; -webkit-appearance: none;}td{vertical-align:top;}td.imgTd{border-top-left-radius:8px;border-bottom-left-radius:8px;}</style>";let n,r,s,a,l;"dark"===e.display.theme?(n="#2d2d2e",r="#eaeaea",s="#353535",a="#353535",l="#ffffff"):(n="#ffffff",r="#000000",a="#f4f4f4",s="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="<td class='imgTd' style='background-color:"+a+"'><img src='"+e.msgContent.imageUrl+"' height='60' width='60'></td>");v=i+("<div class='wzrkPPwarp' style='color:"+r+";background-color:"+n+";'><a href='javascript:void(0);' onclick="+("parent.$WZRK_WR.closeIframe("+t+",'"+o+"');")+" class='wzrkClose' style='background-color:"+s+";color:"+l+"'>×</a><div id='contentDiv' class='wzrk'><table cellpadding='0' cellspacing='0' border='0'><tr>"+h+"<td style='vertical-align:top;'><div class='wzrkPPtitle' style='color:"+r+"'>"+c+"</div>")+("<div class='wzrkPPdscr' style='color:"+r+"'>"+d+"<div></td></tr></table></div>")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),r.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"]&&w(e,m),m.close();const C=()=>{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"},k=navigator.userAgent.toLowerCase();if(-1!==k.indexOf("safari"))if(k.indexOf("chrome")>-1)u.onload=()=>{C();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),C();const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),C();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),10)}else u.onload=()=>{C();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},w=(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 P=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(T)&&o!==R){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=D,i.evtData={[R]: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 r=document.createElement("div");r.id="intentOpacityDiv";const s=i.display.opacity||.7,a="rgba(0,0,0,".concat(s,")");r.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(r);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='<style type="text/css">body{margin:0;padding:0;}#contentDiv.wzrk{overflow:hidden;padding:0 0 20px 0;text-align:center;'+f+"}#contentDiv.wzrk td{padding:15px 10px;}.wzrkPPtitle{font-weight: bold;font-size: 24px;font-family:arial;word-break: break-word;padding-top:20px;}.wzrkPPdscr{font-size: 14px;font-family:arial;line-height:16px;word-break: break-word;display:inline-block;padding:20px 20px 0 20px;line-height:20px;}.PL15{padding-left:15px;}.wzrkPPwarp{margin:20px 20px 0 5px;padding:0px;border-radius: "+d+"px;box-shadow: 1px 1px 5px #888888;}a.wzrkClose{cursor:pointer;position: absolute;top: 11px;right: 11px;z-index: 2147483647;font-size:19px;font-family:arial;font-weight:bold;text-decoration: none;width: 25px;/*height: 25px;*/text-align: center; -webkit-appearance: none; line-height: 25px;background: #353535;border: #fff 2px solid;border-radius: 100%;box-shadow: #777 2px 2px 2px;color:#fff;}a:hover.wzrkClose{background-color:#d1914a !important;color:#fff !important; -webkit-appearance: none;}#contentDiv .button{padding-top:20px;}#contentDiv .button a{font-size: 14px;font-weight:bold;font-family:arial;text-align:center;display:inline-block;text-decoration:none;padding:0 30px;height:40px;line-height:40px;background:#ea693b;color:#fff;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;}</style>";let t,n,r,s;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",r="#353535",s="#ffffff"):(t="#ffffff",n="#000000",r="#a5a6a6",s="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="<div class='button'><a href='#'>"+i.msgContent.ctaText+"</a></div>");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="<div style='padding-top:20px;'><img src='"+i.msgContent.imageUrl+"' width='500' alt="+a+" /></div>");p=e+("<div class='wzrkPPwarp' style='color:"+n+";background-color:"+t+";'><a href='javascript:void(0);' onclick="+("parent.$WZRK_WR.closeIframe("+o+",'intentPreview');")+" class='wzrkClose' style='background-color:"+r+";color:"+s+"'>×</a><div id='contentDiv' class='wzrk'><div class='wzrkPPtitle' style='color:"+n+"'>"+a+"</div>")+("<div class='wzrkPPdscr' style='color:"+n+"'>"+l+"</div>"+h+c+"</div></div>")}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"]&&w(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(Jt,1e3,e,{device:s,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]):b(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i<e.inapp_notifs.length;i++){const o=e.inapp_notifs[i];if(null==o.display.wtarget_type||0===o.display.wtarget_type)P(o);else if(1===o.display.wtarget_type)I=o,window.document.body.onmouseleave=O;else if(2===o.display.wtarget_type)if(2===o.msgContent.type||3===o.msgContent.type){null!==(o.display.divId?document.getElementById(o.display.divId):document.querySelector(o.display.divSelector))?2===o.msgContent.type?v(o):b(o):t[o.wzrk_id.split("_")[0]]=o}else P(o)}Object.keys(t).length&&("complete"===document.readyState?_(t):(e=>{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;i<e.inbox_notifs.length;i++)!1!==h(e.inbox_notifs[i])&&t.push(e.inbox_notifs[i]);Dt(t)}};if((e.webInboxSetting||null!=e.inbox_notifs)&&(Kt()&&Vt(),null===le.inbox?(e.webInboxSetting&&function(e){let t=arguments.length>1&&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(C))){const o=JSON.parse(decodeURIComponent(ae.read(C))),n=JSON.parse(decodeURIComponent(ae.read(m)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(C,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(k),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(k,le.globalEventsMap),null==le.globalProfileMap?st(i,!0):st(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(S);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(S,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 Zt=i("isPersonalisationActive");class $t{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Zt,{writable:!0,value:void 0}),o(this,Zt)[Zt]=t}getTotalVisits(){if(!o(this,Zt)[Zt]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!o(this,Zt)[Zt]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const Yt=1,Qt=2,Xt=3,ei=4;var ti=i("logLevel"),ii=i("log"),oi=i("isLegacyDebug");class ni{constructor(e){Object.defineProperty(this,oi,{get:si,set:void 0}),Object.defineProperty(this,ii,{value:ri}),Object.defineProperty(this,ti,{writable:!0,value:void 0}),this.wzrkError={},o(this,ti)[ti]=null==e?e:Qt,this.wzrkError={}}get logLevel(){return o(this,ti)[ti]}set logLevel(e){o(this,ti)[ti]=e}error(e){o(this,ti)[ti]>=Yt&&o(this,ii)[ii]("error",e)}info(e){o(this,ti)[ti]>=Qt&&o(this,ii)[ii]("log",e)}debug(e){(o(this,ti)[ti]>=Xt||o(this,oi)[oi])&&o(this,ii)[ii]("debug",e)}debugPE(e){o(this,ti)[ti]>=ei&&o(this,ii)[ii]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var ri=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},si=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},ai=i("logger"),li=i("sessionId"),ci=i("isPersonalisationActive");class di{constructor(e){let{logger:t,isPersonalisationActive:i}=e;Object.defineProperty(this,ai,{writable:!0,value:void 0}),Object.defineProperty(this,li,{writable:!0,value:void 0}),Object.defineProperty(this,ci,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),o(this,ai)[ai]=t,o(this,ci)[ci]=i}get sessionId(){return o(this,li)[li]}set sessionId(e){o(this,li)[li]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(g,'"'),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(!o(this,ci)[ci]())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(o(this,ci)[ci]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let hi=0,ui=0;var pi=i("logger"),gi=i("account"),fi=i("device"),vi=i("session"),bi=i("isPersonalisationActive"),mi=i("clearCookie"),yi=i("addToLocalEventMap");class wi{constructor(e){let{logger:t,account:i,device:n,session:r,isPersonalisationActive:s}=e;Object.defineProperty(this,yi,{value:Ci}),Object.defineProperty(this,pi,{writable:!0,value:void 0}),Object.defineProperty(this,gi,{writable:!0,value:void 0}),Object.defineProperty(this,fi,{writable:!0,value:void 0}),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:!1}),this.processingBackup=!1,o(this,pi)[pi]=t,o(this,gi)[gi]=i,o(this,fi)[fi]=n,o(this,vi)[vi]=r,o(this,bi)[bi]=s,Qe.logger=t,Qe.device=n,Qe.account=i}processBackupEvents(){const e=ae.readFromLSorCookie(I);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];void 0===i.fired&&(o(this,pi)[pi].debug("Processing backup event : "+i.q),void 0!==i.q&&Qe.fireRequest(i.q),i.fired=!0)}ae.saveToLSorCookie(I,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,o(this,pi)[pi])),$(o(this,pi)[pi].wzrkError)||(e.wzrk_error=o(this,pi)[pi].wzrkError,o(this,pi)[pi].wzrkError={}),e.id=o(this,gi)[gi].id,X(o(this,fi)[fi].gcookie)&&(e.g=o(this,fi)[fi].gcookie);const i=o(this,vi)[vi].getSessionCookieObject();e.s=i.s,e.pg=void 0===i.p?1:i.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={lib:"web-sdk-v2.0.0",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(o(this,mi)[mi]=ae.getAndClearMetaProp(f),void 0!==o(this,mi)[mi]&&o(this,mi)[mi]&&(e.rc=!0,o(this,pi)[pi].debug("reset cookie sent in request and cleared from meta for future requests.")),o(this,bi)[bi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i<oe()&&(e.dsync=!0)}}saveAndFireRequest(e,t,i,n){const r=oe(),s=(e=qe(e,"rn",++le.globalCache.REQ_N))+"&i="+r+"&sn="+hi;ae.backupEvent(s,le.globalCache.REQ_N,o(this,pi)[pi]),le.offline||(t&&(void 0===o(this,mi)[mi]||!o(this,mi)[mi])||window.isOULInProgress?o(this,pi)[pi].debug("Not fired due to override - ".concat(le.blockRequest," or clearCookie - ").concat(o(this,mi)[mi]," or OUL request in progress - ").concat(window.isOULInProgress)):(r===ui?hi++:(ui=r,hi=0),window.oulReqN=le.globalCache.REQ_N,Qe.fireRequest(s,!1,i,n)))}unregisterTokenForGuid(e){const t=ae.readFromLSorCookie(B);if(t){const t={type:"data"};X(e)&&(t.g=e),t.action="unregister",t.id=o(this,gi)[gi].id;const i=o(this,vi)[vi].getSessionCookieObject();t.s=i.s;const n=Ke(JSON.stringify(t),o(this,pi)[pi]);let r=o(this,gi)[gi].dataPostURL;r=qe(r,"type","data"),r=qe(r,"d",n),Qe.fireRequest(r,!0),ae.saveToLSorCookie(z,!1)}this.registerToken(t)}registerToken(e){if(!e)return;e=this.addSystemDataToObject(e,!0),e=JSON.stringify(e);let t=o(this,gi)[gi].dataPostURL;t=qe(t,"type","data"),t=qe(t,"d",Ke(e,o(this,pi)[pi])),Qe.fireRequest(t),ae.save("WZRK_WPR","ok")}processEvent(e){o(this,yi)[yi](e.evtName),e=this.addSystemDataToObject(e,void 0),this.addFlags(e),e.WZRK_CAMP=it();const t=Ke(JSON.stringify(e),o(this,pi)[pi]);let i=o(this,gi)[gi].dataPostURL;i=qe(i,"type",L),i=qe(i,"d",t),this.saveAndFireRequest(i,le.blockRequest,!1,e.evtName)}async post(e,t){try{const i=await fetch(e,{method:"post",headers:{"Content-Type":"application/json"},body:t});if(i.ok){const e=await i.json();return o(this,pi)[pi].debug("Sync data successful",e),e}throw i}catch(e){throw o(this,pi)[pi].debug("Error in syncing variables",e),e}}}var Ci=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(k),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(k,le.globalEventsMap)}},ki=i("request"),xi=i("account"),Pi=i("oldValues"),Si=i("logger"),Ii=i("processPrivacyArray");class Oi extends Array{constructor(e,t){let{request:i,account:n,logger:r}=e;super(),Object.defineProperty(this,Ii,{value:_i}),Object.defineProperty(this,ki,{writable:!0,value:void 0}),Object.defineProperty(this,xi,{writable:!0,value:void 0}),Object.defineProperty(this,Pi,{writable:!0,value:void 0}),Object.defineProperty(this,Si,{writable:!0,value:void 0}),o(this,Si)[Si]=r,o(this,ki)[ki]=i,o(this,xi)[xi]=n,o(this,Pi)[Pi]=t}push(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return le.isPrivacyArrPushed?o(this,Ii)[Ii](le.privacyArray.length>0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){o(this,Pi)[Pi]&&o(this,Ii)[Ii](o(this,Pi)[Pi]),o(this,Pi)[Pi]=null}}var _i=function(e){if(Array.isArray(e)&&e.length>0){const i=e.reduce(((e,t)=>({...e,...t})),{});let n={};const r={};var t=!1;if(i.hasOwnProperty(_)&&"boolean"==typeof(t=i.optOut)&&(r.ct_optout=t,le.isOptInRequest=!t),i.hasOwnProperty(E)){const e=i.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(E,t)}if(!$(r)){n.type="profile",n.profile=r,n=o(this,ki)[ki].addSystemDataToObject(n,void 0);const i=Ke(JSON.stringify(n),o(this,Si)[Si]);let s=o(this,xi)[xi].dataPostURL;s=qe(s,"type",L),s=qe(s,"d",i),s=qe(s,_,t?"true":"false"),o(this,ki)[ki].saveAndFireRequest(s,le.blockRequest),e.splice(0,e.length)}}},Ei=i("oldValues"),Ai=i("logger"),Li=i("request"),Mi=i("account"),Ti=i("wizAlertJSPath"),Ri=i("fcmPublicKey"),ji=i("setUpWebPush"),Di=i("setUpWebPushNotifications"),zi=i("setApplicationServerKey"),Bi=i("setUpSafariNotifications"),Ni=i("setUpChromeFirefoxNotifications"),Fi=i("addWizAlertJS"),Ui=i("removeWizAlertJS"),Vi=i("handleNotificationRegistration");class qi extends Array{constructor(e,t){let{logger:i,session:n,request:r,account:s}=e;super(),Object.defineProperty(this,Vi,{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,zi,{value:Gi}),Object.defineProperty(this,Di,{value:Ki}),Object.defineProperty(this,ji,{value:Wi}),Object.defineProperty(this,Ei,{writable:!0,value:void 0}),Object.defineProperty(this,Ai,{writable:!0,value:void 0}),Object.defineProperty(this,Li,{writable:!0,value:void 0}),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}),o(this,Ti)[Ti]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",o(this,Ri)[Ri]=null,o(this,Ei)[Ei]=t,o(this,Ai)[Ai]=i,o(this,Li)[Li]=r,o(this,Mi)[Mi]=s}push(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return o(this,ji)[ji](t),0}_processOldValues(){o(this,Ei)[Ei]&&o(this,ji)[ji](o(this,Ei)[Ei]),o(this,Ei)[Ei]=null}_enableWebPush(e,t){le.webPushEnabled=e,null!=t&&o(this,zi)[zi](t),le.webPushEnabled&&le.notifApi.notifEnabledFromApi?o(this,Vi)[Vi](le.notifApi.displayArgs):!le.webPushEnabled&&le.notifApi.notifEnabledFromApi&&o(this,Ai)[Ai].error("Ensure that web push notifications are fully enabled and integrated before requesting them")}}var Wi=function(e){le.webPushEnabled&&e.length>0?o(this,Vi)[Vi](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&o(this,Ai)[Ai].error("Make sure push notifications are fully enabled and integrated")},Ki=function(e,t,i,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?o(this,Ni)[Ni](e,t):-1!==navigator.userAgent.indexOf("Safari")&&o(this,Bi)[Bi](e,i,n)},Gi=function(e){o(this,Ri)[Ri]=e},Hi=function(e,t,i){void 0===t&&o(this,Ai)[Ai].error("Ensure that APNS Web Push ID is supplied"),void 0===i&&o(this,Ai)[Ai].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(i,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(B,t),o(this,Li)[Li].registerToken(t),o(this,Ai)[Ai].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&o(this,Ai)[Ai].info("Error subscribing to Safari web push")}))},Ji=function(e,t){let i="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));i=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===i))[0]);const n={userVisibleOnly:!0};null!=o(this,Ri)[Ri]&&(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.length;e++)o.push(i.charCodeAt(e));return new Uint8Array(o)})(o(this,Ri)[Ri])),t.pushManager.subscribe(n).then((t=>{o(this,Ai)[Ai].info("Service Worker registered. Endpoint: "+t.endpoint);const i=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(i.endpoint=i.endpoint.split("/").pop(),i.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(i.endpoint=i.endpoint.split("/").pop(),i.browser="Firefox"),ae.saveToLSorCookie(B,i),o(this,Li)[Li].registerToken(i),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{o(this,Ai)[Ai].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{o(this,Ai)[Ai].info("Unsubscription successful")})).catch((e=>{o(this,Ai)[Ai].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{o(this,Ai)[Ai].error("error registering service worker: "+e)}))},Zi=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",o(this,Ti)[Ti]),document.getElementsByTagName("body")[0].appendChild(e),e},$i=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},Yi=function(e){let t,i,n,r,s,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const o=e[0];t=o.titleText,i=o.bodyText,n=o.okButtonText,r=o.rejectButtonText,s=o.okButtonColor,a=o.skipDialog,l=o.askAgainTimeInSeconds,c=o.okCallback,d=o.rejectCallback,h=o.subscriptionCallback,u=o.serviceWorkerPath,p=o.httpsPopupPath,g=o.httpsIframePath,f=o.apnsWebPushId,v=o.apnsWebPushServiceUrl}}else t=e[0],i=e[1],n=e[2],r=e[3],s=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 o(this,Ai)[Ai].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 o(this,Di)[Di](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void o(this,Di)[Di](h,u,f,v)}if(!(t&&i&&n&&r))return void o(this,Ai)[Ai].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=s&&s.match(/^#[a-f\d]{6}$/i)||(s="#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")<l)return;ae.setMetaProp("notif_last_time",m)}if(b){const e=document.createElement("iframe");e.setAttribute("style","display:none;"),e.setAttribute("src",g),document.body.appendChild(e),window.addEventListener("message",(e=>{if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(o(this,Fi)[Fi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:i,confirmButtonText:n,confirmButtonColor:s,rejectButtonText:r},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),o(this,Ui)[Ui]()}))})}}),!1)}else o(this,Fi)[Fi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:i,confirmButtonText:n,confirmButtonColor:s,rejectButtonText:r},(e=>{e?("function"==typeof c&&c(),o(this,Di)[Di](h,u,f,v)):"function"==typeof d&&d(),o(this,Ui)[Ui]()}))}},Qi=i("variableStore");class Xi{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,Qi,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],o(this,Qi)[Qi]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return this.log("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return this.log("Variable name starts or ends with a `.` which is not allowed: "+e),null;let o="string";"number"==typeof t?o="number":"boolean"==typeof t&&(o="boolean");const n=i.getVariable(e);if(n)return n;const r=new Xi({variableStore:i});try{r.name=e,r.defaultValue=t,r.value=t,r.type=o,i.registerVariable(r),r.update(t)}catch(e){console.error(e)}return r}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||o(this,Qi)[Qi].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),o(this,Qi)[Qi].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 eo=i("logger"),to=i("account"),io=i("request"),oo=i("event"),no=i("variables"),ro=i("remoteVariables"),so=i("fetchCallback"),ao=i("variablesChangedCallbacks"),lo=i("oneTimeVariablesChangedCallbacks"),co=i("hasVarsRequestCompleted"),ho=i("runVariablesChangedCallback");class uo{constructor(e){let{logger:t,request:i,account:n,event:r}=e;Object.defineProperty(this,ho,{value:po}),Object.defineProperty(this,eo,{writable:!0,value:void 0}),Object.defineProperty(this,to,{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,no,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,so,{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:!1}),o(this,eo)[eo]=t,o(this,to)[to]=n,o(this,io)[io]=i,o(this,oo)[oo]=r,o(this,no)[no]={},o(this,ro)[ro]={},o(this,ao)[ao]=[],o(this,lo)[lo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;o(this,no)[no][t]=e,console.log("registerVariable",o(this,no)[no])}getVariable(e){return o(this,no)[no][e]}hasVarsRequestCompleted(){return o(this,co)[co]}async syncVariables(e,t){if(!o(this,to)[to].token)throw new Error("Account token is missing");const i={type:"varsPayload",vars:{}};for(var n in o(this,no)[no])i.vars[n]={defaultValue:o(this,no)[no][n].defaultValue,type:o(this,no)[no][n].type};var r={};(r=o(this,io)[io].addSystemDataToObject(r,void 0)).tk=o(this,to)[to].token,r.type="meta";const s=JSON.stringify([r,i]),a=o(this,to)[to].dataPostPEURL;try{const t=await o(this,io)[io].post(a,s);return e&&"function"==typeof e&&e(t),t}catch(e){t&&"function"==typeof t&&t(e),400===e.status?o(this,eo)[eo].error("Invalid sync payload or clear the existing draft"):401===e.status?o(this,eo)[eo].error("This is not a test profile"):o(this,eo)[eo].error("Sync variable failed")}}async fetchVariables(e){o(this,oo)[oo].push("wzrk_fetch",{t:4}),e&&"function"==typeof e&&(o(this,so)[so]=e)}mergeVariables(e){console.log("msg vars is ",e),o(this,co)[co]=!0,ae.saveToLSorCookie("WZRK_PE",e),o(this,ro)[ro]=e;for(const t in o(this,no)[no])e.hasOwnProperty(t)&&o(this,no)[no][t].update(e[t]);o(this,so)[so]&&o(this,so)[so](),o(this,ho)[ho]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(o(this,ao)[ao].push(e),this.hasVarsRequestCompleted()&&e()):o(this,eo)[eo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():o(this,lo)[lo].push(e))}removeVariablesChangedCallback(e){const t=o(this,ao)[ao].indexOf(e);-1!==t&&o(this,ao)[ao].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=o(this,lo)[lo].indexOf(e);-1!==t&&o(this,lo)[lo].splice(t,1)}}var po=function(){for(var e of o(this,ao)[ao])e();for(var t of o(this,lo)[lo])t();o(this,lo)[lo].length=0},go=i("logger"),fo=i("api"),vo=i("onloadcalled"),bo=i("device"),mo=i("session"),yo=i("account"),wo=i("request"),Co=i("variableStore"),ko=i("isSpa"),xo=i("previousUrl"),Po=i("boundCheckPageChanged"),So=i("dismissSpamControl"),Io=i("processOldValues"),Oo=i("debounce"),_o=i("checkPageChanged"),Eo=i("pingRequest"),Ao=i("isPingContinuous"),Lo=i("overrideDSyncFlag");var Mo=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},To=function(e,t){let i;return function(){clearTimeout(i),i=setTimeout(e,t)}},Ro=function(){o(this,Oo)[Oo]((()=>{o(this,xo)[xo]!==location.href&&this.pageChanged()}),300)()},jo=function(){let e=o(this,yo)[yo].dataPostURL,t={};t=o(this,wo)[wo].addSystemDataToObject(t,void 0),e=qe(e,"type","ping"),e=qe(e,"d",Ke(JSON.stringify(t),o(this,go)[go])),o(this,wo)[wo].saveAndFireRequest(e,le.blockRequest)},Do=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},zo=function(e){this._isPersonalisationActive()&&(e.dsync=!0)};const Bo=new class{get spa(){return o(this,ko)[ko]}set spa(e){const t=!0===e;o(this,ko)[ko]!==t&&1===o(this,vo)[vo]&&(t?document.addEventListener("click",o(this,Po)[Po]):document.removeEventListener("click",o(this,Po)[Po])),o(this,ko)[ko]=t}get dismissSpamControl(){return o(this,So)[So]}set dismissSpamControl(e){const t=!0===e;o(this,So)[So]=t,le.dismissSpamControl=t}constructor(){var e,t,i,n,r;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,Lo,{value:zo}),Object.defineProperty(this,Ao,{value:Do}),Object.defineProperty(this,Eo,{value:jo}),Object.defineProperty(this,_o,{value:Ro}),Object.defineProperty(this,Oo,{value:To}),Object.defineProperty(this,Io,{value:Mo}),Object.defineProperty(this,go,{writable:!0,value:void 0}),Object.defineProperty(this,fo,{writable:!0,value:void 0}),Object.defineProperty(this,vo,{writable:!0,value:void 0}),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:o(this,_o)[_o].bind(this)}),Object.defineProperty(this,So,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",o(this,vo)[vo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},o(this,go)[go]=new ni(Qt),o(this,yo)[yo]=new h(null===(e=s.account)||void 0===e?void 0:e[0],s.region||(null===(t=s.account)||void 0===t?void 0:t[1]),s.targetDomain||(null===(i=s.account)||void 0===i?void 0:i[2]),s.token||(null===(n=s.account)||void 0===n?void 0:n[3])),o(this,bo)[bo]=new ye({logger:o(this,go)[go]}),o(this,So)[So]=s.dismissSpamControl||!1,o(this,mo)[mo]=new di({logger:o(this,go)[go],isPersonalisationActive:this._isPersonalisationActive}),o(this,wo)[wo]=new wi({logger:o(this,go)[go],account:o(this,yo)[yo],device:o(this,bo)[bo],session:o(this,mo)[mo],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=s.enablePersonalization||!1,this.event=new Fe({logger:o(this,go)[go],request:o(this,wo)[wo],isPersonalisationActive:this._isPersonalisationActive},s.event),this.profile=new gt({logger:o(this,go)[go],request:o(this,wo)[wo],account:o(this,yo)[yo],isPersonalisationActive:this._isPersonalisationActive},s.profile),this.onUserLogin=new It({request:o(this,wo)[wo],account:o(this,yo)[yo],session:o(this,mo)[mo],logger:o(this,go)[go],device:o(this,bo)[bo]},s.onUserLogin),this.privacy=new Oi({request:o(this,wo)[wo],account:o(this,yo)[yo],logger:o(this,go)[go]},s.privacy),this.notifications=new qi({logger:o(this,go)[go],request:o(this,wo)[wo],account:o(this,yo)[yo]},s.notifications),o(this,Co)[Co]=new uo({logger:o(this,go)[go],request:o(this,wo)[wo],account:o(this,yo)[yo],event:this.event}),o(this,fo)[fo]=new be({logger:o(this,go)[go],request:o(this,wo)[wo],device:o(this,bo)[bo],session:o(this,mo)[mo]}),this.spa=s.spa,this.dismissSpamControl=s.dismissSpamControl,this.user=new $t({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>o(this,mo)[mo].getTimeElapsed(),getPageCount:()=>o(this,mo)[mo].getPageCount()},this.logout=()=>{o(this,go)[go].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>o(this,bo)[bo].getGuid(),this.getAccountID=()=>o(this,yo)[yo].id,this.getSCDomain=()=>o(this,yo)[yo].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{o(this,yo)[yo].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+o(this,yo)[yo].scSDKVersion};let i=o(this,yo)[yo].dataPostURL;i=qe(i,"type","page"),i=qe(i,"d",Ke(JSON.stringify(t),o(this,go)[go])),o(this,wo)[wo].saveAndFireRequest(i,le.blockRequest)},Kt()&&(Vt(),Ut(o(this,go)[go])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;o(this,go)[go].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;o(this,go)[go].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];o(this,go)[go].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))o(this,go)[go].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,i=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))o(this,go)[go].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"),i[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:i[e].wzrk_id,pivotId:i[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ft(i)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t<e.length;t++)this.markReadInboxMessage(e[t])},this.markReadAllInboxMessage=()=>{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 o(this,go)[go].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(j,e)},this.renderNotificationClicked=e=>{a(D,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=e,i.evtData={[R]:t.msgId},t.pivotId&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(i.evtData={...i.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(T)&&(i.evtData={...i.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(T)&&(i.evtData={...i.evtData,[e]:t.msgCTkv[e]});o(this,wo)[wo].processEvent(i)};this.setLogLevel=e=>{o(this,go)[go].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,N)},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,F):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,F):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,U):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,U):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,V)};const l=(e,t,i)=>{((e,t,i,o,n)=>{const r=Ve(location.href),s=r.e,a=r.p,l=r.page_type;if(void 0!==s){const r={};r.id=o.id,r.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(r.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=qe(c,"fetchGroups",i)),t&&(c=qe(c,"encoded",t)),c=qe(c,"e",s),c=qe(c,"d",Ke(JSON.stringify(r),n)),a&&(c=qe(c,"p",a)),"-1"!==e&&(c=qe(c,"sub",e)),l&&(le.globalUnsubscribe=l===O,c=qe(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,i,o(this,yo)[yo],o(this,go)[go])};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 d(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),d):console.log("Geolocation is not supported by this browser.")};const u=o(this,fo)[fo];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,o(this,mo)[mo].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{Jt(e,{device:o(this,bo)[bo],session:o(this,mo)[mo],request:o(this,wo)[wo],logger:o(this,go)[go]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,o(this,go)[go])},u.is_onloadcalled=()=>1===o(this,vo)[vo],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<t.length;e++){const i=t[e];if(i.name){const e={name:i.name,isUnsubscribed:i.checked};le.unsubGroups.push(e)}}l("2",e)},u.setSubscriptionGroups=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===(r=s.account)||void 0===r?void 0:r[0].id)&&this.init()}init(e,t,i,n){if(1===o(this,vo)[vo])return;if(ae.removeCookie("WZRK_P",window.location.hostname),!o(this,yo)[yo].id){if(!e)return void o(this,go)[go].error(ke);o(this,yo)[yo].id=e}o(this,mo)[mo].cookieName="WZRK_S_"+o(this,yo)[yo].id,t&&(o(this,yo)[yo].region=t),i&&(o(this,yo)[yo].targetDomain=i),n&&(o(this,yo)[yo].token=n);const r=location.href,s=Ve(r.toLowerCase());if(void 0!==s.e&&"0"==s.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),o(this,Io)[Io](),this.pageChanged();const a=setInterval((()=>{o(this,bo)[bo].gcookie&&(clearInterval(a),o(this,wo)[wo].processBackupEvents())}),3e3);o(this,ko)[ko]?document.addEventListener("click",o(this,Po)[Po]):document.removeEventListener("click",o(this,Po)[Po]),o(this,vo)[vo]=1}pageChanged(){const e=window.location.href,t=Ve(e.toLowerCase()),i=o(this,mo)[mo].getSessionCookieObject();let n=void 0===i.p?0:i.p;i.p=++n,o(this,mo)[mo].setSessionCookieObject(i);let r={},s=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==s){const e=120;""!==s&&(s=s.length>e?s.substring(0,e):s,r.referrer=s);let i=t.utm_source||t.wzrk_source;void 0!==i&&(i=i.length>e?i.substring(0,e):i,r.us=i);let o=t.utm_medium||t.wzrk_medium;void 0!==o&&(o=o.length>e?o.substring(0,e):o,r.um=o);let n=t.utm_campaign||t.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,r.uc=n),void 0!==t.wzrk_medium){const e=t.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(r.wm=e)}}r=o(this,wo)[wo].addSystemDataToObject(r,void 0),r.cpg=e,r.WZRK_CAMP=it();let a=o(this,yo)[yo].dataPostURL;o(this,wo)[wo].addFlags(r),1===parseInt(r.pg)&&o(this,Lo)[Lo](r),a=qe(a,"type","page"),a=qe(a,"d",Ke(JSON.stringify(r),o(this,go)[go])),o(this,wo)[wo].saveAndFireRequest(a,le.blockRequest),1===parseInt(r.pg)&&this.event.push("wzrk_fetch",{t:4}),o(this,xo)[xo]=e,setTimeout((()=>{n<=3&&o(this,Eo)[Eo](),o(this,Ao)[Ao]()&&setInterval((()=>{o(this,Eo)[Eo]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}sendLocationData(e){let t={af:{}};const i={};if(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((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=o(this,wo)[wo].addSystemDataToObject(t,void 0),o(this,wo)[wo].addFlags(t);const n=Ke(JSON.stringify(t),o(this,go)[go]);let r=o(this,yo)[yo].dataPostURL;r=qe(r,"type",L),r=qe(r,"d",n),o(this,wo)[wo].saveAndFireRequest(r,le.blockRequest)}setOffline(e){"boolean"==typeof e?(le.offline=e,e||o(this,wo)[wo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}defineVariable(e,t){return Xi.define(e,t,o(this,Co)[Co])}async syncVariables(e,t){if(4===o(this,go)[go].logLevel)return o(this,Co)[Co].syncVariables(e,t);o(this,go)[go].error("App log level is not set to 4")}async fetchVariables(e){return o(this,Co)[Co].fetchVariables(e)}addVariablesChangedCallback(e){o(this,Co)[Co].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){o(this,Co)[Co].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Bo,Bo})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I am wrong: We build our sdk and push it in the codebase itself right? And then we serve it by pushing this code from our repo to npm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
No description provided.