mergn-webapp-sdk 1.0.118 → 1.0.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +76 -1
- package/dist/index.js +76 -1
- package/dist/index2.js +76 -0
- package/package.json +1 -1
- package/dist/index.mjs +0 -1
package/dist/index.global.js
CHANGED
|
@@ -1 +1,76 @@
|
|
|
1
|
-
'use strict';(function(_0x571a32,_0x253aca){const _0x1abf43=_0x1107,_0x42b997=_0x571a32();while(!![]){try{const _0x321970=-parseInt(_0x1abf43(0x333))/0x1+-parseInt(_0x1abf43(0x2a9))/0x2+-parseInt(_0x1abf43(0x342))/0x3+parseInt(_0x1abf43(0x284))/0x4*(parseInt(_0x1abf43(0x306))/0x5)+-parseInt(_0x1abf43(0x24e))/0x6*(-parseInt(_0x1abf43(0x229))/0x7)+parseInt(_0x1abf43(0x294))/0x8*(parseInt(_0x1abf43(0x2a5))/0x9)+parseInt(_0x1abf43(0x1f6))/0xa;if(_0x321970===_0x253aca)break;else _0x42b997['push'](_0x42b997['shift']());}catch(_0x1287c1){_0x42b997['push'](_0x42b997['shift']());}}}(_0x4072,0xc4113));function _0x1107(_0x268f25,_0x2fcaf5){const _0x4072bd=_0x4072();return _0x1107=function(_0x1107f9,_0xa6f4a0){_0x1107f9=_0x1107f9-0x1be;let _0x4395e0=_0x4072bd[_0x1107f9];return _0x4395e0;},_0x1107(_0x268f25,_0x2fcaf5);}function _0x4072(){const _0x2c2976=['get','20489180jeLGEV','User\x20granted\x20the\x20notification\x20permission.','verify\x20API\x20key','showAfterScrollAction','info','getElementById','Accepted\x20Web\x20Push\x20Soft-ask','Web','splice','UTM_CONTENT','button_1','Popup\x20already\x20in\x20cache','syncRealWorldTime','scroll','getVersion',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','logo','Blocked\x20Web\x20Push\x20Subscription','setPlatform','eventProperty','loadWebPushActionInLocalStorage','Popup\x20overlay\x20element\x20found','banner_title','join','throw','\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a','viewed','storeAttributeInLocalStorage','\x0abackground-color:\x20','INFO:\x20','checkTTL','disableSDK','mergn-overlay','contentCard_container_','mergn-column-25','userAgent','Recording\x20event','Button\x20Click','time','parse','Already\x20Registered\x20To\x20Web\x20Push','Mobile','campaignEntryTime','\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','pre_vwp','action','subscribe','loading','Turned\x20Off\x20Notification','clearActionInLocalStorage','init','103439PtHuSh','Invalid\x20platform','offline','Verifying\x20API\x20Key','Form\x20Submit','Turned\x20Off\x20Notification\x20Reset\x20Permission','recordDebugEvents','zIndex','campaignCustomerInstanceId','UTM_SOURCE','utm_source','logout','setOSVersion','getBrandId','text_color','has','Image\x20Click','web_push_action','campaignId','99999999','\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.','Event\x20Payload:\x0a\x20','position','button_2','src','Failed\x20to\x20sync\x20real-world\x20time','\x20has\x20invalid\x20eventProperties:\x20','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','\x0awidth:\x2025%;\x0a','Invalid\x20API\x20Key',';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a','SESSION_ID','textContent','GAD_SOURCE','[id^=\x22u_content_button_\x22]','appendChild','ALL','132PxHNPv','apply','Customer\x20with\x20id\x20','/mergn-sw.js','button-container','.u-popup-container\x20img','pathname','already_registered','mergn','subtitle','#\x20record\x20event','submit','Content\x20Card\x20View','Service\x20Worker\x20registration\x20failed:','Checking\x20notification\x20permission:\x20','update','write\x20to\x20private\x20field','Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage','queue','web_optin_instance_id','Mergn\x20not\x20initialized!','Attribute\x20','getCurrentUTCDate','isPopupAction','UTM_MEDIUM','FBCLID','Internet\x20Explorer','Microsoft\x20Edge','Error\x20posting\x20identity\x20data','banner_color','uniqueIdentity','type','text','SESSION_CREATED','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set','showNotification','check_permission','lastSyncTime','documentElement','entries','preInitializedAttributes','record\x20event\x20-\x20','recordDebugEventsToggle','getAPIKey','offlineEvents','mergn-row','optin_data','img','Recording\x20event\x20Time','div','utm_medium','initialTime','postMessage','1860MIMGMI','verifyTTL','success','Mergn\x20SDK\x20is\x20disabled!','debugLevel','session','Event\x20','utm_term','setIdentity','Web\x20Session\x20Started','.u-popup-container','AbortError','Existing\x20subscription\x20found','Service\x20Worker\x20registration\x20is\x20available','set','active','832KcyjSX','hidden','https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api','vwp_error','Crawlers','mergnWebPushPopup','service_worker','#\x20recordAttribute','\x0aMergnError:\x20','/customer','title','operating-system','getPreviousUrl','scrollHeight','then','getTime','banner_image','79596dUBaAA','/v2','indexOf','prototype','2566444MaldSX','outerHTML','optIn','Firefox','Logging\x20in','important','Notification\x20permission:\x20','Debug\x20Event','findIndex','pushMessageToSW','PUT','Notification\x20already\x20in\x20cache','INFO','isContentCardAction','No\x20existing\x20subscription\x20found','customer','toString','push_manager','click','clearLocalStorage','DEBUG','Viewed\x20Webpage','pushToQueue','getSubscription','getOwnPropertyDescriptors','denied','/brand','pushState','pop','TypeError','hasOwnProperty','min','overflow','application/json','Tracking\x20page\x20change','Performing\x20viewed\x20web\x20page\x20event','Popup\x20Action','Mergn\x20SDK\x20Initialized','content_card','campaignEntryTimeValue','divId','no_optin','identity','gclid','getPlatform','defineProperties','attributeName','mergn_shopify','recordAttribute','height','login','two_step','removeItem','showPopup','groupEnd','toISOString','getItem','querySelector','pushManager','Initializing\x20Mergn\x20SDK','granted','Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20','Campaign\x20Id','data','Edg','name:\x20','loadActionInLocalStorage','recordEvent','Failed\x20to\x20request\x20notification\x20permission','getOperatingSystem','signal','Event\x20Payload','\x20Time','post','register','postEventRecord','Content\x20Card\x20Action','done','getOwnPropertySymbols','body','The\x20user\x20has\x20already\x20enabled\x20notifications.','error','cssText','.u-close-button','undefined','recordEventsFromQueue','Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203','Notification','banner_design','Checking\x20TTL\x20Time','beforeunload','button','eventName','2955BvKsQb','getOSVersion','os-version','notification\x20service','campaigns','Service\x20Worker\x20ready','backgroundColor','Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms','getAttribute','Close\x20Click','substring','preInitializedEvents','showDelayedAction','Denied\x20Web\x20Push\x20Soft-ask','getStoredEvents','getInstance','\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a','removeAttribute','json','/device/add-device-token','test','Time\x20difference:\x20','storeActionInLocalStorageInternal','show_notification_error','entry_time','store\x20session','default','style','shopify','Error\x20fetching\x20attribute\x20data','Attribute\x20Name:\x20','MergnError','message','No\x20events\x20to\x20record','filter','100%','fetchEventData','attributeProperty','PushManager','Recording\x20attribute\x20Time','bind','User\x20denied\x20the\x20notification\x20permission.','/brand/get-web-push-public-key','requestPermission','innerHTML','681334aToZMM','map','block','remove','UTM_TERM','\x0aUnexpected\x20error:\x20','Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization','Checking\x20TTL','centered-image','\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20','updateSessionCreated','createElement','Displayed\x20Web\x20Push\x20Subscription','apiKey','Error\x20posting\x20attribute\x20record','2402868DgZcYf','.u-popup-overlay','close','setPreviousUrl','serviceWorker','Image','Logging\x20out','location','number','fbclid','put','isArray','name','Error\x20fetching\x20event\x20data','Initializing\x20notification\x20service\x20from\x20Base\x20Service','push','SCROLL','Mozilla\x20Firefox','\x20is\x20not\x20valid.','ttl','isInitialized','length','recordEventPreInitialized','stringify','Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported','Request\x20aborted','Attribute\x20value\x20is\x20required','entry_time_value','alt','permission','keys','Cannot\x20','setItem','1.0.118','Popup\x20View','Popup','propertyIsEnumerable','User\x20closed\x20the\x20notification\x20permission\x20dialog.','Reachability\x20Push\x20Web','existing_subscription','ContentCard\x20already\x20displayed','value','fetchAttributeData','Error\x20posting\x20event\x20record','DELAY','utm_campaign','removeEventListener','OriginateFrom:\x20','Web\x20Session\x20Concluded','brandId','updateAPIKey','form','\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a','defineProperty','GCLID','Initializing\x20Notification\x20Service','resolve','auto','className','Popup\x20already\x20displayed','addEventListener','setDebugLevel','Failed\x20to\x20check\x20notification\x20permission','string','Unknown','attributes','toLowerCase','#\x20Recording\x20event','randomUUID','should_set_identity','call','Recording\x20attribute','read\x20from\x20private\x20field','Safari','subscribed','view','record\x20event','setOperatingSystem','events','Current\x20time:\x20','values','storeActionInLocalStorage','Verifying\x20API\x20Key\x20after\x20timeout',';\x0acolor:\x20','querySelectorAll','Identity:\x20','showContentCard','Closed\x20Web\x20Push\x20Subscription','\x20not\x20exists','NONE','/attribute','href','group','storeEventsAndPropertiesInLocalStorage','ERROR','UTCDate','MSIE','popup_container_','Time\x20value:\x20','forEach','color'];_0x4072=function(){return _0x2c2976;};return _0x4072();}((()=>{const _0x116db4=_0x1107;var _0x2c1902=Object[_0x116db4(0x1c5)],_0x46721c=Object[_0x116db4(0x2d6)],_0x3dd69b=Object[_0x116db4(0x2c1)],_0x1e33b3=Object[_0x116db4(0x2f7)],_0x51dee3=Object[_0x116db4(0x2a8)]['hasOwnProperty'],_0x3da4da=Object['prototype'][_0x116db4(0x366)],_0x4fbe30=_0x41f93b=>{throw TypeError(_0x41f93b);},_0x1e5c3f=(_0x37317c,_0x4998e3,_0xf88fc3)=>_0x4998e3 in _0x37317c?_0x2c1902(_0x37317c,_0x4998e3,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xf88fc3}):_0x37317c[_0x4998e3]=_0xf88fc3,_0x943ba1=(_0xd48366,_0x320df5)=>{const _0xba8f0d=_0x116db4;for(var _0x542449 in _0x320df5||(_0x320df5={}))_0x51dee3[_0xba8f0d(0x1d6)](_0x320df5,_0x542449)&&_0x1e5c3f(_0xd48366,_0x542449,_0x320df5[_0x542449]);if(_0x1e33b3){for(var _0x542449 of _0x1e33b3(_0x320df5))_0x3da4da[_0xba8f0d(0x1d6)](_0x320df5,_0x542449)&&_0x1e5c3f(_0xd48366,_0x542449,_0x320df5[_0x542449]);}return _0xd48366;},_0x2d5aae=(_0x4a6e21,_0x1740ae)=>_0x46721c(_0x4a6e21,_0x3dd69b(_0x1740ae)),_0x212e43=(_0x16ab4c,_0x1ba302,_0x4319ae)=>_0x1ba302[_0x116db4(0x238)](_0x16ab4c)||_0x4fbe30(_0x116db4(0x361)+_0x4319ae),_0x4dfbd3=(_0x2e2954,_0x4cce50,_0x3dc80b)=>(_0x212e43(_0x2e2954,_0x4cce50,_0x116db4(0x1d8)),_0x3dc80b?_0x3dc80b[_0x116db4(0x1d6)](_0x2e2954):_0x4cce50[_0x116db4(0x1f5)](_0x2e2954)),_0x43d489=(_0x35adde,_0x29f810,_0x205dff)=>_0x29f810[_0x116db4(0x238)](_0x35adde)?_0x4fbe30(_0x116db4(0x244)):_0x29f810 instanceof WeakSet?_0x29f810['add'](_0x35adde):_0x29f810[_0x116db4(0x292)](_0x35adde,_0x205dff),_0x3022e6=(_0x113fb1,_0x782f57,_0x1823f8,_0x2c4166)=>(_0x212e43(_0x113fb1,_0x782f57,_0x116db4(0x25e)),_0x2c4166?_0x2c4166[_0x116db4(0x1d6)](_0x113fb1,_0x1823f8):_0x782f57[_0x116db4(0x292)](_0x113fb1,_0x1823f8),_0x1823f8),_0x5c1008=(_0x153953,_0x1cc129,_0x44e3d9)=>(_0x212e43(_0x153953,_0x1cc129,'access\x20private\x20method'),_0x44e3d9),_0x2e5987=(_0x197490,_0xf18db8,_0x138303)=>new Promise((_0x1d400f,_0x4e36e6)=>{const _0x45ced5=_0x116db4;var _0x261f6d=_0x49f561=>{try{_0x5bcb6b(_0x138303['next'](_0x49f561));}catch(_0x46ea8e){_0x4e36e6(_0x46ea8e);}},_0x5c5246=_0x52dfb1=>{const _0x91fe6f=_0x1107;try{_0x5bcb6b(_0x138303[_0x91fe6f(0x20e)](_0x52dfb1));}catch(_0x90603f){_0x4e36e6(_0x90603f);}},_0x5bcb6b=_0x5404aa=>_0x5404aa[_0x45ced5(0x2f6)]?_0x1d400f(_0x5404aa[_0x45ced5(0x36b)]):Promise[_0x45ced5(0x1c8)](_0x5404aa[_0x45ced5(0x36b)])['then'](_0x261f6d,_0x5c5246);_0x5bcb6b((_0x138303=_0x138303[_0x45ced5(0x24f)](_0x197490,_0xf18db8))['next']());}),_0x4c4d05=_0x116db4(0x363),_0x556b85=_0x116db4(0x296),_0x34ccc9=_0x116db4(0x1ea),_0x3d421f='/set-attribute',_0x1186dd='/event',_0xd07544='/record-event',_0x2424bd=_0x116db4(0x29d),_0x120dc4=_0x116db4(0x319),_0x52d058='/set-identity',_0x1e7d14=_0x116db4(0x330),_0x6990f='/brand/get-time',_0x39cc8b,_0x2ef466,_0x19386e,_0x507889=class _0x187784{constructor(){_0x43d489(this,_0x2ef466);}static['getInstance'](){return _0x4dfbd3(_0x187784,_0x39cc8b)||_0x3022e6(_0x187784,_0x39cc8b,new _0x187784()),_0x4dfbd3(_0x187784,_0x39cc8b);}['updateAPIKey'](_0x883f7){const _0x5a69ec=_0x116db4;_0x187784['apiKey']=_0x883f7;let _0x4eb2b8=_0x883f7,_0x4fd955=/m(\d+)rgn/,_0x25dacf=_0x4eb2b8['match'](_0x4fd955);_0x25dacf&&(_0x187784[_0x5a69ec(0x1c1)]=_0x25dacf[0x1]);}[_0x116db4(0x27a)](){const _0x248b65=_0x116db4;return _0x187784[_0x248b65(0x340)];}[_0x116db4(0x236)](){const _0x2b4e57=_0x116db4;return _0x187784[_0x2b4e57(0x1c1)];}['get'](_0x461c51){return _0x2e5987(this,null,function*(){const _0x3f9091=_0x1107;return(yield fetch(_0x556b85+_0x461c51,{'headers':{'Authorization':_0x5c1008(this,_0x2ef466,_0x19386e)[_0x3f9091(0x1d6)](this,_0x187784[_0x3f9091(0x340)]),'Content-Type':_0x3f9091(0x2ca)}}))[_0x3f9091(0x318)]();});}['post'](_0x1f3dee,_0x5deb2c,_0x5b6adf){return _0x2e5987(this,null,function*(){const _0x41d40a=_0x1107;return(yield fetch(_0x556b85+_0x1f3dee,{'body':JSON[_0x41d40a(0x359)](_0x5deb2c||{}),'headers':{'Authorization':_0x5c1008(this,_0x2ef466,_0x19386e)[_0x41d40a(0x1d6)](this,_0x187784[_0x41d40a(0x340)]),'Content-Type':_0x41d40a(0x2ca)},'method':'POST','signal':_0x5b6adf}))['json']();});}['put'](_0x52fab2,_0x588d2b){return _0x2e5987(this,null,function*(){const _0xa6bead=_0x1107;return(yield fetch(_0x556b85+_0x52fab2,{'body':JSON['stringify'](_0x588d2b||{}),'headers':{'Authorization':_0x5c1008(this,_0x2ef466,_0x19386e)[_0xa6bead(0x1d6)](this,_0x187784['apiKey']),'Content-Type':_0xa6bead(0x2ca)},'method':_0xa6bead(0x2b3)}))[_0xa6bead(0x318)]();});}[_0x116db4(0x202)](){return _0x2e5987(this,null,function*(){const _0x53ab94=_0x1107;try{let _0x4f19da=(yield(yield fetch(_0x556b85+_0x6990f))['json']())[_0x53ab94(0x2e8)];_0x187784['UTCDate']=new Date(_0x4f19da),_0x187784[_0x53ab94(0x274)]=new Date();}catch(_0x4ca208){_0x121dfc(0x2,_0x53ab94(0x242));}});}[_0x116db4(0x264)](){const _0x4c5c5a=_0x116db4;if(!_0x187784[_0x4c5c5a(0x1ef)]||!_0x187784[_0x4c5c5a(0x274)])return _0x121dfc(0x2,_0x4c5c5a(0x271)),new Date();let _0x245799=new Date()['getTime']()-_0x187784[_0x4c5c5a(0x274)]['getTime']();return new Date(_0x187784[_0x4c5c5a(0x1ef)]['getTime']()+_0x245799);}};_0x39cc8b=new WeakMap(),_0x2ef466=new WeakSet(),_0x19386e=function(_0x1017d5){const _0x59e43b=_0x116db4;return btoa(_0x1017d5+':'+new Date()[_0x59e43b(0x2a3)]());},_0x43d489(_0x507889,_0x39cc8b);var _0x51a48f=_0x507889,_0x4b9836=_0x51a48f[_0x116db4(0x315)](),_0x39865d=class extends Error{constructor(_0x13e7d7){const _0xbf4bcc=_0x116db4;super(_0x13e7d7),this['name']=_0xbf4bcc(0x325);}};_0x39865d['disableSDK']=!0x1,_0x39865d[_0x116db4(0x22b)]=!navigator['onLine'],_0x39865d[_0x116db4(0x288)]=0x0,_0x39865d['isInitialized']=!0x1,_0x39865d[_0x116db4(0x225)]=!0x1;var _0x1fe8a8=(_0x3b788d,_0xeff9e4)=>{const _0xf31098=_0x116db4;_0xeff9e4 instanceof _0x39865d?_0x121dfc(0x2,_0xf31098(0x1bf)+_0x3b788d+_0xf31098(0x29c)+_0xeff9e4[_0xf31098(0x326)]):_0xeff9e4 instanceof Error?_0x121dfc(0x2,'OriginateFrom:\x20'+_0x3b788d+'\x0aUnexpected\x20error:\x20'+_0xeff9e4[_0xf31098(0x326)]):_0x121dfc(0x2,_0xf31098(0x1bf)+_0x3b788d+_0xf31098(0x338)+String(_0xeff9e4));},_0x5bf126=(_0x42254d,_0x3ef55e,_0xfb8d27,_0x28765e=!0x1)=>_0x2e5987(void 0x0,null,function*(){const _0x1b0c3d=_0x116db4;try{_0x32acc3(_0x42254d,!0x0),_0x4ae018(_0x42254d+_0x1b0c3d(0x2f1),!0x0);try{if(_0x39865d[_0x1b0c3d(0x215)])throw new _0x39865d(_0x1b0c3d(0x287));if(_0x42254d!==_0x1b0c3d(0x1dc)&&_0x39865d[_0x1b0c3d(0x22b)])throw new _0x39865d('Mergn\x20is\x20offline!');if(_0x42254d!==_0x1b0c3d(0x228)&&_0x42254d!==_0x1b0c3d(0x1f8)&&_0x42254d!=='record\x20event'&&_0x42254d!==_0x1b0c3d(0x2d9)&&!_0x39865d[_0x1b0c3d(0x356)])throw new _0x39865d(_0x1b0c3d(0x262));if(_0x42254d!=='login'&&_0x39865d['loading'])throw new _0x39865d('Mergn\x20is\x20loading!');return yield _0x3ef55e();}catch(_0x489cd4){return _0xfb8d27?_0xfb8d27(_0x489cd4):(_0x39865d[_0x1b0c3d(0x288)]===0x2||_0x39865d[_0x1b0c3d(0x288)]===0x3)&&_0x1fe8a8(_0x42254d,_0x489cd4),!_0x28765e&&_0x4b9836['getBrandId'](),null;}finally{_0x4ae018(_0x42254d+_0x1b0c3d(0x2f1),!0x1),_0x32acc3(_0x42254d,!0x1);}}catch(_0x3c4c48){return null;}}),_0x44594b=(_0x8c082d=>(_0x8c082d[_0x8c082d[_0x116db4(0x1e9)]=0x0]='NONE',_0x8c082d[_0x8c082d['INFO']=0x1]=_0x116db4(0x2b5),_0x8c082d[_0x8c082d['ERROR']=0x2]=_0x116db4(0x1ee),_0x8c082d[_0x8c082d[_0x116db4(0x24d)]=0x3]=_0x116db4(0x24d),_0x8c082d[_0x8c082d['DEBUG']=0x4]=_0x116db4(0x2bd),_0x8c082d))(_0x44594b||{}),_0x121dfc=(_0xc60d14,_0x56dc8a)=>{const _0x29cd76=_0x116db4;_0x39865d['debugLevel']!==0x0&&(_0x39865d[_0x29cd76(0x288)]>=0x3?_0xc60d14===0x1?console[_0x29cd76(0x1fa)](_0x29cd76(0x213)+new Date()[_0x29cd76(0x2e0)](),_0x56dc8a):_0xc60d14===0x2&&console[_0x29cd76(0x2fa)]('ERROR:\x20'+new Date()['toISOString'](),_0x56dc8a):_0x39865d[_0x29cd76(0x288)]===0x1&&_0xc60d14===0x1?console[_0x29cd76(0x1fa)](_0x29cd76(0x213)+new Date()['toISOString'](),_0x56dc8a):_0x39865d[_0x29cd76(0x288)]===0x2&&_0xc60d14===0x2&&console[_0x29cd76(0x2fa)]('ERROR:\x20'+new Date()[_0x29cd76(0x2e0)](),_0x56dc8a));},_0x4ae018=(_0x1a9e7f,_0x44cb66)=>{const _0x3e48bc=_0x116db4;_0x39865d[_0x3e48bc(0x288)]!==0x0&&(_0x44cb66?console[_0x3e48bc(0x21c)](_0x1a9e7f):console['timeEnd'](_0x1a9e7f));},_0x32acc3=(_0x11fb9d,_0x2cb337)=>{const _0x225984=_0x116db4;_0x39865d[_0x225984(0x288)]!==0x0&&(_0x2cb337?console[_0x225984(0x1ec)](_0x11fb9d):console[_0x225984(0x2df)]());},_0x1c8c5a=(_0x2ab6fe=>(_0x2ab6fe[_0x116db4(0x232)]=_0x116db4(0x233),_0x2ab6fe[_0x116db4(0x266)]=_0x116db4(0x281),_0x2ab6fe['UTM_CAMPAIGN']=_0x116db4(0x36f),_0x2ab6fe[_0x116db4(0x337)]=_0x116db4(0x28b),_0x2ab6fe[_0x116db4(0x1ff)]='utm_content',_0x2ab6fe[_0x116db4(0x24a)]='gad_source',_0x2ab6fe[_0x116db4(0x1c6)]=_0x116db4(0x2d4),_0x2ab6fe[_0x116db4(0x267)]=_0x116db4(0x34b),_0x2ab6fe))(_0x1c8c5a||{}),_0x3dce35=new Set(Object[_0x116db4(0x1e0)](_0x1c8c5a)),_0x24447d=_0x116db4(0x2cd),_0x46c781=_0x116db4(0x2f5),_0x499b95,_0xba1c3b,_0x337241,_0x2ff1be,_0x129d4f,_0x3665b0,_0x417a12,_0x5e873d,_0x4b9e97,_0x4dc55f,_0x53768f,_0x558f42,_0x1ef4a9,_0x5e1478,_0x427061,_0xab198f,_0x20b7ba,_0x3de69c,_0x2b9d12,_0x1f1614=class _0xf207cd{constructor(){const _0x32c0a2=_0x116db4;_0x43d489(this,_0x417a12),this[_0x32c0a2(0x35f)]=null,this[_0x32c0a2(0x2b2)]=_0x1797e5=>{const _0x386dcd=_0x32c0a2;_0x121dfc(0x1,'Pushing\x20message\x20to\x20service\x20worker'),navigator[_0x386dcd(0x346)]['getRegistrations']()[_0x386dcd(0x2a2)](_0x492096=>{const _0x470a79=_0x386dcd;var _0x43c638,_0x5b71d5;_0x121dfc(0x1,'Service\x20Worker\x20registration'),(_0x43c638=_0x492096[0x0])!=null&&_0x43c638[_0x470a79(0x293)]&&(_0x121dfc(0x1,_0x470a79(0x30b)),(_0x5b71d5=_0x492096[0x0][_0x470a79(0x293)])==null||_0x5b71d5[_0x470a79(0x283)](JSON['stringify'](_0x1797e5)));})['catch'](_0x204bf9=>{const _0x177454=_0x386dcd;_0x121dfc(0x2,_0x177454(0x2e6)+_0x204bf9[_0x177454(0x326)]);});},this[_0x32c0a2(0x20a)]=()=>{const _0xfa7056=_0x32c0a2;_0xcb4930[_0xfa7056(0x2eb)]({'actionCondition':()=>!0x0,'actionMethod':_0x2c3fd7=>_0x5c1008(this,_0x417a12,_0x5e1478)[_0xfa7056(0x1d6)](this,Number(_0x2c3fd7[_0xfa7056(0x261)])),'localStorageKey':_0xfa7056(0x23a)});},_0x43d489(this,_0x1ef4a9,()=>{_0xcb4930['storeActionInLocalStorageInternal']('web_push_action');}),_0x43d489(this,_0x3de69c,_0x24d68f=>{const _0x3fa2cf=_0x32c0a2;_0xcb4930[_0x3fa2cf(0x227)]({'id':_0x24d68f,'localStorageKey':_0x3fa2cf(0x23a)});});}static[_0x116db4(0x315)](){return _0x4dfbd3(_0xf207cd,_0x499b95)||_0x3022e6(_0xf207cd,_0x499b95,new _0xf207cd()),_0x4dfbd3(_0xf207cd,_0x499b95);}['init'](_0x1dee80,_0x4d793a){return _0x2e5987(this,null,function*(){const _0x51a294=_0x1107;var _0x2fc938;if(_0x121dfc(0x1,_0x51a294(0x1c7)),_0x170f91[_0x51a294(0x22f)]({'eventName':_0x51a294(0x228),'eventProperties':[{'eventProperty':_0x51a294(0x29a),'value':'serviceWorker'in navigator},{'eventProperty':_0x51a294(0x2ba),'value':_0x51a294(0x32c)in window}]}),_0x51a294(0x346)in navigator&&_0x51a294(0x32c)in window){_0x121dfc(0x1,_0x51a294(0x35a));try{_0x170f91['recordDebugEvents']({'eventName':'init_condition'}),_0x3022e6(_0xf207cd,_0xba1c3b,yield navigator[_0x51a294(0x346)][_0x51a294(0x2f3)](_0x4d793a||_0x51a294(0x251))),_0x121dfc(0x1,'Service\x20Worker\x20registered'),_0x121dfc(0x1,_0x51a294(0x339)),this['pushMessageToSW']({'customer':localStorage['getItem']('customer')||'','events':_0x170f91[_0x51a294(0x314)](),'API_KEY':_0x4b9836[_0x51a294(0x27a)](),'device_id':localStorage[_0x51a294(0x2e1)](_0x51a294(0x26c))||'','operatingSystem':_0xcb4930[_0x51a294(0x2ee)](),'osVersion':_0xcb4930[_0x51a294(0x307)](),'Platform':_0xcb4930[_0x51a294(0x2d5)]()}),_0x3022e6(_0xf207cd,_0x129d4f,!0x0);let _0x5ca9ef=_0x5c1008(this,_0x417a12,_0x427061)['call'](this),_0x51fbdd=Object['keys'](_0x5ca9ef||{});if(_0x51fbdd['length']&&_0x5c1008(this,_0x417a12,_0x5e1478)[_0x51a294(0x1d6)](this,Number(_0x51fbdd[0x0])),!_0x1dee80)return;let _0x1d9a96=yield(_0x2fc938=_0x4dfbd3(_0xf207cd,_0xba1c3b))==null?void 0x0:_0x2fc938[_0x51a294(0x2e3)][_0x51a294(0x2c0)]();_0x121dfc(0x1,'Checking\x20for\x20existing\x20subscription'),_0x4dfbd3(_0xf207cd,_0xba1c3b)&&(_0x121dfc(0x1,_0x51a294(0x291)),_0x4dfbd3(_0xf207cd,_0xba1c3b)[_0x51a294(0x25d)]()),_0x1d9a96?(_0x121dfc(0x1,_0x51a294(0x290)),_0x170f91['recordDebugEvents']({'eventName':_0x51a294(0x369)}),yield _0x5c1008(this,_0x417a12,_0x53768f)[_0x51a294(0x1d6)](this),_0x3022e6(_0xf207cd,_0x337241,!0x0)):(_0x121dfc(0x1,_0x51a294(0x2b7)),yield _0x5c1008(this,_0x417a12,_0x5e873d)['call'](this,_0x4dfbd3(_0xf207cd,_0x3665b0)||void 0x0));}catch(_0x2d3198){let _0x28ad78=_0x2d3198&&_0x2d3198[_0x51a294(0x326)]?_0x2d3198[_0x51a294(0x326)][_0x51a294(0x310)](0x0,0x64):_0x51a294(0x2fd);yield _0x170f91[_0x51a294(0x22f)]({'eventName':_0x51a294(0x368),'eventProperties':[{'eventProperty':_0x51a294(0x326),'value':''+_0x28ad78}]}),_0x121dfc(0x2,_0x51a294(0x25b)),_0x121dfc(0x2,_0x28ad78);}}});}[_0x116db4(0x272)](_0x349769){const _0x3ff9d3=_0x116db4;if(!_0x4dfbd3(_0xf207cd,_0x129d4f)){_0x3022e6(_0xf207cd,_0x3665b0,_0x349769),_0x170f91[_0x3ff9d3(0x22f)]({'eventName':'notification_service_not_initialized'}),_0x121dfc(0x2,'Notification\x20service\x20is\x20not\x20initialized');return;}_0x5bf126(_0x3ff9d3(0x272),()=>_0x2e5987(this,null,function*(){const _0x3beacf=_0x3ff9d3;let _0x49eaaf=JSON[_0x3beacf(0x21d)](localStorage[_0x3beacf(0x2e1)]('web_push_action')||'{}');if(_0x49eaaf&&_0x49eaaf[_0x349769[_0x3beacf(0x261)]]){_0x121dfc(0x1,_0x3beacf(0x2b4));return;}_0x5c1008(this,_0x417a12,_0x558f42)['call'](this,_0x349769),_0x4dfbd3(this,_0x1ef4a9)[_0x3beacf(0x1d6)](this),_0x5c1008(this,_0x417a12,_0x5e1478)[_0x3beacf(0x1d6)](this,_0x349769[_0x3beacf(0x261)]);}));}};_0x499b95=new WeakMap(),_0xba1c3b=new WeakMap(),_0x337241=new WeakMap(),_0x2ff1be=new WeakMap(),_0x129d4f=new WeakMap(),_0x3665b0=new WeakMap(),_0x417a12=new WeakSet(),_0x5e873d=function(_0x442b51){return _0x2e5987(this,null,function*(){const _0x3f7ba1=_0x1107;_0x121dfc(0x1,_0x3f7ba1(0x25c)+JSON[_0x3f7ba1(0x359)](_0x442b51)+'\x20'),_0x170f91['recordDebugEvents']({'eventName':_0x3f7ba1(0x273)});let _0x19abac;try{_0x19abac=Notification[_0x3f7ba1(0x35f)],_0x19abac&&(_0x121dfc(0x1,_0x3f7ba1(0x2af)+_0x19abac),_0x19abac===_0x3f7ba1(0x320)?(_0x442b51||(this[_0x3f7ba1(0x35f)]=_0x3f7ba1(0x320),_0x170f91['recordDebugEvents']({'eventName':_0x3f7ba1(0x22e)})),_0x442b51&&(_0x170f91[_0x3f7ba1(0x22f)]({'eventName':'notification_data','eventProperties':[{'eventProperty':_0x3f7ba1(0x26d),'value':''+(_0x442b51==null?void 0x0:_0x442b51[_0x3f7ba1(0x26d)])}]}),_0x4dfbd3(this,_0x3de69c)['call'](this,_0x442b51[_0x3f7ba1(0x261)]),_0x442b51[_0x3f7ba1(0x26d)]===_0x3f7ba1(0x2dc)?_0x5c1008(this,_0x417a12,_0x4b9e97)[_0x3f7ba1(0x1d6)](this,_0x442b51):yield _0x5c1008(this,_0x417a12,_0x4dc55f)['call'](this,_0x442b51))):_0x19abac===_0x3f7ba1(0x2c2)?(_0x170f91['recordDebugEvents']({'eventName':_0x3f7ba1(0x226)}),_0x121dfc(0x1,'The\x20user\x20has\x20blocked\x20notifications.')):(_0x170f91[_0x3f7ba1(0x22f)]({'eventName':_0x3f7ba1(0x255)}),_0x121dfc(0x1,_0x3f7ba1(0x2f9)),_0x4dfbd3(_0x1f1614,_0x337241)||(yield _0x5c1008(this,_0x417a12,_0x53768f)[_0x3f7ba1(0x1d6)](this),yield _0x170f91[_0x3f7ba1(0x2ec)]({'eventName':_0x3f7ba1(0x21e)}),_0x442b51||_0x3022e6(_0x1f1614,_0x337241,!0x0))));}catch(_0x4d8231){_0x121dfc(0x2,_0x3f7ba1(0x1ce)),_0x170f91[_0x3f7ba1(0x22f)]({'eventName':'notification_permission_error'});}});},_0x4b9e97=function(_0x26fe84){const _0x552e57=_0x116db4;try{let _0x466991=document[_0x552e57(0x33e)](_0x552e57(0x280)),_0x46f6e9;_0x26fe84[_0x552e57(0x301)][_0x552e57(0x2a4)]&&(_0x46f6e9=document[_0x552e57(0x33e)](_0x552e57(0x27e)),_0x46f6e9[_0x552e57(0x241)]=_0x26fe84[_0x552e57(0x301)][_0x552e57(0x2a4)],_0x46f6e9[_0x552e57(0x35e)]=_0x552e57(0x347),_0x46f6e9['id']=_0x552e57(0x33b));let _0x254b9b=document[_0x552e57(0x33e)]('div'),_0x2bbfc1=document[_0x552e57(0x33e)](_0x552e57(0x280)),_0x452b3e=document['createElement'](_0x552e57(0x280)),_0x36b081=document[_0x552e57(0x33e)](_0x552e57(0x27e)),_0x367ca2=document['createElement'](_0x552e57(0x280)),_0x331580=document[_0x552e57(0x33e)](_0x552e57(0x280)),_0x25e810=document[_0x552e57(0x33e)](_0x552e57(0x280)),_0x26c71a=document[_0x552e57(0x33e)](_0x552e57(0x280)),_0x3ee619=document[_0x552e57(0x33e)](_0x552e57(0x280)),_0x4a1f1b=document[_0x552e57(0x33e)](_0x552e57(0x280)),_0x59a901=document[_0x552e57(0x33e)](_0x552e57(0x304)),_0x3ef1cf=document[_0x552e57(0x33e)](_0x552e57(0x304));_0x466991[_0x552e57(0x1ca)]=_0x552e57(0x216),_0x254b9b[_0x552e57(0x1ca)]=_0x552e57(0x299),_0x2bbfc1['className']=_0x26c71a[_0x552e57(0x1ca)]=_0x3ee619['className']=_0x552e57(0x27c),_0x452b3e[_0x552e57(0x1ca)]=_0x552e57(0x218),_0x367ca2[_0x552e57(0x1ca)]='mergn-column-75',_0x4a1f1b[_0x552e57(0x1ca)]=_0x552e57(0x252),_0x331580['id']=_0x552e57(0x29e),_0x25e810['id']=_0x552e57(0x257),_0x59a901['id']='button-1',_0x3ef1cf['id']='button-2',_0x36b081[_0x552e57(0x241)]=_0x26fe84[_0x552e57(0x301)]['banner_icon'],_0x36b081[_0x552e57(0x35e)]=_0x552e57(0x347),_0x36b081['id']=_0x552e57(0x206),_0x331580['textContent']=_0x26fe84['banner_design'][_0x552e57(0x20c)],_0x25e810['textContent']=_0x26fe84[_0x552e57(0x301)]['banner_text'],_0x59a901[_0x552e57(0x249)]=_0x26fe84['banner_design']['button_1']['text'],_0x3ef1cf[_0x552e57(0x249)]=_0x26fe84[_0x552e57(0x301)][_0x552e57(0x240)][_0x552e57(0x26e)],_0x452b3e[_0x552e57(0x24c)](_0x36b081),_0x367ca2[_0x552e57(0x24c)](_0x331580),_0x367ca2[_0x552e57(0x24c)](_0x25e810),_0x2bbfc1['appendChild'](_0x452b3e),_0x2bbfc1[_0x552e57(0x24c)](_0x367ca2),_0x46f6e9&&(_0x26c71a[_0x552e57(0x24c)](_0x46f6e9),_0x46f6e9[_0x552e57(0x321)][_0x552e57(0x2fb)]='\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'),_0x4a1f1b['appendChild'](_0x59a901),_0x4a1f1b['appendChild'](_0x3ef1cf),_0x3ee619['appendChild'](_0x4a1f1b),_0x254b9b[_0x552e57(0x24c)](_0x2bbfc1),_0x254b9b[_0x552e57(0x24c)](_0x26c71a),_0x254b9b[_0x552e57(0x24c)](_0x3ee619),_0x466991[_0x552e57(0x24c)](_0x254b9b),_0x466991[_0x552e57(0x321)][_0x552e57(0x2fb)]=_0x552e57(0x221),_0x254b9b[_0x552e57(0x321)][_0x552e57(0x2fb)]=_0x552e57(0x212)+_0x26fe84['banner_design'][_0x552e57(0x26b)]+_0x552e57(0x247),_0x2bbfc1['style'][_0x552e57(0x2fb)]=_0x26c71a['style'][_0x552e57(0x2fb)]=_0x3ee619[_0x552e57(0x321)]['cssText']=_0x552e57(0x316),_0x452b3e['style'][_0x552e57(0x2fb)]=_0x552e57(0x245),_0x367ca2[_0x552e57(0x321)][_0x552e57(0x2fb)]=_0x552e57(0x1c4),_0x36b081[_0x552e57(0x321)][_0x552e57(0x2fb)]=_0x552e57(0x20f),_0x59a901[_0x552e57(0x321)][_0x552e57(0x2fb)]=_0x552e57(0x270)+_0x26fe84[_0x552e57(0x301)][_0x552e57(0x200)][_0x552e57(0x30c)]+_0x552e57(0x1e3)+_0x26fe84[_0x552e57(0x301)]['button_1'][_0x552e57(0x1f4)]+';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a',_0x3ef1cf['style'][_0x552e57(0x2fb)]=_0x552e57(0x270)+_0x26fe84['banner_design'][_0x552e57(0x240)][_0x552e57(0x30c)]+_0x552e57(0x1e3)+_0x26fe84[_0x552e57(0x301)]['button_2'][_0x552e57(0x1f4)]+_0x552e57(0x205),_0x4a1f1b['style']['cssText']='\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a',_0x331580[_0x552e57(0x321)][_0x552e57(0x2fb)]=_0x552e57(0x33c)+_0x26fe84['banner_design'][_0x552e57(0x237)]+'\x0a',_0x25e810['style']['cssText']='\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20'+_0x26fe84[_0x552e57(0x301)]['text_color']+'\x0a',document[_0x552e57(0x2f8)]['appendChild'](_0x466991),document[_0x552e57(0x2f8)][_0x552e57(0x321)][_0x552e57(0x2c9)]=_0x552e57(0x295),_0x170f91[_0x552e57(0x2ec)]({'eventName':'Viewed\x20Web\x20Push\x20Soft-ask','name':_0x552e57(0x210),'web_optin_instance_id':_0x26fe84[_0x552e57(0x261)]}),_0x59a901==null||_0x59a901[_0x552e57(0x1cc)]('click',()=>_0x2e5987(this,null,function*(){const _0xc79031=_0x552e57;_0x466991['remove'](),_0x3022e6(_0x1f1614,_0x2ff1be,!0x1),document[_0xc79031(0x2f8)]['style'][_0xc79031(0x2c9)]='auto',yield _0x170f91[_0xc79031(0x2ec)]({'eventName':_0xc79031(0x313),'web_optin_instance_id':_0x26fe84[_0xc79031(0x261)]}),_0x121dfc(0x1,_0xc79031(0x32f));})),_0x3ef1cf==null||_0x3ef1cf[_0x552e57(0x1cc)]('click',()=>_0x2e5987(this,null,function*(){const _0x5124bd=_0x552e57;_0x466991[_0x5124bd(0x336)](),document[_0x5124bd(0x2f8)][_0x5124bd(0x321)][_0x5124bd(0x2c9)]=_0x5124bd(0x1c9),_0x170f91[_0x5124bd(0x2ec)]({'eventName':_0x5124bd(0x1fc),'web_optin_instance_id':_0x26fe84[_0x5124bd(0x261)]}),yield _0x5c1008(this,_0x417a12,_0x4dc55f)[_0x5124bd(0x1d6)](this,_0x26fe84);}));}catch(_0x416fab){}},_0x4dc55f=function(_0x67d0e4){return _0x2e5987(this,null,function*(){const _0x3c8c2e=_0x1107;try{_0x170f91[_0x3c8c2e(0x2ec)]({'eventName':_0x3c8c2e(0x33f),'name':_0x3c8c2e(0x210),'web_optin_instance_id':_0x67d0e4[_0x3c8c2e(0x261)]});let _0x3d7a96=yield Notification[_0x3c8c2e(0x331)]();_0x3d7a96===_0x3c8c2e(0x2e5)?(_0x121dfc(0x1,_0x3c8c2e(0x1f7)),yield _0x5c1008(this,_0x417a12,_0x53768f)['call'](this),yield _0x170f91[_0x3c8c2e(0x2ec)]({'eventName':'Allowed\x20Web\x20Push\x20Subscription','name':_0x3c8c2e(0x1da),'web_optin_instance_id':_0x67d0e4[_0x3c8c2e(0x261)]})):_0x3d7a96==='denied'?(yield _0x170f91['recordEvent']({'eventName':_0x3c8c2e(0x207)}),_0x121dfc(0x1,'User\x20denied\x20the\x20notification\x20permission.')):_0x3d7a96==='default'&&(yield _0x170f91[_0x3c8c2e(0x2ec)]({'eventName':_0x3c8c2e(0x1e7)}),_0x121dfc(0x1,_0x3c8c2e(0x367)));}catch(_0x74dff9){_0x121dfc(0x2,_0x3c8c2e(0x2ed));}_0x3022e6(_0x1f1614,_0x2ff1be,!0x1);});},_0x53768f=function(){return _0x2e5987(this,null,function*(){const _0x5e8cc2=_0x1107;var _0x4560af,_0x298c10;let _0x2f7118=yield _0x4b9836[_0x5e8cc2(0x1f5)](''+_0x1e7d14);if(_0x2f7118[_0x5e8cc2(0x286)]){let _0x4e9093=yield(_0x4560af=_0x4dfbd3(_0x1f1614,_0xba1c3b))==null?void 0x0:_0x4560af[_0x5e8cc2(0x2e3)][_0x5e8cc2(0x2c0)]();_0x4e9093&&(yield _0x4e9093['unsubscribe']());let _0x4afa2d=yield(_0x298c10=_0x4dfbd3(_0x1f1614,_0xba1c3b))==null?void 0x0:_0x298c10[_0x5e8cc2(0x2e3)][_0x5e8cc2(0x224)]({'applicationServerKey':_0x2f7118[_0x5e8cc2(0x2e8)]||'','userVisibleOnly':!0x0});yield _0x4b9836[_0x5e8cc2(0x34c)](''+_0x120dc4,{'device_id':localStorage[_0x5e8cc2(0x2e1)]('uniqueIdentity')||'','is_web_push_subscribed':!0x0,'web_push_subscription_page_url':window[_0x5e8cc2(0x349)][_0x5e8cc2(0x254)],'web_push_token':{'token':JSON[_0x5e8cc2(0x21d)](JSON[_0x5e8cc2(0x359)](_0x4afa2d))}}),_0x121dfc(0x1,'User\x20is\x20subscribed');}else throw new Error('Failed\x20to\x20subscribe\x20the\x20user');});},_0x558f42=function(_0x4f98aa){const _0x216b10=_0x116db4;_0xcb4930[_0x216b10(0x1e1)](_0x4f98aa,_0x216b10(0x23a),_0x216b10(0x261));},_0x1ef4a9=new WeakMap(),_0x5e1478=function(_0x588d85){const _0x9f121d=_0x116db4;if(_0x4dfbd3(_0x1f1614,_0x2ff1be))return;_0x3022e6(_0x1f1614,_0x2ff1be,!0x0);let _0x196b42=_0x5c1008(this,_0x417a12,_0x427061)[_0x9f121d(0x1d6)](this);if(_0x196b42!=null&&_0x196b42[_0x588d85])switch(_0x196b42[_0x588d85][_0x9f121d(0x31e)]){case _0x9f121d(0x36e):{_0x5c1008(this,_0x417a12,_0xab198f)[_0x9f121d(0x1d6)](this,_0x196b42[_0x588d85]);break;}case'IMMEDIATELY':{_0x5c1008(this,_0x417a12,_0x20b7ba)[_0x9f121d(0x1d6)](this,_0x196b42[_0x588d85]);break;}case _0x9f121d(0x352):{_0x5c1008(this,_0x417a12,_0x2b9d12)[_0x9f121d(0x1d6)](this,_0x196b42[_0x588d85]);break;}default:return;}},_0x427061=function(){const _0x2e5470=_0x116db4;let _0x35fbe6=localStorage[_0x2e5470(0x2e1)](_0x2e5470(0x23a));return _0x35fbe6?JSON['parse'](_0x35fbe6):null;},_0xab198f=function(_0x1e3ab4){const _0x139f5b=_0x116db4;_0xcb4930[_0x139f5b(0x312)]({'clearActionMethod':_0x4dfbd3(this,_0x3de69c)[_0x139f5b(0x32e)](this),'data':_0x1e3ab4,'displayMethod':_0x5c1008(this,_0x417a12,_0x20b7ba)[_0x139f5b(0x32e)](this),'idKey':'web_optin_instance_id','timeValueKey':_0x139f5b(0x35d)});},_0x20b7ba=function(_0x1408fb){_0x5c1008(this,_0x417a12,_0x5e873d)['call'](this,_0x1408fb);},_0x3de69c=new WeakMap(),_0x2b9d12=function(_0x14b8ea){const _0x47ab26=_0x116db4;_0xcb4930[_0x47ab26(0x1f9)]({'data':_0x14b8ea,'displayMethod':_0x5c1008(this,_0x417a12,_0x20b7ba)[_0x47ab26(0x32e)](this),'timeValueKey':_0x47ab26(0x35d)});},_0x43d489(_0x1f1614,_0x499b95),_0x43d489(_0x1f1614,_0xba1c3b,null),_0x43d489(_0x1f1614,_0x337241,!0x1),_0x43d489(_0x1f1614,_0x2ff1be,!0x1),_0x43d489(_0x1f1614,_0x129d4f,!0x1),_0x43d489(_0x1f1614,_0x3665b0,null);var _0x3c40a9=_0x1f1614,_0x11cd43=_0x3c40a9[_0x116db4(0x315)](),_0x11a891,_0x3b1fdc,_0x59e96a,_0x56b921,_0x5c710e,_0x47089c,_0x1c2088,_0x5f1cc9,_0x3837b6,_0x56a0ab,_0x4c0f01,_0x10f8e4,_0x395ffa=class _0x480b9c{constructor(){_0x43d489(this,_0x3b1fdc),_0x43d489(this,_0x1c2088,_0x3156f2=>{const _0x4f46c3=_0x1107;_0xcb4930['clearActionInLocalStorage']({'id':_0x3156f2,'localStorageKey':_0x4f46c3(0x223)});}),this['loadPopupEventActionInLocalStorage']=()=>{const _0x29ca69=_0x1107;_0xcb4930[_0x29ca69(0x2eb)]({'actionCondition':_0x14e4fb=>_0x14e4fb['message']['name']===_0x29ca69(0x365),'actionMethod':_0x41b40c=>_0x5c1008(this,_0x3b1fdc,_0x56b921)['call'](this,_0x41b40c[_0x29ca69(0x23b)]),'localStorageKey':'action'});},_0x43d489(this,_0x10f8e4,()=>{const _0xb9feb2=_0x1107;_0xcb4930[_0xb9feb2(0x31c)](_0xb9feb2(0x223));});}static[_0x116db4(0x315)](){const _0x4a9128=_0x116db4;var _0x5e8db3;return _0x4dfbd3(_0x480b9c,_0x11a891)||(_0x3022e6(_0x480b9c,_0x11a891,new _0x480b9c()),_0x5c1008(_0x5e8db3=_0x4dfbd3(_0x480b9c,_0x11a891),_0x3b1fdc,_0x59e96a)[_0x4a9128(0x1d6)](_0x5e8db3)),_0x4dfbd3(_0x480b9c,_0x11a891);}[_0x116db4(0x2de)](_0x285d8e){const _0x2ec20e=_0x116db4;let _0x4e95e9=JSON[_0x2ec20e(0x21d)](localStorage[_0x2ec20e(0x2e1)]('action')||'{}');if(_0x4e95e9&&_0x4e95e9[_0x285d8e==null?void 0x0:_0x285d8e[_0x2ec20e(0x23b)]]){_0x121dfc(0x1,_0x2ec20e(0x201));return;}_0x5c1008(this,_0x3b1fdc,_0x4c0f01)[_0x2ec20e(0x1d6)](this,_0x285d8e),_0x4dfbd3(this,_0x10f8e4)['call'](this),_0x5c1008(this,_0x3b1fdc,_0x56b921)['call'](this,_0x285d8e['campaignId']);}[_0x116db4(0x265)](_0x5b5b16){const _0x1a5d7b=_0x116db4;return _0x5b5b16===_0x1a5d7b(0x365);}};_0x11a891=new WeakMap(),_0x3b1fdc=new WeakSet(),_0x59e96a=function(){return _0x2e5987(this,null,function*(){});},_0x56b921=function(_0x3120ca){const _0xa932f9=_0x116db4;let _0x1365e0=_0x5c1008(this,_0x3b1fdc,_0x5c710e)[_0xa932f9(0x1d6)](this);if(document[_0xa932f9(0x1fb)]('popup_container_'+_0x3120ca)){_0x121dfc(0x1,_0xa932f9(0x1cb)),_0x4dfbd3(this,_0x1c2088)[_0xa932f9(0x1d6)](this,_0x3120ca);return;}if(_0x1365e0!=null&&_0x1365e0[_0x3120ca])switch(_0x1365e0[_0x3120ca][_0xa932f9(0x220)]){case'DELAY':{_0x5c1008(this,_0x3b1fdc,_0x47089c)['call'](this,_0x1365e0[_0x3120ca]);break;}case'IMMEDIATELY':{_0x5c1008(this,_0x3b1fdc,_0x5f1cc9)['call'](this,_0x1365e0[_0x3120ca]);break;}case _0xa932f9(0x352):{_0x5c1008(this,_0x3b1fdc,_0x56a0ab)[_0xa932f9(0x1d6)](this,_0x1365e0[_0x3120ca]);break;}default:return;}},_0x5c710e=function(){const _0x189a32=_0x116db4;let _0x5adc32=localStorage[_0x189a32(0x2e1)]('action');return _0x5adc32?JSON[_0x189a32(0x21d)](_0x5adc32):null;},_0x47089c=function(_0x27fb1e){const _0x1b0d3c=_0x116db4;_0xcb4930[_0x1b0d3c(0x312)]({'clearActionMethod':_0x4dfbd3(this,_0x1c2088)[_0x1b0d3c(0x32e)](this),'data':_0x27fb1e,'displayMethod':_0x5c1008(this,_0x3b1fdc,_0x5f1cc9)[_0x1b0d3c(0x32e)](this),'idKey':_0x1b0d3c(0x23b),'timeValueKey':_0x1b0d3c(0x2d0)});},_0x1c2088=new WeakMap(),_0x5f1cc9=function(_0x236bc7){const _0x4bcffb=_0x116db4;if(document['getElementById']('popup_container_'+_0x236bc7[_0x4bcffb(0x23b)]))_0x121dfc(0x1,_0x4bcffb(0x1cb));else{let _0x56adab=_0x5c1008(this,_0x3b1fdc,_0x3837b6)[_0x4bcffb(0x1d6)](this,'div',_0x236bc7);document[_0x4bcffb(0x2f8)][_0x4bcffb(0x24c)](_0x56adab),_0x170f91[_0x4bcffb(0x2ec)]({'campaignCustomerInstanceId':_0x236bc7[_0x4bcffb(0x231)],'campaignId':_0x236bc7[_0x4bcffb(0x23b)],'eventName':_0x24447d,'eventProperties':[{'eventProperty':_0x4bcffb(0x364),'value':JSON['stringify']({'campaignId':_0x236bc7[_0x4bcffb(0x23b)]})}],'name':_0x4bcffb(0x1db)});}_0x4dfbd3(this,_0x1c2088)[_0x4bcffb(0x1d6)](this,_0x236bc7[_0x4bcffb(0x23b)]);},_0x3837b6=function(_0x4de0f8,_0x273888){const _0x274456=_0x116db4;let {campaignCustomerInstanceId:_0x3475a5,campaignId:_0x6fdf3f,message:{design:_0x236adc}}=_0x273888,_0x27941d=document[_0x274456(0x33e)](_0x4de0f8);_0x27941d['id']=_0x274456(0x1f1)+_0x6fdf3f,_0x27941d[_0x274456(0x332)]=_0x236adc,_0x27941d['style'][_0x274456(0x23f)]='fixed',_0x27941d[_0x274456(0x321)]['top']='0',_0x27941d['style']['left']='0',_0x27941d[_0x274456(0x321)]['width']=_0x274456(0x329),_0x27941d[_0x274456(0x321)][_0x274456(0x2da)]=_0x274456(0x329),_0x27941d[_0x274456(0x321)][_0x274456(0x230)]=_0x274456(0x23c);let _0x23eded=_0x27941d['querySelector'](_0x274456(0x28e));_0x23eded&&(_0x23eded['style'][_0x274456(0x230)]='50');let _0x34210e=_0x23eded['querySelector'](_0x274456(0x343));_0x34210e&&(_0x121dfc(0x1,_0x274456(0x20b)),_0x34210e['style']['setProperty']('display',_0x274456(0x335),_0x274456(0x2ae))),_0x27941d[_0x274456(0x1e4)]('[id^=\x22u_content_form_\x22]')[_0x274456(0x1f3)](_0x3024a6=>{const _0x5616ac=_0x274456;let _0x3cad31=_0x3024a6[_0x5616ac(0x2e2)]('form');_0x3cad31&&_0x3cad31[_0x5616ac(0x1cc)](_0x5616ac(0x259),()=>_0x2e5987(this,null,function*(){const _0x3c6a55=_0x5616ac;_0x27941d[_0x3c6a55(0x336)]();let _0x587c89=new FormData(_0x3cad31),_0x4cb9c7={};for(let [_0x1d974b,_0xfaa659]of _0x587c89[_0x3c6a55(0x276)]())_0x4cb9c7[_0x1d974b]=_0xfaa659;yield _0x170f91[_0x3c6a55(0x2ec)]({'campaignCustomerInstanceId':_0x3475a5,'campaignId':_0x6fdf3f,'eventName':_0x24447d,'eventProperties':[{'eventProperty':_0x3c6a55(0x22d),'value':JSON['stringify']({'campaignId':_0x6fdf3f,'formId':_0x3024a6['id'],'formValues':_0x4cb9c7})},{'eventProperty':_0x3c6a55(0x2e7),'value':_0x6fdf3f[_0x3c6a55(0x2b9)]()}],'name':_0x3c6a55(0x1c3)});}));});let _0x28745a=_0x27941d[_0x274456(0x2e2)](_0x274456(0x2fc));return(_0x28745a==null?void 0x0:_0x28745a[_0x274456(0x30e)](_0x274456(0x1eb)))==='#'&&_0x28745a[_0x274456(0x317)]('href'),_0x28745a==null||_0x28745a[_0x274456(0x1cc)](_0x274456(0x2bb),()=>_0x2e5987(this,null,function*(){const _0x397ee3=_0x274456;_0x27941d[_0x397ee3(0x336)](),yield _0x170f91[_0x397ee3(0x2ec)]({'campaignCustomerInstanceId':_0x3475a5,'campaignId':_0x6fdf3f,'eventName':_0x24447d,'eventProperties':[{'eventProperty':_0x397ee3(0x30f),'value':JSON['stringify']({'campaignId':_0x6fdf3f})}],'name':_0x397ee3(0x344)});})),_0x27941d[_0x274456(0x1e4)](_0x274456(0x24b))[_0x274456(0x1f3)](_0x581619=>{const _0x394df1=_0x274456;_0x581619['addEventListener'](_0x394df1(0x2bb),()=>_0x2e5987(this,null,function*(){const _0x4686e6=_0x394df1;_0x27941d['remove'](),yield _0x170f91['recordEvent']({'campaignCustomerInstanceId':_0x3475a5,'campaignId':_0x6fdf3f,'eventName':_0x24447d,'eventProperties':[{'eventProperty':_0x4686e6(0x21b),'value':JSON['stringify']({'buttonId':_0x581619['id'],'campaignId':_0x6fdf3f})}],'name':_0x4686e6(0x2bb)});}));}),_0x27941d[_0x274456(0x1e4)](_0x274456(0x253))[_0x274456(0x1f3)](_0x494ac3=>{const _0x4fb88b=_0x274456;_0x494ac3[_0x4fb88b(0x1cc)](_0x4fb88b(0x2bb),()=>_0x2e5987(this,null,function*(){const _0x39c0df=_0x4fb88b;_0x27941d['remove'](),yield _0x170f91[_0x39c0df(0x2ec)]({'campaignCustomerInstanceId':_0x3475a5,'campaignId':_0x6fdf3f,'eventName':_0x24447d,'eventProperties':[{'eventProperty':_0x39c0df(0x239),'value':JSON['stringify']({'campaignId':_0x6fdf3f,'imageClassName':_0x494ac3[_0x39c0df(0x1ca)],'imageId':_0x494ac3['id']})}],'name':_0x39c0df(0x2bb)});}));}),_0x27941d;},_0x56a0ab=function(_0x49b097){const _0x3be06e=_0x116db4;_0xcb4930[_0x3be06e(0x1f9)]({'data':_0x49b097,'displayMethod':_0x5c1008(this,_0x3b1fdc,_0x5f1cc9)[_0x3be06e(0x32e)](this),'timeValueKey':_0x3be06e(0x2d0)});},_0x4c0f01=function(_0x76b079){const _0x2b9d6f=_0x116db4;_0xcb4930[_0x2b9d6f(0x1e1)](_0x76b079,_0x2b9d6f(0x223),_0x2b9d6f(0x23b));},_0x10f8e4=new WeakMap(),_0x43d489(_0x395ffa,_0x11a891);var _0x15aefe=_0x395ffa,_0x35d500=_0x15aefe[_0x116db4(0x315)](),_0x470dc5,_0x27be4a,_0x12c374,_0x3bd4cb,_0x95d0be,_0x2bdddb,_0x161ee9,_0x477870,_0x3dc9e6=class _0x4f48e7{constructor(){const _0x3239d9=_0x116db4;_0x43d489(this,_0x27be4a),this[_0x3239d9(0x260)]=Promise[_0x3239d9(0x1c8)]();}static['getInstance'](){const _0x331cef=_0x116db4;var _0x41d119;return _0x4dfbd3(_0x4f48e7,_0x470dc5)||(_0x3022e6(_0x4f48e7,_0x470dc5,new _0x4f48e7()),_0x5c1008(_0x41d119=_0x4dfbd3(_0x4f48e7,_0x470dc5),_0x27be4a,_0x12c374)[_0x331cef(0x1d6)](_0x41d119)),_0x4dfbd3(_0x4f48e7,_0x470dc5);}[_0x116db4(0x2bf)](_0x425119){const _0x3f332f=_0x116db4;let _0x368530=JSON['parse'](localStorage[_0x3f332f(0x2e1)](_0x3f332f(0x311))||'[]');_0x368530[_0x3f332f(0x351)](_0x425119),localStorage[_0x3f332f(0x362)](_0x3f332f(0x311),JSON['stringify'](_0x368530));}[_0x116db4(0x2fe)](){return _0x2e5987(this,null,function*(){const _0x139abd=_0x1107;let _0x3c2507=JSON[_0x139abd(0x21d)](localStorage[_0x139abd(0x2e1)](_0x139abd(0x311))||'[]');if(Array['isArray'](_0x3c2507)){for(let _0x244fb0 of _0x3c2507)yield this['recordEventPreInitialized'](_0x244fb0);}});}[_0x116db4(0x2ec)](_0x3429fb,_0x14ef1e){return _0x2e5987(this,null,function*(){const _0x2274ee=_0x1107;_0x39865d[_0x2274ee(0x356)]&&!_0x39865d['loading']?yield _0x5c1008(this,_0x27be4a,_0x3bd4cb)['call'](this,_0x3429fb,_0x14ef1e):this[_0x2274ee(0x2bf)](_0x3429fb);});}[_0x116db4(0x358)](_0x4d8cf3){return _0x2e5987(this,null,function*(){const _0x23ae77=_0x1107;try{yield _0x5c1008(this,_0x27be4a,_0x3bd4cb)[_0x23ae77(0x1d6)](this,_0x4d8cf3);}finally{_0x5c1008(this,_0x27be4a,_0x477870)[_0x23ae77(0x1d6)](this,_0x4d8cf3[_0x23ae77(0x305)]);}});}['recordDebugEvents'](_0x4b1cd3){return _0x2e5987(this,null,function*(){const _0x2522d5=_0x1107;_0x39865d[_0x2522d5(0x288)]===0x4&&(!_0x39865d[_0x2522d5(0x279)]||_0x39865d[_0x2522d5(0x279)][_0x4b1cd3[_0x2522d5(0x305)]])&&(yield _0x5c1008(this,_0x27be4a,_0x3bd4cb)[_0x2522d5(0x1d6)](this,_0x4b1cd3));});}[_0x116db4(0x314)](){const _0xcd477f=_0x116db4;let _0x511034=localStorage[_0xcd477f(0x2e1)](_0xcd477f(0x1de));return _0x511034?JSON[_0xcd477f(0x21d)](_0x511034):{};}[_0x116db4(0x1ed)](){return _0x2e5987(this,null,function*(){const _0x597463=_0x1107;if(!localStorage[_0x597463(0x2e1)](_0x597463(0x1de))){let _0x2c7580=(yield this[_0x597463(0x32a)]())[_0x597463(0x2e8)];if(_0x2c7580){localStorage[_0x597463(0x362)]('events',JSON[_0x597463(0x359)](_0x2c7580));try{_0x11cd43[_0x597463(0x2b2)]({'events':_0x2c7580});}catch(_0x34498f){}}}});}[_0x116db4(0x32a)](){return _0x2e5987(this,null,function*(){const _0x213b5c=_0x1107;try{return yield _0x4b9836['get'](''+_0x1186dd);}catch(_0x58249c){throw new Error(_0x213b5c(0x34f));}});}[_0x116db4(0x2f4)](_0x214111,_0x141443){return _0x2e5987(this,null,function*(){const _0x5049f1=_0x1107;let _0x1c8264=null,_0x5e8fc3=null,_0x1caf26=new AbortController();return this[_0x5049f1(0x260)]=this[_0x5049f1(0x260)][_0x5049f1(0x2a2)](()=>_0x2e5987(this,null,function*(){const _0xf593a5=_0x5049f1;try{if(_0x214111['events'][_0xf593a5(0x357)]===0x0)throw new Error(_0xf593a5(0x327));let _0x20663f=yield _0x4b9836['post'](_0xf593a5(0x2a6)+_0x1186dd+_0xd07544,_0x214111,_0x1caf26[_0xf593a5(0x2ef)]);if(_0x20663f[_0xf593a5(0x286)])return _0x5e8fc3=_0x20663f,_0x20663f;if(_0x20663f[_0xf593a5(0x326)]===_0xf593a5(0x250)+localStorage[_0xf593a5(0x2e1)](_0xf593a5(0x2b8))+_0xf593a5(0x1e8))throw localStorage['removeItem'](_0xf593a5(0x2b8)),new Error('Re\x20initializing\x20customer\x20Id');}catch(_0x473be4){throw _0x121dfc(0x2,'Error\x20posting\x20event\x20record:'),_0x121dfc(0x2,_0xf593a5(0x2ea)+_0x473be4[_0xf593a5(0x34e)]),_0x121dfc(0x2,'message:\x20'+_0x473be4[_0xf593a5(0x326)]),(_0x473be4[_0xf593a5(0x34e)]===_0xf593a5(0x28f)||_0x473be4['name']===_0xf593a5(0x2c6)&&_0x473be4[_0xf593a5(0x326)]==='Failed\x20to\x20fetch')&&(_0x121dfc(0x2,_0xf593a5(0x35b)),_0x141443&&_0x5c1008(this,_0x27be4a,_0x161ee9)[_0xf593a5(0x1d6)](this,_0x141443)),_0x1c8264=new Error(_0xf593a5(0x36d)),_0x473be4;}return null;}))['catch'](()=>{}),this['queue'][_0x5049f1(0x2a2)](()=>{if(_0x1c8264)throw _0x1c8264;return _0x5e8fc3;});});}};_0x470dc5=new WeakMap(),_0x27be4a=new WeakSet(),_0x12c374=function(){return _0x2e5987(this,null,function*(){});},_0x3bd4cb=function(_0x5051ea,_0x5ad3df){return _0x2e5987(this,null,function*(){const _0x3144d1=_0x1107;yield _0x5bf126(_0x3144d1(0x258),()=>_0x2e5987(this,null,function*(){const _0x1c1688=_0x3144d1;var _0x2e41da,_0x27a96a,_0x4d6eb5,_0x2a2cd0;let {campaignCustomerInstanceId:_0x21833c,campaignId:_0x158a87,eventName:_0x5db5b6,eventProperties:_0x34edbb,name:_0x118e97,web_optin_instance_id:_0x8269b3}=_0x5051ea;_0x121dfc(0x1,_0x1c1688(0x1d3)),_0x32acc3(_0x1c1688(0x21a),!0x0),_0x4ae018(_0x1c1688(0x27f),!0x0),_0x121dfc(0x1,_0x1c1688(0x2f0)),_0x121dfc(0x1,{'campaignCustomerInstanceId':_0x21833c,'eventName':_0x5db5b6,'eventProperties':_0x34edbb,'name':_0x118e97,'web_optin_instance_id':_0x8269b3});let _0x5a4ea5=_0xcb4930[_0x1c1688(0x2d5)]();if(_0x5a4ea5==='Crawlers'||_0x5a4ea5===_0x1c1688(0x1d0))throw new Error(_0x1c1688(0x22a));_0x5db5b6!==_0x1c1688(0x1c0)&&(yield _0xcb4930[_0x1c1688(0x214)]());let _0x5bd1c4=[];_0x34edbb&&_0x5bd1c4[_0x1c1688(0x351)](..._0x34edbb),_0x5bd1c4['push']({'eventProperty':'Platform','value':_0x5a4ea5}),_0x5bd1c4[_0x1c1688(0x351)]({'eventProperty':_0x1c1688(0x29f),'value':_0xcb4930[_0x1c1688(0x2ee)]()}),_0x5bd1c4[_0x1c1688(0x351)]({'eventProperty':_0x1c1688(0x308),'value':_0xcb4930[_0x1c1688(0x307)]()});let _0xcc2e08=this[_0x1c1688(0x314)](),_0x6262a8=_0x5c1008(this,_0x27be4a,_0x95d0be)[_0x1c1688(0x1d6)](this,_0xcc2e08,_0x5db5b6,_0x5bd1c4);if(typeof _0x6262a8==_0x1c1688(0x1cf)){_0x121dfc(0x2,_0x6262a8);return;}_0xcb4930['updateSessionCreated']();let {id:_0x577f70}=_0xcc2e08[_0x5db5b6],_0x246e0d=_0x5c1008(this,_0x27be4a,_0x2bdddb)['call'](this,_0x943ba1(_0x2d5aae(_0x943ba1(_0x943ba1(_0x943ba1({},_0x21833c?{'campaignCustomerInstanceId':_0x21833c}:{}),_0x158a87?{'campaignId':_0x158a87}:{}),_0x8269b3?{'web_optin_instance_id':_0x8269b3}:{}),{'eventId':_0x577f70,'eventProperties':_0x6262a8,'sessionId':localStorage['getItem']('session')||''}),_0x118e97?{'name':_0x118e97}:{}));if(_0x39865d[_0x1c1688(0x22b)]){let _0xab7139=JSON[_0x1c1688(0x21d)](localStorage[_0x1c1688(0x2e1)](_0x1c1688(0x27b))||'[]');_0xab7139['length']<=0x32&&(_0xab7139[_0x1c1688(0x351)](..._0x246e0d[_0x1c1688(0x1de)]),localStorage[_0x1c1688(0x362)](_0x1c1688(0x27b),JSON[_0x1c1688(0x359)](_0xab7139)));return;}let _0x187446=yield this[_0x1c1688(0x2f4)](_0x246e0d,_0x5051ea);(_0x2e41da=_0x187446==null?void 0x0:_0x187446[_0x1c1688(0x2e8)])!=null&&_0x2e41da['optIn']?(yield this[_0x1c1688(0x22f)]({'eventName':_0x1c1688(0x27d)}),_0x11cd43[_0x1c1688(0x272)](_0x187446[_0x1c1688(0x2e8)][_0x1c1688(0x2ab)])):_0x5db5b6===_0x1c1688(0x2be)&&(yield this[_0x1c1688(0x22f)]({'eventName':_0x1c1688(0x2d2),'eventProperties':[{'eventProperty':_0x1c1688(0x326),'value':''+('Notification'in window&&typeof((_0x27a96a=window==null?void 0x0:window[_0x1c1688(0x300)])==null?void 0x0:_0x27a96a[_0x1c1688(0x35f)])!='undefined')}]})),(_0x2a2cd0=(_0x4d6eb5=_0x187446==null?void 0x0:_0x187446['data'])==null?void 0x0:_0x4d6eb5[_0x1c1688(0x30a)])==null||_0x2a2cd0[_0x1c1688(0x1f3)](_0xd4e649=>{const _0x3d801a=_0x1c1688;_0x35d500['isPopupAction'](_0xd4e649[_0x3d801a(0x326)]['name'])?_0x35d500[_0x3d801a(0x2de)](_0xd4e649):_0x3b4835[_0x3d801a(0x2b6)](_0xd4e649[_0x3d801a(0x326)]['name'])&&_0x3b4835[_0x3d801a(0x1e6)](_0xd4e649);}),_0x4ae018(_0x1c1688(0x27f),!0x1),_0x32acc3(_0x1c1688(0x21a),!0x1);}),_0x15d58a=>{const _0x69f0ca=_0x3144d1;this['recordEvent']({'eventName':_0x69f0ca(0x2b0),'eventProperties':[{'eventProperty':_0x69f0ca(0x326),'value':_0x69f0ca(0x278)+_0x15d58a[_0x69f0ca(0x326)]}]},!0x0);},_0x5ad3df);});},_0x95d0be=function(_0x5bb40c,_0x683e8a,_0x3854a2){const _0x5aca35=_0x116db4;if(!Object['prototype'][_0x5aca35(0x2c7)][_0x5aca35(0x1d6)](_0x5bb40c,_0x683e8a))return _0x5aca35(0x28a)+_0x683e8a+_0x5aca35(0x354);if(!_0x3854a2)return[];let _0x64458=_0x5bb40c[_0x683e8a];if(!(_0x64458!=null&&_0x64458['eventProperty']))return'Event\x20'+_0x683e8a+_0x5aca35(0x23d);let _0x330787=_0x3854a2[_0x5aca35(0x328)](({eventProperty:_0xade278})=>!Object[_0x5aca35(0x2a8)][_0x5aca35(0x2c7)][_0x5aca35(0x1d6)](_0x64458[_0x5aca35(0x209)],_0xade278))[_0x5aca35(0x334)](({eventProperty:_0x1591c4})=>_0x1591c4);return _0x330787['length']>0x0?_0x5aca35(0x28a)+_0x683e8a+_0x5aca35(0x243)+_0x330787[_0x5aca35(0x20d)](',\x20')+'.':_0x3854a2[_0x5aca35(0x334)](({eventProperty:_0x4cc3c9,value:_0x220d31})=>({'eventPropertyId':_0x64458[_0x5aca35(0x209)][_0x4cc3c9]['id'],'value':_0x220d31}));},_0x2bdddb=function(_0x30d4f8){const _0x82e7e6=_0x116db4;return{'customerId':localStorage['getItem'](_0x82e7e6(0x2b8))||'','deviceId':localStorage['getItem']('uniqueIdentity')||'','events':[_0x30d4f8]};},_0x161ee9=function(_0x5058d0){const _0x2a4f37=_0x116db4;_0x121dfc(0x1,'Adding\x20to\x20pre-initialized\x20event:'),_0x121dfc(0x1,_0x5058d0);let _0x2a82c3=localStorage[_0x2a4f37(0x2e1)](_0x2a4f37(0x311));_0x2a82c3&&_0x2a82c3!==_0x2a4f37(0x2fd)?(_0x2a82c3=JSON[_0x2a4f37(0x21d)](_0x2a82c3),_0x2a82c3[_0x2a4f37(0x351)](_0x5058d0)):_0x2a82c3=[_0x5058d0],localStorage[_0x2a4f37(0x362)](_0x2a4f37(0x311),JSON['stringify'](_0x2a82c3));},_0x477870=function(_0x561927){const _0x3742be=_0x116db4;let _0xa780cf=JSON[_0x3742be(0x21d)](localStorage[_0x3742be(0x2e1)]('preInitializedEvents')||'[]'),_0x54b7af=_0xa780cf[_0x3742be(0x2b1)](_0x28c270=>_0x28c270[_0x3742be(0x305)]===_0x561927);_0x54b7af>=0x0&&_0xa780cf['splice'](_0x54b7af,0x1),localStorage[_0x3742be(0x362)](_0x3742be(0x311),JSON[_0x3742be(0x359)](_0xa780cf));},_0x43d489(_0x3dc9e6,_0x470dc5);var _0x5a2edf=_0x3dc9e6,_0x170f91=_0x5a2edf[_0x116db4(0x315)](),_0x4f5596,_0x39ece1,_0x23233a,_0x3013eb,_0x31408e,_0x23bb1f,_0x5ee308,_0x3af326,_0x294ecb,_0x44aae2,_0x18dae7,_0x106696,_0x2fa3b1=class _0x509511{constructor(){_0x43d489(this,_0x39ece1),_0x43d489(this,_0x5ee308,_0x2ff17f=>{const _0x129795=_0x1107;_0xcb4930['clearActionInLocalStorage']({'id':_0x2ff17f,'localStorageKey':_0x129795(0x223)});}),this['loadContentCardEventActionInLocalStorage']=()=>{const _0x2e2a1c=_0x1107;_0xcb4930['loadActionInLocalStorage']({'actionCondition':_0x5c364a=>_0x5c364a[_0x2e2a1c(0x326)][_0x2e2a1c(0x34e)]==='ContentCard','actionMethod':_0x1b0cb2=>_0x5c1008(this,_0x39ece1,_0x3013eb)[_0x2e2a1c(0x1d6)](this,_0x1b0cb2[_0x2e2a1c(0x23b)]),'localStorageKey':_0x2e2a1c(0x223)});},_0x43d489(this,_0x106696,()=>{const _0x3d112b=_0x1107;_0xcb4930[_0x3d112b(0x31c)](_0x3d112b(0x223));});}static[_0x116db4(0x315)](){const _0x214e8d=_0x116db4;var _0x4d061f;return _0x4dfbd3(_0x509511,_0x4f5596)||(_0x3022e6(_0x509511,_0x4f5596,new _0x509511()),_0x5c1008(_0x4d061f=_0x4dfbd3(_0x509511,_0x4f5596),_0x39ece1,_0x23233a)[_0x214e8d(0x1d6)](_0x4d061f)),_0x4dfbd3(_0x509511,_0x4f5596);}[_0x116db4(0x1e6)](_0xc5d3b2){const _0x34e1aa=_0x116db4;let _0x650c51=JSON[_0x34e1aa(0x21d)](localStorage[_0x34e1aa(0x2e1)]('action')||'{}');if(_0x650c51&&_0x650c51[_0xc5d3b2==null?void 0x0:_0xc5d3b2[_0x34e1aa(0x23b)]]){_0x121dfc(0x1,'ContentCard\x20already\x20in\x20cache');return;}_0x5c1008(this,_0x39ece1,_0x18dae7)[_0x34e1aa(0x1d6)](this,_0xc5d3b2),_0x4dfbd3(this,_0x106696)[_0x34e1aa(0x1d6)](this),_0x5c1008(this,_0x39ece1,_0x3013eb)[_0x34e1aa(0x1d6)](this,_0xc5d3b2[_0x34e1aa(0x23b)]);}[_0x116db4(0x2b6)](_0x4c404d){const _0x568022=_0x116db4;return _0x4c404d===_0x568022(0x2cf);}};_0x4f5596=new WeakMap(),_0x39ece1=new WeakSet(),_0x23233a=function(){return _0x2e5987(this,null,function*(){});},_0x3013eb=function(_0x4a1552){const _0x50a33b=_0x116db4;let _0x53bad3=_0x5c1008(this,_0x39ece1,_0x31408e)['call'](this);if(document[_0x50a33b(0x1fb)]('contentCard_container_'+_0x4a1552)){_0x121dfc(0x1,'ContentCard\x20already\x20displayed'),_0x4dfbd3(this,_0x5ee308)[_0x50a33b(0x1d6)](this,_0x4a1552);return;}if(_0x53bad3!=null&&_0x53bad3[_0x4a1552])switch(_0x53bad3[_0x4a1552]['campaignEntryTime']){case _0x50a33b(0x36e):{_0x5c1008(this,_0x39ece1,_0x23bb1f)[_0x50a33b(0x1d6)](this,_0x53bad3[_0x4a1552]);break;}case'IMMEDIATELY':{_0x5c1008(this,_0x39ece1,_0x3af326)[_0x50a33b(0x1d6)](this,_0x53bad3[_0x4a1552]);break;}case _0x50a33b(0x352):{_0x5c1008(this,_0x39ece1,_0x44aae2)['call'](this,_0x53bad3[_0x4a1552]);break;}default:return;}},_0x31408e=function(){const _0xcf4dfd=_0x116db4;let _0x408820=localStorage[_0xcf4dfd(0x2e1)](_0xcf4dfd(0x223));return _0x408820?JSON[_0xcf4dfd(0x21d)](_0x408820):null;},_0x23bb1f=function(_0x816428){const _0x48d96f=_0x116db4;_0xcb4930[_0x48d96f(0x312)]({'clearActionMethod':_0x4dfbd3(this,_0x5ee308)['bind'](this),'data':_0x816428,'displayMethod':_0x5c1008(this,_0x39ece1,_0x3af326)[_0x48d96f(0x32e)](this),'idKey':_0x48d96f(0x23b),'timeValueKey':_0x48d96f(0x2d0)});},_0x5ee308=new WeakMap(),_0x3af326=function(_0x60fb94){const _0x427cef=_0x116db4;var _0x429170;if(document[_0x427cef(0x1fb)](_0x427cef(0x217)+_0x60fb94['campaignId']))_0x121dfc(0x1,_0x427cef(0x36a));else{let _0x479fe3=_0x5c1008(this,_0x39ece1,_0x294ecb)[_0x427cef(0x1d6)](this,_0x427cef(0x280),_0x60fb94),_0x21343d=document[_0x427cef(0x2e2)]('#'+_0x60fb94[_0x427cef(0x326)][_0x427cef(0x2d1)]);_0x21343d&&(_0x21343d[_0x427cef(0x332)]=_0x479fe3[_0x427cef(0x2aa)],_0x170f91[_0x427cef(0x2ec)]({'campaignCustomerInstanceId':_0x60fb94[_0x427cef(0x231)],'campaignId':_0x60fb94[_0x427cef(0x23b)],'eventName':_0x46c781,'eventProperties':[{'eventProperty':_0x427cef(0x25a),'value':JSON['stringify']({'campaignId':_0x60fb94[_0x427cef(0x23b)]})}],'name':'view'}),(_0x429170=document[_0x427cef(0x1fb)](_0x427cef(0x217)+_0x60fb94['campaignId']))==null||_0x429170[_0x427cef(0x1cc)](_0x427cef(0x2bb),()=>{const _0xc65258=_0x427cef;_0x170f91[_0xc65258(0x2ec)]({'campaignCustomerInstanceId':_0x60fb94[_0xc65258(0x231)],'campaignId':_0x60fb94[_0xc65258(0x23b)],'eventName':_0x46c781,'eventProperties':[{'eventProperty':'Content\x20Card\x20Click','value':JSON[_0xc65258(0x359)]({'campaignId':_0x60fb94[_0xc65258(0x23b)]})}],'name':_0xc65258(0x2bb)});}));}_0x4dfbd3(this,_0x5ee308)['call'](this,_0x60fb94[_0x427cef(0x23b)]);},_0x294ecb=function(_0x3615fd,_0x520d57){const _0x4b6896=_0x116db4;var _0x4145b3;let {campaignId:_0x131b82,message:{design:_0x56036e}}=_0x520d57,_0x40e1d1=document['createElement'](_0x3615fd);return _0x40e1d1['id']='contentCard_container_'+_0x131b82,_0x40e1d1[_0x4b6896(0x332)]=_0x56036e,(_0x4145b3=_0x40e1d1[_0x4b6896(0x2e2)](_0x4b6896(0x2fc)))==null||_0x4145b3[_0x4b6896(0x336)](),_0x40e1d1;},_0x44aae2=function(_0x8f1588){const _0x3f6952=_0x116db4;_0xcb4930[_0x3f6952(0x1f9)]({'data':_0x8f1588,'displayMethod':_0x5c1008(this,_0x39ece1,_0x3af326)['bind'](this),'timeValueKey':_0x3f6952(0x2d0)});},_0x18dae7=function(_0x4853ee){const _0x109674=_0x116db4;_0xcb4930['storeActionInLocalStorage'](_0x4853ee,_0x109674(0x223),'campaignId');},_0x106696=new WeakMap(),_0x43d489(_0x2fa3b1,_0x4f5596);var _0x259f51=_0x2fa3b1,_0x3b4835=_0x259f51[_0x116db4(0x315)](),_0x724952,_0x51881a,_0x51a694,_0x53941d,_0x30aced,_0x3cdcbc,_0x425bd0,_0x41bdc0,_0x59cd79,_0x5a580a,_0x29de50,_0x371caa,_0x353874,_0x5b1348,_0x30c588,_0x2e9e6e,_0x1a307a,_0x1de83b,_0x58a0f7,_0x5862b1,_0x25d9da,_0x1509ed,_0x56c6e3,_0x5d9947,_0x32ae0b,_0x1c92ea,_0xb1bd0e,_0x441101,_0x80ffe7=class _0x4bd3c6{constructor(){const _0x2570be=_0x116db4;_0x43d489(this,_0x59cd79),_0x43d489(this,_0x51881a),_0x43d489(this,_0x51a694),_0x43d489(this,_0x53941d),_0x43d489(this,_0x30aced,null),_0x43d489(this,_0x3cdcbc,null),_0x43d489(this,_0x425bd0,!0x1),_0x43d489(this,_0x41bdc0,()=>{setInterval(()=>{const _0x30c6b6=_0x1107;let _0x312f97=localStorage[_0x30c6b6(0x2e1)]('mergn_shopify');if(_0x312f97!==_0x4dfbd3(this,_0x3cdcbc)){_0x3022e6(this,_0x3cdcbc,_0x312f97);let _0x242e40=JSON[_0x30c6b6(0x21d)](_0x312f97||'{}');if(_0x242e40!=null&&_0x242e40[_0x30c6b6(0x2b2)]){let _0xb61236=_0x242e40['pushMessageToSW'];delete _0x242e40[_0x30c6b6(0x2b2)],localStorage[_0x30c6b6(0x362)](_0x30c6b6(0x2d8),JSON[_0x30c6b6(0x359)](_0x242e40)),_0x11cd43['pushMessageToSW'](_0xb61236);}if(_0x242e40!=null&&_0x242e40[_0x30c6b6(0x2ab)]){let _0x4ea8e2=_0x242e40[_0x30c6b6(0x2ab)];delete _0x242e40['optIn'],localStorage[_0x30c6b6(0x362)](_0x30c6b6(0x2d8),JSON['stringify'](_0x242e40)),_0x11cd43[_0x30c6b6(0x272)](_0x4ea8e2);}if(_0x242e40!=null&&_0x242e40[_0x30c6b6(0x30a)]){let _0x20e7c1=_0x242e40[_0x30c6b6(0x30a)];delete _0x242e40['campaigns'],localStorage[_0x30c6b6(0x362)](_0x30c6b6(0x2d8),JSON[_0x30c6b6(0x359)](_0x242e40)),_0x20e7c1['forEach'](_0x15f023=>{const _0xf9ed2b=_0x30c6b6;_0x35d500[_0xf9ed2b(0x265)](_0x15f023[_0xf9ed2b(0x326)]['name'])?_0x35d500['showPopup'](_0x15f023):_0x3b4835['isContentCardAction'](_0x15f023[_0xf9ed2b(0x326)][_0xf9ed2b(0x34e)])&&_0x3b4835['showContentCard'](_0x15f023);});}}},0x3e8);}),this[_0x2570be(0x31c)]=_0x202417=>{const _0x11f2c0=_0x2570be;let _0x3f87ed=()=>{const _0xb682c5=_0x1107;let _0x260311=JSON[_0xb682c5(0x21d)](localStorage[_0xb682c5(0x2e1)](_0x202417)||'{}');Object[_0xb682c5(0x360)](_0x260311)['forEach'](_0x42bac9=>{const _0xb575cd=_0xb682c5;_0x260311[_0x42bac9][_0xb575cd(0x282)]=new Date()['getTime']();}),localStorage[_0xb682c5(0x362)](_0x202417,JSON[_0xb682c5(0x359)](_0x260311));};_0x3f87ed(),window[_0x11f2c0(0x1cc)](_0x11f2c0(0x303),_0x3f87ed);},this[_0x2570be(0x227)]=({id:_0x331900,localStorageKey:_0x1f45c5})=>{const _0x10cbc4=_0x2570be;let _0x4ba26b=JSON[_0x10cbc4(0x21d)](localStorage[_0x10cbc4(0x2e1)](_0x1f45c5)||'{}');_0x4ba26b[_0x331900]&&delete _0x4ba26b[_0x331900],localStorage[_0x10cbc4(0x362)](_0x1f45c5,JSON[_0x10cbc4(0x359)](_0x4ba26b));},this[_0x2570be(0x2eb)]=({actionCondition:_0x5776ac,actionMethod:_0x228a2e,localStorageKey:_0x50e369})=>{const _0x268b7f=_0x2570be;let _0x2efe71=JSON['parse'](localStorage[_0x268b7f(0x2e1)](_0x50e369)||'{}');Object[_0x268b7f(0x360)](_0x2efe71)[_0x268b7f(0x1f3)](_0x4367cd=>{_0x5776ac(_0x2efe71[_0x4367cd])&&_0x228a2e(_0x2efe71[_0x4367cd]);});};}static[_0x116db4(0x315)](){return _0x4dfbd3(_0x4bd3c6,_0x724952)||_0x3022e6(_0x4bd3c6,_0x724952,new _0x4bd3c6()),_0x4dfbd3(_0x4bd3c6,_0x724952);}['init'](_0x33a6e7,_0x53b22a){return _0x2e5987(this,null,function*(){const _0x2b6da1=_0x1107;_0x121dfc(0x1,'Initializing\x20base\x20service'),_0x53b22a!=null&&_0x53b22a['shopify']&&_0x3022e6(this,_0x425bd0,!0x0),_0x5c1008(this,_0x59cd79,_0x5a580a)[_0x2b6da1(0x1d6)](this,_0x33a6e7);let _0x3e1c1b=this['getPlatform']();if(_0x3e1c1b===_0x2b6da1(0x298)||_0x3e1c1b==='Unknown'){_0x121dfc(0x2,_0x2b6da1(0x30d));return;}if(yield _0x4b9836['syncRealWorldTime'](),_0x121dfc(0x1,_0x2b6da1(0x22c)),yield _0x5c1008(this,_0x59cd79,_0x32ae0b)[_0x2b6da1(0x1d6)](this),_0x53b22a!=null&&_0x53b22a[_0x2b6da1(0x322)]&&_0x4dfbd3(this,_0x41bdc0)[_0x2b6da1(0x1d6)](this),_0x53b22a!=null&&_0x53b22a[_0x2b6da1(0x2d3)])try{_0x39865d[_0x2b6da1(0x225)]=!0x0,yield this[_0x2b6da1(0x28c)](_0x53b22a['identity']);}finally{_0x39865d[_0x2b6da1(0x225)]=!0x1;}setInterval(()=>_0x2e5987(this,null,function*(){const _0x351bb6=_0x2b6da1;_0x121dfc(0x1,_0x351bb6(0x1e2)),yield _0x5c1008(this,_0x59cd79,_0x32ae0b)[_0x351bb6(0x1d6)](this);}),0x493e0);let _0x505e72=_0x5c1008(this,_0x59cd79,_0x353874)[_0x2b6da1(0x1d6)](this);if(yield this[_0x2b6da1(0x214)](),yield _0x170f91['recordEventsFromQueue'](),_0x170f91[_0x2b6da1(0x22f)]({'eventName':'base_init'}),_0x121dfc(0x1,_0x2b6da1(0x350)),yield _0x5bf126(_0x2b6da1(0x309),()=>_0x2e5987(this,null,function*(){const _0x5c7d4d=_0x2b6da1;yield _0x11cd43[_0x5c7d4d(0x228)](_0x505e72,_0x53b22a==null?void 0x0:_0x53b22a['swPath']);})),!(_0x53b22a!=null&&_0x53b22a[_0x2b6da1(0x322)])){yield _0x5c1008(this,_0x59cd79,_0x441101)[_0x2b6da1(0x1d6)](this);let _0x3dab59=history[_0x2b6da1(0x2c4)];history['pushState']=(..._0x9c241a)=>{const _0x3a7a1f=_0x2b6da1;_0x3dab59[_0x3a7a1f(0x24f)](history,_0x9c241a),_0x5c1008(this,_0x59cd79,_0xb1bd0e)['call'](this);};}_0x121dfc(0x1,'tracking\x20page\x20change\x20register');});}['setPlatform'](_0x97aae2){_0x3022e6(this,_0x51881a,_0x97aae2);}[_0x116db4(0x235)](_0x59c1d0){_0x3022e6(this,_0x51a694,_0x59c1d0);}[_0x116db4(0x1dd)](_0x198b40){_0x3022e6(this,_0x53941d,_0x198b40);}[_0x116db4(0x345)](_0x1ebea7){_0x3022e6(this,_0x30aced,_0x1ebea7);}[_0x116db4(0x2a0)](){return _0x4dfbd3(this,_0x30aced);}['getPlatform'](){return _0x4dfbd3(this,_0x51881a);}[_0x116db4(0x307)](){return _0x4dfbd3(this,_0x51a694);}[_0x116db4(0x2ee)](){return _0x4dfbd3(this,_0x53941d);}[_0x116db4(0x33d)](){const _0x842d86=_0x116db4;localStorage[_0x842d86(0x362)]('ttl',''+new Date()[_0x842d86(0x2a3)]());}['showAfterScrollAction']({data:_0xd81863,displayMethod:_0x2c3b5f,timeValueKey:_0x120a48}){const _0x2c118f=_0x116db4;let _0x5a66be=()=>{const _0x5dec5a=_0x1107;var _0x1b3363;let _0x104492=window['innerHeight'],_0x5b3c80=document[_0x5dec5a(0x275)][_0x5dec5a(0x2a1)];window['scrollY']/(_0x5b3c80-_0x104492)*0x64>(((_0x1b3363=_0xd81863[_0x120a48])==null?void 0x0:_0x1b3363[_0x5dec5a(0x36b)])||0x0)&&(window[_0x5dec5a(0x1be)]('scroll',_0x5a66be),_0x2c3b5f(_0xd81863));};window[_0x2c118f(0x1cc)](_0x2c118f(0x203),_0x5a66be);}[_0x116db4(0x312)]({clearActionMethod:_0x310b95,data:_0xc03ce4,displayMethod:_0x59c81b,idKey:_0x98492c,timeValueKey:_0x50a704}){const _0x443a03=_0x116db4;var _0x574264,_0x2cf574,_0x3d2a36;let _0x1d72f6=(_0x574264=_0xc03ce4[_0x50a704])==null?void 0x0:_0x574264[_0x443a03(0x36b)];((_0x2cf574=_0xc03ce4[_0x50a704])==null?void 0x0:_0x2cf574['duration'])===_0x443a03(0x2c8)&&(_0x1d72f6=_0x1d72f6*0x3c);let _0x4e31cb=_0xc03ce4[_0x443a03(0x282)]-0x1f4+(_0x1d72f6||0x0)*0x3e8-new Date()[_0x443a03(0x2a3)]();_0x121dfc(0x1,'Initial\x20time:\x20'+_0xc03ce4[_0x443a03(0x282)]),_0x121dfc(0x1,_0x443a03(0x1f2)+((_0x3d2a36=_0xc03ce4[_0x50a704])==null?void 0x0:_0x3d2a36[_0x443a03(0x36b)])),_0x121dfc(0x1,_0x443a03(0x1df)+new Date()[_0x443a03(0x2a3)]()),_0x121dfc(0x1,_0x443a03(0x31b)+_0x4e31cb),_0x4e31cb>0x0?setTimeout(()=>{_0x310b95(_0xc03ce4[_0x98492c]),_0x59c81b(_0xc03ce4);},_0x4e31cb):(_0x310b95(_0xc03ce4[_0x98492c]),_0x59c81b(_0xc03ce4));}['storeActionInLocalStorage'](_0x524c28,_0x4dda2f,_0x4afcc1){const _0x1eafc3=_0x116db4;var _0x176fff;let _0x2fa74e=JSON[_0x1eafc3(0x21d)](localStorage[_0x1eafc3(0x2e1)](_0x4dda2f)||'{}'),_0x3f927e=(_0x176fff=_0x4afcc1 in _0x524c28&&_0x524c28[_0x4afcc1])!=null?_0x176fff:'';_0x3f927e&&(_0x2fa74e[_0x3f927e]=_0x2d5aae(_0x943ba1({},_0x524c28),{'initialTime':new Date()[_0x1eafc3(0x2a3)]()}),localStorage[_0x1eafc3(0x362)](_0x4dda2f,JSON[_0x1eafc3(0x359)](_0x2fa74e)));}['checkTTL'](){return _0x2e5987(this,null,function*(){const _0x2ea210=_0x1107;if(_0x4dfbd3(this,_0x425bd0))return;_0x121dfc(0x1,_0x2ea210(0x33a)),_0x32acc3(_0x2ea210(0x33a),!0x0),_0x4ae018(_0x2ea210(0x302),!0x0);let _0x3332ef=localStorage['getItem'](_0x2ea210(0x355)),_0x2c90a0=!0x1;if(_0x3332ef){if(_0x2c90a0=_0x5c1008(this,_0x59cd79,_0x353874)[_0x2ea210(0x1d6)](this,_0x3332ef),_0x2c90a0){let _0x344db4=localStorage['getItem']('session'),_0x5eb585=localStorage[_0x2ea210(0x2e1)](_0x2ea210(0x355));_0x344db4&&_0x5eb585&&_0x170f91['recordEvent']({'eventName':_0x2ea210(0x1c0),'eventProperties':[{'eventProperty':'SESSION_ID','value':localStorage[_0x2ea210(0x2e1)](_0x2ea210(0x289))},{'eventProperty':_0x2ea210(0x26f),'value':new Date(parseInt(_0x5eb585,0xa))[_0x2ea210(0x2e0)]()}]}),this[_0x2ea210(0x2bc)](),localStorage[_0x2ea210(0x362)](_0x2ea210(0x355),''+new Date()[_0x2ea210(0x2a3)]());}}else localStorage[_0x2ea210(0x362)](_0x2ea210(0x355),''+new Date()['getTime']());(!_0x3332ef||_0x2c90a0||_0x5c1008(this,_0x59cd79,_0x58a0f7)['call'](this))&&(_0x5c1008(this,_0x59cd79,_0x1a307a)[_0x2ea210(0x1d6)](this)&&_0x5c1008(this,_0x59cd79,_0x5862b1)['call'](this),_0x5c1008(this,_0x59cd79,_0x2e9e6e)[_0x2ea210(0x1d6)](this)&&(yield this[_0x2ea210(0x28c)]()),(_0x5c1008(this,_0x59cd79,_0x353874)[_0x2ea210(0x1d6)](this)||_0x5c1008(this,_0x59cd79,_0x5b1348)['call'](this))&&(yield _0x5c1008(this,_0x59cd79,_0x56c6e3)[_0x2ea210(0x1d6)](this)),yield _0x5c1008(this,_0x59cd79,_0x25d9da)[_0x2ea210(0x1d6)](this),(_0x5c1008(this,_0x59cd79,_0x353874)[_0x2ea210(0x1d6)](this)||_0x5c1008(this,_0x59cd79,_0x30c588)[_0x2ea210(0x1d6)](this))&&(yield _0x5c1008(this,_0x59cd79,_0x5d9947)[_0x2ea210(0x1d6)](this))),_0x4ae018('Checking\x20TTL\x20Time',!0x1),_0x32acc3(_0x2ea210(0x33a),!0x1);});}[_0x116db4(0x2bc)](){const _0xe21292=_0x116db4;localStorage[_0xe21292(0x2dd)](_0xe21292(0x223)),localStorage['removeItem'](_0xe21292(0x1de)),localStorage[_0xe21292(0x2dd)](_0xe21292(0x1d1)),localStorage[_0xe21292(0x2dd)]('offlineEvents'),localStorage[_0xe21292(0x2dd)](_0xe21292(0x355)),localStorage[_0xe21292(0x2dd)](_0xe21292(0x289));}[_0x116db4(0x28c)](_0x43e30a){return _0x2e5987(this,null,function*(){const _0x236cde=_0x1107;let _0x53a56a={'deviceId':localStorage['getItem'](_0x236cde(0x26c))||crypto[_0x236cde(0x1d4)](),'os':this[_0x236cde(0x2d5)]()};if(_0x43e30a)_0x53a56a[_0x236cde(0x2d3)]=_0x43e30a;else{if(!_0x43e30a&&localStorage['getItem'](_0x236cde(0x2b8)))return;}try{let _0x3ac609=yield _0x5c1008(this,_0x59cd79,_0x1509ed)[_0x236cde(0x1d6)](this,_0x53a56a);if(_0x3ac609!==void 0x0){localStorage['setItem']('customer',_0x3ac609);try{_0x11cd43[_0x236cde(0x2b2)]({'customer':_0x3ac609});}catch(_0x289e7f){}}}catch(_0xc76379){throw new Error('Error\x20setting\x20identity');}});}};_0x724952=new WeakMap(),_0x51881a=new WeakMap(),_0x51a694=new WeakMap(),_0x53941d=new WeakMap(),_0x30aced=new WeakMap(),_0x3cdcbc=new WeakMap(),_0x425bd0=new WeakMap(),_0x41bdc0=new WeakMap(),_0x59cd79=new WeakSet(),_0x5a580a=function(_0x542262){const _0x4d9960=_0x116db4;_0x4b9836[_0x4d9960(0x1c2)](_0x542262),this[_0x4d9960(0x208)](_0x5c1008(this,_0x59cd79,_0x29de50)[_0x4d9960(0x1d6)](this)),this[_0x4d9960(0x235)](_0x5c1008(this,_0x59cd79,_0x371caa)[_0x4d9960(0x1d6)](this)),this['setOperatingSystem'](navigator[_0x4d9960(0x219)]);},_0x29de50=function(){const _0x3747ff=_0x116db4;var _0x33dab6;let _0x179e73=navigator[_0x3747ff(0x219)][_0x3747ff(0x1d2)]();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i[_0x3747ff(0x31a)](_0x179e73)?_0x3747ff(0x298):/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i[_0x3747ff(0x31a)](_0x179e73)?_0x3747ff(0x21f):/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i[_0x3747ff(0x31a)](_0x179e73)?(_0x3747ff(0x300)in window&&typeof((_0x33dab6=window==null?void 0x0:window[_0x3747ff(0x300)])==null?void 0x0:_0x33dab6[_0x3747ff(0x35f)])!='undefined',_0x3747ff(0x21f)):/windows|macintosh|linux|x11/i[_0x3747ff(0x31a)](_0x179e73)?_0x3747ff(0x1fd):_0x3747ff(0x1d0);},_0x371caa=function(){const _0x223cf4=_0x116db4;let _0x37c494=navigator[_0x223cf4(0x219)],_0x192c2f;return _0x37c494[_0x223cf4(0x2a7)]('Chrome')>-0x1?_0x192c2f='Google\x20Chrome':_0x37c494[_0x223cf4(0x2a7)](_0x223cf4(0x1d9))>-0x1?_0x192c2f=_0x223cf4(0x1d9):_0x37c494[_0x223cf4(0x2a7)](_0x223cf4(0x2ac))>-0x1?_0x192c2f=_0x223cf4(0x353):_0x37c494[_0x223cf4(0x2a7)](_0x223cf4(0x2e9))>-0x1?_0x192c2f=_0x223cf4(0x269):_0x37c494[_0x223cf4(0x2a7)](_0x223cf4(0x1f0))>-0x1?_0x192c2f=_0x223cf4(0x268):_0x192c2f=_0x223cf4(0x1d0),_0x192c2f;},_0x353874=function(_0x103e49){const _0x4526d8=_0x116db4;let _0x2c8183;return _0x103e49||(_0x2c8183=localStorage['getItem'](_0x4526d8(0x355))),_0x103e49||_0x2c8183?new Date()['getTime']()-parseInt(_0x103e49||_0x2c8183||'',0xa)>0x124f80:!0x0;},_0x5b1348=function(){const _0x21650d=_0x116db4;return!localStorage[_0x21650d(0x2e1)]('events');},_0x30c588=function(){const _0x5e6f20=_0x116db4;return!localStorage[_0x5e6f20(0x2e1)](_0x5e6f20(0x1d1));},_0x2e9e6e=function(){const _0x2e1ae0=_0x116db4;return!localStorage[_0x2e1ae0(0x2e1)](_0x2e1ae0(0x2b8));},_0x1a307a=function(){const _0x554faa=_0x116db4;return!localStorage['getItem'](_0x554faa(0x26c));},_0x1de83b=function(){const _0x179988=_0x116db4;return!localStorage[_0x179988(0x2e1)](_0x179988(0x289));},_0x58a0f7=function(){const _0x46505a=_0x116db4;return _0x5c1008(this,_0x59cd79,_0x5b1348)[_0x46505a(0x1d6)](this)||_0x5c1008(this,_0x59cd79,_0x30c588)[_0x46505a(0x1d6)](this)||_0x5c1008(this,_0x59cd79,_0x2e9e6e)[_0x46505a(0x1d6)](this)||_0x5c1008(this,_0x59cd79,_0x1a307a)['call'](this)||_0x5c1008(this,_0x59cd79,_0x1de83b)[_0x46505a(0x1d6)](this);},_0x5862b1=function(){const _0x5c7316=_0x116db4;let _0x4d3b42=localStorage['getItem']('uniqueIdentity');return _0x4d3b42||(_0x4d3b42=crypto[_0x5c7316(0x1d4)](),localStorage[_0x5c7316(0x362)]('uniqueIdentity',_0x4d3b42)),_0x4d3b42;},_0x25d9da=function(){return _0x2e5987(this,null,function*(){const _0x34c6e5=_0x1107;yield _0x5bf126(_0x34c6e5(0x31f),()=>_0x2e5987(this,null,function*(){const _0x3d6f87=_0x34c6e5;let _0x90e9bd=localStorage[_0x3d6f87(0x2e1)](_0x3d6f87(0x289));_0x90e9bd||(_0x90e9bd=crypto['randomUUID'](),localStorage['setItem']('session',_0x90e9bd),yield _0x170f91[_0x3d6f87(0x2ec)]({'eventName':_0x3d6f87(0x28d),'eventProperties':[{'eventProperty':_0x3d6f87(0x248),'value':localStorage[_0x3d6f87(0x2e1)](_0x3d6f87(0x289))},{'eventProperty':_0x3d6f87(0x26f),'value':new Date(parseInt(localStorage['getItem']('ttl')||'',0xa))['toISOString']()}]}));}),_0x1ef076=>{const _0x1d0311=_0x34c6e5;_0x170f91[_0x1d0311(0x2ec)]({'eventName':_0x1d0311(0x2b0),'eventProperties':[{'eventProperty':'message','value':'store\x20session\x20-\x20'+_0x1ef076[_0x1d0311(0x326)]}]},!0x0);});});},_0x1509ed=function(_0x3e306e){return _0x2e5987(this,null,function*(){const _0xe153c4=_0x1107;try{return(yield _0x4b9836[_0xe153c4(0x2f2)](''+_0x2424bd+_0x52d058,_0x3e306e))[_0xe153c4(0x2e8)];}catch(_0x1be53d){throw new Error(_0xe153c4(0x26a));}});},_0x56c6e3=function(){return _0x2e5987(this,null,function*(){const _0x42e558=_0x1107;yield _0x170f91[_0x42e558(0x1ed)]();});},_0x5d9947=function(){return _0x2e5987(this,null,function*(){const _0x3885a3=_0x1107;yield _0x91a112[_0x3885a3(0x211)]();});},_0x32ae0b=function(){return _0x2e5987(this,null,function*(){const _0x40b6f9=_0x1107;yield _0x5bf126(_0x40b6f9(0x1f8),()=>_0x2e5987(this,null,function*(){const _0x46efc7=_0x40b6f9;var _0x4e3c0a;try{let _0x15149d=parseInt(localStorage['getItem'](_0x46efc7(0x285))||'0',0xa)||0x0;if(!_0x15149d||_0x15149d&&new Date()[_0x46efc7(0x2a3)]()>_0x15149d){if(!((_0x4e3c0a=yield _0x4b9836['get'](_0x46efc7(0x2c3)))!=null&&_0x4e3c0a[_0x46efc7(0x286)]))throw new Error(_0x46efc7(0x246));localStorage['setItem'](_0x46efc7(0x285),(new Date()[_0x46efc7(0x2a3)]()+0x493e0)['toString']());}_0x39865d[_0x46efc7(0x356)]=!0x0;}catch(_0x196fc6){throw _0x39865d[_0x46efc7(0x215)]=!0x0,_0x196fc6[_0x46efc7(0x326)];}}));});},_0x1c92ea=function(){return _0x2e5987(this,null,function*(){const _0x23158a=_0x1107;var _0x40dda5;_0x121dfc(0x1,_0x23158a(0x2cc));let _0x5ca915=(_0x40dda5=window==null?void 0x0:window[_0x23158a(0x349)])==null?void 0x0:_0x40dda5[_0x23158a(0x1eb)];this[_0x23158a(0x345)](_0x5ca915),_0x170f91[_0x23158a(0x22f)]({'eventName':_0x23158a(0x222)});let _0x41e394=[];new URLSearchParams(new URL(window[_0x23158a(0x349)][_0x23158a(0x1eb)])['search'])['forEach']((_0x115ccc,_0x242f58)=>_0x2e5987(this,null,function*(){const _0x3379f1=_0x23158a;_0x3dce35[_0x3379f1(0x238)](_0x242f58)&&_0x41e394['push']({'eventProperty':_0x242f58,'value':_0x115ccc});})),yield _0x170f91[_0x23158a(0x2ec)]({'eventName':_0x23158a(0x2be),'eventProperties':[{'eventProperty':'URL','value':window[_0x23158a(0x349)]['pathname']},..._0x41e394]});});},_0xb1bd0e=function(){return _0x2e5987(this,null,function*(){const _0x5bdad5=_0x1107;var _0x26c6c5;_0x121dfc(0x1,_0x5bdad5(0x2cb));let _0x5b709c=(_0x26c6c5=window==null?void 0x0:window[_0x5bdad5(0x349)])==null?void 0x0:_0x26c6c5[_0x5bdad5(0x1eb)];(this[_0x5bdad5(0x2a0)]()===null||this[_0x5bdad5(0x2a0)]()===void 0x0||_0x5b709c!==this[_0x5bdad5(0x2a0)]())&&(yield _0x5c1008(this,_0x59cd79,_0x1c92ea)[_0x5bdad5(0x1d6)](this));});},_0x441101=function(){return _0x2e5987(this,null,function*(){const _0x395c88=_0x1107;var _0x3fa0c8,_0x5d4eab;let _0x5d8c97=(_0x3fa0c8=window==null?void 0x0:window[_0x395c88(0x349)])==null?void 0x0:_0x3fa0c8[_0x395c88(0x1eb)];_0x170f91[_0x395c88(0x22f)]({'eventName':_0x395c88(0x31d),'eventProperties':[{'eventProperty':_0x395c88(0x326),'value':(_0x5d8c97!==this[_0x395c88(0x2a0)]())+':'+_0x5d8c97+':'+this['getPreviousUrl']()}]});try{yield _0x5c1008(this,_0x59cd79,_0x1c92ea)['call'](this);}catch(_0x267dec){let _0x322fb3=_0x267dec&&_0x267dec[_0x395c88(0x326)]?(_0x5d4eab=_0x267dec==null?void 0x0:_0x267dec[_0x395c88(0x326)])==null?void 0x0:_0x5d4eab[_0x395c88(0x310)](0x0,0x64):'undefined';yield _0x170f91[_0x395c88(0x22f)]({'eventName':_0x395c88(0x297),'eventProperties':[{'eventProperty':'message','value':''+_0x322fb3}]});}});},_0x43d489(_0x80ffe7,_0x724952);var _0x285175=_0x80ffe7,_0xcb4930=_0x285175[_0x116db4(0x315)](),_0x2eae17,_0x139884,_0x1605e3,_0x38d27b,_0x5ef26b,_0x35f21b,_0x22bb76,_0x4d6cd9=class _0xa245e{constructor(){_0x43d489(this,_0x1605e3),_0x43d489(this,_0x139884,!0x1);}static[_0x116db4(0x315)](){const _0x1b5431=_0x116db4;var _0x53d194;return _0x4dfbd3(_0xa245e,_0x2eae17)||(_0x3022e6(_0xa245e,_0x2eae17,new _0xa245e()),_0x5c1008(_0x53d194=_0x4dfbd3(_0xa245e,_0x2eae17),_0x1605e3,_0x38d27b)[_0x1b5431(0x1d6)](_0x53d194)),_0x4dfbd3(_0xa245e,_0x2eae17);}[_0x116db4(0x2d9)](_0x624822,_0x470041,_0xe30ce0){return _0x2e5987(this,null,function*(){const _0x2b1362=_0x1107;yield _0x5bf126(_0x2b1362(0x29b),()=>_0x2e5987(this,null,function*(){const _0x3926f9=_0x2b1362;if(_0x121dfc(0x1,_0x3926f9(0x1d7)),_0x32acc3(_0x3926f9(0x1d7),!0x0),_0x4ae018(_0x3926f9(0x32d),!0x0),_0x121dfc(0x1,'Attribute\x20Payload:\x0a\x20'+{'attributeName':_0x624822,'attributeProperties':_0xe30ce0,'attributeValue':_0x470041}+')}'),!_0x470041||_0x470041===''){_0x121dfc(0x2,_0x3926f9(0x35c));return;}yield _0xcb4930[_0x3926f9(0x214)](),yield _0x5c1008(this,_0x1605e3,_0x35f21b)[_0x3926f9(0x1d6)](this);let _0x10928=JSON[_0x3926f9(0x21d)](localStorage[_0x3926f9(0x2e1)](_0x3926f9(0x1d1))||'{}'),_0x445175=_0xe30ce0?_0x5c1008(this,_0x1605e3,_0x5ef26b)[_0x3926f9(0x1d6)](this,_0x10928,_0x624822,_0xe30ce0):_0x5c1008(this,_0x1605e3,_0x5ef26b)[_0x3926f9(0x1d6)](this,_0x10928,_0x624822);if(typeof _0x445175==_0x3926f9(0x1cf)){_0x121dfc(0x2,_0x445175);return;}_0x10928[_0x624822][_0x3926f9(0x1d5)]&&(yield _0xcb4930[_0x3926f9(0x28c)](typeof _0x470041==_0x3926f9(0x1cf)?_0x470041:JSON[_0x3926f9(0x359)](_0x470041))),_0xcb4930['updateSessionCreated']();let {id:_0x31c4ff}=_0x10928[_0x624822],_0x15cb96={'attributeId':_0x31c4ff,'attributeProperties':_0x445175,'customerId':localStorage[_0x3926f9(0x2e1)]('customer')||'','value':_0x470041};yield _0x5c1008(this,_0x1605e3,_0x22bb76)[_0x3926f9(0x1d6)](this,_0x15cb96);let _0x4406c7=JSON['parse'](localStorage[_0x3926f9(0x2e1)](_0x3926f9(0x277))||'[]');_0x4406c7[_0x3926f9(0x2c5)](),localStorage[_0x3926f9(0x362)]('preInitializedAttributes',JSON[_0x3926f9(0x359)](_0x4406c7)),_0x4ae018(_0x3926f9(0x32d),!0x1),_0x32acc3(_0x3926f9(0x1d7),!0x1);}));});}[_0x116db4(0x211)](){return _0x2e5987(this,null,function*(){const _0x4fe885=_0x1107;if(!localStorage['getItem'](_0x4fe885(0x1d1))&&!_0x4dfbd3(this,_0x139884)){_0x3022e6(this,_0x139884,!0x0);try{let _0x11321e=(yield this[_0x4fe885(0x36c)]())[_0x4fe885(0x2e8)];_0x11321e&&localStorage[_0x4fe885(0x362)]('attributes',JSON[_0x4fe885(0x359)](_0x11321e));}catch(_0x143129){throw new Error(_0x4fe885(0x25f));}finally{_0x3022e6(this,_0x139884,!0x1);}}});}[_0x116db4(0x36c)](){return _0x2e5987(this,null,function*(){const _0x2c1efa=_0x1107;try{return yield _0x4b9836[_0x2c1efa(0x1f5)](''+_0x34ccc9);}catch(_0x3d905f){throw new Error(_0x2c1efa(0x323));}});}};_0x2eae17=new WeakMap(),_0x139884=new WeakMap(),_0x1605e3=new WeakSet(),_0x38d27b=function(){return _0x2e5987(this,null,function*(){});},_0x5ef26b=function(_0x12625a,_0x54fe54,_0x21a136){const _0x3993f8=_0x116db4;if(!Object[_0x3993f8(0x2a8)][_0x3993f8(0x2c7)]['call'](_0x12625a,_0x54fe54))return _0x3993f8(0x263)+_0x54fe54+_0x3993f8(0x354);if(!_0x21a136)return[];let _0x8eb9aa=_0x12625a[_0x54fe54];if(!(_0x8eb9aa!=null&&_0x8eb9aa[_0x3993f8(0x32b)]))return _0x3993f8(0x263)+_0x54fe54+'\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.';let _0x2aaa7c=_0x21a136[_0x3993f8(0x328)](({attributeProperty:_0x3aa71a})=>!Object[_0x3993f8(0x2a8)][_0x3993f8(0x2c7)][_0x3993f8(0x1d6)](_0x8eb9aa[_0x3993f8(0x32b)],_0x3aa71a))['map'](({attributeProperty:_0x1781b4})=>_0x1781b4);return _0x2aaa7c[_0x3993f8(0x357)]>0x0?_0x3993f8(0x263)+_0x54fe54+'\x20has\x20invalid\x20attributeProperties:\x20'+_0x2aaa7c['join'](',\x20')+'.':_0x21a136[_0x3993f8(0x334)](({attributeProperty:_0x2d7af2,value:_0x428e74})=>({'attributePropertyId':_0x8eb9aa[_0x3993f8(0x32b)][_0x2d7af2]['id'],'value':_0x428e74}));},_0x35f21b=function(){return _0x2e5987(this,null,function*(){const _0x561a95=_0x1107;localStorage[_0x561a95(0x2e1)](_0x561a95(0x1d1))||(yield this[_0x561a95(0x211)]());});},_0x22bb76=function(_0x40b69e){return _0x2e5987(this,null,function*(){const _0x5a2fa2=_0x1107;try{return yield _0x4b9836[_0x5a2fa2(0x2f2)](''+_0x34ccc9+_0x3d421f,_0x40b69e);}catch(_0x5184bc){throw new Error(_0x5a2fa2(0x341));}});},_0x43d489(_0x4d6cd9,_0x2eae17);var _0x45f0a2=_0x4d6cd9,_0x91a112=_0x45f0a2[_0x116db4(0x315)](),_0x3904b5,_0x49a828=class _0x4b30c7{constructor(){}static['getInstance'](){return _0x4dfbd3(_0x4b30c7,_0x3904b5)||_0x3022e6(_0x4b30c7,_0x3904b5,new _0x4b30c7()),_0x4dfbd3(_0x4b30c7,_0x3904b5);}[_0x116db4(0x228)](_0x4e1b79,_0x1a1b68){setTimeout(()=>{const _0x28cd29=_0x1107;_0x5bf126(_0x28cd29(0x228),()=>_0x2e5987(this,null,function*(){const _0x500cf7=_0x28cd29;_0x121dfc(0x1,_0x500cf7(0x2e4)),yield _0xcb4930['init'](_0x4e1b79,_0x1a1b68),_0x170f91[_0x500cf7(0x22f)]({'eventName':'mergn_init'}),_0x121dfc(0x1,_0x500cf7(0x2ce));let _0x878cbe=JSON['parse'](localStorage[_0x500cf7(0x2e1)](_0x500cf7(0x277))||'[]');Array[_0x500cf7(0x34d)](_0x878cbe)&&_0x878cbe[_0x500cf7(0x1f3)]((_0x1ec5e0,_0x2d48ff)=>_0x2e5987(this,null,function*(){const _0x305500=_0x500cf7;yield _0x91a112[_0x305500(0x2d9)](_0x1ec5e0[_0x305500(0x2d7)],_0x1ec5e0['attributeValue']),_0x878cbe[_0x305500(0x1fe)](_0x2d48ff,0x1),localStorage[_0x305500(0x362)]('preInitializedAttributes',JSON[_0x305500(0x359)](_0x878cbe));})),window[_0x500cf7(0x1cc)]('online',()=>_0x2e5987(this,null,function*(){const _0x3cc142=_0x500cf7;_0x39865d[_0x3cc142(0x22b)]=!0x1;let _0x486bfc=JSON['parse'](localStorage[_0x3cc142(0x2e1)]('offlineEvents')||'[]');Array[_0x3cc142(0x34d)](_0x486bfc)&&(yield _0x170f91[_0x3cc142(0x2f4)]({'customerId':localStorage[_0x3cc142(0x2e1)]('customer')||'','deviceId':localStorage[_0x3cc142(0x2e1)]('uniqueIdentity')||'','events':_0x486bfc}),localStorage[_0x3cc142(0x2dd)](_0x3cc142(0x27b))),_0xcb4930['checkTTL'](),_0xcb4930[_0x3cc142(0x33d)]();})),window['addEventListener'](_0x500cf7(0x22b),()=>{const _0x402802=_0x500cf7;_0x39865d[_0x402802(0x22b)]=!0x0;}),window[_0x500cf7(0x1cc)]('load',()=>{const _0x236b7f=_0x500cf7;_0x35d500['loadPopupEventActionInLocalStorage'](),_0x11cd43[_0x236b7f(0x20a)]();});}));});}[_0x116db4(0x1cd)](_0x431521,_0x576e41){const _0xa2b6bf=_0x116db4;if(!(_0x431521 in _0x44594b)){console[_0xa2b6bf(0x2fa)](_0xa2b6bf(0x2ff));return;}_0x39865d[_0xa2b6bf(0x279)]=_0x576e41||{},_0x39865d[_0xa2b6bf(0x288)]=_0x431521;try{_0x11cd43[_0xa2b6bf(0x2b2)]({'debugLevel':_0x431521});}catch(_0x53d9ac){}}[_0x116db4(0x2d9)](_0x5847e1,_0xc030f1){return _0x2e5987(this,null,function*(){return new Promise((_0x5aedb1,_0xdc2301)=>{setTimeout(()=>_0x2e5987(this,null,function*(){try{yield _0x5bf126('recordAttribute',()=>_0x2e5987(this,null,function*(){const _0x1e876f=_0x1107;let _0x4c57db;Array['isArray'](_0xc030f1)?_0x4c57db=JSON[_0x1e876f(0x359)](_0xc030f1):typeof _0xc030f1==_0x1e876f(0x34a)?_0x4c57db=''+_0xc030f1:_0x4c57db=_0xc030f1,_0x121dfc(0x1,_0x1e876f(0x1d7)),_0x121dfc(0x1,_0x1e876f(0x324)+_0x5847e1+',\x20Attribute\x20Value:\x20'+_0x4c57db);let _0x3bb780=JSON['parse'](localStorage[_0x1e876f(0x2e1)](_0x1e876f(0x277))||'[]');_0x3bb780[_0x1e876f(0x351)]({'attributeName':_0x5847e1,'attrValueStringified':_0x4c57db}),localStorage[_0x1e876f(0x362)](_0x1e876f(0x277),JSON['stringify'](_0x3bb780)),_0x39865d[_0x1e876f(0x356)]&&(yield _0x91a112[_0x1e876f(0x2d9)](_0x5847e1,_0x4c57db));})),_0x5aedb1();}catch(_0x5b2c48){_0xdc2301(_0x5b2c48);}}));});});}[_0x116db4(0x2db)](_0x1f124c){return _0x2e5987(this,null,function*(){return new Promise((_0x1ccf82,_0x2bbc5a)=>{setTimeout(()=>_0x2e5987(this,null,function*(){const _0x2d1f5b=_0x1107;try{yield _0x5bf126(_0x2d1f5b(0x2db),()=>_0x2e5987(this,null,function*(){const _0x5a3e84=_0x2d1f5b;_0x121dfc(0x1,_0x5a3e84(0x2ad)),_0x121dfc(0x1,_0x5a3e84(0x1e5)+_0x1f124c),_0x39865d['loading']=!0x0,yield _0xcb4930[_0x5a3e84(0x28c)](_0x1f124c);})),_0x1ccf82();}catch(_0xe0f1c4){_0x2bbc5a(_0xe0f1c4);}finally{_0x39865d[_0x2d1f5b(0x225)]=!0x1,yield _0x170f91['recordEventsFromQueue']();}}));});});}[_0x116db4(0x234)](){setTimeout(()=>{const _0x554b06=_0x1107;_0x5bf126(_0x554b06(0x234),()=>_0x2e5987(this,null,function*(){const _0x38fbf0=_0x554b06;_0x121dfc(0x1,_0x38fbf0(0x348)),_0xcb4930[_0x38fbf0(0x2bc)]();}));});}[_0x116db4(0x2ec)](_0x3c845e,_0x4b9588){return _0x2e5987(this,null,function*(){return new Promise((_0x5564f0,_0x56b9eb)=>{setTimeout(()=>_0x2e5987(this,null,function*(){try{yield _0x5bf126('record\x20event',()=>_0x2e5987(this,null,function*(){const _0x41ae7d=_0x1107;_0x121dfc(0x1,_0x41ae7d(0x21a)),_0x121dfc(0x1,_0x41ae7d(0x23e)+{'eventName':_0x3c845e,'eventProperties':_0x4b9588}),yield _0x170f91[_0x41ae7d(0x2ec)]({'eventName':_0x3c845e,'eventProperties':_0x4b9588});})),_0x5564f0();}catch(_0x3d56e5){_0x56b9eb(_0x3d56e5);}}));});});}[_0x116db4(0x204)](){return _0x4c4d05;}};_0x3904b5=new WeakMap(),_0x43d489(_0x49a828,_0x3904b5);var _0x5987b6=_0x49a828,_0x22e5b3=_0x5987b6[_0x116db4(0x315)]();typeof window!=_0x116db4(0x2fd)&&(window[_0x116db4(0x256)]=_0x22e5b3);var _0x4c5b5a=_0x22e5b3;})());
|
|
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;})();
|
package/dist/index.js
CHANGED
|
@@ -1 +1,76 @@
|
|
|
1
|
-
'use strict';const _0x4fbc4d=_0x1a99;(function(_0x1ed2e1,_0x5aae43){const _0x246add=_0x1a99,_0x163092=_0x1ed2e1();while(!![]){try{const _0x476dfa=parseInt(_0x246add(0x24a))/0x1*(parseInt(_0x246add(0x287))/0x2)+parseInt(_0x246add(0x275))/0x3*(-parseInt(_0x246add(0x173))/0x4)+parseInt(_0x246add(0x229))/0x5*(-parseInt(_0x246add(0x241))/0x6)+-parseInt(_0x246add(0x1c7))/0x7+parseInt(_0x246add(0x131))/0x8+-parseInt(_0x246add(0x227))/0x9*(-parseInt(_0x246add(0x104))/0xa)+-parseInt(_0x246add(0x1ba))/0xb*(parseInt(_0x246add(0x19c))/0xc);if(_0x476dfa===_0x5aae43)break;else _0x163092['push'](_0x163092['shift']());}catch(_0x9b09f6){_0x163092['push'](_0x163092['shift']());}}}(_0x527a,0xeac93));var Te=Object['defineProperty'],un=Object[_0x4fbc4d(0x25a)],pn=Object['getOwnPropertyDescriptor'],gn=Object['getOwnPropertyDescriptors'],mn=Object['getOwnPropertyNames'],pt=Object[_0x4fbc4d(0x10c)],mt=Object['prototype'][_0x4fbc4d(0x1f5)],En=Object[_0x4fbc4d(0x1e2)][_0x4fbc4d(0x2b6)],Et=_0x5e008d=>{throw TypeError(_0x5e008d);},gt=(_0x51c146,_0x25bf77,_0x447920)=>_0x25bf77 in _0x51c146?Te(_0x51c146,_0x25bf77,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x447920}):_0x51c146[_0x25bf77]=_0x447920,z=(_0x3e4e08,_0x4f2354)=>{const _0x20f293=_0x4fbc4d;for(var _0x4517ac in _0x4f2354||(_0x4f2354={}))mt[_0x20f293(0x22b)](_0x4f2354,_0x4517ac)&>(_0x3e4e08,_0x4517ac,_0x4f2354[_0x4517ac]);if(pt){for(var _0x4517ac of pt(_0x4f2354))En[_0x20f293(0x22b)](_0x4f2354,_0x4517ac)&>(_0x3e4e08,_0x4517ac,_0x4f2354[_0x4517ac]);}return _0x3e4e08;},Pe=(_0x1d879e,_0x5eaf69)=>un(_0x1d879e,gn(_0x5eaf69)),vn=(_0x50cae4,_0x3a7a7a)=>{for(var _0x5af786 in _0x3a7a7a)Te(_0x50cae4,_0x5af786,{'get':_0x3a7a7a[_0x5af786],'enumerable':!0x0});},In=(_0x5aa5ab,_0x7b6c3c,_0x129b8a,_0x54b0ca)=>{const _0x17b78b=_0x4fbc4d;if(_0x7b6c3c&&typeof _0x7b6c3c==_0x17b78b(0x1f8)||typeof _0x7b6c3c==_0x17b78b(0x122)){for(let _0x5ddfea of mn(_0x7b6c3c))!mt[_0x17b78b(0x22b)](_0x5aa5ab,_0x5ddfea)&&_0x5ddfea!==_0x129b8a&&Te(_0x5aa5ab,_0x5ddfea,{'get':()=>_0x7b6c3c[_0x5ddfea],'enumerable':!(_0x54b0ca=pn(_0x7b6c3c,_0x5ddfea))||_0x54b0ca['enumerable']});}return _0x5aa5ab;},Sn=_0x34e95e=>In(Te({},_0x4fbc4d(0x196),{'value':!0x0}),_0x34e95e),ke=(_0x4c0ece,_0x41efd5,_0xeb0817)=>_0x41efd5[_0x4fbc4d(0x2a4)](_0x4c0ece)||Et(_0x4fbc4d(0xfd)+_0xeb0817),d=(_0x428069,_0x112b20,_0x38fc33)=>(ke(_0x428069,_0x112b20,'read\x20from\x20private\x20field'),_0x38fc33?_0x38fc33[_0x4fbc4d(0x22b)](_0x428069):_0x112b20['get'](_0x428069)),m=(_0x25cf6e,_0x333da3,_0x30b868)=>_0x333da3[_0x4fbc4d(0x2a4)](_0x25cf6e)?Et(_0x4fbc4d(0x2c0)):_0x333da3 instanceof WeakSet?_0x333da3[_0x4fbc4d(0x143)](_0x25cf6e):_0x333da3[_0x4fbc4d(0x181)](_0x25cf6e,_0x30b868),I=(_0x15e68e,_0x16de84,_0x2d7159,_0x3f5f78)=>(ke(_0x15e68e,_0x16de84,'write\x20to\x20private\x20field'),_0x3f5f78?_0x3f5f78[_0x4fbc4d(0x22b)](_0x15e68e,_0x2d7159):_0x16de84[_0x4fbc4d(0x181)](_0x15e68e,_0x2d7159),_0x2d7159),r=(_0xc0a289,_0x36f715,_0x35f3f1)=>(ke(_0xc0a289,_0x36f715,_0x4fbc4d(0x106)),_0x35f3f1),c=(_0x24aa16,_0x31d638,_0x4256fc)=>new Promise((_0x7d14f4,_0xedb657)=>{const _0x1df392=_0x4fbc4d;var _0x32d897=_0x3852cf=>{const _0x3fbdb1=_0x1a99;try{_0x4b74b3(_0x4256fc[_0x3fbdb1(0x1dd)](_0x3852cf));}catch(_0x2286d6){_0xedb657(_0x2286d6);}},_0x3a13d0=_0x33cb23=>{try{_0x4b74b3(_0x4256fc['throw'](_0x33cb23));}catch(_0x33c698){_0xedb657(_0x33c698);}},_0x4b74b3=_0xa7860f=>_0xa7860f['done']?_0x7d14f4(_0xa7860f[_0x1df392(0x18c)]):Promise[_0x1df392(0x298)](_0xa7860f[_0x1df392(0x18c)])['then'](_0x32d897,_0x3a13d0);_0x4b74b3((_0x4256fc=_0x4256fc[_0x1df392(0x1e8)](_0x24aa16,_0x31d638))['next']());}),wn={};vn(wn,{'default':()=>yn}),module[_0x4fbc4d(0x1fb)]=Sn(wn);var vt=_0x4fbc4d(0x11e),pe=_0x4fbc4d(0x254),Be=_0x4fbc4d(0x248),It=_0x4fbc4d(0x2a3),Fe=_0x4fbc4d(0x28d),St='/record-event',ft='/customer',bt=_0x4fbc4d(0x249),ht='/set-identity',yt=_0x4fbc4d(0x23e),wt='/brand/get-time',ee,te,_e,P=class P{constructor(){m(this,te);}static[_0x4fbc4d(0x13f)](){return d(P,ee)||I(P,ee,new P()),d(P,ee);}[_0x4fbc4d(0x24c)](_0x372fe5){const _0x5bfb21=_0x4fbc4d;P[_0x5bfb21(0x296)]=_0x372fe5;let _0x57e85d=_0x372fe5,_0x38dc69=/m(\d+)rgn/,_0x14941b=_0x57e85d[_0x5bfb21(0x1e3)](_0x38dc69);_0x14941b&&(P[_0x5bfb21(0x1d2)]=_0x14941b[0x1]);}[_0x4fbc4d(0x1a1)](){return P['apiKey'];}[_0x4fbc4d(0x141)](){return P['brandId'];}[_0x4fbc4d(0x24b)](_0x34384c){return c(this,null,function*(){const _0xa1db41=_0x1a99;return(yield fetch(pe+_0x34384c,{'headers':{'Authorization':r(this,te,_e)[_0xa1db41(0x22b)](this,P['apiKey']),'Content-Type':_0xa1db41(0x222)}}))[_0xa1db41(0x297)]();});}[_0x4fbc4d(0x2b5)](_0x478a56,_0x1d153c,_0x7bdf97){return c(this,null,function*(){const _0x15a613=_0x1a99;return(yield fetch(pe+_0x478a56,{'body':JSON[_0x15a613(0x176)](_0x1d153c||{}),'headers':{'Authorization':r(this,te,_e)[_0x15a613(0x22b)](this,P[_0x15a613(0x296)]),'Content-Type':_0x15a613(0x222)},'method':'POST','signal':_0x7bdf97}))[_0x15a613(0x297)]();});}['put'](_0x166a9d,_0xcdbc50){return c(this,null,function*(){const _0x5ae50d=_0x1a99;return(yield fetch(pe+_0x166a9d,{'body':JSON[_0x5ae50d(0x176)](_0xcdbc50||{}),'headers':{'Authorization':r(this,te,_e)[_0x5ae50d(0x22b)](this,P[_0x5ae50d(0x296)]),'Content-Type':_0x5ae50d(0x222)},'method':_0x5ae50d(0x156)}))[_0x5ae50d(0x297)]();});}[_0x4fbc4d(0x14d)](){return c(this,null,function*(){const _0x4767e0=_0x1a99;try{let _0x3840df=(yield(yield fetch(pe+wt))[_0x4767e0(0x297)]())[_0x4767e0(0x116)];P[_0x4767e0(0x2b4)]=new Date(_0x3840df),P[_0x4767e0(0x2b1)]=new Date();}catch(_0x6e5452){o(0x2,_0x4767e0(0x17c));}});}['getCurrentUTCDate'](){const _0x4ea78c=_0x4fbc4d;if(!P['UTCDate']||!P[_0x4ea78c(0x2b1)])return o(0x2,_0x4ea78c(0x22a)),new Date();let _0x2f764e=new Date()[_0x4ea78c(0x16c)]()-P[_0x4ea78c(0x2b1)][_0x4ea78c(0x16c)]();return new Date(P[_0x4ea78c(0x2b4)][_0x4ea78c(0x16c)]()+_0x2f764e);}};ee=new WeakMap(),te=new WeakSet(),_e=function(_0x134865){return btoa(_0x134865+':'+new Date()['getTime']());},m(P,ee);var Me=P,A=Me[_0x4fbc4d(0x13f)](),g=class extends Error{constructor(_0x44be4b){const _0x92c22e=_0x4fbc4d;super(_0x44be4b),this['name']=_0x92c22e(0x1e1);}};function _0x527a(){const _0x593928=['INFO','groupEnd','UTM_MEDIUM','https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api','logout','Mergn\x20SDK\x20is\x20disabled!','getItem','then','base_init','defineProperties','init_condition','removeAttribute','postEventRecord','popup_container_','\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','filter','Re\x20initializing\x20customer\x20Id','check_permission','Mergn\x20is\x20loading!','banner_icon','Checking\x20TTL\x20Time','Notification\x20permission:\x20','left','[id^=\x22u_content_button_\x22]','map','Checking\x20TTL','\x20is\x20not\x20valid.','storeActionInLocalStorage','attributes','campaigns','setItem','URL','Accepted\x20Web\x20Push\x20Soft-ask','Recording\x20event','service_worker','\x20Time','3118857MeagXd','loadWebPushActionInLocalStorage','load','button-container','toLowerCase','Recording\x20attribute','100%','\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a','style','disableSDK','getVersion','Verifying\x20API\x20Key\x20after\x20timeout','\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20','Recording\x20event\x20Time','error','textContent','events','setPreviousUrl','4ivFMyD','Notification\x20already\x20in\x20cache','The\x20user\x20has\x20already\x20enabled\x20notifications.','\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','Failed\x20to\x20subscribe\x20the\x20user','pushManager','/event','addEventListener','Event\x20Payload:\x0a\x20','top','storeAttributeInLocalStorage','Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage','campaignId','className','fetchEventData','apiKey','json','resolve','record\x20event','Mergn\x20is\x20offline!','name:\x20','Time\x20difference:\x20','Tracking\x20page\x20change','Mobile','height','/mergn-sw.js','Service\x20Worker\x20ready','should_set_identity','/set-attribute','has','Failed\x20to\x20fetch','values','onLine','Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203','Form\x20Submit','mergn-row','Close\x20Click','campaignEntryTimeValue','action','clearLocalStorage','logo','\x0abackground-color:\x20','lastSyncTime','Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported','getOSVersion','UTCDate','post','propertyIsEnumerable','FBCLID','campaignCustomerInstanceId','button-2','block','banner_image','zIndex','Internet\x20Explorer','scroll','default','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','time','Initial\x20time:\x20','showPopup','swPath','Cannot\x20','Failed\x20to\x20check\x20notification\x20permission','keys','body','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','os-version','put','17042290maORPi','checkTTL','access\x20private\x20method','Popup\x20Action','scrollY','Firefox','\x0aUnexpected\x20error:\x20','Verifying\x20API\x20Key','getOwnPropertySymbols','attributeValue','button_1','Checking\x20for\x20existing\x20subscription','queue','getOperatingSystem','initialTime','Adding\x20to\x20pre-initialized\x20event:','Button\x20Click','uniqueIdentity','data','mergn-column-75','Initializing\x20Mergn\x20SDK','Safari','AbortError','attributeProperty','pre_vwp','Pushing\x20message\x20to\x20service\x20worker','1.0.118','Content\x20Card\x20Click','Attribute\x20value\x20is\x20required','Logging\x20in','function','GAD_SOURCE','div','loadActionInLocalStorage','overflow','length','recordDebugEventsToggle','pushToQueue','Attribute\x20','NONE','Error\x20fetching\x20attribute\x20data','divId','entry_time','DELAY','SESSION_ID','12304112KFqoOo','online','/v2','pushMessageToSW','Error\x20posting\x20identity\x20data','recordAttribute','User\x20closed\x20the\x20notification\x20permission\x20dialog.','getRegistrations','recordEventsFromQueue','cssText','findIndex','recordEvent','setProperty','toString','getInstance','User\x20denied\x20the\x20notification\x20permission.','getBrandId','bind','add','scrollHeight','Viewed\x20Web\x20Push\x20Soft-ask','Event\x20','Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20','session','#\x20recordAttribute','click','mergn_shopify','success','syncRealWorldTime','forEach','Mergn\x20not\x20initialized!','loadPopupEventActionInLocalStorage','Error\x20setting\x20identity','mergn_init','\x20has\x20invalid\x20attributeProperties:\x20','UTM_TERM','Popup\x20already\x20in\x20cache','PUT','isPopupAction','text','Popup','duration','init','catch','No\x20events\x20to\x20record','Image','Error\x20fetching\x20event\x20data','banner_design','Service\x20Worker\x20registered','loadContentCardEventActionInLocalStorage','showAfterScrollAction','notification_permission_error','permission','submit','Failed\x20to\x20request\x20notification\x20permission',';\x0acolor:\x20','SESSION_CREATED','view','eventName','getTime','appendChild','eventProperty','\x20not\x20exists','Unknown','serviceWorker','gad_source','4kCUSUS','img','hidden','stringify','notification_data','form','\x0aMergnError:\x20','Microsoft\x20Edge','SCROLL','Failed\x20to\x20sync\x20real-world\x20time','banner_color','src','mergn-overlay','utm_term','set','\x0awidth:\x2025%;\x0a',',\x20Attribute\x20Value:\x20','99999999','content_card','remove','toISOString','Popup\x20already\x20displayed','Recording\x20attribute\x20Time','display','Allowed\x20Web\x20Push\x20Subscription','value','TypeError','setIdentity','debugLevel','\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.','web_optin_instance_id','MSIE','showNotification','innerHTML','Request\x20aborted','__esModule','subscribed','\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a','/brand','GCLID','width','3876kxdjHR','push','Debug\x20Event','auto','storeActionInLocalStorageInternal','getAPIKey','storeEventsAndPropertiesInLocalStorage','min','alt','setOSVersion','campaignEntryTime','showDelayedAction','indexOf','shopify','verifyTTL','info','Blocked\x20Web\x20Push\x20Subscription','Content\x20Card\x20Action','loading','clearActionInLocalStorage','push_manager','isInitialized','close','innerHeight','attributeName','createElement','button_2','tracking\x20page\x20change\x20register','User\x20granted\x20the\x20notification\x20permission.','string','32483PpWWdR','notification_service_not_initialized','getPreviousUrl','isArray','color','getElementById','Content\x20Card\x20View','offlineEvents','ttl','contentCard_container_','centered-image','randomUUID','Error\x20posting\x20event\x20record','3898713TcXLwO','pathname','position','fixed','ContentCard\x20already\x20in\x20cache','location','mergn-column-25','isContentCardAction','getPlatform','entry_time_value','Viewed\x20Webpage','brandId','operating-system','Closed\x20Web\x20Push\x20Subscription','offline','store\x20session','Identity:\x20','Reachability\x20Push\x20Web',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','message:\x20','store\x20session\x20-\x20','Service\x20Worker\x20registration\x20is\x20available','next','login','customer','Already\x20Registered\x20To\x20Web\x20Push','MergnError','prototype','match','Notification\x20service\x20is\x20not\x20initialized','pop','banner_title','Performing\x20viewed\x20web\x20page\x20event','apply','type','preInitializedAttributes','IMMEDIATELY','Mergn\x20SDK\x20Initialized','querySelector','utm_campaign','web_push_action','number','fetchAttributeData','userAgent','querySelectorAll','two_step','hasOwnProperty','join','undefined','object','Invalid\x20platform','Web','exports','Notification','Initializing\x20Notification\x20Service','Customer\x20with\x20id\x20','backgroundColor','Existing\x20subscription\x20found','test','unsubscribe','parse','Edg','Attribute\x20Payload:\x0a\x20','Campaign\x20Id','pushState','Invalid\x20API\x20Key','denied','update','name','identity','granted','setPlatform','group','removeItem','[id^=\x22u_content_form_\x22]','outerHTML','button','button-1','ALL','recordEventPreInitialized','Crawlers','updateSessionCreated','Platform','Web\x20Session\x20Concluded','INFO:\x20','User\x20is\x20subscribed','.u-close-button','UTM_CAMPAIGN','splice','Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization','OriginateFrom:\x20','application/json','verify\x20API\x20key','requestPermission','ContentCard','#\x20Recording\x20event','9NgFJOi','\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a','5bDtAQE','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set','call','getStoredEvents','href','Checking\x20notification\x20permission:\x20','getSubscription','search','Chrome','\x20has\x20invalid\x20eventProperties:\x20','ERROR:\x20','utm_source','mergnWebPushPopup','UTM_SOURCE','message','Service\x20Worker\x20registration\x20failed:','.u-popup-container\x20img','Turned\x20Off\x20Notification','recordDebugEvents','Attribute\x20Name:\x20','setOperatingSystem','/brand/get-web-push-public-key','preInitializedEvents','gclid','9246714VyJSoR','already_registered','removeEventListener','showContentCard','PushManager','ERROR','.u-popup-container','/attribute','/device/add-device-token','905478tWBusB','get','updateAPIKey','Popup\x20View','optIn','Web\x20Session\x20Started','No\x20existing\x20subscription\x20found'];_0x527a=function(){return _0x593928;};return _0x527a();}g[_0x4fbc4d(0x27e)]=!0x1,g[_0x4fbc4d(0x1d5)]=!navigator[_0x4fbc4d(0x2a7)],g['debugLevel']=0x0,g['isInitialized']=!0x1,g[_0x4fbc4d(0x1ae)]=!0x1;var bn=(_0x3be1e6,_0x5aba98)=>{const _0x598731=_0x4fbc4d;_0x5aba98 instanceof g?o(0x2,_0x598731(0x221)+_0x3be1e6+_0x598731(0x179)+_0x5aba98['message']):_0x5aba98 instanceof Error?o(0x2,_0x598731(0x221)+_0x3be1e6+_0x598731(0x10a)+_0x5aba98[_0x598731(0x237)]):o(0x2,_0x598731(0x221)+_0x3be1e6+'\x0aUnexpected\x20error:\x20'+String(_0x5aba98));},N=(_0x104f83,_0x28d929,_0x23323c,_0xd84bc4=!0x1)=>c(void 0x0,null,function*(){const _0x307fb0=_0x4fbc4d;try{C(_0x104f83,!0x0),L(_0x104f83+_0x307fb0(0x274),!0x0);try{if(g['disableSDK'])throw new g(_0x307fb0(0x256));if(_0x104f83!==_0x307fb0(0x299)&&g['offline'])throw new g(_0x307fb0(0x29a));if(_0x104f83!==_0x307fb0(0x15b)&&_0x104f83!==_0x307fb0(0x223)&&_0x104f83!=='record\x20event'&&_0x104f83!==_0x307fb0(0x136)&&!g[_0x307fb0(0x1b1)])throw new g(_0x307fb0(0x14f));if(_0x104f83!==_0x307fb0(0x1de)&&g[_0x307fb0(0x1ae)])throw new g(_0x307fb0(0x263));return yield _0x28d929();}catch(_0x3f98ec){return _0x23323c?_0x23323c(_0x3f98ec):(g[_0x307fb0(0x18f)]===0x2||g[_0x307fb0(0x18f)]===0x3)&&bn(_0x104f83,_0x3f98ec),!_0xd84bc4&&A['getBrandId'](),null;}finally{L(_0x104f83+_0x307fb0(0x274),!0x1),C(_0x104f83,!0x1);}}catch(_0x42c7eb){return null;}}),U=(_0x42c113=>(_0x42c113[_0x42c113[_0x4fbc4d(0x12b)]=0x0]='NONE',_0x42c113[_0x42c113[_0x4fbc4d(0x251)]=0x1]='INFO',_0x42c113[_0x42c113[_0x4fbc4d(0x246)]=0x2]=_0x4fbc4d(0x246),_0x42c113[_0x42c113['ALL']=0x3]=_0x4fbc4d(0x215),_0x42c113[_0x42c113['DEBUG']=0x4]='DEBUG',_0x42c113))(U||{}),o=(_0x40874e,_0x235810)=>{const _0x40a63c=_0x4fbc4d;g[_0x40a63c(0x18f)]!==0x0&&(g['debugLevel']>=0x3?_0x40874e===0x1?console[_0x40a63c(0x1ab)]('INFO:\x20'+new Date()[_0x40a63c(0x187)](),_0x235810):_0x40874e===0x2&&console[_0x40a63c(0x283)](_0x40a63c(0x233)+new Date()['toISOString'](),_0x235810):g[_0x40a63c(0x18f)]===0x1&&_0x40874e===0x1?console[_0x40a63c(0x1ab)](_0x40a63c(0x21b)+new Date()[_0x40a63c(0x187)](),_0x235810):g['debugLevel']===0x2&&_0x40874e===0x2&&console[_0x40a63c(0x283)](_0x40a63c(0x233)+new Date()[_0x40a63c(0x187)](),_0x235810));},L=(_0x47c0a7,_0x174987)=>{const _0x24350d=_0x4fbc4d;g[_0x24350d(0x18f)]!==0x0&&(_0x174987?console[_0x24350d(0xf9)](_0x47c0a7):console['timeEnd'](_0x47c0a7));},C=(_0xcbe42c,_0x105c9b)=>{const _0xc540c2=_0x4fbc4d;g['debugLevel']!==0x0&&(_0x105c9b?console[_0xc540c2(0x20f)](_0xcbe42c):console[_0xc540c2(0x252)]());},Tt=(_0x1a7c97=>(_0x1a7c97[_0x4fbc4d(0x236)]=_0x4fbc4d(0x234),_0x1a7c97[_0x4fbc4d(0x253)]='utm_medium',_0x1a7c97[_0x4fbc4d(0x21e)]=_0x4fbc4d(0x1ee),_0x1a7c97[_0x4fbc4d(0x154)]=_0x4fbc4d(0x180),_0x1a7c97['UTM_CONTENT']='utm_content',_0x1a7c97[_0x4fbc4d(0x123)]=_0x4fbc4d(0x172),_0x1a7c97[_0x4fbc4d(0x19a)]=_0x4fbc4d(0x240),_0x1a7c97[_0x4fbc4d(0x2b7)]='fbclid',_0x1a7c97))(Tt||{}),Pt=new Set(Object[_0x4fbc4d(0x2a6)](Tt)),ne=_0x4fbc4d(0x107),Ve=_0x4fbc4d(0x1ad),ie,F,re,j,ge,me,S,Ke,At,Je,Ae,Nt,Oe,Ne,He,Rt,Re,Ee,Ot,f=class f{constructor(){const _0x41abe8=_0x4fbc4d;m(this,S),this[_0x41abe8(0x165)]=null,this[_0x41abe8(0x134)]=_0x3f1e01=>{const _0x2d8897=_0x41abe8;o(0x1,_0x2d8897(0x11d)),navigator[_0x2d8897(0x171)][_0x2d8897(0x138)]()[_0x2d8897(0x258)](_0x4a587f=>{const _0x2fe25e=_0x2d8897;var _0x18badf,_0x1af8ff;o(0x1,'Service\x20Worker\x20registration'),(_0x18badf=_0x4a587f[0x0])!=null&&_0x18badf['active']&&(o(0x1,_0x2fe25e(0x2a1)),(_0x1af8ff=_0x4a587f[0x0]['active'])==null||_0x1af8ff['postMessage'](JSON['stringify'](_0x3f1e01)));})['catch'](_0x3691e3=>{const _0x4aec92=_0x2d8897;o(0x2,_0x4aec92(0x147)+_0x3691e3[_0x4aec92(0x237)]);});},this[_0x41abe8(0x276)]=()=>{const _0x3b5d35=_0x41abe8;E['loadActionInLocalStorage']({'actionCondition':()=>!0x0,'actionMethod':_0x6a7fb6=>r(this,S,Ne)['call'](this,Number(_0x6a7fb6[_0x3b5d35(0x191)])),'localStorageKey':_0x3b5d35(0x1ef)});},m(this,Oe,()=>{E['storeActionInLocalStorageInternal']('web_push_action');}),m(this,Ee,_0x2f93e5=>{const _0x4c8459=_0x41abe8;E['clearActionInLocalStorage']({'id':_0x2f93e5,'localStorageKey':_0x4c8459(0x1ef)});});}static[_0x4fbc4d(0x13f)](){return d(f,ie)||I(f,ie,new f()),d(f,ie);}[_0x4fbc4d(0x15b)](_0x5b9e44,_0xd02940){return c(this,null,function*(){const _0x3d99f9=_0x1a99;var _0x1231e9;if(o(0x1,_0x3d99f9(0x1fd)),p['recordDebugEvents']({'eventName':_0x3d99f9(0x15b),'eventProperties':[{'eventProperty':_0x3d99f9(0x273),'value':_0x3d99f9(0x171)in navigator},{'eventProperty':_0x3d99f9(0x1b0),'value':_0x3d99f9(0x245)in window}]}),_0x3d99f9(0x171)in navigator&&'PushManager'in window){o(0x1,_0x3d99f9(0x2b2));try{p[_0x3d99f9(0x23b)]({'eventName':_0x3d99f9(0x25b)}),I(f,F,yield navigator[_0x3d99f9(0x171)]['register'](_0xd02940||_0x3d99f9(0x2a0))),o(0x1,_0x3d99f9(0x161)),o(0x1,_0x3d99f9(0x220)),this[_0x3d99f9(0x134)]({'customer':localStorage[_0x3d99f9(0x257)]('customer')||'','events':p[_0x3d99f9(0x22c)](),'API_KEY':A[_0x3d99f9(0x1a1)](),'device_id':localStorage['getItem'](_0x3d99f9(0x115))||'','operatingSystem':E['getOperatingSystem'](),'osVersion':E[_0x3d99f9(0x2b3)](),'Platform':E['getPlatform']()}),I(f,ge,!0x0);let _0x5ba8cf=r(this,S,He)[_0x3d99f9(0x22b)](this),_0x5d7a3d=Object[_0x3d99f9(0xff)](_0x5ba8cf||{});if(_0x5d7a3d['length']&&r(this,S,Ne)[_0x3d99f9(0x22b)](this,Number(_0x5d7a3d[0x0])),!_0x5b9e44)return;let _0x310d8b=yield(_0x1231e9=d(f,F))==null?void 0x0:_0x1231e9[_0x3d99f9(0x28c)][_0x3d99f9(0x22f)]();o(0x1,_0x3d99f9(0x10f)),d(f,F)&&(o(0x1,_0x3d99f9(0x1dc)),d(f,F)[_0x3d99f9(0x20a)]()),_0x310d8b?(o(0x1,_0x3d99f9(0x200)),p[_0x3d99f9(0x23b)]({'eventName':'existing_subscription'}),yield r(this,S,Ae)['call'](this),I(f,re,!0x0)):(o(0x1,_0x3d99f9(0x250)),yield r(this,S,Ke)['call'](this,d(f,me)||void 0x0));}catch(_0x54e7dd){let _0x55645c=_0x54e7dd&&_0x54e7dd['message']?_0x54e7dd[_0x3d99f9(0x237)]['substring'](0x0,0x64):_0x3d99f9(0x1f7);yield p[_0x3d99f9(0x23b)]({'eventName':_0x3d99f9(0x1d8),'eventProperties':[{'eventProperty':_0x3d99f9(0x237),'value':''+_0x55645c}]}),o(0x2,_0x3d99f9(0x238)),o(0x2,_0x55645c);}}});}[_0x4fbc4d(0x193)](_0x487385){const _0x2f18ad=_0x4fbc4d;if(!d(f,ge)){I(f,me,_0x487385),p['recordDebugEvents']({'eventName':_0x2f18ad(0x1bb)}),o(0x2,_0x2f18ad(0x1e4));return;}N('showNotification',()=>c(this,null,function*(){const _0x2d8f3c=_0x2f18ad;let _0x3c92bb=JSON[_0x2d8f3c(0x203)](localStorage[_0x2d8f3c(0x257)]('web_push_action')||'{}');if(_0x3c92bb&&_0x3c92bb[_0x487385[_0x2d8f3c(0x191)]]){o(0x1,_0x2d8f3c(0x288));return;}r(this,S,Nt)[_0x2d8f3c(0x22b)](this,_0x487385),d(this,Oe)[_0x2d8f3c(0x22b)](this),r(this,S,Ne)['call'](this,_0x487385[_0x2d8f3c(0x191)]);}));}};function _0x1a99(_0xf73904,_0x37adcf){const _0x527a90=_0x527a();return _0x1a99=function(_0x1a991d,_0x15ce00){_0x1a991d=_0x1a991d-0xf9;let _0x586779=_0x527a90[_0x1a991d];return _0x586779;},_0x1a99(_0xf73904,_0x37adcf);}ie=new WeakMap(),F=new WeakMap(),re=new WeakMap(),j=new WeakMap(),ge=new WeakMap(),me=new WeakMap(),S=new WeakSet(),Ke=function(_0x289377){return c(this,null,function*(){const _0x54cf1e=_0x1a99;o(0x1,_0x54cf1e(0x22e)+JSON[_0x54cf1e(0x176)](_0x289377)+'\x20'),p[_0x54cf1e(0x23b)]({'eventName':_0x54cf1e(0x262)});let _0x21af4c;try{_0x21af4c=Notification[_0x54cf1e(0x165)],_0x21af4c&&(o(0x1,_0x54cf1e(0x266)+_0x21af4c),_0x21af4c==='default'?(_0x289377||(this['permission']=_0x54cf1e(0x2bf),p[_0x54cf1e(0x23b)]({'eventName':'Turned\x20Off\x20Notification\x20Reset\x20Permission'})),_0x289377&&(p['recordDebugEvents']({'eventName':_0x54cf1e(0x177),'eventProperties':[{'eventProperty':_0x54cf1e(0x1e9),'value':''+(_0x289377==null?void 0x0:_0x289377[_0x54cf1e(0x1e9)])}]}),d(this,Ee)[_0x54cf1e(0x22b)](this,_0x289377[_0x54cf1e(0x191)]),_0x289377[_0x54cf1e(0x1e9)]===_0x54cf1e(0x1f4)?r(this,S,At)[_0x54cf1e(0x22b)](this,_0x289377):yield r(this,S,Je)[_0x54cf1e(0x22b)](this,_0x289377))):_0x21af4c==='denied'?(p[_0x54cf1e(0x23b)]({'eventName':_0x54cf1e(0x23a)}),o(0x1,'The\x20user\x20has\x20blocked\x20notifications.')):(p[_0x54cf1e(0x23b)]({'eventName':_0x54cf1e(0x242)}),o(0x1,_0x54cf1e(0x289)),d(f,re)||(yield r(this,S,Ae)[_0x54cf1e(0x22b)](this),yield p[_0x54cf1e(0x13c)]({'eventName':_0x54cf1e(0x1e0)}),_0x289377||I(f,re,!0x0))));}catch(_0x35a94d){o(0x2,_0x54cf1e(0xfe)),p['recordDebugEvents']({'eventName':_0x54cf1e(0x164)});}});},At=function(_0x305d59){const _0x255a53=_0x4fbc4d;try{let _0x42d129=document[_0x255a53(0x1b5)](_0x255a53(0x124)),_0x15d249;_0x305d59[_0x255a53(0x160)][_0x255a53(0x2bb)]&&(_0x15d249=document['createElement'](_0x255a53(0x174)),_0x15d249[_0x255a53(0x17e)]=_0x305d59[_0x255a53(0x160)]['banner_image'],_0x15d249[_0x255a53(0x1a4)]=_0x255a53(0x15e),_0x15d249['id']=_0x255a53(0x1c4));let _0x13e535=document[_0x255a53(0x1b5)]('div'),_0x29fded=document['createElement'](_0x255a53(0x124)),_0x461616=document[_0x255a53(0x1b5)](_0x255a53(0x124)),_0x69af54=document[_0x255a53(0x1b5)](_0x255a53(0x174)),_0x1fe622=document[_0x255a53(0x1b5)](_0x255a53(0x124)),_0x57c7d8=document['createElement'](_0x255a53(0x124)),_0x16fd5=document['createElement'](_0x255a53(0x124)),_0x5c3655=document[_0x255a53(0x1b5)](_0x255a53(0x124)),_0x37e9ed=document[_0x255a53(0x1b5)]('div'),_0x1bea21=document[_0x255a53(0x1b5)](_0x255a53(0x124)),_0x193a7b=document[_0x255a53(0x1b5)](_0x255a53(0x213)),_0x3e4b25=document[_0x255a53(0x1b5)](_0x255a53(0x213));_0x42d129['className']=_0x255a53(0x17f),_0x13e535[_0x255a53(0x294)]=_0x255a53(0x235),_0x29fded[_0x255a53(0x294)]=_0x5c3655[_0x255a53(0x294)]=_0x37e9ed[_0x255a53(0x294)]=_0x255a53(0x2aa),_0x461616['className']=_0x255a53(0x1cd),_0x1fe622[_0x255a53(0x294)]=_0x255a53(0x117),_0x1bea21[_0x255a53(0x294)]=_0x255a53(0x278),_0x57c7d8['id']='title',_0x16fd5['id']='subtitle',_0x193a7b['id']=_0x255a53(0x214),_0x3e4b25['id']=_0x255a53(0x2b9),_0x69af54['src']=_0x305d59['banner_design'][_0x255a53(0x264)],_0x69af54[_0x255a53(0x1a4)]=_0x255a53(0x15e),_0x69af54['id']=_0x255a53(0x2af),_0x57c7d8[_0x255a53(0x284)]=_0x305d59[_0x255a53(0x160)][_0x255a53(0x1e6)],_0x16fd5['textContent']=_0x305d59[_0x255a53(0x160)]['banner_text'],_0x193a7b[_0x255a53(0x284)]=_0x305d59[_0x255a53(0x160)]['button_1']['text'],_0x3e4b25[_0x255a53(0x284)]=_0x305d59[_0x255a53(0x160)][_0x255a53(0x1b6)][_0x255a53(0x158)],_0x461616[_0x255a53(0x16d)](_0x69af54),_0x1fe622[_0x255a53(0x16d)](_0x57c7d8),_0x1fe622[_0x255a53(0x16d)](_0x16fd5),_0x29fded[_0x255a53(0x16d)](_0x461616),_0x29fded[_0x255a53(0x16d)](_0x1fe622),_0x15d249&&(_0x5c3655[_0x255a53(0x16d)](_0x15d249),_0x15d249['style'][_0x255a53(0x13a)]=_0x255a53(0x25f)),_0x1bea21[_0x255a53(0x16d)](_0x193a7b),_0x1bea21['appendChild'](_0x3e4b25),_0x37e9ed[_0x255a53(0x16d)](_0x1bea21),_0x13e535[_0x255a53(0x16d)](_0x29fded),_0x13e535[_0x255a53(0x16d)](_0x5c3655),_0x13e535[_0x255a53(0x16d)](_0x37e9ed),_0x42d129[_0x255a53(0x16d)](_0x13e535),_0x42d129['style']['cssText']=_0x255a53(0x28a),_0x13e535[_0x255a53(0x27d)]['cssText']=_0x255a53(0x2b0)+_0x305d59[_0x255a53(0x160)][_0x255a53(0x17d)]+';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a',_0x29fded['style'][_0x255a53(0x13a)]=_0x5c3655[_0x255a53(0x27d)][_0x255a53(0x13a)]=_0x37e9ed['style']['cssText']=_0x255a53(0x198),_0x461616[_0x255a53(0x27d)][_0x255a53(0x13a)]=_0x255a53(0x182),_0x1fe622[_0x255a53(0x27d)][_0x255a53(0x13a)]=_0x255a53(0x228),_0x69af54['style'][_0x255a53(0x13a)]='\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a',_0x193a7b[_0x255a53(0x27d)]['cssText']='\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20'+_0x305d59[_0x255a53(0x160)]['button_1']['backgroundColor']+_0x255a53(0x168)+_0x305d59[_0x255a53(0x160)][_0x255a53(0x10e)]['color']+_0x255a53(0x1d9),_0x3e4b25[_0x255a53(0x27d)][_0x255a53(0x13a)]=_0x255a53(0x101)+_0x305d59[_0x255a53(0x160)][_0x255a53(0x1b6)][_0x255a53(0x1ff)]+_0x255a53(0x168)+_0x305d59['banner_design'][_0x255a53(0x1b6)][_0x255a53(0x1be)]+';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a',_0x1bea21[_0x255a53(0x27d)]['cssText']=_0x255a53(0x27c),_0x57c7d8[_0x255a53(0x27d)][_0x255a53(0x13a)]='\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20'+_0x305d59['banner_design']['text_color']+'\x0a',_0x16fd5['style'][_0x255a53(0x13a)]=_0x255a53(0x281)+_0x305d59[_0x255a53(0x160)]['text_color']+'\x0a',document[_0x255a53(0x100)][_0x255a53(0x16d)](_0x42d129),document[_0x255a53(0x100)][_0x255a53(0x27d)]['overflow']=_0x255a53(0x175),p[_0x255a53(0x13c)]({'eventName':_0x255a53(0x145),'name':'viewed','web_optin_instance_id':_0x305d59['web_optin_instance_id']}),_0x193a7b==null||_0x193a7b[_0x255a53(0x28e)](_0x255a53(0x14a),()=>c(this,null,function*(){const _0x45ffee=_0x255a53;_0x42d129[_0x45ffee(0x186)](),I(f,j,!0x1),document[_0x45ffee(0x100)][_0x45ffee(0x27d)][_0x45ffee(0x126)]=_0x45ffee(0x19f),yield p[_0x45ffee(0x13c)]({'eventName':'Denied\x20Web\x20Push\x20Soft-ask','web_optin_instance_id':_0x305d59[_0x45ffee(0x191)]}),o(0x1,_0x45ffee(0x140));})),_0x3e4b25==null||_0x3e4b25[_0x255a53(0x28e)](_0x255a53(0x14a),()=>c(this,null,function*(){const _0x5abe98=_0x255a53;_0x42d129[_0x5abe98(0x186)](),document[_0x5abe98(0x100)][_0x5abe98(0x27d)][_0x5abe98(0x126)]='auto',p[_0x5abe98(0x13c)]({'eventName':_0x5abe98(0x271),'web_optin_instance_id':_0x305d59[_0x5abe98(0x191)]}),yield r(this,S,Je)[_0x5abe98(0x22b)](this,_0x305d59);}));}catch(_0x4902d4){}},Je=function(_0x1f4341){return c(this,null,function*(){const _0x26a125=_0x1a99;try{p[_0x26a125(0x13c)]({'eventName':'Displayed\x20Web\x20Push\x20Subscription','name':'viewed','web_optin_instance_id':_0x1f4341[_0x26a125(0x191)]});let _0x126461=yield Notification[_0x26a125(0x224)]();_0x126461===_0x26a125(0x20d)?(o(0x1,_0x26a125(0x1b8)),yield r(this,S,Ae)['call'](this),yield p[_0x26a125(0x13c)]({'eventName':_0x26a125(0x18b),'name':_0x26a125(0x197),'web_optin_instance_id':_0x1f4341[_0x26a125(0x191)]})):_0x126461===_0x26a125(0x209)?(yield p[_0x26a125(0x13c)]({'eventName':_0x26a125(0x1ac)}),o(0x1,_0x26a125(0x140))):_0x126461===_0x26a125(0x2bf)&&(yield p[_0x26a125(0x13c)]({'eventName':_0x26a125(0x1d4)}),o(0x1,_0x26a125(0x137)));}catch(_0x3b1dcf){o(0x2,_0x26a125(0x167));}I(f,j,!0x1);});},Ae=function(){return c(this,null,function*(){const _0x33732c=_0x1a99;var _0xe49660,_0x221b4a;let _0x2a1ed8=yield A[_0x33732c(0x24b)](''+yt);if(_0x2a1ed8['success']){let _0x5bc69f=yield(_0xe49660=d(f,F))==null?void 0x0:_0xe49660['pushManager'][_0x33732c(0x22f)]();_0x5bc69f&&(yield _0x5bc69f[_0x33732c(0x202)]());let _0x4e25e2=yield(_0x221b4a=d(f,F))==null?void 0x0:_0x221b4a['pushManager']['subscribe']({'applicationServerKey':_0x2a1ed8[_0x33732c(0x116)]||'','userVisibleOnly':!0x0});yield A[_0x33732c(0x103)](''+bt,{'device_id':localStorage[_0x33732c(0x257)]('uniqueIdentity')||'','is_web_push_subscribed':!0x0,'web_push_subscription_page_url':window[_0x33732c(0x1cc)][_0x33732c(0x1c8)],'web_push_token':{'token':JSON[_0x33732c(0x203)](JSON[_0x33732c(0x176)](_0x4e25e2))}}),o(0x1,_0x33732c(0x21c));}else throw new Error(_0x33732c(0x28b));});},Nt=function(_0x11b575){const _0x173173=_0x4fbc4d;E[_0x173173(0x26c)](_0x11b575,_0x173173(0x1ef),_0x173173(0x191));},Oe=new WeakMap(),Ne=function(_0x328043){const _0xb0cafd=_0x4fbc4d;if(d(f,j))return;I(f,j,!0x0);let _0x1b486a=r(this,S,He)[_0xb0cafd(0x22b)](this);if(_0x1b486a!=null&&_0x1b486a[_0x328043])switch(_0x1b486a[_0x328043][_0xb0cafd(0x12e)]){case _0xb0cafd(0x12f):{r(this,S,Rt)['call'](this,_0x1b486a[_0x328043]);break;}case _0xb0cafd(0x1eb):{r(this,S,Re)[_0xb0cafd(0x22b)](this,_0x1b486a[_0x328043]);break;}case _0xb0cafd(0x17b):{r(this,S,Ot)[_0xb0cafd(0x22b)](this,_0x1b486a[_0x328043]);break;}default:return;}},He=function(){const _0x530c2a=_0x4fbc4d;let _0x533eb2=localStorage[_0x530c2a(0x257)](_0x530c2a(0x1ef));return _0x533eb2?JSON[_0x530c2a(0x203)](_0x533eb2):null;},Rt=function(_0x18a76f){const _0x3bc1f8=_0x4fbc4d;E[_0x3bc1f8(0x1a7)]({'clearActionMethod':d(this,Ee)['bind'](this),'data':_0x18a76f,'displayMethod':r(this,S,Re)[_0x3bc1f8(0x142)](this),'idKey':_0x3bc1f8(0x191),'timeValueKey':_0x3bc1f8(0x1d0)});},Re=function(_0x5b1a56){const _0xf1fb26=_0x4fbc4d;r(this,S,Ke)[_0xf1fb26(0x22b)](this,_0x5b1a56);},Ee=new WeakMap(),Ot=function(_0x25d5fc){const _0x326efb=_0x4fbc4d;E[_0x326efb(0x163)]({'data':_0x25d5fc,'displayMethod':r(this,S,Re)[_0x326efb(0x142)](this),'timeValueKey':_0x326efb(0x1d0)});},m(f,ie),m(f,F,null),m(f,re,!0x1),m(f,j,!0x1),m(f,ge,!0x1),m(f,me,null);var $e=f,x=$e[_0x4fbc4d(0x13f)](),G,w,Lt,je,Ct,Dt,se,Le,Ut,xt,Wt,Ce,V=class V{constructor(){const _0x522cbe=_0x4fbc4d;m(this,w),m(this,se,_0x24b2e1=>{const _0x37cd22=_0x1a99;E[_0x37cd22(0x1af)]({'id':_0x24b2e1,'localStorageKey':'action'});}),this[_0x522cbe(0x150)]=()=>{const _0x36e595=_0x522cbe;E['loadActionInLocalStorage']({'actionCondition':_0x208132=>_0x208132['message'][_0x36e595(0x20b)]===_0x36e595(0x159),'actionMethod':_0x258e7a=>r(this,w,je)[_0x36e595(0x22b)](this,_0x258e7a['campaignId']),'localStorageKey':'action'});},m(this,Ce,()=>{const _0x398966=_0x522cbe;E['storeActionInLocalStorageInternal'](_0x398966(0x2ad));});}static[_0x4fbc4d(0x13f)](){const _0x30f21f=_0x4fbc4d;var _0x3cdaa6;return d(V,G)||(I(V,G,new V()),r(_0x3cdaa6=d(V,G),w,Lt)[_0x30f21f(0x22b)](_0x3cdaa6)),d(V,G);}[_0x4fbc4d(0xfb)](_0x3b5360){const _0x150be8=_0x4fbc4d;let _0x49acf5=JSON[_0x150be8(0x203)](localStorage[_0x150be8(0x257)](_0x150be8(0x2ad))||'{}');if(_0x49acf5&&_0x49acf5[_0x3b5360==null?void 0x0:_0x3b5360['campaignId']]){o(0x1,_0x150be8(0x155));return;}r(this,w,Wt)[_0x150be8(0x22b)](this,_0x3b5360),d(this,Ce)[_0x150be8(0x22b)](this),r(this,w,je)[_0x150be8(0x22b)](this,_0x3b5360[_0x150be8(0x293)]);}[_0x4fbc4d(0x157)](_0x3ef6e3){return _0x3ef6e3==='Popup';}};G=new WeakMap(),w=new WeakSet(),Lt=function(){return c(this,null,function*(){});},je=function(_0x39eaa1){const _0x204a1c=_0x4fbc4d;let _0x452ca8=r(this,w,Ct)[_0x204a1c(0x22b)](this);if(document[_0x204a1c(0x1bf)](_0x204a1c(0x25e)+_0x39eaa1)){o(0x1,_0x204a1c(0x188)),d(this,se)['call'](this,_0x39eaa1);return;}if(_0x452ca8!=null&&_0x452ca8[_0x39eaa1])switch(_0x452ca8[_0x39eaa1][_0x204a1c(0x1a6)]){case'DELAY':{r(this,w,Dt)[_0x204a1c(0x22b)](this,_0x452ca8[_0x39eaa1]);break;}case'IMMEDIATELY':{r(this,w,Le)['call'](this,_0x452ca8[_0x39eaa1]);break;}case _0x204a1c(0x17b):{r(this,w,xt)[_0x204a1c(0x22b)](this,_0x452ca8[_0x39eaa1]);break;}default:return;}},Ct=function(){const _0x227191=_0x4fbc4d;let _0x1fd153=localStorage['getItem']('action');return _0x1fd153?JSON[_0x227191(0x203)](_0x1fd153):null;},Dt=function(_0x2ed6c9){const _0x364ed2=_0x4fbc4d;E[_0x364ed2(0x1a7)]({'clearActionMethod':d(this,se)[_0x364ed2(0x142)](this),'data':_0x2ed6c9,'displayMethod':r(this,w,Le)[_0x364ed2(0x142)](this),'idKey':_0x364ed2(0x293),'timeValueKey':_0x364ed2(0x2ac)});},se=new WeakMap(),Le=function(_0xd4fc44){const _0x5392fd=_0x4fbc4d;if(document[_0x5392fd(0x1bf)](_0x5392fd(0x25e)+_0xd4fc44[_0x5392fd(0x293)]))o(0x1,_0x5392fd(0x188));else{let _0x4e722a=r(this,w,Ut)['call'](this,'div',_0xd4fc44);document['body'][_0x5392fd(0x16d)](_0x4e722a),p[_0x5392fd(0x13c)]({'campaignCustomerInstanceId':_0xd4fc44['campaignCustomerInstanceId'],'campaignId':_0xd4fc44[_0x5392fd(0x293)],'eventName':ne,'eventProperties':[{'eventProperty':_0x5392fd(0x24d),'value':JSON[_0x5392fd(0x176)]({'campaignId':_0xd4fc44[_0x5392fd(0x293)]})}],'name':_0x5392fd(0x16a)});}d(this,se)[_0x5392fd(0x22b)](this,_0xd4fc44[_0x5392fd(0x293)]);},Ut=function(_0x4f04fd,_0x578a63){const _0x5af626=_0x4fbc4d;let {campaignCustomerInstanceId:_0xa6997a,campaignId:_0x1b0d1b,message:{design:_0x16e101}}=_0x578a63,_0x26f15b=document['createElement'](_0x4f04fd);_0x26f15b['id']='popup_container_'+_0x1b0d1b,_0x26f15b[_0x5af626(0x194)]=_0x16e101,_0x26f15b['style'][_0x5af626(0x1c9)]=_0x5af626(0x1ca),_0x26f15b[_0x5af626(0x27d)][_0x5af626(0x290)]='0',_0x26f15b[_0x5af626(0x27d)][_0x5af626(0x267)]='0',_0x26f15b[_0x5af626(0x27d)][_0x5af626(0x19b)]=_0x5af626(0x27b),_0x26f15b[_0x5af626(0x27d)][_0x5af626(0x29f)]=_0x5af626(0x27b),_0x26f15b[_0x5af626(0x27d)][_0x5af626(0x2bc)]=_0x5af626(0x184);let _0x4b15c4=_0x26f15b[_0x5af626(0x1ed)](_0x5af626(0x247));_0x4b15c4&&(_0x4b15c4[_0x5af626(0x27d)][_0x5af626(0x2bc)]='50');let _0x2006a9=_0x4b15c4[_0x5af626(0x1ed)]('.u-popup-overlay');_0x2006a9&&(o(0x1,'Popup\x20overlay\x20element\x20found'),_0x2006a9[_0x5af626(0x27d)][_0x5af626(0x13d)](_0x5af626(0x18a),_0x5af626(0x2ba),'important')),_0x26f15b[_0x5af626(0x1f3)](_0x5af626(0x211))['forEach'](_0x3e80ae=>{const _0x709458=_0x5af626;let _0x25093f=_0x3e80ae[_0x709458(0x1ed)](_0x709458(0x178));_0x25093f&&_0x25093f['addEventListener'](_0x709458(0x166),()=>c(this,null,function*(){const _0xb5e09e=_0x709458;_0x26f15b[_0xb5e09e(0x186)]();let _0x432fd5=new FormData(_0x25093f),_0x223d85={};for(let [_0x468fdf,_0xaf4dfd]of _0x432fd5['entries']())_0x223d85[_0x468fdf]=_0xaf4dfd;yield p[_0xb5e09e(0x13c)]({'campaignCustomerInstanceId':_0xa6997a,'campaignId':_0x1b0d1b,'eventName':ne,'eventProperties':[{'eventProperty':_0xb5e09e(0x2a9),'value':JSON[_0xb5e09e(0x176)]({'campaignId':_0x1b0d1b,'formId':_0x3e80ae['id'],'formValues':_0x223d85})},{'eventProperty':_0xb5e09e(0x206),'value':_0x1b0d1b[_0xb5e09e(0x13e)]()}],'name':_0xb5e09e(0x178)});}));});let _0x59d858=_0x26f15b[_0x5af626(0x1ed)]('.u-close-button');return(_0x59d858==null?void 0x0:_0x59d858['getAttribute'](_0x5af626(0x22d)))==='#'&&_0x59d858[_0x5af626(0x25c)]('href'),_0x59d858==null||_0x59d858[_0x5af626(0x28e)]('click',()=>c(this,null,function*(){const _0x13189a=_0x5af626;_0x26f15b[_0x13189a(0x186)](),yield p[_0x13189a(0x13c)]({'campaignCustomerInstanceId':_0xa6997a,'campaignId':_0x1b0d1b,'eventName':ne,'eventProperties':[{'eventProperty':_0x13189a(0x2ab),'value':JSON[_0x13189a(0x176)]({'campaignId':_0x1b0d1b})}],'name':_0x13189a(0x1b2)});})),_0x26f15b[_0x5af626(0x1f3)](_0x5af626(0x268))['forEach'](_0x4219cc=>{const _0x553097=_0x5af626;_0x4219cc['addEventListener'](_0x553097(0x14a),()=>c(this,null,function*(){const _0x589bb9=_0x553097;_0x26f15b['remove'](),yield p[_0x589bb9(0x13c)]({'campaignCustomerInstanceId':_0xa6997a,'campaignId':_0x1b0d1b,'eventName':ne,'eventProperties':[{'eventProperty':_0x589bb9(0x114),'value':JSON['stringify']({'buttonId':_0x4219cc['id'],'campaignId':_0x1b0d1b})}],'name':_0x589bb9(0x14a)});}));}),_0x26f15b[_0x5af626(0x1f3)](_0x5af626(0x239))[_0x5af626(0x14e)](_0xa118bc=>{const _0x5895df=_0x5af626;_0xa118bc[_0x5895df(0x28e)](_0x5895df(0x14a),()=>c(this,null,function*(){const _0x3d2487=_0x5895df;_0x26f15b[_0x3d2487(0x186)](),yield p[_0x3d2487(0x13c)]({'campaignCustomerInstanceId':_0xa6997a,'campaignId':_0x1b0d1b,'eventName':ne,'eventProperties':[{'eventProperty':'Image\x20Click','value':JSON['stringify']({'campaignId':_0x1b0d1b,'imageClassName':_0xa118bc[_0x3d2487(0x294)],'imageId':_0xa118bc['id']})}],'name':'click'});}));}),_0x26f15b;},xt=function(_0x14d57e){const _0x1de32f=_0x4fbc4d;E[_0x1de32f(0x163)]({'data':_0x14d57e,'displayMethod':r(this,w,Le)[_0x1de32f(0x142)](this),'timeValueKey':_0x1de32f(0x2ac)});},Wt=function(_0x21392d){const _0x35de80=_0x4fbc4d;E[_0x35de80(0x26c)](_0x21392d,_0x35de80(0x2ad),_0x35de80(0x293));},Ce=new WeakMap(),m(V,G);var ze=V,$=ze['getInstance'](),Y,R,kt,De,Bt,Ft,Mt,Vt,K=class K{constructor(){const _0x11a1c7=_0x4fbc4d;m(this,R),this['queue']=Promise[_0x11a1c7(0x298)]();}static[_0x4fbc4d(0x13f)](){var _0x25a3e5;return d(K,Y)||(I(K,Y,new K()),r(_0x25a3e5=d(K,Y),R,kt)['call'](_0x25a3e5)),d(K,Y);}['pushToQueue'](_0x57baa6){const _0x23c889=_0x4fbc4d;let _0x12acef=JSON[_0x23c889(0x203)](localStorage[_0x23c889(0x257)]('preInitializedEvents')||'[]');_0x12acef['push'](_0x57baa6),localStorage[_0x23c889(0x26f)](_0x23c889(0x23f),JSON[_0x23c889(0x176)](_0x12acef));}[_0x4fbc4d(0x139)](){return c(this,null,function*(){const _0x25ca5d=_0x1a99;let _0x18ace3=JSON['parse'](localStorage[_0x25ca5d(0x257)]('preInitializedEvents')||'[]');if(Array[_0x25ca5d(0x1bd)](_0x18ace3)){for(let _0x5b6a3d of _0x18ace3)yield this[_0x25ca5d(0x216)](_0x5b6a3d);}});}[_0x4fbc4d(0x13c)](_0x118ac3,_0x3b6c59){return c(this,null,function*(){const _0x41c784=_0x1a99;g[_0x41c784(0x1b1)]&&!g[_0x41c784(0x1ae)]?yield r(this,R,De)['call'](this,_0x118ac3,_0x3b6c59):this[_0x41c784(0x129)](_0x118ac3);});}[_0x4fbc4d(0x216)](_0x5bf08d){return c(this,null,function*(){const _0xc22860=_0x1a99;try{yield r(this,R,De)[_0xc22860(0x22b)](this,_0x5bf08d);}finally{r(this,R,Vt)['call'](this,_0x5bf08d[_0xc22860(0x16b)]);}});}['recordDebugEvents'](_0x5e002f){return c(this,null,function*(){const _0x198072=_0x1a99;g[_0x198072(0x18f)]===0x4&&(!g[_0x198072(0x128)]||g[_0x198072(0x128)][_0x5e002f[_0x198072(0x16b)]])&&(yield r(this,R,De)[_0x198072(0x22b)](this,_0x5e002f));});}['getStoredEvents'](){const _0x58a1e8=_0x4fbc4d;let _0x2d664d=localStorage[_0x58a1e8(0x257)](_0x58a1e8(0x285));return _0x2d664d?JSON[_0x58a1e8(0x203)](_0x2d664d):{};}[_0x4fbc4d(0x1a2)](){return c(this,null,function*(){const _0x1cc626=_0x1a99;if(!localStorage[_0x1cc626(0x257)](_0x1cc626(0x285))){let _0x36b9db=(yield this[_0x1cc626(0x295)]())[_0x1cc626(0x116)];if(_0x36b9db){localStorage[_0x1cc626(0x26f)](_0x1cc626(0x285),JSON[_0x1cc626(0x176)](_0x36b9db));try{x[_0x1cc626(0x134)]({'events':_0x36b9db});}catch(_0x1e2fae){}}}});}[_0x4fbc4d(0x295)](){return c(this,null,function*(){const _0x1bc5bb=_0x1a99;try{return yield A[_0x1bc5bb(0x24b)](''+Fe);}catch(_0x516ff0){throw new Error(_0x1bc5bb(0x15f));}});}[_0x4fbc4d(0x25d)](_0x4f46da,_0x4b715c){return c(this,null,function*(){const _0x439b96=_0x1a99;let _0x1de825=null,_0xd376e5=null,_0xff0b0c=new AbortController();return this[_0x439b96(0x110)]=this[_0x439b96(0x110)][_0x439b96(0x258)](()=>c(this,null,function*(){const _0x113b58=_0x439b96;try{if(_0x4f46da[_0x113b58(0x285)]['length']===0x0)throw new Error(_0x113b58(0x15d));let _0x22c342=yield A[_0x113b58(0x2b5)](_0x113b58(0x133)+Fe+St,_0x4f46da,_0xff0b0c['signal']);if(_0x22c342[_0x113b58(0x14c)])return _0xd376e5=_0x22c342,_0x22c342;if(_0x22c342[_0x113b58(0x237)]===_0x113b58(0x1fe)+localStorage[_0x113b58(0x257)](_0x113b58(0x1df))+_0x113b58(0x16f))throw localStorage['removeItem'](_0x113b58(0x1df)),new Error(_0x113b58(0x261));}catch(_0x582f67){throw o(0x2,'Error\x20posting\x20event\x20record:'),o(0x2,_0x113b58(0x29b)+_0x582f67[_0x113b58(0x20b)]),o(0x2,_0x113b58(0x1da)+_0x582f67['message']),(_0x582f67[_0x113b58(0x20b)]===_0x113b58(0x11a)||_0x582f67[_0x113b58(0x20b)]===_0x113b58(0x18d)&&_0x582f67['message']===_0x113b58(0x2a5))&&(o(0x2,_0x113b58(0x195)),_0x4b715c&&r(this,R,Mt)['call'](this,_0x4b715c)),_0x1de825=new Error(_0x113b58(0x1c6)),_0x582f67;}return null;}))[_0x439b96(0x15c)](()=>{}),this['queue'][_0x439b96(0x258)](()=>{if(_0x1de825)throw _0x1de825;return _0xd376e5;});});}};Y=new WeakMap(),R=new WeakSet(),kt=function(){return c(this,null,function*(){});},De=function(_0x861150,_0x3182e8){return c(this,null,function*(){yield N('#\x20record\x20event',()=>c(this,null,function*(){const _0x50ca73=_0x1a99;var _0x58ab63,_0x16ba2e,_0x2b8cdd,_0x26e07f;let {campaignCustomerInstanceId:_0x75ee71,campaignId:_0x9f515e,eventName:_0x1519ca,eventProperties:_0x3cdeec,name:_0x387d80,web_optin_instance_id:_0x8dcb3f}=_0x861150;o(0x1,_0x50ca73(0x226)),C(_0x50ca73(0x272),!0x0),L(_0x50ca73(0x282),!0x0),o(0x1,'Event\x20Payload'),o(0x1,{'campaignCustomerInstanceId':_0x75ee71,'eventName':_0x1519ca,'eventProperties':_0x3cdeec,'name':_0x387d80,'web_optin_instance_id':_0x8dcb3f});let _0x40bdae=E[_0x50ca73(0x1cf)]();if(_0x40bdae===_0x50ca73(0x217)||_0x40bdae===_0x50ca73(0x170))throw new Error(_0x50ca73(0x1f9));_0x1519ca!==_0x50ca73(0x21a)&&(yield E[_0x50ca73(0x105)]());let _0x55cfdc=[];_0x3cdeec&&_0x55cfdc['push'](..._0x3cdeec),_0x55cfdc[_0x50ca73(0x19d)]({'eventProperty':_0x50ca73(0x219),'value':_0x40bdae}),_0x55cfdc['push']({'eventProperty':_0x50ca73(0x1d3),'value':E[_0x50ca73(0x111)]()}),_0x55cfdc[_0x50ca73(0x19d)]({'eventProperty':_0x50ca73(0x102),'value':E[_0x50ca73(0x2b3)]()});let _0x200bff=this[_0x50ca73(0x22c)](),_0x7b1231=r(this,R,Bt)['call'](this,_0x200bff,_0x1519ca,_0x55cfdc);if(typeof _0x7b1231==_0x50ca73(0x1b9)){o(0x2,_0x7b1231);return;}E[_0x50ca73(0x218)]();let {id:_0x124673}=_0x200bff[_0x1519ca],_0x51a75b=r(this,R,Ft)[_0x50ca73(0x22b)](this,z(Pe(z(z(z({},_0x75ee71?{'campaignCustomerInstanceId':_0x75ee71}:{}),_0x9f515e?{'campaignId':_0x9f515e}:{}),_0x8dcb3f?{'web_optin_instance_id':_0x8dcb3f}:{}),{'eventId':_0x124673,'eventProperties':_0x7b1231,'sessionId':localStorage['getItem'](_0x50ca73(0x148))||''}),_0x387d80?{'name':_0x387d80}:{}));if(g[_0x50ca73(0x1d5)]){let _0x71b5e0=JSON[_0x50ca73(0x203)](localStorage[_0x50ca73(0x257)](_0x50ca73(0x1c1))||'[]');_0x71b5e0[_0x50ca73(0x127)]<=0x32&&(_0x71b5e0[_0x50ca73(0x19d)](..._0x51a75b[_0x50ca73(0x285)]),localStorage[_0x50ca73(0x26f)]('offlineEvents',JSON[_0x50ca73(0x176)](_0x71b5e0)));return;}let _0x29d596=yield this[_0x50ca73(0x25d)](_0x51a75b,_0x861150);(_0x58ab63=_0x29d596==null?void 0x0:_0x29d596[_0x50ca73(0x116)])!=null&&_0x58ab63[_0x50ca73(0x24e)]?(yield this['recordDebugEvents']({'eventName':'optin_data'}),x[_0x50ca73(0x193)](_0x29d596[_0x50ca73(0x116)][_0x50ca73(0x24e)])):_0x1519ca==='Viewed\x20Webpage'&&(yield this['recordDebugEvents']({'eventName':'no_optin','eventProperties':[{'eventProperty':'message','value':''+(_0x50ca73(0x1fc)in window&&typeof((_0x16ba2e=window==null?void 0x0:window[_0x50ca73(0x1fc)])==null?void 0x0:_0x16ba2e[_0x50ca73(0x165)])!=_0x50ca73(0x1f7))}]})),(_0x26e07f=(_0x2b8cdd=_0x29d596==null?void 0x0:_0x29d596['data'])==null?void 0x0:_0x2b8cdd[_0x50ca73(0x26e)])==null||_0x26e07f['forEach'](_0x98817e=>{const _0x1631e5=_0x50ca73;$[_0x1631e5(0x157)](_0x98817e[_0x1631e5(0x237)]['name'])?$[_0x1631e5(0xfb)](_0x98817e):ae[_0x1631e5(0x1ce)](_0x98817e[_0x1631e5(0x237)][_0x1631e5(0x20b)])&&ae[_0x1631e5(0x244)](_0x98817e);}),L(_0x50ca73(0x282),!0x1),C(_0x50ca73(0x272),!0x1);}),_0xd0ae64=>{const _0x29e352=_0x1a99;this[_0x29e352(0x13c)]({'eventName':_0x29e352(0x19e),'eventProperties':[{'eventProperty':_0x29e352(0x237),'value':'record\x20event\x20-\x20'+_0xd0ae64['message']}]},!0x0);},_0x3182e8);});},Bt=function(_0x532754,_0x54c6a6,_0x11beed){const _0x28e286=_0x4fbc4d;if(!Object[_0x28e286(0x1e2)][_0x28e286(0x1f5)]['call'](_0x532754,_0x54c6a6))return _0x28e286(0x146)+_0x54c6a6+_0x28e286(0x26b);if(!_0x11beed)return[];let _0x4bac23=_0x532754[_0x54c6a6];if(!(_0x4bac23!=null&&_0x4bac23[_0x28e286(0x16e)]))return _0x28e286(0x146)+_0x54c6a6+'\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.';let _0x5c2539=_0x11beed[_0x28e286(0x260)](({eventProperty:_0x278265})=>!Object['prototype'][_0x28e286(0x1f5)][_0x28e286(0x22b)](_0x4bac23[_0x28e286(0x16e)],_0x278265))[_0x28e286(0x269)](({eventProperty:_0x3f889c})=>_0x3f889c);return _0x5c2539[_0x28e286(0x127)]>0x0?_0x28e286(0x146)+_0x54c6a6+_0x28e286(0x232)+_0x5c2539[_0x28e286(0x1f6)](',\x20')+'.':_0x11beed[_0x28e286(0x269)](({eventProperty:_0x4219d4,value:_0x548de7})=>({'eventPropertyId':_0x4bac23[_0x28e286(0x16e)][_0x4219d4]['id'],'value':_0x548de7}));},Ft=function(_0x9e87b1){const _0x1e1cf2=_0x4fbc4d;return{'customerId':localStorage['getItem'](_0x1e1cf2(0x1df))||'','deviceId':localStorage[_0x1e1cf2(0x257)]('uniqueIdentity')||'','events':[_0x9e87b1]};},Mt=function(_0x5c51f3){const _0x34a8b2=_0x4fbc4d;o(0x1,_0x34a8b2(0x113)),o(0x1,_0x5c51f3);let _0x29642b=localStorage[_0x34a8b2(0x257)](_0x34a8b2(0x23f));_0x29642b&&_0x29642b!==_0x34a8b2(0x1f7)?(_0x29642b=JSON[_0x34a8b2(0x203)](_0x29642b),_0x29642b['push'](_0x5c51f3)):_0x29642b=[_0x5c51f3],localStorage[_0x34a8b2(0x26f)](_0x34a8b2(0x23f),JSON[_0x34a8b2(0x176)](_0x29642b));},Vt=function(_0x4deec6){const _0x1de275=_0x4fbc4d;let _0x5dc784=JSON[_0x1de275(0x203)](localStorage['getItem'](_0x1de275(0x23f))||'[]'),_0xfccf4e=_0x5dc784[_0x1de275(0x13b)](_0x52a923=>_0x52a923[_0x1de275(0x16b)]===_0x4deec6);_0xfccf4e>=0x0&&_0x5dc784['splice'](_0xfccf4e,0x1),localStorage[_0x1de275(0x26f)](_0x1de275(0x23f),JSON[_0x1de275(0x176)](_0x5dc784));},m(K,Y);var Ge=K,p=Ge[_0x4fbc4d(0x13f)](),q,T,$t,qe,Kt,Jt,ce,Ue,Ht,zt,jt,xe,J=class J{constructor(){const _0x32fbd=_0x4fbc4d;m(this,T),m(this,ce,_0x21a868=>{const _0xb07df2=_0x1a99;E[_0xb07df2(0x1af)]({'id':_0x21a868,'localStorageKey':_0xb07df2(0x2ad)});}),this[_0x32fbd(0x162)]=()=>{const _0x28f44e=_0x32fbd;E[_0x28f44e(0x125)]({'actionCondition':_0x1268d4=>_0x1268d4[_0x28f44e(0x237)]['name']===_0x28f44e(0x225),'actionMethod':_0x228343=>r(this,T,qe)['call'](this,_0x228343[_0x28f44e(0x293)]),'localStorageKey':'action'});},m(this,xe,()=>{const _0x44ceb0=_0x32fbd;E[_0x44ceb0(0x1a0)](_0x44ceb0(0x2ad));});}static[_0x4fbc4d(0x13f)](){const _0x285d79=_0x4fbc4d;var _0x594b99;return d(J,q)||(I(J,q,new J()),r(_0x594b99=d(J,q),T,$t)[_0x285d79(0x22b)](_0x594b99)),d(J,q);}[_0x4fbc4d(0x244)](_0x2a7e18){const _0x11bb2d=_0x4fbc4d;let _0x292a5f=JSON[_0x11bb2d(0x203)](localStorage[_0x11bb2d(0x257)](_0x11bb2d(0x2ad))||'{}');if(_0x292a5f&&_0x292a5f[_0x2a7e18==null?void 0x0:_0x2a7e18[_0x11bb2d(0x293)]]){o(0x1,_0x11bb2d(0x1cb));return;}r(this,T,jt)[_0x11bb2d(0x22b)](this,_0x2a7e18),d(this,xe)['call'](this),r(this,T,qe)[_0x11bb2d(0x22b)](this,_0x2a7e18[_0x11bb2d(0x293)]);}[_0x4fbc4d(0x1ce)](_0x4ca689){const _0x1ea63a=_0x4fbc4d;return _0x4ca689===_0x1ea63a(0x185);}};q=new WeakMap(),T=new WeakSet(),$t=function(){return c(this,null,function*(){});},qe=function(_0x3cae7a){const _0x63baa7=_0x4fbc4d;let _0x2c0967=r(this,T,Kt)[_0x63baa7(0x22b)](this);if(document[_0x63baa7(0x1bf)]('contentCard_container_'+_0x3cae7a)){o(0x1,'ContentCard\x20already\x20displayed'),d(this,ce)[_0x63baa7(0x22b)](this,_0x3cae7a);return;}if(_0x2c0967!=null&&_0x2c0967[_0x3cae7a])switch(_0x2c0967[_0x3cae7a][_0x63baa7(0x1a6)]){case _0x63baa7(0x12f):{r(this,T,Jt)['call'](this,_0x2c0967[_0x3cae7a]);break;}case'IMMEDIATELY':{r(this,T,Ue)[_0x63baa7(0x22b)](this,_0x2c0967[_0x3cae7a]);break;}case _0x63baa7(0x17b):{r(this,T,zt)[_0x63baa7(0x22b)](this,_0x2c0967[_0x3cae7a]);break;}default:return;}},Kt=function(){const _0x5b0d7e=_0x4fbc4d;let _0x117cc9=localStorage[_0x5b0d7e(0x257)]('action');return _0x117cc9?JSON['parse'](_0x117cc9):null;},Jt=function(_0x2b6259){const _0x1bf27d=_0x4fbc4d;E[_0x1bf27d(0x1a7)]({'clearActionMethod':d(this,ce)[_0x1bf27d(0x142)](this),'data':_0x2b6259,'displayMethod':r(this,T,Ue)['bind'](this),'idKey':_0x1bf27d(0x293),'timeValueKey':_0x1bf27d(0x2ac)});},ce=new WeakMap(),Ue=function(_0x52d129){const _0x1192a7=_0x4fbc4d;var _0x294e92;if(document['getElementById'](_0x1192a7(0x1c3)+_0x52d129[_0x1192a7(0x293)]))o(0x1,'ContentCard\x20already\x20displayed');else{let _0x69146b=r(this,T,Ht)[_0x1192a7(0x22b)](this,_0x1192a7(0x124),_0x52d129),_0x2e1907=document['querySelector']('#'+_0x52d129[_0x1192a7(0x237)][_0x1192a7(0x12d)]);_0x2e1907&&(_0x2e1907[_0x1192a7(0x194)]=_0x69146b[_0x1192a7(0x212)],p[_0x1192a7(0x13c)]({'campaignCustomerInstanceId':_0x52d129['campaignCustomerInstanceId'],'campaignId':_0x52d129[_0x1192a7(0x293)],'eventName':Ve,'eventProperties':[{'eventProperty':_0x1192a7(0x1c0),'value':JSON[_0x1192a7(0x176)]({'campaignId':_0x52d129['campaignId']})}],'name':_0x1192a7(0x16a)}),(_0x294e92=document[_0x1192a7(0x1bf)](_0x1192a7(0x1c3)+_0x52d129[_0x1192a7(0x293)]))==null||_0x294e92['addEventListener'](_0x1192a7(0x14a),()=>{const _0x5a886b=_0x1192a7;p[_0x5a886b(0x13c)]({'campaignCustomerInstanceId':_0x52d129[_0x5a886b(0x2b8)],'campaignId':_0x52d129[_0x5a886b(0x293)],'eventName':Ve,'eventProperties':[{'eventProperty':_0x5a886b(0x11f),'value':JSON[_0x5a886b(0x176)]({'campaignId':_0x52d129[_0x5a886b(0x293)]})}],'name':_0x5a886b(0x14a)});}));}d(this,ce)[_0x1192a7(0x22b)](this,_0x52d129[_0x1192a7(0x293)]);},Ht=function(_0x27567d,_0x568deb){const _0x16f260=_0x4fbc4d;var _0x3100ad;let {campaignId:_0x56e733,message:{design:_0x2596c3}}=_0x568deb,_0x558104=document[_0x16f260(0x1b5)](_0x27567d);return _0x558104['id']=_0x16f260(0x1c3)+_0x56e733,_0x558104[_0x16f260(0x194)]=_0x2596c3,(_0x3100ad=_0x558104[_0x16f260(0x1ed)](_0x16f260(0x21d)))==null||_0x3100ad[_0x16f260(0x186)](),_0x558104;},zt=function(_0x117d2e){const _0x1eccd6=_0x4fbc4d;E[_0x1eccd6(0x163)]({'data':_0x117d2e,'displayMethod':r(this,T,Ue)[_0x1eccd6(0x142)](this),'timeValueKey':'campaignEntryTimeValue'});},jt=function(_0x4ad69c){const _0x35aacc=_0x4fbc4d;E['storeActionInLocalStorage'](_0x4ad69c,_0x35aacc(0x2ad),'campaignId');},xe=new WeakMap(),m(J,q);var Ye=J,ae=Ye[_0x4fbc4d(0x13f)](),le,Ie,Se,fe,be,he,ye,We,u,Yt,qt,Qt,ve,Ze,Xe,et,tt,Zt,Xt,en,tn,nn,rn,on,nt,it,sn,an,Q=class Q{constructor(){const _0x4eeaf4=_0x4fbc4d;m(this,u),m(this,Ie),m(this,Se),m(this,fe),m(this,be,null),m(this,he,null),m(this,ye,!0x1),m(this,We,()=>{setInterval(()=>{const _0x321297=_0x1a99;let _0x26d48b=localStorage[_0x321297(0x257)](_0x321297(0x14b));if(_0x26d48b!==d(this,he)){I(this,he,_0x26d48b);let _0x226ce5=JSON[_0x321297(0x203)](_0x26d48b||'{}');if(_0x226ce5!=null&&_0x226ce5[_0x321297(0x134)]){let _0x4b3b39=_0x226ce5[_0x321297(0x134)];delete _0x226ce5['pushMessageToSW'],localStorage[_0x321297(0x26f)]('mergn_shopify',JSON['stringify'](_0x226ce5)),x[_0x321297(0x134)](_0x4b3b39);}if(_0x226ce5!=null&&_0x226ce5[_0x321297(0x24e)]){let _0x3d15ab=_0x226ce5[_0x321297(0x24e)];delete _0x226ce5['optIn'],localStorage['setItem'](_0x321297(0x14b),JSON[_0x321297(0x176)](_0x226ce5)),x['showNotification'](_0x3d15ab);}if(_0x226ce5!=null&&_0x226ce5[_0x321297(0x26e)]){let _0x5b7bf8=_0x226ce5[_0x321297(0x26e)];delete _0x226ce5[_0x321297(0x26e)],localStorage[_0x321297(0x26f)](_0x321297(0x14b),JSON[_0x321297(0x176)](_0x226ce5)),_0x5b7bf8[_0x321297(0x14e)](_0x394148=>{const _0x3d1a83=_0x321297;$[_0x3d1a83(0x157)](_0x394148['message']['name'])?$[_0x3d1a83(0xfb)](_0x394148):ae['isContentCardAction'](_0x394148[_0x3d1a83(0x237)][_0x3d1a83(0x20b)])&&ae['showContentCard'](_0x394148);});}}},0x3e8);}),this[_0x4eeaf4(0x1a0)]=_0x5aba0f=>{const _0x9b9d74=_0x4eeaf4;let _0x2f2d2f=()=>{const _0x2c0994=_0x1a99;let _0xf3386=JSON[_0x2c0994(0x203)](localStorage['getItem'](_0x5aba0f)||'{}');Object[_0x2c0994(0xff)](_0xf3386)[_0x2c0994(0x14e)](_0x3ab10c=>{const _0x3544c4=_0x2c0994;_0xf3386[_0x3ab10c][_0x3544c4(0x112)]=new Date()[_0x3544c4(0x16c)]();}),localStorage[_0x2c0994(0x26f)](_0x5aba0f,JSON[_0x2c0994(0x176)](_0xf3386));};_0x2f2d2f(),window[_0x9b9d74(0x28e)]('beforeunload',_0x2f2d2f);},this[_0x4eeaf4(0x1af)]=({id:_0x4fb3ff,localStorageKey:_0x2369e3})=>{const _0x148322=_0x4eeaf4;let _0x2aa508=JSON[_0x148322(0x203)](localStorage[_0x148322(0x257)](_0x2369e3)||'{}');_0x2aa508[_0x4fb3ff]&&delete _0x2aa508[_0x4fb3ff],localStorage['setItem'](_0x2369e3,JSON[_0x148322(0x176)](_0x2aa508));},this[_0x4eeaf4(0x125)]=({actionCondition:_0x47cd8f,actionMethod:_0x3a2ec5,localStorageKey:_0x28b39d})=>{const _0x9d7aad=_0x4eeaf4;let _0xadb8a2=JSON[_0x9d7aad(0x203)](localStorage[_0x9d7aad(0x257)](_0x28b39d)||'{}');Object[_0x9d7aad(0xff)](_0xadb8a2)['forEach'](_0x226fea=>{_0x47cd8f(_0xadb8a2[_0x226fea])&&_0x3a2ec5(_0xadb8a2[_0x226fea]);});};}static[_0x4fbc4d(0x13f)](){return d(Q,le)||I(Q,le,new Q()),d(Q,le);}['init'](_0x4289a4,_0x2b52f7){return c(this,null,function*(){const _0x2ef14b=_0x1a99;o(0x1,'Initializing\x20base\x20service'),_0x2b52f7!=null&&_0x2b52f7[_0x2ef14b(0x1a9)]&&I(this,ye,!0x0),r(this,u,Yt)[_0x2ef14b(0x22b)](this,_0x4289a4);let _0x215003=this[_0x2ef14b(0x1cf)]();if(_0x215003===_0x2ef14b(0x217)||_0x215003===_0x2ef14b(0x170)){o(0x2,'Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms');return;}if(yield A[_0x2ef14b(0x14d)](),o(0x1,_0x2ef14b(0x10b)),yield r(this,u,nt)[_0x2ef14b(0x22b)](this),_0x2b52f7!=null&&_0x2b52f7[_0x2ef14b(0x1a9)]&&d(this,We)[_0x2ef14b(0x22b)](this),_0x2b52f7!=null&&_0x2b52f7[_0x2ef14b(0x20c)])try{g[_0x2ef14b(0x1ae)]=!0x0,yield this['setIdentity'](_0x2b52f7[_0x2ef14b(0x20c)]);}finally{g[_0x2ef14b(0x1ae)]=!0x1;}setInterval(()=>c(this,null,function*(){const _0x29c3c9=_0x2ef14b;o(0x1,_0x29c3c9(0x280)),yield r(this,u,nt)[_0x29c3c9(0x22b)](this);}),0x493e0);let _0x139269=r(this,u,ve)['call'](this);if(yield this[_0x2ef14b(0x105)](),yield p[_0x2ef14b(0x139)](),p['recordDebugEvents']({'eventName':_0x2ef14b(0x259)}),o(0x1,'Initializing\x20notification\x20service\x20from\x20Base\x20Service'),yield N('notification\x20service',()=>c(this,null,function*(){const _0x5eecc6=_0x2ef14b;yield x['init'](_0x139269,_0x2b52f7==null?void 0x0:_0x2b52f7[_0x5eecc6(0xfc)]);})),!(_0x2b52f7!=null&&_0x2b52f7[_0x2ef14b(0x1a9)])){yield r(this,u,an)[_0x2ef14b(0x22b)](this);let _0xd3327a=history[_0x2ef14b(0x207)];history['pushState']=(..._0x260d91)=>{const _0x69ae70=_0x2ef14b;_0xd3327a[_0x69ae70(0x1e8)](history,_0x260d91),r(this,u,sn)[_0x69ae70(0x22b)](this);};}o(0x1,_0x2ef14b(0x1b7));});}[_0x4fbc4d(0x20e)](_0x226ca6){I(this,Ie,_0x226ca6);}['setOSVersion'](_0x51ef60){I(this,Se,_0x51ef60);}[_0x4fbc4d(0x23d)](_0x526549){I(this,fe,_0x526549);}[_0x4fbc4d(0x286)](_0x1ebdad){I(this,be,_0x1ebdad);}[_0x4fbc4d(0x1bc)](){return d(this,be);}[_0x4fbc4d(0x1cf)](){return d(this,Ie);}[_0x4fbc4d(0x2b3)](){return d(this,Se);}['getOperatingSystem'](){return d(this,fe);}['updateSessionCreated'](){const _0x3f4b12=_0x4fbc4d;localStorage[_0x3f4b12(0x26f)](_0x3f4b12(0x1c2),''+new Date()[_0x3f4b12(0x16c)]());}[_0x4fbc4d(0x163)]({data:_0x1df9d0,displayMethod:_0x2332fc,timeValueKey:_0x4822fb}){const _0x4960de=_0x4fbc4d;let _0x4cb30a=()=>{const _0xaa5258=_0x1a99;var _0x320389;let _0x3bf052=window[_0xaa5258(0x1b3)],_0x191348=document['documentElement'][_0xaa5258(0x144)];window[_0xaa5258(0x108)]/(_0x191348-_0x3bf052)*0x64>(((_0x320389=_0x1df9d0[_0x4822fb])==null?void 0x0:_0x320389[_0xaa5258(0x18c)])||0x0)&&(window[_0xaa5258(0x243)](_0xaa5258(0x2be),_0x4cb30a),_0x2332fc(_0x1df9d0));};window[_0x4960de(0x28e)](_0x4960de(0x2be),_0x4cb30a);}[_0x4fbc4d(0x1a7)]({clearActionMethod:_0x2ad3a0,data:_0x360c2f,displayMethod:_0x16cf0b,idKey:_0x520edf,timeValueKey:_0x33cb06}){const _0x8eaa5d=_0x4fbc4d;var _0x142507,_0x187f98,_0x48684e;let _0x979139=(_0x142507=_0x360c2f[_0x33cb06])==null?void 0x0:_0x142507[_0x8eaa5d(0x18c)];((_0x187f98=_0x360c2f[_0x33cb06])==null?void 0x0:_0x187f98[_0x8eaa5d(0x15a)])===_0x8eaa5d(0x1a3)&&(_0x979139=_0x979139*0x3c);let _0x1a9465=_0x360c2f[_0x8eaa5d(0x112)]-0x1f4+(_0x979139||0x0)*0x3e8-new Date()[_0x8eaa5d(0x16c)]();o(0x1,_0x8eaa5d(0xfa)+_0x360c2f[_0x8eaa5d(0x112)]),o(0x1,'Time\x20value:\x20'+((_0x48684e=_0x360c2f[_0x33cb06])==null?void 0x0:_0x48684e[_0x8eaa5d(0x18c)])),o(0x1,'Current\x20time:\x20'+new Date()[_0x8eaa5d(0x16c)]()),o(0x1,_0x8eaa5d(0x29c)+_0x1a9465),_0x1a9465>0x0?setTimeout(()=>{_0x2ad3a0(_0x360c2f[_0x520edf]),_0x16cf0b(_0x360c2f);},_0x1a9465):(_0x2ad3a0(_0x360c2f[_0x520edf]),_0x16cf0b(_0x360c2f));}['storeActionInLocalStorage'](_0x19b3a7,_0x325538,_0x50596a){const _0x22a011=_0x4fbc4d;var _0x3aa19a;let _0x33e13f=JSON[_0x22a011(0x203)](localStorage['getItem'](_0x325538)||'{}'),_0x33c3de=(_0x3aa19a=_0x50596a in _0x19b3a7&&_0x19b3a7[_0x50596a])!=null?_0x3aa19a:'';_0x33c3de&&(_0x33e13f[_0x33c3de]=Pe(z({},_0x19b3a7),{'initialTime':new Date()['getTime']()}),localStorage[_0x22a011(0x26f)](_0x325538,JSON[_0x22a011(0x176)](_0x33e13f)));}['checkTTL'](){return c(this,null,function*(){const _0x5b32fa=_0x1a99;if(d(this,ye))return;o(0x1,_0x5b32fa(0x26a)),C(_0x5b32fa(0x26a),!0x0),L('Checking\x20TTL\x20Time',!0x0);let _0x13bf1a=localStorage['getItem'](_0x5b32fa(0x1c2)),_0x15ec8c=!0x1;if(_0x13bf1a){if(_0x15ec8c=r(this,u,ve)['call'](this,_0x13bf1a),_0x15ec8c){let _0x3c4b37=localStorage[_0x5b32fa(0x257)](_0x5b32fa(0x148)),_0x5d73ee=localStorage[_0x5b32fa(0x257)]('ttl');_0x3c4b37&&_0x5d73ee&&p['recordEvent']({'eventName':'Web\x20Session\x20Concluded','eventProperties':[{'eventProperty':_0x5b32fa(0x130),'value':localStorage[_0x5b32fa(0x257)]('session')},{'eventProperty':'SESSION_CREATED','value':new Date(parseInt(_0x5d73ee,0xa))[_0x5b32fa(0x187)]()}]}),this[_0x5b32fa(0x2ae)](),localStorage[_0x5b32fa(0x26f)]('ttl',''+new Date()[_0x5b32fa(0x16c)]());}}else localStorage[_0x5b32fa(0x26f)](_0x5b32fa(0x1c2),''+new Date()[_0x5b32fa(0x16c)]());(!_0x13bf1a||_0x15ec8c||r(this,u,Xt)['call'](this))&&(r(this,u,tt)['call'](this)&&r(this,u,en)[_0x5b32fa(0x22b)](this),r(this,u,et)[_0x5b32fa(0x22b)](this)&&(yield this[_0x5b32fa(0x18e)]()),(r(this,u,ve)['call'](this)||r(this,u,Ze)[_0x5b32fa(0x22b)](this))&&(yield r(this,u,rn)['call'](this)),yield r(this,u,tn)[_0x5b32fa(0x22b)](this),(r(this,u,ve)[_0x5b32fa(0x22b)](this)||r(this,u,Xe)[_0x5b32fa(0x22b)](this))&&(yield r(this,u,on)[_0x5b32fa(0x22b)](this))),L(_0x5b32fa(0x265),!0x1),C(_0x5b32fa(0x26a),!0x1);});}[_0x4fbc4d(0x2ae)](){const _0x16e255=_0x4fbc4d;localStorage[_0x16e255(0x210)](_0x16e255(0x2ad)),localStorage[_0x16e255(0x210)](_0x16e255(0x285)),localStorage['removeItem'](_0x16e255(0x26d)),localStorage[_0x16e255(0x210)](_0x16e255(0x1c1)),localStorage[_0x16e255(0x210)](_0x16e255(0x1c2)),localStorage['removeItem'](_0x16e255(0x148));}['setIdentity'](_0x2bbb7e){return c(this,null,function*(){const _0x555878=_0x1a99;let _0x1bd4b9={'deviceId':localStorage[_0x555878(0x257)]('uniqueIdentity')||crypto[_0x555878(0x1c5)](),'os':this['getPlatform']()};if(_0x2bbb7e)_0x1bd4b9['identity']=_0x2bbb7e;else{if(!_0x2bbb7e&&localStorage[_0x555878(0x257)](_0x555878(0x1df)))return;}try{let _0x4bfd78=yield r(this,u,nn)[_0x555878(0x22b)](this,_0x1bd4b9);if(_0x4bfd78!==void 0x0){localStorage[_0x555878(0x26f)](_0x555878(0x1df),_0x4bfd78);try{x[_0x555878(0x134)]({'customer':_0x4bfd78});}catch(_0x1a9022){}}}catch(_0x288863){throw new Error(_0x555878(0x151));}});}};le=new WeakMap(),Ie=new WeakMap(),Se=new WeakMap(),fe=new WeakMap(),be=new WeakMap(),he=new WeakMap(),ye=new WeakMap(),We=new WeakMap(),u=new WeakSet(),Yt=function(_0x4e4afd){const _0x16eec4=_0x4fbc4d;A[_0x16eec4(0x24c)](_0x4e4afd),this['setPlatform'](r(this,u,qt)['call'](this)),this[_0x16eec4(0x1a5)](r(this,u,Qt)[_0x16eec4(0x22b)](this)),this[_0x16eec4(0x23d)](navigator[_0x16eec4(0x1f2)]);},qt=function(){const _0x3305df=_0x4fbc4d;var _0x972ebf;let _0x27790e=navigator[_0x3305df(0x1f2)][_0x3305df(0x279)]();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i[_0x3305df(0x201)](_0x27790e)?'Crawlers':/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i[_0x3305df(0x201)](_0x27790e)?_0x3305df(0x29e):/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i[_0x3305df(0x201)](_0x27790e)?(_0x3305df(0x1fc)in window&&typeof((_0x972ebf=window==null?void 0x0:window[_0x3305df(0x1fc)])==null?void 0x0:_0x972ebf[_0x3305df(0x165)])!=_0x3305df(0x1f7),_0x3305df(0x29e)):/windows|macintosh|linux|x11/i[_0x3305df(0x201)](_0x27790e)?_0x3305df(0x1fa):_0x3305df(0x170);},Qt=function(){const _0x3a8e9f=_0x4fbc4d;let _0x31c303=navigator[_0x3a8e9f(0x1f2)],_0x338a54;return _0x31c303['indexOf'](_0x3a8e9f(0x231))>-0x1?_0x338a54='Google\x20Chrome':_0x31c303[_0x3a8e9f(0x1a8)](_0x3a8e9f(0x119))>-0x1?_0x338a54=_0x3a8e9f(0x119):_0x31c303[_0x3a8e9f(0x1a8)](_0x3a8e9f(0x109))>-0x1?_0x338a54='Mozilla\x20Firefox':_0x31c303[_0x3a8e9f(0x1a8)](_0x3a8e9f(0x204))>-0x1?_0x338a54=_0x3a8e9f(0x17a):_0x31c303[_0x3a8e9f(0x1a8)](_0x3a8e9f(0x192))>-0x1?_0x338a54=_0x3a8e9f(0x2bd):_0x338a54=_0x3a8e9f(0x170),_0x338a54;},ve=function(_0x419886){const _0x3bfdf3=_0x4fbc4d;let _0x3a2cf0;return _0x419886||(_0x3a2cf0=localStorage[_0x3bfdf3(0x257)](_0x3bfdf3(0x1c2))),_0x419886||_0x3a2cf0?new Date()['getTime']()-parseInt(_0x419886||_0x3a2cf0||'',0xa)>0x124f80:!0x0;},Ze=function(){const _0x295ae5=_0x4fbc4d;return!localStorage[_0x295ae5(0x257)](_0x295ae5(0x285));},Xe=function(){const _0x5b0d0c=_0x4fbc4d;return!localStorage[_0x5b0d0c(0x257)]('attributes');},et=function(){const _0xe57e40=_0x4fbc4d;return!localStorage['getItem'](_0xe57e40(0x1df));},tt=function(){const _0x5ac77c=_0x4fbc4d;return!localStorage[_0x5ac77c(0x257)]('uniqueIdentity');},Zt=function(){const _0x370be7=_0x4fbc4d;return!localStorage[_0x370be7(0x257)](_0x370be7(0x148));},Xt=function(){const _0x5dfa5d=_0x4fbc4d;return r(this,u,Ze)[_0x5dfa5d(0x22b)](this)||r(this,u,Xe)['call'](this)||r(this,u,et)[_0x5dfa5d(0x22b)](this)||r(this,u,tt)[_0x5dfa5d(0x22b)](this)||r(this,u,Zt)[_0x5dfa5d(0x22b)](this);},en=function(){const _0x2c3c77=_0x4fbc4d;let _0xe49187=localStorage[_0x2c3c77(0x257)](_0x2c3c77(0x115));return _0xe49187||(_0xe49187=crypto[_0x2c3c77(0x1c5)](),localStorage[_0x2c3c77(0x26f)]('uniqueIdentity',_0xe49187)),_0xe49187;},tn=function(){return c(this,null,function*(){const _0x37e7f1=_0x1a99;yield N(_0x37e7f1(0x1d6),()=>c(this,null,function*(){const _0x312aea=_0x37e7f1;let _0x17f0d4=localStorage['getItem']('session');_0x17f0d4||(_0x17f0d4=crypto[_0x312aea(0x1c5)](),localStorage['setItem'](_0x312aea(0x148),_0x17f0d4),yield p[_0x312aea(0x13c)]({'eventName':_0x312aea(0x24f),'eventProperties':[{'eventProperty':'SESSION_ID','value':localStorage[_0x312aea(0x257)](_0x312aea(0x148))},{'eventProperty':_0x312aea(0x169),'value':new Date(parseInt(localStorage['getItem'](_0x312aea(0x1c2))||'',0xa))[_0x312aea(0x187)]()}]}));}),_0x4cafab=>{const _0x22bb4b=_0x37e7f1;p[_0x22bb4b(0x13c)]({'eventName':_0x22bb4b(0x19e),'eventProperties':[{'eventProperty':_0x22bb4b(0x237),'value':_0x22bb4b(0x1db)+_0x4cafab[_0x22bb4b(0x237)]}]},!0x0);});});},nn=function(_0x3f236c){return c(this,null,function*(){const _0x51af31=_0x1a99;try{return(yield A['post'](''+ft+ht,_0x3f236c))[_0x51af31(0x116)];}catch(_0x28afbd){throw new Error(_0x51af31(0x135));}});},rn=function(){return c(this,null,function*(){const _0x5d065e=_0x1a99;yield p[_0x5d065e(0x1a2)]();});},on=function(){return c(this,null,function*(){const _0x39ad45=_0x1a99;yield we[_0x39ad45(0x291)]();});},nt=function(){return c(this,null,function*(){const _0x7b3adc=_0x1a99;yield N(_0x7b3adc(0x223),()=>c(this,null,function*(){const _0x2bc328=_0x7b3adc;var _0x2c6f9f;try{let _0x4e99ce=parseInt(localStorage[_0x2bc328(0x257)](_0x2bc328(0x1aa))||'0',0xa)||0x0;if(!_0x4e99ce||_0x4e99ce&&new Date()['getTime']()>_0x4e99ce){if(!((_0x2c6f9f=yield A[_0x2bc328(0x24b)](_0x2bc328(0x199)))!=null&&_0x2c6f9f[_0x2bc328(0x14c)]))throw new Error(_0x2bc328(0x208));localStorage['setItem']('verifyTTL',(new Date()['getTime']()+0x493e0)[_0x2bc328(0x13e)]());}g[_0x2bc328(0x1b1)]=!0x0;}catch(_0x3ce31c){throw g[_0x2bc328(0x27e)]=!0x0,_0x3ce31c[_0x2bc328(0x237)];}}));});},it=function(){return c(this,null,function*(){const _0x15a249=_0x1a99;var _0x1df3e2;o(0x1,_0x15a249(0x1e7));let _0x15b59e=(_0x1df3e2=window==null?void 0x0:window['location'])==null?void 0x0:_0x1df3e2[_0x15a249(0x22d)];this[_0x15a249(0x286)](_0x15b59e),p[_0x15a249(0x23b)]({'eventName':_0x15a249(0x11c)});let _0x390e35=[];new URLSearchParams(new URL(window[_0x15a249(0x1cc)][_0x15a249(0x22d)])[_0x15a249(0x230)])[_0x15a249(0x14e)]((_0x566d2f,_0x2f4554)=>c(this,null,function*(){const _0x655b5c=_0x15a249;Pt[_0x655b5c(0x2a4)](_0x2f4554)&&_0x390e35[_0x655b5c(0x19d)]({'eventProperty':_0x2f4554,'value':_0x566d2f});})),yield p[_0x15a249(0x13c)]({'eventName':_0x15a249(0x1d1),'eventProperties':[{'eventProperty':_0x15a249(0x270),'value':window[_0x15a249(0x1cc)][_0x15a249(0x1c8)]},..._0x390e35]});});},sn=function(){return c(this,null,function*(){const _0x1113cc=_0x1a99;var _0x36784d;o(0x1,_0x1113cc(0x29d));let _0x234f4b=(_0x36784d=window==null?void 0x0:window[_0x1113cc(0x1cc)])==null?void 0x0:_0x36784d[_0x1113cc(0x22d)];(this[_0x1113cc(0x1bc)]()===null||this[_0x1113cc(0x1bc)]()===void 0x0||_0x234f4b!==this[_0x1113cc(0x1bc)]())&&(yield r(this,u,it)[_0x1113cc(0x22b)](this));});},an=function(){return c(this,null,function*(){const _0x260ec3=_0x1a99;var _0x220ca6,_0x110cbd;let _0x35b972=(_0x220ca6=window==null?void 0x0:window[_0x260ec3(0x1cc)])==null?void 0x0:_0x220ca6['href'];p[_0x260ec3(0x23b)]({'eventName':'show_notification_error','eventProperties':[{'eventProperty':_0x260ec3(0x237),'value':(_0x35b972!==this['getPreviousUrl']())+':'+_0x35b972+':'+this[_0x260ec3(0x1bc)]()}]});try{yield r(this,u,it)[_0x260ec3(0x22b)](this);}catch(_0x4303fd){let _0x1aa3cc=_0x4303fd&&_0x4303fd['message']?(_0x110cbd=_0x4303fd==null?void 0x0:_0x4303fd['message'])==null?void 0x0:_0x110cbd['substring'](0x0,0x64):_0x260ec3(0x1f7);yield p['recordDebugEvents']({'eventName':'vwp_error','eventProperties':[{'eventProperty':'message','value':''+_0x1aa3cc}]});}});},m(Q,le);var Qe=Q,E=Qe['getInstance'](),Z,de,W,cn,ot,ln,dn,H=class H{constructor(){m(this,W),m(this,de,!0x1);}static['getInstance'](){const _0x282b29=_0x4fbc4d;var _0x391752;return d(H,Z)||(I(H,Z,new H()),r(_0x391752=d(H,Z),W,cn)[_0x282b29(0x22b)](_0x391752)),d(H,Z);}[_0x4fbc4d(0x136)](_0x4f9a6e,_0x3f0b4b,_0x3994a3){return c(this,null,function*(){const _0x4b86e5=_0x1a99;yield N(_0x4b86e5(0x149),()=>c(this,null,function*(){const _0x3fb07a=_0x4b86e5;if(o(0x1,'Recording\x20attribute'),C(_0x3fb07a(0x27a),!0x0),L('Recording\x20attribute\x20Time',!0x0),o(0x1,_0x3fb07a(0x205)+{'attributeName':_0x4f9a6e,'attributeProperties':_0x3994a3,'attributeValue':_0x3f0b4b}+')}'),!_0x3f0b4b||_0x3f0b4b===''){o(0x2,_0x3fb07a(0x120));return;}yield E['checkTTL'](),yield r(this,W,ln)[_0x3fb07a(0x22b)](this);let _0x5e5ddf=JSON[_0x3fb07a(0x203)](localStorage[_0x3fb07a(0x257)](_0x3fb07a(0x26d))||'{}'),_0x2b531f=_0x3994a3?r(this,W,ot)[_0x3fb07a(0x22b)](this,_0x5e5ddf,_0x4f9a6e,_0x3994a3):r(this,W,ot)[_0x3fb07a(0x22b)](this,_0x5e5ddf,_0x4f9a6e);if(typeof _0x2b531f==_0x3fb07a(0x1b9)){o(0x2,_0x2b531f);return;}_0x5e5ddf[_0x4f9a6e][_0x3fb07a(0x2a2)]&&(yield E[_0x3fb07a(0x18e)](typeof _0x3f0b4b=='string'?_0x3f0b4b:JSON[_0x3fb07a(0x176)](_0x3f0b4b))),E['updateSessionCreated']();let {id:_0x4707ac}=_0x5e5ddf[_0x4f9a6e],_0x516745={'attributeId':_0x4707ac,'attributeProperties':_0x2b531f,'customerId':localStorage['getItem'](_0x3fb07a(0x1df))||'','value':_0x3f0b4b};yield r(this,W,dn)[_0x3fb07a(0x22b)](this,_0x516745);let _0x2e7c03=JSON[_0x3fb07a(0x203)](localStorage[_0x3fb07a(0x257)]('preInitializedAttributes')||'[]');_0x2e7c03[_0x3fb07a(0x1e5)](),localStorage[_0x3fb07a(0x26f)](_0x3fb07a(0x1ea),JSON[_0x3fb07a(0x176)](_0x2e7c03)),L(_0x3fb07a(0x189),!0x1),C('Recording\x20attribute',!0x1);}));});}[_0x4fbc4d(0x291)](){return c(this,null,function*(){const _0x2ed9da=_0x1a99;if(!localStorage[_0x2ed9da(0x257)](_0x2ed9da(0x26d))&&!d(this,de)){I(this,de,!0x0);try{let _0xaeece7=(yield this[_0x2ed9da(0x1f1)]())[_0x2ed9da(0x116)];_0xaeece7&&localStorage[_0x2ed9da(0x26f)]('attributes',JSON['stringify'](_0xaeece7));}catch(_0x5a6c65){throw new Error(_0x2ed9da(0x292));}finally{I(this,de,!0x1);}}});}[_0x4fbc4d(0x1f1)](){return c(this,null,function*(){const _0x4f9360=_0x1a99;try{return yield A[_0x4f9360(0x24b)](''+Be);}catch(_0x244566){throw new Error(_0x4f9360(0x12c));}});}};Z=new WeakMap(),de=new WeakMap(),W=new WeakSet(),cn=function(){return c(this,null,function*(){});},ot=function(_0x11b188,_0x52fb80,_0x17106a){const _0x13d60d=_0x4fbc4d;if(!Object['prototype'][_0x13d60d(0x1f5)][_0x13d60d(0x22b)](_0x11b188,_0x52fb80))return _0x13d60d(0x12a)+_0x52fb80+'\x20is\x20not\x20valid.';if(!_0x17106a)return[];let _0x7e627=_0x11b188[_0x52fb80];if(!(_0x7e627!=null&&_0x7e627[_0x13d60d(0x11b)]))return _0x13d60d(0x12a)+_0x52fb80+_0x13d60d(0x190);let _0x33f727=_0x17106a[_0x13d60d(0x260)](({attributeProperty:_0x4ae075})=>!Object['prototype'][_0x13d60d(0x1f5)][_0x13d60d(0x22b)](_0x7e627[_0x13d60d(0x11b)],_0x4ae075))[_0x13d60d(0x269)](({attributeProperty:_0x3a436c})=>_0x3a436c);return _0x33f727[_0x13d60d(0x127)]>0x0?_0x13d60d(0x12a)+_0x52fb80+_0x13d60d(0x153)+_0x33f727[_0x13d60d(0x1f6)](',\x20')+'.':_0x17106a[_0x13d60d(0x269)](({attributeProperty:_0x244fc3,value:_0x1d402e})=>({'attributePropertyId':_0x7e627['attributeProperty'][_0x244fc3]['id'],'value':_0x1d402e}));},ln=function(){return c(this,null,function*(){const _0x19972a=_0x1a99;localStorage[_0x19972a(0x257)](_0x19972a(0x26d))||(yield this[_0x19972a(0x291)]());});},dn=function(_0x5908bc){return c(this,null,function*(){const _0x2211ff=_0x1a99;try{return yield A[_0x2211ff(0x2b5)](''+Be+It,_0x5908bc);}catch(_0x45ec38){throw new Error('Error\x20posting\x20attribute\x20record');}});},m(H,Z);var rt=H,we=rt[_0x4fbc4d(0x13f)](),ue,X=class X{constructor(){}static[_0x4fbc4d(0x13f)](){return d(X,ue)||I(X,ue,new X()),d(X,ue);}[_0x4fbc4d(0x15b)](_0x294536,_0x1f250e){setTimeout(()=>{const _0x3d85fb=_0x1a99;N(_0x3d85fb(0x15b),()=>c(this,null,function*(){const _0x13b9c1=_0x3d85fb;o(0x1,_0x13b9c1(0x118)),yield E[_0x13b9c1(0x15b)](_0x294536,_0x1f250e),p[_0x13b9c1(0x23b)]({'eventName':_0x13b9c1(0x152)}),o(0x1,_0x13b9c1(0x1ec));let _0x5d1cd7=JSON[_0x13b9c1(0x203)](localStorage['getItem'](_0x13b9c1(0x1ea))||'[]');Array[_0x13b9c1(0x1bd)](_0x5d1cd7)&&_0x5d1cd7['forEach']((_0x435fc0,_0x4e5442)=>c(this,null,function*(){const _0x5be8b9=_0x13b9c1;yield we[_0x5be8b9(0x136)](_0x435fc0[_0x5be8b9(0x1b4)],_0x435fc0[_0x5be8b9(0x10d)]),_0x5d1cd7[_0x5be8b9(0x21f)](_0x4e5442,0x1),localStorage[_0x5be8b9(0x26f)](_0x5be8b9(0x1ea),JSON[_0x5be8b9(0x176)](_0x5d1cd7));})),window[_0x13b9c1(0x28e)](_0x13b9c1(0x132),()=>c(this,null,function*(){const _0x5c35e5=_0x13b9c1;g[_0x5c35e5(0x1d5)]=!0x1;let _0x5a650d=JSON[_0x5c35e5(0x203)](localStorage['getItem'](_0x5c35e5(0x1c1))||'[]');Array[_0x5c35e5(0x1bd)](_0x5a650d)&&(yield p[_0x5c35e5(0x25d)]({'customerId':localStorage['getItem']('customer')||'','deviceId':localStorage[_0x5c35e5(0x257)]('uniqueIdentity')||'','events':_0x5a650d}),localStorage[_0x5c35e5(0x210)](_0x5c35e5(0x1c1))),E['checkTTL'](),E[_0x5c35e5(0x218)]();})),window['addEventListener'](_0x13b9c1(0x1d5),()=>{const _0x28b23c=_0x13b9c1;g[_0x28b23c(0x1d5)]=!0x0;}),window[_0x13b9c1(0x28e)](_0x13b9c1(0x277),()=>{const _0x401cee=_0x13b9c1;$[_0x401cee(0x150)](),x[_0x401cee(0x276)]();});}));});}['setDebugLevel'](_0x35b70a,_0x4cfb25){const _0x22d28c=_0x4fbc4d;if(!(_0x35b70a in U)){console['error'](_0x22d28c(0x2a8));return;}g[_0x22d28c(0x128)]=_0x4cfb25||{},g[_0x22d28c(0x18f)]=_0x35b70a;try{x[_0x22d28c(0x134)]({'debugLevel':_0x35b70a});}catch(_0x51b4ab){}}[_0x4fbc4d(0x136)](_0x1b1bf8,_0x5044a7){return c(this,null,function*(){return new Promise((_0x410549,_0x6810b0)=>{setTimeout(()=>c(this,null,function*(){const _0x420606=_0x1a99;try{yield N(_0x420606(0x136),()=>c(this,null,function*(){const _0x4e12aa=_0x420606;let _0xb1de8c;Array[_0x4e12aa(0x1bd)](_0x5044a7)?_0xb1de8c=JSON['stringify'](_0x5044a7):typeof _0x5044a7==_0x4e12aa(0x1f0)?_0xb1de8c=''+_0x5044a7:_0xb1de8c=_0x5044a7,o(0x1,_0x4e12aa(0x27a)),o(0x1,_0x4e12aa(0x23c)+_0x1b1bf8+_0x4e12aa(0x183)+_0xb1de8c);let _0x1b4abb=JSON['parse'](localStorage['getItem'](_0x4e12aa(0x1ea))||'[]');_0x1b4abb[_0x4e12aa(0x19d)]({'attributeName':_0x1b1bf8,'attrValueStringified':_0xb1de8c}),localStorage[_0x4e12aa(0x26f)]('preInitializedAttributes',JSON['stringify'](_0x1b4abb)),g[_0x4e12aa(0x1b1)]&&(yield we[_0x4e12aa(0x136)](_0x1b1bf8,_0xb1de8c));})),_0x410549();}catch(_0x295c60){_0x6810b0(_0x295c60);}}));});});}['login'](_0x489cba){return c(this,null,function*(){return new Promise((_0xec803d,_0x17fc4a)=>{setTimeout(()=>c(this,null,function*(){const _0x10d5aa=_0x1a99;try{yield N(_0x10d5aa(0x1de),()=>c(this,null,function*(){const _0x479c76=_0x10d5aa;o(0x1,_0x479c76(0x121)),o(0x1,_0x479c76(0x1d7)+_0x489cba),g[_0x479c76(0x1ae)]=!0x0,yield E[_0x479c76(0x18e)](_0x489cba);})),_0xec803d();}catch(_0x57f8ee){_0x17fc4a(_0x57f8ee);}finally{g[_0x10d5aa(0x1ae)]=!0x1,yield p[_0x10d5aa(0x139)]();}}));});});}[_0x4fbc4d(0x255)](){setTimeout(()=>{const _0x39d721=_0x1a99;N(_0x39d721(0x255),()=>c(this,null,function*(){o(0x1,'Logging\x20out'),E['clearLocalStorage']();}));});}[_0x4fbc4d(0x13c)](_0x2d83b0,_0x1972d8){return c(this,null,function*(){return new Promise((_0x2979e6,_0x42e465)=>{setTimeout(()=>c(this,null,function*(){const _0x3e4058=_0x1a99;try{yield N(_0x3e4058(0x299),()=>c(this,null,function*(){const _0x329737=_0x3e4058;o(0x1,'Recording\x20event'),o(0x1,_0x329737(0x28f)+{'eventName':_0x2d83b0,'eventProperties':_0x1972d8}),yield p[_0x329737(0x13c)]({'eventName':_0x2d83b0,'eventProperties':_0x1972d8});})),_0x2979e6();}catch(_0x5f12ef){_0x42e465(_0x5f12ef);}}));});});}[_0x4fbc4d(0x27f)](){return vt;}};ue=new WeakMap(),m(X,ue);var st=X,at=st[_0x4fbc4d(0x13f)]();typeof window!=_0x4fbc4d(0x1f7)&&(window['mergn']=at);var yn=at;
|
|
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)&>(l,t,e[t]);if(pt)for(var t of pt(e))En.call(e,t)&>(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;
|
package/dist/index2.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
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};
|
package/package.json
CHANGED
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const _0x5784de=_0x1e9d;(function(_0x43e223,_0x55da15){const _0x309b7e=_0x1e9d,_0x4bf774=_0x43e223();while(!![]){try{const _0x548442=-parseInt(_0x309b7e(0x231))/0x1*(-parseInt(_0x309b7e(0x297))/0x2)+-parseInt(_0x309b7e(0x1d6))/0x3*(parseInt(_0x309b7e(0x260))/0x4)+parseInt(_0x309b7e(0x1c1))/0x5*(-parseInt(_0x309b7e(0x104))/0x6)+parseInt(_0x309b7e(0x1e9))/0x7+-parseInt(_0x309b7e(0x139))/0x8+parseInt(_0x309b7e(0x10f))/0x9+parseInt(_0x309b7e(0x171))/0xa;if(_0x548442===_0x55da15)break;else _0x4bf774['push'](_0x4bf774['shift']());}catch(_0x4ceebb){_0x4bf774['push'](_0x4bf774['shift']());}}}(_0xcb74,0xa1f18));var ln=Object[_0x5784de(0x191)],dn=Object[_0x5784de(0x252)],un=Object['getOwnPropertyDescriptors'],ut=Object[_0x5784de(0x119)],pn=Object[_0x5784de(0x271)][_0x5784de(0x183)],gn=Object[_0x5784de(0x271)][_0x5784de(0x261)],gt=_0x212620=>{throw TypeError(_0x212620);},pt=(_0x357f57,_0x269abf,_0x5e0eea)=>_0x269abf in _0x357f57?ln(_0x357f57,_0x269abf,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5e0eea}):_0x357f57[_0x269abf]=_0x5e0eea,z=(_0x5902c1,_0x2f84ca)=>{const _0x5ea392=_0x5784de;for(var _0xeb8a78 in _0x2f84ca||(_0x2f84ca={}))pn['call'](_0x2f84ca,_0xeb8a78)&&pt(_0x5902c1,_0xeb8a78,_0x2f84ca[_0xeb8a78]);if(ut){for(var _0xeb8a78 of ut(_0x2f84ca))gn[_0x5ea392(0x22a)](_0x2f84ca,_0xeb8a78)&&pt(_0x5902c1,_0xeb8a78,_0x2f84ca[_0xeb8a78]);}return _0x5902c1;},Te=(_0x50d06c,_0x45dd20)=>dn(_0x50d06c,un(_0x45dd20)),We=(_0x1bdf69,_0x336fa0,_0x28e3d6)=>_0x336fa0[_0x5784de(0x2b0)](_0x1bdf69)||gt('Cannot\x20'+_0x28e3d6),d=(_0x61783e,_0x476562,_0x58748a)=>(We(_0x61783e,_0x476562,_0x5784de(0x108)),_0x58748a?_0x58748a[_0x5784de(0x22a)](_0x61783e):_0x476562[_0x5784de(0x158)](_0x61783e)),m=(_0x5de2ba,_0x1ea1fd,_0x358a62)=>_0x1ea1fd[_0x5784de(0x2b0)](_0x5de2ba)?gt('Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once'):_0x1ea1fd instanceof WeakSet?_0x1ea1fd[_0x5784de(0x229)](_0x5de2ba):_0x1ea1fd[_0x5784de(0x20f)](_0x5de2ba,_0x358a62),I=(_0x289d67,_0x133b68,_0x432be5,_0x2831e6)=>(We(_0x289d67,_0x133b68,'write\x20to\x20private\x20field'),_0x2831e6?_0x2831e6['call'](_0x289d67,_0x432be5):_0x133b68[_0x5784de(0x20f)](_0x289d67,_0x432be5),_0x432be5),r=(_0x220f64,_0x4233de,_0x3aafa2)=>(We(_0x220f64,_0x4233de,'access\x20private\x20method'),_0x3aafa2),c=(_0x27521b,_0x3d40ec,_0x58ab03)=>new Promise((_0x39fee7,_0xf49e93)=>{const _0x265aea=_0x5784de;var _0x20d0fb=_0x489d75=>{const _0xd615d7=_0x1e9d;try{_0x2ea6fd(_0x58ab03[_0xd615d7(0x278)](_0x489d75));}catch(_0x47809d){_0xf49e93(_0x47809d);}},_0x17ba14=_0x4fc471=>{const _0x1bd317=_0x1e9d;try{_0x2ea6fd(_0x58ab03[_0x1bd317(0x161)](_0x4fc471));}catch(_0x5d54a0){_0xf49e93(_0x5d54a0);}},_0x2ea6fd=_0x1b9c26=>_0x1b9c26['done']?_0x39fee7(_0x1b9c26[_0x265aea(0x1de)]):Promise[_0x265aea(0x251)](_0x1b9c26['value'])['then'](_0x20d0fb,_0x17ba14);_0x2ea6fd((_0x58ab03=_0x58ab03[_0x265aea(0x203)](_0x27521b,_0x3d40ec))['next']());}),mt='1.0.118',pe=_0x5784de(0x154),ke=_0x5784de(0x28e),Et=_0x5784de(0x1d5),Be=_0x5784de(0x193),vt=_0x5784de(0x1f9),It='/customer',St=_0x5784de(0x13e),ft=_0x5784de(0x13c),bt=_0x5784de(0x121),ht='/brand/get-time',ee,te,Pe,P=class P{constructor(){m(this,te);}static[_0x5784de(0x26a)](){return d(P,ee)||I(P,ee,new P()),d(P,ee);}[_0x5784de(0x175)](_0x541f7f){const _0xd1483f=_0x5784de;P['apiKey']=_0x541f7f;let _0x3ad063=_0x541f7f,_0x3864ed=/m(\d+)rgn/,_0x21984a=_0x3ad063[_0xd1483f(0x10d)](_0x3864ed);_0x21984a&&(P['brandId']=_0x21984a[0x1]);}[_0x5784de(0x282)](){const _0x5d183d=_0x5784de;return P[_0x5d183d(0x22f)];}['getBrandId'](){return P['brandId'];}[_0x5784de(0x158)](_0x5556c9){return c(this,null,function*(){const _0x2633cc=_0x1e9d;return(yield fetch(pe+_0x5556c9,{'headers':{'Authorization':r(this,te,Pe)[_0x2633cc(0x22a)](this,P['apiKey']),'Content-Type':_0x2633cc(0xfc)}}))[_0x2633cc(0x15c)]();});}[_0x5784de(0x15d)](_0x529d30,_0x4e3a5b,_0x498054){return c(this,null,function*(){const _0x5687a7=_0x1e9d;return(yield fetch(pe+_0x529d30,{'body':JSON[_0x5687a7(0x16d)](_0x4e3a5b||{}),'headers':{'Authorization':r(this,te,Pe)[_0x5687a7(0x22a)](this,P[_0x5687a7(0x22f)]),'Content-Type':_0x5687a7(0xfc)},'method':_0x5687a7(0x1d2),'signal':_0x498054}))[_0x5687a7(0x15c)]();});}[_0x5784de(0x135)](_0x497cbd,_0x46af49){return c(this,null,function*(){const _0x1bd074=_0x1e9d;return(yield fetch(pe+_0x497cbd,{'body':JSON[_0x1bd074(0x16d)](_0x46af49||{}),'headers':{'Authorization':r(this,te,Pe)[_0x1bd074(0x22a)](this,P[_0x1bd074(0x22f)]),'Content-Type':_0x1bd074(0xfc)},'method':_0x1bd074(0x1c2)}))[_0x1bd074(0x15c)]();});}['syncRealWorldTime'](){return c(this,null,function*(){const _0x45d3e8=_0x1e9d;try{let _0x24d223=(yield(yield fetch(pe+ht))['json']())[_0x45d3e8(0x19b)];P[_0x45d3e8(0x181)]=new Date(_0x24d223),P[_0x45d3e8(0x242)]=new Date();}catch(_0x350543){o(0x2,'Failed\x20to\x20sync\x20real-world\x20time');}});}[_0x5784de(0x2af)](){const _0x136080=_0x5784de;if(!P[_0x136080(0x181)]||!P['lastSyncTime'])return o(0x2,_0x136080(0x1b3)),new Date();let _0x1612e9=new Date()[_0x136080(0x202)]()-P[_0x136080(0x242)]['getTime']();return new Date(P[_0x136080(0x181)]['getTime']()+_0x1612e9);}};ee=new WeakMap(),te=new WeakSet(),Pe=function(_0x26b987){const _0x34f116=_0x5784de;return btoa(_0x26b987+':'+new Date()[_0x34f116(0x202)]());},m(P,ee);var Fe=P,A=Fe['getInstance'](),g=class extends Error{constructor(_0x16b6eb){const _0x363464=_0x5784de;super(_0x16b6eb),this[_0x363464(0xf7)]=_0x363464(0x17a);}};g['disableSDK']=!0x1,g[_0x5784de(0xfb)]=!navigator[_0x5784de(0x176)],g[_0x5784de(0x1a3)]=0x0,g[_0x5784de(0x1ff)]=!0x1,g['loading']=!0x1;var En=(_0x4a7fee,_0x193dc2)=>{const _0x195a6a=_0x5784de;_0x193dc2 instanceof g?o(0x2,'OriginateFrom:\x20'+_0x4a7fee+_0x195a6a(0xfa)+_0x193dc2[_0x195a6a(0x1a9)]):_0x193dc2 instanceof Error?o(0x2,'OriginateFrom:\x20'+_0x4a7fee+_0x195a6a(0x1a2)+_0x193dc2[_0x195a6a(0x1a9)]):o(0x2,'OriginateFrom:\x20'+_0x4a7fee+_0x195a6a(0x1a2)+String(_0x193dc2));},N=(_0x2ce993,_0x3f162c,_0x455d67,_0x22332f=!0x1)=>c(void 0x0,null,function*(){const _0x3a7ca2=_0x5784de;try{C(_0x2ce993,!0x0),L(_0x2ce993+_0x3a7ca2(0x1e8),!0x0);try{if(g[_0x3a7ca2(0x113)])throw new g(_0x3a7ca2(0x187));if(_0x2ce993!==_0x3a7ca2(0x1b2)&&g[_0x3a7ca2(0xfb)])throw new g('Mergn\x20is\x20offline!');if(_0x2ce993!==_0x3a7ca2(0x111)&&_0x2ce993!==_0x3a7ca2(0xfe)&&_0x2ce993!==_0x3a7ca2(0x1b2)&&_0x2ce993!==_0x3a7ca2(0x270)&&!g[_0x3a7ca2(0x1ff)])throw new g('Mergn\x20not\x20initialized!');if(_0x2ce993!==_0x3a7ca2(0x250)&&g['loading'])throw new g('Mergn\x20is\x20loading!');return yield _0x3f162c();}catch(_0x8beed5){return _0x455d67?_0x455d67(_0x8beed5):(g[_0x3a7ca2(0x1a3)]===0x2||g['debugLevel']===0x3)&&En(_0x2ce993,_0x8beed5),!_0x22332f&&A[_0x3a7ca2(0x205)](),null;}finally{L(_0x2ce993+_0x3a7ca2(0x1e8),!0x1),C(_0x2ce993,!0x1);}}catch(_0xd19907){return null;}}),U=(_0xe91f8c=>(_0xe91f8c[_0xe91f8c[_0x5784de(0x18d)]=0x0]=_0x5784de(0x18d),_0xe91f8c[_0xe91f8c[_0x5784de(0x12d)]=0x1]=_0x5784de(0x12d),_0xe91f8c[_0xe91f8c['ERROR']=0x2]='ERROR',_0xe91f8c[_0xe91f8c[_0x5784de(0x14e)]=0x3]=_0x5784de(0x14e),_0xe91f8c[_0xe91f8c[_0x5784de(0x16b)]=0x4]=_0x5784de(0x16b),_0xe91f8c))(U||{}),o=(_0x1dc155,_0x5bfcda)=>{const _0x181ecd=_0x5784de;g[_0x181ecd(0x1a3)]!==0x0&&(g[_0x181ecd(0x1a3)]>=0x3?_0x1dc155===0x1?console[_0x181ecd(0x25b)]('INFO:\x20'+new Date()[_0x181ecd(0x21e)](),_0x5bfcda):_0x1dc155===0x2&&console['error'](_0x181ecd(0x283)+new Date()[_0x181ecd(0x21e)](),_0x5bfcda):g[_0x181ecd(0x1a3)]===0x1&&_0x1dc155===0x1?console[_0x181ecd(0x25b)](_0x181ecd(0x1f4)+new Date()[_0x181ecd(0x21e)](),_0x5bfcda):g['debugLevel']===0x2&&_0x1dc155===0x2&&console[_0x181ecd(0x221)](_0x181ecd(0x283)+new Date()['toISOString'](),_0x5bfcda));},L=(_0x40a006,_0xc01551)=>{const _0x56fb37=_0x5784de;g['debugLevel']!==0x0&&(_0xc01551?console[_0x56fb37(0x14d)](_0x40a006):console['timeEnd'](_0x40a006));},C=(_0x5c909b,_0xb0d95b)=>{const _0x244f6d=_0x5784de;g[_0x244f6d(0x1a3)]!==0x0&&(_0xb0d95b?console['group'](_0x5c909b):console[_0x244f6d(0x1ae)]());},yt=(_0x45da42=>(_0x45da42['UTM_SOURCE']=_0x5784de(0x288),_0x45da42['UTM_MEDIUM']='utm_medium',_0x45da42[_0x5784de(0x25a)]=_0x5784de(0x21b),_0x45da42['UTM_TERM']=_0x5784de(0xf6),_0x45da42[_0x5784de(0x272)]=_0x5784de(0x1d0),_0x45da42['GAD_SOURCE']=_0x5784de(0x1dc),_0x45da42[_0x5784de(0x123)]=_0x5784de(0x29a),_0x45da42[_0x5784de(0x28d)]='fbclid',_0x45da42))(yt||{}),wt=new Set(Object[_0x5784de(0x290)](yt)),ne=_0x5784de(0x1f0),Me=_0x5784de(0x262),ie,F,re,j,ge,me,S,$e,Pt,Ke,_e,_t,Re,Ae,Je,At,Ne,Ee,Nt,f=class f{constructor(){const _0xa48cc7=_0x5784de;m(this,S),this['permission']=null,this[_0xa48cc7(0x134)]=_0x2d8345=>{const _0x3781ed=_0xa48cc7;o(0x1,_0x3781ed(0x12a)),navigator['serviceWorker'][_0x3781ed(0x174)]()[_0x3781ed(0x1ed)](_0x254c8b=>{const _0x25dce8=_0x3781ed;var _0x3cf071,_0x2ef54e;o(0x1,_0x25dce8(0x26c)),(_0x3cf071=_0x254c8b[0x0])!=null&&_0x3cf071[_0x25dce8(0x10e)]&&(o(0x1,_0x25dce8(0x267)),(_0x2ef54e=_0x254c8b[0x0]['active'])==null||_0x2ef54e['postMessage'](JSON[_0x25dce8(0x16d)](_0x2d8345)));})['catch'](_0x3590f6=>{const _0x4b1c77=_0x3781ed;o(0x2,_0x4b1c77(0x1f7)+_0x3590f6[_0x4b1c77(0x1a9)]);});},this[_0xa48cc7(0x204)]=()=>{const _0x2f2107=_0xa48cc7;E['loadActionInLocalStorage']({'actionCondition':()=>!0x0,'actionMethod':_0x55ea30=>r(this,S,Ae)['call'](this,Number(_0x55ea30[_0x2f2107(0x1aa)])),'localStorageKey':'web_push_action'});},m(this,Re,()=>{const _0x4e8093=_0xa48cc7;E['storeActionInLocalStorageInternal'](_0x4e8093(0x269));}),m(this,Ee,_0x56d3ea=>{const _0x30bd5e=_0xa48cc7;E[_0x30bd5e(0x122)]({'id':_0x56d3ea,'localStorageKey':_0x30bd5e(0x269)});});}static['getInstance'](){return d(f,ie)||I(f,ie,new f()),d(f,ie);}[_0x5784de(0x111)](_0x149639,_0x44fedf){return c(this,null,function*(){const _0x4f815e=_0x1e9d;var _0x480f6f;if(o(0x1,'Initializing\x20Notification\x20Service'),p[_0x4f815e(0x1cf)]({'eventName':'init','eventProperties':[{'eventProperty':_0x4f815e(0x1f1),'value':_0x4f815e(0x1c8)in navigator},{'eventProperty':_0x4f815e(0x188),'value':_0x4f815e(0x26d)in window}]}),_0x4f815e(0x1c8)in navigator&&_0x4f815e(0x26d)in window){o(0x1,'Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported');try{p[_0x4f815e(0x1cf)]({'eventName':_0x4f815e(0x1d9)}),I(f,F,yield navigator[_0x4f815e(0x1c8)][_0x4f815e(0x160)](_0x44fedf||_0x4f815e(0x13b))),o(0x1,_0x4f815e(0x1ec)),o(0x1,_0x4f815e(0x107)),this[_0x4f815e(0x134)]({'customer':localStorage['getItem'](_0x4f815e(0x179))||'','events':p['getStoredEvents'](),'API_KEY':A[_0x4f815e(0x282)](),'device_id':localStorage[_0x4f815e(0x194)]('uniqueIdentity')||'','operatingSystem':E[_0x4f815e(0x125)](),'osVersion':E['getOSVersion'](),'Platform':E['getPlatform']()}),I(f,ge,!0x0);let _0x4e4214=r(this,S,Je)[_0x4f815e(0x22a)](this),_0x4fed28=Object['keys'](_0x4e4214||{});if(_0x4fed28[_0x4f815e(0x1ee)]&&r(this,S,Ae)[_0x4f815e(0x22a)](this,Number(_0x4fed28[0x0])),!_0x149639)return;let _0x285ed4=yield(_0x480f6f=d(f,F))==null?void 0x0:_0x480f6f[_0x4f815e(0x17d)]['getSubscription']();o(0x1,_0x4f815e(0x273)),d(f,F)&&(o(0x1,_0x4f815e(0x2a3)),d(f,F)[_0x4f815e(0x1fd)]()),_0x285ed4?(o(0x1,'Existing\x20subscription\x20found'),p[_0x4f815e(0x1cf)]({'eventName':_0x4f815e(0x1e3)}),yield r(this,S,_e)[_0x4f815e(0x22a)](this),I(f,re,!0x0)):(o(0x1,_0x4f815e(0x14f)),yield r(this,S,$e)[_0x4f815e(0x22a)](this,d(f,me)||void 0x0));}catch(_0x5ec5f8){let _0x442975=_0x5ec5f8&&_0x5ec5f8[_0x4f815e(0x1a9)]?_0x5ec5f8['message'][_0x4f815e(0x23f)](0x0,0x64):_0x4f815e(0x1cc);yield p[_0x4f815e(0x1cf)]({'eventName':'Reachability\x20Push\x20Web','eventProperties':[{'eventProperty':_0x4f815e(0x1a9),'value':''+_0x442975}]}),o(0x2,_0x4f815e(0x1fb)),o(0x2,_0x442975);}}});}[_0x5784de(0x239)](_0x2dcb75){const _0x100f2a=_0x5784de;if(!d(f,ge)){I(f,me,_0x2dcb75),p['recordDebugEvents']({'eventName':_0x100f2a(0x16f)}),o(0x2,_0x100f2a(0x1be));return;}N(_0x100f2a(0x239),()=>c(this,null,function*(){const _0x4f535b=_0x100f2a;let _0x39bc9f=JSON['parse'](localStorage[_0x4f535b(0x194)]('web_push_action')||'{}');if(_0x39bc9f&&_0x39bc9f[_0x2dcb75['web_optin_instance_id']]){o(0x1,_0x4f535b(0x190));return;}r(this,S,_t)[_0x4f535b(0x22a)](this,_0x2dcb75),d(this,Re)[_0x4f535b(0x22a)](this),r(this,S,Ae)[_0x4f535b(0x22a)](this,_0x2dcb75[_0x4f535b(0x1aa)]);}));}};ie=new WeakMap(),F=new WeakMap(),re=new WeakMap(),j=new WeakMap(),ge=new WeakMap(),me=new WeakMap(),S=new WeakSet(),$e=function(_0x52678b){return c(this,null,function*(){const _0x584c48=_0x1e9d;o(0x1,_0x584c48(0x19d)+JSON[_0x584c48(0x16d)](_0x52678b)+'\x20'),p[_0x584c48(0x1cf)]({'eventName':_0x584c48(0x241)});let _0x5a15e4;try{_0x5a15e4=Notification['permission'],_0x5a15e4&&(o(0x1,_0x584c48(0x1e7)+_0x5a15e4),_0x5a15e4===_0x584c48(0x226)?(_0x52678b||(this[_0x584c48(0x23b)]='default',p[_0x584c48(0x1cf)]({'eventName':_0x584c48(0x24f)})),_0x52678b&&(p[_0x584c48(0x1cf)]({'eventName':_0x584c48(0x1e4),'eventProperties':[{'eventProperty':_0x584c48(0x208),'value':''+(_0x52678b==null?void 0x0:_0x52678b[_0x584c48(0x208)])}]}),d(this,Ee)[_0x584c48(0x22a)](this,_0x52678b['web_optin_instance_id']),_0x52678b[_0x584c48(0x208)]===_0x584c48(0x22c)?r(this,S,Pt)[_0x584c48(0x22a)](this,_0x52678b):yield r(this,S,Ke)[_0x584c48(0x22a)](this,_0x52678b))):_0x5a15e4===_0x584c48(0x16c)?(p[_0x584c48(0x1cf)]({'eventName':'Turned\x20Off\x20Notification'}),o(0x1,'The\x20user\x20has\x20blocked\x20notifications.')):(p[_0x584c48(0x1cf)]({'eventName':_0x584c48(0x1b4)}),o(0x1,_0x584c48(0x1d3)),d(f,re)||(yield r(this,S,_e)['call'](this),yield p['recordEvent']({'eventName':_0x584c48(0x22b)}),_0x52678b||I(f,re,!0x0))));}catch(_0x848e0b){o(0x2,'Failed\x20to\x20check\x20notification\x20permission'),p['recordDebugEvents']({'eventName':_0x584c48(0x138)});}});},Pt=function(_0x2090bb){const _0xb10e2a=_0x5784de;try{let _0x5f328b=document[_0xb10e2a(0x298)](_0xb10e2a(0x147)),_0x34b508;_0x2090bb[_0xb10e2a(0x146)][_0xb10e2a(0x126)]&&(_0x34b508=document[_0xb10e2a(0x298)](_0xb10e2a(0x195)),_0x34b508[_0xb10e2a(0x197)]=_0x2090bb[_0xb10e2a(0x146)]['banner_image'],_0x34b508[_0xb10e2a(0x114)]=_0xb10e2a(0x133),_0x34b508['id']=_0xb10e2a(0x159));let _0xdb8924=document[_0xb10e2a(0x298)](_0xb10e2a(0x147)),_0x4f6787=document[_0xb10e2a(0x298)](_0xb10e2a(0x147)),_0x256e5c=document[_0xb10e2a(0x298)](_0xb10e2a(0x147)),_0x4459ce=document[_0xb10e2a(0x298)](_0xb10e2a(0x195)),_0x4292e9=document[_0xb10e2a(0x298)](_0xb10e2a(0x147)),_0x197b38=document[_0xb10e2a(0x298)](_0xb10e2a(0x147)),_0xbfe526=document[_0xb10e2a(0x298)](_0xb10e2a(0x147)),_0x1db7e0=document[_0xb10e2a(0x298)]('div'),_0xd11552=document[_0xb10e2a(0x298)](_0xb10e2a(0x147)),_0x2d8ee7=document[_0xb10e2a(0x298)](_0xb10e2a(0x147)),_0x59eb05=document[_0xb10e2a(0x298)](_0xb10e2a(0x25f)),_0x3b4ca5=document[_0xb10e2a(0x298)](_0xb10e2a(0x25f));_0x5f328b[_0xb10e2a(0x206)]=_0xb10e2a(0x1e2),_0xdb8924[_0xb10e2a(0x206)]=_0xb10e2a(0x1eb),_0x4f6787[_0xb10e2a(0x206)]=_0x1db7e0['className']=_0xd11552['className']=_0xb10e2a(0x289),_0x256e5c[_0xb10e2a(0x206)]=_0xb10e2a(0x249),_0x4292e9[_0xb10e2a(0x206)]=_0xb10e2a(0x234),_0x2d8ee7[_0xb10e2a(0x206)]=_0xb10e2a(0x2a2),_0x197b38['id']=_0xb10e2a(0x224),_0xbfe526['id']=_0xb10e2a(0x185),_0x59eb05['id']=_0xb10e2a(0x28b),_0x3b4ca5['id']='button-2',_0x4459ce['src']=_0x2090bb[_0xb10e2a(0x146)][_0xb10e2a(0x155)],_0x4459ce['alt']=_0xb10e2a(0x133),_0x4459ce['id']='logo',_0x197b38[_0xb10e2a(0x21f)]=_0x2090bb['banner_design'][_0xb10e2a(0x1fa)],_0xbfe526[_0xb10e2a(0x21f)]=_0x2090bb[_0xb10e2a(0x146)][_0xb10e2a(0x18f)],_0x59eb05[_0xb10e2a(0x21f)]=_0x2090bb[_0xb10e2a(0x146)][_0xb10e2a(0x1b8)]['text'],_0x3b4ca5['textContent']=_0x2090bb[_0xb10e2a(0x146)]['button_2'][_0xb10e2a(0x25c)],_0x256e5c[_0xb10e2a(0x23e)](_0x4459ce),_0x4292e9[_0xb10e2a(0x23e)](_0x197b38),_0x4292e9[_0xb10e2a(0x23e)](_0xbfe526),_0x4f6787[_0xb10e2a(0x23e)](_0x256e5c),_0x4f6787[_0xb10e2a(0x23e)](_0x4292e9),_0x34b508&&(_0x1db7e0[_0xb10e2a(0x23e)](_0x34b508),_0x34b508[_0xb10e2a(0x1a6)][_0xb10e2a(0x1ef)]='\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'),_0x2d8ee7['appendChild'](_0x59eb05),_0x2d8ee7[_0xb10e2a(0x23e)](_0x3b4ca5),_0xd11552[_0xb10e2a(0x23e)](_0x2d8ee7),_0xdb8924[_0xb10e2a(0x23e)](_0x4f6787),_0xdb8924[_0xb10e2a(0x23e)](_0x1db7e0),_0xdb8924['appendChild'](_0xd11552),_0x5f328b[_0xb10e2a(0x23e)](_0xdb8924),_0x5f328b['style'][_0xb10e2a(0x1ef)]=_0xb10e2a(0x28a),_0xdb8924['style']['cssText']='\x0abackground-color:\x20'+_0x2090bb[_0xb10e2a(0x146)][_0xb10e2a(0x1cb)]+_0xb10e2a(0x29f),_0x4f6787['style']['cssText']=_0x1db7e0[_0xb10e2a(0x1a6)][_0xb10e2a(0x1ef)]=_0xd11552[_0xb10e2a(0x1a6)][_0xb10e2a(0x1ef)]=_0xb10e2a(0x258),_0x256e5c['style'][_0xb10e2a(0x1ef)]=_0xb10e2a(0x25e),_0x4292e9[_0xb10e2a(0x1a6)][_0xb10e2a(0x1ef)]='\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a',_0x4459ce[_0xb10e2a(0x1a6)][_0xb10e2a(0x1ef)]='\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a',_0x59eb05[_0xb10e2a(0x1a6)][_0xb10e2a(0x1ef)]=_0xb10e2a(0x26e)+_0x2090bb['banner_design'][_0xb10e2a(0x1b8)][_0xb10e2a(0xf8)]+';\x0acolor:\x20'+_0x2090bb[_0xb10e2a(0x146)][_0xb10e2a(0x1b8)][_0xb10e2a(0x230)]+_0xb10e2a(0x11e),_0x3b4ca5[_0xb10e2a(0x1a6)][_0xb10e2a(0x1ef)]=_0xb10e2a(0x26e)+_0x2090bb[_0xb10e2a(0x146)][_0xb10e2a(0x165)][_0xb10e2a(0xf8)]+_0xb10e2a(0x277)+_0x2090bb[_0xb10e2a(0x146)][_0xb10e2a(0x165)][_0xb10e2a(0x230)]+';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a',_0x2d8ee7[_0xb10e2a(0x1a6)][_0xb10e2a(0x1ef)]=_0xb10e2a(0x129),_0x197b38[_0xb10e2a(0x1a6)]['cssText']=_0xb10e2a(0x240)+_0x2090bb['banner_design'][_0xb10e2a(0x1f5)]+'\x0a',_0xbfe526[_0xb10e2a(0x1a6)][_0xb10e2a(0x1ef)]=_0xb10e2a(0x1a5)+_0x2090bb[_0xb10e2a(0x146)][_0xb10e2a(0x1f5)]+'\x0a',document['body'][_0xb10e2a(0x23e)](_0x5f328b),document[_0xb10e2a(0x149)][_0xb10e2a(0x1a6)][_0xb10e2a(0x233)]=_0xb10e2a(0x244),p[_0xb10e2a(0x152)]({'eventName':_0xb10e2a(0x102),'name':_0xb10e2a(0x14b),'web_optin_instance_id':_0x2090bb[_0xb10e2a(0x1aa)]}),_0x59eb05==null||_0x59eb05[_0xb10e2a(0x10a)]('click',()=>c(this,null,function*(){const _0x3484c7=_0xb10e2a;_0x5f328b['remove'](),I(f,j,!0x1),document[_0x3484c7(0x149)][_0x3484c7(0x1a6)][_0x3484c7(0x233)]=_0x3484c7(0x220),yield p['recordEvent']({'eventName':_0x3484c7(0x167),'web_optin_instance_id':_0x2090bb['web_optin_instance_id']}),o(0x1,_0x3484c7(0x243));})),_0x3b4ca5==null||_0x3b4ca5[_0xb10e2a(0x10a)](_0xb10e2a(0x27f),()=>c(this,null,function*(){const _0x41d001=_0xb10e2a;_0x5f328b[_0x41d001(0x148)](),document[_0x41d001(0x149)]['style'][_0x41d001(0x233)]='auto',p[_0x41d001(0x152)]({'eventName':_0x41d001(0x110),'web_optin_instance_id':_0x2090bb[_0x41d001(0x1aa)]}),yield r(this,S,Ke)[_0x41d001(0x22a)](this,_0x2090bb);}));}catch(_0x5b7d12){}},Ke=function(_0x1616da){return c(this,null,function*(){const _0x34e60c=_0x1e9d;try{p['recordEvent']({'eventName':_0x34e60c(0x27e),'name':_0x34e60c(0x14b),'web_optin_instance_id':_0x1616da['web_optin_instance_id']});let _0x472a41=yield Notification[_0x34e60c(0x21a)]();_0x472a41===_0x34e60c(0x18c)?(o(0x1,'User\x20granted\x20the\x20notification\x20permission.'),yield r(this,S,_e)[_0x34e60c(0x22a)](this),yield p['recordEvent']({'eventName':_0x34e60c(0x24a),'name':_0x34e60c(0x144),'web_optin_instance_id':_0x1616da[_0x34e60c(0x1aa)]})):_0x472a41===_0x34e60c(0x16c)?(yield p['recordEvent']({'eventName':_0x34e60c(0x21d)}),o(0x1,_0x34e60c(0x243))):_0x472a41===_0x34e60c(0x226)&&(yield p[_0x34e60c(0x152)]({'eventName':_0x34e60c(0x11f)}),o(0x1,_0x34e60c(0x166)));}catch(_0x129baa){o(0x2,_0x34e60c(0x1fe));}I(f,j,!0x1);});},_e=function(){return c(this,null,function*(){const _0x23dfcc=_0x1e9d;var _0x40ef26,_0x3319f6;let _0x24d209=yield A[_0x23dfcc(0x158)](''+bt);if(_0x24d209['success']){let _0x2e16c3=yield(_0x40ef26=d(f,F))==null?void 0x0:_0x40ef26[_0x23dfcc(0x17d)][_0x23dfcc(0x164)]();_0x2e16c3&&(yield _0x2e16c3[_0x23dfcc(0x295)]());let _0x2ddb23=yield(_0x3319f6=d(f,F))==null?void 0x0:_0x3319f6[_0x23dfcc(0x17d)][_0x23dfcc(0x16e)]({'applicationServerKey':_0x24d209[_0x23dfcc(0x19b)]||'','userVisibleOnly':!0x0});yield A[_0x23dfcc(0x135)](''+St,{'device_id':localStorage[_0x23dfcc(0x194)](_0x23dfcc(0x29d))||'','is_web_push_subscribed':!0x0,'web_push_subscription_page_url':window[_0x23dfcc(0x2aa)][_0x23dfcc(0x2a9)],'web_push_token':{'token':JSON[_0x23dfcc(0x1ca)](JSON[_0x23dfcc(0x16d)](_0x2ddb23))}}),o(0x1,_0x23dfcc(0x1ab));}else throw new Error(_0x23dfcc(0x24e));});},_t=function(_0x1ff049){const _0x3aeda3=_0x5784de;E['storeActionInLocalStorage'](_0x1ff049,_0x3aeda3(0x269),'web_optin_instance_id');},Re=new WeakMap(),Ae=function(_0x3a9dcb){const _0xf729be=_0x5784de;if(d(f,j))return;I(f,j,!0x0);let _0x59d65a=r(this,S,Je)[_0xf729be(0x22a)](this);if(_0x59d65a!=null&&_0x59d65a[_0x3a9dcb])switch(_0x59d65a[_0x3a9dcb][_0xf729be(0x285)]){case _0xf729be(0x266):{r(this,S,At)[_0xf729be(0x22a)](this,_0x59d65a[_0x3a9dcb]);break;}case'IMMEDIATELY':{r(this,S,Ne)[_0xf729be(0x22a)](this,_0x59d65a[_0x3a9dcb]);break;}case _0xf729be(0x14a):{r(this,S,Nt)['call'](this,_0x59d65a[_0x3a9dcb]);break;}default:return;}},Je=function(){const _0x4ec954=_0x5784de;let _0xd17e49=localStorage[_0x4ec954(0x194)](_0x4ec954(0x269));return _0xd17e49?JSON[_0x4ec954(0x1ca)](_0xd17e49):null;},At=function(_0x3b2e8c){const _0x1428e8=_0x5784de;E['showDelayedAction']({'clearActionMethod':d(this,Ee)[_0x1428e8(0x22e)](this),'data':_0x3b2e8c,'displayMethod':r(this,S,Ne)['bind'](this),'idKey':_0x1428e8(0x1aa),'timeValueKey':_0x1428e8(0x26b)});},Ne=function(_0x4c7ac9){const _0x1b450d=_0x5784de;r(this,S,$e)[_0x1b450d(0x22a)](this,_0x4c7ac9);},Ee=new WeakMap(),Nt=function(_0x2d24f1){const _0x17f09a=_0x5784de;E[_0x17f09a(0x247)]({'data':_0x2d24f1,'displayMethod':r(this,S,Ne)[_0x17f09a(0x22e)](this),'timeValueKey':_0x17f09a(0x26b)});},m(f,ie),m(f,F,null),m(f,re,!0x1),m(f,j,!0x1),m(f,ge,!0x1),m(f,me,null);var Ve=f,x=Ve[_0x5784de(0x26a)](),G,w,Rt,ze,Ot,Lt,se,Oe,Ct,Dt,Ut,Le,V=class V{constructor(){const _0x89d2cf=_0x5784de;m(this,w),m(this,se,_0x1f7778=>{const _0x478d25=_0x1e9d;E[_0x478d25(0x122)]({'id':_0x1f7778,'localStorageKey':_0x478d25(0x201)});}),this[_0x89d2cf(0x281)]=()=>{const _0x387528=_0x89d2cf;E['loadActionInLocalStorage']({'actionCondition':_0x52b1f9=>_0x52b1f9[_0x387528(0x1a9)][_0x387528(0xf7)]==='Popup','actionMethod':_0x22c177=>r(this,w,ze)[_0x387528(0x22a)](this,_0x22c177['campaignId']),'localStorageKey':_0x387528(0x201)});},m(this,Le,()=>{const _0x17c037=_0x89d2cf;E['storeActionInLocalStorageInternal'](_0x17c037(0x201));});}static['getInstance'](){var _0x58452c;return d(V,G)||(I(V,G,new V()),r(_0x58452c=d(V,G),w,Rt)['call'](_0x58452c)),d(V,G);}[_0x5784de(0x199)](_0x1d0929){const _0x15c1ca=_0x5784de;let _0x277d33=JSON['parse'](localStorage['getItem'](_0x15c1ca(0x201))||'{}');if(_0x277d33&&_0x277d33[_0x1d0929==null?void 0x0:_0x1d0929[_0x15c1ca(0x12c)]]){o(0x1,_0x15c1ca(0x259));return;}r(this,w,Ut)['call'](this,_0x1d0929),d(this,Le)[_0x15c1ca(0x22a)](this),r(this,w,ze)[_0x15c1ca(0x22a)](this,_0x1d0929[_0x15c1ca(0x12c)]);}[_0x5784de(0x214)](_0x227428){const _0x369f1c=_0x5784de;return _0x227428===_0x369f1c(0x15a);}};G=new WeakMap(),w=new WeakSet(),Rt=function(){return c(this,null,function*(){});},ze=function(_0x26cca2){const _0x5142f4=_0x5784de;let _0x3c3d37=r(this,w,Ot)[_0x5142f4(0x22a)](this);if(document['getElementById'](_0x5142f4(0x1a0)+_0x26cca2)){o(0x1,_0x5142f4(0x143)),d(this,se)[_0x5142f4(0x22a)](this,_0x26cca2);return;}if(_0x3c3d37!=null&&_0x3c3d37[_0x26cca2])switch(_0x3c3d37[_0x26cca2][_0x5142f4(0x1da)]){case'DELAY':{r(this,w,Lt)[_0x5142f4(0x22a)](this,_0x3c3d37[_0x26cca2]);break;}case _0x5142f4(0x116):{r(this,w,Oe)[_0x5142f4(0x22a)](this,_0x3c3d37[_0x26cca2]);break;}case _0x5142f4(0x14a):{r(this,w,Dt)['call'](this,_0x3c3d37[_0x26cca2]);break;}default:return;}},Ot=function(){const _0x1ee211=_0x5784de;let _0x1ea68f=localStorage[_0x1ee211(0x194)](_0x1ee211(0x201));return _0x1ea68f?JSON[_0x1ee211(0x1ca)](_0x1ea68f):null;},Lt=function(_0x502721){const _0x18b83a=_0x5784de;E[_0x18b83a(0x120)]({'clearActionMethod':d(this,se)[_0x18b83a(0x22e)](this),'data':_0x502721,'displayMethod':r(this,w,Oe)[_0x18b83a(0x22e)](this),'idKey':_0x18b83a(0x12c),'timeValueKey':_0x18b83a(0x1a7)});},se=new WeakMap(),Oe=function(_0x57bbe4){const _0x1aefd2=_0x5784de;if(document[_0x1aefd2(0x2a4)]('popup_container_'+_0x57bbe4[_0x1aefd2(0x12c)]))o(0x1,'Popup\x20already\x20displayed');else{let _0x811a77=r(this,w,Ct)[_0x1aefd2(0x22a)](this,_0x1aefd2(0x147),_0x57bbe4);document['body']['appendChild'](_0x811a77),p[_0x1aefd2(0x152)]({'campaignCustomerInstanceId':_0x57bbe4[_0x1aefd2(0x209)],'campaignId':_0x57bbe4['campaignId'],'eventName':ne,'eventProperties':[{'eventProperty':_0x1aefd2(0x219),'value':JSON[_0x1aefd2(0x16d)]({'campaignId':_0x57bbe4[_0x1aefd2(0x12c)]})}],'name':'view'});}d(this,se)[_0x1aefd2(0x22a)](this,_0x57bbe4[_0x1aefd2(0x12c)]);},Ct=function(_0x51ac0a,_0x34e327){const _0x4a3750=_0x5784de;let {campaignCustomerInstanceId:_0x32db11,campaignId:_0x2dce6f,message:{design:_0xcd60c4}}=_0x34e327,_0x442869=document[_0x4a3750(0x298)](_0x51ac0a);_0x442869['id']=_0x4a3750(0x1a0)+_0x2dce6f,_0x442869['innerHTML']=_0xcd60c4,_0x442869[_0x4a3750(0x1a6)][_0x4a3750(0x14c)]=_0x4a3750(0x280),_0x442869[_0x4a3750(0x1a6)]['top']='0',_0x442869[_0x4a3750(0x1a6)][_0x4a3750(0x17f)]='0',_0x442869['style'][_0x4a3750(0x292)]=_0x4a3750(0x24d),_0x442869['style'][_0x4a3750(0x1bc)]=_0x4a3750(0x24d),_0x442869[_0x4a3750(0x1a6)][_0x4a3750(0x1bb)]='99999999';let _0x432172=_0x442869['querySelector']('.u-popup-container');_0x432172&&(_0x432172[_0x4a3750(0x1a6)][_0x4a3750(0x1bb)]='50');let _0x1d45c9=_0x432172[_0x4a3750(0x211)](_0x4a3750(0x1b9));_0x1d45c9&&(o(0x1,_0x4a3750(0x29b)),_0x1d45c9[_0x4a3750(0x1a6)][_0x4a3750(0x142)]('display','block',_0x4a3750(0xf9))),_0x442869['querySelectorAll'](_0x4a3750(0x24c))[_0x4a3750(0x215)](_0x1d556d=>{const _0x5f0b74=_0x4a3750;let _0x173392=_0x1d556d['querySelector'](_0x5f0b74(0x27d));_0x173392&&_0x173392[_0x5f0b74(0x10a)](_0x5f0b74(0x173),()=>c(this,null,function*(){const _0x405eab=_0x5f0b74;_0x442869['remove']();let _0x1dbb36=new FormData(_0x173392),_0x2dcc4e={};for(let [_0x1671e8,_0x115df5]of _0x1dbb36[_0x405eab(0x124)]())_0x2dcc4e[_0x1671e8]=_0x115df5;yield p[_0x405eab(0x152)]({'campaignCustomerInstanceId':_0x32db11,'campaignId':_0x2dce6f,'eventName':ne,'eventProperties':[{'eventProperty':'Form\x20Submit','value':JSON['stringify']({'campaignId':_0x2dce6f,'formId':_0x1d556d['id'],'formValues':_0x2dcc4e})},{'eventProperty':_0x405eab(0x196),'value':_0x2dce6f[_0x405eab(0x1e0)]()}],'name':'form'});}));});let _0x2f70cc=_0x442869[_0x4a3750(0x211)](_0x4a3750(0x1b0));return(_0x2f70cc==null?void 0x0:_0x2f70cc[_0x4a3750(0x294)](_0x4a3750(0x103)))==='#'&&_0x2f70cc[_0x4a3750(0x263)](_0x4a3750(0x103)),_0x2f70cc==null||_0x2f70cc[_0x4a3750(0x10a)](_0x4a3750(0x27f),()=>c(this,null,function*(){const _0xca4e81=_0x4a3750;_0x442869[_0xca4e81(0x148)](),yield p['recordEvent']({'campaignCustomerInstanceId':_0x32db11,'campaignId':_0x2dce6f,'eventName':ne,'eventProperties':[{'eventProperty':_0xca4e81(0x1db),'value':JSON[_0xca4e81(0x16d)]({'campaignId':_0x2dce6f})}],'name':'close'});})),_0x442869[_0x4a3750(0x189)](_0x4a3750(0x222))[_0x4a3750(0x215)](_0x284126=>{const _0x1bb207=_0x4a3750;_0x284126['addEventListener'](_0x1bb207(0x27f),()=>c(this,null,function*(){const _0x425e8e=_0x1bb207;_0x442869['remove'](),yield p[_0x425e8e(0x152)]({'campaignCustomerInstanceId':_0x32db11,'campaignId':_0x2dce6f,'eventName':ne,'eventProperties':[{'eventProperty':_0x425e8e(0x18a),'value':JSON[_0x425e8e(0x16d)]({'buttonId':_0x284126['id'],'campaignId':_0x2dce6f})}],'name':'click'});}));}),_0x442869[_0x4a3750(0x189)](_0x4a3750(0x23a))[_0x4a3750(0x215)](_0x55230c=>{const _0x5c2f5b=_0x4a3750;_0x55230c[_0x5c2f5b(0x10a)](_0x5c2f5b(0x27f),()=>c(this,null,function*(){const _0x4eff03=_0x5c2f5b;_0x442869['remove'](),yield p[_0x4eff03(0x152)]({'campaignCustomerInstanceId':_0x32db11,'campaignId':_0x2dce6f,'eventName':ne,'eventProperties':[{'eventProperty':_0x4eff03(0x1ad),'value':JSON[_0x4eff03(0x16d)]({'campaignId':_0x2dce6f,'imageClassName':_0x55230c[_0x4eff03(0x206)],'imageId':_0x55230c['id']})}],'name':_0x4eff03(0x27f)});}));}),_0x442869;},Dt=function(_0x12a903){const _0x1361f4=_0x5784de;E[_0x1361f4(0x247)]({'data':_0x12a903,'displayMethod':r(this,w,Oe)[_0x1361f4(0x22e)](this),'timeValueKey':_0x1361f4(0x1a7)});},Ut=function(_0x166bb6){const _0x3a5224=_0x5784de;E['storeActionInLocalStorage'](_0x166bb6,_0x3a5224(0x201),_0x3a5224(0x12c));},Le=new WeakMap(),m(V,G);function _0x1e9d(_0x5f498b,_0x24685a){const _0xcb74f6=_0xcb74();return _0x1e9d=function(_0x1e9d13,_0x47bc2a){_0x1e9d13=_0x1e9d13-0xf6;let _0x3bc19f=_0xcb74f6[_0x1e9d13];return _0x3bc19f;},_0x1e9d(_0x5f498b,_0x24685a);}var He=V,$=He['getInstance'](),Y,R,xt,Ce,Wt,kt,Bt,Ft,K=class K{constructor(){const _0xfb1054=_0x5784de;m(this,R),this['queue']=Promise[_0xfb1054(0x251)]();}static['getInstance'](){const _0x537dea=_0x5784de;var _0xb1cd8f;return d(K,Y)||(I(K,Y,new K()),r(_0xb1cd8f=d(K,Y),R,xt)[_0x537dea(0x22a)](_0xb1cd8f)),d(K,Y);}[_0x5784de(0x131)](_0x3b3eb4){const _0x5bc46b=_0x5784de;let _0x5b51d1=JSON[_0x5bc46b(0x1ca)](localStorage[_0x5bc46b(0x194)]('preInitializedEvents')||'[]');_0x5b51d1[_0x5bc46b(0x1f3)](_0x3b3eb4),localStorage[_0x5bc46b(0x287)](_0x5bc46b(0x1d1),JSON['stringify'](_0x5b51d1));}[_0x5784de(0x1cd)](){return c(this,null,function*(){const _0x46f2a8=_0x1e9d;let _0x9f2d89=JSON[_0x46f2a8(0x1ca)](localStorage[_0x46f2a8(0x194)](_0x46f2a8(0x1d1))||'[]');if(Array[_0x46f2a8(0x127)](_0x9f2d89)){for(let _0x397ada of _0x9f2d89)yield this['recordEventPreInitialized'](_0x397ada);}});}[_0x5784de(0x152)](_0x5bb304,_0x4ab406){return c(this,null,function*(){const _0x86b27=_0x1e9d;g[_0x86b27(0x1ff)]&&!g[_0x86b27(0x150)]?yield r(this,R,Ce)[_0x86b27(0x22a)](this,_0x5bb304,_0x4ab406):this[_0x86b27(0x131)](_0x5bb304);});}[_0x5784de(0x213)](_0x133fcd){return c(this,null,function*(){const _0x5bb839=_0x1e9d;try{yield r(this,R,Ce)[_0x5bb839(0x22a)](this,_0x133fcd);}finally{r(this,R,Ft)[_0x5bb839(0x22a)](this,_0x133fcd['eventName']);}});}[_0x5784de(0x1cf)](_0x45b916){return c(this,null,function*(){const _0x298754=_0x1e9d;g['debugLevel']===0x4&&(!g[_0x298754(0x2ac)]||g[_0x298754(0x2ac)][_0x45b916[_0x298754(0x245)]])&&(yield r(this,R,Ce)[_0x298754(0x22a)](this,_0x45b916));});}[_0x5784de(0x2ad)](){const _0x18cead=_0x5784de;let _0x1d5f3b=localStorage[_0x18cead(0x194)](_0x18cead(0x212));return _0x1d5f3b?JSON[_0x18cead(0x1ca)](_0x1d5f3b):{};}[_0x5784de(0x200)](){return c(this,null,function*(){const _0x5ae68b=_0x1e9d;if(!localStorage[_0x5ae68b(0x194)]('events')){let _0x3a3083=(yield this[_0x5ae68b(0x293)]())[_0x5ae68b(0x19b)];if(_0x3a3083){localStorage[_0x5ae68b(0x287)](_0x5ae68b(0x212),JSON[_0x5ae68b(0x16d)](_0x3a3083));try{x[_0x5ae68b(0x134)]({'events':_0x3a3083});}catch(_0x2eb937){}}}});}[_0x5784de(0x293)](){return c(this,null,function*(){const _0x1d33c3=_0x1e9d;try{return yield A[_0x1d33c3(0x158)](''+Be);}catch(_0x5569d4){throw new Error(_0x1d33c3(0x163));}});}[_0x5784de(0x275)](_0x30c64f,_0x41a4ba){return c(this,null,function*(){const _0xcbd7e9=_0x1e9d;let _0x5ed908=null,_0x4a85a9=null,_0x4904ef=new AbortController();return this[_0xcbd7e9(0x1dd)]=this[_0xcbd7e9(0x1dd)][_0xcbd7e9(0x1ed)](()=>c(this,null,function*(){const _0x3ddfd3=_0xcbd7e9;try{if(_0x30c64f[_0x3ddfd3(0x212)][_0x3ddfd3(0x1ee)]===0x0)throw new Error(_0x3ddfd3(0x15f));let _0x15e9f4=yield A['post'](_0x3ddfd3(0x29e)+Be+vt,_0x30c64f,_0x4904ef[_0x3ddfd3(0x29c)]);if(_0x15e9f4[_0x3ddfd3(0x2ab)])return _0x4a85a9=_0x15e9f4,_0x15e9f4;if(_0x15e9f4['message']===_0x3ddfd3(0x19f)+localStorage[_0x3ddfd3(0x194)](_0x3ddfd3(0x179))+_0x3ddfd3(0x21c))throw localStorage['removeItem'](_0x3ddfd3(0x179)),new Error(_0x3ddfd3(0xff));}catch(_0x36a496){throw o(0x2,_0x3ddfd3(0x180)),o(0x2,'name:\x20'+_0x36a496[_0x3ddfd3(0xf7)]),o(0x2,_0x3ddfd3(0x136)+_0x36a496[_0x3ddfd3(0x1a9)]),(_0x36a496[_0x3ddfd3(0xf7)]==='AbortError'||_0x36a496[_0x3ddfd3(0xf7)]==='TypeError'&&_0x36a496['message']===_0x3ddfd3(0x10c))&&(o(0x2,_0x3ddfd3(0x20d)),_0x41a4ba&&r(this,R,Bt)[_0x3ddfd3(0x22a)](this,_0x41a4ba)),_0x5ed908=new Error(_0x3ddfd3(0x1ea)),_0x36a496;}return null;}))['catch'](()=>{}),this[_0xcbd7e9(0x1dd)][_0xcbd7e9(0x1ed)](()=>{if(_0x5ed908)throw _0x5ed908;return _0x4a85a9;});});}};Y=new WeakMap(),R=new WeakSet(),xt=function(){return c(this,null,function*(){});},Ce=function(_0x5ef8fd,_0x43016e){return c(this,null,function*(){const _0xac9209=_0x1e9d;yield N(_0xac9209(0x1e5),()=>c(this,null,function*(){const _0x24c507=_0xac9209;var _0x4ae135,_0x74d02f,_0x16cf50,_0x16b17b;let {campaignCustomerInstanceId:_0x5cdac9,campaignId:_0x279896,eventName:_0x3afd85,eventProperties:_0x5c5bcb,name:_0x3d59bd,web_optin_instance_id:_0x278f65}=_0x5ef8fd;o(0x1,'#\x20Recording\x20event'),C(_0x24c507(0x2a7),!0x0),L(_0x24c507(0x19e),!0x0),o(0x1,_0x24c507(0x17c)),o(0x1,{'campaignCustomerInstanceId':_0x5cdac9,'eventName':_0x3afd85,'eventProperties':_0x5c5bcb,'name':_0x3d59bd,'web_optin_instance_id':_0x278f65});let _0x72f846=E['getPlatform']();if(_0x72f846===_0x24c507(0x254)||_0x72f846===_0x24c507(0x162))throw new Error('Invalid\x20platform');_0x3afd85!==_0x24c507(0x2ae)&&(yield E[_0x24c507(0x15e)]());let _0xe1d717=[];_0x5c5bcb&&_0xe1d717[_0x24c507(0x1f3)](..._0x5c5bcb),_0xe1d717[_0x24c507(0x1f3)]({'eventProperty':_0x24c507(0x109),'value':_0x72f846}),_0xe1d717[_0x24c507(0x1f3)]({'eventProperty':_0x24c507(0x207),'value':E['getOperatingSystem']()}),_0xe1d717[_0x24c507(0x1f3)]({'eventProperty':_0x24c507(0x236),'value':E[_0x24c507(0x1fc)]()});let _0x2e8ef4=this[_0x24c507(0x2ad)](),_0x48683a=r(this,R,Wt)[_0x24c507(0x22a)](this,_0x2e8ef4,_0x3afd85,_0xe1d717);if(typeof _0x48683a==_0x24c507(0x23d)){o(0x2,_0x48683a);return;}E[_0x24c507(0x1b6)]();let {id:_0x5d4fe9}=_0x2e8ef4[_0x3afd85],_0x25d926=r(this,R,kt)[_0x24c507(0x22a)](this,z(Te(z(z(z({},_0x5cdac9?{'campaignCustomerInstanceId':_0x5cdac9}:{}),_0x279896?{'campaignId':_0x279896}:{}),_0x278f65?{'web_optin_instance_id':_0x278f65}:{}),{'eventId':_0x5d4fe9,'eventProperties':_0x48683a,'sessionId':localStorage[_0x24c507(0x194)](_0x24c507(0x225))||''}),_0x3d59bd?{'name':_0x3d59bd}:{}));if(g['offline']){let _0xe80aa2=JSON[_0x24c507(0x1ca)](localStorage[_0x24c507(0x194)](_0x24c507(0x19a))||'[]');_0xe80aa2[_0x24c507(0x1ee)]<=0x32&&(_0xe80aa2['push'](..._0x25d926[_0x24c507(0x212)]),localStorage[_0x24c507(0x287)](_0x24c507(0x19a),JSON['stringify'](_0xe80aa2)));return;}let _0x2830ef=yield this[_0x24c507(0x275)](_0x25d926,_0x5ef8fd);(_0x4ae135=_0x2830ef==null?void 0x0:_0x2830ef[_0x24c507(0x19b)])!=null&&_0x4ae135['optIn']?(yield this[_0x24c507(0x1cf)]({'eventName':_0x24c507(0x237)}),x[_0x24c507(0x239)](_0x2830ef[_0x24c507(0x19b)]['optIn'])):_0x3afd85==='Viewed\x20Webpage'&&(yield this[_0x24c507(0x1cf)]({'eventName':_0x24c507(0x18b),'eventProperties':[{'eventProperty':_0x24c507(0x1a9),'value':''+('Notification'in window&&typeof((_0x74d02f=window==null?void 0x0:window[_0x24c507(0x1f8)])==null?void 0x0:_0x74d02f['permission'])!=_0x24c507(0x1cc))}]})),(_0x16b17b=(_0x16cf50=_0x2830ef==null?void 0x0:_0x2830ef[_0x24c507(0x19b)])==null?void 0x0:_0x16cf50[_0x24c507(0x217)])==null||_0x16b17b[_0x24c507(0x215)](_0x5ef4fd=>{const _0x4652a1=_0x24c507;$[_0x4652a1(0x214)](_0x5ef4fd[_0x4652a1(0x1a9)][_0x4652a1(0xf7)])?$[_0x4652a1(0x199)](_0x5ef4fd):ae[_0x4652a1(0x24b)](_0x5ef4fd[_0x4652a1(0x1a9)][_0x4652a1(0xf7)])&&ae['showContentCard'](_0x5ef4fd);}),L(_0x24c507(0x19e),!0x1),C(_0x24c507(0x2a7),!0x1);}),_0x1f6d36=>{const _0x14c19b=_0xac9209;this[_0x14c19b(0x152)]({'eventName':_0x14c19b(0x216),'eventProperties':[{'eventProperty':_0x14c19b(0x1a9),'value':_0x14c19b(0x1c3)+_0x1f6d36['message']}]},!0x0);},_0x43016e);});},Wt=function(_0x336fb6,_0x697c64,_0x107d74){const _0x4900ea=_0x5784de;if(!Object['prototype']['hasOwnProperty'][_0x4900ea(0x22a)](_0x336fb6,_0x697c64))return'Event\x20'+_0x697c64+_0x4900ea(0x279);if(!_0x107d74)return[];let _0x42056c=_0x336fb6[_0x697c64];if(!(_0x42056c!=null&&_0x42056c[_0x4900ea(0x2a6)]))return _0x4900ea(0x172)+_0x697c64+_0x4900ea(0x235);let _0x5f3a4d=_0x107d74['filter'](({eventProperty:_0x5e16e0})=>!Object[_0x4900ea(0x271)][_0x4900ea(0x183)][_0x4900ea(0x22a)](_0x42056c[_0x4900ea(0x2a6)],_0x5e16e0))[_0x4900ea(0x186)](({eventProperty:_0x3a8353})=>_0x3a8353);return _0x5f3a4d['length']>0x0?_0x4900ea(0x172)+_0x697c64+_0x4900ea(0x192)+_0x5f3a4d[_0x4900ea(0x1bd)](',\x20')+'.':_0x107d74[_0x4900ea(0x186)](({eventProperty:_0x1aeb7a,value:_0x508694})=>({'eventPropertyId':_0x42056c[_0x4900ea(0x2a6)][_0x1aeb7a]['id'],'value':_0x508694}));},kt=function(_0x302698){const _0xf28eae=_0x5784de;return{'customerId':localStorage[_0xf28eae(0x194)](_0xf28eae(0x179))||'','deviceId':localStorage[_0xf28eae(0x194)](_0xf28eae(0x29d))||'','events':[_0x302698]};},Bt=function(_0x266733){const _0x19ee03=_0x5784de;o(0x1,_0x19ee03(0x11b)),o(0x1,_0x266733);let _0x4a4c32=localStorage['getItem'](_0x19ee03(0x1d1));_0x4a4c32&&_0x4a4c32!==_0x19ee03(0x1cc)?(_0x4a4c32=JSON[_0x19ee03(0x1ca)](_0x4a4c32),_0x4a4c32[_0x19ee03(0x1f3)](_0x266733)):_0x4a4c32=[_0x266733],localStorage['setItem'](_0x19ee03(0x1d1),JSON[_0x19ee03(0x16d)](_0x4a4c32));},Ft=function(_0x4d22de){const _0x59a5db=_0x5784de;let _0x4707b7=JSON[_0x59a5db(0x1ca)](localStorage[_0x59a5db(0x194)](_0x59a5db(0x1d1))||'[]'),_0x2ca6b0=_0x4707b7[_0x59a5db(0x276)](_0x2a2a6b=>_0x2a2a6b['eventName']===_0x4d22de);_0x2ca6b0>=0x0&&_0x4707b7[_0x59a5db(0x1c0)](_0x2ca6b0,0x1),localStorage[_0x59a5db(0x287)](_0x59a5db(0x1d1),JSON[_0x59a5db(0x16d)](_0x4707b7));},m(K,Y);var je=K,p=je[_0x5784de(0x26a)](),q,T,Mt,Ye,Vt,$t,ce,De,Kt,Jt,Ht,Ue,J=class J{constructor(){const _0x3bc338=_0x5784de;m(this,T),m(this,ce,_0x229007=>{const _0x58fb70=_0x1e9d;E[_0x58fb70(0x122)]({'id':_0x229007,'localStorageKey':_0x58fb70(0x201)});}),this[_0x3bc338(0x115)]=()=>{const _0x5df853=_0x3bc338;E['loadActionInLocalStorage']({'actionCondition':_0x262290=>_0x262290[_0x5df853(0x1a9)][_0x5df853(0xf7)]===_0x5df853(0x130),'actionMethod':_0x3e1137=>r(this,T,Ye)[_0x5df853(0x22a)](this,_0x3e1137[_0x5df853(0x12c)]),'localStorageKey':_0x5df853(0x201)});},m(this,Ue,()=>{E['storeActionInLocalStorageInternal']('action');});}static[_0x5784de(0x26a)](){var _0x55dcc7;return d(J,q)||(I(J,q,new J()),r(_0x55dcc7=d(J,q),T,Mt)['call'](_0x55dcc7)),d(J,q);}[_0x5784de(0x1df)](_0x55062c){const _0x4a47db=_0x5784de;let _0x2db1b4=JSON[_0x4a47db(0x1ca)](localStorage['getItem'](_0x4a47db(0x201))||'{}');if(_0x2db1b4&&_0x2db1b4[_0x55062c==null?void 0x0:_0x55062c[_0x4a47db(0x12c)]]){o(0x1,'ContentCard\x20already\x20in\x20cache');return;}r(this,T,Ht)[_0x4a47db(0x22a)](this,_0x55062c),d(this,Ue)[_0x4a47db(0x22a)](this),r(this,T,Ye)[_0x4a47db(0x22a)](this,_0x55062c[_0x4a47db(0x12c)]);}[_0x5784de(0x24b)](_0x2e6f8c){const _0x11a291=_0x5784de;return _0x2e6f8c===_0x11a291(0x101);}};q=new WeakMap(),T=new WeakSet(),Mt=function(){return c(this,null,function*(){});},Ye=function(_0x19b5f2){const _0xdd0c84=_0x5784de;let _0x42d203=r(this,T,Vt)[_0xdd0c84(0x22a)](this);if(document[_0xdd0c84(0x2a4)]('contentCard_container_'+_0x19b5f2)){o(0x1,_0xdd0c84(0x105)),d(this,ce)[_0xdd0c84(0x22a)](this,_0x19b5f2);return;}if(_0x42d203!=null&&_0x42d203[_0x19b5f2])switch(_0x42d203[_0x19b5f2][_0xdd0c84(0x1da)]){case _0xdd0c84(0x266):{r(this,T,$t)[_0xdd0c84(0x22a)](this,_0x42d203[_0x19b5f2]);break;}case _0xdd0c84(0x116):{r(this,T,De)[_0xdd0c84(0x22a)](this,_0x42d203[_0x19b5f2]);break;}case'SCROLL':{r(this,T,Jt)[_0xdd0c84(0x22a)](this,_0x42d203[_0x19b5f2]);break;}default:return;}},Vt=function(){const _0x58f709=_0x5784de;let _0xaed862=localStorage['getItem'](_0x58f709(0x201));return _0xaed862?JSON[_0x58f709(0x1ca)](_0xaed862):null;},$t=function(_0x58ae1a){const _0x52ea8a=_0x5784de;E['showDelayedAction']({'clearActionMethod':d(this,ce)[_0x52ea8a(0x22e)](this),'data':_0x58ae1a,'displayMethod':r(this,T,De)[_0x52ea8a(0x22e)](this),'idKey':_0x52ea8a(0x12c),'timeValueKey':_0x52ea8a(0x1a7)});},ce=new WeakMap(),De=function(_0xf174d3){const _0x4ac393=_0x5784de;var _0x3710e3;if(document['getElementById'](_0x4ac393(0x27a)+_0xf174d3[_0x4ac393(0x12c)]))o(0x1,_0x4ac393(0x105));else{let _0x229caf=r(this,T,Kt)[_0x4ac393(0x22a)](this,'div',_0xf174d3),_0xc6d01d=document['querySelector']('#'+_0xf174d3[_0x4ac393(0x1a9)]['divId']);_0xc6d01d&&(_0xc6d01d[_0x4ac393(0x151)]=_0x229caf[_0x4ac393(0x286)],p[_0x4ac393(0x152)]({'campaignCustomerInstanceId':_0xf174d3['campaignCustomerInstanceId'],'campaignId':_0xf174d3[_0x4ac393(0x12c)],'eventName':Me,'eventProperties':[{'eventProperty':_0x4ac393(0x153),'value':JSON['stringify']({'campaignId':_0xf174d3['campaignId']})}],'name':_0x4ac393(0x19c)}),(_0x3710e3=document[_0x4ac393(0x2a4)](_0x4ac393(0x27a)+_0xf174d3[_0x4ac393(0x12c)]))==null||_0x3710e3[_0x4ac393(0x10a)](_0x4ac393(0x27f),()=>{const _0x16de71=_0x4ac393;p['recordEvent']({'campaignCustomerInstanceId':_0xf174d3[_0x16de71(0x209)],'campaignId':_0xf174d3[_0x16de71(0x12c)],'eventName':Me,'eventProperties':[{'eventProperty':_0x16de71(0x299),'value':JSON[_0x16de71(0x16d)]({'campaignId':_0xf174d3[_0x16de71(0x12c)]})}],'name':_0x16de71(0x27f)});}));}d(this,ce)[_0x4ac393(0x22a)](this,_0xf174d3[_0x4ac393(0x12c)]);},Kt=function(_0x535914,_0x51dd78){const _0x5b430d=_0x5784de;var _0x138b38;let {campaignId:_0x498b83,message:{design:_0xaf20eb}}=_0x51dd78,_0x2b2839=document[_0x5b430d(0x298)](_0x535914);return _0x2b2839['id']=_0x5b430d(0x27a)+_0x498b83,_0x2b2839[_0x5b430d(0x151)]=_0xaf20eb,(_0x138b38=_0x2b2839[_0x5b430d(0x211)]('.u-close-button'))==null||_0x138b38[_0x5b430d(0x148)](),_0x2b2839;},Jt=function(_0x564d84){const _0x366cae=_0x5784de;E[_0x366cae(0x247)]({'data':_0x564d84,'displayMethod':r(this,T,De)[_0x366cae(0x22e)](this),'timeValueKey':_0x366cae(0x1a7)});},Ht=function(_0xd2d2bf){const _0x412e04=_0x5784de;E[_0x412e04(0x128)](_0xd2d2bf,_0x412e04(0x201),_0x412e04(0x12c));},Ue=new WeakMap(),m(J,q);var Ge=J,ae=Ge[_0x5784de(0x26a)](),le,Ie,Se,fe,be,he,ye,xe,u,jt,Gt,Yt,ve,Qe,Ze,Xe,et,qt,Qt,Zt,Xt,en,tn,nn,tt,nt,rn,on,Q=class Q{constructor(){const _0x1761ec=_0x5784de;m(this,u),m(this,Ie),m(this,Se),m(this,fe),m(this,be,null),m(this,he,null),m(this,ye,!0x1),m(this,xe,()=>{setInterval(()=>{const _0x5e11d3=_0x1e9d;let _0xd1d00f=localStorage[_0x5e11d3(0x194)]('mergn_shopify');if(_0xd1d00f!==d(this,he)){I(this,he,_0xd1d00f);let _0x268b34=JSON['parse'](_0xd1d00f||'{}');if(_0x268b34!=null&&_0x268b34[_0x5e11d3(0x134)]){let _0x358bfe=_0x268b34[_0x5e11d3(0x134)];delete _0x268b34[_0x5e11d3(0x134)],localStorage[_0x5e11d3(0x287)]('mergn_shopify',JSON[_0x5e11d3(0x16d)](_0x268b34)),x[_0x5e11d3(0x134)](_0x358bfe);}if(_0x268b34!=null&&_0x268b34[_0x5e11d3(0x291)]){let _0x5b4790=_0x268b34[_0x5e11d3(0x291)];delete _0x268b34[_0x5e11d3(0x291)],localStorage['setItem'](_0x5e11d3(0x28c),JSON[_0x5e11d3(0x16d)](_0x268b34)),x[_0x5e11d3(0x239)](_0x5b4790);}if(_0x268b34!=null&&_0x268b34['campaigns']){let _0x28fb19=_0x268b34[_0x5e11d3(0x217)];delete _0x268b34[_0x5e11d3(0x217)],localStorage[_0x5e11d3(0x287)](_0x5e11d3(0x28c),JSON[_0x5e11d3(0x16d)](_0x268b34)),_0x28fb19[_0x5e11d3(0x215)](_0xb7b3a6=>{const _0x525f2a=_0x5e11d3;$[_0x525f2a(0x214)](_0xb7b3a6[_0x525f2a(0x1a9)][_0x525f2a(0xf7)])?$[_0x525f2a(0x199)](_0xb7b3a6):ae[_0x525f2a(0x24b)](_0xb7b3a6[_0x525f2a(0x1a9)][_0x525f2a(0xf7)])&&ae['showContentCard'](_0xb7b3a6);});}}},0x3e8);}),this[_0x1761ec(0x253)]=_0x366917=>{let _0x47aa7a=()=>{const _0x14480c=_0x1e9d;let _0x4c5cd7=JSON[_0x14480c(0x1ca)](localStorage[_0x14480c(0x194)](_0x366917)||'{}');Object['keys'](_0x4c5cd7)[_0x14480c(0x215)](_0x5e67aa=>{const _0x2fb0c5=_0x14480c;_0x4c5cd7[_0x5e67aa][_0x2fb0c5(0x198)]=new Date()[_0x2fb0c5(0x202)]();}),localStorage[_0x14480c(0x287)](_0x366917,JSON[_0x14480c(0x16d)](_0x4c5cd7));};_0x47aa7a(),window['addEventListener']('beforeunload',_0x47aa7a);},this[_0x1761ec(0x122)]=({id:_0x328bfc,localStorageKey:_0x58d785})=>{const _0x4d5b95=_0x1761ec;let _0x3af2a0=JSON[_0x4d5b95(0x1ca)](localStorage[_0x4d5b95(0x194)](_0x58d785)||'{}');_0x3af2a0[_0x328bfc]&&delete _0x3af2a0[_0x328bfc],localStorage[_0x4d5b95(0x287)](_0x58d785,JSON[_0x4d5b95(0x16d)](_0x3af2a0));},this[_0x1761ec(0x1ac)]=({actionCondition:_0xdedc09,actionMethod:_0x2da29c,localStorageKey:_0x54ed5b})=>{const _0x46d5ba=_0x1761ec;let _0x3dceee=JSON[_0x46d5ba(0x1ca)](localStorage[_0x46d5ba(0x194)](_0x54ed5b)||'{}');Object[_0x46d5ba(0x178)](_0x3dceee)['forEach'](_0x41f3cb=>{_0xdedc09(_0x3dceee[_0x41f3cb])&&_0x2da29c(_0x3dceee[_0x41f3cb]);});};}static['getInstance'](){return d(Q,le)||I(Q,le,new Q()),d(Q,le);}[_0x5784de(0x111)](_0x36528b,_0x2d34bc){return c(this,null,function*(){const _0x39c59f=_0x1e9d;o(0x1,_0x39c59f(0x26f)),_0x2d34bc!=null&&_0x2d34bc[_0x39c59f(0x1bf)]&&I(this,ye,!0x0),r(this,u,jt)[_0x39c59f(0x22a)](this,_0x36528b);let _0x3e8b38=this[_0x39c59f(0x27b)]();if(_0x3e8b38===_0x39c59f(0x254)||_0x3e8b38===_0x39c59f(0x162)){o(0x2,_0x39c59f(0x1c6));return;}if(yield A[_0x39c59f(0x1c9)](),o(0x1,_0x39c59f(0x1ba)),yield r(this,u,tt)[_0x39c59f(0x22a)](this),_0x2d34bc!=null&&_0x2d34bc[_0x39c59f(0x1bf)]&&d(this,xe)[_0x39c59f(0x22a)](this),_0x2d34bc!=null&&_0x2d34bc[_0x39c59f(0x169)])try{g['loading']=!0x0,yield this[_0x39c59f(0x132)](_0x2d34bc[_0x39c59f(0x169)]);}finally{g[_0x39c59f(0x150)]=!0x1;}setInterval(()=>c(this,null,function*(){const _0x7768ed=_0x39c59f;o(0x1,_0x7768ed(0x145)),yield r(this,u,tt)[_0x7768ed(0x22a)](this);}),0x493e0);let _0x42623d=r(this,u,ve)['call'](this);if(yield this[_0x39c59f(0x15e)](),yield p[_0x39c59f(0x1cd)](),p[_0x39c59f(0x1cf)]({'eventName':'base_init'}),o(0x1,'Initializing\x20notification\x20service\x20from\x20Base\x20Service'),yield N(_0x39c59f(0x137),()=>c(this,null,function*(){const _0x42ffa5=_0x39c59f;yield x[_0x42ffa5(0x111)](_0x42623d,_0x2d34bc==null?void 0x0:_0x2d34bc[_0x42ffa5(0x296)]);})),!(_0x2d34bc!=null&&_0x2d34bc['shopify'])){yield r(this,u,on)[_0x39c59f(0x22a)](this);let _0x4381ff=history[_0x39c59f(0x13d)];history[_0x39c59f(0x13d)]=(..._0x47f8cb)=>{const _0x566903=_0x39c59f;_0x4381ff[_0x566903(0x203)](history,_0x47f8cb),r(this,u,rn)[_0x566903(0x22a)](this);};}o(0x1,_0x39c59f(0x1d4));});}[_0x5784de(0x1ce)](_0x17c612){I(this,Ie,_0x17c612);}[_0x5784de(0x20c)](_0x2fb966){I(this,Se,_0x2fb966);}[_0x5784de(0x177)](_0x24d6d6){I(this,fe,_0x24d6d6);}[_0x5784de(0x1af)](_0x38cded){I(this,be,_0x38cded);}[_0x5784de(0x256)](){return d(this,be);}[_0x5784de(0x27b)](){return d(this,Ie);}[_0x5784de(0x1fc)](){return d(this,Se);}[_0x5784de(0x125)](){return d(this,fe);}['updateSessionCreated'](){const _0x5464a7=_0x5784de;localStorage[_0x5464a7(0x287)](_0x5464a7(0x118),''+new Date()['getTime']());}[_0x5784de(0x247)]({data:_0xc80238,displayMethod:_0x37a3a3,timeValueKey:_0x514de3}){const _0x2551a1=_0x5784de;let _0x2f270b=()=>{const _0x414f53=_0x1e9d;var _0x20a3bf;let _0x4df402=window['innerHeight'],_0x14b723=document[_0x414f53(0x141)][_0x414f53(0x265)];window['scrollY']/(_0x14b723-_0x4df402)*0x64>(((_0x20a3bf=_0xc80238[_0x514de3])==null?void 0x0:_0x20a3bf[_0x414f53(0x1de)])||0x0)&&(window[_0x414f53(0x1b7)](_0x414f53(0x170),_0x2f270b),_0x37a3a3(_0xc80238));};window[_0x2551a1(0x10a)](_0x2551a1(0x170),_0x2f270b);}[_0x5784de(0x120)]({clearActionMethod:_0x4c5de3,data:_0x49dd99,displayMethod:_0x27da5d,idKey:_0x1b52f0,timeValueKey:_0x1477c6}){const _0x26118e=_0x5784de;var _0x395917,_0x32c79a,_0x448430;let _0x27e216=(_0x395917=_0x49dd99[_0x1477c6])==null?void 0x0:_0x395917[_0x26118e(0x1de)];((_0x32c79a=_0x49dd99[_0x1477c6])==null?void 0x0:_0x32c79a[_0x26118e(0x112)])==='min'&&(_0x27e216=_0x27e216*0x3c);let _0x222a91=_0x49dd99[_0x26118e(0x198)]-0x1f4+(_0x27e216||0x0)*0x3e8-new Date()[_0x26118e(0x202)]();o(0x1,_0x26118e(0x12e)+_0x49dd99[_0x26118e(0x198)]),o(0x1,'Time\x20value:\x20'+((_0x448430=_0x49dd99[_0x1477c6])==null?void 0x0:_0x448430[_0x26118e(0x1de)])),o(0x1,_0x26118e(0x15b)+new Date()[_0x26118e(0x202)]()),o(0x1,_0x26118e(0x264)+_0x222a91),_0x222a91>0x0?setTimeout(()=>{_0x4c5de3(_0x49dd99[_0x1b52f0]),_0x27da5d(_0x49dd99);},_0x222a91):(_0x4c5de3(_0x49dd99[_0x1b52f0]),_0x27da5d(_0x49dd99));}[_0x5784de(0x128)](_0x53011b,_0xc5cf49,_0x433d52){const _0x18a385=_0x5784de;var _0x4c5faf;let _0x1cb805=JSON[_0x18a385(0x1ca)](localStorage[_0x18a385(0x194)](_0xc5cf49)||'{}'),_0x57629f=(_0x4c5faf=_0x433d52 in _0x53011b&&_0x53011b[_0x433d52])!=null?_0x4c5faf:'';_0x57629f&&(_0x1cb805[_0x57629f]=Te(z({},_0x53011b),{'initialTime':new Date()['getTime']()}),localStorage[_0x18a385(0x287)](_0xc5cf49,JSON[_0x18a385(0x16d)](_0x1cb805)));}[_0x5784de(0x15e)](){return c(this,null,function*(){const _0x2f412e=_0x1e9d;if(d(this,ye))return;o(0x1,'Checking\x20TTL'),C('Checking\x20TTL',!0x0),L(_0x2f412e(0x13a),!0x0);let _0x8125a7=localStorage[_0x2f412e(0x194)](_0x2f412e(0x118)),_0xfe5419=!0x1;if(_0x8125a7){if(_0xfe5419=r(this,u,ve)['call'](this,_0x8125a7),_0xfe5419){let _0x22cb83=localStorage[_0x2f412e(0x194)]('session'),_0x527d89=localStorage['getItem']('ttl');_0x22cb83&&_0x527d89&&p[_0x2f412e(0x152)]({'eventName':_0x2f412e(0x2ae),'eventProperties':[{'eventProperty':_0x2f412e(0x18e),'value':localStorage[_0x2f412e(0x194)](_0x2f412e(0x225))},{'eventProperty':_0x2f412e(0x2a8),'value':new Date(parseInt(_0x527d89,0xa))['toISOString']()}]}),this['clearLocalStorage'](),localStorage[_0x2f412e(0x287)](_0x2f412e(0x118),''+new Date()[_0x2f412e(0x202)]());}}else localStorage['setItem'](_0x2f412e(0x118),''+new Date()['getTime']());(!_0x8125a7||_0xfe5419||r(this,u,Qt)[_0x2f412e(0x22a)](this))&&(r(this,u,et)[_0x2f412e(0x22a)](this)&&r(this,u,Zt)[_0x2f412e(0x22a)](this),r(this,u,Xe)[_0x2f412e(0x22a)](this)&&(yield this[_0x2f412e(0x132)]()),(r(this,u,ve)[_0x2f412e(0x22a)](this)||r(this,u,Qe)[_0x2f412e(0x22a)](this))&&(yield r(this,u,tn)[_0x2f412e(0x22a)](this)),yield r(this,u,Xt)[_0x2f412e(0x22a)](this),(r(this,u,ve)['call'](this)||r(this,u,Ze)[_0x2f412e(0x22a)](this))&&(yield r(this,u,nn)[_0x2f412e(0x22a)](this))),L(_0x2f412e(0x13a),!0x1),C(_0x2f412e(0x1a1),!0x1);});}[_0x5784de(0x274)](){const _0x3b9717=_0x5784de;localStorage['removeItem'](_0x3b9717(0x201)),localStorage[_0x3b9717(0x284)](_0x3b9717(0x212)),localStorage['removeItem'](_0x3b9717(0x184)),localStorage[_0x3b9717(0x284)](_0x3b9717(0x19a)),localStorage[_0x3b9717(0x284)]('ttl'),localStorage['removeItem'](_0x3b9717(0x225));}[_0x5784de(0x132)](_0x549cc4){return c(this,null,function*(){const _0x5a1137=_0x1e9d;let _0x4dc3b9={'deviceId':localStorage['getItem'](_0x5a1137(0x29d))||crypto['randomUUID'](),'os':this[_0x5a1137(0x27b)]()};if(_0x549cc4)_0x4dc3b9['identity']=_0x549cc4;else{if(!_0x549cc4&&localStorage['getItem'](_0x5a1137(0x179)))return;}try{let _0x4c3f34=yield r(this,u,en)[_0x5a1137(0x22a)](this,_0x4dc3b9);if(_0x4c3f34!==void 0x0){localStorage[_0x5a1137(0x287)]('customer',_0x4c3f34);try{x[_0x5a1137(0x134)]({'customer':_0x4c3f34});}catch(_0x35d72a){}}}catch(_0x397568){throw new Error(_0x5a1137(0x23c));}});}};le=new WeakMap(),Ie=new WeakMap(),Se=new WeakMap(),fe=new WeakMap(),be=new WeakMap(),he=new WeakMap(),ye=new WeakMap(),xe=new WeakMap(),u=new WeakSet(),jt=function(_0x5eaaa1){const _0x3e3c34=_0x5784de;A[_0x3e3c34(0x175)](_0x5eaaa1),this[_0x3e3c34(0x1ce)](r(this,u,Gt)[_0x3e3c34(0x22a)](this)),this[_0x3e3c34(0x20c)](r(this,u,Yt)[_0x3e3c34(0x22a)](this)),this[_0x3e3c34(0x177)](navigator[_0x3e3c34(0x12b)]);},Gt=function(){const _0x26ea3d=_0x5784de;var _0x28f3b7;let _0x2fd55d=navigator[_0x26ea3d(0x12b)]['toLowerCase']();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i['test'](_0x2fd55d)?_0x26ea3d(0x254):/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i[_0x26ea3d(0x268)](_0x2fd55d)?'Mobile':/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i['test'](_0x2fd55d)?(_0x26ea3d(0x1f8)in window&&typeof((_0x28f3b7=window==null?void 0x0:window[_0x26ea3d(0x1f8)])==null?void 0x0:_0x28f3b7[_0x26ea3d(0x23b)])!=_0x26ea3d(0x1cc),_0x26ea3d(0x168)):/windows|macintosh|linux|x11/i[_0x26ea3d(0x268)](_0x2fd55d)?_0x26ea3d(0x20e):_0x26ea3d(0x162);},Yt=function(){const _0x3f696c=_0x5784de;let _0x224be3=navigator['userAgent'],_0x1147cb;return _0x224be3[_0x3f696c(0x20a)](_0x3f696c(0x1c4))>-0x1?_0x1147cb=_0x3f696c(0x1e1):_0x224be3[_0x3f696c(0x20a)](_0x3f696c(0x16a))>-0x1?_0x1147cb=_0x3f696c(0x16a):_0x224be3[_0x3f696c(0x20a)](_0x3f696c(0x22d))>-0x1?_0x1147cb=_0x3f696c(0x1f6):_0x224be3['indexOf'](_0x3f696c(0x1b5))>-0x1?_0x1147cb='Microsoft\x20Edge':_0x224be3[_0x3f696c(0x20a)](_0x3f696c(0x182))>-0x1?_0x1147cb=_0x3f696c(0x257):_0x1147cb=_0x3f696c(0x162),_0x1147cb;},ve=function(_0x298744){const _0x40f212=_0x5784de;let _0x308789;return _0x298744||(_0x308789=localStorage[_0x40f212(0x194)](_0x40f212(0x118))),_0x298744||_0x308789?new Date()[_0x40f212(0x202)]()-parseInt(_0x298744||_0x308789||'',0xa)>0x124f80:!0x0;},Qe=function(){const _0x2a6f01=_0x5784de;return!localStorage[_0x2a6f01(0x194)](_0x2a6f01(0x212));},Ze=function(){const _0x48949e=_0x5784de;return!localStorage[_0x48949e(0x194)](_0x48949e(0x184));},Xe=function(){const _0x3f8ec6=_0x5784de;return!localStorage[_0x3f8ec6(0x194)](_0x3f8ec6(0x179));},et=function(){const _0x563d89=_0x5784de;return!localStorage[_0x563d89(0x194)](_0x563d89(0x29d));},qt=function(){const _0x873894=_0x5784de;return!localStorage[_0x873894(0x194)](_0x873894(0x225));},Qt=function(){const _0x596daa=_0x5784de;return r(this,u,Qe)[_0x596daa(0x22a)](this)||r(this,u,Ze)[_0x596daa(0x22a)](this)||r(this,u,Xe)[_0x596daa(0x22a)](this)||r(this,u,et)['call'](this)||r(this,u,qt)[_0x596daa(0x22a)](this);},Zt=function(){const _0x58ef6b=_0x5784de;let _0x377a59=localStorage[_0x58ef6b(0x194)](_0x58ef6b(0x29d));return _0x377a59||(_0x377a59=crypto[_0x58ef6b(0x10b)](),localStorage[_0x58ef6b(0x287)](_0x58ef6b(0x29d),_0x377a59)),_0x377a59;},Xt=function(){return c(this,null,function*(){const _0x4528c3=_0x1e9d;yield N(_0x4528c3(0x2a1),()=>c(this,null,function*(){const _0x4f04e8=_0x4528c3;let _0x4ced7d=localStorage[_0x4f04e8(0x194)](_0x4f04e8(0x225));_0x4ced7d||(_0x4ced7d=crypto['randomUUID'](),localStorage['setItem'](_0x4f04e8(0x225),_0x4ced7d),yield p['recordEvent']({'eventName':'Web\x20Session\x20Started','eventProperties':[{'eventProperty':_0x4f04e8(0x18e),'value':localStorage[_0x4f04e8(0x194)](_0x4f04e8(0x225))},{'eventProperty':_0x4f04e8(0x2a8),'value':new Date(parseInt(localStorage['getItem']('ttl')||'',0xa))[_0x4f04e8(0x21e)]()}]}));}),_0x4314e1=>{const _0xeced9f=_0x4528c3;p[_0xeced9f(0x152)]({'eventName':_0xeced9f(0x216),'eventProperties':[{'eventProperty':_0xeced9f(0x1a9),'value':_0xeced9f(0x27c)+_0x4314e1[_0xeced9f(0x1a9)]}]},!0x0);});});},en=function(_0x37e643){return c(this,null,function*(){const _0x54bd60=_0x1e9d;try{return(yield A[_0x54bd60(0x15d)](''+It+ft,_0x37e643))[_0x54bd60(0x19b)];}catch(_0xf4fce0){throw new Error(_0x54bd60(0xfd));}});},tn=function(){return c(this,null,function*(){const _0x414e02=_0x1e9d;yield p[_0x414e02(0x200)]();});},nn=function(){return c(this,null,function*(){const _0x203633=_0x1e9d;yield we[_0x203633(0x11a)]();});},tt=function(){return c(this,null,function*(){const _0xd632c6=_0x1e9d;yield N(_0xd632c6(0xfe),()=>c(this,null,function*(){const _0x53f607=_0xd632c6;var _0x1235ab;try{let _0x28439f=parseInt(localStorage['getItem'](_0x53f607(0x13f))||'0',0xa)||0x0;if(!_0x28439f||_0x28439f&&new Date()['getTime']()>_0x28439f){if(!((_0x1235ab=yield A[_0x53f607(0x158)](_0x53f607(0x246)))!=null&&_0x1235ab[_0x53f607(0x2ab)]))throw new Error('Invalid\x20API\x20Key');localStorage[_0x53f607(0x287)](_0x53f607(0x13f),(new Date()[_0x53f607(0x202)]()+0x493e0)['toString']());}g['isInitialized']=!0x0;}catch(_0x5b3824){throw g['disableSDK']=!0x0,_0x5b3824[_0x53f607(0x1a9)];}}));});},nt=function(){return c(this,null,function*(){const _0x3233d6=_0x1e9d;var _0x29b52f;o(0x1,_0x3233d6(0x17b));let _0x592107=(_0x29b52f=window==null?void 0x0:window[_0x3233d6(0x2aa)])==null?void 0x0:_0x29b52f[_0x3233d6(0x103)];this['setPreviousUrl'](_0x592107),p[_0x3233d6(0x1cf)]({'eventName':_0x3233d6(0x1a8)});let _0x217128=[];new URLSearchParams(new URL(window['location'][_0x3233d6(0x103)])[_0x3233d6(0x2a0)])[_0x3233d6(0x215)]((_0x1636f3,_0x1f0745)=>c(this,null,function*(){const _0x1a8777=_0x3233d6;wt[_0x1a8777(0x2b0)](_0x1f0745)&&_0x217128['push']({'eventProperty':_0x1f0745,'value':_0x1636f3});})),yield p[_0x3233d6(0x152)]({'eventName':_0x3233d6(0x1d8),'eventProperties':[{'eventProperty':_0x3233d6(0x1c7),'value':window['location']['pathname']},..._0x217128]});});},rn=function(){return c(this,null,function*(){const _0x23e0ba=_0x1e9d;var _0x4a1a2d;o(0x1,_0x23e0ba(0x117));let _0x5a36cb=(_0x4a1a2d=window==null?void 0x0:window[_0x23e0ba(0x2aa)])==null?void 0x0:_0x4a1a2d[_0x23e0ba(0x103)];(this[_0x23e0ba(0x256)]()===null||this[_0x23e0ba(0x256)]()===void 0x0||_0x5a36cb!==this[_0x23e0ba(0x256)]())&&(yield r(this,u,nt)[_0x23e0ba(0x22a)](this));});},on=function(){return c(this,null,function*(){const _0x2fded3=_0x1e9d;var _0x43e707,_0x5ca428;let _0x25b15f=(_0x43e707=window==null?void 0x0:window['location'])==null?void 0x0:_0x43e707['href'];p[_0x2fded3(0x1cf)]({'eventName':_0x2fded3(0x255),'eventProperties':[{'eventProperty':_0x2fded3(0x1a9),'value':(_0x25b15f!==this[_0x2fded3(0x256)]())+':'+_0x25b15f+':'+this[_0x2fded3(0x256)]()}]});try{yield r(this,u,nt)[_0x2fded3(0x22a)](this);}catch(_0x24c194){let _0x44b9d6=_0x24c194&&_0x24c194['message']?(_0x5ca428=_0x24c194==null?void 0x0:_0x24c194[_0x2fded3(0x1a9)])==null?void 0x0:_0x5ca428[_0x2fded3(0x23f)](0x0,0x64):_0x2fded3(0x1cc);yield p['recordDebugEvents']({'eventName':_0x2fded3(0x1b1),'eventProperties':[{'eventProperty':_0x2fded3(0x1a9),'value':''+_0x44b9d6}]});}});},m(Q,le);var qe=Q,E=qe['getInstance'](),Z,de,W,sn,rt,an,cn,H=class H{constructor(){m(this,W),m(this,de,!0x1);}static['getInstance'](){const _0x1e7f64=_0x5784de;var _0x21675d;return d(H,Z)||(I(H,Z,new H()),r(_0x21675d=d(H,Z),W,sn)[_0x1e7f64(0x22a)](_0x21675d)),d(H,Z);}['recordAttribute'](_0x5679fa,_0x1aa437,_0x4da15f){return c(this,null,function*(){yield N('#\x20recordAttribute',()=>c(this,null,function*(){const _0x5dec23=_0x1e9d;if(o(0x1,_0x5dec23(0x12f)),C(_0x5dec23(0x12f),!0x0),L('Recording\x20attribute\x20Time',!0x0),o(0x1,_0x5dec23(0x106)+{'attributeName':_0x5679fa,'attributeProperties':_0x4da15f,'attributeValue':_0x1aa437}+')}'),!_0x1aa437||_0x1aa437===''){o(0x2,_0x5dec23(0x28f));return;}yield E[_0x5dec23(0x15e)](),yield r(this,W,an)[_0x5dec23(0x22a)](this);let _0x4836e9=JSON[_0x5dec23(0x1ca)](localStorage[_0x5dec23(0x194)](_0x5dec23(0x184))||'{}'),_0x4c7a2e=_0x4da15f?r(this,W,rt)[_0x5dec23(0x22a)](this,_0x4836e9,_0x5679fa,_0x4da15f):r(this,W,rt)[_0x5dec23(0x22a)](this,_0x4836e9,_0x5679fa);if(typeof _0x4c7a2e==_0x5dec23(0x23d)){o(0x2,_0x4c7a2e);return;}_0x4836e9[_0x5679fa]['should_set_identity']&&(yield E['setIdentity'](typeof _0x1aa437==_0x5dec23(0x23d)?_0x1aa437:JSON['stringify'](_0x1aa437))),E[_0x5dec23(0x1b6)]();let {id:_0x368cbd}=_0x4836e9[_0x5679fa],_0x246a84={'attributeId':_0x368cbd,'attributeProperties':_0x4c7a2e,'customerId':localStorage['getItem']('customer')||'','value':_0x1aa437};yield r(this,W,cn)['call'](this,_0x246a84);let _0x20cf43=JSON[_0x5dec23(0x1ca)](localStorage['getItem']('preInitializedAttributes')||'[]');_0x20cf43[_0x5dec23(0x210)](),localStorage[_0x5dec23(0x287)](_0x5dec23(0x25d),JSON['stringify'](_0x20cf43)),L('Recording\x20attribute\x20Time',!0x1),C(_0x5dec23(0x12f),!0x1);}));});}[_0x5784de(0x11a)](){return c(this,null,function*(){const _0x246259=_0x1e9d;if(!localStorage['getItem']('attributes')&&!d(this,de)){I(this,de,!0x0);try{let _0x331ed9=(yield this[_0x246259(0x232)]())[_0x246259(0x19b)];_0x331ed9&&localStorage[_0x246259(0x287)](_0x246259(0x184),JSON[_0x246259(0x16d)](_0x331ed9));}catch(_0x3aaf32){throw new Error(_0x246259(0x17e));}finally{I(this,de,!0x1);}}});}[_0x5784de(0x232)](){return c(this,null,function*(){const _0x3e8188=_0x1e9d;try{return yield A[_0x3e8188(0x158)](''+ke);}catch(_0x4df827){throw new Error(_0x3e8188(0x1d7));}});}};Z=new WeakMap(),de=new WeakMap(),W=new WeakSet(),sn=function(){return c(this,null,function*(){});},rt=function(_0x2495d1,_0x2eb7e5,_0x403970){const _0x16f39b=_0x5784de;if(!Object[_0x16f39b(0x271)][_0x16f39b(0x183)]['call'](_0x2495d1,_0x2eb7e5))return _0x16f39b(0x248)+_0x2eb7e5+_0x16f39b(0x279);if(!_0x403970)return[];let _0x456d5f=_0x2495d1[_0x2eb7e5];if(!(_0x456d5f!=null&&_0x456d5f['attributeProperty']))return'Attribute\x20'+_0x2eb7e5+'\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.';let _0x4fa5bd=_0x403970['filter'](({attributeProperty:_0x53a9c1})=>!Object[_0x16f39b(0x271)][_0x16f39b(0x183)][_0x16f39b(0x22a)](_0x456d5f[_0x16f39b(0x140)],_0x53a9c1))[_0x16f39b(0x186)](({attributeProperty:_0x51a7c0})=>_0x51a7c0);return _0x4fa5bd[_0x16f39b(0x1ee)]>0x0?_0x16f39b(0x248)+_0x2eb7e5+'\x20has\x20invalid\x20attributeProperties:\x20'+_0x4fa5bd[_0x16f39b(0x1bd)](',\x20')+'.':_0x403970['map'](({attributeProperty:_0x1f4bb5,value:_0x524147})=>({'attributePropertyId':_0x456d5f[_0x16f39b(0x140)][_0x1f4bb5]['id'],'value':_0x524147}));},an=function(){return c(this,null,function*(){const _0x31997b=_0x1e9d;localStorage['getItem']('attributes')||(yield this[_0x31997b(0x11a)]());});},cn=function(_0x3806e5){return c(this,null,function*(){const _0x1fb866=_0x1e9d;try{return yield A[_0x1fb866(0x15d)](''+ke+Et,_0x3806e5);}catch(_0x33d479){throw new Error(_0x1fb866(0x238));}});},m(H,Z);function _0xcb74(){const _0x374211=['auto','error','[id^=\x22u_content_button_\x22]','logout','title','session','default','Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203','online','add','call','Already\x20Registered\x20To\x20Web\x20Push','two_step','Firefox','bind','apiKey','color','1798BrLhwV','fetchAttributeData','overflow','mergn-column-75','\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.','os-version','optin_data','Error\x20posting\x20attribute\x20record','showNotification','.u-popup-container\x20img','permission','Error\x20setting\x20identity','string','appendChild','substring','\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20','check_permission','lastSyncTime','User\x20denied\x20the\x20notification\x20permission.','hidden','eventName','/brand','showAfterScrollAction','Attribute\x20','mergn-column-25','Allowed\x20Web\x20Push\x20Subscription','isContentCardAction','[id^=\x22u_content_form_\x22]','100%','Failed\x20to\x20subscribe\x20the\x20user','Turned\x20Off\x20Notification\x20Reset\x20Permission','login','resolve','defineProperties','storeActionInLocalStorageInternal','Crawlers','show_notification_error','getPreviousUrl','Internet\x20Explorer','\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a','Popup\x20already\x20in\x20cache','UTM_CAMPAIGN','info','text','preInitializedAttributes','\x0awidth:\x2025%;\x0a','button','14776nRowid','propertyIsEnumerable','Content\x20Card\x20Action','removeAttribute','Time\x20difference:\x20','scrollHeight','DELAY','Service\x20Worker\x20ready','test','web_push_action','getInstance','entry_time_value','Service\x20Worker\x20registration','PushManager','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','Initializing\x20base\x20service','recordAttribute','prototype','UTM_CONTENT','Checking\x20for\x20existing\x20subscription','clearLocalStorage','postEventRecord','findIndex',';\x0acolor:\x20','next','\x20is\x20not\x20valid.','contentCard_container_','getPlatform','store\x20session\x20-\x20','form','Displayed\x20Web\x20Push\x20Subscription','click','fixed','loadPopupEventActionInLocalStorage','getAPIKey','ERROR:\x20','removeItem','entry_time','outerHTML','setItem','utm_source','mergn-row','\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-1','mergn_shopify','FBCLID','/attribute','Attribute\x20value\x20is\x20required','values','optIn','width','fetchEventData','getAttribute','unsubscribe','swPath','464noepyd','createElement','Content\x20Card\x20Click','gclid','Popup\x20overlay\x20element\x20found','signal','uniqueIdentity','/v2',';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a','search','store\x20session','button-container','Service\x20Worker\x20registration\x20is\x20available','getElementById','Event\x20Payload:\x0a\x20','eventProperty','Recording\x20event','SESSION_CREATED','pathname','location','success','recordDebugEventsToggle','getStoredEvents','Web\x20Session\x20Concluded','getCurrentUTCDate','has','utm_term','name','backgroundColor','important','\x0aMergnError:\x20','offline','application/json','Error\x20posting\x20identity\x20data','verify\x20API\x20key','Re\x20initializing\x20customer\x20Id','Logging\x20out','content_card','Viewed\x20Web\x20Push\x20Soft-ask','href','6tsMXSt','ContentCard\x20already\x20displayed','Attribute\x20Payload:\x0a\x20','Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization','read\x20from\x20private\x20field','Platform','addEventListener','randomUUID','Failed\x20to\x20fetch','match','active','2575350BWrKZA','Accepted\x20Web\x20Push\x20Soft-ask','init','duration','disableSDK','alt','loadContentCardEventActionInLocalStorage','IMMEDIATELY','Tracking\x20page\x20change','ttl','getOwnPropertySymbols','storeAttributeInLocalStorage','Adding\x20to\x20pre-initialized\x20event:','attributeName','Logging\x20in',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','Closed\x20Web\x20Push\x20Subscription','showDelayedAction','/brand/get-web-push-public-key','clearActionInLocalStorage','GCLID','entries','getOperatingSystem','banner_image','isArray','storeActionInLocalStorage','\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a','Pushing\x20message\x20to\x20service\x20worker','userAgent','campaignId','INFO','Initial\x20time:\x20','Recording\x20attribute','ContentCard','pushToQueue','setIdentity','Image','pushMessageToSW','put','message:\x20','notification\x20service','notification_permission_error','2806880WVVYyZ','Checking\x20TTL\x20Time','/mergn-sw.js','/set-identity','pushState','/device/add-device-token','verifyTTL','attributeProperty','documentElement','setProperty','Popup\x20already\x20displayed','subscribed','Verifying\x20API\x20Key\x20after\x20timeout','banner_design','div','remove','body','SCROLL','viewed','position','time','ALL','No\x20existing\x20subscription\x20found','loading','innerHTML','recordEvent','Content\x20Card\x20View','https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api','banner_icon','load','getVersion','get','centered-image','Popup','Current\x20time:\x20','json','post','checkTTL','No\x20events\x20to\x20record','register','throw','Unknown','Error\x20fetching\x20event\x20data','getSubscription','button_2','User\x20closed\x20the\x20notification\x20permission\x20dialog.','Denied\x20Web\x20Push\x20Soft-ask','Mobile','identity','Safari','DEBUG','denied','stringify','subscribe','notification_service_not_initialized','scroll','319280HkQBeN','Event\x20','submit','getRegistrations','updateAPIKey','onLine','setOperatingSystem','keys','customer','MergnError','Performing\x20viewed\x20web\x20page\x20event','Event\x20Payload','pushManager','Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage','left','Error\x20posting\x20event\x20record:','UTCDate','MSIE','hasOwnProperty','attributes','subtitle','map','Mergn\x20SDK\x20is\x20disabled!','push_manager','querySelectorAll','Button\x20Click','no_optin','granted','NONE','SESSION_ID','banner_text','Notification\x20already\x20in\x20cache','defineProperty','\x20has\x20invalid\x20eventProperties:\x20','/event','getItem','img','Campaign\x20Id','src','initialTime','showPopup','offlineEvents','data','view','Checking\x20notification\x20permission:\x20','Recording\x20event\x20Time','Customer\x20with\x20id\x20','popup_container_','Checking\x20TTL','\x0aUnexpected\x20error:\x20','debugLevel','attributeValue','\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20','style','campaignEntryTimeValue','pre_vwp','message','web_optin_instance_id','User\x20is\x20subscribed','loadActionInLocalStorage','Image\x20Click','groupEnd','setPreviousUrl','.u-close-button','vwp_error','record\x20event','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set','already_registered','Edg','updateSessionCreated','removeEventListener','button_1','.u-popup-overlay','Verifying\x20API\x20Key','zIndex','height','join','Notification\x20service\x20is\x20not\x20initialized','shopify','splice','2572565ybicoz','PUT','record\x20event\x20-\x20','Chrome','Mergn\x20SDK\x20Initialized','Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms','URL','serviceWorker','syncRealWorldTime','parse','banner_color','undefined','recordEventsFromQueue','setPlatform','recordDebugEvents','utm_content','preInitializedEvents','POST','The\x20user\x20has\x20already\x20enabled\x20notifications.','tracking\x20page\x20change\x20register','/set-attribute','369DKNZnK','Error\x20fetching\x20attribute\x20data','Viewed\x20Webpage','init_condition','campaignEntryTime','Close\x20Click','gad_source','queue','value','showContentCard','toString','Google\x20Chrome','mergn-overlay','existing_subscription','notification_data','#\x20record\x20event','setDebugLevel','Notification\x20permission:\x20','\x20Time','8734887SnrBaR','Error\x20posting\x20event\x20record','mergnWebPushPopup','Service\x20Worker\x20registered','then','length','cssText','Popup\x20Action','service_worker','mergn_init','push','INFO:\x20','text_color','Mozilla\x20Firefox','Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20','Notification','/record-event','banner_title','Service\x20Worker\x20registration\x20failed:','getOSVersion','update','Failed\x20to\x20request\x20notification\x20permission','isInitialized','storeEventsAndPropertiesInLocalStorage','action','getTime','apply','loadWebPushActionInLocalStorage','getBrandId','className','operating-system','type','campaignCustomerInstanceId','indexOf','mergn','setOSVersion','Request\x20aborted','Web','set','pop','querySelector','events','recordEventPreInitialized','isPopupAction','forEach','Debug\x20Event','campaigns','Identity:\x20','Popup\x20View','requestPermission','utm_campaign','\x20not\x20exists','Blocked\x20Web\x20Push\x20Subscription','toISOString','textContent'];_0xcb74=function(){return _0x374211;};return _0xcb74();}var it=H,we=it[_0x5784de(0x26a)](),ue,X=class X{constructor(){}static[_0x5784de(0x26a)](){return d(X,ue)||I(X,ue,new X()),d(X,ue);}[_0x5784de(0x111)](_0x4a1081,_0x59b54b){setTimeout(()=>{const _0x5b325b=_0x1e9d;N(_0x5b325b(0x111),()=>c(this,null,function*(){const _0x35f56a=_0x5b325b;o(0x1,'Initializing\x20Mergn\x20SDK'),yield E['init'](_0x4a1081,_0x59b54b),p['recordDebugEvents']({'eventName':_0x35f56a(0x1f2)}),o(0x1,_0x35f56a(0x1c5));let _0x4c28a5=JSON[_0x35f56a(0x1ca)](localStorage[_0x35f56a(0x194)](_0x35f56a(0x25d))||'[]');Array[_0x35f56a(0x127)](_0x4c28a5)&&_0x4c28a5[_0x35f56a(0x215)]((_0x1ea16b,_0x583fc3)=>c(this,null,function*(){const _0x15891b=_0x35f56a;yield we[_0x15891b(0x270)](_0x1ea16b[_0x15891b(0x11c)],_0x1ea16b[_0x15891b(0x1a4)]),_0x4c28a5[_0x15891b(0x1c0)](_0x583fc3,0x1),localStorage[_0x15891b(0x287)](_0x15891b(0x25d),JSON[_0x15891b(0x16d)](_0x4c28a5));})),window[_0x35f56a(0x10a)](_0x35f56a(0x228),()=>c(this,null,function*(){const _0x310f6e=_0x35f56a;g[_0x310f6e(0xfb)]=!0x1;let _0x412303=JSON[_0x310f6e(0x1ca)](localStorage['getItem'](_0x310f6e(0x19a))||'[]');Array[_0x310f6e(0x127)](_0x412303)&&(yield p['postEventRecord']({'customerId':localStorage[_0x310f6e(0x194)](_0x310f6e(0x179))||'','deviceId':localStorage['getItem'](_0x310f6e(0x29d))||'','events':_0x412303}),localStorage[_0x310f6e(0x284)]('offlineEvents')),E[_0x310f6e(0x15e)](),E[_0x310f6e(0x1b6)]();})),window[_0x35f56a(0x10a)](_0x35f56a(0xfb),()=>{const _0x6e6890=_0x35f56a;g[_0x6e6890(0xfb)]=!0x0;}),window[_0x35f56a(0x10a)](_0x35f56a(0x156),()=>{const _0x5ab1ca=_0x35f56a;$[_0x5ab1ca(0x281)](),x[_0x5ab1ca(0x204)]();});}));});}[_0x5784de(0x1e6)](_0x59e3f7,_0x4740a0){const _0x4a981e=_0x5784de;if(!(_0x59e3f7 in U)){console['error'](_0x4a981e(0x227));return;}g[_0x4a981e(0x2ac)]=_0x4740a0||{},g['debugLevel']=_0x59e3f7;try{x[_0x4a981e(0x134)]({'debugLevel':_0x59e3f7});}catch(_0x3f9947){}}[_0x5784de(0x270)](_0x4e651d,_0x536a60){return c(this,null,function*(){return new Promise((_0x2e9199,_0x5860ea)=>{setTimeout(()=>c(this,null,function*(){const _0x21b324=_0x1e9d;try{yield N(_0x21b324(0x270),()=>c(this,null,function*(){const _0x30883d=_0x21b324;let _0x4385ec;Array['isArray'](_0x536a60)?_0x4385ec=JSON[_0x30883d(0x16d)](_0x536a60):typeof _0x536a60=='number'?_0x4385ec=''+_0x536a60:_0x4385ec=_0x536a60,o(0x1,_0x30883d(0x12f)),o(0x1,'Attribute\x20Name:\x20'+_0x4e651d+',\x20Attribute\x20Value:\x20'+_0x4385ec);let _0x2dd0c9=JSON[_0x30883d(0x1ca)](localStorage['getItem']('preInitializedAttributes')||'[]');_0x2dd0c9[_0x30883d(0x1f3)]({'attributeName':_0x4e651d,'attrValueStringified':_0x4385ec}),localStorage[_0x30883d(0x287)]('preInitializedAttributes',JSON[_0x30883d(0x16d)](_0x2dd0c9)),g[_0x30883d(0x1ff)]&&(yield we['recordAttribute'](_0x4e651d,_0x4385ec));})),_0x2e9199();}catch(_0x15560a){_0x5860ea(_0x15560a);}}));});});}['login'](_0x233dce){return c(this,null,function*(){return new Promise((_0x1748fb,_0x185f49)=>{setTimeout(()=>c(this,null,function*(){const _0xa42eda=_0x1e9d;try{yield N(_0xa42eda(0x250),()=>c(this,null,function*(){const _0x2a5c6f=_0xa42eda;o(0x1,_0x2a5c6f(0x11d)),o(0x1,_0x2a5c6f(0x218)+_0x233dce),g['loading']=!0x0,yield E['setIdentity'](_0x233dce);})),_0x1748fb();}catch(_0x143507){_0x185f49(_0x143507);}finally{g['loading']=!0x1,yield p[_0xa42eda(0x1cd)]();}}));});});}[_0x5784de(0x223)](){setTimeout(()=>{const _0x13dab1=_0x1e9d;N(_0x13dab1(0x223),()=>c(this,null,function*(){const _0x34b996=_0x13dab1;o(0x1,_0x34b996(0x100)),E[_0x34b996(0x274)]();}));});}['recordEvent'](_0x23a2d0,_0x40d585){return c(this,null,function*(){return new Promise((_0x40dff9,_0x345b92)=>{setTimeout(()=>c(this,null,function*(){const _0x41815b=_0x1e9d;try{yield N(_0x41815b(0x1b2),()=>c(this,null,function*(){const _0x3966f0=_0x41815b;o(0x1,'Recording\x20event'),o(0x1,_0x3966f0(0x2a5)+{'eventName':_0x23a2d0,'eventProperties':_0x40d585}),yield p[_0x3966f0(0x152)]({'eventName':_0x23a2d0,'eventProperties':_0x40d585});})),_0x40dff9();}catch(_0x55fe1d){_0x345b92(_0x55fe1d);}}));});});}[_0x5784de(0x157)](){return mt;}};ue=new WeakMap(),m(X,ue);var ot=X,st=ot[_0x5784de(0x26a)]();typeof window!=_0x5784de(0x1cc)&&(window[_0x5784de(0x20b)]=st);var kr=st;export{kr as default};
|