1function debounce(fn,wait=300){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}if(!customElements.get("faq-header")){const FaqHeader=class extends HTMLElement{connectedCallback(){this.classNames={questionContainerInactive:"faq-search-item-inactive",sectionWithIndexStatus:"section-faq-header--with-index"},this.searchInput=this.querySelector(".faq-search__input"),this.searchInput&&(this.searchInput.addEventListener("change",this.performSearch.bind(this)),this.searchInput.addEventListener("keyup",this.performSearch.bind(this)),this.searchInput.addEventListener("paste",this.performSearch.bind(this))),this.debouncedBuildIndex=debounce(this.buildIndex.bind(this),50),document.addEventListener("theme:faq-header-update",this.debouncedBuildIndex),this.debouncedBuildIndex(),this.querySelector(".faq-index")&&(this.addEventListener("click",FaqHeader.handleIndexClick.bind(this)),this.closest(".section-faq-header").classList.add(this.classNames.sectionWithIndexStatus),this.resizeIndex.call(this),this.debouncedResizeIndex=debounce(this.resizeIndex.bind(this),250),window.addEventListener("resize",this.debouncedResizeIndex))}disconnectedCallback(){document.removeEventListener("theme:faq-header-update",this.debouncedBuildIndex),window.removeEventListener("resize",this.debouncedResizeIndex)}buildIndex(){const faqHeaderSection=this.closest(".section-faq-header"),indexContainer=this.querySelector(".faq-index__item-container");indexContainer&&indexContainer.querySelectorAll(".faq-index-item").forEach(el=>{el.parentNode.removeChild(el)}),this.linkedCollapsibleTabs=[],this.linkedQuestionContainers=[],this.linkedContent=[];let currentElement=faqHeaderSection;for(;currentElement.nextElementSibling&¤tElement.nextElementSibling.classList.contains("section-collapsible-tabs");)if(currentElement=currentElement.nextElementSibling,this.linkedCollapsibleTabs.push(currentElement),currentElement.querySelectorAll(".collapsible-tabs__tab").forEach(el=>this.linkedQuestionContainers.push(el)),currentElement.querySelectorAll(".collapsible-tabs__content").forEach(el=>this.linkedContent.push(el)),indexContainer){const currentElementHeading=currentElement.querySelector(".collapsible-tabs__heading");if(currentElementHeading){const htmlFragment=document.createRange().createContextualFragment(` 2 <div class="faq-index-item"> 3 <a class="faq-index-item__link"></a> 4 </div>`),link=htmlFragment.querySelector(".faq-index-item__link");link.href=`#${currentElementHeading.id}`,link.innerHTML=currentElementHeading.innerHTML,indexContainer.appendChild(htmlFragment)}}indexContainer&&this.resizeIndex.call(this)}resizeIndex(){const stickyContainer=this.querySelector(".faq-index__sticky-container");let currentElement=this.closest(".section-faq-header");for(;currentElement.nextElementSibling&¤tElement.nextElementSibling.classList.contains("section-collapsible-tabs");)currentElement=currentElement.nextElementSibling;const stickyContainerRect=stickyContainer.getBoundingClientRect(),currentElementRect=currentElement.getBoundingClientRect();stickyContainer.style.height=`${currentElementRect.bottom-stickyContainerRect.top}px`}performSearch(){setTimeout(()=>{const splitValue=this.searchInput.value.split(" "),terms=[];splitValue.forEach(t=>{t.length>0&&terms.push(t.toLowerCase())}),this.linkedQuestionContainers.forEach(el=>{if(terms.length){let termFound=!1;const matchContent=el.textContent.toLowerCase();terms.forEach(term=>{matchContent.indexOf(term)>=0&&(termFound=!0)}),termFound?el.classList.remove(this.classNames.questionContainerInactive):el.classList.add(this.classNames.questionContainerInactive)}else el.classList.remove(this.classNames.questionContainerInactive)}),this.linkedContent.forEach(el=>{terms.length?el.classList.add(this.classNames.questionContainerInactive):el.classList.remove(this.classNames.questionContainerInactive)})},10)}static handleIndexClick(evt){if(evt.target.classList.contains("faq-index-item__link")){evt.preventDefault();const id=evt.target.href.split("#")[1];let scrollTargetY=document.getElementById(id).getBoundingClientRect().top+window.pageYOffset-50;const stickyHeight=getComputedStyle(document.documentElement).getPropertyValue("--theme-sticky-header-height");stickyHeight&&(scrollTargetY-=parseInt(stickyHeight,10)),window.scrollTo({top:scrollTargetY,behavior:"smooth"})}}};window.customElements.define("faq-header",FaqHeader)} 5//# sourceMappingURL=/cdn/shop/t/28/assets/faq-header.js.map?v=50543771854149867501738753049
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.