"use strict";(self.webpackChunkclam_av=self.webpackChunkclam_av||[]).push([[179],{903:(y,Q,s)=>{var w=s(1481),t=s(5062),H=s(348),J=s(4175),N=s(7618),d=s(3990),o=s(4006),g=s(269),f=s(5529),D=s(7625),p=(()=>{return(n=p||(p={})).root="",n.cleanupPage="cleanup",n.newScanPage="newscan",n.scannerPage="scanner",n.doCleanupPage="docleanup",p;var n})(),A=(()=>{return(n=A||(A={})).scanPath="scanpath",n.disinfect="actions",A;var n})(),h=(()=>{return(n=h||(h={})).disinfect="cleanse_mailbox",n.quarantine="quarantine",n.destroy="delete",n.ignore="ignore",h;var n})(),m=(()=>{return(n=m||(m={})).file="File",n.virus="Virus",n.disinfect="Disinfect",n.quarantine="Quarantine",n.destroy="Destroy",n.ignore="Ignore",m;var n})(),S=(()=>{return(n=S||(S={})).done="done",n.running="running",S;var n})(),I=(()=>{return(n=I||(I={})).done="done",n.step="step",I;var n})(),x=(()=>{return(n=x||(x={})).cleansed="mailbox-cleansed",n.deleted="deleted",n.error="error",n.noAction="no-action",n.quarantined="quarantined",n.success="success",n.warning="warning",x;var n})(),_=(()=>{return(n=_||(_={})).namespace="ClamScanner",n.startScan="start_scan",n.getScanStatus="get_scan_status",n.getScanPath="get_scan_paths",n.listInfectedFiles="list_infected_files",n.disinfectedFiles="disinfect_files",n.checkDisinfectedStatus="check_disinfection_status",n.scanTypeArgs="scan_type",n.virusesArg="viruses",n.actionsArg="actions",_;var n})(),v=(()=>{return(n=v||(v={})).failedToStartScan="FAILED_TO_START_SCAN",n.noScanpathOrData="NO_SCANPATH_OR_DATA",n.failedToFetchScanStatus="FAILED_TO_FETCH_SCAN_STATUS",n.internalError="INTERNAL_ERROR",v;var n})(),C=(()=>{return(n=C||(C={})).failedToFetchInfectedFiles="FAILED_TO_FETCH_INFECTED_FILES",n.internalError="INTERNAL_ERROR",C;var n})(),F=(()=>{return(n=F||(F={})).failedToStartDisinfection="FAILED_TO_START_DISINFECTION",n.noVirusActionsOrData="NO_VIRUS_ACTIONS_OR_DATA",n.failedToFetchDisinfectStatus="FAILED_TO_FETCH_DISINFECT_STATUS",n.internalError="INTERNAL_ERROR",F;var n})(),M=s(1086),T=s(4850),O=s(7221),j=s(2868),Y=s(4290),U=s(2986),V=s(9194),X=s(1737),K=s(8896),W=s(2313);let q;const it={interval:2e3,initialDelay:0,maxAttempts:5},L=(n,a=it)=>(0,V.H)(a.initialDelay,a.interval).pipe((0,W.c)(n.pipe(at(a.maxAttempts)))).pipe((0,j.b)(()=>q=a.maxAttempts)),at=n=>(q=n,(0,O.K)(a=>(console.error(a),q--<=1?(0,X._)(`Polling failed ${n} times in succession.`):K.E)));var l=s(3063),Z=s(2291),R=s(7709);const ct=n=>{const a={};for(const e of n){const i=Object.keys(e)[0];a[i]=e[i]}return a};var st=s(8638);let k=(()=>{class n{constructor(e){this._http=e}getScanPaths(){const e=new Z.j({namespace:_.namespace,method:_.getScanPath});return this._http.get(e).pipe((0,T.U)(i=>{if(1===i.status)return i.data;throw i.errors.pop()}))}startScan(e){const i=new Z.j({namespace:_.namespace,method:_.startScan,arguments:[new R.h(_.scanTypeArgs,e)]});return this._http.get(i).pipe((0,T.U)(c=>{if(1===c.status)return!0;throw c.errors.pop()}))}getScanStatus(){const e=new Z.j({namespace:_.namespace,method:_.getScanStatus});return this._http.get(e).pipe((0,T.U)(i=>{if(1===i.status)return i.data;throw i.errors.pop()}))}getInfectedFiles(){const e=new Z.j({namespace:_.namespace,method:_.listInfectedFiles});return this._http.get(e).pipe((0,T.U)(i=>{if(1===i.status)return i.data;throw i.errors.pop()}))}startDisinfect(e){const i=new Z.j({namespace:_.namespace,method:_.disinfectedFiles,arguments:[new R.h(_.actionsArg,ct(e))],config:{json:!0}});return this._http.post(i).pipe((0,T.U)(c=>{if(1===c.status)return!0;throw c.errors.pop()}))}getDisinfectStatus(){const e=new Z.j({namespace:_.namespace,method:_.checkDisinfectedStatus});return this._http.get(e).pipe((0,T.U)(i=>{if(1===i.status)return i.data;throw i.errors.pop()}))}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(st.Tr))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),P=(()=>{class n{constructor(e,i,c,r){this._router=e,this.locale=i,this._alertService=c,this._clamApiService=r,this.disinfectStatusSubject=new f.xQ,this.infectedFilesSubject=new f.xQ,this.disinfectErrorSubject=new f.xQ,this.doDisinfectErrorSubject=new f.xQ}getInfectedFiles(){this.getMappedInfectedFiles().subscribe(e=>this.infectedFilesSubject.next(e),()=>{this.disinfectErrorSubject.next(C.failedToFetchInfectedFiles)})}getMappedInfectedFiles(){return this._clamApiService.getInfectedFiles().pipe((0,T.U)(e=>e.map(i=>({...i,virusInMailDir:i.file.includes("/mail/")||i.file.startsWith("mail/")}))),(0,O.K)(()=>(0,M.of)([])))}goToDoDisinfectPage(e){this._router.navigate([p.doCleanupPage],{state:{values:e}})}startDisinfect({virusesWithActions:e,disinfectStatus:i}){i?(this.disinfectStatusSubject.next(i),this.startPolling()):!i&&e?this._startFreshDisinfection(e):this._checkForOngoingDisinfection()}startPolling(e){L(this._clamApiService.getDisinfectStatus(),e).pipe((0,j.b)(i=>this.disinfectStatusSubject.next(i)),(0,Y.o)(i=>i.status!==S.done)).subscribe({error:()=>{this.doDisinfectErrorSubject.next(F.failedToFetchDisinfectStatus);const i=this.locale.maketext("The system failed to fetch the disinfect status.");this._alertService.error(i)}})}_startFreshDisinfection(e){this._clamApiService.startDisinfect(e).pipe((0,U.q)(1)).subscribe(()=>this.startPolling(),()=>{this.doDisinfectErrorSubject.next(F.failedToStartDisinfection);const i=this.locale.maketext("The system failed to start the disinfection process in the background.");this._alertService.error(i)})}_checkForOngoingDisinfection(){this._clamApiService.getDisinfectStatus().subscribe(e=>{e?.status===S.running&&this.startPolling(),this.disinfectStatusSubject.next(e)},()=>{this.doDisinfectErrorSubject.next(F.internalError);const e=this.locale.maketext("Internal Error"),i=this.locale.maketext("If this condition persists, contact your system administrator.");this._alertService.error(`${e} ${i}`)})}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(d.F0),t.LFG(g.g),t.LFG(l.c9),t.LFG(k))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var u=s(6895);let E=(()=>{class n{constructor(e,i){this.locale=e,this._alertService=i,this.rootRoute=p.root}clearAlerts(){this._alertService.clear()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.g),t.Y36(l.c9))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-clam-start-scan-link"]],decls:2,vars:2,consts:[["id","start-scan-link__error-link",1,"start-scan-link__error-link",3,"routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"a",0),t.NdJ("click",function(){return i.clearAlerts()}),t._uU(1),t.qZA()),2&e&&(t.Q6J("routerLink",i.rootRoute),t.xp6(1),t.Oqu(i.locale.maketext("Start a New Scan")))},directives:[d.yS],styles:[".start-scan-link__error-link[_ngcontent-%COMP%]{display:block;margin-top:10px}"]}),n})();function ot(n,a){1&n&&t._UZ(0,"cp-loading-spinner",5)}function rt(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("The system failed to fetch the infected files.")," ")}}function lt(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("Internal Error")," ")}}function ut(n,a){if(1&n&&(t.TgZ(0,"cp-callout",6)(1,"h3",7),t._uU(2),t.qZA(),t.ynx(3,8),t.YNc(4,rt,2,1,"div",9),t.YNc(5,lt,2,1,"div",9),t.BQk(),t.TgZ(6,"div"),t._uU(7),t.qZA(),t._UZ(8,"cp-clam-start-scan-link"),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.hij(" ",e.locale.maketext("Oops!")," "),t.xp6(1),t.Q6J("ngSwitch",e.errorMessage),t.xp6(1),t.Q6J("ngSwitchCase",e.disinfectErrorMessage.failedToFetchInfectedFiles),t.xp6(1),t.Q6J("ngSwitchCase",e.disinfectErrorMessage.internalError),t.xp6(2),t.hij(" ",e.locale.maketext("If this condition persists, contact your system administrator.")," ")}}function pt(n,a){if(1&n&&(t.TgZ(0,"cp-callout",10)(1,"h3",7),t._uU(2),t.qZA(),t._UZ(3,"cp-clam-start-scan-link"),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.hij(" ",e.locale.maketext("No cleanup process found.")," ")}}function _t(n,a){1&n&&(t.TgZ(0,"span"),t._uU(1,"* "),t.qZA())}function dt(n,a){if(1&n&&(t.TgZ(0,"th"),t.YNc(1,_t,2,0,"span",3),t._uU(2),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.id===i.disinfectTableHeaders.disinfect),t.xp6(1),t.hij(" ",e.label," ")}}function ft(n,a){if(1&n&&t._UZ(0,"input",20),2&n){const e=t.oxw().$implicit,i=t.oxw().$implicit;t.Q6J("formControlName",i.file)("id","disinfect__"+i.file+"--"+e)("name",i.file)("value",e)}}function ht(n,a){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,ft,1,4,"input",19),t.qZA()),2&n){const e=a.$implicit,i=t.oxw().$implicit,c=t.oxw(2);t.xp6(1),t.Q6J("ngIf",c.showDisinfectRadio(e,i))}}function mt(n,a){if(1&n&&(t.TgZ(0,"tr",17)(1,"td",18),t._uU(2),t.qZA(),t.TgZ(3,"td",18),t._uU(4),t.qZA(),t.YNc(5,ht,2,1,"td",13),t.qZA()),2&n){const e=a.$implicit,i=a.index,c=t.oxw(2);t.Q6J("formGroupName",i)("id","disinfect__row-"+e.file),t.xp6(1),t.Q6J("id","disinfect__file-"+e.file),t.xp6(1),t.hij(" ",e.file," "),t.xp6(1),t.Q6J("id","disinfect__virus_type-"+e.virus_type),t.xp6(1),t.hij(" ",e.virus_type," "),t.xp6(1),t.Q6J("ngForOf",c.actions)}}function gt(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th")(1,"input",21),t.NdJ("click",function(){const r=t.CHM(e).$implicit;return t.oxw(2).selectAll(r)}),t.qZA()()}if(2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("id","disinfect__all--"+e)("value",i.locale.maketext("Select All"))}}function xt(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"section")(1,"form",11),t.NdJ("ngSubmit",function(){return t.CHM(e),t.oxw().submit()}),t.TgZ(2,"table",12)(3,"thead")(4,"tr"),t.YNc(5,dt,3,2,"th",13),t.qZA()(),t.ynx(6,14),t.TgZ(7,"tbody"),t.YNc(8,mt,6,7,"tr",15),t.qZA(),t.BQk(),t.TgZ(9,"tfoot")(10,"tr")(11,"th"),t._uU(12,"\xa0"),t.qZA(),t.TgZ(13,"th"),t._uU(14,"\xa0"),t.qZA(),t.YNc(15,gt,2,2,"th",13),t.qZA()()(),t.TgZ(16,"button",16),t._uU(17),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("formGroup",e.formGroup),t.xp6(4),t.Q6J("ngForOf",e.tableHeaders),t.xp6(3),t.Q6J("ngForOf",e.infectedFilesData)("ngForTrackBy",e.trackByFile),t.xp6(7),t.Q6J("ngForOf",e.actions),t.xp6(2),t.hij(" ",e.locale.maketext("Process Cleanup")," ")}}function St(n,a){if(1&n&&(t.TgZ(0,"div",22),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij(" * ",e.locale.maketext("Only mailboxes can be disinfected."),"\n")}}let vt=(()=>{class n{constructor(e,i,c,r){this.locale=e,this._disinfectFacadeService=i,this._router=c,this._fb=r,this.submitted=!1,this.disinfectTableHeaders=m,this.actions=Object.values(h),this.showDisinfectNotice=!0,this.loading=!0,this.disinfectErrorMessage=C,this._destroy$=new f.xQ,this.formGroup=this._fb.group({formArray:this._fb.array([])}),this._infectedFormArray=this.formGroup.get("formArray"),this._initTableHeaders(),this._subscribeToDisinfectErrorSubject(),this._subscribeToInfectedFilesSubject(),this.infectedFilesData=this._router.getCurrentNavigation().extras.state}canDeactivate(){return!this.loading&&!this.infectedFilesData?.length||this.submitted}ngOnInit(){this.infectedFilesData?this._initInfectedFilesFormAndSetDisinfectFlag():this._disinfectFacadeService.getInfectedFiles()}ngOnDestroy(){this._destroy$.next()}selectAll(e){for(let i=0;i<this.infectedFilesData.length;i++){const c=this._infectedFormArray.get([i]),r=Object.keys(c.controls)[0];(e!==h.disinfect||e===h.disinfect&&this.infectedFilesData[i].virusInMailDir)&&c.get([r]).setValue(e)}}submit(){this.submitted=!0,this._disinfectFacadeService.goToDoDisinfectPage(this._infectedFormArray.value)}trackByFile(e,i){return i.file}showDisinfectRadio(e,i){return e!==h.disinfect||e===h.disinfect&&i.virusInMailDir}_initInfectedFilesFormAndSetDisinfectFlag(){let e=!1;this.infectedFilesData.map(i=>{const c=this._fb.group({[i.file]:["",o.kI.required]});this._infectedFormArray.push(c),i.virusInMailDir?(e=!0,c.setValue({[i.file]:h.disinfect})):c.setValue({[i.file]:h.quarantine})}),!e&&this.infectedFilesData.length&&this._hideDisinfectFlagAndAction(),this.loading=!1}_initTableHeaders(){this.tableHeaders=[{id:m.file,label:this.locale.maketext("File")},{id:m.virus,label:this.locale.maketext("Virus")},{id:m.disinfect,label:this.locale.maketext("Disinfect")},{id:m.quarantine,label:this.locale.maketext("Quarantine")},{id:m.destroy,label:this.locale.maketext("Destroy")},{id:m.ignore,label:this.locale.maketext("Ignore")}]}_hideDisinfectFlagAndAction(){this.showDisinfectNotice=!1,this.actions=this.actions.filter(e=>e!==h.disinfect),this.tableHeaders=this.tableHeaders.filter(e=>e.id!==m.disinfect)}_subscribeToDisinfectErrorSubject(){this._disinfectFacadeService.disinfectErrorSubject.pipe((0,D.R)(this._destroy$)).subscribe(e=>{this.errorMessage=e,this.loading=!1})}_subscribeToInfectedFilesSubject(){this._disinfectFacadeService.infectedFilesSubject.pipe((0,D.R)(this._destroy$)).subscribe(e=>{this.infectedFilesData=e,this.loading=!1,this._initInfectedFilesFormAndSetDisinfectFlag()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.g),t.Y36(P),t.Y36(d.F0),t.Y36(o.qu))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-clam-disinfect"]],hostBindings:function(e,i){1&e&&t.NdJ("beforeunload",function(){return i.canDeactivate()},!1,t.Jf7)},decls:7,vars:6,consts:[["id","disinfect__loading-spinner",4,"ngIf"],["id","disinfect__callout--danger","class","clam-callout","calloutType","danger",4,"ngIf"],["id","disinfect__callout--info","class","clam-callout","calloutType","info",4,"ngIf"],[4,"ngIf"],["id","disinfect__mailbox-notice",4,"ngIf"],["id","disinfect__loading-spinner"],["id","disinfect__callout--danger","calloutType","danger",1,"clam-callout"],[1,"clam-callout__header"],[3,"ngSwitch"],[4,"ngSwitchCase"],["id","disinfect__callout--info","calloutType","info",1,"clam-callout"],["method","post",3,"formGroup","ngSubmit"],[1,"table","table-striped"],[4,"ngFor","ngForOf"],["formArrayName","formArray"],[3,"formGroupName","id",4,"ngFor","ngForOf","ngForTrackBy"],["type","submit","id","disinfect__btn-submit",1,"btn","btn-primary"],[3,"formGroupName","id"],[3,"id"],["type","radio",3,"formControlName","id","name","value",4,"ngIf"],["type","radio",3,"formControlName","id","name","value"],["type","button",1,"btn","btn-default",3,"id","value","click"],["id","disinfect__mailbox-notice"]],template:function(e,i){1&e&&(t.TgZ(0,"h2"),t._uU(1),t.qZA(),t.YNc(2,ot,1,0,"cp-loading-spinner",0),t.YNc(3,ut,9,5,"cp-callout",1),t.YNc(4,pt,4,1,"cp-callout",2),t.YNc(5,xt,18,6,"section",3),t.YNc(6,St,2,1,"div",4)),2&e&&(t.xp6(1),t.Oqu(i.locale.maketext("Cleanup Process")),t.xp6(1),t.Q6J("ngIf",i.loading),t.xp6(1),t.Q6J("ngIf",i.errorMessage),t.xp6(1),t.Q6J("ngIf",!(i.loading||null!=i.infectedFilesData&&i.infectedFilesData.length||i.errorMessage)),t.xp6(1),t.Q6J("ngIf",!i.loading&&(null==i.infectedFilesData?null:i.infectedFilesData.length)),t.xp6(1),t.Q6J("ngIf",i.showDisinfectNotice))},directives:[u.O5,l.go,l.Oc,u.RF,u.n9,E,o._Y,o.JL,o.sg,u.sg,o.CE,o.x0,o._,o.Fj,o.JJ,o.u],encapsulation:2}),n})();function Tt(n,a){1&n&&t._UZ(0,"cp-loading-spinner",4)}function bt(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("The system failed to start a disinfection.")," ")}}function Ft(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("No cleanup process found.")," ")}}function Dt(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t._uU(1),t.TgZ(2,"button",9),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).continuePolling()}),t._uU(3),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("The system failed to fetch the disinfect status.")," "),t.xp6(2),t.hij(" ",e.locale.maketext("Try again")," ")}}function Zt(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("Internal Error")," ")}}function yt(n,a){if(1&n&&(t.TgZ(0,"cp-callout",5)(1,"h3",6),t._uU(2),t.qZA(),t.ynx(3,7),t.YNc(4,bt,2,1,"div",8),t.YNc(5,Ft,2,1,"div",8),t.YNc(6,Dt,4,2,"div",8),t.YNc(7,Zt,2,1,"div",8),t.TgZ(8,"div"),t._uU(9),t.qZA(),t._UZ(10,"cp-clam-start-scan-link"),t.BQk(),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.hij(" ",e.locale.maketext("Oops!")," "),t.xp6(1),t.Q6J("ngSwitch",e.errorMessage),t.xp6(1),t.Q6J("ngSwitchCase",e.doDisinfectErrorMessage.failedToFetchDisinfectStatus),t.xp6(1),t.Q6J("ngSwitchCase",e.doDisinfectErrorMessage.noVirusActionsOrData),t.xp6(1),t.Q6J("ngSwitchCase",e.doDisinfectErrorMessage.failedToFetchDisinfectStatus),t.xp6(1),t.Q6J("ngSwitchCase",e.doDisinfectErrorMessage.internalError),t.xp6(2),t.hij(" ",e.locale.maketext("If this condition persists, contact your system administrator.")," ")}}function At(n,a){if(1&n&&(t.TgZ(0,"cp-callout",10)(1,"h3",6),t._uU(2),t.qZA(),t._UZ(3,"cp-clam-start-scan-link"),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.hij(" ",e.locale.maketext("No cleanup process found.")," ")}}function Ct(n,a){if(1&n&&(t.TgZ(0,"div",15),t._uU(1,"\n "),t._UZ(2,"span",16),t._uU(3,"\n "),t.TgZ(4,"span"),t._uU(5),t.qZA(),t._uU(6,"\n "),t.qZA()),2&n){const e=t.oxw(3);t.xp6(5),t.Oqu(e.locale.maketext("Processing \u2026"))}}function kt(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.Oqu(e.message)}}function wt(n,a){if(1&n&&(t.ynx(0),t._uU(1,"\n "),t.TgZ(2,"span",18),t._uU(3),t.qZA(),t._uU(4,"\n "),t.TgZ(5,"span"),t._uU(6),t.qZA(),t._uU(7,"\n "),t.YNc(8,kt,2,1,"span",3),t._uU(9,"\n "),t.BQk()),2&n){const e=t.oxw().$implicit,i=t.oxw(4);t.xp6(3),t.hij("",e.file,":"),t.xp6(3),t.Oqu(i.stateTranslations[e.state]),t.xp6(2),t.Q6J("ngIf",e.message)}}function It(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1,"\n "),t.YNc(2,wt,10,3,"ng-container",3),t._uU(3,"\n "),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Q6J("ngIf",e.file)}}function Ut(n,a){if(1&n&&(t.ynx(0),t._uU(1,"\n "),t.YNc(2,It,4,1,"div",17),t._uU(3,"\n "),t.BQk()),2&n){const e=t.oxw(3);t.xp6(2),t.Q6J("ngForOf",e.disinfectStatusData.details)}}function Nt(n,a){if(1&n&&(t.TgZ(0,"div",19),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij("\n ",e.locale.maketext("Scan Complete!"),"\n ")}}function Ot(n,a){if(1&n&&(t.TgZ(0,"pre",12),t._uU(1," "),t.YNc(2,Ct,7,1,"div",13),t._uU(3,"\n\n "),t.YNc(4,Ut,4,1,"ng-container",3),t._uU(5,"\n\n "),t.YNc(6,Nt,2,1,"div",14),t._uU(7,"\n"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("ngIf",(null==e.disinfectStatusData?null:e.disinfectStatusData.status)===e.disinfectCompletedStatus.running&&!e.errorMessage),t.xp6(2),t.Q6J("ngIf",null==e.disinfectStatusData?null:e.disinfectStatusData.details),t.xp6(2),t.Q6J("ngIf",(null==e.disinfectStatusData?null:e.disinfectStatusData.status)===e.disinfectCompletedStatus.done)}}function jt(n,a){if(1&n&&(t.ynx(0),t.YNc(1,Ot,8,3,"pre",11),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",!e.loading&&!e.errorMessage||e.disinfectStatusData)}}let qt=(()=>{class n{constructor(e,i,c,r){this.locale=e,this._disinfectFacadeService=i,this._cd=c,this._router=r,this.loading=!0,this.disinfectCompletedStatus=S,this.doDisinfectErrorMessage=F,this.disinfectionInProgress=!0,this._destroy$=new f.xQ,this.subscribeToDoDisinfectErrorSubject(),this.subscribeToDisinfectStatusSubject(),this.initStateTranslations(),this.disinfectStatusData=this._router.getCurrentNavigation()?.extras?.state?.status,this._disinfectActions=this._router.getCurrentNavigation()?.extras?.state?.values}ngOnInit(){this.disinfectStatusData&&(this.loading=!1),this.startDisinfect()}ngOnDestroy(){this._destroy$.next()}continuePolling(){this.errorMessage=null,this._cd.markForCheck(),this._disinfectFacadeService.startPolling()}startDisinfect(){this._disinfectFacadeService.startDisinfect({virusesWithActions:this._disinfectActions,disinfectStatus:this.disinfectStatusData})}initStateTranslations(){this.stateTranslations={[x.cleansed]:this.locale.maketext("Disinfected.[comment, placed after the path to a file that was cleaned]"),[x.deleted]:this.locale.maketext("Deleted.[comment, placed after the path to a file that was removed]"),[x.quarantined]:this.locale.maketext("Quarantined.[comment, placed after the path to a file that was moved to a safer place]"),[x.noAction]:this.locale.maketext("Ignored.[comment, placed after the path to a file that was not processed]"),[x.warning]:this.locale.maketext("Warning!"),[x.error]:this.locale.maketext("Error!"),[x.success]:this.locale.maketext("Success!")}}subscribeToDoDisinfectErrorSubject(){this._disinfectFacadeService.doDisinfectErrorSubject.pipe((0,D.R)(this._destroy$)).subscribe(e=>{this.loading=!1,this.errorMessage=e,this._cd.markForCheck()})}subscribeToDisinfectStatusSubject(){this._disinfectFacadeService.disinfectStatusSubject.pipe((0,D.R)(this._destroy$)).subscribe(e=>{this.loading=!1,this.disinfectStatusData=e,e.status===S.done&&e.details[0].type===I.done&&(this.disinfectionInProgress=!1),this._cd.markForCheck()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.g),t.Y36(P),t.Y36(t.sBO),t.Y36(d.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-clam-do-disinfect"]],decls:6,vars:5,consts:[["id","do-disinfect__loading-spinner",4,"ngIf"],["id","do-disinfect__callout","class","clam-callout","calloutType","danger",4,"ngIf"],["id","do-disinfect__no-cleanup","calloutType","info","class","clam-callout",4,"ngIf"],[4,"ngIf"],["id","do-disinfect__loading-spinner"],["id","do-disinfect__callout","calloutType","danger",1,"clam-callout"],[1,"clam-callout__header"],[3,"ngSwitch"],[4,"ngSwitchCase"],["id","do-disinfect__error-btn",1,"btn","btn-sm","btn-default",3,"click"],["id","do-disinfect__no-cleanup","calloutType","info",1,"clam-callout"],["class","do-disinfect__pre","id","do-disinfect__results",4,"ngIf"],["id","do-disinfect__results",1,"do-disinfect__pre"],["class","do-disinfect__processing",4,"ngIf"],["class","do-disinfect__scan-complete",4,"ngIf"],[1,"do-disinfect__processing"],[1,"fas","fa-sync","fa-spin"],[4,"ngFor","ngForOf"],[1,"do-disinfect__file-name"],[1,"do-disinfect__scan-complete"]],template:function(e,i){1&e&&(t.TgZ(0,"h2"),t._uU(1),t.qZA(),t.YNc(2,Tt,1,0,"cp-loading-spinner",0),t.YNc(3,yt,11,7,"cp-callout",1),t.YNc(4,At,4,1,"cp-callout",2),t.YNc(5,jt,2,1,"ng-container",3)),2&e&&(t.xp6(1),t.Oqu(i.locale.maketext("Cleanup Process")),t.xp6(1),t.Q6J("ngIf",i.loading),t.xp6(1),t.Q6J("ngIf",i.errorMessage),t.xp6(1),t.Q6J("ngIf",!i.disinfectionInProgress),t.xp6(1),t.Q6J("ngIf",i.disinfectionInProgress))},directives:[u.O5,l.go,l.Oc,u.RF,u.n9,E,u.sg],styles:[".clam-callout__header[_ngcontent-%COMP%]{margin-top:0}.clam-callout[_ngcontent-%COMP%]{display:block;max-width:500px}.do-disinfect__file-name[_ngcontent-%COMP%]{font-weight:700}.do-disinfect__scan-complete[_ngcontent-%COMP%]{margin-top:10px}.do-disinfect__pre[_ngcontent-%COMP%]{white-space:normal}.do-disinfect__processing[_ngcontent-%COMP%]{margin-bottom:5px}"],changeDetection:0}),n})(),Pt=(()=>{class n{constructor(e,i){this._router=e,this._clamApiService=i}hasMailLinkage(){return window.PAGE?.hasMailnodeLinkage}goToScanPage(e){this._router.navigate([p.scannerPage,{[A.scanPath]:e}])}getScanpaths(){return this._clamApiService.getScanPaths()}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(d.F0),t.LFG(k))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function Et(n,a){if(1&n&&t._UZ(0,"cp-alert",7),2&n){const e=t.oxw();t.Q6J("alert",e.linkedNodeAlert)}}function Qt(n,a){if(1&n&&(t.TgZ(0,"tr",8),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij(" ",e.locale.maketext("Loading \u2026")," ")}}function Jt(n,a){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._UZ(2,"input",9),t.TgZ(3,"label",10),t._uU(4),t.qZA()()()),2&n){const e=a.$implicit;t.xp6(2),t.Q6J("id","new-scan__control-"+e.id)("value",e.id),t.xp6(1),t.Q6J("for","new-scan__control-"+e.id),t.xp6(1),t.hij("\xa0",e.message,"")}}function Mt(n,a){if(1&n&&(t.TgZ(0,"button",11),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij(" ",e.locale.maketext("Scan Now")," ")}}let Yt=(()=>{class n{constructor(e,i,c,r){this.newscanFacade=e,this.locale=i,this._fb=c,this._cd=r,this.scanpathForm=this._fb.group({scanpath:[""]}),this.linkedNodeAlert=new l.bZ(this.locale.maketext("Due to your system\u2019s configuration, the system can not scan all files in your user\u2019s mail directory."),l.NK.warning,{isCloseable:!1})}ngOnInit(){this._getScanpaths()}onSubmitScanpath(){this.newscanFacade.goToScanPage(this.scanpathForm.value.scanpath)}_getScanpaths(){this.newscanFacade.getScanpaths().pipe((0,U.q)(1)).subscribe(e=>{this.scanpaths=e,this.scanpathForm.controls.scanpath.patchValue(e[0].id),this._cd.markForCheck()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(Pt),t.Y36(g.g),t.Y36(o.qu),t.Y36(t.sBO))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-clam-new-scan"]],decls:16,vars:7,consts:[["id","new-scan__header"],["id","new-scan__alert","class","new-scan__alert",3,"alert",4,"ngIf"],[3,"formGroup","ngSubmit"],["cellspacing","0","cellpadding","2","border","0","align","center"],["id","new-scan__loading",4,"ngIf"],[4,"ngFor","ngForOf"],["class","btn btn-default","id","new-scan__submit-button","type","submit",4,"ngIf"],["id","new-scan__alert",1,"new-scan__alert",3,"alert"],["id","new-scan__loading"],["formControlName","scanpath","name","scanpath","type","radio",3,"id","value"],[3,"for"],["id","new-scan__submit-button","type","submit",1,"btn","btn-default"]],template:function(e,i){1&e&&(t.TgZ(0,"h2",0),t._uU(1),t.qZA(),t.TgZ(2,"p"),t._uU(3),t.qZA(),t.YNc(4,Et,1,1,"cp-alert",1),t.TgZ(5,"form",2),t.NdJ("ngSubmit",function(){return i.onSubmitScanpath()}),t.TgZ(6,"table",3)(7,"tbody"),t.YNc(8,Qt,2,1,"tr",4),t.YNc(9,Jt,5,4,"tr",5),t.TgZ(10,"tr")(11,"td"),t._uU(12,"\xa0"),t.qZA()(),t.TgZ(13,"tr")(14,"td"),t.YNc(15,Mt,2,1,"button",6),t.qZA()()()()()),2&e&&(t.xp6(1),t.Oqu(i.locale.maketext("Start a New Scan")),t.xp6(2),t.hij(" ",i.locale.maketext("Scans will automatically stop if they run for more than one day."),"\n"),t.xp6(1),t.Q6J("ngIf",i.newscanFacade.hasMailLinkage()),t.xp6(1),t.Q6J("formGroup",i.scanpathForm),t.xp6(3),t.Q6J("ngIf",!i.scanpaths),t.xp6(1),t.Q6J("ngForOf",i.scanpaths),t.xp6(6),t.Q6J("ngIf",i.scanpaths))},directives:[u.O5,l.wx,o._Y,o.JL,o.sg,u.sg,o.Fj,o._,o.JJ,o.u],styles:[".new-scan__alert[_ngcontent-%COMP%]{display:block;width:-moz-fit-content;width:fit-content}"],changeDetection:0}),n})(),Lt=(()=>{class n{constructor(e,i){this._bsModalRef=e,this.locale=i,this.onHide=new f.xQ}ngOnInit(){this.scannerData.infected_files.length?(this.infoText=this.locale.maketext("Infected files found."),this.buttonText=this.locale.maketext("Go to the Cleanup Process Page")):(this.infoText=this.locale.maketext("No virus found."),this.buttonText=this.locale.maketext("Close"))}close(e=null){this.onHide.next(e),this._bsModalRef.hide()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(N.UZ),t.Y36(g.g))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-clam-scan-complete-modal"]],decls:13,vars:5,consts:[[1,"modal-header","scan-complete-modal__header"],[1,"modal-title","scan-complete-modal__title"],["id","scan-complete-modal__close-button",1,"close",3,"click"],["aria-hidden","true"],["aria-hidden","true",1,"fas","fa-times"],[1,"modal-body"],["id","scan-complete-modal__info"],["id","scan-complete-modal__main-button",1,"btn","btn-primary",3,"click"],["id","scan-complete-modal__label",1,"sr-only"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"h2",1),t._uU(2),t.qZA(),t.TgZ(3,"button",2),t.NdJ("click",function(){return i.close()}),t.TgZ(4,"span",3),t._UZ(5,"i",4),t.qZA()()(),t.TgZ(6,"div",5)(7,"p",6),t._uU(8),t.qZA(),t.TgZ(9,"button",7),t.NdJ("click",function(){return i.close()}),t._uU(10),t.qZA()(),t.TgZ(11,"label",8),t._uU(12),t.qZA()),2&e&&(t.xp6(2),t.hij(" ",i.locale.maketext("Virus Scan Complete")," "),t.xp6(1),t.uIk("aria-label",i.locale.maketext("Close")),t.xp6(5),t.Oqu(i.infoText),t.xp6(2),t.hij(" ",i.buttonText," "),t.xp6(2),t.Oqu(i.locale.maketext("Virus scan complete modal.")))},styles:[".scan-complete-modal__header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;flex-direction:row}.scan-complete-modal__title[_ngcontent-%COMP%]{font-size:2rem}"]}),n})(),G=(()=>{class n{constructor(e,i,c,r,b){this._apiService=e,this._alertService=i,this.locale=c,this._modalService=r,this._router=b,this.scannerDataSubject=new f.xQ,this.scannerErrorSubject=new f.xQ,this.config={keyboard:!1,ignoreBackdropClick:!0,ariaLabelledBy:"scan-complete-modal__label"}}startFileScan({scanpath:e,scannerData:i}){i?(this.scannerDataSubject.next(i),this._startPolling()):e?this._apiService.startScan(e).pipe((0,U.q)(1)).subscribe(()=>this._startPolling(),()=>{this.scannerErrorSubject.next(v.failedToStartScan);const c=this.locale.maketext("The system failed to start the virus scanner in the background.");this._alertService.error(c)}):this._apiService.getScanStatus().subscribe(c=>{!c.scan_complete&&c.scanned_file_size?(this.scannerDataSubject.next(c),this._startPolling()):this.scannerErrorSubject.next(v.noScanpathOrData)},()=>{this.scannerErrorSubject.next(v.internalError);const c=this.locale.maketext("Internal Error"),r=this.locale.maketext("If this condition persists, contact your system administrator.");this._alertService.error(`${c} ${r}`)})}openModal(e){this._modalService.show(Lt,{...this.config,initialState:{scannerData:e}}).content.onHide.pipe((0,U.q)(1)).subscribe(()=>this._goTo(e.infected_files.length?p.cleanupPage:p.root))}_goTo(e){this._router.navigate([e])}_startPolling(e){L(this._apiService.getScanStatus(),e).pipe((0,j.b)(c=>this.scannerDataSubject.next(c)),(0,Y.o)(c=>!c?.scan_complete)).subscribe({error:()=>{this.scannerErrorSubject.next(v.failedToFetchScanStatus);const c=this.locale.maketext("The system failed to fetch the scan status.");this._alertService.error(c)}})}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(k),t.LFG(l.c9),t.LFG(g.g),t.LFG(N.tT),t.LFG(d.F0))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function Rt(n,a){1&n&&t._UZ(0,"cp-loading-spinner",5)}function Gt(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("The system failed to start a scan.")," ")}}function $t(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t._uU(1),t.TgZ(2,"button",12),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).continuePolling()}),t._uU(3),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("The system failed to fetch the scan status.")," "),t.xp6(2),t.hij(" ",e.locale.maketext("Try again")," ")}}function Bt(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("Something bad happened.")," ")}}function zt(n,a){if(1&n&&(t.TgZ(0,"cp-callout",6)(1,"h3",7),t._uU(2),t.qZA(),t.ynx(3,8),t.YNc(4,Gt,2,1,"div",9),t.YNc(5,$t,4,2,"div",9),t.YNc(6,Bt,2,1,"div",10),t.TgZ(7,"div",11),t._uU(8),t.qZA(),t._UZ(9,"cp-clam-start-scan-link"),t.BQk(),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.hij(" ",e.locale.maketext("Oops!")," "),t.xp6(1),t.Q6J("ngSwitch",e.errorMessage),t.xp6(1),t.Q6J("ngSwitchCase",e.scannerPageErrors.failedToStartScan),t.xp6(1),t.Q6J("ngSwitchCase",e.scannerPageErrors.failedToFetchScanStatus),t.xp6(3),t.hij(" ",e.locale.maketext("If this condition persists, contact your system administrator.")," ")}}function Ht(n,a){if(1&n&&(t.TgZ(0,"cp-callout",13)(1,"h3",7),t._uU(2),t.qZA(),t._UZ(3,"cp-clam-start-scan-link"),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.hij(" ",e.locale.maketext("No active scans.")," ")}}function Vt(n,a){if(1&n&&(t.TgZ(0,"option",37),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.hij(" ",e," ")}}function Xt(n,a){if(1&n&&(t.TgZ(0,"div")(1,"div")(2,"p")(3,"strong"),t._uU(4),t.qZA(),t.TgZ(5,"span",14),t._uU(6),t.qZA()(),t.TgZ(7,"form",15)(8,"div",16)(9,"label",17),t._uU(10),t.qZA(),t.TgZ(11,"div",18)(12,"div",19),t._UZ(13,"input",20),t.qZA(),t.TgZ(14,"div",21),t._uU(15,"/"),t.qZA(),t.TgZ(16,"div",19)(17,"label",22),t._uU(18),t.qZA(),t._UZ(19,"input",23),t.qZA()()(),t.TgZ(20,"div",16)(21,"label",24),t._uU(22),t.qZA(),t.TgZ(23,"div",18)(24,"div",19)(25,"div",25),t._UZ(26,"input",26),t.TgZ(27,"span",27),t._uU(28,"MB"),t.qZA()()(),t.TgZ(29,"div",21),t._uU(30,"/"),t.qZA(),t.TgZ(31,"div",19)(32,"div",25)(33,"label",28),t._uU(34),t.qZA(),t._UZ(35,"input",29),t.TgZ(36,"span",27),t._uU(37,"MB"),t.qZA()()()()(),t.TgZ(38,"div",16)(39,"label",30),t._uU(40),t.qZA(),t.TgZ(41,"div",18)(42,"div",31)(43,"progressbar",32)(44,"b"),t._uU(45),t.qZA()()()()(),t.TgZ(46,"div",16)(47,"label",33),t._uU(48),t.qZA(),t.TgZ(49,"div",18)(50,"div",34)(51,"select",35),t.YNc(52,Vt,2,2,"option",36),t.qZA()(),t._UZ(53,"div",34),t.qZA()()()()()),2&n){const e=t.oxw();t.xp6(4),t.hij("",e.locale.maketext("Scanning:"),"\xa0"),t.xp6(2),t.Oqu((null==e.scannerData?null:e.scannerData.current_file)||e.locale.maketext("Loading \u2026")),t.xp6(4),t.Oqu(e.locale.maketext("File")),t.xp6(3),t.Q6J("value",null==e.scannerData?null:e.scannerData.scanned_file_count),t.xp6(5),t.Oqu(e.locale.maketext("Total file count")),t.xp6(1),t.Q6J("value",null==e.scannerData?null:e.scannerData.total_file_count),t.xp6(3),t.Oqu(e.locale.maketext("Data")),t.xp6(4),t.Q6J("value",null==e.scannerData?null:e.scannerData.scanned_file_size),t.xp6(8),t.Oqu(e.locale.maketext("Total file size")),t.xp6(1),t.Q6J("value",null==e.scannerData?null:e.scannerData.total_file_size_MiB),t.xp6(5),t.hij(" ",e.locale.maketext("Scanner Progress")," "),t.xp6(3),t.Q6J("animate",!0)("value",e.progress),t.xp6(2),t.hij("",e.progress,"%"),t.xp6(3),t.hij(" ",e.locale.maketext("Infected Files")," "),t.xp6(4),t.Q6J("ngForOf",null==e.scannerData?null:e.scannerData.infected_files)("ngForTrackBy",e.trackByIndex)}}let Kt=(()=>{class n{constructor(e,i,c,r,b){this.locale=e,this._scannerFacadeService=i,this._cd=c,this._route=r,this._router=b,this.loading=!0,this.scannerPageErrors=v,this._destroy$=new f.xQ,this._subscribeToScannerErrorSubject(),this._subscribeToScannerDataSubject(),this.scannerData=this._router.getCurrentNavigation().extras.state,this._scanpath=this._route.snapshot.paramMap.get(A.scanPath)}ngOnInit(){this._startScan()}ngOnDestroy(){this._destroy$.next()}trackByIndex(e){return e}continuePolling(){this.errorMessage=null,this._cd.markForCheck(),this._startScan()}_startScan(){this._scannerFacadeService.startFileScan({scanpath:this._scanpath,scannerData:this.scannerData})}_subscribeToScannerErrorSubject(){this._scannerFacadeService.scannerErrorSubject.pipe((0,D.R)(this._destroy$)).subscribe(e=>{this.loading=!1,this.errorMessage=e,this._cd.markForCheck()})}_subscribeToScannerDataSubject(){this._scannerFacadeService.scannerDataSubject.pipe((0,D.R)(this._destroy$)).subscribe(e=>{this.scannerData=e,this.progress=this._calculateProgressPercentage(e?.scanned_file_count,e?.total_file_count),this._cd.markForCheck(),e?.scan_complete&&this._scannerFacadeService.openModal(e)})}_calculateProgressPercentage(e,i){return!i||i<=0||e<0?0:e>i?100:Math.round(e/i*100)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.g),t.Y36(G),t.Y36(t.sBO),t.Y36(d.gz),t.Y36(d.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-clam-scanner"]],decls:6,vars:5,consts:[["id","scanner__header"],["id","scanner__loading-spinner",4,"ngIf"],["id","scanner__callout","class","clam-callout","calloutType","danger",4,"ngIf"],["id","scanner__callout--info","class","clam-callout","calloutType","info",4,"ngIf"],[4,"ngIf"],["id","scanner__loading-spinner"],["id","scanner__callout","calloutType","danger",1,"clam-callout"],[1,"clam-callout__header"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["ngClass","scanner__error-persists"],["id","scanner__error-btn",1,"btn","btn-sm","btn-default",3,"click"],["id","scanner__callout--info","calloutType","info",1,"clam-callout"],["id","scanner__current-file"],["name","scanner__form"],[1,"form-group"],["id","scanner__file-label","for","scanner__scanned-file-count"],[1,"row"],[1,"col-xs-3"],["type","text","id","scanner__scanned-file-count","disabled","",1,"form-control",3,"value"],[1,"col-xs-1"],["for","scanner__total-file-count",1,"sr-only"],["type","text","id","scanner__total-file-count","disabled","",1,"form-control",3,"value"],["id","scanner__data-label","for","scanner__scanned-file-size"],[1,"input-group"],["type","text","id","scanner__scanned-file-size","disabled","",1,"form-control",3,"value"],[1,"input-group-addon"],["for","scanner__total-file-size",1,"sr-only"],["type","text","id","scanner__total-file-size","disabled","",1,"form-control",3,"value"],["id","scanner__progressbar-label","for","scanner__progressbar"],[1,"col-xs-12"],["id","scanner__progressbar",1,"h-100","scanner__progressbar",3,"animate","value"],["id","lblInfectedFiles","for","status"],[1,"col-xs-12","col-sm-6","col-md-6","col-lg-6"],["size","8","name","status","id","status",1,"form-control"],[3,"value",4,"ngFor","ngForOf","ngForTrackBy"],[3,"value"]],template:function(e,i){1&e&&(t.TgZ(0,"h2",0),t._uU(1),t.qZA(),t.YNc(2,Rt,1,0,"cp-loading-spinner",1),t.YNc(3,zt,10,5,"cp-callout",2),t.YNc(4,Ht,4,1,"cp-callout",3),t.YNc(5,Xt,54,17,"div",4)),2&e&&(t.xp6(1),t.Oqu(i.locale.maketext("Scanner")),t.xp6(1),t.Q6J("ngIf",i.loading),t.xp6(1),t.Q6J("ngIf",i.errorMessage&&i.errorMessage!==i.scannerPageErrors.noScanpathOrData),t.xp6(1),t.Q6J("ngIf",i.errorMessage===i.scannerPageErrors.noScanpathOrData),t.xp6(1),t.Q6J("ngIf",!i.loading&&!i.errorMessage||i.scannerData))},directives:[u.O5,l.go,l.Oc,u.RF,u.n9,u.ED,u.mk,E,o._Y,o.JL,o.F,J.O1,u.sg,o.YN,o.Kr],styles:[".clam-callout__header[_ngcontent-%COMP%]{margin-top:0}.clam-callout[_ngcontent-%COMP%]{display:block;max-width:500px}.scanner__progressbar[_ngcontent-%COMP%]{height:100%}.scanner__error-persists[_ngcontent-%COMP%]{margin-top:.25rem}"],changeDetection:0}),n})(),$=(()=>{class n{constructor(e){this.locale=e}canDeactivate(e){const i=this.locale.maketext("You should not leave this page without hitting the \u201cProcess Cleanup\u201d button!"),c=this.locale.maketext("Please press the \u201cCancel\u201d button.");return!!e.canDeactivate()||confirm(`${i}\n\n${c}`)}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(g.g))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var Wt=s(567),te=s(537);let B=(()=>{class n{constructor(){this.appIsLoading=new f.xQ}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const ne=[{path:p.doCleanupPage,component:qt},{path:p.cleanupPage,component:vt,canDeactivate:[$]},{path:p.scannerPage,component:Kt},{path:p.newScanPage,component:Yt,canActivate:[(()=>{class n{constructor(e,i,c,r,b,z){this._clamApiService=e,this._disinfectFacadeService=i,this._alertService=c,this._router=r,this._appFacadeService=b,this.locale=z}canActivate(){return this._appFacadeService.appIsLoading.next(!0),(0,Wt.D)([this._clamApiService.getScanStatus(),this._disinfectFacadeService.getMappedInfectedFiles(),this._clamApiService.getDisinfectStatus()]).pipe((0,T.U)(([e,i,c])=>{const r=e&&e?.scan_complete,b=i&&i?.length;return c&&c?.status===S.running?(this._router.navigate([p.doCleanupPage],{state:{status:c}}),!1):b?(this._router.navigate([p.cleanupPage],{state:i}),!1):!(!r&&e?.scanned_file_size&&(this._router.navigate([p.scannerPage],{state:e}),1))}),(0,O.K)(()=>{const e=this.locale.maketext("Internal Error"),i=this.locale.maketext("If this condition persists, contact your system administrator.");return this._alertService.error(`${e} ${i}`),(0,M.of)(!0)})).pipe((0,te.x)(()=>this._appFacadeService.appIsLoading.next(!1)))}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(k),t.LFG(P),t.LFG(l.c9),t.LFG(d.F0),t.LFG(B),t.LFG(g.g))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})()]},{path:"",redirectTo:p.newScanPage,pathMatch:"full"},{path:"**",redirectTo:p.newScanPage}];let ie=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[[d.Bz.forRoot(ne,{useHash:!0,relativeLinkResolution:"legacy"})],d.Bz]}),n})();var ae=s(1607);function ce(n,a){1&n&&t._UZ(0,"cp-loading-spinner",1)}let se=(()=>{class n{constructor(e){this.appFacadeService=e,(0,ae.Dc)("bs3")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(B))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-clam-root"]],decls:4,vars:3,consts:[["id","app__loading-spinner",4,"ngIf"],["id","app__loading-spinner"]],template:function(e,i){1&e&&(t._UZ(0,"cp-alert-list")(1,"router-outlet"),t.YNc(2,ce,1,0,"cp-loading-spinner",0),t.ALo(3,"async")),2&e&&(t.xp6(2),t.Q6J("ngIf",t.lcZ(3,1,i.appFacadeService.appIsLoading)))},directives:[l.hF,d.lC,u.O5,l.go],pipes:[u.Ov],encapsulation:2}),n})();var oe=s(529);let re=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n,bootstrap:[se]}),n.\u0275inj=t.cJS({providers:[l.c9,k,G,$],imports:[[l.CQ,l.Sw,oe.JF,o.u5,o.UX,w.b2,l.zf,l.df,ie,H.m,J.HC.forRoot(),N.zk.forRoot()]]}),n})();(0,t.G48)(),w.q6().bootstrapModule(re).catch(n=>console.error(n))}},y=>{y.O(0,[736],()=>y(y.s=903)),y.O()}]);