File: /var/www/html/achiver_ai_production/angular_app/dist/browser/chunk-G3CSY5HF.js
import{A,B as R,C as L,E as b,G as T,I as j,Jb as P,K as N,Kb as k,L as X,Lb as z,Mb as Y,N as V,Nb as Ce,O as q,Ob as $,P as G,Pb as be,Qb as H,R as B,S as D,T as ee,Tb as F,U as O,Ub as ye,Va as Z,Wa as ne,Wb as oe,b as me,ca as te,d as C,da as U,e as y,ea as ie,i as E,qa as W,x as M,y as g}from"./chunk-KZA2GA3L.js";import"./chunk-W4BNGQYG.js";import"./chunk-XQDNE2OA.js";import{Fb as p,Fc as x,Nb as u,Sb as m,Xb as e,Yb as n,Zb as l,bc as le,da as _e,hc as w,ia as Se,ic as f,lb as s,rb as c,sa as J,ta as K,vc as o,wc as S,xc as Q,zb as _}from"./chunk-6VSL23XL.js";import"./chunk-WWX6BADO.js";var I=(()=>{class i{constructor(t){this.settings=t,this.options=this.settings.getOptions()}static{this.\u0275fac=function(r){return new(r||i)(c(k))}}static{this.\u0275cmp=_({type:i,selectors:[["app-branding"]],decls:4,vars:0,consts:[["href","/",1,"logodark"],["src","https://static.achieverr.ai/app/logos/achieverr-logo-3.png","alt","logo","width","129",1,"align-middle","m-l-2"],["href","/",1,"logolight"]],template:function(r,a){r&1&&(e(0,"a",0),l(1,"img",1),n(),e(2,"a",2),l(3,"img",1),n())},encapsulation:2})}}return i})();var Ee=()=>["/auth/login"];function Le(i,d){i&1&&(e(0,"div",15),o(1,"Email is required."),n())}function Te(i,d){i&1&&(e(0,"div",15),o(1,"Enter a valid email address."),n())}function je(i,d){if(i&1&&(e(0,"mat-hint",20),p(1,Le,2,0,"div",15)(2,Te,2,0,"div",15),n()),i&2){let t=f(2);s(),m(t.f.email.errors!=null&&t.f.email.errors.required?1:-1),s(),m(t.f.email.errors!=null&&t.f.email.errors.pattern?2:-1)}}function Ne(i,d){if(i&1&&(e(0,"mat-hint",20)(1,"div",15),o(2),n()()),i&2){let t=f(2);s(2),Q(" ",t.f.email.errors==null?null:t.f.email.errors.server," ")}}function Ve(i,d){if(i&1){let t=le();e(0,"h4",11),o(1,"Forgot your password?"),n(),e(2,"span",12),o(3,"Please enter the email address associated with your account, and we will email you a link to reset your password."),n(),e(4,"form",13),w("ngSubmit",function(){J(t);let a=f();return K(a.submit())}),e(5,"mat-label",14),o(6,"Email "),e(7,"span",15),o(8,"*"),n()(),e(9,"mat-form-field",16),l(10,"input",17),e(11,"mat-icon",18),l(12,"i-tabler",19),n(),p(13,je,3,2,"mat-hint",20)(14,Ne,3,1,"mat-hint",20),n(),e(15,"button",21),o(16," Forgot Password "),n(),e(17,"a",22),o(18," Back to Login "),n()()}if(i&2){let t=f();s(4),u("formGroup",t.forgotPwdForm),s(9),m(t.f.email.touched&&t.f.email.invalid?13:-1),s(),m(t.f.email.errors!=null&&t.f.email.errors.server?14:-1),s(),u("disabled",!t.forgotPwdForm.valid),s(2),u("routerLink",x(5,Ee))}}function qe(i,d){if(i&1&&(e(0,"div",23)(1,"div",24),l(2,"img",25),n()(),e(3,"h4",11),o(4,"Forgot your password?"),n(),e(5,"span",12),o(6," We've sent a password reset link to your email address "),e(7,"span"),o(8),n(),o(9,". "),n(),e(10,"a",26),o(11," Back to Login "),n()),i&2){let t=f();s(8),S(t.submittedEmail),s(2),u("routerLink",x(2,Ee))}}var Pe=(()=>{class i{constructor(t,r,a,h){this.settings=t,this.router=r,this.authService=a,this.toastr=h,this.options=this.settings.getOptions(),this.isForgotPassword=!0,this.emailPattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$",this.serverError="",this.submittedEmail=null,this.forgotPwdForm=new L({email:new b("",[g.required,g.email,g.pattern(this.emailPattern)])})}get f(){return this.forgotPwdForm.controls}ngOnInit(){this.isForgotPassword=!0}submit(){if(this.forgotPwdForm.invalid)return;let t={email:this.forgotPwdForm.value.email||""};this.authService.forgotPassword(t).subscribe({next:r=>{r.success!==!1&&(this.submittedEmail=t.email,this.isForgotPassword=!1,oe(this.forgotPwdForm),this.toastr.success(r?.message||"Reset link Sent Successfull","Reset Link Sent"))},error:r=>{this.isForgotPassword=!0,this.toastr.error(r?.error?.message||"Reset failed","Reset Request Failed"),this.forgotPwdForm.get("email")?.setErrors({server:r?.error?.message})}})}static{this.\u0275fac=function(r){return new(r||i)(c(k),c(C),c(H),c(F))}}static{this.\u0275cmp=_({type:i,selectors:[["app-side-forgot-password"]],decls:14,vars:1,consts:[[1,"d-flex","justify-content-center","auth-font"],[1,"position-relative","row","w-100","h-100"],[1,"col-lg-7","col-xl-8","bg-gredient","p-0"],[1,"p-24","h-100"],[1,"col-md-13","col-sm-12","col-lg-3","d-flex","justify-content-center"],[1,"align-items-center","justify-content-center","img-height","d-none","d-lg-flex"],["src","https://static.achieverr.ai/app/backgrounds/forgot-bg.svg","alt","login"],[1,"col-lg-5","col-xl-4","p-y-30"],[1,"d-flex","align-items-start","align-items-lg-center","justify-content-center","h-100"],[1,"row","justify-content-center","w-100"],[1,"col-lg-9","max-width-form"],[1,"f-w-700","f-s-24","m-0"],[1,"f-s-14","d-block","f-s-14","m-t-8"],[1,"m-t-30",3,"ngSubmit","formGroup"],[1,"f-s-14","f-w-600","m-b-12","d-block"],[1,"text-error"],["appearance","outline","color","primary",1,"w-100"],["matInput","","type","email","formControlName","email"],["matPrefix",""],["name","mail",1,"icon-20","d-flex"],[1,"m-b-16","error-msg"],["mat-flat-button","","color","primary",1,"w-100","m-t-8",3,"disabled"],["mat-stroked-button","","color","primary",1,"w-100","m-t-8",3,"routerLink"],[1,"row","m-b-16"],[1,"col-5","d-flex","justify-content-center","align-items-center"],["src","https://static.achieverr.ai/app/backgrounds/email-verify.png","alt","login",2,"max-width","150px"],["mat-stroked-button","","color","primary",1,"w-100","m-t-16",3,"routerLink"]],template:function(r,a){r&1&&(e(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"app-branding"),n(),e(6,"div",5),l(7,"img",6),n()()(),e(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10),p(12,Ve,19,6)(13,qe,12,3),n()()()()()()),r&2&&(s(12),m(a.isForgotPassword?12:13))},dependencies:[E,y,P,O,G,B,D,W,ie,U,Z,V,T,M,A,R,q,j,N,I,Y,z],encapsulation:2})}}return i})();var Ge=()=>["/auth/forgot-password"],Be=()=>["/auth/register"];function De(i,d){i&1&&(e(0,"div",23),o(1,"Email is required."),n())}function Oe(i,d){i&1&&(e(0,"div",23),o(1,"Enter a valid email address."),n())}function Ue(i,d){if(i&1&&(e(0,"mat-hint",28),p(1,De,2,0,"div",23)(2,Oe,2,0,"div",23),n()),i&2){let t=f();s(),m(t.f.email.errors&&t.f.email.errors.required?1:-1),s(),m(t.f.email.errors&&t.f.email.errors.pattern?2:-1)}}function We(i,d){i&1&&(e(0,"div",23),o(1,"Password is required."),n())}function Ze(i,d){i&1&&(e(0,"div",23),o(1," Password must be at least 8 characters. "),n())}function ze(i,d){if(i&1&&(e(0,"mat-hint",28),p(1,We,2,0,"div",23)(2,Ze,2,0,"div",23),n()),i&2){let t=f();s(),m(t.f.password.errors&&t.f.password.errors.required?1:-1),s(),m(t.f.password.errors&&t.f.password.errors.minlength?2:-1)}}var ke=(()=>{class i{constructor(t,r,a,h){this.settings=t,this.router=r,this.authService=a,this.toastr=h,this.options=this.settings.getOptions(),this.isSubmitting=!1,this.error=null,this.emailPattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$",this.hidePwd=!0,this.signInForm=new L({email:new b("",[g.required,g.email,g.pattern(this.emailPattern)]),password:new b("",[g.required,g.minLength(8)])}),window.addEventListener("message",v=>{if(console.log(v,"event"),!$.allowedOrigins.includes(v.origin)){this.toastr.error("Blocked message from unknown origin",v.origin);return}if(v.data?.type==="OAUTH_SUCCESS"){if(!v.data?.data?.success){this.toastr.error(v?.data?.data?.message||"Login failed. Please try again.");return}this.authService.handleAuthSuccess(v.data.data),this.toastr.success("Login successful!","Welcome Back!");let xe=localStorage.getItem("redirectUrl");xe?(localStorage.removeItem("redirectUrl"),this.router.navigateByUrl(xe)):this.router.navigate(["/dashboard"])}})}get f(){return this.signInForm.controls}signIn(){if(this.isSubmitting=!0,this.signInForm.invalid)return;let t={email:this.signInForm?.value?.email||"",password:this.signInForm?.value?.password||""};this.authService.login(t).subscribe({next:r=>{if(this.isSubmitting=!1,r.success===!1)return this.serverError=r.message;oe(this.signInForm),this.authService.handleAuthSuccess(r?.data),this.toastr.success(r.message||"You\u2019ve logged in successfully.","Welcome Back!");let a=localStorage.getItem("redirectUrl");localStorage.removeItem("redirectUrl"),a?this.router.navigateByUrl(a,{replaceUrl:!0}):this.router.navigate(["/dashboard"],{replaceUrl:!0})},error:r=>{this.toastr.error(r.error?.message||"Login Failed! Please try again."),this.serverError=r?.error?.message,console.log(r,"err"),this.isSubmitting=!1}})}loginWithGoogle(){window.open(`${$.apiEndpoint}/authgoogle/google`,"googleLogin","width=500,height=600")}loginWithLinkedIn(){window.open(`${$.apiEndpoint}/authlinkedin/linkedin`,"linkedinLogin","width=500,height=600")}static{this.\u0275fac=function(r){return new(r||i)(c(k),c(C),c(H),c(F))}}static{this.\u0275cmp=_({type:i,selectors:[["app-side-login"]],decls:60,vars:10,consts:[[1,"d-flex","justify-content-center","auth-font"],[1,"position-relative","row","w-100","h-100"],[1,"col-lg-7","col-xl-8","bg-gredient","p-0"],[1,"p-24","h-100"],[1,"col-md-13","col-sm-12","col-lg-3","d-flex","justify-content-center"],[1,"align-items-center","justify-content-center","img-height","d-none","d-lg-flex"],["src","https://static.achieverr.ai/app/backgrounds/login.svg","alt","login",2,"max-width","500px"],[1,"col-lg-5","col-xl-4","p-y-30"],[1,"d-flex","align-items-start","align-items-lg-center","justify-content-center","h-100"],[1,"row","justify-content-center","w-100"],[1,"col-lg-9","max-width-form"],[1,"f-w-700","f-s-24","m-0"],[1,"f-s-14","d-block","f-s-14","m-t-8"],[1,"row","m-t-16"],[1,"col-12","col-sm-6","m-t-8"],["mat-stroked-button","","color","dark",1,"w-100",3,"click"],[1,"d-flex","align-items-center","text-nowrap","text-black"],["src","https://static.achieverr.ai/app/svgs/google-icon.svg","alt","google","width","16",1,"m-r-8"],["mat-stroked-button","",1,"w-100",3,"click"],["src","https://static.achieverr.ai/app/svgs/linkedIn.svg","alt","facebook","width","16",1,"m-r-8"],[1,"or-border","m-t-30"],[1,"m-t-30",3,"ngSubmit","formGroup"],[1,"f-s-14","f-w-600","m-b-12","d-block"],[1,"text-error"],["appearance","outline","color","primary",1,"w-100"],["matInput","","formControlName","email"],["matPrefix",""],["name","mail",1,"icon-20","d-flex"],[1,"m-b-16","error-msg"],["matInput","","type","password","formControlName","password","maxlength","16",3,"type"],["name","lock",1,"icon-20","d-flex"],["mat-icon-button","","matSuffix","","type","button",3,"click"],[2,"color","#5c5c5c"],[1,"d-flex","align-items-center","m-b-12"],[1,"text-primary","f-w-600","text-decoration-none","m-l-auto","f-s-14",3,"routerLink"],["mat-flat-button","","color","primary",1,"w-100",3,"disabled"],[1,"d-block","text-center","f-w-500","d-block","m-t-24"],[1,"text-decoration-none","f-w-600","f-s-14","text-primary",3,"routerLink"]],template:function(r,a){r&1&&(e(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"app-branding"),n(),e(6,"div",5),l(7,"img",6),n()()(),e(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"h4",11),o(13,"Welcome Back, Achieverr"),n(),e(14,"span",12),o(15,"Your next big opportunity is just one login away."),n(),e(16,"div",13)(17,"div",14)(18,"button",15),w("click",function(){return a.loginWithGoogle()}),e(19,"div",16),l(20,"img",17),o(21," Sign In with Google "),n()()(),e(22,"div",14)(23,"button",18),w("click",function(){return a.loginWithLinkedIn()}),e(24,"div",16),l(25,"img",19),o(26," Sign In with LinkedIn "),n()()()(),e(27,"div",20),o(28,"or sign in with"),n(),e(29,"form",21),w("ngSubmit",function(){return a.signIn()}),e(30,"mat-label",22),o(31,"Email "),e(32,"span",23),o(33,"*"),n()(),e(34,"mat-form-field",24),l(35,"input",25),e(36,"mat-icon",26),l(37,"i-tabler",27),n(),p(38,Ue,3,2,"mat-hint",28),n(),e(39,"mat-label",22),o(40,"Password "),e(41,"span",23),o(42,"*"),n()(),e(43,"mat-form-field",24),l(44,"input",29),e(45,"mat-icon",26),l(46,"i-tabler",30),n(),e(47,"button",31),w("click",function(){return a.hidePwd=!a.hidePwd}),e(48,"mat-icon",32),o(49),n()(),p(50,ze,3,2,"mat-hint",28),n(),e(51,"div",33)(52,"a",34),o(53,"Forgot Password?"),n()(),e(54,"button",35),o(55," Sign In "),n()(),e(56,"span",36),o(57,"New to Achieverr.ai? "),e(58,"a",37),o(59," Sign Up"),n()()()()()()()()),r&2&&(s(29),u("formGroup",a.signInForm),s(9),m(a.f.email.touched&&a.f.email.invalid?38:-1),s(6),u("type",a.hidePwd?"password":"text"),s(5),S(a.hidePwd?"visibility_off":"visibility"),s(),m(a.f.password.touched&&a.f.password.invalid?50:-1),s(2),u("routerLink",x(8,Ge)),s(2),u("disabled",!a.signInForm.valid),s(4),u("routerLink",x(9,Be)))},dependencies:[E,y,P,O,G,B,D,ee,W,U,te,Z,V,T,M,A,R,X,q,j,N,I,Y,z,ne],encapsulation:2})}}return i})();var Ye=()=>["/auth/login"];function $e(i,d){i&1&&(e(0,"div",24),o(1,"Name is required."),n())}function He(i,d){i&1&&(e(0,"div",24),o(1," Name cannot exceed 64 characters. "),n())}function Je(i,d){i&1&&(e(0,"div",24),o(1,"Only letters A-Z are allowed."),n())}function Ke(i,d){if(i&1&&(e(0,"mat-hint",29),p(1,$e,2,0,"div",24)(2,He,2,0,"div",24)(3,Je,2,0,"div",24),n()),i&2){let t=f();s(),m(t.f.name.errors&&t.f.name.errors.required?1:-1),s(),m(t.f.name.errors&&t.f.name.errors.maxlength?2:-1),s(),m(t.f.name.errors&&t.f.name.errors.pattern?3:-1)}}function Qe(i,d){i&1&&(e(0,"div",24),o(1,"Email is required."),n())}function Xe(i,d){i&1&&(e(0,"div",24),o(1,"Enter a valid email address."),n())}function et(i,d){if(i&1&&(e(0,"mat-hint",29),p(1,Qe,2,0,"div",24)(2,Xe,2,0,"div",24),n()),i&2){let t=f();s(),m(t.f.email.errors&&t.f.email.errors.required?1:-1),s(),m(t.f.email.errors&&t.f.email.errors.pattern?2:-1)}}function tt(i,d){if(i&1&&(e(0,"mat-hint",29)(1,"div",24),o(2),n()()),i&2){let t=f();s(2),Q(" ",t.serverError," ")}}function it(i,d){i&1&&(e(0,"div",24),o(1,"Password is required."),n())}function nt(i,d){i&1&&(e(0,"div",24),o(1," Password must be at least 8 characters. "),n())}function ot(i,d){if(i&1&&(e(0,"mat-hint",29),p(1,it,2,0,"div",24)(2,nt,2,0,"div",24),n()),i&2){let t=f();s(),m(t.f.password.errors&&t.f.password.errors.required?1:-1),s(),m(t.f.password.errors&&t.f.password.errors.minlength?2:-1)}}var Fe=(()=>{class i{constructor(t,r,a,h){this.settings=t,this.router=r,this.authService=a,this.toastr=h,this.options=this.settings.getOptions(),this.loading=!1,this.error=null,this.emailPattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$",this.hideRegisterPwd=!0,this.registerForm=new L({name:new b("",[g.required,g.maxLength(64),g.pattern("^[A-Za-z ]+$")]),email:new b("",[g.required,g.email,g.pattern(this.emailPattern)]),password:new b("",[g.required,g.minLength(8)])}),window.addEventListener("message",v=>{if(!$.allowedOrigins.includes(v.origin)){this.toastr.error("Blocked message from unknown origin",v.origin);return}if(v.data?.type==="OAUTH_SUCCESS"){if(v.data.data.success===!1)return this.serverError=v?.data?.data?.message;this.authService.handleAuthSuccess(v.data.data)}})}ngOnInit(){this.registerForm.get("email")?.setErrors({server:!1})}get f(){return this.registerForm.controls}submit(){if(this.registerForm.invalid)return;this.loading=!0,this.error=null;let t={name:this.registerForm.value.name??null,password:this.registerForm.value.password??null,email:this.registerForm.value.email??null};this.authService.register(t).subscribe({next:r=>{if(r.success===!1)return this.serverError=r.message;this.loading=!1,this.authService.handleAuthSuccess(r?.data),this.toastr.success(r.message||"Registration successful!","Account Created")},error:r=>{this.loading=!1;let a=r?.error?.message||"Registration failed. Please try again.";this.toastr.error(a,"Signup Failed"),r?.error?.message?.toLowerCase().includes("email is already registered")&&(this.serverError="Email is already registered",this.registerForm.get("email")?.setErrors({server:!0}))}})}loginWithGoogle(){window.open(`${$.apiEndpoint}/authgoogle/google`,"googleLogin","width=500,height=600")}loginWithLinkedIn(){window.open(`${$.apiEndpoint}/authlinkedin/linkedin`,"linkedinLogin","width=500,height=600")}static{this.\u0275fac=function(r){return new(r||i)(c(k),c(C),c(H),c(F))}}static{this.\u0275cmp=_({type:i,selectors:[["app-side-register"]],decls:69,vars:10,consts:[[1,"d-flex","auth-font","justify-content-center"],[1,"position-relative","row","w-100","h-100"],[1,"col-lg-7","col-xl-8","bg-gredient","p-0"],[1,"p-24","h-100"],[1,"col-md-13","col-sm-12","col-lg-3","d-flex","justify-content-center"],[1,"align-items-center","justify-content-center","img-height","d-none","d-lg-flex"],["src","https://static.achieverr.ai/app/backgrounds/signup-bg.svg","alt","login",2,"max-width","500px"],[1,"d-none","d-lg-flex","align-items-center","justify-content-center","signup-title","text-primary","f-w-500"],[1,"col-lg-5","col-xl-4","p-y-30"],[1,"d-flex","align-items-start","align-items-lg-center","justify-content-center","h-100"],[1,"row","justify-content-center","w-100"],[1,"col-lg-9","max-width-form"],[1,"f-w-700","f-s-24","m-0"],[1,"f-s-14","d-block","f-s-14","m-t-8"],[1,"row","m-t-16"],[1,"col-12","col-sm-6","m-t-8",3,"click"],["mat-stroked-button","",1,"w-100"],[1,"d-flex","align-items-center","text-nowrap","text-black"],["src","https://static.achieverr.ai/app/svgs/google-icon.svg","alt","google","width","16",1,"m-r-8"],["mat-stroked-button","",1,"w-100","d-flex","align-items-center"],["src","https://static.achieverr.ai/app/svgs/linkedIn.svg","alt","facebook","width","16",1,"m-r-4"],[1,"or-border","m-t-30"],[1,"m-t-30",3,"ngSubmit","formGroup"],[1,"f-s-14","f-w-600","m-b-12","d-block"],[1,"text-error"],["appearance","outline","color","primary",1,"w-100"],["matInput","","formControlName","name","maxlength","65"],["matPrefix",""],["name","user",1,"icon-20","d-flex"],[1,"m-b-16","error-msg"],["matInput","","type","email","formControlName","email"],["name","mail",1,"icon-20","d-flex"],["matInput","","type","password","formControlName","password","maxlength","16",3,"type"],["name","lock",1,"icon-20","d-flex"],["mat-icon-button","","matSuffix","","type","button",3,"click"],[2,"color","#5c5c5c"],["mat-flat-button","","color","primary","type","submit",1,"w-100",3,"disabled"],[1,"d-block","text-center","f-w-500","d-block","m-t-24"],[1,"text-decoration-none","text-primary","f-w-500","f-s-14",3,"routerLink"]],template:function(r,a){r&1&&(e(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"app-branding"),n(),e(6,"div",5),l(7,"img",6),n(),e(8,"div",7),o(9," Your dream job won\u2019t wait \u2014 why should you? Sign up and let Atlas start applying today! "),n()()(),e(10,"div",8)(11,"div",9)(12,"div",10)(13,"div",11)(14,"h4",12),o(15,"Your Job Hunt, Automated"),n(),e(16,"span",13),o(17,"Step into your smartest job search yet \u2014 powered by Atlas."),n(),e(18,"div",14)(19,"div",15),w("click",function(){return a.loginWithGoogle()}),e(20,"button",16)(21,"div",17),l(22,"img",18),o(23," Sign In with Google "),n()()(),e(24,"div",15),w("click",function(){return a.loginWithLinkedIn()}),e(25,"button",19)(26,"div",17),l(27,"img",20),o(28," Sign In with LinkedIn "),n()()()(),e(29,"div",21),o(30,"or sign up with"),n(),e(31,"form",22),w("ngSubmit",function(){return a.submit()}),e(32,"mat-label",23),o(33,"Name "),e(34,"span",24),o(35,"*"),n()(),e(36,"mat-form-field",25),l(37,"input",26),e(38,"mat-icon",27),l(39,"i-tabler",28),n(),p(40,Ke,4,3,"mat-hint",29),n(),e(41,"mat-label",23),o(42,"Email "),e(43,"span",24),o(44,"*"),n()(),e(45,"mat-form-field",25),l(46,"input",30),e(47,"mat-icon",27),l(48,"i-tabler",31),n(),p(49,et,3,2,"mat-hint",29)(50,tt,3,1,"mat-hint",29),n(),e(51,"mat-label",23),o(52,"Password "),e(53,"span",24),o(54,"*"),n()(),e(55,"mat-form-field",25),l(56,"input",32),e(57,"mat-icon",27),l(58,"i-tabler",33),n(),e(59,"button",34),w("click",function(){return a.hideRegisterPwd=!a.hideRegisterPwd}),e(60,"mat-icon",35),o(61),n()(),p(62,ot,3,2,"mat-hint",29),n(),e(63,"button",36),o(64," Start Free with Atlas \u2192 "),n()(),e(65,"span",37),o(66,"Already have an account? "),e(67,"a",38),o(68," Sign In"),n()()()()()()()()),r&2&&(s(31),u("formGroup",a.registerForm),s(9),m(a.f.name.touched&&a.f.name.invalid?40:-1),s(9),m(a.f.email.touched&&a.f.email.invalid?49:-1),s(),m(a.f.email.hasError("server")?50:-1),s(6),u("type",a.hideRegisterPwd?"password":"text"),s(5),S(a.hideRegisterPwd?"visibility_off":"visibility"),s(),m(a.f.password.touched&&a.f.password.invalid?62:-1),s(),u("disabled",!a.registerForm.valid),s(4),u("routerLink",x(9,Ye)))},dependencies:[E,y,P,O,G,B,D,ee,W,U,te,Z,V,T,M,A,R,X,q,j,N,I,Y,z,ne],encapsulation:2})}}return i})();var ae=(()=>{class i{constructor(t){this.router=t}canActivate(t,r){let a=localStorage.getItem("access_token"),h=t.data.allowLoggedIn===!0;return a&&!h?this.router.createUrlTree(["/dashboard"]):!0}static{this.\u0275fac=function(r){return new(r||i)(Se(C))}}static{this.\u0275prov=_e({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ie=()=>["/auth/login"];function rt(i,d){i&1&&l(0,"img",6)}function at(i,d){i&1&&l(0,"img",7)}function st(i,d){i&1&&(e(0,"div",16),o(1,"New Password is required."),n())}function lt(i,d){i&1&&(e(0,"div",16),o(1," New Password must be at least 8 characters. "),n())}function mt(i,d){if(i&1&&(e(0,"mat-hint",23),p(1,st,2,0,"div",16)(2,lt,2,0,"div",16),n()),i&2){let t=f(2);s(),m(t.f.newPassword.errors&&t.f.newPassword.errors.required?1:-1),s(),m(t.f.newPassword.errors&&t.f.newPassword.errors.minlength?2:-1)}}function dt(i,d){i&1&&(e(0,"div",16),o(1,"Confirm Password is required."),n())}function ct(i,d){i&1&&(e(0,"div",16),o(1," Confirm Password must be at least 8 characters. "),n())}function pt(i,d){if(i&1&&(e(0,"mat-hint",23),p(1,dt,2,0,"div",16)(2,ct,2,0,"div",16),n()),i&2){let t=f(2);s(),m(t.f.confirmPassword.errors.required?1:-1),s(),m(t.f.confirmPassword.errors&&t.f.confirmPassword.errors.minlength?2:-1)}}function ut(i,d){i&1&&(e(0,"mat-hint",23)(1,"div",16),o(2,"Passwords do not match."),n()())}function ft(i,d){if(i&1&&(e(0,"mat-hint",23)(1,"div",16),o(2),n()()),i&2){let t=f(2);s(2),Q(" ",t.serverError," ")}}function gt(i,d){if(i&1){let t=le();e(0,"h4",12),o(1,"Reset Password"),n(),e(2,"span",13),o(3,"Fresh Password, Fresh Start."),n(),e(4,"form",14),w("ngSubmit",function(){J(t);let a=f();return K(a.submit())}),e(5,"mat-label",15),o(6,"Enter New Password "),e(7,"span",16),o(8,"*"),n()(),e(9,"mat-form-field",17),l(10,"input",18),e(11,"mat-icon",19),l(12,"i-tabler",20),n(),e(13,"button",21),w("click",function(){J(t);let a=f();return K(a.hideNewPwd=!a.hideNewPwd)}),e(14,"mat-icon",22),o(15),n()(),p(16,mt,3,2,"mat-hint",23),n(),e(17,"mat-label",15),o(18,"Confirm Password "),e(19,"span",16),o(20,"*"),n()(),e(21,"mat-form-field",17),l(22,"input",24),e(23,"mat-icon",19),l(24,"i-tabler",20),n(),e(25,"button",21),w("click",function(){J(t);let a=f();return K(a.hideConfirmPwd=!a.hideConfirmPwd)}),e(26,"mat-icon",22),o(27),n()(),p(28,pt,3,2,"mat-hint",23)(29,ut,3,0,"mat-hint",23)(30,ft,3,1,"mat-hint",23),n(),e(31,"button",25),o(32," Reset Password "),n(),e(33,"a",26),o(34," Back to Login "),n()()}if(i&2){let t=f();s(4),u("formGroup",t.resetPwdForm),s(6),u("type",t.hideNewPwd?"password":"text"),s(5),S(t.hideNewPwd?"visibility_off":"visibility"),s(),m(t.f.newPassword.touched&&t.f.newPassword.invalid?16:-1),s(6),u("type",t.hideConfirmPwd?"password":"text"),s(5),S(t.hideConfirmPwd?"visibility_off":"visibility"),s(),m(t.f.confirmPassword.touched&&t.f.confirmPassword.errors?28:-1),s(),m(t.resetPwdForm.errors!=null&&t.resetPwdForm.errors.passwordMismatch&&t.f.confirmPassword.touched&&!(t.f.confirmPassword.errors!=null&&t.f.confirmPassword.errors.required)&&!(t.f.confirmPassword.errors!=null&&t.f.confirmPassword.errors.minlength)?29:-1),s(),m(t.serverError&&t.resetPwdForm.valid?30:-1),s(),u("disabled",!t.resetPwdForm.valid),s(2),u("routerLink",x(11,Ie))}}function ht(i,d){i&1&&(e(0,"div",27)(1,"div",28),l(2,"img",29),n()(),e(3,"h4",12),o(4,"Password Updated Successfully"),n(),e(5,"span",13),o(6,"Your account is now secure with the updated password. Let\u2019s get back to finding jobs made for you."),n(),e(7,"a",30),o(8," Login Now "),n()),i&2&&(s(7),u("routerLink",x(1,Ie)))}var Me=(()=>{class i{constructor(t,r,a,h,v){this.settings=t,this.router=r,this.authService=a,this.route=h,this.toastr=v,this.options=this.settings.getOptions(),this.isResetPassword=!0,this.hideNewPwd=!0,this.hideConfirmPwd=!0,this.resetPwdForm=new L({newPassword:new b("",[g.required,g.minLength(8)]),confirmPassword:new b("",[g.required,g.minLength(8)])},{validators:ye()})}ngOnInit(){this.route.queryParams.subscribe(t=>{this.token=t.token,this.token||this.router.navigate(["/auth/forgot-password"])})}get f(){return this.resetPwdForm.controls}submit(){if(this.resetPwdForm.invalid||this.resetPwdForm.errors?.passwordMismatch){this.toastr.error("Please fix the form errors.");return}let t={newPassword:this.resetPwdForm.value.newPassword,token:this.token,isFormData:!0};this.authService.resetPassword(t).subscribe({next:r=>{if(r.success===!1)return this.serverError=r.message;this.isResetPassword=!1,oe(this.resetPwdForm),this.toastr.success(r?.message||"Your password has been reset successfully.","Password Updated")},error:r=>{this.toastr.error(r?.error?.message||"Reset failed"),this.serverError="The link has expired. Please try again with a different link.",this.isResetPassword=!0}})}static{this.\u0275fac=function(r){return new(r||i)(c(k),c(C),c(H),c(me),c(F))}}static{this.\u0275cmp=_({type:i,selectors:[["app-reset-password"]],decls:15,vars:2,consts:[[1,"d-flex","justify-content-center","auth-font"],[1,"position-relative","row","w-100","h-100"],[1,"col-lg-7","col-xl-8","bg-gredient","p-0"],[1,"p-24","h-100"],[1,"col-md-13","col-sm-12","col-lg-3","d-flex","justify-content-center"],[1,"align-items-center","justify-content-center","img-height","d-none","d-lg-flex"],["src","https://static.achieverr.ai/app/backgrounds/forgot-bg.svg","alt","login",2,"max-width","500px"],["src","https://static.achieverr.ai/app/backgrounds/reset.svg","alt","login",2,"max-width","500px"],[1,"col-lg-5","col-xl-4","p-y-30"],[1,"d-flex","align-items-start","align-items-lg-center","justify-content-center","h-100"],[1,"row","justify-content-center","w-100"],[1,"col-lg-9","max-width-form"],[1,"f-w-700","f-s-24","m-0"],[1,"f-s-14","d-block","f-s-14","m-t-8"],[1,"m-t-30",3,"ngSubmit","formGroup"],[1,"f-s-14","f-w-600","m-b-12","d-block"],[1,"text-error"],["appearance","outline","color","primary",1,"w-100"],["matInput","","type","text","formControlName","newPassword","maxlength","16",3,"type"],["matPrefix",""],["name","lock",1,"icon-20","d-flex"],["mat-icon-button","","matSuffix","","type","button",3,"click"],[2,"color","#5c5c5c"],[1,"m-b-16","error-msg"],["matInput","","type","text","formControlName","confirmPassword","maxlength","16",3,"type"],["mat-flat-button","","color","primary",1,"w-100","m-t-16",3,"disabled"],["mat-stroked-button","","color","primary",1,"w-100","m-t-8",3,"routerLink"],[1,"row","m-b-16"],[1,"col-5","d-flex","justify-content-center","align-items-center"],["src","https://static.achieverr.ai/app/backgrounds/reset_success.svg","alt","login",2,"max-width","150px"],["mat-stroked-button","","color","primary",1,"w-100","m-t-16",3,"routerLink"]],template:function(r,a){r&1&&(e(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"app-branding"),n(),e(6,"div",5),p(7,rt,1,0,"img",6)(8,at,1,0,"img",7),n()()(),e(9,"div",8)(10,"div",9)(11,"div",10)(12,"div",11),p(13,gt,35,12)(14,ht,9,2),n()()()()()()),r&2&&(s(7),m(a.isResetPassword?7:8),s(6),m(a.isResetPassword?13:14))},dependencies:[E,y,P,O,G,B,D,ee,W,ie,U,te,Z,V,T,M,A,R,X,q,j,N,I,Y,z,ne],encapsulation:2})}}return i})();var vt=()=>["/auth/login"];function wt(i,d){if(i&1&&(e(0,"div",12)(1,"div",13),l(2,"img",14),n()(),e(3,"h4",15),o(4),n(),e(5,"span",16),o(6,"You\u2019re all set. We\u2019re redirecting you to your account now."),n()),i&2){let t=f();s(4),S(t.message)}}function xt(i,d){if(i&1&&(e(0,"div",12)(1,"div",13),l(2,"img",14),n()(),e(3,"h4",15),o(4),n(),e(5,"span",16),o(6,"Please try a different link. If the problem persists, contact support."),n()),i&2){let t=f();s(4),S(t.message)}}var Ae=(()=>{class i{constructor(t,r,a,h){this.route=t,this.router=r,this.apiService=a,this.toastr=h,this.message="Verifying your email...",this.isSuccess=null}ngOnInit(){this.route.queryParams.subscribe(t=>{let r=t.token;r?this.apiService.post(Ce.auth.verifyEmail,{token:r}).subscribe({next:a=>{a.success!==!1&&(this.toastr.success(a.message||"Your email has been successfully verified.","Email Verified"),this.message=a.message||"Your email has been verified.",this.isSuccess=!0,setTimeout(()=>this.router.navigate(["/dashboard"]),3e3))},error:a=>{this.toastr.error(a?.error?.message||"Invalid or expired token.","Verification Failed"),this.message="Verification failed. The link may have expired.",this.isSuccess=!1}}):(this.message="No token found in URL.",this.isSuccess=!1)})}static{this.\u0275fac=function(r){return new(r||i)(c(me),c(C),c(be),c(F))}}static{this.\u0275cmp=_({type:i,selectors:[["app-verify-email"]],decls:16,vars:3,consts:[[1,"d-flex","justify-content-center","auth-font"],[1,"position-relative","row","w-100","h-100"],[1,"col-lg-7","col-xl-8","bg-gredient","p-0"],[1,"p-24","h-100"],[1,"col-md-13","col-sm-12","col-lg-3","d-flex","justify-content-center"],[1,"align-items-center","justify-content-center","img-height","d-none","d-lg-flex"],["src","https://static.achieverr.ai/app/backgrounds/forgot-bg.svg","alt","login",2,"max-width","500px"],[1,"col-lg-5","col-xl-4","p-y-30"],[1,"d-flex","align-items-start","align-items-lg-center","justify-content-center","h-100"],[1,"row","justify-content-center","w-100"],[1,"col-lg-9","max-width-form"],["mat-stroked-button","","color","primary",1,"w-100","m-t-16",3,"routerLink"],[1,"row","m-b-16"],[1,"col-5","d-flex","justify-content-center","align-items-center"],["src","https://static.achieverr.ai/app/backgrounds/email-verify.png","alt","login",2,"max-width","150px"],[1,"f-w-700","f-s-24","m-0"],[1,"f-s-14","d-block","f-s-14","m-t-8"]],template:function(r,a){r&1&&(e(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"app-branding"),n(),e(6,"div",5),l(7,"img",6),n()()(),e(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10),p(12,wt,7,1)(13,xt,7,1),e(14,"a",11),o(15," Back to Login "),n()()()()()()()),r&2&&(s(12),m(a.isSuccess?13:12),s(2),u("routerLink",x(2,vt)))},dependencies:[I,E,y,P,ie],encapsulation:2})}}return i})();var pi=[{path:"",children:[{path:"forgot-password",component:Pe,canActivate:[ae]},{path:"login",component:ke,canActivate:[ae],data:{allowLoggedIn:!0}},{path:"register",component:Fe,canActivate:[ae]},{path:"reset-password",component:Me,canActivate:[ae]},{path:"verify-email",component:Ae,canActivate:[ae],data:{allowLoggedIn:!0}}]}];export{pi as AuthenticationRoutes};