1(()=>{window.mx=window.mx||{},window.mx.EventManager=class{constructor(){this._listeners=new Map}addListener(element,type,handler,options){if(!(element instanceof EventTarget))throw new Error("Invalid element provided to addListener");element.addEventListener(type,handler,options),this._listeners.has(element)||this._listeners.set(element,new Set),this._listeners.get(element).add({type,handler})}removeListener(element,type,handler){element.removeEventListener(type,handler)}removeAllListeners(){for(const[element,listeners]of this._listeners)listeners.forEach(({type,handler})=>{this.removeListener(element,type,handler)});this._listeners.clear()}},window.mx.MxComponent=class extends HTMLElement{constructor(){super(),this.eventManager=new window.mx.EventManager}connectedCallback(){}disconnectedCallback(){this.eventManager.removeAllListeners()}},window.customElements.get("mx-component")||window.customElements.define("mx-component",window.mx.MxComponent);const GiftWrapSelector=class extends window.mx.MxComponent{constructor(){super()}connectedCallback(){this.eventManager.addListener(this.input,"change",()=>this.onInputChange())}get section(){return document.querySelector(".shopify-section--cart-drawer")}get cartDrawer(){return document.querySelector("#cart-drawer")}get input(){return this.querySelector("input")}get label(){return this.querySelector("label")}get variantId(){return this.getAttribute("data-variant-id")}async onInputChange(){try{this.setAttribute("inert","");const sectionId=this.section.id.split("shopify-section-").pop();if(this.input.checked){const addToCartJson=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({items:[{id:this.variantId,quantity:1}],sections:[sectionId]})}).then(response=>response.json());document.documentElement.dispatchEvent(new CustomEvent("cart:change",{bubbles:!0,detail:{baseEvent:"variant:add",cart:addToCartJson,sections:[sectionId]}}))}else{const cartChangeJson=await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({id:this.variantId,quantity:0,sections:[sectionId]})}).then(response=>response.json());document.documentElement.dispatchEvent(new CustomEvent("cart:change",{bubbles:!0,detail:{baseEvent:"line-item:change",cart:cartChangeJson,sections:[sectionId]}}))}}catch(error){console.error("Error selecting gift wrapping:",error)}finally{this.input.checked?this.removeAttribute("checked"):this.setAttribute("checked",""),this.removeAttribute("inert")}}};customElements.get("gift-wrap-selector")||customElements.define("gift-wrap-selector",GiftWrapSelector)})(); 2//# sourceMappingURL=/cdn/shop/t/69/assets/custom.js.map?v=30252350099666773071789474472
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.