import{A as e,B as t,C as n,D as r,Dt as i,E as a,Et as o,F as s,K as c,L as l,M as u,Ot as d,P as f,T as p,U as m,W as h,Y as g,b as ee,gt as _,it as v,kt as y,ot as b,q as x,rt as S,tt as C,vt as w,w as T,wt as E,z as D}from"./dist-B4ulKgpj.js";import{i as O}from"./Primitive-CN38JRWA.js";import{n as k}from"./wayfinder-CgqleRqW.js";import{F as A,P as j,f as M,g as N,h as P,p as F,v as I}from"./app-DUC9tg6Z.js";var L=`
[data-input-otp] {
  --nojs-bg: white !important;
  --nojs-fg: black !important;

  background-color: var(--nojs-bg) !important;
  color: var(--nojs-fg) !important;
  caret-color: var(--nojs-fg) !important;
  letter-spacing: .25em !important;
  text-align: center !important;
  border: 1px solid var(--nojs-fg) !important;
  border-radius: 4px !important;
  width: 100% !important;
}
@media (prefers-color-scheme: dark) {
  [data-input-otp] {
    --nojs-bg: black !important;
    --nojs-fg: white !important;
  }
}`,R=u({props:{fallback:{type:String,required:!0}},setup(e){return()=>s(`noscript`,{innerHTML:`<style>${e.fallback}</style>`})}}),z=Symbol(`vue-otp-context`);function B(e){return[setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)]}var V=18,H=40,U=`${H}px`,W=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function te({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:i}){let a=_({done:!1,refocused:!1}),o=_(!1),s=_(!1),c=_(!1),l=n(()=>r===`none`?!1:(r===`increase-width`||r===`experimental-no-flickering`)&&o.value&&s.value),u=()=>{let n=e.value,i=t.value;if(!n||!i||c.value||r===`none`)return;let s=n,l=s.getBoundingClientRect().left+s.offsetWidth,u=s.getBoundingClientRect().top+s.offsetHeight/2,d=l-V,f=u;if(!(document.querySelectorAll(W).length===0&&document.elementFromPoint(d,f)===n)&&(o.value=!0,c.value=!0,!a.value.refocused&&document.activeElement===i)){let e=[i.selectionStart,i.selectionEnd];i.blur(),i.focus(),i.setSelectionRange(e[0],e[1]),a.value.refocused=!0}},d=()=>{let t=e.value;!t||r===`none`||(s.value=window.innerWidth-t.getBoundingClientRect().right>=H)},f;return m(()=>{d(),f=setInterval(d,1e3)}),h(()=>{clearInterval(f)}),S([i,t],(e,t,n)=>{let[i,a]=e,o=i||document.activeElement===a;if(r===`none`||!o)return;let s=setTimeout(u,0),l=setTimeout(u,2e3),d=setTimeout(u,5e3),f=setTimeout(()=>{c.value=!0},6e3);n(()=>{clearTimeout(s),clearTimeout(l),clearTimeout(d),clearTimeout(f)})}),{hasPWMBadge:o,willPushPWMBadge:l,PWM_BADGE_SPACE_WIDTH:U}}var ne={style:{position:`absolute`,inset:`0`,"pointer-events":`none`}},re=[`value`,`data-input-otp-placeholder-shown`,`data-input-otp-mss`,`data-input-otp-mse`,`aria-placeholder`,`pattern`],G=u({name:`OTPInput`,inheritAttrs:!1,__name:`OTPInput`,props:D({maxlength:{},textAlign:{default:`left`},inputmode:{default:`numeric`},containerClass:{},pushPasswordManagerStrategy:{default:`increase-width`},noScriptCssFallback:{default:L},defaultValue:{default:``},pasteTransformer:{},accept:{},alt:{},autocomplete:{default:`one-time-code`},autofocus:{type:Boolean},capture:{type:[Boolean,String]},checked:{type:[Boolean,Array,Set]},crossorigin:{},disabled:{type:Boolean},enterKeyHint:{},form:{},formaction:{},formenctype:{},formmethod:{},formnovalidate:{type:Boolean},formtarget:{},height:{},indeterminate:{type:Boolean},list:{},max:{},min:{},minlength:{},multiple:{type:Boolean},name:{},pattern:{},placeholder:{},readonly:{type:Boolean},required:{type:Boolean},size:{},src:{},step:{},type:{},value:{},width:{}},{modelValue:{default(e){return e.defaultValue}},modelModifiers:{}}),emits:D([`complete`,`change`,`select`,`input`,`focus`,`blur`,`mouseover`,`mouseleave`,`paste`],[`update:modelValue`]),setup(e,{expose:i,emit:s}){let l=e,u=s,[f]=C(e,`modelValue`),_=N(f),y=n(()=>l.pattern?typeof l.pattern==`string`?new RegExp(l.pattern):l.pattern:null),b=w(!1),D=w(!1),O=w(null),k=w(null),j=w(null),L=w(null),V=F?.CSS?.supports?.(`-webkit-touch-callout`,`none`),H={prev:[j.value?.selectionStart,j.value?.selectionEnd,j.value?.selectionDirection]};function U(e,t){try{e.insertRule(t)}catch{console.error(`input-otp could not insert CSS rule:`,t)}}m(()=>{let e=j.value,t=L.value;if(!e||!t)return;H.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection??`none`];let n=P(M,`selectionchange`,r,{capture:!0});function r(){if(!e)return;if(M?.activeElement!==e){O.value=null,k.value=null;return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,o=H.prev,s=-1,c=-1,l;if(a.length!==0&&t!==null&&n!==null){let r=t===n,u=t===a.length&&a.length<i;if(r&&!u){let e=t;if(e===0)s=0,c=1,l=`forward`;else if(e===i)s=e-1,c=e,l=`backward`;else if(i>1&&a.length>1){let t=0;if(o[0]!==null&&o[1]!==null){l=e<o[1]?`backward`:`forward`;let n=o[0]===o[1]&&o[0]<i;l===`backward`&&!n&&(t=-1)}s=t+e,c=t+e+1}}s!==-1&&c!==-1&&s!==c&&e.setSelectionRange(s,c,l)}let u=s===-1?t:s,d=c===-1?n:c,f=l??r;O.value=u,k.value=d,H.prev=[u,d,f]}if(r(),M?.activeElement===e&&(D.value=!0),!M?.getElementById(`input-otp-style`)){let e=M?.createElement(`style`);if(e.id=`input-otp-style`,M?.head.appendChild(e),e.sheet){let t=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;U(e.sheet,`[data-input-otp]::selection { background: transparent !important; color: transparent !important; }`),U(e.sheet,`[data-input-otp]:autofill { ${t} }`),U(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),U(e.sheet,`@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),U(e.sheet,`[data-input-otp] + * { pointer-events: all !important; }`)}}let i=()=>{t&&t.style.setProperty(`--root-height`,`${e.clientHeight}px`)};i();let a=new ResizeObserver(i);a.observe(e),h(()=>{n(),a.disconnect()})}),S([f],()=>{B(()=>{if(!j.value)return;j.value?.dispatchEvent(new Event(`input`));let e=j.value?.selectionStart,t=j.value?.selectionEnd,n=j.value?.selectionDirection;e!==null&&t!==null&&(O.value=e??null,k.value=t??null,H.prev=[e,t,n])})},{immediate:!0}),v(()=>{_.value!==void 0&&f.value!==_.value&&_.value.length<l.maxlength&&f.value.length===l.maxlength&&u(`complete`,f.value)});let W=te({containerRef:L,inputRef:j,pushPasswordManagerStrategy:l.pushPasswordManagerStrategy,isFocused:D});function G(e){if(e.inputType===`insertText`&&e.data!==null){let t=e.currentTarget,n=t.selectionStart??0,r=t.selectionEnd??0,i=t.value,a=(n===r?i.slice(0,n)+e.data+i.slice(n):i.slice(0,n)+e.data+i.slice(r)).slice(0,l.maxlength);a.length>0&&y.value&&!y.value.test(a)&&e.preventDefault()}}function K(e){let t=e.currentTarget.value.slice(0,l.maxlength);if(t.length>0&&y.value&&!y.value.test(t)){e.preventDefault();return}typeof _.value==`string`&&t.length<_.value.length&&M?.dispatchEvent(new Event(`selectionchange`)),f.value=t,u(`input`,t)}function q(){let e=j.value;if(e){let t=Math.min(e.value.length,l.maxlength-1),n=e.value.length;e.setSelectionRange(t,n),O.value=t,k.value=n}D.value=!0}function J(e){let t=j.value;if(!t||!l.pasteTransformer&&(!V||!e.clipboardData||!t))return;let n=e?.clipboardData?.getData(`text/plain`),r=l?.pasteTransformer?l.pasteTransformer(n):n;e.preventDefault();let i=j.value?.selectionStart,a=j.value?.selectionEnd,o=(i===a?f.value.slice(0,i)+r+f.value.slice(i):f.value.slice(0,i)+r+f.value.slice(a)).slice(0,l.maxlength);if(o.length>0&&y.value&&!y.value.test(o))return;f.value=o,u(`input`,o);let s=Math.min(o.length,l.maxlength-1),c=o.length;t?.setSelectionRange(s,c),O.value=s,k.value=c}let Y=A(I(l,`containerClass`,`value`,`pattern`,`defaultValue`,`pushPasswordManagerStrategy`,`noScriptCssFallback`,`modelValue`)),X=n(()=>({position:`relative`,cursor:l.disabled?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`})),Z=n(()=>({position:`absolute`,inset:0,width:W.willPushPWMBadge.value?`calc(100% + ${W.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:W.willPushPWMBadge.value?`inset(0 ${W.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:l.textAlign,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`})),Q=n(()=>({slots:Array.from({length:Number(l.maxlength)}).map((e,t)=>{let n=D.value&&O.value!==null&&k.value!==null&&(O.value===k.value&&t===O.value||t>=O.value&&t<k.value),r=f.value[t]===void 0?null:f.value[t];return{char:r,placeholderChar:r??l?.placeholder?.[t]??null,isActive:n,hasFakeCaret:n&&r===null}}),isFocused:D.value,isHovering:!l.disabled&&b.value}));return x(z,Q),i(Object.defineProperty({},`$el`,{enumerable:!0,configurable:!0,get:()=>j})),(n,i)=>(c(),r(ee,null,[e.noScriptCssFallback===null?a(`v-if`,!0):(c(),p(E(R),{key:0,fallback:e.noScriptCssFallback},null,8,[`fallback`])),T(`div`,{ref_key:`containerRef`,ref:L,"data-input-otp-container":``,style:d(X.value),class:o(e.containerClass)},[g(n.$slots,`default`,{slots:Q.value.slots,isFocused:D.value,isHovering:!e.disabled&&b.value}),T(`div`,ne,[T(`input`,t({ref_key:`inputRef`,ref:j,value:E(f),"data-input-otp":``,"data-input-otp-placeholder-shown":E(f).length===0||void 0,"data-input-otp-mss":O.value,"data-input-otp-mse":k.value,"aria-placeholder":e.placeholder,style:Z.value,pattern:y.value?.source},{...n.$attrs,...E(Y)},{onBeforeinput:G,onMouseover:i[0]||=e=>{b.value=!0,u(`mouseover`,e)},onMouseleave:i[1]||=e=>{b.value=!1,u(`mouseleave`,e)},onPaste:i[2]||=e=>{J(e),u(`paste`,e)},onInput:K,onFocus:i[3]||=e=>{q(),u(`focus`,e)},onBlur:i[4]||=e=>{D.value=!1,u(`blur`,e)}}),null,16,re)])],6)],64))}});function K(){return l(z)}var q=u({__name:`InputOTP`,props:{maxlength:{},textAlign:{},inputmode:{},containerClass:{},pushPasswordManagerStrategy:{},noScriptCssFallback:{},defaultValue:{},pasteTransformer:{type:Function},accept:{},alt:{},autocomplete:{},autofocus:{type:Boolean},capture:{type:[Boolean,String]},checked:{type:[Boolean,Array,Set]},crossorigin:{},disabled:{type:Boolean},enterKeyHint:{},form:{},formaction:{},formenctype:{},formmethod:{},formnovalidate:{type:Boolean},formtarget:{},height:{},indeterminate:{type:Boolean},list:{},max:{},min:{},minlength:{},multiple:{type:Boolean},name:{},pattern:{},placeholder:{},readonly:{type:Boolean},required:{type:Boolean},size:{},src:{},step:{},type:{},value:{},width:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`complete`,`change`,`select`,`input`,`focus`,`blur`,`mouseover`,`mouseleave`,`paste`],setup(e,{emit:n}){let r=e,a=n,o=j(I(r,`class`),a);return(e,n)=>(c(),p(E(G),t(E(o),{"container-class":E(O)(`flex items-center gap-2 has-disabled:opacity-50`,r.class),"data-slot":`input-otp`,class:`disabled:cursor-not-allowed`}),{default:b(t=>[g(e.$slots,`default`,i(f(t)))]),_:3},16,[`container-class`]))}}),J=u({__name:`InputOTPGroup`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let n=e,i=A(I(n,`class`));return(e,a)=>(c(),r(`div`,t({"data-slot":`input-otp-group`},E(i),{class:E(O)(`flex items-center`,n.class)}),[g(e.$slots,`default`)],16))}}),Y=[`data-active`],X={key:0,class:`pointer-events-none absolute inset-0 flex items-center justify-center`},Z=u({__name:`InputOTPSlot`,props:{index:{},class:{type:[Boolean,null,String,Object,Array]}},setup(i){let o=i,s=A(I(o,`class`)),l=K(),u=n(()=>l?.value.slots[o.index]);return(n,i)=>(c(),r(`div`,t(E(s),{"data-slot":`input-otp-slot`,"data-active":u.value?.isActive,class:E(O)(`data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]`,o.class)}),[e(y(u.value?.char)+` `,1),u.value?.hasFakeCaret?(c(),r(`div`,X,[...i[0]||=[T(`div`,{class:`animate-caret-blink bg-foreground h-4 w-px duration-1000`},null,-1)]])):a(``,!0)],16,Y))}}),Q=e=>({url:Q.url(e),method:`post`});Q.definition={methods:[`post`],url:`/two-factor-challenge`},Q.url=e=>Q.definition.url+k(e),Q.post=e=>({url:Q.url(e),method:`post`});var $=e=>({action:Q.url(e),method:`post`});$.post=e=>({action:Q.url(e),method:`post`}),Q.form=$;var ie={store:Object.assign(Q,Q)};export{q as a,J as i,Q as n,Z as r,ie as t};