1customElements.get("quick-add-drawer-opener")||customElements.define("quick-add-drawer-opener",class extends HTMLElement{constructor(){super(),this.button=this.querySelector("button"),this.onClickHandler=this.onClick.bind(this),this.button.addEventListener("click",this.onClickHandler)}onClick(e){this.button.setAttribute("aria-disabled",!0),this.button.classList.add("loading"),this.button.querySelector(".loading-overlay__spinner").classList.remove("hidden");let url=this.button.dataset.productUrl;url.includes("?")?url+="&":url+="?",url+="section_id=quick-add-drawer",fetch(url).then(response=>response.text()).then(responseText=>{const newQuickAddDrawer=getDomHtmlFromText(responseText,"quick-add-drawer");if(window.hasQuickAddDrawer){const quickAddDrawer=document.querySelector("quick-add-drawer");quickAddDrawer.setInnerHTML(newQuickAddDrawer.querySelector(".quick-add-main-product").innerHTML),quickAddDrawer.open(this.button)}else document.body.appendChild(newQuickAddDrawer),newQuickAddDrawer.reInjectScript(newQuickAddDrawer),setTimeout(()=>{newQuickAddDrawer.open(this.button)},300),window.hasQuickAddDrawer=!0}).finally(()=>{this.button.removeAttribute("aria-disabled"),this.button.classList.remove("loading"),this.button.querySelector(".loading-overlay__spinner").classList.add("hidden")})}}),customElements.get("quick-add-drawer")||customElements.define("quick-add-drawer",class extends DrawerFixed{constructor(){super(),this.querySelector(".drawer__overlay").addEventListener("click",this.close.bind(this))}close(evt){this.classList.remove("open-content"),super.close(evt),setTimeout(()=>{this.productElement.innerHTML=""},300)}open(opener){this.assignProductElement(),this.preventDuplicatedIDs(),this.removeDOMElements(),window.Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),window.ProductModel&&window.ProductModel.loadShopifyXR(),this.removeGalleryListSemantic(),this.preventVariantURLSwitching(),super.open(opener),setTimeout(()=>{this.classList.add("open-content")},300)}assignProductElement(){this.productElement||(this.productElement=this.querySelector(".quick-add-main-product"))}setInnerHTML(html){this.assignProductElement(),this.productElement.innerHTML=html,this.reInjectScript(this.productElement)}reInjectScript(element){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)})}preventVariantURLSwitching(){this.productElement.querySelector("variant-radios,variant-selects").setAttribute("data-update-url","false")}removeDOMElements(){this.productElement.querySelectorAll(".quick-add-hidden").forEach(element=>{element&&element.remove()})}preventDuplicatedIDs(){const sectionId=this.productElement.dataset.section;this.productElement.innerHTML=this.productElement.innerHTML.replaceAll(sectionId,`quickadd-${sectionId}`),this.productElement.querySelectorAll("variant-selects, variant-radios").forEach(variantSelect=>{variantSelect.dataset.originalSection=sectionId})}removeGalleryListSemantic(){const galleryList=this.productElement.querySelector('[id^="Slider-Gallery"]');galleryList&&(galleryList.setAttribute("role","presentation"),galleryList.querySelectorAll('[id^="Slide-"]').forEach(li=>li.setAttribute("role","presentation")))}}); 2//# sourceMappingURL=/cdn/shop/t/2/assets/quick-add.js.map?v=26900552424052655451716288670
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.