1const scrollToTopWrp=document.querySelector(".scroll-to-top"),scrollToTopBtn=scrollToTopWrp?.querySelector(".scrollToTop");let scrollAnimation=null,wheelHandler=null;function showScrollToTop(){document.body.scrollTop>window.innerHeight/2||document.documentElement.scrollTop>window.innerHeight/2?scrollToTopWrp?.classList.add("active"):scrollToTopWrp?.classList.remove("active")}const scrollHandler=()=>{showScrollToTop()};scrollToTopWrp&&window.addEventListener("scroll",scrollHandler);function scrollToTop(){let position=document.body.scrollTop||document.documentElement.scrollTop;scrollAnimation&&(clearTimeout(scrollAnimation),scrollAnimation=null),wheelHandler&&(window.removeEventListener("wheel",wheelHandler),wheelHandler=null),position?(window.scrollBy(0,-Math.max(1,Math.floor(position/10))),scrollAnimation=setTimeout(scrollToTop,30),wheelHandler=()=>{scrollAnimation&&(clearTimeout(scrollAnimation),scrollAnimation=null),window.removeEventListener("wheel",wheelHandler),wheelHandler=null},window.addEventListener("wheel",wheelHandler)):(scrollAnimation&&(clearTimeout(scrollAnimation),scrollAnimation=null),wheelHandler&&(window.removeEventListener("wheel",wheelHandler),wheelHandler=null))}scrollToTopBtn&&scrollToTopBtn.addEventListener("click",()=>{scrollToTop()}),window.cleanupScrollToTop=function(){scrollAnimation&&(clearTimeout(scrollAnimation),scrollAnimation=null),wheelHandler&&(window.removeEventListener("wheel",wheelHandler),wheelHandler=null),window.removeEventListener("scroll",scrollHandler)}; 2//# sourceMappingURL=/cdn/shop/t/4/assets/scroll-to-top.js.map?v=48485886766554217551773661981
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.