import{a as v}from"./chunk-LSDTG77S.js";import{e as S}from"./chunk-MNHXVU2U.js";import{s as d,t as D,w as h,x as w}from"./chunk-BYO7JUDG.js";import{k as p}from"./chunk-AVXTYPYF.js";import{F as f,k as l,la as T,od as j,qa as u,va as a}from"./chunk-HEIW4SFT.js";T();D();j();w();var O=(()=>{class i{constructor(r,e,s){this.apiService=r,this.router=e,this.dialogService=s}runDocumentTaskAction(r,e,s,g,c,o,k){return l(this,null,function*(){let y={actionName:r,taskIds:[e],subjectId:s,comment:g,metadata:[],location:k};try{let I=yield f(this.apiService.post(d.tasks.runTaskAction,y)),n=o&&o.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([o]):this.router.navigate(["/documentation/task/task-form/task-data"],{queryParams:{id:t[0]}});return}}n?this.router.navigate([o]):c?this.router.navigateByUrl(c):this.router.navigate(["/documentation/task"])}catch{this.dialogService.open({id:v.DialogTaskActionService,title:"Error",text:"GeneralError",contentStyleClass:"paw-offset"})}})}static{this.\u0275fac=function(e){return new(e||i)(a(h),a(p),a(S))}}static{this.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{O as a};
