import{e as v}from"./chunk-CX35JBUF.js";import{s as h,t as I,w as d,x as D}from"./chunk-7AC745CZ.js";import{k as p}from"./chunk-QVLAHW2O.js";import{F as f,k as l,la as j,nd as T,qa as u,va as o}from"./chunk-PGS4AHIT.js";j();I();T();D();var E=(()=>{class i{constructor(r,e,s){this.apiService=r,this.router=e,this.dialogService=s}runDocumentTaskAction(r,e,s,S,c,a,g){return l(this,null,function*(){let k={actionName:r,taskIds:[e],subjectId:s,comment:S,metadata:[],location:g};try{let y=yield f(this.apiService.post(h.tasks.runTaskAction,k)),n=a&&a.length>0,m=localStorage.getItem("runSelectedTasks");if(m){let t=JSON.parse(m);if(t&&t.length>0&&t[0]===e&&(t.splice(0,1),localStorage.setItem("runSelectedTasks",JSON.stringify(t)),t&&t.length>0)){n?this.router.navigate([a]):this.router.navigate(["/documentation/task/task-form/task-data"],{queryParams:{id:t[0]}});return}}n?this.router.navigate([a]):c?this.router.navigateByUrl(c):this.router.navigate(["/documentation/task/task-form/task-data"],{queryParams:{id:e}})}catch{this.dialogService.open({title:"Error",text:"GeneralError",contentStyleClass:"paw-offset"})}})}static{this.\u0275fac=function(e){return new(e||i)(o(d),o(p),o(v))}}static{this.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{E as a};
