(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[363],{4833:function(e,s,t){Promise.resolve().then(t.bind(t,724))},724:function(e,s,t){"use strict";t.r(s);var r=t(7821),n=t(9164),a=t(3153),o=t(6712),i=t(1736),u=t(3984),d=t(6447),c=t(7558),l=t(1853),m=t(9881),p=t(4089),f=t(8504),g=t(8078),v=t(746),h=t(9912);s.default=()=>{let e=(0,f.useRouter)(),[s,t]=(0,g.useState)(!1),x=h.z.object({activation_code:h.z.string({required_error:"Veuillez renseigner le code d'activation"}),password:m.r}),b=(0,v.cI)({resolver:(0,p.F)(x),mode:"onChange"});async function j(s){try{t(!0);let r=await (0,n.u7z)({body:{reset_token:s.activation_code,new_password:s.password}});if(t(!1),r.response.status<300){e.push("/reset-password/success");return}(0,l.Am)({title:"Erreur",description:r.error.detail,variant:"destructive"})}catch(e){t(!1),(0,l.Am)({title:"Erreur",description:"".concat(e),variant:"destructive"})}}return(0,r.jsx)(a.G,{title:"R\xe9initialiser le mot de passe",description:"Entrez votre nouveau mot de passe",children:(0,r.jsx)(c.l0,{...b,children:(0,r.jsx)("form",{onSubmit:b.handleSubmit(j),children:(0,r.jsxs)("div",{className:"grid gap-4",children:[(0,r.jsx)(d.D,{form:b,name:"activation_code",queryParam:"reset_token"}),(0,r.jsx)(o.T,{form:b,name:"password",label:"Mot de passe",render:e=>(0,r.jsx)(u.S,{autoFocus:!0,...e})}),(0,r.jsx)(i.f,{type:"submit",className:"mt-2 w-full",label:"R\xe9initialiser le mot de passe",isLoading:s})]})})})})}},8676:function(e,s,t){"use strict";t.d(s,{W:function(){return u}});var r=t(7821),n=t(5231),a=t(7211),o=t(8078),i=t(6963);let u=o.forwardRef((e,s)=>{let{className:t,...u}=e,[d,c]=o.useState(!1),l=()=>c(!d);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(n.I,{type:d?"text":"password",className:(0,a.cn)(t),ref:s,...u}),(0,r.jsx)("div",{className:"absolute inset-y-0 right-0 flex cursor-pointer items-center pr-3 text-gray-400 hover:text-[hsl(var(--ring))]",children:d?(0,r.jsx)(i.Rbo,{className:"h-4 w-4",onClick:l}):(0,r.jsx)(i.MBb,{className:"h-4 w-4",onClick:l})})]})});u.displayName="PasswordInput"},3984:function(e,s,t){"use strict";t.d(s,{S:function(){return i}});var r=t(7821),n=t(8676),a=t(5374),o=t(8078);let i=o.forwardRef((e,s)=>{let{...t}=e,[i,u]=o.useState(0),d=t.onChange;return t.onChange=e=>{d&&(u((0,a.tu)(e.target.value).score),d(e))},(0,r.jsxs)("div",{children:[(0,r.jsx)(n.W,{...t,ref:s}),(0,r.jsx)("div",{className:"grid grid-flow-col justify-stretch gap-4 mt-4 px-1",children:[void 0,void 0,void 0,void 0,void 0].map((e,s)=>{var n,a;return(0,r.jsx)("div",{className:"px-1 h-2 rounded-xl transition-colors ".concat((null===(a=t.value)||void 0===a?void 0:null===(n=a.toString())||void 0===n?void 0:n.length)&&!(i<s)?["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-400","bg-green-400"][i]:"bg-gray-200")},s)})})]})});i.displayName="PasswordInputWithStrength"},9686:function(e,s,t){"use strict";t.d(s,{F:function(){return a}});var r=t(7821),n=t(8078);let a=e=>{let{children:s}=e;return(0,r.jsx)(n.Suspense,{fallback:(0,r.jsx)(r.Fragment,{}),children:s})}},6447:function(e,s,t){"use strict";t.d(s,{D:function(){return d}});var r=t(7821),n=t(7558),a=t(8504),o=t(8078);let i=e=>{let{form:s,queryParam:t,name:i,optional:u=!1}=e,d=(0,a.useSearchParams)().get(t),c=(0,a.useRouter)();return(0,o.useEffect)(()=>{u||d?d&&s.setValue(i,d):(console.error("Missing required query parameter: ".concat(t)),c.push(encodeURI("/message?type=missing_query_param")))}),(0,r.jsx)(n.Wi,{control:s.control,name:i,render:e=>{let{field:s}=e;return(0,r.jsx)("input",{type:"hidden",...s})}})};var u=t(9686);let d=e=>{let{form:s,queryParam:t,name:n,optional:a=!1}=e;return(0,r.jsx)(u.F,{children:(0,r.jsx)(i,{form:s,name:n,queryParam:t,optional:a})})}},9881:function(e,s,t){"use strict";t.d(s,{r:function(){return c}});var r=t(5374),n=t(6574),a=t(4814),o=t(7932),i=t(7028),u=t(9912);let d={translations:o.Z,graphs:n.x,dictionary:{...n.F,...a.F,...i.F}};r.Mu.setOptions(d);let c=u.z.string({required_error:"Le mot de passe n'est pas assez fort"}).superRefine((e,s)=>{let t=(0,r.tu)(e||"");t.score>=4||(t.feedback.warning?s.addIssue({code:u.z.ZodIssueCode.custom,message:t.feedback.warning}):t.feedback.suggestions.length?s.addIssue({code:u.z.ZodIssueCode.custom,message:t.feedback.suggestions[0]}):s.addIssue({code:u.z.ZodIssueCode.custom,message:"Le mot de passe n'est pas assez fort"}))})}},function(e){e.O(0,[322,382,314,726,393,792,819,874,807,282,506,37,164,115,364,744],function(){return e(e.s=4833)}),_N_E=e.O()}]);