import{e as F,i as O,j as m}from"./chunk-2QHWGTUH.js";import{F as x,L as k,N as w,Pa as T,Qa as L,Sa as M,W as I,Za as R,gb as _,rb as j,tb as P,ub as A,xa as D}from"./chunk-6564DHLL.js";import{E as p,Fc as s,Hc as S,L as h,Rc as y,_ as g,ac as a,bc as l,ia as c,ib as v,ob as o,oc as b,u as d,ya as f,yb as C}from"./chunk-YRCUNHHT.js";import"./chunk-2AVGQ2MQ.js";var X=(()=>{class i{#t;#e;#o;constructor(e,t,n,u,Y){this.authService=e,this.router=t,this.apiService=n,this.titleService=u,this.userRoleService=Y,this.title="Logout Page",this.#t=c(k),this.#e=c(R),this.colorMode=this.#e.colorMode,this.#o=c(f),this.currentYear=new Date().getFullYear(),this.#e.localStorageItemName.set("theme-default"),this.#e.eventName.set("ColorSchemeChange"),this.#t.queryParams.pipe(h(1),d(r=>r.theme?.match(/^[A-Za-z0-9\s]+/)?.[0]),p(r=>["dark","light","auto"].includes(r)),g(r=>{this.colorMode.set(r)}),I(this.#o)).subscribe(),this.titleService.setTitle(this.title)}ngOnInit(){try{this.logout()}catch(e){console.error("ngOnInit error in LogoutComponent:",e)}}logout(){try{let e=localStorage.getItem("theme-default");this.authService.clearToken(),localStorage.clear(),e&&localStorage.setItem("theme-default",e),this.userRoleService.clear(),this.router.url!=="/logout"&&this.router.navigate(["/logout"])}catch(e){console.error("Logout failed:",e)}}goToLogin(){this.authService.clearToken(),this.router.navigate(["/login"])}static{this.\u0275fac=function(t){return new(t||i)(o(F),o(w),o(m),o(x),o(O))}}static{this.\u0275cmp=C({type:i,selectors:[["app-logout"]],features:[y([m])],decls:17,vars:1,consts:[[1,"bg-light","dark:bg-transparent","min-vh-100","d-flex","flex-row","align-items-center"],["breakpoint","md"],[1,"justify-content-center"],["lg","10","xl","8"],[1,"p-4"],["cForm",""],["xs","6"],["cButton","","color","primary",1,"logout-btn",3,"click"],[1,"text-center"],["href","https://www.crashplan.com","target","_blank",2,"color","#062D4D","text-decoration","none"]],template:function(t,n){t&1&&(a(0,"div",0)(1,"c-container",1)(2,"c-row",2)(3,"c-col",3)(4,"c-card-group")(5,"c-card",4)(6,"c-card-body")(7,"form",5)(8,"h2"),s(9,"You have been successfully logged out"),l(),a(10,"c-row")(11,"c-col",6)(12,"button",7),b("click",function(){return n.goToLogin()}),s(13," Login to Portal "),l()()()()()()()()()()(),a(14,"div",8)(15,"a",9),s(16),l()()),t&2&&(v(16),S("\xA9 CrashPlan ",n.currentYear," "))},dependencies:[j,A,P,M,T,L,_,D],styles:[".logout-btn[_ngcontent-%COMP%]{color:#fff!important;background-color:#35b7f4!important;border-color:#35b7f4!important;transition:none}.logout-btn[_ngcontent-%COMP%]:hover{transition:background-color .3s ease-in-out,box-shadow .3s ease-in-out;background-color:#35b7f4!important;box-shadow:0 0 5px #0003}"]})}}return i})();export{X as LogoutComponent};
