window.CUSTOMER_DATA_HUB_API_SERVER="https://hubapi.fromdoppler.com",window.POPUP_HUB_API_SERVER="https://apis.fromdoppler.com/doppler-popup-hub-msa/api",window.SCRAPING_API_SERVER="https://apis.fromdoppler.com/doppler-product-scraping",window.CDH_VERSION="v9.1.8",window.cdhReferrer=function(){var e;return e=window.cdh_stored_referrer||""===window.cdh_stored_referrer?window.cdh_stored_referrer:document.referrer,window.cdh_stored_referrer=window.location.href,e}();const enableCustomTracking=document.currentScript&&"true"==document.currentScript.getAttribute("enableCustomTracking"),domainsToBeLinked=document.currentScript&&document.currentScript.getAttribute("domainsToBeLinked");var _dha=function(){function e(e){var t;return void 0===(t="object"==typeof e[0]?e[0]:{}).local&&(t.local=!1),t}function t(e,t,r){return enableCustomTracking?{page:e||window.location.pathname,search:t,hash:r,referrer:window.cdhReferrer,host:window.location.host}:{page:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:window.cdhReferrer,host:window.location.host}}function r(e,t,r,n,o){_dha.pageInfo.getPageInformation(!1,null).then(i=>{_dha.proxy.trackData(_dha.storage.getItem("_dha__uuid"),window.location.host,e||window.location.pathname,n,t,r,_dha.utils.detectSourceByUrl(),"historychange_"+o,null,null,i,_dha.utils.hasEmail())})}function n(e){if(0!==e.button&&1!==e.button)return;const t=domainsToBeLinked&&domainsToBeLinked.split(",").map(function(e){return e.trim()});if(!t||0===t.length)return;const r=_dha.storage.getItem("_dha__em");if(r){const e=_dha.utils.asciiToHex(r),n={completeUrl:this.href,protocolHostAndPath:this.origin+this.pathname,search:this.search,hash:this.hash,host:this.host};-1!==t.indexOf(n.host)&&(this.href=_dha.utils.getUrlAddingNewParam(n,"dplrid",e))}}function o(e){if(!domainsToBeLinked||""===domainsToBeLinked.trim())return;const t=(e||document).getElementsByTagName("a"),r=t&&[].slice.call(t).filter(e=>e.href);[].forEach.call(r,function(e){e.addEventListener("click",n),e.addEventListener("auxclick",n)})}function i(e){const r=function(e){e.cdhFnOnChange&&e.removeEventListener("change",e.cdhFnOnChange),e.cdhFnOnChange=function(r){!function(e,r){if(_dha.utils.trackVisitorEmail(e.target.value)){const e=t(null,null,null);_dha.pageInfo.getPageInformation(!1,null).then(t=>{_dha.proxy.trackData(_dha.storage.getItem("_dha__uuid"),e.host,e.page,e.referrer,e.search,e.hash,"","inputemailchange",r.id,null,t,_dha.utils.hasEmail())})}}(r,e)},e.addEventListener("change",e.cdhFnOnChange)},n=(e||document).getElementsByTagName("input");[].forEach.call(n,function(e){("email"===e.type||e.id&&-1!==e.id.indexOf("email")||e.name&&-1!==e.name.indexOf("email"))&&r(e)})}return window.addEventListener("hashchange",function(e){if(!enableCustomTracking){var t=_dha.storage.getItem("_dha__uuid");t&&_dha.pageInfo.getPageInformation(!1,null).then(r=>{_dha.proxy.trackData(t,window.location.host,window.location.pathname,e.oldURL,window.location.search,window.location.hash,null,"hashchange",null,null,r,_dha.utils.hasEmail())})}}),{trackAddToCart:function(e){var t=e.formSelectors||[],r=_dha.pageInfoUtils.getTagsByNameAndAttribute("form",t),n=[];r&&r.length>=1&&r.forEach(function(e){var t=e.querySelector("input[type=submit], button[type=submit], button[type=button]");t&&n.push({form:e,input:t})}),n.forEach(function(e){e.input.addEventListener("click",function(){_dha.pageInfo.getPageInformation(!0,{involvedForm:e.form}).then(e=>{_dha.proxy.trackData(_dha.storage.getItem("_dha__uuid"),window.location.host,window.location.pathname,window.cdhReferrer,window.location.search,window.location.hash,_dha.utils.detectSourceByUrl(),"addcartformevent",null,null,e,_dha.utils.hasEmail())})})})},track:function(){var r=e(arguments);_dha.proxy.config(r);var n=_dha.storage.getItem("_dha__uuid"),o=_dha.utils.obtainEmailParameter(),i=function(e,t){var r=!1,n="";return e?(t&&e!==t?(n=t,_dha.storage.deleteItem("_dha__uuid"),_dha.storage.setItem("_dha__uuid",n),_dha.proxy.aliasVisitor(t,e)):n=e,{guid:n,isNewGuid:r}):(t?n=t:(n=_dha.utils.generateUUID(),r=!0),_dha.storage.setItem("_dha__uuid",n),{guid:n,isNewGuid:r})}(n,_dha.utils.getParameterByName("dha_id"));_dha.updateUrlLink(i.guid);const a=t(r.navigatedPage,r.search,r.hash);_dha.pageInfo.getPageInformation(!1,null).then(e=>{_dha.proxy.trackData(i.guid,a.host,a.page,a.referrer,a.search,a.hash,_dha.utils.detectSourceByUrl(),"pageview",null,null,e,_dha.utils.hasEmail())});var s=!1,u=!1,c=!1;if(o&&_dha.utils.isValidEmail(o)&&(s=!0,o===_dha.storage.getItem("_dha__em")&&(u=!0),c=_dha.utils.isFirstEmail(),_dha.storage.setItem("_dha__em",o)),i.isNewGuid)_dha.proxy.addVisitor(i.guid,s?o:null,window.location.host,c);else if(s&&!u)_dha.proxy.updateVisitor(i.guid,o,null,null,window.location.host,c);else if(localStorage.getItem("_dha__vud")){var d=new Date(JSON.parse(localStorage.getItem("_dha__vud")));new Date>d&&_dha.proxy.updateVisitor(i.guid,s?o:null,null,null,window.location.host,c)}},savePushNotificationToken:function(e,t){var r=_dha.storage.getItem("_dha__uuid"),n=_dha.storage.getItem("_dha__push_token");return!!r&&(!n||t?(_dha.storage.setItem("_dha__push_token","true"),_dha.proxy.updateVisitor(r,null,null,null,window.location.host,!1,e)):void 0)},trackForm:function(){var t=e(arguments);t.trackForm.length>0?_dha.trackFormByParameters(t.trackForm,t.navigatedPage,t.hash,t.search):_dha.trackAllForm(t.navigatedPage,t.hash,t.search)},trackFormByParameters:function(e,r,n,o){var i=_dha.storage.getItem("_dha__uuid");e.forEach(function(e){var a="",s=document.querySelector("#"+e.id_form_track);s?a="#"+e.id_form_track:(s=document.querySelector("form[name="+e.id_form_track+"]"))&&(a="form[name="+e.id_form_track+"]"),a&&document.forms[e.id_form_track].addEventListener("submit",function(){var s=[];if(e.id_input_track.length>0)e.id_input_track.forEach(function(e){var t,r=document.querySelector(a+" #"+e);t=r?r.getAttribute("id"):(r=document.querySelector(a+" input[name="+e+"]")).getAttribute("name");var n=r.getAttribute("type");if(t&&t.indexOf("email")>-1||n&&"email"===n.toLowerCase()){var o=r.value;if(o&&_dha.utils.isValidEmail(o)){const e=_dha.utils.isFirstEmail();_dha.proxy.updateVisitor(i,o,null,null,window.location.host,e),_dha.storage.setItem("_dha__em",o)}}n&&"password"!=n.toLowerCase()&&"hidden"!=n.toLowerCase()&&r.value&&s.push({name:t,value:r.value})});else{var u=document.querySelectorAll(a+" input");[].forEach.call(u,function(e){input_id=e.getAttribute("id")?e.getAttribute("id"):e.getAttribute("name");var t=e.getAttribute("type");t&&"password"!=t.toLowerCase()&&"hidden"!=t.toLowerCase()&&e.value&&s.push({name:input_id,value:e.value})})}if(s.length>0){r||window.location.pathname;const a=t(r,o,n);_dha.proxy.trackData(i,a.host,a.page,a.referrer,a.search,a.hash,"","formevent",e.id_form_track,s,null,_dha.utils.hasEmail(),!1)}})})},trackAllForm:function(e,r,n){[].forEach.call(document.forms,function(o){var i=[],a=o.getAttribute("id");a||(a=o.getAttribute("name"))||(a="");var s=_dha.storage.getItem("_dha__uuid");o.addEventListener("submit",function(){var o=this.querySelectorAll("input");if([].forEach.call(o,function(e){var t=e.getAttribute("id"),r=e.getAttribute("type");if(t||(t=e.getAttribute("name")),t&&t.indexOf("email")>-1||r&&"email"===r.toLowerCase()){var n=e.value;if(n&&_dha.utils.isValidEmail(n)){const e=_dha.utils.isFirstEmail();_dha.proxy.updateVisitor(s,n,null,null,window.location.host,e),_dha.storage.setItem("_dha__em",n)}}r&&"password"!=r.toLowerCase()&&"hidden"!=r.toLowerCase()&&e.value&&i.push({name:t,value:e.value})}),i.length>0){const o=t(e,n,r);_dha.proxy.trackData(s,o.host,o.page,o.referrer,o.search,o.hash,"","formevent",a,i,null,_dha.utils.hasEmail(),!1)}})})},linkDomains:function(e){o(e)},trackInputEmail:function(e){i(e)},trackDOMMutation:function(){const e=document.body;new MutationObserver(function(e,t){for(let t of e)"childList"===t.type&&t.addedNodes&&t.addedNodes.length>0&&(i(t.target),o(t.target))}).observe(e,{childList:!0,subtree:!0})},trackNavigationOnChangeStateDebounced:function(e,t){let r;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e(this,...n)},t)}}((e,t)=>{_dha.pageInfoUtils.currentUrl!==window.location.href&&(_dha.pageInfoUtils.currentUrl=window.location.href,"object"==typeof t.url?r(t.url.pathname,t.url.search,t.url.hash,t.referrer,t.state):r(t.url,null,null,t.referrer,t.state)),e._isObserving&&(e.disconnect(),e._isObserving=!1)},2500),trackChangeState:function(){const e=window.history.pushState;let t,r={};const n={childList:!0,subtree:!0};t=new MutationObserver(e=>{!function(e,t,r){e.forEach(e=>{"childList"===e.type&&(e.addedNodes.forEach(e=>{}),_dha.trackNavigationOnChangeStateDebounced(t,r))})}(e,t,r)}),window.history.pushState=function(t,r,n){return"function"==typeof window.history.onpushstate_cdh&&window.history.onpushstate_cdh({state:t,unused:r,url:n}),e.apply(window.history,arguments)},window.history.onpushstate_cdh=function(e){const o=window.location.pathname;r={url:e.url||window.location,referrer:o,state:"onpushstate"},t._isObserving||(t.observe(document.body,n),t._isObserving=!0)},window.addEventListener("popstate",function(e){const o=window.location;r={url:o.pathname,search:o.search,hash:o.hash,referrer:document.referrer,state:"onpopstate"},t._isObserving||(t.observe(document.body,n),t._isObserving=!0)})},updateUrlLink:function(e){if(e){var t=document.querySelectorAll(".dh--link--exit");[].forEach.call(t,function(t){t.onclick=function(){t.href=-1===t.href.indexOf("?")?t.href+"?dha_id="+e:t.href+"&dha_id="+e}})}},trackEmail:function(e){_dha.utils.trackVisitorEmail(e)}}}();_dha.proxy=function(){var e={local:!1};document.location.protocol;function t(){return e.local?"http://localhost:3000":CUSTOMER_DATA_HUB_API_SERVER}function r(){var e=new Date;return e.setMinutes(e.getMinutes()+14400),e}return{config:function(t){e=t},addVisitor:function(e,n,o,i){_dha.storage.setItem("_dha__vud",JSON.stringify(r()));var a=new XMLHttpRequest;a.open("POST",t()+"/api/visitors"),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.onload=function(e){4===a.readyState&&(200===a.status||console.error(a.statusText))},a.onerror=function(e){console.error(a.statusText)},a.send(JSON.stringify({visitor:{visitorGuid:e,email:n,domain:o,isFirstEmail:i}}))},aliasVisitor:function(e,r){var n=new XMLHttpRequest;n.open("POST",t()+"/api/alias"),n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.onload=function(e){4===n.readyState&&(200===n.status||console.error(n.statusText))},n.onerror=function(e){console.error(n.statusText)},n.send(JSON.stringify({visitor:{visitor_1:e,visitor_2:r}}))},updateVisitor:function(e,n,o,i,a,s,u){_dha.storage.setItem("_dha__vud",JSON.stringify(r()));var c=new XMLHttpRequest,d=t()+"/api/visitors/"+e;c.open("POST",d),c.setRequestHeader("Content-Type","application/json;charset=UTF-8"),c.onload=function(e){4===c.readyState&&(200===c.status||console.error(c.statusText))},c.onerror=function(e){console.error(c.statusText)},c.send(JSON.stringify({visitor:{visitorGuid:e,email:n,username:o,fullname:i,domain:a,isFirstEmail:s,pushNotificationToken:u}}))},trackData:function(e,r,n,o,i,a,s,u,c,d,l,p,h){h=void 0===h||h;var f=new XMLHttpRequest;f.open("POST",t()+"/api/data",h),f.setRequestHeader("Content-Type","application/json;charset=UTF-8"),f.onload=function(e){4===f.readyState&&(200===f.status||console.error(f.statusText))},f.onerror=function(e){console.error(f.statusText)},f.send(JSON.stringify({visitor:{visitorGuid:e,domain:r,page:n,referrer:o,queryString:i,hash:a,source:s,eventType:u,eventName:c,additionalInfo:d,pageInfo:l,scriptVersion:window.CDH_VERSION,userAgent:navigator.userAgent,appName:navigator.appName,appVersion:navigator.appVersion,hasEmail:p}}))}}}(),_dha.storage=function(){var e=!1,t=!1;function r(){t||(e=function(){var e="_dha__ck";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}(),t=!0)}return{setItem:function(t,n){r(),e?function(e,t){localStorage.setItem(e,t)}(t,n):function(e,t){var r=new Date;r.setTime(r.getTime()+31536e7);var n="expires="+r.toUTCString();document.cookie=e+"="+t+"; "+n+"path=/"}(t,n)},getItem:function(t){return r(),e?function(e){return localStorage.getItem(e)}(t):function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return""}(t)},deleteItem:function(t){return r(),e?function(e){localStorage.removeItem(e)}(t):(n=t,void(document.cookie=n+"=;expires=Thu, 01 Jan 1970 00:00:00 UTCpath=/"));var n}}}(),_dha.utils=function(){const e=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,t=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;return{hexToAscii:function(e){for(var t=e.toString(),r="",n=0;n<t.length;n+=2)r+=String.fromCharCode(parseInt(t.substr(n,2),16));return r},asciiToHex:function(e){const t=[];for(let r=0;r<e.length;r++){const n=Number(e.charCodeAt(r)).toString(16);t.push(n)}return t.join("")},getUrlAddingNewParam:function(e,t,r){const n=t+"=";return-1!==e.search.indexOf(n)?e.completeUrl:e.protocolHostAndPath+(e.search?e.search+"&":"?")+n+r+e.hash},getParameterByName:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)","i");return results=t.exec(location.search),null===results?"":decodeURIComponent(results[1].replace(/\+/g," "))},isValidEmail:function(e){return/^((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/.test(e)},trackVisitorEmail:function(e){if(_dha.utils.isValidEmail(e)){var t=_dha.storage.getItem("_dha__uuid");if(t){const r=_dha.utils.isFirstEmail();return _dha.storage.setItem("_dha__em",e),_dha.proxy.updateVisitor(t,e,null,null,window.location.host,r),!0}}return!1},obtainEmailParameter:function(){var e=_dha.utils.getParameterByName("dplrid");return e?e=_dha.utils.hexToAscii(e):(e=_dha.utils.getParameterByName("email"))||_dha.utils.getParameterByName("dha_em")},hasEmail:function(){const e=_dha.storage.getItem("_dha__em"),t=_dha.utils.obtainEmailParameter();return!!(e||t&&_dha.utils.isValidEmail(t))},isFirstEmail:function(){return!_dha.storage.getItem("_dha__em")},isStringIntoArrayOfSubstring:function(e,t){return t.some(function(t){return e.indexOf(t)>-1})},isStringIntoArrayOfString:function(e,t){return t.indexOf(e)>-1},detectSourceByUrl:function(){var e=["twitter","facebook","linkedin","pinterest","plus.google","youtube","instagram"],t=["google","bing","duckduckgo","exalead","gigablast","munax","qwant","yahoo","yandex"],r=_dha.utils.getParameterByName("utm_medium"),n=_dha.utils.getParameterByName("utm_source"),o=_dha.utils.getParameterByName("utm_campaign");const i=!!_dha.utils.getParameterByName("dplrid");var a=[];if(r&&(r=r.toLowerCase(),a.push(r)),n&&(n=n.toLowerCase(),a.push(n)),o&&(o=o.toLowerCase(),a.push(o)),"social"===r){if(_dha.utils.isStringIntoArrayOfString(n,e))return"Social";if(window.cdhReferrer&&_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,e))return"Social"}return _dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,e)?"Social":_dha.utils.isStringIntoArrayOfSubstring(n,["email"])||_dha.utils.isStringIntoArrayOfSubstring(r,["email"])||_dha.utils.isStringIntoArrayOfSubstring(o,["email"])||i?"Email":_dha.utils.isStringIntoArrayOfSubstring(n,["adword","ppc","cpc"])||_dha.utils.isStringIntoArrayOfSubstring(r,["adword","ppc","cpc"])||_dha.utils.isStringIntoArrayOfSubstring(o,["adword","ppc","cpc"])?"Paid":_dha.utils.getParameterByName("gclid")?"Paid":window.cdhReferrer&&a.length>0&&_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,a)?"Paid":window.cdhReferrer&&_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,t)?"Organic":!window.cdhReferrer||_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,t)&&_dha.utils.isStringIntoArrayOfSubstring(window.cdhReferrer,e)?"Direct":"Referral"},generateBrowserFingerprint:function(){var e=(new Date).getTime(),t=window.navigator,r=window.screen,n=t.mimeTypes.length;n+=t.userAgent.replace(/\D+/g,""),n+=t.plugins.length,n+=r.height||"",n+=r.width||"";for(var o=e+(n+=r.pixelDepth||""),i=[8,4,4,4,12],a=[],s=0,u=0;u<i.length;u++)a.push(o.slice(s,s+i[u])),s+=i[u];return a.join("-")},generateUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16);var r=4294967295*Math.random()|0,n=4294967295*Math.random()|0,o=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return e[255&r]+e[r>>8&255]+e[r>>16&255]+e[r>>24&255]+"-"+e[255&n]+e[n>>8&255]+"-"+e[n>>16&15|64]+e[n>>24&255]+"-"+e[63&o|128]+e[o>>8&255]+"-"+e[o>>16&255]+e[o>>24&255]+e[255&i]+e[i>>8&255]+e[i>>16&255]+e[i>>24&255]},isMobile:function(){const r=navigator.userAgent||navigator.vendor||window.opera;return e.test(r)||t.test(r.substr(0,4))}}}(),_dha.UI=function(){var e={},t=0,r=!1;function n(e){var t;return function e(t,r){for(var n in r)t.hasOwnProperty(n)?"object"==typeof r[n]&&e(t[n],r[n]):t[n]=r[n]}(t="object"==typeof e[0]?e[0]:{},{delay_capturer_display:0,mobile:!1,leave_window:!1,after_time:{show:!1,time:1e4},repeat_after_time:2592e6,capturer_info:{handle_by_lib:!0,import_file:!0,capturer_id:"dha-capturer-container",form_id:"dha-capturer-form"}}),t}return{config:function(t){e=t},init:function(){window.onblur=function(){r=!0},window.onfocus=function(){r=!1},e.capturer_info.handle_by_lib&&(document.onclick=function(t){t.target.id!=e.capturer_info.capturer_id&&"dha-close-popup"!=t.target.id&&"dha-close-popup"!=t.target.parentElement.id||(document.getElementById(e.capturer_info.capturer_id).style.display="none")})},captureEmail:function(){if(!_dha.storage.getItem("_dha__ps")){if(_dha.UI.config(n(arguments)),_dha.utils.isMobile()&&!e.mobile)return;if(e.capturer_info.import_file){var t=document.querySelector("#dha-capturer-file");t&&t.href&&fetch(t.href).then(function(e){return e.text()}).then(function(e){var t=document.createElement("div");t.innerHTML=e,document.body.appendChild(t)})}_dha.UI.init(),_dha.UI.verify_time_to_repeat(),e.after_time.show&&_dha.UI.show_popup_after_period_a_time(),e.leave_window&&setTimeout(function(){document.onmouseout=function(e){if(!_dha.storage.getItem("_dha__ped")){var t=(e=e||window.event).relatedTarget||e.toElement;t&&"HTML"!=t.nodeName||_dha.UI.show_popup()}}},e.delay_capturer_display),e.capturer_info.handle_by_lib||_dha.UI.bindCapturerSubmit()}},validateCapturer:function(){var t="#"+e.capturer_info.form_id,r=document.querySelector(t+" #email");return document.querySelector(t+" #dha-error-email-empty").style.display="none",document.querySelector(t+" #dha-error-email-invalid").style.display="none",r.value?_dha.utils.isValidEmail(r.value)?void _dha.UI.registerInfoPopup(r.value):(r.className&&-1==r.className.indexOf("dha-error")?r.className+=" dha-error":r.className||(r.className="dha-error"),void(document.querySelector(t+" #dha-error-email-invalid").style.display="block")):(r.className&&-1==r.className.indexOf("dha-error")?r.className+=" dha-error":r.className||(r.className="dha-error"),void(document.querySelector(t+" #dha-error-email-empty").style.display="block"))},show_popup_after_period_a_time:function(){time=e.after_time.time,delta=100,_dha.storage.getItem("_dha__ped")||(t=setInterval(function(){r?time=e.after_time.time:(time-=delta,time<=0&&(clearInterval(t),_dha.UI.show_popup()))},delta))},verify_time_to_repeat:function(){if(_dha.storage.getItem("_dha__ped")){popup_exit_date=new Date(JSON.parse(localStorage.getItem("_dha__ped"))),max_date_popup=new Date(JSON.parse(localStorage.getItem("_dha__ped")));var t=Math.floor(e.repeat_after_time/1e3/60);max_date_popup.setMinutes(max_date_popup.getMinutes()+t),current_time=new Date,current_time>max_date_popup&&_dha.storage.deleteItem("_dha__ped")}},show_popup:function(){if(_dha.storage.setItem("_dha__ped",JSON.stringify(new Date)),clearInterval(t),e.capturer_info.handle_by_lib){var r="#"+e.capturer_info.form_id,n=document.querySelector(r+" #email");n.className=n.className.replace("dha-error",""),document.querySelector(r+" #dha-error-email-empty").style.display="none",document.querySelector(r+" #dha-error-email-invalid").style.display="none",document.querySelector(r+" div.dha-before-submit").style.display="block",document.querySelector(r+" div.dha-after-submit").style.display="none",document.querySelector(r+" div.dha-inputs-holder").style.display="block"}document.querySelector("div#"+e.capturer_info.capturer_id)&&(document.querySelector("div#"+e.capturer_info.capturer_id).style.display="block")},bindCapturerSubmit:function(){var t=_dha.storage.getItem("_dha__uuid"),r=document.querySelector("#"+e.capturer_info.form_id);r&&r.addEventListener("submit",function(){var e=this.querySelector("#email").value;if(e&&_dha.utils.isValidEmail(e)){const r=_dha.utils.isFirstEmail();_dha.proxy.updateVisitor(t,e,null,null,window.location.host,r),_dha.storage.setItem("_dha__em",e),_dha.storage.setItem("_dha__ps",new Date)}})},registerInfoPopup:function(t){var r=_dha.storage.getItem("_dha__uuid");const n=_dha.utils.isFirstEmail();_dha.proxy.updateVisitor(r,t,null,null,window.location.host,n),_dha.storage.setItem("_dha__em",t),_dha.storage.setItem("_dha__ps",new Date);var o="#"+e.capturer_info.form_id;document.querySelector(o+" div.dha-before-submit").style.display="none",document.querySelector(o+" div.dha-after-submit").style.display="block",document.querySelector(o+" div.dha-inputs-holder").style.display="none",setTimeout(function(){document.getElementById(e.capturer_info.capturer_id).style.display="none"},4e3)}}}(),_dha.pageInfo={getPageInformation:(e,t)=>new Promise(r=>{let n={pageType:void 0,productId:void 0,price:void 0,categoryId:void 0};const o=_dha.ecommerceServicesUtils.identifyEcommerce();try{switch(o){case"shopify":n=_dha.shopify.getPageInfo(e);break;case"tienda-nube":n=_dha.tiendaNube.getPageInfo(e,t);break;case"magento":n=_dha.magento.getPageInfo(e);break;case"vtex":n=_dha.vtex.getPageInfo(e);break;case"mercadoshops":case"mercadolibre":n=_dha.meli.getPageInfo();break;case"woocommerce":n=_dha.woocommenrce.getPageInfo(n)}}catch(e){console.log(e)}n=_dha.pageInfoUtils.setOpenGraphInfoToPageInfo(n),_dha.pageInfoUtils.completeAndSanitizePageInfo(n).then(e=>{r(e)})})},_dha.pageInfoUtils={currentUrl:"",pathKeywords:["producto","productos","product","products","articulo","articulos","article","articles"],getPageType:e=>{if(!e){const t=_dha.pageInfoUtils.getTagsByNameAndAttribute("meta",[{attName:"property",attValue:"og:type"}]);t&&t.length>0&&(e=t[0].getAttribute("content"))}if("website"===e){const t=window.location.href;new RegExp(`\\/(${_dha.pageInfoUtils.pathKeywords.join("|")})\\/`,"i").test(t)&&(e="products")}return e},setOpenGraphInfoToPageInfo:e=>{if(!e.pageType){const t=_dha.pageInfoUtils.getPageType(e.pageType);e.pageType=t}if(!e.price){const t=_dha.pageInfoUtils.getTagsByNameAndAttribute("meta",[{attName:"property",attValue:"og:price"},{attName:"property",attValue:"og:price:amount"},{attName:"property",attValue:"product:price:amount"}]);t&&t.length>0&&(e.price=t[0].getAttribute("content"))}return e},sanitizePageInfo:(e,t)=>({pageType:e.pageType?e.pageType:void 0,productId:e.productId?e.productId.toString():void 0,price:e.price?e.price:t.price,categoryId:e.categoryId?e.categoryId.toString():void 0,cartId:e.cartId?e.cartId.toString():void 0,items:e.items&&e.items.length>=1?e.items:void 0,eCommerceCustomer:e.eCommerceCustomer?e.eCommerceCustomer.toString():void 0,image:t.image,name:t.title,url:t.url,source:t.source}),completeAndSanitizePageInfo:e=>new Promise((t,r)=>{e.pageType?_dha.pageInfoUtils.validateIfPageIsProduct(e.pageType)?_dha.pageInfoUtils.getProductInfo().then(r=>{const n=_dha.pageInfoUtils.sanitizePageInfo(e,r||{});t(n)}).catch(e=>r(e)):t(_dha.pageInfoUtils.sanitizePageInfo(e,{})):t(null)}),getTagsByNameAndAttribute:(e,t,r)=>{const n=(r||document).getElementsByTagName(e),o=[];for(let e=0;e<n.length;e++)for(let r=0;r<t.length;r++)if(n[e].getAttribute(t[r].attName)===t[r].attValue)o.push(n[e]);else if("class"===t[r].attName){const i=n[e].getAttribute(t[r].attName),a=i&&i.split(" ");a&&-1!==a.indexOf(t[r].attValue)&&o.push(n[e])}return o},getProductByAI:()=>{const e=document.documentElement.outerHTML,t=window.location.href,r=_dha&&_dha.popUpHubWidgets&&_dha.popUpHubWidgets.widgetConfig,n=r?r.token:null,o=(r&&r.widgets?r.widgets:[]).map(({type:e,widgetId:t})=>({type:e,widgetId:t}));return fetch(`${SCRAPING_API_SERVER}/product-by-ia`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({html:e,url:t,widgets:JSON.stringify(o)})}).then(e=>e.json()).then(e=>e).catch(e=>e)},getProductInfo:()=>new Promise(e=>{const t=_dha.pageInfoUtils.getProductByMeta();if(_dha.pageInfoUtils.checkProductIsComplete(t))return t.source="METADATA",void e(t);const r=_dha.pageInfoUtils.getProductByWPN();if(_dha.pageInfoUtils.checkProductIsComplete(r))return r.source="LOCAL_STORAGE_WPN",void e(r);_dha.pageInfoUtils.checkAndGetProductByAI().then(t=>{if(t)return t.url=window.location.href,t.source="IA",t.title=t.name,void e(t);e({})}).catch(e=>e)}),getProductByMeta:()=>{const e={},t=Array.from(document.getElementsByTagName("meta")),r={price:e=>/^[0-9]{1,9}(\.[0-9]+)?|[0-9]{1,9}(,[0-9]{9})*(\.[0-9]+)?$/.test(e),image:e=>/^https:\/\/.*/.test(e),":id":e=>/^https:\/\/.*/.test(e),title:()=>!0,url:()=>!0};return t.forEach(t=>{const n=t.getAttribute("property");if(!n)return;const o=Object.keys(r).find(e=>n.includes(e));o&&r[o](t.content)&&(e[":id"===o?"id":o]=t.content)}),e},getProductByWPN:()=>{const e=localStorage.getItem("wpn-local-history"),t={};if(e){const r=JSON.parse(e);r.length>0&&(t.image=r[0].image,t.price=r[0].price,t.title=r[0].title,t.url=r[0].url)}return t},checkProductIsComplete:e=>{if(e){const t=Object.keys(e),r=["image","title","url"];for(let e=0;e<r.length;e++)if(!t.includes(r[e]))return!1;return!0}return!1},checkAndGetProductByAI:()=>new Promise((e,t)=>{let r=0;const n=setInterval(()=>{if(r<_dha.popUpHubWidgets.maxAttemptsCheckWidgetConfig){if(r++,void 0!==_dha.popUpHubWidgets.widgetConfig&&_dha.popUpHubWidgets.widgetConfig.widgets){r=_dha.popUpHubWidgets.maxAttemptsCheckWidgetConfig,_dha.popUpHubWidgets.widgetConfig.widgets.some(e=>_dha.popUpHubWidgets.widgetTypes.includes(e.type))&&(clearInterval(n),_dha.pageInfoUtils.getProductByAI().then(t=>{e(t)}).catch(e=>{t(e)}))}}else clearInterval(n),e()},500)}),validateIfPageIsProduct:e=>{return/product/.test(e)}},_dha.magento={getPageInfo:e=>{const t={pageType:e?"cart":void 0,productId:void 0,price:void 0,categoryId:void 0,items:void 0};if(t.pageType||(t.pageType=/\/checkout\//.test(window.location.pathname)?"checkout":void 0),"cart"===t.pageType){const e=_dha.pageInfoUtils.getTagsByNameAndAttribute("form",[{attName:"id",attValue:"product_addtocart_form"}]);t.productId=e&&e.length>0&&e[0].getAttribute("data-product-sku")}if("cart"===t.pageType||"checkout"===t.pageType){const e=JSON.parse(_dha.storage.getItem("mage-cache-storage"));if(e&&e.cart&&e.cart.items){const r=e.cart.items.map(e=>({item_id:e.item_id,product_id:e.product_id,sku:e.product_sku}));t.items=r}}return t},listenerAddProductToCart:({widget:e,rule:t},r)=>{require(["jquery"],n=>{n(document).on("ajax:addToCart",(n,o)=>{r({widget:e,rule:t},o.productIds[0])})})},isCurrentPlatform:()=>!!_dha.storage.getItem("mage-cache-storage")},_dha.shopify={getPageInfo:e=>{const t={pageType:e?"cart":void 0,productId:void 0,price:void 0,categoryId:void 0};return window.meta&&(t.pageType||(t.pageType=window.meta.page&&window.meta.page.pageType),window.meta.product&&(t.productId=window.meta.product.id,t.price=window.meta.product.variants&&window.meta.product.variants.length>0?window.meta.product.variants[0].price:void 0)),t},isCurrentPlatform:()=>!("undefined"==typeof Shopify||!Shopify||!Shopify.shop)},_dha.tiendaNube={getPageInfo:(e,t)=>{const r={pageType:e?"cart":window.LS.template,productId:void 0,price:void 0,categoryId:void 0};let n;if(r.pageType||(r.pageType=/^\/checkout\//.test(window.location.pathname)?"checkout":void 0),e&&t&&t.involvedForm){const e=_dha.pageInfoUtils.getTagsByNameAndAttribute("input",[{attName:"name",attValue:"add_to_cart"}],t.involvedForm);n=e&&e.length>0&&e[0].value||void 0}if(r.cartId=window.LS.cart?window.LS.cart.id:void 0,r.productId=n||window.LS.product&&window.LS.product.id||void 0,r.price=window.LS.variants&&window.LS.variants.length>0?window.LS.variants[0].price_number:void 0,r.categoryId=window.LS.category?window.LS.category.id:void 0,r.eCommerceCustomer=window.LS.customer,r.eCommerceCustomer){const e=new XMLHttpRequest;e.open("GET","/account/info/",!0),e.responseType="document",e.onload=function(){if(4===e.readyState)if(200===e.status){const t=e.responseXML.getElementsByName("email");if(t&&t.length>0){Array.prototype.slice.call(t).forEach(e=>{_dha.utils.isValidEmail(e.value)&&_dha.utils.trackVisitorEmail(e.value)})}}else console.error(`${e.status} => ${e.statusText}`)},e.onerror=function(){console.error(`${e.status} => ${e.statusText}`)},e.send()}return r},listenerAddProductToCart:({widget:e,rule:t},r)=>{window.addEventListener("productAddedToCart",n=>{const o=_dha.tiendaNube.getProductIdFromCart(n.detail.cart_item)||_dha.tiendaNube.getProductIdFromStore()||void 0;o&&r({widget:e,rule:t},o)})},getProductIdFromCart:e=>{let t;return e.product?t=e.product.id:e.line_item&&(t=e.line_item.product_id),t},getProductIdFromStore:()=>{let e;const t=document.querySelector("[data-store^='product-name-']");return window.LS&&window.LS.product?e=window.LS.product.id:t&&(e=t.dataset.store.split("-").pop()),e},isCurrentPlatform:()=>!!window.LS},_dha.vtex={getPageInfo:e=>{const t=_dha.pageInfoUtils.getPageType(),r=_dha.pageInfoUtils.getProductByMeta();return{pageType:e?"cart":t,productId:r.id?r.id:void 0,price:r.price?r.price:void 0,categoryId:r.categoryId?r.categoryId:void 0}},isCurrentPlatform:()=>!!window.vtex},_dha.meli={getPageInfo:()=>{const e={pageType:void 0,productId:void 0,price:void 0,categoryId:void 0};e.pageType=_dha.pageInfoUtils.getPageType(e.pageType);const t=window.__PRELOADED_STATE__;if(t&&t.initialState&&t.initialState.schema&&Array.isArray(t.initialState.schema)){const r=t.initialState.schema[0];if(!r)return e;e.title=r.name,e.image=r.image,r.offers&&(e.url=r.offers.url,e.price=r.offers.price)}return e}},_dha.woocommenrce={getPageInfo:e=>{if(e.pageType=/\/product\/|\/producto\//.test(window.location.href)?"product":void 0,!e.pageType){const t=_dha.pageInfoUtils.getPageType(e.pageType);e.pageType="article"===t?"product":t}return e}},_dha.ecommerceServicesUtils={identifyEcommerce:()=>_dha.shopify.isCurrentPlatform()?"shopify":_dha.tiendaNube.isCurrentPlatform()?"tienda-nube":_dha.magento.isCurrentPlatform()?"magento":_dha.vtex.isCurrentPlatform()?"vtex":_dha.ecommerceServicesUtils.getEcommerce(),getEcommerce:()=>{const e=["mercadoshops","mercadolibre","jumpseller","prestashop","woocommerce"],t=Array.from(document.getElementsByTagName("link"));let r;for(let n=0;n<t.length;n++){for(let o=0;o<e.length;o++){const i=t[n].href;if(i&&i.toString().includes(e[o])){r=e[o];break}}if(r)break}return r}},_dha.popUpHubUtils={getlastMonth:()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth()-1,e.getDate());return`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`},visitorCounter:e=>{if(!e.visitorCounterHasIncreased){e.visitorCounterHasIncreased=!0;const t=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId),r=t.dphWidget;r.visitorCounter.amount+=1,_dha.popUpHubUtils.saveLocalStorage(e.widgetId,t.dphWidgetsStorage,r)}},fillLocalStorage:(e,t)=>{let r=JSON.parse(t);r||(r={});const n=_dha.popUpHubUtils.getNewTime(),o=_dha.ecommerceServicesUtils.identifyEcommerce();r[e]={showPerday:{date:n,amount:0},visitorCounter:{date:n,amount:0},openWidgetCounter:{date:n,amount:0},smartFormData:{completed:!1},[`cart_items_${o}`]:[]},localStorage.setItem(_dha.popUpHubWidgets.key,JSON.stringify(r))},getNewTime:()=>{const e=new Date;return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`},getInfoByLocalStorage:e=>{const t=localStorage.getItem(_dha.popUpHubWidgets.key);if(t){const r=JSON.parse(t),n=r[e];if(n)return{dphWidgetsStorage:r,dphWidget:n}}return _dha.popUpHubUtils.fillLocalStorage(e,t),_dha.popUpHubUtils.getInfoByLocalStorage(e)},saveLocalStorage:(e,t,r)=>{t[e]=r,localStorage.setItem(_dha.popUpHubWidgets.key,JSON.stringify(t))},debounce:(e,t)=>{let r;return function(...n){clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}},incrementWidgetOpenCount:e=>{const t=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId),r=t.dphWidget;r.openWidgetCounter.amount+=1,_dha.popUpHubUtils.saveLocalStorage(e.widgetId,t.dphWidgetsStorage,r)},incrementShowPerDayCount:e=>{const t=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId),r=t.dphWidget;new Date(r.showPerday.date).getTime()===new Date(_dha.popUpHubUtils.getNewTime()).getTime()?r.showPerday.amount+=1:(r.showPerday.amount=0,r.showPerday.date=_dha.popUpHubUtils.getNewTime()),_dha.popUpHubUtils.saveLocalStorage(e.widgetId,t.dphWidgetsStorage,r)},addToCartListenerByEcommerce:({widget:e,rule:t})=>{switch(_dha.ecommerceServicesUtils.identifyEcommerce()){case"tienda-nube":_dha.tiendaNube.listenerAddProductToCart({widget:e,rule:t},_dha.popUpHubRules.addToCartListenerCallBack);break;case"magento":_dha.magento.listenerAddProductToCart({widget:e,rule:t},_dha.popUpHubRules.addToCartListenerCallBack)}},getDateFromOnASpecificDateRule:e=>{if(e&&e.length>0){const t=e.split("|");if(Array.isArray(t)&&t.length>0){const e=new Date(t[0]);if(!isNaN(e))return e}}}},_dha.popUpHubRules={ruleResult:!1,sanitizeUrl:e=>e.replace(/\/$/,""),checkDomains:e=>{for(const t of e.domains)if(void 0===t.path||null===t.path||"*"===t.path||_dha.popUpHubRules.sanitizeUrl(t.path)===_dha.popUpHubRules.sanitizeUrl(window.location.pathname)||t.path.slice(0,t.path.length-2)===window.location.pathname&&"/*"===t.path.slice(-2))return!0;return!1},exitPageValidation:({widget:e,rule:t})=>{document.addEventListener("mouseout",r=>{!r.relatedTarget&&r.clientY<=0&&(t.result=!0,_dha.popUpHubRules.validateRules(e))})},scrollConditionValidation:({widget:e,rule:t})=>{let r=(document.body.scrollHeight-window.innerHeight)*(t.field.value/100);return window.addEventListener("scroll",()=>{r<window.scrollY&&(r=1e5,t.result=!0,_dha.popUpHubRules.validateRules(e))}),!1},waitingTimeValidation:({widget:e,rule:t})=>{setTimeout(()=>{t.result=!0,_dha.popUpHubRules.validateRules(e)},1e3*t.field.value)},hasSeenSectionsAmount:({widget:e,rule:t})=>{return _dha.popUpHubUtils.visitorCounter(e),_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget.visitorCounter.amount>=t.field.value},showsPerDayValidation:({widget:e,rule:t})=>{return _dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget.showPerday.amount<t.field.value},afterShownAmountValidation:({widget:e,rule:t})=>{return _dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget.openWidgetCounter.amount<=t.field.value},afterShowToUserAmountValidation:({widget:e,rule:t})=>{return _dha.popUpHubUtils.visitorCounter(e),_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget.visitorCounter.amount<=t.field.value},isNotInBrowser:({rule:e,clientData:t})=>e.key.toLowerCase()!==t.browser.toLowerCase(),isNotInDevice:({rule:e,clientData:t})=>e.key.toLowerCase()!==t.device.toLowerCase(),isCheckoutPage:()=>{const e=window.location.href;return/checkout/i.test(e)},isCheckoutSuccessPage:()=>{const e=window.location.href;return/checkout.*success/.test(e)},showOnEveryCheckoutAccess:({widget:e,rule:t})=>(_dha.popUpHubUtils.addToCartListenerByEcommerce({widget:e,rule:t}),_dha.popUpHubRules.isCheckoutPage()),immediatelyAfterProductAddedToCart:({widget:e,rule:t})=>{_dha.popUpHubUtils.addToCartListenerByEcommerce({widget:e,rule:t})},timeElapsedInCheckoutSection:({widget:e,rule:t})=>{_dha.popUpHubUtils.addToCartListenerByEcommerce({widget:e,rule:t}),_dha.popUpHubRules.isCheckoutPage()&&_dha.popUpHubRules.waitingTimeValidation({widget:e,rule:t})},ruleIsOR:(e,t)=>e.operator&&"OR"===e.operator&&t,ruleIsAnd:(e,t)=>e.operator&&"AND"===e.operator&&!t,showFromDateValidation:({rule:e})=>{const t=_dha.popUpHubUtils.getDateFromOnASpecificDateRule(e.field.value);return!!t&&t<new Date},showToDateValidation:({rule:e})=>{const t=_dha.popUpHubUtils.getDateFromOnASpecificDateRule(e.field.value);return!!t&&t>new Date},saveCartItemsLocalStorage:({widget:e,rule:t},r)=>{const n=_dha.ecommerceServicesUtils.identifyEcommerce(),o=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId),i=o.dphWidget;switch(t.jsFn){case"immediatelyAfterProductAddedToCart":i[`cart_items_${n}`]=[r];break;default:i[`cart_items_${n}`].push(r)}_dha.popUpHubUtils.saveLocalStorage(e.widgetId,o.dphWidgetsStorage,i)},addToCartListenerCallBack:({widget:e,rule:t},r)=>{_dha.popUpHubRules.saveCartItemsLocalStorage({widget:e,rule:t},r),"immediatelyAfterProductAddedToCart"===t.jsFn&&(t.result=!0,_dha.popUpHubRules.validateRules(e))},checkRules:e=>{for(const t of e){if(_dha.popUpHubRules.ruleResult=!!t.result&&t.result,_dha.popUpHubRules.ruleIsOR(t,_dha.popUpHubRules.ruleResult))break;if(_dha.popUpHubRules.ruleIsAnd(t,_dha.popUpHubRules.ruleResult))break;if(t.options){if(_dha.popUpHubRules.checkRules(t.options),t.result=_dha.popUpHubRules.ruleResult,_dha.popUpHubRules.ruleIsOR(t,_dha.popUpHubRules.ruleResult))break;if(_dha.popUpHubRules.ruleIsAnd(t,_dha.popUpHubRules.ruleResult))break}}},validateRules:e=>{_dha.popUpHubRules.checkDomains(e)&&(0!==e.settings.rules.length?(_dha.popUpHubRules.ruleResult=!1,_dha.popUpHubRules.checkRules(e.settings.rules),e.settings.rules.some(e=>!1===e.result)||_dha.popUpHubWidgets.showWidgetByWidgetType({widget:e})):_dha.popUpHubWidgets.showWidgetByWidgetType({widget:e}))}},_dha.popUpHubEvents={eventTypes:{OPEN:"OPEN",CLOSE:"CLOSE",CLICK:"CLICK",SCROLL:"SCROLL",PARTIAL_SUBMIT:"PARTIAL_SUBMIT",FINAL_SUBMIT:"FINAL_SUBMIT"},widgetNotCountRightClick:["smart-form"],trackEvents:e=>{const t=`${POPUP_HUB_API_SERVER}/event/create`;fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then().catch()},clickEvent:(e,t,r)=>{if(!Array.from(t.classList).find(e=>"u-close-button"===e)){const n=_dha.popUpHubEvents.getTrackInfoForClickEvent({widgetId:r,event:e,tag:t,eventType:_dha.popUpHubEvents.eventTypes.CLICK});_dha.popUpHubEvents.trackEvents(n)}},getTrackInfoForClickEvent:({widgetId:e,event:t,tag:r,eventType:n})=>{const o=_dha.popUpHubWidgets.widgetConfig.widgets.find(t=>t.widgetId===e);return{widgetId:e,widgetType:o.type,visitorGuid:localStorage._dha__uuid,type:n,data:{coordinates:{x:t.clientX,y:t.clientY},link:r&&r.href?r.href:null}}},openOrCloseEvent:(e,t)=>{const r={widgetId:e.widgetId,widgetType:e.type,visitorGuid:localStorage._dha__uuid,type:t};_dha.popUpHubEvents.trackEvents(r)},scrollEvent:(e,t)=>{const r={widgetId:e.widgetId,widgetType:e.type,visitorGuid:localStorage._dha__uuid,type:_dha.popUpHubEvents.eventTypes.SCROLL,data:{percentage:(t.scrollTop/(t.scrollHeight-t.clientHeight)*100).toFixed(2),direction:e.scrollPosition<t.scrollTop?"DOWN":"UP"}};e.scrollPosition=t.scrollTop,_dha.popUpHubEvents.trackEvents(r)},listenRightCtrlAuxClickCallback:({event:e,widget:t})=>{const r=_dha.popUpHubEvents.getTrackInfoForClickEvent({widgetId:t.widgetId,event:e,tag:{href:window.location.href},eventType:_dha.popUpHubEvents.eventTypes.CLICK});_dha.popUpHubEvents.trackEvents(r)},listenScrollRightCtrlAuxEvents:({element:e,widget:t},r)=>{e.addEventListener("scroll",_dha.popUpHubUtils.debounce(()=>{_dha.popUpHubEvents.scrollEvent(t,e)},1800)),_dha.popUpHubEvents.widgetNotCountRightClick.includes(t.type)||(e.addEventListener("mousedown",e=>{(2===e.button||e.ctrlKey&&0===e.button)&&r({event:e,widget:t})}),e.addEventListener("auxclick",e=>{1===e.button&&r({event:e,widget:t})}))}},_dha.popUpHubWidgets={widgetConfig:void 0,widgetTypes:["products-history","last-products"],maxAttemptsCheckWidgetConfig:5,containerId:"dph-button-container",key:"_dph_widget",ruleResult:!1,loadWidgets:()=>new Promise((e,t)=>{const r=localStorage.getItem("_dha__uuid"),n=`${POPUP_HUB_API_SERVER}/widget/read-by-domain?visitorId=${r}`;fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>200===e.status?e.json():null).then(r=>{0===r.widgets.length?t(new Error("Widget not found")):(_dha.popUpHubWidgets.widgetConfig=r,e(r))}).catch(e=>t(e))}),startWidgets:e=>{for(const t of e.widgets)t.popUpHtml&&(_dha.popUpHubWidgets.ruleResult=!1,_dha.popUpHubWidgets.checkShowWidget(t,t.settings.rules,e.clientData),_dha.popUpHubRules.validateRules(t))},showWidget:e=>{if(e.ctaHtml&&0!==e.ctaHtml.trim().length)_dha.popUpHubWidgets.showActionButton(e);else{if(e.storeUrl===window.location.href)return;_dha.popUpHubWidgets.showPopUp(e)}},showPopUp:e=>{if(!e.widgetIsDisplayed){e.widgetIsDisplayed=!0,e.storeUrl=window.location.href,_dha.popUpHubUtils.incrementWidgetOpenCount(e),_dha.popUpHubUtils.incrementShowPerDayCount(e);const t=document.createElement("div"),r=`dph-widget-${e.widgetId}`;t.id=r,t.innerHTML=e.popUpHtml;const n=t.getElementsByClassName("u-close-button")[0];n.removeAttribute("href"),n.addEventListener("click",()=>{_dha.popUpHubWidgets.closePopUp(e,r)});const o=t.getElementsByClassName("u-popup-content");o&&(e.scrollPosition=0,_dha.popUpHubEvents.listenScrollRightCtrlAuxEvents({element:o[0],widget:e},_dha.popUpHubEvents.listenRightCtrlAuxClickCallback)),_dha.popUpHubWidgets.handleAppendHtmlWidget(e,t)}},handleAppendHtmlWidget:(e,t)=>{switch(e.type){case _dha.popUpHubSmartForm.type:t.style.display="none",document.body.appendChild(t),_dha.popUpHubSmartForm.initSmartForm(e),_dha.popUpHubSmartForm.renderSmartForm(e);break;case _dha.popUpHubRoulette.type:t.style.display="none",document.body.appendChild(t),_dha.popUpHubRoulette.initRoulette(e),_dha.popUpHubRoulette.renderRoulette(e);break;default:document.body.appendChild(t)}_dha.popUpHubEvents.openOrCloseEvent(e,_dha.popUpHubEvents.eventTypes.OPEN)},initButtonContainer:e=>{let t=document.getElementById(`${_dha.popUpHubWidgets.containerId}-${e}`);return t||((t=document.createElement("div")).id=`${_dha.popUpHubWidgets.containerId}-${e}`,t.style.position="fixed",t.style.bottom="0px",t.style.padding="20px",t.style.zIndex="9999",t.style[e]="0px",document.body.appendChild(t)),t},showActionButton:e=>{if(!e.actionButtonIsDisplayed){e.actionButtonIsDisplayed=!0;const t=_dha.popUpHubWidgets.initButtonContainer(e.settings.cta.bubbleLocation),r=document.createElement("div");r.innerHTML=e.ctaHtml,t.appendChild(r),document.getElementsByClassName(`widget-button-${e.widgetId}`)[0].addEventListener("click",()=>{_dha.popUpHubWidgets.showPopUp(e)})}},closePopUp:(e,t,r=!0)=>{document.getElementById(t).remove(),e.widgetIsDisplayed=!1,r&&_dha.popUpHubEvents.openOrCloseEvent(e,_dha.popUpHubEvents.eventTypes.CLOSE)},checkShowWidget:(e,t,r)=>{for(const n of t){const t=_dha.popUpHubRules[n.jsFn];"function"==typeof t?(_dha.popUpHubWidgets.ruleResult=t({widget:e,rule:n,clientData:r}),n.result=_dha.popUpHubWidgets.ruleResult):n.options?(_dha.popUpHubWidgets.checkShowWidget(e,n.options,r),n.result=_dha.popUpHubWidgets.ruleResult):n.result=!0}},getCrosSellingContent:e=>{const t=_dha.ecommerceServicesUtils.identifyEcommerce(),r=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget[`cart_items_${t}`];r&&_dha.popUpHubWidgets.getContentByWidgetIdFromApi(e,r)},getContentByWidgetIdFromApi:(e,t)=>{const r=`${POPUP_HUB_API_SERVER}/widget/content/${e.widgetId}?productsId=${t.toString()}`;fetch(r,{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(t=>{t.widgetHTMLContent&&(e.popUpHtml=t.widgetHTMLContent,_dha.popUpHubWidgets.showWidget(e))}).catch(()=>{})},showWidgetByWidgetType:({widget:e})=>{switch(e.type){case"cross-selling":_dha.popUpHubWidgets.getCrosSellingContent(e);break;default:_dha.popUpHubWidgets.showWidget(e)}}},_dha.popUpHubSmartForm={type:"smart-form",widget:null,formSettings:null,intlTelInputCDN:"https://cdn.jsdelivr.net/npm/intl-tel-input@25.2.1/build/js",inputsTel:[],hasInputTelToShow:!1,dataTrack:null,initSmartForm:e=>{const t=localStorage.getItem("_dha__em"),r=document.getElementById("dp_sf_EMAIL");t&&r&&(r.value=t),_dha.popUpHubSmartForm.widget=e,_dha.popUpHubSmartForm.formSettings=_dha.popUpHubSmartForm.getFormSettings(e),_dha.popUpHubSmartForm.cleanUpFormFields(e),_dha.popUpHubSmartForm.initSubmitButton()},initTel:()=>{loadScript(activateInput)},initSmartFormTelInput:()=>{if("undefined"==typeof iti){const e=document.createElement("script");e.type="text/javascript",e.innerHTML=`\n        let iti = [];\n        function loadScript(callback) {\n          const head = document.getElementsByTagName('head')[0];\n          const script = document.createElement('script');\n          script.type = 'text/javascript';\n          script.src = "${_dha.popUpHubSmartForm.intlTelInputCDN}/intlTelInput.min.js";\n          script.onreadystatechange = callback;\n          script.onload = callback;\n          head.appendChild(script);\n        }\n\n        const inputTelChange = (evt) => {\n          const itiIndex = evt.target.dataset.itiIndex;\n          if (iti[itiIndex].getNumber()) {\n            if (iti[itiIndex].isValidNumber()) {\n              evt.target.value = iti[itiIndex].getNumber(1);\n            }\n          }\n        }\n\n        function activateInput() {  \n          const inputElements = document.querySelectorAll('#dp_sf input[type="tel"]');\n          inputElements.forEach((input, index) => {\n            input.dataset.itiIndex = index;\n            iti[index] = window.intlTelInput(input, {\n              nationalMode: false,\n              separateDialCode: false,\n              autoPlaceholder: 'aggressive',\n              preferredCountries: ['ar', 'mx', 'co', 'es', 'ec', 'cl', 'pe', 'us'],\n              initialCountry: 'ar',\n              customContainer: 'dropdown--full',\n              loadUtils: () => import("${_dha.popUpHubSmartForm.intlTelInputCDN}/utils.js"),\n            });\n            input.addEventListener('change', inputTelChange, false);\n          });\n        }\n      `,document.body.appendChild(e)}},getFormSettings:e=>{const t=_dha.popUpHubSmartForm.getTargetForm(e.widgetId),r=_dha.popUpHubSmartForm.getFormData(e),n=r.map(e=>e.name);return{fieldInstance:t.getAttribute("data-field-instance"),targetIdList:t.getAttribute("data-target-id-list"),actionOnFinish:t.getAttribute("data-action-on-finish"),totalFields:r.length,fieldsShown:[],fieldNames:n}},getTargetForm:e=>{return document.getElementById(e).querySelector("#dp_sf")},getFormData:e=>{const t=document.getElementById(e.widgetId).querySelector("#dp_sf"),r=[],n=new Map;for(const e of t.elements)if(e.name)if("tel"!==e.type||_dha.popUpHubSmartForm.inputsTel.includes(e.name)||_dha.popUpHubSmartForm.inputsTel.push(e.name),"checkbox"===e.type){const t=e.getAttribute("data-type"),r=e.name,o=n.get(r);"toggle"===t?n.set(r,e.checked):"checkboxlist"===t&&e.checked?n.set(r,o?`${o},${e.value}`:e.value):n.set(r,o||"")}else n.set(e.name,e.value);for(const[e,t]of n)r.push({name:e,value:t});return r},getUserFormData:()=>{const e=_dha.popUpHubUtils.getInfoByLocalStorage(_dha.popUpHubSmartForm.widget.widgetId);return e.dphWidget.smartFormData?e.dphWidget.smartFormData.data:null},cleanUpFormFields:e=>{const t=_dha.popUpHubSmartForm.getFormData(e),r=_dha.popUpHubSmartForm.getUserFormData();let n=0;const o=_dha.popUpHubSmartForm.formSettings.fieldInstance>0?_dha.popUpHubSmartForm.formSettings.fieldInstance:t.length;for(const e of t){(r&&r.fields?r.fields.find(t=>t.name===e.name):null)||n>=o?_dha.popUpHubSmartForm.removeFieldset(e.name):(_dha.popUpHubSmartForm.hasInputTelToShow=_dha.popUpHubSmartForm.hasInputTelToShow||-1!==_dha.popUpHubSmartForm.inputsTel.indexOf(e.name),_dha.popUpHubSmartForm.formSettings.fieldsShown.push(e.name),n++)}_dha.popUpHubSmartForm.hasInputTelToShow&&(_dha.popUpHubSmartForm.initSmartFormTelInput(),_dha.popUpHubSmartForm.initTel())},removeFieldset:e=>{const t=document.getElementById(`fieldset_${e}`);t&&t.remove()},initSubmitButton:()=>{const e=_dha.popUpHubSmartForm.getTargetForm(_dha.popUpHubSmartForm.widget.widgetId);if(e){const t=e.querySelector("button[type='submit']");t?t.addEventListener("click",t=>{if(e.reportValidity()){t.preventDefault(),_dha.popUpHubSmartForm.updateUserFormData();const e=_dha.popUpHubUtils.getInfoByLocalStorage(_dha.popUpHubSmartForm.widget.widgetId).dphWidget.smartFormData.completed,r=_dha.popUpHubEvents.getTrackInfoForClickEvent({widgetId:_dha.popUpHubSmartForm.widget.widgetId,event:t,tag:{href:window.location.href},eventType:e?_dha.popUpHubEvents.eventTypes.FINAL_SUBMIT:_dha.popUpHubEvents.eventTypes.PARTIAL_SUBMIT});_dha.popUpHubSmartForm.dataTrack=r,_dha.popUpHubSmartForm.sendData()}}):console.error("Submit button not found in the form.")}else console.error("Target form not found with the specified widget ID.")},updateUserFormData:()=>{const e=_dha.popUpHubSmartForm.getFormData(_dha.popUpHubSmartForm.widget),t=_dha.popUpHubUtils.getInfoByLocalStorage(_dha.popUpHubSmartForm.widget.widgetId);let r=t.dphWidget.smartFormData.data;r||(r={email:e.find(e=>"EMAIL"===e.name).value,fields:[]}),e.forEach(e=>{r.fields.find(t=>t.name===e.name)||r.fields.push({name:e.name,value:e.value})}),t.dphWidget.smartFormData.completed=_dha.popUpHubSmartForm.formSettings.fieldNames.every(e=>r.fields.some(t=>t.name===e)),t.dphWidget.smartFormData.data=r,_dha.popUpHubUtils.saveLocalStorage(_dha.popUpHubSmartForm.widget.widgetId,t.dphWidgetsStorage,t.dphWidget)},sendData:()=>{const e=_dha.popUpHubUtils.getInfoByLocalStorage(_dha.popUpHubSmartForm.widget.widgetId),t=e.dphWidget.smartFormData.data,r=[];for(const e of t.fields){_dha.popUpHubSmartForm.formSettings.fieldsShown.includes(e.name)&&r.push(e)}_dha.popUpHubSmartForm.formSettings.fieldsShown=[];const n={data:{email:t.email,fields:r},widgetId:_dha.popUpHubSmartForm.widget.widgetId,idTargetList:_dha.popUpHubSmartForm.formSettings.targetIdList,dataTrack:_dha.popUpHubSmartForm.dataTrack},o=`${POPUP_HUB_API_SERVER}/widget/smartform/submission`;fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(()=>{e.dphWidget.smartFormData.completed?_dha.popUpHubSmartForm.runCompletionAction():_dha.popUpHubWidgets.closePopUp(_dha.popUpHubSmartForm.widget,_dha.popUpHubSmartForm.widget.widgetId,!1)}).catch(e=>{console.error("Error during fetch request:",e)})},runCompletionAction:()=>{switch(_dha.popUpHubSmartForm.formSettings.actionOnFinish){case"message":_dha.popUpHubSmartForm.showThanksMessage(_dha.popUpHubSmartForm.widget.widgetId);break;case"url":_dha.popUpHubSmartForm.redirectUrl(_dha.popUpHubSmartForm.widget.widgetId);break;default:_dha.popUpHubWidgets.closePopUp(_dha.popUpHubSmartForm.widget,_dha.popUpHubSmartForm.widget.widgetId,!1)}},showThanksMessage:()=>{const e=document.getElementById(_dha.popUpHubSmartForm.widget.widgetId);if(e){const t=e.querySelectorAll("section");if(t.length>1){const e=t[1].querySelector("span");e&&""!==e.innerHTML.trim()?(t[0].style.display="none",t[1].style.display="block"):_dha.popUpHubWidgets.closePopUp(_dha.popUpHubSmartForm.widget,_dha.popUpHubSmartForm.widget.widgetId,!1)}else console.error("Not enough sections were found in the widget's content.")}else console.error("The content of the widget with the specified ID was not found.")},redirectUrl:()=>{const e=_dha.popUpHubSmartForm.getTargetForm(_dha.popUpHubSmartForm.widget.widgetId);if(e){const t=e.getAttribute("data-action-on-finish-url");t?window.open(t,"_blank"):console.warn("The redirection URL was not found in the form.")}else console.error("The form was not found.");_dha.popUpHubWidgets.closePopUp(_dha.popUpHubSmartForm.widget,_dha.popUpHubSmartForm.widget.widgetId,!1)},renderSmartForm:e=>{const t=_dha.popUpHubSmartForm.getFormData(e),r=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget.smartFormData,n=`dph-widget-${e.widgetId}`,o=document.getElementById(n);if(r.data){let e=!0;for(const n of t){if(!r.data.fields.some(e=>n.name===e.name)){o.style.display="block",e=!1;break}}e&&o.remove()}else o.style.display="block"}},_dha.popUpHubRoulette={type:"roulette",dataTrack:null,initRoulette:e=>{_dha.popUpHubRoulette.initForm(e),_dha.popUpHubRoulette.initSubmitButton(e)},getRotation:(e,t)=>{return 3600+(t-.5)*(360/e)},getWinner:e=>{const t=e.map(e=>parseFloat(e.percent)/100).reduce((e,t,r)=>(e.push((e[r-1]||0)+t),e),[]),r=Math.random();for(let n=0;n<t.length;n++)if(r<t[n]){return{label:e[n].label,gift:e[n].gift,percent:e[n].percent,color:e[n].color,position:n+1}}},copyGiftCode:e=>{document.querySelector(".dp-roulette-congrats").querySelectorAll("button, .dp-roulette-congrats-copy-icon").forEach(t=>{t.addEventListener("click",()=>{navigator.clipboard.writeText(e).then(()=>{document.getElementById("dp_copy_code_message").style.display="flex"})})})},displayWinnerMessage:e=>{const t=document.getElementsByClassName("dp-roulette-description")[0],r=document.getElementsByClassName("dp-roulette-congrats")[0];t&&r&&(r.innerHTML=r.innerHTML.replace(/\[\[GIFT CODE\]\]/g,e.gift),r.style.display="block",t.style.display="none"),_dha.popUpHubRoulette.copyGiftCode(e.gift)},renderRoulette:e=>{const t=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId).dphWidget.smartFormData,r=`dph-widget-${e.widgetId}`,n=document.getElementById(r);t.completed?n.remove():n.style.display="block"},initForm:e=>{const t=localStorage.getItem("_dha__em"),r=document.getElementById("dp_sf_EMAIL");t&&r&&(r.value=t),_dha.popUpHubSmartForm.getFormData(e).some(e=>_dha.popUpHubSmartForm.inputsTel.includes(e.name))&&(_dha.popUpHubSmartForm.initSmartFormTelInput(),_dha.popUpHubSmartForm.initTel())},sendData:(e,t)=>{const r=_dha.popUpHubSmartForm.getFormData(e),n=_dha.popUpHubUtils.getInfoByLocalStorage(e.widgetId);let o=n.dphWidget.smartFormData.data;o||(o={email:r.find(e=>"EMAIL"===e.name).value,fields:[]}),r.forEach(e=>{o.fields.push({name:e.name,value:e.value})}),n.dphWidget.smartFormData.completed=!0,n.dphWidget.smartFormData.data=o,_dha.popUpHubUtils.saveLocalStorage(e.widgetId,n.dphWidgetsStorage,n.dphWidget);const i={data:{email:o.email,fields:o.fields},widgetId:e.widgetId,idTargetList:t,dataTrack:_dha.popUpHubRoulette.dataTrack},a=`${POPUP_HUB_API_SERVER}/widget/smartform/submission`;fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).catch(e=>{console.error("Error during fetch request:",e)})},initSubmitButton:e=>{const t=JSON.parse(document.getElementById("dp-wheel").getAttribute("data-slides")),r=_dha.popUpHubRoulette.getWinner(t),n=_dha.popUpHubRoulette.getRotation(t.length,r.position),o=_dha.popUpHubSmartForm.getTargetForm(e.widgetId);if(o){const t=o.querySelector("button[type='submit']");t?t.addEventListener("click",t=>{if(o.reportValidity()){t.preventDefault();const i=document.getElementById("dp-wheel");i.style.transform=`rotate(-${n}deg)`;const a=_dha.popUpHubEvents.getTrackInfoForClickEvent({widgetId:e.widgetId,event:t,tag:{href:window.location.href},eventType:_dha.popUpHubEvents.eventTypes.FINAL_SUBMIT});_dha.popUpHubRoulette.dataTrack=a,_dha.popUpHubRoulette.sendData(e,o.getAttribute("data-target-id-list")),i.addEventListener("transitionend",()=>{_dha.popUpHubRoulette.displayWinnerMessage(r)},{once:!0})}}):console.error("Submit button not found in the form.")}else console.error("Target form not found with the specified widget ID.")}},(()=>{var e={199:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o,i=r(215),a=r(336),s=r(319),u=r(477),c=((n={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",n["bad-app-name"]="Illegal App name: '{$appName}",n["duplicate-app"]="Firebase App named '{$appName}' already exists",n["app-deleted"]="Firebase App named '{$appName}' already deleted",n["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",n["invalid-log-argument"]="First argument to `onLog` must be null or a function.",n),d=new a.ErrorFactory("app","Firebase",c),l="@firebase/app",p="[DEFAULT]",h=((o={})[l]="fire-core",o["@firebase/analytics"]="fire-analytics",o["@firebase/auth"]="fire-auth",o["@firebase/database"]="fire-rtdb",o["@firebase/functions"]="fire-fn",o["@firebase/installations"]="fire-iid",o["@firebase/messaging"]="fire-fcm",o["@firebase/performance"]="fire-perf",o["@firebase/remote-config"]="fire-rc",o["@firebase/storage"]="fire-gcs",o["@firebase/firestore"]="fire-fst",o["fire-js"]="fire-js",o["firebase-wrapper"]="fire-js-all",o),f=new u.Logger("@firebase/app"),g=function(){function e(e,t,r){var n,o,u=this;this.firebase_=r,this.isDeleted_=!1,this.name_=t.name,this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1,this.options_=a.deepCopy(e),this.container=new s.ComponentContainer(t.name),this._addComponent(new s.Component("app",function(){return u},"PUBLIC"));try{for(var c=i.__values(this.firebase_.INTERNAL.components.values()),d=c.next();!d.done;d=c.next()){var l=d.value;this._addComponent(l)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(e){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.checkDestroyed_(),t()}).then(function(){return e.firebase_.INTERNAL.removeApp(e.name_),Promise.all(e.container.getProviders().map(function(e){return e.delete()}))}).then(function(){e.isDeleted_=!0})},e.prototype._getService=function(e,t){return void 0===t&&(t=p),this.checkDestroyed_(),this.container.getProvider(e).getImmediate({identifier:t})},e.prototype._removeServiceInstance=function(e,t){void 0===t&&(t=p),this.container.getProvider(e).clearInstance(t)},e.prototype._addComponent=function(e){try{this.container.addComponent(e)}catch(t){f.debug("Component "+e.name+" failed to register with FirebaseApp "+this.name,t)}},e.prototype._addOrOverwriteComponent=function(e){this.container.addOrOverwriteComponent(e)},e.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw d.create("app-deleted",{appName:this.name_})},e}();g.prototype.name&&g.prototype.options||g.prototype.delete||console.log("dc");var m=function e(){var t=function(e){var t={},r=new Map,n={__esModule:!0,initializeApp:function(r,o){void 0===o&&(o={}),"object"==typeof o&&null!==o||(o={name:o});var i=o;void 0===i.name&&(i.name=p);var s=i.name;if("string"!=typeof s||!s)throw d.create("bad-app-name",{appName:String(s)});if(a.contains(t,s))throw d.create("duplicate-app",{appName:s});var u=new e(r,i,n);return t[s]=u,u},app:o,registerVersion:function(e,t,r){var n,o=null!==(n=h[e])&&void 0!==n?n:e;r&&(o+="-"+r);var i=o.match(/\s|\//),a=t.match(/\s|\//);if(i||a){var u=['Unable to register library "'+o+'" with version "'+t+'":'];return i&&u.push('library name "'+o+'" contains illegal characters (whitespace or "/")'),i&&a&&u.push("and"),a&&u.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),void f.warn(u.join(" "))}c(new s.Component(o+"-version",function(){return{library:o,version:t}},"VERSION"))},setLogLevel:u.setLogLevel,onLog:function(e,t){if(null!==e&&"function"!=typeof e)throw d.create("invalid-log-argument",{appName:name});u.setUserLogHandler(e,t)},apps:null,SDK_VERSION:"7.20.0",INTERNAL:{registerComponent:c,removeApp:function(e){delete t[e]},components:r,useAsService:function(e,t){return"serverAuth"===t?null:t}}};function o(e){if(e=e||p,!a.contains(t,e))throw d.create("no-app",{appName:e});return t[e]}function c(s){var u,c,l=s.name;if(r.has(l))return f.debug("There were multiple attempts to register component "+l+"."),"PUBLIC"===s.type?n[l]:null;if(r.set(l,s),"PUBLIC"===s.type){var p=function(e){if(void 0===e&&(e=o()),"function"!=typeof e[l])throw d.create("invalid-app-argument",{appName:l});return e[l]()};void 0!==s.serviceProps&&a.deepExtend(p,s.serviceProps),n[l]=p,e.prototype[l]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._getService.bind(this,l).apply(this,s.multipleInstances?e:[])}}try{for(var h=i.__values(Object.keys(t)),g=h.next();!g.done;g=h.next()){var m=g.value;t[m]._addComponent(s)}}catch(e){u={error:e}}finally{try{g&&!g.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}return"PUBLIC"===s.type?n[l]:null}return n.default=n,Object.defineProperty(n,"apps",{get:function(){return Object.keys(t).map(function(e){return t[e]})}}),o.App=e,n}(g);return t.INTERNAL=i.__assign(i.__assign({},t.INTERNAL),{createFirebaseNamespace:e,extendNamespace:function(e){a.deepExtend(t,e)},createSubscribe:a.createSubscribe,ErrorFactory:a.ErrorFactory,deepExtend:a.deepExtend}),t}(),_=function(){function e(e){this.container=e}return e.prototype.getPlatformInfoString=function(){return this.container.getProviders().map(function(e){if(function(e){var t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){var t=e.getImmediate();return t.library+"/"+t.version}return null}).filter(function(e){return e}).join(" ")},e}();if(a.isBrowser()&&void 0!==self.firebase){f.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  ");var v=self.firebase.SDK_VERSION;v&&v.indexOf("LITE")>=0&&f.warn("\n    Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n    You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n    ")}var y=m.initializeApp;m.initializeApp=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a.isNode()&&f.warn('\n      Warning: This is a browser-targeted Firebase bundle but it appears it is being\n      run in a Node environment.  If running in a Node environment, make sure you\n      are using the bundle specified by the "main" field in package.json.\n      \n      If you are using Webpack, you can specify "main" as the first item in\n      "resolve.mainFields":\n      https://webpack.js.org/configuration/resolve/#resolvemainfields\n      \n      If using Rollup, use the rollup-plugin-node-resolve plugin and specify "main"\n      as the first item in "mainFields", e.g. [\'main\', \'module\'].\n      https://github.com/rollup/rollup-plugin-node-resolve\n      '),y.apply(void 0,e)};var b=m;!function(e){e.INTERNAL.registerComponent(new s.Component("platform-logger",function(e){return new _(e)},"PRIVATE")),e.registerVersion(l,"0.6.11",void 0),e.registerVersion("fire-js","")}(b),t.default=b,t.firebase=b},319:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(215),o=r(336),i=function(){function e(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}return e.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},e.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},e.prototype.setServiceProps=function(e){return this.serviceProps=e,this},e}(),a="[DEFAULT]",s=function(){function e(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map}return e.prototype.get=function(e){void 0===e&&(e=a);var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var r=new o.Deferred;this.instancesDeferred.set(t,r);try{var n=this.getOrInitializeService(t);n&&r.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise},e.prototype.getImmediate=function(e){var t=n.__assign({identifier:a,optional:!1},e),r=t.identifier,o=t.optional,i=this.normalizeInstanceIdentifier(r);try{var s=this.getOrInitializeService(i);if(!s){if(o)return null;throw Error("Service "+this.name+" is not available")}return s}catch(e){if(o)return null;throw e}},e.prototype.getComponent=function(){return this.component},e.prototype.setComponent=function(e){var t,r;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=e,function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService(a)}catch(e){}try{for(var o=n.__values(this.instancesDeferred.entries()),i=o.next();!i.done;i=o.next()){var s=n.__read(i.value,2),u=s[0],c=s[1],d=this.normalizeInstanceIdentifier(u);try{var l=this.getOrInitializeService(d);c.resolve(l)}catch(e){}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},e.prototype.clearInstance=function(e){void 0===e&&(e=a),this.instancesDeferred.delete(e),this.instances.delete(e)},e.prototype.delete=function(){return n.__awaiter(this,void 0,void 0,function(){var e;return n.__generator(this,function(t){switch(t.label){case 0:return e=Array.from(this.instances.values()),[4,Promise.all(n.__spread(e.filter(function(e){return"INTERNAL"in e}).map(function(e){return e.INTERNAL.delete()}),e.filter(function(e){return"_delete"in e}).map(function(e){return e._delete()})))];case 1:return t.sent(),[2]}})})},e.prototype.isComponentSet=function(){return null!=this.component},e.prototype.getOrInitializeService=function(e){var t=this.instances.get(e);return!t&&this.component&&(t=this.component.instanceFactory(this.container,function(e){return e===a?void 0:e}(e)),this.instances.set(e,t)),t||null},e.prototype.normalizeInstanceIdentifier=function(e){return this.component?this.component.multipleInstances?e:a:e},e}(),u=function(){function e(e){this.name=e,this.providers=new Map}return e.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component "+e.name+" has already been registered with "+this.name);t.setComponent(e)},e.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},e.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new s(e,this);return this.providers.set(e,t),t},e.prototype.getProviders=function(){return Array.from(this.providers.values())},e}();t.Component=i,t.ComponentContainer=u,t.Provider=s},477:(e,t,r)=>{"use strict";function n(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}var o;r.r(t),r.d(t,{LogLevel:()=>i,Logger:()=>l,setLogLevel:()=>(function(e){a.forEach(function(t){t.setLogLevel(e)})}),setUserLogHandler:()=>(function(e,t){for(var r=function(r){var n=null;t&&t.level&&(n=s[t.level]),r.userLogHandler=null===e?null:function(t,r){for(var o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];var s=o.map(function(e){if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(function(e){return e}).join(" ");r>=(null!=n?n:t.logLevel)&&e({level:i[r].toLowerCase(),message:s,args:o,type:t.name})}},n=0,o=a;n<o.length;n++)r(o[n])})});var i,a=[];!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(i||(i={}));var s={debug:i.DEBUG,verbose:i.VERBOSE,info:i.INFO,warn:i.WARN,error:i.ERROR,silent:i.SILENT},u=i.INFO,c=((o={})[i.DEBUG]="log",o[i.VERBOSE]="log",o[i.INFO]="info",o[i.WARN]="warn",o[i.ERROR]="error",o),d=function(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(!(t<e.logLevel)){var i=(new Date).toISOString(),a=c[t];if(!a)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[a].apply(console,n(["["+i+"]  "+e.name+":"],r))}},l=function(){function e(e){this.name=e,this._logLevel=u,this._logHandler=d,this._userLogHandler=null,a.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in i))throw new TypeError('Invalid value "'+e+'" assigned to `logLevel`');this._logLevel=e},enumerable:!1,configurable:!0}),e.prototype.setLogLevel=function(e){this._logLevel="string"==typeof e?s[e]:e},Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(e){this._userLogHandler=e},enumerable:!1,configurable:!0}),e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,n([this,i.DEBUG],e)),this._logHandler.apply(this,n([this,i.DEBUG],e))},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,n([this,i.VERBOSE],e)),this._logHandler.apply(this,n([this,i.VERBOSE],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,n([this,i.INFO],e)),this._logHandler.apply(this,n([this,i.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,n([this,i.WARN],e)),this._logHandler.apply(this,n([this,i.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,n([this,i.ERROR],e)),this._logHandler.apply(this,n([this,i.ERROR],e))},e}()},336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(215),o={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},i=function(e,t){if(!e)throw a(t)},a=function(e){return new Error("Firebase Database ("+o.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},s=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=63&o|128):55296==(64512&o)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128)}return t},u={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[],o=0;o<e.length;o+=3){var i=e[o],a=o+1<e.length,s=a?e[o+1]:0,u=o+2<e.length,c=u?e[o+2]:0,d=i>>2,l=(3&i)<<4|s>>4,p=(15&s)<<2|c>>6,h=63&c;u||(h=64,a||(p=64)),n.push(r[d],r[l],r[p],r[h])}return n.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(s(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],r=0,n=0;r<e.length;){var o=e[r++];if(o<128)t[n++]=String.fromCharCode(o);else if(o>191&&o<224){var i=e[r++];t[n++]=String.fromCharCode((31&o)<<6|63&i)}else if(o>239&&o<365){var a=((7&o)<<18|(63&(i=e[r++]))<<12|(63&(s=e[r++]))<<6|63&e[r++])-65536;t[n++]=String.fromCharCode(55296+(a>>10)),t[n++]=String.fromCharCode(56320+(1023&a))}else{i=e[r++];var s=e[r++];t[n++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[],o=0;o<e.length;){var i=r[e.charAt(o++)],a=o<e.length?r[e.charAt(o)]:0,s=++o<e.length?r[e.charAt(o)]:64,u=++o<e.length?r[e.charAt(o)]:64;if(++o,null==i||null==a||null==s||null==u)throw Error();var c=i<<2|a>>4;if(n.push(c),64!==s){var d=a<<4&240|s>>2;if(n.push(d),64!==u){var l=s<<6&192|u;n.push(l)}}}return n},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},c=function(e){try{return u.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function d(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var r in t)t.hasOwnProperty(r)&&(e[r]=d(e[r],t[r]));return e}var l=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise(function(t,r){e.resolve=t,e.reject=r})}return e.prototype.wrapCallback=function(e){var t=this;return function(r,n){r?t.reject(r):t.resolve(n),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(r):e(r,n))}},e}();function p(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function h(){try{return"[object process]"===Object.prototype.toString.call(r.g.process)}catch(e){return!1}}var f=function(e){function t(r,n){var o=e.call(this,n)||this;return o.code=r,o.name="FirebaseError",Object.setPrototypeOf(o,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,g.prototype.create),o}return n.__extends(t,e),t}(Error),g=function(){function e(e,t,r){this.service=e,this.serviceName=t,this.errors=r}return e.prototype.create=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=t[0]||{},o=this.service+"/"+e,i=this.errors[e],a=i?function(e,t){return i.replace(m,function(e,r){var n=t[r];return null!=n?String(n):"<"+r+"?>"})}(0,n):"Error",s=this.serviceName+": "+a+" ("+o+").",u=new f(o,s),c=0,d=Object.keys(n);c<d.length;c++){var l=d[c];"_"!==l.slice(-1)&&(l in u&&console.warn('Overwriting FirebaseError base field "'+l+'" can cause unexpected behavior.'),u[l]=n[l])}return u},e}(),m=/\{\$([^}]+)}/g;function _(e){return JSON.parse(e)}var v=function(e){var t={},r={},n={},o="";try{var i=e.split(".");t=_(c(i[0])||""),r=_(c(i[1])||""),o=i[2],n=r.d||{},delete r.d}catch(e){}return{header:t,claims:r,data:n,signature:o}},y=function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}return e.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},e.prototype.compress_=function(e,t){t||(t=0);var r=this.W_;if("string"==typeof e)for(var n=0;n<16;n++)r[n]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(n=0;n<16;n++)r[n]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(n=16;n<80;n++){var o=r[n-3]^r[n-8]^r[n-14]^r[n-16];r[n]=4294967295&(o<<1|o>>>31)}var i,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],d=this.chain_[3],l=this.chain_[4];for(n=0;n<80;n++)n<40?n<20?(i=d^u&(c^d),a=1518500249):(i=u^c^d,a=1859775393):n<60?(i=u&c|d&(u|c),a=2400959708):(i=u^c^d,a=3395469782),o=(s<<5|s>>>27)+i+l+a+r[n]&4294967295,l=d,d=c,c=4294967295&(u<<30|u>>>2),u=s,s=o;this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+d&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var r=t-this.blockSize,n=0,o=this.buf_,i=this.inbuf_;n<t;){if(0===i)for(;n<=r;)this.compress_(e,n),n+=this.blockSize;if("string"==typeof e){for(;n<t;)if(o[i]=e.charCodeAt(n),++n,++i===this.blockSize){this.compress_(o),i=0;break}}else for(;n<t;)if(o[i]=e[n],++n,++i===this.blockSize){this.compress_(o),i=0;break}}this.inbuf_=i,this.total_+=t}},e.prototype.digest=function(){var e=[],t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var r=this.blockSize-1;r>=56;r--)this.buf_[r]=255&t,t/=256;this.compress_(this.buf_);var n=0;for(r=0;r<5;r++)for(var o=24;o>=0;o-=8)e[n]=this.chain_[r]>>o&255,++n;return e},e}(),b=function(){function e(e,t){var r=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(r)}).catch(function(e){r.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,r){var n,o=this;if(void 0===e&&void 0===t&&void 0===r)throw new Error("Missing Observer.");void 0===(n=function(e){if("object"!=typeof e||null===e)return!1;for(var t=0,r=["next","error","complete"];t<r.length;t++){var n=r[t];if(n in e&&"function"==typeof e[n])return!0}return!1}(e)?e:{next:e,error:t,complete:r}).next&&(n.next=w),void 0===n.error&&(n.error=w),void 0===n.complete&&(n.complete=w);var i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{o.finalError?n.error(o.finalError):n.complete()}catch(e){}}),this.observers.push(n),i},e.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},e.prototype.sendOne=function(e,t){var r=this;this.task.then(function(){if(void 0!==r.observers&&void 0!==r.observers[e])try{t(r.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})},e.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},e}();function w(){}function S(e,t,r){var n="";switch(t){case 1:n=r?"first":"First";break;case 2:n=r?"second":"Second";break;case 3:n=r?"third":"Third";break;case 4:n=r?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4.  Need to update it?")}return e+" failed: "+n+" argument "}t.CONSTANTS=o,t.Deferred=l,t.ErrorFactory=g,t.FirebaseError=f,t.MAX_VALUE_MILLIS=144e5,t.RANDOM_FACTOR=.5,t.Sha1=y,t.areCookiesEnabled=function(){return!(!navigator||!navigator.cookieEnabled)},t.assert=i,t.assertionError=a,t.async=function(e,t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];Promise.resolve(!0).then(function(){e.apply(void 0,r)}).catch(function(e){t&&t(e)})}},t.base64=u,t.base64Decode=c,t.base64Encode=function(e){var t=s(e);return u.encodeByteArray(t,!0)},t.calculateBackoffMillis=function(e,t,r){void 0===t&&(t=1e3),void 0===r&&(r=2);var n=t*Math.pow(r,e),o=Math.round(.5*n*(Math.random()-.5)*2);return Math.min(144e5,n+o)},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.createSubscribe=function(e,t){var r=new b(e,t);return r.subscribe.bind(r)},t.decode=v,t.deepCopy=function(e){return d(void 0,e)},t.deepExtend=d,t.errorPrefix=S,t.getUA=p,t.isAdmin=function(e){var t=v(e).claims;return"object"==typeof t&&!0===t.admin},t.isBrowser=function(){return"object"==typeof self&&self.self===self},t.isBrowserExtension=function(){var e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id},t.isElectron=function(){return p().indexOf("Electron/")>=0},t.isEmpty=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},t.isIE=function(){var e=p();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0},t.isIndexedDBAvailable=function(){return"indexedDB"in self&&null!=indexedDB},t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())},t.isNode=h,t.isNodeSdk=function(){return!0===o.NODE_CLIENT||!0===o.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.isSafari=function(){return!h()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},t.isUWP=function(){return p().indexOf("MSAppHost/")>=0},t.isValidFormat=function(e){var t=v(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t=v(e).claims,r=Math.floor((new Date).getTime()/1e3),n=0,o=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?n=t.nbf:t.hasOwnProperty("iat")&&(n=t.iat),o=t.hasOwnProperty("exp")?t.exp:n+86400),!!r&&!!n&&!!o&&r>=n&&r<=o},t.issuedAtTime=function(e){var t=v(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.jsonEval=_,t.map=function(e,t,r){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=t.call(r,e[o],o,e));return n},t.querystring=function(e){for(var t=[],r=function(e,r){Array.isArray(r)?r.forEach(function(r){t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))},n=0,o=Object.entries(e);n<o.length;n++){var i=o[n];r(i[0],i[1])}return t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={};return e.replace(/^\?/,"").split("&").forEach(function(e){if(e){var r=e.split("=");t[r[0]]=r[1]}}),t},t.safeGet=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},t.stringLength=function(e){for(var t=0,r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t++:n<2048?t+=2:n>=55296&&n<=56319?(t+=4,r++):t+=3}return t},t.stringToByteArray=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);if(o>=55296&&o<=56319){var a=o-55296;i(++n<e.length,"Surrogate pair missing trail surrogate."),o=65536+(a<<10)+(e.charCodeAt(n)-56320)}o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=63&o|128):o<65536?(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128)}return t},t.stringify=function(e){return JSON.stringify(e)},t.validateArgCount=function(e,t,r,n){var o;if(n<t?o="at least "+t:n>r&&(o=0===r?"none":"no more than "+r),o)throw new Error(e+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+o+".")},t.validateCallback=function(e,t,r,n){if((!n||r)&&"function"!=typeof r)throw new Error(S(e,t,n)+"must be a valid function.")},t.validateContextObject=function(e,t,r,n){if((!n||r)&&("object"!=typeof r||null===r))throw new Error(S(e,t,n)+"must be a valid context object.")},t.validateIndexedDBOpenable=function(){return new Promise(function(e,t){try{var r=!0,n="validate-browser-context-for-indexeddb-analytics-module",o=window.indexedDB.open(n);o.onsuccess=function(){o.result.close(),r||window.indexedDB.deleteDatabase(n),e(!0)},o.onupgradeneeded=function(){r=!1},o.onerror=function(){var e;t((null===(e=o.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})},t.validateNamespace=function(e,t,r,n){if((!n||r)&&"string"!=typeof r)throw new Error(S(e,t,n)+"must be a valid firebase namespace.")}},577:(e,t,r)=>{"use strict";var n=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(r(199));n.default.registerVersion("firebase","7.24.0","app"),e.exports=n.default},588:function(e,t){!function(e){"use strict";function t(e){return new Promise(function(t,r){e.onsuccess=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function r(e,r,n){var o,i=new Promise(function(i,a){t(o=e[r].apply(e,n)).then(i,a)});return i.request=o,i}function n(e,t,r){r.forEach(function(r){Object.defineProperty(e.prototype,r,{get:function(){return this[t][r]},set:function(e){this[t][r]=e}})})}function o(e,t,n,o){o.forEach(function(o){o in n.prototype&&(e.prototype[o]=function(){return r(this[t],o,arguments)})})}function i(e,t,r,n){n.forEach(function(n){n in r.prototype&&(e.prototype[n]=function(){return this[t][n].apply(this[t],arguments)})})}function a(e,t,n,o){o.forEach(function(o){o in n.prototype&&(e.prototype[o]=function(){return e=this[t],(n=r(e,o,arguments)).then(function(e){if(e)return new u(e,n.request)});var e,n})})}function s(e){this._index=e}function u(e,t){this._cursor=e,this._request=t}function c(e){this._store=e}function d(e){this._tx=e,this.complete=new Promise(function(t,r){e.oncomplete=function(){t()},e.onerror=function(){r(e.error)},e.onabort=function(){r(e.error)}})}function l(e,t,r){this._db=e,this.oldVersion=t,this.transaction=new d(r)}function p(e){this._db=e}n(s,"_index",["name","keyPath","multiEntry","unique"]),o(s,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),a(s,"_index",IDBIndex,["openCursor","openKeyCursor"]),n(u,"_cursor",["direction","key","primaryKey","value"]),o(u,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(e){e in IDBCursor.prototype&&(u.prototype[e]=function(){var r=this,n=arguments;return Promise.resolve().then(function(){return r._cursor[e].apply(r._cursor,n),t(r._request).then(function(e){if(e)return new u(e,r._request)})})})}),c.prototype.createIndex=function(){return new s(this._store.createIndex.apply(this._store,arguments))},c.prototype.index=function(){return new s(this._store.index.apply(this._store,arguments))},n(c,"_store",["name","keyPath","indexNames","autoIncrement"]),o(c,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),a(c,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),i(c,"_store",IDBObjectStore,["deleteIndex"]),d.prototype.objectStore=function(){return new c(this._tx.objectStore.apply(this._tx,arguments))},n(d,"_tx",["objectStoreNames","mode"]),i(d,"_tx",IDBTransaction,["abort"]),l.prototype.createObjectStore=function(){return new c(this._db.createObjectStore.apply(this._db,arguments))},n(l,"_db",["name","version","objectStoreNames"]),i(l,"_db",IDBDatabase,["deleteObjectStore","close"]),p.prototype.transaction=function(){return new d(this._db.transaction.apply(this._db,arguments))},n(p,"_db",["name","version","objectStoreNames"]),i(p,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(e){[c,s].forEach(function(t){e in t.prototype&&(t.prototype[e.replace("open","iterate")]=function(){var t,r=(t=arguments,Array.prototype.slice.call(t)),n=r[r.length-1],o=this._store||this._index,i=o[e].apply(o,r.slice(0,-1));i.onsuccess=function(){n(i.result)}})})}),[s,c].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(e,t){var r=this,n=[];return new Promise(function(o){r.iterateCursor(e,function(e){e?(n.push(e.value),void 0===t||n.length!=t?e.continue():o(n)):o(n)})})})}),e.openDb=function(e,t,n){var o=r(indexedDB,"open",[e,t]),i=o.request;return i&&(i.onupgradeneeded=function(e){n&&n(new l(i.result,e.oldVersion,i.transaction))}),o.then(function(e){return new p(e)})},e.deleteDb=function(e){return r(indexedDB,"deleteDatabase",[e])},Object.defineProperty(e,"__esModule",{value:!0})}(t)},215:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>(function(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:s(e[n](t)),done:"return"===n}:o?o(t):t}:o}}),__asyncGenerator:()=>(function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||u(e,t)})})}function u(e,t){try{(r=o[e](t)).value instanceof s?Promise.resolve(r.value.v).then(c,d):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function c(e){u("next",e)}function d(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}),__asyncValues:()=>(function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=i(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,o,(t=e[r](t)).done,t.value)})}}}),__await:()=>s,__awaiter:()=>(function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})}),__classPrivateFieldGet:()=>(function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}),__classPrivateFieldSet:()=>(function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}),__createBinding:()=>(function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),__decorate:()=>(function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}),__exportStar:()=>(function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}),__extends:()=>(function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),__generator:()=>(function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}),__importDefault:()=>(function(e){return e&&e.__esModule?e:{default:e}}),__importStar:()=>(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}),__makeTemplateObject:()=>(function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}),__metadata:()=>(function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}),__param:()=>(function(e,t){return function(r,n){t(r,n,e)}}),__read:()=>a,__rest:()=>(function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}),__spread:()=>(function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e}),__spreadArrays:()=>(function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}),__values:()=>i});var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function s(e){return this instanceof s?(this.v=e,this):new s(e)}},633:(e,t,r)=>{var n=r(738).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",d=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new O(n||[]);return s(i,"_invoke",{value:U(e,r,a)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=h;var g="suspendedStart",m="suspendedYield",_="executing",v="completed",y={};function b(){}function w(){}function S(){}var I={};p(I,c,function(){return this});var x=Object.getPrototypeOf,k=x&&x(x(D([])));k&&k!==i&&a.call(k,c)&&(I=k);var E=S.prototype=b.prototype=Object.create(I);function T(e){["next","throw","return"].forEach(function(t){p(e,t,function(e){return this._invoke(t,e)})})}function C(e,t){function r(o,i,s,u){var c=f(e[o],e,i);if("throw"!==c.type){var d=c.arg,l=d.value;return l&&"object"==n(l)&&a.call(l,"__await")?t.resolve(l.__await).then(function(e){r("next",e,s,u)},function(e){r("throw",e,s,u)}):t.resolve(l).then(function(e){d.value=e,s(d)},function(e){return r("throw",e,s,u)})}u(c.arg)}var o;s(this,"_invoke",{value:function(e,n){function i(){return new t(function(t,o){r(e,n,t,o)})}return o=o?o.then(i,i):i()}})}function U(e,r,n){var o=g;return function(i,a){if(o===_)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===g)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=_;var c=f(e,r,n);if("normal"===c.type){if(o=n.done?v:m,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function F(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(F,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(a.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=S,s(E,"constructor",{value:S,configurable:!0}),s(S,"constructor",{value:w,configurable:!0}),w.displayName=p(S,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,p(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},r.awrap=function(e){return{__await:e}},T(C.prototype),p(C.prototype,d,function(){return this}),r.AsyncIterator=C,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var a=new C(h(e,t,n,o),i);return r.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},T(E),p(E,l,"Generator"),p(E,c,function(){return this}),p(E,"toString",function(){return"[object Generator]"}),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=D,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=(e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}),r.d=((e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}),r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),r.r=(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}),(()=>{"use strict";function e(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function t(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,u,"next",t)}function u(t){e(a,o,i,s,u,"throw",t)}s(void 0)})}}var n=r(756),o=r.n(n);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return function(){return t(o().mark(function e(t){return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){"activated"===t.state?e(t):t.addEventListener("statechange",function(){"activated"===t.state&&e(t)})}));case 1:case"end":return e.stop()}},e)})).apply(this,arguments)}.apply(this,arguments)}!function(e,t){var r="http"+("https:"===t.location.protocol?"s":"")+"://",n="logglytrackingsession";function o(){this.key=!1,this.sendConsoleErrors=!1,this.tag="jslogger",this.useDomainProxy=!1,this.useUtfEncoding=!1}function a(t){1==t.useDomainProxy?t.inputUrl=r+e.location.host+"/loggly/inputs/"+t.key+"/tag/"+t.tag:t.inputUrl=r+(t.logglyCollectorDomain||"logs-01.loggly.com")+"/inputs/"+t.key+"/tag/"+t.tag}o.prototype={setSession:function(e){e?(this.session_id=e,this.setCookie(this.session_id)):this.session_id||(this.session_id=this.readCookie(),this.session_id||(this.session_id="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),this.setCookie(this.session_id)))},push:function(t){var r=i(t);if(t&&("object"===r||"string"===r)){var n,o,s,u,c,d,l,p,h=this;if("string"===r)t={text:t};else{if(t.logglyCollectorDomain)return void(h.logglyCollectorDomain=t.logglyCollectorDomain);if(void 0!==t.sendConsoleErrors&&function(t,r){if(t.sendConsoleErrors=r,!0===t.sendConsoleErrors){var n=e.onerror;e.onerror=function(r,o,i,a,s){t.push({category:"BrowserJsException",exception:{message:r,url:o,lineno:i,colno:a,stack:s?s.stack:"n/a"}}),n&&"function"==typeof n&&n.apply(e,arguments)}}}(h,t.sendConsoleErrors),t.tag&&(l=h,p=t.tag,l.tag=p),void 0!==t.useUtfEncoding&&(c=h,d=t.useUtfEncoding,c.useUtfEncoding=d),t.useDomainProxy&&(s=h,u=t.useDomainProxy,s.useDomainProxy=u,a(s)),t.logglyKey)return n=h,o=t.logglyKey,n.key=o,n.setSession(),void a(n);if(t.session_id)return void h.setSession(t.session_id)}h.key&&h.track(t)}},track:function(t){t.sessionId=this.session_id;try{var r=new XMLHttpRequest;r.open("POST",this.inputUrl,!0),!0===u.useUtfEncoding?r.setRequestHeader("Content-Type","text/plain; charset=utf-8"):r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(t))}catch(r){e&&e.console&&"function"==typeof e.console.log&&(console.log("Failed to log to loggly because of this exception:\n"+r),console.log("Failed log data:",t))}},readCookie:function(){var e=t.cookie,r=e.indexOf(n);if(r<0)return!1;var o=e.indexOf(";",r+1);return o=o<0?e.length:o,e.slice(r+22,o)},setCookie:function(e){t.cookie=n+"="+e}};var s=e._LTracker,u=new o;if(s&&s.length){var c=0,d=s.length;for(c=0;c<d;c++)u.push(s[c])}e._LTracker=u,e.LogglyTracker=o}(window,document);const s=function(){var e=t(o().mark(function e(t){var r,n,i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("Notification"in window&&"denied"!==Notification.permission){e.next=2;break}return e.abrupt("return",null);case 2:if(r=document.location.origin+t,!("serviceWorker"in navigator)){e.next=25;break}return e.next=6,navigator.serviceWorker.getRegistrations();case 6:if(i=e.sent,n=i.find(function(e){return e.active&&e.active.scriptURL===r})){e.next=25;break}return e.prev=9,e.next=12,navigator.serviceWorker.register(t,{scope:"/"});case 12:if(!(n=e.sent).installing){e.next=18;break}return e.next=16,a(n.installing);case 16:e.next=21;break;case 18:if(!n.waiting){e.next=21;break}return e.next=21,a(n.waiting);case 21:e.next=25;break;case 23:e.prev=23,e.t0=e.catch(9);case 25:return e.abrupt("return",n);case 26:case"end":return e.stop()}},e,null,[[9,23]])}));return function(t){return e.apply(this,arguments)}}();var u,c=r(577),d=r.n(c),l=r(199),p=r(319),h=r(215),f=r(336),g=r(588),m="0.4.17",_=1e4,v="w:"+m,y="FIS_v2",b="https://firebaseinstallations.googleapis.com/v1",w=((u={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',u["not-registered"]="Firebase Installation is not registered.",u["installation-not-found"]="Firebase Installation not found.",u["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',u["app-offline"]="Could not process request. Application offline.",u["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",u),S=new f.ErrorFactory("installations","Installations",w);function I(e){return e instanceof f.FirebaseError&&e.code.includes("request-failed")}function x(e){var t=e.projectId;return b+"/projects/"+t+"/installations"}function k(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}function E(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return[4,t.json()];case 1:return r=o.sent(),n=r.error,[2,S.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})]}})})}function T(e){var t=e.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function C(e,t){var r=t.refreshToken,n=T(e);return n.append("Authorization",y+" "+r),n}function U(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t;return(0,h.__generator)(this,function(r){switch(r.label){case 0:return[4,e()];case 1:return(t=r.sent()).status>=500&&t.status<600?[2,e()]:[2,t]}})})}function P(e){return new Promise(function(t){setTimeout(t,e)})}var F=/^[cdef][\w-]{21}$/,A="";function O(e){return e.appName+"!"+e.appId}var D=new Map;function H(e,t){var r=O(e);N(r,t),function(e,t){var r=R();r&&r.postMessage({key:e,fid:t}),B()}(r,t)}function N(e,t){var r,n,o=D.get(e);if(o)try{for(var i=(0,h.__values)(o),a=i.next();!a.done;a=i.next())(0,a.value)(t)}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}var L=null;function R(){return!L&&"BroadcastChannel"in self&&((L=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(e){N(e.data.key,e.data.fid)}),L}function B(){0===D.size&&L&&(L.close(),L=null)}var j,M,W="firebase-installations-database",V=1,q="firebase-installations-store",z=null;function K(){return z||(z=(0,g.openDb)(W,V,function(e){0===e.oldVersion&&e.createObjectStore(q)})),z}function G(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a;return(0,h.__generator)(this,function(s){switch(s.label){case 0:return r=O(e),[4,K()];case 1:return n=s.sent(),o=n.transaction(q,"readwrite"),[4,(i=o.objectStore(q)).get(r)];case 2:return a=s.sent(),[4,i.put(t,r)];case 3:return s.sent(),[4,o.complete];case 4:return s.sent(),a&&a.fid===t.fid||H(e,t.fid),[2,t]}})})}function $(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return t=O(e),[4,K()];case 1:return r=o.sent(),[4,(n=r.transaction(q,"readwrite")).objectStore(q).delete(t)];case 2:return o.sent(),[4,n.complete];case 3:return o.sent(),[2]}})})}function J(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return r=O(e),[4,K()];case 1:return n=u.sent(),o=n.transaction(q,"readwrite"),[4,(i=o.objectStore(q)).get(r)];case 2:return a=u.sent(),void 0!==(s=t(a))?[3,4]:[4,i.delete(r)];case 3:return u.sent(),[3,6];case 4:return[4,i.put(s,r)];case 5:u.sent(),u.label=6;case 6:return[4,o.complete];case 7:return u.sent(),!s||a&&a.fid===s.fid||H(e,s.fid),[2,s]}})})}function X(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return[4,J(e,function(r){var n=Z(r||{fid:function(){try{var e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;var t=function(e){var t;return(t=e,btoa(String.fromCharCode.apply(String,(0,h.__spread)(t))).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22)}(e);return F.test(t)?t:A}catch(e){return A}}(),registrationStatus:0}),o=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(S.create("app-offline"))};var r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,7]),[4,function(e,t){var r=t.fid;return(0,h.__awaiter)(this,void 0,void 0,function(){var t,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return t=x(e),n=T(e),o={fid:r,authVersion:y,appId:e.appId,sdkVersion:v},i={method:"POST",headers:n,body:JSON.stringify(o)},[4,U(function(){return fetch(t,i)})];case 1:return(a=u.sent()).ok?[4,a.json()]:[3,3];case 2:return[2,{fid:(s=u.sent()).fid||r,registrationStatus:2,refreshToken:s.refreshToken,authToken:k(s.authToken)}];case 3:return[4,E("Create Installation",a)];case 4:throw u.sent()}})})}(e,t)];case 1:return r=o.sent(),[2,G(e,r)];case 2:return I(n=o.sent())&&409===n.serverCode?[4,$(e)]:[3,4];case 3:return o.sent(),[3,6];case 4:return[4,G(e,{fid:t.fid,registrationStatus:0})];case 5:o.sent(),o.label=6;case 6:throw n;case 7:return[2]}})})}(e,r);return{installationEntry:r,registrationPromise:n}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n,o;return(0,h.__generator)(this,function(i){switch(i.label){case 0:return[4,Y(e)];case 1:t=i.sent(),i.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,P(100)];case 3:return i.sent(),[4,Y(e)];case 4:return t=i.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,X(e)];case 6:return r=i.sent(),n=r.installationEntry,(o=r.registrationPromise)?[2,o]:[2,n];case 7:return[2,t]}})})}(e)}:{installationEntry:t}}(e,n);return t=o.registrationPromise,o.installationEntry})];case 1:return(r=o.sent()).fid!==A?[3,3]:(n={},[4,t]);case 2:return[2,(n.installationEntry=o.sent(),n)];case 3:return[2,{installationEntry:r,registrationPromise:t}]}})})}function Y(e){return J(e,function(e){if(!e)throw S.create("installation-not-found");return Z(e)})}function Z(e){return 1===(t=e).registrationStatus&&t.registrationTime+_<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}function Q(e,t){return void 0===t&&(t=!1),(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o;return(0,h.__generator)(this,function(i){switch(i.label){case 0:return[4,J(e.appConfig,function(n){if(!te(n))throw S.create("not-registered");var o,i=n.authToken;if(!t&&2===(o=i).requestStatus&&!function(e){var t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+36e5}(o))return n;if(1===i.requestStatus)return r=function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return[4,ee(e.appConfig)];case 1:r=o.sent(),o.label=2;case 2:return 1!==r.authToken.requestStatus?[3,5]:[4,P(100)];case 3:return o.sent(),[4,ee(e.appConfig)];case 4:return r=o.sent(),[3,2];case 5:return 0===(n=r.authToken).requestStatus?[2,Q(e,t)]:[2,n]}})})}(e,t),n;if(!navigator.onLine)throw S.create("app-offline");var a=function(e){var t={requestStatus:1,requestTime:Date.now()};return(0,h.__assign)((0,h.__assign)({},e),{authToken:t})}(n);return r=function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o;return(0,h.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,8]),[4,function(e,t){var r=e.appConfig,n=e.platformLoggerProvider;return(0,h.__awaiter)(this,void 0,void 0,function(){var e,o,i,a,s,u;return(0,h.__generator)(this,function(c){switch(c.label){case 0:return e=function(e,t){var r=t.fid;return x(e)+"/"+r+"/authTokens:generate"}(r,t),o=C(r,t),(i=n.getImmediate({optional:!0}))&&o.append("x-firebase-client",i.getPlatformInfoString()),a={installation:{sdkVersion:v}},s={method:"POST",headers:o,body:JSON.stringify(a)},[4,U(function(){return fetch(e,s)})];case 1:return(u=c.sent()).ok?[4,u.json()]:[3,3];case 2:return[2,k(c.sent())];case 3:return[4,E("Generate Auth Token",u)];case 4:throw c.sent()}})})}(e,t)];case 1:return r=i.sent(),o=(0,h.__assign)((0,h.__assign)({},t),{authToken:r}),[4,G(e.appConfig,o)];case 2:return i.sent(),[2,r];case 3:return!I(n=i.sent())||401!==n.serverCode&&404!==n.serverCode?[3,5]:[4,$(e.appConfig)];case 4:return i.sent(),[3,7];case 5:return o=(0,h.__assign)((0,h.__assign)({},t),{authToken:{requestStatus:0}}),[4,G(e.appConfig,o)];case 6:i.sent(),i.label=7;case 7:throw n;case 8:return[2]}})})}(e,a),a})];case 1:return n=i.sent(),r?[4,r]:[3,3];case 2:return o=i.sent(),[3,4];case 3:o=n.authToken,i.label=4;case 4:return[2,o]}})})}function ee(e){return J(e,function(e){if(!te(e))throw S.create("not-registered");var t;return 1===(t=e.authToken).requestStatus&&t.requestTime+_<Date.now()?(0,h.__assign)((0,h.__assign)({},e),{authToken:{requestStatus:0}}):e})}function te(e){return void 0!==e&&2===e.registrationStatus}function re(e){return S.create("missing-app-config-values",{valueName:e})}(j=l.default).INTERNAL.registerComponent(new p.Component("installations",function(e){var t=e.getProvider("app").getImmediate(),r={appConfig:function(e){var t,r;if(!e||!e.options)throw re("App Configuration");if(!e.name)throw re("App Name");try{for(var n=(0,h.__values)(["projectId","apiKey","appId"]),o=n.next();!o.done;o=n.next()){var i=o.value;if(!e.options[i])throw re(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),platformLoggerProvider:e.getProvider("platform-logger")};return{app:t,getId:function(){return function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return[4,X(e.appConfig)];case 1:return t=o.sent(),r=t.installationEntry,(n=t.registrationPromise)?n.catch(console.error):Q(e).catch(console.error),[2,r.fid]}})})}(r)},getToken:function(e){return function(e,t){return void 0===t&&(t=!1),(0,h.__awaiter)(this,void 0,void 0,function(){return(0,h.__generator)(this,function(r){switch(r.label){case 0:return[4,function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t;return(0,h.__generator)(this,function(r){switch(r.label){case 0:return[4,X(e)];case 1:return(t=r.sent().registrationPromise)?[4,t]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})}(e.appConfig)];case 1:return r.sent(),[4,Q(e,t)];case 2:return[2,r.sent().token]}})})}(r,e)},delete:function(){return function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return[4,J(t=e.appConfig,function(e){if(!e||0!==e.registrationStatus)return e})];case 1:if(!(r=n.sent()))return[3,6];if(1!==r.registrationStatus)return[3,2];throw S.create("delete-pending-registration");case 2:if(2!==r.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw S.create("app-offline");case 3:return[4,function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i;return(0,h.__generator)(this,function(a){switch(a.label){case 0:return r=function(e,t){var r=t.fid;return x(e)+"/"+r}(e,t),n=C(e,t),o={method:"DELETE",headers:n},[4,U(function(){return fetch(r,o)})];case 1:return(i=a.sent()).ok?[3,3]:[4,E("Delete Installation",i)];case 2:throw a.sent();case 3:return[2]}})})}(t,r)];case 4:return n.sent(),[4,$(t)];case 5:n.sent(),n.label=6;case 6:return[2]}})})}(r)},onIdChange:function(e){return function(e,t){R();var r=O(e),n=D.get(r);n||(n=new Set,D.set(r,n)),n.add(t)}(n=r.appConfig,t=e),function(){!function(e,t){var r=O(e),n=D.get(r);n&&(n.delete(t),0===n.size&&D.delete(r),B())}(n,t)};var t,n}}},"PUBLIC")),j.registerVersion("@firebase/installations",m);var ne,oe=((M={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',M["only-available-in-window"]="This method is available in a Window context.",M["only-available-in-sw"]="This method is available in a service worker context.",M["permission-default"]="The notification permission was not granted and dismissed instead.",M["permission-blocked"]="The notification permission was not granted and blocked instead.",M["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",M["failed-service-worker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",M["token-subscribe-failed"]="A problem occurred while subscribing the user to FCM: {$errorInfo}",M["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",M["token-unsubscribe-failed"]="A problem occurred while unsubscribing the user from FCM: {$errorInfo}",M["token-update-failed"]="A problem occurred while updating the user from FCM: {$errorInfo}",M["token-update-no-token"]="FCM returned no token when updating the user to push.",M["use-sw-after-get-token"]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",M["invalid-sw-registration"]="The input to useServiceWorker() must be a ServiceWorkerRegistration.",M["invalid-bg-handler"]="The input to setBackgroundMessageHandler() must be a function.",M["invalid-vapid-key"]="The public VAPID key must be a string.",M["use-vapid-key-after-get-token"]="The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.",M),ie=new f.ErrorFactory("messaging","Messaging",oe),ae="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",se="https://fcmregistrations.googleapis.com/v1",ue="FCM_MSG",ce="google.c.a.c_id";function de(e){var t=new Uint8Array(e);return btoa(String.fromCharCode.apply(String,(0,h.__spread)(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}!function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(ne||(ne={}));var le="fcm_token_details_db",pe=5,he="fcm_token_object_Store";var fe="firebase-messaging-database",ge=1,me="firebase-messaging-store",_e=null;function ve(){return _e||(_e=(0,g.openDb)(fe,ge,function(e){0===e.oldVersion&&e.createObjectStore(me)})),_e}function ye(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return t=we(e),[4,ve()];case 1:return[4,o.sent().transaction(me).objectStore(me).get(t)];case 2:return(r=o.sent())?[2,r]:[3,3];case 3:return[4,function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r=this;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return"databases"in indexedDB?[4,indexedDB.databases()]:[3,2];case 1:if(!n.sent().map(function(e){return e.name}).includes(le))return[2,null];n.label=2;case 2:return t=null,[4,(0,g.openDb)(le,pe,function(n){return(0,h.__awaiter)(r,void 0,void 0,function(){var r,o,i,a;return(0,h.__generator)(this,function(s){switch(s.label){case 0:return n.oldVersion<2?[2]:n.objectStoreNames.contains(he)?[4,(r=n.transaction.objectStore(he)).index("fcmSenderId").get(e)]:[2];case 1:return o=s.sent(),[4,r.clear()];case 2:if(s.sent(),!o)return[2];if(2===n.oldVersion){if(!(i=o).auth||!i.p256dh||!i.endpoint)return[2];t={token:i.fcmToken,createTime:null!==(a=i.createTime)&&void 0!==a?a:Date.now(),subscriptionOptions:{auth:i.auth,p256dh:i.p256dh,endpoint:i.endpoint,swScope:i.swScope,vapidKey:"string"==typeof i.vapidKey?i.vapidKey:de(i.vapidKey)}}}else(3===n.oldVersion||4===n.oldVersion)&&(t={token:(i=o).fcmToken,createTime:i.createTime,subscriptionOptions:{auth:de(i.auth),p256dh:de(i.p256dh),endpoint:i.endpoint,swScope:i.swScope,vapidKey:de(i.vapidKey)}});return[2]}})})})];case 3:return n.sent().close(),[4,(0,g.deleteDb)(le)];case 4:return n.sent(),[4,(0,g.deleteDb)("fcm_vapid_details_db")];case 5:return n.sent(),[4,(0,g.deleteDb)("undefined")];case 6:return n.sent(),[2,function(e){if(!e||!e.subscriptionOptions)return!1;var t=e.subscriptionOptions;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null]}})})}(e.appConfig.senderId)];case 4:return(n=o.sent())?[4,be(e,n)]:[3,6];case 5:return o.sent(),[2,n];case 6:return[2]}})})}function be(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o;return(0,h.__generator)(this,function(i){switch(i.label){case 0:return r=we(e),[4,ve()];case 1:return n=i.sent(),[4,(o=n.transaction(me,"readwrite")).objectStore(me).put(t,r)];case 2:return i.sent(),[4,o.complete];case 3:return i.sent(),[2,t]}})})}function we(e){return e.appConfig.appId}function Se(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a;return(0,h.__generator)(this,function(s){switch(s.label){case 0:return[4,xe(e)];case 1:r=s.sent(),n={method:"DELETE",headers:r},s.label=2;case 2:return s.trys.push([2,5,,6]),[4,fetch(Ie(e.appConfig)+"/"+t,n)];case 3:return[4,s.sent().json()];case 4:if((o=s.sent()).error)throw i=o.error.message,ie.create("token-unsubscribe-failed",{errorInfo:i});return[3,6];case 5:throw a=s.sent(),ie.create("token-unsubscribe-failed",{errorInfo:a});case 6:return[2]}})})}function Ie(e){var t=e.projectId;return se+"/projects/"+t+"/registrations"}function xe(e){var t=e.appConfig,r=e.installations;return(0,h.__awaiter)(this,void 0,void 0,function(){var e;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return[4,r.getToken()];case 1:return e=n.sent(),[2,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t.apiKey,"x-goog-firebase-installations-auth":"FIS "+e})]}})})}function ke(e){var t=e.p256dh,r=e.auth,n=e.endpoint,o=e.vapidKey,i={web:{endpoint:n,auth:r,p256dh:t}};return o!==ae&&(i.web.applicationPubKey=o),i}function Ee(e,t,r){return(0,h.__awaiter)(this,void 0,void 0,function(){var n,o,i,a;return(0,h.__generator)(this,function(s){switch(s.label){case 0:if("granted"!==Notification.permission)throw ie.create("permission-blocked");return[4,function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return[4,e.pushManager.getSubscription()];case 1:return(r=n.sent())?[2,r]:[2,e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length),o=0;o<r.length;++o)n[o]=r.charCodeAt(o);return n}(t)})]}})})}(t,r)];case 1:return n=s.sent(),[4,ye(e)];case 2:return o=s.sent(),i={vapidKey:r,swScope:t.scope,endpoint:n.endpoint,auth:de(n.getKey("auth")),p256dh:de(n.getKey("p256dh"))},o?[3,3]:[2,Ce(e,i)];case 3:if(u=o.subscriptionOptions,d=(c=i).vapidKey===u.vapidKey,l=c.endpoint===u.endpoint,p=c.auth===u.auth,f=c.p256dh===u.p256dh,d&&l&&p&&f)return[3,8];s.label=4;case 4:return s.trys.push([4,6,,7]),[4,Se(e,o.token)];case 5:return s.sent(),[3,7];case 6:return a=s.sent(),console.warn(a),[3,7];case 7:return[2,Ce(e,i)];case 8:return Date.now()>=o.createTime+6048e5?[2,function(e,t,r){return(0,h.__awaiter)(this,void 0,void 0,function(){var n,o,i;return(0,h.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,5]),[4,function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return[4,xe(e)];case 1:r=u.sent(),n=ke(t.subscriptionOptions),o={method:"PATCH",headers:r,body:JSON.stringify(n)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(Ie(e.appConfig)+"/"+t.token,o)];case 3:return[4,u.sent().json()];case 4:return i=u.sent(),[3,6];case 5:throw a=u.sent(),ie.create("token-update-failed",{errorInfo:a});case 6:if(i.error)throw s=i.error.message,ie.create("token-update-failed",{errorInfo:s});if(!i.token)throw ie.create("token-update-no-token");return[2,i.token]}})})}(t,e)];case 1:return n=a.sent(),o=(0,h.__assign)((0,h.__assign)({},e),{token:n,createTime:Date.now()}),[4,be(t,o)];case 2:return a.sent(),[2,n];case 3:return i=a.sent(),[4,Te(t,r)];case 4:throw a.sent(),i;case 5:return[2]}})})}({token:o.token,createTime:Date.now(),subscriptionOptions:i},e,t)]:[2,o.token];case 9:return[2]}var u,c,d,l,p,f})})}function Te(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return[4,ye(e)];case 1:return(r=o.sent())?[4,Se(e,r.token)]:[3,4];case 2:return o.sent(),[4,function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return t=we(e),[4,ve()];case 1:return r=o.sent(),[4,(n=r.transaction(me,"readwrite")).objectStore(me).delete(t)];case 2:return o.sent(),[4,n.complete];case 3:return o.sent(),[2]}})})}(e)];case 3:o.sent(),o.label=4;case 4:return[4,t.pushManager.getSubscription()];case 5:return(n=o.sent())?[2,n.unsubscribe()]:[2,!0]}})})}function Ce(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return[4,function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return[4,xe(e)];case 1:r=u.sent(),n=ke(t),o={method:"POST",headers:r,body:JSON.stringify(n)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(Ie(e.appConfig),o)];case 3:return[4,u.sent().json()];case 4:return i=u.sent(),[3,6];case 5:throw a=u.sent(),ie.create("token-subscribe-failed",{errorInfo:a});case 6:if(i.error)throw s=i.error.message,ie.create("token-subscribe-failed",{errorInfo:s});if(!i.token)throw ie.create("token-subscribe-no-token");return[2,i.token]}})})}(e,t)];case 1:return r=o.sent(),n={token:r,createTime:Date.now(),subscriptionOptions:t},[4,be(e,n)];case 2:return o.sent(),[2,n.token]}})})}function Ue(e){return"object"==typeof e&&!!e&&ce in e}var Pe=function(){function e(e){var t=this;this.firebaseDependencies=e,this.isOnBackgroundMessageUsed=null,this.vapidKey=null,this.bgMessageHandler=null,self.addEventListener("push",function(e){e.waitUntil(t.onPush(e))}),self.addEventListener("pushsubscriptionchange",function(e){e.waitUntil(t.onSubChange(e))}),self.addEventListener("notificationclick",function(e){e.waitUntil(t.onNotificationClick(e))})}return Object.defineProperty(e.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),e.prototype.setBackgroundMessageHandler=function(e){if(this.isOnBackgroundMessageUsed=!1,!e||"function"!=typeof e)throw ie.create("invalid-bg-handler");this.bgMessageHandler=e},e.prototype.onBackgroundMessage=function(e){var t=this;return this.isOnBackgroundMessageUsed=!0,this.bgMessageHandler=e,function(){t.bgMessageHandler=null}},e.prototype.getToken=function(){var e,t;return(0,h.__awaiter)(this,void 0,void 0,function(){var r;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return this.vapidKey?[3,2]:[4,ye(this.firebaseDependencies)];case 1:r=n.sent(),this.vapidKey=null!==(t=null===(e=null==r?void 0:r.subscriptionOptions)||void 0===e?void 0:e.vapidKey)&&void 0!==t?t:ae,n.label=2;case 2:return[2,Ee(this.firebaseDependencies,self.registration,this.vapidKey)]}})})},e.prototype.deleteToken=function(){return Te(this.firebaseDependencies,self.registration)},e.prototype.requestPermission=function(){throw ie.create("only-available-in-window")},e.prototype.usePublicVapidKey=function(e){if(null!==this.vapidKey)throw ie.create("use-vapid-key-after-get-token");if("string"!=typeof e||0===e.length)throw ie.create("invalid-vapid-key");this.vapidKey=e},e.prototype.useServiceWorker=function(){throw ie.create("only-available-in-window")},e.prototype.onMessage=function(){throw ie.create("only-available-in-window")},e.prototype.onTokenRefresh=function(){throw ie.create("only-available-in-window")},e.prototype.onPush=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n,o;return(0,h.__generator)(this,function(i){switch(i.label){case 0:return(t=function(e){var t=e.data;if(!t)return null;try{return t.json()}catch(e){return null}}(e))?[4,Fe()]:(console.debug("FirebaseMessaging: failed to get parsed MessagePayload from the PushEvent. Skip handling the push."),[2]);case 1:return(r=i.sent()).some(function(e){return"visible"===e.visibilityState&&!e.url.startsWith("chrome-extension://")})?[2,function(e,t){var r,n;t.isFirebaseMessaging=!0,t.messageType=ne.PUSH_RECEIVED;try{for(var o=(0,h.__values)(e),i=o.next();!i.done;i=o.next())i.value.postMessage(t)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}(r,t)]:(n=!1,t.notification?[4,function(e){var t,r=e.actions,n=Notification.maxActions;return r&&n&&r.length>n&&console.warn("This browser only supports "+n+" actions. The remaining actions will not be displayed."),self.registration.showNotification(null!==(t=e.title)&&void 0!==t?t:"",e)}(function(e){var t,r=(0,h.__assign)({},e.notification);return r.data=((t={})[ue]=e,t),r}(t))]:[3,3]);case 2:i.sent(),n=!0,i.label=3;case 3:return!0===n&&!1===this.isOnBackgroundMessageUsed||this.bgMessageHandler&&(o=function(e){var t={from:e.from,collapseKey:e.collapse_key};return function(e,t){if(t.notification){e.notification={};var r=t.notification.title;r&&(e.notification.title=r);var n=t.notification.body;n&&(e.notification.body=n);var o=t.notification.image;o&&(e.notification.image=o)}}(t,e),function(e,t){t.data&&(e.data=t.data)}(t,e),function(e,t){if(t.fcmOptions){e.fcmOptions={};var r=t.fcmOptions.link;r&&(e.fcmOptions.link=r);var n=t.fcmOptions.analytics_label;n&&(e.fcmOptions.analyticsLabel=n)}}(t,e),t}(t),"function"==typeof this.bgMessageHandler?this.bgMessageHandler(o):this.bgMessageHandler.next(o)),[2]}})})},e.prototype.onSubChange=function(e){var t,r;return(0,h.__awaiter)(this,void 0,void 0,function(){var n;return(0,h.__generator)(this,function(o){switch(o.label){case 0:return e.newSubscription?[3,2]:[4,Te(this.firebaseDependencies,self.registration)];case 1:case 5:return o.sent(),[2];case 2:return[4,ye(this.firebaseDependencies)];case 3:return n=o.sent(),[4,Te(this.firebaseDependencies,self.registration)];case 4:return o.sent(),[4,Ee(this.firebaseDependencies,self.registration,null!==(r=null===(t=null==n?void 0:n.subscriptionOptions)||void 0===t?void 0:t.vapidKey)&&void 0!==r?r:ae)]}})})},e.prototype.onNotificationClick=function(e){var t,r;return(0,h.__awaiter)(this,void 0,void 0,function(){var n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return(n=null===(r=null===(t=e.notification)||void 0===t?void 0:t.data)||void 0===r?void 0:r[ue])?e.action?[2]:(e.stopImmediatePropagation(),e.notification.close(),(o=function(e){var t,r,n;return(null!==(r=null===(t=e.fcmOptions)||void 0===t?void 0:t.link)&&void 0!==r?r:null===(n=e.notification)||void 0===n?void 0:n.click_action)||(Ue(e.data)?self.location.origin:null)}(n))?(i=new URL(o,self.location.href),a=new URL(self.location.origin),i.host!==a.host?[2]:[4,function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r,n,o,i,a,s;return(0,h.__generator)(this,function(u){switch(u.label){case 0:return[4,Fe()];case 1:t=u.sent();try{for(r=(0,h.__values)(t),n=r.next();!n.done;n=r.next())if(o=n.value,i=new URL(o.url,self.location.href),e.host===i.host)return[2,o]}catch(e){a={error:e}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(a)throw a.error}}return[2,null]}})})}(i)]):[2]):[2];case 1:return(s=u.sent())?[3,4]:[4,self.clients.openWindow(o)];case 2:return s=u.sent(),[4,new Promise(function(e){setTimeout(e,3e3)})];case 3:return u.sent(),[3,6];case 4:return[4,s.focus()];case 5:s=u.sent(),u.label=6;case 6:return s?(n.messageType=ne.NOTIFICATION_CLICKED,n.isFirebaseMessaging=!0,[2,s.postMessage(n)]):[2]}})})},e}();function Fe(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}var Ae=function(){function e(e){var t=this;this.firebaseDependencies=e,this.vapidKey=null,this.onMessageCallback=null,navigator.serviceWorker.addEventListener("message",function(e){return t.messageEventListener(e)})}return Object.defineProperty(e.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),e.prototype.messageEventListener=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){var t,r;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return(t=e.data).isFirebaseMessaging?(this.onMessageCallback&&t.messageType===ne.PUSH_RECEIVED&&("function"==typeof this.onMessageCallback?this.onMessageCallback(function(e){return delete e.messageType,delete e.isFirebaseMessaging,e}(Object.assign({},t))):this.onMessageCallback.next(Object.assign({},t))),Ue(r=t.data)&&"1"===r["google.c.a.e"]?[4,this.logEvent(t.messageType,r)]:[3,2]):[2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.getVapidKey=function(){return this.vapidKey},e.prototype.getSwReg=function(){return this.swRegistration},e.prototype.getToken=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){return(0,h.__generator)(this,function(t){switch(t.label){case 0:return"default"!==Notification.permission?[3,2]:[4,Notification.requestPermission()];case 1:t.sent(),t.label=2;case 2:if("granted"!==Notification.permission)throw ie.create("permission-blocked");return[4,this.updateVapidKey(null==e?void 0:e.vapidKey)];case 3:return t.sent(),[4,this.updateSwReg(null==e?void 0:e.serviceWorkerRegistration)];case 4:return t.sent(),[2,Ee(this.firebaseDependencies,this.swRegistration,this.vapidKey)]}})})},e.prototype.updateVapidKey=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){return(0,h.__generator)(this,function(t){return e?this.vapidKey=e:this.vapidKey||(this.vapidKey=ae),[2]})})},e.prototype.updateSwReg=function(e){return(0,h.__awaiter)(this,void 0,void 0,function(){return(0,h.__generator)(this,function(t){switch(t.label){case 0:return e||this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:t.sent(),t.label=2;case 2:if(!e&&this.swRegistration)return[2];if(!(e instanceof ServiceWorkerRegistration))throw ie.create("invalid-sw-registration");return this.swRegistration=e,[2]}})})},e.prototype.registerDefaultSw=function(){return(0,h.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,h.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=this,[4,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"})];case 1:return e.swRegistration=r.sent(),this.swRegistration.update().catch(function(){}),[3,3];case 2:throw t=r.sent(),ie.create("failed-service-worker-registration",{browserErrorMessage:t.message});case 3:return[2]}})})},e.prototype.deleteToken=function(){return(0,h.__awaiter)(this,void 0,void 0,function(){return(0,h.__generator)(this,function(e){switch(e.label){case 0:return this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:e.sent(),e.label=2;case 2:return[2,Te(this.firebaseDependencies,this.swRegistration)]}})})},e.prototype.requestPermission=function(){return(0,h.__awaiter)(this,void 0,void 0,function(){var e;return(0,h.__generator)(this,function(t){switch(t.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(e=t.sent()))return[2];throw"denied"===e?ie.create("permission-blocked"):ie.create("permission-default")}})})},e.prototype.usePublicVapidKey=function(e){if(null!==this.vapidKey)throw ie.create("use-vapid-key-after-get-token");if("string"!=typeof e||0===e.length)throw ie.create("invalid-vapid-key");this.vapidKey=e},e.prototype.useServiceWorker=function(e){if(!(e instanceof ServiceWorkerRegistration))throw ie.create("invalid-sw-registration");if(this.swRegistration)throw ie.create("use-sw-after-get-token");this.swRegistration=e},e.prototype.onMessage=function(e){var t=this;return this.onMessageCallback=e,function(){t.onMessageCallback=null}},e.prototype.setBackgroundMessageHandler=function(){throw ie.create("only-available-in-sw")},e.prototype.onBackgroundMessage=function(){throw ie.create("only-available-in-sw")},e.prototype.onTokenRefresh=function(){return function(){}},e.prototype.logEvent=function(e,t){return(0,h.__awaiter)(this,void 0,void 0,function(){var r;return(0,h.__generator)(this,function(n){switch(n.label){case 0:return r=function(e){switch(e){case ne.NOTIFICATION_CLICKED:return"notification_open";case ne.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(e),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return n.sent().logEvent(r,{message_id:t[ce],message_name:t["google.c.a.c_l"],message_time:t["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)}),[2]}})})},e}();function Oe(e){return ie.create("missing-app-config-values",{valueName:e})}var De={isSupported:He};function He(){return self&&"ServiceWorkerGlobalScope"in self?"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}l.default.INTERNAL.registerComponent(new p.Component("messaging",function(e){var t=e.getProvider("app").getImmediate(),r=function(e){var t,r;if(!e||!e.options)throw Oe("App Configuration Object");if(!e.name)throw Oe("App Name");var n=e.options;try{for(var o=(0,h.__values)(["projectId","apiKey","appId","messagingSenderId"]),i=o.next();!i.done;i=o.next()){var a=i.value;if(!n[a])throw Oe(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}(t),n={app:t,appConfig:r,installations:e.getProvider("installations").getImmediate(),analyticsProvider:e.getProvider("analytics-internal")};if(!He())throw ie.create("unsupported-browser");return self&&"ServiceWorkerGlobalScope"in self?new Pe(n):new Ae(n)},"PUBLIC").setServiceProps(De));var Ne=function(){var e=d().initializeApp({apiKey:"AIzaSyAv7G04oyBZYqE_yAyku-rRQRXnsA1mLmw",authDomain:"webpush-prod.firebaseapp.com",projectId:"webpush-prod",storageBucket:"webpush-prod.appspot.com",messagingSenderId:"312459295826",appId:"1:312459295826:web:6d6650a797358aafe3f38b",measurementId:"G-FWD9J8MWD6"},"pushMessage").messaging();return e.usePublicVapidKey("BAdGdYm_SSlWJV0eXw36DDjDPhKYsa37R5WphjCA_Dm1kBo55XsVCn62jCE1RFAAXbzQGs0mG3hs9ZvXhVfTUpg"),e},Le=function(){var e=t(o().mark(function e(t,r){var n;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=6;break}return e.next=3,t.getToken({vapidKey:"BAdGdYm_SSlWJV0eXw36DDjDPhKYsa37R5WphjCA_Dm1kBo55XsVCn62jCE1RFAAXbzQGs0mG3hs9ZvXhVfTUpg",serviceWorkerRegistration:r});case 3:n=e.sent,e.next=9;break;case 6:return e.next=8,t.getToken();case 8:n=e.sent;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}();const Re=function(){var e=t(o().mark(function e(){var t,r,n;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s("/doppler-push-notification-sw.js");case 2:if(!(t=e.sent)){e.next=20;break}return e.prev=4,e.next=7,t.pushManager.getSubscription();case 7:if(n=e.sent){e.next=14;break}return e.next=11,t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:"BBBe2B9PLkV30W5fRnY8E6jtuWZQJzxY5933G2XyVucFOX6ozAZfRRrPNi9iFY6CE0JFvXzIZL5s81jKsV7mVjI"});case 11:r=e.sent,e.next=15;break;case 14:r=n;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(4),console.log("Fail subscribing to Doppler notifications. Error: ".concat(JSON.stringify(e.t0)));case 20:return e.abrupt("return",r?r.toJSON():null);case 21:case"end":return e.stop()}},e,null,[[4,17]])}));return function(){return e.apply(this,arguments)}}();function Be(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}function je(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Be(n.key),n)}}const Me=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiUrl=t,this.cdhStorage=r,this.logger=n}return r=e,n=[{key:"addPushContact",value:(c=t(o().mark(function e(t,r,n){return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||t===this.cdhStorage.getItem("_dha__push_deviceToken")){e.next=8;break}return e.next=3,fetch("".concat(this.apiUrl,"/push-contacts"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:n||window.location.host,deviceToken:t,visitorGuid:this.cdhStorage.getItem("_dha__uuid"),email:this.cdhStorage.getItem("_dha__em")||null,subscription:r})});case 3:if(!e.sent.ok){e.next=8;break}return this.cdhStorage.setItem("_dha__push_deviceToken",t),this.cdhStorage.setItem("_dha__push_subscription",JSON.stringify(r)),e.abrupt("return",!0);case 8:return e.abrupt("return",!1);case 9:case"end":return e.stop()}},e,this)})),function(e,t,r){return c.apply(this,arguments)})},{key:"updatePushContact",value:(u=t(o().mark(function e(t,r){var n,i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=encodeURIComponent(t),i="".concat(this.apiUrl,"/push-contacts/").concat(n,"/subscription"),e.next=4,fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({endPoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}})});case 4:e.sent.ok&&this.cdhStorage.setItem("_dha__push_subscription",JSON.stringify(r));case 6:case"end":return e.stop()}},e,this)})),function(e,t){return u.apply(this,arguments)})},{key:"isPushFeatureDomainEnabled",value:(s=t(o().mark(function e(t){var r,n,i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r="".concat(this.apiUrl,"/domains/").concat(t,"/isPushFeatureEnabled"),e.next=4,fetch(r);case 4:if(404!==(n=e.sent).status){e.next=8;break}return this.logger.push("Api push contact. Hostname ".concat(t," not found.")),e.abrupt("return",!1);case 8:return e.next=10,n.json();case 10:return i=e.sent,e.abrupt("return",i);case 14:return e.prev=14,e.t0=e.catch(0),this.logger.push("Api push contact. Err: ".concat(JSON.stringify(e.t0))),e.abrupt("return",!1);case 18:case"end":return e.stop()}},e,this,[[0,14]])})),function(e){return s.apply(this,arguments)})},{key:"getPushConfiguration",value:(a=t(o().mark(function e(t){var r,n,i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r="".concat(this.apiUrl,"/domains/").concat(t,"/push-configuration"),e.next=4,fetch(r);case 4:if(404!==(n=e.sent).status){e.next=8;break}return this.logger.push("Api push contact. Hostname ".concat(t," not found.")),e.abrupt("return",!1);case 8:return e.next=10,n.json();case 10:return i=e.sent,e.abrupt("return",{isPushFeatureEnabled:i.isPushFeatureEnabled,usesExternalPushDomain:i.usesExternalPushDomain,externalPushDomain:i.externalPushDomain});case 14:return e.prev=14,e.t0=e.catch(0),this.logger.push("Error obtaining push configuration. Err: ".concat(JSON.stringify(e.t0))),e.abrupt("return",!1);case 18:case"end":return e.stop()}},e,this,[[0,14]])})),function(e){return a.apply(this,arguments)})}],i=[{key:"getInstance",value:function(t,r,n){return e.instance||(e.instance=new e(t,r,n)),e.instance}}],n&&je(r.prototype,n),i&&je(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i,a,s,u,c}();var We="pushParent";function Ve(e){return new URLSearchParams(window.location.search).get(e)}function qe(e,t){e&&(t?(e.classList.remove("cdh_init","cdh_hidden"),e.classList.add("cdh_visible")):(e.classList.remove("cdh_visible"),e.classList.add("cdh_hidden")))}var ze=function(e,t){try{var r=(navigator.language||navigator.userLanguage).startsWith("es"),n=r?'<div id="cdh_push-modal" class="cdh_init"> <div class="cdh_modal-content"> <div class="cdh_modal-icon-wrapper" aria-label="notificaciones"> <span class="cdh_modal-icon">🔔</span> </div> <div class="cdh_modal-text"> <p class="cdh_site-url">{{siteUrl}}</p> <p class="cdh_subtext">Nos gustaría mostrarte notificaciones con novedades y actualizaciones</p> <div class="cdh_modal-buttons"> <button id="cdh_btn-no">No, gracias</button> <button id="cdh_btn-yes">Permitir</button> </div> </div> </div> </div> <style>@keyframes slideDownEnter{0%{opacity:0;transform:translate(-50%,-100%)}100%{opacity:1;transform:translate(-50%,0)}}@keyframes slideUpExit{0%{opacity:1;transform:translate(-50%,0)}100%{opacity:0;transform:translate(-50%,-100%)}}#cdh_push-modal{position:fixed;top:0;left:50%;transform:translate(-50%,-100%);background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.2);border-radius:4px;z-index:2147483647;width:100%;max-width:640px;padding:20px 24px;box-sizing:border-box;font-family:sans-serif;opacity:0;pointer-events:none}#cdh_push-modal.cdh_init{transform:translate(-50%,-100%);opacity:0;pointer-events:none}#cdh_push-modal.cdh_visible{animation:slideDownEnter .4s ease-out forwards;pointer-events:auto}#cdh_push-modal.cdh_hidden{animation:slideUpExit .3s ease-in forwards;pointer-events:none}.cdh_modal-content{display:flex;align-items:flex-start}.cdh_modal-icon-wrapper{display:flex;align-items:flex-start;justify-content:center;width:24px;height:24px;margin-right:12px;flex-shrink:0;margin-top:4px}.cdh_modal-icon{font-size:18px;color:#fbbf24;line-height:1}.cdh_modal-text{flex:1;font-size:15px;color:#333;line-height:1.5}.cdh_modal-text p{margin:0}.cdh_site-url{font-family:"Proxima Nova",sans-serif;color:var(--darkgrey,#333);font-size:20px;font-weight:700;line-height:20px;margin-bottom:22px!important}.cdh_subtext{font-family:"Proxima Nova",sans-serif;color:var(--darkgrey,#333);font-size:16px;font-weight:400;line-height:20px;margin-bottom:25px!important}.cdh_modal-buttons{display:flex;justify-content:flex-end;gap:12px}#cdh_btn-no{background:#fff;border:1px solid var(--green,#33ad73);color:var(--green,#33ad73);text-align:center;font-family:Helvetica,sans-serif;font-size:13px;font-weight:400;line-height:15px;border-radius:3px;padding:13px 25px;cursor:pointer;display:inline-flex;align-items:flex-start;gap:10px}#cdh_btn-yes{background-color:#33ad73;color:var(--white,#fff);text-align:center;font-family:"Proxima Nova",sans-serif;font-size:15px;font-weight:700;line-height:15px;border:none;padding:14px 25px;border-radius:3px;cursor:pointer;display:flex;align-items:flex-start;gap:10px;flex-shrink:0}#cdh_btn-no:hover,#cdh_btn-yes:hover{opacity:.9}</style> ':'<div id="cdh_push-modal" class="cdh_init"> <div class="cdh_modal-content"> <div class="cdh_modal-icon-wrapper" aria-label="notifications"> <span class="cdh_modal-icon">🔔</span> </div> <div class="cdh_modal-text"> <p class="cdh_site-url">{{siteUrl}}</p> <p class="cdh_subtext">We’d like to show you notifications with news and updates</p> <div class="cdh_modal-buttons"> <button id="cdh_btn-no">No, thanks</button> <button id="cdh_btn-yes">Allow</button> </div> </div> </div> </div> <style>@keyframes slideDownEnter{0%{opacity:0;transform:translate(-50%,-100%)}100%{opacity:1;transform:translate(-50%,0)}}@keyframes slideUpExit{0%{opacity:1;transform:translate(-50%,0)}100%{opacity:0;transform:translate(-50%,-100%)}}#cdh_push-modal{position:fixed;top:0;left:50%;transform:translate(-50%,-100%);background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.2);border-radius:4px;z-index:2147483647;width:100%;max-width:640px;padding:20px 24px;box-sizing:border-box;font-family:sans-serif;opacity:0;pointer-events:none}#cdh_push-modal.cdh_init{transform:translate(-50%,-100%);opacity:0;pointer-events:none}#cdh_push-modal.cdh_visible{animation:slideDownEnter .4s ease-out forwards;pointer-events:auto}#cdh_push-modal.cdh_hidden{animation:slideUpExit .3s ease-in forwards;pointer-events:none}.cdh_modal-content{display:flex;align-items:flex-start}.cdh_modal-icon-wrapper{display:flex;align-items:flex-start;justify-content:center;width:24px;height:24px;margin-right:12px;flex-shrink:0;margin-top:4px}.cdh_modal-icon{font-size:18px;color:#fbbf24;line-height:1}.cdh_modal-text{flex:1;font-size:15px;color:#333;line-height:1.5}.cdh_modal-text p{margin:0}.cdh_site-url{font-family:"Proxima Nova",sans-serif;color:var(--darkgrey,#333);font-size:20px;font-weight:700;line-height:20px;margin-bottom:22px!important}.cdh_subtext{font-family:"Proxima Nova",sans-serif;color:var(--darkgrey,#333);font-size:16px;font-weight:400;line-height:20px;margin-bottom:25px!important}.cdh_modal-buttons{display:flex;justify-content:flex-end;gap:12px}#cdh_btn-no{background:#fff;border:1px solid var(--green,#33ad73);color:var(--green,#33ad73);text-align:center;font-family:Helvetica,sans-serif;font-size:13px;font-weight:400;line-height:15px;border-radius:3px;padding:13px 25px;cursor:pointer;display:inline-flex;align-items:flex-start;gap:10px}#cdh_btn-yes{background-color:#33ad73;color:var(--white,#fff);text-align:center;font-family:"Proxima Nova",sans-serif;font-size:15px;font-weight:700;line-height:15px;border:none;padding:14px 25px;border-radius:3px;cursor:pointer;display:flex;align-items:flex-start;gap:10px;flex-shrink:0}#cdh_btn-no:hover,#cdh_btn-yes:hover{opacity:.9}</style> ',o=window.location.origin;n=n.replace("{{siteUrl}}",o);var i=document.createElement("div");i.innerHTML=n,document.body.appendChild(i);var a=document.getElementById("cdh_push-modal"),s=document.getElementById("cdh_btn-yes"),u=document.getElementById("cdh_btn-no");setTimeout(function(){a&&qe(a,!0)},1e3);var c=e.includes("https://")?e:"https://".concat(e),d=null;s.addEventListener("click",function(){var e=window.location.host,t=localStorage.getItem("_dha__uuid"),n=r?"push_permission.es.html":"push_permission.en.html",o=new URL("".concat(c,"/").concat(n));o.searchParams.set("dha_ori_domain",e),o.searchParams.set("dha_id",t),o.searchParams.set("dha_push_source",We);var i=o.toString(),s=window.screenX+(window.outerWidth-700)/2,u=window.screenY+(window.outerHeight-550)/2;d=window.open(i,"pushWindow","width=".concat(700,",height=").concat(550,",left=").concat(s,",top=").concat(u)),qe(a,!1)}),u.addEventListener("click",function(){qe(a,!1),localStorage.setItem("_dha__external_push_processed","true")}),window.addEventListener("message",function(e){!function(e,t,r){if(e.origin===r){var n=e.data.permission;"granted"!==n&&"denied"!==n||(localStorage.setItem("_dha__external_push_processed","true"),t&&!t.closed&&t.close())}}(e,d,c)})}catch(e){t.push("Error loading push modal. Error: ".concat(e))}},Ke=function(){var e=t(o().mark(function e(){var t,r,n;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{t=Ve("dha_push_source"),window.opener&&t===We&&(r=Notification.permission,n=new URL(document.referrer).origin,window.opener.postMessage({permission:r},n))}catch(e){}case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();function Ge(){return function(){return t(o().mark(function e(){var t,r;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("serviceWorker"in navigator&&"PushManager"in window){e.next=2;break}return e.abrupt("return",{isPermissionGranted:!1,permissionValue:"denied"});case 2:if("denied"!==(t=Notification.permission)){e.next=5;break}return e.abrupt("return",{isPermissionGranted:!1,permissionValue:t});case 5:if("default"!==t){e.next=10;break}return e.next=8,Notification.requestPermission();case 8:return r=e.sent,e.abrupt("return",{isPermissionGranted:"granted"===r,permissionValue:r});case 10:return e.abrupt("return",{isPermissionGranted:!0,permissionValue:"granted"});case 11:case"end":return e.stop()}},e)})).apply(this,arguments)}.apply(this,arguments)}var $e=new LogglyTracker;$e.push({logglyKey:"97cc20a4-a0dc-40b0-a74e-9643a9388202",sendConsoleErrors:!1,tag:"push-client-side-".concat("prod")});var Je=Me.getInstance("https://apis.fromdoppler.com/doppler-push-contact",_dha.storage,$e);function Xe(){return Ye.apply(this,arguments)}function Ye(){return(Ye=t(o().mark(function e(){var r,n,i,a,u,c,d,l,p;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ne(),n=function(e,t){try{if(!e)return;_dha.savePushNotificationToken(e,t)}catch(e){$e.push("Datahub script must be included first. Error: ".concat(e))}},i=function(e){if(!e||!e.keys)return!1;var t=_dha.storage.getItem("_dha__push_subscription"),r=JSON.parse(t);return!r||!r.keys||e.endpoint!==r.endpoint||e.keys.p256dh!==r.keys.p256dh||e.keys.auth!==r.keys.auth},a=function(){var e=t(o().mark(function e(t){var r,n,i,a,s,u;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.keys){e.next=2;break}return e.abrupt("return",null);case 2:return r="".concat(t.endpoint,"|").concat(t.keys.p256dh,"|").concat(t.keys.auth),n=new TextEncoder,i=n.encode(r),e.next=7,crypto.subtle.digest("SHA-256",i);case 7:return a=e.sent,s=Array.from(new Uint8Array(a)),u=s.map(function(e){return e.toString(16).padStart(2,"0")}).join(""),e.abrupt("return",u);case 11:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),u=function(e){return new URLSearchParams(window.location.search).get(e)},e.prev=5,e.next=8,Re();case 8:return c=e.sent,e.next=11,s("/files/service-worker.js");case 11:return l=e.sent,e.prev=12,e.next=15,Le(r,l);case 15:d=e.sent,e.next=20;break;case 18:e.prev=18,e.t0=e.catch(12);case 20:if(d){e.next=24;break}return e.next=23,a(c);case 23:d=e.sent;case 24:return n(d,!1),p=u("dha_ori_domain"),e.next=28,Je.addPushContact(d,c,p);case 28:if(e.sent||!i(c)){e.next=32;break}return e.next=32,Je.updatePushContact(d,c);case 32:e.next=37;break;case 34:e.prev=34,e.t1=e.catch(5),$e.push("FCM blocked or not allowed: ".concat(JSON.stringify(e.t1)));case 37:r.onMessage(function(){}),r.onTokenRefresh(t(o().mark(function e(){var t;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Le();case 3:t=e.sent,n(t,!0),Je.addPushContact(t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),$e.push("Unable to retrieve refreshed token ".concat(e.t0));case 11:case"end":return e.stop()}},e,null,[[0,8]])})));case 39:case"end":return e.stop()}},e,null,[[5,34],[12,18]])}))).apply(this,arguments)}t(o().mark(function e(){var t,r,n;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Je.getPushConfiguration(window.location.host);case 2:if(t=e.sent,r="true"===localStorage.getItem("_dha__external_push_processed"),!(t&&t.isPushFeatureEnabled&&t.usesExternalPushDomain&&t.externalPushDomain)||r){e.next=8;break}ze(t.externalPushDomain,$e),e.next=18;break;case 8:if(!t||!t.isPushFeatureEnabled||t.usesExternalPushDomain){e.next=18;break}return e.next=11,Ge();case 11:if(n=e.sent,console.log(n),!n.isPermissionGranted){e.next=16;break}return e.next=16,Xe();case 16:return e.next=18,Ke();case 18:case"end":return e.stop()}},e)}))()})()})();