PageSourceSearch

https://www.chemicalguys.com/cdn/shop/t/5/assets/global.js?v=140267141269545141871790759746

js chemicalguys.com collected 2026-10-01 11:26:10 UTC 51,304 bytes, 2 lines download raw bytes

1(function(){function getDeviceType(){const userAgent=navigator.userAgent.toLowerCase(),isTablet=/ipad|tablet|playbook|silk/.test(userAgent)||navigator.maxTouchPoints>1&&window.screen.width>=768&&window.screen.width<=1024,isMobile=/mobile|iphone|ipod|android/.test(userAgent)&&!isTablet;return isTablet?"tablet":isMobile?"mobile":"desktop"}window.deviceType=getDeviceType()})();function closePredictiveSearch(openElement=null){const desktopSearch=document.querySelector("predictive-search"),mobileSearch=document.querySelector("predictive-search-mobile");[desktopSearch,mobileSearch].filter(el=>el&&el!==openElement).forEach(el=>el.close(!0))}function toggleMinicartPromo(show=!1){const minicartButton=document.querySelector(".minicart-promo");minicartButton&&(show?minicartButton.classList.remove("hidden"):minicartButton.classList.add("hidden"))}function formatCurrency(amount,cents=1){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(amount/cents)}function fancyConsoleLog(...args){const style="font-family:monospace;",style1="color:#6affc2;"+style,style2="color:#ff6ad2;"+style,style3="color:#efa934;"+style;try{let title="",print=args;args&&typeof args[0]=="string"&&(title=args[0].trim(),print=args.slice(1,args.length||0)),print?.length>0?(console.groupCollapsed(`%c{ %c...DEBUG %c${title} %c}`,style3,style2,style1,style3),console.dir(print,{depth:null}),console.groupEnd()):title&&console.log(`%c{ %c...DEBUG %c${title} %c}`,style3,style2,style1,style3)}catch(e){console.error(e)}}(function(){let overlayScrollbarsInstance=null;function initOverlayScrollbars(target,viewport){if(!target.hasAttribute("data-overlayscrollbars-initialize"))return!1;const initialize=()=>overlayScrollbarsInstance?(loadOverlayScrollbars(target,viewport),!0):!1;if(overlayScrollbarsInstance)return initialize();{let retryCount=0;const maxRetries=50,checkOverlayScrollbars=setInterval(()=>{window.OverlayScrollbarsGlobal?(clearInterval(checkOverlayScrollbars),overlayScrollbarsInstance=window.OverlayScrollbarsGlobal,initialize()):(retryCount++,retryCount>=maxRetries&&(clearInterval(checkOverlayScrollbars),console.error("OverlayScrollbarsGlobal failed to load."),target.removeAttribute("data-overlayscrollbars-initialize")))},100)}}function loadOverlayScrollbars(target,viewport){if(!overlayScrollbarsInstance)return!1;const{OverlayScrollbars,ScrollbarsHidingPlugin,SizeObserverPlugin}=overlayScrollbarsInstance;OverlayScrollbars.plugin([ScrollbarsHidingPlugin,SizeObserverPlugin]);const os=OverlayScrollbars({target,elements:{viewport}},{paddingAbsolute:!0,overflow:{x:"scroll",y:"hidden"},scrollbars:{theme:"os-theme-dark",autoHide:"never",dragScroll:!0,autoHideSuspend:!0}});return!0}document.addEventListener("DOMContentLoaded",()=>{const autoInitElements=document.querySelectorAll("[data-overlayscrollbars-element][data-overlayscrollbars-initialize]");autoInitElements&&autoInitElements.forEach(element=>{initOverlayScrollbars(element,null)})}),window.initOverlayScrollbars=initOverlayScrollbars})(),(function(){function initializeTabButtons(html){const tabButtonGroup=html.querySelectorAll(".tab-layout .tab-button-group");tabButtonGroup&&tabButtonGroup.forEach(group=>{const tabButtons=group.querySelectorAll(".tab--button");tabButtons.forEach(button=>{button.addEventListener("click",()=>{const tabContent=html.querySelector(button.dataset.tabContent);tabContent&&(tabButtons.forEach(tab=>{tab.classList.remove("selected"),html.querySelector(tab.dataset.tabContent).classList.add("hidden")}),button.classList.add("selected"),tabContent.classList.remove("hidden"))})})})}window.initializeTabButtons=initializeTabButtons})(),(function(){function initializeScrollToLink(html){const container=html||document;container.querySelectorAll(".smooth-scroll-button").forEach(button=>{if(!button)return;const initialTarget=document.querySelector(button.dataset.scroll_to);if(!initialTarget){button.remove();return}button.classList.remove("hidden"),initialTarget.classList.add("scroll-margin"),button.addEventListener("click",()=>{const scrollToElement=document.querySelector(button.dataset.scroll_to);if(!scrollToElement){button.remove();return}if(scrollToElement.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),scrollToElement?.tagName?.toLowerCase()=="accordion-content"){const accordionButton=scrollToElement.querySelector('.toggle-button[aria-expanded="false"]');accordionButton&&mobileToggleAction(accordionButton,container)}})})}function mobileToggleAction(button,container){const content=container.querySelector(button.getAttribute("aria-controls"))||null;if(!content)return!1;const announcer=content.querySelector("[aria-live]")||null;button.classList.contains("open")?(button.classList.remove("open"),button.setAttribute("aria-expanded",!1),content.style.display="none",announcer&&(announcer.textContent="Section collapsed.")):(button.classList.add("open"),button.setAttribute("aria-expanded",!0),content.style.display="block",announcer&&(announcer.textContent="Section expanded. Use arrow keys to navigate through the content."))}document.addEventListener("DOMContentLoaded",()=>{initializeScrollToLink()}),document.addEventListener("product-info:refreshed",event=>{initializeScrollToLink(event?.target)})})();function isTouchDevice(){try{return navigator?.maxTouchPoints>0||"ontouchstart"in window||window?.matchMedia("(pointer: coarse)")?.matches}catch(e){return console.error(e),!1}}let inMainMenu=!1,hoverTimeout;const minWindowHeight="(min-height: 600px)";let minWindowMatchMedia=window.matchMedia(minWindowHeight);const toggleMainMenu=(element,open)=>{open?(element.setAttribute("aria-expanded",!0),element.closest("details").setAttribute("open",""),element.nextElementSibling.style.opacity=1):(element.setAttribute("aria-expanded",!1),element.closest("details").removeAttribute("open"),element.nextElementSibling.style.opacity=0)},queueHoverMenu=function(element){clearTimeout(hoverTimeout),hoverTimeout=setTimeout(function(){document.body.classList.contains("suggestions-open")||(toggleMainMenu(element,!0),document.querySelector(".mega-menu__overlay").style.display="block",inMainMenu=!0)},200)},nav_header=document.querySelector("nav.header__menu");nav_header&&nav_header.addEventListener("mouseleave",()=>{document.querySelector(".mega-menu__overlay").style.display="none",inMainMenu=!1}),document.querySelectorAll("header-menu").forEach(menu=>{let summary=menu.querySelector("summary");summary.setAttribute("role","button"),summary.setAttribute("aria-expanded",summary.parentNode.hasAttribute("open")),summary.nextElementSibling&&summary.nextElementSibling.getAttribute("id")&&summary.setAttribute("aria-controls",summary.nextElementSibling.id),menu.addEventListener("mouseenter",()=>{minWindowMatchMedia=window.matchMedia(minWindowHeight),minWindowMatchMedia.matches&&(inMainMenu?(clearTimeout(hoverTimeout),toggleMainMenu(summary,!0)):queueHoverMenu(summary))}),menu.addEventListener("mouseleave",()=>{clearTimeout(hoverTimeout),toggleMainMenu(summary,!1)}),menu.addEventListener("keyup",e=>{e.target.tagName==="SUMMARY"&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),toggleMainMenu(summary,!0))}),!summary.closest("header-drawer")&&summary.parentElement.addEventListener("keyup",onKeyUpEscape)}),document.querySelectorAll(".iframe-container").forEach(container=>{var image=container.querySelector(".iframe-image"),iframe=container.querySelector(".iframe-video");container.addEventListener("click",e=>{image.classList.add("d-none"),iframe.classList.remove("d-none"),e.preventDefault()})}),document.querySelectorAll("ul.tabs").forEach(tabs=>{const links=tabs.querySelectorAll("a");links&&activateTabs(links)});function activateTabs(links){links[0].classList.add("active"),links.forEach(function(link){link.classList.contains("active")||document.querySelector("#"+link.getAttribute("id")+"-content").classList.add("d-none"),link.addEventListener("click",()=>{switchTab(links,link)})})}function switchTab(links,element){return element.classList.contains("active")||(links.forEach(function(link){link.classList.remove("active"),document.querySelector("#"+link.getAttribute("id")+"-content").classList.add("d-none")}),element.classList.add("active"),document.querySelector("#"+element.getAttribute("id")+"-content").classList.remove("d-none")),!1}window.onload=function(){const backToTopButton=document.querySelector("#back-to-top");backToTopButton&&(backToTopButton.addEventListener("click",function(e){e.preventDefault(),window.scrollTo({top:0,behavior:"smooth"})}),backToTopDisplay(backToTopButton),backToTopPosition(backToTopButton),window.addEventListener("scroll",function(){backToTopDisplay(backToTopButton),backToTopPosition(backToTopButton)}),window.addEventListener("resize",function(){backToTopDisplay(backToTopButton),backToTopPosition(backToTopButton)}))};const backToTopDisplay=button=>{const scrollPosition=window.scrollY||document.documentElement.scrollTop,pageHeight=document.querySelector("body").offsetHeight;scrollPosition>pageHeight/3&&pageHeight>=window.innerHeight*3?button.classList.add("show"):button.classList.remove("show")},backToTopPosition=button=>{const scrollPosition=window.scrollY||document.documentElement.scrollTop,stopper=document.querySelector("#back-to-top-stopper");if(stopper){const buttonBottom=scrollPosition+window.innerHeight-stopper.offsetTop;buttonBottom>0&&buttonBottom-button.offsetHeight+stopper.offsetHeight>0?button.style.bottom=buttonBottom+"px":button.style.bottom="0px"}};document.querySelectorAll('[id^="Details-"]:not(.mega-menu) summary').forEach(summary=>{const desktop=window.matchMedia("(min-width: 990px)");if(summary.parentNode.classList.contains("product-accordion-detail
1s")&&desktop.matches)summary.setAttribute("aria-expanded",!0),summary.parentNode.setAttribute("open","");else{if(summary.setAttribute("role","button"),summary.setAttribute("aria-expanded",summary.parentNode.hasAttribute("open")),summary.nextElementSibling&&summary.nextElementSibling.getAttribute("id")&&summary.setAttribute("aria-controls",summary.nextElementSibling.id),summary.addEventListener("click",event=>{event.currentTarget.setAttribute("aria-expanded",!event.currentTarget.closest("details").hasAttribute("open"))}),summary.closest("header-drawer"))return;summary.parentElement.addEventListener("keyup",onKeyUpEscape)}});const trapFocusHandlers={};function getFocusableElements(container){const focusable=container.querySelectorAll("summary, a[href], button:enabled, [tabindex], [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe");return Array.from(focusable).filter(el=>el.getAttribute("tabindex")!=="-1")}function trapFocus(container,elementToFocus=container){if(!container){removeTrapFocus();return}var elements=getFocusableElements(container),first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=event=>{event.target!==container&&event.target!==last&&event.target!==first||document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(event){event.code.toUpperCase()==="TAB"&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),elementToFocus.focus(),elementToFocus.tagName==="INPUT"&&["search","text","email","url"].includes(elementToFocus.type)&&elementToFocus.value&&elementToFocus.setSelectionRange(0,elementToFocus.value.length)}try{document.querySelector(":focus-visible")}catch{focusVisiblePolyfill()}function focusVisiblePolyfill(){const navKeys=["ARROWUP","ARROWDOWN","ARROWLEFT","ARROWRIGHT","TAB","ENTER","SPACE","ESCAPE","HOME","END","PAGEUP","PAGEDOWN"];let currentFocusedElement=null,mouseClick=null;window.addEventListener("keydown",event=>{navKeys.includes(event.code.toUpperCase())&&(mouseClick=!1)}),window.addEventListener("mousedown",event=>{mouseClick=!0}),window.addEventListener("focus",()=>{currentFocusedElement&&currentFocusedElement.classList.remove("focused"),!mouseClick&&(currentFocusedElement=document.activeElement,currentFocusedElement.classList.add("focused"))},!0)}function pauseAllMedia(){document.querySelectorAll(".js-youtube").forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(".js-vimeo").forEach(video=>{video.contentWindow.postMessage('{"method":"pause"}',"*")}),document.querySelectorAll("video").forEach(video=>video.pause()),document.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&model.modelViewerUI.pause()})}function removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}function onKeyUpEscape(event){if(event.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event.target.closest("details[open]");if(!openDetailsElement)return;const summaryElement=openDetailsElement.querySelector("summary");openDetailsElement.removeAttribute("open"),summaryElement.setAttribute("aria-expanded",!1),summaryElement.focus()}class SectionId{static#separator="__";static parseId(qualifiedSectionId){return qualifiedSectionId.split(SectionId.#separator)[0]}static parseSectionName(qualifiedSectionId){return qualifiedSectionId.split(SectionId.#separator)[1]}static getIdForSection(sectionId,sectionName){return`${sectionId}${SectionId.#separator}${sectionName}`}}class HTMLUpdateUtility{static viewTransition(oldNode,newContent,preProcessCallbacks=[],postProcessCallbacks=[]){preProcessCallbacks?.forEach(callback=>callback(newContent));const newNodeWrapper=document.createElement("div");HTMLUpdateUtility.setInnerHTML(newNodeWrapper,newContent.outerHTML);const newNode=newNodeWrapper.firstChild,uniqueKey=Date.now();oldNode.querySelectorAll("[id], [form]").forEach(element=>
1{element.id&&(element.id=`${element.id}-${uniqueKey}`),element.form&&element.setAttribute("form",`${element.form.getAttribute("id")}-${uniqueKey}`)});try{oldNode.parentNode.insertBefore(newNode,oldNode),oldNode.style.display="none"}catch(e){console.error("viewTransition",e,newNode,oldNode);return}postProcessCallbacks?.forEach(callback=>callback(newNode)),setTimeout(()=>oldNode.remove(),500)}static setInnerHTML(element,html){element.innerHTML=html,element.querySelectorAll("script").forEach(oldScriptTag=>{const newScriptTag=document.createElement("script");Array.from(oldScriptTag.attributes).forEach(attribute=>{newScriptTag.setAttribute(attribute.name,attribute.value)}),newScriptTag.appendChild(document.createTextNode(oldScriptTag.innerHTML)),oldScriptTag.parentNode.replaceChild(newScriptTag,oldScriptTag)})}}class AccordionGroup extends HTMLElement{constructor(){super(),this.querySelectorAll(".toggle-button").forEach(button=>{this.setButtonAttributes(button),button.addEventListener("click",this.onButtonClick.bind(this)),button.addEventListener("keypress",this.onButtonClick.bind(this))})}setButtonAttributes(button){button.setAttribute("aria-expanded",button.classList.contains("open")),button.setAttribute("aria-controls",button.dataset.controls||null)}onButtonClick(event){const button=event.target,content=this.querySelector(button.getAttribute("aria-controls"))||null;if(!content)return!1;const announcer=content.querySelector("[aria-live]")||null;button.classList.contains("open")?(button.classList.remove("open"),button.setAttribute("aria-expanded",!1),content.style.display="none",announcer&&(announcer.textContent="Section collapsed.")):(button.classList.add("open"),button.setAttribute("aria-expanded",!0),content.style.display="block",announcer&&(announcer.textContent="Section expanded. Use arrow keys to navigate through the content."))}}customElements.get("accordion-group")||customElements.define("accordion-group",AccordionGroup);class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=ne
1w Event("change",{bubbles:!0}),this.input.addEventListener("change",this.onInputChange.bind(this)),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)))}quantityUpdateUnsubscriber=void 0;connectedCallback(){this.validateQtyRules(),this.quantityUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.quantityUpdate,this.validateQtyRules.bind(this))}disconnectedCallback(){this.quantityUpdateUnsubscriber&&this.quantityUpdateUnsubscriber()}onInputChange(event){this.validateQtyRules()}onButtonClick(event){event.preventDefault();const previousValue=this.input.value;event.target.name==="plus"?parseInt(this.input.dataset.min)>parseInt(this.input.step)&&this.input.value==0?this.input.value=this.input.dataset.min:this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent),this.input.dataset.min===previousValue&&event.target.name==="minus"&&(this.input.value=parseInt(this.input.min))}validateQtyRules(){const value=parseInt(this.input.value);if(this.input.min&&this.querySelector(".quantity__button[name='minus']").classList.toggle("disabled",parseInt(value)<=parseInt(this.input.min)),this.input.max){const max=parseInt(this.input.max);this.querySelector(".quantity__button[name='plus']").classList.toggle("disabled",value>=max)}}}customElements.define("quantity-input",QuantityInput);function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}function throttle(fn,delay){let lastCall=0;return function(...args){const now=new Date().getTime();if(!(now-lastCall<delay))return lastCall=now,fn(...args)}}function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}typeof window.Shopify>"u"&&(window.Shopify={}),Shopify.bind=function(fn,scope){return function(){return fn.apply(scope,arguments)}},Shopify.setSelectorByValue=function(selector,value){for(var i=0,count=selector.options.length;i<count;i++){var option=selector.options[i];if(value==option.value||value==option.innerHTML)return selector.selectedIndex=i,i}},Shopify.addListener=function(target,eventName,callback){target.addEventListener?target.addEventListener(eventName,callback,!1):target.attachEvent("on"+eventName,callback)},Shopify.postLink=function(path,options){options=options||{};var method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(var key in params){var hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",key),hiddenField.setAttribute("value",params[key]),form.appendChild(hiddenField)}document.body.appendChild(form),form.submit(),document.body.removeChild(form)},Shopify.CountryProvinceSelector=function(country_domid,province_domid,options){this.countryEl=document.getElementById(country_domid),this.provinceEl=document.getElementById(province_domid),this.provinceContainer=document.getElementById(options.hideElement||province_domid),Shopify.addListener(this.countryEl,"change",Shopify.bind(this.countryHandler,this)),this.initCountry(),this.initProvince()},Shopify.CountryProvinceSelector.prototype={initCountry:function(){var value=this.countryEl.getAttribute("data-default");Shopify.setSelectorByValue(this.countryEl,value),this.countryHandler()},initProvince:function(){var value=this.provinceEl.getAttribute("data-default");value&&this.provinceEl.options.length>0&&Shopify.setSelectorByValue(this.provinceEl,value)},countryHandler:function(e){var opt=this.countryEl.options[this.countryEl.selectedIndex],raw=opt.getAttribute("data-provinces"),provinces=JSON.parse(raw);if(this.clearOptions(this.provinceEl),provinces&&provinces.length==0)this.provinceContainer.style.display="none";else{for(var i=0;i<provinces.length;i++){var opt=document.createElement("option");opt.value=provinces[i][0],opt.innerHTML=provinces[i][1],this.provinceEl.appendChild(opt)}this.provinceContainer.style.display=""}},clearOptions:function(selector){for(;selector.firstChild;)selector.removeChild(selector.firstChild)},setOptions:function(selector,values){for(var i=0,count=values.length;i<values.length;i++){var opt=document.createElement("option");opt.value=values[i],opt.innerHTML=values[i],selector.appendChild(opt)}}};let currentConsent={};Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],error=>{if(error){console.error("consent-tracking-api ERROR",error);return}currentConsent=Shopify.customerPrivacy.currentVisitorConsent(),(currentConsent.marketing!="yes"||currentConsent.sale_of_data!="yes")&&deleteKlaviyoCookie()});function deleteKlaviyoCookie(){document.cookie="__kla_id=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"}window.addEventListener("OneTrustGroupsUpdated",event=>{const activeGroups=event.detail||[];try{if((currentConsent.marketing=="yes"||currentConsent.sale_of_data=="yes")&&activeGroups.includes("C0002")||(currentConsent.marketing=="no"||currentConsent.sale_of_data=="no")&&!activeGroups.includes("C0002"))return;activeGroups.includes("C0002")||deleteKlaviyoCookie(),Shopify.customerPrivacy.setTrackingConsent({marketing:activeGroups.includes("C0002"),sale_of_data:activeGroups.includes("C0002")},()=>{currentConsent=Shopify.customerPrivacy.currentVisitorConsent()})}catch(e){console.error(e)}}),(function(){const pagetype=window.ShopifyAnalytics?.meta?.page?.pageType,getPathname=path=>{if(!path)return null;try{const segments=new URL(path,"http://dummy.base").pathname.replace(/\/+$/,"").split("/").filter(
1Boolean);return segments.length>=2?`${segments[0]}-${segments[1]}`:segments.length===1?segments[0]:null}catch(e){return console.error(e),null}},addUniqueIds2=(selector,prefix,suffix,identifier_selector={})=>{try{const elements=document.querySelectorAll(selector+":not([id])");if(!elements)return;elements.forEach((element,index)=>{let identifier=index;identifier_selector?.data?identifier=element.getAttribute(identifier_selector.data)||null:identifier_selector?.checkbox?identifier=(element.querySelector("input[type=checkbox]")||element)?.getAttribute(identifier_selector.checkbox)||null:identifier=getPathname((element.querySelector("a")||element)?.getAttribute("href")||null),identifier?identifier=String(identifier||"").trim().toLowerCase().replaceAll(".","-").replaceAll(" ","-"):identifier="-ERROR-MISSING-IDENTIFIER-",element.setAttribute("id",`${prefix}-${identifier}--${suffix||pagetype+"-page"}`)})}catch(e){console.error("addUniqueIds",e)}};window.addUniqueIds=addUniqueIds2})(),document.addEventListener("DOMContentLoaded",function(){addUniqueIds("summary.mega-menu__summary","menu-button-level-1","mega-menu"),addUniqueIds("a.header__menu-link","menu-link-level-1","mega-menu"),addUniqueIds("ul.footer-block__details-content > li > a","menu-link","footer-menu"),addUniqueIds("summary.menu-drawer__menu-item","menu-button","mobile-menu",{data:"data-menu-id"}),addUniqueIds("a.menu-drawer__menu-item.list-menu__item","menu-link","mobile-menu",{data:"data-menu-id"}),addUniqueIds("a.menu-drawer__menu-item.menu__item level-1","menu-link-level-1","mobile-menu"),addUniqueIds(".menu-drawer__cta","menu-cta","mobile-menu"),addUniqueIds(".otto-grid [data-otto-placement]","otto-grid-image"),addUniqueIds(".otto-slider [data-otto-placement]","otto-slider-banner"),addUniqueIds(".subcats-container a.subcat","subcat-list-link"),addUniqueIds(".collection-tabs__container .tab-item","collection-slider-link"),addUniqueIds(".products-slider .shop-all-button","shop-all-link"),addUniqueIds(".thumbnail-slider button.thumbnail","product-slider-thumbnail",null,{data:"data-thumb-id"}),addUniqueIds(".blog__view-all","view-blog-link")});class MenuDrawer extends HTMLElement{constructor(){super(),this.mainDetailsToggle=this.querySelector("details"),this.addEventListener("keyup",this.onKeyUp.bind(this)),this.addEventListener("focusout",this.onFocusOut.bind(this)),this.bindEvents()}bindEvents(){this.querySelectorAll("summary").forEach(summary=>summary.addEventListener("click",this.onSummaryClick.bind(this))),this.querySelectorAll("button:not(.localization-selector):not(.country-selector__close-button):not(.country-filter__reset-button)").forEach(button=>button.addEventListener("click",this.onBackButtonClick.bind(this)))}onKeyUp(event){if(event.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event.target.closest("details[open]");openDetailsElement&&(openDetailsElement===this.mainDetailsToggle?this.closeMenuDrawer(event,this.mainDetailsToggle.querySelector("summary")):this.closeSubmenu(openDetailsElement))}onSummaryClick(event){const summaryElement=event.currentTarget,detailsElement=summaryElement.parentNode,parentMenuElement=detailsElement.closest(".has-submenu"),isOpen=detailsElement.hasAttribute("open"),reducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)");if(!summaryElement.nextElementSibling)return;function addTrapFocus(){trapFocus(summaryElement.nextElementSibling,detailsElement.querySelector("button")),summaryElement.nextElementSibling.removeEventListener("transitionend",addTrapFocus)}detailsElement===this.mainDetailsToggle?(isOpen&&event.preventDefault(),isOpen?this.closeMenuDrawer(event,summaryElement):this.openMenuDrawer(summaryElement),window.matchMedia("(max-width: 990px)")&&document.documentElement.style.setProperty("--viewport-height",`${window.innerHeight}px`)):setTimeout(()=>{detailsElement.classList.add("menu-opening"),summaryElement.setAttribute("aria-expanded",!0),parentMenuElement&&parentMenuElement.classList.add("submenu-open"),!reducedMotion||reducedMotion.matches?addTrapFocus():summaryElement.nextElementSibling.addEventListener("transitionend",addTrapFocus)},100)}openMenuDrawer(summaryElement){closePredictiveSearch(this),setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}onCloseButtonClick(event){this.closeMenuDrawer(event)}closeMenuDrawer(event,elementToFocus=!1){event!==void 0&&(this.mainDetailsToggle.classList.remove("menu-opening"),this.mainDetailsToggle.querySelectorAll("details").forEach(detail
1s=>{details.removeAttribute("open"),details.classList.remove("menu-opening")}),this.mainDetailsToggle.querySelectorAll(".submenu-open").forEach(submenu=>{submenu.classList.remove("submenu-open")}),document.body.classList.remove(`overflow-hidden-${this.dataset.breakpoint}`),removeTrapFocus(elementToFocus),this.closeAnimation(this.mainDetailsToggle),event instanceof KeyboardEvent&&elementToFocus?.setAttribute("aria-expanded",!1))}onFocusOut(){setTimeout(()=>{this.mainDetailsToggle.hasAttribute("open")&&!this.mainDetailsToggle.contains(document.activeElement)&&this.closeMenuDrawer()})}onBackButtonClick(event){const detailsElement=event.currentTarget.closest("details");this.closeSubmenu(detailsElement)}closeSubmenu(detailsElement){const parentMenuElement=detailsElement.closest(".submenu-open");parentMenuElement&&parentMenuElement.classList.remove("submenu-open"),detailsElement.classList.remove("menu-opening"),detailsElement.querySelector("summary").setAttribute("aria-expanded",!1),removeTrapFocus(detailsElement.querySelector("summary")),this.closeAnimation(detailsElement)}closeAnimation(detailsElement){let animationStart;const handleAnimation=time=>{animationStart===void 0&&(animationStart=time),time-animationStart<400?window.requestAnimationFrame(handleAnimation):(detailsElement.removeAttribute("open"),detailsElement.closest("details[open]")&&trapFocus(detail
1sElement.closest("details[open]"),detailsElement.querySelector("summary")))};window.requestAnimationFrame(handleAnimation)}}customElements.define("menu-drawer",MenuDrawer);class HeaderDrawer extends MenuDrawer{constructor(){super()}openMenuDrawer(summaryElement){closePredictiveSearch(this),this.header=this.header||document.querySelector(".section-header"),this.borderOffset=this.borderOffset||this.closest(".header-wrapper").classList.contains("header-wrapper--border-bottom")?1:0,this.mainHeaderHeight=this.mainHeaderHeight||this.header.querySelector("header"),this.mainHeaderBottomOffset=this.mainHeaderHeight?Math.max(0,Math.round(this.mainHeaderHeight.getBoundingClientRect().bottom)):0,document.documentElement.style.setProperty("--header-bottom-position",`${parseInt(this.header.getBoundingClientRect().bottom-this.borderOffset)}px`),document.documentElement.style.setProperty("--wls-header-top-offset",`${this.mainHeaderBottomOffset}px`),this.header.classList.add("menu-open"),setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),window.addEventListener("resize",this.onResize),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`),document.querySelector("body").classList.remove("mobile-search-open")}closeMenuDrawer(event,elementToFocus){elementToFocus&&(super.closeMenuDrawer(event,elementToFocus),this.header.classList.remove("menu-open"),window.removeEventListener("resize",this.onResize))}onResize(){try{this.header&&document.documentElement.style.setProperty("--header-bottom-position",`${parseInt(this.header.getBoundingClientRect().bottom-this.borderOffset)}px`),this.mainHeaderHeight&&document.documentElement.style.setProperty("--wls-header-top-offset",`${Math.max(0,Math.round(this.mainHeaderHeight.getBoundingClientRect().bottom))}px`),document.documentElement.style.setProperty("--viewport-height",`${window.innerHeight}px`)}catch(e){console.error(e)}}}customElements.define("header-drawer",HeaderDrawer);class ModalDialog extends HTMLElement{constructor(){super(),this.querySelector('[id^="ModalClose-"]').addEventListener("click",this.hide.bind(this,!1)),this.addEventListener("keyup",event=>{event.code.toUpperCase()==="ESCAPE"&&this.hide()}),this.classList.contains("media-modal")?this.addEventListener("pointerup",event=>{event.pointerType==="mouse"&&!event.target.closest("deferred-media, product-model")&&this.hide()}):this.addEventListener("click",event=>{event.target===this&&this.hide()})}connectedCallback(){this.moved||(this.moved=!0,this.dataset.section=this.closest(".shopify-section")?.id.replace("shopify-section-",""),document.body.appendChild(this))}show(opener){this.openedBy=opener;const popup=this.querySelector(".template-popup");document.body.classList.add("overflow-hidden"),this.setAttribute("open",""),popup&&popup.loadContent(),trapFocus(this,this.querySelector('[role="dialog"]')),window.pauseAllMedia()}hide(){document.body.classList.remove("overflow-hidden"),document.body.dispatchEvent(new CustomEvent("modalClosed")),this.removeAttribute("open"),removeTrapFocus(this.openedBy),window.pauseAllMedia()}}customElements.define("modal-dialog",ModalDialog);class BulkModal extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{if(entries[0].isIntersecting&&(observer.unobserve(this),this.innerHTML.trim()==="")){const productUrl=this.dataset.url.split("?")[0];fetch(`${productUrl}?section_id=bulk-quick-order-list`).then(response=>response.text()).then(responseText=>{const sourceQty=new DOMParser().parseFromString(responseText,"text/html").querySelector(".quick-order-list-container").parentNode;this.innerHTML=sourceQty.innerHTML}).catch(e=>{console.error(e)})}};new IntersectionObserver(handleIntersection.bind(this)).observe(document.querySelector(`#QuickBulk-${this.dataset.productId}-${this.dataset.sectionId}`))}}customElements.define("bulk-modal",BulkModal);class ModalOpener extends HTMLElement{constructor(){super();const button=this.querySelector("button");button&&button.addEventListener("click",()=>{const modal=document.querySelector(this.getAttribute("data-modal"));modal&&modal.show(button)})}}customElements.define("modal-opener",ModalOpener);class DeferredMedia extends HTMLElement{constructor(){super();const poster=this.querySelector('[id^="Deferred-Poster-"]');poster&&poster.addEventListener("click",this.loadContent.bind(this))}loadContent(focus=!0){if(window.pauseAllMedia(),!this.getAttribute("loaded")){const content=document.createElement("div");content.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",!0);const deferredElement=this.appendChild(content.querySelector("video, model-viewer, iframe"));focus&&deferredElement.focus(),deferredElement.nodeName=="VIDEO"&&deferredElement.getAttribute("autoplay")&&deferredElement.play();const formerStyle=deferredElement.getAttribute("style");deferredElement.setAttribute("style","display: block;"),window.setTimeout(()=>{deferredElement.setAttribute("style",formerStyle)}
1,0)}}}customElements.define("deferred-media",DeferredMedia);class SliderComponent extends HTMLElement{constructor(){if(super(),this.slider=this.querySelector('[id^="Slider-"]'),this.sliderItems=this.querySelectorAll('[id^="Slide-"]'),this.enableSliderLooping=!1,this.currentPageElement=this.querySelector(".slider-counter--current"),this.pageTotalElement=this.querySelector(".slider-counter--total"),this.prevButton=this.querySelector(".slider-button--prev"),this.nextButton=this.querySelector(".slider-button--next"),!(!this.slider||!this.nextButton||!this.sliderItems)){this.initPages();try{new ResizeObserver(entries=>this.initPages()).observe(this.slider)}catch(e){console.error(e)}this.slider.addEventListener("scroll",this.update.bind(this)),this.prevButton.addEventListener("click",this.onButtonClick.bind(this)),this.nextButton.addEventListener("click",this.onButtonClick.bind(this)),this.overlayScrollbarsLoaded=!1}}initPages(){if(this.sliderItemsToShow=Array.from(this.sliderItems).filter(element=>element.clientWidth>0),this.sliderItemsToShow.length>1)this.sliderItemOffset=this.sliderItemsToShow[1].offsetLeft-this.sliderItemsToShow[0].offsetLeft,this.slidesPerPage=Math.floor((this.slider.clientWidth-this.sliderItemsToShow[0].offsetLeft)/this.sliderItemOffset),this.totalPages=this.sliderItemsToShow.length-this.slidesPerPage;else{this.currentPage=1,this.totalPages=1;return}this.update(),this.overlayScrollbarsLoaded||(this.hasAttribute("data-overlayscrollbars-initialize")?this.overlayScrollbarsLoaded=window.initOverlayScrollbars(this,this.slider):this.querySelector(".slider-items[data-overlayscrollbars-initialize]")&&(this.overlayScrollbarsLoaded=window.initOverlayScrollbars(this.querySelector(".slider-items[data-overlayscrollbars-initialize]"),this.slider)))}resetPages(){this.sliderItems=this.querySelectorAll('[id^="Slide-"]'),this.initPages()}update(){if(!this.slider||!this.nextButton)return;const previousPage=this.currentPage;this.currentPage=Math.round(this.slider.scrollLeft/this.sliderItemOffset)+1,this.currentPageElement&&this.pageTotalElement&&(this.currentPageElement.textContent=this.currentPage,this.pageTotalElement.textContent=this.totalPages),this.currentPage!=previousPage&&this.dispatchEvent(new CustomEvent("slideChanged",{detail:{currentPage:this.currentPage,currentElement:this.sliderItemsToShow[this.currentPage-1]}})),!this.enableSliderLooping&&(this.isSlideVisible(this.sliderItemsToShow[0])&&this.slider.scrollLeft===0?this.prevButton.setAttribute("disabled","disabled"):this.prevButton.removeAttribute("disabled"),this.isSlideVisible(this.sliderItemsToShow[this.sliderItemsToShow.length-1],-2)?this.nextButton.setAttribute("disabled","disabled"):this.nextButton.removeAttribute("disabled"))}isSlideVisible(element,offset=0){const lastVisibleSlide=this.slider.clientWidth+this.slider.scrollLeft-offset;return element.offsetLeft+element.clientWidth<=lastVisibleSlide&&element.offsetLeft>=this.slider.scrollLeft}onButtonClick(event){event.preventDefault();let step=event.currentTarget.dataset.step||2;window.innerWidth>989&&(step=event.currentTarget.dataset.stepdesktop||2),this.slideScrollPosition=event.currentTarget.name==="next"?this.slider.scrollLeft+step*this.sliderItemOffset:this.slider.scrollLeft-step*this.sliderItemOffset,this.slider.scrollTo({left:this.slideScrollPosition})}}customElements.define("slider-component",SliderComponent);class SlideshowComponent extends SliderComponent{constructor(){super(),this.sliderControlWrapper=this.querySelector(".slider-buttons"),this.enableSliderLooping=!0,!(!this.sliderControlWrapper||!this.sliderItemsToShow)&&(this.sliderFirstItemNode=this.slider.querySelector(".slideshow__slide"),this.sliderItemsToShow.length>0&&(this.currentPage=1),this.sliderControlLinksArray=Array.from(this.sliderControlWrapper.querySelectorAll(".slider-counter__link")),this.sliderControlLinksArray.forEach(link=>link.addEventListener("click",this.linkToSlide.bind(this))),this.slider.addEventListener("scroll",this.setSlideVisibility.bind(this)),this.setSlideVisibility(),this.slider.getAttribute("data-autoplay")==="true"&&this.setAutoPlay())}setAutoPlay(){this.sliderAutoplayButton=this.querySelector(".slideshow__autoplay"),this.autoplaySpeed=this.slider.dataset.speed*1e3,this.sliderAutoplayButton.addEventListener("click",this.autoPlayToggle.bind(this)),this.addEventListener("mouseover",this.focusInHandling.bind(this)),this.addEventListener("mouseleave",this.focusOutHandling.bind(this)),this.addEventListener("focusin",this.focusInHandling.bind(this)),this.addEventListener("focusout",this.focusOutHandling.bind(this)),this.play(),this.autoplayButtonIsSetToPlay=!0}onButtonClick(event){super.onButtonClick(event);const isFirstSlide=this.currentPage===1,isLastSlide=this.currentPage===this.sliderItemsToShow.length;!isFirstSlide&&!isLastSlide||(isFirstSlide&&event.currentTarget.name==="previous"?this.slideScrollPosition=this.slider.scrollLeft+this.sliderFirstItemNode.clientWidth*this.sliderItemsToShow.length:isLastSlide&&event.currentTarget.name==="next"&&(this.slideScrollPosition=0),this.slider.scrollTo({left:this.slideScrollPosition}))}
1update(){super.update(),this.sliderControlButtons=this.querySelectorAll(".slider-counter__link"),this.prevButton.removeAttribute("disabled"),this.sliderControlButtons.length&&(this.sliderControlButtons.forEach(link=>{link.classList.remove("slider-counter__link--active"),link.removeAttribute("aria-current")}),this.sliderControlButtons[this.currentPage-1].classList.add("slider-counter__link--active"),this.sliderControlButtons[this.currentPage-1].setAttribute("aria-current",!0))}autoPlayToggle(){this.togglePlayButtonState(this.autoplayButtonIsSetToPlay),this.autoplayButtonIsSetToPlay?this.pause():this.play(),this.autoplayButtonIsSetToPlay=!this.autoplayButtonIsSetToPlay}focusOutHandling(event){const focusedOnAutoplayButton=event.target===this.sliderAutoplayButton||this.sliderAutoplayButton.contains(event.target);!this.autoplayButtonIsSetToPlay||focusedOnAutoplayButton||this.play()}focusInHandling(event){(event.target===this.sliderAutoplayButton||this.sliderAutoplayButton.contains(event.target))&&this.autoplayButtonIsSetToPlay?this.play():this.autoplayButtonIsSetToPlay&&this.pause()}play(){this.slider.setAttribute("aria-live","off"),clearInterval(this.autoplay),this.autoplay=setInterval(this.autoRotateSlides.bind(this),this.autoplaySpeed)}pause(){this.slider.setAttribute("aria-live","polite"),clearInterval(this.autoplay)}togglePlayButtonState(pauseAutoplay){pauseAutoplay?(this.sliderAutoplayButton.classList.add("slideshow__autoplay--paused"),this.sliderAutoplayButton.setAttribute("aria-label",window.accessibilityStrings.playSlideshow)):(this.sliderAutoplayButton.classList.remove("slideshow__autoplay--paused"),this.sliderAutoplayButton.setAttribute("aria-label",window.accessibilityStrings.pauseSlideshow))}autoRotateSlides(){const transition=this.slider.getAttribute("data-transition")||"slide",slideScrollPosition=this.currentPage===this.sliderItems.length?0:this.slider.scrollLeft+this.slider.querySelector(".slideshow__slide").clientWidth;this.slider.scrollTo({left:slideScrollPosition,behavior:transition=="fade"?"instant":"auto"})}setSlideVisibility(){this.sliderItemsToShow.forEach((item,index)=>{const linkElements=item.querySelectorAll("a");index===this.currentPage-1?(linkElements.length&&linkElements.forEach(button=>{button.removeAttribute("tabindex")}),item.setAttribute("aria-hidden","false"),item.removeAttribute("tabindex")):(linkElements.length&&linkElements.forEach(button=>{button.setAttribute("tabindex","-1")}),item.setAttribute("aria-hidden","true"),item.setAttribute("tabindex","-1"))})}linkToSlide(event){event.preventDefault();const slideScrollPosition=this.slider.scrollLeft+this.sliderFirstItemNode.clientWidth*(this.sliderControlLinksArray.indexOf(event.currentTarget)+1-this.currentPage);this.slider.scrollTo({left:slideScrollPosition})}}customElements.define("slideshow-component",SlideshowComponent);class VariantSelects extends HTMLElement{constructor(){super()}connectedCallback(){this.addEventListener("change",event=>{const target=this.getInputForEventTarget(event.target);this.updateSelectionMetadata(event);const inputs=this.querySelectorAll("select option[selected], fieldset input:checked");console.log("VariantSelects:change:inputs",inputs,event.target),publish(PUB_SUB_EVENTS.optionValueSelectionChange,{data:{event,target,selectedOptionValues:this.selectedOptionValues}})})}updateSelectionMetadata({target}){const{value,tagName}=target;if(tagName==="SELECT"&&target.selectedOptions.length){Array.from(target.options).find(option=>option.getAttribute("selected")).removeAttribute("selected"),target.selectedOptions[0].setAttribute("selected","selected");const swatchValue=target.selectedOptions[0].dataset.optionSwatchValue,selectedDropdownSwatchValue=target.closest(".product-form__input").querySelector("[data-selected-value] > .swatch");if(!selectedDropdownSwatchValue)return;swatchValue?(selectedDropdownSwatchValue.style.setProperty("--swatch--background",swatchValue),selectedDropdownSwatchValue.classList.remove("swatch--unavailable")):(selectedDropdownSwatchValue.style.setProperty("--swatch--background","unset"),selectedDropdownSwatchValue.classList.add("swatch--unavailable")),selectedDropdownSwatchValue.style.setProperty("--swatch-focal-point",target.selectedOptions[0].dataset.optionSwatchFocalPoint||"unset")}else if(tagName==="INPUT"&&target.type==="radio"){const selectedSwatchValue=target.closest(".product-form__input").querySelector("[data-selected-value]");selectedSwatchValue&&(selectedSwatchValue.innerHTML=value)}}getInputForEventTarget(target){return target.tagName==="SELECT"?target.selectedOptions[0]:target}get selectedOptionValues(){return Array.from(this.querySelectorAll("select option[selected], fieldset input:checked")).map(({dataset})=>dataset.optionValueId)}}customElements.define("variant-selects",VariantSelects);class ProductRecommendations extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=new DOMParser().parseFromString(text,"text/html"),recommendations=html.querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),!this.querySelector("slider-component")&&this.classList.contains("complementary-products")&&this.remove(),html.querySelector(".grid__item")&&(this.classList.add("product-recommendations--loaded"),this.dispatchEvent(new CustomEvent("cg-ninja-dynamic-content:updated",{bubbles:!0,detail:{selector:"product-recommendations"}})))}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}customElements.define("product-recommendations",ProductRecommendations);class AccountIcon extends HTMLElement{constructor(){super(),this.icon=this.querySelector(".icon")}connectedCallback(){document.addEventListener("storefront:signincompleted",this.handleStorefrontSignInCompleted.bind(this))}handleStorefrontSignInCompleted(event){event?.detail?.avatar&&this.icon?.replaceWith(event.detail.avatar.cloneNode())}}customElements.define("account-icon",AccountIcon);class VarianCardtButtons extends HTMLElement{constructor(){super(),this.buttons=this.querySelectorAll(".variant-card-button"),this.buttons&&(this._onButtonEvent=this.buttonHandler.bind(this),this.isTouch="ontouchstart"in window||navigator.maxTouchPoints>0)}connectedCallback(){this.addEventListener("click",this._onButtonEvent),this.addEventListener("mouseover",this._onButtonEvent)}disconnectedCallback(){this.removeEventListener("click",this._onButtonEvent),this.removeEventListener("mouseover",this._onButtonEvent)}buttonHandler(event){event.preventDefault();try{const target=event.target;if(!target.classList.contains("variant-card-button"))return;if(event.type=="click")this.buttons.forEach(element=>{element.classList.remove("selected")}),target.classList.add("selected");else if(event.type=="mouseover"){if(this.isTouch)return;const relatedTarget=event.relatedTarget;if(relatedTarget&&target.contains(relatedTarget)||target.classList.contains("selected"))return;this.buttons.forEach(element=>{element.classList.remove("selected")}),target.classList.add("selected")}const cardWrapper=this.closest(".card-wrapper");if(!cardWrapper)return;this.updateHtml(target,cardWrapper)}catch(e){console.error(e)}}showLoadingSpinner(target){target.classList.add("loading"),target.querySelector(".loading__spinner").classList.remove("hidden"),target.querySelector(".text").style.opacity=.5}updateHtml(target,html){const productUrls=html.querySelectorAll("[data-product-url]");
1productUrls&&productUrls.forEach(element=>{element.dataset.productUrl=target.getAttribute("href"),element.hasAttribute("href")&&element.setAttribute("href",target.getAttribute("href"))});const addCartForm=html.querySelector(".add-to-cart-form");if(addCartForm){const variantID=addCartForm.querySelector("input[name=id]");variantID&&target.dataset.variant_id&&(variantID.value=target.dataset.variant_id)}const priceId=target.dataset.priceId;if(priceId){html.querySelectorAll(".variant-price-wrapper").forEach(wrapper=>{wrapper.classList.add("hidden")});const selectedPriceWrapper=html.querySelector(`#${priceId}`);if(selectedPriceWrapper&&(selectedPriceWrapper.classList.remove("hidden"),window.CouponUIUpdater)){const priceElement=selectedPriceWrapper.querySelector(".price[data-discount-tag]");if(priceElement){const discountTag=priceElement.dataset.discountTag;discountTag&&setTimeout(()=>{CouponUIUpdater.updateCouponUIForTag(discountTag)},50)}}}else{const priceHtml=html.querySelector(".price");priceHtml&&(priceHtml.dataset.variant_id=target.dataset.variant_id,priceHtml.dataset.sku=target.dataset.sku,priceHtml.dataset.price=target.dataset.price||0,priceHtml.dataset.saleprice=target.dataset.saleprice,priceHtml.dataset.compareprice=target.dataset.compareprice||target.dataset.price||0,priceHtml.dataset.available=target.dataset.available,priceHtml.dataset.collections=target.dataset.collections,priceHtml.dataset.hideprice=target.dataset.hideprice||"N",html.dispatchEvent(new CustomEvent("cg-ninja-dynamic-content:updated",{bubbles:!0})))}const cardImageHtml=html.querySelector("img.selected-image");cardImageHtml&&target.dataset.image&&cardImageHtml.getAttribute("src")!==target.dataset.image&&(cardImageHtml.removeAttribute("srcset"),cardImageHtml.removeAttribute("sizes"),cardImageHtml.setAttribute("src",target.dataset.image));const sweepsAmount=html.querySelector(".js-shared-sweeps-entries-amount");sweepsAmount&&target.dataset.sweepsEntries!==void 0&&target.dataset.sweepsEntries!==""&&(sweepsAmount.textContent=target.dataset.sweepsEntries),html.dispatchEvent(new CustomEvent("cg-ninja-dynamic-content:updated",{bubbles:!0}))}}customElements.define("variant-card-buttons",VarianCardtButtons);class BulkAdd extends HTMLElement{constructor(){super(),this.queue=[],this.requestStarted=!1,this.ids=[]}startQueue(id,quantity){this.queue.push({id,quantity});const interval=setInterval(()=>{this.queue.length>0?this.requestStarted||this.sendRequest(this.queue):clearInterval(interval)},250)}sendRequest(queue){this.requestStarted=!0;const items={};queue.forEach(queueItem=>{items[parseInt(queueItem.id)]=queueItem.quantity}),this.queue=this.queue.filter(queueElement=>!queue.includes(queueElement)),(this.closest("quick-order-list")||this.closest("quick-add-bulk")).updateMultipleQty(items)}resetQuantityInput(id){const input=this.querySelector(`#Quantity-${id}`);input.value=input.getAttribute("value"),this.isEnterPressed=!1}setValidity(event,index,message){event.target.setCustomValidity(message),event.target.reportValidity(),this.resetQuantityInput(index),event.target.select()}validateQuantity(event){const inputValue=parseInt(event.target.value),index=event.target.dataset.index;inputValue<event.target.dataset.min?this.setValidity(event,index,window.quickOrderListStrings.min_error.replace("[min]",event.target.dataset.min)):inputValue>parseInt(event.target.max)?this.setValidity(event,index,window.quickOrderListStrings.max_error.replace("[max]",event.target.max)):inputValue%parseInt(event.target.step)!=0?this.setValidity(event,index,window.quickOrderListStrings.step_error.replace("[step]",event.target.step)):(event.target.setCustomValidity(""),event.target.reportValidity(),this.startQueue(index,inputValue))}getSectionsUrl(){return window.pageNumber?`${window.location.pathname}?page=${window.pageNumber}`:`${window.location.pathname}`}getSectionInnerHTML(html,selector){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}}customElements.get("bulk-add")||customElements.define("bulk-add",BulkAdd),window.addEventListener("load",function(){if(window.location.hash){const headerHeight=window.innerWidth<990?160:220,targetId=window.location.hash.substring(1),targetElement=document.getElementById(targetId);if(targetElement){const rect=targetElement.getBoundingClientRect(),scrollPosition=window.scrollY+rect.top-headerHeight;window.scrollTo({top:scrollPosition,behavior:"smooth"})}}}),document.body.addEventListener("click",function(e){const headerHeight=window.innerWidth<990?160:220;if(e.target.classList.contains("anchor")){const targetId=e.target.getAttribute("href").substring(1),targetElement=document.getElementById(targetId);if(e.preventDefault(),targetElement){const rect=targetElement.getBoundingClientRect(),scrollPosition=window.scrollY+rect.top-headerHeight;window.scrollTo({top:scrollPosition,behavior:"smooth"})}}});function showProductPromoPopup(){const modal=document.querySelector("quick-add-modal#QuickAdd-gift-popup"),opener=document.querySelector('modal-opener[data-modal="#QuickAdd-gift-popup"]');if(opener&&modal){const button=opener.querySelector("button");button.setAttribute("data-product-url","/products/pop-the-top-bottle-cap-t-shirt"),button.click()}}
2//# sourceMappingURL=/cdn/shop/t/5/assets/global.js.map?v=140267141269545141871790759746

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.