1class MainHomepage extends HTMLElement{constructor(){super(),this.swiper=null,this.headerWrapper=null,this.desktopBreakpoint=990,this.isDesktop=window.innerWidth>=this.desktopBreakpoint,this.originalSlides=[],this.handleResize=this.handleResize.bind(this),this.mouseSensitivity=this.dataset.mouseSensitivity,this.freeShippingObserver=null}connectedCallback(){if(this.observeFreeShippingBanner(),typeof Swiper<"u"){if(this.originalSlides=Array.from(this.querySelectorAll(".swiper-slide")),this.filterSlidesByBreakpoint(),this.initializeSwiper(),window.addEventListener("resize",this.handleResize),window.location.href.indexOf("ContactFooter")>-1){const lastSlideIndex=this.swiper.slides.length-1;this.swiper.slideTo(lastSlideIndex,1e3)}}else console.error("Swiper library not loaded.")}observeFreeShippingBanner(){const target=document.body;if(target){if(document.getElementById("FreeShippingBanner")){this.onFreeShippingBannerInjected();return}this.freeShippingObserver=new MutationObserver(mutations=>{for(const mutation of mutations)for(const node of mutation.addedNodes)if(node.id==="FreeShippingBanner"){this.onFreeShippingBannerInjected();return}}),this.freeShippingObserver.observe(target,{childList:!0,subtree:!0})}}onFreeShippingBannerInjected(){const stickyHeader=document.querySelector("sticky-header"),freeShippingBanner=document.getElementById("FreeShippingBanner");stickyHeader&&freeShippingBanner&&(console.log("FreeShippingBanner detected",{freeShippingBanner,stickyHeader}),stickyHeader.insertBefore(freeShippingBanner,stickyHeader.firstChild),this.freeShippingObserver&&(this.freeShippingObserver.disconnect(),this.freeShippingObserver=null))}handleResize(){const currentIsDesktop=window.innerWidth>=this.desktopBreakpoint;currentIsDesktop!==this.isDesktop&&(this.isDesktop=currentIsDesktop,this.destroySwiper(),this.reinsertAllSlides(),this.filterSlidesByBreakpoint(),this.initializeSwiper())}reinsertAllSlides(){const swiperWrapper=this.querySelector(".swiper-wrapper");swiperWrapper&&(swiperWrapper.innerHTML="",this.originalSlides.forEach(sli
1de=>{swiperWrapper.appendChild(slide)}))}filterSlidesByBreakpoint(){const isDesktop=window.innerWidth>=this.desktopBreakpoint;this.querySelectorAll(".swiper-slide").forEach(slide=>{const firstChild=slide.querySelector(":scope > :first-child");if(!firstChild)return;const shouldHideDesktop=firstChild.hasAttribute("data-slide-hide-desktop")&&firstChild.getAttribute("data-slide-hide-desktop")==="true",shouldHideMobile=firstChild.hasAttribute("data-slide-hide-mobile")&&firstChild.getAttribute("data-slide-hide-mobile")==="true";(isDesktop&&shouldHideDesktop||!isDesktop&&shouldHideMobile)&&slide.remove()})}initializeSwiper(){const swiperContainer=this.querySelector(".swiper");if(this.headerWrapper=document.querySelector(".header-wrapper"),!swiperContainer){console.error("Swiper container not found inside <main-homepage>");return}this.swiper=new Swiper(swiperContainer,{direction:"vertical",grabCursor:!0,speed:400,mousewheel:{enabled:!0,releaseOnEdges:!0,thresholdDelta:this.mouseSensitivity},keyboard:{enabled:!0},effect:"creative",creativeEffect:{prev:{shadow:!0,translate:[0,"0%",-1],opacity:0},next:{translate:[0,"100%",0],opacity:1}}}),this.swiper.on("slideChange",()=>{const activeSlide=this.swiper.slides[this.swiper.activeIndex];let headerStyle="light";const contentBlock=activeSlide.querySelector("[data-header-style]");contentBlock&&(headerStyle=contentBlock.getAttribute("data-header-style")),this.headerWrapper.classList.remove("header-style-light","header-style-dark","header-style-default"),this.headerWrapper.classList.add(`header-style-${headerStyle}`)}),setTimeout(()=>{this.swiper.emit("slideChange")},0)}destroySwiper(){this.swiper&&(this.swiper.destroy(!0,!0),this.swiper=null)}disconnectedCallback(){this.destroySwiper(),window.removeEventListener("resize",this.handleResize),this.headerWrapper=null}}customElements.define("main-homepage",MainHomepage); 2//# sourceMappingURL=/cdn/shop/t/106/assets/main-homepage.js.map?v=127133917277236034421765293142
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.