import{A as g,r as c,B as y,c as h,o as x,a as s,p as l,d as u,G as E,l as _,D as b,E as v,t as w}from"./UpFGpe05.js";import{a as A}from"./B2llNqhU.js";import{u as I}from"./DsXiT_L-.js";const S={class:"flex bg-gray-100"},N={class:"w-full px-6 pt-10 2xl:pt-20"},R={class:"flex items-center justify-center pb-12 pt-4"},O=["src"],D={class:"flex flex-col items-center gap-6 pt-8 md:pb-5"},M=["disabled"],L={__name:"PasswordRecovery",async setup(U){let r,n;const d=g(),a=c(""),i=c(!1),{logoSrc:m}=([r,n]=y(()=>I()),r=await r,n(),r),p=async()=>{var o,e;if(a.value){i.value=!0;try{const{resetPassword:t}=A();await t({login:a.value}),d.success("Sua solicitação de alteração de senha ao SisDemanda foi realizada com sucesso. Verifique a caixa de entrada do email para confirmação.",{timeout:6e3})}catch(t){const f=((e=(o=t.response)==null?void 0:o.data)==null?void 0:e.message)||"Erro ao solicitar recuperação de senha";d.error(f,{timeout:3e3})}finally{i.value=!1}}};return(o,e)=>(x(),h("div",S,[s("div",N,[s("div",R,[s("img",{src:l(m),class:"max-h-16 w-auto pt-2",onError:e[0]||(e[0]=(...t)=>o.handleImageError&&o.handleImageError(...t))},null,40,O)]),e[2]||(e[2]=s("p",{class:"text-md text-center font-light text-gray-600"},[u(" INFORME SEU E-MAIL OU NOME DE USUÁRIO ABAIXO PARA SOLICITAR A"),s("br"),u(" RECUPERAÇÃO DA SENHA. ")],-1)),s("form",{onSubmit:E(p,["prevent"])},[s("div",D,[_(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>v(a)?a.value=t:null),type:"text",placeholder:"E-mail ou usuário",class:"focus:ring-primary border-mediumGray bg-lightGray h-10 w-80 rounded-md border py-2 pl-10 shadow-xl focus:outline-none focus:ring-2",required:""},null,512),[[b,l(a)]]),s("button",{type:"submit",disabled:l(i),class:"w-80 rounded-md py-2 font-bold text-white shadow-md transition-colors disabled:opacity-50",style:{backgroundColor:"var(--primary)"}},w(l(i)?"ENVIANDO...":"ENVIAR LINK"),9,M)])],32)])]))}};export{L as _};
