mergn-webapp-sdk 1.0.120 → 1.0.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,76 +1 @@
1
- /* Copyright (c) 2024 MERGN */
2
- "use strict";(()=>{var ln=Object.defineProperty,dn=Object.defineProperties;var un=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var pn=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var gt=l=>{throw TypeError(l)};var pt=(l,e,t)=>e in l?ln(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,z=(l,e)=>{for(var t in e||(e={}))pn.call(e,t)&&pt(l,t,e[t]);if(ut)for(var t of ut(e))gn.call(e,t)&&pt(l,t,e[t]);return l},Pe=(l,e)=>dn(l,un(e));var We=(l,e,t)=>e.has(l)||gt("Cannot "+t);var d=(l,e,t)=>(We(l,e,"read from private field"),t?t.call(l):e.get(l)),m=(l,e,t)=>e.has(l)?gt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,t),I=(l,e,t,n)=>(We(l,e,"write to private field"),n?n.call(l,t):e.set(l,t),t),i=(l,e,t)=>(We(l,e,"access private method"),t);var a=(l,e,t)=>new Promise((n,r)=>{var o=v=>{try{h(t.next(v))}catch(b){r(b)}},c=v=>{try{h(t.throw(v))}catch(b){r(b)}},h=v=>v.done?n(v.value):Promise.resolve(v.value).then(o,c);h((t=t.apply(l,e)).next())});var mt="1.0.120";var ge="https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api",ke="/attribute",Et="/set-attribute",Fe="/event",vt="/record-event";var It="/customer",St="/device/add-device-token",ft="/set-identity",ht="/brand/get-web-push-public-key",bt="/brand/get-time";var yt=(v=>(v.UTM_SOURCE="utm_source",v.UTM_MEDIUM="utm_medium",v.UTM_CAMPAIGN="utm_campaign",v.UTM_TERM="utm_term",v.UTM_CONTENT="utm_content",v.GAD_SOURCE="gad_source",v.GCLID="gclid",v.FBCLID="fbclid",v))(yt||{});var wt=new Set(Object.values(yt));var te="Popup Action";var re,$,ne,w=class w{constructor(){m(this,$)}static getInstance(){return d(w,re)||I(w,re,new w),d(w,re)}updateAPIKey(e){w.apiKey=e;let t=e,n=/m(\d+)rgn/,r=t.match(n);r&&(w.brandId=r[1])}getAPIKey(){return w.apiKey}getBrandId(){return w.brandId}get(e){return a(this,null,function*(){try{return(yield fetch(ge+e,{headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"}})).json()}catch(t){let n=t.message;return this.getBrandId()==="67"&&n!=="Failed to fetch"&&n!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`get - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${t.message}`}]},!0),Promise.reject(t)}})}post(e,t,n){return a(this,null,function*(){try{return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"POST",signal:n})).json()}catch(r){let o=r.message;return this.getBrandId()==="67"&&o!=="Failed to fetch"&&o!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`post - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${JSON.stringify(t||{})} -${r.message}`}]},!0),Promise.reject(r)}})}put(e,t){return a(this,null,function*(){return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"PUT"})).json()})}syncRealWorldTime(){return a(this,null,function*(){try{let e=(yield(yield fetch(ge+bt)).json()).data;w.UTCDate=new Date(e),w.lastSyncTime=new Date}catch(e){s(2,"Failed to sync real-world time")}})}getCurrentUTCDate(){if(!w.UTCDate||!w.lastSyncTime)return s(2,"UTC Date or last sync time is not set"),new Date;let t=new Date().getTime()-w.lastSyncTime.getTime();return new Date(w.UTCDate.getTime()+t)}};re=new WeakMap,$=new WeakSet,ne=function(e){return btoa(`${e}:${new Date().getTime()}`)},m(w,re);var Be=w,N=Be.getInstance();var G,ie,x,Tt,$e,Pt,Nt,V=class V{constructor(){m(this,x);m(this,ie,!1)}static getInstance(){var e;return d(V,G)||(I(V,G,new V),i(e=d(V,G),x,Tt).call(e)),d(V,G)}recordAttribute(e,t,n){return a(this,null,function*(){yield A("# recordAttribute",()=>a(this,null,function*(){if(s(1,"Recording attribute"),C("Recording attribute",!0),L("Recording attribute Time",!0),s(1,`Attribute Payload:
3
- ${{attributeName:e,attributeProperties:n,attributeValue:t}})}`),!t||t===""){s(2,"Attribute value is required");return}yield E.checkTTL(),yield i(this,x,Pt).call(this);let r=JSON.parse(localStorage.getItem("attributes")||"{}"),o=n?i(this,x,$e).call(this,r,e,n):i(this,x,$e).call(this,r,e);if(typeof o=="string"){s(2,o);return}r[e].should_set_identity&&(yield E.setIdentity(typeof t=="string"?t:JSON.stringify(t))),E.updateSessionCreated();let{id:c}=r[e],h={attributeId:c,attributeProperties:o,customerId:localStorage.getItem("customer")||"",value:t};yield i(this,x,Nt).call(this,h);let v=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");v.pop(),localStorage.setItem("preInitializedAttributes",JSON.stringify(v)),L("Recording attribute Time",!1),C("Recording attribute",!1)}))})}storeAttributeInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("attributes")&&!d(this,ie)){I(this,ie,!0);try{let e=(yield this.fetchAttributeData()).data;e&&localStorage.setItem("attributes",JSON.stringify(e))}catch(e){throw new Error("Error storing attribute data in local storage")}finally{I(this,ie,!1)}}})}fetchAttributeData(){return a(this,null,function*(){try{return yield N.get(`${ke}`)}catch(e){throw new Error("Error fetching attribute data")}})}};G=new WeakMap,ie=new WeakMap,x=new WeakSet,Tt=function(){return a(this,null,function*(){})},$e=function(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,t))return`Attribute ${t} is not valid.`;if(!n)return[];let r=e[t];if(!(r!=null&&r.attributeProperty))return`Attribute ${t} does not have a valid attributeProperty.`;let o=n.filter(({attributeProperty:c})=>!Object.prototype.hasOwnProperty.call(r.attributeProperty,c)).map(({attributeProperty:c})=>c);return o.length>0?`Attribute ${t} has invalid attributeProperties: ${o.join(", ")}.`:n.map(({attributeProperty:c,value:h})=>({attributePropertyId:r.attributeProperty[c].id,value:h}))},Pt=function(){return a(this,null,function*(){localStorage.getItem("attributes")||(yield this.storeAttributeInLocalStorage())})},Nt=function(e){return a(this,null,function*(){try{return yield N.post(`${ke}${Et}`,e)}catch(t){throw new Error("Error posting attribute record")}})},m(V,G);var Me=V,me=Me.getInstance();var Ve="Content Card Action";var Y,T,At,Je,Rt,Ot,se,Ne,Lt,Ct,Dt,_e,K=class K{constructor(){m(this,T);m(this,se,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadContentCardEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="ContentCard",actionMethod:e=>i(this,T,Je).call(this,e.campaignId),localStorageKey:"action"})};m(this,_e,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(K,Y)||(I(K,Y,new K),i(e=d(K,Y),T,At).call(e)),d(K,Y)}showContentCard(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"ContentCard already in cache");return}i(this,T,Dt).call(this,e),d(this,_e).call(this),i(this,T,Je).call(this,e.campaignId)}isContentCardAction(e){return e==="content_card"}};Y=new WeakMap,T=new WeakSet,At=function(){return a(this,null,function*(){})},Je=function(e){let t=i(this,T,Rt).call(this);if(document.getElementById(`contentCard_container_${e}`)){s(1,"ContentCard already displayed"),d(this,se).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,T,Ot).call(this,t[e]);break}case"IMMEDIATELY":{i(this,T,Ne).call(this,t[e]);break}case"SCROLL":{i(this,T,Ct).call(this,t[e]);break}default:return}},Rt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Ot=function(e){E.showDelayedAction({clearActionMethod:d(this,se).bind(this),data:e,displayMethod:i(this,T,Ne).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},se=new WeakMap,Ne=function(e){var t;if(document.getElementById(`contentCard_container_${e.campaignId}`))s(1,"ContentCard already displayed");else{let n=i(this,T,Lt).call(this,"div",e),r=document.querySelector(`#${e.message.divId}`);r&&(r.innerHTML=n.outerHTML,u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ve,eventProperties:[{eventProperty:"Content Card View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"}),(t=document.getElementById(`contentCard_container_${e.campaignId}`))==null||t.addEventListener("click",()=>{u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ve,eventProperties:[{eventProperty:"Content Card Click",value:JSON.stringify({campaignId:e.campaignId})}],name:"click"})}))}d(this,se).call(this,e.campaignId)},Lt=function(e,t){var c;let{campaignId:n,message:{design:r}}=t,o=document.createElement(e);return o.id=`contentCard_container_${n}`,o.innerHTML=r,(c=o.querySelector(".u-close-button"))==null||c.remove(),o},Ct=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,T,Ne).bind(this),timeValueKey:"campaignEntryTimeValue"})},Dt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},_e=new WeakMap,m(K,Y);var Ke=K,ae=Ke.getInstance();var ce,B,le,q,Ee,ve,S,je,Ut,ze,Ae,xt,Le,Re,Ge,Wt,Oe,Ie,kt,f=class f{constructor(){m(this,S);this.permission=null;this.pushMessageToSW=e=>{s(1,"Pushing message to service worker"),navigator.serviceWorker.getRegistrations().then(t=>{var n,r;s(1,"Service Worker registration"),(n=t[0])!=null&&n.active&&(s(1,"Service Worker ready"),(r=t[0].active)==null||r.postMessage(JSON.stringify(e)))}).catch(t=>{s(2,`Failed to push message to service worker: ${t.message}`)})};this.loadWebPushActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:()=>!0,actionMethod:e=>i(this,S,Re).call(this,Number(e.web_optin_instance_id)),localStorageKey:"web_push_action"})};m(this,Le,()=>{E.storeActionInLocalStorageInternal("web_push_action")});m(this,Ie,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"web_push_action"})})}static getInstance(){return d(f,ce)||I(f,ce,new f),d(f,ce)}init(e,t){return a(this,null,function*(){var n;if(s(1,"Initializing Notification Service"),u.recordDebugEvents({eventName:"init",eventProperties:[{eventProperty:"service_worker",value:"serviceWorker"in navigator},{eventProperty:"push_manager",value:"PushManager"in window}]}),"serviceWorker"in navigator&&"PushManager"in window){s(1,"Service Worker and Push Manager are supported");try{u.recordDebugEvents({eventName:"init_condition"}),I(f,B,yield navigator.serviceWorker.register(t||"/mergn-sw.js")),s(1,"Service Worker registered"),s(1,"Pushing message to service worker for initialization"),this.pushMessageToSW({customer:localStorage.getItem("customer")||"",events:u.getStoredEvents(),API_KEY:N.getAPIKey(),device_id:localStorage.getItem("uniqueIdentity")||"",operatingSystem:E.getOperatingSystem(),osVersion:E.getOSVersion(),Platform:E.getPlatform()}),I(f,Ee,!0);let r=i(this,S,Ge).call(this),o=Object.keys(r||{});if(o.length&&i(this,S,Re).call(this,Number(o[0])),!e)return;let c=yield(n=d(f,B))==null?void 0:n.pushManager.getSubscription();s(1,"Checking for existing subscription"),d(f,B)&&(s(1,"Service Worker registration is available"),d(f,B).update()),c?(s(1,"Existing subscription found"),u.recordDebugEvents({eventName:"existing_subscription"}),yield i(this,S,Ae).call(this),I(f,le,!0)):(s(1,"No existing subscription found"),yield i(this,S,je).call(this,d(f,ve)||void 0))}catch(r){let o=r&&r.message?r.message.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"Reachability Push Web",eventProperties:[{eventProperty:"message",value:`${o}`}]}),s(2,"Service Worker registration failed:"),s(2,o)}}})}showNotification(e){if(!d(f,Ee)){I(f,ve,e),u.recordDebugEvents({eventName:"notification_service_not_initialized"}),s(2,"Notification service is not initialized");return}A("showNotification",()=>a(this,null,function*(){let t=JSON.parse(localStorage.getItem("web_push_action")||"{}");if(t&&t[e.web_optin_instance_id]){s(1,"Notification already in cache");return}i(this,S,xt).call(this,e),d(this,Le).call(this),i(this,S,Re).call(this,e.web_optin_instance_id)}))}};ce=new WeakMap,B=new WeakMap,le=new WeakMap,q=new WeakMap,Ee=new WeakMap,ve=new WeakMap,S=new WeakSet,je=function(e){return a(this,null,function*(){s(1,`Checking notification permission: ${JSON.stringify(e)} `),u.recordDebugEvents({eventName:"check_permission"});let t;try{t=Notification.permission,t&&(s(1,`Notification permission: ${t}`),t==="default"?(e||(this.permission="default",u.recordDebugEvents({eventName:"Turned Off Notification Reset Permission"})),e&&(u.recordDebugEvents({eventName:"notification_data",eventProperties:[{eventProperty:"type",value:`${e==null?void 0:e.type}`}]}),d(this,Ie).call(this,e.web_optin_instance_id),e.type==="two_step"?i(this,S,Ut).call(this,e):yield i(this,S,ze).call(this,e))):t==="denied"?(u.recordDebugEvents({eventName:"Turned Off Notification"}),s(1,"The user has blocked notifications.")):(u.recordDebugEvents({eventName:"already_registered"}),s(1,"The user has already enabled notifications."),d(f,le)||(yield i(this,S,Ae).call(this),yield u.recordEvent({eventName:"Already Registered To Web Push"}),e||I(f,le,!0))))}catch(n){s(2,"Failed to check notification permission"),u.recordDebugEvents({eventName:"notification_permission_error"})}})},Ut=function(e){try{let t=document.createElement("div"),n;e.banner_design.banner_image&&(n=document.createElement("img"),n.src=e.banner_design.banner_image,n.alt="Image",n.id="centered-image");let r=document.createElement("div"),o=document.createElement("div"),c=document.createElement("div"),h=document.createElement("img"),v=document.createElement("div"),b=document.createElement("div"),y=document.createElement("div"),D=document.createElement("div"),k=document.createElement("div"),F=document.createElement("div"),O=document.createElement("button"),_=document.createElement("button");t.className="mergn-overlay",r.className="mergnWebPushPopup",o.className=D.className=k.className="mergn-row",c.className="mergn-column-25",v.className="mergn-column-75",F.className="button-container",b.id="title",y.id="subtitle",O.id="button-1",_.id="button-2",h.src=e.banner_design.banner_icon,h.alt="Image",h.id="logo",b.textContent=e.banner_design.banner_title,y.textContent=e.banner_design.banner_text,O.textContent=e.banner_design.button_1.text,_.textContent=e.banner_design.button_2.text,c.appendChild(h),v.appendChild(b),v.appendChild(y),o.appendChild(c),o.appendChild(v),n&&(D.appendChild(n),n.style.cssText=`
4
- max-width: 100%;
5
- height: auto;
6
- display: block;
7
- margin-left: auto;
8
- margin-right: auto;
9
- border-radius: 10px;
10
- max-width: 350px;
11
- aspect-ratio: 2 / 1;
12
- `),F.appendChild(O),F.appendChild(_),k.appendChild(F),r.appendChild(o),r.appendChild(D),r.appendChild(k),t.appendChild(r),t.style.cssText=`
13
- position: fixed;
14
- top: 0;
15
- left: 0;
16
- width: 100%;
17
- height: 100%;
18
- background-color: rgba(0, 0, 0, 0.5);
19
- z-index: 99999999999;
20
- display: flex;
21
- justify-content: center;
22
- align-items: start;
23
- `,r.style.cssText=`
24
- background-color: ${e.banner_design.banner_color};
25
- padding: 15px;
26
- border-radius: 5px;
27
- max-width: 380px;
28
- max-height: 463px;
29
- `,o.style.cssText=D.style.cssText=k.style.cssText=`
30
- display: flex;
31
- flex-wrap: wrap;
32
- margin-bottom: 10px;
33
- `,c.style.cssText=`
34
- width: 25%;
35
- `,v.style.cssText=`
36
- width: 73%;
37
- margin-left: 2%;
38
- `,h.style.cssText=`
39
- max-width: 100%;
40
- height: auto;
41
- `,O.style.cssText=`
42
- padding: 12px 20px;
43
- border: none;
44
- background-color: ${e.banner_design.button_1.backgroundColor};
45
- color: ${e.banner_design.button_1.color};
46
- cursor: pointer;
47
- border-radius: 5px;
48
- width: 48%;
49
- `,_.style.cssText=`
50
- padding: 12px 20px;
51
- border: none;
52
- background-color: ${e.banner_design.button_2.backgroundColor};
53
- color: ${e.banner_design.button_2.color};
54
- cursor: pointer;
55
- border-radius: 5px;
56
- width: 48%;
57
- `,F.style.cssText=`
58
- display: flex;
59
- justify-content: space-between;
60
- align-items: center;
61
- flex-wrap: nowrap;
62
- width: 100%;
63
- `,b.style.cssText=`
64
- margin-bottom: 5px;
65
- font-size: 16px;
66
- color: ${e.banner_design.text_color}
67
- `,y.style.cssText=`
68
- margin-bottom: 5px;
69
- font-size: 13px;
70
- color: ${e.banner_design.text_color}
71
- `,document.body.appendChild(t),document.body.style.overflow="hidden",u.recordEvent({eventName:"Viewed Web Push Soft-ask",name:"viewed",web_optin_instance_id:e.web_optin_instance_id}),O==null||O.addEventListener("click",()=>a(this,null,function*(){t.remove(),I(f,q,!1),document.body.style.overflow="auto",yield u.recordEvent({eventName:"Denied Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),s(1,"User denied the notification permission.")})),_==null||_.addEventListener("click",()=>a(this,null,function*(){t.remove(),document.body.style.overflow="auto",u.recordEvent({eventName:"Accepted Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),yield i(this,S,ze).call(this,e)}))}catch(t){}},ze=function(e){return a(this,null,function*(){try{u.recordEvent({eventName:"Displayed Web Push Subscription",name:"viewed",web_optin_instance_id:e.web_optin_instance_id});let t=yield Notification.requestPermission();t==="granted"?(s(1,"User granted the notification permission."),yield i(this,S,Ae).call(this),yield u.recordEvent({eventName:"Allowed Web Push Subscription",name:"subscribed",web_optin_instance_id:e.web_optin_instance_id})):t==="denied"?(yield u.recordEvent({eventName:"Blocked Web Push Subscription"}),s(1,"User denied the notification permission.")):t==="default"&&(yield u.recordEvent({eventName:"Closed Web Push Subscription"}),s(1,"User closed the notification permission dialog."))}catch(t){s(2,"Failed to request notification permission")}I(f,q,!1)})},Ae=function(){return a(this,null,function*(){var t,n;let e=yield N.get(`${ht}`);if(e.success){let r=yield(t=d(f,B))==null?void 0:t.pushManager.getSubscription();r&&(yield r.unsubscribe());let o=yield(n=d(f,B))==null?void 0:n.pushManager.subscribe({applicationServerKey:e.data||"",userVisibleOnly:!0});yield N.put(`${St}`,{device_id:localStorage.getItem("uniqueIdentity")||"",is_web_push_subscribed:!0,web_push_subscription_page_url:window.location.pathname,web_push_token:{token:JSON.parse(JSON.stringify(o))}}),s(1,"User is subscribed")}else throw new Error("Failed to subscribe the user")})},xt=function(e){E.storeActionInLocalStorage(e,"web_push_action","web_optin_instance_id")},Le=new WeakMap,Re=function(e){if(d(f,q))return;I(f,q,!0);let t=i(this,S,Ge).call(this);if(t!=null&&t[e])switch(t[e].entry_time){case"DELAY":{i(this,S,Wt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,S,Oe).call(this,t[e]);break}case"SCROLL":{i(this,S,kt).call(this,t[e]);break}default:return}},Ge=function(){let e=localStorage.getItem("web_push_action");return e?JSON.parse(e):null},Wt=function(e){E.showDelayedAction({clearActionMethod:d(this,Ie).bind(this),data:e,displayMethod:i(this,S,Oe).bind(this),idKey:"web_optin_instance_id",timeValueKey:"entry_time_value"})},Oe=function(e){i(this,S,je).call(this,e)},Ie=new WeakMap,kt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,S,Oe).bind(this),timeValueKey:"entry_time_value"})},m(f,ce),m(f,B,null),m(f,le,!1),m(f,q,!1),m(f,Ee,!1),m(f,ve,null);var He=f,W=He.getInstance();var Q,P,Ft,qe,Bt,Mt,de,Ce,$t,Vt,Kt,De,J=class J{constructor(){m(this,P);m(this,de,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadPopupEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="Popup",actionMethod:e=>i(this,P,qe).call(this,e.campaignId),localStorageKey:"action"})};m(this,De,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(J,Q)||(I(J,Q,new J),i(e=d(J,Q),P,Ft).call(e)),d(J,Q)}showPopup(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"Popup already in cache");return}i(this,P,Kt).call(this,e),d(this,De).call(this),i(this,P,qe).call(this,e.campaignId)}isPopupAction(e){return e==="Popup"}};Q=new WeakMap,P=new WeakSet,Ft=function(){return a(this,null,function*(){})},qe=function(e){let t=i(this,P,Bt).call(this);if(document.getElementById(`popup_container_${e}`)){s(1,"Popup already displayed"),d(this,de).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,P,Mt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,P,Ce).call(this,t[e]);break}case"SCROLL":{i(this,P,Vt).call(this,t[e]);break}default:return}},Bt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Mt=function(e){E.showDelayedAction({clearActionMethod:d(this,de).bind(this),data:e,displayMethod:i(this,P,Ce).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},de=new WeakMap,Ce=function(e){if(document.getElementById(`popup_container_${e.campaignId}`))s(1,"Popup already displayed");else{let t=i(this,P,$t).call(this,"div",e);document.body.appendChild(t),u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:te,eventProperties:[{eventProperty:"Popup View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"})}d(this,de).call(this,e.campaignId)},$t=function(e,t){let{campaignCustomerInstanceId:n,campaignId:r,message:{design:o}}=t,c=document.createElement(e);c.id=`popup_container_${r}`,c.innerHTML=o,c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%",c.style.zIndex="99999999";let h=c.querySelector(".u-popup-container");h&&(h.style.zIndex="50");let v=h.querySelector(".u-popup-overlay");v&&(s(1,"Popup overlay element found"),v.style.setProperty("display","block","important")),c.querySelectorAll('[id^="u_content_form_"]').forEach(y=>{let D=y.querySelector("form");D&&D.addEventListener("submit",()=>a(this,null,function*(){c.remove();let k=new FormData(D),F={};for(let[O,_]of k.entries())F[O]=_;yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Form Submit",value:JSON.stringify({campaignId:r,formId:y.id,formValues:F})},{eventProperty:"Campaign Id",value:r.toString()}],name:"form"})}))});let b=c.querySelector(".u-close-button");return(b==null?void 0:b.getAttribute("href"))==="#"&&b.removeAttribute("href"),b==null||b.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Close Click",value:JSON.stringify({campaignId:r})}],name:"close"})})),c.querySelectorAll('[id^="u_content_button_"]').forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Button Click",value:JSON.stringify({buttonId:y.id,campaignId:r})}],name:"click"})}))}),c.querySelectorAll(".u-popup-container img").forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Image Click",value:JSON.stringify({campaignId:r,imageClassName:y.className,imageId:y.id})}],name:"click"})}))}),c},Vt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,P,Ce).bind(this),timeValueKey:"campaignEntryTimeValue"})},Kt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},De=new WeakMap,m(J,Q);var Ye=J,H=Ye.getInstance();var ue,fe,he,be,ye,we,Te,Ue,p,Ht,jt,zt,Se,Ze,Xe,et,tt,Gt,Yt,qt,Qt,Zt,Xt,en,nt,rt,tn,nn,Z=class Z{constructor(){m(this,p);m(this,fe);m(this,he);m(this,be);m(this,ye,null);m(this,we,null);m(this,Te,!1);m(this,Ue,()=>{setInterval(()=>{let e=localStorage.getItem("mergn_shopify");if(e!==d(this,we)){I(this,we,e);let t=JSON.parse(e||"{}");if(t!=null&&t.pushMessageToSW){let n=t.pushMessageToSW;delete t.pushMessageToSW,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.pushMessageToSW(n)}if(t!=null&&t.optIn){let n=t.optIn;delete t.optIn,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.showNotification(n)}if(t!=null&&t.campaigns){let n=t.campaigns;delete t.campaigns,localStorage.setItem("mergn_shopify",JSON.stringify(t)),n.forEach(r=>{H.isPopupAction(r.message.name)?H.showPopup(r):ae.isContentCardAction(r.message.name)&&ae.showContentCard(r)})}}},1e3)});this.storeActionInLocalStorageInternal=e=>{let t=()=>{let n=JSON.parse(localStorage.getItem(e)||"{}");Object.keys(n).forEach(r=>{n[r].initialTime=new Date().getTime()}),localStorage.setItem(e,JSON.stringify(n))};t(),window.addEventListener("beforeunload",t)};this.clearActionInLocalStorage=({id:e,localStorageKey:t})=>{let n=JSON.parse(localStorage.getItem(t)||"{}");n[e]&&delete n[e],localStorage.setItem(t,JSON.stringify(n))};this.loadActionInLocalStorage=({actionCondition:e,actionMethod:t,localStorageKey:n})=>{let r=JSON.parse(localStorage.getItem(n)||"{}");Object.keys(r).forEach(o=>{e(r[o])&&t(r[o])})}}static getInstance(){return d(Z,ue)||I(Z,ue,new Z),d(Z,ue)}init(e,t){return a(this,null,function*(){s(1,"Initializing base service"),t!=null&&t.shopify&&I(this,Te,!0),i(this,p,Ht).call(this,e);let n=this.getPlatform();if(n==="Crawlers"||n==="Unknown"){s(2,"Not initializing base service for crawlers or unknown platforms");return}if(yield N.syncRealWorldTime(),s(1,"Verifying API Key"),yield i(this,p,nt).call(this),t!=null&&t.shopify&&d(this,Ue).call(this),t!=null&&t.identity)try{g.loading=!0,yield this.setIdentity(t.identity)}finally{g.loading=!1}setInterval(()=>a(this,null,function*(){s(1,"Verifying API Key after timeout"),yield i(this,p,nt).call(this)}),3e5);let r=i(this,p,Se).call(this);if(yield this.checkTTL(),yield u.recordEventsFromQueue(),u.recordDebugEvents({eventName:"base_init"}),s(1,"Initializing notification service from Base Service"),yield A("notification service",()=>a(this,null,function*(){yield W.init(r,t==null?void 0:t.swPath)})),!(t!=null&&t.shopify)){yield i(this,p,nn).call(this);let o=history.pushState;history.pushState=(...c)=>{o.apply(history,c),i(this,p,tn).call(this)}}s(1,"tracking page change register")})}setPlatform(e){I(this,fe,e)}setOSVersion(e){I(this,he,e)}setOperatingSystem(e){I(this,be,e)}setPreviousUrl(e){I(this,ye,e)}getPreviousUrl(){return d(this,ye)}getPlatform(){return d(this,fe)}getOSVersion(){return d(this,he)}getOperatingSystem(){return d(this,be)}updateSessionCreated(){localStorage.setItem("ttl",`${new Date().getTime()}`)}showAfterScrollAction({data:e,displayMethod:t,timeValueKey:n}){let r=()=>{var b;let o=window.innerHeight,c=document.documentElement.scrollHeight;window.scrollY/(c-o)*100>(((b=e[n])==null?void 0:b.value)||0)&&(window.removeEventListener("scroll",r),t(e))};window.addEventListener("scroll",r)}showDelayedAction({clearActionMethod:e,data:t,displayMethod:n,idKey:r,timeValueKey:o}){var v,b,y;let c=(v=t[o])==null?void 0:v.value;((b=t[o])==null?void 0:b.duration)==="min"&&(c=c*60);let h=t.initialTime-500+(c||0)*1e3-new Date().getTime();s(1,`Initial time: ${t.initialTime}`),s(1,`Time value: ${(y=t[o])==null?void 0:y.value}`),s(1,`Current time: ${new Date().getTime()}`),s(1,`Time difference: ${h}`),h>0?setTimeout(()=>{e(t[r]),n(t)},h):(e(t[r]),n(t))}storeActionInLocalStorage(e,t,n){var c;let r=JSON.parse(localStorage.getItem(t)||"{}"),o=(c=n in e&&e[n])!=null?c:"";o&&(r[o]=Pe(z({},e),{initialTime:new Date().getTime()}),localStorage.setItem(t,JSON.stringify(r)))}checkTTL(){return a(this,null,function*(){yield A("# check TTL",()=>a(this,null,function*(){if(d(this,Te))return;s(1,"Checking TTL"),C("Checking TTL",!0),L("Checking TTL Time",!0);let e=localStorage.getItem("ttl"),t=!1;if(e){if(t=i(this,p,Se).call(this,e),t){let n=localStorage.getItem("session"),r=localStorage.getItem("ttl");n&&r&&u.recordEvent({eventName:"Web Session Concluded",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(r,10)).toISOString()}]}),this.clearLocalStorage(),localStorage.setItem("ttl",`${new Date().getTime()}`)}}else localStorage.setItem("ttl",`${new Date().getTime()}`);(!e||t||i(this,p,Yt).call(this))&&(i(this,p,tt).call(this)&&i(this,p,qt).call(this),i(this,p,et).call(this)&&(yield this.setIdentity()),(i(this,p,Se).call(this)||i(this,p,Ze).call(this))&&(yield i(this,p,Xt).call(this)),yield i(this,p,Qt).call(this),(i(this,p,Se).call(this)||i(this,p,Xe).call(this))&&(yield i(this,p,en).call(this))),L("Checking TTL Time",!1),C("Checking TTL",!1)}))})}clearLocalStorage(){localStorage.removeItem("action"),localStorage.removeItem("events"),localStorage.removeItem("attributes"),localStorage.removeItem("offlineEvents"),localStorage.removeItem("ttl"),localStorage.removeItem("session")}setIdentity(e){return a(this,null,function*(){let t={deviceId:localStorage.getItem("uniqueIdentity")||crypto.randomUUID(),os:this.getPlatform()};if(e)t.identity=e;else if(!e&&localStorage.getItem("customer"))return;try{let n=yield i(this,p,Zt).call(this,t);if(n!==void 0){localStorage.setItem("customer",n);try{W.pushMessageToSW({customer:n})}catch(r){}}}catch(n){throw new Error("Error setting identity")}})}};ue=new WeakMap,fe=new WeakMap,he=new WeakMap,be=new WeakMap,ye=new WeakMap,we=new WeakMap,Te=new WeakMap,Ue=new WeakMap,p=new WeakSet,Ht=function(e){N.updateAPIKey(e),this.setPlatform(i(this,p,jt).call(this)),this.setOSVersion(i(this,p,zt).call(this)),this.setOperatingSystem(navigator.userAgent)},jt=function(){var t;let e=navigator.userAgent.toLowerCase();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i.test(e)?"Crawlers":/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i.test(e)?"Mobile":/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(e)?("Notification"in window&&typeof((t=window==null?void 0:window.Notification)==null?void 0:t.permission)!="undefined","Mobile"):/windows|macintosh|linux|x11/i.test(e)?"Web":"Unknown"},zt=function(){let e=navigator.userAgent,t;return e.indexOf("Chrome")>-1?t="Google Chrome":e.indexOf("Safari")>-1?t="Safari":e.indexOf("Firefox")>-1?t="Mozilla Firefox":e.indexOf("Edg")>-1?t="Microsoft Edge":e.indexOf("MSIE")>-1?t="Internet Explorer":t="Unknown",t},Se=function(e){let t;return e||(t=localStorage.getItem("ttl")),e||t?new Date().getTime()-parseInt(e||t||"",10)>12e5:!0},Ze=function(){return!localStorage.getItem("events")},Xe=function(){return!localStorage.getItem("attributes")},et=function(){return!localStorage.getItem("customer")},tt=function(){return!localStorage.getItem("uniqueIdentity")},Gt=function(){return!localStorage.getItem("session")},Yt=function(){return i(this,p,Ze).call(this)||i(this,p,Xe).call(this)||i(this,p,et).call(this)||i(this,p,tt).call(this)||i(this,p,Gt).call(this)},qt=function(){let e=localStorage.getItem("uniqueIdentity");return e||(e=crypto.randomUUID(),localStorage.setItem("uniqueIdentity",e)),e},Qt=function(){return a(this,null,function*(){yield A("store session",()=>a(this,null,function*(){let e=localStorage.getItem("session");e||(e=crypto.randomUUID(),localStorage.setItem("session",e),yield u.recordEvent({eventName:"Web Session Started",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(localStorage.getItem("ttl")||"",10)).toISOString()}]}))}),e=>{u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`store session - ${e.message}`}]},!0)})})},Zt=function(e){return a(this,null,function*(){try{return(yield N.post(`${It}${ft}`,e)).data}catch(t){throw new Error("Error posting identity data")}})},Xt=function(){return a(this,null,function*(){yield u.storeEventsAndPropertiesInLocalStorage()})},en=function(){return a(this,null,function*(){yield me.storeAttributeInLocalStorage()})},nt=function(){return a(this,null,function*(){yield A("verify API key",()=>a(this,null,function*(){var e;try{let t=parseInt(localStorage.getItem("verifyTTL")||"0",10)||0;if(!t||t&&new Date().getTime()>t){let n=yield N.get("/brand");if(!(n!=null&&n.success))throw new Error(JSON.stringify(n));localStorage.setItem("verifyTTL",(new Date().getTime()+3e5).toString())}g.isInitialized=!0}catch(t){throw N.getBrandId()==="67"&&!((e=t==null?void 0:t.message)!=null&&e.startsWith("get"))&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`verifyAPIKey - ${t.message}`}]},!0),g.disableSDK=!0,new Error("Error verifying API key")}}))})},rt=function(){return a(this,null,function*(){var n;s(1,"Performing viewed web page event");let e=(n=window==null?void 0:window.location)==null?void 0:n.href;this.setPreviousUrl(e),u.recordDebugEvents({eventName:"pre_vwp"});let t=[];new URLSearchParams(new URL(window.location.href).search).forEach((r,o)=>a(this,null,function*(){wt.has(o)&&t.push({eventProperty:o,value:r})})),yield u.recordEvent({eventName:"Viewed Webpage",eventProperties:[{eventProperty:"URL",value:window.location.pathname},...t]})})},tn=function(){return a(this,null,function*(){var t;s(1,"Tracking page change");let e=(t=window==null?void 0:window.location)==null?void 0:t.href;(this.getPreviousUrl()===null||this.getPreviousUrl()===void 0||e!==this.getPreviousUrl())&&(yield i(this,p,rt).call(this))})},nn=function(){return a(this,null,function*(){var t,n;let e=(t=window==null?void 0:window.location)==null?void 0:t.href;u.recordDebugEvents({eventName:"show_notification_error",eventProperties:[{eventProperty:"message",value:`${e!==this.getPreviousUrl()}:${e}:${this.getPreviousUrl()}`}]});try{yield i(this,p,rt).call(this)}catch(r){let o=r&&r.message?(n=r==null?void 0:r.message)==null?void 0:n.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"vwp_error",eventProperties:[{eventProperty:"message",value:`${o}`}]})}})},m(Z,ue);var Qe=Z,E=Qe.getInstance();var X,R,rn,xe,on,sn,an,cn,j=class j{constructor(){m(this,R);this.queue=Promise.resolve()}static getInstance(){var e;return d(j,X)||(I(j,X,new j),i(e=d(j,X),R,rn).call(e)),d(j,X)}pushToQueue(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");t.push(e),localStorage.setItem("preInitializedEvents",JSON.stringify(t))}recordEventsFromQueue(){return a(this,null,function*(){let e=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");if(Array.isArray(e))for(let t of e)yield this.recordEventPreInitialized(t)})}recordEvent(e,t){return a(this,null,function*(){g.isInitialized&&!g.loading?yield i(this,R,xe).call(this,e,t):this.pushToQueue(e)})}recordEventPreInitialized(e){return a(this,null,function*(){try{yield i(this,R,xe).call(this,e)}finally{i(this,R,cn).call(this,e.eventName)}})}recordDebugEvents(e){return a(this,null,function*(){g.debugLevel===4&&(!g.recordDebugEventsToggle||g.recordDebugEventsToggle[e.eventName])&&(yield i(this,R,xe).call(this,e))})}getStoredEvents(){let e=localStorage.getItem("events");return e?JSON.parse(e):{}}storeEventsAndPropertiesInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("events")){let e=(yield this.fetchEventData()).data;if(e){localStorage.setItem("events",JSON.stringify(e));try{W.pushMessageToSW({events:e})}catch(t){}}}})}fetchEventData(){return a(this,null,function*(){try{return yield N.get(`${Fe}`)}catch(e){throw new Error("Error fetching event data")}})}postEventRecord(e,t){return a(this,null,function*(){let n=null,r=null,o=new AbortController;return this.queue=this.queue.then(()=>a(this,null,function*(){try{if(e.events.length===0)throw new Error("No events to record");let c=yield N.post(`/v2${Fe}${vt}`,e,o.signal);if(c.success)return r=c,c;if(c.message===`Customer with id ${localStorage.getItem("customer")} not exists`)throw localStorage.removeItem("customer"),new Error("Re initializing customer Id")}catch(c){throw s(2,"Error posting event record:"),s(2,`name: ${c.name}`),s(2,`message: ${c.message}`),(c.name==="AbortError"||c.name==="TypeError"&&c.message==="Failed to fetch")&&(s(2,"Request aborted"),t&&i(this,R,an).call(this,t)),n=new Error("Error posting event record"),c}return null})).catch(()=>{}),this.queue.then(()=>{if(n)throw n;return r})})}};X=new WeakMap,R=new WeakSet,rn=function(){return a(this,null,function*(){})},xe=function(e,t){return a(this,null,function*(){yield A("# record event",()=>a(this,null,function*(){var at,ct,lt,dt;let{campaignCustomerInstanceId:n,campaignId:r,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v}=e;s(1,"# Recording event"),C("Recording event",!0),L("Recording event Time",!0),s(1,"Event Payload"),s(1,{campaignCustomerInstanceId:n,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v});let b=E.getPlatform();if(b==="Crawlers"||b==="Unknown")throw new Error("Invalid platform");o!=="Web Session Concluded"&&(yield E.checkTTL());let y=[];c&&y.push(...c),y.push({eventProperty:"Platform",value:b}),y.push({eventProperty:"operating-system",value:E.getOperatingSystem()}),y.push({eventProperty:"os-version",value:E.getOSVersion()});let D=this.getStoredEvents(),k=i(this,R,on).call(this,D,o,y);if(typeof k=="string"){s(2,k);return}E.updateSessionCreated();let{id:F}=D[o],O=i(this,R,sn).call(this,z(Pe(z(z(z({},n?{campaignCustomerInstanceId:n}:{}),r?{campaignId:r}:{}),v?{web_optin_instance_id:v}:{}),{eventId:F,eventProperties:k,sessionId:localStorage.getItem("session")||""}),h?{name:h}:{}));if(g.offline){let M=JSON.parse(localStorage.getItem("offlineEvents")||"[]");M.length<=50&&(M.push(...O.events),localStorage.setItem("offlineEvents",JSON.stringify(M)));return}let _=yield this.postEventRecord(O,e);(at=_==null?void 0:_.data)!=null&&at.optIn?(yield this.recordDebugEvents({eventName:"optin_data"}),W.showNotification(_.data.optIn)):o==="Viewed Webpage"&&(yield this.recordDebugEvents({eventName:"no_optin",eventProperties:[{eventProperty:"message",value:`${"Notification"in window&&typeof((ct=window==null?void 0:window.Notification)==null?void 0:ct.permission)!="undefined"}`}]})),(dt=(lt=_==null?void 0:_.data)==null?void 0:lt.campaigns)==null||dt.forEach(M=>{H.isPopupAction(M.message.name)?H.showPopup(M):ae.isContentCardAction(M.message.name)&&ae.showContentCard(M)}),L("Recording event Time",!1),C("Recording event",!1)}),n=>{this.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`record event - ${e} - ${n.message}`}]},!0)},t)})},on=function(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,t))return`Event ${t} is not valid.`;if(!n)return[];let r=e[t];if(!(r!=null&&r.eventProperty))return`Event ${t} does not have a valid eventProperty.`;let o=n.filter(({eventProperty:c})=>!Object.prototype.hasOwnProperty.call(r.eventProperty,c)).map(({eventProperty:c})=>c);return o.length>0?`Event ${t} has invalid eventProperties: ${o.join(", ")}.`:n.map(({eventProperty:c,value:h})=>({eventPropertyId:r.eventProperty[c].id,value:h}))},sn=function(e){return{customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:[e]}},an=function(e){s(1,"Adding to pre-initialized event:"),s(1,e);let t=localStorage.getItem("preInitializedEvents");t&&t!=="undefined"?(t=JSON.parse(t),t.push(e)):t=[e],localStorage.setItem("preInitializedEvents",JSON.stringify(t))},cn=function(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]"),n=t.findIndex(r=>r.eventName===e);n>=0&&t.splice(n,1),localStorage.setItem("preInitializedEvents",JSON.stringify(t))},m(j,X);var it=j,u=it.getInstance();var g=class extends Error{constructor(e){super(e),this.name="MergnError"}};g.disableSDK=!1,g.offline=!navigator.onLine,g.debugLevel=0,g.isInitialized=!1,g.loading=!1;var vn=(l,e)=>{e instanceof g?s(2,`OriginateFrom: ${l}
72
- MergnError: ${e.message}`):e instanceof Error?s(2,`OriginateFrom: ${l}
73
- Unexpected error: ${e.message}`):s(2,`OriginateFrom: ${l}
74
- Unexpected error: ${String(e)}`)},A=(l,e,t,n=!1)=>a(void 0,null,function*(){try{C(l,!0),L(`${l} Time`,!0);try{if(g.disableSDK)throw new g("Mergn SDK is disabled!");if(l!=="record event"&&g.offline)throw new g("Mergn is offline!");if(l!=="init"&&l!=="verify API key"&&l!=="record event"&&l!=="recordAttribute"&&!g.isInitialized)throw new g("Mergn not initialized!");if(l!=="login"&&g.loading)throw new g("Mergn is loading!");return yield e()}catch(r){return t?t(r):(g.debugLevel===2||g.debugLevel===3)&&vn(l,r),!n&&N.getBrandId()==="67"&&r.message!=="Failed to fetch"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`${l} - ${r.message}`}]},!0),null}finally{L(`${l} Time`,!1),C(l,!1)}}catch(r){return null}});var U=(o=>(o[o.NONE=0]="NONE",o[o.INFO=1]="INFO",o[o.ERROR=2]="ERROR",o[o.ALL=3]="ALL",o[o.DEBUG=4]="DEBUG",o))(U||{}),s=(l,e)=>{g.debugLevel!==0&&(g.debugLevel>=3?l===1?console.info(`INFO: ${new Date().toISOString()}`,e):l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e):g.debugLevel===1&&l===1?console.info(`INFO: ${new Date().toISOString()}`,e):g.debugLevel===2&&l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e))},L=(l,e)=>{g.debugLevel!==0&&(e?console.time(l):console.timeEnd(l))},C=(l,e)=>{g.debugLevel!==0&&(e?console.group(l):console.groupEnd())};var pe,ee=class ee{constructor(){}static getInstance(){return d(ee,pe)||I(ee,pe,new ee),d(ee,pe)}init(e,t){setTimeout(()=>{A("init",()=>a(this,null,function*(){s(1,"Initializing Mergn SDK"),yield E.init(e,t),u.recordDebugEvents({eventName:"mergn_init"}),s(1,"Mergn SDK Initialized");let n=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");Array.isArray(n)&&n.forEach((r,o)=>a(this,null,function*(){yield me.recordAttribute(r.attributeName,r.attributeValue),n.splice(o,1),localStorage.setItem("preInitializedAttributes",JSON.stringify(n))})),window.addEventListener("online",()=>a(this,null,function*(){g.offline=!1;let r=JSON.parse(localStorage.getItem("offlineEvents")||"[]");Array.isArray(r)&&(yield u.postEventRecord({customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:r}),localStorage.removeItem("offlineEvents")),E.checkTTL(),E.updateSessionCreated()})),window.addEventListener("offline",()=>{g.offline=!0}),window.addEventListener("load",()=>{H.loadPopupEventActionInLocalStorage(),W.loadWebPushActionInLocalStorage()})}))})}setDebugLevel(e,t){if(!(e in U)){console.error(`Debug level must be according to:
75
- NONE: 0, INFO: 1, ERROR: 2, ALL: 3`);return}g.recordDebugEventsToggle=t||{},g.debugLevel=e;try{W.pushMessageToSW({debugLevel:e})}catch(n){}}recordAttribute(e,t){return a(this,null,function*(){return new Promise((n,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("recordAttribute",()=>a(this,null,function*(){let o;Array.isArray(t)?o=JSON.stringify(t):typeof t=="number"?o=`${t}`:o=t,s(1,"Recording attribute"),s(1,`Attribute Name: ${e}, Attribute Value: ${o}`);let c=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");c.push({attributeName:e,attrValueStringified:o}),localStorage.setItem("preInitializedAttributes",JSON.stringify(c)),g.isInitialized&&(yield me.recordAttribute(e,o))})),n()}catch(o){r(o)}}))})})}login(e){return a(this,null,function*(){return new Promise((t,n)=>{setTimeout(()=>a(this,null,function*(){try{yield A("login",()=>a(this,null,function*(){s(1,"Logging in"),s(1,`Identity: ${e}`),g.loading=!0,yield E.setIdentity(e)})),t()}catch(r){n(r)}finally{g.loading=!1,yield u.recordEventsFromQueue()}}))})})}logout(){setTimeout(()=>{A("logout",()=>a(this,null,function*(){s(1,"Logging out"),E.clearLocalStorage()}))})}recordEvent(e,t){return a(this,null,function*(){return new Promise((n,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("record event",()=>a(this,null,function*(){s(1,"Recording event"),s(1,`Event Payload:
76
- ${{eventName:e,eventProperties:t}}`),yield u.recordEvent({eventName:e,eventProperties:t})})),n()}catch(o){r(o)}}))})})}getVersion(){return mt}};pe=new WeakMap,m(ee,pe);var ot=ee,st=ot.getInstance();typeof window!="undefined"&&(window.mergn=st);var Bi=st;})();
1
+ 'use strict';(function(_0x35fefe,_0xd7fcd5){const _0x4e41f8=_0x1f99,_0x158440=_0x35fefe();while(!![]){try{const _0xfe83e5=parseInt(_0x4e41f8(0x13a))/0x1*(parseInt(_0x4e41f8(0x166))/0x2)+-parseInt(_0x4e41f8(0x162))/0x3+-parseInt(_0x4e41f8(0xd7))/0x4*(-parseInt(_0x4e41f8(0xbf))/0x5)+parseInt(_0x4e41f8(0x9b))/0x6+-parseInt(_0x4e41f8(0x164))/0x7*(-parseInt(_0x4e41f8(0x19c))/0x8)+-parseInt(_0x4e41f8(0x11f))/0x9+parseInt(_0x4e41f8(0x105))/0xa;if(_0xfe83e5===_0xd7fcd5)break;else _0x158440['push'](_0x158440['shift']());}catch(_0x4feda9){_0x158440['push'](_0x158440['shift']());}}}(_0x4bd5,0x5c380));function _0x4bd5(){const _0x388c4b=['\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a','contentCard_container_','Firefox','removeEventListener','URL','className','.u-popup-overlay','color','fixed','subscribe','Closed\x20Web\x20Push\x20Subscription','init_condition','\x0awidth:\x2025%;\x0a','storeEventsAndPropertiesInLocalStorage','attributeName','test','PushManager','Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203','SESSION_ID','beforeunload','stringify','Event\x20Payload','duration','clearActionInLocalStorage','postMessage','Verifying\x20API\x20Key','min','mergn_init','type','loadActionInLocalStorage','show_notification_error','alt','Turned\x20Off\x20Notification','/v2','4492926GevnSA','Current\x20time:\x20','Notification\x20already\x20in\x20cache','Error\x20setting\x20identity','isInteger','Popup\x20Action','done','length','UTM_CAMPAIGN','width','Mergn\x20is\x20offline!','click','centered-image','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set','TypeError','notification_service_not_initialized','indexOf','denied','Chrome','Notification\x20service\x20is\x20not\x20initialized','banner_image','gad_source','bind','setDebugLevel','application/json','data','Error\x20posting\x20attribute\x20record','session','Error\x20posting\x20identity\x20data','clearLocalStorage','getOwnPropertySymbols','button_2','utm_source','pushState','apply','notification\x20service','88305vqvBgh','Failed\x20to\x20request\x20notification\x20permission','entries','access\x20private\x20method','tracking\x20page\x20change\x20register','Cannot\x20','mergn-row','record\x20event','entry_time_value','logo','loading','checkTTL','propertyIsEnumerable','success','scrollY','eventName','Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization','Debug\x20Event','Initial\x20time:\x20','ERROR','Mozilla\x20Firefox','scrollHeight','operating-system','lastSyncTime','68moaaJf','fbclid','loadPopupEventActionInLocalStorage','offlineEvents','\x20Time','cssText','get','divId',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','[id^=\x22u_content_form_\x22]','isInitialized','forEach','Mobile','setPlatform','campaigns','get\x20-\x20','timeEnd','Displayed\x20Web\x20Push\x20Subscription','Viewed\x20Webpage','prototype','DELAY','toString','Checking\x20TTL\x20Time','campaignId','findIndex','view','text','group','queue','Internet\x20Explorer','Error\x20posting\x20event\x20record','MSIE','getInstance','default','/set-identity','SESSION_CREATED','loadContentCardEventActionInLocalStorage','two_step','No\x20existing\x20subscription\x20found','undefined','apiKey','permission','active','attributeValue','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','146420kvzSXk','message:\x20','UTM_MEDIUM','https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api','Edg','substring','map','update','store\x20session\x20-\x20','banner_text','ContentCard','notification_data','mergn-column-75','button-container','swPath','error','button-1','info','parse','Attribute\x20value\x20is\x20required','time','\x20-\x20','content_card','campaignEntryTime','recordAttribute','title','2052846XtfCwG','showAfterScrollAction','storeActionInLocalStorageInternal','entry_time','POST','popup_container_','serviceWorker','recordDebugEventsToggle','remove','showNotification','getAPIKey','Attribute\x20','IMMEDIATELY','/mergn-sw.js','Customer\x20with\x20id\x20','web_push_action','reject','subscribed','os-version','syncRealWorldTime','Service\x20Worker\x20registered','Pushing\x20message\x20to\x20service\x20worker','Recording\x20event\x20Time','Error\x20verifying\x20API\x20key','Initializing\x20base\x20service','#\x20record\x20event','ERROR:\x20','73534LNbUpm','zIndex','ALL','showContentCard','Attribute\x20Payload:\x0a\x20','Close\x20Click','updateAPIKey','Event\x20','getOperatingSystem','then','Mergn\x20SDK\x20Initialized','Safari','Failed\x20to\x20fetch','Verifying\x20API\x20Key\x20after\x20timeout','pathname','top','getVersion','Mergn\x20not\x20initialized!','Performing\x20viewed\x20web\x20page\x20event','value','User\x20denied\x20the\x20notification\x20permission.','location','Crawlers','banner_design','userAgent','eventProperty','initialTime','setOperatingSystem','1.0.122','ContentCard\x20already\x20displayed','block','Time\x20value:\x20','getOSVersion','base_init','shopify','setPreviousUrl','pushToQueue','99999999','postEventRecord','Form\x20Submit','2089032OiWuGN','getElementById','14rsFZQE','Checking\x20notification\x20permission:\x20','2lGDLft','button','addEventListener','Logging\x20in','removeItem','Campaign\x20Id','next','FBCLID','div','Popup','backgroundColor','\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.','Notification','display','logout','load','search','Time\x20difference:\x20','json','offline','getSubscription','subtitle','User\x20closed\x20the\x20notification\x20permission\x20dialog.','form','updateSessionCreated','createElement','record\x20event\x20-\x20','recordEventPreInitialized','\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a','\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20','groupEnd','GCLID','viewed','showPopup','NONE','login','debugLevel','Error\x20posting\x20event\x20record:','isPopupAction','documentElement','Failed\x20to\x20sync\x20real-world\x20time','/brand','button_1','post\x20-\x20','getBrandId','recordDebugEvents','set','Accepted\x20Web\x20Push\x20Soft-ask','getStoredEvents','web_optin_instance_id','UTM_CONTENT','pushManager','verify\x20API\x20key','querySelector','659728WMixZK','User\x20granted\x20the\x20notification\x20permission.','DEBUG','Image\x20Click','ttl','Microsoft\x20Edge','check_permission','granted','recordEventsFromQueue','textContent','isArray','Recording\x20event','banner_color','disableSDK','optin_data','Attribute\x20Name:\x20','.u-close-button','requestPermission','recordEvent','splice','innerHTML','INFO','\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.','No\x20events\x20to\x20record','\x20has\x20invalid\x20attributeProperties:\x20','read\x20from\x20private\x20field','getItem','utm_term','identity','hidden','message','img','push','text_color','attributes','GAD_SOURCE','\x0aposition:\x20fixed;\x0atop:\x200;\x0aleft:\x200;\x0awidth:\x20100%;\x0aheight:\x20100%;\x0abackground-color:\x20rgba(0,\x200,\x200,\x200.5);\x0az-index:\x2099999999999;\x0adisplay:\x20flex;\x0ajustify-content:\x20center;\x0aalign-items:\x20start;\x0a','Initializing\x20Mergn\x20SDK','filter','appendChild','Popup\x20View','name:\x20','ContentCard\x20already\x20in\x20cache','Content\x20Card\x20Action','verifyAPIKey\x20-\x20','throw','Mergn\x20SDK\x20is\x20disabled!','campaignCustomerInstanceId','verifyTTL','add','INFO:\x20','brandId','src','Web\x20Session\x20Started','mergn','Initializing\x20notification\x20service\x20from\x20Base\x20Service','OriginateFrom:\x20','fetchAttributeData','Failed\x20to\x20check\x20notification\x20permission','attributeProperty',';\x0acolor:\x20','Image','events','getRegistrations','name','put','already_registered','startsWith','Platform','loadWebPushActionInLocalStorage','number','href','customer','Recording\x20attribute','height','Unknown','getPreviousUrl','Already\x20Registered\x20To\x20Web\x20Push','body','Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported','.u-popup-container\x20img','action','setIdentity','keys','\x20-\x20\x20','Recording\x20attribute\x20Time','overflow',';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a','Denied\x20Web\x20Push\x20Soft-ask','getPlatform','removeAttribute','#\x20check\x20TTL','init','Request\x20aborted','call','setItem','auto','no_optin','/device/add-device-token','vwp_error','gclid','\x20is\x20not\x20valid.','register','Reachability\x20Push\x20Web','scroll','style','innerHeight','UTM_TERM','getAttribute','PUT','campaignEntryTimeValue','Content\x20Card\x20Click','\x0aMergnError:\x20','#\x20Recording\x20event','\x20has\x20invalid\x20eventProperties:\x20','post','showDelayedAction','Mergn\x20is\x20loading!','isContentCardAction','catch','storeAttributeInLocalStorage','storeActionInLocalStorage','Invalid\x20platform','pop','hasOwnProperty','uniqueIdentity','utm_medium','querySelectorAll','\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a','100%','mergn_shopify','Checking\x20TTL','setProperty','getTime','preInitializedEvents','write\x20to\x20private\x20field','Failed\x20to\x20load','fetchEventData','UTM_SOURCE','The\x20user\x20has\x20already\x20enabled\x20notifications.','/brand/get-time','\x0abackground-color:\x20','optIn','preInitializedAttributes','getOwnPropertyDescriptors','mergnWebPushPopup','position','store\x20session','Service\x20Worker\x20registration','string','Re\x20initializing\x20customer\x20Id','randomUUID','Viewed\x20Web\x20Push\x20Soft-ask','has','Allowed\x20Web\x20Push\x20Subscription','toISOString','onLine','resolve','UTCDate','Service\x20Worker\x20registration\x20failed:','match','Web\x20Session\x20Concluded','mergn-column-25','\x0aUnexpected\x20error:\x20','pushMessageToSW','signal','SCROLL','join'];_0x4bd5=function(){return _0x388c4b;};return _0x4bd5();}function _0x1f99(_0x1061a6,_0x467202){const _0x4bd5ff=_0x4bd5();return _0x1f99=function(_0x1f9965,_0x45b1a4){_0x1f9965=_0x1f9965-0x8e;let _0x151adf=_0x4bd5ff[_0x1f9965];return _0x151adf;},_0x1f99(_0x1061a6,_0x467202);}((()=>{const _0x5aead6=_0x1f99;var _0x55e034=Object['defineProperty'],_0x3b2c3f=Object['defineProperties'],_0x2e09c8=Object[_0x5aead6(0x22c)],_0x4e47c0=Object[_0x5aead6(0xb9)],_0x17273e=Object['prototype'][_0x5aead6(0x218)],_0x2e599d=Object[_0x5aead6(0xea)][_0x5aead6(0xcb)],_0x5cd4ad=_0x5aa40b=>{throw TypeError(_0x5aa40b);},_0xe0a460=(_0x3766cf,_0x1ecf79,_0x5b81cd)=>_0x1ecf79 in _0x3766cf?_0x55e034(_0x3766cf,_0x1ecf79,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5b81cd}):_0x3766cf[_0x1ecf79]=_0x5b81cd,_0x5c8d21=(_0x4241cc,_0x164267)=>{const _0x3d5e44=_0x5aead6;for(var _0x49efcc in _0x164267||(_0x164267={}))_0x17273e['call'](_0x164267,_0x49efcc)&&_0xe0a460(_0x4241cc,_0x49efcc,_0x164267[_0x49efcc]);if(_0x4e47c0){for(var _0x49efcc of _0x4e47c0(_0x164267))_0x2e599d[_0x3d5e44(0x1fa)](_0x164267,_0x49efcc)&&_0xe0a460(_0x4241cc,_0x49efcc,_0x164267[_0x49efcc]);}return _0x4241cc;},_0x4ebf7f=(_0x30d79d,_0x24afa5)=>_0x3b2c3f(_0x30d79d,_0x2e09c8(_0x24afa5)),_0x43e6a5=(_0x170075,_0x1ca6a4,_0x170ee3)=>_0x1ca6a4[_0x5aead6(0x235)](_0x170075)||_0x5cd4ad(_0x5aead6(0xc4)+_0x170ee3),_0x282439=(_0x3565b6,_0x371751,_0x50253c)=>(_0x43e6a5(_0x3565b6,_0x371751,_0x5aead6(0x1b5)),_0x50253c?_0x50253c[_0x5aead6(0x1fa)](_0x3565b6):_0x371751['get'](_0x3565b6)),_0x4f26ee=(_0x4e2303,_0x1d6962,_0x18b3f9)=>_0x1d6962[_0x5aead6(0x235)](_0x4e2303)?_0x5cd4ad(_0x5aead6(0x103)):_0x1d6962 instanceof WeakSet?_0x1d6962[_0x5aead6(0x1cd)](_0x4e2303):_0x1d6962[_0x5aead6(0x194)](_0x4e2303,_0x18b3f9),_0x412844=(_0x11f0b6,_0x2b5065,_0x2a340f,_0x334a07)=>(_0x43e6a5(_0x11f0b6,_0x2b5065,_0x5aead6(0x223)),_0x334a07?_0x334a07[_0x5aead6(0x1fa)](_0x11f0b6,_0x2a340f):_0x2b5065[_0x5aead6(0x194)](_0x11f0b6,_0x2a340f),_0x2a340f),_0x3ee6aa=(_0xc64305,_0x514273,_0x580024)=>(_0x43e6a5(_0xc64305,_0x514273,_0x5aead6(0xc2)),_0x580024),_0x2fbc56=(_0x4827d0,_0x24aa36,_0x4b701b)=>new Promise((_0x420120,_0x2573a3)=>{const _0x2334ac=_0x5aead6;var _0x14b6eb=_0x29ca4c=>{const _0x3298c2=_0x1f99;try{_0x89c2f4(_0x4b701b[_0x3298c2(0x16c)](_0x29ca4c));}catch(_0x2dd42a){_0x2573a3(_0x2dd42a);}},_0x3dbd8d=_0x4bec6b=>{const _0x8f7cb4=_0x1f99;try{_0x89c2f4(_0x4b701b[_0x8f7cb4(0x1c9)](_0x4bec6b));}catch(_0x55e9c5){_0x2573a3(_0x55e9c5);}},_0x89c2f4=_0x3c97b6=>_0x3c97b6[_0x2334ac(0xa1)]?_0x420120(_0x3c97b6[_0x2334ac(0x14d)]):Promise[_0x2334ac(0x239)](_0x3c97b6[_0x2334ac(0x14d)])[_0x2334ac(0x143)](_0x14b6eb,_0x3dbd8d);_0x89c2f4((_0x4b701b=_0x4b701b['apply'](_0x4827d0,_0x24aa36))[_0x2334ac(0x16c)]());}),_0x356a70=_0x5aead6(0x156),_0x32c2ad=_0x5aead6(0x108),_0x4e9cab='/attribute',_0x230ac6='/set-attribute',_0x3c63fc='/event',_0x23d8fe='/record-event',_0x4b7816='/customer',_0x3a6ed2=_0x5aead6(0x1fe),_0x4f09a6=_0x5aead6(0xf9),_0x424206='/brand/get-web-push-public-key',_0x5ac41c=_0x5aead6(0x228),_0x252b8e=(_0x5c2319=>(_0x5c2319[_0x5aead6(0x226)]=_0x5aead6(0xbb),_0x5c2319[_0x5aead6(0x107)]=_0x5aead6(0x21a),_0x5c2319[_0x5aead6(0xa3)]='utm_campaign',_0x5c2319[_0x5aead6(0x207)]=_0x5aead6(0x1b7),_0x5c2319[_0x5aead6(0x198)]='utm_content',_0x5c2319[_0x5aead6(0x1bf)]=_0x5aead6(0xb0),_0x5c2319[_0x5aead6(0x185)]=_0x5aead6(0x200),_0x5c2319[_0x5aead6(0x16d)]=_0x5aead6(0xd8),_0x5c2319))(_0x252b8e||{}),_0x579a5c=new Set(Object['values'](_0x252b8e)),_0x2fffb3=_0x5aead6(0xa0),_0xd0853a,_0x24f755,_0x2ff4a8,_0x387f27=class _0x3224bd{constructor(){_0x4f26ee(this,_0x24f755);}static[_0x5aead6(0xf7)](){return _0x282439(_0x3224bd,_0xd0853a)||_0x412844(_0x3224bd,_0xd0853a,new _0x3224bd()),_0x282439(_0x3224bd,_0xd0853a);}[_0x5aead6(0x140)](_0x4312a0){const _0x20dfed=_0x5aead6;_0x3224bd['apiKey']=_0x4312a0;let _0x540c76=_0x4312a0,_0x419639=/m(\d+)rgn/,_0x27e4da=_0x540c76[_0x20dfed(0x23c)](_0x419639);_0x27e4da&&(_0x3224bd[_0x20dfed(0x1cf)]=_0x27e4da[0x1]);}[_0x5aead6(0x129)](){const _0x28eba4=_0x5aead6;return _0x3224bd[_0x28eba4(0xff)];}[_0x5aead6(0x192)](){return _0x3224bd['brandId'];}['get'](_0x34e730){return _0x2fbc56(this,null,function*(){const _0x55a72d=_0x1f99;try{return(yield fetch(_0x32c2ad+_0x34e730,{'headers':{'Authorization':_0x3ee6aa(this,_0x24f755,_0x2ff4a8)[_0x55a72d(0x1fa)](this,_0x3224bd[_0x55a72d(0xff)]),'Content-Type':_0x55a72d(0xb3)}}))[_0x55a72d(0x178)]();}catch(_0x47af2a){let _0x9b5472=_0x47af2a[_0x55a72d(0x1ba)];return this['getBrandId']()==='67'&&_0x9b5472!==_0x55a72d(0x146)&&_0x9b5472!==_0x55a72d(0x224)&&_0x1cb69e[_0x55a72d(0x1ae)]({'eventName':_0x55a72d(0xd0),'eventProperties':[{'eventProperty':_0x55a72d(0x1ba),'value':_0x55a72d(0xe6)+_0x34e730+'\x20-\x20'+_0x3ee6aa(this,_0x24f755,_0x2ff4a8)[_0x55a72d(0x1fa)](this,_0x3224bd[_0x55a72d(0xff)])+_0x55a72d(0x1f0)+_0x47af2a['message']}]},!0x0),Promise[_0x55a72d(0x12f)](_0x47af2a);}});}[_0x5aead6(0x20f)](_0xe1d350,_0xb081b8,_0x4866a2){return _0x2fbc56(this,null,function*(){const _0x4f7364=_0x1f99;try{return(yield fetch(_0x32c2ad+_0xe1d350,{'body':JSON[_0x4f7364(0x258)](_0xb081b8||{}),'headers':{'Authorization':_0x3ee6aa(this,_0x24f755,_0x2ff4a8)[_0x4f7364(0x1fa)](this,_0x3224bd[_0x4f7364(0xff)]),'Content-Type':_0x4f7364(0xb3)},'method':_0x4f7364(0x123),'signal':_0x4866a2}))[_0x4f7364(0x178)]();}catch(_0x2bc194){let _0x36fe08=_0x2bc194['message'];return this[_0x4f7364(0x192)]()==='67'&&_0x36fe08!==_0x4f7364(0x146)&&_0x36fe08!==_0x4f7364(0x224)&&_0x1cb69e[_0x4f7364(0x1ae)]({'eventName':_0x4f7364(0xd0),'eventProperties':[{'eventProperty':_0x4f7364(0x1ba),'value':_0x4f7364(0x191)+_0xe1d350+_0x4f7364(0x11a)+_0x3ee6aa(this,_0x24f755,_0x2ff4a8)[_0x4f7364(0x1fa)](this,_0x3224bd[_0x4f7364(0xff)])+_0x4f7364(0x11a)+JSON[_0x4f7364(0x258)](_0xb081b8||{})+'\x20-'+_0x2bc194[_0x4f7364(0x1ba)]}]},!0x0),Promise[_0x4f7364(0x12f)](_0x2bc194);}});}[_0x5aead6(0x1dd)](_0x50d7ca,_0x208190){return _0x2fbc56(this,null,function*(){const _0xdd7a93=_0x1f99;return(yield fetch(_0x32c2ad+_0x50d7ca,{'body':JSON['stringify'](_0x208190||{}),'headers':{'Authorization':_0x3ee6aa(this,_0x24f755,_0x2ff4a8)['call'](this,_0x3224bd['apiKey']),'Content-Type':_0xdd7a93(0xb3)},'method':_0xdd7a93(0x209)}))[_0xdd7a93(0x178)]();});}[_0x5aead6(0x132)](){return _0x2fbc56(this,null,function*(){const _0x5cf0fe=_0x1f99;try{let _0x3c4ef7=(yield(yield fetch(_0x32c2ad+_0x5ac41c))[_0x5cf0fe(0x178)]())['data'];_0x3224bd[_0x5cf0fe(0x23a)]=new Date(_0x3c4ef7),_0x3224bd[_0x5cf0fe(0xd6)]=new Date();}catch(_0x5b4d01){_0x524edc(0x2,_0x5cf0fe(0x18e));}});}['getCurrentUTCDate'](){const _0x34d100=_0x5aead6;if(!_0x3224bd[_0x34d100(0x23a)]||!_0x3224bd['lastSyncTime'])return _0x524edc(0x2,_0x34d100(0xa8)),new Date();let _0x20c733=new Date()[_0x34d100(0x221)]()-_0x3224bd[_0x34d100(0xd6)][_0x34d100(0x221)]();return new Date(_0x3224bd['UTCDate'][_0x34d100(0x221)]()+_0x20c733);}};_0xd0853a=new WeakMap(),_0x24f755=new WeakSet(),_0x2ff4a8=function(_0x235ada){const _0x1b7e43=_0x5aead6;return btoa(_0x235ada+':'+new Date()[_0x1b7e43(0x221)]());},_0x4f26ee(_0x387f27,_0xd0853a);var _0x3434d7=_0x387f27,_0x545bce=_0x3434d7[_0x5aead6(0xf7)](),_0x41849a,_0x4b6c81,_0x1d77d8,_0x4c2c4c,_0x197208,_0x43f2d6,_0x67c3bd,_0x4fce71=class _0x5662b4{constructor(){_0x4f26ee(this,_0x1d77d8),_0x4f26ee(this,_0x4b6c81,!0x1);}static['getInstance'](){const _0x428ac9=_0x5aead6;var _0x24eaf4;return _0x282439(_0x5662b4,_0x41849a)||(_0x412844(_0x5662b4,_0x41849a,new _0x5662b4()),_0x3ee6aa(_0x24eaf4=_0x282439(_0x5662b4,_0x41849a),_0x1d77d8,_0x4c2c4c)[_0x428ac9(0x1fa)](_0x24eaf4)),_0x282439(_0x5662b4,_0x41849a);}[_0x5aead6(0x11d)](_0x500384,_0x518c7f,_0x5b01a5){return _0x2fbc56(this,null,function*(){yield _0x2e48db('#\x20recordAttribute',()=>_0x2fbc56(this,null,function*(){const _0x329577=_0x1f99;if(_0x524edc(0x1,_0x329577(0x1e5)),_0x32db77('Recording\x20attribute',!0x0),_0x4e4e64(_0x329577(0x1f1),!0x0),_0x524edc(0x1,_0x329577(0x13e)+{'attributeName':_0x500384,'attributeProperties':_0x5b01a5,'attributeValue':_0x518c7f}+')}'),!_0x518c7f||_0x518c7f===''){_0x524edc(0x2,_0x329577(0x118));return;}yield _0x1ad162[_0x329577(0xca)](),yield _0x3ee6aa(this,_0x1d77d8,_0x43f2d6)['call'](this);let _0x54b734=JSON['parse'](localStorage[_0x329577(0x1b6)](_0x329577(0x1be))||'{}'),_0x27ec86=_0x5b01a5?_0x3ee6aa(this,_0x1d77d8,_0x197208)[_0x329577(0x1fa)](this,_0x54b734,_0x500384,_0x5b01a5):_0x3ee6aa(this,_0x1d77d8,_0x197208)['call'](this,_0x54b734,_0x500384);if(typeof _0x27ec86=='string'){_0x524edc(0x2,_0x27ec86);return;}_0x54b734[_0x500384]['should_set_identity']&&(yield _0x1ad162[_0x329577(0x1ee)](typeof _0x518c7f==_0x329577(0x231)?_0x518c7f:JSON['stringify'](_0x518c7f))),_0x1ad162[_0x329577(0x17e)]();let {id:_0x123416}=_0x54b734[_0x500384],_0x188db2={'attributeId':_0x123416,'attributeProperties':_0x27ec86,'customerId':localStorage[_0x329577(0x1b6)](_0x329577(0x1e4))||'','value':_0x518c7f};yield _0x3ee6aa(this,_0x1d77d8,_0x67c3bd)['call'](this,_0x188db2);let _0x3b7494=JSON[_0x329577(0x117)](localStorage[_0x329577(0x1b6)](_0x329577(0x22b))||'[]');_0x3b7494[_0x329577(0x217)](),localStorage[_0x329577(0x1fb)](_0x329577(0x22b),JSON['stringify'](_0x3b7494)),_0x4e4e64(_0x329577(0x1f1),!0x1),_0x32db77(_0x329577(0x1e5),!0x1);}));});}[_0x5aead6(0x214)](){return _0x2fbc56(this,null,function*(){const _0x5f0042=_0x1f99;if(!localStorage[_0x5f0042(0x1b6)]('attributes')&&!_0x282439(this,_0x4b6c81)){_0x412844(this,_0x4b6c81,!0x0);try{let _0x54b585=(yield this[_0x5f0042(0x1d5)]())[_0x5f0042(0xb4)];_0x54b585&&localStorage[_0x5f0042(0x1fb)](_0x5f0042(0x1be),JSON[_0x5f0042(0x258)](_0x54b585));}catch(_0x57169b){throw new Error('Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage');}finally{_0x412844(this,_0x4b6c81,!0x1);}}});}[_0x5aead6(0x1d5)](){return _0x2fbc56(this,null,function*(){const _0x1d61a6=_0x1f99;try{return yield _0x545bce[_0x1d61a6(0xdd)](''+_0x4e9cab);}catch(_0x17edb9){throw new Error('Error\x20fetching\x20attribute\x20data');}});}};_0x41849a=new WeakMap(),_0x4b6c81=new WeakMap(),_0x1d77d8=new WeakSet(),_0x4c2c4c=function(){return _0x2fbc56(this,null,function*(){});},_0x197208=function(_0x53144d,_0x284b74,_0x157d21){const _0x11ed7b=_0x5aead6;if(!Object['prototype'][_0x11ed7b(0x218)][_0x11ed7b(0x1fa)](_0x53144d,_0x284b74))return _0x11ed7b(0x12a)+_0x284b74+'\x20is\x20not\x20valid.';if(!_0x157d21)return[];let _0x2a4590=_0x53144d[_0x284b74];if(!(_0x2a4590!=null&&_0x2a4590['attributeProperty']))return'Attribute\x20'+_0x284b74+_0x11ed7b(0x171);let _0x1603dc=_0x157d21[_0x11ed7b(0x1c2)](({attributeProperty:_0x497bd2})=>!Object[_0x11ed7b(0xea)]['hasOwnProperty']['call'](_0x2a4590[_0x11ed7b(0x1d7)],_0x497bd2))[_0x11ed7b(0x10b)](({attributeProperty:_0xd8ce8e})=>_0xd8ce8e);return _0x1603dc[_0x11ed7b(0xa2)]>0x0?'Attribute\x20'+_0x284b74+_0x11ed7b(0x1b4)+_0x1603dc['join'](',\x20')+'.':_0x157d21[_0x11ed7b(0x10b)](({attributeProperty:_0x3a3920,value:_0x1d8e7e})=>({'attributePropertyId':_0x2a4590[_0x11ed7b(0x1d7)][_0x3a3920]['id'],'value':_0x1d8e7e}));},_0x43f2d6=function(){return _0x2fbc56(this,null,function*(){const _0x24be89=_0x1f99;localStorage[_0x24be89(0x1b6)](_0x24be89(0x1be))||(yield this[_0x24be89(0x214)]());});},_0x67c3bd=function(_0xea1fa0){return _0x2fbc56(this,null,function*(){const _0x2e8ef3=_0x1f99;try{return yield _0x545bce['post'](''+_0x4e9cab+_0x230ac6,_0xea1fa0);}catch(_0x408b83){throw new Error(_0x2e8ef3(0xb5));}});},_0x4f26ee(_0x4fce71,_0x41849a);var _0x3c659e=_0x4fce71,_0x22b036=_0x3c659e[_0x5aead6(0xf7)](),_0x268b85=_0x5aead6(0x1c7),_0x1d9432,_0x2a68b4,_0x229dcd,_0x214eaa,_0x5a1f21,_0x1c1b89,_0x379f4b,_0x793a11,_0x3b794f,_0x2e878c,_0x3c65a5,_0x24340f,_0xee751d=class _0x7d2668{constructor(){const _0x52a8c9=_0x5aead6;_0x4f26ee(this,_0x2a68b4),_0x4f26ee(this,_0x379f4b,_0x41a33c=>{const _0x266a23=_0x1f99;_0x1ad162['clearActionInLocalStorage']({'id':_0x41a33c,'localStorageKey':_0x266a23(0x1ed)});}),this[_0x52a8c9(0xfb)]=()=>{const _0x42bda1=_0x52a8c9;_0x1ad162[_0x42bda1(0x96)]({'actionCondition':_0x1c17d6=>_0x1c17d6[_0x42bda1(0x1ba)][_0x42bda1(0x1dc)]===_0x42bda1(0x10f),'actionMethod':_0x154b47=>_0x3ee6aa(this,_0x2a68b4,_0x214eaa)['call'](this,_0x154b47[_0x42bda1(0xee)]),'localStorageKey':_0x42bda1(0x1ed)});},_0x4f26ee(this,_0x24340f,()=>{const _0x4af46b=_0x52a8c9;_0x1ad162[_0x4af46b(0x121)]('action');});}static['getInstance'](){var _0x15f0fc;return _0x282439(_0x7d2668,_0x1d9432)||(_0x412844(_0x7d2668,_0x1d9432,new _0x7d2668()),_0x3ee6aa(_0x15f0fc=_0x282439(_0x7d2668,_0x1d9432),_0x2a68b4,_0x229dcd)['call'](_0x15f0fc)),_0x282439(_0x7d2668,_0x1d9432);}[_0x5aead6(0x13d)](_0x45ea67){const _0x697cfd=_0x5aead6;let _0x17586b=JSON[_0x697cfd(0x117)](localStorage[_0x697cfd(0x1b6)](_0x697cfd(0x1ed))||'{}');if(_0x17586b&&_0x17586b[_0x45ea67==null?void 0x0:_0x45ea67[_0x697cfd(0xee)]]){_0x524edc(0x1,_0x697cfd(0x1c6));return;}_0x3ee6aa(this,_0x2a68b4,_0x3c65a5)[_0x697cfd(0x1fa)](this,_0x45ea67),_0x282439(this,_0x24340f)[_0x697cfd(0x1fa)](this),_0x3ee6aa(this,_0x2a68b4,_0x214eaa)['call'](this,_0x45ea67[_0x697cfd(0xee)]);}[_0x5aead6(0x212)](_0x32401f){const _0x127f6f=_0x5aead6;return _0x32401f===_0x127f6f(0x11b);}};_0x1d9432=new WeakMap(),_0x2a68b4=new WeakSet(),_0x229dcd=function(){return _0x2fbc56(this,null,function*(){});},_0x214eaa=function(_0x3ade10){const _0x26b76c=_0x5aead6;let _0x58abe0=_0x3ee6aa(this,_0x2a68b4,_0x5a1f21)[_0x26b76c(0x1fa)](this);if(document[_0x26b76c(0x163)]('contentCard_container_'+_0x3ade10)){_0x524edc(0x1,_0x26b76c(0x157)),_0x282439(this,_0x379f4b)[_0x26b76c(0x1fa)](this,_0x3ade10);return;}if(_0x58abe0!=null&&_0x58abe0[_0x3ade10])switch(_0x58abe0[_0x3ade10][_0x26b76c(0x11c)]){case _0x26b76c(0xeb):{_0x3ee6aa(this,_0x2a68b4,_0x1c1b89)[_0x26b76c(0x1fa)](this,_0x58abe0[_0x3ade10]);break;}case _0x26b76c(0x12b):{_0x3ee6aa(this,_0x2a68b4,_0x793a11)[_0x26b76c(0x1fa)](this,_0x58abe0[_0x3ade10]);break;}case'SCROLL':{_0x3ee6aa(this,_0x2a68b4,_0x2e878c)[_0x26b76c(0x1fa)](this,_0x58abe0[_0x3ade10]);break;}default:return;}},_0x5a1f21=function(){const _0x58887a=_0x5aead6;let _0x48138f=localStorage[_0x58887a(0x1b6)](_0x58887a(0x1ed));return _0x48138f?JSON[_0x58887a(0x117)](_0x48138f):null;},_0x1c1b89=function(_0x27c865){const _0x26ce3e=_0x5aead6;_0x1ad162['showDelayedAction']({'clearActionMethod':_0x282439(this,_0x379f4b)[_0x26ce3e(0xb1)](this),'data':_0x27c865,'displayMethod':_0x3ee6aa(this,_0x2a68b4,_0x793a11)['bind'](this),'idKey':_0x26ce3e(0xee),'timeValueKey':_0x26ce3e(0x20a)});},_0x379f4b=new WeakMap(),_0x793a11=function(_0x1cfe8e){const _0x55f3d5=_0x5aead6;var _0x4481b8;if(document['getElementById'](_0x55f3d5(0x245)+_0x1cfe8e[_0x55f3d5(0xee)]))_0x524edc(0x1,_0x55f3d5(0x157));else{let _0x457085=_0x3ee6aa(this,_0x2a68b4,_0x3b794f)[_0x55f3d5(0x1fa)](this,_0x55f3d5(0x16e),_0x1cfe8e),_0xf5cc36=document['querySelector']('#'+_0x1cfe8e[_0x55f3d5(0x1ba)][_0x55f3d5(0xde)]);_0xf5cc36&&(_0xf5cc36['innerHTML']=_0x457085['outerHTML'],_0x1cb69e[_0x55f3d5(0x1ae)]({'campaignCustomerInstanceId':_0x1cfe8e[_0x55f3d5(0x1cb)],'campaignId':_0x1cfe8e[_0x55f3d5(0xee)],'eventName':_0x268b85,'eventProperties':[{'eventProperty':'Content\x20Card\x20View','value':JSON[_0x55f3d5(0x258)]({'campaignId':_0x1cfe8e['campaignId']})}],'name':_0x55f3d5(0xf0)}),(_0x4481b8=document[_0x55f3d5(0x163)](_0x55f3d5(0x245)+_0x1cfe8e[_0x55f3d5(0xee)]))==null||_0x4481b8[_0x55f3d5(0x168)](_0x55f3d5(0xa6),()=>{const _0x2fb012=_0x55f3d5;_0x1cb69e[_0x2fb012(0x1ae)]({'campaignCustomerInstanceId':_0x1cfe8e['campaignCustomerInstanceId'],'campaignId':_0x1cfe8e[_0x2fb012(0xee)],'eventName':_0x268b85,'eventProperties':[{'eventProperty':_0x2fb012(0x20b),'value':JSON[_0x2fb012(0x258)]({'campaignId':_0x1cfe8e[_0x2fb012(0xee)]})}],'name':_0x2fb012(0xa6)});}));}_0x282439(this,_0x379f4b)[_0x55f3d5(0x1fa)](this,_0x1cfe8e['campaignId']);},_0x3b794f=function(_0x366bdd,_0x269c29){const _0xfb19ae=_0x5aead6;var _0x23df64;let {campaignId:_0x555ed8,message:{design:_0x5ed03b}}=_0x269c29,_0x2a4e84=document[_0xfb19ae(0x17f)](_0x366bdd);return _0x2a4e84['id']='contentCard_container_'+_0x555ed8,_0x2a4e84[_0xfb19ae(0x1b0)]=_0x5ed03b,(_0x23df64=_0x2a4e84[_0xfb19ae(0x19b)](_0xfb19ae(0x1ac)))==null||_0x23df64[_0xfb19ae(0x127)](),_0x2a4e84;},_0x2e878c=function(_0xd64a2a){const _0x28b117=_0x5aead6;_0x1ad162[_0x28b117(0x120)]({'data':_0xd64a2a,'displayMethod':_0x3ee6aa(this,_0x2a68b4,_0x793a11)[_0x28b117(0xb1)](this),'timeValueKey':_0x28b117(0x20a)});},_0x3c65a5=function(_0x5cdb89){const _0x5e4079=_0x5aead6;_0x1ad162['storeActionInLocalStorage'](_0x5cdb89,_0x5e4079(0x1ed),_0x5e4079(0xee));},_0x24340f=new WeakMap(),_0x4f26ee(_0xee751d,_0x1d9432);var _0x5d278e=_0xee751d,_0x16f039=_0x5d278e['getInstance'](),_0x254951,_0xb24454,_0x2eaac6,_0x2cb88c,_0x178ad8,_0x232528,_0x107112,_0x1dc684,_0x545138,_0x12431e,_0x3e540c,_0x2bf5de,_0x4a62bf,_0x3a820d,_0x398e49,_0x3db2de,_0x3d1ad3,_0x12edc6,_0x1eb811,_0x16cdb6=class _0x211bb3{constructor(){const _0x435488=_0x5aead6;_0x4f26ee(this,_0x107112),this[_0x435488(0x100)]=null,this[_0x435488(0x240)]=_0x1f32d2=>{const _0x4c881e=_0x435488;_0x524edc(0x1,_0x4c881e(0x134)),navigator[_0x4c881e(0x125)][_0x4c881e(0x1db)]()[_0x4c881e(0x143)](_0x56bf50=>{const _0xe312cd=_0x4c881e;var _0x553a6f,_0x686aa6;_0x524edc(0x1,_0xe312cd(0x230)),(_0x553a6f=_0x56bf50[0x0])!=null&&_0x553a6f[_0xe312cd(0x101)]&&(_0x524edc(0x1,'Service\x20Worker\x20ready'),(_0x686aa6=_0x56bf50[0x0]['active'])==null||_0x686aa6[_0xe312cd(0x91)](JSON['stringify'](_0x1f32d2)));})[_0x4c881e(0x213)](_0x3c840a=>{const _0x252e89=_0x4c881e;_0x524edc(0x2,'Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20'+_0x3c840a[_0x252e89(0x1ba)]);});},this[_0x435488(0x1e1)]=()=>{const _0x4f5c4e=_0x435488;_0x1ad162[_0x4f5c4e(0x96)]({'actionCondition':()=>!0x0,'actionMethod':_0x542ab8=>_0x3ee6aa(this,_0x107112,_0x3a820d)[_0x4f5c4e(0x1fa)](this,Number(_0x542ab8[_0x4f5c4e(0x197)])),'localStorageKey':_0x4f5c4e(0x12e)});},_0x4f26ee(this,_0x4a62bf,()=>{const _0x25b058=_0x435488;_0x1ad162[_0x25b058(0x121)](_0x25b058(0x12e));}),_0x4f26ee(this,_0x12edc6,_0x2902be=>{const _0x36d476=_0x435488;_0x1ad162[_0x36d476(0x90)]({'id':_0x2902be,'localStorageKey':_0x36d476(0x12e)});});}static[_0x5aead6(0xf7)](){return _0x282439(_0x211bb3,_0x254951)||_0x412844(_0x211bb3,_0x254951,new _0x211bb3()),_0x282439(_0x211bb3,_0x254951);}[_0x5aead6(0x1f8)](_0x12e769,_0x563813){return _0x2fbc56(this,null,function*(){const _0x769254=_0x1f99;var _0x5ed696;if(_0x524edc(0x1,'Initializing\x20Notification\x20Service'),_0x1cb69e[_0x769254(0x193)]({'eventName':_0x769254(0x1f8),'eventProperties':[{'eventProperty':'service_worker','value':_0x769254(0x125)in navigator},{'eventProperty':'push_manager','value':'PushManager'in window}]}),_0x769254(0x125)in navigator&&_0x769254(0x254)in window){_0x524edc(0x1,_0x769254(0x1eb));try{_0x1cb69e[_0x769254(0x193)]({'eventName':_0x769254(0x24f)}),_0x412844(_0x211bb3,_0xb24454,yield navigator[_0x769254(0x125)][_0x769254(0x202)](_0x563813||_0x769254(0x12c))),_0x524edc(0x1,_0x769254(0x133)),_0x524edc(0x1,_0x769254(0xcf)),this[_0x769254(0x240)]({'customer':localStorage[_0x769254(0x1b6)](_0x769254(0x1e4))||'','events':_0x1cb69e['getStoredEvents'](),'API_KEY':_0x545bce[_0x769254(0x129)](),'device_id':localStorage[_0x769254(0x1b6)](_0x769254(0x219))||'','operatingSystem':_0x1ad162[_0x769254(0x142)](),'osVersion':_0x1ad162[_0x769254(0x15a)](),'Platform':_0x1ad162['getPlatform']()}),_0x412844(_0x211bb3,_0x178ad8,!0x0);let _0x3b3ccc=_0x3ee6aa(this,_0x107112,_0x398e49)[_0x769254(0x1fa)](this),_0x22be19=Object[_0x769254(0x1ef)](_0x3b3ccc||{});if(_0x22be19[_0x769254(0xa2)]&&_0x3ee6aa(this,_0x107112,_0x3a820d)['call'](this,Number(_0x22be19[0x0])),!_0x12e769)return;let _0x45e416=yield(_0x5ed696=_0x282439(_0x211bb3,_0xb24454))==null?void 0x0:_0x5ed696[_0x769254(0x199)][_0x769254(0x17a)]();_0x524edc(0x1,'Checking\x20for\x20existing\x20subscription'),_0x282439(_0x211bb3,_0xb24454)&&(_0x524edc(0x1,'Service\x20Worker\x20registration\x20is\x20available'),_0x282439(_0x211bb3,_0xb24454)[_0x769254(0x10c)]()),_0x45e416?(_0x524edc(0x1,'Existing\x20subscription\x20found'),_0x1cb69e[_0x769254(0x193)]({'eventName':'existing_subscription'}),yield _0x3ee6aa(this,_0x107112,_0x3e540c)['call'](this),_0x412844(_0x211bb3,_0x2eaac6,!0x0)):(_0x524edc(0x1,_0x769254(0xfd)),yield _0x3ee6aa(this,_0x107112,_0x1dc684)[_0x769254(0x1fa)](this,_0x282439(_0x211bb3,_0x232528)||void 0x0));}catch(_0x27235e){let _0x40e933=_0x27235e&&_0x27235e[_0x769254(0x1ba)]?_0x27235e['message']['substring'](0x0,0x64):_0x769254(0xfe);yield _0x1cb69e[_0x769254(0x193)]({'eventName':_0x769254(0x203),'eventProperties':[{'eventProperty':'message','value':''+_0x40e933}]}),_0x524edc(0x2,_0x769254(0x23b)),_0x524edc(0x2,_0x40e933);}}});}[_0x5aead6(0x128)](_0x85ade3){const _0x375615=_0x5aead6;if(!_0x282439(_0x211bb3,_0x178ad8)){_0x412844(_0x211bb3,_0x232528,_0x85ade3),_0x1cb69e['recordDebugEvents']({'eventName':_0x375615(0xaa)}),_0x524edc(0x2,_0x375615(0xae));return;}_0x2e48db(_0x375615(0x128),()=>_0x2fbc56(this,null,function*(){const _0x8768e4=_0x375615;let _0x5bad63=JSON[_0x8768e4(0x117)](localStorage[_0x8768e4(0x1b6)](_0x8768e4(0x12e))||'{}');if(_0x5bad63&&_0x5bad63[_0x85ade3[_0x8768e4(0x197)]]){_0x524edc(0x1,_0x8768e4(0x9d));return;}_0x3ee6aa(this,_0x107112,_0x2bf5de)[_0x8768e4(0x1fa)](this,_0x85ade3),_0x282439(this,_0x4a62bf)[_0x8768e4(0x1fa)](this),_0x3ee6aa(this,_0x107112,_0x3a820d)[_0x8768e4(0x1fa)](this,_0x85ade3[_0x8768e4(0x197)]);}));}};_0x254951=new WeakMap(),_0xb24454=new WeakMap(),_0x2eaac6=new WeakMap(),_0x2cb88c=new WeakMap(),_0x178ad8=new WeakMap(),_0x232528=new WeakMap(),_0x107112=new WeakSet(),_0x1dc684=function(_0x4dd0af){return _0x2fbc56(this,null,function*(){const _0x3ba2c2=_0x1f99;_0x524edc(0x1,_0x3ba2c2(0x165)+JSON[_0x3ba2c2(0x258)](_0x4dd0af)+'\x20'),_0x1cb69e['recordDebugEvents']({'eventName':_0x3ba2c2(0x1a2)});let _0x3af7ae;try{_0x3af7ae=Notification[_0x3ba2c2(0x100)],_0x3af7ae&&(_0x524edc(0x1,'Notification\x20permission:\x20'+_0x3af7ae),_0x3af7ae===_0x3ba2c2(0xf8)?(_0x4dd0af||(this[_0x3ba2c2(0x100)]=_0x3ba2c2(0xf8),_0x1cb69e['recordDebugEvents']({'eventName':'Turned\x20Off\x20Notification\x20Reset\x20Permission'})),_0x4dd0af&&(_0x1cb69e[_0x3ba2c2(0x193)]({'eventName':_0x3ba2c2(0x110),'eventProperties':[{'eventProperty':_0x3ba2c2(0x95),'value':''+(_0x4dd0af==null?void 0x0:_0x4dd0af[_0x3ba2c2(0x95)])}]}),_0x282439(this,_0x12edc6)[_0x3ba2c2(0x1fa)](this,_0x4dd0af[_0x3ba2c2(0x197)]),_0x4dd0af[_0x3ba2c2(0x95)]===_0x3ba2c2(0xfc)?_0x3ee6aa(this,_0x107112,_0x545138)[_0x3ba2c2(0x1fa)](this,_0x4dd0af):yield _0x3ee6aa(this,_0x107112,_0x12431e)[_0x3ba2c2(0x1fa)](this,_0x4dd0af))):_0x3af7ae===_0x3ba2c2(0xac)?(_0x1cb69e[_0x3ba2c2(0x193)]({'eventName':_0x3ba2c2(0x99)}),_0x524edc(0x1,'The\x20user\x20has\x20blocked\x20notifications.')):(_0x1cb69e[_0x3ba2c2(0x193)]({'eventName':_0x3ba2c2(0x1de)}),_0x524edc(0x1,_0x3ba2c2(0x227)),_0x282439(_0x16cdb6,_0x2eaac6)||(yield _0x3ee6aa(this,_0x107112,_0x3e540c)['call'](this),yield _0x1cb69e[_0x3ba2c2(0x1ae)]({'eventName':_0x3ba2c2(0x1e9)}),_0x4dd0af||_0x412844(_0x16cdb6,_0x2eaac6,!0x0))));}catch(_0x575920){_0x524edc(0x2,_0x3ba2c2(0x1d6)),_0x1cb69e[_0x3ba2c2(0x193)]({'eventName':'notification_permission_error'});}});},_0x545138=function(_0x67374b){const _0x86bdda=_0x5aead6;try{let _0x54f8cd=document[_0x86bdda(0x17f)]('div'),_0x1b1ea1;_0x67374b[_0x86bdda(0x151)][_0x86bdda(0xaf)]&&(_0x1b1ea1=document['createElement'](_0x86bdda(0x1bb)),_0x1b1ea1[_0x86bdda(0x1d0)]=_0x67374b[_0x86bdda(0x151)][_0x86bdda(0xaf)],_0x1b1ea1[_0x86bdda(0x98)]=_0x86bdda(0x1d9),_0x1b1ea1['id']=_0x86bdda(0xa7));let _0x658b7c=document[_0x86bdda(0x17f)](_0x86bdda(0x16e)),_0x227232=document[_0x86bdda(0x17f)](_0x86bdda(0x16e)),_0x2be502=document[_0x86bdda(0x17f)](_0x86bdda(0x16e)),_0x2d5430=document['createElement']('img'),_0x345974=document[_0x86bdda(0x17f)](_0x86bdda(0x16e)),_0x3dfd40=document['createElement'](_0x86bdda(0x16e)),_0xcd2f67=document[_0x86bdda(0x17f)](_0x86bdda(0x16e)),_0x5560e6=document[_0x86bdda(0x17f)](_0x86bdda(0x16e)),_0x2d865d=document[_0x86bdda(0x17f)](_0x86bdda(0x16e)),_0x3b8e50=document[_0x86bdda(0x17f)](_0x86bdda(0x16e)),_0x575d86=document[_0x86bdda(0x17f)](_0x86bdda(0x167)),_0x52b809=document['createElement'](_0x86bdda(0x167));_0x54f8cd[_0x86bdda(0x249)]='mergn-overlay',_0x658b7c[_0x86bdda(0x249)]=_0x86bdda(0x22d),_0x227232[_0x86bdda(0x249)]=_0x5560e6[_0x86bdda(0x249)]=_0x2d865d[_0x86bdda(0x249)]=_0x86bdda(0xc5),_0x2be502[_0x86bdda(0x249)]=_0x86bdda(0x23e),_0x345974['className']=_0x86bdda(0x111),_0x3b8e50[_0x86bdda(0x249)]=_0x86bdda(0x112),_0x3dfd40['id']=_0x86bdda(0x11e),_0xcd2f67['id']=_0x86bdda(0x17b),_0x575d86['id']=_0x86bdda(0x115),_0x52b809['id']='button-2',_0x2d5430[_0x86bdda(0x1d0)]=_0x67374b[_0x86bdda(0x151)]['banner_icon'],_0x2d5430[_0x86bdda(0x98)]=_0x86bdda(0x1d9),_0x2d5430['id']=_0x86bdda(0xc8),_0x3dfd40[_0x86bdda(0x1a5)]=_0x67374b[_0x86bdda(0x151)]['banner_title'],_0xcd2f67[_0x86bdda(0x1a5)]=_0x67374b[_0x86bdda(0x151)][_0x86bdda(0x10e)],_0x575d86['textContent']=_0x67374b[_0x86bdda(0x151)][_0x86bdda(0x190)][_0x86bdda(0xf1)],_0x52b809['textContent']=_0x67374b['banner_design'][_0x86bdda(0xba)][_0x86bdda(0xf1)],_0x2be502[_0x86bdda(0x1c3)](_0x2d5430),_0x345974['appendChild'](_0x3dfd40),_0x345974[_0x86bdda(0x1c3)](_0xcd2f67),_0x227232[_0x86bdda(0x1c3)](_0x2be502),_0x227232[_0x86bdda(0x1c3)](_0x345974),_0x1b1ea1&&(_0x5560e6['appendChild'](_0x1b1ea1),_0x1b1ea1[_0x86bdda(0x205)][_0x86bdda(0xdc)]='\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0adisplay:\x20block;\x0amargin-left:\x20auto;\x0amargin-right:\x20auto;\x0aborder-radius:\x2010px;\x0amax-width:\x20350px;\x0aaspect-ratio:\x202\x20/\x201;\x0a'),_0x3b8e50['appendChild'](_0x575d86),_0x3b8e50['appendChild'](_0x52b809),_0x2d865d[_0x86bdda(0x1c3)](_0x3b8e50),_0x658b7c[_0x86bdda(0x1c3)](_0x227232),_0x658b7c[_0x86bdda(0x1c3)](_0x5560e6),_0x658b7c[_0x86bdda(0x1c3)](_0x2d865d),_0x54f8cd[_0x86bdda(0x1c3)](_0x658b7c),_0x54f8cd[_0x86bdda(0x205)]['cssText']=_0x86bdda(0x1c0),_0x658b7c[_0x86bdda(0x205)][_0x86bdda(0xdc)]=_0x86bdda(0x229)+_0x67374b['banner_design'][_0x86bdda(0x1a8)]+_0x86bdda(0x1f3),_0x227232['style']['cssText']=_0x5560e6[_0x86bdda(0x205)][_0x86bdda(0xdc)]=_0x2d865d['style'][_0x86bdda(0xdc)]=_0x86bdda(0x244),_0x2be502[_0x86bdda(0x205)]['cssText']=_0x86bdda(0x250),_0x345974[_0x86bdda(0x205)][_0x86bdda(0xdc)]=_0x86bdda(0x182),_0x2d5430['style'][_0x86bdda(0xdc)]='\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a',_0x575d86[_0x86bdda(0x205)][_0x86bdda(0xdc)]='\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20'+_0x67374b[_0x86bdda(0x151)][_0x86bdda(0x190)][_0x86bdda(0x170)]+_0x86bdda(0x1d8)+_0x67374b[_0x86bdda(0x151)]['button_1'][_0x86bdda(0x24b)]+_0x86bdda(0xdf),_0x52b809['style'][_0x86bdda(0xdc)]=_0x86bdda(0x104)+_0x67374b['banner_design'][_0x86bdda(0xba)][_0x86bdda(0x170)]+_0x86bdda(0x1d8)+_0x67374b[_0x86bdda(0x151)]['button_2'][_0x86bdda(0x24b)]+';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a',_0x3b8e50['style'][_0x86bdda(0xdc)]=_0x86bdda(0x21c),_0x3dfd40[_0x86bdda(0x205)][_0x86bdda(0xdc)]='\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20'+_0x67374b[_0x86bdda(0x151)][_0x86bdda(0x1bd)]+'\x0a',_0xcd2f67[_0x86bdda(0x205)]['cssText']=_0x86bdda(0x183)+_0x67374b['banner_design'][_0x86bdda(0x1bd)]+'\x0a',document[_0x86bdda(0x1ea)][_0x86bdda(0x1c3)](_0x54f8cd),document[_0x86bdda(0x1ea)][_0x86bdda(0x205)][_0x86bdda(0x1f2)]=_0x86bdda(0x1b9),_0x1cb69e[_0x86bdda(0x1ae)]({'eventName':_0x86bdda(0x234),'name':'viewed','web_optin_instance_id':_0x67374b[_0x86bdda(0x197)]}),_0x575d86==null||_0x575d86['addEventListener'](_0x86bdda(0xa6),()=>_0x2fbc56(this,null,function*(){const _0x37b64c=_0x86bdda;_0x54f8cd['remove'](),_0x412844(_0x16cdb6,_0x2cb88c,!0x1),document['body'][_0x37b64c(0x205)][_0x37b64c(0x1f2)]=_0x37b64c(0x1fc),yield _0x1cb69e[_0x37b64c(0x1ae)]({'eventName':_0x37b64c(0x1f4),'web_optin_instance_id':_0x67374b[_0x37b64c(0x197)]}),_0x524edc(0x1,'User\x20denied\x20the\x20notification\x20permission.');})),_0x52b809==null||_0x52b809[_0x86bdda(0x168)](_0x86bdda(0xa6),()=>_0x2fbc56(this,null,function*(){const _0x8b7cc4=_0x86bdda;_0x54f8cd['remove'](),document[_0x8b7cc4(0x1ea)]['style']['overflow']=_0x8b7cc4(0x1fc),_0x1cb69e[_0x8b7cc4(0x1ae)]({'eventName':_0x8b7cc4(0x195),'web_optin_instance_id':_0x67374b[_0x8b7cc4(0x197)]}),yield _0x3ee6aa(this,_0x107112,_0x12431e)['call'](this,_0x67374b);}));}catch(_0x482ebc){}},_0x12431e=function(_0xd8d9e0){return _0x2fbc56(this,null,function*(){const _0x4f5a75=_0x1f99;try{_0x1cb69e[_0x4f5a75(0x1ae)]({'eventName':_0x4f5a75(0xe8),'name':_0x4f5a75(0x186),'web_optin_instance_id':_0xd8d9e0['web_optin_instance_id']});let _0x24e18f=yield Notification[_0x4f5a75(0x1ad)]();_0x24e18f===_0x4f5a75(0x1a3)?(_0x524edc(0x1,_0x4f5a75(0x19d)),yield _0x3ee6aa(this,_0x107112,_0x3e540c)[_0x4f5a75(0x1fa)](this),yield _0x1cb69e['recordEvent']({'eventName':_0x4f5a75(0x236),'name':_0x4f5a75(0x130),'web_optin_instance_id':_0xd8d9e0[_0x4f5a75(0x197)]})):_0x24e18f===_0x4f5a75(0xac)?(yield _0x1cb69e['recordEvent']({'eventName':'Blocked\x20Web\x20Push\x20Subscription'}),_0x524edc(0x1,_0x4f5a75(0x14e))):_0x24e18f===_0x4f5a75(0xf8)&&(yield _0x1cb69e[_0x4f5a75(0x1ae)]({'eventName':_0x4f5a75(0x24e)}),_0x524edc(0x1,_0x4f5a75(0x17c)));}catch(_0xc74011){_0x524edc(0x2,_0x4f5a75(0xc0));}_0x412844(_0x16cdb6,_0x2cb88c,!0x1);});},_0x3e540c=function(){return _0x2fbc56(this,null,function*(){const _0x50f309=_0x1f99;var _0x2e3d6d,_0xc87436;let _0x354183=yield _0x545bce[_0x50f309(0xdd)](''+_0x424206);if(_0x354183[_0x50f309(0xcc)]){let _0x520e3b=yield(_0x2e3d6d=_0x282439(_0x16cdb6,_0xb24454))==null?void 0x0:_0x2e3d6d[_0x50f309(0x199)][_0x50f309(0x17a)]();_0x520e3b&&(yield _0x520e3b['unsubscribe']());let _0x53839f=yield(_0xc87436=_0x282439(_0x16cdb6,_0xb24454))==null?void 0x0:_0xc87436[_0x50f309(0x199)][_0x50f309(0x24d)]({'applicationServerKey':_0x354183[_0x50f309(0xb4)]||'','userVisibleOnly':!0x0});yield _0x545bce['put'](''+_0x3a6ed2,{'device_id':localStorage[_0x50f309(0x1b6)](_0x50f309(0x219))||'','is_web_push_subscribed':!0x0,'web_push_subscription_page_url':window[_0x50f309(0x14f)][_0x50f309(0x148)],'web_push_token':{'token':JSON[_0x50f309(0x117)](JSON[_0x50f309(0x258)](_0x53839f))}}),_0x524edc(0x1,'User\x20is\x20subscribed');}else throw new Error('Failed\x20to\x20subscribe\x20the\x20user');});},_0x2bf5de=function(_0x2104ae){const _0xc6f441=_0x5aead6;_0x1ad162[_0xc6f441(0x215)](_0x2104ae,_0xc6f441(0x12e),'web_optin_instance_id');},_0x4a62bf=new WeakMap(),_0x3a820d=function(_0x3a02ad){const _0x2a89c5=_0x5aead6;if(_0x282439(_0x16cdb6,_0x2cb88c))return;_0x412844(_0x16cdb6,_0x2cb88c,!0x0);let _0x404819=_0x3ee6aa(this,_0x107112,_0x398e49)[_0x2a89c5(0x1fa)](this);if(_0x404819!=null&&_0x404819[_0x3a02ad])switch(_0x404819[_0x3a02ad][_0x2a89c5(0x122)]){case'DELAY':{_0x3ee6aa(this,_0x107112,_0x3db2de)['call'](this,_0x404819[_0x3a02ad]);break;}case'IMMEDIATELY':{_0x3ee6aa(this,_0x107112,_0x3d1ad3)[_0x2a89c5(0x1fa)](this,_0x404819[_0x3a02ad]);break;}case _0x2a89c5(0x242):{_0x3ee6aa(this,_0x107112,_0x1eb811)['call'](this,_0x404819[_0x3a02ad]);break;}default:return;}},_0x398e49=function(){const _0x1f6d3a=_0x5aead6;let _0x1dab04=localStorage[_0x1f6d3a(0x1b6)](_0x1f6d3a(0x12e));return _0x1dab04?JSON[_0x1f6d3a(0x117)](_0x1dab04):null;},_0x3db2de=function(_0x44e84e){const _0x5940b9=_0x5aead6;_0x1ad162[_0x5940b9(0x210)]({'clearActionMethod':_0x282439(this,_0x12edc6)[_0x5940b9(0xb1)](this),'data':_0x44e84e,'displayMethod':_0x3ee6aa(this,_0x107112,_0x3d1ad3)[_0x5940b9(0xb1)](this),'idKey':_0x5940b9(0x197),'timeValueKey':_0x5940b9(0xc7)});},_0x3d1ad3=function(_0x4c7224){const _0x4b74d2=_0x5aead6;_0x3ee6aa(this,_0x107112,_0x1dc684)[_0x4b74d2(0x1fa)](this,_0x4c7224);},_0x12edc6=new WeakMap(),_0x1eb811=function(_0x70fd9e){const _0x1f31c9=_0x5aead6;_0x1ad162[_0x1f31c9(0x120)]({'data':_0x70fd9e,'displayMethod':_0x3ee6aa(this,_0x107112,_0x3d1ad3)['bind'](this),'timeValueKey':'entry_time_value'});},_0x4f26ee(_0x16cdb6,_0x254951),_0x4f26ee(_0x16cdb6,_0xb24454,null),_0x4f26ee(_0x16cdb6,_0x2eaac6,!0x1),_0x4f26ee(_0x16cdb6,_0x2cb88c,!0x1),_0x4f26ee(_0x16cdb6,_0x178ad8,!0x1),_0x4f26ee(_0x16cdb6,_0x232528,null);var _0x22f1da=_0x16cdb6,_0x382007=_0x22f1da[_0x5aead6(0xf7)](),_0xde2ff0,_0x1819a3,_0x2d61c9,_0x6a99c6,_0x5e7d98,_0x2b841b,_0x51f831,_0x4e6ee3,_0x3b9473,_0x2425b9,_0x10e540,_0x5ec10b,_0x39336d=class _0x3d8f19{constructor(){const _0x467787=_0x5aead6;_0x4f26ee(this,_0x1819a3),_0x4f26ee(this,_0x51f831,_0x41a8d8=>{const _0x293b81=_0x1f99;_0x1ad162[_0x293b81(0x90)]({'id':_0x41a8d8,'localStorageKey':_0x293b81(0x1ed)});}),this[_0x467787(0xd9)]=()=>{const _0x4963f8=_0x467787;_0x1ad162[_0x4963f8(0x96)]({'actionCondition':_0x4c6c5b=>_0x4c6c5b['message'][_0x4963f8(0x1dc)]===_0x4963f8(0x16f),'actionMethod':_0x249ffe=>_0x3ee6aa(this,_0x1819a3,_0x6a99c6)[_0x4963f8(0x1fa)](this,_0x249ffe[_0x4963f8(0xee)]),'localStorageKey':_0x4963f8(0x1ed)});},_0x4f26ee(this,_0x5ec10b,()=>{const _0xaf95bb=_0x467787;_0x1ad162[_0xaf95bb(0x121)](_0xaf95bb(0x1ed));});}static[_0x5aead6(0xf7)](){const _0x3aceb0=_0x5aead6;var _0x54a8ed;return _0x282439(_0x3d8f19,_0xde2ff0)||(_0x412844(_0x3d8f19,_0xde2ff0,new _0x3d8f19()),_0x3ee6aa(_0x54a8ed=_0x282439(_0x3d8f19,_0xde2ff0),_0x1819a3,_0x2d61c9)[_0x3aceb0(0x1fa)](_0x54a8ed)),_0x282439(_0x3d8f19,_0xde2ff0);}[_0x5aead6(0x187)](_0xea7405){const _0x348087=_0x5aead6;let _0x4968c8=JSON[_0x348087(0x117)](localStorage[_0x348087(0x1b6)](_0x348087(0x1ed))||'{}');if(_0x4968c8&&_0x4968c8[_0xea7405==null?void 0x0:_0xea7405['campaignId']]){_0x524edc(0x1,'Popup\x20already\x20in\x20cache');return;}_0x3ee6aa(this,_0x1819a3,_0x10e540)[_0x348087(0x1fa)](this,_0xea7405),_0x282439(this,_0x5ec10b)[_0x348087(0x1fa)](this),_0x3ee6aa(this,_0x1819a3,_0x6a99c6)[_0x348087(0x1fa)](this,_0xea7405[_0x348087(0xee)]);}[_0x5aead6(0x18c)](_0x312b37){const _0x315b00=_0x5aead6;return _0x312b37===_0x315b00(0x16f);}};_0xde2ff0=new WeakMap(),_0x1819a3=new WeakSet(),_0x2d61c9=function(){return _0x2fbc56(this,null,function*(){});},_0x6a99c6=function(_0x5e31e7){const _0x292168=_0x5aead6;let _0x27ea2e=_0x3ee6aa(this,_0x1819a3,_0x5e7d98)[_0x292168(0x1fa)](this);if(document[_0x292168(0x163)](_0x292168(0x124)+_0x5e31e7)){_0x524edc(0x1,'Popup\x20already\x20displayed'),_0x282439(this,_0x51f831)[_0x292168(0x1fa)](this,_0x5e31e7);return;}if(_0x27ea2e!=null&&_0x27ea2e[_0x5e31e7])switch(_0x27ea2e[_0x5e31e7]['campaignEntryTime']){case _0x292168(0xeb):{_0x3ee6aa(this,_0x1819a3,_0x2b841b)[_0x292168(0x1fa)](this,_0x27ea2e[_0x5e31e7]);break;}case _0x292168(0x12b):{_0x3ee6aa(this,_0x1819a3,_0x4e6ee3)[_0x292168(0x1fa)](this,_0x27ea2e[_0x5e31e7]);break;}case'SCROLL':{_0x3ee6aa(this,_0x1819a3,_0x2425b9)[_0x292168(0x1fa)](this,_0x27ea2e[_0x5e31e7]);break;}default:return;}},_0x5e7d98=function(){const _0x486a01=_0x5aead6;let _0x2b857d=localStorage[_0x486a01(0x1b6)](_0x486a01(0x1ed));return _0x2b857d?JSON[_0x486a01(0x117)](_0x2b857d):null;},_0x2b841b=function(_0x268fee){const _0x4e8c7c=_0x5aead6;_0x1ad162['showDelayedAction']({'clearActionMethod':_0x282439(this,_0x51f831)['bind'](this),'data':_0x268fee,'displayMethod':_0x3ee6aa(this,_0x1819a3,_0x4e6ee3)[_0x4e8c7c(0xb1)](this),'idKey':_0x4e8c7c(0xee),'timeValueKey':_0x4e8c7c(0x20a)});},_0x51f831=new WeakMap(),_0x4e6ee3=function(_0x3f6dfa){const _0xc2ab97=_0x5aead6;if(document[_0xc2ab97(0x163)]('popup_container_'+_0x3f6dfa[_0xc2ab97(0xee)]))_0x524edc(0x1,'Popup\x20already\x20displayed');else{let _0x125a25=_0x3ee6aa(this,_0x1819a3,_0x3b9473)[_0xc2ab97(0x1fa)](this,_0xc2ab97(0x16e),_0x3f6dfa);document['body'][_0xc2ab97(0x1c3)](_0x125a25),_0x1cb69e[_0xc2ab97(0x1ae)]({'campaignCustomerInstanceId':_0x3f6dfa[_0xc2ab97(0x1cb)],'campaignId':_0x3f6dfa[_0xc2ab97(0xee)],'eventName':_0x2fffb3,'eventProperties':[{'eventProperty':_0xc2ab97(0x1c4),'value':JSON[_0xc2ab97(0x258)]({'campaignId':_0x3f6dfa['campaignId']})}],'name':_0xc2ab97(0xf0)});}_0x282439(this,_0x51f831)[_0xc2ab97(0x1fa)](this,_0x3f6dfa[_0xc2ab97(0xee)]);},_0x3b9473=function(_0x35382f,_0x4b7591){const _0x53f60f=_0x5aead6;let {campaignCustomerInstanceId:_0x388bff,campaignId:_0x267d67,message:{design:_0x113765}}=_0x4b7591,_0x1acb75=document[_0x53f60f(0x17f)](_0x35382f);_0x1acb75['id']=_0x53f60f(0x124)+_0x267d67,_0x1acb75[_0x53f60f(0x1b0)]=_0x113765,_0x1acb75[_0x53f60f(0x205)][_0x53f60f(0x22e)]=_0x53f60f(0x24c),_0x1acb75[_0x53f60f(0x205)][_0x53f60f(0x149)]='0',_0x1acb75[_0x53f60f(0x205)]['left']='0',_0x1acb75[_0x53f60f(0x205)][_0x53f60f(0xa4)]=_0x53f60f(0x21d),_0x1acb75[_0x53f60f(0x205)][_0x53f60f(0x1e6)]=_0x53f60f(0x21d),_0x1acb75['style'][_0x53f60f(0x13b)]=_0x53f60f(0x15f);let _0x3d309b=_0x1acb75[_0x53f60f(0x19b)]('.u-popup-container');_0x3d309b&&(_0x3d309b['style']['zIndex']='50');let _0x2d715b=_0x3d309b['querySelector'](_0x53f60f(0x24a));_0x2d715b&&(_0x524edc(0x1,'Popup\x20overlay\x20element\x20found'),_0x2d715b['style'][_0x53f60f(0x220)](_0x53f60f(0x173),_0x53f60f(0x158),'important')),_0x1acb75[_0x53f60f(0x21b)](_0x53f60f(0xe0))['forEach'](_0x308b0f=>{const _0xc882ad=_0x53f60f;let _0x4233fc=_0x308b0f[_0xc882ad(0x19b)](_0xc882ad(0x17d));_0x4233fc&&_0x4233fc[_0xc882ad(0x168)]('submit',()=>_0x2fbc56(this,null,function*(){const _0x26a5d6=_0xc882ad;_0x1acb75[_0x26a5d6(0x127)]();let _0x3cc641=new FormData(_0x4233fc),_0x55f6cb={};for(let [_0x5f6eae,_0x22e6bd]of _0x3cc641[_0x26a5d6(0xc1)]())_0x55f6cb[_0x5f6eae]=_0x22e6bd;yield _0x1cb69e[_0x26a5d6(0x1ae)]({'campaignCustomerInstanceId':_0x388bff,'campaignId':_0x267d67,'eventName':_0x2fffb3,'eventProperties':[{'eventProperty':_0x26a5d6(0x161),'value':JSON[_0x26a5d6(0x258)]({'campaignId':_0x267d67,'formId':_0x308b0f['id'],'formValues':_0x55f6cb})},{'eventProperty':_0x26a5d6(0x16b),'value':_0x267d67[_0x26a5d6(0xec)]()}],'name':_0x26a5d6(0x17d)});}));});let _0x32e562=_0x1acb75['querySelector'](_0x53f60f(0x1ac));return(_0x32e562==null?void 0x0:_0x32e562[_0x53f60f(0x208)](_0x53f60f(0x1e3)))==='#'&&_0x32e562[_0x53f60f(0x1f6)](_0x53f60f(0x1e3)),_0x32e562==null||_0x32e562['addEventListener'](_0x53f60f(0xa6),()=>_0x2fbc56(this,null,function*(){const _0x33eba5=_0x53f60f;_0x1acb75[_0x33eba5(0x127)](),yield _0x1cb69e[_0x33eba5(0x1ae)]({'campaignCustomerInstanceId':_0x388bff,'campaignId':_0x267d67,'eventName':_0x2fffb3,'eventProperties':[{'eventProperty':_0x33eba5(0x13f),'value':JSON['stringify']({'campaignId':_0x267d67})}],'name':'close'});})),_0x1acb75[_0x53f60f(0x21b)]('[id^=\x22u_content_button_\x22]')[_0x53f60f(0xe2)](_0x1fa009=>{const _0x5b88b4=_0x53f60f;_0x1fa009['addEventListener'](_0x5b88b4(0xa6),()=>_0x2fbc56(this,null,function*(){const _0x403738=_0x5b88b4;_0x1acb75[_0x403738(0x127)](),yield _0x1cb69e[_0x403738(0x1ae)]({'campaignCustomerInstanceId':_0x388bff,'campaignId':_0x267d67,'eventName':_0x2fffb3,'eventProperties':[{'eventProperty':'Button\x20Click','value':JSON[_0x403738(0x258)]({'buttonId':_0x1fa009['id'],'campaignId':_0x267d67})}],'name':_0x403738(0xa6)});}));}),_0x1acb75['querySelectorAll'](_0x53f60f(0x1ec))[_0x53f60f(0xe2)](_0x3f0e5b=>{const _0x322237=_0x53f60f;_0x3f0e5b[_0x322237(0x168)](_0x322237(0xa6),()=>_0x2fbc56(this,null,function*(){const _0x3f3138=_0x322237;_0x1acb75[_0x3f3138(0x127)](),yield _0x1cb69e[_0x3f3138(0x1ae)]({'campaignCustomerInstanceId':_0x388bff,'campaignId':_0x267d67,'eventName':_0x2fffb3,'eventProperties':[{'eventProperty':_0x3f3138(0x19f),'value':JSON[_0x3f3138(0x258)]({'campaignId':_0x267d67,'imageClassName':_0x3f0e5b[_0x3f3138(0x249)],'imageId':_0x3f0e5b['id']})}],'name':'click'});}));}),_0x1acb75;},_0x2425b9=function(_0x44bcd2){const _0x1eb389=_0x5aead6;_0x1ad162[_0x1eb389(0x120)]({'data':_0x44bcd2,'displayMethod':_0x3ee6aa(this,_0x1819a3,_0x4e6ee3)[_0x1eb389(0xb1)](this),'timeValueKey':_0x1eb389(0x20a)});},_0x10e540=function(_0x1d3c12){const _0x2b150a=_0x5aead6;_0x1ad162['storeActionInLocalStorage'](_0x1d3c12,_0x2b150a(0x1ed),'campaignId');},_0x5ec10b=new WeakMap(),_0x4f26ee(_0x39336d,_0xde2ff0);var _0x41337b=_0x39336d,_0xc9b044=_0x41337b[_0x5aead6(0xf7)](),_0x3af1da,_0x4e204c,_0x2edb4a,_0x29fa98,_0x378566,_0x5399cd,_0x3b97c8,_0x42a011,_0x5bc651,_0x4af3f4,_0x5ab256,_0x9a8ccd,_0x24fa8d,_0x4af1ba,_0x4e6a0a,_0x4cb405,_0x38d5b4,_0x5ed0fa,_0x230cfa,_0x39ee5d,_0xca2e1e,_0x2d964e,_0x44f464,_0x2c3354,_0x31b136,_0xfce077,_0x486543,_0x233d44,_0x331906=class _0x1aa2f6{constructor(){const _0x4872aa=_0x5aead6;_0x4f26ee(this,_0x5bc651),_0x4f26ee(this,_0x4e204c),_0x4f26ee(this,_0x2edb4a),_0x4f26ee(this,_0x29fa98),_0x4f26ee(this,_0x378566,null),_0x4f26ee(this,_0x5399cd,null),_0x4f26ee(this,_0x3b97c8,!0x1),_0x4f26ee(this,_0x42a011,()=>{setInterval(()=>{const _0x46d439=_0x1f99;let _0x39167c=localStorage[_0x46d439(0x1b6)](_0x46d439(0x21e));if(_0x39167c!==_0x282439(this,_0x5399cd)){_0x412844(this,_0x5399cd,_0x39167c);let _0x54f9bd=JSON[_0x46d439(0x117)](_0x39167c||'{}');if(_0x54f9bd!=null&&_0x54f9bd[_0x46d439(0x240)]){let _0x69a395=_0x54f9bd[_0x46d439(0x240)];delete _0x54f9bd[_0x46d439(0x240)],localStorage[_0x46d439(0x1fb)](_0x46d439(0x21e),JSON[_0x46d439(0x258)](_0x54f9bd)),_0x382007['pushMessageToSW'](_0x69a395);}if(_0x54f9bd!=null&&_0x54f9bd[_0x46d439(0x22a)]){let _0x6bfdde=_0x54f9bd['optIn'];delete _0x54f9bd[_0x46d439(0x22a)],localStorage[_0x46d439(0x1fb)](_0x46d439(0x21e),JSON[_0x46d439(0x258)](_0x54f9bd)),_0x382007[_0x46d439(0x128)](_0x6bfdde);}if(_0x54f9bd!=null&&_0x54f9bd[_0x46d439(0xe5)]){let _0x3a8755=_0x54f9bd[_0x46d439(0xe5)];delete _0x54f9bd[_0x46d439(0xe5)],localStorage[_0x46d439(0x1fb)](_0x46d439(0x21e),JSON[_0x46d439(0x258)](_0x54f9bd)),_0x3a8755['forEach'](_0x27d5f7=>{const _0x490181=_0x46d439;_0xc9b044[_0x490181(0x18c)](_0x27d5f7[_0x490181(0x1ba)][_0x490181(0x1dc)])?_0xc9b044[_0x490181(0x187)](_0x27d5f7):_0x16f039[_0x490181(0x212)](_0x27d5f7[_0x490181(0x1ba)]['name'])&&_0x16f039[_0x490181(0x13d)](_0x27d5f7);});}}},0x3e8);}),this[_0x4872aa(0x121)]=_0x397c63=>{const _0x37ed5d=_0x4872aa;let _0x223eb3=()=>{const _0x19846=_0x1f99;let _0x296370=JSON[_0x19846(0x117)](localStorage[_0x19846(0x1b6)](_0x397c63)||'{}');Object['keys'](_0x296370)[_0x19846(0xe2)](_0x2e765d=>{const _0x55b3e2=_0x19846;_0x296370[_0x2e765d][_0x55b3e2(0x154)]=new Date()[_0x55b3e2(0x221)]();}),localStorage[_0x19846(0x1fb)](_0x397c63,JSON[_0x19846(0x258)](_0x296370));};_0x223eb3(),window[_0x37ed5d(0x168)](_0x37ed5d(0x257),_0x223eb3);},this['clearActionInLocalStorage']=({id:_0x5c510d,localStorageKey:_0x430c4f})=>{const _0x1fdff6=_0x4872aa;let _0x5bed9a=JSON[_0x1fdff6(0x117)](localStorage[_0x1fdff6(0x1b6)](_0x430c4f)||'{}');_0x5bed9a[_0x5c510d]&&delete _0x5bed9a[_0x5c510d],localStorage['setItem'](_0x430c4f,JSON[_0x1fdff6(0x258)](_0x5bed9a));},this['loadActionInLocalStorage']=({actionCondition:_0x240c2b,actionMethod:_0x1fbbde,localStorageKey:_0x58f636})=>{const _0x3e6410=_0x4872aa;let _0x261700=JSON['parse'](localStorage[_0x3e6410(0x1b6)](_0x58f636)||'{}');Object['keys'](_0x261700)[_0x3e6410(0xe2)](_0xdf1ba1=>{_0x240c2b(_0x261700[_0xdf1ba1])&&_0x1fbbde(_0x261700[_0xdf1ba1]);});};}static[_0x5aead6(0xf7)](){return _0x282439(_0x1aa2f6,_0x3af1da)||_0x412844(_0x1aa2f6,_0x3af1da,new _0x1aa2f6()),_0x282439(_0x1aa2f6,_0x3af1da);}['init'](_0x3af0b9,_0x55b2e1){return _0x2fbc56(this,null,function*(){const _0x46714a=_0x1f99;_0x524edc(0x1,_0x46714a(0x137)),_0x55b2e1!=null&&_0x55b2e1[_0x46714a(0x15c)]&&_0x412844(this,_0x3b97c8,!0x0),_0x3ee6aa(this,_0x5bc651,_0x4af3f4)['call'](this,_0x3af0b9);let _0x4cf247=this['getPlatform']();if(_0x4cf247===_0x46714a(0x150)||_0x4cf247===_0x46714a(0x1e7)){_0x524edc(0x2,'Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms');return;}if(yield _0x545bce[_0x46714a(0x132)](),_0x524edc(0x1,_0x46714a(0x92)),yield _0x3ee6aa(this,_0x5bc651,_0x31b136)[_0x46714a(0x1fa)](this,0x3),_0x55b2e1!=null&&_0x55b2e1[_0x46714a(0x15c)]&&_0x282439(this,_0x42a011)[_0x46714a(0x1fa)](this),_0x55b2e1!=null&&_0x55b2e1['identity'])try{_0x1c83dd[_0x46714a(0xc9)]=!0x0,yield this['setIdentity'](_0x55b2e1[_0x46714a(0x1b8)]);}finally{_0x1c83dd[_0x46714a(0xc9)]=!0x1;}setInterval(()=>_0x2fbc56(this,null,function*(){const _0x4b6bb4=_0x46714a;_0x524edc(0x1,_0x4b6bb4(0x147)),yield _0x3ee6aa(this,_0x5bc651,_0x31b136)['call'](this,0x3);}),0x493e0);let _0x33f926=_0x3ee6aa(this,_0x5bc651,_0x24fa8d)['call'](this);if(yield this[_0x46714a(0xca)](),yield _0x1cb69e['recordEventsFromQueue'](),_0x1cb69e[_0x46714a(0x193)]({'eventName':_0x46714a(0x15b)}),_0x524edc(0x1,_0x46714a(0x1d3)),yield _0x2e48db(_0x46714a(0xbe),()=>_0x2fbc56(this,null,function*(){const _0x254111=_0x46714a;yield _0x382007[_0x254111(0x1f8)](_0x33f926,_0x55b2e1==null?void 0x0:_0x55b2e1[_0x254111(0x113)]);})),!(_0x55b2e1!=null&&_0x55b2e1[_0x46714a(0x15c)])){yield _0x3ee6aa(this,_0x5bc651,_0x233d44)['call'](this);let _0x3f1325=history['pushState'];history[_0x46714a(0xbc)]=(..._0x4916c6)=>{const _0x27841b=_0x46714a;_0x3f1325[_0x27841b(0xbd)](history,_0x4916c6),_0x3ee6aa(this,_0x5bc651,_0x486543)[_0x27841b(0x1fa)](this);};}_0x524edc(0x1,_0x46714a(0xc3));});}[_0x5aead6(0xe4)](_0x51e419){_0x412844(this,_0x4e204c,_0x51e419);}['setOSVersion'](_0x28287d){_0x412844(this,_0x2edb4a,_0x28287d);}[_0x5aead6(0x155)](_0x130d54){_0x412844(this,_0x29fa98,_0x130d54);}[_0x5aead6(0x15d)](_0x5171fa){_0x412844(this,_0x378566,_0x5171fa);}['getPreviousUrl'](){return _0x282439(this,_0x378566);}[_0x5aead6(0x1f5)](){return _0x282439(this,_0x4e204c);}[_0x5aead6(0x15a)](){return _0x282439(this,_0x2edb4a);}[_0x5aead6(0x142)](){return _0x282439(this,_0x29fa98);}[_0x5aead6(0x17e)](){const _0x19dcdf=_0x5aead6;localStorage[_0x19dcdf(0x1fb)]('ttl',''+new Date()['getTime']());}[_0x5aead6(0x120)]({data:_0x1ce6f3,displayMethod:_0x378b2a,timeValueKey:_0x215d01}){const _0xbfe341=_0x5aead6;let _0x44c53f=()=>{const _0x385fbc=_0x1f99;var _0x1c88b0;let _0x5885c9=window[_0x385fbc(0x206)],_0x40e179=document[_0x385fbc(0x18d)][_0x385fbc(0xd4)];window[_0x385fbc(0xcd)]/(_0x40e179-_0x5885c9)*0x64>(((_0x1c88b0=_0x1ce6f3[_0x215d01])==null?void 0x0:_0x1c88b0['value'])||0x0)&&(window[_0x385fbc(0x247)](_0x385fbc(0x204),_0x44c53f),_0x378b2a(_0x1ce6f3));};window['addEventListener'](_0xbfe341(0x204),_0x44c53f);}['showDelayedAction']({clearActionMethod:_0x4c1a10,data:_0x52ba2b,displayMethod:_0x36092b,idKey:_0xb21173,timeValueKey:_0x25b087}){const _0x5aff02=_0x5aead6;var _0x2ad9d1,_0x45c8b3,_0x6b4bc4;let _0x4000a5=(_0x2ad9d1=_0x52ba2b[_0x25b087])==null?void 0x0:_0x2ad9d1[_0x5aff02(0x14d)];((_0x45c8b3=_0x52ba2b[_0x25b087])==null?void 0x0:_0x45c8b3[_0x5aff02(0x8f)])===_0x5aff02(0x93)&&(_0x4000a5=_0x4000a5*0x3c);let _0x3a837e=_0x52ba2b[_0x5aff02(0x154)]-0x1f4+(_0x4000a5||0x0)*0x3e8-new Date()[_0x5aff02(0x221)]();_0x524edc(0x1,_0x5aff02(0xd1)+_0x52ba2b[_0x5aff02(0x154)]),_0x524edc(0x1,_0x5aff02(0x159)+((_0x6b4bc4=_0x52ba2b[_0x25b087])==null?void 0x0:_0x6b4bc4['value'])),_0x524edc(0x1,_0x5aff02(0x9c)+new Date()['getTime']()),_0x524edc(0x1,_0x5aff02(0x177)+_0x3a837e),_0x3a837e>0x0?setTimeout(()=>{_0x4c1a10(_0x52ba2b[_0xb21173]),_0x36092b(_0x52ba2b);},_0x3a837e):(_0x4c1a10(_0x52ba2b[_0xb21173]),_0x36092b(_0x52ba2b));}[_0x5aead6(0x215)](_0x594073,_0x3362c8,_0x312dfa){const _0x5e1cd4=_0x5aead6;var _0x3d0aee;let _0x3b04e5=JSON['parse'](localStorage['getItem'](_0x3362c8)||'{}'),_0x5d89d4=(_0x3d0aee=_0x312dfa in _0x594073&&_0x594073[_0x312dfa])!=null?_0x3d0aee:'';_0x5d89d4&&(_0x3b04e5[_0x5d89d4]=_0x4ebf7f(_0x5c8d21({},_0x594073),{'initialTime':new Date()[_0x5e1cd4(0x221)]()}),localStorage[_0x5e1cd4(0x1fb)](_0x3362c8,JSON[_0x5e1cd4(0x258)](_0x3b04e5)));}[_0x5aead6(0xca)](){return _0x2fbc56(this,null,function*(){const _0x36251b=_0x1f99;yield _0x2e48db(_0x36251b(0x1f7),()=>_0x2fbc56(this,null,function*(){const _0x299a2e=_0x36251b;if(_0x282439(this,_0x3b97c8))return;_0x524edc(0x1,_0x299a2e(0x21f)),_0x32db77(_0x299a2e(0x21f),!0x0),_0x4e4e64(_0x299a2e(0xed),!0x0);let _0x756227=localStorage['getItem'](_0x299a2e(0x1a0)),_0x4178f6=!0x1;if(_0x756227){if(_0x4178f6=_0x3ee6aa(this,_0x5bc651,_0x24fa8d)[_0x299a2e(0x1fa)](this,_0x756227),_0x4178f6){let _0x3971dc=localStorage[_0x299a2e(0x1b6)](_0x299a2e(0xb6)),_0x65094d=localStorage['getItem'](_0x299a2e(0x1a0));if(_0x3971dc&&_0x65094d){let _0x46dc76=parseInt(_0x65094d,0xa);_0x1cb69e[_0x299a2e(0x1ae)]({'eventName':_0x299a2e(0x23d),'eventProperties':[{'eventProperty':_0x299a2e(0x256),'value':localStorage['getItem'](_0x299a2e(0xb6))},{'eventProperty':_0x299a2e(0xfa),'value':Number[_0x299a2e(0x9f)](_0x46dc76)?new Date(_0x46dc76)[_0x299a2e(0x237)]():new Date()[_0x299a2e(0x237)]()}]});}this[_0x299a2e(0xb8)](),localStorage[_0x299a2e(0x1fb)](_0x299a2e(0x1a0),''+new Date()[_0x299a2e(0x221)]());}}else localStorage[_0x299a2e(0x1fb)](_0x299a2e(0x1a0),''+new Date()[_0x299a2e(0x221)]());(!_0x756227||_0x4178f6||_0x3ee6aa(this,_0x5bc651,_0x230cfa)[_0x299a2e(0x1fa)](this))&&(_0x3ee6aa(this,_0x5bc651,_0x38d5b4)[_0x299a2e(0x1fa)](this)&&_0x3ee6aa(this,_0x5bc651,_0x39ee5d)['call'](this),_0x3ee6aa(this,_0x5bc651,_0x4cb405)[_0x299a2e(0x1fa)](this)&&(yield this[_0x299a2e(0x1ee)]()),(_0x3ee6aa(this,_0x5bc651,_0x24fa8d)[_0x299a2e(0x1fa)](this)||_0x3ee6aa(this,_0x5bc651,_0x4af1ba)[_0x299a2e(0x1fa)](this))&&(yield _0x3ee6aa(this,_0x5bc651,_0x44f464)[_0x299a2e(0x1fa)](this)),yield _0x3ee6aa(this,_0x5bc651,_0xca2e1e)['call'](this),(_0x3ee6aa(this,_0x5bc651,_0x24fa8d)[_0x299a2e(0x1fa)](this)||_0x3ee6aa(this,_0x5bc651,_0x4e6a0a)[_0x299a2e(0x1fa)](this))&&(yield _0x3ee6aa(this,_0x5bc651,_0x2c3354)['call'](this))),_0x4e4e64(_0x299a2e(0xed),!0x1),_0x32db77(_0x299a2e(0x21f),!0x1);}));});}['clearLocalStorage'](){const _0x4a0afd=_0x5aead6;localStorage[_0x4a0afd(0x16a)](_0x4a0afd(0x1ed)),localStorage[_0x4a0afd(0x16a)](_0x4a0afd(0x1da)),localStorage[_0x4a0afd(0x16a)](_0x4a0afd(0x1be)),localStorage[_0x4a0afd(0x16a)](_0x4a0afd(0xda)),localStorage['removeItem']('ttl'),localStorage[_0x4a0afd(0x16a)](_0x4a0afd(0xb6));}[_0x5aead6(0x1ee)](_0x482163){return _0x2fbc56(this,null,function*(){const _0x2bb680=_0x1f99;let _0x24933c={'deviceId':localStorage['getItem'](_0x2bb680(0x219))||crypto[_0x2bb680(0x233)](),'os':this[_0x2bb680(0x1f5)]()};if(_0x482163)_0x24933c[_0x2bb680(0x1b8)]=_0x482163;else{if(!_0x482163&&localStorage[_0x2bb680(0x1b6)]('customer'))return;}try{let _0x4e73d6=yield _0x3ee6aa(this,_0x5bc651,_0x2d964e)[_0x2bb680(0x1fa)](this,_0x24933c);if(_0x4e73d6!==void 0x0){localStorage[_0x2bb680(0x1fb)](_0x2bb680(0x1e4),_0x4e73d6);try{_0x382007['pushMessageToSW']({'customer':_0x4e73d6});}catch(_0x542646){}}}catch(_0xe47c5c){throw new Error(_0x2bb680(0x9e));}});}};_0x3af1da=new WeakMap(),_0x4e204c=new WeakMap(),_0x2edb4a=new WeakMap(),_0x29fa98=new WeakMap(),_0x378566=new WeakMap(),_0x5399cd=new WeakMap(),_0x3b97c8=new WeakMap(),_0x42a011=new WeakMap(),_0x5bc651=new WeakSet(),_0x4af3f4=function(_0x4ffb2d){const _0xce8ea3=_0x5aead6;_0x545bce[_0xce8ea3(0x140)](_0x4ffb2d),this[_0xce8ea3(0xe4)](_0x3ee6aa(this,_0x5bc651,_0x5ab256)[_0xce8ea3(0x1fa)](this)),this['setOSVersion'](_0x3ee6aa(this,_0x5bc651,_0x9a8ccd)['call'](this)),this[_0xce8ea3(0x155)](navigator[_0xce8ea3(0x152)]);},_0x5ab256=function(){const _0xd74b9e=_0x5aead6;var _0x29cf2b;let _0x2bfe5c=navigator[_0xd74b9e(0x152)]['toLowerCase']();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i[_0xd74b9e(0x253)](_0x2bfe5c)?_0xd74b9e(0x150):/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i[_0xd74b9e(0x253)](_0x2bfe5c)?_0xd74b9e(0xe3):/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i['test'](_0x2bfe5c)?(_0xd74b9e(0x172)in window&&typeof((_0x29cf2b=window==null?void 0x0:window[_0xd74b9e(0x172)])==null?void 0x0:_0x29cf2b[_0xd74b9e(0x100)])!=_0xd74b9e(0xfe),'Mobile'):/windows|macintosh|linux|x11/i[_0xd74b9e(0x253)](_0x2bfe5c)?'Web':_0xd74b9e(0x1e7);},_0x9a8ccd=function(){const _0x3d61db=_0x5aead6;let _0x1b7ba7=navigator['userAgent'],_0x4c6183;return _0x1b7ba7['indexOf'](_0x3d61db(0xad))>-0x1?_0x4c6183='Google\x20Chrome':_0x1b7ba7['indexOf'](_0x3d61db(0x145))>-0x1?_0x4c6183=_0x3d61db(0x145):_0x1b7ba7[_0x3d61db(0xab)](_0x3d61db(0x246))>-0x1?_0x4c6183=_0x3d61db(0xd3):_0x1b7ba7[_0x3d61db(0xab)](_0x3d61db(0x109))>-0x1?_0x4c6183=_0x3d61db(0x1a1):_0x1b7ba7['indexOf'](_0x3d61db(0xf6))>-0x1?_0x4c6183=_0x3d61db(0xf4):_0x4c6183=_0x3d61db(0x1e7),_0x4c6183;},_0x24fa8d=function(_0x4a9ff3){const _0x33aa1c=_0x5aead6;let _0x1dc698;return _0x4a9ff3||(_0x1dc698=localStorage['getItem'](_0x33aa1c(0x1a0))),_0x4a9ff3||_0x1dc698?new Date()['getTime']()-parseInt(_0x4a9ff3||_0x1dc698||'',0xa)>0x124f80:!0x0;},_0x4af1ba=function(){const _0x5882fe=_0x5aead6;return!localStorage[_0x5882fe(0x1b6)]('events');},_0x4e6a0a=function(){const _0x5b7508=_0x5aead6;return!localStorage[_0x5b7508(0x1b6)](_0x5b7508(0x1be));},_0x4cb405=function(){const _0x22612c=_0x5aead6;return!localStorage[_0x22612c(0x1b6)]('customer');},_0x38d5b4=function(){const _0x230d56=_0x5aead6;return!localStorage[_0x230d56(0x1b6)](_0x230d56(0x219));},_0x5ed0fa=function(){const _0x13ab44=_0x5aead6;return!localStorage[_0x13ab44(0x1b6)](_0x13ab44(0xb6));},_0x230cfa=function(){const _0x252f38=_0x5aead6;return _0x3ee6aa(this,_0x5bc651,_0x4af1ba)[_0x252f38(0x1fa)](this)||_0x3ee6aa(this,_0x5bc651,_0x4e6a0a)[_0x252f38(0x1fa)](this)||_0x3ee6aa(this,_0x5bc651,_0x4cb405)[_0x252f38(0x1fa)](this)||_0x3ee6aa(this,_0x5bc651,_0x38d5b4)[_0x252f38(0x1fa)](this)||_0x3ee6aa(this,_0x5bc651,_0x5ed0fa)[_0x252f38(0x1fa)](this);},_0x39ee5d=function(){const _0xd89af2=_0x5aead6;let _0x418b46=localStorage[_0xd89af2(0x1b6)](_0xd89af2(0x219));return _0x418b46||(_0x418b46=crypto['randomUUID'](),localStorage['setItem'](_0xd89af2(0x219),_0x418b46)),_0x418b46;},_0xca2e1e=function(){return _0x2fbc56(this,null,function*(){const _0x505762=_0x1f99;yield _0x2e48db(_0x505762(0x22f),()=>_0x2fbc56(this,null,function*(){const _0x5ba1a8=_0x505762;let _0x782890=localStorage[_0x5ba1a8(0x1b6)](_0x5ba1a8(0xb6));if(!_0x782890){_0x782890=crypto[_0x5ba1a8(0x233)](),localStorage[_0x5ba1a8(0x1fb)](_0x5ba1a8(0xb6),_0x782890);let _0x49491a=localStorage[_0x5ba1a8(0x1b6)](_0x5ba1a8(0x1a0)),_0x3b0851=_0x49491a?parseInt(_0x49491a,0xa):'';yield _0x1cb69e[_0x5ba1a8(0x1ae)]({'eventName':_0x5ba1a8(0x1d1),'eventProperties':[{'eventProperty':'SESSION_ID','value':localStorage[_0x5ba1a8(0x1b6)](_0x5ba1a8(0xb6))},{'eventProperty':_0x5ba1a8(0xfa),'value':_0x3b0851?new Date(_0x3b0851)[_0x5ba1a8(0x237)]():new Date()[_0x5ba1a8(0x237)]()}]});}}),_0x361702=>{const _0x911636=_0x505762;_0x1cb69e[_0x911636(0x1ae)]({'eventName':_0x911636(0xd0),'eventProperties':[{'eventProperty':_0x911636(0x1ba),'value':_0x911636(0x10d)+_0x361702[_0x911636(0x1ba)]}]},!0x0);});});},_0x2d964e=function(_0x2bdfad){return _0x2fbc56(this,null,function*(){const _0x2ba067=_0x1f99;try{return(yield _0x545bce[_0x2ba067(0x20f)](''+_0x4b7816+_0x4f09a6,_0x2bdfad))[_0x2ba067(0xb4)];}catch(_0x1731e0){throw new Error(_0x2ba067(0xb7));}});},_0x44f464=function(){return _0x2fbc56(this,null,function*(){yield _0x1cb69e['storeEventsAndPropertiesInLocalStorage']();});},_0x2c3354=function(){return _0x2fbc56(this,null,function*(){const _0x336e17=_0x1f99;yield _0x22b036[_0x336e17(0x214)]();});},_0x31b136=function(_0x182a4e){return _0x2fbc56(this,null,function*(){const _0x599257=_0x1f99;yield _0x2e48db(_0x599257(0x19a),()=>_0x2fbc56(this,null,function*(){const _0x40e922=_0x599257;var _0x1267ba;try{let _0x210cea=parseInt(localStorage[_0x40e922(0x1b6)]('verifyTTL')||'0',0xa)||0x0;if(!_0x210cea||_0x210cea&&new Date()[_0x40e922(0x221)]()>_0x210cea){let _0x5b866c=yield _0x545bce[_0x40e922(0xdd)](_0x40e922(0x18f));if(!(_0x5b866c!=null&&_0x5b866c['success']))throw new Error(JSON[_0x40e922(0x258)](_0x5b866c));localStorage[_0x40e922(0x1fb)](_0x40e922(0x1cc),(new Date()[_0x40e922(0x221)]()+0x493e0)[_0x40e922(0xec)]());}_0x1c83dd[_0x40e922(0x1a9)]=!0x1,_0x1c83dd[_0x40e922(0xe1)]=!0x0;}catch(_0x40c386){if(_0x545bce[_0x40e922(0x192)]()==='67'&&(!((_0x1267ba=_0x40c386==null?void 0x0:_0x40c386[_0x40e922(0x1ba)])!=null&&_0x1267ba[_0x40e922(0x1df)](_0x40e922(0xdd)))||(_0x40c386==null?void 0x0:_0x40c386['message'])!==_0x40e922(0x136))&&_0x1cb69e['recordEvent']({'eventName':_0x40e922(0xd0),'eventProperties':[{'eventProperty':_0x40e922(0x1ba),'value':_0x40e922(0x1c8)+_0x40c386[_0x40e922(0x1ba)]}]},!0x0),_0x182a4e&&_0x182a4e>=0x1){yield _0x3ee6aa(this,_0x5bc651,_0x31b136)[_0x40e922(0x1fa)](this,_0x182a4e-0x1);return;}throw _0x1c83dd[_0x40e922(0x1a9)]=!0x0,new Error('Error\x20verifying\x20API\x20key');}}));});},_0xfce077=function(){return _0x2fbc56(this,null,function*(){const _0x680e3b=_0x1f99;var _0x106312;_0x524edc(0x1,_0x680e3b(0x14c));let _0x2a75b9=(_0x106312=window==null?void 0x0:window[_0x680e3b(0x14f)])==null?void 0x0:_0x106312[_0x680e3b(0x1e3)];this['setPreviousUrl'](_0x2a75b9),_0x1cb69e[_0x680e3b(0x193)]({'eventName':'pre_vwp'});let _0x1c14b4=[];new URLSearchParams(new URL(window[_0x680e3b(0x14f)]['href'])[_0x680e3b(0x176)])['forEach']((_0x16d5b7,_0x570e74)=>_0x2fbc56(this,null,function*(){const _0x3815af=_0x680e3b;_0x579a5c[_0x3815af(0x235)](_0x570e74)&&_0x1c14b4[_0x3815af(0x1bc)]({'eventProperty':_0x570e74,'value':_0x16d5b7});})),yield _0x1cb69e[_0x680e3b(0x1ae)]({'eventName':_0x680e3b(0xe9),'eventProperties':[{'eventProperty':_0x680e3b(0x248),'value':window['location']['pathname']},..._0x1c14b4]});});},_0x486543=function(){return _0x2fbc56(this,null,function*(){const _0x135507=_0x1f99;var _0x12185f;_0x524edc(0x1,'Tracking\x20page\x20change');let _0x21feea=(_0x12185f=window==null?void 0x0:window[_0x135507(0x14f)])==null?void 0x0:_0x12185f[_0x135507(0x1e3)];(this[_0x135507(0x1e8)]()===null||this[_0x135507(0x1e8)]()===void 0x0||_0x21feea!==this['getPreviousUrl']())&&(yield _0x3ee6aa(this,_0x5bc651,_0xfce077)[_0x135507(0x1fa)](this));});},_0x233d44=function(){return _0x2fbc56(this,null,function*(){const _0x22b520=_0x1f99;var _0x790cc,_0x15cd63;let _0x49bbb8=(_0x790cc=window==null?void 0x0:window[_0x22b520(0x14f)])==null?void 0x0:_0x790cc[_0x22b520(0x1e3)];_0x1cb69e[_0x22b520(0x193)]({'eventName':_0x22b520(0x97),'eventProperties':[{'eventProperty':_0x22b520(0x1ba),'value':(_0x49bbb8!==this[_0x22b520(0x1e8)]())+':'+_0x49bbb8+':'+this['getPreviousUrl']()}]});try{yield _0x3ee6aa(this,_0x5bc651,_0xfce077)[_0x22b520(0x1fa)](this);}catch(_0xa3b8e5){let _0x44441b=_0xa3b8e5&&_0xa3b8e5[_0x22b520(0x1ba)]?(_0x15cd63=_0xa3b8e5==null?void 0x0:_0xa3b8e5[_0x22b520(0x1ba)])==null?void 0x0:_0x15cd63[_0x22b520(0x10a)](0x0,0x64):_0x22b520(0xfe);yield _0x1cb69e[_0x22b520(0x193)]({'eventName':_0x22b520(0x1ff),'eventProperties':[{'eventProperty':_0x22b520(0x1ba),'value':''+_0x44441b}]});}});},_0x4f26ee(_0x331906,_0x3af1da);var _0x4ae74f=_0x331906,_0x1ad162=_0x4ae74f[_0x5aead6(0xf7)](),_0x21765a,_0x42779e,_0x1b521b,_0x1aad23,_0x1b824e,_0x1a0e69,_0x46300e,_0x1271cf,_0x25952a=class _0x1abaad{constructor(){const _0x5e886e=_0x5aead6;_0x4f26ee(this,_0x42779e),this[_0x5e886e(0xf3)]=Promise[_0x5e886e(0x239)]();}static[_0x5aead6(0xf7)](){const _0x43568e=_0x5aead6;var _0x4d4eb0;return _0x282439(_0x1abaad,_0x21765a)||(_0x412844(_0x1abaad,_0x21765a,new _0x1abaad()),_0x3ee6aa(_0x4d4eb0=_0x282439(_0x1abaad,_0x21765a),_0x42779e,_0x1b521b)[_0x43568e(0x1fa)](_0x4d4eb0)),_0x282439(_0x1abaad,_0x21765a);}[_0x5aead6(0x15e)](_0x1fbf65){const _0x56235a=_0x5aead6;let _0x330ef6=JSON[_0x56235a(0x117)](localStorage[_0x56235a(0x1b6)]('preInitializedEvents')||'[]');_0x330ef6['push'](_0x1fbf65),localStorage['setItem'](_0x56235a(0x222),JSON[_0x56235a(0x258)](_0x330ef6));}[_0x5aead6(0x1a4)](){return _0x2fbc56(this,null,function*(){const _0x3cbe7b=_0x1f99;let _0x1369fa=JSON[_0x3cbe7b(0x117)](localStorage[_0x3cbe7b(0x1b6)]('preInitializedEvents')||'[]');if(Array[_0x3cbe7b(0x1a6)](_0x1369fa)){for(let _0x4ffaa2 of _0x1369fa)yield this[_0x3cbe7b(0x181)](_0x4ffaa2);}});}[_0x5aead6(0x1ae)](_0x5c2aa2,_0x4a77ba){return _0x2fbc56(this,null,function*(){const _0x3e778e=_0x1f99;_0x1c83dd['isInitialized']&&!_0x1c83dd[_0x3e778e(0xc9)]?yield _0x3ee6aa(this,_0x42779e,_0x1aad23)['call'](this,_0x5c2aa2,_0x4a77ba):this[_0x3e778e(0x15e)](_0x5c2aa2);});}[_0x5aead6(0x181)](_0x2a18e4){return _0x2fbc56(this,null,function*(){const _0x154536=_0x1f99;try{yield _0x3ee6aa(this,_0x42779e,_0x1aad23)[_0x154536(0x1fa)](this,_0x2a18e4);}finally{_0x3ee6aa(this,_0x42779e,_0x1271cf)[_0x154536(0x1fa)](this,_0x2a18e4[_0x154536(0xce)]);}});}[_0x5aead6(0x193)](_0x231b6f){return _0x2fbc56(this,null,function*(){const _0x4a3e3e=_0x1f99;_0x1c83dd['debugLevel']===0x4&&(!_0x1c83dd[_0x4a3e3e(0x126)]||_0x1c83dd[_0x4a3e3e(0x126)][_0x231b6f[_0x4a3e3e(0xce)]])&&(yield _0x3ee6aa(this,_0x42779e,_0x1aad23)[_0x4a3e3e(0x1fa)](this,_0x231b6f));});}[_0x5aead6(0x196)](){const _0x178f69=_0x5aead6;let _0x209b2b=localStorage[_0x178f69(0x1b6)]('events');return _0x209b2b?JSON[_0x178f69(0x117)](_0x209b2b):{};}[_0x5aead6(0x251)](){return _0x2fbc56(this,null,function*(){const _0x1f151c=_0x1f99;if(!localStorage['getItem'](_0x1f151c(0x1da))){let _0x46d470=(yield this['fetchEventData']())['data'];if(_0x46d470){localStorage[_0x1f151c(0x1fb)](_0x1f151c(0x1da),JSON['stringify'](_0x46d470));try{_0x382007['pushMessageToSW']({'events':_0x46d470});}catch(_0x506a28){}}}});}[_0x5aead6(0x225)](){return _0x2fbc56(this,null,function*(){try{return yield _0x545bce['get'](''+_0x3c63fc);}catch(_0xe1f2d1){throw new Error('Error\x20fetching\x20event\x20data');}});}[_0x5aead6(0x160)](_0x49de60,_0x1187e8){return _0x2fbc56(this,null,function*(){const _0x28cef1=_0x1f99;let _0x1d7d57=null,_0x1f496b=null,_0x13b341=new AbortController();return this[_0x28cef1(0xf3)]=this[_0x28cef1(0xf3)]['then'](()=>_0x2fbc56(this,null,function*(){const _0x2a31a0=_0x28cef1;try{if(_0x49de60['events']['length']===0x0)throw new Error(_0x2a31a0(0x1b3));let _0x428676=yield _0x545bce[_0x2a31a0(0x20f)](_0x2a31a0(0x9a)+_0x3c63fc+_0x23d8fe,_0x49de60,_0x13b341[_0x2a31a0(0x241)]);if(_0x428676[_0x2a31a0(0xcc)])return _0x1f496b=_0x428676,_0x428676;if(_0x428676[_0x2a31a0(0x1ba)]===_0x2a31a0(0x12d)+localStorage[_0x2a31a0(0x1b6)]('customer')+'\x20not\x20exists')throw localStorage[_0x2a31a0(0x16a)](_0x2a31a0(0x1e4)),new Error(_0x2a31a0(0x232));}catch(_0x3cc063){throw _0x524edc(0x2,_0x2a31a0(0x18b)),_0x524edc(0x2,_0x2a31a0(0x1c5)+_0x3cc063[_0x2a31a0(0x1dc)]),_0x524edc(0x2,_0x2a31a0(0x106)+_0x3cc063['message']),(_0x3cc063[_0x2a31a0(0x1dc)]==='AbortError'||_0x3cc063[_0x2a31a0(0x1dc)]===_0x2a31a0(0xa9)&&_0x3cc063[_0x2a31a0(0x1ba)]===_0x2a31a0(0x146))&&(_0x524edc(0x2,_0x2a31a0(0x1f9)),_0x1187e8&&_0x3ee6aa(this,_0x42779e,_0x46300e)[_0x2a31a0(0x1fa)](this,_0x1187e8)),_0x1d7d57=new Error(_0x2a31a0(0xf5)),_0x3cc063;}return null;}))[_0x28cef1(0x213)](()=>{}),this[_0x28cef1(0xf3)]['then'](()=>{if(_0x1d7d57)throw _0x1d7d57;return _0x1f496b;});});}};_0x21765a=new WeakMap(),_0x42779e=new WeakSet(),_0x1b521b=function(){return _0x2fbc56(this,null,function*(){});},_0x1aad23=function(_0x412e56,_0x3afdb2){return _0x2fbc56(this,null,function*(){const _0x33696d=_0x1f99;yield _0x2e48db(_0x33696d(0x138),()=>_0x2fbc56(this,null,function*(){const _0xf19989=_0x33696d;var _0x6f5d2a,_0x17f630,_0x3ef4bb,_0x4b48ff;let {campaignCustomerInstanceId:_0x51b1e3,campaignId:_0x4b64c9,eventName:_0x522df4,eventProperties:_0x5e9d73,name:_0xfb7046,web_optin_instance_id:_0x3df22d}=_0x412e56;_0x524edc(0x1,_0xf19989(0x20d)),_0x32db77(_0xf19989(0x1a7),!0x0),_0x4e4e64(_0xf19989(0x135),!0x0),_0x524edc(0x1,_0xf19989(0x8e)),_0x524edc(0x1,{'campaignCustomerInstanceId':_0x51b1e3,'eventName':_0x522df4,'eventProperties':_0x5e9d73,'name':_0xfb7046,'web_optin_instance_id':_0x3df22d});let _0xb820ed=_0x1ad162[_0xf19989(0x1f5)]();if(_0xb820ed===_0xf19989(0x150)||_0xb820ed==='Unknown')throw new Error(_0xf19989(0x216));_0x522df4!=='Web\x20Session\x20Concluded'&&(yield _0x1ad162[_0xf19989(0xca)]());let _0x14326b=[];_0x5e9d73&&_0x14326b['push'](..._0x5e9d73),_0x14326b['push']({'eventProperty':_0xf19989(0x1e0),'value':_0xb820ed}),_0x14326b[_0xf19989(0x1bc)]({'eventProperty':_0xf19989(0xd5),'value':_0x1ad162[_0xf19989(0x142)]()}),_0x14326b[_0xf19989(0x1bc)]({'eventProperty':_0xf19989(0x131),'value':_0x1ad162[_0xf19989(0x15a)]()});let _0x4fca22=this['getStoredEvents'](),_0x3d7f31=_0x3ee6aa(this,_0x42779e,_0x1b824e)[_0xf19989(0x1fa)](this,_0x4fca22,_0x522df4,_0x14326b);if(typeof _0x3d7f31=='string'){_0x524edc(0x2,_0x3d7f31);return;}_0x1ad162['updateSessionCreated']();let {id:_0x3b4d7b}=_0x4fca22[_0x522df4],_0x3651a0=_0x3ee6aa(this,_0x42779e,_0x1a0e69)[_0xf19989(0x1fa)](this,_0x5c8d21(_0x4ebf7f(_0x5c8d21(_0x5c8d21(_0x5c8d21({},_0x51b1e3?{'campaignCustomerInstanceId':_0x51b1e3}:{}),_0x4b64c9?{'campaignId':_0x4b64c9}:{}),_0x3df22d?{'web_optin_instance_id':_0x3df22d}:{}),{'eventId':_0x3b4d7b,'eventProperties':_0x3d7f31,'sessionId':localStorage[_0xf19989(0x1b6)](_0xf19989(0xb6))||''}),_0xfb7046?{'name':_0xfb7046}:{}));if(_0x1c83dd[_0xf19989(0x179)]){let _0x5d8de5=JSON[_0xf19989(0x117)](localStorage[_0xf19989(0x1b6)]('offlineEvents')||'[]');_0x5d8de5['length']<=0x32&&(_0x5d8de5[_0xf19989(0x1bc)](..._0x3651a0[_0xf19989(0x1da)]),localStorage[_0xf19989(0x1fb)](_0xf19989(0xda),JSON[_0xf19989(0x258)](_0x5d8de5)));return;}let _0x5b3aca=yield this[_0xf19989(0x160)](_0x3651a0,_0x412e56);(_0x6f5d2a=_0x5b3aca==null?void 0x0:_0x5b3aca[_0xf19989(0xb4)])!=null&&_0x6f5d2a[_0xf19989(0x22a)]?(yield this[_0xf19989(0x193)]({'eventName':_0xf19989(0x1aa)}),_0x382007[_0xf19989(0x128)](_0x5b3aca['data'][_0xf19989(0x22a)])):_0x522df4==='Viewed\x20Webpage'&&(yield this[_0xf19989(0x193)]({'eventName':_0xf19989(0x1fd),'eventProperties':[{'eventProperty':_0xf19989(0x1ba),'value':''+('Notification'in window&&typeof((_0x17f630=window==null?void 0x0:window[_0xf19989(0x172)])==null?void 0x0:_0x17f630['permission'])!=_0xf19989(0xfe))}]})),(_0x4b48ff=(_0x3ef4bb=_0x5b3aca==null?void 0x0:_0x5b3aca[_0xf19989(0xb4)])==null?void 0x0:_0x3ef4bb[_0xf19989(0xe5)])==null||_0x4b48ff['forEach'](_0x1b51cb=>{const _0x46f40f=_0xf19989;_0xc9b044[_0x46f40f(0x18c)](_0x1b51cb[_0x46f40f(0x1ba)][_0x46f40f(0x1dc)])?_0xc9b044[_0x46f40f(0x187)](_0x1b51cb):_0x16f039[_0x46f40f(0x212)](_0x1b51cb['message']['name'])&&_0x16f039[_0x46f40f(0x13d)](_0x1b51cb);}),_0x4e4e64(_0xf19989(0x135),!0x1),_0x32db77(_0xf19989(0x1a7),!0x1);}),_0x5e9c32=>{const _0x4d8a4b=_0x33696d;this[_0x4d8a4b(0x1ae)]({'eventName':_0x4d8a4b(0xd0),'eventProperties':[{'eventProperty':_0x4d8a4b(0x1ba),'value':_0x4d8a4b(0x180)+_0x412e56+_0x4d8a4b(0x11a)+_0x5e9c32[_0x4d8a4b(0x1ba)]}]},!0x0);},_0x3afdb2);});},_0x1b824e=function(_0x4a4c90,_0x881df2,_0x522c16){const _0x2b3ac3=_0x5aead6;if(!Object[_0x2b3ac3(0xea)][_0x2b3ac3(0x218)][_0x2b3ac3(0x1fa)](_0x4a4c90,_0x881df2))return _0x2b3ac3(0x141)+_0x881df2+_0x2b3ac3(0x201);if(!_0x522c16)return[];let _0x46224f=_0x4a4c90[_0x881df2];if(!(_0x46224f!=null&&_0x46224f[_0x2b3ac3(0x153)]))return'Event\x20'+_0x881df2+_0x2b3ac3(0x1b2);let _0x50cadd=_0x522c16[_0x2b3ac3(0x1c2)](({eventProperty:_0x4d2ad7})=>!Object[_0x2b3ac3(0xea)][_0x2b3ac3(0x218)][_0x2b3ac3(0x1fa)](_0x46224f[_0x2b3ac3(0x153)],_0x4d2ad7))['map'](({eventProperty:_0x4ba4f9})=>_0x4ba4f9);return _0x50cadd[_0x2b3ac3(0xa2)]>0x0?_0x2b3ac3(0x141)+_0x881df2+_0x2b3ac3(0x20e)+_0x50cadd[_0x2b3ac3(0x243)](',\x20')+'.':_0x522c16[_0x2b3ac3(0x10b)](({eventProperty:_0x28441e,value:_0x430076})=>({'eventPropertyId':_0x46224f[_0x2b3ac3(0x153)][_0x28441e]['id'],'value':_0x430076}));},_0x1a0e69=function(_0x30cfea){const _0x28a7cb=_0x5aead6;return{'customerId':localStorage[_0x28a7cb(0x1b6)](_0x28a7cb(0x1e4))||'','deviceId':localStorage['getItem'](_0x28a7cb(0x219))||'','events':[_0x30cfea]};},_0x46300e=function(_0x174458){const _0x3c65d1=_0x5aead6;_0x524edc(0x1,'Adding\x20to\x20pre-initialized\x20event:'),_0x524edc(0x1,_0x174458);let _0x2587d6=localStorage[_0x3c65d1(0x1b6)](_0x3c65d1(0x222));_0x2587d6&&_0x2587d6!==_0x3c65d1(0xfe)?(_0x2587d6=JSON[_0x3c65d1(0x117)](_0x2587d6),_0x2587d6[_0x3c65d1(0x1bc)](_0x174458)):_0x2587d6=[_0x174458],localStorage[_0x3c65d1(0x1fb)]('preInitializedEvents',JSON['stringify'](_0x2587d6));},_0x1271cf=function(_0x20eb1d){const _0x4eb3c3=_0x5aead6;let _0x3c622d=JSON[_0x4eb3c3(0x117)](localStorage[_0x4eb3c3(0x1b6)](_0x4eb3c3(0x222))||'[]'),_0x20b8aa=_0x3c622d[_0x4eb3c3(0xef)](_0x1ac03b=>_0x1ac03b[_0x4eb3c3(0xce)]===_0x20eb1d);_0x20b8aa>=0x0&&_0x3c622d[_0x4eb3c3(0x1af)](_0x20b8aa,0x1),localStorage[_0x4eb3c3(0x1fb)]('preInitializedEvents',JSON[_0x4eb3c3(0x258)](_0x3c622d));},_0x4f26ee(_0x25952a,_0x21765a);var _0x31b4b2=_0x25952a,_0x1cb69e=_0x31b4b2[_0x5aead6(0xf7)](),_0x1c83dd=class extends Error{constructor(_0x3f33e0){const _0x202ccc=_0x5aead6;super(_0x3f33e0),this[_0x202ccc(0x1dc)]='MergnError';}};_0x1c83dd[_0x5aead6(0x1a9)]=!0x1,_0x1c83dd[_0x5aead6(0x179)]=!navigator[_0x5aead6(0x238)],_0x1c83dd[_0x5aead6(0x18a)]=0x0,_0x1c83dd[_0x5aead6(0xe1)]=!0x1,_0x1c83dd['loading']=!0x1;var _0x294cec=(_0x49270e,_0xe96d5)=>{const _0xbb7303=_0x5aead6;_0xe96d5 instanceof _0x1c83dd?_0x524edc(0x2,_0xbb7303(0x1d4)+_0x49270e+_0xbb7303(0x20c)+_0xe96d5[_0xbb7303(0x1ba)]):_0xe96d5 instanceof Error?_0x524edc(0x2,_0xbb7303(0x1d4)+_0x49270e+_0xbb7303(0x23f)+_0xe96d5[_0xbb7303(0x1ba)]):_0x524edc(0x2,'OriginateFrom:\x20'+_0x49270e+_0xbb7303(0x23f)+String(_0xe96d5));},_0x2e48db=(_0x1ba011,_0x3e6394,_0x1b9711,_0x9df90d=!0x1)=>_0x2fbc56(void 0x0,null,function*(){const _0x858f3=_0x5aead6;try{_0x32db77(_0x1ba011,!0x0),_0x4e4e64(_0x1ba011+_0x858f3(0xdb),!0x0);try{if(_0x1c83dd[_0x858f3(0x1a9)])throw new _0x1c83dd(_0x858f3(0x1ca));if(_0x1ba011!==_0x858f3(0xc6)&&_0x1c83dd[_0x858f3(0x179)])throw new _0x1c83dd(_0x858f3(0xa5));if(_0x1ba011!==_0x858f3(0x1f8)&&_0x1ba011!==_0x858f3(0x19a)&&_0x1ba011!==_0x858f3(0xc6)&&_0x1ba011!==_0x858f3(0x11d)&&!_0x1c83dd[_0x858f3(0xe1)])throw new _0x1c83dd(_0x858f3(0x14b));if(_0x1ba011!=='login'&&_0x1c83dd['loading'])throw new _0x1c83dd(_0x858f3(0x211));return yield _0x3e6394();}catch(_0x31bcca){return _0x1b9711?_0x1b9711(_0x31bcca):(_0x1c83dd[_0x858f3(0x18a)]===0x2||_0x1c83dd[_0x858f3(0x18a)]===0x3)&&_0x294cec(_0x1ba011,_0x31bcca),!_0x9df90d&&_0x545bce[_0x858f3(0x192)]()==='67'&&_0x31bcca[_0x858f3(0x1ba)]!==_0x858f3(0x146)&&_0x1cb69e['recordEvent']({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':_0x858f3(0x1ba),'value':_0x1ba011+_0x858f3(0x11a)+_0x31bcca[_0x858f3(0x1ba)]}]},!0x0),null;}finally{_0x4e4e64(_0x1ba011+_0x858f3(0xdb),!0x1),_0x32db77(_0x1ba011,!0x1);}}catch(_0x4e6923){return null;}}),_0x26ec5d=(_0x3c8146=>(_0x3c8146[_0x3c8146[_0x5aead6(0x188)]=0x0]=_0x5aead6(0x188),_0x3c8146[_0x3c8146[_0x5aead6(0x1b1)]=0x1]='INFO',_0x3c8146[_0x3c8146['ERROR']=0x2]=_0x5aead6(0xd2),_0x3c8146[_0x3c8146[_0x5aead6(0x13c)]=0x3]=_0x5aead6(0x13c),_0x3c8146[_0x3c8146[_0x5aead6(0x19e)]=0x4]=_0x5aead6(0x19e),_0x3c8146))(_0x26ec5d||{}),_0x524edc=(_0x528e49,_0x48452c)=>{const _0xd96b8=_0x5aead6;_0x1c83dd[_0xd96b8(0x18a)]!==0x0&&(_0x1c83dd['debugLevel']>=0x3?_0x528e49===0x1?console['info']('INFO:\x20'+new Date()[_0xd96b8(0x237)](),_0x48452c):_0x528e49===0x2&&console['error'](_0xd96b8(0x139)+new Date()[_0xd96b8(0x237)](),_0x48452c):_0x1c83dd['debugLevel']===0x1&&_0x528e49===0x1?console[_0xd96b8(0x116)](_0xd96b8(0x1ce)+new Date()['toISOString'](),_0x48452c):_0x1c83dd[_0xd96b8(0x18a)]===0x2&&_0x528e49===0x2&&console[_0xd96b8(0x114)]('ERROR:\x20'+new Date()['toISOString'](),_0x48452c));},_0x4e4e64=(_0x196319,_0xa5cf57)=>{const _0x15ef68=_0x5aead6;_0x1c83dd['debugLevel']!==0x0&&(_0xa5cf57?console[_0x15ef68(0x119)](_0x196319):console[_0x15ef68(0xe7)](_0x196319));},_0x32db77=(_0x4d1b39,_0x1e8e5e)=>{const _0xcabd7f=_0x5aead6;_0x1c83dd[_0xcabd7f(0x18a)]!==0x0&&(_0x1e8e5e?console[_0xcabd7f(0xf2)](_0x4d1b39):console[_0xcabd7f(0x184)]());},_0x4c896b,_0x83ac07=class _0x2f7c8c{constructor(){}static[_0x5aead6(0xf7)](){return _0x282439(_0x2f7c8c,_0x4c896b)||_0x412844(_0x2f7c8c,_0x4c896b,new _0x2f7c8c()),_0x282439(_0x2f7c8c,_0x4c896b);}[_0x5aead6(0x1f8)](_0x30bf1a,_0x54d8c3){setTimeout(()=>{_0x2e48db('init',()=>_0x2fbc56(this,null,function*(){const _0x483174=_0x1f99;_0x524edc(0x1,_0x483174(0x1c1)),yield _0x1ad162[_0x483174(0x1f8)](_0x30bf1a,_0x54d8c3),_0x1cb69e[_0x483174(0x193)]({'eventName':_0x483174(0x94)}),_0x524edc(0x1,_0x483174(0x144));let _0x43ca77=JSON[_0x483174(0x117)](localStorage['getItem'](_0x483174(0x22b))||'[]');Array[_0x483174(0x1a6)](_0x43ca77)&&_0x43ca77[_0x483174(0xe2)]((_0x11f245,_0x2e192e)=>_0x2fbc56(this,null,function*(){const _0x3e4d59=_0x483174;yield _0x22b036[_0x3e4d59(0x11d)](_0x11f245[_0x3e4d59(0x252)],_0x11f245[_0x3e4d59(0x102)]),_0x43ca77[_0x3e4d59(0x1af)](_0x2e192e,0x1),localStorage[_0x3e4d59(0x1fb)](_0x3e4d59(0x22b),JSON['stringify'](_0x43ca77));})),window[_0x483174(0x168)]('online',()=>_0x2fbc56(this,null,function*(){const _0x339643=_0x483174;_0x1c83dd['offline']=!0x1;let _0x43bb95=JSON[_0x339643(0x117)](localStorage[_0x339643(0x1b6)](_0x339643(0xda))||'[]');Array[_0x339643(0x1a6)](_0x43bb95)&&(yield _0x1cb69e[_0x339643(0x160)]({'customerId':localStorage[_0x339643(0x1b6)](_0x339643(0x1e4))||'','deviceId':localStorage[_0x339643(0x1b6)](_0x339643(0x219))||'','events':_0x43bb95}),localStorage[_0x339643(0x16a)](_0x339643(0xda))),_0x1ad162[_0x339643(0xca)](),_0x1ad162['updateSessionCreated']();})),window[_0x483174(0x168)]('offline',()=>{const _0x5f1ede=_0x483174;_0x1c83dd[_0x5f1ede(0x179)]=!0x0;}),window[_0x483174(0x168)](_0x483174(0x175),()=>{const _0x261c0b=_0x483174;_0xc9b044[_0x261c0b(0xd9)](),_0x382007[_0x261c0b(0x1e1)]();});}));});}[_0x5aead6(0xb2)](_0x1ef064,_0x1cdaec){const _0x371986=_0x5aead6;if(!(_0x1ef064 in _0x26ec5d)){console[_0x371986(0x114)](_0x371986(0x255));return;}_0x1c83dd['recordDebugEventsToggle']=_0x1cdaec||{},_0x1c83dd[_0x371986(0x18a)]=_0x1ef064;try{_0x382007[_0x371986(0x240)]({'debugLevel':_0x1ef064});}catch(_0x39b806){}}[_0x5aead6(0x11d)](_0x4b10d6,_0x368505){return _0x2fbc56(this,null,function*(){return new Promise((_0x3fd5eb,_0x32a9c5)=>{setTimeout(()=>_0x2fbc56(this,null,function*(){const _0x5a4bc7=_0x1f99;try{yield _0x2e48db(_0x5a4bc7(0x11d),()=>_0x2fbc56(this,null,function*(){const _0x327995=_0x5a4bc7;let _0xd0e7be;Array['isArray'](_0x368505)?_0xd0e7be=JSON[_0x327995(0x258)](_0x368505):typeof _0x368505==_0x327995(0x1e2)?_0xd0e7be=''+_0x368505:_0xd0e7be=_0x368505,_0x524edc(0x1,'Recording\x20attribute'),_0x524edc(0x1,_0x327995(0x1ab)+_0x4b10d6+',\x20Attribute\x20Value:\x20'+_0xd0e7be);let _0x2bf06d=JSON[_0x327995(0x117)](localStorage[_0x327995(0x1b6)](_0x327995(0x22b))||'[]');_0x2bf06d['push']({'attributeName':_0x4b10d6,'attrValueStringified':_0xd0e7be}),localStorage[_0x327995(0x1fb)](_0x327995(0x22b),JSON[_0x327995(0x258)](_0x2bf06d)),_0x1c83dd[_0x327995(0xe1)]&&(yield _0x22b036[_0x327995(0x11d)](_0x4b10d6,_0xd0e7be));})),_0x3fd5eb();}catch(_0x5a861e){_0x32a9c5(_0x5a861e);}}));});});}[_0x5aead6(0x189)](_0x492732){return _0x2fbc56(this,null,function*(){return new Promise((_0x4ef48f,_0x551d93)=>{setTimeout(()=>_0x2fbc56(this,null,function*(){const _0x22c27c=_0x1f99;try{yield _0x2e48db(_0x22c27c(0x189),()=>_0x2fbc56(this,null,function*(){const _0x5c06b5=_0x22c27c;_0x524edc(0x1,_0x5c06b5(0x169)),_0x524edc(0x1,'Identity:\x20'+_0x492732),_0x1c83dd['loading']=!0x0,yield _0x1ad162[_0x5c06b5(0x1ee)](_0x492732);})),_0x4ef48f();}catch(_0x593285){_0x551d93(_0x593285);}finally{_0x1c83dd[_0x22c27c(0xc9)]=!0x1,yield _0x1cb69e[_0x22c27c(0x1a4)]();}}));});});}['logout'](){setTimeout(()=>{const _0x40f5a9=_0x1f99;_0x2e48db(_0x40f5a9(0x174),()=>_0x2fbc56(this,null,function*(){const _0x1129d4=_0x40f5a9;_0x524edc(0x1,'Logging\x20out'),_0x1ad162[_0x1129d4(0xb8)]();}));});}[_0x5aead6(0x1ae)](_0x4ff3e0,_0x5df8e5){return _0x2fbc56(this,null,function*(){return new Promise((_0x23b317,_0x7e9868)=>{setTimeout(()=>_0x2fbc56(this,null,function*(){const _0x38daee=_0x1f99;try{yield _0x2e48db(_0x38daee(0xc6),()=>_0x2fbc56(this,null,function*(){const _0x5c9394=_0x38daee;_0x524edc(0x1,_0x5c9394(0x1a7)),_0x524edc(0x1,'Event\x20Payload:\x0a\x20'+{'eventName':_0x4ff3e0,'eventProperties':_0x5df8e5}),yield _0x1cb69e[_0x5c9394(0x1ae)]({'eventName':_0x4ff3e0,'eventProperties':_0x5df8e5});})),_0x23b317();}catch(_0x5ef496){_0x7e9868(_0x5ef496);}}));});});}[_0x5aead6(0x14a)](){return _0x356a70;}};_0x4c896b=new WeakMap(),_0x4f26ee(_0x83ac07,_0x4c896b);var _0x541408=_0x83ac07,_0x40fd48=_0x541408['getInstance']();typeof window!=_0x5aead6(0xfe)&&(window[_0x5aead6(0x1d2)]=_0x40fd48);var _0x43b91a=_0x40fd48;})());
package/dist/index.js CHANGED
@@ -1,76 +1 @@
1
- /* Copyright (c) 2024 MERGN */
2
- "use strict";var Pe=Object.defineProperty,un=Object.defineProperties,pn=Object.getOwnPropertyDescriptor,gn=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertyNames,pt=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable;var Et=l=>{throw TypeError(l)};var gt=(l,e,t)=>e in l?Pe(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,z=(l,e)=>{for(var t in e||(e={}))mt.call(e,t)&&gt(l,t,e[t]);if(pt)for(var t of pt(e))En.call(e,t)&&gt(l,t,e[t]);return l},Ne=(l,e)=>un(l,gn(e));var vn=(l,e)=>{for(var t in e)Pe(l,t,{get:e[t],enumerable:!0})},In=(l,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of mn(e))!mt.call(l,n)&&n!==t&&Pe(l,n,{get:()=>e[n],enumerable:!(r=pn(e,n))||r.enumerable});return l};var Sn=l=>In(Pe({},"__esModule",{value:!0}),l);var ke=(l,e,t)=>e.has(l)||Et("Cannot "+t);var d=(l,e,t)=>(ke(l,e,"read from private field"),t?t.call(l):e.get(l)),m=(l,e,t)=>e.has(l)?Et("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,t),I=(l,e,t,r)=>(ke(l,e,"write to private field"),r?r.call(l,t):e.set(l,t),t),i=(l,e,t)=>(ke(l,e,"access private method"),t);var a=(l,e,t)=>new Promise((r,n)=>{var o=v=>{try{h(t.next(v))}catch(b){n(b)}},c=v=>{try{h(t.throw(v))}catch(b){n(b)}},h=v=>v.done?r(v.value):Promise.resolve(v.value).then(o,c);h((t=t.apply(l,e)).next())});var wn={};vn(wn,{default:()=>yn});module.exports=Sn(wn);var vt="1.0.120";var ge="https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api",Fe="/attribute",It="/set-attribute",Be="/event",St="/record-event";var ft="/customer",ht="/device/add-device-token",bt="/set-identity",yt="/brand/get-web-push-public-key",wt="/brand/get-time";var Tt=(v=>(v.UTM_SOURCE="utm_source",v.UTM_MEDIUM="utm_medium",v.UTM_CAMPAIGN="utm_campaign",v.UTM_TERM="utm_term",v.UTM_CONTENT="utm_content",v.GAD_SOURCE="gad_source",v.GCLID="gclid",v.FBCLID="fbclid",v))(Tt||{});var Pt=new Set(Object.values(Tt));var te="Popup Action";var re,$,ne,w=class w{constructor(){m(this,$)}static getInstance(){return d(w,re)||I(w,re,new w),d(w,re)}updateAPIKey(e){w.apiKey=e;let t=e,r=/m(\d+)rgn/,n=t.match(r);n&&(w.brandId=n[1])}getAPIKey(){return w.apiKey}getBrandId(){return w.brandId}get(e){return a(this,null,function*(){try{return(yield fetch(ge+e,{headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"}})).json()}catch(t){let r=t.message;return this.getBrandId()==="67"&&r!=="Failed to fetch"&&r!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`get - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${t.message}`}]},!0),Promise.reject(t)}})}post(e,t,r){return a(this,null,function*(){try{return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"POST",signal:r})).json()}catch(n){let o=n.message;return this.getBrandId()==="67"&&o!=="Failed to fetch"&&o!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`post - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${JSON.stringify(t||{})} -${n.message}`}]},!0),Promise.reject(n)}})}put(e,t){return a(this,null,function*(){return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"PUT"})).json()})}syncRealWorldTime(){return a(this,null,function*(){try{let e=(yield(yield fetch(ge+wt)).json()).data;w.UTCDate=new Date(e),w.lastSyncTime=new Date}catch(e){s(2,"Failed to sync real-world time")}})}getCurrentUTCDate(){if(!w.UTCDate||!w.lastSyncTime)return s(2,"UTC Date or last sync time is not set"),new Date;let t=new Date().getTime()-w.lastSyncTime.getTime();return new Date(w.UTCDate.getTime()+t)}};re=new WeakMap,$=new WeakSet,ne=function(e){return btoa(`${e}:${new Date().getTime()}`)},m(w,re);var Me=w,N=Me.getInstance();var G,ie,x,Nt,Ve,_t,At,V=class V{constructor(){m(this,x);m(this,ie,!1)}static getInstance(){var e;return d(V,G)||(I(V,G,new V),i(e=d(V,G),x,Nt).call(e)),d(V,G)}recordAttribute(e,t,r){return a(this,null,function*(){yield A("# recordAttribute",()=>a(this,null,function*(){if(s(1,"Recording attribute"),C("Recording attribute",!0),L("Recording attribute Time",!0),s(1,`Attribute Payload:
3
- ${{attributeName:e,attributeProperties:r,attributeValue:t}})}`),!t||t===""){s(2,"Attribute value is required");return}yield E.checkTTL(),yield i(this,x,_t).call(this);let n=JSON.parse(localStorage.getItem("attributes")||"{}"),o=r?i(this,x,Ve).call(this,n,e,r):i(this,x,Ve).call(this,n,e);if(typeof o=="string"){s(2,o);return}n[e].should_set_identity&&(yield E.setIdentity(typeof t=="string"?t:JSON.stringify(t))),E.updateSessionCreated();let{id:c}=n[e],h={attributeId:c,attributeProperties:o,customerId:localStorage.getItem("customer")||"",value:t};yield i(this,x,At).call(this,h);let v=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");v.pop(),localStorage.setItem("preInitializedAttributes",JSON.stringify(v)),L("Recording attribute Time",!1),C("Recording attribute",!1)}))})}storeAttributeInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("attributes")&&!d(this,ie)){I(this,ie,!0);try{let e=(yield this.fetchAttributeData()).data;e&&localStorage.setItem("attributes",JSON.stringify(e))}catch(e){throw new Error("Error storing attribute data in local storage")}finally{I(this,ie,!1)}}})}fetchAttributeData(){return a(this,null,function*(){try{return yield N.get(`${Fe}`)}catch(e){throw new Error("Error fetching attribute data")}})}};G=new WeakMap,ie=new WeakMap,x=new WeakSet,Nt=function(){return a(this,null,function*(){})},Ve=function(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))return`Attribute ${t} is not valid.`;if(!r)return[];let n=e[t];if(!(n!=null&&n.attributeProperty))return`Attribute ${t} does not have a valid attributeProperty.`;let o=r.filter(({attributeProperty:c})=>!Object.prototype.hasOwnProperty.call(n.attributeProperty,c)).map(({attributeProperty:c})=>c);return o.length>0?`Attribute ${t} has invalid attributeProperties: ${o.join(", ")}.`:r.map(({attributeProperty:c,value:h})=>({attributePropertyId:n.attributeProperty[c].id,value:h}))},_t=function(){return a(this,null,function*(){localStorage.getItem("attributes")||(yield this.storeAttributeInLocalStorage())})},At=function(e){return a(this,null,function*(){try{return yield N.post(`${Fe}${It}`,e)}catch(t){throw new Error("Error posting attribute record")}})},m(V,G);var $e=V,me=$e.getInstance();var Ke="Content Card Action";var Y,T,Ot,He,Lt,Ct,se,_e,Dt,Ut,xt,Ae,K=class K{constructor(){m(this,T);m(this,se,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadContentCardEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="ContentCard",actionMethod:e=>i(this,T,He).call(this,e.campaignId),localStorageKey:"action"})};m(this,Ae,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(K,Y)||(I(K,Y,new K),i(e=d(K,Y),T,Ot).call(e)),d(K,Y)}showContentCard(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"ContentCard already in cache");return}i(this,T,xt).call(this,e),d(this,Ae).call(this),i(this,T,He).call(this,e.campaignId)}isContentCardAction(e){return e==="content_card"}};Y=new WeakMap,T=new WeakSet,Ot=function(){return a(this,null,function*(){})},He=function(e){let t=i(this,T,Lt).call(this);if(document.getElementById(`contentCard_container_${e}`)){s(1,"ContentCard already displayed"),d(this,se).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,T,Ct).call(this,t[e]);break}case"IMMEDIATELY":{i(this,T,_e).call(this,t[e]);break}case"SCROLL":{i(this,T,Ut).call(this,t[e]);break}default:return}},Lt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Ct=function(e){E.showDelayedAction({clearActionMethod:d(this,se).bind(this),data:e,displayMethod:i(this,T,_e).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},se=new WeakMap,_e=function(e){var t;if(document.getElementById(`contentCard_container_${e.campaignId}`))s(1,"ContentCard already displayed");else{let r=i(this,T,Dt).call(this,"div",e),n=document.querySelector(`#${e.message.divId}`);n&&(n.innerHTML=r.outerHTML,u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ke,eventProperties:[{eventProperty:"Content Card View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"}),(t=document.getElementById(`contentCard_container_${e.campaignId}`))==null||t.addEventListener("click",()=>{u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ke,eventProperties:[{eventProperty:"Content Card Click",value:JSON.stringify({campaignId:e.campaignId})}],name:"click"})}))}d(this,se).call(this,e.campaignId)},Dt=function(e,t){var c;let{campaignId:r,message:{design:n}}=t,o=document.createElement(e);return o.id=`contentCard_container_${r}`,o.innerHTML=n,(c=o.querySelector(".u-close-button"))==null||c.remove(),o},Ut=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,T,_e).bind(this),timeValueKey:"campaignEntryTimeValue"})},xt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},Ae=new WeakMap,m(K,Y);var Je=K,ae=Je.getInstance();var ce,B,le,q,Ee,ve,S,ze,Wt,Ge,Re,kt,Ce,Oe,Ye,Ft,Le,Ie,Bt,f=class f{constructor(){m(this,S);this.permission=null;this.pushMessageToSW=e=>{s(1,"Pushing message to service worker"),navigator.serviceWorker.getRegistrations().then(t=>{var r,n;s(1,"Service Worker registration"),(r=t[0])!=null&&r.active&&(s(1,"Service Worker ready"),(n=t[0].active)==null||n.postMessage(JSON.stringify(e)))}).catch(t=>{s(2,`Failed to push message to service worker: ${t.message}`)})};this.loadWebPushActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:()=>!0,actionMethod:e=>i(this,S,Oe).call(this,Number(e.web_optin_instance_id)),localStorageKey:"web_push_action"})};m(this,Ce,()=>{E.storeActionInLocalStorageInternal("web_push_action")});m(this,Ie,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"web_push_action"})})}static getInstance(){return d(f,ce)||I(f,ce,new f),d(f,ce)}init(e,t){return a(this,null,function*(){var r;if(s(1,"Initializing Notification Service"),u.recordDebugEvents({eventName:"init",eventProperties:[{eventProperty:"service_worker",value:"serviceWorker"in navigator},{eventProperty:"push_manager",value:"PushManager"in window}]}),"serviceWorker"in navigator&&"PushManager"in window){s(1,"Service Worker and Push Manager are supported");try{u.recordDebugEvents({eventName:"init_condition"}),I(f,B,yield navigator.serviceWorker.register(t||"/mergn-sw.js")),s(1,"Service Worker registered"),s(1,"Pushing message to service worker for initialization"),this.pushMessageToSW({customer:localStorage.getItem("customer")||"",events:u.getStoredEvents(),API_KEY:N.getAPIKey(),device_id:localStorage.getItem("uniqueIdentity")||"",operatingSystem:E.getOperatingSystem(),osVersion:E.getOSVersion(),Platform:E.getPlatform()}),I(f,Ee,!0);let n=i(this,S,Ye).call(this),o=Object.keys(n||{});if(o.length&&i(this,S,Oe).call(this,Number(o[0])),!e)return;let c=yield(r=d(f,B))==null?void 0:r.pushManager.getSubscription();s(1,"Checking for existing subscription"),d(f,B)&&(s(1,"Service Worker registration is available"),d(f,B).update()),c?(s(1,"Existing subscription found"),u.recordDebugEvents({eventName:"existing_subscription"}),yield i(this,S,Re).call(this),I(f,le,!0)):(s(1,"No existing subscription found"),yield i(this,S,ze).call(this,d(f,ve)||void 0))}catch(n){let o=n&&n.message?n.message.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"Reachability Push Web",eventProperties:[{eventProperty:"message",value:`${o}`}]}),s(2,"Service Worker registration failed:"),s(2,o)}}})}showNotification(e){if(!d(f,Ee)){I(f,ve,e),u.recordDebugEvents({eventName:"notification_service_not_initialized"}),s(2,"Notification service is not initialized");return}A("showNotification",()=>a(this,null,function*(){let t=JSON.parse(localStorage.getItem("web_push_action")||"{}");if(t&&t[e.web_optin_instance_id]){s(1,"Notification already in cache");return}i(this,S,kt).call(this,e),d(this,Ce).call(this),i(this,S,Oe).call(this,e.web_optin_instance_id)}))}};ce=new WeakMap,B=new WeakMap,le=new WeakMap,q=new WeakMap,Ee=new WeakMap,ve=new WeakMap,S=new WeakSet,ze=function(e){return a(this,null,function*(){s(1,`Checking notification permission: ${JSON.stringify(e)} `),u.recordDebugEvents({eventName:"check_permission"});let t;try{t=Notification.permission,t&&(s(1,`Notification permission: ${t}`),t==="default"?(e||(this.permission="default",u.recordDebugEvents({eventName:"Turned Off Notification Reset Permission"})),e&&(u.recordDebugEvents({eventName:"notification_data",eventProperties:[{eventProperty:"type",value:`${e==null?void 0:e.type}`}]}),d(this,Ie).call(this,e.web_optin_instance_id),e.type==="two_step"?i(this,S,Wt).call(this,e):yield i(this,S,Ge).call(this,e))):t==="denied"?(u.recordDebugEvents({eventName:"Turned Off Notification"}),s(1,"The user has blocked notifications.")):(u.recordDebugEvents({eventName:"already_registered"}),s(1,"The user has already enabled notifications."),d(f,le)||(yield i(this,S,Re).call(this),yield u.recordEvent({eventName:"Already Registered To Web Push"}),e||I(f,le,!0))))}catch(r){s(2,"Failed to check notification permission"),u.recordDebugEvents({eventName:"notification_permission_error"})}})},Wt=function(e){try{let t=document.createElement("div"),r;e.banner_design.banner_image&&(r=document.createElement("img"),r.src=e.banner_design.banner_image,r.alt="Image",r.id="centered-image");let n=document.createElement("div"),o=document.createElement("div"),c=document.createElement("div"),h=document.createElement("img"),v=document.createElement("div"),b=document.createElement("div"),y=document.createElement("div"),D=document.createElement("div"),k=document.createElement("div"),F=document.createElement("div"),O=document.createElement("button"),_=document.createElement("button");t.className="mergn-overlay",n.className="mergnWebPushPopup",o.className=D.className=k.className="mergn-row",c.className="mergn-column-25",v.className="mergn-column-75",F.className="button-container",b.id="title",y.id="subtitle",O.id="button-1",_.id="button-2",h.src=e.banner_design.banner_icon,h.alt="Image",h.id="logo",b.textContent=e.banner_design.banner_title,y.textContent=e.banner_design.banner_text,O.textContent=e.banner_design.button_1.text,_.textContent=e.banner_design.button_2.text,c.appendChild(h),v.appendChild(b),v.appendChild(y),o.appendChild(c),o.appendChild(v),r&&(D.appendChild(r),r.style.cssText=`
4
- max-width: 100%;
5
- height: auto;
6
- display: block;
7
- margin-left: auto;
8
- margin-right: auto;
9
- border-radius: 10px;
10
- max-width: 350px;
11
- aspect-ratio: 2 / 1;
12
- `),F.appendChild(O),F.appendChild(_),k.appendChild(F),n.appendChild(o),n.appendChild(D),n.appendChild(k),t.appendChild(n),t.style.cssText=`
13
- position: fixed;
14
- top: 0;
15
- left: 0;
16
- width: 100%;
17
- height: 100%;
18
- background-color: rgba(0, 0, 0, 0.5);
19
- z-index: 99999999999;
20
- display: flex;
21
- justify-content: center;
22
- align-items: start;
23
- `,n.style.cssText=`
24
- background-color: ${e.banner_design.banner_color};
25
- padding: 15px;
26
- border-radius: 5px;
27
- max-width: 380px;
28
- max-height: 463px;
29
- `,o.style.cssText=D.style.cssText=k.style.cssText=`
30
- display: flex;
31
- flex-wrap: wrap;
32
- margin-bottom: 10px;
33
- `,c.style.cssText=`
34
- width: 25%;
35
- `,v.style.cssText=`
36
- width: 73%;
37
- margin-left: 2%;
38
- `,h.style.cssText=`
39
- max-width: 100%;
40
- height: auto;
41
- `,O.style.cssText=`
42
- padding: 12px 20px;
43
- border: none;
44
- background-color: ${e.banner_design.button_1.backgroundColor};
45
- color: ${e.banner_design.button_1.color};
46
- cursor: pointer;
47
- border-radius: 5px;
48
- width: 48%;
49
- `,_.style.cssText=`
50
- padding: 12px 20px;
51
- border: none;
52
- background-color: ${e.banner_design.button_2.backgroundColor};
53
- color: ${e.banner_design.button_2.color};
54
- cursor: pointer;
55
- border-radius: 5px;
56
- width: 48%;
57
- `,F.style.cssText=`
58
- display: flex;
59
- justify-content: space-between;
60
- align-items: center;
61
- flex-wrap: nowrap;
62
- width: 100%;
63
- `,b.style.cssText=`
64
- margin-bottom: 5px;
65
- font-size: 16px;
66
- color: ${e.banner_design.text_color}
67
- `,y.style.cssText=`
68
- margin-bottom: 5px;
69
- font-size: 13px;
70
- color: ${e.banner_design.text_color}
71
- `,document.body.appendChild(t),document.body.style.overflow="hidden",u.recordEvent({eventName:"Viewed Web Push Soft-ask",name:"viewed",web_optin_instance_id:e.web_optin_instance_id}),O==null||O.addEventListener("click",()=>a(this,null,function*(){t.remove(),I(f,q,!1),document.body.style.overflow="auto",yield u.recordEvent({eventName:"Denied Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),s(1,"User denied the notification permission.")})),_==null||_.addEventListener("click",()=>a(this,null,function*(){t.remove(),document.body.style.overflow="auto",u.recordEvent({eventName:"Accepted Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),yield i(this,S,Ge).call(this,e)}))}catch(t){}},Ge=function(e){return a(this,null,function*(){try{u.recordEvent({eventName:"Displayed Web Push Subscription",name:"viewed",web_optin_instance_id:e.web_optin_instance_id});let t=yield Notification.requestPermission();t==="granted"?(s(1,"User granted the notification permission."),yield i(this,S,Re).call(this),yield u.recordEvent({eventName:"Allowed Web Push Subscription",name:"subscribed",web_optin_instance_id:e.web_optin_instance_id})):t==="denied"?(yield u.recordEvent({eventName:"Blocked Web Push Subscription"}),s(1,"User denied the notification permission.")):t==="default"&&(yield u.recordEvent({eventName:"Closed Web Push Subscription"}),s(1,"User closed the notification permission dialog."))}catch(t){s(2,"Failed to request notification permission")}I(f,q,!1)})},Re=function(){return a(this,null,function*(){var t,r;let e=yield N.get(`${yt}`);if(e.success){let n=yield(t=d(f,B))==null?void 0:t.pushManager.getSubscription();n&&(yield n.unsubscribe());let o=yield(r=d(f,B))==null?void 0:r.pushManager.subscribe({applicationServerKey:e.data||"",userVisibleOnly:!0});yield N.put(`${ht}`,{device_id:localStorage.getItem("uniqueIdentity")||"",is_web_push_subscribed:!0,web_push_subscription_page_url:window.location.pathname,web_push_token:{token:JSON.parse(JSON.stringify(o))}}),s(1,"User is subscribed")}else throw new Error("Failed to subscribe the user")})},kt=function(e){E.storeActionInLocalStorage(e,"web_push_action","web_optin_instance_id")},Ce=new WeakMap,Oe=function(e){if(d(f,q))return;I(f,q,!0);let t=i(this,S,Ye).call(this);if(t!=null&&t[e])switch(t[e].entry_time){case"DELAY":{i(this,S,Ft).call(this,t[e]);break}case"IMMEDIATELY":{i(this,S,Le).call(this,t[e]);break}case"SCROLL":{i(this,S,Bt).call(this,t[e]);break}default:return}},Ye=function(){let e=localStorage.getItem("web_push_action");return e?JSON.parse(e):null},Ft=function(e){E.showDelayedAction({clearActionMethod:d(this,Ie).bind(this),data:e,displayMethod:i(this,S,Le).bind(this),idKey:"web_optin_instance_id",timeValueKey:"entry_time_value"})},Le=function(e){i(this,S,ze).call(this,e)},Ie=new WeakMap,Bt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,S,Le).bind(this),timeValueKey:"entry_time_value"})},m(f,ce),m(f,B,null),m(f,le,!1),m(f,q,!1),m(f,Ee,!1),m(f,ve,null);var je=f,W=je.getInstance();var Q,P,Mt,Qe,$t,Vt,de,De,Kt,Jt,Ht,Ue,J=class J{constructor(){m(this,P);m(this,de,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadPopupEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="Popup",actionMethod:e=>i(this,P,Qe).call(this,e.campaignId),localStorageKey:"action"})};m(this,Ue,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(J,Q)||(I(J,Q,new J),i(e=d(J,Q),P,Mt).call(e)),d(J,Q)}showPopup(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"Popup already in cache");return}i(this,P,Ht).call(this,e),d(this,Ue).call(this),i(this,P,Qe).call(this,e.campaignId)}isPopupAction(e){return e==="Popup"}};Q=new WeakMap,P=new WeakSet,Mt=function(){return a(this,null,function*(){})},Qe=function(e){let t=i(this,P,$t).call(this);if(document.getElementById(`popup_container_${e}`)){s(1,"Popup already displayed"),d(this,de).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,P,Vt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,P,De).call(this,t[e]);break}case"SCROLL":{i(this,P,Jt).call(this,t[e]);break}default:return}},$t=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Vt=function(e){E.showDelayedAction({clearActionMethod:d(this,de).bind(this),data:e,displayMethod:i(this,P,De).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},de=new WeakMap,De=function(e){if(document.getElementById(`popup_container_${e.campaignId}`))s(1,"Popup already displayed");else{let t=i(this,P,Kt).call(this,"div",e);document.body.appendChild(t),u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:te,eventProperties:[{eventProperty:"Popup View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"})}d(this,de).call(this,e.campaignId)},Kt=function(e,t){let{campaignCustomerInstanceId:r,campaignId:n,message:{design:o}}=t,c=document.createElement(e);c.id=`popup_container_${n}`,c.innerHTML=o,c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%",c.style.zIndex="99999999";let h=c.querySelector(".u-popup-container");h&&(h.style.zIndex="50");let v=h.querySelector(".u-popup-overlay");v&&(s(1,"Popup overlay element found"),v.style.setProperty("display","block","important")),c.querySelectorAll('[id^="u_content_form_"]').forEach(y=>{let D=y.querySelector("form");D&&D.addEventListener("submit",()=>a(this,null,function*(){c.remove();let k=new FormData(D),F={};for(let[O,_]of k.entries())F[O]=_;yield u.recordEvent({campaignCustomerInstanceId:r,campaignId:n,eventName:te,eventProperties:[{eventProperty:"Form Submit",value:JSON.stringify({campaignId:n,formId:y.id,formValues:F})},{eventProperty:"Campaign Id",value:n.toString()}],name:"form"})}))});let b=c.querySelector(".u-close-button");return(b==null?void 0:b.getAttribute("href"))==="#"&&b.removeAttribute("href"),b==null||b.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:r,campaignId:n,eventName:te,eventProperties:[{eventProperty:"Close Click",value:JSON.stringify({campaignId:n})}],name:"close"})})),c.querySelectorAll('[id^="u_content_button_"]').forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:r,campaignId:n,eventName:te,eventProperties:[{eventProperty:"Button Click",value:JSON.stringify({buttonId:y.id,campaignId:n})}],name:"click"})}))}),c.querySelectorAll(".u-popup-container img").forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:r,campaignId:n,eventName:te,eventProperties:[{eventProperty:"Image Click",value:JSON.stringify({campaignId:n,imageClassName:y.className,imageId:y.id})}],name:"click"})}))}),c},Jt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,P,De).bind(this),timeValueKey:"campaignEntryTimeValue"})},Ht=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},Ue=new WeakMap,m(J,Q);var qe=J,H=qe.getInstance();var ue,fe,he,be,ye,we,Te,xe,p,zt,Gt,Yt,Se,Xe,et,tt,nt,qt,Qt,Zt,Xt,en,tn,nn,rt,it,rn,on,Z=class Z{constructor(){m(this,p);m(this,fe);m(this,he);m(this,be);m(this,ye,null);m(this,we,null);m(this,Te,!1);m(this,xe,()=>{setInterval(()=>{let e=localStorage.getItem("mergn_shopify");if(e!==d(this,we)){I(this,we,e);let t=JSON.parse(e||"{}");if(t!=null&&t.pushMessageToSW){let r=t.pushMessageToSW;delete t.pushMessageToSW,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.pushMessageToSW(r)}if(t!=null&&t.optIn){let r=t.optIn;delete t.optIn,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.showNotification(r)}if(t!=null&&t.campaigns){let r=t.campaigns;delete t.campaigns,localStorage.setItem("mergn_shopify",JSON.stringify(t)),r.forEach(n=>{H.isPopupAction(n.message.name)?H.showPopup(n):ae.isContentCardAction(n.message.name)&&ae.showContentCard(n)})}}},1e3)});this.storeActionInLocalStorageInternal=e=>{let t=()=>{let r=JSON.parse(localStorage.getItem(e)||"{}");Object.keys(r).forEach(n=>{r[n].initialTime=new Date().getTime()}),localStorage.setItem(e,JSON.stringify(r))};t(),window.addEventListener("beforeunload",t)};this.clearActionInLocalStorage=({id:e,localStorageKey:t})=>{let r=JSON.parse(localStorage.getItem(t)||"{}");r[e]&&delete r[e],localStorage.setItem(t,JSON.stringify(r))};this.loadActionInLocalStorage=({actionCondition:e,actionMethod:t,localStorageKey:r})=>{let n=JSON.parse(localStorage.getItem(r)||"{}");Object.keys(n).forEach(o=>{e(n[o])&&t(n[o])})}}static getInstance(){return d(Z,ue)||I(Z,ue,new Z),d(Z,ue)}init(e,t){return a(this,null,function*(){s(1,"Initializing base service"),t!=null&&t.shopify&&I(this,Te,!0),i(this,p,zt).call(this,e);let r=this.getPlatform();if(r==="Crawlers"||r==="Unknown"){s(2,"Not initializing base service for crawlers or unknown platforms");return}if(yield N.syncRealWorldTime(),s(1,"Verifying API Key"),yield i(this,p,rt).call(this),t!=null&&t.shopify&&d(this,xe).call(this),t!=null&&t.identity)try{g.loading=!0,yield this.setIdentity(t.identity)}finally{g.loading=!1}setInterval(()=>a(this,null,function*(){s(1,"Verifying API Key after timeout"),yield i(this,p,rt).call(this)}),3e5);let n=i(this,p,Se).call(this);if(yield this.checkTTL(),yield u.recordEventsFromQueue(),u.recordDebugEvents({eventName:"base_init"}),s(1,"Initializing notification service from Base Service"),yield A("notification service",()=>a(this,null,function*(){yield W.init(n,t==null?void 0:t.swPath)})),!(t!=null&&t.shopify)){yield i(this,p,on).call(this);let o=history.pushState;history.pushState=(...c)=>{o.apply(history,c),i(this,p,rn).call(this)}}s(1,"tracking page change register")})}setPlatform(e){I(this,fe,e)}setOSVersion(e){I(this,he,e)}setOperatingSystem(e){I(this,be,e)}setPreviousUrl(e){I(this,ye,e)}getPreviousUrl(){return d(this,ye)}getPlatform(){return d(this,fe)}getOSVersion(){return d(this,he)}getOperatingSystem(){return d(this,be)}updateSessionCreated(){localStorage.setItem("ttl",`${new Date().getTime()}`)}showAfterScrollAction({data:e,displayMethod:t,timeValueKey:r}){let n=()=>{var b;let o=window.innerHeight,c=document.documentElement.scrollHeight;window.scrollY/(c-o)*100>(((b=e[r])==null?void 0:b.value)||0)&&(window.removeEventListener("scroll",n),t(e))};window.addEventListener("scroll",n)}showDelayedAction({clearActionMethod:e,data:t,displayMethod:r,idKey:n,timeValueKey:o}){var v,b,y;let c=(v=t[o])==null?void 0:v.value;((b=t[o])==null?void 0:b.duration)==="min"&&(c=c*60);let h=t.initialTime-500+(c||0)*1e3-new Date().getTime();s(1,`Initial time: ${t.initialTime}`),s(1,`Time value: ${(y=t[o])==null?void 0:y.value}`),s(1,`Current time: ${new Date().getTime()}`),s(1,`Time difference: ${h}`),h>0?setTimeout(()=>{e(t[n]),r(t)},h):(e(t[n]),r(t))}storeActionInLocalStorage(e,t,r){var c;let n=JSON.parse(localStorage.getItem(t)||"{}"),o=(c=r in e&&e[r])!=null?c:"";o&&(n[o]=Ne(z({},e),{initialTime:new Date().getTime()}),localStorage.setItem(t,JSON.stringify(n)))}checkTTL(){return a(this,null,function*(){yield A("# check TTL",()=>a(this,null,function*(){if(d(this,Te))return;s(1,"Checking TTL"),C("Checking TTL",!0),L("Checking TTL Time",!0);let e=localStorage.getItem("ttl"),t=!1;if(e){if(t=i(this,p,Se).call(this,e),t){let r=localStorage.getItem("session"),n=localStorage.getItem("ttl");r&&n&&u.recordEvent({eventName:"Web Session Concluded",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(n,10)).toISOString()}]}),this.clearLocalStorage(),localStorage.setItem("ttl",`${new Date().getTime()}`)}}else localStorage.setItem("ttl",`${new Date().getTime()}`);(!e||t||i(this,p,Qt).call(this))&&(i(this,p,nt).call(this)&&i(this,p,Zt).call(this),i(this,p,tt).call(this)&&(yield this.setIdentity()),(i(this,p,Se).call(this)||i(this,p,Xe).call(this))&&(yield i(this,p,tn).call(this)),yield i(this,p,Xt).call(this),(i(this,p,Se).call(this)||i(this,p,et).call(this))&&(yield i(this,p,nn).call(this))),L("Checking TTL Time",!1),C("Checking TTL",!1)}))})}clearLocalStorage(){localStorage.removeItem("action"),localStorage.removeItem("events"),localStorage.removeItem("attributes"),localStorage.removeItem("offlineEvents"),localStorage.removeItem("ttl"),localStorage.removeItem("session")}setIdentity(e){return a(this,null,function*(){let t={deviceId:localStorage.getItem("uniqueIdentity")||crypto.randomUUID(),os:this.getPlatform()};if(e)t.identity=e;else if(!e&&localStorage.getItem("customer"))return;try{let r=yield i(this,p,en).call(this,t);if(r!==void 0){localStorage.setItem("customer",r);try{W.pushMessageToSW({customer:r})}catch(n){}}}catch(r){throw new Error("Error setting identity")}})}};ue=new WeakMap,fe=new WeakMap,he=new WeakMap,be=new WeakMap,ye=new WeakMap,we=new WeakMap,Te=new WeakMap,xe=new WeakMap,p=new WeakSet,zt=function(e){N.updateAPIKey(e),this.setPlatform(i(this,p,Gt).call(this)),this.setOSVersion(i(this,p,Yt).call(this)),this.setOperatingSystem(navigator.userAgent)},Gt=function(){var t;let e=navigator.userAgent.toLowerCase();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i.test(e)?"Crawlers":/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i.test(e)?"Mobile":/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(e)?("Notification"in window&&typeof((t=window==null?void 0:window.Notification)==null?void 0:t.permission)!="undefined","Mobile"):/windows|macintosh|linux|x11/i.test(e)?"Web":"Unknown"},Yt=function(){let e=navigator.userAgent,t;return e.indexOf("Chrome")>-1?t="Google Chrome":e.indexOf("Safari")>-1?t="Safari":e.indexOf("Firefox")>-1?t="Mozilla Firefox":e.indexOf("Edg")>-1?t="Microsoft Edge":e.indexOf("MSIE")>-1?t="Internet Explorer":t="Unknown",t},Se=function(e){let t;return e||(t=localStorage.getItem("ttl")),e||t?new Date().getTime()-parseInt(e||t||"",10)>12e5:!0},Xe=function(){return!localStorage.getItem("events")},et=function(){return!localStorage.getItem("attributes")},tt=function(){return!localStorage.getItem("customer")},nt=function(){return!localStorage.getItem("uniqueIdentity")},qt=function(){return!localStorage.getItem("session")},Qt=function(){return i(this,p,Xe).call(this)||i(this,p,et).call(this)||i(this,p,tt).call(this)||i(this,p,nt).call(this)||i(this,p,qt).call(this)},Zt=function(){let e=localStorage.getItem("uniqueIdentity");return e||(e=crypto.randomUUID(),localStorage.setItem("uniqueIdentity",e)),e},Xt=function(){return a(this,null,function*(){yield A("store session",()=>a(this,null,function*(){let e=localStorage.getItem("session");e||(e=crypto.randomUUID(),localStorage.setItem("session",e),yield u.recordEvent({eventName:"Web Session Started",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(localStorage.getItem("ttl")||"",10)).toISOString()}]}))}),e=>{u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`store session - ${e.message}`}]},!0)})})},en=function(e){return a(this,null,function*(){try{return(yield N.post(`${ft}${bt}`,e)).data}catch(t){throw new Error("Error posting identity data")}})},tn=function(){return a(this,null,function*(){yield u.storeEventsAndPropertiesInLocalStorage()})},nn=function(){return a(this,null,function*(){yield me.storeAttributeInLocalStorage()})},rt=function(){return a(this,null,function*(){yield A("verify API key",()=>a(this,null,function*(){var e;try{let t=parseInt(localStorage.getItem("verifyTTL")||"0",10)||0;if(!t||t&&new Date().getTime()>t){let r=yield N.get("/brand");if(!(r!=null&&r.success))throw new Error(JSON.stringify(r));localStorage.setItem("verifyTTL",(new Date().getTime()+3e5).toString())}g.isInitialized=!0}catch(t){throw N.getBrandId()==="67"&&!((e=t==null?void 0:t.message)!=null&&e.startsWith("get"))&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`verifyAPIKey - ${t.message}`}]},!0),g.disableSDK=!0,new Error("Error verifying API key")}}))})},it=function(){return a(this,null,function*(){var r;s(1,"Performing viewed web page event");let e=(r=window==null?void 0:window.location)==null?void 0:r.href;this.setPreviousUrl(e),u.recordDebugEvents({eventName:"pre_vwp"});let t=[];new URLSearchParams(new URL(window.location.href).search).forEach((n,o)=>a(this,null,function*(){Pt.has(o)&&t.push({eventProperty:o,value:n})})),yield u.recordEvent({eventName:"Viewed Webpage",eventProperties:[{eventProperty:"URL",value:window.location.pathname},...t]})})},rn=function(){return a(this,null,function*(){var t;s(1,"Tracking page change");let e=(t=window==null?void 0:window.location)==null?void 0:t.href;(this.getPreviousUrl()===null||this.getPreviousUrl()===void 0||e!==this.getPreviousUrl())&&(yield i(this,p,it).call(this))})},on=function(){return a(this,null,function*(){var t,r;let e=(t=window==null?void 0:window.location)==null?void 0:t.href;u.recordDebugEvents({eventName:"show_notification_error",eventProperties:[{eventProperty:"message",value:`${e!==this.getPreviousUrl()}:${e}:${this.getPreviousUrl()}`}]});try{yield i(this,p,it).call(this)}catch(n){let o=n&&n.message?(r=n==null?void 0:n.message)==null?void 0:r.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"vwp_error",eventProperties:[{eventProperty:"message",value:`${o}`}]})}})},m(Z,ue);var Ze=Z,E=Ze.getInstance();var X,R,sn,We,an,cn,ln,dn,j=class j{constructor(){m(this,R);this.queue=Promise.resolve()}static getInstance(){var e;return d(j,X)||(I(j,X,new j),i(e=d(j,X),R,sn).call(e)),d(j,X)}pushToQueue(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");t.push(e),localStorage.setItem("preInitializedEvents",JSON.stringify(t))}recordEventsFromQueue(){return a(this,null,function*(){let e=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");if(Array.isArray(e))for(let t of e)yield this.recordEventPreInitialized(t)})}recordEvent(e,t){return a(this,null,function*(){g.isInitialized&&!g.loading?yield i(this,R,We).call(this,e,t):this.pushToQueue(e)})}recordEventPreInitialized(e){return a(this,null,function*(){try{yield i(this,R,We).call(this,e)}finally{i(this,R,dn).call(this,e.eventName)}})}recordDebugEvents(e){return a(this,null,function*(){g.debugLevel===4&&(!g.recordDebugEventsToggle||g.recordDebugEventsToggle[e.eventName])&&(yield i(this,R,We).call(this,e))})}getStoredEvents(){let e=localStorage.getItem("events");return e?JSON.parse(e):{}}storeEventsAndPropertiesInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("events")){let e=(yield this.fetchEventData()).data;if(e){localStorage.setItem("events",JSON.stringify(e));try{W.pushMessageToSW({events:e})}catch(t){}}}})}fetchEventData(){return a(this,null,function*(){try{return yield N.get(`${Be}`)}catch(e){throw new Error("Error fetching event data")}})}postEventRecord(e,t){return a(this,null,function*(){let r=null,n=null,o=new AbortController;return this.queue=this.queue.then(()=>a(this,null,function*(){try{if(e.events.length===0)throw new Error("No events to record");let c=yield N.post(`/v2${Be}${St}`,e,o.signal);if(c.success)return n=c,c;if(c.message===`Customer with id ${localStorage.getItem("customer")} not exists`)throw localStorage.removeItem("customer"),new Error("Re initializing customer Id")}catch(c){throw s(2,"Error posting event record:"),s(2,`name: ${c.name}`),s(2,`message: ${c.message}`),(c.name==="AbortError"||c.name==="TypeError"&&c.message==="Failed to fetch")&&(s(2,"Request aborted"),t&&i(this,R,ln).call(this,t)),r=new Error("Error posting event record"),c}return null})).catch(()=>{}),this.queue.then(()=>{if(r)throw r;return n})})}};X=new WeakMap,R=new WeakSet,sn=function(){return a(this,null,function*(){})},We=function(e,t){return a(this,null,function*(){yield A("# record event",()=>a(this,null,function*(){var ct,lt,dt,ut;let{campaignCustomerInstanceId:r,campaignId:n,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v}=e;s(1,"# Recording event"),C("Recording event",!0),L("Recording event Time",!0),s(1,"Event Payload"),s(1,{campaignCustomerInstanceId:r,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v});let b=E.getPlatform();if(b==="Crawlers"||b==="Unknown")throw new Error("Invalid platform");o!=="Web Session Concluded"&&(yield E.checkTTL());let y=[];c&&y.push(...c),y.push({eventProperty:"Platform",value:b}),y.push({eventProperty:"operating-system",value:E.getOperatingSystem()}),y.push({eventProperty:"os-version",value:E.getOSVersion()});let D=this.getStoredEvents(),k=i(this,R,an).call(this,D,o,y);if(typeof k=="string"){s(2,k);return}E.updateSessionCreated();let{id:F}=D[o],O=i(this,R,cn).call(this,z(Ne(z(z(z({},r?{campaignCustomerInstanceId:r}:{}),n?{campaignId:n}:{}),v?{web_optin_instance_id:v}:{}),{eventId:F,eventProperties:k,sessionId:localStorage.getItem("session")||""}),h?{name:h}:{}));if(g.offline){let M=JSON.parse(localStorage.getItem("offlineEvents")||"[]");M.length<=50&&(M.push(...O.events),localStorage.setItem("offlineEvents",JSON.stringify(M)));return}let _=yield this.postEventRecord(O,e);(ct=_==null?void 0:_.data)!=null&&ct.optIn?(yield this.recordDebugEvents({eventName:"optin_data"}),W.showNotification(_.data.optIn)):o==="Viewed Webpage"&&(yield this.recordDebugEvents({eventName:"no_optin",eventProperties:[{eventProperty:"message",value:`${"Notification"in window&&typeof((lt=window==null?void 0:window.Notification)==null?void 0:lt.permission)!="undefined"}`}]})),(ut=(dt=_==null?void 0:_.data)==null?void 0:dt.campaigns)==null||ut.forEach(M=>{H.isPopupAction(M.message.name)?H.showPopup(M):ae.isContentCardAction(M.message.name)&&ae.showContentCard(M)}),L("Recording event Time",!1),C("Recording event",!1)}),r=>{this.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`record event - ${e} - ${r.message}`}]},!0)},t)})},an=function(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))return`Event ${t} is not valid.`;if(!r)return[];let n=e[t];if(!(n!=null&&n.eventProperty))return`Event ${t} does not have a valid eventProperty.`;let o=r.filter(({eventProperty:c})=>!Object.prototype.hasOwnProperty.call(n.eventProperty,c)).map(({eventProperty:c})=>c);return o.length>0?`Event ${t} has invalid eventProperties: ${o.join(", ")}.`:r.map(({eventProperty:c,value:h})=>({eventPropertyId:n.eventProperty[c].id,value:h}))},cn=function(e){return{customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:[e]}},ln=function(e){s(1,"Adding to pre-initialized event:"),s(1,e);let t=localStorage.getItem("preInitializedEvents");t&&t!=="undefined"?(t=JSON.parse(t),t.push(e)):t=[e],localStorage.setItem("preInitializedEvents",JSON.stringify(t))},dn=function(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]"),r=t.findIndex(n=>n.eventName===e);r>=0&&t.splice(r,1),localStorage.setItem("preInitializedEvents",JSON.stringify(t))},m(j,X);var ot=j,u=ot.getInstance();var g=class extends Error{constructor(e){super(e),this.name="MergnError"}};g.disableSDK=!1,g.offline=!navigator.onLine,g.debugLevel=0,g.isInitialized=!1,g.loading=!1;var bn=(l,e)=>{e instanceof g?s(2,`OriginateFrom: ${l}
72
- MergnError: ${e.message}`):e instanceof Error?s(2,`OriginateFrom: ${l}
73
- Unexpected error: ${e.message}`):s(2,`OriginateFrom: ${l}
74
- Unexpected error: ${String(e)}`)},A=(l,e,t,r=!1)=>a(void 0,null,function*(){try{C(l,!0),L(`${l} Time`,!0);try{if(g.disableSDK)throw new g("Mergn SDK is disabled!");if(l!=="record event"&&g.offline)throw new g("Mergn is offline!");if(l!=="init"&&l!=="verify API key"&&l!=="record event"&&l!=="recordAttribute"&&!g.isInitialized)throw new g("Mergn not initialized!");if(l!=="login"&&g.loading)throw new g("Mergn is loading!");return yield e()}catch(n){return t?t(n):(g.debugLevel===2||g.debugLevel===3)&&bn(l,n),!r&&N.getBrandId()==="67"&&n.message!=="Failed to fetch"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`${l} - ${n.message}`}]},!0),null}finally{L(`${l} Time`,!1),C(l,!1)}}catch(n){return null}});var U=(o=>(o[o.NONE=0]="NONE",o[o.INFO=1]="INFO",o[o.ERROR=2]="ERROR",o[o.ALL=3]="ALL",o[o.DEBUG=4]="DEBUG",o))(U||{}),s=(l,e)=>{g.debugLevel!==0&&(g.debugLevel>=3?l===1?console.info(`INFO: ${new Date().toISOString()}`,e):l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e):g.debugLevel===1&&l===1?console.info(`INFO: ${new Date().toISOString()}`,e):g.debugLevel===2&&l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e))},L=(l,e)=>{g.debugLevel!==0&&(e?console.time(l):console.timeEnd(l))},C=(l,e)=>{g.debugLevel!==0&&(e?console.group(l):console.groupEnd())};var pe,ee=class ee{constructor(){}static getInstance(){return d(ee,pe)||I(ee,pe,new ee),d(ee,pe)}init(e,t){setTimeout(()=>{A("init",()=>a(this,null,function*(){s(1,"Initializing Mergn SDK"),yield E.init(e,t),u.recordDebugEvents({eventName:"mergn_init"}),s(1,"Mergn SDK Initialized");let r=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");Array.isArray(r)&&r.forEach((n,o)=>a(this,null,function*(){yield me.recordAttribute(n.attributeName,n.attributeValue),r.splice(o,1),localStorage.setItem("preInitializedAttributes",JSON.stringify(r))})),window.addEventListener("online",()=>a(this,null,function*(){g.offline=!1;let n=JSON.parse(localStorage.getItem("offlineEvents")||"[]");Array.isArray(n)&&(yield u.postEventRecord({customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:n}),localStorage.removeItem("offlineEvents")),E.checkTTL(),E.updateSessionCreated()})),window.addEventListener("offline",()=>{g.offline=!0}),window.addEventListener("load",()=>{H.loadPopupEventActionInLocalStorage(),W.loadWebPushActionInLocalStorage()})}))})}setDebugLevel(e,t){if(!(e in U)){console.error(`Debug level must be according to:
75
- NONE: 0, INFO: 1, ERROR: 2, ALL: 3`);return}g.recordDebugEventsToggle=t||{},g.debugLevel=e;try{W.pushMessageToSW({debugLevel:e})}catch(r){}}recordAttribute(e,t){return a(this,null,function*(){return new Promise((r,n)=>{setTimeout(()=>a(this,null,function*(){try{yield A("recordAttribute",()=>a(this,null,function*(){let o;Array.isArray(t)?o=JSON.stringify(t):typeof t=="number"?o=`${t}`:o=t,s(1,"Recording attribute"),s(1,`Attribute Name: ${e}, Attribute Value: ${o}`);let c=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");c.push({attributeName:e,attrValueStringified:o}),localStorage.setItem("preInitializedAttributes",JSON.stringify(c)),g.isInitialized&&(yield me.recordAttribute(e,o))})),r()}catch(o){n(o)}}))})})}login(e){return a(this,null,function*(){return new Promise((t,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("login",()=>a(this,null,function*(){s(1,"Logging in"),s(1,`Identity: ${e}`),g.loading=!0,yield E.setIdentity(e)})),t()}catch(n){r(n)}finally{g.loading=!1,yield u.recordEventsFromQueue()}}))})})}logout(){setTimeout(()=>{A("logout",()=>a(this,null,function*(){s(1,"Logging out"),E.clearLocalStorage()}))})}recordEvent(e,t){return a(this,null,function*(){return new Promise((r,n)=>{setTimeout(()=>a(this,null,function*(){try{yield A("record event",()=>a(this,null,function*(){s(1,"Recording event"),s(1,`Event Payload:
76
- ${{eventName:e,eventProperties:t}}`),yield u.recordEvent({eventName:e,eventProperties:t})})),r()}catch(o){n(o)}}))})})}getVersion(){return vt}};pe=new WeakMap,m(ee,pe);var st=ee,at=st.getInstance();typeof window!="undefined"&&(window.mergn=at);var yn=at;
1
+ 'use strict';const _0xbd6474=_0x1f9a;(function(_0x4b1b02,_0x358b46){const _0x43efcf=_0x1f9a,_0x266119=_0x4b1b02();while(!![]){try{const _0x3c1839=parseInt(_0x43efcf(0x1f1))/0x1*(parseInt(_0x43efcf(0x23b))/0x2)+-parseInt(_0x43efcf(0x27e))/0x3+-parseInt(_0x43efcf(0x222))/0x4*(parseInt(_0x43efcf(0x292))/0x5)+parseInt(_0x43efcf(0x2be))/0x6+parseInt(_0x43efcf(0x2f4))/0x7*(-parseInt(_0x43efcf(0x19c))/0x8)+parseInt(_0x43efcf(0x2b1))/0x9*(-parseInt(_0x43efcf(0x1bf))/0xa)+parseInt(_0x43efcf(0x2b5))/0xb*(parseInt(_0x43efcf(0x21b))/0xc);if(_0x3c1839===_0x358b46)break;else _0x266119['push'](_0x266119['shift']());}catch(_0xf11655){_0x266119['push'](_0x266119['shift']());}}}(_0x46d0,0xa6119));var Pe=Object[_0xbd6474(0x1c5)],un=Object[_0xbd6474(0x1e9)],pn=Object[_0xbd6474(0x29d)],gn=Object[_0xbd6474(0x1d4)],mn=Object[_0xbd6474(0x199)],pt=Object[_0xbd6474(0x318)],mt=Object['prototype']['hasOwnProperty'],En=Object['prototype'][_0xbd6474(0x1d3)],Et=_0x563cd7=>{throw TypeError(_0x563cd7);},gt=(_0x41651e,_0x3514a0,_0x3a4199)=>_0x3514a0 in _0x41651e?Pe(_0x41651e,_0x3514a0,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x3a4199}):_0x41651e[_0x3514a0]=_0x3a4199,z=(_0x4a51d6,_0x343c02)=>{const _0x4acd40=_0xbd6474;for(var _0x4300f0 in _0x343c02||(_0x343c02={}))mt[_0x4acd40(0x1b0)](_0x343c02,_0x4300f0)&&gt(_0x4a51d6,_0x4300f0,_0x343c02[_0x4300f0]);if(pt){for(var _0x4300f0 of pt(_0x343c02))En[_0x4acd40(0x1b0)](_0x343c02,_0x4300f0)&&gt(_0x4a51d6,_0x4300f0,_0x343c02[_0x4300f0]);}return _0x4a51d6;},Ne=(_0x4397c6,_0x3ab565)=>un(_0x4397c6,gn(_0x3ab565)),vn=(_0xa9b74c,_0x1372db)=>{for(var _0x2f9ab0 in _0x1372db)Pe(_0xa9b74c,_0x2f9ab0,{'get':_0x1372db[_0x2f9ab0],'enumerable':!0x0});},In=(_0x5263d0,_0x1f1f00,_0x32a220,_0x26b964)=>{const _0x58d267=_0xbd6474;if(_0x1f1f00&&typeof _0x1f1f00==_0x58d267(0x186)||typeof _0x1f1f00==_0x58d267(0x31e)){for(let _0x396879 of mn(_0x1f1f00))!mt[_0x58d267(0x1b0)](_0x5263d0,_0x396879)&&_0x396879!==_0x32a220&&Pe(_0x5263d0,_0x396879,{'get':()=>_0x1f1f00[_0x396879],'enumerable':!(_0x26b964=pn(_0x1f1f00,_0x396879))||_0x26b964[_0x58d267(0x2ad)]});}return _0x5263d0;},Sn=_0x191916=>In(Pe({},_0xbd6474(0x2a6),{'value':!0x0}),_0x191916),Fe=(_0x4b492b,_0x22edc2,_0x1f88aa)=>_0x22edc2[_0xbd6474(0x18f)](_0x4b492b)||Et(_0xbd6474(0x234)+_0x1f88aa),d=(_0x1a6636,_0x1cde8f,_0x5c954e)=>(Fe(_0x1a6636,_0x1cde8f,_0xbd6474(0x2bc)),_0x5c954e?_0x5c954e[_0xbd6474(0x1b0)](_0x1a6636):_0x1cde8f[_0xbd6474(0x1ea)](_0x1a6636)),m=(_0x4acd96,_0xd92a64,_0x1f6102)=>_0xd92a64[_0xbd6474(0x18f)](_0x4acd96)?Et(_0xbd6474(0x24a)):_0xd92a64 instanceof WeakSet?_0xd92a64[_0xbd6474(0x2e5)](_0x4acd96):_0xd92a64['set'](_0x4acd96,_0x1f6102),I=(_0x404e34,_0x272e81,_0x2a77e7,_0x3938dc)=>(Fe(_0x404e34,_0x272e81,_0xbd6474(0x2da)),_0x3938dc?_0x3938dc[_0xbd6474(0x1b0)](_0x404e34,_0x2a77e7):_0x272e81['set'](_0x404e34,_0x2a77e7),_0x2a77e7),i=(_0x3ec61c,_0x18a942,_0x30bcd0)=>(Fe(_0x3ec61c,_0x18a942,'access\x20private\x20method'),_0x30bcd0),a=(_0x54ce16,_0x51016,_0x5d49fa)=>new Promise((_0x49d918,_0x40758a)=>{const _0x965b40=_0xbd6474;var _0x48f5d0=_0x164b04=>{try{_0x35ede9(_0x5d49fa['next'](_0x164b04));}catch(_0xe97965){_0x40758a(_0xe97965);}},_0x1f3a15=_0x56968f=>{try{_0x35ede9(_0x5d49fa['throw'](_0x56968f));}catch(_0x29e052){_0x40758a(_0x29e052);}},_0x35ede9=_0x5478bc=>_0x5478bc[_0x965b40(0x1e8)]?_0x49d918(_0x5478bc['value']):Promise[_0x965b40(0x298)](_0x5478bc[_0x965b40(0x286)])[_0x965b40(0x183)](_0x48f5d0,_0x1f3a15);_0x35ede9((_0x5d49fa=_0x5d49fa[_0x965b40(0x1b1)](_0x54ce16,_0x51016))['next']());}),wn={};vn(wn,{'default':()=>yn}),module['exports']=Sn(wn);var vt=_0xbd6474(0x229),ge=_0xbd6474(0x306),Be=_0xbd6474(0x1a5),It=_0xbd6474(0x2a2),Me=_0xbd6474(0x2d2),St=_0xbd6474(0x1ab),ft=_0xbd6474(0x180),ht=_0xbd6474(0x2c6),bt=_0xbd6474(0x22a),yt=_0xbd6474(0x2e8),wt='/brand/get-time',Tt=(_0x464985=>(_0x464985[_0xbd6474(0x1d0)]=_0xbd6474(0x27c),_0x464985[_0xbd6474(0x253)]=_0xbd6474(0x325),_0x464985['UTM_CAMPAIGN']=_0xbd6474(0x1a1),_0x464985[_0xbd6474(0x2ca)]=_0xbd6474(0x2c4),_0x464985[_0xbd6474(0x1cc)]=_0xbd6474(0x26a),_0x464985['GAD_SOURCE']=_0xbd6474(0x2ba),_0x464985[_0xbd6474(0x26b)]=_0xbd6474(0x22e),_0x464985[_0xbd6474(0x28a)]=_0xbd6474(0x20e),_0x464985))(Tt||{}),Pt=new Set(Object[_0xbd6474(0x2c9)](Tt)),te='Popup\x20Action',re,$,ne,w=class w{constructor(){m(this,$);}static[_0xbd6474(0x323)](){return d(w,re)||I(w,re,new w()),d(w,re);}[_0xbd6474(0x1b8)](_0x56f7f3){const _0x38847a=_0xbd6474;w[_0x38847a(0x1f6)]=_0x56f7f3;let _0x380680=_0x56f7f3,_0x511ca7=/m(\d+)rgn/,_0x4ec1cb=_0x380680['match'](_0x511ca7);_0x4ec1cb&&(w[_0x38847a(0x1f8)]=_0x4ec1cb[0x1]);}[_0xbd6474(0x240)](){const _0x4f8bbc=_0xbd6474;return w[_0x4f8bbc(0x1f6)];}[_0xbd6474(0x23a)](){const _0x3077bb=_0xbd6474;return w[_0x3077bb(0x1f8)];}['get'](_0x154e38){return a(this,null,function*(){const _0x214000=_0x1f9a;try{return(yield fetch(ge+_0x154e38,{'headers':{'Authorization':i(this,$,ne)[_0x214000(0x1b0)](this,w[_0x214000(0x1f6)]),'Content-Type':_0x214000(0x324)}}))['json']();}catch(_0x1f5c00){let _0x3c36ae=_0x1f5c00['message'];return this['getBrandId']()==='67'&&_0x3c36ae!==_0x214000(0x28f)&&_0x3c36ae!==_0x214000(0x23f)&&u['recordEvent']({'eventName':_0x214000(0x1d1),'eventProperties':[{'eventProperty':_0x214000(0x2f6),'value':'get\x20-\x20'+_0x154e38+_0x214000(0x32f)+i(this,$,ne)[_0x214000(0x1b0)](this,w[_0x214000(0x1f6)])+_0x214000(0x225)+_0x1f5c00[_0x214000(0x2f6)]}]},!0x0),Promise[_0x214000(0x33a)](_0x1f5c00);}});}[_0xbd6474(0x25c)](_0x47a349,_0x19ed85,_0x2d9431){return a(this,null,function*(){const _0x3d0166=_0x1f9a;try{return(yield fetch(ge+_0x47a349,{'body':JSON[_0x3d0166(0x277)](_0x19ed85||{}),'headers':{'Authorization':i(this,$,ne)[_0x3d0166(0x1b0)](this,w[_0x3d0166(0x1f6)]),'Content-Type':_0x3d0166(0x324)},'method':_0x3d0166(0x202),'signal':_0x2d9431}))[_0x3d0166(0x267)]();}catch(_0x21c853){let _0x1c45e2=_0x21c853[_0x3d0166(0x2f6)];return this[_0x3d0166(0x23a)]()==='67'&&_0x1c45e2!==_0x3d0166(0x28f)&&_0x1c45e2!=='Failed\x20to\x20load'&&u[_0x3d0166(0x343)]({'eventName':_0x3d0166(0x1d1),'eventProperties':[{'eventProperty':_0x3d0166(0x2f6),'value':'post\x20-\x20'+_0x47a349+_0x3d0166(0x32f)+i(this,$,ne)[_0x3d0166(0x1b0)](this,w[_0x3d0166(0x1f6)])+_0x3d0166(0x32f)+JSON[_0x3d0166(0x277)](_0x19ed85||{})+'\x20-'+_0x21c853[_0x3d0166(0x2f6)]}]},!0x0),Promise[_0x3d0166(0x33a)](_0x21c853);}});}[_0xbd6474(0x24e)](_0x3a300c,_0x589205){return a(this,null,function*(){const _0xa3927c=_0x1f9a;return(yield fetch(ge+_0x3a300c,{'body':JSON['stringify'](_0x589205||{}),'headers':{'Authorization':i(this,$,ne)['call'](this,w['apiKey']),'Content-Type':_0xa3927c(0x324)},'method':_0xa3927c(0x22b)}))[_0xa3927c(0x267)]();});}[_0xbd6474(0x2fe)](){return a(this,null,function*(){const _0x4e246f=_0x1f9a;try{let _0x4cf4fe=(yield(yield fetch(ge+wt))[_0x4e246f(0x267)]())[_0x4e246f(0x1d5)];w[_0x4e246f(0x191)]=new Date(_0x4cf4fe),w['lastSyncTime']=new Date();}catch(_0x18fb9d){s(0x2,_0x4e246f(0x27f));}});}[_0xbd6474(0x1f4)](){const _0x1ee735=_0xbd6474;if(!w[_0x1ee735(0x191)]||!w[_0x1ee735(0x288)])return s(0x2,_0x1ee735(0x236)),new Date();let _0x47f8f6=new Date()['getTime']()-w['lastSyncTime'][_0x1ee735(0x2b7)]();return new Date(w['UTCDate'][_0x1ee735(0x2b7)]()+_0x47f8f6);}};re=new WeakMap(),$=new WeakSet(),ne=function(_0x4a671d){const _0x233a1b=_0xbd6474;return btoa(_0x4a671d+':'+new Date()[_0x233a1b(0x2b7)]());},m(w,re);var $e=w,N=$e['getInstance'](),G,ie,x,Nt,Ke,_t,At,V=class V{constructor(){m(this,x),m(this,ie,!0x1);}static['getInstance'](){const _0xe586ae=_0xbd6474;var _0x36ce2c;return d(V,G)||(I(V,G,new V()),i(_0x36ce2c=d(V,G),x,Nt)[_0xe586ae(0x1b0)](_0x36ce2c)),d(V,G);}[_0xbd6474(0x304)](_0x48daad,_0x3ae3be,_0x1fbdb9){return a(this,null,function*(){const _0x2652b=_0x1f9a;yield A(_0x2652b(0x287),()=>a(this,null,function*(){const _0x70fc37=_0x2652b;if(s(0x1,_0x70fc37(0x2c5)),C(_0x70fc37(0x2c5),!0x0),L(_0x70fc37(0x29e),!0x0),s(0x1,'Attribute\x20Payload:\x0a\x20'+{'attributeName':_0x48daad,'attributeProperties':_0x1fbdb9,'attributeValue':_0x3ae3be}+')}'),!_0x3ae3be||_0x3ae3be===''){s(0x2,_0x70fc37(0x341));return;}yield E[_0x70fc37(0x2de)](),yield i(this,x,_t)['call'](this);let _0x4affd9=JSON[_0x70fc37(0x1a6)](localStorage[_0x70fc37(0x2b9)](_0x70fc37(0x328))||'{}'),_0x184abc=_0x1fbdb9?i(this,x,Ke)[_0x70fc37(0x1b0)](this,_0x4affd9,_0x48daad,_0x1fbdb9):i(this,x,Ke)[_0x70fc37(0x1b0)](this,_0x4affd9,_0x48daad);if(typeof _0x184abc==_0x70fc37(0x1a7)){s(0x2,_0x184abc);return;}_0x4affd9[_0x48daad][_0x70fc37(0x20c)]&&(yield E[_0x70fc37(0x2d0)](typeof _0x3ae3be==_0x70fc37(0x1a7)?_0x3ae3be:JSON[_0x70fc37(0x277)](_0x3ae3be))),E[_0x70fc37(0x25e)]();let {id:_0x305b3c}=_0x4affd9[_0x48daad],_0x139adc={'attributeId':_0x305b3c,'attributeProperties':_0x184abc,'customerId':localStorage[_0x70fc37(0x2b9)]('customer')||'','value':_0x3ae3be};yield i(this,x,At)['call'](this,_0x139adc);let _0x5e86b0=JSON['parse'](localStorage['getItem'](_0x70fc37(0x179))||'[]');_0x5e86b0[_0x70fc37(0x297)](),localStorage[_0x70fc37(0x233)](_0x70fc37(0x179),JSON[_0x70fc37(0x277)](_0x5e86b0)),L(_0x70fc37(0x29e),!0x1),C(_0x70fc37(0x2c5),!0x1);}));});}['storeAttributeInLocalStorage'](){return a(this,null,function*(){const _0x4f6c16=_0x1f9a;if(!localStorage[_0x4f6c16(0x2b9)](_0x4f6c16(0x328))&&!d(this,ie)){I(this,ie,!0x0);try{let _0x2cc727=(yield this[_0x4f6c16(0x2e2)]())[_0x4f6c16(0x1d5)];_0x2cc727&&localStorage[_0x4f6c16(0x233)](_0x4f6c16(0x328),JSON[_0x4f6c16(0x277)](_0x2cc727));}catch(_0x11a1a0){throw new Error('Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage');}finally{I(this,ie,!0x1);}}});}['fetchAttributeData'](){return a(this,null,function*(){const _0x499a92=_0x1f9a;try{return yield N[_0x499a92(0x1ea)](''+Be);}catch(_0x32d1ef){throw new Error(_0x499a92(0x270));}});}};G=new WeakMap(),ie=new WeakMap(),x=new WeakSet(),Nt=function(){return a(this,null,function*(){});},Ke=function(_0x382afb,_0x38abae,_0x1fa145){const _0x2a1924=_0xbd6474;if(!Object[_0x2a1924(0x2a7)][_0x2a1924(0x308)]['call'](_0x382afb,_0x38abae))return _0x2a1924(0x2ee)+_0x38abae+_0x2a1924(0x19f);if(!_0x1fa145)return[];let _0x4e41d6=_0x382afb[_0x38abae];if(!(_0x4e41d6!=null&&_0x4e41d6['attributeProperty']))return _0x2a1924(0x2ee)+_0x38abae+_0x2a1924(0x209);let _0x4870df=_0x1fa145[_0x2a1924(0x2d1)](({attributeProperty:_0x3b2f31})=>!Object['prototype']['hasOwnProperty']['call'](_0x4e41d6[_0x2a1924(0x25a)],_0x3b2f31))['map'](({attributeProperty:_0x43536d})=>_0x43536d);return _0x4870df['length']>0x0?_0x2a1924(0x2ee)+_0x38abae+_0x2a1924(0x196)+_0x4870df[_0x2a1924(0x32b)](',\x20')+'.':_0x1fa145[_0x2a1924(0x19e)](({attributeProperty:_0xf02d5a,value:_0x6a373c})=>({'attributePropertyId':_0x4e41d6[_0x2a1924(0x25a)][_0xf02d5a]['id'],'value':_0x6a373c}));},_t=function(){return a(this,null,function*(){const _0x93b08d=_0x1f9a;localStorage[_0x93b08d(0x2b9)](_0x93b08d(0x328))||(yield this[_0x93b08d(0x216)]());});},At=function(_0x3c63fc){return a(this,null,function*(){const _0x4fc67b=_0x1f9a;try{return yield N[_0x4fc67b(0x25c)](''+Be+It,_0x3c63fc);}catch(_0x393d0f){throw new Error(_0x4fc67b(0x276));}});},m(V,G);var Ve=V,me=Ve[_0xbd6474(0x323)](),Je='Content\x20Card\x20Action',Y,T,Ot,je,Lt,Ct,se,_e,Dt,Ut,xt,Ae,K=class K{constructor(){const _0x4db4d9=_0xbd6474;m(this,T),m(this,se,_0x457925=>{const _0x25f77f=_0x1f9a;E[_0x25f77f(0x1a2)]({'id':_0x457925,'localStorageKey':_0x25f77f(0x257)});}),this[_0x4db4d9(0x31a)]=()=>{const _0x1700f1=_0x4db4d9;E[_0x1700f1(0x2c1)]({'actionCondition':_0x3bdad6=>_0x3bdad6[_0x1700f1(0x2f6)][_0x1700f1(0x2aa)]===_0x1700f1(0x2ff),'actionMethod':_0xeaf88d=>i(this,T,je)[_0x1700f1(0x1b0)](this,_0xeaf88d[_0x1700f1(0x2f5)]),'localStorageKey':_0x1700f1(0x257)});},m(this,Ae,()=>{const _0x5b45a9=_0x4db4d9;E[_0x5b45a9(0x1c3)](_0x5b45a9(0x257));});}static[_0xbd6474(0x323)](){const _0x487b2f=_0xbd6474;var _0x5a0e61;return d(K,Y)||(I(K,Y,new K()),i(_0x5a0e61=d(K,Y),T,Ot)[_0x487b2f(0x1b0)](_0x5a0e61)),d(K,Y);}['showContentCard'](_0x3370e6){const _0x491df8=_0xbd6474;let _0x54b49c=JSON[_0x491df8(0x1a6)](localStorage[_0x491df8(0x2b9)](_0x491df8(0x257))||'{}');if(_0x54b49c&&_0x54b49c[_0x3370e6==null?void 0x0:_0x3370e6['campaignId']]){s(0x1,_0x491df8(0x299));return;}i(this,T,xt)[_0x491df8(0x1b0)](this,_0x3370e6),d(this,Ae)[_0x491df8(0x1b0)](this),i(this,T,je)[_0x491df8(0x1b0)](this,_0x3370e6[_0x491df8(0x2f5)]);}[_0xbd6474(0x21f)](_0x5ba43){return _0x5ba43==='content_card';}};Y=new WeakMap(),T=new WeakSet(),Ot=function(){return a(this,null,function*(){});},je=function(_0x1c238e){const _0x28f8a7=_0xbd6474;let _0x5b4d41=i(this,T,Lt)[_0x28f8a7(0x1b0)](this);if(document['getElementById'](_0x28f8a7(0x313)+_0x1c238e)){s(0x1,_0x28f8a7(0x2e3)),d(this,se)[_0x28f8a7(0x1b0)](this,_0x1c238e);return;}if(_0x5b4d41!=null&&_0x5b4d41[_0x1c238e])switch(_0x5b4d41[_0x1c238e]['campaignEntryTime']){case _0x28f8a7(0x1f3):{i(this,T,Ct)[_0x28f8a7(0x1b0)](this,_0x5b4d41[_0x1c238e]);break;}case _0x28f8a7(0x211):{i(this,T,_e)[_0x28f8a7(0x1b0)](this,_0x5b4d41[_0x1c238e]);break;}case _0x28f8a7(0x1cb):{i(this,T,Ut)[_0x28f8a7(0x1b0)](this,_0x5b4d41[_0x1c238e]);break;}default:return;}},Lt=function(){const _0x5e36ef=_0xbd6474;let _0x1b4210=localStorage[_0x5e36ef(0x2b9)](_0x5e36ef(0x257));return _0x1b4210?JSON[_0x5e36ef(0x1a6)](_0x1b4210):null;},Ct=function(_0x2e7c7e){const _0x4d79fd=_0xbd6474;E[_0x4d79fd(0x333)]({'clearActionMethod':d(this,se)['bind'](this),'data':_0x2e7c7e,'displayMethod':i(this,T,_e)[_0x4d79fd(0x20d)](this),'idKey':'campaignId','timeValueKey':_0x4d79fd(0x278)});},se=new WeakMap(),_e=function(_0x3a64fc){const _0x284885=_0xbd6474;var _0x4f26ab;if(document[_0x284885(0x311)]('contentCard_container_'+_0x3a64fc[_0x284885(0x2f5)]))s(0x1,'ContentCard\x20already\x20displayed');else{let _0x525428=i(this,T,Dt)[_0x284885(0x1b0)](this,_0x284885(0x266),_0x3a64fc),_0x5bfd0c=document[_0x284885(0x285)]('#'+_0x3a64fc[_0x284885(0x2f6)][_0x284885(0x2e6)]);_0x5bfd0c&&(_0x5bfd0c[_0x284885(0x21c)]=_0x525428[_0x284885(0x30d)],u[_0x284885(0x343)]({'campaignCustomerInstanceId':_0x3a64fc['campaignCustomerInstanceId'],'campaignId':_0x3a64fc[_0x284885(0x2f5)],'eventName':Je,'eventProperties':[{'eventProperty':_0x284885(0x17a),'value':JSON[_0x284885(0x277)]({'campaignId':_0x3a64fc[_0x284885(0x2f5)]})}],'name':'view'}),(_0x4f26ab=document['getElementById'](_0x284885(0x313)+_0x3a64fc[_0x284885(0x2f5)]))==null||_0x4f26ab[_0x284885(0x307)]('click',()=>{const _0x240cae=_0x284885;u['recordEvent']({'campaignCustomerInstanceId':_0x3a64fc['campaignCustomerInstanceId'],'campaignId':_0x3a64fc[_0x240cae(0x2f5)],'eventName':Je,'eventProperties':[{'eventProperty':'Content\x20Card\x20Click','value':JSON['stringify']({'campaignId':_0x3a64fc[_0x240cae(0x2f5)]})}],'name':'click'});}));}d(this,se)[_0x284885(0x1b0)](this,_0x3a64fc['campaignId']);},Dt=function(_0x4a1541,_0x6c1a05){const _0x4bec19=_0xbd6474;var _0x301485;let {campaignId:_0x45352a,message:{design:_0x2349f4}}=_0x6c1a05,_0x1c778c=document[_0x4bec19(0x1cf)](_0x4a1541);return _0x1c778c['id']=_0x4bec19(0x313)+_0x45352a,_0x1c778c['innerHTML']=_0x2349f4,(_0x301485=_0x1c778c[_0x4bec19(0x285)]('.u-close-button'))==null||_0x301485[_0x4bec19(0x303)](),_0x1c778c;},Ut=function(_0x4d6c5e){const _0x3645fa=_0xbd6474;E[_0x3645fa(0x237)]({'data':_0x4d6c5e,'displayMethod':i(this,T,_e)['bind'](this),'timeValueKey':'campaignEntryTimeValue'});},xt=function(_0x57d5ba){const _0x318b4b=_0xbd6474;E[_0x318b4b(0x255)](_0x57d5ba,_0x318b4b(0x257),_0x318b4b(0x2f5));},Ae=new WeakMap(),m(K,Y);var He=K,ae=He[_0xbd6474(0x323)](),ce,B,le,q,Ee,ve,S,Ge,Wt,Ye,Re,kt,Ce,Oe,qe,Ft,Le,Ie,Bt,f=class f{constructor(){const _0x371888=_0xbd6474;m(this,S),this[_0x371888(0x249)]=null,this['pushMessageToSW']=_0x4423d9=>{const _0x488c52=_0x371888;s(0x1,_0x488c52(0x314)),navigator[_0x488c52(0x2d5)][_0x488c52(0x2a5)]()[_0x488c52(0x183)](_0x219530=>{const _0x2351fe=_0x488c52;var _0x2a7ddf,_0x50bf0b;s(0x1,_0x2351fe(0x1b2)),(_0x2a7ddf=_0x219530[0x0])!=null&&_0x2a7ddf[_0x2351fe(0x1fb)]&&(s(0x1,_0x2351fe(0x2a4)),(_0x50bf0b=_0x219530[0x0][_0x2351fe(0x1fb)])==null||_0x50bf0b[_0x2351fe(0x2d4)](JSON[_0x2351fe(0x277)](_0x4423d9)));})[_0x488c52(0x24c)](_0x688c2c=>{const _0x4ebe44=_0x488c52;s(0x2,'Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20'+_0x688c2c[_0x4ebe44(0x2f6)]);});},this[_0x371888(0x1ff)]=()=>{const _0x44984f=_0x371888;E['loadActionInLocalStorage']({'actionCondition':()=>!0x0,'actionMethod':_0x47be52=>i(this,S,Oe)[_0x44984f(0x1b0)](this,Number(_0x47be52[_0x44984f(0x25b)])),'localStorageKey':_0x44984f(0x181)});},m(this,Ce,()=>{const _0x3a64c6=_0x371888;E['storeActionInLocalStorageInternal'](_0x3a64c6(0x181));}),m(this,Ie,_0x499892=>{const _0x564824=_0x371888;E['clearActionInLocalStorage']({'id':_0x499892,'localStorageKey':_0x564824(0x181)});});}static['getInstance'](){return d(f,ce)||I(f,ce,new f()),d(f,ce);}['init'](_0x2a43c4,_0x419c78){return a(this,null,function*(){const _0x5b6015=_0x1f9a;var _0x39f5ad;if(s(0x1,_0x5b6015(0x1e3)),u[_0x5b6015(0x227)]({'eventName':_0x5b6015(0x2d3),'eventProperties':[{'eventProperty':_0x5b6015(0x294),'value':'serviceWorker'in navigator},{'eventProperty':_0x5b6015(0x18b),'value':_0x5b6015(0x206)in window}]}),_0x5b6015(0x2d5)in navigator&&_0x5b6015(0x206)in window){s(0x1,_0x5b6015(0x293));try{u[_0x5b6015(0x227)]({'eventName':_0x5b6015(0x2fb)}),I(f,B,yield navigator[_0x5b6015(0x2d5)][_0x5b6015(0x215)](_0x419c78||_0x5b6015(0x190))),s(0x1,_0x5b6015(0x189)),s(0x1,'Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization'),this[_0x5b6015(0x2df)]({'customer':localStorage[_0x5b6015(0x2b9)](_0x5b6015(0x320))||'','events':u[_0x5b6015(0x18d)](),'API_KEY':N[_0x5b6015(0x240)](),'device_id':localStorage[_0x5b6015(0x2b9)](_0x5b6015(0x19d))||'','operatingSystem':E[_0x5b6015(0x321)](),'osVersion':E[_0x5b6015(0x1b9)](),'Platform':E[_0x5b6015(0x302)]()}),I(f,Ee,!0x0);let _0x5c0894=i(this,S,qe)[_0x5b6015(0x1b0)](this),_0x2d00a7=Object['keys'](_0x5c0894||{});if(_0x2d00a7[_0x5b6015(0x212)]&&i(this,S,Oe)[_0x5b6015(0x1b0)](this,Number(_0x2d00a7[0x0])),!_0x2a43c4)return;let _0x102bb3=yield(_0x39f5ad=d(f,B))==null?void 0x0:_0x39f5ad[_0x5b6015(0x1f7)]['getSubscription']();s(0x1,_0x5b6015(0x2ce)),d(f,B)&&(s(0x1,_0x5b6015(0x2fa)),d(f,B)[_0x5b6015(0x2d9)]()),_0x102bb3?(s(0x1,'Existing\x20subscription\x20found'),u[_0x5b6015(0x227)]({'eventName':'existing_subscription'}),yield i(this,S,Re)['call'](this),I(f,le,!0x0)):(s(0x1,_0x5b6015(0x2ea)),yield i(this,S,Ge)[_0x5b6015(0x1b0)](this,d(f,ve)||void 0x0));}catch(_0x73baa7){let _0x23ca8c=_0x73baa7&&_0x73baa7[_0x5b6015(0x2f6)]?_0x73baa7[_0x5b6015(0x2f6)][_0x5b6015(0x1c6)](0x0,0x64):_0x5b6015(0x1e6);yield u[_0x5b6015(0x227)]({'eventName':_0x5b6015(0x2ab),'eventProperties':[{'eventProperty':_0x5b6015(0x2f6),'value':''+_0x23ca8c}]}),s(0x2,_0x5b6015(0x17d)),s(0x2,_0x23ca8c);}}});}[_0xbd6474(0x2d7)](_0x17500a){const _0x58a92d=_0xbd6474;if(!d(f,Ee)){I(f,ve,_0x17500a),u[_0x58a92d(0x227)]({'eventName':'notification_service_not_initialized'}),s(0x2,'Notification\x20service\x20is\x20not\x20initialized');return;}A('showNotification',()=>a(this,null,function*(){const _0x27fb44=_0x58a92d;let _0xd9d340=JSON[_0x27fb44(0x1a6)](localStorage[_0x27fb44(0x2b9)](_0x27fb44(0x181))||'{}');if(_0xd9d340&&_0xd9d340[_0x17500a[_0x27fb44(0x25b)]]){s(0x1,_0x27fb44(0x17f));return;}i(this,S,kt)[_0x27fb44(0x1b0)](this,_0x17500a),d(this,Ce)['call'](this),i(this,S,Oe)['call'](this,_0x17500a[_0x27fb44(0x25b)]);}));}};ce=new WeakMap(),B=new WeakMap(),le=new WeakMap(),q=new WeakMap(),Ee=new WeakMap(),ve=new WeakMap(),S=new WeakSet(),Ge=function(_0x35eed0){return a(this,null,function*(){const _0x543044=_0x1f9a;s(0x1,'Checking\x20notification\x20permission:\x20'+JSON[_0x543044(0x277)](_0x35eed0)+'\x20'),u[_0x543044(0x227)]({'eventName':_0x543044(0x246)});let _0x2392b9;try{_0x2392b9=Notification[_0x543044(0x249)],_0x2392b9&&(s(0x1,_0x543044(0x207)+_0x2392b9),_0x2392b9==='default'?(_0x35eed0||(this[_0x543044(0x249)]=_0x543044(0x342),u[_0x543044(0x227)]({'eventName':_0x543044(0x281)})),_0x35eed0&&(u['recordDebugEvents']({'eventName':_0x543044(0x329),'eventProperties':[{'eventProperty':_0x543044(0x1c0),'value':''+(_0x35eed0==null?void 0x0:_0x35eed0[_0x543044(0x1c0)])}]}),d(this,Ie)[_0x543044(0x1b0)](this,_0x35eed0['web_optin_instance_id']),_0x35eed0[_0x543044(0x1c0)]==='two_step'?i(this,S,Wt)[_0x543044(0x1b0)](this,_0x35eed0):yield i(this,S,Ye)[_0x543044(0x1b0)](this,_0x35eed0))):_0x2392b9===_0x543044(0x274)?(u[_0x543044(0x227)]({'eventName':_0x543044(0x1b4)}),s(0x1,_0x543044(0x344))):(u['recordDebugEvents']({'eventName':_0x543044(0x33f)}),s(0x1,_0x543044(0x28c)),d(f,le)||(yield i(this,S,Re)[_0x543044(0x1b0)](this),yield u[_0x543044(0x343)]({'eventName':'Already\x20Registered\x20To\x20Web\x20Push'}),_0x35eed0||I(f,le,!0x0))));}catch(_0x43e9c7){s(0x2,_0x543044(0x184)),u['recordDebugEvents']({'eventName':'notification_permission_error'});}});},Wt=function(_0x88d4fd){const _0x2c1ec9=_0xbd6474;try{let _0xf29891=document[_0x2c1ec9(0x1cf)](_0x2c1ec9(0x266)),_0x4a2064;_0x88d4fd[_0x2c1ec9(0x241)][_0x2c1ec9(0x1d2)]&&(_0x4a2064=document['createElement']('img'),_0x4a2064[_0x2c1ec9(0x18c)]=_0x88d4fd[_0x2c1ec9(0x241)][_0x2c1ec9(0x1d2)],_0x4a2064[_0x2c1ec9(0x24d)]=_0x2c1ec9(0x1ef),_0x4a2064['id']=_0x2c1ec9(0x310));let _0x24f89d=document['createElement'](_0x2c1ec9(0x266)),_0x14c2d3=document['createElement'](_0x2c1ec9(0x266)),_0x624120=document[_0x2c1ec9(0x1cf)]('div'),_0x4956dd=document['createElement']('img'),_0x3ebfe1=document[_0x2c1ec9(0x1cf)]('div'),_0x579682=document[_0x2c1ec9(0x1cf)]('div'),_0x16ffdd=document[_0x2c1ec9(0x1cf)]('div'),_0x52d5e2=document[_0x2c1ec9(0x1cf)](_0x2c1ec9(0x266)),_0x31852e=document[_0x2c1ec9(0x1cf)](_0x2c1ec9(0x266)),_0x4bccc4=document[_0x2c1ec9(0x1cf)](_0x2c1ec9(0x266)),_0x236dc1=document[_0x2c1ec9(0x1cf)](_0x2c1ec9(0x1c7)),_0x240d43=document[_0x2c1ec9(0x1cf)](_0x2c1ec9(0x1c7));_0xf29891[_0x2c1ec9(0x315)]=_0x2c1ec9(0x221),_0x24f89d[_0x2c1ec9(0x315)]=_0x2c1ec9(0x17e),_0x14c2d3[_0x2c1ec9(0x315)]=_0x52d5e2[_0x2c1ec9(0x315)]=_0x31852e['className']='mergn-row',_0x624120[_0x2c1ec9(0x315)]=_0x2c1ec9(0x1e0),_0x3ebfe1['className']=_0x2c1ec9(0x263),_0x4bccc4[_0x2c1ec9(0x315)]=_0x2c1ec9(0x1c9),_0x579682['id']=_0x2c1ec9(0x18e),_0x16ffdd['id']='subtitle',_0x236dc1['id']='button-1',_0x240d43['id']=_0x2c1ec9(0x20b),_0x4956dd[_0x2c1ec9(0x18c)]=_0x88d4fd[_0x2c1ec9(0x241)]['banner_icon'],_0x4956dd['alt']='Image',_0x4956dd['id']=_0x2c1ec9(0x1a9),_0x579682[_0x2c1ec9(0x330)]=_0x88d4fd[_0x2c1ec9(0x241)][_0x2c1ec9(0x319)],_0x16ffdd[_0x2c1ec9(0x330)]=_0x88d4fd[_0x2c1ec9(0x241)]['banner_text'],_0x236dc1[_0x2c1ec9(0x330)]=_0x88d4fd[_0x2c1ec9(0x241)][_0x2c1ec9(0x335)][_0x2c1ec9(0x1c4)],_0x240d43[_0x2c1ec9(0x330)]=_0x88d4fd['banner_design'][_0x2c1ec9(0x197)][_0x2c1ec9(0x1c4)],_0x624120[_0x2c1ec9(0x268)](_0x4956dd),_0x3ebfe1['appendChild'](_0x579682),_0x3ebfe1[_0x2c1ec9(0x268)](_0x16ffdd),_0x14c2d3[_0x2c1ec9(0x268)](_0x624120),_0x14c2d3[_0x2c1ec9(0x268)](_0x3ebfe1),_0x4a2064&&(_0x52d5e2['appendChild'](_0x4a2064),_0x4a2064['style'][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x214)),_0x4bccc4[_0x2c1ec9(0x268)](_0x236dc1),_0x4bccc4['appendChild'](_0x240d43),_0x31852e['appendChild'](_0x4bccc4),_0x24f89d['appendChild'](_0x14c2d3),_0x24f89d['appendChild'](_0x52d5e2),_0x24f89d[_0x2c1ec9(0x268)](_0x31852e),_0xf29891[_0x2c1ec9(0x268)](_0x24f89d),_0xf29891[_0x2c1ec9(0x2a1)][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x20a),_0x24f89d[_0x2c1ec9(0x2a1)][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x2d8)+_0x88d4fd[_0x2c1ec9(0x241)][_0x2c1ec9(0x33d)]+_0x2c1ec9(0x30c),_0x14c2d3[_0x2c1ec9(0x2a1)][_0x2c1ec9(0x31c)]=_0x52d5e2[_0x2c1ec9(0x2a1)]['cssText']=_0x31852e['style'][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x1f0),_0x624120[_0x2c1ec9(0x2a1)][_0x2c1ec9(0x31c)]='\x0awidth:\x2025%;\x0a',_0x3ebfe1[_0x2c1ec9(0x2a1)][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x228),_0x4956dd['style'][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x271),_0x236dc1['style'][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x295)+_0x88d4fd[_0x2c1ec9(0x241)][_0x2c1ec9(0x335)]['backgroundColor']+';\x0acolor:\x20'+_0x88d4fd[_0x2c1ec9(0x241)]['button_1'][_0x2c1ec9(0x18a)]+_0x2c1ec9(0x198),_0x240d43[_0x2c1ec9(0x2a1)][_0x2c1ec9(0x31c)]='\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20'+_0x88d4fd[_0x2c1ec9(0x241)]['button_2'][_0x2c1ec9(0x178)]+_0x2c1ec9(0x22d)+_0x88d4fd[_0x2c1ec9(0x241)][_0x2c1ec9(0x197)][_0x2c1ec9(0x18a)]+_0x2c1ec9(0x198),_0x4bccc4[_0x2c1ec9(0x2a1)][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x250),_0x579682[_0x2c1ec9(0x2a1)][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x338)+_0x88d4fd[_0x2c1ec9(0x241)][_0x2c1ec9(0x1ec)]+'\x0a',_0x16ffdd[_0x2c1ec9(0x2a1)][_0x2c1ec9(0x31c)]=_0x2c1ec9(0x235)+_0x88d4fd['banner_design']['text_color']+'\x0a',document[_0x2c1ec9(0x259)][_0x2c1ec9(0x268)](_0xf29891),document[_0x2c1ec9(0x259)][_0x2c1ec9(0x2a1)][_0x2c1ec9(0x2af)]=_0x2c1ec9(0x29c),u[_0x2c1ec9(0x343)]({'eventName':_0x2c1ec9(0x309),'name':_0x2c1ec9(0x305),'web_optin_instance_id':_0x88d4fd[_0x2c1ec9(0x25b)]}),_0x236dc1==null||_0x236dc1[_0x2c1ec9(0x307)]('click',()=>a(this,null,function*(){const _0x138622=_0x2c1ec9;_0xf29891[_0x138622(0x303)](),I(f,q,!0x1),document[_0x138622(0x259)][_0x138622(0x2a1)][_0x138622(0x2af)]=_0x138622(0x1e1),yield u['recordEvent']({'eventName':_0x138622(0x2a3),'web_optin_instance_id':_0x88d4fd[_0x138622(0x25b)]}),s(0x1,'User\x20denied\x20the\x20notification\x20permission.');})),_0x240d43==null||_0x240d43[_0x2c1ec9(0x307)]('click',()=>a(this,null,function*(){const _0xa885d8=_0x2c1ec9;_0xf29891['remove'](),document[_0xa885d8(0x259)][_0xa885d8(0x2a1)]['overflow']=_0xa885d8(0x1e1),u['recordEvent']({'eventName':'Accepted\x20Web\x20Push\x20Soft-ask','web_optin_instance_id':_0x88d4fd['web_optin_instance_id']}),yield i(this,S,Ye)[_0xa885d8(0x1b0)](this,_0x88d4fd);}));}catch(_0x311197){}},Ye=function(_0x32fbd8){return a(this,null,function*(){const _0x171de0=_0x1f9a;try{u[_0x171de0(0x343)]({'eventName':_0x171de0(0x1d6),'name':_0x171de0(0x305),'web_optin_instance_id':_0x32fbd8[_0x171de0(0x25b)]});let _0x1bee9f=yield Notification[_0x171de0(0x2bd)]();_0x1bee9f==='granted'?(s(0x1,'User\x20granted\x20the\x20notification\x20permission.'),yield i(this,S,Re)[_0x171de0(0x1b0)](this),yield u['recordEvent']({'eventName':_0x171de0(0x2ed),'name':_0x171de0(0x27b),'web_optin_instance_id':_0x32fbd8[_0x171de0(0x25b)]})):_0x1bee9f===_0x171de0(0x274)?(yield u[_0x171de0(0x343)]({'eventName':'Blocked\x20Web\x20Push\x20Subscription'}),s(0x1,_0x171de0(0x2d6))):_0x1bee9f===_0x171de0(0x342)&&(yield u[_0x171de0(0x343)]({'eventName':_0x171de0(0x1ad)}),s(0x1,_0x171de0(0x284)));}catch(_0x76296f){s(0x2,_0x171de0(0x1c1));}I(f,q,!0x1);});},Re=function(){return a(this,null,function*(){const _0x45bbfe=_0x1f9a;var _0x3af95c,_0x222d92;let _0x276ccf=yield N[_0x45bbfe(0x1ea)](''+yt);if(_0x276ccf['success']){let _0x78071e=yield(_0x3af95c=d(f,B))==null?void 0x0:_0x3af95c['pushManager'][_0x45bbfe(0x283)]();_0x78071e&&(yield _0x78071e['unsubscribe']());let _0x5314d4=yield(_0x222d92=d(f,B))==null?void 0x0:_0x222d92[_0x45bbfe(0x1f7)]['subscribe']({'applicationServerKey':_0x276ccf[_0x45bbfe(0x1d5)]||'','userVisibleOnly':!0x0});yield N['put'](''+ht,{'device_id':localStorage[_0x45bbfe(0x2b9)](_0x45bbfe(0x19d))||'','is_web_push_subscribed':!0x0,'web_push_subscription_page_url':window[_0x45bbfe(0x248)][_0x45bbfe(0x261)],'web_push_token':{'token':JSON['parse'](JSON[_0x45bbfe(0x277)](_0x5314d4))}}),s(0x1,_0x45bbfe(0x2a9));}else throw new Error(_0x45bbfe(0x31d));});},kt=function(_0x2074eb){const _0x1e5dc2=_0xbd6474;E[_0x1e5dc2(0x255)](_0x2074eb,_0x1e5dc2(0x181),_0x1e5dc2(0x25b));},Ce=new WeakMap(),Oe=function(_0x178777){const _0x3b998c=_0xbd6474;if(d(f,q))return;I(f,q,!0x0);let _0x24aadd=i(this,S,qe)[_0x3b998c(0x1b0)](this);if(_0x24aadd!=null&&_0x24aadd[_0x178777])switch(_0x24aadd[_0x178777][_0x3b998c(0x1b5)]){case _0x3b998c(0x1f3):{i(this,S,Ft)[_0x3b998c(0x1b0)](this,_0x24aadd[_0x178777]);break;}case _0x3b998c(0x211):{i(this,S,Le)['call'](this,_0x24aadd[_0x178777]);break;}case _0x3b998c(0x1cb):{i(this,S,Bt)[_0x3b998c(0x1b0)](this,_0x24aadd[_0x178777]);break;}default:return;}},qe=function(){const _0x3bb728=_0xbd6474;let _0x3fc160=localStorage[_0x3bb728(0x2b9)]('web_push_action');return _0x3fc160?JSON[_0x3bb728(0x1a6)](_0x3fc160):null;},Ft=function(_0x2ecbb2){const _0x5de2c0=_0xbd6474;E[_0x5de2c0(0x333)]({'clearActionMethod':d(this,Ie)[_0x5de2c0(0x20d)](this),'data':_0x2ecbb2,'displayMethod':i(this,S,Le)[_0x5de2c0(0x20d)](this),'idKey':_0x5de2c0(0x25b),'timeValueKey':_0x5de2c0(0x337)});},Le=function(_0x5c1408){const _0x5ae24d=_0xbd6474;i(this,S,Ge)[_0x5ae24d(0x1b0)](this,_0x5c1408);},Ie=new WeakMap(),Bt=function(_0x2a2727){const _0x1c603f=_0xbd6474;E['showAfterScrollAction']({'data':_0x2a2727,'displayMethod':i(this,S,Le)[_0x1c603f(0x20d)](this),'timeValueKey':'entry_time_value'});},m(f,ce),m(f,B,null),m(f,le,!0x1),m(f,q,!0x1),m(f,Ee,!0x1),m(f,ve,null);function _0x1f9a(_0x2bb7b4,_0x5aa0be){const _0x46d0ed=_0x46d0();return _0x1f9a=function(_0x1f9af0,_0x51b865){_0x1f9af0=_0x1f9af0-0x178;let _0x59f424=_0x46d0ed[_0x1f9af0];return _0x59f424;},_0x1f9a(_0x2bb7b4,_0x5aa0be);}var ze=f,W=ze[_0xbd6474(0x323)](),Q,P,Mt,Ze,$t,Vt,de,De,Kt,Jt,Ht,Ue,J=class J{constructor(){m(this,P),m(this,de,_0x550959=>{const _0x4f3ab3=_0x1f9a;E[_0x4f3ab3(0x1a2)]({'id':_0x550959,'localStorageKey':_0x4f3ab3(0x257)});}),this['loadPopupEventActionInLocalStorage']=()=>{const _0x4aff1=_0x1f9a;E[_0x4aff1(0x2c1)]({'actionCondition':_0x250d72=>_0x250d72[_0x4aff1(0x2f6)][_0x4aff1(0x2aa)]===_0x4aff1(0x23e),'actionMethod':_0x2f0b3d=>i(this,P,Ze)['call'](this,_0x2f0b3d[_0x4aff1(0x2f5)]),'localStorageKey':'action'});},m(this,Ue,()=>{const _0x5d5f25=_0x1f9a;E[_0x5d5f25(0x1c3)](_0x5d5f25(0x257));});}static[_0xbd6474(0x323)](){var _0x48aaca;return d(J,Q)||(I(J,Q,new J()),i(_0x48aaca=d(J,Q),P,Mt)['call'](_0x48aaca)),d(J,Q);}[_0xbd6474(0x1dc)](_0xc847e8){const _0x33a653=_0xbd6474;let _0x5042fa=JSON[_0x33a653(0x1a6)](localStorage[_0x33a653(0x2b9)](_0x33a653(0x257))||'{}');if(_0x5042fa&&_0x5042fa[_0xc847e8==null?void 0x0:_0xc847e8[_0x33a653(0x2f5)]]){s(0x1,'Popup\x20already\x20in\x20cache');return;}i(this,P,Ht)[_0x33a653(0x1b0)](this,_0xc847e8),d(this,Ue)[_0x33a653(0x1b0)](this),i(this,P,Ze)[_0x33a653(0x1b0)](this,_0xc847e8[_0x33a653(0x2f5)]);}['isPopupAction'](_0x7899e1){return _0x7899e1==='Popup';}};Q=new WeakMap(),P=new WeakSet(),Mt=function(){return a(this,null,function*(){});},Ze=function(_0x5053f9){const _0x54957f=_0xbd6474;let _0xcdbac7=i(this,P,$t)[_0x54957f(0x1b0)](this);if(document[_0x54957f(0x311)](_0x54957f(0x1eb)+_0x5053f9)){s(0x1,_0x54957f(0x2bb)),d(this,de)['call'](this,_0x5053f9);return;}if(_0xcdbac7!=null&&_0xcdbac7[_0x5053f9])switch(_0xcdbac7[_0x5053f9]['campaignEntryTime']){case _0x54957f(0x1f3):{i(this,P,Vt)[_0x54957f(0x1b0)](this,_0xcdbac7[_0x5053f9]);break;}case _0x54957f(0x211):{i(this,P,De)[_0x54957f(0x1b0)](this,_0xcdbac7[_0x5053f9]);break;}case _0x54957f(0x1cb):{i(this,P,Jt)[_0x54957f(0x1b0)](this,_0xcdbac7[_0x5053f9]);break;}default:return;}},$t=function(){const _0xf6bfee=_0xbd6474;let _0x22aca3=localStorage[_0xf6bfee(0x2b9)](_0xf6bfee(0x257));return _0x22aca3?JSON[_0xf6bfee(0x1a6)](_0x22aca3):null;},Vt=function(_0x228fd4){const _0x1c45f5=_0xbd6474;E[_0x1c45f5(0x333)]({'clearActionMethod':d(this,de)['bind'](this),'data':_0x228fd4,'displayMethod':i(this,P,De)[_0x1c45f5(0x20d)](this),'idKey':_0x1c45f5(0x2f5),'timeValueKey':_0x1c45f5(0x278)});},de=new WeakMap(),De=function(_0x36107b){const _0x5e6259=_0xbd6474;if(document['getElementById']('popup_container_'+_0x36107b['campaignId']))s(0x1,_0x5e6259(0x2bb));else{let _0x246b90=i(this,P,Kt)[_0x5e6259(0x1b0)](this,_0x5e6259(0x266),_0x36107b);document[_0x5e6259(0x259)][_0x5e6259(0x268)](_0x246b90),u[_0x5e6259(0x343)]({'campaignCustomerInstanceId':_0x36107b[_0x5e6259(0x1ca)],'campaignId':_0x36107b[_0x5e6259(0x2f5)],'eventName':te,'eventProperties':[{'eventProperty':_0x5e6259(0x1df),'value':JSON[_0x5e6259(0x277)]({'campaignId':_0x36107b[_0x5e6259(0x2f5)]})}],'name':'view'});}d(this,de)[_0x5e6259(0x1b0)](this,_0x36107b[_0x5e6259(0x2f5)]);},Kt=function(_0xf0a685,_0x2f39e5){const _0x1e0f65=_0xbd6474;let {campaignCustomerInstanceId:_0x4e54d7,campaignId:_0x1db257,message:{design:_0x2bc163}}=_0x2f39e5,_0x50b3b2=document[_0x1e0f65(0x1cf)](_0xf0a685);_0x50b3b2['id']=_0x1e0f65(0x1eb)+_0x1db257,_0x50b3b2[_0x1e0f65(0x21c)]=_0x2bc163,_0x50b3b2[_0x1e0f65(0x2a1)]['position']=_0x1e0f65(0x21e),_0x50b3b2[_0x1e0f65(0x2a1)][_0x1e0f65(0x339)]='0',_0x50b3b2[_0x1e0f65(0x2a1)][_0x1e0f65(0x1cd)]='0',_0x50b3b2['style'][_0x1e0f65(0x33b)]=_0x1e0f65(0x2ae),_0x50b3b2['style'][_0x1e0f65(0x30b)]='100%',_0x50b3b2[_0x1e0f65(0x2a1)][_0x1e0f65(0x2fd)]=_0x1e0f65(0x32a);let _0x1ccf71=_0x50b3b2['querySelector'](_0x1e0f65(0x269));_0x1ccf71&&(_0x1ccf71[_0x1e0f65(0x2a1)][_0x1e0f65(0x2fd)]='50');let _0x31ab46=_0x1ccf71[_0x1e0f65(0x285)](_0x1e0f65(0x2e4));_0x31ab46&&(s(0x1,_0x1e0f65(0x30a)),_0x31ab46[_0x1e0f65(0x2a1)][_0x1e0f65(0x1b6)](_0x1e0f65(0x201),_0x1e0f65(0x291),_0x1e0f65(0x19b))),_0x50b3b2[_0x1e0f65(0x322)](_0x1e0f65(0x17c))[_0x1e0f65(0x1b7)](_0x8813eb=>{const _0xe1d25f=_0x1e0f65;let _0x18934c=_0x8813eb['querySelector'](_0xe1d25f(0x1a0));_0x18934c&&_0x18934c[_0xe1d25f(0x307)](_0xe1d25f(0x1bd),()=>a(this,null,function*(){const _0x15fe55=_0xe1d25f;_0x50b3b2[_0x15fe55(0x303)]();let _0x551c58=new FormData(_0x18934c),_0x548a0b={};for(let [_0x31c622,_0x4a300b]of _0x551c58['entries']())_0x548a0b[_0x31c622]=_0x4a300b;yield u['recordEvent']({'campaignCustomerInstanceId':_0x4e54d7,'campaignId':_0x1db257,'eventName':te,'eventProperties':[{'eventProperty':_0x15fe55(0x213),'value':JSON[_0x15fe55(0x277)]({'campaignId':_0x1db257,'formId':_0x8813eb['id'],'formValues':_0x548a0b})},{'eventProperty':_0x15fe55(0x230),'value':_0x1db257[_0x15fe55(0x2c3)]()}],'name':_0x15fe55(0x1a0)});}));});let _0x5b9b02=_0x50b3b2[_0x1e0f65(0x285)](_0x1e0f65(0x247));return(_0x5b9b02==null?void 0x0:_0x5b9b02[_0x1e0f65(0x218)](_0x1e0f65(0x264)))==='#'&&_0x5b9b02['removeAttribute'](_0x1e0f65(0x264)),_0x5b9b02==null||_0x5b9b02[_0x1e0f65(0x307)](_0x1e0f65(0x22c),()=>a(this,null,function*(){const _0x50d372=_0x1e0f65;_0x50b3b2['remove'](),yield u[_0x50d372(0x343)]({'campaignCustomerInstanceId':_0x4e54d7,'campaignId':_0x1db257,'eventName':te,'eventProperties':[{'eventProperty':_0x50d372(0x251),'value':JSON[_0x50d372(0x277)]({'campaignId':_0x1db257})}],'name':_0x50d372(0x2cd)});})),_0x50b3b2[_0x1e0f65(0x322)](_0x1e0f65(0x254))[_0x1e0f65(0x1b7)](_0x301136=>{const _0x12c935=_0x1e0f65;_0x301136[_0x12c935(0x307)](_0x12c935(0x22c),()=>a(this,null,function*(){const _0x2c5a8b=_0x12c935;_0x50b3b2['remove'](),yield u['recordEvent']({'campaignCustomerInstanceId':_0x4e54d7,'campaignId':_0x1db257,'eventName':te,'eventProperties':[{'eventProperty':'Button\x20Click','value':JSON['stringify']({'buttonId':_0x301136['id'],'campaignId':_0x1db257})}],'name':_0x2c5a8b(0x22c)});}));}),_0x50b3b2['querySelectorAll'](_0x1e0f65(0x223))[_0x1e0f65(0x1b7)](_0x4feccc=>{const _0x4c244a=_0x1e0f65;_0x4feccc[_0x4c244a(0x307)](_0x4c244a(0x22c),()=>a(this,null,function*(){const _0x289911=_0x4c244a;_0x50b3b2['remove'](),yield u['recordEvent']({'campaignCustomerInstanceId':_0x4e54d7,'campaignId':_0x1db257,'eventName':te,'eventProperties':[{'eventProperty':_0x289911(0x24f),'value':JSON['stringify']({'campaignId':_0x1db257,'imageClassName':_0x4feccc[_0x289911(0x315)],'imageId':_0x4feccc['id']})}],'name':'click'});}));}),_0x50b3b2;},Jt=function(_0x57841f){const _0x1b129b=_0xbd6474;E[_0x1b129b(0x237)]({'data':_0x57841f,'displayMethod':i(this,P,De)[_0x1b129b(0x20d)](this),'timeValueKey':'campaignEntryTimeValue'});},Ht=function(_0x49411c){const _0xdf89af=_0xbd6474;E[_0xdf89af(0x255)](_0x49411c,'action',_0xdf89af(0x2f5));},Ue=new WeakMap(),m(J,Q);var Qe=J,H=Qe[_0xbd6474(0x323)](),ue,fe,he,be,ye,we,Te,We,p,zt,Gt,Yt,Se,et,tt,nt,rt,qt,Qt,Zt,Xt,en,tn,nn,xe,it,rn,on,Z=class Z{constructor(){const _0x59a317=_0xbd6474;m(this,p),m(this,fe),m(this,he),m(this,be),m(this,ye,null),m(this,we,null),m(this,Te,!0x1),m(this,We,()=>{setInterval(()=>{const _0x494e4b=_0x1f9a;let _0x2f0cfc=localStorage['getItem']('mergn_shopify');if(_0x2f0cfc!==d(this,we)){I(this,we,_0x2f0cfc);let _0x4b55a9=JSON[_0x494e4b(0x1a6)](_0x2f0cfc||'{}');if(_0x4b55a9!=null&&_0x4b55a9[_0x494e4b(0x2df)]){let _0x462893=_0x4b55a9[_0x494e4b(0x2df)];delete _0x4b55a9[_0x494e4b(0x2df)],localStorage['setItem'](_0x494e4b(0x25f),JSON['stringify'](_0x4b55a9)),W[_0x494e4b(0x2df)](_0x462893);}if(_0x4b55a9!=null&&_0x4b55a9['optIn']){let _0x40851e=_0x4b55a9[_0x494e4b(0x1db)];delete _0x4b55a9[_0x494e4b(0x1db)],localStorage['setItem']('mergn_shopify',JSON['stringify'](_0x4b55a9)),W[_0x494e4b(0x2d7)](_0x40851e);}if(_0x4b55a9!=null&&_0x4b55a9[_0x494e4b(0x226)]){let _0x216c4e=_0x4b55a9[_0x494e4b(0x226)];delete _0x4b55a9[_0x494e4b(0x226)],localStorage[_0x494e4b(0x233)]('mergn_shopify',JSON[_0x494e4b(0x277)](_0x4b55a9)),_0x216c4e[_0x494e4b(0x1b7)](_0x6c6081=>{const _0x526750=_0x494e4b;H['isPopupAction'](_0x6c6081[_0x526750(0x2f6)][_0x526750(0x2aa)])?H[_0x526750(0x1dc)](_0x6c6081):ae[_0x526750(0x21f)](_0x6c6081[_0x526750(0x2f6)][_0x526750(0x2aa)])&&ae['showContentCard'](_0x6c6081);});}}},0x3e8);}),this['storeActionInLocalStorageInternal']=_0x5763fc=>{const _0x37c2b7=_0x1f9a;let _0x5ca1ca=()=>{const _0x475826=_0x1f9a;let _0x2cea76=JSON[_0x475826(0x1a6)](localStorage[_0x475826(0x2b9)](_0x5763fc)||'{}');Object[_0x475826(0x1fa)](_0x2cea76)[_0x475826(0x1b7)](_0x3c229f=>{const _0x1a71c3=_0x475826;_0x2cea76[_0x3c229f]['initialTime']=new Date()[_0x1a71c3(0x2b7)]();}),localStorage[_0x475826(0x233)](_0x5763fc,JSON['stringify'](_0x2cea76));};_0x5ca1ca(),window[_0x37c2b7(0x307)](_0x37c2b7(0x2b6),_0x5ca1ca);},this[_0x59a317(0x1a2)]=({id:_0x313323,localStorageKey:_0x515c07})=>{const _0x456589=_0x59a317;let _0x1fee21=JSON['parse'](localStorage[_0x456589(0x2b9)](_0x515c07)||'{}');_0x1fee21[_0x313323]&&delete _0x1fee21[_0x313323],localStorage[_0x456589(0x233)](_0x515c07,JSON['stringify'](_0x1fee21));},this[_0x59a317(0x2c1)]=({actionCondition:_0x513547,actionMethod:_0x350934,localStorageKey:_0x27f574})=>{const _0x1851e5=_0x59a317;let _0x2035db=JSON['parse'](localStorage[_0x1851e5(0x2b9)](_0x27f574)||'{}');Object[_0x1851e5(0x1fa)](_0x2035db)[_0x1851e5(0x1b7)](_0x1b290e=>{_0x513547(_0x2035db[_0x1b290e])&&_0x350934(_0x2035db[_0x1b290e]);});};}static[_0xbd6474(0x323)](){return d(Z,ue)||I(Z,ue,new Z()),d(Z,ue);}['init'](_0x1c3542,_0x42dc4d){return a(this,null,function*(){const _0x35e38a=_0x1f9a;s(0x1,_0x35e38a(0x1e4)),_0x42dc4d!=null&&_0x42dc4d[_0x35e38a(0x1e2)]&&I(this,Te,!0x0),i(this,p,zt)[_0x35e38a(0x1b0)](this,_0x1c3542);let _0x346cad=this[_0x35e38a(0x302)]();if(_0x346cad===_0x35e38a(0x2e0)||_0x346cad===_0x35e38a(0x2ac)){s(0x2,'Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms');return;}if(yield N[_0x35e38a(0x2fe)](),s(0x1,_0x35e38a(0x1ce)),yield i(this,p,xe)[_0x35e38a(0x1b0)](this,0x3),_0x42dc4d!=null&&_0x42dc4d[_0x35e38a(0x1e2)]&&d(this,We)[_0x35e38a(0x1b0)](this),_0x42dc4d!=null&&_0x42dc4d[_0x35e38a(0x2f3)])try{g[_0x35e38a(0x1bb)]=!0x0,yield this[_0x35e38a(0x2d0)](_0x42dc4d['identity']);}finally{g[_0x35e38a(0x1bb)]=!0x1;}setInterval(()=>a(this,null,function*(){const _0x4947e6=_0x35e38a;s(0x1,_0x4947e6(0x1d8)),yield i(this,p,xe)['call'](this,0x3);}),0x493e0);let _0x53e1d=i(this,p,Se)[_0x35e38a(0x1b0)](this);if(yield this[_0x35e38a(0x2de)](),yield u[_0x35e38a(0x1d7)](),u[_0x35e38a(0x227)]({'eventName':_0x35e38a(0x2a8)}),s(0x1,'Initializing\x20notification\x20service\x20from\x20Base\x20Service'),yield A(_0x35e38a(0x23d),()=>a(this,null,function*(){yield W['init'](_0x53e1d,_0x42dc4d==null?void 0x0:_0x42dc4d['swPath']);})),!(_0x42dc4d!=null&&_0x42dc4d[_0x35e38a(0x1e2)])){yield i(this,p,on)[_0x35e38a(0x1b0)](this);let _0x4a5c85=history[_0x35e38a(0x1fd)];history['pushState']=(..._0x2ba286)=>{const _0x4d9d0e=_0x35e38a;_0x4a5c85[_0x4d9d0e(0x1b1)](history,_0x2ba286),i(this,p,rn)['call'](this);};}s(0x1,_0x35e38a(0x187));});}['setPlatform'](_0x2291cc){I(this,fe,_0x2291cc);}[_0xbd6474(0x205)](_0xf8575f){I(this,he,_0xf8575f);}[_0xbd6474(0x2eb)](_0x51fbb3){I(this,be,_0x51fbb3);}[_0xbd6474(0x2bf)](_0x236cbc){I(this,ye,_0x236cbc);}['getPreviousUrl'](){return d(this,ye);}[_0xbd6474(0x302)](){return d(this,fe);}[_0xbd6474(0x1b9)](){return d(this,he);}['getOperatingSystem'](){return d(this,be);}[_0xbd6474(0x25e)](){const _0x46c7f7=_0xbd6474;localStorage[_0x46c7f7(0x233)]('ttl',''+new Date()[_0x46c7f7(0x2b7)]());}[_0xbd6474(0x237)]({data:_0xe6806b,displayMethod:_0x47ec55,timeValueKey:_0x10d3f7}){const _0x29133b=_0xbd6474;let _0x353021=()=>{const _0x26bb71=_0x1f9a;var _0x2e83dc;let _0x54a144=window['innerHeight'],_0x325b2a=document[_0x26bb71(0x2dd)][_0x26bb71(0x28b)];window[_0x26bb71(0x2c7)]/(_0x325b2a-_0x54a144)*0x64>(((_0x2e83dc=_0xe6806b[_0x10d3f7])==null?void 0x0:_0x2e83dc[_0x26bb71(0x286)])||0x0)&&(window[_0x26bb71(0x2f7)](_0x26bb71(0x28d),_0x353021),_0x47ec55(_0xe6806b));};window[_0x29133b(0x307)](_0x29133b(0x28d),_0x353021);}[_0xbd6474(0x333)]({clearActionMethod:_0xd705b7,data:_0x4bef10,displayMethod:_0x232e4c,idKey:_0x16aa2e,timeValueKey:_0x436934}){const _0x47e681=_0xbd6474;var _0x3ea5e6,_0x2b8c49,_0x43ce4a;let _0x5c88e6=(_0x3ea5e6=_0x4bef10[_0x436934])==null?void 0x0:_0x3ea5e6[_0x47e681(0x286)];((_0x2b8c49=_0x4bef10[_0x436934])==null?void 0x0:_0x2b8c49['duration'])===_0x47e681(0x296)&&(_0x5c88e6=_0x5c88e6*0x3c);let _0x9c924a=_0x4bef10[_0x47e681(0x185)]-0x1f4+(_0x5c88e6||0x0)*0x3e8-new Date()[_0x47e681(0x2b7)]();s(0x1,_0x47e681(0x21a)+_0x4bef10[_0x47e681(0x185)]),s(0x1,_0x47e681(0x1de)+((_0x43ce4a=_0x4bef10[_0x436934])==null?void 0x0:_0x43ce4a[_0x47e681(0x286)])),s(0x1,_0x47e681(0x316)+new Date()[_0x47e681(0x2b7)]()),s(0x1,_0x47e681(0x29b)+_0x9c924a),_0x9c924a>0x0?setTimeout(()=>{_0xd705b7(_0x4bef10[_0x16aa2e]),_0x232e4c(_0x4bef10);},_0x9c924a):(_0xd705b7(_0x4bef10[_0x16aa2e]),_0x232e4c(_0x4bef10));}[_0xbd6474(0x255)](_0x1c2e74,_0xd1d96b,_0x4795f5){const _0x2138f5=_0xbd6474;var _0x5d4079;let _0x43a01b=JSON[_0x2138f5(0x1a6)](localStorage[_0x2138f5(0x2b9)](_0xd1d96b)||'{}'),_0x56fd63=(_0x5d4079=_0x4795f5 in _0x1c2e74&&_0x1c2e74[_0x4795f5])!=null?_0x5d4079:'';_0x56fd63&&(_0x43a01b[_0x56fd63]=Ne(z({},_0x1c2e74),{'initialTime':new Date()[_0x2138f5(0x2b7)]()}),localStorage[_0x2138f5(0x233)](_0xd1d96b,JSON['stringify'](_0x43a01b)));}['checkTTL'](){return a(this,null,function*(){const _0x4ec4e4=_0x1f9a;yield A(_0x4ec4e4(0x336),()=>a(this,null,function*(){const _0x3dbcdb=_0x4ec4e4;if(d(this,Te))return;s(0x1,_0x3dbcdb(0x31b)),C(_0x3dbcdb(0x31b),!0x0),L('Checking\x20TTL\x20Time',!0x0);let _0x537134=localStorage['getItem']('ttl'),_0x4b55ff=!0x1;if(_0x537134){if(_0x4b55ff=i(this,p,Se)[_0x3dbcdb(0x1b0)](this,_0x537134),_0x4b55ff){let _0x400181=localStorage[_0x3dbcdb(0x2b9)](_0x3dbcdb(0x1b3)),_0x5065b0=localStorage[_0x3dbcdb(0x2b9)](_0x3dbcdb(0x219));if(_0x400181&&_0x5065b0){let _0x236eb7=parseInt(_0x5065b0,0xa);u[_0x3dbcdb(0x343)]({'eventName':_0x3dbcdb(0x1ba),'eventProperties':[{'eventProperty':_0x3dbcdb(0x26f),'value':localStorage[_0x3dbcdb(0x2b9)](_0x3dbcdb(0x1b3))},{'eventProperty':_0x3dbcdb(0x203),'value':Number['isInteger'](_0x236eb7)?new Date(_0x236eb7)[_0x3dbcdb(0x22f)]():new Date()[_0x3dbcdb(0x22f)]()}]});}this[_0x3dbcdb(0x2ef)](),localStorage[_0x3dbcdb(0x233)](_0x3dbcdb(0x219),''+new Date()['getTime']());}}else localStorage[_0x3dbcdb(0x233)](_0x3dbcdb(0x219),''+new Date()[_0x3dbcdb(0x2b7)]());(!_0x537134||_0x4b55ff||i(this,p,Qt)[_0x3dbcdb(0x1b0)](this))&&(i(this,p,rt)[_0x3dbcdb(0x1b0)](this)&&i(this,p,Zt)[_0x3dbcdb(0x1b0)](this),i(this,p,nt)[_0x3dbcdb(0x1b0)](this)&&(yield this['setIdentity']()),(i(this,p,Se)[_0x3dbcdb(0x1b0)](this)||i(this,p,et)[_0x3dbcdb(0x1b0)](this))&&(yield i(this,p,tn)[_0x3dbcdb(0x1b0)](this)),yield i(this,p,Xt)[_0x3dbcdb(0x1b0)](this),(i(this,p,Se)[_0x3dbcdb(0x1b0)](this)||i(this,p,tt)[_0x3dbcdb(0x1b0)](this))&&(yield i(this,p,nn)[_0x3dbcdb(0x1b0)](this))),L('Checking\x20TTL\x20Time',!0x1),C(_0x3dbcdb(0x31b),!0x1);}));});}[_0xbd6474(0x2ef)](){const _0x4c4fb=_0xbd6474;localStorage[_0x4c4fb(0x312)](_0x4c4fb(0x257)),localStorage['removeItem'](_0x4c4fb(0x262)),localStorage[_0x4c4fb(0x312)](_0x4c4fb(0x328)),localStorage[_0x4c4fb(0x312)](_0x4c4fb(0x275)),localStorage[_0x4c4fb(0x312)](_0x4c4fb(0x219)),localStorage[_0x4c4fb(0x312)](_0x4c4fb(0x1b3));}[_0xbd6474(0x2d0)](_0x529cad){return a(this,null,function*(){const _0x88b057=_0x1f9a;let _0x53dc50={'deviceId':localStorage[_0x88b057(0x2b9)](_0x88b057(0x19d))||crypto[_0x88b057(0x289)](),'os':this[_0x88b057(0x302)]()};if(_0x529cad)_0x53dc50[_0x88b057(0x2f3)]=_0x529cad;else{if(!_0x529cad&&localStorage[_0x88b057(0x2b9)](_0x88b057(0x320)))return;}try{let _0x4968e9=yield i(this,p,en)[_0x88b057(0x1b0)](this,_0x53dc50);if(_0x4968e9!==void 0x0){localStorage[_0x88b057(0x233)](_0x88b057(0x320),_0x4968e9);try{W[_0x88b057(0x2df)]({'customer':_0x4968e9});}catch(_0xbb7152){}}}catch(_0xca1534){throw new Error('Error\x20setting\x20identity');}});}};ue=new WeakMap(),fe=new WeakMap(),he=new WeakMap(),be=new WeakMap(),ye=new WeakMap(),we=new WeakMap(),Te=new WeakMap(),We=new WeakMap(),p=new WeakSet(),zt=function(_0x57122b){const _0x4d6c18=_0xbd6474;N[_0x4d6c18(0x1b8)](_0x57122b),this[_0x4d6c18(0x245)](i(this,p,Gt)[_0x4d6c18(0x1b0)](this)),this[_0x4d6c18(0x205)](i(this,p,Yt)[_0x4d6c18(0x1b0)](this)),this['setOperatingSystem'](navigator[_0x4d6c18(0x282)]);},Gt=function(){const _0x53a39f=_0xbd6474;var _0x27827d;let _0x169e43=navigator[_0x53a39f(0x282)]['toLowerCase']();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i[_0x53a39f(0x1c8)](_0x169e43)?_0x53a39f(0x2e0):/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i[_0x53a39f(0x1c8)](_0x169e43)?_0x53a39f(0x194):/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i[_0x53a39f(0x1c8)](_0x169e43)?('Notification'in window&&typeof((_0x27827d=window==null?void 0x0:window[_0x53a39f(0x32e)])==null?void 0x0:_0x27827d[_0x53a39f(0x249)])!=_0x53a39f(0x1e6),_0x53a39f(0x194)):/windows|macintosh|linux|x11/i[_0x53a39f(0x1c8)](_0x169e43)?_0x53a39f(0x33c):_0x53a39f(0x2ac);},Yt=function(){const _0x371fca=_0xbd6474;let _0x4c7c1e=navigator[_0x371fca(0x282)],_0x234c81;return _0x4c7c1e[_0x371fca(0x2e7)](_0x371fca(0x290))>-0x1?_0x234c81='Google\x20Chrome':_0x4c7c1e['indexOf'](_0x371fca(0x1fe))>-0x1?_0x234c81=_0x371fca(0x1fe):_0x4c7c1e[_0x371fca(0x2e7)](_0x371fca(0x29a))>-0x1?_0x234c81=_0x371fca(0x224):_0x4c7c1e[_0x371fca(0x2e7)](_0x371fca(0x2cb))>-0x1?_0x234c81=_0x371fca(0x29f):_0x4c7c1e[_0x371fca(0x2e7)](_0x371fca(0x2c2))>-0x1?_0x234c81=_0x371fca(0x25d):_0x234c81='Unknown',_0x234c81;},Se=function(_0x552959){const _0x3af569=_0xbd6474;let _0x491c3c;return _0x552959||(_0x491c3c=localStorage[_0x3af569(0x2b9)]('ttl')),_0x552959||_0x491c3c?new Date()[_0x3af569(0x2b7)]()-parseInt(_0x552959||_0x491c3c||'',0xa)>0x124f80:!0x0;},et=function(){const _0x3325d5=_0xbd6474;return!localStorage[_0x3325d5(0x2b9)](_0x3325d5(0x262));},tt=function(){const _0x220bbf=_0xbd6474;return!localStorage['getItem'](_0x220bbf(0x328));},nt=function(){const _0x42bd5d=_0xbd6474;return!localStorage[_0x42bd5d(0x2b9)](_0x42bd5d(0x320));},rt=function(){const _0x554b0a=_0xbd6474;return!localStorage[_0x554b0a(0x2b9)](_0x554b0a(0x19d));},qt=function(){const _0x3030cf=_0xbd6474;return!localStorage[_0x3030cf(0x2b9)](_0x3030cf(0x1b3));},Qt=function(){const _0x35e8b2=_0xbd6474;return i(this,p,et)[_0x35e8b2(0x1b0)](this)||i(this,p,tt)['call'](this)||i(this,p,nt)[_0x35e8b2(0x1b0)](this)||i(this,p,rt)[_0x35e8b2(0x1b0)](this)||i(this,p,qt)['call'](this);},Zt=function(){const _0x82dc4f=_0xbd6474;let _0x3e22ff=localStorage['getItem'](_0x82dc4f(0x19d));return _0x3e22ff||(_0x3e22ff=crypto[_0x82dc4f(0x289)](),localStorage[_0x82dc4f(0x233)](_0x82dc4f(0x19d),_0x3e22ff)),_0x3e22ff;},Xt=function(){return a(this,null,function*(){yield A('store\x20session',()=>a(this,null,function*(){const _0x5b2d9e=_0x1f9a;let _0x514a60=localStorage['getItem'](_0x5b2d9e(0x1b3));if(!_0x514a60){_0x514a60=crypto[_0x5b2d9e(0x289)](),localStorage[_0x5b2d9e(0x233)](_0x5b2d9e(0x1b3),_0x514a60);let _0x37721b=localStorage[_0x5b2d9e(0x2b9)](_0x5b2d9e(0x219)),_0x435ad9=_0x37721b?parseInt(_0x37721b,0xa):'';yield u[_0x5b2d9e(0x343)]({'eventName':_0x5b2d9e(0x332),'eventProperties':[{'eventProperty':'SESSION_ID','value':localStorage[_0x5b2d9e(0x2b9)](_0x5b2d9e(0x1b3))},{'eventProperty':_0x5b2d9e(0x203),'value':_0x435ad9?new Date(_0x435ad9)[_0x5b2d9e(0x22f)]():new Date()['toISOString']()}]});}}),_0x4d71a9=>{const _0x9b61bd=_0x1f9a;u['recordEvent']({'eventName':_0x9b61bd(0x1d1),'eventProperties':[{'eventProperty':_0x9b61bd(0x2f6),'value':_0x9b61bd(0x265)+_0x4d71a9[_0x9b61bd(0x2f6)]}]},!0x0);});});},en=function(_0x3b7551){return a(this,null,function*(){const _0xd821f5=_0x1f9a;try{return(yield N[_0xd821f5(0x25c)](''+ft+bt,_0x3b7551))[_0xd821f5(0x1d5)];}catch(_0x3ece69){throw new Error(_0xd821f5(0x1a4));}});},tn=function(){return a(this,null,function*(){const _0x12d20f=_0x1f9a;yield u[_0x12d20f(0x2dc)]();});},nn=function(){return a(this,null,function*(){yield me['storeAttributeInLocalStorage']();});},xe=function(_0x11f99d){return a(this,null,function*(){yield A('verify\x20API\x20key',()=>a(this,null,function*(){const _0x2f4c13=_0x1f9a;var _0x500b65;try{let _0xf4e9cb=parseInt(localStorage['getItem']('verifyTTL')||'0',0xa)||0x0;if(!_0xf4e9cb||_0xf4e9cb&&new Date()[_0x2f4c13(0x2b7)]()>_0xf4e9cb){let _0x45618f=yield N[_0x2f4c13(0x1ea)]('/brand');if(!(_0x45618f!=null&&_0x45618f['success']))throw new Error(JSON[_0x2f4c13(0x277)](_0x45618f));localStorage[_0x2f4c13(0x233)](_0x2f4c13(0x32c),(new Date()[_0x2f4c13(0x2b7)]()+0x493e0)[_0x2f4c13(0x2c3)]());}g[_0x2f4c13(0x1af)]=!0x1,g[_0x2f4c13(0x2b8)]=!0x0;}catch(_0x45a0c5){if(N[_0x2f4c13(0x23a)]()==='67'&&(!((_0x500b65=_0x45a0c5==null?void 0x0:_0x45a0c5[_0x2f4c13(0x2f6)])!=null&&_0x500b65['startsWith']('get'))||(_0x45a0c5==null?void 0x0:_0x45a0c5['message'])!=='Error\x20verifying\x20API\x20key')&&u[_0x2f4c13(0x343)]({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':'message','value':_0x2f4c13(0x2cc)+_0x45a0c5[_0x2f4c13(0x2f6)]}]},!0x0),_0x11f99d&&_0x11f99d>=0x1){yield i(this,p,xe)[_0x2f4c13(0x1b0)](this,_0x11f99d-0x1);return;}throw g[_0x2f4c13(0x1af)]=!0x0,new Error(_0x2f4c13(0x17b));}}));});},it=function(){return a(this,null,function*(){const _0x202f3e=_0x1f9a;var _0x37ed66;s(0x1,_0x202f3e(0x2a0));let _0x40429b=(_0x37ed66=window==null?void 0x0:window[_0x202f3e(0x248)])==null?void 0x0:_0x37ed66['href'];this[_0x202f3e(0x2bf)](_0x40429b),u[_0x202f3e(0x227)]({'eventName':_0x202f3e(0x26e)});let _0x4728ec=[];new URLSearchParams(new URL(window[_0x202f3e(0x248)][_0x202f3e(0x264)])[_0x202f3e(0x1d9)])[_0x202f3e(0x1b7)]((_0x5e4ec1,_0x485ade)=>a(this,null,function*(){const _0x5aa31e=_0x202f3e;Pt[_0x5aa31e(0x18f)](_0x485ade)&&_0x4728ec[_0x5aa31e(0x32d)]({'eventProperty':_0x485ade,'value':_0x5e4ec1});})),yield u[_0x202f3e(0x343)]({'eventName':_0x202f3e(0x317),'eventProperties':[{'eventProperty':'URL','value':window[_0x202f3e(0x248)][_0x202f3e(0x261)]},..._0x4728ec]});});},rn=function(){return a(this,null,function*(){const _0x45e042=_0x1f9a;var _0xcbd190;s(0x1,_0x45e042(0x30e));let _0x42785a=(_0xcbd190=window==null?void 0x0:window['location'])==null?void 0x0:_0xcbd190[_0x45e042(0x264)];(this[_0x45e042(0x2f0)]()===null||this['getPreviousUrl']()===void 0x0||_0x42785a!==this[_0x45e042(0x2f0)]())&&(yield i(this,p,it)[_0x45e042(0x1b0)](this));});},on=function(){return a(this,null,function*(){const _0xda2481=_0x1f9a;var _0x584056,_0xde6423;let _0x2377e6=(_0x584056=window==null?void 0x0:window[_0xda2481(0x248)])==null?void 0x0:_0x584056[_0xda2481(0x264)];u[_0xda2481(0x227)]({'eventName':_0xda2481(0x243),'eventProperties':[{'eventProperty':'message','value':(_0x2377e6!==this[_0xda2481(0x2f0)]())+':'+_0x2377e6+':'+this[_0xda2481(0x2f0)]()}]});try{yield i(this,p,it)[_0xda2481(0x1b0)](this);}catch(_0x3e0e33){let _0x1f5f0b=_0x3e0e33&&_0x3e0e33[_0xda2481(0x2f6)]?(_0xde6423=_0x3e0e33==null?void 0x0:_0x3e0e33[_0xda2481(0x2f6)])==null?void 0x0:_0xde6423[_0xda2481(0x1c6)](0x0,0x64):_0xda2481(0x1e6);yield u[_0xda2481(0x227)]({'eventName':_0xda2481(0x1a3),'eventProperties':[{'eventProperty':_0xda2481(0x2f6),'value':''+_0x1f5f0b}]});}});},m(Z,ue);var Xe=Z,E=Xe[_0xbd6474(0x323)](),X,R,sn,ke,an,cn,ln,dn,j=class j{constructor(){const _0x53c2a0=_0xbd6474;m(this,R),this[_0x53c2a0(0x2f1)]=Promise['resolve']();}static['getInstance'](){var _0xd1b5fa;return d(j,X)||(I(j,X,new j()),i(_0xd1b5fa=d(j,X),R,sn)['call'](_0xd1b5fa)),d(j,X);}[_0xbd6474(0x1f5)](_0x317172){const _0x16a918=_0xbd6474;let _0x560d89=JSON[_0x16a918(0x1a6)](localStorage[_0x16a918(0x2b9)](_0x16a918(0x23c))||'[]');_0x560d89[_0x16a918(0x32d)](_0x317172),localStorage[_0x16a918(0x233)](_0x16a918(0x23c),JSON['stringify'](_0x560d89));}[_0xbd6474(0x1d7)](){return a(this,null,function*(){const _0xf49466=_0x1f9a;let _0x45f235=JSON[_0xf49466(0x1a6)](localStorage[_0xf49466(0x2b9)](_0xf49466(0x23c))||'[]');if(Array['isArray'](_0x45f235)){for(let _0x1a00d0 of _0x45f235)yield this[_0xf49466(0x210)](_0x1a00d0);}});}[_0xbd6474(0x343)](_0x510c1e,_0x9d6587){return a(this,null,function*(){const _0x254f5f=_0x1f9a;g[_0x254f5f(0x2b8)]&&!g[_0x254f5f(0x1bb)]?yield i(this,R,ke)['call'](this,_0x510c1e,_0x9d6587):this['pushToQueue'](_0x510c1e);});}[_0xbd6474(0x210)](_0x1cc5af){return a(this,null,function*(){const _0x4ede82=_0x1f9a;try{yield i(this,R,ke)['call'](this,_0x1cc5af);}finally{i(this,R,dn)[_0x4ede82(0x1b0)](this,_0x1cc5af[_0x4ede82(0x2f2)]);}});}['recordDebugEvents'](_0x31e06b){return a(this,null,function*(){const _0x1aea81=_0x1f9a;g[_0x1aea81(0x27d)]===0x4&&(!g[_0x1aea81(0x1da)]||g[_0x1aea81(0x1da)][_0x31e06b[_0x1aea81(0x2f2)]])&&(yield i(this,R,ke)['call'](this,_0x31e06b));});}[_0xbd6474(0x18d)](){let _0x12453e=localStorage['getItem']('events');return _0x12453e?JSON['parse'](_0x12453e):{};}[_0xbd6474(0x2dc)](){return a(this,null,function*(){const _0x33a1be=_0x1f9a;if(!localStorage[_0x33a1be(0x2b9)](_0x33a1be(0x262))){let _0x865fb6=(yield this[_0x33a1be(0x2f8)]())[_0x33a1be(0x1d5)];if(_0x865fb6){localStorage['setItem']('events',JSON[_0x33a1be(0x277)](_0x865fb6));try{W[_0x33a1be(0x2df)]({'events':_0x865fb6});}catch(_0xab279e){}}}});}[_0xbd6474(0x2f8)](){return a(this,null,function*(){const _0x4349e1=_0x1f9a;try{return yield N[_0x4349e1(0x1ea)](''+Me);}catch(_0x4d486a){throw new Error(_0x4349e1(0x258));}});}['postEventRecord'](_0x34678f,_0x1149f8){return a(this,null,function*(){const _0x9bf269=_0x1f9a;let _0x4999b4=null,_0x3bb1f0=null,_0x46c6f8=new AbortController();return this['queue']=this[_0x9bf269(0x2f1)][_0x9bf269(0x183)](()=>a(this,null,function*(){const _0x40a2=_0x9bf269;try{if(_0x34678f[_0x40a2(0x262)]['length']===0x0)throw new Error(_0x40a2(0x192));let _0x55f41b=yield N['post'](_0x40a2(0x21d)+Me+St,_0x34678f,_0x46c6f8[_0x40a2(0x1dd)]);if(_0x55f41b[_0x40a2(0x2fc)])return _0x3bb1f0=_0x55f41b,_0x55f41b;if(_0x55f41b[_0x40a2(0x2f6)]===_0x40a2(0x188)+localStorage['getItem'](_0x40a2(0x320))+_0x40a2(0x24b))throw localStorage[_0x40a2(0x312)](_0x40a2(0x320)),new Error(_0x40a2(0x1c2));}catch(_0x133e61){throw s(0x2,'Error\x20posting\x20event\x20record:'),s(0x2,'name:\x20'+_0x133e61[_0x40a2(0x2aa)]),s(0x2,_0x40a2(0x231)+_0x133e61['message']),(_0x133e61[_0x40a2(0x2aa)]===_0x40a2(0x26d)||_0x133e61[_0x40a2(0x2aa)]===_0x40a2(0x239)&&_0x133e61[_0x40a2(0x2f6)]===_0x40a2(0x28f))&&(s(0x2,_0x40a2(0x1bc)),_0x1149f8&&i(this,R,ln)[_0x40a2(0x1b0)](this,_0x1149f8)),_0x4999b4=new Error('Error\x20posting\x20event\x20record'),_0x133e61;}return null;}))[_0x9bf269(0x24c)](()=>{}),this[_0x9bf269(0x2f1)][_0x9bf269(0x183)](()=>{if(_0x4999b4)throw _0x4999b4;return _0x3bb1f0;});});}};X=new WeakMap(),R=new WeakSet(),sn=function(){return a(this,null,function*(){});},ke=function(_0x554183,_0x74bb0f){return a(this,null,function*(){const _0x30310a=_0x1f9a;yield A(_0x30310a(0x31f),()=>a(this,null,function*(){const _0x6601d6=_0x30310a;var _0x4c7b66,_0x5dbac0,_0x2cbf1e,_0x5b2418;let {campaignCustomerInstanceId:_0x174e00,campaignId:_0xdf2170,eventName:_0x1ad276,eventProperties:_0x53381c,name:_0x219ca8,web_optin_instance_id:_0x3b54f6}=_0x554183;s(0x1,_0x6601d6(0x252)),C(_0x6601d6(0x1ed),!0x0),L(_0x6601d6(0x26c),!0x0),s(0x1,_0x6601d6(0x195)),s(0x1,{'campaignCustomerInstanceId':_0x174e00,'eventName':_0x1ad276,'eventProperties':_0x53381c,'name':_0x219ca8,'web_optin_instance_id':_0x3b54f6});let _0xecd666=E[_0x6601d6(0x302)]();if(_0xecd666===_0x6601d6(0x2e0)||_0xecd666===_0x6601d6(0x2ac))throw new Error('Invalid\x20platform');_0x1ad276!==_0x6601d6(0x1ba)&&(yield E[_0x6601d6(0x2de)]());let _0x44f166=[];_0x53381c&&_0x44f166[_0x6601d6(0x32d)](..._0x53381c),_0x44f166[_0x6601d6(0x32d)]({'eventProperty':'Platform','value':_0xecd666}),_0x44f166[_0x6601d6(0x32d)]({'eventProperty':_0x6601d6(0x327),'value':E[_0x6601d6(0x321)]()}),_0x44f166[_0x6601d6(0x32d)]({'eventProperty':_0x6601d6(0x334),'value':E[_0x6601d6(0x1b9)]()});let _0x394287=this[_0x6601d6(0x18d)](),_0x41f667=i(this,R,an)[_0x6601d6(0x1b0)](this,_0x394287,_0x1ad276,_0x44f166);if(typeof _0x41f667==_0x6601d6(0x1a7)){s(0x2,_0x41f667);return;}E[_0x6601d6(0x25e)]();let {id:_0x1ee3af}=_0x394287[_0x1ad276],_0x4a432c=i(this,R,cn)[_0x6601d6(0x1b0)](this,z(Ne(z(z(z({},_0x174e00?{'campaignCustomerInstanceId':_0x174e00}:{}),_0xdf2170?{'campaignId':_0xdf2170}:{}),_0x3b54f6?{'web_optin_instance_id':_0x3b54f6}:{}),{'eventId':_0x1ee3af,'eventProperties':_0x41f667,'sessionId':localStorage['getItem'](_0x6601d6(0x1b3))||''}),_0x219ca8?{'name':_0x219ca8}:{}));if(g['offline']){let _0x337c76=JSON[_0x6601d6(0x1a6)](localStorage[_0x6601d6(0x2b9)](_0x6601d6(0x275))||'[]');_0x337c76['length']<=0x32&&(_0x337c76[_0x6601d6(0x32d)](..._0x4a432c[_0x6601d6(0x262)]),localStorage[_0x6601d6(0x233)](_0x6601d6(0x275),JSON[_0x6601d6(0x277)](_0x337c76)));return;}let _0x412399=yield this[_0x6601d6(0x232)](_0x4a432c,_0x554183);(_0x4c7b66=_0x412399==null?void 0x0:_0x412399[_0x6601d6(0x1d5)])!=null&&_0x4c7b66[_0x6601d6(0x1db)]?(yield this[_0x6601d6(0x227)]({'eventName':_0x6601d6(0x28e)}),W[_0x6601d6(0x2d7)](_0x412399['data'][_0x6601d6(0x1db)])):_0x1ad276===_0x6601d6(0x317)&&(yield this[_0x6601d6(0x227)]({'eventName':_0x6601d6(0x1ac),'eventProperties':[{'eventProperty':_0x6601d6(0x2f6),'value':''+(_0x6601d6(0x32e)in window&&typeof((_0x5dbac0=window==null?void 0x0:window['Notification'])==null?void 0x0:_0x5dbac0['permission'])!=_0x6601d6(0x1e6))}]})),(_0x5b2418=(_0x2cbf1e=_0x412399==null?void 0x0:_0x412399[_0x6601d6(0x1d5)])==null?void 0x0:_0x2cbf1e[_0x6601d6(0x226)])==null||_0x5b2418[_0x6601d6(0x1b7)](_0x3d7706=>{const _0x126de2=_0x6601d6;H[_0x126de2(0x1e5)](_0x3d7706[_0x126de2(0x2f6)][_0x126de2(0x2aa)])?H[_0x126de2(0x1dc)](_0x3d7706):ae[_0x126de2(0x21f)](_0x3d7706[_0x126de2(0x2f6)][_0x126de2(0x2aa)])&&ae[_0x126de2(0x1ee)](_0x3d7706);}),L(_0x6601d6(0x26c),!0x1),C('Recording\x20event',!0x1);}),_0x5fc6f2=>{const _0xb11e9d=_0x30310a;this[_0xb11e9d(0x343)]({'eventName':_0xb11e9d(0x1d1),'eventProperties':[{'eventProperty':'message','value':'record\x20event\x20-\x20'+_0x554183+'\x20-\x20'+_0x5fc6f2[_0xb11e9d(0x2f6)]}]},!0x0);},_0x74bb0f);});},an=function(_0x48089e,_0x2c0032,_0xe28391){const _0x433d20=_0xbd6474;if(!Object[_0x433d20(0x2a7)][_0x433d20(0x308)][_0x433d20(0x1b0)](_0x48089e,_0x2c0032))return _0x433d20(0x326)+_0x2c0032+_0x433d20(0x19f);if(!_0xe28391)return[];let _0x23b9e1=_0x48089e[_0x2c0032];if(!(_0x23b9e1!=null&&_0x23b9e1[_0x433d20(0x2b3)]))return _0x433d20(0x326)+_0x2c0032+_0x433d20(0x260);let _0x17b49e=_0xe28391[_0x433d20(0x2d1)](({eventProperty:_0x201db9})=>!Object[_0x433d20(0x2a7)]['hasOwnProperty']['call'](_0x23b9e1[_0x433d20(0x2b3)],_0x201db9))[_0x433d20(0x19e)](({eventProperty:_0x4061fd})=>_0x4061fd);return _0x17b49e[_0x433d20(0x212)]>0x0?_0x433d20(0x326)+_0x2c0032+_0x433d20(0x33e)+_0x17b49e[_0x433d20(0x32b)](',\x20')+'.':_0xe28391['map'](({eventProperty:_0x98048c,value:_0x56fe90})=>({'eventPropertyId':_0x23b9e1[_0x433d20(0x2b3)][_0x98048c]['id'],'value':_0x56fe90}));},cn=function(_0xc7daf3){const _0x201afc=_0xbd6474;return{'customerId':localStorage[_0x201afc(0x2b9)](_0x201afc(0x320))||'','deviceId':localStorage['getItem']('uniqueIdentity')||'','events':[_0xc7daf3]};},ln=function(_0x25e45){const _0x2f142e=_0xbd6474;s(0x1,_0x2f142e(0x272)),s(0x1,_0x25e45);let _0x23c74b=localStorage[_0x2f142e(0x2b9)](_0x2f142e(0x23c));_0x23c74b&&_0x23c74b!=='undefined'?(_0x23c74b=JSON[_0x2f142e(0x1a6)](_0x23c74b),_0x23c74b[_0x2f142e(0x32d)](_0x25e45)):_0x23c74b=[_0x25e45],localStorage[_0x2f142e(0x233)]('preInitializedEvents',JSON['stringify'](_0x23c74b));},dn=function(_0x211039){const _0x57e10f=_0xbd6474;let _0x103d97=JSON['parse'](localStorage[_0x57e10f(0x2b9)](_0x57e10f(0x23c))||'[]'),_0xd812b8=_0x103d97[_0x57e10f(0x238)](_0x59cc52=>_0x59cc52['eventName']===_0x211039);_0xd812b8>=0x0&&_0x103d97[_0x57e10f(0x2b0)](_0xd812b8,0x1),localStorage['setItem'](_0x57e10f(0x23c),JSON[_0x57e10f(0x277)](_0x103d97));},m(j,X);var ot=j,u=ot[_0xbd6474(0x323)](),g=class extends Error{constructor(_0x3f7cd4){const _0x1a0356=_0xbd6474;super(_0x3f7cd4),this['name']=_0x1a0356(0x2cf);}};function _0x46d0(){const _0x1cbf79=['resolve','ContentCard\x20already\x20in\x20cache','Firefox','Time\x20difference:\x20','hidden','getOwnPropertyDescriptor','Recording\x20attribute\x20Time','Microsoft\x20Edge','Performing\x20viewed\x20web\x20page\x20event','style','/set-attribute','Denied\x20Web\x20Push\x20Soft-ask','Service\x20Worker\x20ready','getRegistrations','__esModule','prototype','base_init','User\x20is\x20subscribed','name','Reachability\x20Push\x20Web','Unknown','enumerable','100%','overflow','splice','9BSYibl','offline','eventProperty','load','101497lXNghT','beforeunload','getTime','isInitialized','getItem','gad_source','Popup\x20already\x20displayed','read\x20from\x20private\x20field','requestPermission','2798916kQAoho','setPreviousUrl','record\x20event','loadActionInLocalStorage','MSIE','toString','utm_term','Recording\x20attribute','/device/add-device-token','scrollY','Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203','values','UTM_TERM','Edg','verifyAPIKey\x20-\x20','close','Checking\x20for\x20existing\x20subscription','MergnError','setIdentity','filter','/event','init','postMessage','serviceWorker','User\x20denied\x20the\x20notification\x20permission.','showNotification','\x0abackground-color:\x20','update','write\x20to\x20private\x20field','Mergn\x20SDK\x20Initialized','storeEventsAndPropertiesInLocalStorage','documentElement','checkTTL','pushMessageToSW','Crawlers','group','fetchAttributeData','ContentCard\x20already\x20displayed','.u-popup-overlay','add','divId','indexOf','/brand/get-web-push-public-key','OriginateFrom:\x20','No\x20existing\x20subscription\x20found','setOperatingSystem','INFO','Allowed\x20Web\x20Push\x20Subscription','Attribute\x20','clearLocalStorage','getPreviousUrl','queue','eventName','identity','161KUryAH','campaignId','message','removeEventListener','fetchEventData','NONE','Service\x20Worker\x20registration\x20is\x20available','init_condition','success','zIndex','syncRealWorldTime','ContentCard','attributeValue','Mergn\x20is\x20loading!','getPlatform','remove','recordAttribute','viewed','https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api','addEventListener','hasOwnProperty','Viewed\x20Web\x20Push\x20Soft-ask','Popup\x20overlay\x20element\x20found','height',';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a','outerHTML','Tracking\x20page\x20change','info','centered-image','getElementById','removeItem','contentCard_container_','Pushing\x20message\x20to\x20service\x20worker','className','Current\x20time:\x20','Viewed\x20Webpage','getOwnPropertySymbols','banner_title','loadContentCardEventActionInLocalStorage','Checking\x20TTL','cssText','Failed\x20to\x20subscribe\x20the\x20user','function','#\x20record\x20event','customer','getOperatingSystem','querySelectorAll','getInstance','application/json','utm_medium','Event\x20','operating-system','attributes','notification_data','99999999','join','verifyTTL','push','Notification','\x20-\x20','textContent','Logging\x20in','Web\x20Session\x20Started','showDelayedAction','os-version','button_1','#\x20check\x20TTL','entry_time_value','\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20','top','reject','width','Web','banner_color','\x20has\x20invalid\x20eventProperties:\x20','already_registered','error','Attribute\x20value\x20is\x20required','default','recordEvent','The\x20user\x20has\x20blocked\x20notifications.','backgroundColor','preInitializedAttributes','Content\x20Card\x20View','Error\x20verifying\x20API\x20key','[id^=\x22u_content_form_\x22]','Service\x20Worker\x20registration\x20failed:','mergnWebPushPopup','Notification\x20already\x20in\x20cache','/customer','web_push_action','ALL','then','Failed\x20to\x20check\x20notification\x20permission','initialTime','object','tracking\x20page\x20change\x20register','Customer\x20with\x20id\x20','Service\x20Worker\x20registered','color','push_manager','src','getStoredEvents','title','has','/mergn-sw.js','UTCDate','No\x20events\x20to\x20record','number','Mobile','Event\x20Payload','\x20has\x20invalid\x20attributeProperties:\x20','button_2',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','getOwnPropertyNames','\x0aMergnError:\x20','important','99168iWJiPt','uniqueIdentity','map','\x20is\x20not\x20valid.','form','utm_campaign','clearActionInLocalStorage','vwp_error','Error\x20posting\x20identity\x20data','/attribute','parse','string','Mergn\x20SDK\x20is\x20disabled!','logo','setDebugLevel','/record-event','no_optin','Closed\x20Web\x20Push\x20Subscription','\x0aUnexpected\x20error:\x20','disableSDK','call','apply','Service\x20Worker\x20registration','session','Turned\x20Off\x20Notification','entry_time','setProperty','forEach','updateAPIKey','getOSVersion','Web\x20Session\x20Concluded','loading','Request\x20aborted','submit','ERROR:\x20','12572570PcYQff','type','Failed\x20to\x20request\x20notification\x20permission','Re\x20initializing\x20customer\x20Id','storeActionInLocalStorageInternal','text','defineProperty','substring','button','test','button-container','campaignCustomerInstanceId','SCROLL','UTM_CONTENT','left','Verifying\x20API\x20Key','createElement','UTM_SOURCE','Debug\x20Event','banner_image','propertyIsEnumerable','getOwnPropertyDescriptors','data','Displayed\x20Web\x20Push\x20Subscription','recordEventsFromQueue','Verifying\x20API\x20Key\x20after\x20timeout','search','recordDebugEventsToggle','optIn','showPopup','signal','Time\x20value:\x20','Popup\x20View','mergn-column-25','auto','shopify','Initializing\x20Notification\x20Service','Initializing\x20base\x20service','isPopupAction','undefined','DEBUG','done','defineProperties','get','popup_container_','text_color','Recording\x20event','showContentCard','Image','\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a','1HFFMsA','time','DELAY','getCurrentUTCDate','pushToQueue','apiKey','pushManager','brandId','\x20Time','keys','active','Attribute\x20Name:\x20','pushState','Safari','loadWebPushActionInLocalStorage','getVersion','display','POST','SESSION_CREATED','ERROR','setOSVersion','PushManager','Notification\x20permission:\x20','Mergn\x20is\x20offline!','\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.','\x0aposition:\x20fixed;\x0atop:\x200;\x0aleft:\x200;\x0awidth:\x20100%;\x0aheight:\x20100%;\x0abackground-color:\x20rgba(0,\x200,\x200,\x200.5);\x0az-index:\x2099999999999;\x0adisplay:\x20flex;\x0ajustify-content:\x20center;\x0aalign-items:\x20start;\x0a','button-2','should_set_identity','bind','fbclid','login','recordEventPreInitialized','IMMEDIATELY','length','Form\x20Submit','\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0adisplay:\x20block;\x0amargin-left:\x20auto;\x0amargin-right:\x20auto;\x0aborder-radius:\x2010px;\x0amax-width:\x20350px;\x0aaspect-ratio:\x202\x20/\x201;\x0a','register','storeAttributeInLocalStorage','isArray','getAttribute','ttl','Initial\x20time:\x20','3252ADFeSy','innerHTML','/v2','fixed','isContentCardAction','Initializing\x20Mergn\x20SDK','mergn-overlay','5984VWshzJ','.u-popup-container\x20img','Mozilla\x20Firefox','\x20-\x20\x20','campaigns','recordDebugEvents','\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a','1.0.122','/set-identity','PUT','click',';\x0acolor:\x20','gclid','toISOString','Campaign\x20Id','message:\x20','postEventRecord','setItem','Cannot\x20','\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set','showAfterScrollAction','findIndex','TypeError','getBrandId','259586mkapSO','preInitializedEvents','notification\x20service','Popup','Failed\x20to\x20load','getAPIKey','banner_design','timeEnd','show_notification_error','Logging\x20out','setPlatform','check_permission','.u-close-button','location','permission','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','\x20not\x20exists','catch','alt','put','Image\x20Click','\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a','Close\x20Click','#\x20Recording\x20event','UTM_MEDIUM','[id^=\x22u_content_button_\x22]','storeActionInLocalStorage','online','action','Error\x20fetching\x20event\x20data','body','attributeProperty','web_optin_instance_id','post','Internet\x20Explorer','updateSessionCreated','mergn_shopify','\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.','pathname','events','mergn-column-75','href','store\x20session\x20-\x20','div','json','appendChild','.u-popup-container','utm_content','GCLID','Recording\x20event\x20Time','AbortError','pre_vwp','SESSION_ID','Error\x20fetching\x20attribute\x20data','\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a','Adding\x20to\x20pre-initialized\x20event:','onLine','denied','offlineEvents','Error\x20posting\x20attribute\x20record','stringify','campaignEntryTimeValue','INFO:\x20','attributeName','subscribed','utm_source','debugLevel','2357850QUwaMY','Failed\x20to\x20sync\x20real-world\x20time','logout','Turned\x20Off\x20Notification\x20Reset\x20Permission','userAgent','getSubscription','User\x20closed\x20the\x20notification\x20permission\x20dialog.','querySelector','value','#\x20recordAttribute','lastSyncTime','randomUUID','FBCLID','scrollHeight','The\x20user\x20has\x20already\x20enabled\x20notifications.','scroll','optin_data','Failed\x20to\x20fetch','Chrome','block','295fVvmFd','Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported','service_worker','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','min','pop'];_0x46d0=function(){return _0x1cbf79;};return _0x46d0();}g[_0xbd6474(0x1af)]=!0x1,g[_0xbd6474(0x2b2)]=!navigator[_0xbd6474(0x273)],g[_0xbd6474(0x27d)]=0x0,g['isInitialized']=!0x1,g[_0xbd6474(0x1bb)]=!0x1;var bn=(_0x3705be,_0x47879d)=>{const _0x5be4ad=_0xbd6474;_0x47879d instanceof g?s(0x2,_0x5be4ad(0x2e9)+_0x3705be+_0x5be4ad(0x19a)+_0x47879d['message']):_0x47879d instanceof Error?s(0x2,'OriginateFrom:\x20'+_0x3705be+_0x5be4ad(0x1ae)+_0x47879d['message']):s(0x2,_0x5be4ad(0x2e9)+_0x3705be+_0x5be4ad(0x1ae)+String(_0x47879d));},A=(_0x37ecc1,_0x49f8f1,_0xc3dce4,_0x1ebe8f=!0x1)=>a(void 0x0,null,function*(){const _0x12a8e8=_0xbd6474;try{C(_0x37ecc1,!0x0),L(_0x37ecc1+_0x12a8e8(0x1f9),!0x0);try{if(g['disableSDK'])throw new g(_0x12a8e8(0x1a8));if(_0x37ecc1!==_0x12a8e8(0x2c0)&&g[_0x12a8e8(0x2b2)])throw new g(_0x12a8e8(0x208));if(_0x37ecc1!==_0x12a8e8(0x2d3)&&_0x37ecc1!=='verify\x20API\x20key'&&_0x37ecc1!=='record\x20event'&&_0x37ecc1!==_0x12a8e8(0x304)&&!g['isInitialized'])throw new g('Mergn\x20not\x20initialized!');if(_0x37ecc1!=='login'&&g[_0x12a8e8(0x1bb)])throw new g(_0x12a8e8(0x301));return yield _0x49f8f1();}catch(_0x5ae52a){return _0xc3dce4?_0xc3dce4(_0x5ae52a):(g[_0x12a8e8(0x27d)]===0x2||g[_0x12a8e8(0x27d)]===0x3)&&bn(_0x37ecc1,_0x5ae52a),!_0x1ebe8f&&N[_0x12a8e8(0x23a)]()==='67'&&_0x5ae52a[_0x12a8e8(0x2f6)]!=='Failed\x20to\x20fetch'&&u[_0x12a8e8(0x343)]({'eventName':_0x12a8e8(0x1d1),'eventProperties':[{'eventProperty':_0x12a8e8(0x2f6),'value':_0x37ecc1+_0x12a8e8(0x32f)+_0x5ae52a[_0x12a8e8(0x2f6)]}]},!0x0),null;}finally{L(_0x37ecc1+_0x12a8e8(0x1f9),!0x1),C(_0x37ecc1,!0x1);}}catch(_0x1f425b){return null;}}),U=(_0x2e32e9=>(_0x2e32e9[_0x2e32e9[_0xbd6474(0x2f9)]=0x0]=_0xbd6474(0x2f9),_0x2e32e9[_0x2e32e9[_0xbd6474(0x2ec)]=0x1]=_0xbd6474(0x2ec),_0x2e32e9[_0x2e32e9['ERROR']=0x2]=_0xbd6474(0x204),_0x2e32e9[_0x2e32e9[_0xbd6474(0x182)]=0x3]='ALL',_0x2e32e9[_0x2e32e9[_0xbd6474(0x1e7)]=0x4]='DEBUG',_0x2e32e9))(U||{}),s=(_0x14013f,_0x153d1f)=>{const _0x553442=_0xbd6474;g[_0x553442(0x27d)]!==0x0&&(g['debugLevel']>=0x3?_0x14013f===0x1?console[_0x553442(0x30f)](_0x553442(0x279)+new Date()[_0x553442(0x22f)](),_0x153d1f):_0x14013f===0x2&&console[_0x553442(0x340)]('ERROR:\x20'+new Date()['toISOString'](),_0x153d1f):g[_0x553442(0x27d)]===0x1&&_0x14013f===0x1?console['info']('INFO:\x20'+new Date()[_0x553442(0x22f)](),_0x153d1f):g['debugLevel']===0x2&&_0x14013f===0x2&&console[_0x553442(0x340)](_0x553442(0x1be)+new Date()[_0x553442(0x22f)](),_0x153d1f));},L=(_0x57b3ed,_0x7c4711)=>{const _0x3a9dc1=_0xbd6474;g[_0x3a9dc1(0x27d)]!==0x0&&(_0x7c4711?console[_0x3a9dc1(0x1f2)](_0x57b3ed):console[_0x3a9dc1(0x242)](_0x57b3ed));},C=(_0x3d017c,_0x534a3b)=>{const _0x15cb9b=_0xbd6474;g[_0x15cb9b(0x27d)]!==0x0&&(_0x534a3b?console[_0x15cb9b(0x2e1)](_0x3d017c):console['groupEnd']());},pe,ee=class ee{constructor(){}static[_0xbd6474(0x323)](){return d(ee,pe)||I(ee,pe,new ee()),d(ee,pe);}[_0xbd6474(0x2d3)](_0x2e91fd,_0x20abbc){setTimeout(()=>{A('init',()=>a(this,null,function*(){const _0xe51b96=_0x1f9a;s(0x1,_0xe51b96(0x220)),yield E[_0xe51b96(0x2d3)](_0x2e91fd,_0x20abbc),u['recordDebugEvents']({'eventName':'mergn_init'}),s(0x1,_0xe51b96(0x2db));let _0x1059df=JSON['parse'](localStorage[_0xe51b96(0x2b9)](_0xe51b96(0x179))||'[]');Array['isArray'](_0x1059df)&&_0x1059df[_0xe51b96(0x1b7)]((_0x1cf2cd,_0x57fc3e)=>a(this,null,function*(){const _0x213114=_0xe51b96;yield me['recordAttribute'](_0x1cf2cd[_0x213114(0x27a)],_0x1cf2cd[_0x213114(0x300)]),_0x1059df['splice'](_0x57fc3e,0x1),localStorage[_0x213114(0x233)](_0x213114(0x179),JSON[_0x213114(0x277)](_0x1059df));})),window[_0xe51b96(0x307)](_0xe51b96(0x256),()=>a(this,null,function*(){const _0x21451e=_0xe51b96;g[_0x21451e(0x2b2)]=!0x1;let _0x378fb1=JSON[_0x21451e(0x1a6)](localStorage[_0x21451e(0x2b9)](_0x21451e(0x275))||'[]');Array[_0x21451e(0x217)](_0x378fb1)&&(yield u[_0x21451e(0x232)]({'customerId':localStorage['getItem'](_0x21451e(0x320))||'','deviceId':localStorage[_0x21451e(0x2b9)](_0x21451e(0x19d))||'','events':_0x378fb1}),localStorage['removeItem'](_0x21451e(0x275))),E[_0x21451e(0x2de)](),E[_0x21451e(0x25e)]();})),window[_0xe51b96(0x307)](_0xe51b96(0x2b2),()=>{const _0x35cac3=_0xe51b96;g[_0x35cac3(0x2b2)]=!0x0;}),window[_0xe51b96(0x307)](_0xe51b96(0x2b4),()=>{const _0x4c36ac=_0xe51b96;H['loadPopupEventActionInLocalStorage'](),W[_0x4c36ac(0x1ff)]();});}));});}[_0xbd6474(0x1aa)](_0x55f36c,_0x16b196){const _0x5e1606=_0xbd6474;if(!(_0x55f36c in U)){console[_0x5e1606(0x340)](_0x5e1606(0x2c8));return;}g[_0x5e1606(0x1da)]=_0x16b196||{},g[_0x5e1606(0x27d)]=_0x55f36c;try{W[_0x5e1606(0x2df)]({'debugLevel':_0x55f36c});}catch(_0x1255d0){}}[_0xbd6474(0x304)](_0x176c9c,_0x5457ab){return a(this,null,function*(){return new Promise((_0x3dec92,_0x6e485b)=>{setTimeout(()=>a(this,null,function*(){const _0x403276=_0x1f9a;try{yield A(_0x403276(0x304),()=>a(this,null,function*(){const _0x113f38=_0x403276;let _0x91c39b;Array[_0x113f38(0x217)](_0x5457ab)?_0x91c39b=JSON[_0x113f38(0x277)](_0x5457ab):typeof _0x5457ab==_0x113f38(0x193)?_0x91c39b=''+_0x5457ab:_0x91c39b=_0x5457ab,s(0x1,_0x113f38(0x2c5)),s(0x1,_0x113f38(0x1fc)+_0x176c9c+',\x20Attribute\x20Value:\x20'+_0x91c39b);let _0x15b93a=JSON[_0x113f38(0x1a6)](localStorage[_0x113f38(0x2b9)]('preInitializedAttributes')||'[]');_0x15b93a['push']({'attributeName':_0x176c9c,'attrValueStringified':_0x91c39b}),localStorage['setItem'](_0x113f38(0x179),JSON['stringify'](_0x15b93a)),g[_0x113f38(0x2b8)]&&(yield me['recordAttribute'](_0x176c9c,_0x91c39b));})),_0x3dec92();}catch(_0x4ba815){_0x6e485b(_0x4ba815);}}));});});}[_0xbd6474(0x20f)](_0x5ea534){return a(this,null,function*(){return new Promise((_0xc15a73,_0x37bda3)=>{setTimeout(()=>a(this,null,function*(){const _0x308c63=_0x1f9a;try{yield A(_0x308c63(0x20f),()=>a(this,null,function*(){const _0x55d751=_0x308c63;s(0x1,_0x55d751(0x331)),s(0x1,'Identity:\x20'+_0x5ea534),g[_0x55d751(0x1bb)]=!0x0,yield E[_0x55d751(0x2d0)](_0x5ea534);})),_0xc15a73();}catch(_0x1649be){_0x37bda3(_0x1649be);}finally{g[_0x308c63(0x1bb)]=!0x1,yield u[_0x308c63(0x1d7)]();}}));});});}[_0xbd6474(0x280)](){setTimeout(()=>{const _0x34481a=_0x1f9a;A(_0x34481a(0x280),()=>a(this,null,function*(){const _0x5aa1c2=_0x34481a;s(0x1,_0x5aa1c2(0x244)),E['clearLocalStorage']();}));});}[_0xbd6474(0x343)](_0xcf4ef7,_0x281be2){return a(this,null,function*(){return new Promise((_0x1606a4,_0x35cb67)=>{setTimeout(()=>a(this,null,function*(){const _0xe04024=_0x1f9a;try{yield A(_0xe04024(0x2c0),()=>a(this,null,function*(){const _0x95032b=_0xe04024;s(0x1,_0x95032b(0x1ed)),s(0x1,'Event\x20Payload:\x0a\x20'+{'eventName':_0xcf4ef7,'eventProperties':_0x281be2}),yield u['recordEvent']({'eventName':_0xcf4ef7,'eventProperties':_0x281be2});})),_0x1606a4();}catch(_0x49e224){_0x35cb67(_0x49e224);}}));});});}[_0xbd6474(0x200)](){return vt;}};pe=new WeakMap(),m(ee,pe);var st=ee,at=st['getInstance']();typeof window!=_0xbd6474(0x1e6)&&(window['mergn']=at);var yn=at;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ const _0x32fca5=_0x96f8;(function(_0x36e8b7,_0x26c83f){const _0x44377f=_0x96f8,_0x4649ec=_0x36e8b7();while(!![]){try{const _0x48db29=parseInt(_0x44377f(0x2cb))/0x1*(parseInt(_0x44377f(0x1ae))/0x2)+-parseInt(_0x44377f(0x29b))/0x3*(-parseInt(_0x44377f(0x2d5))/0x4)+parseInt(_0x44377f(0x269))/0x5+-parseInt(_0x44377f(0x1a5))/0x6+-parseInt(_0x44377f(0x270))/0x7*(parseInt(_0x44377f(0x343))/0x8)+-parseInt(_0x44377f(0x29f))/0x9+parseInt(_0x44377f(0x1eb))/0xa*(parseInt(_0x44377f(0x265))/0xb);if(_0x48db29===_0x26c83f)break;else _0x4649ec['push'](_0x4649ec['shift']());}catch(_0x381d89){_0x4649ec['push'](_0x4649ec['shift']());}}}(_0x478f,0x6b867));var ln=Object[_0x32fca5(0x1f4)],dn=Object[_0x32fca5(0x286)],un=Object['getOwnPropertyDescriptors'],ut=Object[_0x32fca5(0x1f7)],pn=Object['prototype']['hasOwnProperty'],gn=Object[_0x32fca5(0x2b1)][_0x32fca5(0x340)],gt=_0x16f74c=>{throw TypeError(_0x16f74c);},pt=(_0x38046b,_0x4accf7,_0x3a152d)=>_0x4accf7 in _0x38046b?ln(_0x38046b,_0x4accf7,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x3a152d}):_0x38046b[_0x4accf7]=_0x3a152d,z=(_0x3df93c,_0x485cfe)=>{const _0x194746=_0x32fca5;for(var _0x131f52 in _0x485cfe||(_0x485cfe={}))pn[_0x194746(0x1a0)](_0x485cfe,_0x131f52)&&pt(_0x3df93c,_0x131f52,_0x485cfe[_0x131f52]);if(ut){for(var _0x131f52 of ut(_0x485cfe))gn[_0x194746(0x1a0)](_0x485cfe,_0x131f52)&&pt(_0x3df93c,_0x131f52,_0x485cfe[_0x131f52]);}return _0x3df93c;},Pe=(_0x3a7665,_0x54d85a)=>dn(_0x3a7665,un(_0x54d85a)),ke=(_0x6f39a5,_0x39c9f5,_0x53bfaa)=>_0x39c9f5[_0x32fca5(0x2b4)](_0x6f39a5)||gt(_0x32fca5(0x1c7)+_0x53bfaa),d=(_0x592843,_0x150236,_0x169bf5)=>(ke(_0x592843,_0x150236,_0x32fca5(0x2e5)),_0x169bf5?_0x169bf5[_0x32fca5(0x1a0)](_0x592843):_0x150236[_0x32fca5(0x1e1)](_0x592843)),m=(_0x49be2a,_0x1c0ea4,_0x3bea0b)=>_0x1c0ea4['has'](_0x49be2a)?gt(_0x32fca5(0x1bc)):_0x1c0ea4 instanceof WeakSet?_0x1c0ea4[_0x32fca5(0x208)](_0x49be2a):_0x1c0ea4[_0x32fca5(0x328)](_0x49be2a,_0x3bea0b),I=(_0x12d5bc,_0x273c99,_0x250485,_0x16acdb)=>(ke(_0x12d5bc,_0x273c99,_0x32fca5(0x255)),_0x16acdb?_0x16acdb[_0x32fca5(0x1a0)](_0x12d5bc,_0x250485):_0x273c99['set'](_0x12d5bc,_0x250485),_0x250485),i=(_0x50dc70,_0x189a0b,_0x1718b0)=>(ke(_0x50dc70,_0x189a0b,_0x32fca5(0x213)),_0x1718b0),a=(_0x41ac8e,_0x26c6ba,_0x221cb0)=>new Promise((_0x31f39b,_0x2067ff)=>{const _0x6aa6d0=_0x32fca5;var _0x1b5ff8=_0x571cb0=>{const _0x435068=_0x96f8;try{_0xce9b7a(_0x221cb0[_0x435068(0x331)](_0x571cb0));}catch(_0x406275){_0x2067ff(_0x406275);}},_0xa3ba81=_0x351eaa=>{const _0x11d2e0=_0x96f8;try{_0xce9b7a(_0x221cb0[_0x11d2e0(0x2e9)](_0x351eaa));}catch(_0x309019){_0x2067ff(_0x309019);}},_0xce9b7a=_0x2daac6=>_0x2daac6[_0x6aa6d0(0x2be)]?_0x31f39b(_0x2daac6[_0x6aa6d0(0x25c)]):Promise['resolve'](_0x2daac6['value'])[_0x6aa6d0(0x22c)](_0x1b5ff8,_0xa3ba81);_0xce9b7a((_0x221cb0=_0x221cb0[_0x6aa6d0(0x1fc)](_0x41ac8e,_0x26c6ba))[_0x6aa6d0(0x331)]());}),mt='1.0.122',ge=_0x32fca5(0x271),Fe=_0x32fca5(0x28f),Et=_0x32fca5(0x339),Be='/event',vt='/record-event',It=_0x32fca5(0x1bb),St=_0x32fca5(0x1cc),ft=_0x32fca5(0x251),ht=_0x32fca5(0x303),bt=_0x32fca5(0x25b),yt=(_0x3e8a0d=>(_0x3e8a0d['UTM_SOURCE']=_0x32fca5(0x2a8),_0x3e8a0d[_0x32fca5(0x2d7)]=_0x32fca5(0x2e2),_0x3e8a0d[_0x32fca5(0x2c1)]=_0x32fca5(0x198),_0x3e8a0d[_0x32fca5(0x292)]=_0x32fca5(0x31d),_0x3e8a0d[_0x32fca5(0x1a3)]='utm_content',_0x3e8a0d[_0x32fca5(0x342)]='gad_source',_0x3e8a0d[_0x32fca5(0x1a1)]=_0x32fca5(0x299),_0x3e8a0d[_0x32fca5(0x18c)]=_0x32fca5(0x257),_0x3e8a0d))(yt||{}),wt=new Set(Object[_0x32fca5(0x28b)](yt)),te=_0x32fca5(0x298),re,$,ne,w=class w{constructor(){m(this,$);}static[_0x32fca5(0x1a9)](){return d(w,re)||I(w,re,new w()),d(w,re);}[_0x32fca5(0x1f9)](_0x53818c){const _0x19feab=_0x32fca5;w[_0x19feab(0x1e7)]=_0x53818c;let _0x41586e=_0x53818c,_0x21db85=/m(\d+)rgn/,_0x5dfeb2=_0x41586e[_0x19feab(0x28a)](_0x21db85);_0x5dfeb2&&(w['brandId']=_0x5dfeb2[0x1]);}['getAPIKey'](){const _0x46b445=_0x32fca5;return w[_0x46b445(0x1e7)];}['getBrandId'](){const _0x393f53=_0x32fca5;return w[_0x393f53(0x210)];}[_0x32fca5(0x1e1)](_0x1fc825){return a(this,null,function*(){const _0x2c7bb9=_0x96f8;try{return(yield fetch(ge+_0x1fc825,{'headers':{'Authorization':i(this,$,ne)[_0x2c7bb9(0x1a0)](this,w['apiKey']),'Content-Type':_0x2c7bb9(0x1d6)}}))[_0x2c7bb9(0x2c2)]();}catch(_0x196402){let _0xf8279d=_0x196402[_0x2c7bb9(0x280)];return this['getBrandId']()==='67'&&_0xf8279d!==_0x2c7bb9(0x310)&&_0xf8279d!==_0x2c7bb9(0x1b0)&&u[_0x2c7bb9(0x28d)]({'eventName':_0x2c7bb9(0x2cd),'eventProperties':[{'eventProperty':_0x2c7bb9(0x280),'value':'get\x20-\x20'+_0x1fc825+_0x2c7bb9(0x212)+i(this,$,ne)['call'](this,w[_0x2c7bb9(0x1e7)])+_0x2c7bb9(0x2da)+_0x196402[_0x2c7bb9(0x280)]}]},!0x0),Promise['reject'](_0x196402);}});}[_0x32fca5(0x1de)](_0x20301e,_0x27621b,_0x521753){return a(this,null,function*(){const _0x58d9e9=_0x96f8;try{return(yield fetch(ge+_0x20301e,{'body':JSON[_0x58d9e9(0x309)](_0x27621b||{}),'headers':{'Authorization':i(this,$,ne)['call'](this,w['apiKey']),'Content-Type':_0x58d9e9(0x1d6)},'method':_0x58d9e9(0x2d6),'signal':_0x521753}))[_0x58d9e9(0x2c2)]();}catch(_0x4cef53){let _0x4814fe=_0x4cef53[_0x58d9e9(0x280)];return this[_0x58d9e9(0x234)]()==='67'&&_0x4814fe!==_0x58d9e9(0x310)&&_0x4814fe!==_0x58d9e9(0x1b0)&&u['recordEvent']({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':_0x58d9e9(0x280),'value':_0x58d9e9(0x337)+_0x20301e+_0x58d9e9(0x212)+i(this,$,ne)[_0x58d9e9(0x1a0)](this,w[_0x58d9e9(0x1e7)])+'\x20-\x20'+JSON['stringify'](_0x27621b||{})+'\x20-'+_0x4cef53[_0x58d9e9(0x280)]}]},!0x0),Promise[_0x58d9e9(0x306)](_0x4cef53);}});}[_0x32fca5(0x191)](_0x2a448d,_0x26d609){return a(this,null,function*(){const _0x5885c4=_0x96f8;return(yield fetch(ge+_0x2a448d,{'body':JSON[_0x5885c4(0x309)](_0x26d609||{}),'headers':{'Authorization':i(this,$,ne)[_0x5885c4(0x1a0)](this,w[_0x5885c4(0x1e7)]),'Content-Type':_0x5885c4(0x1d6)},'method':'PUT'}))[_0x5885c4(0x2c2)]();});}['syncRealWorldTime'](){return a(this,null,function*(){const _0x59962b=_0x96f8;try{let _0x2b6fd6=(yield(yield fetch(ge+bt))[_0x59962b(0x2c2)]())['data'];w[_0x59962b(0x1f1)]=new Date(_0x2b6fd6),w[_0x59962b(0x1be)]=new Date();}catch(_0xbec983){s(0x2,_0x59962b(0x288));}});}[_0x32fca5(0x1a6)](){const _0x1908b5=_0x32fca5;if(!w[_0x1908b5(0x1f1)]||!w[_0x1908b5(0x1be)])return s(0x2,_0x1908b5(0x26b)),new Date();let _0x174379=new Date()[_0x1908b5(0x29c)]()-w['lastSyncTime']['getTime']();return new Date(w[_0x1908b5(0x1f1)]['getTime']()+_0x174379);}};re=new WeakMap(),$=new WeakSet(),ne=function(_0x2525fc){const _0x1fe2df=_0x32fca5;return btoa(_0x2525fc+':'+new Date()[_0x1fe2df(0x29c)]());},m(w,re);var Me=w,N=Me[_0x32fca5(0x1a9)](),G,ie,x,Tt,Ve,Pt,Nt,V=class V{constructor(){m(this,x),m(this,ie,!0x1);}static['getInstance'](){var _0x3eba2f;return d(V,G)||(I(V,G,new V()),i(_0x3eba2f=d(V,G),x,Tt)['call'](_0x3eba2f)),d(V,G);}[_0x32fca5(0x1a8)](_0x2b063c,_0x47615d,_0x35dc9f){return a(this,null,function*(){const _0xa46150=_0x96f8;yield A(_0xa46150(0x338),()=>a(this,null,function*(){const _0x4facc9=_0xa46150;if(s(0x1,_0x4facc9(0x237)),C(_0x4facc9(0x237),!0x0),L(_0x4facc9(0x230),!0x0),s(0x1,'Attribute\x20Payload:\x0a\x20'+{'attributeName':_0x2b063c,'attributeProperties':_0x35dc9f,'attributeValue':_0x47615d}+')}'),!_0x47615d||_0x47615d===''){s(0x2,_0x4facc9(0x322));return;}yield E[_0x4facc9(0x2e4)](),yield i(this,x,Pt)[_0x4facc9(0x1a0)](this);let _0x1b2898=JSON[_0x4facc9(0x225)](localStorage['getItem'](_0x4facc9(0x2dc))||'{}'),_0x21f0dd=_0x35dc9f?i(this,x,Ve)[_0x4facc9(0x1a0)](this,_0x1b2898,_0x2b063c,_0x35dc9f):i(this,x,Ve)[_0x4facc9(0x1a0)](this,_0x1b2898,_0x2b063c);if(typeof _0x21f0dd=='string'){s(0x2,_0x21f0dd);return;}_0x1b2898[_0x2b063c]['should_set_identity']&&(yield E[_0x4facc9(0x248)](typeof _0x47615d==_0x4facc9(0x224)?_0x47615d:JSON[_0x4facc9(0x309)](_0x47615d))),E[_0x4facc9(0x290)]();let {id:_0x186c26}=_0x1b2898[_0x2b063c],_0x45d06d={'attributeId':_0x186c26,'attributeProperties':_0x21f0dd,'customerId':localStorage[_0x4facc9(0x235)](_0x4facc9(0x334))||'','value':_0x47615d};yield i(this,x,Nt)['call'](this,_0x45d06d);let _0x3cf6f9=JSON[_0x4facc9(0x225)](localStorage[_0x4facc9(0x235)](_0x4facc9(0x1ce))||'[]');_0x3cf6f9['pop'](),localStorage[_0x4facc9(0x2d3)](_0x4facc9(0x1ce),JSON[_0x4facc9(0x309)](_0x3cf6f9)),L(_0x4facc9(0x230),!0x1),C(_0x4facc9(0x237),!0x1);}));});}['storeAttributeInLocalStorage'](){return a(this,null,function*(){const _0x8b7d39=_0x96f8;if(!localStorage[_0x8b7d39(0x235)](_0x8b7d39(0x2dc))&&!d(this,ie)){I(this,ie,!0x0);try{let _0x56bfb3=(yield this['fetchAttributeData']())[_0x8b7d39(0x279)];_0x56bfb3&&localStorage[_0x8b7d39(0x2d3)](_0x8b7d39(0x2dc),JSON[_0x8b7d39(0x309)](_0x56bfb3));}catch(_0x178f96){throw new Error(_0x8b7d39(0x193));}finally{I(this,ie,!0x1);}}});}[_0x32fca5(0x283)](){return a(this,null,function*(){const _0x1c827e=_0x96f8;try{return yield N['get'](''+Fe);}catch(_0x50324b){throw new Error(_0x1c827e(0x33e));}});}};G=new WeakMap(),ie=new WeakMap(),x=new WeakSet(),Tt=function(){return a(this,null,function*(){});},Ve=function(_0x3d4d9a,_0x5604cd,_0x20ccca){const _0x428216=_0x32fca5;if(!Object[_0x428216(0x2b1)][_0x428216(0x1b5)][_0x428216(0x1a0)](_0x3d4d9a,_0x5604cd))return _0x428216(0x318)+_0x5604cd+'\x20is\x20not\x20valid.';if(!_0x20ccca)return[];let _0x3733cc=_0x3d4d9a[_0x5604cd];if(!(_0x3733cc!=null&&_0x3733cc[_0x428216(0x1d9)]))return'Attribute\x20'+_0x5604cd+_0x428216(0x275);let _0x38eebf=_0x20ccca[_0x428216(0x1db)](({attributeProperty:_0x46e880})=>!Object[_0x428216(0x2b1)][_0x428216(0x1b5)][_0x428216(0x1a0)](_0x3733cc[_0x428216(0x1d9)],_0x46e880))[_0x428216(0x263)](({attributeProperty:_0x3966fd})=>_0x3966fd);return _0x38eebf[_0x428216(0x304)]>0x0?_0x428216(0x318)+_0x5604cd+_0x428216(0x2de)+_0x38eebf[_0x428216(0x30f)](',\x20')+'.':_0x20ccca['map'](({attributeProperty:_0x2b1bab,value:_0x28b6b7})=>({'attributePropertyId':_0x3733cc[_0x428216(0x1d9)][_0x2b1bab]['id'],'value':_0x28b6b7}));},Pt=function(){return a(this,null,function*(){const _0x30fb70=_0x96f8;localStorage[_0x30fb70(0x235)](_0x30fb70(0x2dc))||(yield this[_0x30fb70(0x254)]());});},Nt=function(_0x95b78d){return a(this,null,function*(){const _0x155ec4=_0x96f8;try{return yield N[_0x155ec4(0x1de)](''+Fe+Et,_0x95b78d);}catch(_0x46c1fc){throw new Error('Error\x20posting\x20attribute\x20record');}});},m(V,G);var $e=V,me=$e[_0x32fca5(0x1a9)](),Ke='Content\x20Card\x20Action',Y,T,At,He,Rt,Ot,se,Ne,Lt,Ct,Dt,_e,K=class K{constructor(){const _0x266e41=_0x32fca5;m(this,T),m(this,se,_0x3445b2=>{const _0x30e759=_0x96f8;E[_0x30e759(0x245)]({'id':_0x3445b2,'localStorageKey':_0x30e759(0x2bd)});}),this[_0x266e41(0x206)]=()=>{const _0x573c64=_0x266e41;E[_0x573c64(0x1d2)]({'actionCondition':_0x61f668=>_0x61f668[_0x573c64(0x280)][_0x573c64(0x1df)]===_0x573c64(0x319),'actionMethod':_0x480a23=>i(this,T,He)['call'](this,_0x480a23[_0x573c64(0x32b)]),'localStorageKey':'action'});},m(this,_e,()=>{const _0x1023af=_0x266e41;E['storeActionInLocalStorageInternal'](_0x1023af(0x2bd));});}static[_0x32fca5(0x1a9)](){const _0x438efe=_0x32fca5;var _0x434784;return d(K,Y)||(I(K,Y,new K()),i(_0x434784=d(K,Y),T,At)[_0x438efe(0x1a0)](_0x434784)),d(K,Y);}[_0x32fca5(0x25a)](_0x573133){const _0x436a6e=_0x32fca5;let _0x4cc841=JSON[_0x436a6e(0x225)](localStorage['getItem'](_0x436a6e(0x2bd))||'{}');if(_0x4cc841&&_0x4cc841[_0x573133==null?void 0x0:_0x573133[_0x436a6e(0x32b)]]){s(0x1,_0x436a6e(0x24c));return;}i(this,T,Dt)['call'](this,_0x573133),d(this,_e)[_0x436a6e(0x1a0)](this),i(this,T,He)[_0x436a6e(0x1a0)](this,_0x573133[_0x436a6e(0x32b)]);}[_0x32fca5(0x1ad)](_0x314413){return _0x314413==='content_card';}};Y=new WeakMap(),T=new WeakSet(),At=function(){return a(this,null,function*(){});},He=function(_0x22c412){const _0x70849c=_0x32fca5;let _0x4b3e50=i(this,T,Rt)[_0x70849c(0x1a0)](this);if(document[_0x70849c(0x2ae)](_0x70849c(0x24b)+_0x22c412)){s(0x1,'ContentCard\x20already\x20displayed'),d(this,se)[_0x70849c(0x1a0)](this,_0x22c412);return;}if(_0x4b3e50!=null&&_0x4b3e50[_0x22c412])switch(_0x4b3e50[_0x22c412][_0x70849c(0x32f)]){case _0x70849c(0x22e):{i(this,T,Ot)[_0x70849c(0x1a0)](this,_0x4b3e50[_0x22c412]);break;}case _0x70849c(0x22f):{i(this,T,Ne)[_0x70849c(0x1a0)](this,_0x4b3e50[_0x22c412]);break;}case _0x70849c(0x2dd):{i(this,T,Ct)['call'](this,_0x4b3e50[_0x22c412]);break;}default:return;}},Rt=function(){const _0x3174aa=_0x32fca5;let _0x15f0c6=localStorage[_0x3174aa(0x235)](_0x3174aa(0x2bd));return _0x15f0c6?JSON[_0x3174aa(0x225)](_0x15f0c6):null;},Ot=function(_0x4c3aef){const _0x5ac3a3=_0x32fca5;E[_0x5ac3a3(0x20e)]({'clearActionMethod':d(this,se)[_0x5ac3a3(0x1fa)](this),'data':_0x4c3aef,'displayMethod':i(this,T,Ne)[_0x5ac3a3(0x1fa)](this),'idKey':_0x5ac3a3(0x32b),'timeValueKey':_0x5ac3a3(0x23f)});},se=new WeakMap(),Ne=function(_0x579be3){const _0x5a999e=_0x32fca5;var _0x1ce3d4;if(document[_0x5a999e(0x2ae)](_0x5a999e(0x24b)+_0x579be3[_0x5a999e(0x32b)]))s(0x1,'ContentCard\x20already\x20displayed');else{let _0x130c24=i(this,T,Lt)['call'](this,_0x5a999e(0x2e7),_0x579be3),_0x1034cf=document[_0x5a999e(0x18b)]('#'+_0x579be3[_0x5a999e(0x280)][_0x5a999e(0x190)]);_0x1034cf&&(_0x1034cf[_0x5a999e(0x20d)]=_0x130c24['outerHTML'],u[_0x5a999e(0x28d)]({'campaignCustomerInstanceId':_0x579be3[_0x5a999e(0x2a6)],'campaignId':_0x579be3[_0x5a999e(0x32b)],'eventName':Ke,'eventProperties':[{'eventProperty':_0x5a999e(0x1a7),'value':JSON[_0x5a999e(0x309)]({'campaignId':_0x579be3[_0x5a999e(0x32b)]})}],'name':_0x5a999e(0x344)}),(_0x1ce3d4=document[_0x5a999e(0x2ae)](_0x5a999e(0x24b)+_0x579be3[_0x5a999e(0x32b)]))==null||_0x1ce3d4[_0x5a999e(0x2f7)](_0x5a999e(0x1f8),()=>{const _0x45822d=_0x5a999e;u['recordEvent']({'campaignCustomerInstanceId':_0x579be3[_0x45822d(0x2a6)],'campaignId':_0x579be3[_0x45822d(0x32b)],'eventName':Ke,'eventProperties':[{'eventProperty':_0x45822d(0x2c6),'value':JSON[_0x45822d(0x309)]({'campaignId':_0x579be3[_0x45822d(0x32b)]})}],'name':_0x45822d(0x1f8)});}));}d(this,se)[_0x5a999e(0x1a0)](this,_0x579be3[_0x5a999e(0x32b)]);},Lt=function(_0x468c05,_0x17e2a7){const _0x1e9ff3=_0x32fca5;var _0x43001a;let {campaignId:_0xb5f0a0,message:{design:_0x348d46}}=_0x17e2a7,_0x13a8fe=document['createElement'](_0x468c05);return _0x13a8fe['id']='contentCard_container_'+_0xb5f0a0,_0x13a8fe[_0x1e9ff3(0x20d)]=_0x348d46,(_0x43001a=_0x13a8fe['querySelector'](_0x1e9ff3(0x236)))==null||_0x43001a[_0x1e9ff3(0x19d)](),_0x13a8fe;},Ct=function(_0x22061e){const _0x4ce050=_0x32fca5;E[_0x4ce050(0x329)]({'data':_0x22061e,'displayMethod':i(this,T,Ne)[_0x4ce050(0x1fa)](this),'timeValueKey':_0x4ce050(0x23f)});},Dt=function(_0x28ce21){const _0x8e472c=_0x32fca5;E[_0x8e472c(0x2ca)](_0x28ce21,_0x8e472c(0x2bd),_0x8e472c(0x32b));},_e=new WeakMap(),m(K,Y);var Je=K,ae=Je['getInstance'](),ce,B,le,q,Ee,ve,S,ze,Ut,Ge,Ae,xt,Le,Re,Ye,Wt,Oe,Ie,kt,f=class f{constructor(){const _0x5f3188=_0x32fca5;m(this,S),this[_0x5f3188(0x240)]=null,this[_0x5f3188(0x2c5)]=_0x1e84c7=>{const _0x48a2ce=_0x5f3188;s(0x1,'Pushing\x20message\x20to\x20service\x20worker'),navigator[_0x48a2ce(0x1b2)][_0x48a2ce(0x221)]()[_0x48a2ce(0x22c)](_0x1a0935=>{const _0x61132b=_0x48a2ce;var _0x192a33,_0x250ce5;s(0x1,_0x61132b(0x227)),(_0x192a33=_0x1a0935[0x0])!=null&&_0x192a33['active']&&(s(0x1,'Service\x20Worker\x20ready'),(_0x250ce5=_0x1a0935[0x0][_0x61132b(0x346)])==null||_0x250ce5[_0x61132b(0x1e8)](JSON['stringify'](_0x1e84c7)));})['catch'](_0x1bb68d=>{const _0x51b099=_0x48a2ce;s(0x2,_0x51b099(0x33f)+_0x1bb68d[_0x51b099(0x280)]);});},this[_0x5f3188(0x2d4)]=()=>{const _0x2e1396=_0x5f3188;E[_0x2e1396(0x1d2)]({'actionCondition':()=>!0x0,'actionMethod':_0x2499e9=>i(this,S,Re)['call'](this,Number(_0x2499e9['web_optin_instance_id'])),'localStorageKey':_0x2e1396(0x266)});},m(this,Le,()=>{const _0x5a1339=_0x5f3188;E['storeActionInLocalStorageInternal'](_0x5a1339(0x266));}),m(this,Ie,_0x2d9526=>{const _0x41da56=_0x5f3188;E[_0x41da56(0x245)]({'id':_0x2d9526,'localStorageKey':'web_push_action'});});}static[_0x32fca5(0x1a9)](){return d(f,ce)||I(f,ce,new f()),d(f,ce);}[_0x32fca5(0x2f1)](_0x31c1d8,_0x3304b2){return a(this,null,function*(){const _0xcc66f8=_0x96f8;var _0x2b62de;if(s(0x1,'Initializing\x20Notification\x20Service'),u[_0xcc66f8(0x32a)]({'eventName':_0xcc66f8(0x2f1),'eventProperties':[{'eventProperty':_0xcc66f8(0x1fb),'value':'serviceWorker'in navigator},{'eventProperty':_0xcc66f8(0x22d),'value':_0xcc66f8(0x33d)in window}]}),_0xcc66f8(0x1b2)in navigator&&_0xcc66f8(0x33d)in window){s(0x1,_0xcc66f8(0x2f6));try{u[_0xcc66f8(0x32a)]({'eventName':'init_condition'}),I(f,B,yield navigator[_0xcc66f8(0x1b2)]['register'](_0x3304b2||'/mergn-sw.js')),s(0x1,_0xcc66f8(0x23b)),s(0x1,_0xcc66f8(0x2cf)),this['pushMessageToSW']({'customer':localStorage[_0xcc66f8(0x235)](_0xcc66f8(0x334))||'','events':u[_0xcc66f8(0x2f5)](),'API_KEY':N[_0xcc66f8(0x313)](),'device_id':localStorage[_0xcc66f8(0x235)](_0xcc66f8(0x2b8))||'','operatingSystem':E[_0xcc66f8(0x2ff)](),'osVersion':E[_0xcc66f8(0x30e)](),'Platform':E[_0xcc66f8(0x247)]()}),I(f,Ee,!0x0);let _0x87a402=i(this,S,Ye)[_0xcc66f8(0x1a0)](this),_0x26ceb0=Object[_0xcc66f8(0x1d7)](_0x87a402||{});if(_0x26ceb0['length']&&i(this,S,Re)[_0xcc66f8(0x1a0)](this,Number(_0x26ceb0[0x0])),!_0x31c1d8)return;let _0xf21a83=yield(_0x2b62de=d(f,B))==null?void 0x0:_0x2b62de[_0xcc66f8(0x2f3)][_0xcc66f8(0x24a)]();s(0x1,_0xcc66f8(0x1aa)),d(f,B)&&(s(0x1,'Service\x20Worker\x20registration\x20is\x20available'),d(f,B)['update']()),_0xf21a83?(s(0x1,'Existing\x20subscription\x20found'),u[_0xcc66f8(0x32a)]({'eventName':_0xcc66f8(0x1d0)}),yield i(this,S,Ae)[_0xcc66f8(0x1a0)](this),I(f,le,!0x0)):(s(0x1,_0xcc66f8(0x238)),yield i(this,S,ze)[_0xcc66f8(0x1a0)](this,d(f,ve)||void 0x0));}catch(_0x1589a7){let _0x1a8ea2=_0x1589a7&&_0x1589a7[_0xcc66f8(0x280)]?_0x1589a7[_0xcc66f8(0x280)][_0xcc66f8(0x278)](0x0,0x64):'undefined';yield u[_0xcc66f8(0x32a)]({'eventName':_0xcc66f8(0x2a5),'eventProperties':[{'eventProperty':_0xcc66f8(0x280),'value':''+_0x1a8ea2}]}),s(0x2,_0xcc66f8(0x2d2)),s(0x2,_0x1a8ea2);}}});}[_0x32fca5(0x301)](_0x367eba){const _0xd67f24=_0x32fca5;if(!d(f,Ee)){I(f,ve,_0x367eba),u['recordDebugEvents']({'eventName':_0xd67f24(0x23a)}),s(0x2,_0xd67f24(0x30a));return;}A(_0xd67f24(0x301),()=>a(this,null,function*(){const _0x308554=_0xd67f24;let _0x9bbc=JSON[_0x308554(0x225)](localStorage[_0x308554(0x235)](_0x308554(0x266))||'{}');if(_0x9bbc&&_0x9bbc[_0x367eba[_0x308554(0x1af)]]){s(0x1,_0x308554(0x305));return;}i(this,S,xt)[_0x308554(0x1a0)](this,_0x367eba),d(this,Le)[_0x308554(0x1a0)](this),i(this,S,Re)[_0x308554(0x1a0)](this,_0x367eba[_0x308554(0x1af)]);}));}};ce=new WeakMap(),B=new WeakMap(),le=new WeakMap(),q=new WeakMap(),Ee=new WeakMap(),ve=new WeakMap(),S=new WeakSet(),ze=function(_0xe8da91){return a(this,null,function*(){const _0x140cb3=_0x96f8;s(0x1,_0x140cb3(0x239)+JSON[_0x140cb3(0x309)](_0xe8da91)+'\x20'),u[_0x140cb3(0x32a)]({'eventName':_0x140cb3(0x325)});let _0x97c615;try{_0x97c615=Notification['permission'],_0x97c615&&(s(0x1,_0x140cb3(0x2f0)+_0x97c615),_0x97c615===_0x140cb3(0x26c)?(_0xe8da91||(this[_0x140cb3(0x240)]=_0x140cb3(0x26c),u[_0x140cb3(0x32a)]({'eventName':_0x140cb3(0x300)})),_0xe8da91&&(u[_0x140cb3(0x32a)]({'eventName':_0x140cb3(0x196),'eventProperties':[{'eventProperty':_0x140cb3(0x2d9),'value':''+(_0xe8da91==null?void 0x0:_0xe8da91[_0x140cb3(0x2d9)])}]}),d(this,Ie)[_0x140cb3(0x1a0)](this,_0xe8da91[_0x140cb3(0x1af)]),_0xe8da91[_0x140cb3(0x2d9)]===_0x140cb3(0x2ec)?i(this,S,Ut)[_0x140cb3(0x1a0)](this,_0xe8da91):yield i(this,S,Ge)[_0x140cb3(0x1a0)](this,_0xe8da91))):_0x97c615===_0x140cb3(0x28c)?(u['recordDebugEvents']({'eventName':_0x140cb3(0x1b4)}),s(0x1,'The\x20user\x20has\x20blocked\x20notifications.')):(u[_0x140cb3(0x32a)]({'eventName':_0x140cb3(0x1d4)}),s(0x1,_0x140cb3(0x1e9)),d(f,le)||(yield i(this,S,Ae)['call'](this),yield u[_0x140cb3(0x28d)]({'eventName':_0x140cb3(0x1ed)}),_0xe8da91||I(f,le,!0x0))));}catch(_0x15a97f){s(0x2,_0x140cb3(0x25f)),u['recordDebugEvents']({'eventName':_0x140cb3(0x25d)});}});},Ut=function(_0x1ed095){const _0x290798=_0x32fca5;try{let _0x1777cf=document[_0x290798(0x316)](_0x290798(0x2e7)),_0x849eaf;_0x1ed095['banner_design']['banner_image']&&(_0x849eaf=document[_0x290798(0x316)](_0x290798(0x312)),_0x849eaf[_0x290798(0x336)]=_0x1ed095['banner_design'][_0x290798(0x2ce)],_0x849eaf[_0x290798(0x216)]=_0x290798(0x31b),_0x849eaf['id']=_0x290798(0x2c7));let _0x539f0b=document['createElement'](_0x290798(0x2e7)),_0x3ca214=document[_0x290798(0x316)](_0x290798(0x2e7)),_0x27536a=document[_0x290798(0x316)](_0x290798(0x2e7)),_0x3d8999=document[_0x290798(0x316)](_0x290798(0x312)),_0x362d5f=document['createElement'](_0x290798(0x2e7)),_0x1cc0bb=document[_0x290798(0x316)]('div'),_0x40ce12=document[_0x290798(0x316)]('div'),_0x4fa58c=document[_0x290798(0x316)](_0x290798(0x2e7)),_0x1354ca=document[_0x290798(0x316)](_0x290798(0x2e7)),_0x6a420b=document['createElement'](_0x290798(0x2e7)),_0x49b9d4=document[_0x290798(0x316)](_0x290798(0x27c)),_0x2e82c2=document[_0x290798(0x316)](_0x290798(0x27c));_0x1777cf['className']=_0x290798(0x1f5),_0x539f0b[_0x290798(0x2bb)]=_0x290798(0x2f2),_0x3ca214[_0x290798(0x2bb)]=_0x4fa58c['className']=_0x1354ca[_0x290798(0x2bb)]=_0x290798(0x284),_0x27536a[_0x290798(0x2bb)]=_0x290798(0x231),_0x362d5f[_0x290798(0x2bb)]=_0x290798(0x345),_0x6a420b[_0x290798(0x2bb)]=_0x290798(0x32c),_0x1cc0bb['id']=_0x290798(0x289),_0x40ce12['id']=_0x290798(0x268),_0x49b9d4['id']=_0x290798(0x25e),_0x2e82c2['id']='button-2',_0x3d8999['src']=_0x1ed095[_0x290798(0x2a9)][_0x290798(0x19e)],_0x3d8999[_0x290798(0x216)]='Image',_0x3d8999['id']='logo',_0x1cc0bb[_0x290798(0x223)]=_0x1ed095[_0x290798(0x2a9)][_0x290798(0x267)],_0x40ce12['textContent']=_0x1ed095[_0x290798(0x2a9)][_0x290798(0x29a)],_0x49b9d4[_0x290798(0x223)]=_0x1ed095[_0x290798(0x2a9)]['button_1'][_0x290798(0x1c0)],_0x2e82c2[_0x290798(0x223)]=_0x1ed095[_0x290798(0x2a9)][_0x290798(0x317)]['text'],_0x27536a['appendChild'](_0x3d8999),_0x362d5f[_0x290798(0x1fd)](_0x1cc0bb),_0x362d5f[_0x290798(0x1fd)](_0x40ce12),_0x3ca214[_0x290798(0x1fd)](_0x27536a),_0x3ca214[_0x290798(0x1fd)](_0x362d5f),_0x849eaf&&(_0x4fa58c[_0x290798(0x1fd)](_0x849eaf),_0x849eaf[_0x290798(0x320)][_0x290798(0x244)]=_0x290798(0x21b)),_0x6a420b['appendChild'](_0x49b9d4),_0x6a420b[_0x290798(0x1fd)](_0x2e82c2),_0x1354ca[_0x290798(0x1fd)](_0x6a420b),_0x539f0b[_0x290798(0x1fd)](_0x3ca214),_0x539f0b[_0x290798(0x1fd)](_0x4fa58c),_0x539f0b[_0x290798(0x1fd)](_0x1354ca),_0x1777cf[_0x290798(0x1fd)](_0x539f0b),_0x1777cf[_0x290798(0x320)][_0x290798(0x244)]=_0x290798(0x2ac),_0x539f0b[_0x290798(0x320)][_0x290798(0x244)]=_0x290798(0x335)+_0x1ed095[_0x290798(0x2a9)][_0x290798(0x1d1)]+';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a',_0x3ca214[_0x290798(0x320)][_0x290798(0x244)]=_0x4fa58c[_0x290798(0x320)][_0x290798(0x244)]=_0x1354ca[_0x290798(0x320)][_0x290798(0x244)]=_0x290798(0x21c),_0x27536a[_0x290798(0x320)][_0x290798(0x244)]='\x0awidth:\x2025%;\x0a',_0x362d5f[_0x290798(0x320)][_0x290798(0x244)]=_0x290798(0x2b9),_0x3d8999[_0x290798(0x320)]['cssText']='\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a',_0x49b9d4[_0x290798(0x320)][_0x290798(0x244)]=_0x290798(0x2db)+_0x1ed095[_0x290798(0x2a9)][_0x290798(0x246)][_0x290798(0x24f)]+_0x290798(0x195)+_0x1ed095[_0x290798(0x2a9)]['button_1'][_0x290798(0x314)]+_0x290798(0x282),_0x2e82c2['style'][_0x290798(0x244)]='\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20'+_0x1ed095[_0x290798(0x2a9)][_0x290798(0x317)]['backgroundColor']+_0x290798(0x195)+_0x1ed095[_0x290798(0x2a9)][_0x290798(0x317)][_0x290798(0x314)]+';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a',_0x6a420b[_0x290798(0x320)][_0x290798(0x244)]=_0x290798(0x323),_0x1cc0bb[_0x290798(0x320)][_0x290798(0x244)]=_0x290798(0x2d0)+_0x1ed095[_0x290798(0x2a9)]['text_color']+'\x0a',_0x40ce12['style'][_0x290798(0x244)]=_0x290798(0x1d8)+_0x1ed095[_0x290798(0x2a9)][_0x290798(0x232)]+'\x0a',document[_0x290798(0x1d3)][_0x290798(0x1fd)](_0x1777cf),document[_0x290798(0x1d3)]['style']['overflow']=_0x290798(0x2bc),u[_0x290798(0x28d)]({'eventName':'Viewed\x20Web\x20Push\x20Soft-ask','name':'viewed','web_optin_instance_id':_0x1ed095['web_optin_instance_id']}),_0x49b9d4==null||_0x49b9d4['addEventListener'](_0x290798(0x1f8),()=>a(this,null,function*(){const _0xa6dc83=_0x290798;_0x1777cf[_0xa6dc83(0x19d)](),I(f,q,!0x1),document[_0xa6dc83(0x1d3)]['style'][_0xa6dc83(0x1e0)]=_0xa6dc83(0x20a),yield u[_0xa6dc83(0x28d)]({'eventName':_0xa6dc83(0x297),'web_optin_instance_id':_0x1ed095[_0xa6dc83(0x1af)]}),s(0x1,_0xa6dc83(0x21f));})),_0x2e82c2==null||_0x2e82c2[_0x290798(0x2f7)](_0x290798(0x1f8),()=>a(this,null,function*(){const _0x41e71c=_0x290798;_0x1777cf[_0x41e71c(0x19d)](),document[_0x41e71c(0x1d3)][_0x41e71c(0x320)]['overflow']=_0x41e71c(0x20a),u[_0x41e71c(0x28d)]({'eventName':_0x41e71c(0x207),'web_optin_instance_id':_0x1ed095[_0x41e71c(0x1af)]}),yield i(this,S,Ge)['call'](this,_0x1ed095);}));}catch(_0x40d16b){}},Ge=function(_0x2c22d2){return a(this,null,function*(){const _0x3badb2=_0x96f8;try{u[_0x3badb2(0x28d)]({'eventName':_0x3badb2(0x24e),'name':_0x3badb2(0x2c8),'web_optin_instance_id':_0x2c22d2[_0x3badb2(0x1af)]});let _0x32ce3a=yield Notification['requestPermission']();_0x32ce3a===_0x3badb2(0x1ec)?(s(0x1,'User\x20granted\x20the\x20notification\x20permission.'),yield i(this,S,Ae)[_0x3badb2(0x1a0)](this),yield u[_0x3badb2(0x28d)]({'eventName':_0x3badb2(0x253),'name':'subscribed','web_optin_instance_id':_0x2c22d2['web_optin_instance_id']})):_0x32ce3a===_0x3badb2(0x28c)?(yield u[_0x3badb2(0x28d)]({'eventName':'Blocked\x20Web\x20Push\x20Subscription'}),s(0x1,_0x3badb2(0x21f))):_0x32ce3a===_0x3badb2(0x26c)&&(yield u['recordEvent']({'eventName':'Closed\x20Web\x20Push\x20Subscription'}),s(0x1,_0x3badb2(0x27a)));}catch(_0x3cf614){s(0x2,_0x3badb2(0x1b9));}I(f,q,!0x1);});},Ae=function(){return a(this,null,function*(){const _0x3366b9=_0x96f8;var _0x1f58ab,_0x3adbdb;let _0x380a4f=yield N[_0x3366b9(0x1e1)](''+ht);if(_0x380a4f['success']){let _0x5773b0=yield(_0x1f58ab=d(f,B))==null?void 0x0:_0x1f58ab[_0x3366b9(0x2f3)][_0x3366b9(0x24a)]();_0x5773b0&&(yield _0x5773b0[_0x3366b9(0x1a4)]());let _0x41ab01=yield(_0x3adbdb=d(f,B))==null?void 0x0:_0x3adbdb[_0x3366b9(0x2f3)][_0x3366b9(0x302)]({'applicationServerKey':_0x380a4f[_0x3366b9(0x279)]||'','userVisibleOnly':!0x0});yield N[_0x3366b9(0x191)](''+St,{'device_id':localStorage['getItem'](_0x3366b9(0x2b8))||'','is_web_push_subscribed':!0x0,'web_push_subscription_page_url':window['location'][_0x3366b9(0x1b3)],'web_push_token':{'token':JSON[_0x3366b9(0x225)](JSON['stringify'](_0x41ab01))}}),s(0x1,'User\x20is\x20subscribed');}else throw new Error(_0x3366b9(0x2af));});},xt=function(_0x145bc0){const _0x55611b=_0x32fca5;E['storeActionInLocalStorage'](_0x145bc0,_0x55611b(0x266),_0x55611b(0x1af));},Le=new WeakMap(),Re=function(_0x2acf44){const _0x3263c6=_0x32fca5;if(d(f,q))return;I(f,q,!0x0);let _0x5dce3c=i(this,S,Ye)[_0x3263c6(0x1a0)](this);if(_0x5dce3c!=null&&_0x5dce3c[_0x2acf44])switch(_0x5dce3c[_0x2acf44]['entry_time']){case _0x3263c6(0x22e):{i(this,S,Wt)[_0x3263c6(0x1a0)](this,_0x5dce3c[_0x2acf44]);break;}case _0x3263c6(0x22f):{i(this,S,Oe)[_0x3263c6(0x1a0)](this,_0x5dce3c[_0x2acf44]);break;}case _0x3263c6(0x2dd):{i(this,S,kt)[_0x3263c6(0x1a0)](this,_0x5dce3c[_0x2acf44]);break;}default:return;}},Ye=function(){const _0x20121b=_0x32fca5;let _0x3588b4=localStorage['getItem'](_0x20121b(0x266));return _0x3588b4?JSON[_0x20121b(0x225)](_0x3588b4):null;},Wt=function(_0x3fcff8){const _0x4685c5=_0x32fca5;E[_0x4685c5(0x20e)]({'clearActionMethod':d(this,Ie)[_0x4685c5(0x1fa)](this),'data':_0x3fcff8,'displayMethod':i(this,S,Oe)[_0x4685c5(0x1fa)](this),'idKey':_0x4685c5(0x1af),'timeValueKey':'entry_time_value'});},Oe=function(_0x24f5f4){i(this,S,ze)['call'](this,_0x24f5f4);},Ie=new WeakMap(),kt=function(_0x44c0fe){const _0x2ec416=_0x32fca5;E[_0x2ec416(0x329)]({'data':_0x44c0fe,'displayMethod':i(this,S,Oe)[_0x2ec416(0x1fa)](this),'timeValueKey':'entry_time_value'});},m(f,ce),m(f,B,null),m(f,le,!0x1),m(f,q,!0x1),m(f,Ee,!0x1),m(f,ve,null);var je=f,W=je[_0x32fca5(0x1a9)](),Q,P,Ft,Qe,Bt,Mt,de,Ce,$t,Vt,Kt,De,J=class J{constructor(){m(this,P),m(this,de,_0x42353f=>{const _0x1f41c4=_0x96f8;E[_0x1f41c4(0x245)]({'id':_0x42353f,'localStorageKey':'action'});}),this['loadPopupEventActionInLocalStorage']=()=>{const _0x198339=_0x96f8;E[_0x198339(0x1d2)]({'actionCondition':_0x4f4391=>_0x4f4391['message']['name']===_0x198339(0x209),'actionMethod':_0x380981=>i(this,P,Qe)[_0x198339(0x1a0)](this,_0x380981[_0x198339(0x32b)]),'localStorageKey':_0x198339(0x2bd)});},m(this,De,()=>{const _0xcf2171=_0x96f8;E[_0xcf2171(0x211)](_0xcf2171(0x2bd));});}static[_0x32fca5(0x1a9)](){const _0x5316ce=_0x32fca5;var _0xedd60e;return d(J,Q)||(I(J,Q,new J()),i(_0xedd60e=d(J,Q),P,Ft)[_0x5316ce(0x1a0)](_0xedd60e)),d(J,Q);}[_0x32fca5(0x204)](_0x252b45){const _0xe6b1eb=_0x32fca5;let _0x37fb46=JSON[_0xe6b1eb(0x225)](localStorage['getItem'](_0xe6b1eb(0x2bd))||'{}');if(_0x37fb46&&_0x37fb46[_0x252b45==null?void 0x0:_0x252b45[_0xe6b1eb(0x32b)]]){s(0x1,_0xe6b1eb(0x2b0));return;}i(this,P,Kt)['call'](this,_0x252b45),d(this,De)['call'](this),i(this,P,Qe)[_0xe6b1eb(0x1a0)](this,_0x252b45[_0xe6b1eb(0x32b)]);}[_0x32fca5(0x1c8)](_0x1bf41b){const _0x32e77a=_0x32fca5;return _0x1bf41b===_0x32e77a(0x209);}};Q=new WeakMap(),P=new WeakSet(),Ft=function(){return a(this,null,function*(){});},Qe=function(_0x3c4ae8){const _0x3f7a06=_0x32fca5;let _0x3c2c3f=i(this,P,Bt)[_0x3f7a06(0x1a0)](this);if(document[_0x3f7a06(0x2ae)](_0x3f7a06(0x31e)+_0x3c4ae8)){s(0x1,_0x3f7a06(0x243)),d(this,de)[_0x3f7a06(0x1a0)](this,_0x3c4ae8);return;}if(_0x3c2c3f!=null&&_0x3c2c3f[_0x3c4ae8])switch(_0x3c2c3f[_0x3c4ae8][_0x3f7a06(0x32f)]){case _0x3f7a06(0x22e):{i(this,P,Mt)[_0x3f7a06(0x1a0)](this,_0x3c2c3f[_0x3c4ae8]);break;}case _0x3f7a06(0x22f):{i(this,P,Ce)['call'](this,_0x3c2c3f[_0x3c4ae8]);break;}case _0x3f7a06(0x2dd):{i(this,P,Vt)['call'](this,_0x3c2c3f[_0x3c4ae8]);break;}default:return;}},Bt=function(){const _0x4cfa0e=_0x32fca5;let _0x47e7aa=localStorage[_0x4cfa0e(0x235)]('action');return _0x47e7aa?JSON[_0x4cfa0e(0x225)](_0x47e7aa):null;},Mt=function(_0x55d038){const _0x969559=_0x32fca5;E['showDelayedAction']({'clearActionMethod':d(this,de)[_0x969559(0x1fa)](this),'data':_0x55d038,'displayMethod':i(this,P,Ce)[_0x969559(0x1fa)](this),'idKey':_0x969559(0x32b),'timeValueKey':'campaignEntryTimeValue'});},de=new WeakMap(),Ce=function(_0x5c30db){const _0x2a84dd=_0x32fca5;if(document[_0x2a84dd(0x2ae)](_0x2a84dd(0x31e)+_0x5c30db[_0x2a84dd(0x32b)]))s(0x1,_0x2a84dd(0x243));else{let _0x5d45e1=i(this,P,$t)[_0x2a84dd(0x1a0)](this,_0x2a84dd(0x2e7),_0x5c30db);document[_0x2a84dd(0x1d3)][_0x2a84dd(0x1fd)](_0x5d45e1),u[_0x2a84dd(0x28d)]({'campaignCustomerInstanceId':_0x5c30db[_0x2a84dd(0x2a6)],'campaignId':_0x5c30db[_0x2a84dd(0x32b)],'eventName':te,'eventProperties':[{'eventProperty':'Popup\x20View','value':JSON[_0x2a84dd(0x309)]({'campaignId':_0x5c30db[_0x2a84dd(0x32b)]})}],'name':_0x2a84dd(0x344)});}d(this,de)[_0x2a84dd(0x1a0)](this,_0x5c30db[_0x2a84dd(0x32b)]);},$t=function(_0x55c030,_0x2d1f9d){const _0x595f0a=_0x32fca5;let {campaignCustomerInstanceId:_0x87db68,campaignId:_0x2f8a1c,message:{design:_0x1d2e54}}=_0x2d1f9d,_0x77a1af=document['createElement'](_0x55c030);_0x77a1af['id']=_0x595f0a(0x31e)+_0x2f8a1c,_0x77a1af['innerHTML']=_0x1d2e54,_0x77a1af['style'][_0x595f0a(0x250)]=_0x595f0a(0x26a),_0x77a1af['style'][_0x595f0a(0x2ba)]='0',_0x77a1af[_0x595f0a(0x320)]['left']='0',_0x77a1af[_0x595f0a(0x320)][_0x595f0a(0x215)]=_0x595f0a(0x2b7),_0x77a1af[_0x595f0a(0x320)][_0x595f0a(0x256)]=_0x595f0a(0x2b7),_0x77a1af[_0x595f0a(0x320)][_0x595f0a(0x2a2)]='99999999';let _0x2a2025=_0x77a1af['querySelector'](_0x595f0a(0x23c));_0x2a2025&&(_0x2a2025[_0x595f0a(0x320)][_0x595f0a(0x2a2)]='50');let _0x132d56=_0x2a2025[_0x595f0a(0x18b)](_0x595f0a(0x32d));_0x132d56&&(s(0x1,_0x595f0a(0x233)),_0x132d56['style']['setProperty'](_0x595f0a(0x220),'block',_0x595f0a(0x2b2))),_0x77a1af['querySelectorAll']('[id^=\x22u_content_form_\x22]')[_0x595f0a(0x33b)](_0x4a3d2b=>{const _0x28e024=_0x595f0a;let _0x379421=_0x4a3d2b['querySelector']('form');_0x379421&&_0x379421[_0x28e024(0x2f7)](_0x28e024(0x321),()=>a(this,null,function*(){const _0x38888f=_0x28e024;_0x77a1af[_0x38888f(0x19d)]();let _0x41b8ea=new FormData(_0x379421),_0x4628cf={};for(let [_0x180337,_0x5ebdac]of _0x41b8ea[_0x38888f(0x2c4)]())_0x4628cf[_0x180337]=_0x5ebdac;yield u['recordEvent']({'campaignCustomerInstanceId':_0x87db68,'campaignId':_0x2f8a1c,'eventName':te,'eventProperties':[{'eventProperty':_0x38888f(0x2eb),'value':JSON[_0x38888f(0x309)]({'campaignId':_0x2f8a1c,'formId':_0x4a3d2b['id'],'formValues':_0x4628cf})},{'eventProperty':'Campaign\x20Id','value':_0x2f8a1c[_0x38888f(0x22a)]()}],'name':'form'});}));});let _0x33b154=_0x77a1af['querySelector']('.u-close-button');return(_0x33b154==null?void 0x0:_0x33b154[_0x595f0a(0x241)]('href'))==='#'&&_0x33b154[_0x595f0a(0x1dc)]('href'),_0x33b154==null||_0x33b154[_0x595f0a(0x2f7)]('click',()=>a(this,null,function*(){const _0xffe5a9=_0x595f0a;_0x77a1af[_0xffe5a9(0x19d)](),yield u['recordEvent']({'campaignCustomerInstanceId':_0x87db68,'campaignId':_0x2f8a1c,'eventName':te,'eventProperties':[{'eventProperty':_0xffe5a9(0x285),'value':JSON[_0xffe5a9(0x309)]({'campaignId':_0x2f8a1c})}],'name':_0xffe5a9(0x19b)});})),_0x77a1af[_0x595f0a(0x276)]('[id^=\x22u_content_button_\x22]')[_0x595f0a(0x33b)](_0xc5f197=>{const _0x403e50=_0x595f0a;_0xc5f197[_0x403e50(0x2f7)]('click',()=>a(this,null,function*(){const _0x483d36=_0x403e50;_0x77a1af[_0x483d36(0x19d)](),yield u[_0x483d36(0x28d)]({'campaignCustomerInstanceId':_0x87db68,'campaignId':_0x2f8a1c,'eventName':te,'eventProperties':[{'eventProperty':'Button\x20Click','value':JSON[_0x483d36(0x309)]({'buttonId':_0xc5f197['id'],'campaignId':_0x2f8a1c})}],'name':_0x483d36(0x1f8)});}));}),_0x77a1af[_0x595f0a(0x276)]('.u-popup-container\x20img')[_0x595f0a(0x33b)](_0x541cd7=>{const _0x33b62e=_0x595f0a;_0x541cd7[_0x33b62e(0x2f7)]('click',()=>a(this,null,function*(){const _0x5267f4=_0x33b62e;_0x77a1af['remove'](),yield u['recordEvent']({'campaignCustomerInstanceId':_0x87db68,'campaignId':_0x2f8a1c,'eventName':te,'eventProperties':[{'eventProperty':'Image\x20Click','value':JSON[_0x5267f4(0x309)]({'campaignId':_0x2f8a1c,'imageClassName':_0x541cd7[_0x5267f4(0x2bb)],'imageId':_0x541cd7['id']})}],'name':_0x5267f4(0x1f8)});}));}),_0x77a1af;},Vt=function(_0x2776de){const _0x22b6af=_0x32fca5;E[_0x22b6af(0x329)]({'data':_0x2776de,'displayMethod':i(this,P,Ce)[_0x22b6af(0x1fa)](this),'timeValueKey':'campaignEntryTimeValue'});},Kt=function(_0x8d6441){const _0x443dbd=_0x32fca5;E[_0x443dbd(0x2ca)](_0x8d6441,_0x443dbd(0x2bd),_0x443dbd(0x32b));},De=new WeakMap(),m(J,Q);function _0x96f8(_0x2ccfe0,_0x221287){const _0x478f26=_0x478f();return _0x96f8=function(_0x96f803,_0x5d1b2b){_0x96f803=_0x96f803-0x18b;let _0x270c98=_0x478f26[_0x96f803];return _0x270c98;},_0x96f8(_0x2ccfe0,_0x221287);}var qe=J,H=qe['getInstance'](),ue,fe,he,be,ye,we,Te,xe,p,Ht,jt,zt,Se,Xe,et,tt,nt,Gt,Yt,qt,Qt,Zt,Xt,en,Ue,rt,tn,nn,Z=class Z{constructor(){const _0x56990a=_0x32fca5;m(this,p),m(this,fe),m(this,he),m(this,be),m(this,ye,null),m(this,we,null),m(this,Te,!0x1),m(this,xe,()=>{setInterval(()=>{const _0x5228f3=_0x96f8;let _0x287718=localStorage[_0x5228f3(0x235)](_0x5228f3(0x19f));if(_0x287718!==d(this,we)){I(this,we,_0x287718);let _0x2f6f8f=JSON[_0x5228f3(0x225)](_0x287718||'{}');if(_0x2f6f8f!=null&&_0x2f6f8f[_0x5228f3(0x2c5)]){let _0x58a8eb=_0x2f6f8f[_0x5228f3(0x2c5)];delete _0x2f6f8f['pushMessageToSW'],localStorage[_0x5228f3(0x2d3)](_0x5228f3(0x19f),JSON[_0x5228f3(0x309)](_0x2f6f8f)),W[_0x5228f3(0x2c5)](_0x58a8eb);}if(_0x2f6f8f!=null&&_0x2f6f8f[_0x5228f3(0x2cc)]){let _0x48c7d7=_0x2f6f8f[_0x5228f3(0x2cc)];delete _0x2f6f8f['optIn'],localStorage[_0x5228f3(0x2d3)](_0x5228f3(0x19f),JSON[_0x5228f3(0x309)](_0x2f6f8f)),W['showNotification'](_0x48c7d7);}if(_0x2f6f8f!=null&&_0x2f6f8f[_0x5228f3(0x252)]){let _0x3c59b5=_0x2f6f8f[_0x5228f3(0x252)];delete _0x2f6f8f[_0x5228f3(0x252)],localStorage[_0x5228f3(0x2d3)](_0x5228f3(0x19f),JSON['stringify'](_0x2f6f8f)),_0x3c59b5['forEach'](_0x5effb7=>{const _0x1dc85c=_0x5228f3;H[_0x1dc85c(0x1c8)](_0x5effb7[_0x1dc85c(0x280)][_0x1dc85c(0x1df)])?H['showPopup'](_0x5effb7):ae[_0x1dc85c(0x1ad)](_0x5effb7[_0x1dc85c(0x280)][_0x1dc85c(0x1df)])&&ae[_0x1dc85c(0x25a)](_0x5effb7);});}}},0x3e8);}),this['storeActionInLocalStorageInternal']=_0x52a8d3=>{const _0x37771d=_0x96f8;let _0x4a7392=()=>{const _0x4d5946=_0x96f8;let _0x2bd7b3=JSON[_0x4d5946(0x225)](localStorage[_0x4d5946(0x235)](_0x52a8d3)||'{}');Object[_0x4d5946(0x1d7)](_0x2bd7b3)[_0x4d5946(0x33b)](_0x20923e=>{const _0x25f86e=_0x4d5946;_0x2bd7b3[_0x20923e][_0x25f86e(0x1da)]=new Date()[_0x25f86e(0x29c)]();}),localStorage[_0x4d5946(0x2d3)](_0x52a8d3,JSON[_0x4d5946(0x309)](_0x2bd7b3));};_0x4a7392(),window['addEventListener'](_0x37771d(0x307),_0x4a7392);},this[_0x56990a(0x245)]=({id:_0x5b1ca3,localStorageKey:_0x36898b})=>{const _0x30a7ed=_0x56990a;let _0x21cbe1=JSON[_0x30a7ed(0x225)](localStorage[_0x30a7ed(0x235)](_0x36898b)||'{}');_0x21cbe1[_0x5b1ca3]&&delete _0x21cbe1[_0x5b1ca3],localStorage[_0x30a7ed(0x2d3)](_0x36898b,JSON[_0x30a7ed(0x309)](_0x21cbe1));},this[_0x56990a(0x1d2)]=({actionCondition:_0x18af9a,actionMethod:_0x58ab9f,localStorageKey:_0x19632a})=>{const _0x2a2217=_0x56990a;let _0x32eec2=JSON[_0x2a2217(0x225)](localStorage[_0x2a2217(0x235)](_0x19632a)||'{}');Object[_0x2a2217(0x1d7)](_0x32eec2)[_0x2a2217(0x33b)](_0x4cb760=>{_0x18af9a(_0x32eec2[_0x4cb760])&&_0x58ab9f(_0x32eec2[_0x4cb760]);});};}static['getInstance'](){return d(Z,ue)||I(Z,ue,new Z()),d(Z,ue);}['init'](_0x36f2c5,_0x5d22f7){return a(this,null,function*(){const _0x48066e=_0x96f8;s(0x1,_0x48066e(0x30d)),_0x5d22f7!=null&&_0x5d22f7[_0x48066e(0x311)]&&I(this,Te,!0x0),i(this,p,Ht)['call'](this,_0x36f2c5);let _0xc4c3b6=this[_0x48066e(0x247)]();if(_0xc4c3b6===_0x48066e(0x294)||_0xc4c3b6===_0x48066e(0x2e1)){s(0x2,'Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms');return;}if(yield N[_0x48066e(0x214)](),s(0x1,_0x48066e(0x1bd)),yield i(this,p,Ue)['call'](this,0x3),_0x5d22f7!=null&&_0x5d22f7[_0x48066e(0x311)]&&d(this,xe)['call'](this),_0x5d22f7!=null&&_0x5d22f7[_0x48066e(0x2d8)])try{g['loading']=!0x0,yield this[_0x48066e(0x248)](_0x5d22f7[_0x48066e(0x2d8)]);}finally{g[_0x48066e(0x2a4)]=!0x1;}setInterval(()=>a(this,null,function*(){const _0x5adb78=_0x48066e;s(0x1,_0x5adb78(0x1b7)),yield i(this,p,Ue)[_0x5adb78(0x1a0)](this,0x3);}),0x493e0);let _0x2b347b=i(this,p,Se)['call'](this);if(yield this[_0x48066e(0x2e4)](),yield u[_0x48066e(0x1ee)](),u[_0x48066e(0x32a)]({'eventName':'base_init'}),s(0x1,'Initializing\x20notification\x20service\x20from\x20Base\x20Service'),yield A(_0x48066e(0x2ab),()=>a(this,null,function*(){const _0x13a6b2=_0x48066e;yield W[_0x13a6b2(0x2f1)](_0x2b347b,_0x5d22f7==null?void 0x0:_0x5d22f7[_0x13a6b2(0x1bf)]);})),!(_0x5d22f7!=null&&_0x5d22f7[_0x48066e(0x311)])){yield i(this,p,nn)[_0x48066e(0x1a0)](this);let _0x3daa74=history[_0x48066e(0x1c3)];history[_0x48066e(0x1c3)]=(..._0x5377bd)=>{const _0x3d5389=_0x48066e;_0x3daa74[_0x3d5389(0x1fc)](history,_0x5377bd),i(this,p,tn)[_0x3d5389(0x1a0)](this);};}s(0x1,_0x48066e(0x29e));});}['setPlatform'](_0x4c2993){I(this,fe,_0x4c2993);}[_0x32fca5(0x31f)](_0x5e956f){I(this,he,_0x5e956f);}[_0x32fca5(0x26d)](_0x5c2b6a){I(this,be,_0x5c2b6a);}[_0x32fca5(0x33c)](_0x18fff6){I(this,ye,_0x18fff6);}[_0x32fca5(0x26e)](){return d(this,ye);}[_0x32fca5(0x247)](){return d(this,fe);}[_0x32fca5(0x30e)](){return d(this,he);}[_0x32fca5(0x2ff)](){return d(this,be);}[_0x32fca5(0x290)](){const _0x50d720=_0x32fca5;localStorage[_0x50d720(0x2d3)](_0x50d720(0x2b5),''+new Date()[_0x50d720(0x29c)]());}[_0x32fca5(0x329)]({data:_0x260925,displayMethod:_0x5d380c,timeValueKey:_0x3f1251}){const _0x5a38fc=_0x32fca5;let _0xe1831a=()=>{const _0x2e3a49=_0x96f8;var _0x3a67c3;let _0x14e16a=window[_0x2e3a49(0x1e5)],_0x3f313e=document[_0x2e3a49(0x1f0)][_0x2e3a49(0x19a)];window[_0x2e3a49(0x31c)]/(_0x3f313e-_0x14e16a)*0x64>(((_0x3a67c3=_0x260925[_0x3f1251])==null?void 0x0:_0x3a67c3['value'])||0x0)&&(window[_0x2e3a49(0x1ff)](_0x2e3a49(0x2c0),_0xe1831a),_0x5d380c(_0x260925));};window[_0x5a38fc(0x2f7)]('scroll',_0xe1831a);}[_0x32fca5(0x20e)]({clearActionMethod:_0x3fa34a,data:_0x16e0cc,displayMethod:_0x45130b,idKey:_0x377b5f,timeValueKey:_0x21479f}){const _0x3fac04=_0x32fca5;var _0x32742e,_0x2d6af3,_0x3babb5;let _0x135867=(_0x32742e=_0x16e0cc[_0x21479f])==null?void 0x0:_0x32742e[_0x3fac04(0x25c)];((_0x2d6af3=_0x16e0cc[_0x21479f])==null?void 0x0:_0x2d6af3[_0x3fac04(0x18d)])===_0x3fac04(0x2ea)&&(_0x135867=_0x135867*0x3c);let _0x669bdf=_0x16e0cc[_0x3fac04(0x1da)]-0x1f4+(_0x135867||0x0)*0x3e8-new Date()[_0x3fac04(0x29c)]();s(0x1,_0x3fac04(0x1c2)+_0x16e0cc[_0x3fac04(0x1da)]),s(0x1,'Time\x20value:\x20'+((_0x3babb5=_0x16e0cc[_0x21479f])==null?void 0x0:_0x3babb5['value'])),s(0x1,_0x3fac04(0x27f)+new Date()[_0x3fac04(0x29c)]()),s(0x1,_0x3fac04(0x23d)+_0x669bdf),_0x669bdf>0x0?setTimeout(()=>{_0x3fa34a(_0x16e0cc[_0x377b5f]),_0x45130b(_0x16e0cc);},_0x669bdf):(_0x3fa34a(_0x16e0cc[_0x377b5f]),_0x45130b(_0x16e0cc));}['storeActionInLocalStorage'](_0x2ab101,_0x33c783,_0x13b0a0){const _0x14f240=_0x32fca5;var _0x571bbf;let _0x59533f=JSON[_0x14f240(0x225)](localStorage[_0x14f240(0x235)](_0x33c783)||'{}'),_0x5693e7=(_0x571bbf=_0x13b0a0 in _0x2ab101&&_0x2ab101[_0x13b0a0])!=null?_0x571bbf:'';_0x5693e7&&(_0x59533f[_0x5693e7]=Pe(z({},_0x2ab101),{'initialTime':new Date()['getTime']()}),localStorage['setItem'](_0x33c783,JSON[_0x14f240(0x309)](_0x59533f)));}['checkTTL'](){return a(this,null,function*(){yield A('#\x20check\x20TTL',()=>a(this,null,function*(){const _0x101780=_0x96f8;if(d(this,Te))return;s(0x1,_0x101780(0x1e3)),C(_0x101780(0x1e3),!0x0),L('Checking\x20TTL\x20Time',!0x0);let _0x56caa9=localStorage[_0x101780(0x235)](_0x101780(0x2b5)),_0x46c422=!0x1;if(_0x56caa9){if(_0x46c422=i(this,p,Se)[_0x101780(0x1a0)](this,_0x56caa9),_0x46c422){let _0x1081cb=localStorage['getItem'](_0x101780(0x2fd)),_0x1bbd85=localStorage[_0x101780(0x235)](_0x101780(0x2b5));if(_0x1081cb&&_0x1bbd85){let _0x8c2878=parseInt(_0x1bbd85,0xa);u[_0x101780(0x28d)]({'eventName':_0x101780(0x2a3),'eventProperties':[{'eventProperty':_0x101780(0x1f3),'value':localStorage['getItem'](_0x101780(0x2fd))},{'eventProperty':'SESSION_CREATED','value':Number[_0x101780(0x31a)](_0x8c2878)?new Date(_0x8c2878)[_0x101780(0x2e3)]():new Date()['toISOString']()}]});}this[_0x101780(0x2b6)](),localStorage[_0x101780(0x2d3)](_0x101780(0x2b5),''+new Date()[_0x101780(0x29c)]());}}else localStorage[_0x101780(0x2d3)](_0x101780(0x2b5),''+new Date()['getTime']());(!_0x56caa9||_0x46c422||i(this,p,Yt)[_0x101780(0x1a0)](this))&&(i(this,p,nt)[_0x101780(0x1a0)](this)&&i(this,p,qt)[_0x101780(0x1a0)](this),i(this,p,tt)['call'](this)&&(yield this[_0x101780(0x248)]()),(i(this,p,Se)['call'](this)||i(this,p,Xe)[_0x101780(0x1a0)](this))&&(yield i(this,p,Xt)[_0x101780(0x1a0)](this)),yield i(this,p,Qt)[_0x101780(0x1a0)](this),(i(this,p,Se)[_0x101780(0x1a0)](this)||i(this,p,et)[_0x101780(0x1a0)](this))&&(yield i(this,p,en)['call'](this))),L('Checking\x20TTL\x20Time',!0x1),C(_0x101780(0x1e3),!0x1);}));});}['clearLocalStorage'](){const _0x519055=_0x32fca5;localStorage[_0x519055(0x1d5)](_0x519055(0x2bd)),localStorage[_0x519055(0x1d5)](_0x519055(0x2c3)),localStorage[_0x519055(0x1d5)]('attributes'),localStorage[_0x519055(0x1d5)]('offlineEvents'),localStorage[_0x519055(0x1d5)]('ttl'),localStorage['removeItem'](_0x519055(0x2fd));}[_0x32fca5(0x248)](_0x2fc322){return a(this,null,function*(){const _0x52bb2a=_0x96f8;let _0x413e3c={'deviceId':localStorage[_0x52bb2a(0x235)](_0x52bb2a(0x2b8))||crypto[_0x52bb2a(0x222)](),'os':this[_0x52bb2a(0x247)]()};if(_0x2fc322)_0x413e3c[_0x52bb2a(0x2d8)]=_0x2fc322;else{if(!_0x2fc322&&localStorage['getItem'](_0x52bb2a(0x334)))return;}try{let _0x4b6717=yield i(this,p,Zt)[_0x52bb2a(0x1a0)](this,_0x413e3c);if(_0x4b6717!==void 0x0){localStorage[_0x52bb2a(0x2d3)]('customer',_0x4b6717);try{W[_0x52bb2a(0x2c5)]({'customer':_0x4b6717});}catch(_0x57451e){}}}catch(_0x35d967){throw new Error(_0x52bb2a(0x218));}});}};ue=new WeakMap(),fe=new WeakMap(),he=new WeakMap(),be=new WeakMap(),ye=new WeakMap(),we=new WeakMap(),Te=new WeakMap(),xe=new WeakMap(),p=new WeakSet(),Ht=function(_0x5be11f){const _0x5e5241=_0x32fca5;N['updateAPIKey'](_0x5be11f),this[_0x5e5241(0x1cf)](i(this,p,jt)['call'](this)),this[_0x5e5241(0x31f)](i(this,p,zt)[_0x5e5241(0x1a0)](this)),this[_0x5e5241(0x26d)](navigator['userAgent']);},jt=function(){const _0x12e829=_0x32fca5;var _0x33ffce;let _0xe6962d=navigator[_0x12e829(0x293)]['toLowerCase']();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i[_0x12e829(0x1ef)](_0xe6962d)?_0x12e829(0x294):/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i['test'](_0xe6962d)?_0x12e829(0x2f8):/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i['test'](_0xe6962d)?('Notification'in window&&typeof((_0x33ffce=window==null?void 0x0:window[_0x12e829(0x296)])==null?void 0x0:_0x33ffce[_0x12e829(0x240)])!='undefined','Mobile'):/windows|macintosh|linux|x11/i[_0x12e829(0x1ef)](_0xe6962d)?_0x12e829(0x24d):_0x12e829(0x2e1);},zt=function(){const _0x142700=_0x32fca5;let _0x983cc4=navigator['userAgent'],_0x1df5dd;return _0x983cc4[_0x142700(0x347)]('Chrome')>-0x1?_0x1df5dd=_0x142700(0x2e0):_0x983cc4[_0x142700(0x347)](_0x142700(0x217))>-0x1?_0x1df5dd='Safari':_0x983cc4[_0x142700(0x347)](_0x142700(0x21e))>-0x1?_0x1df5dd=_0x142700(0x272):_0x983cc4[_0x142700(0x347)](_0x142700(0x1a2))>-0x1?_0x1df5dd=_0x142700(0x2a1):_0x983cc4[_0x142700(0x347)](_0x142700(0x205))>-0x1?_0x1df5dd=_0x142700(0x1c1):_0x1df5dd=_0x142700(0x2e1),_0x1df5dd;},Se=function(_0x2f7c0a){const _0x51b90e=_0x32fca5;let _0x355b77;return _0x2f7c0a||(_0x355b77=localStorage[_0x51b90e(0x235)](_0x51b90e(0x2b5))),_0x2f7c0a||_0x355b77?new Date()['getTime']()-parseInt(_0x2f7c0a||_0x355b77||'',0xa)>0x124f80:!0x0;},Xe=function(){const _0x1d2051=_0x32fca5;return!localStorage[_0x1d2051(0x235)]('events');},et=function(){const _0x3c1a68=_0x32fca5;return!localStorage[_0x3c1a68(0x235)](_0x3c1a68(0x2dc));},tt=function(){const _0x588d44=_0x32fca5;return!localStorage['getItem'](_0x588d44(0x334));},nt=function(){const _0x5ac16a=_0x32fca5;return!localStorage[_0x5ac16a(0x235)](_0x5ac16a(0x2b8));},Gt=function(){const _0x3f719c=_0x32fca5;return!localStorage[_0x3f719c(0x235)](_0x3f719c(0x2fd));},Yt=function(){const _0x447d01=_0x32fca5;return i(this,p,Xe)['call'](this)||i(this,p,et)['call'](this)||i(this,p,tt)[_0x447d01(0x1a0)](this)||i(this,p,nt)['call'](this)||i(this,p,Gt)[_0x447d01(0x1a0)](this);},qt=function(){const _0x6775c6=_0x32fca5;let _0x220ad3=localStorage[_0x6775c6(0x235)](_0x6775c6(0x2b8));return _0x220ad3||(_0x220ad3=crypto[_0x6775c6(0x222)](),localStorage[_0x6775c6(0x2d3)](_0x6775c6(0x2b8),_0x220ad3)),_0x220ad3;},Qt=function(){return a(this,null,function*(){const _0x365cfa=_0x96f8;yield A(_0x365cfa(0x262),()=>a(this,null,function*(){const _0x30f77d=_0x365cfa;let _0x8ebce=localStorage[_0x30f77d(0x235)](_0x30f77d(0x2fd));if(!_0x8ebce){_0x8ebce=crypto[_0x30f77d(0x222)](),localStorage[_0x30f77d(0x2d3)](_0x30f77d(0x2fd),_0x8ebce);let _0x11ec2d=localStorage[_0x30f77d(0x235)]('ttl'),_0x517f3a=_0x11ec2d?parseInt(_0x11ec2d,0xa):'';yield u['recordEvent']({'eventName':'Web\x20Session\x20Started','eventProperties':[{'eventProperty':_0x30f77d(0x1f3),'value':localStorage[_0x30f77d(0x235)](_0x30f77d(0x2fd))},{'eventProperty':_0x30f77d(0x22b),'value':_0x517f3a?new Date(_0x517f3a)[_0x30f77d(0x2e3)]():new Date()['toISOString']()}]});}}),_0x1471fa=>{const _0x370af8=_0x365cfa;u[_0x370af8(0x28d)]({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':_0x370af8(0x280),'value':_0x370af8(0x27d)+_0x1471fa[_0x370af8(0x280)]}]},!0x0);});});},Zt=function(_0x191549){return a(this,null,function*(){const _0x7c5c2a=_0x96f8;try{return(yield N[_0x7c5c2a(0x1de)](''+It+ft,_0x191549))[_0x7c5c2a(0x279)];}catch(_0xfc4610){throw new Error(_0x7c5c2a(0x273));}});},Xt=function(){return a(this,null,function*(){yield u['storeEventsAndPropertiesInLocalStorage']();});},en=function(){return a(this,null,function*(){const _0x612e1d=_0x96f8;yield me[_0x612e1d(0x254)]();});},Ue=function(_0xe0de3d){return a(this,null,function*(){const _0x429652=_0x96f8;yield A(_0x429652(0x1ac),()=>a(this,null,function*(){const _0x33c9a2=_0x429652;var _0x6d4fc8;try{let _0x2b82ee=parseInt(localStorage[_0x33c9a2(0x235)]('verifyTTL')||'0',0xa)||0x0;if(!_0x2b82ee||_0x2b82ee&&new Date()[_0x33c9a2(0x29c)]()>_0x2b82ee){let _0x1634a2=yield N[_0x33c9a2(0x1e1)](_0x33c9a2(0x1b6));if(!(_0x1634a2!=null&&_0x1634a2[_0x33c9a2(0x1f2)]))throw new Error(JSON[_0x33c9a2(0x309)](_0x1634a2));localStorage[_0x33c9a2(0x2d3)](_0x33c9a2(0x20f),(new Date()[_0x33c9a2(0x29c)]()+0x493e0)[_0x33c9a2(0x22a)]());}g[_0x33c9a2(0x260)]=!0x1,g[_0x33c9a2(0x327)]=!0x0;}catch(_0x59b859){if(N[_0x33c9a2(0x234)]()==='67'&&(!((_0x6d4fc8=_0x59b859==null?void 0x0:_0x59b859[_0x33c9a2(0x280)])!=null&&_0x6d4fc8[_0x33c9a2(0x19c)]('get'))||(_0x59b859==null?void 0x0:_0x59b859[_0x33c9a2(0x280)])!==_0x33c9a2(0x2fb))&&u[_0x33c9a2(0x28d)]({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':'message','value':_0x33c9a2(0x21d)+_0x59b859[_0x33c9a2(0x280)]}]},!0x0),_0xe0de3d&&_0xe0de3d>=0x1){yield i(this,p,Ue)['call'](this,_0xe0de3d-0x1);return;}throw g[_0x33c9a2(0x260)]=!0x0,new Error(_0x33c9a2(0x2fb));}}));});},rt=function(){return a(this,null,function*(){const _0x3c89f6=_0x96f8;var _0xa03902;s(0x1,'Performing\x20viewed\x20web\x20page\x20event');let _0x287052=(_0xa03902=window==null?void 0x0:window[_0x3c89f6(0x1f6)])==null?void 0x0:_0xa03902[_0x3c89f6(0x1dd)];this[_0x3c89f6(0x33c)](_0x287052),u['recordDebugEvents']({'eventName':'pre_vwp'});let _0x59e9da=[];new URLSearchParams(new URL(window[_0x3c89f6(0x1f6)][_0x3c89f6(0x1dd)])[_0x3c89f6(0x23e)])[_0x3c89f6(0x33b)]((_0x28ed0b,_0x1266fb)=>a(this,null,function*(){const _0x5f355e=_0x3c89f6;wt[_0x5f355e(0x2b4)](_0x1266fb)&&_0x59e9da[_0x5f355e(0x27b)]({'eventProperty':_0x1266fb,'value':_0x28ed0b});})),yield u[_0x3c89f6(0x28d)]({'eventName':'Viewed\x20Webpage','eventProperties':[{'eventProperty':'URL','value':window[_0x3c89f6(0x1f6)][_0x3c89f6(0x1b3)]},..._0x59e9da]});});},tn=function(){return a(this,null,function*(){const _0xbb219a=_0x96f8;var _0x42edcb;s(0x1,_0xbb219a(0x1ba));let _0x3373d6=(_0x42edcb=window==null?void 0x0:window[_0xbb219a(0x1f6)])==null?void 0x0:_0x42edcb['href'];(this[_0xbb219a(0x26e)]()===null||this[_0xbb219a(0x26e)]()===void 0x0||_0x3373d6!==this[_0xbb219a(0x26e)]())&&(yield i(this,p,rt)[_0xbb219a(0x1a0)](this));});},nn=function(){return a(this,null,function*(){const _0x4faf91=_0x96f8;var _0x4b0f03,_0x43c0bc;let _0x74d19d=(_0x4b0f03=window==null?void 0x0:window[_0x4faf91(0x1f6)])==null?void 0x0:_0x4b0f03['href'];u['recordDebugEvents']({'eventName':_0x4faf91(0x1e6),'eventProperties':[{'eventProperty':_0x4faf91(0x280),'value':(_0x74d19d!==this[_0x4faf91(0x26e)]())+':'+_0x74d19d+':'+this[_0x4faf91(0x26e)]()}]});try{yield i(this,p,rt)[_0x4faf91(0x1a0)](this);}catch(_0x1edca1){let _0x383b03=_0x1edca1&&_0x1edca1[_0x4faf91(0x280)]?(_0x43c0bc=_0x1edca1==null?void 0x0:_0x1edca1[_0x4faf91(0x280)])==null?void 0x0:_0x43c0bc[_0x4faf91(0x278)](0x0,0x64):_0x4faf91(0x2ee);yield u['recordDebugEvents']({'eventName':'vwp_error','eventProperties':[{'eventProperty':_0x4faf91(0x280),'value':''+_0x383b03}]});}});},m(Z,ue);var Ze=Z,E=Ze[_0x32fca5(0x1a9)](),X,R,rn,We,on,sn,an,cn,j=class j{constructor(){const _0x49d69d=_0x32fca5;m(this,R),this[_0x49d69d(0x33a)]=Promise[_0x49d69d(0x258)]();}static['getInstance'](){var _0x6848ec;return d(j,X)||(I(j,X,new j()),i(_0x6848ec=d(j,X),R,rn)['call'](_0x6848ec)),d(j,X);}['pushToQueue'](_0x1724c5){const _0x39d990=_0x32fca5;let _0x1a2dd6=JSON[_0x39d990(0x225)](localStorage[_0x39d990(0x235)](_0x39d990(0x21a))||'[]');_0x1a2dd6[_0x39d990(0x27b)](_0x1724c5),localStorage[_0x39d990(0x2d3)](_0x39d990(0x21a),JSON['stringify'](_0x1a2dd6));}[_0x32fca5(0x1ee)](){return a(this,null,function*(){const _0x3289ec=_0x96f8;let _0x5d78a4=JSON[_0x3289ec(0x225)](localStorage['getItem'](_0x3289ec(0x21a))||'[]');if(Array['isArray'](_0x5d78a4)){for(let _0x13076c of _0x5d78a4)yield this['recordEventPreInitialized'](_0x13076c);}});}[_0x32fca5(0x28d)](_0x4776ee,_0x34ae90){return a(this,null,function*(){const _0x1ed0fa=_0x96f8;g[_0x1ed0fa(0x327)]&&!g['loading']?yield i(this,R,We)['call'](this,_0x4776ee,_0x34ae90):this[_0x1ed0fa(0x30c)](_0x4776ee);});}[_0x32fca5(0x2e6)](_0x4e69af){return a(this,null,function*(){const _0x48df04=_0x96f8;try{yield i(this,R,We)[_0x48df04(0x1a0)](this,_0x4e69af);}finally{i(this,R,cn)[_0x48df04(0x1a0)](this,_0x4e69af[_0x48df04(0x291)]);}});}[_0x32fca5(0x32a)](_0xa22002){return a(this,null,function*(){const _0x28c4f2=_0x96f8;g['debugLevel']===0x4&&(!g[_0x28c4f2(0x197)]||g[_0x28c4f2(0x197)][_0xa22002[_0x28c4f2(0x291)]])&&(yield i(this,R,We)[_0x28c4f2(0x1a0)](this,_0xa22002));});}[_0x32fca5(0x2f5)](){const _0x27e046=_0x32fca5;let _0x11c090=localStorage['getItem'](_0x27e046(0x2c3));return _0x11c090?JSON['parse'](_0x11c090):{};}[_0x32fca5(0x203)](){return a(this,null,function*(){const _0x54ca2e=_0x96f8;if(!localStorage[_0x54ca2e(0x235)](_0x54ca2e(0x2c3))){let _0x4e38f8=(yield this[_0x54ca2e(0x2fc)]())['data'];if(_0x4e38f8){localStorage[_0x54ca2e(0x2d3)](_0x54ca2e(0x2c3),JSON[_0x54ca2e(0x309)](_0x4e38f8));try{W['pushMessageToSW']({'events':_0x4e38f8});}catch(_0x4dbd7f){}}}});}[_0x32fca5(0x2fc)](){return a(this,null,function*(){const _0x463be8=_0x96f8;try{return yield N[_0x463be8(0x1e1)](''+Be);}catch(_0x30f5d2){throw new Error(_0x463be8(0x2f9));}});}['postEventRecord'](_0x2a8058,_0x534b85){return a(this,null,function*(){const _0x3119f2=_0x96f8;let _0x29848f=null,_0x22293e=null,_0x8b5533=new AbortController();return this[_0x3119f2(0x33a)]=this[_0x3119f2(0x33a)]['then'](()=>a(this,null,function*(){const _0x1cf257=_0x3119f2;try{if(_0x2a8058[_0x1cf257(0x2c3)][_0x1cf257(0x304)]===0x0)throw new Error(_0x1cf257(0x264));let _0x1a094d=yield N[_0x1cf257(0x1de)](_0x1cf257(0x229)+Be+vt,_0x2a8058,_0x8b5533['signal']);if(_0x1a094d[_0x1cf257(0x1f2)])return _0x22293e=_0x1a094d,_0x1a094d;if(_0x1a094d[_0x1cf257(0x280)]===_0x1cf257(0x249)+localStorage[_0x1cf257(0x235)]('customer')+_0x1cf257(0x29d))throw localStorage[_0x1cf257(0x1d5)]('customer'),new Error(_0x1cf257(0x315));}catch(_0x23bc6a){throw s(0x2,'Error\x20posting\x20event\x20record:'),s(0x2,_0x1cf257(0x20b)+_0x23bc6a[_0x1cf257(0x1df)]),s(0x2,_0x1cf257(0x261)+_0x23bc6a[_0x1cf257(0x280)]),(_0x23bc6a[_0x1cf257(0x1df)]===_0x1cf257(0x200)||_0x23bc6a[_0x1cf257(0x1df)]===_0x1cf257(0x28e)&&_0x23bc6a['message']==='Failed\x20to\x20fetch')&&(s(0x2,'Request\x20aborted'),_0x534b85&&i(this,R,an)[_0x1cf257(0x1a0)](this,_0x534b85)),_0x29848f=new Error(_0x1cf257(0x228)),_0x23bc6a;}return null;}))['catch'](()=>{}),this[_0x3119f2(0x33a)][_0x3119f2(0x22c)](()=>{if(_0x29848f)throw _0x29848f;return _0x22293e;});});}};X=new WeakMap(),R=new WeakSet(),rn=function(){return a(this,null,function*(){});},We=function(_0x280dac,_0x278f08){return a(this,null,function*(){const _0x287117=_0x96f8;yield A(_0x287117(0x1e4),()=>a(this,null,function*(){const _0x1688d3=_0x287117;var _0x2d09d5,_0x4e5758,_0x2a354d,_0xc57b56;let {campaignCustomerInstanceId:_0x3f7324,campaignId:_0x536d93,eventName:_0x37dfbc,eventProperties:_0x565fa4,name:_0x20c106,web_optin_instance_id:_0x291c1c}=_0x280dac;s(0x1,_0x1688d3(0x324)),C('Recording\x20event',!0x0),L(_0x1688d3(0x1c9),!0x0),s(0x1,'Event\x20Payload'),s(0x1,{'campaignCustomerInstanceId':_0x3f7324,'eventName':_0x37dfbc,'eventProperties':_0x565fa4,'name':_0x20c106,'web_optin_instance_id':_0x291c1c});let _0x377b13=E[_0x1688d3(0x247)]();if(_0x377b13==='Crawlers'||_0x377b13==='Unknown')throw new Error(_0x1688d3(0x1ca));_0x37dfbc!=='Web\x20Session\x20Concluded'&&(yield E['checkTTL']());let _0x228d9b=[];_0x565fa4&&_0x228d9b[_0x1688d3(0x27b)](..._0x565fa4),_0x228d9b[_0x1688d3(0x27b)]({'eventProperty':_0x1688d3(0x281),'value':_0x377b13}),_0x228d9b[_0x1688d3(0x27b)]({'eventProperty':_0x1688d3(0x192),'value':E[_0x1688d3(0x2ff)]()}),_0x228d9b['push']({'eventProperty':_0x1688d3(0x30b),'value':E[_0x1688d3(0x30e)]()});let _0x3341ed=this['getStoredEvents'](),_0x413c4e=i(this,R,on)[_0x1688d3(0x1a0)](this,_0x3341ed,_0x37dfbc,_0x228d9b);if(typeof _0x413c4e=='string'){s(0x2,_0x413c4e);return;}E['updateSessionCreated']();let {id:_0x413615}=_0x3341ed[_0x37dfbc],_0x5f04fe=i(this,R,sn)[_0x1688d3(0x1a0)](this,z(Pe(z(z(z({},_0x3f7324?{'campaignCustomerInstanceId':_0x3f7324}:{}),_0x536d93?{'campaignId':_0x536d93}:{}),_0x291c1c?{'web_optin_instance_id':_0x291c1c}:{}),{'eventId':_0x413615,'eventProperties':_0x413c4e,'sessionId':localStorage['getItem']('session')||''}),_0x20c106?{'name':_0x20c106}:{}));if(g['offline']){let _0x3f0669=JSON[_0x1688d3(0x225)](localStorage[_0x1688d3(0x235)](_0x1688d3(0x1ea))||'[]');_0x3f0669[_0x1688d3(0x304)]<=0x32&&(_0x3f0669[_0x1688d3(0x27b)](..._0x5f04fe[_0x1688d3(0x2c3)]),localStorage[_0x1688d3(0x2d3)](_0x1688d3(0x1ea),JSON[_0x1688d3(0x309)](_0x3f0669)));return;}let _0x42acbd=yield this[_0x1688d3(0x1c5)](_0x5f04fe,_0x280dac);(_0x2d09d5=_0x42acbd==null?void 0x0:_0x42acbd[_0x1688d3(0x279)])!=null&&_0x2d09d5[_0x1688d3(0x2cc)]?(yield this['recordDebugEvents']({'eventName':_0x1688d3(0x2ef)}),W[_0x1688d3(0x301)](_0x42acbd[_0x1688d3(0x279)][_0x1688d3(0x2cc)])):_0x37dfbc===_0x1688d3(0x2fa)&&(yield this[_0x1688d3(0x32a)]({'eventName':_0x1688d3(0x259),'eventProperties':[{'eventProperty':_0x1688d3(0x280),'value':''+('Notification'in window&&typeof((_0x4e5758=window==null?void 0x0:window[_0x1688d3(0x296)])==null?void 0x0:_0x4e5758['permission'])!=_0x1688d3(0x2ee))}]})),(_0xc57b56=(_0x2a354d=_0x42acbd==null?void 0x0:_0x42acbd[_0x1688d3(0x279)])==null?void 0x0:_0x2a354d[_0x1688d3(0x252)])==null||_0xc57b56[_0x1688d3(0x33b)](_0x5d349a=>{const _0x4e0325=_0x1688d3;H['isPopupAction'](_0x5d349a['message'][_0x4e0325(0x1df)])?H[_0x4e0325(0x204)](_0x5d349a):ae[_0x4e0325(0x1ad)](_0x5d349a[_0x4e0325(0x280)][_0x4e0325(0x1df)])&&ae[_0x4e0325(0x25a)](_0x5d349a);}),L(_0x1688d3(0x1c9),!0x1),C(_0x1688d3(0x348),!0x1);}),_0x4cd09e=>{const _0x3693bb=_0x287117;this['recordEvent']({'eventName':_0x3693bb(0x2cd),'eventProperties':[{'eventProperty':_0x3693bb(0x280),'value':'record\x20event\x20-\x20'+_0x280dac+_0x3693bb(0x212)+_0x4cd09e[_0x3693bb(0x280)]}]},!0x0);},_0x278f08);});},on=function(_0x468a97,_0x58edf0,_0x59103e){const _0x33e74b=_0x32fca5;if(!Object['prototype'][_0x33e74b(0x1b5)]['call'](_0x468a97,_0x58edf0))return'Event\x20'+_0x58edf0+'\x20is\x20not\x20valid.';if(!_0x59103e)return[];let _0x1a0040=_0x468a97[_0x58edf0];if(!(_0x1a0040!=null&&_0x1a0040[_0x33e74b(0x295)]))return _0x33e74b(0x341)+_0x58edf0+_0x33e74b(0x2aa);let _0x1dba4b=_0x59103e[_0x33e74b(0x1db)](({eventProperty:_0x457767})=>!Object[_0x33e74b(0x2b1)][_0x33e74b(0x1b5)]['call'](_0x1a0040[_0x33e74b(0x295)],_0x457767))[_0x33e74b(0x263)](({eventProperty:_0x50b884})=>_0x50b884);return _0x1dba4b[_0x33e74b(0x304)]>0x0?_0x33e74b(0x341)+_0x58edf0+'\x20has\x20invalid\x20eventProperties:\x20'+_0x1dba4b[_0x33e74b(0x30f)](',\x20')+'.':_0x59103e['map'](({eventProperty:_0x4665f2,value:_0x3e10ba})=>({'eventPropertyId':_0x1a0040[_0x33e74b(0x295)][_0x4665f2]['id'],'value':_0x3e10ba}));},sn=function(_0x388b79){const _0x56ee38=_0x32fca5;return{'customerId':localStorage[_0x56ee38(0x235)]('customer')||'','deviceId':localStorage[_0x56ee38(0x235)]('uniqueIdentity')||'','events':[_0x388b79]};},an=function(_0x473fec){const _0x2fde41=_0x32fca5;s(0x1,_0x2fde41(0x18f)),s(0x1,_0x473fec);let _0x32f444=localStorage[_0x2fde41(0x235)](_0x2fde41(0x21a));_0x32f444&&_0x32f444!=='undefined'?(_0x32f444=JSON[_0x2fde41(0x225)](_0x32f444),_0x32f444[_0x2fde41(0x27b)](_0x473fec)):_0x32f444=[_0x473fec],localStorage['setItem']('preInitializedEvents',JSON[_0x2fde41(0x309)](_0x32f444));},cn=function(_0x1ce26c){const _0x3b8e6c=_0x32fca5;let _0x111b62=JSON[_0x3b8e6c(0x225)](localStorage[_0x3b8e6c(0x235)](_0x3b8e6c(0x21a))||'[]'),_0x25beab=_0x111b62[_0x3b8e6c(0x1ab)](_0x33802b=>_0x33802b['eventName']===_0x1ce26c);_0x25beab>=0x0&&_0x111b62[_0x3b8e6c(0x1c4)](_0x25beab,0x1),localStorage[_0x3b8e6c(0x2d3)](_0x3b8e6c(0x21a),JSON[_0x3b8e6c(0x309)](_0x111b62));},m(j,X);var it=j,u=it[_0x32fca5(0x1a9)](),g=class extends Error{constructor(_0x3051de){const _0x387282=_0x32fca5;super(_0x3051de),this[_0x387282(0x1df)]=_0x387282(0x1cb);}};g[_0x32fca5(0x260)]=!0x1,g['offline']=!navigator['onLine'],g[_0x32fca5(0x226)]=0x0,g[_0x32fca5(0x327)]=!0x1,g[_0x32fca5(0x2a4)]=!0x1;var vn=(_0x30728a,_0x528011)=>{const _0x333e8d=_0x32fca5;_0x528011 instanceof g?s(0x2,_0x333e8d(0x1c6)+_0x30728a+_0x333e8d(0x202)+_0x528011[_0x333e8d(0x280)]):_0x528011 instanceof Error?s(0x2,_0x333e8d(0x1c6)+_0x30728a+_0x333e8d(0x194)+_0x528011[_0x333e8d(0x280)]):s(0x2,_0x333e8d(0x1c6)+_0x30728a+'\x0aUnexpected\x20error:\x20'+String(_0x528011));},A=(_0x1dd65a,_0x135b44,_0x561dcb,_0x399ff4=!0x1)=>a(void 0x0,null,function*(){const _0x2f9208=_0x32fca5;try{C(_0x1dd65a,!0x0),L(_0x1dd65a+_0x2f9208(0x1b8),!0x0);try{if(g['disableSDK'])throw new g(_0x2f9208(0x287));if(_0x1dd65a!==_0x2f9208(0x1b1)&&g['offline'])throw new g(_0x2f9208(0x26f));if(_0x1dd65a!==_0x2f9208(0x2f1)&&_0x1dd65a!==_0x2f9208(0x1ac)&&_0x1dd65a!=='record\x20event'&&_0x1dd65a!==_0x2f9208(0x1a8)&&!g[_0x2f9208(0x327)])throw new g(_0x2f9208(0x1fe));if(_0x1dd65a!==_0x2f9208(0x27e)&&g[_0x2f9208(0x2a4)])throw new g(_0x2f9208(0x20c));return yield _0x135b44();}catch(_0x3690ba){return _0x561dcb?_0x561dcb(_0x3690ba):(g[_0x2f9208(0x226)]===0x2||g[_0x2f9208(0x226)]===0x3)&&vn(_0x1dd65a,_0x3690ba),!_0x399ff4&&N[_0x2f9208(0x234)]()==='67'&&_0x3690ba[_0x2f9208(0x280)]!==_0x2f9208(0x310)&&u[_0x2f9208(0x28d)]({'eventName':_0x2f9208(0x2cd),'eventProperties':[{'eventProperty':_0x2f9208(0x280),'value':_0x1dd65a+'\x20-\x20'+_0x3690ba['message']}]},!0x0),null;}finally{L(_0x1dd65a+_0x2f9208(0x1b8),!0x1),C(_0x1dd65a,!0x1);}}catch(_0x5052ec){return null;}}),U=(_0x4b13c4=>(_0x4b13c4[_0x4b13c4['NONE']=0x0]=_0x32fca5(0x2ad),_0x4b13c4[_0x4b13c4['INFO']=0x1]='INFO',_0x4b13c4[_0x4b13c4[_0x32fca5(0x242)]=0x2]='ERROR',_0x4b13c4[_0x4b13c4[_0x32fca5(0x277)]=0x3]=_0x32fca5(0x277),_0x4b13c4[_0x4b13c4[_0x32fca5(0x32e)]=0x4]=_0x32fca5(0x32e),_0x4b13c4))(U||{}),s=(_0x2c3356,_0x6132ff)=>{const _0x12f5d1=_0x32fca5;g[_0x12f5d1(0x226)]!==0x0&&(g[_0x12f5d1(0x226)]>=0x3?_0x2c3356===0x1?console['info'](_0x12f5d1(0x1cd)+new Date()['toISOString'](),_0x6132ff):_0x2c3356===0x2&&console[_0x12f5d1(0x332)]('ERROR:\x20'+new Date()[_0x12f5d1(0x2e3)](),_0x6132ff):g[_0x12f5d1(0x226)]===0x1&&_0x2c3356===0x1?console['info']('INFO:\x20'+new Date()['toISOString'](),_0x6132ff):g[_0x12f5d1(0x226)]===0x2&&_0x2c3356===0x2&&console['error'](_0x12f5d1(0x326)+new Date()[_0x12f5d1(0x2e3)](),_0x6132ff));},L=(_0x3307d7,_0x2dbe19)=>{const _0x3255b9=_0x32fca5;g[_0x3255b9(0x226)]!==0x0&&(_0x2dbe19?console['time'](_0x3307d7):console[_0x3255b9(0x2d1)](_0x3307d7));},C=(_0x4b07f3,_0x4bbfd0)=>{const _0x2d5819=_0x32fca5;g[_0x2d5819(0x226)]!==0x0&&(_0x4bbfd0?console[_0x2d5819(0x199)](_0x4b07f3):console[_0x2d5819(0x308)]());},pe,ee=class ee{constructor(){}static['getInstance'](){return d(ee,pe)||I(ee,pe,new ee()),d(ee,pe);}['init'](_0x1865e9,_0xc8636a){setTimeout(()=>{const _0x1f8b03=_0x96f8;A(_0x1f8b03(0x2f1),()=>a(this,null,function*(){const _0x4ee083=_0x1f8b03;s(0x1,_0x4ee083(0x274)),yield E[_0x4ee083(0x2f1)](_0x1865e9,_0xc8636a),u[_0x4ee083(0x32a)]({'eventName':_0x4ee083(0x1e2)}),s(0x1,'Mergn\x20SDK\x20Initialized');let _0xb843e=JSON[_0x4ee083(0x225)](localStorage[_0x4ee083(0x235)]('preInitializedAttributes')||'[]');Array['isArray'](_0xb843e)&&_0xb843e[_0x4ee083(0x33b)]((_0x23cf3e,_0x513740)=>a(this,null,function*(){const _0x528232=_0x4ee083;yield me['recordAttribute'](_0x23cf3e['attributeName'],_0x23cf3e['attributeValue']),_0xb843e['splice'](_0x513740,0x1),localStorage[_0x528232(0x2d3)](_0x528232(0x1ce),JSON['stringify'](_0xb843e));})),window[_0x4ee083(0x2f7)](_0x4ee083(0x2b3),()=>a(this,null,function*(){const _0x181318=_0x4ee083;g[_0x181318(0x2a0)]=!0x1;let _0x1ecefe=JSON[_0x181318(0x225)](localStorage[_0x181318(0x235)](_0x181318(0x1ea))||'[]');Array[_0x181318(0x2ed)](_0x1ecefe)&&(yield u[_0x181318(0x1c5)]({'customerId':localStorage['getItem'](_0x181318(0x334))||'','deviceId':localStorage[_0x181318(0x235)](_0x181318(0x2b8))||'','events':_0x1ecefe}),localStorage['removeItem'](_0x181318(0x1ea))),E[_0x181318(0x2e4)](),E[_0x181318(0x290)]();})),window['addEventListener'](_0x4ee083(0x2a0),()=>{const _0x110a6=_0x4ee083;g[_0x110a6(0x2a0)]=!0x0;}),window[_0x4ee083(0x2f7)](_0x4ee083(0x2f4),()=>{const _0x217b22=_0x4ee083;H['loadPopupEventActionInLocalStorage'](),W[_0x217b22(0x2d4)]();});}));});}[_0x32fca5(0x2fe)](_0x153bd3,_0x26dd3c){const _0x1aec44=_0x32fca5;if(!(_0x153bd3 in U)){console[_0x1aec44(0x332)](_0x1aec44(0x18e));return;}g[_0x1aec44(0x197)]=_0x26dd3c||{},g[_0x1aec44(0x226)]=_0x153bd3;try{W[_0x1aec44(0x2c5)]({'debugLevel':_0x153bd3});}catch(_0x2d1317){}}[_0x32fca5(0x1a8)](_0x5936cf,_0x29cc44){return a(this,null,function*(){return new Promise((_0x31c03f,_0x2a9187)=>{setTimeout(()=>a(this,null,function*(){try{yield A('recordAttribute',()=>a(this,null,function*(){const _0x1fd18a=_0x96f8;let _0x39a934;Array[_0x1fd18a(0x2ed)](_0x29cc44)?_0x39a934=JSON[_0x1fd18a(0x309)](_0x29cc44):typeof _0x29cc44==_0x1fd18a(0x2a7)?_0x39a934=''+_0x29cc44:_0x39a934=_0x29cc44,s(0x1,_0x1fd18a(0x237)),s(0x1,_0x1fd18a(0x2df)+_0x5936cf+_0x1fd18a(0x2bf)+_0x39a934);let _0x56e0d7=JSON[_0x1fd18a(0x225)](localStorage[_0x1fd18a(0x235)]('preInitializedAttributes')||'[]');_0x56e0d7[_0x1fd18a(0x27b)]({'attributeName':_0x5936cf,'attrValueStringified':_0x39a934}),localStorage[_0x1fd18a(0x2d3)](_0x1fd18a(0x1ce),JSON['stringify'](_0x56e0d7)),g['isInitialized']&&(yield me['recordAttribute'](_0x5936cf,_0x39a934));})),_0x31c03f();}catch(_0x320732){_0x2a9187(_0x320732);}}));});});}[_0x32fca5(0x27e)](_0xbcdb80){return a(this,null,function*(){return new Promise((_0x5b14b5,_0x22adea)=>{setTimeout(()=>a(this,null,function*(){const _0x1c94d5=_0x96f8;try{yield A(_0x1c94d5(0x27e),()=>a(this,null,function*(){const _0x33c465=_0x1c94d5;s(0x1,'Logging\x20in'),s(0x1,_0x33c465(0x330)+_0xbcdb80),g[_0x33c465(0x2a4)]=!0x0,yield E[_0x33c465(0x248)](_0xbcdb80);})),_0x5b14b5();}catch(_0x52677a){_0x22adea(_0x52677a);}finally{g[_0x1c94d5(0x2a4)]=!0x1,yield u['recordEventsFromQueue']();}}));});});}[_0x32fca5(0x333)](){setTimeout(()=>{const _0x1d5acb=_0x96f8;A(_0x1d5acb(0x333),()=>a(this,null,function*(){const _0x5659cb=_0x1d5acb;s(0x1,_0x5659cb(0x2c9)),E['clearLocalStorage']();}));});}[_0x32fca5(0x28d)](_0x3edeac,_0x3e388d){return a(this,null,function*(){return new Promise((_0x31e36a,_0x23ada0)=>{setTimeout(()=>a(this,null,function*(){const _0x686a59=_0x96f8;try{yield A(_0x686a59(0x1b1),()=>a(this,null,function*(){const _0x4393b6=_0x686a59;s(0x1,_0x4393b6(0x348)),s(0x1,_0x4393b6(0x201)+{'eventName':_0x3edeac,'eventProperties':_0x3e388d}),yield u[_0x4393b6(0x28d)]({'eventName':_0x3edeac,'eventProperties':_0x3e388d});})),_0x31e36a();}catch(_0x3e2589){_0x23ada0(_0x3e2589);}}));});});}[_0x32fca5(0x219)](){return mt;}};pe=new WeakMap(),m(ee,pe);var ot=ee,st=ot[_0x32fca5(0x1a9)]();typeof window!=_0x32fca5(0x2ee)&&(window[_0x32fca5(0x2e8)]=st);var Bi=st;export{Bi as default};function _0x478f(){const _0x41a386=['apply','appendChild','Mergn\x20not\x20initialized!','removeEventListener','AbortError','Event\x20Payload:\x0a\x20','\x0aMergnError:\x20','storeEventsAndPropertiesInLocalStorage','showPopup','MSIE','loadContentCardEventActionInLocalStorage','Accepted\x20Web\x20Push\x20Soft-ask','add','Popup','auto','name:\x20','Mergn\x20is\x20loading!','innerHTML','showDelayedAction','verifyTTL','brandId','storeActionInLocalStorageInternal','\x20-\x20','access\x20private\x20method','syncRealWorldTime','width','alt','Safari','Error\x20setting\x20identity','getVersion','preInitializedEvents','\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0adisplay:\x20block;\x0amargin-left:\x20auto;\x0amargin-right:\x20auto;\x0aborder-radius:\x2010px;\x0amax-width:\x20350px;\x0aaspect-ratio:\x202\x20/\x201;\x0a','\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a','verifyAPIKey\x20-\x20','Firefox','User\x20denied\x20the\x20notification\x20permission.','display','getRegistrations','randomUUID','textContent','string','parse','debugLevel','Service\x20Worker\x20registration','Error\x20posting\x20event\x20record','/v2','toString','SESSION_CREATED','then','push_manager','DELAY','IMMEDIATELY','Recording\x20attribute\x20Time','mergn-column-25','text_color','Popup\x20overlay\x20element\x20found','getBrandId','getItem','.u-close-button','Recording\x20attribute','No\x20existing\x20subscription\x20found','Checking\x20notification\x20permission:\x20','notification_service_not_initialized','Service\x20Worker\x20registered','.u-popup-container','Time\x20difference:\x20','search','campaignEntryTimeValue','permission','getAttribute','ERROR','Popup\x20already\x20displayed','cssText','clearActionInLocalStorage','button_1','getPlatform','setIdentity','Customer\x20with\x20id\x20','getSubscription','contentCard_container_','ContentCard\x20already\x20in\x20cache','Web','Displayed\x20Web\x20Push\x20Subscription','backgroundColor','position','/set-identity','campaigns','Allowed\x20Web\x20Push\x20Subscription','storeAttributeInLocalStorage','write\x20to\x20private\x20field','height','fbclid','resolve','no_optin','showContentCard','/brand/get-time','value','notification_permission_error','button-1','Failed\x20to\x20check\x20notification\x20permission','disableSDK','message:\x20','store\x20session','map','No\x20events\x20to\x20record','15136VDUOrw','web_push_action','banner_title','subtitle','34740jcClzO','fixed','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set','default','setOperatingSystem','getPreviousUrl','Mergn\x20is\x20offline!','1834154MrfFsm','https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api','Mozilla\x20Firefox','Error\x20posting\x20identity\x20data','Initializing\x20Mergn\x20SDK','\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.','querySelectorAll','ALL','substring','data','User\x20closed\x20the\x20notification\x20permission\x20dialog.','push','button','store\x20session\x20-\x20','login','Current\x20time:\x20','message','Platform',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','fetchAttributeData','mergn-row','Close\x20Click','defineProperties','Mergn\x20SDK\x20is\x20disabled!','Failed\x20to\x20sync\x20real-world\x20time','title','match','values','denied','recordEvent','TypeError','/attribute','updateSessionCreated','eventName','UTM_TERM','userAgent','Crawlers','eventProperty','Notification','Denied\x20Web\x20Push\x20Soft-ask','Popup\x20Action','gclid','banner_text','27429Iirshg','getTime','\x20not\x20exists','tracking\x20page\x20change\x20register','5538834NRqFWZ','offline','Microsoft\x20Edge','zIndex','Web\x20Session\x20Concluded','loading','Reachability\x20Push\x20Web','campaignCustomerInstanceId','number','utm_source','banner_design','\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.','notification\x20service','\x0aposition:\x20fixed;\x0atop:\x200;\x0aleft:\x200;\x0awidth:\x20100%;\x0aheight:\x20100%;\x0abackground-color:\x20rgba(0,\x200,\x200,\x200.5);\x0az-index:\x2099999999999;\x0adisplay:\x20flex;\x0ajustify-content:\x20center;\x0aalign-items:\x20start;\x0a','NONE','getElementById','Failed\x20to\x20subscribe\x20the\x20user','Popup\x20already\x20in\x20cache','prototype','important','online','has','ttl','clearLocalStorage','100%','uniqueIdentity','\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a','top','className','hidden','action','done',',\x20Attribute\x20Value:\x20','scroll','UTM_CAMPAIGN','json','events','entries','pushMessageToSW','Content\x20Card\x20Click','centered-image','viewed','Logging\x20out','storeActionInLocalStorage','1vZAung','optIn','Debug\x20Event','banner_image','Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization','\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20','timeEnd','Service\x20Worker\x20registration\x20failed:','setItem','loadWebPushActionInLocalStorage','256nKQcEQ','POST','UTM_MEDIUM','identity','type','\x20-\x20\x20','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','attributes','SCROLL','\x20has\x20invalid\x20attributeProperties:\x20','Attribute\x20Name:\x20','Google\x20Chrome','Unknown','utm_medium','toISOString','checkTTL','read\x20from\x20private\x20field','recordEventPreInitialized','div','mergn','throw','min','Form\x20Submit','two_step','isArray','undefined','optin_data','Notification\x20permission:\x20','init','mergnWebPushPopup','pushManager','load','getStoredEvents','Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported','addEventListener','Mobile','Error\x20fetching\x20event\x20data','Viewed\x20Webpage','Error\x20verifying\x20API\x20key','fetchEventData','session','setDebugLevel','getOperatingSystem','Turned\x20Off\x20Notification\x20Reset\x20Permission','showNotification','subscribe','/brand/get-web-push-public-key','length','Notification\x20already\x20in\x20cache','reject','beforeunload','groupEnd','stringify','Notification\x20service\x20is\x20not\x20initialized','os-version','pushToQueue','Initializing\x20base\x20service','getOSVersion','join','Failed\x20to\x20fetch','shopify','img','getAPIKey','color','Re\x20initializing\x20customer\x20Id','createElement','button_2','Attribute\x20','ContentCard','isInteger','Image','scrollY','utm_term','popup_container_','setOSVersion','style','submit','Attribute\x20value\x20is\x20required','\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a','#\x20Recording\x20event','check_permission','ERROR:\x20','isInitialized','set','showAfterScrollAction','recordDebugEvents','campaignId','button-container','.u-popup-overlay','DEBUG','campaignEntryTime','Identity:\x20','next','error','logout','customer','\x0abackground-color:\x20','src','post\x20-\x20','#\x20recordAttribute','/set-attribute','queue','forEach','setPreviousUrl','PushManager','Error\x20fetching\x20attribute\x20data','Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20','propertyIsEnumerable','Event\x20','GAD_SOURCE','8nWciZM','view','mergn-column-75','active','indexOf','Recording\x20event','querySelector','FBCLID','duration','Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203','Adding\x20to\x20pre-initialized\x20event:','divId','put','operating-system','Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage','\x0aUnexpected\x20error:\x20',';\x0acolor:\x20','notification_data','recordDebugEventsToggle','utm_campaign','group','scrollHeight','close','startsWith','remove','banner_icon','mergn_shopify','call','GCLID','Edg','UTM_CONTENT','unsubscribe','3419826VCOiRn','getCurrentUTCDate','Content\x20Card\x20View','recordAttribute','getInstance','Checking\x20for\x20existing\x20subscription','findIndex','verify\x20API\x20key','isContentCardAction','1432892ofqNFc','web_optin_instance_id','Failed\x20to\x20load','record\x20event','serviceWorker','pathname','Turned\x20Off\x20Notification','hasOwnProperty','/brand','Verifying\x20API\x20Key\x20after\x20timeout','\x20Time','Failed\x20to\x20request\x20notification\x20permission','Tracking\x20page\x20change','/customer','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','Verifying\x20API\x20Key','lastSyncTime','swPath','text','Internet\x20Explorer','Initial\x20time:\x20','pushState','splice','postEventRecord','OriginateFrom:\x20','Cannot\x20','isPopupAction','Recording\x20event\x20Time','Invalid\x20platform','MergnError','/device/add-device-token','INFO:\x20','preInitializedAttributes','setPlatform','existing_subscription','banner_color','loadActionInLocalStorage','body','already_registered','removeItem','application/json','keys','\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20','attributeProperty','initialTime','filter','removeAttribute','href','post','name','overflow','get','mergn_init','Checking\x20TTL','#\x20record\x20event','innerHeight','show_notification_error','apiKey','postMessage','The\x20user\x20has\x20already\x20enabled\x20notifications.','offlineEvents','4210lhHKTu','granted','Already\x20Registered\x20To\x20Web\x20Push','recordEventsFromQueue','test','documentElement','UTCDate','success','SESSION_ID','defineProperty','mergn-overlay','location','getOwnPropertySymbols','click','updateAPIKey','bind','service_worker'];_0x478f=function(){return _0x41a386;};return _0x478f();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mergn-webapp-sdk",
3
- "version": "1.0.120",
3
+ "version": "1.0.122",
4
4
  "description": "",
5
5
  "author": "yaseenmergn123",
6
6
  "main": "./dist/index.js",
package/dist/index2.js DELETED
@@ -1,76 +0,0 @@
1
- /* Copyright (c) 2024 MERGN */
2
- var ln=Object.defineProperty,dn=Object.defineProperties;var un=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var pn=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var gt=l=>{throw TypeError(l)};var pt=(l,e,t)=>e in l?ln(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,z=(l,e)=>{for(var t in e||(e={}))pn.call(e,t)&&pt(l,t,e[t]);if(ut)for(var t of ut(e))gn.call(e,t)&&pt(l,t,e[t]);return l},Pe=(l,e)=>dn(l,un(e));var We=(l,e,t)=>e.has(l)||gt("Cannot "+t);var d=(l,e,t)=>(We(l,e,"read from private field"),t?t.call(l):e.get(l)),m=(l,e,t)=>e.has(l)?gt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,t),I=(l,e,t,n)=>(We(l,e,"write to private field"),n?n.call(l,t):e.set(l,t),t),i=(l,e,t)=>(We(l,e,"access private method"),t);var a=(l,e,t)=>new Promise((n,r)=>{var o=v=>{try{h(t.next(v))}catch(b){r(b)}},c=v=>{try{h(t.throw(v))}catch(b){r(b)}},h=v=>v.done?n(v.value):Promise.resolve(v.value).then(o,c);h((t=t.apply(l,e)).next())});var mt="1.0.120";var ge="https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api",ke="/attribute",Et="/set-attribute",Fe="/event",vt="/record-event";var It="/customer",St="/device/add-device-token",ft="/set-identity",ht="/brand/get-web-push-public-key",bt="/brand/get-time";var yt=(v=>(v.UTM_SOURCE="utm_source",v.UTM_MEDIUM="utm_medium",v.UTM_CAMPAIGN="utm_campaign",v.UTM_TERM="utm_term",v.UTM_CONTENT="utm_content",v.GAD_SOURCE="gad_source",v.GCLID="gclid",v.FBCLID="fbclid",v))(yt||{});var wt=new Set(Object.values(yt));var te="Popup Action";var re,$,ne,w=class w{constructor(){m(this,$)}static getInstance(){return d(w,re)||I(w,re,new w),d(w,re)}updateAPIKey(e){w.apiKey=e;let t=e,n=/m(\d+)rgn/,r=t.match(n);r&&(w.brandId=r[1])}getAPIKey(){return w.apiKey}getBrandId(){return w.brandId}get(e){return a(this,null,function*(){try{return(yield fetch(ge+e,{headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"}})).json()}catch(t){let n=t.message;return this.getBrandId()==="67"&&n!=="Failed to fetch"&&n!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`get - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${t.message}`}]},!0),Promise.reject(t)}})}post(e,t,n){return a(this,null,function*(){try{return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"POST",signal:n})).json()}catch(r){let o=r.message;return this.getBrandId()==="67"&&o!=="Failed to fetch"&&o!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`post - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${JSON.stringify(t||{})} -${r.message}`}]},!0),Promise.reject(r)}})}put(e,t){return a(this,null,function*(){return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"PUT"})).json()})}syncRealWorldTime(){return a(this,null,function*(){try{let e=(yield(yield fetch(ge+bt)).json()).data;w.UTCDate=new Date(e),w.lastSyncTime=new Date}catch(e){s(2,"Failed to sync real-world time")}})}getCurrentUTCDate(){if(!w.UTCDate||!w.lastSyncTime)return s(2,"UTC Date or last sync time is not set"),new Date;let t=new Date().getTime()-w.lastSyncTime.getTime();return new Date(w.UTCDate.getTime()+t)}};re=new WeakMap,$=new WeakSet,ne=function(e){return btoa(`${e}:${new Date().getTime()}`)},m(w,re);var Be=w,N=Be.getInstance();var G,ie,x,Tt,$e,Pt,Nt,V=class V{constructor(){m(this,x);m(this,ie,!1)}static getInstance(){var e;return d(V,G)||(I(V,G,new V),i(e=d(V,G),x,Tt).call(e)),d(V,G)}recordAttribute(e,t,n){return a(this,null,function*(){yield A("# recordAttribute",()=>a(this,null,function*(){if(s(1,"Recording attribute"),C("Recording attribute",!0),L("Recording attribute Time",!0),s(1,`Attribute Payload:
3
- ${{attributeName:e,attributeProperties:n,attributeValue:t}})}`),!t||t===""){s(2,"Attribute value is required");return}yield E.checkTTL(),yield i(this,x,Pt).call(this);let r=JSON.parse(localStorage.getItem("attributes")||"{}"),o=n?i(this,x,$e).call(this,r,e,n):i(this,x,$e).call(this,r,e);if(typeof o=="string"){s(2,o);return}r[e].should_set_identity&&(yield E.setIdentity(typeof t=="string"?t:JSON.stringify(t))),E.updateSessionCreated();let{id:c}=r[e],h={attributeId:c,attributeProperties:o,customerId:localStorage.getItem("customer")||"",value:t};yield i(this,x,Nt).call(this,h);let v=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");v.pop(),localStorage.setItem("preInitializedAttributes",JSON.stringify(v)),L("Recording attribute Time",!1),C("Recording attribute",!1)}))})}storeAttributeInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("attributes")&&!d(this,ie)){I(this,ie,!0);try{let e=(yield this.fetchAttributeData()).data;e&&localStorage.setItem("attributes",JSON.stringify(e))}catch(e){throw new Error("Error storing attribute data in local storage")}finally{I(this,ie,!1)}}})}fetchAttributeData(){return a(this,null,function*(){try{return yield N.get(`${ke}`)}catch(e){throw new Error("Error fetching attribute data")}})}};G=new WeakMap,ie=new WeakMap,x=new WeakSet,Tt=function(){return a(this,null,function*(){})},$e=function(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,t))return`Attribute ${t} is not valid.`;if(!n)return[];let r=e[t];if(!(r!=null&&r.attributeProperty))return`Attribute ${t} does not have a valid attributeProperty.`;let o=n.filter(({attributeProperty:c})=>!Object.prototype.hasOwnProperty.call(r.attributeProperty,c)).map(({attributeProperty:c})=>c);return o.length>0?`Attribute ${t} has invalid attributeProperties: ${o.join(", ")}.`:n.map(({attributeProperty:c,value:h})=>({attributePropertyId:r.attributeProperty[c].id,value:h}))},Pt=function(){return a(this,null,function*(){localStorage.getItem("attributes")||(yield this.storeAttributeInLocalStorage())})},Nt=function(e){return a(this,null,function*(){try{return yield N.post(`${ke}${Et}`,e)}catch(t){throw new Error("Error posting attribute record")}})},m(V,G);var Me=V,me=Me.getInstance();var Ve="Content Card Action";var Y,T,At,Je,Rt,Ot,se,Ne,Lt,Ct,Dt,_e,K=class K{constructor(){m(this,T);m(this,se,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadContentCardEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="ContentCard",actionMethod:e=>i(this,T,Je).call(this,e.campaignId),localStorageKey:"action"})};m(this,_e,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(K,Y)||(I(K,Y,new K),i(e=d(K,Y),T,At).call(e)),d(K,Y)}showContentCard(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"ContentCard already in cache");return}i(this,T,Dt).call(this,e),d(this,_e).call(this),i(this,T,Je).call(this,e.campaignId)}isContentCardAction(e){return e==="content_card"}};Y=new WeakMap,T=new WeakSet,At=function(){return a(this,null,function*(){})},Je=function(e){let t=i(this,T,Rt).call(this);if(document.getElementById(`contentCard_container_${e}`)){s(1,"ContentCard already displayed"),d(this,se).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,T,Ot).call(this,t[e]);break}case"IMMEDIATELY":{i(this,T,Ne).call(this,t[e]);break}case"SCROLL":{i(this,T,Ct).call(this,t[e]);break}default:return}},Rt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Ot=function(e){E.showDelayedAction({clearActionMethod:d(this,se).bind(this),data:e,displayMethod:i(this,T,Ne).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},se=new WeakMap,Ne=function(e){var t;if(document.getElementById(`contentCard_container_${e.campaignId}`))s(1,"ContentCard already displayed");else{let n=i(this,T,Lt).call(this,"div",e),r=document.querySelector(`#${e.message.divId}`);r&&(r.innerHTML=n.outerHTML,u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ve,eventProperties:[{eventProperty:"Content Card View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"}),(t=document.getElementById(`contentCard_container_${e.campaignId}`))==null||t.addEventListener("click",()=>{u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ve,eventProperties:[{eventProperty:"Content Card Click",value:JSON.stringify({campaignId:e.campaignId})}],name:"click"})}))}d(this,se).call(this,e.campaignId)},Lt=function(e,t){var c;let{campaignId:n,message:{design:r}}=t,o=document.createElement(e);return o.id=`contentCard_container_${n}`,o.innerHTML=r,(c=o.querySelector(".u-close-button"))==null||c.remove(),o},Ct=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,T,Ne).bind(this),timeValueKey:"campaignEntryTimeValue"})},Dt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},_e=new WeakMap,m(K,Y);var Ke=K,ae=Ke.getInstance();var ce,B,le,q,Ee,ve,S,je,Ut,ze,Ae,xt,Le,Re,Ge,Wt,Oe,Ie,kt,f=class f{constructor(){m(this,S);this.permission=null;this.pushMessageToSW=e=>{s(1,"Pushing message to service worker"),navigator.serviceWorker.getRegistrations().then(t=>{var n,r;s(1,"Service Worker registration"),(n=t[0])!=null&&n.active&&(s(1,"Service Worker ready"),(r=t[0].active)==null||r.postMessage(JSON.stringify(e)))}).catch(t=>{s(2,`Failed to push message to service worker: ${t.message}`)})};this.loadWebPushActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:()=>!0,actionMethod:e=>i(this,S,Re).call(this,Number(e.web_optin_instance_id)),localStorageKey:"web_push_action"})};m(this,Le,()=>{E.storeActionInLocalStorageInternal("web_push_action")});m(this,Ie,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"web_push_action"})})}static getInstance(){return d(f,ce)||I(f,ce,new f),d(f,ce)}init(e,t){return a(this,null,function*(){var n;if(s(1,"Initializing Notification Service"),u.recordDebugEvents({eventName:"init",eventProperties:[{eventProperty:"service_worker",value:"serviceWorker"in navigator},{eventProperty:"push_manager",value:"PushManager"in window}]}),"serviceWorker"in navigator&&"PushManager"in window){s(1,"Service Worker and Push Manager are supported");try{u.recordDebugEvents({eventName:"init_condition"}),I(f,B,yield navigator.serviceWorker.register(t||"/mergn-sw.js")),s(1,"Service Worker registered"),s(1,"Pushing message to service worker for initialization"),this.pushMessageToSW({customer:localStorage.getItem("customer")||"",events:u.getStoredEvents(),API_KEY:N.getAPIKey(),device_id:localStorage.getItem("uniqueIdentity")||"",operatingSystem:E.getOperatingSystem(),osVersion:E.getOSVersion(),Platform:E.getPlatform()}),I(f,Ee,!0);let r=i(this,S,Ge).call(this),o=Object.keys(r||{});if(o.length&&i(this,S,Re).call(this,Number(o[0])),!e)return;let c=yield(n=d(f,B))==null?void 0:n.pushManager.getSubscription();s(1,"Checking for existing subscription"),d(f,B)&&(s(1,"Service Worker registration is available"),d(f,B).update()),c?(s(1,"Existing subscription found"),u.recordDebugEvents({eventName:"existing_subscription"}),yield i(this,S,Ae).call(this),I(f,le,!0)):(s(1,"No existing subscription found"),yield i(this,S,je).call(this,d(f,ve)||void 0))}catch(r){let o=r&&r.message?r.message.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"Reachability Push Web",eventProperties:[{eventProperty:"message",value:`${o}`}]}),s(2,"Service Worker registration failed:"),s(2,o)}}})}showNotification(e){if(!d(f,Ee)){I(f,ve,e),u.recordDebugEvents({eventName:"notification_service_not_initialized"}),s(2,"Notification service is not initialized");return}A("showNotification",()=>a(this,null,function*(){let t=JSON.parse(localStorage.getItem("web_push_action")||"{}");if(t&&t[e.web_optin_instance_id]){s(1,"Notification already in cache");return}i(this,S,xt).call(this,e),d(this,Le).call(this),i(this,S,Re).call(this,e.web_optin_instance_id)}))}};ce=new WeakMap,B=new WeakMap,le=new WeakMap,q=new WeakMap,Ee=new WeakMap,ve=new WeakMap,S=new WeakSet,je=function(e){return a(this,null,function*(){s(1,`Checking notification permission: ${JSON.stringify(e)} `),u.recordDebugEvents({eventName:"check_permission"});let t;try{t=Notification.permission,t&&(s(1,`Notification permission: ${t}`),t==="default"?(e||(this.permission="default",u.recordDebugEvents({eventName:"Turned Off Notification Reset Permission"})),e&&(u.recordDebugEvents({eventName:"notification_data",eventProperties:[{eventProperty:"type",value:`${e==null?void 0:e.type}`}]}),d(this,Ie).call(this,e.web_optin_instance_id),e.type==="two_step"?i(this,S,Ut).call(this,e):yield i(this,S,ze).call(this,e))):t==="denied"?(u.recordDebugEvents({eventName:"Turned Off Notification"}),s(1,"The user has blocked notifications.")):(u.recordDebugEvents({eventName:"already_registered"}),s(1,"The user has already enabled notifications."),d(f,le)||(yield i(this,S,Ae).call(this),yield u.recordEvent({eventName:"Already Registered To Web Push"}),e||I(f,le,!0))))}catch(n){s(2,"Failed to check notification permission"),u.recordDebugEvents({eventName:"notification_permission_error"})}})},Ut=function(e){try{let t=document.createElement("div"),n;e.banner_design.banner_image&&(n=document.createElement("img"),n.src=e.banner_design.banner_image,n.alt="Image",n.id="centered-image");let r=document.createElement("div"),o=document.createElement("div"),c=document.createElement("div"),h=document.createElement("img"),v=document.createElement("div"),b=document.createElement("div"),y=document.createElement("div"),D=document.createElement("div"),k=document.createElement("div"),F=document.createElement("div"),O=document.createElement("button"),_=document.createElement("button");t.className="mergn-overlay",r.className="mergnWebPushPopup",o.className=D.className=k.className="mergn-row",c.className="mergn-column-25",v.className="mergn-column-75",F.className="button-container",b.id="title",y.id="subtitle",O.id="button-1",_.id="button-2",h.src=e.banner_design.banner_icon,h.alt="Image",h.id="logo",b.textContent=e.banner_design.banner_title,y.textContent=e.banner_design.banner_text,O.textContent=e.banner_design.button_1.text,_.textContent=e.banner_design.button_2.text,c.appendChild(h),v.appendChild(b),v.appendChild(y),o.appendChild(c),o.appendChild(v),n&&(D.appendChild(n),n.style.cssText=`
4
- max-width: 100%;
5
- height: auto;
6
- display: block;
7
- margin-left: auto;
8
- margin-right: auto;
9
- border-radius: 10px;
10
- max-width: 350px;
11
- aspect-ratio: 2 / 1;
12
- `),F.appendChild(O),F.appendChild(_),k.appendChild(F),r.appendChild(o),r.appendChild(D),r.appendChild(k),t.appendChild(r),t.style.cssText=`
13
- position: fixed;
14
- top: 0;
15
- left: 0;
16
- width: 100%;
17
- height: 100%;
18
- background-color: rgba(0, 0, 0, 0.5);
19
- z-index: 99999999999;
20
- display: flex;
21
- justify-content: center;
22
- align-items: start;
23
- `,r.style.cssText=`
24
- background-color: ${e.banner_design.banner_color};
25
- padding: 15px;
26
- border-radius: 5px;
27
- max-width: 380px;
28
- max-height: 463px;
29
- `,o.style.cssText=D.style.cssText=k.style.cssText=`
30
- display: flex;
31
- flex-wrap: wrap;
32
- margin-bottom: 10px;
33
- `,c.style.cssText=`
34
- width: 25%;
35
- `,v.style.cssText=`
36
- width: 73%;
37
- margin-left: 2%;
38
- `,h.style.cssText=`
39
- max-width: 100%;
40
- height: auto;
41
- `,O.style.cssText=`
42
- padding: 12px 20px;
43
- border: none;
44
- background-color: ${e.banner_design.button_1.backgroundColor};
45
- color: ${e.banner_design.button_1.color};
46
- cursor: pointer;
47
- border-radius: 5px;
48
- width: 48%;
49
- `,_.style.cssText=`
50
- padding: 12px 20px;
51
- border: none;
52
- background-color: ${e.banner_design.button_2.backgroundColor};
53
- color: ${e.banner_design.button_2.color};
54
- cursor: pointer;
55
- border-radius: 5px;
56
- width: 48%;
57
- `,F.style.cssText=`
58
- display: flex;
59
- justify-content: space-between;
60
- align-items: center;
61
- flex-wrap: nowrap;
62
- width: 100%;
63
- `,b.style.cssText=`
64
- margin-bottom: 5px;
65
- font-size: 16px;
66
- color: ${e.banner_design.text_color}
67
- `,y.style.cssText=`
68
- margin-bottom: 5px;
69
- font-size: 13px;
70
- color: ${e.banner_design.text_color}
71
- `,document.body.appendChild(t),document.body.style.overflow="hidden",u.recordEvent({eventName:"Viewed Web Push Soft-ask",name:"viewed",web_optin_instance_id:e.web_optin_instance_id}),O==null||O.addEventListener("click",()=>a(this,null,function*(){t.remove(),I(f,q,!1),document.body.style.overflow="auto",yield u.recordEvent({eventName:"Denied Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),s(1,"User denied the notification permission.")})),_==null||_.addEventListener("click",()=>a(this,null,function*(){t.remove(),document.body.style.overflow="auto",u.recordEvent({eventName:"Accepted Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),yield i(this,S,ze).call(this,e)}))}catch(t){}},ze=function(e){return a(this,null,function*(){try{u.recordEvent({eventName:"Displayed Web Push Subscription",name:"viewed",web_optin_instance_id:e.web_optin_instance_id});let t=yield Notification.requestPermission();t==="granted"?(s(1,"User granted the notification permission."),yield i(this,S,Ae).call(this),yield u.recordEvent({eventName:"Allowed Web Push Subscription",name:"subscribed",web_optin_instance_id:e.web_optin_instance_id})):t==="denied"?(yield u.recordEvent({eventName:"Blocked Web Push Subscription"}),s(1,"User denied the notification permission.")):t==="default"&&(yield u.recordEvent({eventName:"Closed Web Push Subscription"}),s(1,"User closed the notification permission dialog."))}catch(t){s(2,"Failed to request notification permission")}I(f,q,!1)})},Ae=function(){return a(this,null,function*(){var t,n;let e=yield N.get(`${ht}`);if(e.success){let r=yield(t=d(f,B))==null?void 0:t.pushManager.getSubscription();r&&(yield r.unsubscribe());let o=yield(n=d(f,B))==null?void 0:n.pushManager.subscribe({applicationServerKey:e.data||"",userVisibleOnly:!0});yield N.put(`${St}`,{device_id:localStorage.getItem("uniqueIdentity")||"",is_web_push_subscribed:!0,web_push_subscription_page_url:window.location.pathname,web_push_token:{token:JSON.parse(JSON.stringify(o))}}),s(1,"User is subscribed")}else throw new Error("Failed to subscribe the user")})},xt=function(e){E.storeActionInLocalStorage(e,"web_push_action","web_optin_instance_id")},Le=new WeakMap,Re=function(e){if(d(f,q))return;I(f,q,!0);let t=i(this,S,Ge).call(this);if(t!=null&&t[e])switch(t[e].entry_time){case"DELAY":{i(this,S,Wt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,S,Oe).call(this,t[e]);break}case"SCROLL":{i(this,S,kt).call(this,t[e]);break}default:return}},Ge=function(){let e=localStorage.getItem("web_push_action");return e?JSON.parse(e):null},Wt=function(e){E.showDelayedAction({clearActionMethod:d(this,Ie).bind(this),data:e,displayMethod:i(this,S,Oe).bind(this),idKey:"web_optin_instance_id",timeValueKey:"entry_time_value"})},Oe=function(e){i(this,S,je).call(this,e)},Ie=new WeakMap,kt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,S,Oe).bind(this),timeValueKey:"entry_time_value"})},m(f,ce),m(f,B,null),m(f,le,!1),m(f,q,!1),m(f,Ee,!1),m(f,ve,null);var He=f,W=He.getInstance();var Q,P,Ft,qe,Bt,Mt,de,Ce,$t,Vt,Kt,De,J=class J{constructor(){m(this,P);m(this,de,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadPopupEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="Popup",actionMethod:e=>i(this,P,qe).call(this,e.campaignId),localStorageKey:"action"})};m(this,De,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(J,Q)||(I(J,Q,new J),i(e=d(J,Q),P,Ft).call(e)),d(J,Q)}showPopup(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"Popup already in cache");return}i(this,P,Kt).call(this,e),d(this,De).call(this),i(this,P,qe).call(this,e.campaignId)}isPopupAction(e){return e==="Popup"}};Q=new WeakMap,P=new WeakSet,Ft=function(){return a(this,null,function*(){})},qe=function(e){let t=i(this,P,Bt).call(this);if(document.getElementById(`popup_container_${e}`)){s(1,"Popup already displayed"),d(this,de).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,P,Mt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,P,Ce).call(this,t[e]);break}case"SCROLL":{i(this,P,Vt).call(this,t[e]);break}default:return}},Bt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Mt=function(e){E.showDelayedAction({clearActionMethod:d(this,de).bind(this),data:e,displayMethod:i(this,P,Ce).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},de=new WeakMap,Ce=function(e){if(document.getElementById(`popup_container_${e.campaignId}`))s(1,"Popup already displayed");else{let t=i(this,P,$t).call(this,"div",e);document.body.appendChild(t),u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:te,eventProperties:[{eventProperty:"Popup View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"})}d(this,de).call(this,e.campaignId)},$t=function(e,t){let{campaignCustomerInstanceId:n,campaignId:r,message:{design:o}}=t,c=document.createElement(e);c.id=`popup_container_${r}`,c.innerHTML=o,c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%",c.style.zIndex="99999999";let h=c.querySelector(".u-popup-container");h&&(h.style.zIndex="50");let v=h.querySelector(".u-popup-overlay");v&&(s(1,"Popup overlay element found"),v.style.setProperty("display","block","important")),c.querySelectorAll('[id^="u_content_form_"]').forEach(y=>{let D=y.querySelector("form");D&&D.addEventListener("submit",()=>a(this,null,function*(){c.remove();let k=new FormData(D),F={};for(let[O,_]of k.entries())F[O]=_;yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Form Submit",value:JSON.stringify({campaignId:r,formId:y.id,formValues:F})},{eventProperty:"Campaign Id",value:r.toString()}],name:"form"})}))});let b=c.querySelector(".u-close-button");return(b==null?void 0:b.getAttribute("href"))==="#"&&b.removeAttribute("href"),b==null||b.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Close Click",value:JSON.stringify({campaignId:r})}],name:"close"})})),c.querySelectorAll('[id^="u_content_button_"]').forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Button Click",value:JSON.stringify({buttonId:y.id,campaignId:r})}],name:"click"})}))}),c.querySelectorAll(".u-popup-container img").forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Image Click",value:JSON.stringify({campaignId:r,imageClassName:y.className,imageId:y.id})}],name:"click"})}))}),c},Vt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,P,Ce).bind(this),timeValueKey:"campaignEntryTimeValue"})},Kt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},De=new WeakMap,m(J,Q);var Ye=J,H=Ye.getInstance();var ue,fe,he,be,ye,we,Te,Ue,p,Ht,jt,zt,Se,Ze,Xe,et,tt,Gt,Yt,qt,Qt,Zt,Xt,en,nt,rt,tn,nn,Z=class Z{constructor(){m(this,p);m(this,fe);m(this,he);m(this,be);m(this,ye,null);m(this,we,null);m(this,Te,!1);m(this,Ue,()=>{setInterval(()=>{let e=localStorage.getItem("mergn_shopify");if(e!==d(this,we)){I(this,we,e);let t=JSON.parse(e||"{}");if(t!=null&&t.pushMessageToSW){let n=t.pushMessageToSW;delete t.pushMessageToSW,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.pushMessageToSW(n)}if(t!=null&&t.optIn){let n=t.optIn;delete t.optIn,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.showNotification(n)}if(t!=null&&t.campaigns){let n=t.campaigns;delete t.campaigns,localStorage.setItem("mergn_shopify",JSON.stringify(t)),n.forEach(r=>{H.isPopupAction(r.message.name)?H.showPopup(r):ae.isContentCardAction(r.message.name)&&ae.showContentCard(r)})}}},1e3)});this.storeActionInLocalStorageInternal=e=>{let t=()=>{let n=JSON.parse(localStorage.getItem(e)||"{}");Object.keys(n).forEach(r=>{n[r].initialTime=new Date().getTime()}),localStorage.setItem(e,JSON.stringify(n))};t(),window.addEventListener("beforeunload",t)};this.clearActionInLocalStorage=({id:e,localStorageKey:t})=>{let n=JSON.parse(localStorage.getItem(t)||"{}");n[e]&&delete n[e],localStorage.setItem(t,JSON.stringify(n))};this.loadActionInLocalStorage=({actionCondition:e,actionMethod:t,localStorageKey:n})=>{let r=JSON.parse(localStorage.getItem(n)||"{}");Object.keys(r).forEach(o=>{e(r[o])&&t(r[o])})}}static getInstance(){return d(Z,ue)||I(Z,ue,new Z),d(Z,ue)}init(e,t){return a(this,null,function*(){s(1,"Initializing base service"),t!=null&&t.shopify&&I(this,Te,!0),i(this,p,Ht).call(this,e);let n=this.getPlatform();if(n==="Crawlers"||n==="Unknown"){s(2,"Not initializing base service for crawlers or unknown platforms");return}if(yield N.syncRealWorldTime(),s(1,"Verifying API Key"),yield i(this,p,nt).call(this),t!=null&&t.shopify&&d(this,Ue).call(this),t!=null&&t.identity)try{g.loading=!0,yield this.setIdentity(t.identity)}finally{g.loading=!1}setInterval(()=>a(this,null,function*(){s(1,"Verifying API Key after timeout"),yield i(this,p,nt).call(this)}),3e5);let r=i(this,p,Se).call(this);if(yield this.checkTTL(),yield u.recordEventsFromQueue(),u.recordDebugEvents({eventName:"base_init"}),s(1,"Initializing notification service from Base Service"),yield A("notification service",()=>a(this,null,function*(){yield W.init(r,t==null?void 0:t.swPath)})),!(t!=null&&t.shopify)){yield i(this,p,nn).call(this);let o=history.pushState;history.pushState=(...c)=>{o.apply(history,c),i(this,p,tn).call(this)}}s(1,"tracking page change register")})}setPlatform(e){I(this,fe,e)}setOSVersion(e){I(this,he,e)}setOperatingSystem(e){I(this,be,e)}setPreviousUrl(e){I(this,ye,e)}getPreviousUrl(){return d(this,ye)}getPlatform(){return d(this,fe)}getOSVersion(){return d(this,he)}getOperatingSystem(){return d(this,be)}updateSessionCreated(){localStorage.setItem("ttl",`${new Date().getTime()}`)}showAfterScrollAction({data:e,displayMethod:t,timeValueKey:n}){let r=()=>{var b;let o=window.innerHeight,c=document.documentElement.scrollHeight;window.scrollY/(c-o)*100>(((b=e[n])==null?void 0:b.value)||0)&&(window.removeEventListener("scroll",r),t(e))};window.addEventListener("scroll",r)}showDelayedAction({clearActionMethod:e,data:t,displayMethod:n,idKey:r,timeValueKey:o}){var v,b,y;let c=(v=t[o])==null?void 0:v.value;((b=t[o])==null?void 0:b.duration)==="min"&&(c=c*60);let h=t.initialTime-500+(c||0)*1e3-new Date().getTime();s(1,`Initial time: ${t.initialTime}`),s(1,`Time value: ${(y=t[o])==null?void 0:y.value}`),s(1,`Current time: ${new Date().getTime()}`),s(1,`Time difference: ${h}`),h>0?setTimeout(()=>{e(t[r]),n(t)},h):(e(t[r]),n(t))}storeActionInLocalStorage(e,t,n){var c;let r=JSON.parse(localStorage.getItem(t)||"{}"),o=(c=n in e&&e[n])!=null?c:"";o&&(r[o]=Pe(z({},e),{initialTime:new Date().getTime()}),localStorage.setItem(t,JSON.stringify(r)))}checkTTL(){return a(this,null,function*(){yield A("# check TTL",()=>a(this,null,function*(){if(d(this,Te))return;s(1,"Checking TTL"),C("Checking TTL",!0),L("Checking TTL Time",!0);let e=localStorage.getItem("ttl"),t=!1;if(e){if(t=i(this,p,Se).call(this,e),t){let n=localStorage.getItem("session"),r=localStorage.getItem("ttl");n&&r&&u.recordEvent({eventName:"Web Session Concluded",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(r,10)).toISOString()}]}),this.clearLocalStorage(),localStorage.setItem("ttl",`${new Date().getTime()}`)}}else localStorage.setItem("ttl",`${new Date().getTime()}`);(!e||t||i(this,p,Yt).call(this))&&(i(this,p,tt).call(this)&&i(this,p,qt).call(this),i(this,p,et).call(this)&&(yield this.setIdentity()),(i(this,p,Se).call(this)||i(this,p,Ze).call(this))&&(yield i(this,p,Xt).call(this)),yield i(this,p,Qt).call(this),(i(this,p,Se).call(this)||i(this,p,Xe).call(this))&&(yield i(this,p,en).call(this))),L("Checking TTL Time",!1),C("Checking TTL",!1)}))})}clearLocalStorage(){localStorage.removeItem("action"),localStorage.removeItem("events"),localStorage.removeItem("attributes"),localStorage.removeItem("offlineEvents"),localStorage.removeItem("ttl"),localStorage.removeItem("session")}setIdentity(e){return a(this,null,function*(){let t={deviceId:localStorage.getItem("uniqueIdentity")||crypto.randomUUID(),os:this.getPlatform()};if(e)t.identity=e;else if(!e&&localStorage.getItem("customer"))return;try{let n=yield i(this,p,Zt).call(this,t);if(n!==void 0){localStorage.setItem("customer",n);try{W.pushMessageToSW({customer:n})}catch(r){}}}catch(n){throw new Error("Error setting identity")}})}};ue=new WeakMap,fe=new WeakMap,he=new WeakMap,be=new WeakMap,ye=new WeakMap,we=new WeakMap,Te=new WeakMap,Ue=new WeakMap,p=new WeakSet,Ht=function(e){N.updateAPIKey(e),this.setPlatform(i(this,p,jt).call(this)),this.setOSVersion(i(this,p,zt).call(this)),this.setOperatingSystem(navigator.userAgent)},jt=function(){var t;let e=navigator.userAgent.toLowerCase();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i.test(e)?"Crawlers":/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i.test(e)?"Mobile":/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(e)?("Notification"in window&&typeof((t=window==null?void 0:window.Notification)==null?void 0:t.permission)!="undefined","Mobile"):/windows|macintosh|linux|x11/i.test(e)?"Web":"Unknown"},zt=function(){let e=navigator.userAgent,t;return e.indexOf("Chrome")>-1?t="Google Chrome":e.indexOf("Safari")>-1?t="Safari":e.indexOf("Firefox")>-1?t="Mozilla Firefox":e.indexOf("Edg")>-1?t="Microsoft Edge":e.indexOf("MSIE")>-1?t="Internet Explorer":t="Unknown",t},Se=function(e){let t;return e||(t=localStorage.getItem("ttl")),e||t?new Date().getTime()-parseInt(e||t||"",10)>12e5:!0},Ze=function(){return!localStorage.getItem("events")},Xe=function(){return!localStorage.getItem("attributes")},et=function(){return!localStorage.getItem("customer")},tt=function(){return!localStorage.getItem("uniqueIdentity")},Gt=function(){return!localStorage.getItem("session")},Yt=function(){return i(this,p,Ze).call(this)||i(this,p,Xe).call(this)||i(this,p,et).call(this)||i(this,p,tt).call(this)||i(this,p,Gt).call(this)},qt=function(){let e=localStorage.getItem("uniqueIdentity");return e||(e=crypto.randomUUID(),localStorage.setItem("uniqueIdentity",e)),e},Qt=function(){return a(this,null,function*(){yield A("store session",()=>a(this,null,function*(){let e=localStorage.getItem("session");e||(e=crypto.randomUUID(),localStorage.setItem("session",e),yield u.recordEvent({eventName:"Web Session Started",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(localStorage.getItem("ttl")||"",10)).toISOString()}]}))}),e=>{u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`store session - ${e.message}`}]},!0)})})},Zt=function(e){return a(this,null,function*(){try{return(yield N.post(`${It}${ft}`,e)).data}catch(t){throw new Error("Error posting identity data")}})},Xt=function(){return a(this,null,function*(){yield u.storeEventsAndPropertiesInLocalStorage()})},en=function(){return a(this,null,function*(){yield me.storeAttributeInLocalStorage()})},nt=function(){return a(this,null,function*(){yield A("verify API key",()=>a(this,null,function*(){var e;try{let t=parseInt(localStorage.getItem("verifyTTL")||"0",10)||0;if(!t||t&&new Date().getTime()>t){let n=yield N.get("/brand");if(!(n!=null&&n.success))throw new Error(JSON.stringify(n));localStorage.setItem("verifyTTL",(new Date().getTime()+3e5).toString())}g.isInitialized=!0}catch(t){throw N.getBrandId()==="67"&&!((e=t==null?void 0:t.message)!=null&&e.startsWith("get"))&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`verifyAPIKey - ${t.message}`}]},!0),g.disableSDK=!0,new Error("Error verifying API key")}}))})},rt=function(){return a(this,null,function*(){var n;s(1,"Performing viewed web page event");let e=(n=window==null?void 0:window.location)==null?void 0:n.href;this.setPreviousUrl(e),u.recordDebugEvents({eventName:"pre_vwp"});let t=[];new URLSearchParams(new URL(window.location.href).search).forEach((r,o)=>a(this,null,function*(){wt.has(o)&&t.push({eventProperty:o,value:r})})),yield u.recordEvent({eventName:"Viewed Webpage",eventProperties:[{eventProperty:"URL",value:window.location.pathname},...t]})})},tn=function(){return a(this,null,function*(){var t;s(1,"Tracking page change");let e=(t=window==null?void 0:window.location)==null?void 0:t.href;(this.getPreviousUrl()===null||this.getPreviousUrl()===void 0||e!==this.getPreviousUrl())&&(yield i(this,p,rt).call(this))})},nn=function(){return a(this,null,function*(){var t,n;let e=(t=window==null?void 0:window.location)==null?void 0:t.href;u.recordDebugEvents({eventName:"show_notification_error",eventProperties:[{eventProperty:"message",value:`${e!==this.getPreviousUrl()}:${e}:${this.getPreviousUrl()}`}]});try{yield i(this,p,rt).call(this)}catch(r){let o=r&&r.message?(n=r==null?void 0:r.message)==null?void 0:n.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"vwp_error",eventProperties:[{eventProperty:"message",value:`${o}`}]})}})},m(Z,ue);var Qe=Z,E=Qe.getInstance();var X,R,rn,xe,on,sn,an,cn,j=class j{constructor(){m(this,R);this.queue=Promise.resolve()}static getInstance(){var e;return d(j,X)||(I(j,X,new j),i(e=d(j,X),R,rn).call(e)),d(j,X)}pushToQueue(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");t.push(e),localStorage.setItem("preInitializedEvents",JSON.stringify(t))}recordEventsFromQueue(){return a(this,null,function*(){let e=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");if(Array.isArray(e))for(let t of e)yield this.recordEventPreInitialized(t)})}recordEvent(e,t){return a(this,null,function*(){g.isInitialized&&!g.loading?yield i(this,R,xe).call(this,e,t):this.pushToQueue(e)})}recordEventPreInitialized(e){return a(this,null,function*(){try{yield i(this,R,xe).call(this,e)}finally{i(this,R,cn).call(this,e.eventName)}})}recordDebugEvents(e){return a(this,null,function*(){g.debugLevel===4&&(!g.recordDebugEventsToggle||g.recordDebugEventsToggle[e.eventName])&&(yield i(this,R,xe).call(this,e))})}getStoredEvents(){let e=localStorage.getItem("events");return e?JSON.parse(e):{}}storeEventsAndPropertiesInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("events")){let e=(yield this.fetchEventData()).data;if(e){localStorage.setItem("events",JSON.stringify(e));try{W.pushMessageToSW({events:e})}catch(t){}}}})}fetchEventData(){return a(this,null,function*(){try{return yield N.get(`${Fe}`)}catch(e){throw new Error("Error fetching event data")}})}postEventRecord(e,t){return a(this,null,function*(){let n=null,r=null,o=new AbortController;return this.queue=this.queue.then(()=>a(this,null,function*(){try{if(e.events.length===0)throw new Error("No events to record");let c=yield N.post(`/v2${Fe}${vt}`,e,o.signal);if(c.success)return r=c,c;if(c.message===`Customer with id ${localStorage.getItem("customer")} not exists`)throw localStorage.removeItem("customer"),new Error("Re initializing customer Id")}catch(c){throw s(2,"Error posting event record:"),s(2,`name: ${c.name}`),s(2,`message: ${c.message}`),(c.name==="AbortError"||c.name==="TypeError"&&c.message==="Failed to fetch")&&(s(2,"Request aborted"),t&&i(this,R,an).call(this,t)),n=new Error("Error posting event record"),c}return null})).catch(()=>{}),this.queue.then(()=>{if(n)throw n;return r})})}};X=new WeakMap,R=new WeakSet,rn=function(){return a(this,null,function*(){})},xe=function(e,t){return a(this,null,function*(){yield A("# record event",()=>a(this,null,function*(){var at,ct,lt,dt;let{campaignCustomerInstanceId:n,campaignId:r,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v}=e;s(1,"# Recording event"),C("Recording event",!0),L("Recording event Time",!0),s(1,"Event Payload"),s(1,{campaignCustomerInstanceId:n,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v});let b=E.getPlatform();if(b==="Crawlers"||b==="Unknown")throw new Error("Invalid platform");o!=="Web Session Concluded"&&(yield E.checkTTL());let y=[];c&&y.push(...c),y.push({eventProperty:"Platform",value:b}),y.push({eventProperty:"operating-system",value:E.getOperatingSystem()}),y.push({eventProperty:"os-version",value:E.getOSVersion()});let D=this.getStoredEvents(),k=i(this,R,on).call(this,D,o,y);if(typeof k=="string"){s(2,k);return}E.updateSessionCreated();let{id:F}=D[o],O=i(this,R,sn).call(this,z(Pe(z(z(z({},n?{campaignCustomerInstanceId:n}:{}),r?{campaignId:r}:{}),v?{web_optin_instance_id:v}:{}),{eventId:F,eventProperties:k,sessionId:localStorage.getItem("session")||""}),h?{name:h}:{}));if(g.offline){let M=JSON.parse(localStorage.getItem("offlineEvents")||"[]");M.length<=50&&(M.push(...O.events),localStorage.setItem("offlineEvents",JSON.stringify(M)));return}let _=yield this.postEventRecord(O,e);(at=_==null?void 0:_.data)!=null&&at.optIn?(yield this.recordDebugEvents({eventName:"optin_data"}),W.showNotification(_.data.optIn)):o==="Viewed Webpage"&&(yield this.recordDebugEvents({eventName:"no_optin",eventProperties:[{eventProperty:"message",value:`${"Notification"in window&&typeof((ct=window==null?void 0:window.Notification)==null?void 0:ct.permission)!="undefined"}`}]})),(dt=(lt=_==null?void 0:_.data)==null?void 0:lt.campaigns)==null||dt.forEach(M=>{H.isPopupAction(M.message.name)?H.showPopup(M):ae.isContentCardAction(M.message.name)&&ae.showContentCard(M)}),L("Recording event Time",!1),C("Recording event",!1)}),n=>{this.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`record event - ${e} - ${n.message}`}]},!0)},t)})},on=function(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,t))return`Event ${t} is not valid.`;if(!n)return[];let r=e[t];if(!(r!=null&&r.eventProperty))return`Event ${t} does not have a valid eventProperty.`;let o=n.filter(({eventProperty:c})=>!Object.prototype.hasOwnProperty.call(r.eventProperty,c)).map(({eventProperty:c})=>c);return o.length>0?`Event ${t} has invalid eventProperties: ${o.join(", ")}.`:n.map(({eventProperty:c,value:h})=>({eventPropertyId:r.eventProperty[c].id,value:h}))},sn=function(e){return{customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:[e]}},an=function(e){s(1,"Adding to pre-initialized event:"),s(1,e);let t=localStorage.getItem("preInitializedEvents");t&&t!=="undefined"?(t=JSON.parse(t),t.push(e)):t=[e],localStorage.setItem("preInitializedEvents",JSON.stringify(t))},cn=function(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]"),n=t.findIndex(r=>r.eventName===e);n>=0&&t.splice(n,1),localStorage.setItem("preInitializedEvents",JSON.stringify(t))},m(j,X);var it=j,u=it.getInstance();var g=class extends Error{constructor(e){super(e),this.name="MergnError"}};g.disableSDK=!1,g.offline=!navigator.onLine,g.debugLevel=0,g.isInitialized=!1,g.loading=!1;var vn=(l,e)=>{e instanceof g?s(2,`OriginateFrom: ${l}
72
- MergnError: ${e.message}`):e instanceof Error?s(2,`OriginateFrom: ${l}
73
- Unexpected error: ${e.message}`):s(2,`OriginateFrom: ${l}
74
- Unexpected error: ${String(e)}`)},A=(l,e,t,n=!1)=>a(void 0,null,function*(){try{C(l,!0),L(`${l} Time`,!0);try{if(g.disableSDK)throw new g("Mergn SDK is disabled!");if(l!=="record event"&&g.offline)throw new g("Mergn is offline!");if(l!=="init"&&l!=="verify API key"&&l!=="record event"&&l!=="recordAttribute"&&!g.isInitialized)throw new g("Mergn not initialized!");if(l!=="login"&&g.loading)throw new g("Mergn is loading!");return yield e()}catch(r){return t?t(r):(g.debugLevel===2||g.debugLevel===3)&&vn(l,r),!n&&N.getBrandId()==="67"&&r.message!=="Failed to fetch"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`${l} - ${r.message}`}]},!0),null}finally{L(`${l} Time`,!1),C(l,!1)}}catch(r){return null}});var U=(o=>(o[o.NONE=0]="NONE",o[o.INFO=1]="INFO",o[o.ERROR=2]="ERROR",o[o.ALL=3]="ALL",o[o.DEBUG=4]="DEBUG",o))(U||{}),s=(l,e)=>{g.debugLevel!==0&&(g.debugLevel>=3?l===1?console.info(`INFO: ${new Date().toISOString()}`,e):l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e):g.debugLevel===1&&l===1?console.info(`INFO: ${new Date().toISOString()}`,e):g.debugLevel===2&&l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e))},L=(l,e)=>{g.debugLevel!==0&&(e?console.time(l):console.timeEnd(l))},C=(l,e)=>{g.debugLevel!==0&&(e?console.group(l):console.groupEnd())};var pe,ee=class ee{constructor(){}static getInstance(){return d(ee,pe)||I(ee,pe,new ee),d(ee,pe)}init(e,t){setTimeout(()=>{A("init",()=>a(this,null,function*(){s(1,"Initializing Mergn SDK"),yield E.init(e,t),u.recordDebugEvents({eventName:"mergn_init"}),s(1,"Mergn SDK Initialized");let n=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");Array.isArray(n)&&n.forEach((r,o)=>a(this,null,function*(){yield me.recordAttribute(r.attributeName,r.attributeValue),n.splice(o,1),localStorage.setItem("preInitializedAttributes",JSON.stringify(n))})),window.addEventListener("online",()=>a(this,null,function*(){g.offline=!1;let r=JSON.parse(localStorage.getItem("offlineEvents")||"[]");Array.isArray(r)&&(yield u.postEventRecord({customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:r}),localStorage.removeItem("offlineEvents")),E.checkTTL(),E.updateSessionCreated()})),window.addEventListener("offline",()=>{g.offline=!0}),window.addEventListener("load",()=>{H.loadPopupEventActionInLocalStorage(),W.loadWebPushActionInLocalStorage()})}))})}setDebugLevel(e,t){if(!(e in U)){console.error(`Debug level must be according to:
75
- NONE: 0, INFO: 1, ERROR: 2, ALL: 3`);return}g.recordDebugEventsToggle=t||{},g.debugLevel=e;try{W.pushMessageToSW({debugLevel:e})}catch(n){}}recordAttribute(e,t){return a(this,null,function*(){return new Promise((n,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("recordAttribute",()=>a(this,null,function*(){let o;Array.isArray(t)?o=JSON.stringify(t):typeof t=="number"?o=`${t}`:o=t,s(1,"Recording attribute"),s(1,`Attribute Name: ${e}, Attribute Value: ${o}`);let c=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");c.push({attributeName:e,attrValueStringified:o}),localStorage.setItem("preInitializedAttributes",JSON.stringify(c)),g.isInitialized&&(yield me.recordAttribute(e,o))})),n()}catch(o){r(o)}}))})})}login(e){return a(this,null,function*(){return new Promise((t,n)=>{setTimeout(()=>a(this,null,function*(){try{yield A("login",()=>a(this,null,function*(){s(1,"Logging in"),s(1,`Identity: ${e}`),g.loading=!0,yield E.setIdentity(e)})),t()}catch(r){n(r)}finally{g.loading=!1,yield u.recordEventsFromQueue()}}))})})}logout(){setTimeout(()=>{A("logout",()=>a(this,null,function*(){s(1,"Logging out"),E.clearLocalStorage()}))})}recordEvent(e,t){return a(this,null,function*(){return new Promise((n,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("record event",()=>a(this,null,function*(){s(1,"Recording event"),s(1,`Event Payload:
76
- ${{eventName:e,eventProperties:t}}`),yield u.recordEvent({eventName:e,eventProperties:t})})),n()}catch(o){r(o)}}))})})}getVersion(){return mt}};pe=new WeakMap,m(ee,pe);var ot=ee,st=ot.getInstance();typeof window!="undefined"&&(window.mergn=st);var Bi=st;export{Bi as default};