System.register(["./index-legacy-fdce4919.js"],(function(e,l){"use strict";var a,t,u,n,i,o,s,r,d,m,c,v,p,b,g,h,f,S,x,w,y,V,P,B,I;return{setters:[e=>{a=e.c,t=e.b,u=e.t,n=e.n,i=e.d,o=e.r,s=e.e,r=e.o,d=e.aX,m=e.w,c=e.a2,v=e.a,p=e.g,b=e.v,g=e.h,h=e.H,f=e.bf,S=e.W,x=e.z,w=e.bg,y=e.p,V=e.$,P=e.aW,B=e.b7,I=e.k}],execute:function(){const[l,M]=a("stepper"),T=(e,l)=>String(e)===String(l),C={min:t(1),max:t(1/0),name:t(""),step:t(1),theme:String,integer:Boolean,disabled:Boolean,showPlus:u,showMinus:u,showInput:u,longPress:u,autoFixed:u,allowEmpty:Boolean,modelValue:n,inputWidth:n,buttonSize:n,placeholder:String,disablePlus:Boolean,disableMinus:Boolean,disableInput:Boolean,beforeChange:Function,defaultValue:t(1),decimalLength:n};var F=i({name:l,props:C,emits:["plus","blur","minus","focus","change","overlimit","update:modelValue"],setup(e,{emit:l}){const a=(l,a=!0)=>{const{min:t,max:u,allowEmpty:n,decimalLength:i}=e;return n&&""===l||(l=""===(l=f(String(l),!e.integer))?0:+l,l=Number.isNaN(l)?+t:l,l=a?Math.max(Math.min(+u,l),+t):l,S(i)&&(l=l.toFixed(+i))),l};let t;const u=o(),n=o((()=>{var t;const u=null!=(t=e.modelValue)?t:e.defaultValue,n=a(u);return T(n,e.modelValue)||l("update:modelValue",n),n})()),i=s((()=>e.disabled||e.disableMinus||+n.value<=+e.min)),I=s((()=>e.disabled||e.disablePlus||+n.value>=+e.max)),C=s((()=>({width:r(e.inputWidth),height:r(e.buttonSize)}))),F=s((()=>d(e.buttonSize))),z=l=>{e.beforeChange?V(e.beforeChange,{args:[l],done(){n.value=l}}):n.value=l},L=()=>{if("plus"===t&&I.value||"minus"===t&&i.value)return void l("overlimit",t);const u="minus"===t?-e.step:+e.step,o=a(P(+n.value,u));z(o),l(t)},W=l=>{const a=l.target,{value:t}=a,{decimalLength:u}=e;let i=f(String(t),!e.integer);if(S(u)&&i.includes(".")){const e=i.split(".");i=`${e[0]}.${e[1].slice(0,+u)}`}e.beforeChange?a.value=String(n.value):T(t,i)||(a.value=i);const o=i===String(+i);z(o?+i:i)},N=a=>{var t;e.disableInput?null==(t=u.value)||t.blur():l("focus",a)},$=t=>{const u=t.target,i=a(u.value,e.autoFixed);u.value=String(i),n.value=i,x((()=>{l("blur",t),w()}))};let k,E;const j=()=>{E=setTimeout((()=>{L(),j()}),200)},H=l=>{e.longPress&&(clearTimeout(E),k&&y(l))},X=l=>{e.disableInput&&y(l)},q=l=>({onClick:e=>{y(e),t=l,L()},onTouchstartPassive:()=>{t=l,e.longPress&&(k=!1,clearTimeout(E),E=setTimeout((()=>{k=!0,L(),j()}),B))},onTouchend:H,onTouchcancel:H});return m((()=>[e.max,e.min,e.integer,e.decimalLength]),(()=>{const e=a(n.value);T(e,n.value)||(n.value=e)})),m((()=>e.modelValue),(e=>{T(e,n.value)||(n.value=a(e))})),m(n,(a=>{l("update:modelValue",a),l("change",a,{name:e.name})})),c((()=>e.modelValue)),()=>v("div",{role:"group",class:M([e.theme])},[p(v("button",g({type:"button",style:F.value,class:[M("minus",{disabled:i.value}),{[h]:!i.value}],"aria-disabled":i.value||void 0},q("minus")),null),[[b,e.showMinus]]),p(v("input",{ref:u,type:e.integer?"tel":"text",role:"spinbutton",class:M("input"),value:n.value,style:C.value,disabled:e.disabled,readonly:e.disableInput,inputmode:e.integer?"numeric":"decimal",placeholder:e.placeholder,"aria-valuemax":e.max,"aria-valuemin":e.min,"aria-valuenow":n.value,onBlur:$,onInput:W,onFocus:N,onMousedown:X},null),[[b,e.showInput]]),p(v("button",g({type:"button",style:F.value,class:[M("plus",{disabled:I.value}),{[h]:!I.value}],"aria-disabled":I.value||void 0},q("plus")),null),[[b,e.showPlus]])])}});e("S",I(F))}}}));
