1function ulHeight(container,rM){theme.ulHeight=container.querySelector(".main-menu .customer-links").offsetHeight,rM.style.maxHeight=theme.height-theme.ulHeight-40+"px"}function MenuHeight(container){var hdr=document.getElementById("header-toolbar"),stky=hdr.getAttribute("data-sticky");stky=="true"?document.selectors={sht:hdr.offsetHeight}:document.selectors={sht:0},document.querySelector("html").style.scrollPaddingTop=document.selectors.sht+"px";const iH=theme.height,sNH=container.querySelector(".sticky-navigation-container").offsetHeight;var cD=document.querySelector("#cart-dropdown span"),rM=container.querySelector(".responsiveMenu");if(cD){var cDl=document.querySelector("#cart-dropdown .buttons").offsetHeight;theme.width<=theme.breakpoint_margin?cD.style.maxHeight=iH-sNH-cDl-30+"px":cD.style.maxHeight=(iH-sNH-cDl)/2+"px"}if(theme.mobile==!1){var pLu=rM.querySelectorAll(".parent-level-ul");pLu.forEach(function(p){p&&p.style.setProperty("--max-height",iH-parseInt(document.selectors.sht)-40+"px")})}}theme.Header=(function(){function Header(container){var sectionId=container.getAttribute("data-section-id"),dD=container.getAttribute("data-dropdown"),t=container.querySelector(".toggleMenu"),r=container.querySelector(".responsiveMenu"),sN=container.querySelector(".sticky-navigation"),sNB=sN.getAttribute("data-border"),hNW=document.getElementById("header-navigation-width"),cCM=document.getElementById("cart-count-mobile"),cCMa=cCM.querySelector(".cart-count-mobile"),cCMb=container.querySelector("#cart-dropdown .modal-close"),m=container.getAttribute("data-multi"),pS=JSON.parse(document.getElementById("shopify-features").textContent),iH=theme.height,mmCL=container.querySelector(".main-menu .customer-links"),k=container.querySelectorAll(".header-customerbar .customer-links .keydown");function menuWidth(){const pL=document.querySelectorAll(".visually-hidden .visually-hidden-links");theme.nW=0,pL.forEach(function(p){theme.nW+=p.offsetWidth+5})}dD=="true"?theme.dropdown=!0:theme.dropdown=!1,theme.cart=!1;function menuAdjust(){var iW=theme.width,nW=theme.nW,mMW=theme.breakpoint_margin,tW=container.querySelector("#header-navigation .header-navigation-measure").offsetWidth-parseInt(container.getAttribute("data-logo-width"));nW>tW?theme.updateNav=!0:theme.updateNav=!1;var tM=document.querySelector(".toggleMenu"),rM=document.querySelector(".responsiveMenu"),cD=document.getElementById("cart-dropdown"),cCM2=document.getElementById("cart-count-mobile"),cCD=document.getElementById("cart-count-desktop"),rMl=rM.querySelectorAll("li");if(iW<=mMW?cD&&cCM2.appendChild(cD):cD&&cCD.appendChild(cD),iW<=mMW||theme.updateNav||theme.detectmob){tM.classList.remove("isDesktop"),tM.classList.add("isMobile"),rM.classList.remove("isDesktop"),rM.classList.add("isMobile");var pLu=rM.querySelectorAll(".parent-level-ul");pLu.forEach(function(p){p.removeAttribute("style"),p.querySelector("a.child")&&(p.querySelector("a.child").setAttribute("aria-popup","true"),p.querySelector("a.child").setAttribute("aria-expanded","false"))}),rMl.forEach(function(r2){r2.onmouseenter=function(ev){return!1},r2.onmouseleave=function(ev){return!1},r2.classList.remove("isDesktop"),r2.classList.add("isMobile")});var rMp=rM.querySelectorAll("li.has-dropdown a.parent");rMp.forEach(function(r2){r2.onclick=function(ev){var pE=r2.parentElement,pEuL=pE.querySelector("ul");if(!(r2.getAttribute("href")!="undefined"&&r2.getAttribute("href")!="#"&&ev.target.matches("span"))){if(ev.preventDefault(),pEuL.style.setProperty("--max-height",pEuL.scrollHeight+"px"),pE.classList.contains("child-level")){var h=pE.closest(".parent-level-ul").scrollHeight;pE.closest(".parent-level-ul").style.setProperty("--max-height",pEuL.scrollHeight+h+"px")}pE.classList.toggle("hover"),r2.setAttribute("aria-expanded",r2.getAttribute("aria-expanded")==="true"?"false":"true")}}}),document.body.classList.remove("desktop-only"),document.body.classList.add("mobile-only"),theme.mobile=!0}else if(iW>mMW){let open3=function(r2){var rMh=rM.querySelectorAll("li.hover");rMh.forEach(function(r3){r3.classList.remove("hover"),r3.querySelector("a.parent").setAttribute("aria-expanded","fal
1se")}),clearTimeout(hoverTimeout),r2.classList.add("hover"),r2.querySelector("a.parent").setAttribute("aria-expanded","true")},close3=function(r2){hoverTimeout=setTimeout(function(){r2.classList.remove("hover"),r2.querySelector("a.parent").setAttribute("aria-expanded","false")},250)};var open2=open3,close2=close3,hoverTimeout;tM.classList.remove("isMobile"),tM.classList.add("isDesktop"),rM.classList.remove("isMobile"),rM.classList.add("isDesktop");var pLu=rM.querySelectorAll(".parent-level-ul");pLu.forEach(function(p){p.querySelector("a.child")&&(p.querySelector("a.child").removeAttribute("aria-popup"),p.querySelector("a.child").removeAttribute("aria-expanded"))}),rMl.forEach(function(r2){r2.classList.remove("hover","isMobile"),r2.classList.add("isDesktop")});var rMp=rM.querySelectorAll("li.parent");rMp.forEach(function(r2){r2.addEventListener("keydown",function(ev){r2.classList.add("focused")}),r2.querySelector("a.parent").onblur=function(ev){r2.classList.remove("focused")},r2.querySelector("a.parent").onclick=function(ev){r2.classList.contains("focused")&&ev.preventDefault(),r2.classList.contains("hover")?close3(r2):open3(r2)},r2.onmouseenter=function(ev){open3(r2)},r2.onmouseleave=function(ev){close3(r2)}}),document.body.classList.remove("mobile-only"),document.body.classList.add("desktop-only"),theme.mobile=!1}}if(location.pathname=="/challenge")window.location.hash="",window.scrollTo(0,0);else if(window.location.hash)setTimeout(function(){var hsh=location.hash,hc=document.querySelector(hsh);if(hc){var s2=hc.getBoundingClientRect().top+window.pageYOffset;window.scrollTo({top:s2-document.selectors.sht,behavior:"smooth"})}},1);else if((window.location.href.indexOf("customer_posted")>-1||window.location.href.indexOf("contact?contact_posted")>-1)&&document.cookie.split("AveForm=popUp").length==1){MenuHeight(container,theme.mobile);var fb=document.querySelector(".feedback");if(!fb)return;var s=fb.getBoundingClientRect().top+window.pageYOffset;window.scrollTo({top:s-document.selectors.sht,behavior:"smooth"})}function menu_open(r2){t.classList.add("active"),document.body.classList.add("modal-active"),r2.classList.add("open"),t.setAttribute("aria-expanded","true"),setTimeout(function(){ulHeight(container,r2),trapFocus(sN)},1),sN.style.height=sN.getBoundingClientRect().height-parseInt(sNB)+"px",document.body.classList.add("no-scroll")}function menu_close(r2){t.classList.remove("active"),document.body.classList.remove("modal-active"),r2.classList.remove("open"),t.setAttribute("aria-expanded","false"),document.body.classList.add("clear-scroll"),removeTrapFocus(sN),document.body.classList.remove("no-scroll"),setTimeout(function(){document.body.classList.remove("clear-scroll")},500)}t.onclick=function(ev){r.classList.contains("open")?menu_close(r):menu_open(r),theme.detectmob&&document.body.classList.remove("cart-open"),cCM.classList.remove("hover"),cCMb&&document.getElementById("cart-dropdown")&&container.querySelector("#cart-dropdown .modal-close").classList.add("hidden")};function open(r2){var l=container.querySelectorAll(".header-customerbar .customer-links li.hover");l.forEach(function(r3){r3.classList.remove("hover"),r3.querySelector(".keydown-link").setAttribute("aria-expanded","false")}),r2.classList.add("hover"),r2.querySelector(".keydown-link").setAttribute("aria-expanded","true")}function close(r2){r2.classList.remove("hover"),r2.querySelector(".keydown-link").setAttribute("aria-expanded","false")}k.forEach(function(r2){r2.addEventListener("keydown",function(ev){r2.classList.add("focused")}),r2.querySelector(".keydown-link").onblur=function(ev){r2.classList.remove("focused")},r2.querySelector(".keydown-link").onclick=function(ev){r2.classList.contains("focused")&&ev.preventDefault(),r2.classList.contains("hover")?close(r2):open(r2)},r2.onmouseenter=function(ev){open(r2)},r2.onmouseleave=function(ev){close(r2)}}),theme.dropdown==!0&&(cCMa.onclick=function(ev){theme.detectmob&&document.body.classList.toggle("cart-open"),cCM.classList.toggle("hover"),cCMb&&document.getElementById("cart-dropdown")&&container.querySelector("#cart-dropdown .modal-close").classList.add("hidden")});function wS(){menuAdjust(),sN.style.height="",r.classList.contains("open")&&menu_close(r)}var cW=window.innerWidth;window.addEventListener("resize",function(){theme.height=window.innerHeight,MenuHeight(container,theme.mobile),cW!=window.innerWidth&&(cW=window.innerWidth,wS())}),menuWidth(),menuAdjust(),MenuHeight(container,theme.mobile),theme.multiHead=m,theme.multiHead=="true"&&Multi();var el=document.querySelector(".search details");if(el&&(el.onclick=function(e){var moR=container.querySelector(".mobile-only .responsiveMenu");if(theme.width<=theme.breakpoint_margin)var dd=document.getElementById("cart-count-mobile");else var dd=document.getElementById("cart-count-desktop");dd.classList.remove("hover"),dd.classList.add("avoid");var ddC=dd.querySelector(".modal-close");ddC&&ddC.classList.add("hidden"),setTimeout(function(){dd.classList.remove("avoid")},1),t.classList.contains("active")&&(t.classList.remove("active"),moR.classList.remove("open"),moR.classList.remove("active"),document.body.classList.remove("no-scroll"),document.body.classList.remove("modal-active"),document.body.style.position="",document.body.style.left="auto",document.body.style.right="auto",document.body.style.top="auto");var li=el.closest("li"),d=li.querySelector("details"),mC=li.querySelector(".search-modal"),hS=li.querySelector(".header-searchbar");sF=hS.querySelector(".search-field");function openSearch(e2){sF.value="",sF.disabled=!1,mC.classList.remove("hidden"),trapFocus(li),sF.focus()}function closeSearch(e2){sF.value="",sF.disabled=!0,d.open=!1,mC.classList.add("hidden"),sF.blur(),removeTrapFocus(li)}mC.onclick=function(e2){closeSearch(e2)},setTimeout(function(){el.hasAttribute("open")?openSearch(e):closeSearch(e)},250)}),container.getAttribute("data-search")=="true"){let debounce2=function(fn,wait){let t2;return(...args)=>{clearTimeout(t2),t2=setTimeout(()=>fn.apply(this,args),wait)}};var debounce=debounce2;class PredictiveSearch extends HTMLElement{constructor(){super(),this.cachedResults={},this.input=this.querySelector('input[type="search"]'),this.predictiveSearchResults=this.querySelector("[data-predictive-search]"),this.animate=this.closest(".animate-section"),this.predictiveSearchResultsTop=this.getBoundingClientRect().top,this.isOpen=!1,this.setupEventListeners()}setupEventListeners(){this.querySelector("form.search").addEventListener("submit",this.onFormSubmit.bind(this)),this.input.addEventListener("input",debounce2(event=>{this.onChange(event)},300).bind(this)),this.input.addEventListener("focus",this.onFocus.bind(this)),this.addEventListener("focusout",this.onFocusOut.bind(this))}getQuery(){return this.input.value.trim()}onChange(){const searchTerm=this.getQuery();if(!searchTerm.length){this.close(!0);return}this.getSearchResults(searchTerm)}onFormSubmit(event){(!this.getQuery().length||this.querySelector('[aria-selected="true"] a'))&&event.preventDefault()}onFocus(){document.querySelector("html").style.scrollPaddingTop=0;const searchTerm=this.getQuery();searchTerm.length&&(this.getAttribute("results")==="true"?this.open():this.getSearchResults(searchTerm))}onFocusOut(){document.querySelector("html").style.scrollPaddingTop=document.selectors.sht+"px",setTimeout(()=>{this.contains(document.activeElement)||this.close()})}getSearchResults(searchTerm){const queryKey=searchTerm.replace(" ","-").toLowerCase();if(this.cachedResults[queryKey]){this.renderSearchResults(this.cachedResults[queryKey]);return}const search_limit=this.predictiveSearchResults.getAttribute("data-search-limit"),search_fields=this.predictiveSearchResults.getAttribute("data-search-fields");
1if(pS.predictiveSearch==!0)var URL=theme.routes_predictive_search_url+"?&q="+encodeURIComponent(searchTerm)+"§ion_id=predictive-search&"+encodeURIComponent("resources[fields]")+"="+search_fields+"&"+encodeURIComponent("resources[limit]")+"="+search_limit;else var URL=theme.routes_search_url+"?&q="+encodeURIComponent(searchTerm)+"§ion_id=predictive-search&options[prefix]=last";fetch(URL).then(response=>{if(!response.ok){var error=new Error(response.status);throw this.close(),error}return response.text()}).then(text=>{const resultsMarkup=new DOMParser().parseFromString(text,"text/html").querySelector("#shopify-section-predictive-search").innerHTML;this.cachedResults[queryKey]=resultsMarkup,this.renderSearchResults(resultsMarkup)}).catch(error=>{throw this.close(),error})}renderSearchResults(resultsMarkup){this.predictiveSearchResults.innerHTML=resultsMarkup;const btn=this.querySelector(".modal-close"),ps=this;btn.addEventListener("keydown",e=>{e.key==="Enter"&&ps.close()}),btn.addEventListener("click",function(ev){ps.close()},!1),this.setAttribute("results",!0),this.setLiveRegionResults(),this.open()}setLiveRegionResults(){this.removeAttribute("loading")}getResultsMaxHeight(){return this.resultsMaxHeight=theme.height-this.getBoundingClientRect().top-80,this.resultsMaxHeight}open(){if(theme.width<=theme.breakpoint_margin)var dd=document.getElementById("cart-count-mobile");else var dd=document.getElementById("cart-count-desktop");dd.classList.remove("hover"),dd.classList.add("avoid");var ddC=dd.querySelector(".modal-close");ddC&&ddC.classList.add("hidden"),setTimeout(function(){dd.classList.remove("avoid")},1);var height=this.resultsMaxHeight||`${this.getResultsMaxHeight()}`;this.predictiveSearchResults.style.setProperty("--max-height",height+"px"),this.setAttribute("open",!0),this.predictiveSearchResults.setAttribute("aria-expanded",!0),this.isOpen=!0,this.querySelector("form.search").classList.add("active"),this.animate&&this.animate.classList.add("filter-loaded")}close(clearSearchTerm=!1){clearSearchTerm&&(this.input.value="",this.removeAttribute("results")),this.querySelector("form.search").classList.remove("open");const selected=this.querySelector('[aria-selected="true"]');if(selected&&selected.setAttribute("aria-selected",!1),this.removeAttribute("open"),this.predictiveSearchResults.setAttribute("aria-expanded",!1),this.resultsMaxHeight=!1,this.querySelector("form.search").classList.remove("active"),this.isOpen=!1,this.animate){var _this=this;setTimeout(function(){_this.animate.classList.remove("filter-loaded")},250)}this.classList.remove("focused"),this.input.removeEventListener("focus",this.onFocus.bind(this)),this.removeEventListener("focusout",this.onFocusOut.bind(this))}}customElements.define("predictive-search",PredictiveSearch)}document.body.classList.remove("loading")}return Header})(); 2//# sourceMappingURL=/cdn/shop/t/37/assets/script.header.js.map?v=42399694332103224781747330696
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.