import{_ as z}from"./BEzNrT7f.js";import{q as A,M,l as $,r as p,s as j,G as I,v as s,c as k,o as d,b as o,a as r,k as a,w as t,C as w,t as P,B as b,d as _,I as D}from"./BpDVC-Oo.js";import{a as F}from"./ChaLeZb-.js";import{u as G}from"./BBkQyLon.js";import{u as H}from"./Bbtohs3j.js";import"./DhjIdhCy.js";import"./DlAUqK2U.js";import"./C0JZ2vpu.js";const J={class:"flex min-h-screen bg-white"},K={class:"w-full px-6 pt-10 2xl:pt-20"},O={class:"flex items-center justify-center pb-12 pt-4"},Q=["src"],U={key:0,class:"py-4"},W={class:"text-gray-600"},ce={__name:"[code]",async setup(X){let i,f;const v=A(),x=M(),h=$(),m=x.params.code||x.query.code,n=p(!0),c=p(!1),u=p("Aguarde, verificando as informações..."),{handlePasswordRecoveryError:C}=G(),{logoSrc:B}=([i,f]=j(()=>H()),i=await i,f(),i),E=()=>{h.push("/login")},V=()=>{console.warn("Erro ao carregar logo")};return I(async()=>{if(!m){u.value="Link de confirmação inválido. Verifique o link recebido por email.",n.value=!1,c.value=!1;return}try{const l={nome:m,login:m},{resetPasswordConfirm:e}=F();await e(l),c.value=!0,u.value="Recuperação de senha foi executada com sucesso.",v.success("Recuperação confirmada com sucesso.",{timeout:3e3})}catch(l){c.value=!1;const e=C(l,v);u.value=`${e} Tente acessar o link novamente ou solicite uma nova recuperação de senha.`}finally{n.value=!1}}),(l,e)=>{const N=z,R=s("v-card-title"),S=s("v-progress-circular"),L=s("v-card-text"),g=s("v-icon"),y=s("v-btn"),T=s("v-card-actions"),q=s("v-card");return d(),k(D,null,[o(N),r("div",J,[r("div",K,[r("div",O,[r("img",{src:a(B),class:"max-h-16 w-auto pt-2",onError:V},null,40,Q)]),o(q,{class:"mx-auto max-w-md",elevation:"0"},{default:t(()=>[o(R,{class:"text-center"},{default:t(()=>e[1]||(e[1]=[r("h2",{class:"text-2xl font-bold",style:{color:"var(--primary)"}},"Confirmação",-1)])),_:1,__:[1]}),o(L,{class:"text-center"},{default:t(()=>[a(n)?(d(),k("div",U,[o(S,{indeterminate:"",color:"primary",size:"48",class:"mb-4"})])):w("",!0),r("p",W,P(a(u)),1)]),_:1}),o(T,{class:"justify-center pb-6"},{default:t(()=>[a(c)&&!a(n)?(d(),b(y,{key:0,color:"#273499",variant:"elevated",size:"large",onClick:E,class:"px-8"},{default:t(()=>[o(g,{left:""},{default:t(()=>e[2]||(e[2]=[_("mdi-lock")])),_:1,__:[2]}),e[3]||(e[3]=_(" Acessar "))]),_:1,__:[3]})):!a(n)&&!a(c)?(d(),b(y,{key:1,color:"secondary",variant:"outlined",size:"large",onClick:e[0]||(e[0]=Y=>l.$router.push("/login")),class:"px-8"},{default:t(()=>[o(g,{left:""},{default:t(()=>e[4]||(e[4]=[_("mdi-arrow-left")])),_:1,__:[4]}),e[5]||(e[5]=_(" Voltar ao Login "))]),_:1,__:[5]})):w("",!0)]),_:1})]),_:1})])])],64)}}};export{ce as default};
