1class QuickShop extends HTMLElement{constructor(){super(),this.quickaddButtons=this.querySelectorAll(".quickbutton"),this.quickshopOpen=this.closest(".quickshop__wrapper").querySelector(".open-quickshop"),this.prodId=this.dataset.productId,this.prodUrl=this.dataset.productUrl,this.oosCountries=this.closest(".card-wrapper")?.querySelector(`#oosCountries-${this.prodId}`),this.oosStates=this.closest(".card-wrapper")?.querySelector(`#oosStates-${this.prodId}`)}async connectedCallback(){this.quickaddButtons.forEach(btn=>{btn.addEventListener("click",this.quickadd.bind(this,btn))}),this.quickshopOpen&&this.quickshopOpen.addEventListener("click",this.setQuickshopBtn.bind(this))}disableButton(tag){const quickshopHTML=` 2 <p class="quickshop-header">Quick Add to Cart</p> 3 <div class="quickshop-buttons"></div> 4 <a class="button button-full quickshop-custom-disabled" href="javascript:void(0)">${tag==="oos"?"Sold Out":"Unavailable"}</a> 5 `;this.innerHTML=quickshopHTML,this.classList.add(tag)}quickadd(btn){const variantId=parseInt(btn.dataset.variantId),matchedEarlyAccessObject=earlyAccessData.find(item=>item.earlyAccessVariantId==variantId),sideCart=document.querySelector("side-cart");if(matchedEarlyAccessObject)try{fetch(window.Shopify.routes.root+"cart.js").then(response=>response.json()).then(data=>{const item=data.items.find(item2=>item2.variant_id==matchedEarlyAccessObject.earlyAccessVariantId);if(item)if(qtyLimitEnabled){const existingHelpMessage=document.querySelector(".gating-product-qty-limit-message");if(existingHelpMessage&&existingHelpMessage.remove(),item.quantity<matchedEarlyAccessObject.earlyAccessProductQtyLimit&&matchedEarlyAccessObject.earlyAccessProductQtyLimit>0)variantId&&!isNaN(variantId)&&sideCart.addToCart(variantId);else if(!existingHelpMessage){const helpMessage=document.createElement("div");helpMessage.classList.add("gating-product-qty-limit-message"),helpMessage.innerHTML=`You can buy up to ${matchedEarlyAccessObject.earlyAccessProductQtyLimit} sets of ${matchedEarlyAccessObject.earlyAccessVariantTitle}.`,this.querySelector(".button.button--primary").parentNode.insertAdjacentElement("afterend",helpMessage)}}else variantId&&!isNaN(variantId)&&sideCart.addToCart(variantId);else variantId&&!isNaN(variantId)&&sideCart.addToCart(variantId);return data}).catch(error=>{console.error("Error:",error)})}catch(err){console.error(err)}else variantId&&!isNaN(variantId)&&sideCart.addToCart(variantId)}setQuickshopBtn(){this.quickshopOpen.classList.toggle("opened"),window.innerWidth<=768&&this.quickshopOpen.classList.contains("opened")?this.classList.toggle("custom-mobile-quickshop-open"):window.innerWidth<=768&&!this.quickshopOpen.classList.contains("opened")&&this.classList.toggle("custom-mobile-quickshop-open")}}customElements.define("quick-shop",QuickShop); 6//# sourceMappingURL=/cdn/shop/t/772/assets/quick-shop.js.map?v=48989510979712830271788878036
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.