if(!customElements.get("content-popup")){class ContentPopup extends ModalDialog{constructor(){super(),this.setOverflowHidden=this.dataset.overflowHidden=="true",this.storageKey=this.dataset.key,this.delay=+this.dataset.delay||0,JSON.parse(localStorage.getItem(this.storageKey))!=!0&&JSON.parse(sessionStorage.getItem(this.storageKey))!=!0&&(this.currentScroll=0,this.setCurrentScroll(),this.permanentCloseInput=this.querySelector(".content-popup__checkbox--input"),this.permanentCloseInput&&(this.permanentClosed=this.permanentCloseInput.checked||!1,this.permanentCloseInput.addEventListener("change",this.onPermanentCloseChange.bind(this))),this.currentScroll>=this.dataset.scrollPercentage?this.showPopup():window.addEventListener("scroll",this.onScroll.bind(this)))}showPopup(){window.removeEventListener("scroll",this.onScroll.bind(this)),JSON.parse(localStorage.getItem(this.storageKey))!=!0&&JSON.parse(sessionStorage.getItem(this.storageKey))!=!0&&setTimeout(()=>{this.show(void 0),localStorage.setItem(this.storageKey,!1),sessionStorage.setItem(this.storageKey,!1)},this.dataset.delay)}onPermanentCloseChange(event){this.permanentClosed=event.target.checked}hide(){Shopify.designMode||(this.permanentClosed?localStorage.setItem(this.storageKey,!0):sessionStorage.setItem(this.storageKey,!0)),super.hide()}setCurrentScroll(){this.currentScroll=window.scrollY||window.pageYOffset||document.body.scrollTop+(document.documentElement&&document.documentElement.scrollTop||0)}onScroll(){const documentHeight=document.documentElement.scrollHeight;this.setCurrentScroll(),this.currentScroll/(documentHeight-window.innerHeight)>=this.dataset.scrollPercentage&&this.showPopup()}}customElements.define("content-popup",ContentPopup);class NewsletterPopup extends ContentPopup{constructor(){super(),this.dataset.customerSubscribed=="true"&&!this.querySelector(".newsletter-form__message--success")&&setTimeout(()=>{super.hide()},this.delay+1),this.suscribeButton=this.querySelector("[data-newsletter-button]"),this.suscribeButton&&this.suscribeButton.addEventListener("click",this.onSubscribeClick.bind(this))}onSubscribeClick(){sessionStorage.setItem(this.storageKey,!0),localStorage.setItem(this.storageKey,!0),setTimeout(()=>{super.hide();const href=this.suscribeButton.getAttribute("href");href&&(window.location.href=href)},this.delay+1)}}customElements.define("newsletter-popup",NewsletterPopup)} //# sourceMappingURL=/cdn/shop/t/365/assets/component-content-popup.js.map?v=26920357620703570551753250039