1"use strict";(self.webpackChunkrademploy_web=self.webpackChunkrademploy_web||[]).push([[4598],{84598:(_,m,r)=>{r.r(m),r.d(m,{SsoCallbackModule:()=>M});var d=r(60177),l=r(50580),h=r(21626),f=r(30105),p=r(24790),e=r(17705),y=r(48256),C=r(3923),b=r(2490),x=r(1040);function v(s,u){1&s&&(e.j41(0,"div",5),e.nrm(1,"div",6),e.j41(2,"h3"),e.EFF(3,"Completing sign in..."),e.k0s(),e.j41(4,"p"),e.EFF(5,"Please wait while we verify your credentials."),e.k0s()())}function P(s,u){if(1&s){const t=e.RV6();e.j41(0,"div",7)(1,"h3"),e.EFF(2,"Almost there!"),e.k0s(),e.j41(3,"p"),e.EFF(4,"We don't have an account for you yet. What best describes you?"),e.k0s(),e.j41(5,"div",8)(6,"button",9),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.chooseEmployeeOrStudent())}),e.j41(7,"span",10),e.EFF(8,"Employee / Student"),e.k0s(),e.j41(9,"span",11),e.EFF(10,"Looking for imaging jobs or opportunities."),e.k0s()(),e.j41(11,"button",9),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.chooseEmployer())}),e.j41(12,"span",10),e.EFF(13,"Employer"),e.k0s(),e.j41(14,"span",11),e.EFF(15,"Hiring imaging professionals for your organization."),e.k0s()()()()}}function S(s,u){if(1&s&&(e.j41(0,"div",12),e.qSk(),e.j41(1,"svg",13),e.nrm(2,"circle",14)(3,"line",15)(4,"line",16),e.k0s(),e.joV(),e.j41(5,"h3"),e.EFF(6,"Authentication Failed"),e.k0s(),e.j41(7,"p"),e.EFF(8),e.k0s(),e.j41(9,"p",17),e.EFF(10,"Redirecting to login page..."),e.k0s()()),2&s){const t=e.XpG();e.R7$(8),e.JRh(t.errorMessage)}}const k=[{path:"",component:(()=>{class s{constructor(t,o,n,a,c,i,g){this.route=t,this.router=o,this.http=n,this.toast=a,this.api=c,this.cookie=i,this.analyticsService=g,this.isProcessing=!0,this.errorMessage="",this.showAccountTypeChooser=!1,this.pendingSsoUser=null}ngOnInit(){this.route.queryParams.subscribe(t=>{const o=t.code,n=t.state;if(!o||!n)return this.errorMessage="Missing authorization code or state. Please try logging in again.",this.isProcessing=!1,void setTimeout(()=>this.router.navigate(["/employees/signin"]),3e3);this.completeSSOLogin(o,n)})}completeSSOLogin(t,o){this.http.post(`${this.api.BASE_PATH}/api/v1/employee/sso/complete`,{code:t,state:o}).subscribe({next:a=>{if(200===a.statusCode&&a.data){const{token:c,user:i,isNewUser:g,profileComplete:O}=a.data;if(g||!O)localStorage.removeItem("token"),localStorage.removeItem("user"),localStorage.removeItem("name"),localStorage.removeItem("userId"),localStorage.removeItem("userType"),this.cookie.delete("token","/"),this.pendingSsoUser={email_address:i.email_address,firstName:i.firstName,lastName:i.lastName,profile_pic:i.profile_pic||""},this.isProcessing=!1,this.showAccountTypeChooser=!0;else{if(!c)return void this.handleError("Authentication token missing. Please try again.");localStorage.setItem("token",c),this.cookie.set("token",c,30,"/"),localStorage.setItem("user",JSON.stringify(i)),localStorage.setItem("name",`${i.firstName||""} ${i.lastName||""}`.trim()),localStorage.setItem("userId",i._id),localStorage.setItem("userType",i.userType.toString()),this.analyticsService.identify(i._id),this.analyticsService.setPeopleProperties({user_segment:(0,p.Or)(i),account_role:(0,p.wO)(i),...(0,p.Ad)(i)}),this.toast.success("Login successful!","Welcome"),this.navigateToDashboard(i)}}else this.handleError(a.message||"Login failed")},error:a=>{console.error("SSO completion error:",a),this.handleError(a?.error?.message||("string"==typeof a?.error?a.error:"")||a?.message||"Authentication failed. Please try again.")}})}chooseEmployeeOrStudent(){this.pendingSsoUser&&(this.toast.success("Continue signup to complete your account.","Almost there"),this.router.navigate(["/employees/signup"],{queryParams:{email:this.pendingSsoUser.email_address,firstName:this.pendingSsoUser.firstName,lastName:this.pendingSsoUser.lastName,profilePic:this.pendingSsoUser.profile_pic,sso:"true"}}))}chooseEmployer(){this.pendingSsoUser&&(this.toast.success("Continue to complete your employer profile.","Almost there"),this.router.navigate(["/create-employer-profile"],{queryParams:{email:this.pendingSsoUser.email_address,firstName:this.pendingSsoUser.firstName,lastName:this.pendingSsoUser.lastName,sso:"true"}}))}handleError(t){this.errorMessage=t,this.isProcessing=!1,this.toast.error(t,"Login Failed"),setTimeout(()=>this.router.navigate(["/employees/signin"]),3e3)}navigateToDashboard(t){const o=localStorage.getItem("attachedJobId");if(localStorage.removeItem("attachedJobId"),t.userType==f.Cy.EMPLOYEE)window.location.href=o?`/employee/main/jobdetails/${o}`:"/employee/main";else if(t.userType==f.Cy.EMPLOYER){if(t.parentEmployerId)return void(window.location.href="/employer/main");if(2===Number(t.status)&&!1!==t.membershipSelected)return void(window.location.href="/employer/main/upgrade");window.location.href=!1===t.membershipSelected||"Managed"===t.employerTier?"/employer/main/upgrade":"/employer/main"}}static{this.\u0275fac=function(o){return new(o||s)(e.rXU(l.nX),e.rXU(l.Ix),e.rXU(h.Qq),e.rXU(y.tw),e.rXU(C.G),e.rXU(b.O),e.rXU(x.c))}}static{this.\u0275cmp=e.VBU({type:s,selectors:[["app-sso-callback"]],decls:5,vars:3,consts:[[1,"sso-callback-container"],[1,"callback-content"],["class","processing",4,"ngIf"],["class","account-type-chooser",4,"ngIf"],["class","error",4,"ngIf"],[1,"processing"],[1,"spinner"],[1,"account-type-chooser"],[1,"account-type-options"],["type","button",1,"account-type-btn",3,"click"],[1,"account-type-btn__title"],[1,"account-type-btn__desc"],[1,"error"],["xmlns","http://www.w3.org/2000/svg","width","64","height","64","viewBox","0 0 24 24","fill","none","stroke","#dc3545","stroke-width","2"],["cx","12","cy","12","r","10"],["x1","15","y1","9","x2","9","y2","15"],["x1","9","y1","9","x2","15","y2","15"],[1,"redirect-text"]],template:function(o,n){1&o&&(e.j41(0,"div",0)(1,"div",1),e.DNE(2,v,6,0,"div",2),e.DNE(3,P,16,0,"div",3),e.DNE(4,S,11,1,"div",4),e.k0s()()),2&o&&(e.R7$(2),e.Y8G("ngIf",n.isProcessing),e.R7$(1),e.Y8G("ngIf",n.showAccountTypeChooser),e.R7$(1),e.Y8G("ngIf",!n.isProcessing&&n.errorMessage))},dependencies:[d.bT],styles:[".sso-callback-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:100vh;background:#f8f9fa}.callback-content[_ngcontent-%COMP%]{text-align:center;padding:48px;background:white;border-radius:12px;box-shadow:0 4px 12px #0000001a;max-width:480px;width:100%}.processing[_ngcontent-%COMP%], .error[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:24px}.processing[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .error[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:24px;font-weight:600;color:#333;margin:0}.processing[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .error[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:16px;color:#676767;margin:0}.processing[_ngcontent-%COMP%] .redirect-text[_ngcontent-%COMP%], .error[_ngcontent-%COMP%] .redirect-text[_ngcontent-%COMP%]{font-size:14px;color:#999;margin-top:16px}.spinner[_ngcontent-%COMP%]{width:64px;
1height:64px;border:4px solid #e5e5e5;border-top-color:#4285f4;border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.error[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeIn .5s ease-in}.account-type-chooser[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:20px}.account-type-chooser[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:24px;font-weight:600;color:#333;margin:0}.account-type-chooser[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:15px;color:#676767;margin:0}.account-type-options[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;width:100%}.account-type-btn[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;padding:16px 20px;border:1.5px solid #e5e5e5;border-radius:10px;background:#fff;text-align:left;cursor:pointer;transition:border-color .15s ease,background .15s ease}.account-type-btn[_ngcontent-%COMP%]:hover{border-color:#4285f4;background:#f8faff}.account-type-btn__title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#1b75b9}.account-type-btn__desc[_ngcontent-%COMP%]{font-size:13px;color:#888}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}"]})}}return s})()}];let M=(()=>{class s{static{this.\u0275fac=function(o){return new(o||s)}}static{this.\u0275mod=e.$C({type:s})}static{this.\u0275inj=e.G2t({imports:[d.MD,h.q1,l.iI.forChild(k)]})}}return s})()}}]);
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.