customElements.get("mobile-dock")||customElements.define("mobile-dock",class extends HTMLElement{constructor(){super(),Shopify.designMode?this.init():new theme.initWhenVisible(theme.utils.throttle(this.init.bind(this)))}get section(){return this._section=this._section||this.closest(".mobile-dock-section")}init(){this.initialized||(this.initialized=!0,this.setAttribute("loaded",""),this.detectForHeader(),this.detectForFooter(),setTimeout(this.setHeight.bind(this)),document.addEventListener("matchSmall",this.setHeight.bind(this)),Shopify.designMode&&(this.section.addEventListener("shopify:section:select",()=>{this.section.classList.add("shopify-active")}),this.section.addEventListener("shopify:section:deselect",()=>{this.section.classList.remove("shopify-active")})))}detectForHeader(){const header=document.querySelector(".header-section");if(header===null){this.section.classList.add("active");return}header.classList.contains("header-sticky")||(this.scrollY=parseInt(header.getBoundingClientRect().bottom),window.addEventListener("scroll",theme.utils.throttle(this.onScrollForHeader.bind(this)),!1))}onScrollForHeader(){window.scrollY>=this.scrollY?this.section.classList.add("active"):this.section.classList.remove("active")}detectForFooter(){document.querySelector(".footer-copyright")!==null&&window.addEventListener("scroll",theme.utils.throttle(this.onScrollForFooter.bind(this)),!1)}onScrollForFooter(){if(!theme.config.mqlSmall)return;const scrolledTo=window.scrollY+window.innerHeight,threshold=this.offsetHeight,isReachBottom=document.body.scrollHeight-threshold<=scrolledTo;this.classList.toggle("active",isReachBottom)}setHeight(){document.documentElement.style.setProperty("--mobile-dock-height",`${this.offsetHeight}px`)}}); //# sourceMappingURL=/cdn/shop/t/3/assets/mobile-dock.js.map?v=58337412862330386231750874410