mergn-webapp-sdk 1.0.160 → 1.0.162

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,75 @@
1
- 'use strict';function _0x2d7d(_0x35cabb,_0x49fd2a){const _0x24b265=_0x24b2();return _0x2d7d=function(_0x2d7d65,_0x1b1e18){_0x2d7d65=_0x2d7d65-0x115;let _0x553abf=_0x24b265[_0x2d7d65];return _0x553abf;},_0x2d7d(_0x35cabb,_0x49fd2a);}(function(_0x53c51f,_0x22a3cc){const _0x264afa=_0x2d7d,_0x2c1415=_0x53c51f();while(!![]){try{const _0x220455=-parseInt(_0x264afa(0x19f))/0x1*(-parseInt(_0x264afa(0x151))/0x2)+parseInt(_0x264afa(0x29e))/0x3+-parseInt(_0x264afa(0x291))/0x4+parseInt(_0x264afa(0x1f7))/0x5*(-parseInt(_0x264afa(0x20f))/0x6)+parseInt(_0x264afa(0x16e))/0x7+-parseInt(_0x264afa(0x1bd))/0x8*(parseInt(_0x264afa(0x1b5))/0x9)+-parseInt(_0x264afa(0x289))/0xa;if(_0x220455===_0x22a3cc)break;else _0x2c1415['push'](_0x2c1415['shift']());}catch(_0x59e3a6){_0x2c1415['push'](_0x2c1415['shift']());}}}(_0x24b2,0x29dc2));function _0x24b2(){const _0x31f225=['1026109amJFEA','initialTime','showNotification','serviceWorker','toUTCString','Popup\x20already\x20in\x20cache','/mergn-sw.js','Popup\x20overlay\x20element\x20found','Attribute\x20','checkIfIdentityExists','splice','Service\x20Worker\x20registered','[id^=\x22u_content_button_\x22]','scroll','href','loadActionInLocalStorage','zIndex','name:\x20','post\x20-\x20','recordDebugEvents','value','offline','height','pop','syncRealWorldTime','should_set_identity','campaignCustomerInstanceId','record\x20event','session','Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20','Pushing\x20message\x20to\x20service\x20worker','button-1','set','init_condition','div','string','setIdentity','Notification','Service\x20Worker\x20registration','\x0abackground-color:\x20','storeAttributeInLocalStorage','\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.','GAD_SOURCE','setOperatingSystem','fetchAttributeData','Mergn\x20SDK\x20is\x20disabled!','recordEvent','group','NONE','184669oojVLU','Failed\x20to\x20sync\x20real-world\x20time','existing_subscription','.u-popup-overlay','99999999','createElement','post','defineProperties','put','init','decodeData','close','pushManager','name','entries','Load\x20failed','#\x20Recording\x20event','permission','updateAPIKey','isInitialized','thank_you','hidden','45hYmItc','utm_campaign','granted','mergn','click','/device/add-device-token','Error\x20posting\x20event\x20record','Initializing\x20Notification\x20Service','63520dlSJZf','Internet\x20Explorer','json','recordAttribute','Campaign\x20Id','postEventRecord','text','propertyIsEnumerable','Accepted\x20Web\x20Push\x20Soft-ask','then','log\x20level\x20check','/brand/get-time','Google\x20Chrome','QQBrowser','Popup','Facebook','data','base_init','/event','Opera','Popup\x20View','attributeProperty','querySelectorAll','showContentCard','The\x20user\x20has\x20already\x20enabled\x20notifications.','store\x20session','Web\x20Session\x20Concluded','ERROR:\x20','showAfterScrollAction','divId','Snapchat','userAgent','getStoredEvents','Error\x20setting\x20identity','getRegistrations','Form\x20submitted\x20values:','content_card','time','scrollHeight','notification\x20service','DEBUG','Displayed\x20Web\x20Push\x20Subscription','boolean','Firefox','Samsung\x20Internet','join','os-version','type','showPopup','get\x20fetch\x20-\x20','FBAN','User\x20granted\x20the\x20notification\x20permission.','ContentCard\x20already\x20in\x20cache','keys','campaignEntryTimeValue','\x0aMergnError:\x20','\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','subscribe','10ScUZmu','values','\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20','ttl',';\x0acolor:\x20','Initializing\x20base\x20service','overflow','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','Content\x20Card\x20Action','padding','showDelayedAction','checkIfAttributeExists','auto','Error\x20fetching\x20attribute\x20data','cookie','style','action','Recording\x20event','Failed\x20to\x20fetch','storeActionInLocalStorageInternal','Close\x20Click','storeAttribute','write\x20to\x20private\x20field','loadWebPushActionInLocalStorage','620652oEeFIz','Button\x20Click','getOSVersion','scrollY','default','forEach','getElementById','Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage','view','getPreviousUrl','pushMessageToSW','check_permission','Event\x20Payload:\x0a\x20','Denied\x20Web\x20Push\x20Soft-ask','notification_service_not_initialized','has','querySelector','\x20-\x20','/set-identity','setOSVersion','SESSION_CREATED','defineProperty','LinkedIn','UTCDate','IMMEDIATELY','display','Event\x20','getCookie','removeEventListener','number','pushState','setPreviousUrl','attributes','button_2','Image\x20Click','setCookie','isInteger','Service\x20Worker\x20registration\x20is\x20available','Checking\x20notification\x20permission:\x20','button_1','verifyTTL','getBrandId','\x20already\x20exists\x20with\x20value\x20','\x20is\x20not\x20valid.','Mergn\x20not\x20initialized!','Unknown','hasOwnProperty','1.0.160','encode','catch','PUT','checkTTL','FBCLID','getPlatform','login','Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms','swPath','innerHeight','eventName','UTM_CONTENT','Event\x20Payload','UCBrowser','Trident','\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a','application/json','debugLevel','MSIE','getSubscription','GCLID','Recording\x20attribute\x20Time','apply','button','Checking\x20TTL\x20Time','recordEventsFromQueue','appendChild','web_optin_instance_id','Attribute\x20value\x20is\x20required','unsubscribe','service_worker','Identity:\x20','getInstance','Mergn\x20is\x20loading!','block','get','Mergn\x20is\x20offline!','success','setPlatform','Tracking\x20page\x20change','Allowed\x20Web\x20Push\x20Subscription','Checking\x20for\x20existing\x20subscription','Logging\x20in','preInitializedAttributes','substring','indexOf','split','Checking\x20TTL','UTM_TERM','User\x20denied\x20the\x20notification\x20permission.','shopify','Viewed\x20Web\x20Push\x20Soft-ask','campaignEntryTime','Recording\x20event\x20Time','Error\x20posting\x20identity\x20data','https://bc5awo3arh4ta2dsgft2iuq6s40lkmyj.lambda-url.ap-southeast-1.on.aws/api/v2/event/record-event','className','Already\x20Registered\x20To\x20Web\x20Push','identity','parse','pathname','popup_container_','cssText','register','match','attributeValue','Popup\x20already\x20displayed','Recording\x20attribute','decode','left','DELAY','pre_vwp','Error\x20posting\x20event\x20record:','Notification\x20service\x20is\x20not\x20initialized','779930TSQvoT','beforeunload','map','mergn_shopify','utm_content','stringify','banner_icon','entry_time','275428sLcvIY','button-container','Web','randomUUID','banner_image','notification_permission_error','campaigns','SamsungBrowser','Brave','important','Sogou\x20Browser','Cannot\x20','/attribute','700908PWxOgB','/v2','setTime','fromCharCode','banner_design','backgroundColor','Verifying\x20API\x20Key','isContentCardAction','getOperatingSystem','shift','test','SCROLL','location','undefined','push_manager','body','Form\x20Submit','filter','INFO','Invalid\x20platform','reject','img','src','push','remove','removeItem','recordDebugEventsToggle','encodeData','customer','signal','Attribute\x20Payload:','fetchEventData','removeAttribute','\x20has\x20invalid\x20eventProperties:\x20','clearLocalStorage','Shopify\x20data\x20changed','Reachability\x20Push\x20Web','expires=','URL','User\x20closed\x20the\x20notification\x20permission\x20dialog.','abcd','updateSessionCreated','\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a','call','No\x20existing\x20subscription\x20found','Popup\x20Action','toISOString','Pushing\x20message\x20to\x20SW\x20from\x20Shopify\x20data','mergn_debug_level','SESSION_ID','submit','optIn','vwp_error','Image','PushManager','postMessage','ALL','FBAV','ERROR','OriginateFrom:\x20','color','denied','uniqueIdentity','mergn_identity','Turned\x20Off\x20Notification\x20Reset\x20Permission','requestPermission','/customer','TikTok','\x20-\x20\x20','Chrome','error','getVersion','documentElement','mergn_init','gclid','Edg','Initial\x20time:\x20','isPopupAction','setProperty','Safari','INFO:\x20','User\x20is\x20subscribed','getOwnPropertySymbols','getItem','viewed','includes','prototype','\x20|\x20Attribute\x20Value:\x20','\x20not\x20exists','operating-system','offlineEvents','Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203','next','form','queue','loading','pushToQueue','Baidu','POST','mergn-row','OPR','loadContentCardEventActionInLocalStorage','message','Crawlers','getAPIKey','AbortError','UTM_MEDIUM','.u-close-button','logout','ContentCard\x20already\x20displayed','100%','campaignId','Turned\x20Off\x20Notification','info','addEventListener','onLine','#\x20record\x20event','alt','notification_data','toString','disableSDK','mergn-column-75','clearActionInLocalStorage','Time\x20value:\x20','mergn_customer_attributes','optin_data','attributeName','access\x20private\x20method','Adding\x20to\x20pre-initialized\x20event:','eventProperty','getTime','/brand/get-web-push-public-key','Mobile','active','text_color','add','entry_time_value','Initializing\x20notification\x20service\x20from\x20Base\x20Service','web_push_action','storeEventsAndPropertiesInLocalStorage','Web\x20Session\x20Started','brandId','charCodeAt','preInitializedEvents','\x0aUnexpected\x20error:\x20','bind','2EJCnFN','storeActionInLocalStorage','contentCard_container_','recordEventPreInitialized','innerHTML','Microsoft\x20Edge','events','isArray','Error\x20posting\x20attribute\x20record','verify\x20API\x20key','Instagram','\x20Time','resolve','apiKey','Baidu\x20Browser','Blocked\x20Web\x20Push\x20Subscription','length','Failed\x20to\x20subscribe\x20the\x20user','UTM_SOURCE','storeIdentity','Sogou','already_registered','textContent','setItem','title','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','loadPopupEventActionInLocalStorage','The\x20user\x20has\x20blocked\x20notifications.'];_0x24b2=function(){return _0x31f225;};return _0x24b2();}((()=>{const _0x29e887=_0x2d7d;var _0x8cff8a=Object[_0x29e887(0x224)],_0x1279b1=Object[_0x29e887(0x1a6)],_0x4df1c4=Object['getOwnPropertyDescriptors'],_0x3fbffd=Object[_0x29e887(0x2f0)],_0x34de5d=Object[_0x29e887(0x115)][_0x29e887(0x23d)],_0x393f6e=Object[_0x29e887(0x115)][_0x29e887(0x1c4)],_0x559350=_0x395223=>{throw TypeError(_0x395223);},_0x54a9fb=(_0x306c95,_0x3055fc,_0x110373)=>_0x3055fc in _0x306c95?_0x8cff8a(_0x306c95,_0x3055fc,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x110373}):_0x306c95[_0x3055fc]=_0x110373,_0x5ee623=(_0x393ac5,_0xd3af54)=>{const _0x6ca0b7=_0x29e887;for(var _0x5aa73f in _0xd3af54||(_0xd3af54={}))_0x34de5d['call'](_0xd3af54,_0x5aa73f)&&_0x54a9fb(_0x393ac5,_0x5aa73f,_0xd3af54[_0x5aa73f]);if(_0x3fbffd){for(var _0x5aa73f of _0x3fbffd(_0xd3af54))_0x393f6e[_0x6ca0b7(0x2c9)](_0xd3af54,_0x5aa73f)&&_0x54a9fb(_0x393ac5,_0x5aa73f,_0xd3af54[_0x5aa73f]);}return _0x393ac5;},_0x572d45=(_0x31150d,_0x4357bb)=>_0x1279b1(_0x31150d,_0x4df1c4(_0x4357bb)),_0xbac428=(_0x270942,_0x141137,_0x418c50)=>_0x141137[_0x29e887(0x21e)](_0x270942)||_0x559350(_0x29e887(0x29c)+_0x418c50),_0xf07c5a=(_0x7997a7,_0x1ffd92,_0x4c3a5b)=>(_0xbac428(_0x7997a7,_0x1ffd92,'read\x20from\x20private\x20field'),_0x4c3a5b?_0x4c3a5b[_0x29e887(0x2c9)](_0x7997a7):_0x1ffd92[_0x29e887(0x262)](_0x7997a7)),_0x5e0cad=(_0x43c07d,_0x440c1b,_0x2f5720)=>_0x440c1b[_0x29e887(0x21e)](_0x43c07d)?_0x559350('Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once'):_0x440c1b instanceof WeakSet?_0x440c1b[_0x29e887(0x146)](_0x43c07d):_0x440c1b[_0x29e887(0x18e)](_0x43c07d,_0x2f5720),_0xba5f7e=(_0x2aaa78,_0x18726c,_0x588219,_0x19173d)=>(_0xbac428(_0x2aaa78,_0x18726c,_0x29e887(0x20d)),_0x19173d?_0x19173d['call'](_0x2aaa78,_0x588219):_0x18726c[_0x29e887(0x18e)](_0x2aaa78,_0x588219),_0x588219),_0x450f4d=(_0xd7ac1a,_0x375b5f,_0x3192a5)=>(_0xbac428(_0xd7ac1a,_0x375b5f,_0x29e887(0x13e)),_0x3192a5),_0x3e4330=(_0x1beefa,_0x5eb6d3,_0x5e8c03)=>new Promise((_0xe4f98f,_0x4e05de)=>{const _0x35cf1a=_0x29e887;var _0x1b5e03=_0x25247d=>{const _0x54993e=_0x2d7d;try{_0x53cae5(_0x5e8c03[_0x54993e(0x11b)](_0x25247d));}catch(_0x1abe09){_0x4e05de(_0x1abe09);}},_0x47b7eb=_0x1393dc=>{try{_0x53cae5(_0x5e8c03['throw'](_0x1393dc));}catch(_0x21eec6){_0x4e05de(_0x21eec6);}},_0x53cae5=_0x1b20b4=>_0x1b20b4['done']?_0xe4f98f(_0x1b20b4['value']):Promise[_0x35cf1a(0x15d)](_0x1b20b4[_0x35cf1a(0x182)])['then'](_0x1b5e03,_0x47b7eb);_0x53cae5((_0x5e8c03=_0x5e8c03[_0x35cf1a(0x255)](_0x1beefa,_0x5eb6d3))['next']());}),_0x55127a=_0x29e887(0x23e),_0x4af413='https://api.mergn.com/sdk-management/api',_0x49be67=_0x29e887(0x29d),_0x3da7b0='/set-attribute',_0x361ab2=_0x29e887(0x1cf),_0x98fadf='/record-event',_0x554888=_0x29e887(0x2e0),_0x20bad6=_0x29e887(0x1ba),_0xb06b77=_0x29e887(0x221),_0x1391e7=_0x29e887(0x142),_0x46ec91=_0x29e887(0x1c8),_0x1f3173=(_0x1bcae=>(_0x1bcae[_0x29e887(0x163)]='utm_source',_0x1bcae[_0x29e887(0x129)]='utm_medium',_0x1bcae['UTM_CAMPAIGN']=_0x29e887(0x1b6),_0x1bcae[_0x29e887(0x26f)]='utm_term',_0x1bcae[_0x29e887(0x24a)]=_0x29e887(0x28d),_0x1bcae[_0x29e887(0x198)]='gad_source',_0x1bcae[_0x29e887(0x253)]=_0x29e887(0x2e8),_0x1bcae[_0x29e887(0x243)]='fbclid',_0x1bcae))(_0x1f3173||{}),_0x1e7220=new Set(Object[_0x29e887(0x1f8)](_0x1f3173)),_0x4d6c79=_0x29e887(0x2cb),_0x1d3824,_0x3f0c25,_0x2cfa11,_0x172f69,_0x5849d8,_0x54e3fd,_0x4bc4fd,_0x4cca61=class _0x124393{constructor(){_0x5e0cad(this,_0x2cfa11),_0x5e0cad(this,_0x3f0c25,!0x1);}static[_0x29e887(0x25f)](){const _0x358a83=_0x29e887;var _0x4ce233;return _0xf07c5a(_0x124393,_0x1d3824)||(_0xba5f7e(_0x124393,_0x1d3824,new _0x124393()),_0x450f4d(_0x4ce233=_0xf07c5a(_0x124393,_0x1d3824),_0x2cfa11,_0x172f69)[_0x358a83(0x2c9)](_0x4ce233)),_0xf07c5a(_0x124393,_0x1d3824);}[_0x29e887(0x1c0)](_0x1028b6,_0x5cc7ab,_0x4d9b26){return _0x3e4330(this,null,function*(){yield _0x1937a8('#\x20recordAttribute',()=>_0x3e4330(this,null,function*(){const _0x55944c=_0x2d7d;if(_0x104477(0x1,_0x55944c(0x282)),_0x2383a1(_0x55944c(0x282),!0x0),_0x1e9091(_0x55944c(0x254),!0x0),_0x104477(0x1,_0x55944c(0x2bc)),_0x104477(0x1,'Attribute\x20Name:\x20'+_0x1028b6+_0x55944c(0x116)+_0x5cc7ab),!_0x5cc7ab||_0x5cc7ab===''){_0x104477(0x2,_0x55944c(0x25b));return;}yield _0x58e5b1[_0x55944c(0x242)](),yield _0x450f4d(this,_0x2cfa11,_0x54e3fd)[_0x55944c(0x2c9)](this);let _0x1540a1=JSON['parse'](localStorage[_0x55944c(0x2f1)]('attributes')||'{}'),_0x505016=_0x4d9b26?_0x450f4d(this,_0x2cfa11,_0x5849d8)['call'](this,_0x1540a1,_0x1028b6,_0x4d9b26):_0x450f4d(this,_0x2cfa11,_0x5849d8)[_0x55944c(0x2c9)](this,_0x1540a1,_0x1028b6);if(typeof _0x505016==_0x55944c(0x191)){_0x104477(0x2,_0x505016);return;}if(_0x1540a1[_0x1028b6][_0x55944c(0x187)]&&(yield _0x58e5b1['setIdentity'](typeof _0x5cc7ab==_0x55944c(0x191)?_0x5cc7ab:JSON[_0x55944c(0x28e)](_0x5cc7ab))),yield this[_0x55944c(0x202)](_0x1028b6,_0x5cc7ab)){_0x104477(0x1,_0x55944c(0x176)+_0x1028b6+_0x55944c(0x239)+_0x5cc7ab);return;}_0x58e5b1[_0x55944c(0x2c7)]();let {id:_0x19b455}=_0x1540a1[_0x1028b6],_0x3a168={'attributeId':_0x19b455,'attributeProperties':_0x505016,'customerId':localStorage[_0x55944c(0x2f1)](_0x55944c(0x2ba))||'','value':_0x5cc7ab};yield _0x450f4d(this,_0x2cfa11,_0x4bc4fd)[_0x55944c(0x2c9)](this,_0x3a168,_0x1028b6,_0x5cc7ab);let _0x53f1bf=JSON['parse'](localStorage['getItem']('preInitializedAttributes')||'[]');_0x53f1bf[_0x55944c(0x185)](),localStorage[_0x55944c(0x168)](_0x55944c(0x26a),JSON[_0x55944c(0x28e)](_0x53f1bf)),_0x1e9091('Recording\x20attribute\x20Time',!0x1),_0x2383a1(_0x55944c(0x282),!0x1);}));});}[_0x29e887(0x196)](){return _0x3e4330(this,null,function*(){const _0x472604=_0x2d7d;if(!localStorage[_0x472604(0x2f1)](_0x472604(0x22f))&&!_0xf07c5a(this,_0x3f0c25)){_0xba5f7e(this,_0x3f0c25,!0x0);try{let _0x1f007e=(yield this['fetchAttributeData']())['data'];_0x1f007e&&localStorage['setItem'](_0x472604(0x22f),JSON[_0x472604(0x28e)](_0x1f007e));}catch(_0x55bd1b){throw new Error(_0x472604(0x216));}finally{_0xba5f7e(this,_0x3f0c25,!0x1);}}});}[_0x29e887(0x19a)](){return _0x3e4330(this,null,function*(){const _0x204a33=_0x2d7d;try{return yield _0x55b99a[_0x204a33(0x262)](''+_0x49be67);}catch(_0x580d39){throw new Error(_0x204a33(0x204));}});}[_0x29e887(0x20c)](_0xda9722,_0x5c6b13){return _0x3e4330(this,null,function*(){const _0x362596=_0x2d7d;let _0x47cac6=_0x58e5b1[_0x362596(0x22a)](_0x362596(0x13b)),_0x1d4053;if(!_0x47cac6)_0x1d4053={};else{let _0xa27f66=_0x58e5b1['decodeData'](_0x47cac6);_0x1d4053=JSON[_0x362596(0x27a)](_0xa27f66);}_0x1d4053[_0xda9722]=_0x5c6b13;let _0x3f388c=_0x58e5b1['encodeData'](JSON['stringify'](_0x1d4053));_0x58e5b1[_0x362596(0x232)](_0x362596(0x13b),_0x3f388c,0x16d);});}[_0x29e887(0x202)](_0x1c33da,_0x5ae4a5){return _0x3e4330(this,null,function*(){const _0x7ef30e=_0x2d7d;let _0x54e409=_0x58e5b1[_0x7ef30e(0x22a)]('mergn_customer_attributes');if(!_0x54e409)return!0x1;let _0x139976=_0x58e5b1[_0x7ef30e(0x1a9)](_0x54e409),_0x266364=JSON[_0x7ef30e(0x27a)](_0x139976);return Object['prototype'][_0x7ef30e(0x23d)][_0x7ef30e(0x2c9)](_0x266364,_0x1c33da)?_0x5ae4a5!==void 0x0?_0x266364[_0x1c33da]===_0x5ae4a5:!0x0:!0x1;});}};_0x1d3824=new WeakMap(),_0x3f0c25=new WeakMap(),_0x2cfa11=new WeakSet(),_0x172f69=function(){return _0x3e4330(this,null,function*(){});},_0x5849d8=function(_0x7522d7,_0x5dd0b2,_0xe6a6bc){const _0x1e6ecb=_0x29e887;if(!Object[_0x1e6ecb(0x115)][_0x1e6ecb(0x23d)][_0x1e6ecb(0x2c9)](_0x7522d7,_0x5dd0b2))return _0x1e6ecb(0x176)+_0x5dd0b2+_0x1e6ecb(0x23a);if(!_0xe6a6bc)return[];let _0x544a4f=_0x7522d7[_0x5dd0b2];if(!(_0x544a4f!=null&&_0x544a4f[_0x1e6ecb(0x1d2)]))return _0x1e6ecb(0x176)+_0x5dd0b2+_0x1e6ecb(0x197);let _0x16a3d2=_0xe6a6bc[_0x1e6ecb(0x2af)](({attributeProperty:_0x33e4c9})=>!Object[_0x1e6ecb(0x115)][_0x1e6ecb(0x23d)][_0x1e6ecb(0x2c9)](_0x544a4f[_0x1e6ecb(0x1d2)],_0x33e4c9))[_0x1e6ecb(0x28b)](({attributeProperty:_0x2232a4})=>_0x2232a4);return _0x16a3d2[_0x1e6ecb(0x161)]>0x0?_0x1e6ecb(0x176)+_0x5dd0b2+'\x20has\x20invalid\x20attributeProperties:\x20'+_0x16a3d2[_0x1e6ecb(0x1ea)](',\x20')+'.':_0xe6a6bc[_0x1e6ecb(0x28b)](({attributeProperty:_0x25937d,value:_0x551bb1})=>({'attributePropertyId':_0x544a4f[_0x1e6ecb(0x1d2)][_0x25937d]['id'],'value':_0x551bb1}));},_0x54e3fd=function(){return _0x3e4330(this,null,function*(){const _0x292450=_0x2d7d;localStorage[_0x292450(0x2f1)](_0x292450(0x22f))||(yield this[_0x292450(0x196)]());});},_0x4bc4fd=function(_0x2716bf,_0x557f90,_0x5279c9){return _0x3e4330(this,null,function*(){const _0x53a2dc=_0x2d7d;try{let _0x310f07=yield _0x55b99a['post'](''+_0x49be67+_0x3da7b0,_0x2716bf);return yield this[_0x53a2dc(0x20c)](_0x557f90,_0x5279c9),_0x310f07;}catch(_0x1c3bc3){throw new Error(_0x53a2dc(0x159));}});},_0x5e0cad(_0x4cca61,_0x1d3824);var _0x867f5a=_0x4cca61,_0x1cb11d=_0x867f5a[_0x29e887(0x25f)](),_0x18ae18=_0x29e887(0x1ff),_0x297dbc,_0x505aaf,_0x3217da,_0x4cb10a,_0xdc28c3,_0x2e9ff9,_0x217086,_0x41705d,_0x4800a3,_0x4daedc,_0x225978,_0x536cce,_0x4cabaa,_0x23a920,_0x1edf0d,_0x3e977a,_0xc75225,_0x4d5544,_0x5d53c7,_0x5e531f=class _0x3be50d{constructor(){const _0x4ffeaa=_0x29e887;_0x5e0cad(this,_0x217086),this[_0x4ffeaa(0x1b0)]=null,this[_0x4ffeaa(0x219)]=_0x344f6b=>{const _0x567674=_0x4ffeaa;_0x104477(0x1,_0x567674(0x18c)),navigator[_0x567674(0x171)][_0x567674(0x1df)]()[_0x567674(0x1c6)](_0x6f8927=>{const _0x5e8387=_0x567674;var _0x3d749d,_0x18dd57;_0x104477(0x1,_0x5e8387(0x194)),(_0x3d749d=_0x6f8927[0x0])!=null&&_0x3d749d[_0x5e8387(0x144)]&&(_0x104477(0x1,'Service\x20Worker\x20ready'),(_0x18dd57=_0x6f8927[0x0][_0x5e8387(0x144)])==null||_0x18dd57[_0x5e8387(0x2d5)](JSON[_0x5e8387(0x28e)](_0x344f6b)));})[_0x567674(0x240)](_0xa8f334=>{const _0xd39839=_0x567674;_0x104477(0x2,_0xd39839(0x18b)+_0xa8f334[_0xd39839(0x125)]);});},this[_0x4ffeaa(0x20e)]=()=>{const _0x3a0c7b=_0x4ffeaa;_0x58e5b1[_0x3a0c7b(0x17d)]({'actionCondition':()=>!0x0,'actionMethod':_0x8a435d=>_0x450f4d(this,_0x217086,_0x23a920)['call'](this,Number(_0x8a435d[_0x3a0c7b(0x25a)])),'localStorageKey':_0x3a0c7b(0x149)});},_0x5e0cad(this,_0x4cabaa,()=>{_0x58e5b1['storeActionInLocalStorageInternal']('web_push_action');}),_0x5e0cad(this,_0x4d5544,_0x4b2320=>{const _0x3904fa=_0x4ffeaa;_0x58e5b1['clearActionInLocalStorage']({'id':_0x4b2320,'localStorageKey':_0x3904fa(0x149)});});}static[_0x29e887(0x25f)](){return _0xf07c5a(_0x3be50d,_0x297dbc)||_0xba5f7e(_0x3be50d,_0x297dbc,new _0x3be50d()),_0xf07c5a(_0x3be50d,_0x297dbc);}[_0x29e887(0x1a8)](_0x907400,_0x34f220){return _0x3e4330(this,null,function*(){const _0x34ae92=_0x2d7d;var _0xe08d27;if(_0x104477(0x1,_0x34ae92(0x1bc)),_0x135cf6[_0x34ae92(0x181)]({'eventName':_0x34ae92(0x1a8),'eventProperties':[{'eventProperty':_0x34ae92(0x25d),'value':_0x34ae92(0x171)in navigator},{'eventProperty':_0x34ae92(0x2ac),'value':_0x34ae92(0x2d4)in window}]}),_0x34ae92(0x171)in navigator&&_0x34ae92(0x2d4)in window){_0x104477(0x1,'Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported');try{_0x135cf6['recordDebugEvents']({'eventName':_0x34ae92(0x18f)}),_0xba5f7e(_0x3be50d,_0x505aaf,yield navigator[_0x34ae92(0x171)][_0x34ae92(0x27e)](_0x34f220||_0x34ae92(0x174))),_0x104477(0x1,_0x34ae92(0x179)),_0x104477(0x1,'Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization'),this[_0x34ae92(0x219)]({'customer':localStorage[_0x34ae92(0x2f1)]('customer')||'','events':_0x135cf6[_0x34ae92(0x1dd)](),'API_KEY':_0x55b99a[_0x34ae92(0x127)](),'device_id':localStorage[_0x34ae92(0x2f1)](_0x34ae92(0x2dc))||'','operatingSystem':_0x58e5b1['getOperatingSystem'](),'osVersion':_0x58e5b1[_0x34ae92(0x211)](),'Platform':_0x58e5b1['getPlatform']()}),_0xba5f7e(_0x3be50d,_0xdc28c3,!0x0);let _0x3cb7e7=_0x450f4d(this,_0x217086,_0x1edf0d)['call'](this),_0x115b0f=Object[_0x34ae92(0x1f2)](_0x3cb7e7||{});if(_0x115b0f[_0x34ae92(0x161)]&&_0x450f4d(this,_0x217086,_0x23a920)[_0x34ae92(0x2c9)](this,Number(_0x115b0f[0x0])),!_0x907400)return;let _0x741b07=yield(_0xe08d27=_0xf07c5a(_0x3be50d,_0x505aaf))==null?void 0x0:_0xe08d27[_0x34ae92(0x1ab)]['getSubscription']();_0x104477(0x1,_0x34ae92(0x268)),_0xf07c5a(_0x3be50d,_0x505aaf)&&(_0x104477(0x1,_0x34ae92(0x234)),_0xf07c5a(_0x3be50d,_0x505aaf)['update']()),_0x741b07?(_0x104477(0x1,'Existing\x20subscription\x20found'),_0x135cf6['recordDebugEvents']({'eventName':_0x34ae92(0x1a1)}),yield _0x450f4d(this,_0x217086,_0x225978)[_0x34ae92(0x2c9)](this),_0xba5f7e(_0x3be50d,_0x3217da,!0x0)):(_0x104477(0x1,_0x34ae92(0x2ca)),yield _0x450f4d(this,_0x217086,_0x41705d)[_0x34ae92(0x2c9)](this,_0xf07c5a(_0x3be50d,_0x2e9ff9)||void 0x0));}catch(_0x50147b){let _0x2720c6=_0x50147b&&_0x50147b['message']?_0x50147b[_0x34ae92(0x125)][_0x34ae92(0x26b)](0x0,0x64):_0x34ae92(0x2ab);yield _0x135cf6[_0x34ae92(0x181)]({'eventName':_0x34ae92(0x2c2),'eventProperties':[{'eventProperty':'message','value':''+_0x2720c6}]}),_0x104477(0x2,'Service\x20Worker\x20registration\x20failed:'),_0x104477(0x2,_0x2720c6);}}});}[_0x29e887(0x170)](_0x3cd67c){const _0x307252=_0x29e887;if(!_0xf07c5a(_0x3be50d,_0xdc28c3)){_0xba5f7e(_0x3be50d,_0x2e9ff9,_0x3cd67c),_0x135cf6[_0x307252(0x181)]({'eventName':_0x307252(0x21d)}),_0x104477(0x2,_0x307252(0x288));return;}_0x1937a8(_0x307252(0x170),()=>_0x3e4330(this,null,function*(){const _0x49b309=_0x307252;let _0x2a16ae=JSON[_0x49b309(0x27a)](localStorage[_0x49b309(0x2f1)]('web_push_action')||'{}');if(_0x2a16ae&&_0x2a16ae[_0x3cd67c[_0x49b309(0x25a)]]){_0x104477(0x1,'Notification\x20already\x20in\x20cache');return;}_0x450f4d(this,_0x217086,_0x536cce)[_0x49b309(0x2c9)](this,_0x3cd67c),_0xf07c5a(this,_0x4cabaa)[_0x49b309(0x2c9)](this),_0x450f4d(this,_0x217086,_0x23a920)[_0x49b309(0x2c9)](this,_0x3cd67c[_0x49b309(0x25a)]);}));}};_0x297dbc=new WeakMap(),_0x505aaf=new WeakMap(),_0x3217da=new WeakMap(),_0x4cb10a=new WeakMap(),_0xdc28c3=new WeakMap(),_0x2e9ff9=new WeakMap(),_0x217086=new WeakSet(),_0x41705d=function(_0x264672){return _0x3e4330(this,null,function*(){const _0x55f55c=_0x2d7d;_0x104477(0x1,_0x55f55c(0x235)+JSON[_0x55f55c(0x28e)](_0x264672)+'\x20'),_0x135cf6[_0x55f55c(0x181)]({'eventName':_0x55f55c(0x21a)});let _0x393ce3;try{if(_0x393ce3=Notification['permission'],_0x393ce3){if(_0x104477(0x1,'Notification\x20permission:\x20'+_0x393ce3),_0x393ce3===_0x55f55c(0x213))_0x264672||(this[_0x55f55c(0x1b0)]=_0x55f55c(0x213),_0x135cf6[_0x55f55c(0x181)]({'eventName':_0x55f55c(0x2de)})),_0x264672&&(_0x135cf6[_0x55f55c(0x181)]({'eventName':_0x55f55c(0x135),'eventProperties':[{'eventProperty':_0x55f55c(0x1ec),'value':''+(_0x264672==null?void 0x0:_0x264672[_0x55f55c(0x1ec)])}]}),_0xf07c5a(this,_0x4d5544)[_0x55f55c(0x2c9)](this,_0x264672['web_optin_instance_id']),_0x264672[_0x55f55c(0x1ec)]==='two_step'?_0x450f4d(this,_0x217086,_0x4800a3)['call'](this,_0x264672):yield _0x450f4d(this,_0x217086,_0x4daedc)[_0x55f55c(0x2c9)](this,_0x264672));else{if(_0x393ce3===_0x55f55c(0x2db))_0x135cf6[_0x55f55c(0x181)]({'eventName':_0x55f55c(0x12f)}),_0x104477(0x1,_0x55f55c(0x16d)),_0x264672&&_0x264672['web_optin_instance_id']&&_0xf07c5a(this,_0x4d5544)['call'](this,_0x264672[_0x55f55c(0x25a)]);else{if(_0x264672&&_0x264672[_0x55f55c(0x25a)]){_0xf07c5a(this,_0x4d5544)['call'](this,_0x264672['web_optin_instance_id']);return;}_0x135cf6['recordDebugEvents']({'eventName':_0x55f55c(0x166)}),_0x104477(0x1,_0x55f55c(0x1d5)),_0xf07c5a(_0x5e531f,_0x3217da)||(yield _0x450f4d(this,_0x217086,_0x225978)['call'](this),yield _0x135cf6[_0x55f55c(0x19c)]({'eventName':_0x55f55c(0x278)}),_0x264672||_0xba5f7e(_0x5e531f,_0x3217da,!0x0));}}}}catch(_0x402e43){_0x104477(0x2,'Failed\x20to\x20check\x20notification\x20permission'),_0x135cf6[_0x55f55c(0x181)]({'eventName':_0x55f55c(0x296)});}});},_0x4800a3=function(_0x59d850){const _0xcea548=_0x29e887;try{let _0x561401=document[_0xcea548(0x1a4)]('div'),_0x3f436e;_0x59d850[_0xcea548(0x2a2)][_0xcea548(0x295)]&&(_0x3f436e=document[_0xcea548(0x1a4)](_0xcea548(0x2b3)),_0x3f436e[_0xcea548(0x2b4)]=_0x59d850[_0xcea548(0x2a2)][_0xcea548(0x295)],_0x3f436e[_0xcea548(0x134)]=_0xcea548(0x2d3),_0x3f436e['id']='centered-image');let _0x3256af=document[_0xcea548(0x1a4)]('div'),_0x24a9ab=document[_0xcea548(0x1a4)]('div'),_0x2086f2=document[_0xcea548(0x1a4)](_0xcea548(0x190)),_0x166ab6=document[_0xcea548(0x1a4)](_0xcea548(0x2b3)),_0x16a159=document[_0xcea548(0x1a4)]('div'),_0x57a79f=document[_0xcea548(0x1a4)]('div'),_0x214573=document[_0xcea548(0x1a4)](_0xcea548(0x190)),_0x35cf3b=document[_0xcea548(0x1a4)]('div'),_0xf3cdc4=document['createElement']('div'),_0x98918e=document[_0xcea548(0x1a4)](_0xcea548(0x190)),_0x26d9c9=document[_0xcea548(0x1a4)](_0xcea548(0x256)),_0x4b7d74=document['createElement'](_0xcea548(0x256));_0x561401['className']='mergn-overlay',_0x3256af[_0xcea548(0x277)]='mergnWebPushPopup',_0x24a9ab[_0xcea548(0x277)]=_0x35cf3b[_0xcea548(0x277)]=_0xf3cdc4[_0xcea548(0x277)]=_0xcea548(0x122),_0x2086f2[_0xcea548(0x277)]='mergn-column-25',_0x16a159[_0xcea548(0x277)]=_0xcea548(0x138),_0x98918e[_0xcea548(0x277)]=_0xcea548(0x292),_0x57a79f['id']=_0xcea548(0x169),_0x214573['id']='subtitle',_0x26d9c9['id']=_0xcea548(0x18d),_0x4b7d74['id']='button-2',_0x166ab6[_0xcea548(0x2b4)]=_0x59d850['banner_design'][_0xcea548(0x28f)],_0x166ab6[_0xcea548(0x134)]=_0xcea548(0x2d3),_0x166ab6['id']='logo',_0x57a79f[_0xcea548(0x167)]=_0x59d850['banner_design']['banner_title'],_0x214573[_0xcea548(0x167)]=_0x59d850[_0xcea548(0x2a2)]['banner_text'],_0x26d9c9[_0xcea548(0x167)]=_0x59d850[_0xcea548(0x2a2)]['button_1']['text'],_0x4b7d74['textContent']=_0x59d850['banner_design'][_0xcea548(0x230)][_0xcea548(0x1c3)],_0x2086f2['appendChild'](_0x166ab6),_0x16a159[_0xcea548(0x259)](_0x57a79f),_0x16a159[_0xcea548(0x259)](_0x214573),_0x24a9ab[_0xcea548(0x259)](_0x2086f2),_0x24a9ab[_0xcea548(0x259)](_0x16a159),_0x3f436e&&(_0x35cf3b[_0xcea548(0x259)](_0x3f436e),_0x3f436e[_0xcea548(0x206)][_0xcea548(0x27d)]='\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'),_0x98918e['appendChild'](_0x26d9c9),_0x98918e['appendChild'](_0x4b7d74),_0xf3cdc4['appendChild'](_0x98918e),_0x3256af['appendChild'](_0x24a9ab),_0x3256af['appendChild'](_0x35cf3b),_0x3256af[_0xcea548(0x259)](_0xf3cdc4),_0x561401[_0xcea548(0x259)](_0x3256af),_0x561401['style'][_0xcea548(0x27d)]=_0xcea548(0x1f5),_0x3256af[_0xcea548(0x206)][_0xcea548(0x27d)]=_0xcea548(0x195)+_0x59d850[_0xcea548(0x2a2)]['banner_color']+';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a',_0x24a9ab['style']['cssText']=_0x35cf3b[_0xcea548(0x206)][_0xcea548(0x27d)]=_0xf3cdc4[_0xcea548(0x206)][_0xcea548(0x27d)]=_0xcea548(0x2c8),_0x2086f2[_0xcea548(0x206)][_0xcea548(0x27d)]='\x0awidth:\x2025%;\x0a',_0x16a159['style'][_0xcea548(0x27d)]=_0xcea548(0x24e),_0x166ab6[_0xcea548(0x206)][_0xcea548(0x27d)]='\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a',_0x26d9c9[_0xcea548(0x206)][_0xcea548(0x27d)]=_0xcea548(0x1fe)+_0x59d850[_0xcea548(0x2a2)][_0xcea548(0x236)][_0xcea548(0x2a3)]+_0xcea548(0x1fb)+_0x59d850[_0xcea548(0x2a2)][_0xcea548(0x236)][_0xcea548(0x2da)]+_0xcea548(0x16b),_0x4b7d74[_0xcea548(0x206)][_0xcea548(0x27d)]=_0xcea548(0x1fe)+_0x59d850[_0xcea548(0x2a2)][_0xcea548(0x230)][_0xcea548(0x2a3)]+_0xcea548(0x1fb)+_0x59d850['banner_design'][_0xcea548(0x230)][_0xcea548(0x2da)]+_0xcea548(0x16b),_0x98918e[_0xcea548(0x206)][_0xcea548(0x27d)]='\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a',_0x57a79f['style'][_0xcea548(0x27d)]='\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20'+_0x59d850[_0xcea548(0x2a2)]['text_color']+'\x0a',_0x214573[_0xcea548(0x206)]['cssText']=_0xcea548(0x1f9)+_0x59d850[_0xcea548(0x2a2)][_0xcea548(0x145)]+'\x0a',document[_0xcea548(0x2ad)][_0xcea548(0x259)](_0x561401),document[_0xcea548(0x2ad)][_0xcea548(0x206)][_0xcea548(0x1fd)]=_0xcea548(0x1b4),_0x135cf6[_0xcea548(0x19c)]({'eventName':_0xcea548(0x272),'name':_0xcea548(0x2f2),'web_optin_instance_id':_0x59d850['web_optin_instance_id']}),_0x26d9c9==null||_0x26d9c9[_0xcea548(0x131)](_0xcea548(0x1b9),()=>_0x3e4330(this,null,function*(){const _0x1b311e=_0xcea548;_0x561401['remove'](),_0xba5f7e(_0x5e531f,_0x4cb10a,!0x1),document['body'][_0x1b311e(0x206)]['overflow']=_0x1b311e(0x203),yield _0x135cf6['recordEvent']({'eventName':_0x1b311e(0x21c),'web_optin_instance_id':_0x59d850[_0x1b311e(0x25a)]}),_0x104477(0x1,_0x1b311e(0x270));})),_0x4b7d74==null||_0x4b7d74[_0xcea548(0x131)](_0xcea548(0x1b9),()=>_0x3e4330(this,null,function*(){const _0x1771c4=_0xcea548;_0x561401[_0x1771c4(0x2b6)](),document[_0x1771c4(0x2ad)][_0x1771c4(0x206)][_0x1771c4(0x1fd)]='auto',_0x135cf6['recordEvent']({'eventName':_0x1771c4(0x1c5),'web_optin_instance_id':_0x59d850[_0x1771c4(0x25a)]}),yield _0x450f4d(this,_0x217086,_0x4daedc)[_0x1771c4(0x2c9)](this,_0x59d850);}));}catch(_0x16b981){}},_0x4daedc=function(_0x4d0a0c){return _0x3e4330(this,null,function*(){const _0x61796d=_0x2d7d;try{_0x135cf6['recordEvent']({'eventName':_0x61796d(0x1e6),'name':_0x61796d(0x2f2),'web_optin_instance_id':_0x4d0a0c[_0x61796d(0x25a)]});let _0x316fb0=yield Notification[_0x61796d(0x2df)]();_0x316fb0===_0x61796d(0x1b7)?(_0x104477(0x1,_0x61796d(0x1f0)),yield _0x450f4d(this,_0x217086,_0x225978)['call'](this),yield _0x135cf6['recordEvent']({'eventName':_0x61796d(0x267),'name':'subscribed','web_optin_instance_id':_0x4d0a0c[_0x61796d(0x25a)]})):_0x316fb0===_0x61796d(0x2db)?(yield _0x135cf6[_0x61796d(0x19c)]({'eventName':_0x61796d(0x160)}),_0x104477(0x1,_0x61796d(0x270))):_0x316fb0==='default'&&(yield _0x135cf6[_0x61796d(0x19c)]({'eventName':'Closed\x20Web\x20Push\x20Subscription'}),_0x104477(0x1,_0x61796d(0x2c5)));}catch(_0x31048d){_0x104477(0x2,'Failed\x20to\x20request\x20notification\x20permission');}_0xba5f7e(_0x5e531f,_0x4cb10a,!0x1);});},_0x225978=function(){return _0x3e4330(this,null,function*(){const _0x2a68b9=_0x2d7d;var _0x5284fb,_0x42b510;let _0x8ea59f=yield _0x55b99a[_0x2a68b9(0x262)](''+_0x1391e7);if(_0x8ea59f[_0x2a68b9(0x264)]){let _0xc23f26=yield(_0x5284fb=_0xf07c5a(_0x5e531f,_0x505aaf))==null?void 0x0:_0x5284fb[_0x2a68b9(0x1ab)][_0x2a68b9(0x252)]();_0xc23f26&&(yield _0xc23f26[_0x2a68b9(0x25c)]());let _0x133974=yield(_0x42b510=_0xf07c5a(_0x5e531f,_0x505aaf))==null?void 0x0:_0x42b510['pushManager'][_0x2a68b9(0x1f6)]({'applicationServerKey':_0x8ea59f[_0x2a68b9(0x1cd)]||'','userVisibleOnly':!0x0}),_0x5cd2f0=localStorage['getItem'](_0x2a68b9(0x2ba))||'';(!_0x5cd2f0||_0x5cd2f0!==_0x2a68b9(0x2ab))&&(yield _0x58e5b1[_0x2a68b9(0x192)]()),yield _0x55b99a[_0x2a68b9(0x1a7)](''+_0x20bad6,{'customer_id':localStorage[_0x2a68b9(0x2f1)](_0x2a68b9(0x2ba)),'device_id':localStorage[_0x2a68b9(0x2f1)](_0x2a68b9(0x2dc)),'device_platform':_0x58e5b1[_0x2a68b9(0x2a6)](),'is_web_push_subscribed':!0x0,'os':_0x58e5b1[_0x2a68b9(0x244)](),'web_push_subscription_page_url':window[_0x2a68b9(0x2aa)][_0x2a68b9(0x27b)],'web_push_token':{'token':JSON['parse'](JSON[_0x2a68b9(0x28e)](_0x133974))}}),_0x104477(0x1,_0x2a68b9(0x2ef));}else throw new Error(_0x2a68b9(0x162));});},_0x536cce=function(_0x12c928){const _0x26f2cb=_0x29e887;_0x58e5b1[_0x26f2cb(0x152)](_0x12c928,'web_push_action',_0x26f2cb(0x25a));},_0x4cabaa=new WeakMap(),_0x23a920=function(_0x4076b6){const _0x48118a=_0x29e887;if(_0xf07c5a(_0x5e531f,_0x4cb10a))return;_0xba5f7e(_0x5e531f,_0x4cb10a,!0x0);let _0x3ef88e=_0x450f4d(this,_0x217086,_0x1edf0d)[_0x48118a(0x2c9)](this);if(_0x3ef88e!=null&&_0x3ef88e[_0x4076b6])switch(_0x3ef88e[_0x4076b6][_0x48118a(0x290)]){case'DELAY':{_0x450f4d(this,_0x217086,_0x3e977a)[_0x48118a(0x2c9)](this,_0x3ef88e[_0x4076b6]);break;}case'IMMEDIATELY':{_0x450f4d(this,_0x217086,_0xc75225)['call'](this,_0x3ef88e[_0x4076b6]);break;}case _0x48118a(0x2a9):{_0x450f4d(this,_0x217086,_0x5d53c7)[_0x48118a(0x2c9)](this,_0x3ef88e[_0x4076b6]);break;}default:return;}},_0x1edf0d=function(){const _0x980a87=_0x29e887;let _0x27216f=localStorage[_0x980a87(0x2f1)](_0x980a87(0x149));return _0x27216f?JSON['parse'](_0x27216f):null;},_0x3e977a=function(_0x41c223){const _0x15eb16=_0x29e887;_0x58e5b1[_0x15eb16(0x201)]({'clearActionMethod':_0xf07c5a(this,_0x4d5544)[_0x15eb16(0x150)](this),'data':_0x41c223,'displayMethod':_0x450f4d(this,_0x217086,_0xc75225)[_0x15eb16(0x150)](this),'idKey':'web_optin_instance_id','timeValueKey':_0x15eb16(0x147)});},_0xc75225=function(_0x307503){const _0x7f81fa=_0x29e887;_0x450f4d(this,_0x217086,_0x41705d)[_0x7f81fa(0x2c9)](this,_0x307503);},_0x4d5544=new WeakMap(),_0x5d53c7=function(_0x477f4f){const _0x462d4c=_0x29e887;_0x58e5b1[_0x462d4c(0x1d9)]({'data':_0x477f4f,'displayMethod':_0x450f4d(this,_0x217086,_0xc75225)[_0x462d4c(0x150)](this),'timeValueKey':'entry_time_value'});},_0x5e0cad(_0x5e531f,_0x297dbc),_0x5e0cad(_0x5e531f,_0x505aaf,null),_0x5e0cad(_0x5e531f,_0x3217da,!0x1),_0x5e0cad(_0x5e531f,_0x4cb10a,!0x1),_0x5e0cad(_0x5e531f,_0xdc28c3,!0x1),_0x5e0cad(_0x5e531f,_0x2e9ff9,null);var _0xf3757f=_0x5e531f,_0x4a23f4=_0xf3757f[_0x29e887(0x25f)](),_0x452ecf,_0xbee2dc,_0x34a4ee,_0x3d1b90,_0x10ae03,_0x5cd9ba,_0x5d1db8,_0x54cb02,_0x291348,_0x358a9e,_0x144571,_0x13682d,_0x226b14=class _0x5c4114{constructor(){const _0x41e293=_0x29e887;_0x5e0cad(this,_0xbee2dc),_0x5e0cad(this,_0x5d1db8,_0x5e5411=>{const _0x3e1948=_0x2d7d;_0x58e5b1[_0x3e1948(0x139)]({'id':_0x5e5411,'localStorageKey':_0x3e1948(0x207)});}),this[_0x41e293(0x16c)]=()=>{const _0x4a2fa4=_0x41e293;_0x58e5b1['loadActionInLocalStorage']({'actionCondition':_0x1e0ae9=>_0x1e0ae9['message'][_0x4a2fa4(0x1ac)]==='Popup','actionMethod':_0x4a7a58=>_0x450f4d(this,_0xbee2dc,_0x3d1b90)[_0x4a2fa4(0x2c9)](this,_0x4a7a58['campaignId']),'localStorageKey':_0x4a2fa4(0x207)});},_0x5e0cad(this,_0x13682d,()=>{const _0xb88c84=_0x41e293;_0x58e5b1[_0xb88c84(0x20a)]('action');});}static[_0x29e887(0x25f)](){const _0x1001d0=_0x29e887;var _0x58836a;return _0xf07c5a(_0x5c4114,_0x452ecf)||(_0xba5f7e(_0x5c4114,_0x452ecf,new _0x5c4114()),_0x450f4d(_0x58836a=_0xf07c5a(_0x5c4114,_0x452ecf),_0xbee2dc,_0x34a4ee)[_0x1001d0(0x2c9)](_0x58836a)),_0xf07c5a(_0x5c4114,_0x452ecf);}[_0x29e887(0x1ed)](_0x404e99){const _0x417ff8=_0x29e887;let _0x42f719=JSON['parse'](localStorage['getItem'](_0x417ff8(0x207))||'{}');if(_0x42f719&&_0x42f719[_0x404e99==null?void 0x0:_0x404e99[_0x417ff8(0x12e)]]){_0x104477(0x1,_0x417ff8(0x173));return;}_0x450f4d(this,_0xbee2dc,_0x144571)[_0x417ff8(0x2c9)](this,_0x404e99),_0xf07c5a(this,_0x13682d)['call'](this),_0x450f4d(this,_0xbee2dc,_0x3d1b90)[_0x417ff8(0x2c9)](this,_0x404e99[_0x417ff8(0x12e)]);}[_0x29e887(0x2eb)](_0x26fd2f){const _0x344748=_0x29e887;return _0x26fd2f===_0x344748(0x1cb);}};_0x452ecf=new WeakMap(),_0xbee2dc=new WeakSet(),_0x34a4ee=function(){return _0x3e4330(this,null,function*(){});},_0x3d1b90=function(_0x229fee){const _0xce9ae0=_0x29e887;let _0x150a08=_0x450f4d(this,_0xbee2dc,_0x10ae03)['call'](this);if(document['getElementById']('popup_container_'+_0x229fee)){_0x104477(0x1,_0xce9ae0(0x281)),_0xf07c5a(this,_0x5d1db8)[_0xce9ae0(0x2c9)](this,_0x229fee);return;}if(_0x150a08!=null&&_0x150a08[_0x229fee])switch(_0x150a08[_0x229fee][_0xce9ae0(0x273)]){case _0xce9ae0(0x285):{_0x450f4d(this,_0xbee2dc,_0x5cd9ba)[_0xce9ae0(0x2c9)](this,_0x150a08[_0x229fee]);break;}case _0xce9ae0(0x227):{_0x450f4d(this,_0xbee2dc,_0x54cb02)[_0xce9ae0(0x2c9)](this,_0x150a08[_0x229fee]);break;}case _0xce9ae0(0x2a9):{_0x450f4d(this,_0xbee2dc,_0x358a9e)[_0xce9ae0(0x2c9)](this,_0x150a08[_0x229fee]);break;}default:return;}},_0x10ae03=function(){const _0x4f903f=_0x29e887;let _0x9c938f=localStorage['getItem'](_0x4f903f(0x207));return _0x9c938f?JSON[_0x4f903f(0x27a)](_0x9c938f):null;},_0x5cd9ba=function(_0x1e29e6){const _0x393195=_0x29e887;_0x58e5b1[_0x393195(0x201)]({'clearActionMethod':_0xf07c5a(this,_0x5d1db8)[_0x393195(0x150)](this),'data':_0x1e29e6,'displayMethod':_0x450f4d(this,_0xbee2dc,_0x54cb02)[_0x393195(0x150)](this),'idKey':'campaignId','timeValueKey':_0x393195(0x1f3)});},_0x5d1db8=new WeakMap(),_0x54cb02=function(_0x571ec1){const _0x8503a8=_0x29e887;if(document['getElementById'](_0x8503a8(0x27c)+_0x571ec1['campaignId']))_0x104477(0x1,_0x8503a8(0x281));else{let _0x5e6bf5=_0x450f4d(this,_0xbee2dc,_0x291348)['call'](this,_0x8503a8(0x190),_0x571ec1);document['body'][_0x8503a8(0x259)](_0x5e6bf5),_0x135cf6['recordEvent']({'campaignCustomerInstanceId':_0x571ec1[_0x8503a8(0x188)],'campaignId':_0x571ec1[_0x8503a8(0x12e)],'eventName':_0x4d6c79,'eventProperties':[{'eventProperty':_0x8503a8(0x1d1),'value':JSON[_0x8503a8(0x28e)]({'campaignId':_0x571ec1[_0x8503a8(0x12e)]})}],'name':_0x8503a8(0x217)});}_0xf07c5a(this,_0x5d1db8)[_0x8503a8(0x2c9)](this,_0x571ec1[_0x8503a8(0x12e)]);},_0x291348=function(_0x3e9b9e,_0x106916){const _0x4e16a5=_0x29e887;let {campaignCustomerInstanceId:_0xab76c9,campaignId:_0x3225c2,message:{design:_0x53f2b4}}=_0x106916,_0x43e01d=document[_0x4e16a5(0x1a4)](_0x3e9b9e);_0x43e01d['id']=_0x4e16a5(0x27c)+_0x3225c2,_0x43e01d[_0x4e16a5(0x155)]=_0x53f2b4,_0x43e01d[_0x4e16a5(0x206)]['position']='fixed',_0x43e01d[_0x4e16a5(0x206)]['top']='0',_0x43e01d[_0x4e16a5(0x206)][_0x4e16a5(0x284)]='0',_0x43e01d[_0x4e16a5(0x206)]['width']='100%',_0x43e01d['style'][_0x4e16a5(0x184)]=_0x4e16a5(0x12d),_0x43e01d[_0x4e16a5(0x206)][_0x4e16a5(0x17e)]=_0x4e16a5(0x1a3);let _0x3f204c=_0x43e01d[_0x4e16a5(0x21f)]('.u-popup-container');_0x3f204c&&(_0x3f204c[_0x4e16a5(0x206)][_0x4e16a5(0x17e)]='50');let _0x4626d1=_0x3f204c[_0x4e16a5(0x21f)](_0x4e16a5(0x1a2));_0x4626d1&&(_0x104477(0x1,_0x4e16a5(0x175)),_0x4626d1[_0x4e16a5(0x206)][_0x4e16a5(0x2ec)](_0x4e16a5(0x228),_0x4e16a5(0x261),'important'));let _0x3cc943;_0x43e01d[_0x4e16a5(0x1d3)]('[id^=\x22u_content_form_\x22]')[_0x4e16a5(0x214)](_0x5eb3ca=>{const _0x418f5b=_0x4e16a5;let _0x33a972=_0x5eb3ca[_0x418f5b(0x21f)](_0x418f5b(0x11c));_0x33a972&&(_0x33a972[_0x418f5b(0x1d3)]('input')[_0x418f5b(0x214)](_0x46288b=>{const _0x463f4e=_0x418f5b;_0x46288b[_0x463f4e(0x206)][_0x463f4e(0x2ec)]('padding',_0x46288b[_0x463f4e(0x206)][_0x463f4e(0x200)],_0x463f4e(0x29a));}),_0x33a972[_0x418f5b(0x131)](_0x418f5b(0x2d0),()=>_0x3e4330(this,null,function*(){const _0x94b0fb=_0x418f5b;_0x43e01d['remove']();let _0x3c1e52=new FormData(_0x33a972),_0xf5759f={};_0x104477(0x1,_0x94b0fb(0x1e0));for(let [_0x43f840,_0x12f294]of _0x3c1e52[_0x94b0fb(0x1ad)]())_0xf5759f[_0x43f840]=_0x12f294,_0x104477(0x1,_0x43f840+':\x20'+_0x12f294),_0x1cb11d['recordAttribute'](_0x43f840,_0x12f294[_0x94b0fb(0x136)]());yield _0x135cf6[_0x94b0fb(0x19c)]({'campaignCustomerInstanceId':_0xab76c9,'campaignId':_0x3225c2,'eventName':_0x4d6c79,'eventProperties':[{'eventProperty':_0x94b0fb(0x2ae),'value':JSON[_0x94b0fb(0x28e)]({'campaignId':_0x3225c2,'formId':_0x5eb3ca['id'],'formValues':_0xf5759f})},{'eventProperty':_0x94b0fb(0x1c1),'value':_0x3225c2[_0x94b0fb(0x136)]()}],'name':'form'});})));});let _0x3067a3=_0x43e01d[_0x4e16a5(0x21f)]('.u-close-button');return(_0x3067a3==null?void 0x0:_0x3067a3['getAttribute'](_0x4e16a5(0x17c)))==='#'&&_0x3067a3[_0x4e16a5(0x2be)](_0x4e16a5(0x17c)),_0x3067a3==null||_0x3067a3[_0x4e16a5(0x131)](_0x4e16a5(0x1b9),()=>_0x3e4330(this,null,function*(){const _0x14c178=_0x4e16a5;var _0x5594a6;_0x43e01d[_0x14c178(0x2b6)](),_0x3cc943&&((_0x5594a6=document['getElementById'](_0x3cc943))==null||_0x5594a6[_0x14c178(0x2b6)]()),yield _0x135cf6[_0x14c178(0x19c)]({'campaignCustomerInstanceId':_0xab76c9,'campaignId':_0x3225c2,'eventName':_0x4d6c79,'eventProperties':[{'eventProperty':_0x14c178(0x20b),'value':JSON[_0x14c178(0x28e)]({'campaignId':_0x3225c2})}],'name':_0x14c178(0x1aa)});})),_0x43e01d['querySelectorAll'](_0x4e16a5(0x17a))[_0x4e16a5(0x214)](_0x1563dc=>{const _0x32e552=_0x4e16a5;_0x1563dc['addEventListener'](_0x32e552(0x1b9),()=>_0x3e4330(this,null,function*(){const _0x53c1e2=_0x32e552;_0x43e01d[_0x53c1e2(0x2b6)](),yield _0x135cf6[_0x53c1e2(0x19c)]({'campaignCustomerInstanceId':_0xab76c9,'campaignId':_0x3225c2,'eventName':_0x4d6c79,'eventProperties':[{'eventProperty':_0x53c1e2(0x210),'value':JSON['stringify']({'buttonId':_0x1563dc['id'],'campaignId':_0x3225c2})}],'name':_0x53c1e2(0x1b9)});}));}),_0x43e01d['querySelectorAll']('.u-popup-container\x20img')['forEach'](_0x22c706=>{const _0x5800df=_0x4e16a5;_0x22c706[_0x5800df(0x131)](_0x5800df(0x1b9),()=>_0x3e4330(this,null,function*(){const _0x12e228=_0x5800df;_0x43e01d[_0x12e228(0x2b6)](),yield _0x135cf6[_0x12e228(0x19c)]({'campaignCustomerInstanceId':_0xab76c9,'campaignId':_0x3225c2,'eventName':_0x4d6c79,'eventProperties':[{'eventProperty':_0x12e228(0x231),'value':JSON['stringify']({'campaignId':_0x3225c2,'imageClassName':_0x22c706[_0x12e228(0x277)],'imageId':_0x22c706['id']})}],'name':_0x12e228(0x1b9)});}));}),_0x43e01d;},_0x358a9e=function(_0xe5473c){const _0x696894=_0x29e887;_0x58e5b1[_0x696894(0x1d9)]({'data':_0xe5473c,'displayMethod':_0x450f4d(this,_0xbee2dc,_0x54cb02)[_0x696894(0x150)](this),'timeValueKey':'campaignEntryTimeValue'});},_0x144571=function(_0x2dfb73){const _0x4af509=_0x29e887;_0x58e5b1[_0x4af509(0x152)](_0x2dfb73,'action',_0x4af509(0x12e));},_0x13682d=new WeakMap(),_0x5e0cad(_0x226b14,_0x452ecf);var _0x5df3ef=_0x226b14,_0xd40005=_0x5df3ef[_0x29e887(0x25f)](),_0x1d2067,_0x11c396,_0x2b8260,_0xe1401b,_0x3f039c,_0x4e43e4,_0x5457fe,_0x5051e3,_0x541627=class _0x2ee0e4{constructor(){const _0xc80894=_0x29e887;_0x5e0cad(this,_0x11c396),this['queue']=Promise[_0xc80894(0x15d)]();}static[_0x29e887(0x25f)](){const _0x19ebbf=_0x29e887;var _0x415398;return _0xf07c5a(_0x2ee0e4,_0x1d2067)||(_0xba5f7e(_0x2ee0e4,_0x1d2067,new _0x2ee0e4()),_0x450f4d(_0x415398=_0xf07c5a(_0x2ee0e4,_0x1d2067),_0x11c396,_0x2b8260)[_0x19ebbf(0x2c9)](_0x415398)),_0xf07c5a(_0x2ee0e4,_0x1d2067);}[_0x29e887(0x11f)](_0x51032a){const _0x3fbe77=_0x29e887;let _0x5275ca=JSON[_0x3fbe77(0x27a)](localStorage[_0x3fbe77(0x2f1)]('preInitializedEvents')||'[]');_0x5275ca[_0x3fbe77(0x2b5)](_0x51032a),localStorage['setItem'](_0x3fbe77(0x14e),JSON[_0x3fbe77(0x28e)](_0x5275ca));}['recordEventsFromQueue'](){return _0x3e4330(this,null,function*(){const _0x9c597f=_0x2d7d;let _0x48321c=JSON[_0x9c597f(0x27a)](localStorage[_0x9c597f(0x2f1)](_0x9c597f(0x14e))||'[]');if(Array['isArray'](_0x48321c)){for(let _0x7494ca of _0x48321c)yield this[_0x9c597f(0x154)](_0x7494ca);}});}['recordEvent'](_0x3ad388,_0x1eeec7){return _0x3e4330(this,null,function*(){const _0x423475=_0x2d7d;_0x411b77[_0x423475(0x1b2)]&&!_0x411b77['loading']?yield _0x450f4d(this,_0x11c396,_0xe1401b)[_0x423475(0x2c9)](this,_0x3ad388,_0x1eeec7):this['pushToQueue'](_0x3ad388);});}[_0x29e887(0x154)](_0x17ebf2){return _0x3e4330(this,null,function*(){const _0xc89378=_0x2d7d;try{yield _0x450f4d(this,_0x11c396,_0xe1401b)[_0xc89378(0x2c9)](this,_0x17ebf2);}finally{_0x450f4d(this,_0x11c396,_0x5051e3)[_0xc89378(0x2c9)](this,_0x17ebf2[_0xc89378(0x249)]);}});}[_0x29e887(0x181)](_0x39eacb){return _0x3e4330(this,null,function*(){const _0x47ecb0=_0x2d7d;_0x411b77[_0x47ecb0(0x250)]===0x4&&(!_0x411b77[_0x47ecb0(0x2b8)]||_0x411b77[_0x47ecb0(0x2b8)][_0x39eacb[_0x47ecb0(0x249)]])&&(yield _0x450f4d(this,_0x11c396,_0xe1401b)[_0x47ecb0(0x2c9)](this,_0x39eacb));});}['getStoredEvents'](){const _0xba7d96=_0x29e887;let _0x5da9d5=localStorage[_0xba7d96(0x2f1)](_0xba7d96(0x157));return _0x5da9d5?JSON['parse'](_0x5da9d5):{};}[_0x29e887(0x14a)](){return _0x3e4330(this,null,function*(){const _0x34cb09=_0x2d7d;if(!localStorage[_0x34cb09(0x2f1)]('events')){let _0x57acd9=(yield this[_0x34cb09(0x2bd)]())[_0x34cb09(0x1cd)];if(_0x57acd9){localStorage[_0x34cb09(0x168)](_0x34cb09(0x157),JSON['stringify'](_0x57acd9));try{_0x4a23f4['pushMessageToSW']({'events':_0x57acd9});}catch(_0x3881ed){}}}});}['fetchEventData'](){return _0x3e4330(this,null,function*(){const _0x1e4369=_0x2d7d;try{return yield _0x55b99a[_0x1e4369(0x262)](''+_0x361ab2);}catch(_0x5a48b9){throw new Error('Error\x20fetching\x20event\x20data');}});}[_0x29e887(0x1c2)](_0x169249,_0x2f5b82){return _0x3e4330(this,null,function*(){const _0x3ac311=_0x2d7d;let _0x40f38b=null,_0x2e641a=null,_0x30ade0=new AbortController();return this[_0x3ac311(0x11d)]=this[_0x3ac311(0x11d)][_0x3ac311(0x1c6)](()=>_0x3e4330(this,null,function*(){const _0x17bae8=_0x3ac311;try{if(_0x169249[_0x17bae8(0x157)][_0x17bae8(0x161)]===0x0)throw new Error('No\x20events\x20to\x20record');let _0x57fd4f=yield _0x55b99a[_0x17bae8(0x1a5)](_0x17bae8(0x29f)+_0x361ab2+_0x98fadf,_0x169249,_0x30ade0[_0x17bae8(0x2bb)]);if(_0x57fd4f['success'])return _0x2e641a=_0x57fd4f,_0x57fd4f;if(_0x57fd4f[_0x17bae8(0x125)]==='Customer\x20with\x20id\x20'+localStorage[_0x17bae8(0x2f1)]('customer')+_0x17bae8(0x117))throw localStorage[_0x17bae8(0x2b7)](_0x17bae8(0x2ba)),new Error('Re\x20initializing\x20customer\x20Id');}catch(_0x55c429){throw _0x104477(0x2,_0x17bae8(0x287)),_0x104477(0x2,_0x17bae8(0x17f)+_0x55c429[_0x17bae8(0x1ac)]),_0x104477(0x2,'message:\x20'+_0x55c429['message']),(_0x55c429[_0x17bae8(0x1ac)]===_0x17bae8(0x128)||_0x55c429[_0x17bae8(0x1ac)]==='TypeError'&&_0x55c429[_0x17bae8(0x125)]===_0x17bae8(0x209)||_0x55c429[_0x17bae8(0x125)]===_0x17bae8(0x1ae))&&(_0x104477(0x2,'Request\x20aborted'),_0x2f5b82&&_0x450f4d(this,_0x11c396,_0x5457fe)[_0x17bae8(0x2c9)](this,_0x2f5b82)),_0x40f38b=new Error((_0x55c429==null?void 0x0:_0x55c429['message'])||_0x17bae8(0x1bb)),_0x55c429;}return null;}))['catch'](()=>{}),this['queue']['then'](()=>{if(_0x40f38b)throw _0x40f38b;return _0x2e641a;});});}};_0x1d2067=new WeakMap(),_0x11c396=new WeakSet(),_0x2b8260=function(){return _0x3e4330(this,null,function*(){});},_0xe1401b=function(_0x4b7e9d,_0x1ab730){return _0x3e4330(this,null,function*(){const _0x250bda=_0x2d7d;yield _0x1937a8(_0x250bda(0x133),()=>_0x3e4330(this,null,function*(){const _0xcd4088=_0x250bda;var _0x916205,_0xf5a59,_0x524613,_0x1dcd01;let {campaignCustomerInstanceId:_0x2b98a2,campaignId:_0x11ba9d,eventName:_0x32331a,eventProperties:_0x3a9042,name:_0x590ca6,web_optin_instance_id:_0x36319d}=_0x4b7e9d;_0x104477(0x1,_0xcd4088(0x1af)),_0x2383a1(_0xcd4088(0x208),!0x0),_0x1e9091(_0xcd4088(0x274),!0x0),_0x104477(0x1,_0xcd4088(0x24b)),_0x104477(0x1,{'campaignCustomerInstanceId':_0x2b98a2,'eventName':_0x32331a,'eventProperties':_0x3a9042,'name':_0x590ca6,'web_optin_instance_id':_0x36319d});let _0xe4886f=_0x58e5b1['getPlatform']();if(_0xe4886f===_0xcd4088(0x126)||_0xe4886f===_0xcd4088(0x23c))throw new Error(_0xcd4088(0x2b1));_0x32331a!==_0xcd4088(0x1d7)&&(yield _0x58e5b1[_0xcd4088(0x242)]());let _0x4f2b32=[];_0x3a9042&&_0x4f2b32[_0xcd4088(0x2b5)](..._0x3a9042),_0x4f2b32[_0xcd4088(0x2b5)]({'eventProperty':'Platform','value':_0xe4886f}),_0x4f2b32[_0xcd4088(0x2b5)]({'eventProperty':_0xcd4088(0x118),'value':_0x58e5b1['getOperatingSystem']()}),_0x4f2b32[_0xcd4088(0x2b5)]({'eventProperty':_0xcd4088(0x1eb),'value':_0x58e5b1[_0xcd4088(0x211)]()});let _0x25c550=this[_0xcd4088(0x1dd)](),_0x11d973=_0x450f4d(this,_0x11c396,_0x3f039c)[_0xcd4088(0x2c9)](this,_0x25c550,_0x32331a,_0x4f2b32);if(typeof _0x11d973==_0xcd4088(0x191)){_0x104477(0x2,_0x11d973);return;}_0x58e5b1[_0xcd4088(0x2c7)]();let {id:_0xaf6e9d}=_0x25c550[_0x32331a],_0xa92508=_0x450f4d(this,_0x11c396,_0x4e43e4)['call'](this,_0x5ee623(_0x572d45(_0x5ee623(_0x5ee623(_0x5ee623({},_0x2b98a2?{'campaignCustomerInstanceId':_0x2b98a2}:{}),_0x11ba9d?{'campaignId':_0x11ba9d}:{}),_0x36319d?{'web_optin_instance_id':_0x36319d}:{}),{'eventId':_0xaf6e9d,'eventProperties':_0x11d973,'sessionId':localStorage['getItem'](_0xcd4088(0x18a))||''}),_0x590ca6?{'name':_0x590ca6}:{}));if(_0x411b77[_0xcd4088(0x183)]){let _0xc37457=JSON[_0xcd4088(0x27a)](localStorage[_0xcd4088(0x2f1)](_0xcd4088(0x119))||'[]');_0xc37457[_0xcd4088(0x161)]<=0x32&&(_0xc37457['push'](..._0xa92508[_0xcd4088(0x157)]),localStorage[_0xcd4088(0x168)](_0xcd4088(0x119),JSON[_0xcd4088(0x28e)](_0xc37457)));return;}let _0x356039=yield this[_0xcd4088(0x1c2)](_0xa92508,_0x4b7e9d);(_0x916205=_0x356039==null?void 0x0:_0x356039[_0xcd4088(0x1cd)])!=null&&_0x916205[_0xcd4088(0x2d1)]?(yield this[_0xcd4088(0x181)]({'eventName':_0xcd4088(0x13c)}),_0x4a23f4['showNotification'](_0x356039[_0xcd4088(0x1cd)][_0xcd4088(0x2d1)])):_0x32331a==='Viewed\x20Webpage'&&(yield this[_0xcd4088(0x181)]({'eventName':'no_optin','eventProperties':[{'eventProperty':_0xcd4088(0x125),'value':''+(_0xcd4088(0x193)in window&&typeof((_0xf5a59=window==null?void 0x0:window['Notification'])==null?void 0x0:_0xf5a59[_0xcd4088(0x1b0)])!='undefined')}]})),(_0x1dcd01=(_0x524613=_0x356039==null?void 0x0:_0x356039[_0xcd4088(0x1cd)])==null?void 0x0:_0x524613['campaigns'])==null||_0x1dcd01[_0xcd4088(0x214)](_0x4d90e7=>{const _0x124ce4=_0xcd4088;_0xd40005[_0x124ce4(0x2eb)](_0x4d90e7[_0x124ce4(0x125)][_0x124ce4(0x1ac)])?_0xd40005['showPopup'](_0x4d90e7):_0x3dc9e5[_0x124ce4(0x2a5)](_0x4d90e7['message']['name'])&&_0x3dc9e5[_0x124ce4(0x1d4)](_0x4d90e7);}),_0x1e9091(_0xcd4088(0x274),!0x1),_0x2383a1(_0xcd4088(0x208),!0x1);}),_0x26bec4=>{const _0x32eb60=_0x250bda;_0x55b99a['getBrandId']()==='67'&&_0x26bec4[_0x32eb60(0x125)]!==_0x32eb60(0x209)&&_0x26bec4[_0x32eb60(0x125)]!=='Load\x20failed'&&_0x26bec4['message'][_0x32eb60(0x2f3)](_0x32eb60(0x209));},_0x1ab730);});},_0x3f039c=function(_0x4ad8c5,_0x127a11,_0x50f065){const _0x19a439=_0x29e887;if(!Object[_0x19a439(0x115)][_0x19a439(0x23d)][_0x19a439(0x2c9)](_0x4ad8c5,_0x127a11))return _0x19a439(0x229)+_0x127a11+_0x19a439(0x23a);if(!_0x50f065)return[];let _0x2ed338=_0x4ad8c5[_0x127a11];if(!(_0x2ed338!=null&&_0x2ed338['eventProperty']))return _0x19a439(0x229)+_0x127a11+'\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.';let _0x1b45ba=_0x50f065[_0x19a439(0x2af)](({eventProperty:_0x1fdd0c})=>!Object[_0x19a439(0x115)][_0x19a439(0x23d)][_0x19a439(0x2c9)](_0x2ed338['eventProperty'],_0x1fdd0c))[_0x19a439(0x28b)](({eventProperty:_0x39b27b})=>_0x39b27b);return _0x1b45ba[_0x19a439(0x161)]>0x0?'Event\x20'+_0x127a11+_0x19a439(0x2bf)+_0x1b45ba['join'](',\x20')+'.':_0x50f065['map'](({eventProperty:_0x44ef3b,value:_0x4044bc})=>({'eventPropertyId':_0x2ed338[_0x19a439(0x140)][_0x44ef3b]['id'],'value':_0x4044bc}));},_0x4e43e4=function(_0x3884f0){const _0x59bbd6=_0x29e887;return{'customerId':localStorage[_0x59bbd6(0x2f1)]('customer')||'','deviceId':localStorage[_0x59bbd6(0x2f1)](_0x59bbd6(0x2dc))||'','events':[_0x3884f0]};},_0x5457fe=function(_0x39aec9){const _0x4857b6=_0x29e887;_0x104477(0x1,_0x4857b6(0x13f)),_0x104477(0x1,_0x39aec9);let _0x2a120d=localStorage[_0x4857b6(0x2f1)](_0x4857b6(0x14e));_0x2a120d&&_0x2a120d!=='undefined'?(_0x2a120d=JSON['parse'](_0x2a120d),_0x2a120d[_0x4857b6(0x2b5)](_0x39aec9)):_0x2a120d=[_0x39aec9],localStorage['setItem'](_0x4857b6(0x14e),JSON[_0x4857b6(0x28e)](_0x2a120d));},_0x5051e3=function(_0x4cefe5){const _0x2a5a0e=_0x29e887;let _0x1bd32c=JSON[_0x2a5a0e(0x27a)](localStorage[_0x2a5a0e(0x2f1)](_0x2a5a0e(0x14e))||'[]'),_0x553ce7=_0x1bd32c['findIndex'](_0x2e42c2=>_0x2e42c2[_0x2a5a0e(0x249)]===_0x4cefe5);_0x553ce7>=0x0&&_0x1bd32c[_0x2a5a0e(0x178)](_0x553ce7,0x1),localStorage['setItem'](_0x2a5a0e(0x14e),JSON[_0x2a5a0e(0x28e)](_0x1bd32c));},_0x5e0cad(_0x541627,_0x1d2067);var _0x10bb8d=_0x541627,_0x135cf6=_0x10bb8d['getInstance'](),_0x4edf83,_0x5af905,_0x8a2885,_0x33659d,_0x2e0be2,_0x192671,_0x4ab398,_0x292af6,_0x5bb406,_0x2eb7d0,_0x4aec72,_0x1c6f3d,_0x1e5c3d=class _0x542810{constructor(){const _0x57677d=_0x29e887;_0x5e0cad(this,_0x5af905),_0x5e0cad(this,_0x4ab398,_0x2b9850=>{const _0x192e6b=_0x2d7d;_0x58e5b1['clearActionInLocalStorage']({'id':_0x2b9850,'localStorageKey':_0x192e6b(0x207)});}),this[_0x57677d(0x124)]=()=>{const _0x1d6c2e=_0x57677d;_0x58e5b1[_0x1d6c2e(0x17d)]({'actionCondition':_0xdb48db=>_0xdb48db['message']['name']==='ContentCard','actionMethod':_0x43f8ac=>_0x450f4d(this,_0x5af905,_0x33659d)[_0x1d6c2e(0x2c9)](this,_0x43f8ac['campaignId']),'localStorageKey':_0x1d6c2e(0x207)});},_0x5e0cad(this,_0x1c6f3d,()=>{const _0x17bf45=_0x57677d;_0x58e5b1[_0x17bf45(0x20a)]('action');});}static[_0x29e887(0x25f)](){var _0x52e102;return _0xf07c5a(_0x542810,_0x4edf83)||(_0xba5f7e(_0x542810,_0x4edf83,new _0x542810()),_0x450f4d(_0x52e102=_0xf07c5a(_0x542810,_0x4edf83),_0x5af905,_0x8a2885)['call'](_0x52e102)),_0xf07c5a(_0x542810,_0x4edf83);}['showContentCard'](_0x1b0c37){const _0x7f4f33=_0x29e887;let _0x4c0b2b=JSON[_0x7f4f33(0x27a)](localStorage[_0x7f4f33(0x2f1)](_0x7f4f33(0x207))||'{}');if(_0x4c0b2b&&_0x4c0b2b[_0x1b0c37==null?void 0x0:_0x1b0c37[_0x7f4f33(0x12e)]]){_0x104477(0x1,_0x7f4f33(0x1f1));return;}_0x450f4d(this,_0x5af905,_0x4aec72)['call'](this,_0x1b0c37),_0xf07c5a(this,_0x1c6f3d)[_0x7f4f33(0x2c9)](this),_0x450f4d(this,_0x5af905,_0x33659d)['call'](this,_0x1b0c37[_0x7f4f33(0x12e)]);}[_0x29e887(0x2a5)](_0x23fca3){const _0x4bb42e=_0x29e887;return _0x23fca3===_0x4bb42e(0x1e1);}};_0x4edf83=new WeakMap(),_0x5af905=new WeakSet(),_0x8a2885=function(){return _0x3e4330(this,null,function*(){});},_0x33659d=function(_0x535478){const _0x3b41e9=_0x29e887;let _0x4f9714=_0x450f4d(this,_0x5af905,_0x2e0be2)[_0x3b41e9(0x2c9)](this);if(document[_0x3b41e9(0x215)](_0x3b41e9(0x153)+_0x535478)){_0x104477(0x1,_0x3b41e9(0x12c)),_0xf07c5a(this,_0x4ab398)[_0x3b41e9(0x2c9)](this,_0x535478);return;}if(_0x4f9714!=null&&_0x4f9714[_0x535478])switch(_0x4f9714[_0x535478][_0x3b41e9(0x273)]){case _0x3b41e9(0x285):{_0x450f4d(this,_0x5af905,_0x192671)[_0x3b41e9(0x2c9)](this,_0x4f9714[_0x535478]);break;}case _0x3b41e9(0x227):{_0x450f4d(this,_0x5af905,_0x292af6)[_0x3b41e9(0x2c9)](this,_0x4f9714[_0x535478]);break;}case _0x3b41e9(0x2a9):{_0x450f4d(this,_0x5af905,_0x2eb7d0)[_0x3b41e9(0x2c9)](this,_0x4f9714[_0x535478]);break;}default:return;}},_0x2e0be2=function(){const _0x1faf82=_0x29e887;let _0x3f3674=localStorage[_0x1faf82(0x2f1)](_0x1faf82(0x207));return _0x3f3674?JSON[_0x1faf82(0x27a)](_0x3f3674):null;},_0x192671=function(_0x544a99){const _0x28fce1=_0x29e887;_0x58e5b1['showDelayedAction']({'clearActionMethod':_0xf07c5a(this,_0x4ab398)[_0x28fce1(0x150)](this),'data':_0x544a99,'displayMethod':_0x450f4d(this,_0x5af905,_0x292af6)['bind'](this),'idKey':'campaignId','timeValueKey':_0x28fce1(0x1f3)});},_0x4ab398=new WeakMap(),_0x292af6=function(_0x3dbcfb){const _0x508e97=_0x29e887;var _0xd69779;if(document[_0x508e97(0x215)]('contentCard_container_'+_0x3dbcfb[_0x508e97(0x12e)]))_0x104477(0x1,_0x508e97(0x12c));else{let _0x268181=_0x450f4d(this,_0x5af905,_0x5bb406)[_0x508e97(0x2c9)](this,_0x508e97(0x190),_0x3dbcfb),_0x3d22b9=document[_0x508e97(0x21f)]('#'+_0x3dbcfb[_0x508e97(0x125)][_0x508e97(0x1da)]);_0x3d22b9&&(_0x3d22b9['innerHTML']=_0x268181['outerHTML'],_0x135cf6[_0x508e97(0x19c)]({'campaignCustomerInstanceId':_0x3dbcfb['campaignCustomerInstanceId'],'campaignId':_0x3dbcfb[_0x508e97(0x12e)],'eventName':_0x18ae18,'eventProperties':[{'eventProperty':'Content\x20Card\x20View','value':JSON[_0x508e97(0x28e)]({'campaignId':_0x3dbcfb[_0x508e97(0x12e)]})}],'name':_0x508e97(0x217)}),(_0xd69779=document[_0x508e97(0x215)](_0x508e97(0x153)+_0x3dbcfb[_0x508e97(0x12e)]))==null||_0xd69779[_0x508e97(0x131)]('click',()=>{const _0x3c2249=_0x508e97;_0x135cf6[_0x3c2249(0x19c)]({'campaignCustomerInstanceId':_0x3dbcfb[_0x3c2249(0x188)],'campaignId':_0x3dbcfb[_0x3c2249(0x12e)],'eventName':_0x18ae18,'eventProperties':[{'eventProperty':'Content\x20Card\x20Click','value':JSON[_0x3c2249(0x28e)]({'campaignId':_0x3dbcfb[_0x3c2249(0x12e)]})}],'name':_0x3c2249(0x1b9)});}));}_0xf07c5a(this,_0x4ab398)['call'](this,_0x3dbcfb[_0x508e97(0x12e)]);},_0x5bb406=function(_0x2d8d0f,_0x588c30){const _0x55d8c1=_0x29e887;var _0x58b420;let {campaignId:_0x2834be,message:{design:_0x3f6152}}=_0x588c30,_0x391b58=document[_0x55d8c1(0x1a4)](_0x2d8d0f);return _0x391b58['id']='contentCard_container_'+_0x2834be,_0x391b58[_0x55d8c1(0x155)]=_0x3f6152,(_0x58b420=_0x391b58['querySelector'](_0x55d8c1(0x12a)))==null||_0x58b420['remove'](),_0x391b58;},_0x2eb7d0=function(_0x588362){const _0x245630=_0x29e887;_0x58e5b1[_0x245630(0x1d9)]({'data':_0x588362,'displayMethod':_0x450f4d(this,_0x5af905,_0x292af6)[_0x245630(0x150)](this),'timeValueKey':'campaignEntryTimeValue'});},_0x4aec72=function(_0x3f1d3c){const _0x357152=_0x29e887;_0x58e5b1[_0x357152(0x152)](_0x3f1d3c,_0x357152(0x207),'campaignId');},_0x1c6f3d=new WeakMap(),_0x5e0cad(_0x1e5c3d,_0x4edf83);var _0x27ba17=_0x1e5c3d,_0x3dc9e5=_0x27ba17[_0x29e887(0x25f)](),_0x3f8d20,_0x1d0aad,_0x480271,_0x36f755,_0x1a0366,_0x4ad88b,_0x577f55,_0x5a1dba,_0x64612d,_0x452c77,_0x48293b,_0x1de185,_0x24f2eb,_0x539803,_0x48740b,_0x91acf0,_0x41bd84,_0x52ce9f,_0x3d1df7,_0x805827,_0x40cb75,_0x2e7a2b,_0xc83246,_0x229640,_0x5e6ea5,_0x2d4007,_0x545d7c,_0x2aa773,_0x39cbf8=class _0x5a5142{constructor(){const _0x35bda0=_0x29e887;_0x5e0cad(this,_0x64612d),_0x5e0cad(this,_0x1d0aad),_0x5e0cad(this,_0x480271),_0x5e0cad(this,_0x36f755),_0x5e0cad(this,_0x1a0366,null),_0x5e0cad(this,_0x4ad88b,null),_0x5e0cad(this,_0x577f55,!0x1),_0x5e0cad(this,_0x5a1dba,()=>{setInterval(()=>{_0x1937a8('listen\x20to\x20shopify\x20data',()=>_0x3e4330(this,null,function*(){const _0x5bf67d=_0x2d7d;let _0x3db82b=localStorage[_0x5bf67d(0x2f1)]('mergn_shopify');if(_0x3db82b!==_0xf07c5a(this,_0x4ad88b)){_0x104477(0x1,_0x5bf67d(0x2c1)),_0xba5f7e(this,_0x4ad88b,_0x3db82b);let _0x3b50dc=JSON[_0x5bf67d(0x27a)](_0x3db82b||'{}');if(_0x3b50dc!=null&&_0x3b50dc['pushMessageToSW']){_0x104477(0x1,_0x5bf67d(0x2cd));let _0x51354b=_0x3b50dc[_0x5bf67d(0x219)];delete _0x3b50dc[_0x5bf67d(0x219)],localStorage[_0x5bf67d(0x168)](_0x5bf67d(0x28c),JSON[_0x5bf67d(0x28e)](_0x3b50dc)),_0x4a23f4[_0x5bf67d(0x219)](_0x51354b);}if(_0x3b50dc!=null&&_0x3b50dc[_0x5bf67d(0x2d1)]){let _0x33c162=_0x3b50dc[_0x5bf67d(0x2d1)];delete _0x3b50dc[_0x5bf67d(0x2d1)],localStorage[_0x5bf67d(0x168)]('mergn_shopify',JSON[_0x5bf67d(0x28e)](_0x3b50dc)),_0x4a23f4['showNotification'](_0x33c162);}if(_0x3b50dc!=null&&_0x3b50dc[_0x5bf67d(0x297)]){let _0x2265be=_0x3b50dc[_0x5bf67d(0x297)];delete _0x3b50dc[_0x5bf67d(0x297)],localStorage['setItem']('mergn_shopify',JSON[_0x5bf67d(0x28e)](_0x3b50dc)),_0x2265be[_0x5bf67d(0x214)](_0x3c287c=>{const _0x2b1d8a=_0x5bf67d;_0xd40005[_0x2b1d8a(0x2eb)](_0x3c287c[_0x2b1d8a(0x125)]['name'])?_0xd40005[_0x2b1d8a(0x1ed)](_0x3c287c):_0x3dc9e5['isContentCardAction'](_0x3c287c[_0x2b1d8a(0x125)][_0x2b1d8a(0x1ac)])&&_0x3dc9e5['showContentCard'](_0x3c287c);});}}}));},0x3e8);}),this[_0x35bda0(0x20a)]=_0x45f587=>{const _0x148758=_0x35bda0;let _0x68cdc6=()=>{const _0x423ecb=_0x2d7d;let _0xf14a6b=JSON[_0x423ecb(0x27a)](localStorage['getItem'](_0x45f587)||'{}');Object['keys'](_0xf14a6b)[_0x423ecb(0x214)](_0x2985ff=>{const _0x15a52a=_0x423ecb;_0xf14a6b[_0x2985ff][_0x15a52a(0x16f)]=new Date()['getTime']();}),localStorage[_0x423ecb(0x168)](_0x45f587,JSON[_0x423ecb(0x28e)](_0xf14a6b));};_0x68cdc6(),window[_0x148758(0x131)](_0x148758(0x28a),_0x68cdc6);},this[_0x35bda0(0x139)]=({id:_0xcd032c,localStorageKey:_0x4e758c})=>{const _0x3de6e1=_0x35bda0;let _0x59fc6f=JSON[_0x3de6e1(0x27a)](localStorage['getItem'](_0x4e758c)||'{}');_0x59fc6f[_0xcd032c]&&delete _0x59fc6f[_0xcd032c],localStorage[_0x3de6e1(0x168)](_0x4e758c,JSON[_0x3de6e1(0x28e)](_0x59fc6f));},this[_0x35bda0(0x17d)]=({actionCondition:_0x5d2b89,actionMethod:_0x483910,localStorageKey:_0x4aaa05})=>{const _0x259c66=_0x35bda0;let _0x182b08=JSON[_0x259c66(0x27a)](localStorage[_0x259c66(0x2f1)](_0x4aaa05)||'{}');Object[_0x259c66(0x1f2)](_0x182b08)[_0x259c66(0x214)](_0x40d6be=>{_0x5d2b89(_0x182b08[_0x40d6be])&&_0x483910(_0x182b08[_0x40d6be]);});};}static[_0x29e887(0x25f)](){return _0xf07c5a(_0x5a5142,_0x3f8d20)||_0xba5f7e(_0x5a5142,_0x3f8d20,new _0x5a5142()),_0xf07c5a(_0x5a5142,_0x3f8d20);}['init'](_0x2d247e,_0x40586b){return _0x3e4330(this,null,function*(){const _0x43439b=_0x2d7d;_0x104477(0x1,_0x43439b(0x1fc));let _0x5f5962=_0x450f4d(this,_0x64612d,_0x24f2eb)[_0x43439b(0x2c9)](this);_0x40586b!=null&&_0x40586b[_0x43439b(0x271)]&&_0xba5f7e(this,_0x577f55,!0x0),_0x450f4d(this,_0x64612d,_0x452c77)['call'](this,_0x2d247e);let _0x51ecf6=this[_0x43439b(0x244)]();if(_0x51ecf6==='Crawlers'||_0x51ecf6===_0x43439b(0x23c)){_0x104477(0x2,_0x43439b(0x246));return;}if(yield _0x55b99a['syncRealWorldTime'](),_0x104477(0x1,_0x43439b(0x2a4)),yield _0x450f4d(this,_0x64612d,_0x5e6ea5)[_0x43439b(0x2c9)](this,0x3),_0x40586b!=null&&_0x40586b[_0x43439b(0x271)]&&_0xf07c5a(this,_0x5a1dba)[_0x43439b(0x2c9)](this),_0x40586b!=null&&_0x40586b['identity'])try{_0x411b77['loading']=!0x0,yield this[_0x43439b(0x192)](_0x40586b[_0x43439b(0x279)]);}finally{_0x411b77[_0x43439b(0x11e)]=!0x1;}yield this[_0x43439b(0x242)](),yield _0x135cf6[_0x43439b(0x258)](),_0x135cf6[_0x43439b(0x181)]({'eventName':_0x43439b(0x1ce)}),_0x104477(0x1,_0x43439b(0x148)),yield _0x1937a8(_0x43439b(0x1e4),()=>_0x3e4330(this,null,function*(){const _0x3e6e7c=_0x43439b;yield _0x4a23f4[_0x3e6e7c(0x1a8)](_0x5f5962,_0x40586b==null?void 0x0:_0x40586b[_0x3e6e7c(0x247)]);})),yield _0x450f4d(this,_0x64612d,_0x2aa773)['call'](this,_0x40586b==null?void 0x0:_0x40586b[_0x43439b(0x271)]);let _0x199c8a=history[_0x43439b(0x22d)];history[_0x43439b(0x22d)]=(..._0x2cfaae)=>{const _0x6587fd=_0x43439b;_0x199c8a['apply'](history,_0x2cfaae),_0x450f4d(this,_0x64612d,_0x545d7c)[_0x6587fd(0x2c9)](this,_0x40586b==null?void 0x0:_0x40586b['shopify']);},_0x104477(0x1,'tracking\x20page\x20change\x20register');});}[_0x29e887(0x265)](_0x46ea4f){_0xba5f7e(this,_0x1d0aad,_0x46ea4f);}[_0x29e887(0x222)](_0x5d73c0){_0xba5f7e(this,_0x480271,_0x5d73c0);}[_0x29e887(0x199)](_0x303807){_0xba5f7e(this,_0x36f755,_0x303807);}[_0x29e887(0x22e)](_0x1d6abb){_0xba5f7e(this,_0x1a0366,_0x1d6abb);}['getPreviousUrl'](){return _0xf07c5a(this,_0x1a0366);}[_0x29e887(0x244)](){return _0xf07c5a(this,_0x1d0aad);}[_0x29e887(0x211)](){return _0xf07c5a(this,_0x480271);}[_0x29e887(0x2a6)](){return _0xf07c5a(this,_0x36f755);}[_0x29e887(0x2c7)](){}[_0x29e887(0x1d9)]({data:_0x188c0e,displayMethod:_0xe3d058,timeValueKey:_0x7897e2}){let _0x3493fa=()=>{const _0x4582ba=_0x2d7d;var _0xfb67b2;let _0x53bb27=window[_0x4582ba(0x248)],_0x153741=document[_0x4582ba(0x2e6)][_0x4582ba(0x1e3)];window[_0x4582ba(0x212)]/(_0x153741-_0x53bb27)*0x64>(((_0xfb67b2=_0x188c0e[_0x7897e2])==null?void 0x0:_0xfb67b2[_0x4582ba(0x182)])||0x0)&&(window[_0x4582ba(0x22b)](_0x4582ba(0x17b),_0x3493fa),_0xe3d058(_0x188c0e));};window['addEventListener']('scroll',_0x3493fa);}[_0x29e887(0x201)]({clearActionMethod:_0x13293e,data:_0x2ad4d1,displayMethod:_0x556b83,idKey:_0x20e2b5,timeValueKey:_0x20e8c5}){const _0x67b100=_0x29e887;var _0x8bc053,_0x3fda58,_0x197056;let _0x4be1d7=(_0x8bc053=_0x2ad4d1[_0x20e8c5])==null?void 0x0:_0x8bc053[_0x67b100(0x182)];((_0x3fda58=_0x2ad4d1[_0x20e8c5])==null?void 0x0:_0x3fda58['duration'])==='min'&&(_0x4be1d7=_0x4be1d7*0x3c);let _0x31813c=_0x2ad4d1['initialTime']-0x1f4+(_0x4be1d7||0x0)*0x3e8-new Date()[_0x67b100(0x141)]();_0x104477(0x1,_0x67b100(0x2ea)+_0x2ad4d1[_0x67b100(0x16f)]),_0x104477(0x1,_0x67b100(0x13a)+((_0x197056=_0x2ad4d1[_0x20e8c5])==null?void 0x0:_0x197056['value'])),_0x104477(0x1,'Current\x20time:\x20'+new Date()['getTime']()),_0x104477(0x1,'Time\x20difference:\x20'+_0x31813c),_0x31813c>0x0?setTimeout(()=>{_0x13293e(_0x2ad4d1[_0x20e2b5]),_0x556b83(_0x2ad4d1);},_0x31813c):(_0x13293e(_0x2ad4d1[_0x20e2b5]),_0x556b83(_0x2ad4d1));}[_0x29e887(0x152)](_0x2e25de,_0x64c560,_0x1d6653){const _0x488c88=_0x29e887;var _0x5e5b50;let _0x22dbc1=JSON[_0x488c88(0x27a)](localStorage[_0x488c88(0x2f1)](_0x64c560)||'{}'),_0x4da6b4=(_0x5e5b50=_0x1d6653 in _0x2e25de&&_0x2e25de[_0x1d6653])!=null?_0x5e5b50:'';_0x4da6b4&&(_0x22dbc1[_0x4da6b4]=_0x572d45(_0x5ee623({},_0x2e25de),{'initialTime':new Date()[_0x488c88(0x141)]()}),localStorage[_0x488c88(0x168)](_0x64c560,JSON[_0x488c88(0x28e)](_0x22dbc1)));}[_0x29e887(0x242)](){return _0x3e4330(this,null,function*(){yield _0x1937a8('#\x20check\x20TTL',()=>_0x3e4330(this,null,function*(){const _0x3e7bfe=_0x2d7d;if(_0xf07c5a(this,_0x577f55))return;_0x104477(0x1,_0x3e7bfe(0x26e)),_0x2383a1(_0x3e7bfe(0x26e),!0x0),_0x1e9091(_0x3e7bfe(0x257),!0x0);let _0x30b4b8=localStorage[_0x3e7bfe(0x2f1)]('ttl'),_0x26806a=!0x1;if(_0x30b4b8){if(_0x26806a=_0x450f4d(this,_0x64612d,_0x24f2eb)[_0x3e7bfe(0x2c9)](this,_0x30b4b8),_0x26806a){let _0x3236ee=localStorage[_0x3e7bfe(0x2f1)](_0x3e7bfe(0x18a)),_0x489df1=localStorage[_0x3e7bfe(0x2f1)](_0x3e7bfe(0x1fa));if(_0x3236ee&&_0x489df1){let _0x593c94=parseInt(_0x489df1,0xa);yield _0x135cf6['recordEvent']({'eventName':_0x3e7bfe(0x1d7),'eventProperties':[{'eventProperty':_0x3e7bfe(0x2cf),'value':localStorage[_0x3e7bfe(0x2f1)](_0x3e7bfe(0x18a))},{'eventProperty':_0x3e7bfe(0x223),'value':Number[_0x3e7bfe(0x233)](_0x593c94)?new Date(_0x593c94)[_0x3e7bfe(0x2cc)]():new Date()[_0x3e7bfe(0x2cc)]()}]});}localStorage[_0x3e7bfe(0x2b7)](_0x3e7bfe(0x1fa)),localStorage[_0x3e7bfe(0x2b7)](_0x3e7bfe(0x18a)),localStorage['setItem'](_0x3e7bfe(0x1fa),''+new Date()[_0x3e7bfe(0x141)]()),yield _0x450f4d(this,_0x64612d,_0x40cb75)[_0x3e7bfe(0x2c9)](this),this[_0x3e7bfe(0x2c0)]();}}else localStorage[_0x3e7bfe(0x168)](_0x3e7bfe(0x1fa),''+new Date()[_0x3e7bfe(0x141)]());(!_0x30b4b8||_0x26806a||_0x450f4d(this,_0x64612d,_0x3d1df7)['call'](this))&&(_0x450f4d(this,_0x64612d,_0x41bd84)[_0x3e7bfe(0x2c9)](this)&&_0x450f4d(this,_0x64612d,_0x805827)['call'](this),_0x450f4d(this,_0x64612d,_0x91acf0)[_0x3e7bfe(0x2c9)](this)&&(yield this[_0x3e7bfe(0x192)]()),(_0x450f4d(this,_0x64612d,_0x24f2eb)[_0x3e7bfe(0x2c9)](this)||_0x450f4d(this,_0x64612d,_0x539803)[_0x3e7bfe(0x2c9)](this))&&(yield _0x450f4d(this,_0x64612d,_0xc83246)[_0x3e7bfe(0x2c9)](this)),yield _0x450f4d(this,_0x64612d,_0x40cb75)[_0x3e7bfe(0x2c9)](this),(_0x450f4d(this,_0x64612d,_0x24f2eb)[_0x3e7bfe(0x2c9)](this)||_0x450f4d(this,_0x64612d,_0x48740b)['call'](this))&&(yield _0x450f4d(this,_0x64612d,_0x229640)['call'](this))),_0x1e9091(_0x3e7bfe(0x257),!0x1),_0x2383a1(_0x3e7bfe(0x26e),!0x1);}));});}[_0x29e887(0x2c0)](){const _0x5b118b=_0x29e887;localStorage[_0x5b118b(0x2b7)](_0x5b118b(0x207)),localStorage[_0x5b118b(0x2b7)]('events'),localStorage['removeItem']('attributes'),localStorage['removeItem']('offlineEvents');}[_0x29e887(0x177)](_0x468f28){const _0x1fac41=_0x29e887;let _0x450d6a=this[_0x1fac41(0x22a)](_0x1fac41(0x2dd));if(_0x450d6a&&_0x450d6a!=='undefined'){let _0x27e22a=this['decodeData'](_0x450d6a);return _0x468f28&&_0x468f28===_0x27e22a?!0x0:_0x27e22a;}return!0x1;}[_0x29e887(0x164)](_0x22e6f4){const _0x2bcf4a=_0x29e887;let _0x116709=this[_0x2bcf4a(0x2b9)](_0x22e6f4);this['setCookie']('mergn_identity',_0x116709,0x16d);}['encodeData'](_0x374709){const _0x4f364f=_0x29e887;let _0x17e505=new TextEncoder()[_0x4f364f(0x23f)](_0x374709),_0x584758='';for(let _0x3d6c80=0x0;_0x3d6c80<_0x17e505[_0x4f364f(0x161)];_0x3d6c80++)_0x584758+=String[_0x4f364f(0x2a1)](_0x17e505[_0x3d6c80]);return btoa(_0x584758);}[_0x29e887(0x1a9)](_0x38f12a){const _0x16e4d1=_0x29e887;let _0x11ed8e=atob(_0x38f12a),_0x58fe42=new Uint8Array(_0x11ed8e[_0x16e4d1(0x161)]);for(let _0xc62095=0x0;_0xc62095<_0x11ed8e[_0x16e4d1(0x161)];_0xc62095++)_0x58fe42[_0xc62095]=_0x11ed8e[_0x16e4d1(0x14d)](_0xc62095);return new TextDecoder()[_0x16e4d1(0x283)](_0x58fe42);}['getCookie'](_0x9a0966){const _0x5e6f8d=_0x29e887;var _0x3e19df;let _0x2960f7=(';\x20'+document[_0x5e6f8d(0x205)])['split'](';\x20'+_0x9a0966+'=');return _0x2960f7['length']===0x2&&((_0x3e19df=_0x2960f7[_0x5e6f8d(0x185)]())==null?void 0x0:_0x3e19df[_0x5e6f8d(0x26d)](';')[_0x5e6f8d(0x2a7)]())||null;}[_0x29e887(0x232)](_0x318506,_0x352735,_0x16b67){const _0x54b8ed=_0x29e887;let _0x57185d=new Date();_0x57185d[_0x54b8ed(0x2a0)](_0x57185d['getTime']()+_0x16b67*0x18*0x3c*0x3c*0x3e8);let _0x574bb2=_0x54b8ed(0x2c3)+_0x57185d[_0x54b8ed(0x172)]();document[_0x54b8ed(0x205)]=_0x318506+'='+_0x352735+';\x20'+_0x574bb2+';\x20path=/;\x20secure;\x20SameSite=Strict';}[_0x29e887(0x192)](_0x153136){return _0x3e4330(this,null,function*(){const _0xf9a4a8=_0x2d7d;let _0x85ccd3=this['checkIfIdentityExists'](_0x153136);if(typeof _0x85ccd3==_0xf9a4a8(0x1e7)&&_0x85ccd3)return;let _0x489e97=localStorage['getItem'](_0xf9a4a8(0x2dc));(!_0x489e97||_0x489e97===_0xf9a4a8(0x2ab))&&(_0x489e97=_0x450f4d(this,_0x64612d,_0x805827)[_0xf9a4a8(0x2c9)](this));let _0xc6f397={'deviceId':_0x489e97,'os':this[_0xf9a4a8(0x244)]()};if(_0x153136)_0xc6f397[_0xf9a4a8(0x279)]=_0x153136;else{if(typeof _0x85ccd3==_0xf9a4a8(0x191))_0xc6f397[_0xf9a4a8(0x279)]=_0x85ccd3;else{if(!_0x153136&&localStorage[_0xf9a4a8(0x2f1)](_0xf9a4a8(0x2ba)))return;}}try{let _0x5dc940=yield _0x450f4d(this,_0x64612d,_0x2e7a2b)[_0xf9a4a8(0x2c9)](this,_0xc6f397);if(_0x5dc940!==void 0x0){localStorage[_0xf9a4a8(0x168)](_0xf9a4a8(0x2ba),_0x5dc940),this[_0xf9a4a8(0x164)](_0xc6f397['identity']);try{_0x4a23f4[_0xf9a4a8(0x219)]({'customer':_0x5dc940});}catch(_0xa3ebff){}}}catch(_0x1ebc9b){throw new Error(_0xf9a4a8(0x1de));}});}};_0x3f8d20=new WeakMap(),_0x1d0aad=new WeakMap(),_0x480271=new WeakMap(),_0x36f755=new WeakMap(),_0x1a0366=new WeakMap(),_0x4ad88b=new WeakMap(),_0x577f55=new WeakMap(),_0x5a1dba=new WeakMap(),_0x64612d=new WeakSet(),_0x452c77=function(_0x4f8a4a){const _0x4d9875=_0x29e887;_0x55b99a[_0x4d9875(0x1b1)](_0x4f8a4a),this['setPlatform'](_0x450f4d(this,_0x64612d,_0x48293b)[_0x4d9875(0x2c9)](this)),this[_0x4d9875(0x222)](_0x450f4d(this,_0x64612d,_0x1de185)[_0x4d9875(0x2c9)](this)),this[_0x4d9875(0x199)](navigator['userAgent']);},_0x48293b=function(){const _0x9d245f=_0x29e887;var _0x59bb11;let _0x3cc63a=navigator[_0x9d245f(0x1dc)]['toLowerCase']();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i['test'](_0x3cc63a)?'Crawlers':/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i[_0x9d245f(0x2a8)](_0x3cc63a)?'Mobile':/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i['test'](_0x3cc63a)?(_0x9d245f(0x193)in window&&typeof((_0x59bb11=window==null?void 0x0:window[_0x9d245f(0x193)])==null?void 0x0:_0x59bb11[_0x9d245f(0x1b0)])!=_0x9d245f(0x2ab),_0x9d245f(0x143)):/windows|macintosh|linux|x11/i[_0x9d245f(0x2a8)](_0x3cc63a)?_0x9d245f(0x293):_0x9d245f(0x23c);},_0x1de185=function(){const _0x1e57ff=_0x29e887;let _0x52391e=navigator[_0x1e57ff(0x1dc)],_0x5e6f48;return _0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x15b))>-0x1?_0x5e6f48=_0x1e57ff(0x15b):_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x1cc))>-0x1||_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x2d7))>-0x1||_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x1ef))>-0x1?_0x5e6f48=_0x1e57ff(0x1cc):_0x52391e[_0x1e57ff(0x26c)]('Twitter')>-0x1?_0x5e6f48='Twitter':_0x52391e[_0x1e57ff(0x26c)]('Snapchat')>-0x1?_0x5e6f48=_0x1e57ff(0x1db):_0x52391e['indexOf'](_0x1e57ff(0x225))>-0x1?_0x5e6f48='LinkedIn':_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x2e1))>-0x1?_0x5e6f48=_0x1e57ff(0x2e1):_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x2e3))>-0x1&&_0x52391e['indexOf'](_0x1e57ff(0x2e9))===-0x1?_0x5e6f48=_0x1e57ff(0x1c9):_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x2ed))>-0x1&&_0x52391e[_0x1e57ff(0x26c)]('Chrome')===-0x1?_0x5e6f48=_0x1e57ff(0x2ed):_0x52391e['indexOf'](_0x1e57ff(0x1e8))>-0x1?_0x5e6f48='Mozilla\x20Firefox':_0x52391e['indexOf'](_0x1e57ff(0x2e9))>-0x1?_0x5e6f48=_0x1e57ff(0x156):_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x251))>-0x1||_0x52391e['indexOf'](_0x1e57ff(0x24d))>-0x1?_0x5e6f48=_0x1e57ff(0x1be):_0x52391e['indexOf'](_0x1e57ff(0x1d0))>-0x1||_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x123))>-0x1?_0x5e6f48=_0x1e57ff(0x1d0):_0x52391e[_0x1e57ff(0x26c)]('Vivaldi')>-0x1?_0x5e6f48='Vivaldi':_0x52391e[_0x1e57ff(0x26c)]('Brave')>-0x1?_0x5e6f48=_0x1e57ff(0x299):_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x298))>-0x1?_0x5e6f48=_0x1e57ff(0x1e9):_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x24c))>-0x1?_0x5e6f48='UC\x20Browser':_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x1ca))>-0x1?_0x5e6f48='QQ\x20Browser':_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x120))>-0x1?_0x5e6f48=_0x1e57ff(0x15f):_0x52391e[_0x1e57ff(0x26c)](_0x1e57ff(0x165))>-0x1?_0x5e6f48=_0x1e57ff(0x29b):_0x5e6f48=_0x1e57ff(0x23c),_0x5e6f48;},_0x24f2eb=function(_0x324719){const _0x2be3d8=_0x29e887;let _0x2f35ba;return _0x324719||(_0x2f35ba=localStorage[_0x2be3d8(0x2f1)](_0x2be3d8(0x1fa))),_0x324719||_0x2f35ba?new Date()[_0x2be3d8(0x141)]()-parseInt(_0x324719||_0x2f35ba||'',0xa)>0x124f80:!0x0;},_0x539803=function(){const _0x2f6be0=_0x29e887;return!localStorage[_0x2f6be0(0x2f1)](_0x2f6be0(0x157));},_0x48740b=function(){const _0x1466be=_0x29e887;return!localStorage[_0x1466be(0x2f1)](_0x1466be(0x22f));},_0x91acf0=function(){const _0x4adc0c=_0x29e887;return!localStorage[_0x4adc0c(0x2f1)](_0x4adc0c(0x2ba));},_0x41bd84=function(){const _0x4a6947=_0x29e887;return!localStorage[_0x4a6947(0x2f1)](_0x4a6947(0x2dc));},_0x52ce9f=function(){const _0x1a617f=_0x29e887;return!localStorage[_0x1a617f(0x2f1)]('session');},_0x3d1df7=function(){const _0x4a955d=_0x29e887;return _0x450f4d(this,_0x64612d,_0x539803)['call'](this)||_0x450f4d(this,_0x64612d,_0x48740b)['call'](this)||_0x450f4d(this,_0x64612d,_0x91acf0)[_0x4a955d(0x2c9)](this)||_0x450f4d(this,_0x64612d,_0x41bd84)[_0x4a955d(0x2c9)](this)||_0x450f4d(this,_0x64612d,_0x52ce9f)[_0x4a955d(0x2c9)](this);},_0x805827=function(){const _0xa2dba7=_0x29e887;let _0x1ce62e=localStorage[_0xa2dba7(0x2f1)](_0xa2dba7(0x2dc));return _0x1ce62e||(_0x1ce62e=crypto[_0xa2dba7(0x294)](),localStorage['setItem']('uniqueIdentity',_0x1ce62e)),_0x1ce62e;},_0x40cb75=function(){return _0x3e4330(this,null,function*(){const _0x107c1a=_0x2d7d;yield _0x1937a8(_0x107c1a(0x1d6),()=>_0x3e4330(this,null,function*(){const _0x31d838=_0x107c1a;let _0x2d19ba=localStorage[_0x31d838(0x2f1)](_0x31d838(0x18a));if(!_0x2d19ba){_0x2d19ba=crypto['randomUUID'](),localStorage['setItem'](_0x31d838(0x18a),_0x2d19ba);let _0x4aab43=localStorage[_0x31d838(0x2f1)](_0x31d838(0x1fa)),_0x4cc488=_0x4aab43?parseInt(_0x4aab43,0xa):'';yield _0x135cf6[_0x31d838(0x19c)]({'eventName':_0x31d838(0x14b),'eventProperties':[{'eventProperty':_0x31d838(0x2cf),'value':localStorage[_0x31d838(0x2f1)](_0x31d838(0x18a))},{'eventProperty':_0x31d838(0x223),'value':_0x4cc488?new Date(_0x4cc488)['toISOString']():new Date()[_0x31d838(0x2cc)]()}]});}}),_0x2d019c=>{const _0x588dfb=_0x107c1a;_0x55b99a[_0x588dfb(0x238)]()==='67'&&_0x2d019c[_0x588dfb(0x125)]!==_0x588dfb(0x209)&&_0x2d019c[_0x588dfb(0x125)];});});},_0x2e7a2b=function(_0x26113d){return _0x3e4330(this,null,function*(){const _0x4b1af1=_0x2d7d;try{return(yield _0x55b99a[_0x4b1af1(0x1a5)](''+_0x554888+_0xb06b77,_0x26113d))['data'];}catch(_0x379922){throw new Error(_0x4b1af1(0x275));}});},_0xc83246=function(){return _0x3e4330(this,null,function*(){yield _0x135cf6['storeEventsAndPropertiesInLocalStorage']();});},_0x229640=function(){return _0x3e4330(this,null,function*(){const _0x133559=_0x2d7d;yield _0x1cb11d[_0x133559(0x196)]();});},_0x5e6ea5=function(_0x494397){return _0x3e4330(this,null,function*(){const _0x5d7e5a=_0x2d7d;yield _0x1937a8(_0x5d7e5a(0x15a),()=>_0x3e4330(this,null,function*(){const _0xff3ebd=_0x5d7e5a;var _0x330352;try{let _0x37d28=parseInt(localStorage['getItem'](_0xff3ebd(0x237))||'0',0xa)||0x0;if(!_0x37d28||_0x37d28&&new Date()[_0xff3ebd(0x141)]()>_0x37d28){let _0xbe1fd1=yield _0x55b99a[_0xff3ebd(0x262)]('/brand');if(!(_0xbe1fd1!=null&&_0xbe1fd1[_0xff3ebd(0x264)]))throw new Error(JSON[_0xff3ebd(0x28e)](_0xbe1fd1));localStorage['setItem']('verifyTTL',(new Date()[_0xff3ebd(0x141)]()+0x493e0)[_0xff3ebd(0x136)]());}_0x411b77[_0xff3ebd(0x137)]=!0x1,_0x411b77[_0xff3ebd(0x1b2)]=!0x0;}catch(_0x3e4b3e){if(_0x55b99a[_0xff3ebd(0x238)]()==='67'&&!((_0x330352=_0x3e4b3e==null?void 0x0:_0x3e4b3e[_0xff3ebd(0x125)])!=null&&_0x330352['startsWith'](_0xff3ebd(0x262)))&&(_0x3e4b3e==null?void 0x0:_0x3e4b3e[_0xff3ebd(0x125)])!=='Error\x20verifying\x20API\x20key'&&_0x3e4b3e[_0xff3ebd(0x125)]!==_0xff3ebd(0x209)&&_0x3e4b3e['message'],_0x494397&&_0x494397>=0x1){yield new Promise(_0x14f09a=>setTimeout(_0x14f09a,0x5dc)),yield _0x450f4d(this,_0x64612d,_0x5e6ea5)['call'](this,_0x494397-0x1);return;}throw _0x411b77['disableSDK']=!0x0,new Error('Error\x20verifying\x20API\x20key');}}));});},_0x2d4007=function(_0x100575){return _0x3e4330(this,null,function*(){const _0x7a06ae=_0x2d7d;var _0x51a7a9;_0x104477(0x1,'Performing\x20viewed\x20web\x20page\x20event');let _0x250271=(_0x51a7a9=window==null?void 0x0:window[_0x7a06ae(0x2aa)])==null?void 0x0:_0x51a7a9[_0x7a06ae(0x17c)];if(this[_0x7a06ae(0x22e)](_0x250271),_0x100575){_0x250271['includes'](_0x7a06ae(0x1b3))&&(yield _0x135cf6[_0x7a06ae(0x19c)]({'eventName':'Thank\x20you\x20page'}));return;}_0x135cf6[_0x7a06ae(0x181)]({'eventName':_0x7a06ae(0x286)});let _0x5828e1=[];new URLSearchParams(new URL(window[_0x7a06ae(0x2aa)][_0x7a06ae(0x17c)])['search'])[_0x7a06ae(0x214)]((_0x52e295,_0x3961aa)=>_0x3e4330(this,null,function*(){const _0x388eeb=_0x7a06ae;_0x1e7220['has'](_0x3961aa)&&_0x5828e1[_0x388eeb(0x2b5)]({'eventProperty':_0x3961aa,'value':_0x52e295});})),yield _0x135cf6[_0x7a06ae(0x19c)]({'eventName':'Viewed\x20Webpage','eventProperties':[{'eventProperty':_0x7a06ae(0x2c4),'value':window[_0x7a06ae(0x2aa)][_0x7a06ae(0x27b)]},..._0x5828e1]});});},_0x545d7c=function(_0x4e728b){return _0x3e4330(this,null,function*(){const _0x53dddb=_0x2d7d;var _0x30ea65;_0x104477(0x1,_0x53dddb(0x266));let _0x32fabc=(_0x30ea65=window==null?void 0x0:window['location'])==null?void 0x0:_0x30ea65[_0x53dddb(0x17c)];(this[_0x53dddb(0x218)]()===null||this[_0x53dddb(0x218)]()===void 0x0||_0x32fabc!==this['getPreviousUrl']())&&(yield _0x450f4d(this,_0x64612d,_0x2d4007)[_0x53dddb(0x2c9)](this,_0x4e728b));});},_0x2aa773=function(_0x555048){return _0x3e4330(this,null,function*(){const _0x33f98e=_0x2d7d;var _0x3fe9fc,_0x1d5791;let _0x17e42e=(_0x3fe9fc=window==null?void 0x0:window[_0x33f98e(0x2aa)])==null?void 0x0:_0x3fe9fc[_0x33f98e(0x17c)];_0x135cf6[_0x33f98e(0x181)]({'eventName':'show_notification_error','eventProperties':[{'eventProperty':_0x33f98e(0x125),'value':(_0x17e42e!==this[_0x33f98e(0x218)]())+':'+_0x17e42e+':'+this[_0x33f98e(0x218)]()}]});try{yield _0x450f4d(this,_0x64612d,_0x2d4007)[_0x33f98e(0x2c9)](this,_0x555048);}catch(_0x31df3d){let _0x57601f=_0x31df3d&&_0x31df3d[_0x33f98e(0x125)]?(_0x1d5791=_0x31df3d==null?void 0x0:_0x31df3d['message'])==null?void 0x0:_0x1d5791[_0x33f98e(0x26b)](0x0,0x64):_0x33f98e(0x2ab);yield _0x135cf6[_0x33f98e(0x181)]({'eventName':_0x33f98e(0x2d2),'eventProperties':[{'eventProperty':'message','value':''+_0x57601f}]});}});},_0x5e0cad(_0x39cbf8,_0x3f8d20);var _0x39c47c=_0x39cbf8,_0x58e5b1=_0x39c47c['getInstance'](),_0x1c3264,_0x2f6c6d,_0x563c36,_0x16dae3=class _0x18a405{constructor(){_0x5e0cad(this,_0x2f6c6d);}static[_0x29e887(0x25f)](){return _0xf07c5a(_0x18a405,_0x1c3264)||_0xba5f7e(_0x18a405,_0x1c3264,new _0x18a405()),_0xf07c5a(_0x18a405,_0x1c3264);}[_0x29e887(0x1b1)](_0x1de9ac){const _0x2ba2a5=_0x29e887;_0x18a405['apiKey']=_0x1de9ac;let _0x1831dd=_0x1de9ac,_0x35c9cf=/m(\d+)rgn/,_0x291a57=_0x1831dd[_0x2ba2a5(0x27f)](_0x35c9cf);_0x291a57&&(_0x18a405[_0x2ba2a5(0x14c)]=_0x291a57[0x1]);}[_0x29e887(0x127)](){const _0x19ec2d=_0x29e887;return _0x18a405[_0x19ec2d(0x15e)];}['getBrandId'](){const _0x38127d=_0x29e887;return _0x18a405[_0x38127d(0x14c)];}[_0x29e887(0x262)](_0x1e6372){return _0x3e4330(this,null,function*(){const _0xae4fc9=_0x2d7d;let _0xbe3bfa=_0x450f4d(this,_0x2f6c6d,_0x563c36)[_0xae4fc9(0x2c9)](this,_0x18a405[_0xae4fc9(0x15e)]);try{let _0x199d63=yield fetch(_0x4af413+_0x1e6372,{'headers':{'Authorization':_0xbe3bfa,'Content-Type':'application/json'}});if(!_0x199d63['ok'])throw new Error(_0xbe3bfa+_0xae4fc9(0x220)+JSON[_0xae4fc9(0x28e)](yield _0x199d63[_0xae4fc9(0x1bf)]()));return _0x199d63['json']();}catch(_0x2f74fc){let _0x5901c2=_0x2f74fc['message'];return this[_0xae4fc9(0x238)]()==='67'&&_0x5901c2!==_0xae4fc9(0x209)&&_0x5901c2!==_0xae4fc9(0x1ae)&&(yield fetch('https://bc5awo3arh4ta2dsgft2iuq6s40lkmyj.lambda-url.ap-southeast-1.on.aws/api/v2/event/record-event',{'body':JSON['stringify']({'customerId':localStorage[_0xae4fc9(0x2f1)](_0xae4fc9(0x2ba)),'deviceId':localStorage[_0xae4fc9(0x2f1)](_0xae4fc9(0x2dc)),'events':[{'eventId':0x493,'eventProperties':[{'eventPropertyId':0x13cf,'value':_0xae4fc9(0x1ee)+_0x1e6372+_0xae4fc9(0x220)+_0xbe3bfa+_0xae4fc9(0x2e2)+_0x2f74fc[_0xae4fc9(0x125)]},{'eventPropertyId':0x13cc,'value':_0x58e5b1['getPlatform']()},{'eventPropertyId':0x13cd,'value':_0x58e5b1[_0xae4fc9(0x2a6)]()},{'eventPropertyId':0x13ce,'value':_0x58e5b1['getOSVersion']()}],'sessionId':localStorage['getItem'](_0xae4fc9(0x18a))||_0xae4fc9(0x2c6)}]}),'headers':{'Authorization':this[_0xae4fc9(0x127)](),'Content-Type':_0xae4fc9(0x24f)},'method':'POST'})),Promise['reject'](_0x2f74fc);}});}[_0x29e887(0x1a5)](_0x49e1ae,_0x5e87b5,_0x44a196){return _0x3e4330(this,null,function*(){const _0x9faddf=_0x2d7d;let _0x177ae6=_0x450f4d(this,_0x2f6c6d,_0x563c36)[_0x9faddf(0x2c9)](this,_0x18a405[_0x9faddf(0x15e)]);try{return(yield fetch(_0x4af413+_0x49e1ae,{'body':JSON['stringify'](_0x5e87b5||{}),'headers':{'Authorization':_0x177ae6,'Content-Type':_0x9faddf(0x24f)},'method':'POST','signal':_0x44a196}))[_0x9faddf(0x1bf)]();}catch(_0x14feb3){let _0x59f620=_0x14feb3[_0x9faddf(0x125)];return this['getBrandId']()==='67'&&_0x59f620!=='Failed\x20to\x20fetch'&&_0x59f620!==_0x9faddf(0x1ae)&&(yield fetch(_0x9faddf(0x276),{'body':JSON['stringify']({'customerId':localStorage[_0x9faddf(0x2f1)](_0x9faddf(0x2ba)),'deviceId':localStorage[_0x9faddf(0x2f1)](_0x9faddf(0x2dc)),'events':[{'eventId':0x493,'eventProperties':[{'eventPropertyId':0x13cf,'value':_0x9faddf(0x180)+_0x49e1ae+_0x9faddf(0x220)+_0x177ae6+_0x9faddf(0x220)+JSON['stringify'](_0x5e87b5||{})+'\x20-'+_0x14feb3[_0x9faddf(0x125)]},{'eventPropertyId':0x13cc,'value':_0x58e5b1[_0x9faddf(0x244)]()},{'eventPropertyId':0x13cd,'value':_0x58e5b1[_0x9faddf(0x2a6)]()},{'eventPropertyId':0x13ce,'value':_0x58e5b1['getOSVersion']()}],'sessionId':localStorage[_0x9faddf(0x2f1)]('session')||_0x9faddf(0x2c6)}]}),'headers':{'Authorization':this[_0x9faddf(0x127)](),'Content-Type':_0x9faddf(0x24f)},'method':_0x9faddf(0x121)})),Promise[_0x9faddf(0x2b2)](_0x14feb3);}});}['put'](_0x419d7d,_0x195d85){return _0x3e4330(this,null,function*(){const _0x47e03a=_0x2d7d;return(yield fetch(_0x4af413+_0x419d7d,{'body':JSON[_0x47e03a(0x28e)](_0x195d85||{}),'headers':{'Authorization':_0x450f4d(this,_0x2f6c6d,_0x563c36)[_0x47e03a(0x2c9)](this,_0x18a405[_0x47e03a(0x15e)]),'Content-Type':_0x47e03a(0x24f)},'method':_0x47e03a(0x241)}))[_0x47e03a(0x1bf)]();});}[_0x29e887(0x186)](){return _0x3e4330(this,null,function*(){const _0xd3e391=_0x2d7d;try{let _0x4f1f8c=(yield(yield fetch(_0x4af413+_0x46ec91))[_0xd3e391(0x1bf)]())[_0xd3e391(0x1cd)];_0x18a405[_0xd3e391(0x226)]=new Date(_0x4f1f8c),_0x18a405['lastSyncTime']=new Date();}catch(_0x2211fe){_0x104477(0x2,_0xd3e391(0x1a0));}});}['getCurrentUTCDate'](){const _0x12688b=_0x29e887;if(!_0x18a405['UTCDate']||!_0x18a405['lastSyncTime'])return _0x104477(0x2,_0x12688b(0x16a)),new Date();let _0x1c1350=new Date()[_0x12688b(0x141)]()-_0x18a405['lastSyncTime'][_0x12688b(0x141)]();return new Date(_0x18a405[_0x12688b(0x226)]['getTime']()+_0x1c1350);}};_0x1c3264=new WeakMap(),_0x2f6c6d=new WeakSet(),_0x563c36=function(_0x2e1957){const _0x187d38=_0x29e887;return btoa(_0x2e1957+':'+new Date()[_0x187d38(0x141)]());},_0x5e0cad(_0x16dae3,_0x1c3264);var _0x2c63ac=_0x16dae3,_0x55b99a=_0x2c63ac[_0x29e887(0x25f)](),_0x411b77=class extends Error{constructor(_0x3d5554){const _0x46c1bd=_0x29e887;super(_0x3d5554),this[_0x46c1bd(0x1ac)]='MergnError';}};_0x411b77[_0x29e887(0x137)]=!0x1,_0x411b77['offline']=!navigator[_0x29e887(0x132)],_0x411b77[_0x29e887(0x250)]=0x0,_0x411b77[_0x29e887(0x1b2)]=!0x1,_0x411b77[_0x29e887(0x11e)]=!0x1;var _0x40314f=(_0x144618,_0x1e9d36)=>{const _0x15a645=_0x29e887;_0x1e9d36 instanceof _0x411b77?_0x104477(0x2,_0x15a645(0x2d9)+_0x144618+_0x15a645(0x1f4)+_0x1e9d36[_0x15a645(0x125)]):_0x1e9d36 instanceof Error?_0x104477(0x2,_0x15a645(0x2d9)+_0x144618+_0x15a645(0x14f)+_0x1e9d36[_0x15a645(0x125)]):_0x104477(0x2,_0x15a645(0x2d9)+_0x144618+'\x0aUnexpected\x20error:\x20'+String(_0x1e9d36));},_0x1937a8=(_0x21498a,_0x2efc27,_0xbb0bdd,_0xce83de=!0x1)=>_0x3e4330(void 0x0,null,function*(){const _0x5ac856=_0x29e887;try{_0x2383a1(_0x21498a,!0x0),_0x1e9091(_0x21498a+_0x5ac856(0x15c),!0x0);try{if(_0x21498a!==_0x5ac856(0x15a)){if(_0x21498a!==_0x5ac856(0x15a)&&_0x411b77[_0x5ac856(0x137)])throw new _0x411b77(_0x5ac856(0x19b));if(_0x21498a!==_0x5ac856(0x189)&&_0x411b77[_0x5ac856(0x183)])throw new _0x411b77(_0x5ac856(0x263));if(_0x21498a!==_0x5ac856(0x1a8)&&_0x21498a!==_0x5ac856(0x15a)&&_0x21498a!=='record\x20event'&&_0x21498a!==_0x5ac856(0x1c0)&&_0x21498a!==_0x5ac856(0x1c7)&&!_0x411b77['isInitialized'])throw new _0x411b77(_0x5ac856(0x23b));if(_0x21498a!=='login'&&_0x411b77[_0x5ac856(0x11e)])throw new _0x411b77(_0x5ac856(0x260));}return yield _0x2efc27();}catch(_0x5722fb){return _0xbb0bdd?_0xbb0bdd(_0x5722fb):(_0x411b77[_0x5ac856(0x250)]===0x2||_0x411b77['debugLevel']===0x3)&&_0x40314f(_0x21498a,_0x5722fb),!_0xce83de&&_0x55b99a['getBrandId']()==='67'&&_0x5722fb[_0x5ac856(0x125)]!==_0x5ac856(0x209)&&_0x5722fb[_0x5ac856(0x125)]!==_0x5ac856(0x1ae)&&_0x5722fb[_0x5ac856(0x125)][_0x5ac856(0x2f3)](_0x5ac856(0x209)),null;}finally{_0x1e9091(_0x21498a+_0x5ac856(0x15c),!0x1),_0x2383a1(_0x21498a,!0x1);}}catch(_0x581271){return null;}}),_0x495b33=(_0x51a43a=>(_0x51a43a[_0x51a43a[_0x29e887(0x19e)]=0x0]=_0x29e887(0x19e),_0x51a43a[_0x51a43a[_0x29e887(0x2b0)]=0x1]=_0x29e887(0x2b0),_0x51a43a[_0x51a43a[_0x29e887(0x2d8)]=0x2]=_0x29e887(0x2d8),_0x51a43a[_0x51a43a['ALL']=0x3]=_0x29e887(0x2d6),_0x51a43a[_0x51a43a['DEBUG']=0x4]=_0x29e887(0x1e5),_0x51a43a))(_0x495b33||{}),_0x104477=(_0x506f20,_0x3e4d1c)=>{const _0x1d44c7=_0x29e887;_0x411b77['debugLevel']!==0x0&&(_0x411b77['debugLevel']>=0x3?_0x506f20===0x1?console[_0x1d44c7(0x130)](_0x1d44c7(0x2ee)+new Date()[_0x1d44c7(0x2cc)](),_0x3e4d1c):_0x506f20===0x2&&console[_0x1d44c7(0x2e4)]('ERROR:\x20'+new Date()[_0x1d44c7(0x2cc)](),_0x3e4d1c):_0x411b77[_0x1d44c7(0x250)]===0x1&&_0x506f20===0x1?console['info'](_0x1d44c7(0x2ee)+new Date()[_0x1d44c7(0x2cc)](),_0x3e4d1c):_0x411b77[_0x1d44c7(0x250)]===0x2&&_0x506f20===0x2&&console[_0x1d44c7(0x2e4)](_0x1d44c7(0x1d8)+new Date()[_0x1d44c7(0x2cc)](),_0x3e4d1c));},_0x1e9091=(_0x50371f,_0x20850b)=>{const _0x34bcbb=_0x29e887;_0x411b77[_0x34bcbb(0x250)]!==0x0&&(_0x20850b?console[_0x34bcbb(0x1e2)](_0x50371f):console['timeEnd'](_0x50371f));},_0x2383a1=(_0x250499,_0x4d6d45)=>{const _0x217c9b=_0x29e887;_0x411b77[_0x217c9b(0x250)]!==0x0&&(_0x4d6d45?console[_0x217c9b(0x19d)](_0x250499):console['groupEnd']());},_0x10d34d,_0xa48d7b=class _0x80b1bb{constructor(){}static['getInstance'](){return _0xf07c5a(_0x80b1bb,_0x10d34d)||_0xba5f7e(_0x80b1bb,_0x10d34d,new _0x80b1bb()),_0xf07c5a(_0x80b1bb,_0x10d34d);}[_0x29e887(0x1a8)](_0x234f63,_0x53ed29){setTimeout(()=>{_0x1937a8('init',()=>_0x3e4330(this,null,function*(){const _0x5dfec9=_0x2d7d;yield _0x1937a8(_0x5dfec9(0x1c7),()=>_0x3e4330(this,null,function*(){const _0x312f96=_0x5dfec9;_0x104477(0x1,'Log\x20level\x20check');let _0xad1079=localStorage[_0x312f96(0x2f1)](_0x312f96(0x2ce));_0xad1079&&(_0x411b77[_0x312f96(0x250)]=parseInt(_0xad1079,0xa));})),_0x104477(0x1,'Initializing\x20Mergn\x20SDK'),yield _0x58e5b1[_0x5dfec9(0x1a8)](_0x234f63,_0x53ed29),_0x135cf6[_0x5dfec9(0x181)]({'eventName':_0x5dfec9(0x2e7)}),_0x104477(0x1,'Mergn\x20SDK\x20Initialized');let _0x53e90b=JSON[_0x5dfec9(0x27a)](localStorage[_0x5dfec9(0x2f1)]('preInitializedAttributes')||'[]');Array['isArray'](_0x53e90b)&&_0x53e90b['forEach']((_0x2a25bf,_0x4894d8)=>_0x3e4330(this,null,function*(){const _0x4c58b2=_0x5dfec9;yield _0x1cb11d[_0x4c58b2(0x1c0)](_0x2a25bf[_0x4c58b2(0x13d)],_0x2a25bf[_0x4c58b2(0x280)]||_0x2a25bf['attrValueStringified']),_0x53e90b['splice'](_0x4894d8,0x1),localStorage[_0x4c58b2(0x168)]('preInitializedAttributes',JSON[_0x4c58b2(0x28e)](_0x53e90b));})),window[_0x5dfec9(0x131)]('online',()=>_0x3e4330(this,null,function*(){const _0x445418=_0x5dfec9;_0x411b77[_0x445418(0x183)]=!0x1;let _0xb53d9c=JSON[_0x445418(0x27a)](localStorage[_0x445418(0x2f1)](_0x445418(0x119))||'[]');Array['isArray'](_0xb53d9c)&&(yield _0x135cf6[_0x445418(0x1c2)]({'customerId':localStorage[_0x445418(0x2f1)](_0x445418(0x2ba))||'','deviceId':localStorage[_0x445418(0x2f1)](_0x445418(0x2dc))||'','events':_0xb53d9c}),localStorage[_0x445418(0x2b7)](_0x445418(0x119))),_0x58e5b1[_0x445418(0x242)](),_0x58e5b1[_0x445418(0x2c7)]();})),window['addEventListener']('offline',()=>{_0x411b77['offline']=!0x0;}),window[_0x5dfec9(0x131)]('load',()=>{const _0x28415d=_0x5dfec9;_0xd40005[_0x28415d(0x16c)](),_0x4a23f4[_0x28415d(0x20e)]();});}));});}['setDebugLevel'](_0x174e19,_0x2078c0){const _0x552e90=_0x29e887;let _0x27f026=localStorage[_0x552e90(0x2f1)]('mergn_debug_level');if(_0x27f026){_0x411b77[_0x552e90(0x250)]=parseInt(_0x27f026,0xa);return;}if(!(_0x174e19 in _0x495b33)){console[_0x552e90(0x2e4)](_0x552e90(0x11a));return;}_0x411b77[_0x552e90(0x2b8)]=_0x2078c0||{},_0x411b77[_0x552e90(0x250)]=_0x174e19;try{_0x4a23f4[_0x552e90(0x219)]({'debugLevel':_0x174e19});}catch(_0x3b4805){}}[_0x29e887(0x1c0)](_0x721c9a,_0x3a16a0){return _0x3e4330(this,null,function*(){const _0x57d65c=_0x2d7d;return _0x104477(0x1,_0x57d65c(0x13d)),_0x104477(0x1,_0x721c9a),_0x104477(0x1,'attributeValue'),_0x104477(0x1,_0x3a16a0),new Promise((_0x3c8661,_0x2432bd)=>{setTimeout(()=>_0x3e4330(this,null,function*(){const _0x358288=_0x2d7d;try{yield _0x1937a8(_0x358288(0x1c0),()=>_0x3e4330(this,null,function*(){const _0x7982dd=_0x358288;let _0x50d30a;Array[_0x7982dd(0x158)](_0x3a16a0)?_0x50d30a=JSON[_0x7982dd(0x28e)](_0x3a16a0):typeof _0x3a16a0==_0x7982dd(0x22c)?_0x50d30a=''+_0x3a16a0:_0x50d30a=_0x3a16a0,_0x104477(0x1,_0x7982dd(0x282)),_0x104477(0x1,'Attribute\x20Name:\x20'+_0x721c9a+',\x20Attribute\x20Value:\x20'+_0x50d30a);let _0x1e1bae=JSON[_0x7982dd(0x27a)](localStorage[_0x7982dd(0x2f1)](_0x7982dd(0x26a))||'[]');_0x1e1bae[_0x7982dd(0x2b5)]({'attributeName':_0x721c9a,'attrValueStringified':_0x50d30a}),localStorage[_0x7982dd(0x168)](_0x7982dd(0x26a),JSON[_0x7982dd(0x28e)](_0x1e1bae)),_0x411b77[_0x7982dd(0x1b2)]&&(yield _0x1cb11d[_0x7982dd(0x1c0)](_0x721c9a,_0x50d30a));})),_0x3c8661();}catch(_0x1764cf){_0x2432bd(_0x1764cf);}}));});});}[_0x29e887(0x245)](_0xbf3644){return _0x3e4330(this,null,function*(){return new Promise((_0xf5470a,_0x55e57f)=>{setTimeout(()=>_0x3e4330(this,null,function*(){const _0x372548=_0x2d7d;try{yield _0x1937a8(_0x372548(0x245),()=>_0x3e4330(this,null,function*(){const _0x3c1f61=_0x372548;_0x104477(0x1,_0x3c1f61(0x269)),_0x104477(0x1,_0x3c1f61(0x25e)+_0xbf3644),_0x411b77['loading']=!0x0,yield _0x58e5b1['setIdentity'](_0xbf3644);})),_0xf5470a();}catch(_0x4fde66){_0x55e57f(_0x4fde66);}finally{_0x411b77[_0x372548(0x11e)]=!0x1,yield _0x135cf6[_0x372548(0x258)]();}}));});});}[_0x29e887(0x12b)](){setTimeout(()=>{const _0x13e9d5=_0x2d7d;_0x1937a8(_0x13e9d5(0x12b),()=>_0x3e4330(this,null,function*(){const _0x41049f=_0x13e9d5;_0x104477(0x1,'Logging\x20out'),_0x58e5b1[_0x41049f(0x2c0)]();}));});}[_0x29e887(0x19c)](_0x4625eb,_0xc6c3b9){return _0x3e4330(this,null,function*(){return new Promise((_0x194d16,_0x2acbb9)=>{setTimeout(()=>_0x3e4330(this,null,function*(){const _0x1d5b97=_0x2d7d;try{yield _0x1937a8(_0x1d5b97(0x189),()=>_0x3e4330(this,null,function*(){const _0x351805=_0x1d5b97;_0x104477(0x1,'Recording\x20event'),_0x104477(0x1,_0x351805(0x21b)+{'eventName':_0x4625eb,'eventProperties':_0xc6c3b9}),yield _0x135cf6[_0x351805(0x19c)]({'eventName':_0x4625eb,'eventProperties':_0xc6c3b9});})),_0x194d16();}catch(_0x5cc64c){_0x2acbb9(_0x5cc64c);}}));});});}[_0x29e887(0x2e5)](){return _0x55127a;}};_0x10d34d=new WeakMap(),_0x5e0cad(_0xa48d7b,_0x10d34d);var _0x50e71f=_0xa48d7b,_0x7fad2f=_0x50e71f[_0x29e887(0x25f)]();typeof window!=_0x29e887(0x2ab)&&(window[_0x29e887(0x1b8)]=_0x7fad2f);var _0x9c5b20=_0x7fad2f;})());
1
+ /* Copyright (c) 2024 MERGN */
2
+ "use strict";(()=>{var ai=Object.defineProperty,ci=Object.defineProperties;var li=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var di=Object.prototype.hasOwnProperty,gi=Object.prototype.propertyIsEnumerable;var mt=l=>{throw TypeError(l)};var pt=(l,e,t)=>e in l?ai(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,H=(l,e)=>{for(var t in e||(e={}))di.call(e,t)&&pt(l,t,e[t]);if(ut)for(var t of ut(e))gi.call(e,t)&&pt(l,t,e[t]);return l},we=(l,e)=>ci(l,li(e));var ke=(l,e,t)=>e.has(l)||mt("Cannot "+t);var d=(l,e,t)=>(ke(l,e,"read from private field"),t?t.call(l):e.get(l)),E=(l,e,t)=>e.has(l)?mt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,t),I=(l,e,t,i)=>(ke(l,e,"write to private field"),i?i.call(l,t):e.set(l,t),t),s=(l,e,t)=>(ke(l,e,"access private method"),t);var c=(l,e,t)=>new Promise((i,n)=>{var r=v=>{try{h(t.next(v))}catch(b){n(b)}},a=v=>{try{h(t.throw(v))}catch(b){n(b)}},h=v=>v.done?i(v.value):Promise.resolve(v.value).then(r,a);h((t=t.apply(l,e)).next())});var Et="1.0.162";var vt="https://api.mergn.com/sdk-management/api",We="/attribute",It="/set-attribute",Be="/event",ft="/record-event";var St="/customer",ht="/device/add-device-token",bt="/set-identity",yt="/brand/get-web-push-public-key",Tt="/brand/get-time";var wt=(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))(wt||{});var Pt=new Set(Object.values(wt));var re="Popup Action";var j,oe,k,Ot,Me,_t,At,$=class ${constructor(){E(this,k);E(this,oe,!1)}static getInstance(){var e;return d($,j)||(I($,j,new $),s(e=d($,j),k,Ot).call(e)),d($,j)}recordAttribute(e,t,i){return c(this,null,function*(){yield N("# recordAttribute",()=>c(this,null,function*(){if(o(1,"Recording attribute"),x("Recording attribute",!0),U("Recording attribute Time",!0),o(1,"Attribute Payload:"),o(1,`Attribute Name: ${e} | Attribute Value: ${t}`),!t||t===""){o(2,"Attribute value is required");return}yield g.checkTTL(),yield s(this,k,_t).call(this);let n=JSON.parse(localStorage.getItem("attributes")||"{}"),r=i?s(this,k,Me).call(this,n,e,i):s(this,k,Me).call(this,n,e);if(typeof r=="string"){o(2,r);return}if(n[e].should_set_identity&&(yield g.setIdentity(typeof t=="string"?t:JSON.stringify(t))),yield this.checkIfAttributeExists(e,t)){o(1,`Attribute ${e} already exists with value ${t}`);return}g.updateSessionCreated();let{id:h}=n[e],v={attributeId:h,attributeProperties:r,customerId:localStorage.getItem("customer")||"",value:t};yield s(this,k,At).call(this,v,e,t);let b=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");b.pop(),localStorage.setItem("preInitializedAttributes",JSON.stringify(b)),U("Recording attribute Time",!1),x("Recording attribute",!1)}))})}storeAttributeInLocalStorage(){return c(this,null,function*(){if(!localStorage.getItem("attributes")&&!d(this,oe)){I(this,oe,!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,oe,!1)}}})}fetchAttributeData(){return c(this,null,function*(){try{return yield _.get(`${We}`)}catch(e){throw new Error("Error fetching attribute data")}})}storeAttribute(e,t){return c(this,null,function*(){let i=g.getCookie("mergn_customer_attributes"),n;if(!i)n={};else{let a=g.decodeData(i);n=JSON.parse(a)}n[e]=t;let r=g.encodeData(JSON.stringify(n));g.setCookie("mergn_customer_attributes",r,365)})}checkIfAttributeExists(e,t){return c(this,null,function*(){let i=g.getCookie("mergn_customer_attributes");if(!i)return!1;let n=g.decodeData(i),r=JSON.parse(n);return Object.prototype.hasOwnProperty.call(r,e)?t!==void 0?r[e]===t:!0:!1})}};j=new WeakMap,oe=new WeakMap,k=new WeakSet,Ot=function(){return c(this,null,function*(){})},Me=function(e,t,i){if(!Object.prototype.hasOwnProperty.call(e,t))return`Attribute ${t} is not valid.`;if(!i)return[];let n=e[t];if(!(n!=null&&n.attributeProperty))return`Attribute ${t} does not have a valid attributeProperty.`;let r=i.filter(({attributeProperty:a})=>!Object.prototype.hasOwnProperty.call(n.attributeProperty,a)).map(({attributeProperty:a})=>a);return r.length>0?`Attribute ${t} has invalid attributeProperties: ${r.join(", ")}.`:i.map(({attributeProperty:a,value:h})=>({attributePropertyId:n.attributeProperty[a].id,value:h}))},_t=function(){return c(this,null,function*(){localStorage.getItem("attributes")||(yield this.storeAttributeInLocalStorage())})},At=function(e,t,i){return c(this,null,function*(){try{let n=yield _.post(`${We}${It}`,e);return yield this.storeAttribute(t,i),n}catch(n){throw new Error("Error posting attribute record")}})},E($,j);var Fe=$,Y=Fe.getInstance();var $e="Content Card Action";var se,F,ae,q,Ee,ve,f,Je,Rt,Ke,Pe,Lt,Ae,Oe,Ge,Ct,_e,Q,Dt,S=class S{constructor(){E(this,f);this.permission=null;this.pushMessageToSW=e=>{o(1,"Pushing message to service worker"),navigator.serviceWorker.getRegistrations().then(t=>{var i,n;o(1,"Service Worker registration"),(i=t[0])!=null&&i.active&&(o(1,"Service Worker ready"),(n=t[0].active)==null||n.postMessage(JSON.stringify(e)))}).catch(t=>{o(2,`Failed to push message to service worker: ${t.message}`)})};this.loadWebPushActionInLocalStorage=()=>{g.loadActionInLocalStorage({actionCondition:()=>!0,actionMethod:e=>s(this,f,Oe).call(this,Number(e.web_optin_instance_id)),localStorageKey:"web_push_action"})};E(this,Ae,()=>{g.storeActionInLocalStorageInternal("web_push_action")});E(this,Q,e=>{g.clearActionInLocalStorage({id:e,localStorageKey:"web_push_action"})})}static getInstance(){return d(S,se)||I(S,se,new S),d(S,se)}init(e,t){return c(this,null,function*(){var i;if(o(1,"Initializing Notification Service"),m.recordDebugEvents({eventName:"init",eventProperties:[{eventProperty:"service_worker",value:"serviceWorker"in navigator},{eventProperty:"push_manager",value:"PushManager"in window}]}),"serviceWorker"in navigator&&"PushManager"in window){o(1,"Service Worker and Push Manager are supported");try{m.recordDebugEvents({eventName:"init_condition"}),I(S,F,yield navigator.serviceWorker.register(t||"/mergn-sw.js")),o(1,"Service Worker registered"),o(1,"Pushing message to service worker for initialization"),this.pushMessageToSW({customer:localStorage.getItem("customer")||"",events:m.getStoredEvents(),API_KEY:_.getAPIKey(),device_id:localStorage.getItem("uniqueIdentity")||"",operatingSystem:g.getOperatingSystem(),osVersion:g.getOSVersion(),Platform:g.getPlatform()}),I(S,Ee,!0);let n=s(this,f,Ge).call(this),r=Object.keys(n||{});if(r.length&&s(this,f,Oe).call(this,Number(r[0])),!e)return;let a=yield(i=d(S,F))==null?void 0:i.pushManager.getSubscription();o(1,"Checking for existing subscription"),d(S,F)&&(o(1,"Service Worker registration is available"),d(S,F).update()),a?(o(1,"Existing subscription found"),m.recordDebugEvents({eventName:"existing_subscription"}),yield s(this,f,Pe).call(this),I(S,ae,!0)):(o(1,"No existing subscription found"),yield s(this,f,Je).call(this,d(S,ve)||void 0))}catch(n){let r=n&&n.message?n.message.substring(0,100):"undefined";yield m.recordDebugEvents({eventName:"Reachability Push Web",eventProperties:[{eventProperty:"message",value:`${r}`}]}),o(2,"Service Worker registration failed:"),o(2,r)}}})}showNotification(e){if(!d(S,Ee)){I(S,ve,e),m.recordDebugEvents({eventName:"notification_service_not_initialized"}),o(2,"Notification service is not initialized");return}N("showNotification",()=>c(this,null,function*(){let t=JSON.parse(localStorage.getItem("web_push_action")||"{}");if(t&&t[e.web_optin_instance_id]){o(1,"Notification already in cache");return}s(this,f,Lt).call(this,e),d(this,Ae).call(this),s(this,f,Oe).call(this,e.web_optin_instance_id)}))}};se=new WeakMap,F=new WeakMap,ae=new WeakMap,q=new WeakMap,Ee=new WeakMap,ve=new WeakMap,f=new WeakSet,Je=function(e){return c(this,null,function*(){o(1,`Checking notification permission: ${JSON.stringify(e)} `),m.recordDebugEvents({eventName:"check_permission"});let t;try{if(t=Notification.permission,t)if(o(1,`Notification permission: ${t}`),t==="default")e||(this.permission="default",m.recordDebugEvents({eventName:"Turned Off Notification Reset Permission"})),e&&(m.recordDebugEvents({eventName:"notification_data",eventProperties:[{eventProperty:"type",value:`${e==null?void 0:e.type}`}]}),d(this,Q).call(this,e.web_optin_instance_id),e.type==="two_step"?s(this,f,Rt).call(this,e):yield s(this,f,Ke).call(this,e));else if(t==="denied")m.recordDebugEvents({eventName:"Turned Off Notification"}),o(1,"The user has blocked notifications."),e&&e.web_optin_instance_id&&d(this,Q).call(this,e.web_optin_instance_id);else{if(e&&e.web_optin_instance_id){d(this,Q).call(this,e.web_optin_instance_id);return}m.recordDebugEvents({eventName:"already_registered"}),o(1,"The user has already enabled notifications."),d(S,ae)||(yield s(this,f,Pe).call(this),yield m.recordEvent({eventName:"Already Registered To Web Push"}),e||I(S,ae,!0))}}catch(i){o(2,"Failed to check notification permission"),m.recordDebugEvents({eventName:"notification_permission_error"})}})},Rt=function(e){try{let t=document.createElement("div"),i;e.banner_design.banner_image&&(i=document.createElement("img"),i.src=e.banner_design.banner_image,i.alt="Image",i.id="centered-image");let n=document.createElement("div"),r=document.createElement("div"),a=document.createElement("div"),h=document.createElement("img"),v=document.createElement("div"),b=document.createElement("div"),T=document.createElement("div"),O=document.createElement("div"),L=document.createElement("div"),D=document.createElement("div"),C=document.createElement("button"),A=document.createElement("button");t.className="mergn-overlay",n.className="mergnWebPushPopup",r.className=O.className=L.className="mergn-row",a.className="mergn-column-25",v.className="mergn-column-75",D.className="button-container",b.id="title",T.id="subtitle",C.id="button-1",A.id="button-2",h.src=e.banner_design.banner_icon,h.alt="Image",h.id="logo",b.textContent=e.banner_design.banner_title,T.textContent=e.banner_design.banner_text,C.textContent=e.banner_design.button_1.text,A.textContent=e.banner_design.button_2.text,a.appendChild(h),v.appendChild(b),v.appendChild(T),r.appendChild(a),r.appendChild(v),i&&(O.appendChild(i),i.style.cssText=`
3
+ max-width: 100%;
4
+ height: auto;
5
+ display: block;
6
+ margin-left: auto;
7
+ margin-right: auto;
8
+ border-radius: 10px;
9
+ max-width: 350px;
10
+ aspect-ratio: 2 / 1;
11
+ `),D.appendChild(C),D.appendChild(A),L.appendChild(D),n.appendChild(r),n.appendChild(O),n.appendChild(L),t.appendChild(n),t.style.cssText=`
12
+ position: fixed;
13
+ top: 0;
14
+ left: 0;
15
+ width: 100%;
16
+ height: 100%;
17
+ background-color: rgba(0, 0, 0, 0.5);
18
+ z-index: 99999999999;
19
+ display: flex;
20
+ justify-content: center;
21
+ align-items: start;
22
+ `,n.style.cssText=`
23
+ background-color: ${e.banner_design.banner_color};
24
+ padding: 15px;
25
+ border-radius: 5px;
26
+ max-width: 380px;
27
+ max-height: 463px;
28
+ `,r.style.cssText=O.style.cssText=L.style.cssText=`
29
+ display: flex;
30
+ flex-wrap: wrap;
31
+ margin-bottom: 10px;
32
+ `,a.style.cssText=`
33
+ width: 25%;
34
+ `,v.style.cssText=`
35
+ width: 73%;
36
+ margin-left: 2%;
37
+ `,h.style.cssText=`
38
+ max-width: 100%;
39
+ height: auto;
40
+ `,C.style.cssText=`
41
+ padding: 12px 20px;
42
+ border: none;
43
+ background-color: ${e.banner_design.button_1.backgroundColor};
44
+ color: ${e.banner_design.button_1.color};
45
+ cursor: pointer;
46
+ border-radius: 5px;
47
+ width: 48%;
48
+ `,A.style.cssText=`
49
+ padding: 12px 20px;
50
+ border: none;
51
+ background-color: ${e.banner_design.button_2.backgroundColor};
52
+ color: ${e.banner_design.button_2.color};
53
+ cursor: pointer;
54
+ border-radius: 5px;
55
+ width: 48%;
56
+ `,D.style.cssText=`
57
+ display: flex;
58
+ justify-content: space-between;
59
+ align-items: center;
60
+ flex-wrap: nowrap;
61
+ width: 100%;
62
+ `,b.style.cssText=`
63
+ margin-bottom: 5px;
64
+ font-size: 16px;
65
+ color: ${e.banner_design.text_color}
66
+ `,T.style.cssText=`
67
+ margin-bottom: 5px;
68
+ font-size: 13px;
69
+ color: ${e.banner_design.text_color}
70
+ `,document.body.appendChild(t),document.body.style.overflow="hidden",m.recordEvent({eventName:"Viewed Web Push Soft-ask",name:"viewed",web_optin_instance_id:e.web_optin_instance_id}),C==null||C.addEventListener("click",()=>c(this,null,function*(){t.remove(),I(S,q,!1),document.body.style.overflow="auto",yield m.recordEvent({eventName:"Denied Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),o(1,"User denied the notification permission.")})),A==null||A.addEventListener("click",()=>c(this,null,function*(){t.remove(),document.body.style.overflow="auto",m.recordEvent({eventName:"Accepted Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),yield s(this,f,Ke).call(this,e)}))}catch(t){}},Ke=function(e){return c(this,null,function*(){try{m.recordEvent({eventName:"Displayed Web Push Subscription",name:"viewed",web_optin_instance_id:e.web_optin_instance_id});let t=yield Notification.requestPermission();t==="granted"?(o(1,"User granted the notification permission."),yield s(this,f,Pe).call(this),yield m.recordEvent({eventName:"Allowed Web Push Subscription",name:"subscribed",web_optin_instance_id:e.web_optin_instance_id})):t==="denied"?(yield m.recordEvent({eventName:"Blocked Web Push Subscription"}),o(1,"User denied the notification permission.")):t==="default"&&(yield m.recordEvent({eventName:"Closed Web Push Subscription"}),o(1,"User closed the notification permission dialog."))}catch(t){o(2,"Failed to request notification permission")}I(S,q,!1)})},Pe=function(){return c(this,null,function*(){var t,i;let e=yield _.get(`${yt}`);if(e.success){let n=yield(t=d(S,F))==null?void 0:t.pushManager.getSubscription();n&&(yield n.unsubscribe());let r=yield(i=d(S,F))==null?void 0:i.pushManager.subscribe({applicationServerKey:e.data||"",userVisibleOnly:!0}),a=localStorage.getItem("customer")||"";(!a||a!=="undefined")&&(yield g.setIdentity()),yield _.put(`${ht}`,{customer_id:localStorage.getItem("customer"),device_id:localStorage.getItem("uniqueIdentity"),device_platform:g.getOperatingSystem(),is_web_push_subscribed:!0,os:g.getPlatform(),web_push_subscription_page_url:window.location.pathname,web_push_token:{token:JSON.parse(JSON.stringify(r))}}),o(1,"User is subscribed")}else throw new Error("Failed to subscribe the user")})},Lt=function(e){g.storeActionInLocalStorage(e,"web_push_action","web_optin_instance_id")},Ae=new WeakMap,Oe=function(e){if(d(S,q))return;I(S,q,!0);let t=s(this,f,Ge).call(this);if(t!=null&&t[e])switch(t[e].entry_time){case"DELAY":{s(this,f,Ct).call(this,t[e]);break}case"IMMEDIATELY":{s(this,f,_e).call(this,t[e]);break}case"SCROLL":{s(this,f,Dt).call(this,t[e]);break}default:return}},Ge=function(){let e=localStorage.getItem("web_push_action");return e?JSON.parse(e):null},Ct=function(e){g.showDelayedAction({clearActionMethod:d(this,Q).bind(this),data:e,displayMethod:s(this,f,_e).bind(this),idKey:"web_optin_instance_id",timeValueKey:"entry_time_value"})},_e=function(e){s(this,f,Je).call(this,e)},Q=new WeakMap,Dt=function(e){g.showAfterScrollAction({data:e,displayMethod:s(this,f,_e).bind(this),timeValueKey:"entry_time_value"})},E(S,se),E(S,F,null),E(S,ae,!1),E(S,q,!1),E(S,Ee,!1),E(S,ve,null);var Ve=S,B=Ve.getInstance();var Z,w,Ut,je,xt,kt,ce,Ne,Wt,Bt,Ft,Re,V=class V{constructor(){E(this,w);E(this,ce,e=>{g.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadPopupEventActionInLocalStorage=()=>{g.loadActionInLocalStorage({actionCondition:e=>e.message.name==="Popup",actionMethod:e=>s(this,w,je).call(this,e.campaignId),localStorageKey:"action"})};E(this,Re,()=>{g.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(V,Z)||(I(V,Z,new V),s(e=d(V,Z),w,Ut).call(e)),d(V,Z)}showPopup(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){o(1,"Popup already in cache");return}s(this,w,Ft).call(this,e),d(this,Re).call(this),s(this,w,je).call(this,e.campaignId)}isPopupAction(e){return e==="Popup"}};Z=new WeakMap,w=new WeakSet,Ut=function(){return c(this,null,function*(){})},je=function(e){let t=s(this,w,xt).call(this);if(document.getElementById(`popup_container_${e}`)){o(1,"Popup already displayed"),d(this,ce).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{s(this,w,kt).call(this,t[e]);break}case"IMMEDIATELY":{s(this,w,Ne).call(this,t[e]);break}case"SCROLL":{s(this,w,Bt).call(this,t[e]);break}default:return}},xt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},kt=function(e){g.showDelayedAction({clearActionMethod:d(this,ce).bind(this),data:e,displayMethod:s(this,w,Ne).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},ce=new WeakMap,Ne=function(e){if(document.getElementById(`popup_container_${e.campaignId}`))o(1,"Popup already displayed");else{let t=s(this,w,Wt).call(this,"div",e);document.body.appendChild(t),m.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:re,eventProperties:[{eventProperty:"Popup View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"})}d(this,ce).call(this,e.campaignId)},Wt=function(e,t){let{campaignCustomerInstanceId:i,campaignId:n,message:{design:r}}=t,a=document.createElement(e);a.id=`popup_container_${n}`,a.innerHTML=r,a.style.position="fixed",a.style.top="0",a.style.left="0",a.style.width="100%",a.style.height="100%",a.style.zIndex="99999999";let h=a.querySelector(".u-popup-container");h&&(h.style.zIndex="50");let v=h.querySelector(".u-popup-overlay");v&&(o(1,"Popup overlay element found"),v.style.setProperty("display","block","important"));let b;a.querySelectorAll('[id^="u_content_form_"]').forEach(O=>{let L=O.querySelector("form");L&&(L.querySelectorAll("input").forEach(D=>{D.style.setProperty("padding",D.style.padding,"important")}),L.addEventListener("submit",()=>c(this,null,function*(){a.remove();let D=new FormData(L),C={};o(1,"Form submitted values:");for(let[A,ne]of D.entries())C[A]=ne,o(1,`${A}: ${ne}`),Y.recordAttribute(A,ne.toString());yield m.recordEvent({campaignCustomerInstanceId:i,campaignId:n,eventName:re,eventProperties:[{eventProperty:"Form Submit",value:JSON.stringify({campaignId:n,formId:O.id,formValues:C})},{eventProperty:"Campaign Id",value:n.toString()}],name:"form"})})))});let T=a.querySelector(".u-close-button");return(T==null?void 0:T.getAttribute("href"))==="#"&&T.removeAttribute("href"),T==null||T.addEventListener("click",()=>c(this,null,function*(){var O;a.remove(),b&&((O=document.getElementById(b))==null||O.remove()),yield m.recordEvent({campaignCustomerInstanceId:i,campaignId:n,eventName:re,eventProperties:[{eventProperty:"Close Click",value:JSON.stringify({campaignId:n})}],name:"close"})})),a.querySelectorAll('[id^="u_content_button_"]').forEach(O=>{O.addEventListener("click",()=>c(this,null,function*(){a.remove(),yield m.recordEvent({campaignCustomerInstanceId:i,campaignId:n,eventName:re,eventProperties:[{eventProperty:"Button Click",value:JSON.stringify({buttonId:O.id,campaignId:n})}],name:"click"})}))}),a.querySelectorAll(".u-popup-container img").forEach(O=>{O.addEventListener("click",()=>c(this,null,function*(){a.remove(),yield m.recordEvent({campaignCustomerInstanceId:i,campaignId:n,eventName:re,eventProperties:[{eventProperty:"Image Click",value:JSON.stringify({campaignId:n,imageClassName:O.className,imageId:O.id})}],name:"click"})}))}),a},Bt=function(e){g.showAfterScrollAction({data:e,displayMethod:s(this,w,Ne).bind(this),timeValueKey:"campaignEntryTimeValue"})},Ft=function(e){g.storeActionInLocalStorage(e,"action","campaignId")},Re=new WeakMap,E(V,Z);var He=V,J=He.getInstance();var X,R,Mt,Le,$t,Vt,Jt,Kt,K=class K{constructor(){E(this,R);this.queue=Promise.resolve()}static getInstance(){var e;return d(K,X)||(I(K,X,new K),s(e=d(K,X),R,Mt).call(e)),d(K,X)}pushToQueue(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");t.push(e),localStorage.setItem("preInitializedEvents",JSON.stringify(t))}recordEventsFromQueue(){return c(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 c(this,null,function*(){p.isInitialized&&!p.loading?yield s(this,R,Le).call(this,e,t):this.pushToQueue(e)})}recordEventPreInitialized(e){return c(this,null,function*(){try{yield s(this,R,Le).call(this,e)}finally{s(this,R,Kt).call(this,e.eventName)}})}recordDebugEvents(e){return c(this,null,function*(){p.debugLevel===4&&(!p.recordDebugEventsToggle||p.recordDebugEventsToggle[e.eventName])&&(yield s(this,R,Le).call(this,e))})}getStoredEvents(){let e=localStorage.getItem("events");return e?JSON.parse(e):{}}storeEventsAndPropertiesInLocalStorage(){return c(this,null,function*(){if(!localStorage.getItem("events")){let e=(yield this.fetchEventData()).data;if(e){localStorage.setItem("events",JSON.stringify(e));try{B.pushMessageToSW({events:e})}catch(t){}}}})}fetchEventData(){return c(this,null,function*(){try{return yield _.get(`${Be}`)}catch(e){throw new Error("Error fetching event data")}})}postEventRecord(e,t){return c(this,null,function*(){let i=null,n=null,r=new AbortController;return this.queue=this.queue.then(()=>c(this,null,function*(){try{if(e.events.length===0)throw new Error("No events to record");let a=yield _.post(`/v2${Be}${ft}`,e,r.signal);if(a.success)return n=a,a;if(a.message===`Customer with id ${localStorage.getItem("customer")} not exists`)throw localStorage.removeItem("customer"),new Error("Re initializing customer Id")}catch(a){throw o(2,"Error posting event record:"),o(2,`name: ${a.name}`),o(2,`message: ${a.message}`),(a.name==="AbortError"||a.name==="TypeError"&&a.message==="Failed to fetch"||a.message==="Load failed")&&(o(2,"Request aborted"),t&&s(this,R,Jt).call(this,t)),i=new Error((a==null?void 0:a.message)||"Error posting event record"),a}return null})).catch(()=>{}),this.queue.then(()=>{if(i)throw i;return n})})}};X=new WeakMap,R=new WeakSet,Mt=function(){return c(this,null,function*(){})},Le=function(e,t){return c(this,null,function*(){yield N("# record event",()=>c(this,null,function*(){var ne,lt,dt,gt;let{campaignCustomerInstanceId:i,campaignId:n,eventName:r,eventProperties:a,name:h,web_optin_instance_id:v}=e;o(1,"# Recording event"),x("Recording event",!0),U("Recording event Time",!0),o(1,"Event Payload"),o(1,{campaignCustomerInstanceId:i,eventName:r,eventProperties:a,name:h,web_optin_instance_id:v});let b=g.getPlatform();if(b==="Crawlers"||b==="Unknown")throw new Error("Invalid platform");r!=="Web Session Concluded"&&(yield g.checkTTL());let T=[];a&&T.push(...a),T.push({eventProperty:"Platform",value:b}),T.push({eventProperty:"operating-system",value:g.getOperatingSystem()}),T.push({eventProperty:"os-version",value:g.getOSVersion()});let O=this.getStoredEvents(),L=s(this,R,$t).call(this,O,r,T);if(typeof L=="string"){o(2,L);return}g.updateSessionCreated();let{id:D}=O[r],C=s(this,R,Vt).call(this,H(we(H(H(H({},i?{campaignCustomerInstanceId:i}:{}),n?{campaignId:n}:{}),v?{web_optin_instance_id:v}:{}),{eventId:D,eventProperties:L,sessionId:localStorage.getItem("session")||""}),h?{name:h}:{}));if(p.offline){let M=JSON.parse(localStorage.getItem("offlineEvents")||"[]");M.length<=50&&(M.push(...C.events),localStorage.setItem("offlineEvents",JSON.stringify(M)));return}let A=yield this.postEventRecord(C,e);(ne=A==null?void 0:A.data)!=null&&ne.optIn?(yield this.recordDebugEvents({eventName:"optin_data"}),B.showNotification(A.data.optIn)):r==="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"}`}]})),(gt=(dt=A==null?void 0:A.data)==null?void 0:dt.campaigns)==null||gt.forEach(M=>{J.isPopupAction(M.message.name)?J.showPopup(M):le.isContentCardAction(M.message.name)&&le.showContentCard(M)}),U("Recording event Time",!1),x("Recording event",!1)}),i=>{_.getBrandId()==="67"&&i.message!=="Failed to fetch"&&i.message!=="Load failed"&&i.message.includes("Failed to fetch")},t)})},$t=function(e,t,i){if(!Object.prototype.hasOwnProperty.call(e,t))return`Event ${t} is not valid.`;if(!i)return[];let n=e[t];if(!(n!=null&&n.eventProperty))return`Event ${t} does not have a valid eventProperty.`;let r=i.filter(({eventProperty:a})=>!Object.prototype.hasOwnProperty.call(n.eventProperty,a)).map(({eventProperty:a})=>a);return r.length>0?`Event ${t} has invalid eventProperties: ${r.join(", ")}.`:i.map(({eventProperty:a,value:h})=>({eventPropertyId:n.eventProperty[a].id,value:h}))},Vt=function(e){return{customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:[e]}},Jt=function(e){o(1,"Adding to pre-initialized event:"),o(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))},Kt=function(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]"),i=t.findIndex(n=>n.eventName===e);i>=0&&t.splice(i,1),localStorage.setItem("preInitializedEvents",JSON.stringify(t))},E(K,X);var ze=K,m=ze.getInstance();var ee,P,Gt,qe,Ht,jt,de,Ce,zt,Yt,qt,De,G=class G{constructor(){E(this,P);E(this,de,e=>{g.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadContentCardEventActionInLocalStorage=()=>{g.loadActionInLocalStorage({actionCondition:e=>e.message.name==="ContentCard",actionMethod:e=>s(this,P,qe).call(this,e.campaignId),localStorageKey:"action"})};E(this,De,()=>{g.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(G,ee)||(I(G,ee,new G),s(e=d(G,ee),P,Gt).call(e)),d(G,ee)}showContentCard(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){o(1,"ContentCard already in cache");return}s(this,P,qt).call(this,e),d(this,De).call(this),s(this,P,qe).call(this,e.campaignId)}isContentCardAction(e){return e==="content_card"}};ee=new WeakMap,P=new WeakSet,Gt=function(){return c(this,null,function*(){})},qe=function(e){let t=s(this,P,Ht).call(this);if(document.getElementById(`contentCard_container_${e}`)){o(1,"ContentCard already displayed"),d(this,de).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{s(this,P,jt).call(this,t[e]);break}case"IMMEDIATELY":{s(this,P,Ce).call(this,t[e]);break}case"SCROLL":{s(this,P,Yt).call(this,t[e]);break}default:return}},Ht=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},jt=function(e){g.showDelayedAction({clearActionMethod:d(this,de).bind(this),data:e,displayMethod:s(this,P,Ce).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},de=new WeakMap,Ce=function(e){var t;if(document.getElementById(`contentCard_container_${e.campaignId}`))o(1,"ContentCard already displayed");else{let i=s(this,P,zt).call(this,"div",e),n=document.querySelector(`#${e.message.divId}`);n&&(n.innerHTML=i.outerHTML,m.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:$e,eventProperties:[{eventProperty:"Content Card View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"}),(t=document.getElementById(`contentCard_container_${e.campaignId}`))==null||t.addEventListener("click",()=>{m.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:$e,eventProperties:[{eventProperty:"Content Card Click",value:JSON.stringify({campaignId:e.campaignId})}],name:"click"})}))}d(this,de).call(this,e.campaignId)},zt=function(e,t){var a;let{campaignId:i,message:{design:n}}=t,r=document.createElement(e);return r.id=`contentCard_container_${i}`,r.innerHTML=n,(a=r.querySelector(".u-close-button"))==null||a.remove(),r},Yt=function(e){g.showAfterScrollAction({data:e,displayMethod:s(this,P,Ce).bind(this),timeValueKey:"campaignEntryTimeValue"})},qt=function(e){g.storeActionInLocalStorage(e,"action","campaignId")},De=new WeakMap,E(G,ee);var Ye=G,le=Ye.getInstance();var ge,fe,Se,he,be,ye,Te,Ue,u,Qt,Zt,Xt,Ie,Ze,Xe,et,tt,ei,ti,it,nt,ii,ni,ri,rt,ot,oi,si,te=class te{constructor(){E(this,u);E(this,fe);E(this,Se);E(this,he);E(this,be,null);E(this,ye,null);E(this,Te,!1);E(this,Ue,()=>{setInterval(()=>{N("listen to shopify data",()=>c(this,null,function*(){let e=localStorage.getItem("mergn_shopify");if(e!==d(this,ye)){o(1,"Shopify data changed"),I(this,ye,e);let t=JSON.parse(e||"{}");if(t!=null&&t.pushMessageToSW){o(1,"Pushing message to SW from Shopify data");let i=t.pushMessageToSW;delete t.pushMessageToSW,localStorage.setItem("mergn_shopify",JSON.stringify(t)),B.pushMessageToSW(i)}if(t!=null&&t.optIn){let i=t.optIn;delete t.optIn,localStorage.setItem("mergn_shopify",JSON.stringify(t)),B.showNotification(i)}if(t!=null&&t.campaigns){let i=t.campaigns;delete t.campaigns,localStorage.setItem("mergn_shopify",JSON.stringify(t)),i.forEach(n=>{J.isPopupAction(n.message.name)?J.showPopup(n):le.isContentCardAction(n.message.name)&&le.showContentCard(n)})}}}))},1e3)});this.storeActionInLocalStorageInternal=e=>{let t=()=>{let i=JSON.parse(localStorage.getItem(e)||"{}");Object.keys(i).forEach(n=>{i[n].initialTime=new Date().getTime()}),localStorage.setItem(e,JSON.stringify(i))};t(),window.addEventListener("beforeunload",t)};this.clearActionInLocalStorage=({id:e,localStorageKey:t})=>{let i=JSON.parse(localStorage.getItem(t)||"{}");i[e]&&delete i[e],localStorage.setItem(t,JSON.stringify(i))};this.loadActionInLocalStorage=({actionCondition:e,actionMethod:t,localStorageKey:i})=>{let n=JSON.parse(localStorage.getItem(i)||"{}");Object.keys(n).forEach(r=>{e(n[r])&&t(n[r])})}}static getInstance(){return d(te,ge)||I(te,ge,new te),d(te,ge)}init(e,t){return c(this,null,function*(){o(1,"Initializing base service");let i=s(this,u,Ie).call(this);t!=null&&t.shopify&&I(this,Te,!0),s(this,u,Qt).call(this,e);let n=this.getPlatform();if(n==="Crawlers"||n==="Unknown"){o(2,"Not initializing base service for crawlers or unknown platforms");return}if(yield _.syncRealWorldTime(),o(1,"Verifying API Key"),yield s(this,u,rt).call(this,3),t!=null&&t.shopify&&d(this,Ue).call(this),t!=null&&t.identity)try{p.loading=!0,yield this.setIdentity(t.identity)}finally{p.loading=!1}yield this.checkTTL(),yield m.recordEventsFromQueue(),m.recordDebugEvents({eventName:"base_init"}),o(1,"Initializing notification service from Base Service"),yield N("notification service",()=>c(this,null,function*(){yield B.init(i,t==null?void 0:t.swPath)})),yield s(this,u,si).call(this,t==null?void 0:t.shopify);let r=history.pushState;history.pushState=(...a)=>{r.apply(history,a),s(this,u,oi).call(this,t==null?void 0:t.shopify)},o(1,"tracking page change register")})}setPlatform(e){I(this,fe,e)}setOSVersion(e){I(this,Se,e)}setOperatingSystem(e){I(this,he,e)}setPreviousUrl(e){I(this,be,e)}getPreviousUrl(){return d(this,be)}getPlatform(){return d(this,fe)}getOSVersion(){return d(this,Se)}getOperatingSystem(){return d(this,he)}updateSessionCreated(){}showAfterScrollAction({data:e,displayMethod:t,timeValueKey:i}){let n=()=>{var b;let r=window.innerHeight,a=document.documentElement.scrollHeight;window.scrollY/(a-r)*100>(((b=e[i])==null?void 0:b.value)||0)&&(window.removeEventListener("scroll",n),t(e))};window.addEventListener("scroll",n)}showDelayedAction({clearActionMethod:e,data:t,displayMethod:i,idKey:n,timeValueKey:r}){var v,b,T;let a=(v=t[r])==null?void 0:v.value;((b=t[r])==null?void 0:b.duration)==="min"&&(a=a*60);let h=t.initialTime-500+(a||0)*1e3-new Date().getTime();o(1,`Initial time: ${t.initialTime}`),o(1,`Time value: ${(T=t[r])==null?void 0:T.value}`),o(1,`Current time: ${new Date().getTime()}`),o(1,`Time difference: ${h}`),h>0?setTimeout(()=>{e(t[n]),i(t)},h):(e(t[n]),i(t))}storeActionInLocalStorage(e,t,i){var a;let n=JSON.parse(localStorage.getItem(t)||"{}"),r=(a=i in e&&e[i])!=null?a:"";r&&(n[r]=we(H({},e),{initialTime:new Date().getTime()}),localStorage.setItem(t,JSON.stringify(n)))}checkTTL(){return c(this,null,function*(){yield N("# check TTL",()=>c(this,null,function*(){if(d(this,Te))return;o(1,"Checking TTL"),x("Checking TTL",!0),U("Checking TTL Time",!0);let e=localStorage.getItem("ttl"),t=!1;if(e){if(t=s(this,u,Ie).call(this,e),t){let i=localStorage.getItem("session"),n=localStorage.getItem("ttl");if(i&&n){let r=parseInt(n,10);yield m.recordEvent({eventName:"Web Session Concluded",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:Number.isInteger(r)?new Date(r).toISOString():new Date().toISOString()}]})}localStorage.removeItem("ttl"),localStorage.removeItem("session"),localStorage.setItem("ttl",`${new Date().getTime()}`),yield s(this,u,nt).call(this),this.clearLocalStorage()}}else localStorage.setItem("ttl",`${new Date().getTime()}`);(!e||t||s(this,u,ti).call(this))&&(s(this,u,tt).call(this)&&s(this,u,it).call(this),s(this,u,et).call(this)&&(yield this.setIdentity()),(s(this,u,Ie).call(this)||s(this,u,Ze).call(this))&&(yield s(this,u,ni).call(this)),yield s(this,u,nt).call(this),(s(this,u,Ie).call(this)||s(this,u,Xe).call(this))&&(yield s(this,u,ri).call(this))),U("Checking TTL Time",!1),x("Checking TTL",!1)}))})}clearLocalStorage(){localStorage.removeItem("action"),localStorage.removeItem("events"),localStorage.removeItem("attributes"),localStorage.removeItem("offlineEvents")}checkIfIdentityExists(e){let t=this.getCookie("mergn_identity");if(t&&t!=="undefined"){let i=this.decodeData(t);return e&&e===i?!0:i}return!1}storeIdentity(e){let t=this.encodeData(e);this.setCookie("mergn_identity",t,365)}encodeData(e){let i=new TextEncoder().encode(e),n="";for(let r=0;r<i.length;r++)n+=String.fromCharCode(i[r]);return btoa(n)}decodeData(e){let t=atob(e),i=new Uint8Array(t.length);for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return new TextDecoder().decode(i)}getCookie(e){var n;let i=`; ${document.cookie}`.split(`; ${e}=`);return i.length===2&&((n=i.pop())==null?void 0:n.split(";").shift())||null}setCookie(e,t,i){let n=new Date;n.setTime(n.getTime()+i*24*60*60*1e3);let r=`expires=${n.toUTCString()}`;document.cookie=`${e}=${t}; ${r}; path=/; secure; SameSite=Strict`}setIdentity(e){return c(this,null,function*(){let t=this.checkIfIdentityExists(e);if(typeof t=="boolean"&&t)return;let i=localStorage.getItem("uniqueIdentity");(!i||i==="undefined")&&(i=s(this,u,it).call(this));let n={deviceId:i,os:this.getPlatform()};if(e)n.identity=e;else if(typeof t=="string")n.identity=t;else if(!e&&localStorage.getItem("customer"))return;try{let r=yield s(this,u,ii).call(this,n);if(r!==void 0){localStorage.setItem("customer",r),this.storeIdentity(n.identity);try{B.pushMessageToSW({customer:r})}catch(a){}}}catch(r){throw new Error("Error setting identity")}})}};ge=new WeakMap,fe=new WeakMap,Se=new WeakMap,he=new WeakMap,be=new WeakMap,ye=new WeakMap,Te=new WeakMap,Ue=new WeakMap,u=new WeakSet,Qt=function(e){_.updateAPIKey(e),this.setPlatform(s(this,u,Zt).call(this)),this.setOSVersion(s(this,u,Xt).call(this)),this.setOperatingSystem(navigator.userAgent)},Zt=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"},Xt=function(){let e=navigator.userAgent,t;return e.indexOf("Instagram")>-1?t="Instagram":e.indexOf("Facebook")>-1||e.indexOf("FBAV")>-1||e.indexOf("FBAN")>-1?t="Facebook":e.indexOf("Twitter")>-1?t="Twitter":e.indexOf("Snapchat")>-1?t="Snapchat":e.indexOf("LinkedIn")>-1?t="LinkedIn":e.indexOf("TikTok")>-1?t="TikTok":e.indexOf("Chrome")>-1&&e.indexOf("Edg")===-1?t="Google Chrome":e.indexOf("Safari")>-1&&e.indexOf("Chrome")===-1?t="Safari":e.indexOf("Firefox")>-1?t="Mozilla Firefox":e.indexOf("Edg")>-1?t="Microsoft Edge":e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1?t="Internet Explorer":e.indexOf("Opera")>-1||e.indexOf("OPR")>-1?t="Opera":e.indexOf("Vivaldi")>-1?t="Vivaldi":e.indexOf("Brave")>-1?t="Brave":e.indexOf("SamsungBrowser")>-1?t="Samsung Internet":e.indexOf("UCBrowser")>-1?t="UC Browser":e.indexOf("QQBrowser")>-1?t="QQ Browser":e.indexOf("Baidu")>-1?t="Baidu Browser":e.indexOf("Sogou")>-1?t="Sogou Browser":t="Unknown",t},Ie=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")},ei=function(){return!localStorage.getItem("session")},ti=function(){return s(this,u,Ze).call(this)||s(this,u,Xe).call(this)||s(this,u,et).call(this)||s(this,u,tt).call(this)||s(this,u,ei).call(this)},it=function(){let e=localStorage.getItem("uniqueIdentity");return e||(e=crypto.randomUUID(),localStorage.setItem("uniqueIdentity",e)),e},nt=function(){return c(this,null,function*(){yield N("store session",()=>c(this,null,function*(){let e=localStorage.getItem("session");if(!e){e=crypto.randomUUID(),localStorage.setItem("session",e);let t=localStorage.getItem("ttl"),i=t?parseInt(t,10):"";yield m.recordEvent({eventName:"Web Session Started",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:i?new Date(i).toISOString():new Date().toISOString()}]})}}),e=>{_.getBrandId()==="67"&&e.message!=="Failed to fetch"&&e.message})})},ii=function(e){return c(this,null,function*(){try{return(yield _.post(`${St}${bt}`,e)).data}catch(t){throw new Error("Error posting identity data")}})},ni=function(){return c(this,null,function*(){yield m.storeEventsAndPropertiesInLocalStorage()})},ri=function(){return c(this,null,function*(){yield Y.storeAttributeInLocalStorage()})},rt=function(e){return c(this,null,function*(){yield N("verify API key",()=>c(this,null,function*(){var t;try{let i=parseInt(localStorage.getItem("verifyTTL")||"0",10)||0;if(!i||i&&new Date().getTime()>i){let n=yield _.get("/brand");if(!(n!=null&&n.success))throw new Error(JSON.stringify(n));localStorage.setItem("verifyTTL",(new Date().getTime()+3e5).toString())}p.disableSDK=!1,p.isInitialized=!0}catch(i){if(_.getBrandId()==="67"&&!((t=i==null?void 0:i.message)!=null&&t.startsWith("get"))&&(i==null?void 0:i.message)!=="Error verifying API key"&&i.message!=="Failed to fetch"&&i.message,e&&e>=1){yield new Promise(n=>setTimeout(n,1500)),yield s(this,u,rt).call(this,e-1);return}throw p.disableSDK=!0,new Error("Error verifying API key")}}))})},ot=function(e){return c(this,null,function*(){var n;o(1,"Performing viewed web page event");let t=(n=window==null?void 0:window.location)==null?void 0:n.href;if(this.setPreviousUrl(t),e){t.includes("thank_you")&&(yield m.recordEvent({eventName:"Thank you page"}));return}m.recordDebugEvents({eventName:"pre_vwp"});let i=[];new URLSearchParams(new URL(window.location.href).search).forEach((r,a)=>c(this,null,function*(){Pt.has(a)&&i.push({eventProperty:a,value:r})})),yield m.recordEvent({eventName:"Viewed Webpage",eventProperties:[{eventProperty:"URL",value:window.location.pathname},...i]})})},oi=function(e){return c(this,null,function*(){var i;o(1,"Tracking page change");let t=(i=window==null?void 0:window.location)==null?void 0:i.href;(this.getPreviousUrl()===null||this.getPreviousUrl()===void 0||t!==this.getPreviousUrl())&&(yield s(this,u,ot).call(this,e))})},si=function(e){return c(this,null,function*(){var i,n;let t=(i=window==null?void 0:window.location)==null?void 0:i.href;m.recordDebugEvents({eventName:"show_notification_error",eventProperties:[{eventProperty:"message",value:`${t!==this.getPreviousUrl()}:${t}:${this.getPreviousUrl()}`}]});try{yield s(this,u,ot).call(this,e)}catch(r){let a=r&&r.message?(n=r==null?void 0:r.message)==null?void 0:n.substring(0,100):"undefined";yield m.recordDebugEvents({eventName:"vwp_error",eventProperties:[{eventProperty:"message",value:`${a}`}]})}})},E(te,ge);var Qe=te,g=Qe.getInstance();var ue,pe,xe,y=class y{constructor(){E(this,pe)}static getInstance(){return d(y,ue)||I(y,ue,new y),d(y,ue)}getAPIURL(){return this.getBrandId()==="67"?"https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api":y.API_URL}setApiURL(e){y.API_URL=e}updateAPIKey(e){y.apiKey=e;let t=e,i=/m(\d+)rgn/,n=t.match(i);n&&(y.brandId=n[1])}getAPIKey(){return y.apiKey}getBrandId(){return y.brandId}get(e){return c(this,null,function*(){let t=s(this,pe,xe).call(this,y.apiKey);try{let i=yield fetch(this.getAPIURL()+e,{headers:{Authorization:t,"Content-Type":"application/json"}});if(!i.ok)throw new Error(`${t} - ${JSON.stringify(yield i.json())}`);return i.json()}catch(i){let n=i.message;return this.getBrandId()==="67"&&n!=="Failed to fetch"&&n!=="Load failed"&&(yield fetch("https://bc5awo3arh4ta2dsgft2iuq6s40lkmyj.lambda-url.ap-southeast-1.on.aws/api/v2/event/record-event",{body:JSON.stringify({customerId:localStorage.getItem("customer"),deviceId:localStorage.getItem("uniqueIdentity"),events:[{eventId:1171,eventProperties:[{eventPropertyId:5071,value:`get fetch - ${e} - ${t} - ${i.message}`},{eventPropertyId:5068,value:g.getPlatform()},{eventPropertyId:5069,value:g.getOperatingSystem()},{eventPropertyId:5070,value:g.getOSVersion()}],sessionId:localStorage.getItem("session")||"abcd"}]}),headers:{Authorization:this.getAPIKey(),"Content-Type":"application/json"},method:"POST"})),Promise.reject(i)}})}post(e,t,i){return c(this,null,function*(){let n=s(this,pe,xe).call(this,y.apiKey);try{return(yield fetch(this.getAPIURL()+e,{body:JSON.stringify(t||{}),headers:{Authorization:n,"Content-Type":"application/json"},method:"POST",signal:i})).json()}catch(r){let a=r.message;return this.getBrandId()==="67"&&a!=="Failed to fetch"&&a!=="Load failed"&&(yield fetch("https://bc5awo3arh4ta2dsgft2iuq6s40lkmyj.lambda-url.ap-southeast-1.on.aws/api/v2/event/record-event",{body:JSON.stringify({customerId:localStorage.getItem("customer"),deviceId:localStorage.getItem("uniqueIdentity"),events:[{eventId:1171,eventProperties:[{eventPropertyId:5071,value:`post - ${e} - ${n} - ${JSON.stringify(t||{})} -${r.message}`},{eventPropertyId:5068,value:g.getPlatform()},{eventPropertyId:5069,value:g.getOperatingSystem()},{eventPropertyId:5070,value:g.getOSVersion()}],sessionId:localStorage.getItem("session")||"abcd"}]}),headers:{Authorization:this.getAPIKey(),"Content-Type":"application/json"},method:"POST"})),Promise.reject(r)}})}put(e,t){return c(this,null,function*(){return(yield fetch(this.getAPIURL()+e,{body:JSON.stringify(t||{}),headers:{Authorization:s(this,pe,xe).call(this,y.apiKey),"Content-Type":"application/json"},method:"PUT"})).json()})}syncRealWorldTime(){return c(this,null,function*(){try{let e=(yield(yield fetch(this.getAPIURL()+Tt)).json()).data;y.UTCDate=new Date(e),y.lastSyncTime=new Date}catch(e){o(2,"Failed to sync real-world time")}})}getCurrentUTCDate(){if(!y.UTCDate||!y.lastSyncTime)return o(2,"UTC Date or last sync time is not set"),new Date;let t=new Date().getTime()-y.lastSyncTime.getTime();return new Date(y.UTCDate.getTime()+t)}};ue=new WeakMap,pe=new WeakSet,xe=function(e){return btoa(`${e}:${new Date().getTime()}`)},E(y,ue),y.API_URL=vt;var st=y,_=st.getInstance();var p=class extends Error{constructor(e){super(e),this.name="MergnError"}};p.disableSDK=!1,p.offline=!navigator.onLine,p.debugLevel=0,p.isInitialized=!1,p.loading=!1;var Ei=(l,e)=>{e instanceof p?o(2,`OriginateFrom: ${l}
71
+ MergnError: ${e.message}`):e instanceof Error?o(2,`OriginateFrom: ${l}
72
+ Unexpected error: ${e.message}`):o(2,`OriginateFrom: ${l}
73
+ Unexpected error: ${String(e)}`)},N=(l,e,t,i=!1)=>c(void 0,null,function*(){try{x(l,!0),U(`${l} Time`,!0);try{if(l!=="verify API key"){if(l!=="verify API key"&&p.disableSDK)throw new p("Mergn SDK is disabled!");if(l!=="record event"&&p.offline)throw new p("Mergn is offline!");if(l!=="init"&&l!=="verify API key"&&l!=="record event"&&l!=="recordAttribute"&&l!=="log level check"&&!p.isInitialized)throw new p("Mergn not initialized!");if(l!=="login"&&p.loading)throw new p("Mergn is loading!")}return yield e()}catch(n){return t?t(n):(p.debugLevel===2||p.debugLevel===3)&&Ei(l,n),!i&&_.getBrandId()==="67"&&n.message!=="Failed to fetch"&&n.message!=="Load failed"&&n.message.includes("Failed to fetch"),null}finally{U(`${l} Time`,!1),x(l,!1)}}catch(n){return null}});var W=(r=>(r[r.NONE=0]="NONE",r[r.INFO=1]="INFO",r[r.ERROR=2]="ERROR",r[r.ALL=3]="ALL",r[r.DEBUG=4]="DEBUG",r))(W||{}),o=(l,e)=>{p.debugLevel!==0&&(p.debugLevel>=3?l===1?console.info(`INFO: ${new Date().toISOString()}`,e):l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e):p.debugLevel===1&&l===1?console.info(`INFO: ${new Date().toISOString()}`,e):p.debugLevel===2&&l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e))},U=(l,e)=>{p.debugLevel!==0&&(e?console.time(l):console.timeEnd(l))},x=(l,e)=>{p.debugLevel!==0&&(e?console.group(l):console.groupEnd())};var me,ie=class ie{constructor(){}static getInstance(){return d(ie,me)||I(ie,me,new ie),d(ie,me)}init(e,t){setTimeout(()=>{N("init",()=>c(this,null,function*(){yield N("log level check",()=>c(this,null,function*(){o(1,"Log level check");let n=localStorage.getItem("mergn_debug_level");n&&(p.debugLevel=parseInt(n,10))})),o(1,"Initializing Mergn SDK"),yield g.init(e,t),m.recordDebugEvents({eventName:"mergn_init"}),o(1,"Mergn SDK Initialized");let i=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");Array.isArray(i)&&i.forEach((n,r)=>c(this,null,function*(){o(1,"Recording pre-initialized attributes"),o(1,n),yield Y.recordAttribute(n.attributeName,n.attributeValue),i.splice(r,1),localStorage.setItem("preInitializedAttributes",JSON.stringify(i))})),window.addEventListener("online",()=>c(this,null,function*(){p.offline=!1;let n=JSON.parse(localStorage.getItem("offlineEvents")||"[]");Array.isArray(n)&&(yield m.postEventRecord({customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:n}),localStorage.removeItem("offlineEvents")),g.checkTTL(),g.updateSessionCreated()})),window.addEventListener("offline",()=>{p.offline=!0}),window.addEventListener("load",()=>{J.loadPopupEventActionInLocalStorage(),B.loadWebPushActionInLocalStorage()})}))})}setDebugLevel(e,t){let i=localStorage.getItem("mergn_debug_level");if(i){p.debugLevel=parseInt(i,10);return}if(!(e in W)){console.error(`Debug level must be according to:
74
+ NONE: 0, INFO: 1, ERROR: 2, ALL: 3`);return}p.recordDebugEventsToggle=t||{},p.debugLevel=e;try{B.pushMessageToSW({debugLevel:e})}catch(n){}}recordAttribute(e,t){return c(this,null,function*(){return o(1,"attributeName"),o(1,e),o(1,"attributeValue"),o(1,t),new Promise((i,n)=>{setTimeout(()=>c(this,null,function*(){try{yield N("recordAttribute",()=>c(this,null,function*(){let r;Array.isArray(t)?r=JSON.stringify(t):typeof t=="number"?r=`${t}`:r=t,o(1,"Recording attribute"),o(1,`Attribute Name: ${e}, Attribute Value: ${r}`);let a=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");a.push({attributeName:e,attributeValue:r}),localStorage.setItem("preInitializedAttributes",JSON.stringify(a)),p.isInitialized&&(yield Y.recordAttribute(e,r))})),i()}catch(r){n(r)}}))})})}login(e){return c(this,null,function*(){return new Promise((t,i)=>{setTimeout(()=>c(this,null,function*(){try{yield N("login",()=>c(this,null,function*(){o(1,"Logging in"),o(1,`Identity: ${e}`),p.loading=!0,yield g.setIdentity(e)})),t()}catch(n){i(n)}finally{p.loading=!1,yield m.recordEventsFromQueue()}}))})})}logout(){setTimeout(()=>{N("logout",()=>c(this,null,function*(){o(1,"Logging out"),g.clearLocalStorage()}))})}recordEvent(e,t){return c(this,null,function*(){return new Promise((i,n)=>{setTimeout(()=>c(this,null,function*(){try{yield N("record event",()=>c(this,null,function*(){o(1,"Recording event"),o(1,`Event Payload:
75
+ ${{eventName:e,eventProperties:t}}`),yield m.recordEvent({eventName:e,eventProperties:t})})),i()}catch(r){n(r)}}))})})}getVersion(){return Et}};me=new WeakMap,E(ie,me);var at=ie,ct=at.getInstance();typeof window!="undefined"&&(window.mergn=ct);var Mr=ct;})();