1if(!customElements.get("sticky-scroll")){class StickyScroll extends HTMLElement{constructor(){super(),this.lastScrollY=window.scrollY,this.currentTop=0,this.boundInit=this.init.bind(this),this.boundOnScroll=this.onScroll.bind(this),this.init()}connectedCallback(){window.addEventListener("on:debounced-resize",this.boundInit)}disconnectedCallback(){window.removeEventListener("on:debounced-resize",this.boundInit),window.removeEventListener("scroll",this.boundOnScroll)}init(){const computedStyle=getComputedStyle(this);computedStyle.position==="sticky"&&!this.attached?(this.initialOffset=parseInt(computedStyle.top,10)||0,window.addEventListener("scroll",this.boundOnScroll,{passive:!0}),this.attached=!0):computedStyle.position!=="sticky"&&this.attached&&(this.style.top="",window.removeEventListener("scroll",this.boundOnScroll),this.attached=!1)}onScroll(){this.waitingToUpdate||(window.requestAnimationFrame(()=>{this.updatePosition(),this.waitingToUpdate=!1}),this.waitingToUpdate=!0)}updatePosition(){const scrollDelta=window.scrollY-this.lastScrollY,viewportHeight=window.innerHeight,elementHeight=this.offsetHeight;if(elementHeight<=viewportHeight){this.style.top="",this.lastScrollY=window.scrollY;return}const minTop=viewportHeight-elementHeight,maxTop=this.initialOffset;this.currentTop-=scrollDelta,this.currentTop=Math.max(minTop,Math.min(maxTop,this.currentTop)),this.style.top=`${this.currentTop}px`,this.lastScrollY=window.scrollY}}customElements.define("sticky-scroll",StickyScroll)} 2//# sourceMappingURL=/cdn/shop/t/31/assets/sticky-scroll.js.map?v=131975390874986687661790942109
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.