import {J,c as tS,ag as lp,lO as KS,a5 as fh,ec as ND,a6 as pi,gb as Ys,a7 as si,aM as AD,H as ul,b3 as w,ei as I4,L as w$1,am as Dh,ac as Dr,aN as r4,aG as br,hu as Gi,ah as ot,ap as Qi,bP as he,bU as vI,gf as Bi,ay as df,a9 as zt,aJ as hf,lP as xo,bK as G,bJ as F,aa as ye,N as Sr,bd as K,ad as ce}from'./main-WUGO6e7n.js';var Z,E=J(()=>{tS();lp();KS();fh();ND();pi();Ys();si();AD();tS();ul();w();Z=(()=>{class r extends I4{constructor(e,t){super(e,t),this.assetsService=w$1(Dh),this.currentUserService=w$1(Dr),this.privateServerInformationChange=w$1(r4).privateServerInformationChange,this.showOnboarding$=new br(!1),this.enableOnboarding=Gi(this.privateServerInformationChange.pipe(ot(i=>i.enableOnboarding))),this.steps=Qi([]),this.save$=new he,this.loadSteps(),this.save$.pipe(vI(1e3),Bi(),df(()=>this.updateOnBoardingStepDone())).subscribe();}toggleOnboarding(){if(this.enableOnboarding()){let e=this.currentUserService.webSettingsSnapshot.clone();e.hideOnboarding=!e.hideOnboarding,this.currentUserService.saveUserWebSettings(e);}else this.showOnboarding$.next(!this.showOnboarding$.value);}loadSteps(){this.getSteps().pipe(zt(1)).subscribe(e=>this.steps.set(e));}getSteps(){return this.assetsService.GetAllOnBoardingStep().pipe(hf(e=>this.handleGetApiResult(e)),ot(e=>this.returnWhenSuccessful(e,()=>e.data)))}toggleStepIsDone(e){return this.steps.update(t=>t.map(i=>new xo(i.id===e?G(F({},i),{isDone:!i.isDone}):i))),this.save$.next(),!!this.steps().find(t=>t.id===e)?.isDone}updateOnBoardingStepDone(){let e=this.steps().filter(t=>t.isDone).map(t=>t.id);return this.assetsService.UpdateOnBoardingStepDone(e).pipe(hf(t=>this.handleGetApiResult(t)))}static{this.\u0275fac=function(t){return new(t||r)(ye(Sr),ye(K))};}static{this.\u0275prov=ce({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();});export{E,Z};