import{u as C,c as r,a as o,g as t,k as w,w as f,b as d,o as s,F as l,d as n,t as i,l as _,n as V,j as y,z as x}from"./app-CYVHboi-.js";import{_ as g}from"./TextInput-CMrw-9XJ.js";import{_ as k}from"./InputError-u5FIXCwc.js";import{_ as b}from"./InputLabel-dHPaqRUC.js";import{_ as F}from"./PrimaryButton-BQjI7rS_.js";import{A as I}from"./AuthenticationCard-D7b9cu3J.js";import{_ as T}from"./AuthenticationCardLogo-DuIUHL9t.js";import"./browser-BwNzv7vE.js";import"./ApplicationLogo-DRGlNRtq.js";const U={class:"mb-4 text-sm text-gray-600 dark:text-gray-400"},B={key:0},N={key:1},j={class:"mt-4 flex items-center justify-end"},G={__name:"TwoFactorChallenge",setup(z){const c=y(!1),e=C({code:"",recovery_code:""}),p=y(null),v=y(null),$=async()=>{c.value^=!0,await x(),c.value?(p.value.focus(),e.code=""):(v.value.focus(),e.recovery_code="")},h=()=>{e.post(route("two-factor.login"))};return(a,u)=>(s(),r(l,null,[o(t(w),{title:a.$t("Two-factor Confirmation")},null,8,["title"]),o(I,null,{logo:f(()=>[o(T)]),default:f(()=>[d("div",U,[c.value?(s(),r(l,{key:1},[n(i(a.$t("Please confirm access to your account by entering one of your emergency recovery codes.")),1)],64)):(s(),r(l,{key:0},[n(i(a.$t("Please confirm access to your account by entering the authentication code provided by your authenticator application.")),1)],64))]),d("form",{onSubmit:_(h,["prevent"])},[c.value?(s(),r("div",N,[o(b,{for:"recovery_code",value:a.$t("Recovery Code")},null,8,["value"]),o(g,{type:"text",id:"recovery_code",ref_key:"recoveryCodeInput",ref:p,class:"mt-1 block w-full",autocomplete:"one-time-code",modelValue:t(e).recovery_code,"onUpdate:modelValue":u[1]||(u[1]=m=>t(e).recovery_code=m)},null,8,["modelValue"]),o(k,{class:"mt-2",message:t(e).errors.recovery_code},null,8,["message"])])):(s(),r("div",B,[o(b,{for:"code",value:a.$t("Code")},null,8,["value"]),o(g,{id:"code",autofocus:"",type:"text",ref_key:"codeInput",ref:v,modelValue:t(e).code,"onUpdate:modelValue":u[0]||(u[0]=m=>t(e).code=m),inputmode:"numeric",class:"mt-1 block w-full",autocomplete:"one-time-code"},null,8,["modelValue"]),o(k,{class:"mt-2",message:t(e).errors.code},null,8,["message"])])),d("div",j,[d("button",{type:"button",class:"cursor-pointer text-sm text-gray-600 underline hover:text-gray-900 dark:text-gray-400",onClick:_($,["prevent"])},[c.value?(s(),r(l,{key:1},[n(i(a.$t("Use an authentication code")),1)],64)):(s(),r(l,{key:0},[n(i(a.$t("Use a recovery code")),1)],64))]),o(F,{class:V(["ms-4",{"opacity-25":t(e).processing}]),disabled:t(e).processing},{default:f(()=>[n(i(a.$t("Log in")),1)]),_:1},8,["class","disabled"])])],32)]),_:1})],64))}};export{G as default};
