import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(s={store:()=>e.store},l={},t.d(l,s),l),r=e=>{const t=(e=>{const t=e.target,n=t.parentElement?.querySelector(".wc-block-components-quantity-selector__input");return n})(e);if(!t)return;const n=parseFloat(t.value),r=parseFloat(t.min),a=parseFloat(t.max),o=parseFloat(t.step);return{currentValue:isNaN(n)?0:n,minValue:isNaN(r)?1:r,maxValue:isNaN(a)?void 0:a,step:isNaN(o)?1:o,inputElement:t}},a=(e,t,n,r)=>{const a=(r.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,s=(n.toString().split(".")[1]||"").length,l=Math.max(a,o,s);return e.toFixed(l)},o=e=>{const t=new Event("change",{bubbles:!0});e.dispatchEvent(t)};var s,l;(0,n.store)("woocommerce/add-to-cart-form",{state:{get allowsIncrease(){return!0},get allowsDecrease(){return!0}},actions:{increaseQuantity:e=>{const t=r(e);if(!t)return;const{currentValue:n,minValue:s,maxValue:l,step:i,inputElement:u}=t,c=n+i;(void 0===l||c<=l)&&(u.value=a(c,s,l??1/0,i),o(u))},decreaseQuantity:e=>{const t=r(e);if(!t)return;const{currentValue:n,minValue:s,maxValue:l,step:i,inputElement:u}=t,c=n-i;c>=s&&(u.value=a(c,s,l??1/0,i),o(u))}}},{lock:"I acknowledge that using a private store means my plugin will inevitably break on the next store release."});