1(async()=>{const{Core}=await importModule("Core"),CN_LOADING="!loading",ATTR_VARIANT_ID="variant-id",ATTR_BELONGS_FORM="form-child";customElements.define("product-to-cart",class extends Core{elements={button:"[data-to-cart]"};subscriptions={"cart:update":"_cartUpdateHandler","cart:error":"_cartUpdateHandler"};render(){this.subscribe("cart:update",{global:!0}),this.subscribe("cart:error",{global:!0}),this._handleClick()}_handleClick(){this.addEventListener("click",this._onClick.bind(this))}_onClick(){this.loading=!0,!this.belongsToForm&&this.addToCart(this.cartItem)}addToCart(items){this.publish("cart:add",{items})}_cartUpdateHandler(){setTimeout(()=>{this.loading=!1},1500)}get belongsToForm(){return this.hasAttribute(ATTR_BELONGS_FORM)}get cartItem(){return[{id:+this.getAttribute(ATTR_VARIANT_ID),quantity:1}]}set loading(state){this.$button.classList.toggle(CN_LOADING,state)}get cartNotificationsEnabled(){return window.global.cartNotificationsEnabled}set variantId(id){this.setAttribute(ATTR_VARIANT_ID,id)}})})(); 2//# sourceMappingURL=/cdn/shop/t/102/assets/product-to-cart.js.map?v=164934713743246472241787250852
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.