https://www.paperplane.shop/cdn/shop/t/1106/assets/product-slider.js?v=61222643677456991301790351888
1(()=>{if(customElements.get("product-slider"))return;class ProductSlider extends HTMLElement{constructor(){super(),this.slider=null,this.thumbs=null,this.sliderOptions={},this.thumbsOptions={},this.header=document.querySelector(".header-group"),this.triggers=this.querySelectorAll(".product-info__thumbs .product-info__image"),this.big=this.querySelectorAll(".product-info__image--big")}connectedCallback(){this.initSlider(),this.scrollSpy(),this.scrNav(),window.addEventListener("scroll",this.scrNav.bind(this))}initSlider(){this.querySelector("[data-slider]")&&(this.sliderOptions={slidesPerView:1,pagination:{el:".product-info__slider-pagination",clickable:!0}},this.slider=new Swiper(this.querySelector("[data-slider]"),this.sliderOptions),this.slider.on("sliderMove",()=>{this.handleImageLoading()}),this.querySelector("[data-thumbs]")&&(this.thumbsOptions={direction:"vertical",slidesPerView:4,spaceBetween:20,slideToClickedSlide:!0,freeMode:!0,navigation:{nextEl:".swiper-thumbs-button-next",prevEl:".swiper-thumbs-button-prev"}},this.thumbs=new Swiper(this.querySelector("[data-thumbs]"),this.thumbsOptions),this.thumbs.controller.control=this.slider,this.slider.controller.control=this.thumbs))}handleImageLoading(){let galleryImages=this.querySelectorAll("img.mobile-image.hidden");window.innerWidth>=990&&(galleryImages=this.querySelectorAll("img.desktop-image.hidden")),galleryImages.forEach(image=>{image.classList.remove("hidden"),image.removeAttribute("loading")})}scrollSpy(){this.triggers.forEach(link=>{link.addEventListener("click",event=>{event.preventDefault();const targetOffset=document.querySelector(`#${link.dataset.target}`).getBoundingClientRect().top+window.pageYOffset-50,currentPosition=window.pageYOffset,distance=targetOffset-currentPosition,duration=600;let startTime=null;function step(timestamp){startTime||(startTime=timestamp);const progress=timestamp-startTime,percentage=Math.min(progress/duration,1);window.scrollTo(0,currentPosition+distance*percentage),progress<duration&&window.requestAnimationFrame(step)}window.requestAnimationFrame(step),link.debouncedOnClick=debounce(event2=>{this.triggers.forEach(function(item){item.classList.remove("active")}),link.classList.add("active")},600),link.debouncedOnClick()})})}toggleActiveClass(trigger){this.triggers.forEach(thumb=>{thumb.classList.remove("active")}),trigger.classList.add("active");const target=trigger.dataset.target,bigImage=document.querySelector(`#${target}`);bigImage&&bigImage.scrollIntoView({behavior:"smooth"})}scrNav(){const headerHeight=`${this.header.offsetHeight}px`;document.documentElement.style.setProperty("--header-height",headerHeight);const scrollTop=window.scrollY;this.big.forEach(section=>{const id=section.getAttribute("id"),offset=section.offsetTop-1,height=section.clientHeight;if(scrollTop>=offset&&scrollTop<offset+height){this.triggers.forEach(link=>{link.classList.remove("active")});const imageSelector=document.querySelector('[data-target="'+id+'"]');if(imageSelector!=null){const slide=imageSelector.closest(".swiper-slide");if(slide!=null&&slide.hasAttribute("aria-label")){const slideIndex=Number(slide.getAttribute("aria-label").split(" / ")[0]);imageSelector.classList.add("active"),slideIndex!=null&&this.thumbs.slideTo(slideIndex-1)}}}})}}customElements.define("product-slider",ProductSlider)})(); 2//# sourceMappingURL=/cdn/shop/t/1106/assets/product-slider.js.map?v=61222643677456991301790351888
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.