import{f as J}from"./chunk-QWKADPWV.js";import"./chunk-2Y3X2RE2.js";import"./chunk-GATRAUGC.js";import"./chunk-IPB45UXV.js";import"./chunk-E6DFULXS.js";import"./chunk-RE4FBLFQ.js";import"./chunk-P77PKJGX.js";import{A as D,D as L,N as V,O as A,P as G,Y as H,l as O,u as R,x as W,z as j}from"./chunk-YEFQA5EZ.js";import{c as U,e as z}from"./chunk-KNXXDNCS.js";import"./chunk-6QA6JGM2.js";import{ma as T,na as E,oa as F,pa as B,qa as N,va as k,z as M,za as q}from"./chunk-J77R5Y4O.js";import"./chunk-2OWRLCO4.js";import{$b as c,Bb as I,Cb as _,Ia as t,Nb as l,Ob as d,Pb as v,Ra as b,Tb as y,Ub as P,Vb as w,Wa as x,_b as u,jb as m,lb as p,pb as h,qb as o,rb as a,sb as C}from"./chunk-KBLF2WKH.js";import"./chunk-N7BD4C2B.js";import"./chunk-UGA6IYPZ.js";import"./chunk-ZF26XQPD.js";import"./chunk-ASACGYF2.js";import"./chunk-VUDEIHRF.js";import"./chunk-MPH3CCBG.js";import"./chunk-O63NBQZ4.js";import"./chunk-OWP4MSNR.js";import"./chunk-7U6EGYR3.js";import"./chunk-R5OUWXIR.js";import"./chunk-FDAY5MI3.js";import{f as S}from"./chunk-S5EYVFES.js";function Q(e,i){e&1&&C(0,"ion-progress-bar",1)}function X(e,i){if(e&1&&(o(0,"ion-toolbar")(1,"ion-text",7),l(2),a()()),e&2){let g=_();t(2),d(g.success)}}function Y(e,i){if(e&1&&(o(0,"ion-toolbar")(1,"ion-text",8),l(2),a()()),e&2){let g=_();t(2),d(g.error)}}var re=(()=>{let i=class i{constructor(r,s){this.auth=r,this.router=s,this.email="",this.isSubmitting=!1,this.error=null,this.success=null}get canSubmit(){return!!this.email&&this.email.includes("@")&&!this.isSubmitting}submit(){return S(this,null,function*(){if(this.canSubmit){this.error=null,this.success=null,this.isSubmitting=!0;try{(yield this.auth.requestPasswordReset(this.email))?(this.success="Si cet email existe, un lien a \xE9t\xE9 envoy\xE9.",setTimeout(()=>this.router.navigate(["/auth/login"]),1500)):this.error="Une erreur est survenue."}catch(r){this.error=r?.error?.message||r?.message||"Erreur lors de la demande."}finally{this.isSubmitting=!1}}})}};i.\u0275fac=function(s){return new(s||i)(b(J),b(M))},i.\u0275cmp=x({type:i,selectors:[["app-forgot-password"]],decls:18,vars:15,consts:[["translucent",""],["type","indeterminate"],[1,"ion-padding"],["autocomplete","off",3,"ngSubmit"],["position","stacked"],["type","email","name","email","required","",3,"ngModelChange","ngModel","disabled"],["color","primary","expand","block","type","submit",1,"ion-margin-top",3,"disabled"],["color","success",1,"ion-padding"],["color","danger",1,"ion-padding"]],template:function(s,n){s&1&&(o(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-title"),l(3),u(4,"translate"),a()(),m(5,Q,1,0,"ion-progress-bar",1),m(6,X,3,1,"ion-toolbar"),m(7,Y,3,1,"ion-toolbar"),a(),o(8,"ion-content",2)(9,"form",3),I("ngSubmit",function(){return n.submit()}),o(10,"ion-item")(11,"ion-label",4),l(12),u(13,"translate"),a(),o(14,"ion-input",5),w("ngModelChange",function(f){return P(n.email,f)||(n.email=f),f}),a()(),o(15,"ion-button",6),l(16),u(17,"translate"),a()()()),s&2&&(t(3),d(c(4,9,"auth.forgot_password.page_title")),t(2),p(n.isSubmitting?5:-1),t(),p(n.success?6:-1),t(),p(n.error?7:-1),t(5),d(c(13,11,"auth.forgot_password.email_label")),t(2),y("ngModel",n.email),h("disabled",n.isSubmitting),t(),h("disabled",!n.canSubmit),t(),v(" ",c(17,13,"auth.forgot_password.submit")," "))},dependencies:[q,N,T,E,k,B,F,z,W,G,A,R,j,D,H,O,V,L,U],styles:[`

ion-content[_ngcontent-%COMP%] {
  --padding-start: 16px;
  --padding-end: 16px;
}
ion-toolbar[_ngcontent-%COMP%]   ion-text[_ngcontent-%COMP%] {
  padding-left: 12px;
}`]});let e=i;return e})();export{re as ForgotPasswordPage};
