1import{P as PubSub}from"./pubsub-CoPYzvVm.js";import{N as Notyf}from"./notyf-DIw0RvBj.js";class QuantityInput extends HTMLElement{#input=this.querySelector("input");#buttons=this.querySelectorAll("button");connectedCallback(){this.#buttons.forEach(button=>{button.addEventListener("click",event=>this.#handleStep(event.currentTarget.name))}),this.#input.addEventListener("change",()=>{this.#constrainAndUpdateInput(this.#input.value),this.#publishQuantityChange()})}#handleStep(type){const value=parseInt(this.#input.value),step=parseInt(this.#input.step)||1,newValue=type==="minus"?Math.max(value-step,0):value+step,updatedValue=this.#constrainAndUpdateInput(newValue);parseInt(updatedValue)!==parseInt(value)&&this.#publishQuantityChange()}#constrainAndUpdateInput(newValue){const{min,max}=this.#input;return this.#input.value=newValue,newValue>=max&&max!==""?(Notyf.error(window.toast_translations.product.quantity.error_max.replace("{{ max }}",max)),this.#input.value=max):newValue<=min&&(this.#input.value=min),this.#input.value}#publishQuantityChange(){PubSub.publish("quantity:change",{line:this.dataset?.itemIndex,quantity:this.#input.value})}}customElements.define("quantity-input",QuantityInput); 2//# sourceMappingURL=/cdn/shop/t/13/assets/quantity-input.js.map?v=42003646300966720411787735888
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.