From fa9a4855df545eb52feba1e4e5a8d6eb8dbc4be8 Mon Sep 17 00:00:00 2001 From: Kunal SIngh Date: Wed, 13 Nov 2024 12:11:57 +0530 Subject: [PATCH] [WEB-3326] Popup Issue - Combined Changes in single release --- CHANGELOG.md | 6 ++---- clevertap.js | 6 +++--- clevertap.min.js | 2 +- package.json | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46d79ba..84e237c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,9 @@ # Change Log All notable changes to this project will be documented in this file. -## [1.11.9] 13th Nov, 2024 -- Fixed White Background issue in Web Popup - -## [1.11.8] 12th Nov, 2024 +## [1.11.8] 13th Nov, 2024 - Fixed anti-flicker for visual editor +- Fixed White Background issue in Web Popup ## [1.11.7] 11th Nov, 2024 - Fixed saving/fetching inbox messages for custom inbox diff --git a/clevertap.js b/clevertap.js index 96ea5cc..f757879 100644 --- a/clevertap.js +++ b/clevertap.js @@ -4366,7 +4366,7 @@ if (search === '?ctBuilderSDKCheck') { if (parentWindow) { - const sdkVersion = '1.11.9'; + const sdkVersion = '1.11.8'; parentWindow.postMessage({ message: 'SDKVersion', accountId, @@ -7389,7 +7389,7 @@ let proto = document.location.protocol; proto = proto.replace(':', ''); dataObject.af = { ...dataObject.af, - lib: 'web-sdk-v1.11.9', + lib: 'web-sdk-v1.11.8', protocol: proto, ...$ct.flutterVersion }; // app fields @@ -9059,7 +9059,7 @@ } getSDKVersion() { - return 'web-sdk-v1.11.9'; + return 'web-sdk-v1.11.8'; } defineVariable(name, defaultValue) { diff --git a/clevertap.min.js b/clevertap.min.js index e7bbd64..a4c0e1a 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var r=t("accountId"),s=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,r)[r]}set id(e){i(this,r)[r]=e}get region(){return i(this,s)[s]}set region(e){i(this,s)[s]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const u=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),h=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",b="WZRK_CHARGED_ID",v="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",I="WZRK_ARP",M="WZRK_L",S="global",P="optOut",O="useIP",E="WZRK_X",_="push",A=31536e3,D="wzrk_",L="wzrk_id",T="Notification Viewed",z="Notification Clicked",j="WZRK_FPU",N="WZRK_PSD",R="$incr",B="$add",U="$remove",F="$delete",V="WZRK_INBOX_CONFIG",W="WZRK_INBOX",q=1e3,G="wzrk_fetch",H="WZRK_PUSH_CONFIG",K=["Stayed","UTM Visited","App Launched","Notification Sent",T,z],Z=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Q=e=>"object"==typeof e&&e instanceof Date,Y=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},$=e=>!isNaN(parseFloat(e))&&isFinite(e),X=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,ee=e=>null!=e&&"undefined"!==e,te=(e,t)=>{if("object"!=typeof e){let i;return Z(e)?(i=ie(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=te(e[i],t);let n;n=ie(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},ie=(e,t)=>e.replace(t,""),oe=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ne=()=>Math.floor((new Date).getTime()/1e3),re=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(ae(e))return"$D_"+e},ae=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 le{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=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,de.broadDomain=r;break}}}else this.createCookie(e,t,i,r)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(M);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(M,o),i.debug("stored in ".concat(M," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(M);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(M,i))}}const de={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:{},pushConfig:null};var ce=t("keyOrder"),ue=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,ue,{value:pe}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=le.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ue)[ue](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,ue)[ue](e,this.cache):n.length===this.max&&(this.cache=i(this,ue)[ue](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}le.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var pe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let r;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:r=i);return o.splice(r,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},ge=t("logger"),fe=t("request"),be=t("device"),ve=t("session");class me{constructor(e){let{logger:t,request:o,device:n,session:r}=e;Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,ge)[ge]=t,i(this,fe)[fe]=o,i(this,be)[be]=n,i(this,ve)[ve]=r}s(e,t,o,n,r){let s=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,s=!0),void 0===n&&(n=0),le.removeBackup(n,i(this,ge)[ge]),n>de.globalCache.REQ_N)return;if(ee(i(this,be)[be].gcookie)||e&&(a=!0),!ee(i(this,be)[be].gcookie)||o||"boolean"==typeof r){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Q(e[t])&&(e[t]=re(e[t]))}return!0}return!1},ze=(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;Q(e[i])&&(e[i]=re(e[i]))}if(Z(e[f])||X(e[f])){const i=e[f]+"";if(void 0===Le&&(Le=le.readFromLSorCookie(b)),void 0!==Le&&Le.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Le=i,le.saveToLSorCookie(b,i)}return!0}return!1};var je=t("logger"),Ne=t("oldValues"),Re=t("request"),Be=t("isPersonalisationActive"),Ue=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,Ue,{value:Ve}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Re,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,Ne)[Ne]=t,i(this,Re)[Re]=n,i(this,Be)[Be]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Z(t)){i(this,je)[je].error(Ie);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),K.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=ie(t,u),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!ze(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Re)[Re].processEvent(o)}};const We=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),Ge=()=>window.location.hostname,He=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ze(e)),Ke=(()=>{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+"+/="})(),Ze=e=>{if(null==e)return"";var t,i,o,n,r,s,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},r={},s="",a="",l="",d=2,c=3,u=2,h="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,u),u++),delete r[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,u),u++),n[a]=c++,l=String(s)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,u),u++),delete r[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,u),u++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){h+=f(p);break}g++}return h})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,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+Ke.charAt(n)+Ke.charAt(r)+Ke.charAt(s)+Ke.charAt(a);return l};var Je=t("fireRequest"),Qe=t("dropRequestDueToOptOut"),Ye=t("addUseIPToRequest"),$e=t("addARPToRequest");class Xe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=q,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),q;{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=q,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Xe.logger=void 0,Xe.device=void 0,Xe.account=void 0,Object.defineProperty(Xe,Je,{value:function(e,t,o,n,r){var s,a;if(i(this,Qe)[Qe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(ee(this.device.gcookie)||(de.blockRequest=!0),r&&r===G)!ee(this.device.gcookie)&&de.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!ee(this.device.gcookie)&&de.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(ee(this.device.gcookie)&&(e=qe(e,"gc",this.device.gcookie)),e=i(this,$e)[$e](e,o)),e=qe(e,"tries",t),e=i(this,Ye)[Ye](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 d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Xe,Qe,{value:function(){return!de.isOptInRequest&&ee(this.device.gcookie)&&Z(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(de.isOptInRequest=!1,!1)}}),Object.defineProperty(Xe,Ye,{value:function(e){var t=le.getMetaProp(O);return"boolean"!=typeof t&&(t=!1),qe(e,O,t?"true":"false")}}),Object.defineProperty(Xe,$e,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return qe(e,"arp",He(JSON.stringify(t),this.logger))}return le._isLocalStorageSupported()&&void 0!==localStorage.getItem(I)&&null!==localStorage.getItem(I)?qe(e,"arp",He(JSON.stringify(le.readFromLSorCookie(I)),this.logger)):e}});const et=()=>{let e={};if(le._isLocalStorageSupported()){let t=le.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},tt=e=>{if(le._isLocalStorageSupported()){const t={...et(),...e},i=JSON.stringify(t);le.save(y,encodeURIComponent(i)),it()}},it=()=>{if(le._isLocalStorageSupported()){let i=le.read(v);if(ee(i))try{i=JSON.parse(decodeURIComponent(le.read(v)));const o=le.read(w)?JSON.parse(decodeURIComponent(le.read(w))):{};if(i&&le._isLocalStorageSupported()){var e={},t=et();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=oe(),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,le.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},ot=()=>{const e=JSON.parse(decodeURIComponent(le.read(v)));let t={};if(le._isLocalStorageSupported()){let i={};t=et();const o=le.read(w),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=oe();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:s,witlc:a},i}},nt=(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(/\b(?:[mM](?:ale)?|[fF](?:emale)?|[oO](?:thers)?|[uU](?:nknown)?)\b/)||(o=!1,i.error(Me)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Pe)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&($(n)?e.Age=+n:(o=!1,i.error(Ee))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Q(n)||(o=!1,i.error(_e)),Q(n)&&(e[t]=re(n))):Q(n)&&(e[t]=re(n)),"Phone"!==t||Y(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),$(n)?e.Phone=+n:(o=!1,i.error(De+". Removed."))):(o=!1,i.error(De+". Removed."))),o||delete e[t]}return o},rt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(le._isLocalStorageSupported()){if(null==de.globalProfileMap&&(de.globalProfileMap=le.readFromLSorCookie(x),null==de.globalProfileMap&&(de.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(de.globalProfileMap.hasOwnProperty(i)&&!t)continue;de.globalProfileMap[i]=e[i]}null!=de.globalProfileMap._custom&&delete de.globalProfileMap._custom,le.saveToLSorCookie(x,de.globalProfileMap)}},lt=(e,t,i)=>{if(null!=e&&"-1"!==e&&le._isLocalStorageSupported()){const t=et();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",tt(t)}if(null!=de.campaignDivMap){const t=de.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t?null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"):"wizParDiv0"===t?null!=document.getElementById("intentOpacityDiv0")&&(document.getElementById("intentOpacityDiv0").style.display="none"):"wizParDiv2"===t&&null!=document.getElementById("intentOpacityDiv2")&&(document.getElementById("intentOpacityDiv2").style.display="none"))}};var dt=t("logger"),ct=t("request"),ut=t("account"),ht=t("oldValues"),pt=t("isPersonalisationActive"),gt=t("processProfileArray");class ft extends Array{constructor(e,t){let{logger:o,request:n,account:r,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,gt,{value:bt}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),i(this,dt)[dt]=o,i(this,ct)[ct]=n,i(this,ut)[ut]=r,i(this,ht)[ht]=t,i(this,pt)[pt]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o{const t="number"==typeof e?e:e.toLowerCase();r.includes(t)||r.push(t)};if(Array.isArray(t))t.forEach((e=>{"string"==typeof e||"number"==typeof e?s(e):i(this,dt)[dt].error("Array supports only string or number type values")}));else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,dt)[dt].error("Unsupported value type");s(t)}de.globalProfileMap[e]=r,le.saveToLSorCookie(x,de.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueRemove(e,t,o){if(null==de.globalProfileMap&&(de.globalProfileMap=le.readFromLSorCookie(x)||{}),!de.globalProfileMap.hasOwnProperty(e))return void i(this,dt)[dt].error("The property ".concat(e," does not exist."));const n=t=>{const i=de.globalProfileMap[e].indexOf(t);-1!==i&&de.globalProfileMap[e].splice(i,1)};if(Array.isArray(t))t.forEach(n);else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,dt)[dt].error("Unsupported propVal type");n(t)}0===de.globalProfileMap[e].length&&delete de.globalProfileMap[e],le.saveToLSorCookie(x,de.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueDelete(e,t){var o;null==de.globalProfileMap&&(de.globalProfileMap=le.readFromLSorCookie(x)),(null==de||null===(o=de.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))?delete de.globalProfileMap[e]:i(this,dt)[dt].error("The property ".concat(e," does not exist.")),le.saveToLSorCookie(x,de.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,o){let n={};const r={};n.type="profile",r[e]={[o]:o===F||t},null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=r,n=i(this,ct)[ct].addSystemDataToObject(n,!0),i(this,ct)[ct].addFlags(n);const s=He(JSON.stringify(n),i(this,dt)[dt]);let a=i(this,ut)[ut].dataPostURL;a=qe(a,"type",_),a=qe(a,"d",s),i(this,ct)[ct].saveAndFireRequest(a,de.blockRequest)}}var bt=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,r={};if(null!=o.Site){if(n=o.Site,Y(n)||!nt(n,{logger:i(this,dt)[dt]}))return}else if(null!=o.Facebook){const e=o.Facebook;Y(e)||e.error||(n=rt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];Y(e)||e.error||(n=st(e,{logger:i(this,dt)[dt]}))}if(null!=n&&!Y(n)){r.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),r.profile=n,at(n,!0),r=i(this,ct)[ct].addSystemDataToObject(r,void 0),i(this,ct)[ct].addFlags(r);const e=He(JSON.stringify(r),i(this,dt)[dt]);let t=i(this,ut)[ut].dataPostURL;t=qe(t,"type",_),t=qe(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,de.blockRequest)}}},vt=t("request"),mt=t("logger"),yt=t("account"),wt=t("session"),Ct=t("oldValues"),kt=t("device"),xt=t("processOUL"),It=t("handleCookieFromCache"),Mt=t("deleteUser"),St=t("processLoginArray");class Pt extends Array{constructor(e,t){let{request:o,account:n,session:r,logger:s,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Mt,{value:_t}),Object.defineProperty(this,It,{value:Et}),Object.defineProperty(this,xt,{value:Ot}),Object.defineProperty(this,vt,{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}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,yt)[yt]=n,i(this,wt)[wt]=r,i(this,mt)[mt]=s,i(this,Ct)[Ct]=t,i(this,kt)[kt]=a}clear(){i(this,mt)[mt].debug("clear called. Reset flag has been set."),i(this,Mt)[Mt](),le.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=le.readFromLSorCookie(m);const n=le.readFromLSorCookie(v);let r;if(null==o)o={},r=e;else{r=o.id;let s=!1,a=!1;if(null==r&&(r=e[0],s=!0),null==de.LRU_CACHE&&le._isLocalStorageSupported()&&(de.LRU_CACHE=new he(100)),s)null!=n&&(de.LRU_CACHE.set(r,n),de.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(de.LRU_CACHE.cache[i]){r=i,a=!0;break}}if(a){r!==de.LRU_CACHE.getLastKey()?i(this,It)[It]():(t=!1,le.saveToLSorCookie(j,t));const e=de.LRU_CACHE.get(r);de.LRU_CACHE.set(r,e),le.saveToLSorCookie(v,e),i(this,kt)[kt].gcookie=e;const o=de.LRU_CACHE.getSecondLastKey();if(le.readFromLSorCookie(j)&&-1!==o){const e=de.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else s?null!=n&&(i(this,kt)[kt].gcookie=n,le.saveToLSorCookie(v,n),t=!1):this.clear(),le.saveToLSorCookie(j,!1),r=e[0]}o.id=r,le.saveToLSorCookie(m,o)};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,Y(s)||!nt(s,{logger:i(this,mt)[mt]}))return}else if(null!=r.Facebook){const e=r.Facebook;Y(e)||e.error||(s=rt(e))}else if(null!=r["Google Plus"]){const e=r["Google Plus"];Y(e)&&!e.error&&(s=st(e,{logger:i(this,mt)[mt]}))}if(null!=s&&!Y(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;const e=[];le._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&&o(e)),at(s,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=He(JSON.stringify(a),i(this,mt)[mt]);let r=i(this,yt)[yt].dataPostURL;r=qe(r,"type",_),r=qe(r,"d",n),i(this,vt)[vt].saveAndFireRequest(r,de.blockRequest,t)}}},Et=function(){de.blockRequest=!1,console.debug("Block request is false"),le._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),le.removeCookie(y,Ge()),le.removeCookie(i(this,wt)[wt].cookieName,de.broadDomain),le.removeCookie(I,de.broadDomain),i(this,wt)[wt].setSessionCookieObject("")},_t=function(){de.blockRequest=!0,i(this,mt)[mt].debug("Block request is true"),de.globalCache={gcookie:null,REQ_N:0,RESP_N:0},le._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),le.removeCookie(v,de.broadDomain),le.removeCookie(y,Ge()),le.removeCookie(m,Ge()),le.removeCookie(i(this,wt)[wt].cookieName,de.broadDomain),le.removeCookie(I,de.broadDomain),i(this,kt)[kt].gcookie=null,i(this,wt)[wt].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)){le.setInstantDeleteFlagInK();try{i(this,xt)[xt]([t])}catch(e){i(this,mt)[mt].debug(e)}}else i(this,mt)[mt].error("Profile object is in incorrect format")}};class Dt 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&&le._isLocalStorageSupported()){const i=et();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",tt(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 Lt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class Tt 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.checkForWebInbox(e)||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.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:le.readFromLSorCookie(V)||{},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=Rt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),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 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++})),Bt(t),this.inbox&&(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 Lt(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"}checkForWebInbox(e){const t=le.readFromLSorCookie(V)||{};return this.inboxSelector.contains(e.target)||document.getElementById(t.inboxSelector).contains(e.target)}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=Rt();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(de.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=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Rt();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:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:u,headerCategoryHeight:h}=e;return'\n \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 \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const zt=e=>{e.inbox_preview?de.inbox.incomingMessagesForPreview=e.inbox_notifs:de.inbox.incomingMessages=e},jt=e=>{Ft(),de.inbox=new Tt({logger:e}),document.body.appendChild(de.inbox)},Nt=e=>{const t=le.readFromLSorCookie(W)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,le.saveToLSorCookie(W,i),i}return t},Rt=()=>{const e=JSON.parse(decodeURIComponent(le.read(v)));if(!ee(e))return{};const t=Nt(e);return t.hasOwnProperty(e)?t[e]:{}},Bt=e=>{const t=JSON.parse(decodeURIComponent(le.read(v)));if(!ee(t))return;const i={...Nt(t),[t]:e};le.saveToLSorCookie(W,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)jt(e),t();else{const i=le.readFromLSorCookie(V)||{},o=()=>{null===de.inbox&&jt(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)}}}))}})),Ft=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",Tt),customElements.define("ct-inbox-message",Lt))},Vt=(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,d=a.y+n,c=a.left+o,u=a.right+o,h=a.top+n,p=a.bottom,g=a.height,f=a.width;let b,v,m=!1;const y=16;if(p+t<=s){const e=s-(p+t);v=e>=y?p+y:p+e}else if(h-t>=n){const e=h-t;v=e>=y?h-t-y:h-t-e}else m=!0,v=d+g/2-t/2,vs&&(v=s-t);if(m){const e=u+i;if(e<=r){b=u+(e+y<=r?y:r-e)}else{const e=c-i;b=e-(e-y>=o?y:e-o)}}else b=l+f/2-i/2,br&&(b=u-i>=o?u-i:r-i);return{xPos:b,yPos:v}},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")))},qt=()=>Object.keys(le.readFromLSorCookie(V)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Kt="https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css",Zt="wve-anti-flicker-show",Jt="wve-anti-flicker-hide",Qt="wve-flicker-style",Yt=e=>{if(e.data&&function(e){try{const t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){{const t=new URL(e.data.originUrl).origin;if(e.origin!==t)return}var t,i;if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,$t(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{},e.data.personalisation);else"Overlay"===e.data.message&&oi(e.data,!0)}},$t=(e,t,i,o)=>{"complete"===document.readyState?ii(e,t,i,o):document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&ii(e,t,i,o)}))};let Xt,ei=!1,ti=!1;function ii(e,t,i,o){if(!ei){window.Shopify&&(ti=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",Xt=document.createElement("div"),Xt.id="overlayDiv",Xt.style.position="relative",Xt.style.display="flex",document.body.appendChild(Xt);(function(e,t,i,o,n){return new Promise(((r,s)=>{var a=document.createElement("script");a.type="module",a.src=e,a.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o,isShopify:ti,personalisation:n}),r()):s(new Error("ContentLayout not found in overlay.js"))},a.onerror=function(e){s(e)},document.head.appendChild(a)}))})("https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js",e,t,i,o).then((()=>{console.log("Overlay script loaded successfully."),ei=!0})).catch((e=>{console.error("Error loading overlay script:",e)})),(n=document.createElement("link")).rel="stylesheet",n.type="text/css",n.href=Kt,document.head.appendChild(n)}var n}const oi=(e,t)=>{const i=t?e.details:e.display.details;let o=!1;const n={msgId:e.wzrk_id,pivotId:e.wzrk_pivot},r=()=>{t||o||(o=!0,window.clevertap.renderNotificationViewed(n))},s=(i,o)=>{var r;o.values&&(o.values.html?i.outerHTML=o.values.html:(null===(r=o.values)||void 0===r?void 0:r.json)?function(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}(e,o.values):(n.msgCTkv={wzrk_selector:o.selector},function(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t.style&&Object.keys(t.style).forEach((i=>{e.style.setProperty(i,t.style[i])})),void 0!==t.underline){const i=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(i," underline").trim():e.style.textDecoration=i.replace("underline","").trim()}if(void 0!==t.text&&(e.innerText=o?t.text.text:t.text),void 0!==t.clickDetails){const n=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?()=>{o||window.clevertap.raiseNotificationClicked(i),window.open(n,"_blank").focus()}:()=>{o||window.clevertap.raiseNotificationClicked(i),window.location.href=n}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){const e=document.createElement("style");e.innerHTML=t.elementCss,document.head.appendChild(e)}}(i,o.values.form,n,t)))};i.forEach((e=>{e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((e=>{const t=document.querySelector(e.selector);t?(r(),s(t,e)):(e=>{let t=0;const i=setInterval((()=>{const o=document.querySelector(e.selector);o?(r(),s(o,e),clearInterval(i)):++t>=20&&(console.log("No element present on DOM with selector '".concat(e,"'.")),clearInterval(i))}),500)})(e)}))}))};function ni(e){const{personalizedSelectors:t=[],delayTime:i=2e3}=e,o={};let n,r=0;function s(e){function t(e){const t=[];e.forEach((e=>{const i=document.querySelectorAll(e);i.length?(i.forEach((e=>{(function(e){const t=e.getBoundingClientRect(),{innerHeight:i,innerWidth:o}=window;return t.bottom>0&&t.right>0&&t.tope.classList.add(Jt))),setTimeout((()=>{e.forEach((e=>{e.classList.remove(Jt),e.classList.add(Zt)}))}),i)}(t)}t(e),Object.keys(o).length&&(n=setInterval((function(){t(Object.keys(o)),r++,(0===Object.keys(o).length||r>20)&&(r=0,clearInterval(n))}),100))}!function(){const e=Qt;if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important;\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important;\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("DOMContentLoaded",(()=>{!function(){let e=document.location.href;new MutationObserver((()=>{e!==document.location.href&&(e=document.location.href,s(t))})).observe(document.body,{childList:!0,subtree:!0})}()})),s(t)}class ri extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class si 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",ri)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}const ai=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ri);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)},li=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",si);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)},di=e=>{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});document.dispatchEvent(i)},ci=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},ui=(e,t)=>{const i="