import{v as g,r as c,x as y,c as h,o as x,a as s,m as l,d as u,C as _,z as b,A as v,B as E,t as w}from"./Bh30i5oR.js";import{a as A}from"./DJivVT1h.js";import{u as I}from"./BP8_MOlH.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:_(p,["prevent"])},[s("div",D,[b(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>E(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),[[v,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 _};
