1class ProductCardForm extends window.BAO.CustomElement(){connectedCallback(){super.connectedCallback()}setupListeners(){super.setupListeners(),this.els.submit.element.addEventListener("click",this.handleAddToCart.bind(this)),this.els.variantChoice?.exists===!0&&this.els.variantChoice.elements.forEach(variantChoice=>{variantChoice.addEventListener("click",this.variantClick.bind(this))}),this.els.id.element.addEventListener("change",this.handleVariantChange.bind(this))}handleVariantChange(event){this.els.id.element.value&&this.els.id.element.classList.add("psh-Card_VariantSelect-value")}variantClick(event){const variantId=event.currentTarget.dataset.variantId;if(variantId&&(this.els.variantChoice.elements.forEach(variantChoice=>{variantChoice.setAttribute("aria-current",variantChoice.dataset.variantId===variantId)}),this.els.id.element.value=variantId,this.els.monogram?.exists===!0)){const url=new URL(this.els.monogram.element.href),params=url.searchParams;params.set("variant",variantId),params.set("open-monogram","true"),this.els.monogram.element.href=url.toString()}}async handleAddToCart(event){if(event.preventDefault(),!this.els.id.element.value)return;const cartItem={id:this.els.id.element.value,quantity:1};try{const state=await window.BAO.Cart.addItem(cartItem);"sections"in state&&this.renderSections(state.sections),this.onCartPage&&!this.inPushCart&&window.location.reload()}catch(err){console.error("Error adding item to cart:",err)}}get inPushCart(){return this.closest("push-cart")!=null}get onCartPage(){return window.location.pathname===window.routes.cartUrl||window.location.pathname==="/cart"}}customElements.get("product-card-form")||customElements.define("product-card-form",ProductCardForm); 2//# sourceMappingURL=/cdn/shop/t/372/assets/product-card-form.js.map?v=94676187128506928691790844741
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.