import{K as w,O as L,P as R,X as V,l as T,u as j,x as B}from"./chunk-YEFQA5EZ.js";import{c as z,e as D}from"./chunk-KNXXDNCS.js";import{a as Z}from"./chunk-6QA6JGM2.js";import{A as E,E as S,m as M,r as P,x as O}from"./chunk-J77R5Y4O.js";import"./chunk-2OWRLCO4.js";import{$b as l,Cb as x,Ia as t,Nb as a,Ob as s,Pb as _,Ra as d,Wa as y,_b as c,da as k,jb as u,jc as I,lb as g,n as C,o as b,pb as v,qb as n,rb as o,sb as h}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"./chunk-S5EYVFES.js";function U(i,r){i&1&&(n(0,"div",4),h(1,"ion-spinner",7),n(2,"h2",1),a(3),c(4,"translate"),o(),n(5,"p",8),a(6),c(7,"translate"),o()()),i&2&&(t(3),s(l(4,2,"auth.verify_email.checking")),t(3),s(l(7,4,"auth.verify_email.checking_subtitle")))}function A(i,r){if(i&1&&(n(0,"div",5),h(1,"ion-icon",9),n(2,"h2",1),a(3),c(4,"translate"),o(),n(5,"p",8),a(6),o(),n(7,"ion-button",10),a(8),c(9,"translate"),o()()),i&2){let f=x();t(3),s(l(4,3,"auth.verify_email.success_title")),t(3),s(f.message),t(2),_(" ",l(9,5,"auth.verify_email.login_button")," ")}}function H(i,r){if(i&1&&(n(0,"div",6),h(1,"ion-icon",11),n(2,"h2",1),a(3),c(4,"translate"),o(),n(5,"p",8),a(6),o(),n(7,"ion-button",12),a(8),c(9,"translate"),o()()),i&2){let f=x();t(3),s(l(4,3,"auth.verify_email.error_title")),t(3),s(f.message),t(2),_(" ",l(9,5,"auth.verify_email.back_to_login")," ")}}var ee=(()=>{let r=class r{constructor(m,e,p,q){this.route=m,this.http=e,this.cdr=p,this.ngZone=q,this.status="loading",this.message=""}ngOnInit(){let m=this.route.snapshot.queryParamMap.get("token");if(!m){this.status="no-token",this.message="Aucun jeton de v\xE9rification trouv\xE9 dans l'URL.";return}this.http.post(`${Z.api.baseUrl}/registration/verify-email`,{token:m}).pipe(b(15e3)).subscribe({next:e=>{this.ngZone.run(()=>{e.success?(this.status="success",this.message=e.message||"Votre adresse email a bien \xE9t\xE9 confirm\xE9e !"):(this.status="error",this.message=e.message||"Une erreur est survenue."),this.cdr.detectChanges()})},error:e=>{this.ngZone.run(()=>{e instanceof C?(this.status="error",this.message="La v\xE9rification a pris trop de temps. R\xE9essayez dans quelques instants."):e?.error?.message==="Token d\xE9j\xE0 utilis\xE9"?(this.status="success",this.message="Votre adresse email est d\xE9j\xE0 confirm\xE9e. Vous pouvez vous connecter."):(this.status="error",this.message=e?.error?.message||"Lien invalide ou expir\xE9. Demandez un nouvel email de confirmation."),this.cdr.detectChanges()})}})}};r.\u0275fac=function(e){return new(e||r)(d(O),d(P),d(I),d(k))},r.\u0275cmp=y({type:r,selectors:[["app-verify-email"]],decls:10,vars:8,consts:[[3,"translucent"],[1,"handwriting"],[1,"ion-padding","verify-content",3,"fullscreen"],[1,"verify-container"],[1,"state-block"],[1,"state-block","success-block","imperfect-element"],[1,"state-block","error-block","imperfect-element"],["name","crescent",1,"big-spinner"],[1,"comfort-text"],["name","checkmark-circle",1,"state-icon","success-icon"],["expand","block","routerLink","/auth/login",1,"handwriting"],["name","close-circle",1,"state-icon","error-icon"],["expand","block","routerLink","/auth/login","fill","outline",1,"handwriting"]],template:function(e,p){e&1&&(n(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-title",1),a(3),c(4,"translate"),o()()(),n(5,"ion-content",2)(6,"div",3),u(7,U,8,6,"div",4),u(8,A,10,7,"div",5),u(9,H,10,7,"div",6),o()()),e&2&&(v("translucent",!0),t(3),s(l(4,6,"auth.verify_email.page_title")),t(2),v("fullscreen",!0),t(2),g(p.status==="loading"?7:-1),t(),g(p.status==="success"?8:-1),t(),g(p.status==="error"||p.status==="no-token"?9:-1))},dependencies:[M,S,E,D,B,R,L,j,T,w,V,z],styles:[`

[_nghost-%COMP%] {
  --ion-background-color: var(--ion-color-light);
}
.verify-content[_ngcontent-%COMP%] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.verify-container[_ngcontent-%COMP%] {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 16px;
  width: 100%;
}
.state-block[_ngcontent-%COMP%] {
  text-align: center;
}
.state-block[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%] {
  margin: 16px 0 8px;
  font-size: 1.6rem;
  color: var(--ion-color-dark);
}
.state-block[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {
  margin-bottom: 24px;
  color: var(--ion-color-medium);
  line-height: 1.6;
}
.big-spinner[_ngcontent-%COMP%] {
  width: 64px;
  height: 64px;
  color: var(--ion-color-primary);
}
.state-icon[_ngcontent-%COMP%] {
  font-size: 72px;
}
.success-icon[_ngcontent-%COMP%] {
  color: var(--ion-color-success);
}
.error-icon[_ngcontent-%COMP%] {
  color: var(--ion-color-danger);
}
.success-block[_ngcontent-%COMP%], 
.error-block[_ngcontent-%COMP%] {
  padding: 32px 24px;
  border-radius: 16px;
  background: var(--ion-color-light-shade);
}`]});let i=r;return i})();export{ee as VerifyEmailPage};
