import{r as h,z as y,c as C,j as s,s as L,L as w}from"./index-BhJeFDTB.js";import{P as N}from"./PublicWrapper-Bptf37DT.js";import{u as S,a as _,s as A,U as F}from"./Form-DmD42TqF.js";import{B as R}from"./button.esm-DWW_mTBz.js";import{U}from"./UiInputText.component-CAsjMEmX.js";import{u as $}from"./useToast-B8sh5C8k.js";import"./inputtext.esm-CLzH7lor.js";const B=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),P=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),v=e=>{const t=P(e);return t.charAt(0).toUpperCase()+t.slice(1)},k=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),I=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var V={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const W=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...l},p)=>h.createElement("svg",{ref:p,...V,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:k("lucide",n),...!o&&!I(l)&&{"aria-hidden":"true"},...l},[...i.map(([c,f])=>h.createElement(c,f)),...Array.isArray(o)?o:[o]]));const q=(e,t)=>{const a=h.forwardRef(({className:r,...n},o)=>h.createElement(W,{ref:o,iconNode:t,className:k(`lucide-${B(v(e))}`,`lucide-${e}`,r),...n}));return a.displayName=v(e),a};const z=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],M=q("arrow-left",z),T=y.object({email:y.string().min(1)}),Z=()=>{const e=C.c(24),t=$();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={resolver:A(T),defaultValues:{email:""}},e[0]=a):a=e[0];const r=S(a);let n;e[1]!==r||e[2]!==t?(n=()=>{r.reset(),t.success({detail:"Link de recuperação enviado! Verifique seu e-mail."})},e[1]=r,e[2]=t,e[3]=n):n=e[3];let o;e[4]!==t?(o=g=>{t.error({detail:g.response?.data?.message||"Erro ao enviar link de recuperação."})},e[4]=t,e[5]=o):o=e[5];let i;e[6]!==n||e[7]!==o?(i={mutationFn:K,onSuccess:n,onError:o},e[6]=n,e[7]=o,e[8]=i):i=e[8];const{mutate:l,isPending:p}=_(i);let c;e[9]!==l?(c=function(E){l(E)},e[9]=l,e[10]=c):c=e[10];const f=c;let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"border-l-2 border-(--primary-color) pl-2",children:s.jsx("h6",{children:"Insira seu e-mail abaixo para recuperar seus acessos"})}),e[11]=x):x=e[11];let m;e[12]!==r?(m=r.register("email"),e[12]=r,e[13]=m):m=e[13];const b=r.formState.errors.email?.message;let u;e[14]!==m||e[15]!==b?(u=s.jsx("div",{className:"flex flex-col gap-5 my-9 max-sm:my-10",children:s.jsx(U,{id:"email",label:"E-mail",...m,error:b,required:!0})}),e[14]=m,e[15]=b,e[16]=u):u=e[16];let d;e[17]!==p?(d=s.jsx("div",{className:"flex flex-col gap-3 text-center",children:s.jsx(R,{type:"submit",className:"justify-center",loading:p,children:"Enviar Link"})}),e[17]=p,e[18]=d):d=e[18];let j;return e[19]!==r||e[20]!==f||e[21]!==u||e[22]!==d?(j=s.jsx(s.Fragment,{children:s.jsxs(F,{methods:r,onSubmit:f,children:[x,u,d]})}),e[19]=r,e[20]=f,e[21]=u,e[22]=d,e[23]=j):j=e[23],j};function H(e){if(!e.data.token)throw new Error("E-mail inválido.")}async function K(e){return await L.auth.recuperarSenha(e).then(H)}function ee(){const e=C.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(s.Fragment,{children:s.jsxs(N,{size:"1/2",className:"[&>h2]:text-bold!",children:[s.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[s.jsx(w,{to:"/acessar",type:"button",children:s.jsx(M,{})}),s.jsx("span",{className:"text-[rgba(0, 48, 73, 1)]",children:"Voltar ao"}),s.jsx(w,{to:"/acessar",type:"button",className:"underline",children:"Login"})]}),s.jsx("h1",{className:"py-10",children:"Bem Vindo!"}),s.jsx(Z,{})]})}),e[0]=t):t=e[0],t}export{ee as component};
