import{r as x,T as g,G as w,c as a,a as t,f as m,g as f,u as n,t as r,k as p,h as v,n as b,K as d,o as i,l as h}from"./app-a39c937f.js";import{_ as k}from"./FormInput-4b7fa008.js";import{l as C}from"./index-80d9f634.js";const V={class:"flex h-screen justify-center"},$={class:"flex justify-center"},A={class:"w-[20em] mt-40"},j={class:"flex justify-center mb-5"},B=["src","alt"],L={key:1,class:"text-2xl mb-2"},N={class:"text-2xl text-center"},S={class:"text-center text-sm text-slate-500"},T={class:"mt-5 space-y-4"},M={class:"mt-6"},Z={key:0,type:"submit",class:"rounded-md bg-primary px-3 py-3 text-sm text-white shadow-sm w-full"},F={key:1,type:"button",class:"rounded-md bg-primary px-3 py-3 text-sm text-white shadow-sm w-full flex justify-center"},G={__name:"Tfa",props:["flash","config","companyConfig"],setup(y){const l=y,c=x(!1),o=g({token:null}),_=async e=>{c.value=!0,o.post("/tfa",{onSuccess:()=>o.reset(),onFinish:()=>{c.value=!1}})};return w(()=>[d().props.flash,{deep:!0}],()=>{d().props.flash.status!=null&&C(d().props.flash.status.message,{autoClose:3e3})}),(e,s)=>(i(),a("div",V,[t("div",$,[t("div",A,[t("div",j,[m(n(h),{href:"/"},{default:f(()=>[l.companyConfig.logo?(i(),a("img",{key:0,class:"max-w-[180px]",src:"/media/"+l.companyConfig.logo,alt:l.companyConfig.company_name},null,8,B)):(i(),a("h4",L,r(l.companyConfig.company_name),1))]),_:1})]),t("h1",N,r(e.$t("Login to your account")),1),t("div",S,[p(r(e.$t("Switch account?"))+" ",1),m(n(h),{href:"logout/tfa",class:"text-sm text-primary-600 dark:text-primary-500 border-b hover:border-gray-500"},{default:f(()=>[p(r(e.$t("Logout")),1)]),_:1})]),t("form",{onSubmit:s[1]||(s[1]=v(u=>_(),["prevent"])),class:"mt-5"},[t("div",T,[m(k,{modelValue:n(o).token,"onUpdate:modelValue":s[0]||(s[0]=u=>n(o).token=u),name:e.$t("Verification Code"),error:n(o).errors.token,type:"text",class:b("col-span-3")},null,8,["modelValue","name","error"])]),t("div",M,[c.value?(i(),a("button",F,s[2]||(s[2]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[t("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"}),t("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[t("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})])],-1)]))):(i(),a("button",Z,r(e.$t("Login to your account")),1))])],32)])])]))}};export{G as default};
