1const{getElement}=window.BAO.Utils;export class HeaderScroll extends window.BAO.CustomElement(){constructor(){super(),this.isTicking=!1,this.lastKnownY=window.scrollY,this.offsetTrackedY=0,this.scrollOffset=100,this.safeZone=50,this.scrollDirection="",this.setupListeners(),this.requestTick=this.requestTick.bind(this),this.updateEl=this.updateEl.bind(this),this.updateEl()}setupListeners(){this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll,{passive:!0})}onScroll(){const previouslyKnown=this.lastKnownY,previousDirection=this.scrollDirection;this.lastKnownY=window.scrollY,this.scrollDirection=previouslyKnown<this.lastKnownY?"down":"up",previousDirection!==this.scrollDirection&&(this.offsetTrackedY=this.lastKnownY),this.requestTick()}requestTick(){this.isTicking||requestAnimationFrame(this.updateEl),this.isTicking=!0}updateEl(){this.isTicking=!1,this.setSize(),this.setVisibility()}setSize(){this.bodyContainer.classList.toggle("hd-Header-small",this.headerIsSmaller)}setVisibility(){this.bodyContainer.classList.toggle("hd-Header-hidden",!this.shouldBeVisible)}get shouldBeVisible(){if(this.lastKnownY<=this.offsetHeight+this.safeZone*2)return!0;if(this.scrollDirection==="down")return!this.isOverOffset;if(this.scrollDirection==="up")return this.isOverOffset}get isOverOffset(){if(this.scrollDirection==="down")return this.lastKnownY>=this.offsetTrackedY+this.scrollOffset;if(this.scrollDirection==="up")return this.lastKnownY<=this.offsetTrackedY-this.scrollOffset}get headerIsSmaller(){return this.lastKnownY>this.safeZone}get bodyContainer(){return getElement("body")}}customElements.define("header-scroll",HeaderScroll); 2//# sourceMappingURL=/cdn/shop/t/291/assets/header.js.map?v=131403488239819481051761906981
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.