class exoPnSubscriber{retries=0;constructor(){this.applicationServerKey="BCmti7ScwxxVAlB7WAyxoOXtV7J8vVCXwEDIFXjKvD-ma-yJx_eHJLdADyyzzTKRGb395bSAtxlh4wuDycO3Ih4";this.swName='worker.js'}static detectBrowser(userAgent){var browserDefinitions=[['firefox',/Firefox\/([0-9.]+)(?:\s|$)/],['opera',/Opera\/([0-9.]+)(?:\s|$)/],['opera',/OPR\/([0-9.]+)(:?\s|$)$/],['edge',/Edge\/([0-9._]+)/],['ie',/Trident\/7\.0.*rv:([0-9.]+)\).*Gecko$/],['ie',/MSIE\s([0-9.]+);.*Trident\/[4-7].0/],['ie',/MSIE\s(7\.0)/],['safari',/Version\/([0-9._]+).*Safari/],['chrome',/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],['bb10',/BB10;\sTouch.*Version\/([0-9.]+)/],['android',/Android\s([0-9.]+)/],['ios',/Version\/([0-9._]+).*Mobile.*Safari.*/],['yandexbrowser',/YaBrowser\/([0-9._]+)/],['crios',/CriOS\/([0-9.]+)(:?\s|$)/]];var isMobile=userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WebOS|Windows Phone/i);for(var i in browserDefinitions){var definition=browserDefinitions[i];if(definition[1].test(userAgent)){var match=definition[1].exec(userAgent);var version=match&&match[1].split(/[._]/).slice(0,3);var versionTails=Array.prototype.slice.call(version,1).join('')||'0';if(version&&version.length<3){Array.prototype.push.apply(version,version.length===1?[0,0]:[0])}return{name:definition[0],version:version.join('.'),versionNumber:parseFloat(version[0]+'.'+versionTails),isMobile:isMobile}}}return{name:"other",version:"1.0",versionNumber:1.0,isMobile:isMobile}}async run(zoneId,swName){this.zoneId=zoneId;this.swName=(typeof swName==='string'||swName instanceof String)?swName:this.swName;let missingZoneId=(typeof this.zoneId==='undefined'||this.zoneId.length<1);let missingSwName=(typeof this.swName==='undefined'||this.swName.length<1);if(missingZoneId||missingSwName||!exoPnSubscriber.isBrowserSupporting()){return false}this.registerSW();if(await exoPnSubscriber.isSubscribed()){exoPnSubscriber.sendEvent("already-subscribed")}else{return this.subscribe()}}static isBrowserSupporting(){let supported=(('serviceWorker'in navigator)&&('PushManager'in window)&&('showNotification'in ServiceWorkerRegistration.prototype));return(supported&&Notification.permission!=='denied')}static urlBase64ToUint8Array(base64String){const padding='='.repeat((4-base64String.length%4)%4);const base64=(base64String+padding).replace(/-/g,'+').replace(/_/g,'/');const rawData=window.atob(base64);return Uint8Array.from([...rawData].map((char)=>char.charCodeAt(0)))}subscribe(){exoPnSubscriber.sendEvent('subscribe-start');return navigator.serviceWorker.ready.then(serviceWorkerRegistration=>{return serviceWorkerRegistration.pushManager.subscribe({userVisibleOnly:true,applicationServerKey:exoPnSubscriber.urlBase64ToUint8Array(this.applicationServerKey),})}).then(subscription=>{return this.sendSubscriptionToBackend(subscription,'POST')}).then(subscription=>{if(subscription){exoPnSubscriber.sendEvent('enabled')}}).catch(e=>{if(Notification.permission==='denied'){exoPnSubscriber.sendEvent('subscribe-denied-by-user',e)}else if(Notification.permission==='default'&&this.retries===0){var that=this;var retry=function(){that.subscribe();document.removeEventListener("click",retry)};document.addEventListener("click",retry);this.retries++}else{exoPnSubscriber.sendEvent('subscribe-failed',e)}})}static isSubscribed(){return navigator.serviceWorker.ready.then(serviceWorkerRegistration=>{return serviceWorkerRegistration.pushManager.getSubscription()}).then(subscription=>{return((typeof subscription!=="undefined")&&subscription!==null)})}static sendEvent(event,exception){if(event==='enabled'){let myEvent=new CustomEvent('subscribe-yes');document.dispatchEvent(myEvent)}if(event==='already-subscribed'||event==='subscribe-denied-by-user'||event==='subscribe-failed'){let myEvent=new CustomEvent('subscribe-no');document.dispatchEvent(myEvent)}}async sendSubscriptionToBackend(subscription,method){let send={};send.endpoint=subscription.endpoint;send.key=btoa(String.fromCharCode.apply(null,new Uint8Array(subscription.getKey('p256dh'))));send.token=btoa(String.fromCharCode.apply(null,new Uint8Array(subscription.getKey('auth'))));send.idzone=this.zoneId;send.is_self_hosted=((typeof pn_is_self_hosted!=='undefined'))?pn_is_self_hosted:0;send.screen_resolution=screen.width+"x"+screen.height;return await fetch('https://'+this.zoneId+'.notify6.com/subscription.php',{method,body:JSON.stringify(send),credentials:'include'}).then(response=>{return{status:(response.status===200),data:{}}}).catch(reason=>console.log(reason))}registerSW(){navigator.serviceWorker.register(this.swName).then(()=>{exoPnSubscriber.sendEvent("sw-registered")},e=>{exoPnSubscriber.sendEvent('sw-failed',e)})}showKeys(){navigator.serviceWorker.register(this.swName);navigator.serviceWorker.ready.then(serviceWorkerRegistration=>serviceWorkerRegistration.pushManager.getSubscription()).then(subscription=>{if(!subscription){console.log("Can't get subscription")}console.log('endpoint',subscription.endpoint);console.log('key',btoa(String.fromCharCode.apply(null,new Uint8Array(subscription.getKey('p256dh')))));console.log('token',btoa(String.fromCharCode.apply(null,new Uint8Array(subscription.getKey('auth')))))}).catch(e=>{console.error('err: getting subscription ',e)})}}(function(exoDynamicParams){var exoLaunchPN=function(event){if(typeof pn_idzone==='undefined'){console.log("pn_idzone not defined");return}var idZone=parseInt(pn_idzone);if(typeof pn_filename==='undefined'){pn_filename='worker.js'}if(typeof pn_sleep_seconds==='undefined'){pn_sleep_seconds=5}if(typeof pn_is_self_hosted==='undefined'){pn_is_self_hosted=0}if(window.customTargeting!==undefined&&Object.keys(customTargeting).length){for(var key in customTargeting){customTargetingParams='&'+key+'='+customTargeting[key]}}var cookieZoneSoftAsk='pn-zone-ask';var cookieZoneSubscribe='pn-zone-done';var cookieNameZonePushNotification='pn-zone-'+idZone;var softAskOnceInHours=48;var checkSubscriptionAfterDays=45;var pn_soft_ask_translations={en:{title:"Click ALLOW to continue",description:"Would you like to receive great special offers and promotions?",yes:"Allow",no:"No, Thanks"},es:{title:"Haz clic en PERMITIR para continuar",description:"¿Te gustaría recibir ofertas especiales y promociones?",yes:"Permitir",no:"No, gracias"},fr:{title:"Cliquez sur AUTORISER pour continuer",description:"Souhaitez-vous recevoir d'excellentes offres spéciales et promotions?",yes:"Autoriser",no:"Non, merci"},de:{title:"Klicken Sie ERLAUBEN um fortzufahren",description:"Möchten Sie tolle Sonderangebote und Aktionen erhalten?",yes:"Erlauben",no:"Nein, Danke"},it:{title:"Clicca su \"ACCETTA\" per continuare",description:"Ti piacerebbe ricevere imperdibili offerte e promozioni?",yes:"Accetta",no:"No, grazie"},zh:{title:"单击“允许”继续",description:"你想获得特别优惠和促销活动吗?",yes:"允许",no:"不,谢谢"},pt:{title:"Clique em \"Permitir\" para continuar",description:"Gostaria de receber ofertas especiais e promoções?",yes:"Permitir",no:"Não, obrigado"},ru:{title:"Нажмите РАЗРЕШИТЬ, чтобы продолжить",description:"Вы бы хотели получать информацию о специальных предложениях и промо-акциях?",yes:"Разрешить",no:"Нет, спасибо"},cs:{title:"Klikni na Ano",description:"Chcete dostávat naše speciální nabídky a promo akce?",yes:"Ano",no:"Ne, děkuji"},sk:{title:"Pokračujte kliknutím na POVOLIŤ",description:"Máte záujem o zasielanie skvelých špeciálnych ponúk a akcií?",yes:"Áno",no:"Nie, ďakujem"},hu:{title:"Kattintson az Engedelyézem linkre a folytatáshoz",description:"Szeretnél értesülni különleges ajánlatokról és akciókról?",yes:"Engedélyezem",no:"Nem, Köszönöm"},hr:{title:"Kliknite DOPUSTI za nastavak",description:"Da li zelite primati specijale ponude i promocije",yes:"Dopusti",no:"Ne, hvala",}};if(typeof pn_soft_ask==='undefined'||pn_soft_ask==1){setTimeout(runPnSoftAsk,pn_sleep_seconds*1000)}else if(typeof pn_is_self_hosted!=='undefined'&&pn_is_self_hosted==1){var browser=exoPnSubscriber.detectBrowser(navigator.userAgent);if(browser.name==='firefox'&&browser.versionNumber>=72){document.addEventListener("click",runSubscription)}else{setTimeout(runSubscription,pn_sleep_seconds*1000)}}else{console.log("Wrong combination of pn_soft_ask or pn_is_self_hosted")}function runPnSoftAsk(){if(getZoneExpireTime()){return}var text=getText();var elem=document.createElement('div');elem.id='wpnAskModalContainer';elem.style.display='none';elem.innerHTML=getCss()+'