(function(){var __sections__={};(function(){for(var i=0,s=document.getElementById("sections-script").getAttribute("data-sections").split(",");i{this.header.classList.remove("is-active")},400)}}customElements.define("header-wrapper",HeaderWrapper);class StickyHeader extends HeaderWrapper{constructor(){super()}connectedCallback(){super.connectedCallback(),this.headerBounds={},this.currentScrollTop=0,this.preventReveal=!1,this.scrollUpActive=!1,this.onScrollHandler=this.onScroll.bind(this),this.hideHeaderOnScrollUp=()=>this.preventReveal=!0,window.addEventListener("scroll",this.onScrollHandler,!1),this.addEventListener("preventHeaderReveal",this.hideHeaderOnScrollUp),this.createObserver()}disconnectedCallback(){super.connectedCallback(),this.removeEventListener("preventHeaderReveal",this.hideHeaderOnScrollUp),window.removeEventListener("scroll",this.onScrollHandler)}createObserver(){new IntersectionObserver((entries,observer2)=>{if(this.headerBounds=entries[0].intersectionRect,this.headerBounds.top===0&&this.headerBounds.bottom===0){const scrollTop=window.pageYOffset||document.documentElement.scrollTop,boundingClientRect=entries[0].boundingClientRect;this.headerBounds={top:scrollTop+boundingClientRect.top,bottom:scrollTop+boundingClientRect.bottom}}this.dataset.scrollUp!==void 0&&(this.scrollUpActive=!0),observer2.disconnect()}).observe(this.header)}onScroll(){const scrollTop=window.pageYOffset||document.documentElement.scrollTop;if(theme.config.mqlSmall||this.scrollUpActive)scrollTop>this.currentScrollTop&&scrollTop>this.headerBounds.bottom?requestAnimationFrame(this.hide.bind(this)):scrollTopthis.headerBounds.bottom?this.preventReveal?(window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(()=>{this.preventReveal=!1},66),requestAnimationFrame(this.hide.bind(this))):requestAnimationFrame(this.reveal.bind(this)):scrollTop<=this.headerBounds.top&&requestAnimationFrame(this.reset.bind(this));else if(scrollTop>this.headerBounds.bottom){if(this.sticky())return;requestAnimationFrame(this.hide.bind(this)),setTimeout(()=>{requestAnimationFrame(this.reveal.bind(this))},300)}else scrollTop<=this.headerBounds.top&&requestAnimationFrame(this.reset.bind(this));this.currentScrollTop=scrollTop}hide(){this.header.classList.add("shopify-section-header-hidden","shopify-section-header-sticky"),document.body.classList.add("shopify-body-section-header-hidden","shopify-body-section-header-sticky")}reveal(){this.header.classList.add("shopify-section-header-sticky","animate"),this.header.classList.remove("shopify-section-header-hidden"),document.body.classList.add("shopify-body-section-header-sticky"),document.body.classList.remove("shopify-body-section-header-hidden")}reset(){this.header.classList.remove("shopify-section-header-hidden","shopify-section-header-sticky","animate")}sticky(){return this.header.classList.contains("shopify-section-header-sticky")&&!this.header.classList.contains("shopify-section-header-hidden")&&document.body.classList.contains("shopify-body-section-header-sticky")&&!document.body.classList.contains("shopify-body-section-header-hidden")}}customElements.define("sticky-header",StickyHeader)}catch(e){console.error(e)}}()})(); //# sourceMappingURL=/cdn/shop/t/106/compiled_assets/scripts.js.map?6016=