1import{j as e,T as m,B as c,o as u,ad as p,b_ as v}from"./main-Bf_5ilwB.js";import{E as h}from"./EmailAndConfirmation-vWNaEKnk.js";import{u as E,F as b,S as y}from"./Send-7tGH8nYm.js";import{t as S,o as g,s as d}from"./zod-M6Q0VA55.js";import{I as M}from"./InteractiveButton-DBRm7g1G.js";import{T as f}from"./TextAlert-O9NOewsZ.js";const C=g({email:d().min(1,{message:u._("Ce champ est requis.")}).email(u._("Veuillez renseigner un courriel correct.")),confirmationCourriel:d()});function I({update:i,isLoading:r,mail:n}){const t={email:n,confirmationCourriel:n},o=E({resolver:S(C),values:t}),{handleSubmit:l,setValue:a}=o,s=j=>{i(j.email).unwrap().then(()=>{a("confirmationCourriel","")})};return e.jsxs(e.Fragment,{children:[e.jsx("br",{}),n===""&&e.jsx(m,{id:"Veuillez saisir votre adresse courriel pour procéder à la mise à jour de vos informations via le formulaire de première connexion."}),e.jsx(b,{...o,children:e.jsxs(c,{component:"form",noValidate:!0,autoComplete:"off",onSubmit:l(s),children:[e.jsx(h,{confirmationMailEnAttente:"",initMail:n,setShowConfirmationEmail:()=>"",setStyleEmail:()=>"",showConfirmationEmail:!0,styleEmail:void 0}),e.jsx("br",{}),e.jsx(c,{component:"div",sx:{mt:"1rem"},children:e.jsx(M,{disabled:!1,variant:"contained",fullWidth:!0,type:"submit",loading:r,sx:{py:"0.8rem"},message:"Envoyer",startIcon:e.jsx(y,{})})})]})})]})}function x(){return e.jsx(f,{severity:"success",children:e.jsx(m,{id:"Accédez maintenant à votre boîte mail pour valider le mail et continuer la procédure de première connexion."})})}function _(){const{data:i}=p(),[r,{isLoading:n,isError:t,isSuccess:o,data:l}]=v(),a=s=>r({mail:s});return o?e.jsx(x,{}):e.jsxs(e.Fragment,{children:[(i==null?void 0:i.modificationEmail)!==""&&e.jsx(f,{severity:"info",children:e.jsx(m,{id:"Un courriel a déjà été envoyé à {0} afin de valider votre adresse mail. En cas d'erreur ou de changement, vous pouvez renseigner une nouvelle adresse mail.",values:{0:i==null?void 0:i.modificationEmail}})}),e.jsx(I,{update:a,isLoading:n,isSuccess:o,isError:t,mail:(i==null?void 0:i.modificationEmail)||""})]})}const B=Object.freeze(Object.defineProperty({__proto__:null,IniMailSuccess:x,default:_},Symbol.toStringTag,{value:"Module"}));export{x as I,I as a,B as b};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.