import{e as I,r as h,Q as z,b as A,n as d,p as g,D,w as B,f as S,X as C,M as E,g as p,aj as F,J as j,Y as v,aO as O}from"./jwt-decode.esm-BYfS37aG.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[r]="6035f843-d34f-4961-91ce-7647561e0f07",l._sentryDebugIdIdentifier="sentry-dbid-6035f843-d34f-4961-91ce-7647561e0f07")}catch{}})();const T=I({__name:"OTPInput",props:{value:{},length:{},masked:{type:Boolean},numeric:{type:Boolean},size:{}},emits:["update:value","collect-token"],setup(l,{emit:r}){const o=l,f=r,a=h(Array(o.length).fill("")),n=h([]),y=(e,t)=>{switch(e.key){case"Delete":case"Backspace":w(t);break;case"ArrowLeft":k(t);break;case"ArrowRight":_(t);break;case"Enter":f("collect-token");break}},m=(e,t)=>{let s=e.target.value??"";for(a.value[t].length>0&&s.length>1&&(s=s.slice(1)),o.numeric&&(s=s.replace(/\D/g,""));t<o.length&&s.length;)a.value[t++]=s.charAt(0),s=s.slice(1);f("update:value",a.value.join("").trim()),t-1<o.length-1&&a.value[t-1]!==""&&v(()=>n.value[t].focus())},w=e=>{const t=a.value[e]==="";a.value[e]="",f("update:value",a.value.join("").trim()),a.value[e]===""&&e>0&&t&&v(()=>n.value[e-1].focus())},k=async e=>{e>0&&(n.value[e-1].focus(),i(e-1))},_=async e=>{e<o.length-1&&n.value[e+1].focus()},i=e=>{requestAnimationFrame(()=>{n.value[e].setSelectionRange(1,1)})};z(()=>{n.value.length>0&&n.value[0].focus()});const b=A(()=>({small:{width:"27px",height:"30px",fontSize:"14px"},middle:{width:"32.4px",height:"36px",fontSize:"16px"},large:{width:"39.6px",height:"44px",fontSize:"18px"}})[o.size||"middle"]);return(e,t)=>(p(),d(g(D),{gap:"small",justify:"center"},{default:B(()=>[(p(!0),S(E,null,C(a.value,(s,u)=>(p(),d(g(F),{key:u,ref_for:!0,ref_key:"inputs",ref:n,value:a.value[u],type:l.masked?"password":"text",style:j(b.value),class:"otp-input",onFocus:c=>i(u),onChange:c=>m(c,u),onKeydown:c=>y(c,u)},null,8,["value","type","style","onFocus","onChange","onKeydown"]))),128))]),_:1}))}}),L=O(T,[["__scopeId","data-v-185f3e56"]]);export{L as O};
//# sourceMappingURL=OTPInput-B76NLryy.js.map
