1import{Component}from"@theme/component";class TabbedMedia extends Component{constructor(){super(),this.currentTab=null}connectedCallback(){if(this.refs={},this.querySelectorAll("[ref]").forEach(el=>{const name=el.getAttribute("ref");this.refs[name]?(Array.isArray(this.refs[name])||(this.refs[name]=[this.refs[name]]),this.refs[name].push(el)):this.refs[name]=el}),this.tabs=[...this.querySelectorAll('[ref="tab"]')],this.refs.media){this.swiper=void 0;const matchMedia=window.matchMedia("(max-width: 1280px)");window.addEventListener("DOMContentLoaded",()=>{this.handleSwiper(matchMedia),matchMedia.addEventListener("change",()=>this.handleSwiper(matchMedia)),this.getAttribute("data-cycle")=="true"&&(this.currentTab=this.querySelector('[ref="tab"].active'),this.currentTab&&setInterval(()=>{let nextTab=this.tabs[this.tabs.indexOf(this.currentTab)+1];(!nextTab||!nextTab.hasAttribute("ref"))&&(nextTab=this.tabs[0]),this.handleOpen({target:nextTab}),this.currentTab=nextTab},8e3))})}window.addEventListener("hashchange",()=>{const hash=window.location.hash.substring(1),tab=this.querySelector(`[id="${hash}"]`);tab&&tab.click()})}handleOpen({event,target}){const tabs=this.querySelectorAll('[ref="tab"]'),content=this.querySelectorAll('[ref^="content"]'),media=this.querySelectorAll('[ref^="media"]');let thingsToTab=[];content.length>0?thingsToTab=content:media&&(thingsToTab=media);const clickTarget=event?event.target:target;
1tabs.forEach((tab,index)=>{if(tab.classList.contains("active")){if(tab==clickTarget)return;tab.classList.remove("active"),thingsToTab[index]&&(thingsToTab[index].classList.remove("active"),thingsToTab[index].classList.remove("tw-fade-in"),thingsToTab[index].classList.add("tw-fade-out"),thingsToTab==content&&(thingsToTab[index].classList.remove("h-[auto]"),thingsToTab[index].classList.add("h-[0px]")))}else tab==clickTarget&&(tab.classList.add("active"),this.currentTab=tab,thingsToTab[index]&&(thingsToTab[index].classList.add("active"),thingsToTab[index].classList.remove("tw-fade-out"),thingsToTab[index].classList.add("tw-fade-in"),thingsToTab[index].classList.remove("h-[0px]"),thingsToTab[index].classList.add("h-[auto]")),this.swiper&&this.swiper.slideTo(index))})}handleSwiper(matchMedia){matchMedia.matches?document.querySelectorAll('[id^="tabbed-media-"]').forEach(container=>{const swiperElement=container.querySelector(".tw-carousel-tabs");if(!swiperElement)return;const swiper=new Swiper(swiperElement,{slidesPerView:1.5,spaceBetween:24,navigation:{nextEl:container.querySelector(".swiper-buttons .swiper-button-next"),prevEl:container.querySelector(".swiper-buttons .swiper-button-prev")},pagination:{el:container.querySelector(".swiper-pagination"),clickable:!0,type:"progressbar"},on:{slideChange:swiper2=>{this.currentTab=this.tabs[swiper2.activeIndex],this.handleOpen({target:this.tabs[swiper2.activeIndex]})}}});swiper.init(),this.swiper=swiper}):this.swiper&&this.swiper.destroy()}}customElements.get("tabbed-media")||customElements.define("tabbed-media",TabbedMedia); 2//# sourceMappingURL=/cdn/shop/t/9/assets/tw-tabbed-media.js.map?v=68653131779847409091770652290
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.