import{_ as q}from"./BK_BLNxW.js";import{v as z,M as A,q as M,r as p,x as $,j as D,y as s,c as w,o as d,b as o,a as r,m as a,w as t,l as k,t as I,D as b,d as m,I as P}from"./CQHo_aHN.js";import{a as F}from"./DTD-Bmou.js";import{u as H}from"./BBkQyLon.js";import{u as G}from"./CU-5m29H.js";import"./B-gxyKwS.js";import"./DlAUqK2U.js";import"./pwbP0T5r.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=z(),x=A(),h=M(),_=x.params.code||x.query.code,n=p(!0),c=p(!1),u=p("Aguarde, verificando as informações..."),{handlePasswordRecoveryError:C}=H(),{logoSrc:E}=([i,f]=$(()=>G()),i=await i,f(),i),V=()=>{h.push("/login")},B=()=>{console.warn("Erro ao carregar logo")};return D(async()=>{if(!_){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:_,login:_},{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=q,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"),j=s("v-card");return d(),w(P,null,[o(N),r("div",J,[r("div",K,[r("div",O,[r("img",{src:a(E),class:"max-h-16 w-auto pt-2",onError:B},null,40,Q)]),o(j,{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(),w("div",U,[o(S,{indeterminate:"",color:"primary",size:"48",class:"mb-4"})])):k("",!0),r("p",W,I(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:V,class:"px-8"},{default:t(()=>[o(g,{left:""},{default:t(()=>e[2]||(e[2]=[m("mdi-lock")])),_:1,__:[2]}),e[3]||(e[3]=m(" 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]=[m("mdi-arrow-left")])),_:1,__:[4]}),e[5]||(e[5]=m(" Voltar ao Login "))]),_:1,__:[5]})):k("",!0)]),_:1})]),_:1})])])],64)}}};export{ce as default};
