@knoflows/engine 0.1.0-beta.18 → 0.1.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/engine.js +19 -19
  2. package/dist/migrations/20260921193000_local_repo_remote/migration.sql +3 -0
  3. package/dist/migrations/20260921193000_local_repo_remote/snapshot.json +1378 -0
  4. package/package.json +1 -1
  5. package/static/assets/i18n/en.json +14 -0
  6. package/static/assets/i18n/es.json +14 -0
  7. package/static/chunk--EZIkevK.js +1 -0
  8. package/static/{chunk-D3JZ8ur5.js → chunk-8ezEUcxN.js} +6 -6
  9. package/static/chunk-B17yZLWe.js +1 -0
  10. package/static/{chunk-7NTQwN96.js → chunk-B8OjWpOp.js} +1 -1
  11. package/static/chunk-BHko4hHm.js +1 -0
  12. package/static/{chunk-DSgUAlqN.js → chunk-BIJScqTM.js} +1 -1
  13. package/static/{chunk-B_R_vsLt.js → chunk-BKYaECRn.js} +1 -1
  14. package/static/chunk-BLN4QkSi.js +1 -0
  15. package/static/{chunk-BrP_q6LZ.js → chunk-BRAytoQl.js} +1 -1
  16. package/static/{chunk-xeQj_hSF.js → chunk-BaLWULJh.js} +1 -1
  17. package/static/{chunk-Dx92ksvP.js → chunk-BcDRgzYZ.js} +1 -1
  18. package/static/{chunk-5xJXPFlv.js → chunk-Bok52e_k.js} +1 -1
  19. package/static/{chunk-CuwZV6XG.js → chunk-BowAQ7m9.js} +1 -1
  20. package/static/{chunk-C9PkSfMb.js → chunk-Bz7bE4tT.js} +1 -1
  21. package/static/{chunk-BCHj6l85.js → chunk-C7P7hUiX.js} +1 -1
  22. package/static/{chunk-BcQQgpKh.js → chunk-CAxHAuhV.js} +1 -1
  23. package/static/{chunk-Cvoe3MtC.js → chunk-CGHIKxZG.js} +1 -1
  24. package/static/{chunk-CZoPJsBm.js → chunk-CJWR0gwk.js} +1 -1
  25. package/static/{chunk-BRZ5T52h.js → chunk-CZA-kp5w.js} +1 -1
  26. package/static/{chunk-ZqQUQSE8.js → chunk-CoQPYpxp.js} +1 -1
  27. package/static/{chunk-DAONFRT8.js → chunk-CtiubhW7.js} +1 -1
  28. package/static/{chunk-hpn_m1ZC.js → chunk-CwEMAptL.js} +1 -1
  29. package/static/{chunk-CRGkNzel.js → chunk-D-ueyYEC.js} +3 -3
  30. package/static/{chunk-DHC_yfIa.js → chunk-D1355dNd.js} +1 -1
  31. package/static/{chunk-CV-FUe_H.js → chunk-D8qyjd0z.js} +1 -1
  32. package/static/{chunk-Dg-4XevL.js → chunk-DOAz4S6b.js} +1 -1
  33. package/static/{chunk-VXZaUyyE.js → chunk-DbQy6dR8.js} +1 -1
  34. package/static/chunk-DdDI9wRc.js +5 -0
  35. package/static/{chunk-BIdwV0jx.js → chunk-Det50scT.js} +1 -1
  36. package/static/{chunk-BIL86kgf.js → chunk-Dm_EWkUz.js} +1 -1
  37. package/static/chunk-DoJknvak.js +1 -0
  38. package/static/{chunk-DEF7Ge5B.js → chunk-DrncP2Qx.js} +1 -1
  39. package/static/{chunk-DvWh-Q5D.js → chunk-EDwdt-Wk.js} +1 -1
  40. package/static/chunk-IjKs-6Cl.js +1 -0
  41. package/static/{chunk-DyiDg8XX.js → chunk-LPXHXTnJ.js} +1 -1
  42. package/static/{chunk-DVJ9L-aC.js → chunk-SiaN7xSQ.js} +1 -1
  43. package/static/{chunk-Bv1r1Ly-.js → chunk-YU-Bg77r.js} +1 -1
  44. package/static/{chunk-Ysn4Fbgj.js → chunk-bSS_wejP.js} +1 -1
  45. package/static/{chunk-CLM-K-Vg.js → chunk-iIEmH_ui.js} +1 -1
  46. package/static/{chunk-CPNxRF7A.js → chunk-vINo5yVD.js} +1 -1
  47. package/static/index.html +1 -1
  48. package/static/{main-SI5AKDMC.js → main-3VZRFHGG.js} +1 -1
  49. package/static/chunk--WRMKpmO.js +0 -5
  50. package/static/chunk-BaYdwXIA.js +0 -1
  51. package/static/chunk-C3Xml1YG.js +0 -1
  52. package/static/chunk-DDhSFoAE.js +0 -1
  53. package/static/chunk-DaO-gpzS.js +0 -1
  54. package/static/chunk-pi-mtheN.js +0 -1
@@ -0,0 +1 @@
1
+ import {S as St}from'./chunk-BRAytoQl.js';import'./chunk-Det50scT.js';import'./chunk-vINo5yVD.js';import {Z as ZE,n as uh}from'./main-3VZRFHGG.js';import'./chunk-Dm_EWkUz.js';import'./chunk-Bok52e_k.js';import'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';var c=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-context-files-manage"]],decls:1,vars:0,template:function(t,a){t&1&&uh(0,"app-context-file-list");},dependencies:[St],encapsulation:2});}}return e})();export{c as ContextFilesManageComponent};
@@ -1 +1 @@
1
- import {U}from'./chunk-Bv1r1Ly-.js';import {f}from'./chunk-CZoPJsBm.js';import {L as Lt}from'./chunk-DyiDg8XX.js';import {y,S}from'./chunk-CV-FUe_H.js';import'./chunk-D3JZ8ur5.js';import {W,I}from'./chunk-5xJXPFlv.js';import'./chunk-DAONFRT8.js';import'./chunk-CLM-K-Vg.js';import {C,a as C1,$,V as Ve,b as at$1,S as p,q as qo,u as ue,T as id,W as qw,c as bi,Z as ZE,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,n as uh,w as lh,az as jw,E as Aw,G as FD,m as mh,z as rl,O as Fu,Q as ju}from'./main-SI5AKDMC.js';var Z=i=>({count:i});function tt(i,p){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function et(i,p){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function it(i,p){if(i&1){let t=FD();_i(0,"button",15),mh("click",function(){Fu(t);let u=HD(2);return ju(u.cancelBatch())}),Iw(1),Pw(2,"transloco"),Jc();}if(i&2){let t=HD(2);lh("disabled",t.cancelling()),gI(),rl(" ",Fw(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function nt(i,p){if(i&1&&(_i(0,"p",12),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.actionError());}}function at(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"h1",5),Iw(6),Jc(),_i(7,"p",6)(8,"nz-tag",7),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"span",8),Iw(12),Jc(),Iw(13," \xB7 "),_i(14,"span",9),Iw(15),Pw(16,"transloco"),Jc(),Iw(17," \xB7 "),_i(18,"span",10),Iw(19),Pw(20,"transloco"),Jc()()(),_D(21,it,3,4,"button",11),Jc(),_D(22,nt,2,1,"p",12),_i(23,"section",13)(24,"h2"),Iw(25),Pw(26,"transloco"),Jc(),uh(27,"app-job-status-table",14),Jc()),i&2){let t=p,e=HD();gI(3),Lh(Fw(4,12,"batches.detail.backHint")),gI(3),Lh(t.id),gI(2),lh("nzColor",e.batchStatusTagColor(t.status,e.theme.theme()))("ngClass",e.batchStatusTagClass(t.status,e.theme.theme())),gI(),Lh(Fw(10,14,e.statusKey(t.status))),gI(3),Lh(t.workflowId),gI(3),Lh(jw(16,16,"batches.detail.subjectCount",Aw(23,Z,t.resolvedSubjects.length))),gI(4),Lh(Fw(20,19,e.triggeredByKey(t.triggeredBy))),gI(2),MD(t.status==="running"?21:-1),gI(),MD(e.actionError()?22:-1),gI(3),Lh(Fw(26,21,"batches.detail.membersHeading")),gI(2),lh("jobs",e.memberJobs());}}var ot=3e3;function v(i){return i!=="running"}var Dt=(()=>{class i{constructor(){this.route=C(C1),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve),this.destroyRef=C(at$1),this.theme=C(p),this.batchStatusTagClass=y,this.batchStatusTagColor=S,this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.cancelling=qo(false),this.actionError=qo(null),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),id(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&qw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();}));});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}cancelBatch(){let t=this.batch();!t||t.status!=="running"||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.batchesApi.cancel(t.id).subscribe({next:e=>{this.cancelling.set(false),this.batch.set(e),this.refreshMembers(),v(e.status)&&(this.stopPolling(),this.closeStream());},error:e=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("batches.errors.cancelFailed")));}}));}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),v(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),v(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||v(t.status)){this.stopPolling();return}this.refreshMembers();},ot));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status",3,"nzColor","ngClass"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"disabled"],["data-testid","action-error",1,"error"],["data-testid","batch-members",1,"members"],[3,"jobs"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"click","disabled"]],template:function(e,u){if(e&1&&(_i(0,"main",0),_D(1,tt,3,3,"p",1)(2,et,2,1,"p",2)(3,at,28,25),Jc()),e&2){let C;gI(),MD(u.loading()?1:u.loadError()?2:(C=u.batch())?3:-1,C);}},dependencies:[$8,M5,v3,pf,bd,sp,fp,W,I,Lt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{Dt as BatchDetailComponent};
1
+ import {U}from'./chunk-YU-Bg77r.js';import {f}from'./chunk-CJWR0gwk.js';import {L as Lt}from'./chunk-LPXHXTnJ.js';import {y,S}from'./chunk-D8qyjd0z.js';import {W,I}from'./chunk-Bok52e_k.js';import'./chunk-8ezEUcxN.js';import'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';import {C,a as C1,$,V as Ve,b as at$1,S as p,q as qo,u as ue,T as id,W as qw,c as bi,Z as ZE,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,n as uh,w as lh,az as jw,E as Aw,G as FD,m as mh,z as rl,O as Fu,Q as ju}from'./main-3VZRFHGG.js';var Z=i=>({count:i});function tt(i,p){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function et(i,p){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function it(i,p){if(i&1){let t=FD();_i(0,"button",15),mh("click",function(){Fu(t);let u=HD(2);return ju(u.cancelBatch())}),Iw(1),Pw(2,"transloco"),Jc();}if(i&2){let t=HD(2);lh("disabled",t.cancelling()),gI(),rl(" ",Fw(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function nt(i,p){if(i&1&&(_i(0,"p",12),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.actionError());}}function at(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"h1",5),Iw(6),Jc(),_i(7,"p",6)(8,"nz-tag",7),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"span",8),Iw(12),Jc(),Iw(13," \xB7 "),_i(14,"span",9),Iw(15),Pw(16,"transloco"),Jc(),Iw(17," \xB7 "),_i(18,"span",10),Iw(19),Pw(20,"transloco"),Jc()()(),_D(21,it,3,4,"button",11),Jc(),_D(22,nt,2,1,"p",12),_i(23,"section",13)(24,"h2"),Iw(25),Pw(26,"transloco"),Jc(),uh(27,"app-job-status-table",14),Jc()),i&2){let t=p,e=HD();gI(3),Lh(Fw(4,12,"batches.detail.backHint")),gI(3),Lh(t.id),gI(2),lh("nzColor",e.batchStatusTagColor(t.status,e.theme.theme()))("ngClass",e.batchStatusTagClass(t.status,e.theme.theme())),gI(),Lh(Fw(10,14,e.statusKey(t.status))),gI(3),Lh(t.workflowId),gI(3),Lh(jw(16,16,"batches.detail.subjectCount",Aw(23,Z,t.resolvedSubjects.length))),gI(4),Lh(Fw(20,19,e.triggeredByKey(t.triggeredBy))),gI(2),MD(t.status==="running"?21:-1),gI(),MD(e.actionError()?22:-1),gI(3),Lh(Fw(26,21,"batches.detail.membersHeading")),gI(2),lh("jobs",e.memberJobs());}}var ot=3e3;function v(i){return i!=="running"}var Dt=(()=>{class i{constructor(){this.route=C(C1),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve),this.destroyRef=C(at$1),this.theme=C(p),this.batchStatusTagClass=y,this.batchStatusTagColor=S,this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.cancelling=qo(false),this.actionError=qo(null),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),id(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&qw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();}));});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}cancelBatch(){let t=this.batch();!t||t.status!=="running"||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.batchesApi.cancel(t.id).subscribe({next:e=>{this.cancelling.set(false),this.batch.set(e),this.refreshMembers(),v(e.status)&&(this.stopPolling(),this.closeStream());},error:e=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("batches.errors.cancelFailed")));}}));}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),v(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),v(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||v(t.status)){this.stopPolling();return}this.refreshMembers();},ot));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status",3,"nzColor","ngClass"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"disabled"],["data-testid","action-error",1,"error"],["data-testid","batch-members",1,"members"],[3,"jobs"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"click","disabled"]],template:function(e,u){if(e&1&&(_i(0,"main",0),_D(1,tt,3,3,"p",1)(2,et,2,1,"p",2)(3,at,28,25),Jc()),e&2){let C;gI(),MD(u.loading()?1:u.loadError()?2:(C=u.batch())?3:-1,C);}},dependencies:[$8,M5,v3,pf,bd,sp,fp,W,I,Lt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{Dt as BatchDetailComponent};
@@ -0,0 +1 @@
1
+ import {w,P,d,K,N,_,D,M,q,V,B}from'./chunk-IjKs-6Cl.js';import {H as He}from'./chunk-CwEMAptL.js';import {f}from'./chunk--EZIkevK.js';import {_ as _n,C as Cn}from'./chunk-vINo5yVD.js';import {G as Gn,u as un}from'./chunk-bSS_wejP.js';import {a as ai,z}from'./chunk-Dm_EWkUz.js';import {W,I}from'./chunk-Bok52e_k.js';import {P as P_,I as I_,t as tm}from'./chunk-8ezEUcxN.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';import {C,b as at,V as Ve,q as qo,U as Uw,aW as Ng,u as ue,s,r as r$1,b9 as Nl,ba as Se,aX as es,aY as Dg,c as bi,Z as ZE,d as $8,e as al,bb as er,bc as Jc,f as rl,bd as Nc,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt$1,j as _i,I as Iw,P as Pw,J as Jc$1,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,a7 as KE,a8 as fu,aA as mT,be as E3,bf as _r,aa as oe,a9 as Z0,bg as Ci,aB as yT,ab as Oe,bh as Bt$1,aq as el,bi as cl,a3 as Ah,a4 as Th,as as st,at as Ee,ai as ly,av as K0,n as uh,al as Sh,w as lh,D as ch,bj as Nw,bk as St,bl as wo,ax as Eh,an as WD,ao as GD,H as HD,x as xD,B as AD,G as FD,k as iE,y as aE,aM as Yl,aw as rh,N as ND,aJ as tl,aK as nl,O as Fu,Q as ju}from'./main-3VZRFHGG.js';var wt=["switchElement"];function Tt(n,m){n&1&&uh(0,"nz-icon",3);}function It(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzCheckedChildren);}}function kt(n,m){if(n&1&&rh(0,It,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzCheckedChildren);}}function Nt(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzUnCheckedChildren);}}function Dt(n,m){if(n&1&&rh(0,Nt,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzUnCheckedChildren);}}var Vt="switch",X=(()=>{let n,m=[],e=[];return class q{static{let i=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],mT(null,null,n,{kind:"field",name:"nzSize",static:false,private:false,access:{has:s=>"nzSize"in s,get:s=>s.nzSize,set:(s,S)=>{s.nzSize=S;}},metadata:i},m,e),i&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:i});}_nzModuleName=Vt;nzConfigService=C(E3);el=C(_r).nativeElement;ngZone=C(oe);cdr=C(Z0);focusMonitor=C(Ci);destroyRef=C(at);isChecked=false;onChange=()=>{};onTouched=()=>{};switchElement;nzLoading=false;nzDisabled=false;nzControl=false;nzCheckedChildren=null;nzUnCheckedChildren=null;nzSize=yT(this,m,"default");nzId=(yT(this,e),null);dir=C(Oe).valueSignal;isNzDisableFirstChange=true;size=qo(this.nzSize);formSize=C(Bt$1,{optional:true});finalSize=Uw(()=>this.formSize?.()||this.size());updateValue(i){this.isChecked!==i&&(this.isChecked=i,this.onChange(this.isChecked));}focus(){this.focusMonitor.focusVia(this.switchElement.nativeElement,"keyboard");}blur(){this.switchElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.switchElement.nativeElement);});}ngOnChanges(i){let{nzSize:s}=i;s&&this.size.set(s.currentValue);}ngOnInit(){el(this.el,"click").pipe(ue(this.destroyRef)).subscribe(i=>{i.preventDefault(),!(this.nzControl||this.nzDisabled||this.nzLoading)&&this.ngZone.run(()=>{this.updateValue(!this.isChecked),this.cdr.markForCheck();});}),el(this.switchElement.nativeElement,"keydown").pipe(ue(this.destroyRef)).subscribe(i=>{if(this.nzControl||this.nzDisabled||this.nzLoading)return;let{keyCode:s}=i;s!==37&&s!==39&&s!==32&&s!==13||(i.preventDefault(),this.ngZone.run(()=>{s===37?this.updateValue(false):s===39?this.updateValue(true):(s===32||s===13)&&this.updateValue(!this.isChecked),this.cdr.markForCheck();}));});}ngAfterViewInit(){this.focusMonitor.monitor(this.switchElement.nativeElement,true).pipe(ue(this.destroyRef)).subscribe(i=>{i||Promise.resolve().then(()=>this.onTouched());});}writeValue(i){this.isChecked=i,this.cdr.markForCheck();}registerOnChange(i){this.onChange=i;}registerOnTouched(i){this.onTouched=i;}setDisabledState(i){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||i,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}static \u0275fac=function(s){return new(s||q)};static \u0275cmp=ZE({type:q,selectors:[["nz-switch"]],viewQuery:function(s,S){if(s&1&&Eh(wt,7),s&2){let j;WD(j=GD())&&(S.switchElement=j.first);}},inputs:{nzLoading:[2,"nzLoading","nzLoading",K0],nzDisabled:[2,"nzDisabled","nzDisabled",K0],nzControl:[2,"nzControl","nzControl",K0],nzCheckedChildren:"nzCheckedChildren",nzUnCheckedChildren:"nzUnCheckedChildren",nzSize:"nzSize",nzId:"nzId"},exportAs:["nzSwitch"],features:[Nw([{provide:St,useExisting:wo(()=>q),multi:true}]),ly],decls:8,vars:15,consts:[["switchElement",""],["nz-wave","","type","button",1,"ant-switch",3,"disabled","nzWaveExtraNode"],[1,"ant-switch-handle"],["nzType","loading",1,"ant-switch-loading-icon"],[1,"ant-switch-inner"],[1,"ant-click-animating-node"],[4,"nzStringTemplateOutlet"]],template:function(s,S){s&1&&(_i(0,"button",1,0)(2,"span",2),_D(3,Tt,1,0,"nz-icon",3),Jc$1(),_i(4,"span",4),_D(5,kt,1,1,"ng-container")(6,Dt,1,1,"ng-container"),Jc$1(),uh(7,"div",5),Jc$1()),s&2&&(Sh("ant-switch-checked",S.isChecked)("ant-switch-loading",S.nzLoading)("ant-switch-disabled",S.nzDisabled)("ant-switch-small",S.finalSize()==="small")("ant-switch-rtl",S.dir()==="rtl"),lh("disabled",S.nzDisabled)("nzWaveExtraNode",true),ch("id",S.nzId),gI(3),MD(S.nzLoading?3:-1),gI(2),MD(S.isChecked?5:6));},dependencies:[cl,fp,Ah,Th,st,Ee],encapsulation:2})}})(),xt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=KE({type:n});static \u0275inj=fu({imports:[X]})}return n})();var ee=(n,m)=>m.id,Pt=(n,m)=>m.key;function Rt(n,m){n&1&&(_i(0,"div",4),uh(1,"nz-alert",9),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),lh("nzMessage",Fw(2,1,"settings.restartRequired.message")));}function At(n,m){n&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Bt(n,m){if(n&1&&(_i(0,"p",6),Iw(1),Jc$1()),n&2){let e=HD();gI(),Lh(e.loadError());}}function Ft(n,m){if(n&1&&(_i(0,"nz-tag",11),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=HD().$implicit;ch("data-testid",e.id+"-default-chip"),gI(),Lh(Fw(2,2,"settings.defaultAgent.label"));}}function Lt(n,m){if(n&1&&(_i(0,"nz-tag",17),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=m,t=HD(2).$implicit,i=HD(2);lh("nzColor",i.testResultTone(e)),ch("title",e.message??"")("data-testid",t.id+"-test-result"),gI(),rl$1(" ",Fw(2,4,i.testResultLabelKey(e))," ");}}function Kt(n,m){if(n&1){let e=FD();_i(0,"span",13)(1,"button",16),mh("click",function(){Fu(e);let i=HD().$implicit,s=HD(2);return ju(s.testSavedConnection(i))}),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Lt,3,6,"nz-tag",17),Jc$1();}if(n&2){let e,t=HD().$implicit,i=HD(2);gI(),lh("nzLoading",i.listTestState(t.id)?.running===true)("disabled",i.listTestState(t.id)?.running===true),ch("data-testid",t.id+"-test-connection"),gI(),rl$1(" ",Fw(3,5,"settings.testConnection")," "),gI(2),MD((e=i.listTestState(t.id)?.result)?4:-1,e);}}function $t(n,m){if(n&1){let e=FD();_i(0,"tr")(1,"td",10)(2,"span"),Iw(3),Jc$1(),_D(4,Ft,3,4,"nz-tag",11),Jc$1(),_i(5,"td")(6,"nz-tag"),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"td"),Iw(10),Jc$1(),_i(11,"td",12),_D(12,Kt,5,7,"span",13),_i(13,"button",14),mh("click",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.openEdit(i))}),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"button",15),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.removeInstance(i.id))}),Iw(20),Pw(21,"transloco"),Jc$1()()();}if(n&2){let e=m.$implicit,t=HD(2);ch("data-testid","instance-"+e.id),gI(),ch("data-testid",e.id+"-name"),gI(2),Lh(e.displayName),gI(),MD(t.isDefaultAgent(e)?4:-1),gI(2),ch("data-testid",e.id+"-type"),gI(),Lh(Fw(8,16,t.typeLabelKey(e))),gI(2),ch("data-testid",e.id+"-expires"),gI(),rl$1(" ",e.expiresOn??""," "),gI(2),MD(t.supportsTestConnection(e.type)?12:-1),gI(),ch("data-testid",e.id+"-edit"),gI(),rl$1(" ",Fw(15,18,"settings.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,20,"settings.deleteConfirm"))("nzOkText",Fw(18,22,"settings.delete"))("nzCancelText",Fw(19,24,"common.cancel")),ch("data-testid",e.id+"-delete"),gI(4),rl$1(" ",Fw(21,26,"settings.delete")," ");}}function qt(n,m){if(n&1&&(_i(0,"nz-table",7)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc$1(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc$1(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc$1()()(),_i(15,"tbody"),xD(16,$t,22,28,"tr",null,ee),Jc$1()()),n&2){let e=HD();lh("nzData",e.instances())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,7,"settings.column.displayName")),gI(3),Lh(Fw(8,9,"settings.column.type")),gI(3),Lh(Fw(11,11,"settings.column.expiresOn")),gI(3),Lh(Fw(14,13,"settings.column.actions")),gI(3),AD(e.instances());}}function jt(n,m){if(n&1&&(_i(0,"li"),Iw(1),Jc$1()),n&2){let e=m.$implicit;gI(),Lh(e);}}function Ut(n,m){if(n&1&&(_i(0,"section",19)(1,"h3"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"ul"),xD(5,jt,2,1,"li",null,ND),Jc$1()()),n&2){let e=HD(2);gI(2),Lh(Fw(3,1,"settings.validation")),gI(3),AD(e.validationErrors());}}function Wt(n,m){if(n&1&&(_i(0,"p",20),Iw(1),Jc$1()),n&2){let e=HD(2);gI(),Lh(e.secretSaveError());}}function Zt(n,m){if(n&1&&(uh(0,"nz-option",27),Pw(1,"transloco")),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",Fw(1,2,e.labelKey));}}function Ht(n,m){if(n&1){let e=FD();_i(0,"label",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"input",37),mh("ngModelChange",function(i){let s=Fu(e).$implicit,S=HD(2);return ju(S.setDraftConfig(s.key,i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=m.$implicit,t=HD(2);gI(2),Lh(Fw(3,3,e.labelKey)),gI(2),lh("ngModel",t.configValue(t.draft().config,e.key)),ch("data-testid","provider-config-"+e.key),aE();}}function Qt(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",38),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setKnownRepoSlugs(i))}),Jc$1(),iE(),_i(5,"p",25),Iw(6),Pw(7,"transloco"),Jc$1()();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,3,"settings.bitbucket.knownRepoSlugs")),gI(2),lh("ngModel",e.draft().knownRepoSlugs),aE(),gI(2),Lh(Fw(7,5,"settings.bitbucket.knownRepoSlugsHint"));}}function Gt(n,m){if(n&1){let e=FD();_i(0,"button",39),mh("click",function(){Fu(e);let i=HD(2);return ju(i.fetchModels())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.fetchingModels())("disabled",!e.canFetchModels()),gI(),rl$1(" ",Fw(2,3,"settings.model.fetch")," ");}}function Jt(n,m){if(n&1){let e=FD();_i(0,"button",40),mh("click",function(){Fu(e);let i=HD(2);return ju(i.testDraftConnection())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.modalTestRunning())("disabled",!e.canTestConnection()),gI(),rl$1(" ",Fw(2,3,"settings.testConnection")," ");}}function Yt(n,m){if(n&1&&(_i(0,"p",42),Iw(1),Jc$1()),n&2){let e=HD();Sh("warning",e.identityMismatch)("error",!e.success),gI(),rl$1(" ",e.message," ");}}function Xt(n,m){if(n&1&&(_i(0,"div",32)(1,"nz-tag",17),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Yt,2,5,"p",41),Jc$1()),n&2){let e=m,t=HD(2);gI(),lh("nzColor",t.testResultTone(e)),gI(),rl$1(" ",Fw(3,3,t.testResultLabelKey(e))," "),gI(2),MD(e.message?4:-1);}}function ei(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=HD(3);lh("nzValue",e.configValue(e.draft().config,"model"))("nzLabel",e.configValue(e.draft().config,"model"));}}function ti(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function ii(n,m){if(n&1&&(_i(0,"p",44),Iw(1),Jc$1()),n&2){let e=HD(3);gI(),Lh(e.modelsError());}}function ni(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",43),Pw(5,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDraftConfig("model",i??""))}),_D(6,ei,1,2,"nz-option",27),xD(7,ti,1,2,"nz-option",27,ee),Jc$1(),iE(),_D(9,ii,2,1,"p",44),_i(10,"p",25),Iw(11),Pw(12,"transloco"),Jc$1()(),_i(13,"label",21)(14,"span"),Iw(15),Pw(16,"transloco"),Jc$1(),_i(17,"input",45),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setMaxConcurrent(i))}),Jc$1(),iE(),_i(18,"p",25),Iw(19),Pw(20,"transloco"),Jc$1()(),_i(21,"label",46)(22,"span"),Iw(23),Pw(24,"transloco"),Jc$1(),_i(25,"nz-switch",47),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDefaultAgentDraft(i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,11,"settings.model.label")),gI(2),lh("nzPlaceHolder",Fw(5,13,"settings.model.placeholder"))("ngModel",e.configValue(e.draft().config,"model")),aE(),gI(2),MD(e.selectedModelMissingFromList()?6:-1),gI(),AD(e.availableModels()),gI(2),MD(e.modelsError()?9:-1),gI(2),Lh(Fw(12,15,"settings.model.hint")),gI(4),Lh(Fw(16,17,"settings.maxConcurrent.label")),gI(2),lh("ngModel",e.draft().maxConcurrent),aE(),gI(2),Lh(Fw(20,19,"settings.maxConcurrent.hint")),gI(4),Lh(Fw(24,21,"settings.defaultAgent.toggle")),gI(2),lh("ngModel",e.draft().defaultAgent),aE();}}function oi(n,m){if(n&1){let e=FD();_i(0,"div",8)(1,"div",18)(2,"h2"),Iw(3),Pw(4,"transloco"),Jc$1(),_D(5,Ut,7,3,"section",19),_D(6,Wt,2,1,"p",20),_i(7,"label",21)(8,"span"),Iw(9),Pw(10,"transloco"),Jc$1(),_i(11,"input",22),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onDisplayNameChange(i))}),Jc$1(),iE(),Jc$1(),_i(12,"label",23)(13,"span"),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"input",24),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onIdChange(i))}),Jc$1(),iE(),_i(17,"p",25),Iw(18),Pw(19,"transloco"),Jc$1()(),_i(20,"div",21)(21,"span"),Iw(22),Pw(23,"transloco"),Jc$1(),_i(24,"nz-select",26),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onTypeChange(i))}),xD(25,Zt,2,4,"nz-option",27,ee),Jc$1(),iE(),Jc$1(),xD(27,Ht,5,5,"label",21,Pt),_D(29,Qt,8,7,"div",21),_i(30,"label",21)(31,"span"),Iw(32),Pw(33,"transloco"),Jc$1(),_i(34,"div",28)(35,"input",29),Pw(36,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setSecretValue(i))}),Jc$1(),iE(),_D(37,Gt,3,5,"button",30),_D(38,Jt,3,5,"button",31),Jc$1(),_D(39,Xt,5,5,"div",32),Jc$1(),_D(40,ni,26,23),_i(41,"label",21)(42,"span"),Iw(43),Pw(44,"transloco"),Jc$1(),_i(45,"input",33),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setExpiresOn(i))}),Jc$1(),iE(),_i(46,"p",25),Iw(47),Pw(48,"transloco"),Jc$1()(),_i(49,"div",34)(50,"button",35),mh("click",function(){Fu(e);let i=HD();return ju(i.closeModal())}),Iw(51),Pw(52,"transloco"),Jc$1(),_i(53,"button",36),mh("click",function(){Fu(e);let i=HD();return ju(i.saveModal())}),Iw(54),Pw(55,"transloco"),Jc$1()()()();}if(n&2){let e,t=HD();gI(3),rl$1(" ",Fw(4,24,t.draft().originalId?"settings.editProvider":"settings.addProvider")," "),gI(2),MD(t.validationErrors().length>0?5:-1),gI(),MD(t.secretSaveError()?6:-1),gI(3),Lh(Fw(10,26,"settings.displayName")),gI(2),lh("ngModel",t.draft().displayName),aE(),gI(3),Lh(Fw(15,28,"settings.instanceId")),gI(2),lh("ngModel",t.draft().id),aE(),gI(2),Lh(Fw(19,30,"settings.instanceIdHint")),gI(4),Lh(Fw(23,32,"settings.type.label")),gI(2),lh("ngModel",t.draft().optionId),aE(),gI(),AD(t.typeOptions),gI(2),AD(t.configFields(t.draft().type)),gI(2),MD(t.draft().type==="bitbucket"?29:-1),gI(3),Lh(Fw(33,34,"settings.apiKey.label")),gI(3),lh("ngModel",t.draft().secretValue)("placeholder",Fw(36,36,t.draft().originalId?"settings.apiKey.placeholderEdit":"settings.apiKey.placeholderCreate")),aE(),gI(2),MD(t.draft().kind==="agent"?37:-1),gI(),MD(t.supportsTestConnection(t.draft().type)?38:-1),gI(),MD((e=t.modalTestResult())?39:-1,e),gI(),MD(t.draft().kind==="agent"?40:-1),gI(3),Lh(Fw(44,38,"settings.expiresOn.label")),gI(2),lh("ngModel",t.draft().expiresOn),aE(),gI(2),Lh(Fw(48,40,"settings.expiresOn.hint")),gI(4),rl$1(" ",Fw(52,42,"common.cancel")," "),gI(2),lh("nzLoading",t.saving()),gI(),rl$1(" ",Fw(55,44,"common.save")," ");}}var en=(()=>{class n{constructor(){this.api=C(f),this.providersApi=C(w),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.loaded=qo({providerInstances:[]}),this.status=qo([]),this.draft=qo(P()),this.loading=qo(true),this.saving=qo(false),this.loadError=qo(null),this.validationErrors=qo([]),this.secretSaveError=qo(null),this.restartRequired=qo(false),this.modalOpen=qo(false),this.availableModels=qo([]),this.fetchingModels=qo(false),this.modelsError=qo(null),this.listTests=qo({}),this.modalTestRunning=qo(false),this.modalTestResult=qo(null),this.instances=Uw(()=>this.loaded().providerInstances??[]),this.typeOptions=d,this.configFields=K,this.typeLabelKey=N,this.isAgent=P_,this.supportsTestConnection=I_,Ng({settings:this.api.getSettings(),status:this.api.getProviderStatus()}).pipe(ue(this.destroyRef)).subscribe({next:({settings:e,status:t})=>{this.applySettings(e,false),this.status.set(t),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("settings.loadFailed")));}});}configValue(e,t){let i=e[t];return typeof i=="string"?i:""}isDefaultAgent(e){return P_(e)&&this.loaded().defaultAgentInstanceId===e.id}selectedModelMissingFromList(){let e=this.configValue(this.draft().config,"model");return e?!this.availableModels().some(t=>t.id===e):false}canFetchModels(){let e=this.draft();return e.kind==="agent"&&(e.secretValue.trim().length>0||e.originalId!=null)}canTestConnection(){let e=this.draft();return I_(e.type)&&(e.secretValue.trim().length>0||e.originalId!=null)}listTestState(e){return this.listTests()[e]}testResultTone(e){return e.identityMismatch?"warning":e.success?"success":"error"}testResultLabelKey(e){return e.identityMismatch?"settings.testConnection.mismatch":e.success?"settings.testConnection.connected":"settings.testConnection.failed"}openCreate(){this.resetModal(P());}openEdit(e){this.resetModal(_(e,this.isDefaultAgent(e)));}closeModal(){this.modalOpen.set(false);}onDisplayNameChange(e){this.draft.update(t=>D(t,e,this.existingIds(t)));}onIdChange(e){this.draft.update(t=>M(t,e));}onTypeChange(e){this.availableModels.set([]),this.modelsError.set(null),this.modalTestResult.set(null),this.draft.update(t=>{let i=q(t,e);return i.kind!=="agent"||t.kind==="agent"?i:s(r$1({},i),{defaultAgent:this.shouldDefaultNewAgent(t)})});}setDraftConfig(e,t){this.draft.update(i=>s(r$1({},i),{config:s(r$1({},i.config),{[e]:t})}));}setSecretValue(e){this.draft.update(t=>s(r$1({},t),{secretValue:e}));}setExpiresOn(e){this.draft.update(t=>s(r$1({},t),{expiresOn:e}));}setKnownRepoSlugs(e){this.draft.update(t=>s(r$1({},t),{knownRepoSlugs:Array.isArray(e)?e:[]}));}setDefaultAgentDraft(e){this.draft.update(t=>s(r$1({},t),{defaultAgent:e}));}setMaxConcurrent(e){let t=typeof e=="number"?e:Number(e),i=Number.isFinite(t)&&t>=1?Math.floor(t):1;this.draft.update(s$1=>s(r$1({},s$1),{maxConcurrent:i}));}fetchModels(){let e=this.draft();if(e.kind!=="agent"||!this.canFetchModels())return;let t=e.secretValue.trim();this.fetchingModels.set(true),this.modelsError.set(null),this.providersApi.previewModels(t?{type:e.type,apiKey:t}:{type:e.type,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.availableModels.set(i),this.fetchingModels.set(false);},error:i=>{this.fetchingModels.set(false),this.modelsError.set(this.errorMessage(i,this.transloco.translate("settings.model.fetchFailed")));}});}testSavedConnection(e){I_(e.type)&&(this.listTests()[e.id]?.running||(this.listTests.update(t=>s(r$1({},t),{[e.id]:{running:true,result:t[e.id]?.result}})),this.api.testProviderConnection(e.id).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:t}}));},error:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:{success:false,message:this.errorMessage(t,this.transloco.translate("settings.testConnection.failed"))}}}));}})));}testDraftConnection(){let e=this.draft();if(!this.canTestConnection()||this.modalTestRunning())return;let t=e.secretValue.trim();this.modalTestRunning.set(true),this.modalTestResult.set(null),this.providersApi.testConnection(t?{type:e.type,config:e.config,apiKey:t}:{type:e.type,config:e.config,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.modalTestRunning.set(false),this.modalTestResult.set(i);},error:i=>{this.modalTestRunning.set(false),this.modalTestResult.set({success:false,message:this.errorMessage(i,this.transloco.translate("settings.testConnection.failed"))});}});}saveModal(){let e=this.draft();if(this.validationErrors.set([]),this.secretSaveError.set(null),!e.displayName.trim()){this.validationErrors.set([this.transloco.translate("settings.displayNameRequired")]);return}if(e.originalId==null&&!e.secretValue.trim()){this.validationErrors.set([this.transloco.translate("settings.apiKey.required")]);return}let t=tm.safeParse(V(e));if(!t.success){this.validationErrors.set(B(t.error));return}this.saving.set(true);let i=t.data,s$1=i.kind==="agent"?{defaultAgent:e.defaultAgent}:{};(e.originalId==null?this.api.createProviderInstance(r$1(r$1({},i),s$1)):this.api.updateProviderInstance(e.originalId,r$1(r$1({displayName:i.displayName,config:i.config,secretKey:i.secretKey,expiresOn:i.expiresOn??null},i.kind==="agent"?{maxConcurrent:i.maxConcurrent}:{}),s$1))).pipe(Nl(D=>{this.applySettings(D.settings,D.restartRequired);let P=e.secretValue.trim();return P?this.api.setSecret(i.secretKey,P).pipe(Se(()=>({kind:"ok"})),es(vt=>Dg({kind:"secret-failed",err:vt}))):Dg({kind:"ok"})}),ue(this.destroyRef)).subscribe({next:D=>{if(this.saving.set(false),D.kind==="secret-failed"){this.draft.update(P=>s(r$1({},P),{originalId:i.id,id:i.id,idAutoSync:false,secretKey:i.secretKey})),this.secretSaveError.set(this.errorMessage(D.err,this.transloco.translate("settings.apiKey.setFailedAfterSave"))),this.refreshStatus();return}this.modalOpen.set(false),this.refreshStatus();},error:D=>{this.saving.set(false),this.message.error(this.errorMessage(D,this.transloco.translate("settings.saveFailed")));}});}removeInstance(e){this.api.deleteProviderInstance(e).subscribe({next:t=>this.applySettings(t.settings,t.restartRequired),error:t=>{this.message.error(this.errorMessage(t,this.transloco.translate("settings.saveFailed")));}});}resetModal(e){this.validationErrors.set([]),this.secretSaveError.set(null),this.availableModels.set([]),this.modelsError.set(null),this.fetchingModels.set(false),this.modalTestRunning.set(false),this.modalTestResult.set(null),this.draft.set(e),this.modalOpen.set(true);}shouldDefaultNewAgent(e){return e.originalId&&e.originalId===this.loaded().defaultAgentInstanceId?true:!this.loaded().defaultAgentInstanceId}existingIds(e){return this.instances().map(t=>t.id).filter(t=>t!==e.originalId)}applySettings(e,t){let i=e.providerInstances??[];this.loaded.set(r$1({providerInstances:i},e.defaultAgentInstanceId?{defaultAgentInstanceId:e.defaultAgentInstanceId}:{})),t&&this.restartRequired.set(true);}refreshStatus(){this.api.getProviderStatus().subscribe({next:e=>this.status.set(e),error:()=>{}});}errorMessage(e,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||n)};}static{this.\u0275cmp=ZE({type:n,selectors:[["app-settings"]],decls:17,vars:12,consts:[["data-testid","settings-page",1,"settings"],[1,"header"],[1,"lede"],["nz-button","","nzType","primary","type","button","data-testid","add-provider",3,"click"],["data-testid","restart-required-banner"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","provider-instances",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","provider-modal",1,"modal-backdrop"],["nzType","warning","nzShowIcon","","nzBanner","",3,"nzMessage"],[1,"name-cell"],["nzColor","blue"],[1,"actions"],[1,"test-connection"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"],["nz-button","","nzType","link","type","button",3,"click","nzLoading","disabled"],[3,"nzColor"],["role","dialog",1,"modal-panel"],["data-testid","validation-errors",1,"errors"],["data-testid","secret-save-error",1,"error"],[1,"field"],["nz-input","","data-testid","provider-display-name",3,"ngModelChange","ngModel"],[1,"field","field-id"],["nz-input","","data-testid","provider-id",3,"ngModelChange","ngModel"],[1,"hint"],["data-testid","provider-type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"api-key-row"],["nz-input","","type","password","autocomplete","off","data-testid","provider-api-key",3,"ngModelChange","ngModel","placeholder"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"nzLoading","disabled"],["data-testid","provider-test-result",1,"test-result-row"],["nz-input","","type","date","data-testid","provider-expires-on",3,"ngModelChange","ngModel"],[1,"modal-actions"],["nz-button","","type","button","data-testid","provider-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","provider-save",3,"click","nzLoading"],["nz-input","",3,"ngModelChange","ngModel"],["nzMode","tags","data-testid","provider-config-knownRepoSlugs",3,"ngModelChange","ngModel"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"click","nzLoading","disabled"],["data-testid","provider-test-result-message",1,"test-result-message",3,"warning","error"],["data-testid","provider-test-result-message",1,"test-result-message"],["data-testid","provider-model","nzAllowClear","",3,"ngModelChange","nzPlaceHolder","ngModel"],["data-testid","provider-models-error",1,"error"],["nz-input","","type","number","min","1","step","1","data-testid","provider-max-concurrent",3,"ngModelChange","ngModel"],[1,"field","field-switch"],["data-testid","provider-default-agent",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"p",2),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"button",3),mh("click",function(){return i.openCreate()}),Iw(10),Pw(11,"transloco"),Jc$1()(),_D(12,Rt,3,3,"div",4),_D(13,At,3,3,"p",5)(14,Bt,2,1,"p",6)(15,qt,18,15,"nz-table",7),_D(16,oi,56,46,"div",8),Jc$1()),t&2&&(gI(4),Lh(Fw(5,6,"settings.title")),gI(3),Lh(Fw(8,8,"settings.lede")),gI(3),rl$1(" ",Fw(11,10,"settings.addProvider")," "),gI(2),MD(i.restartRequired()?12:-1),gI(),MD(i.loading()?13:i.loadError()?14:15),gI(3),MD(i.modalOpen()?16:-1));},dependencies:[$8,al,er,Jc,rl,Nc,$i,Gn,un,pf,bd,sp,fp,ai,z,_n,Cn,ex,Fm,Am,xt,X,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".settings[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.field-id[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace;font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.15rem .25rem}.test-connection[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.api-key-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.api-key-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:10rem}.test-result-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.4rem .6rem;margin-top:.45rem}.test-result-message[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#57534e;flex:1;min-width:12rem}.test-result-message.warning[_ngcontent-%COMP%]{color:#b45309}.test-result-message.error[_ngcontent-%COMP%]{color:#9f1239}.field-switch[_ngcontent-%COMP%]{flex-direction:row;align-items:center;justify-content:space-between}.field[_ngcontent-%COMP%] nz-select[_ngcontent-%COMP%]{width:100%}.modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:4rem 1rem 2rem;background:#1c191759}.modal-panel[_ngcontent-%COMP%]{width:min(32rem,100%);max-height:calc(100vh - 6rem);overflow:auto;background:#fff;border-radius:.5rem;padding:1.25rem 1.5rem 1.5rem;box-shadow:0 10px 30px #1c19172e}.modal-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.15rem}.modal-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}"]});}}return n})();export{en as ProvidersManageComponent,en as SettingsComponent};
@@ -1 +1 @@
1
- import {C,b4 as N2,aV as ix,b5 as cx,i as ie}from'./main-SI5AKDMC.js';var f=(()=>{class r{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/local-repositories`;}list(){return this.http.get(this.baseUrl).pipe(cx())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}create(t){return this.http.post(this.baseUrl,t).pipe(cx())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(cx())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{f};
1
+ import {C,b4 as N2,aV as ix,b5 as cx,i as ie}from'./main-3VZRFHGG.js';var f=(()=>{class r{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/local-repositories`;}list(){return this.http.get(this.baseUrl).pipe(cx())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}create(t){return this.http.post(this.baseUrl,t).pipe(cx())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(cx())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{f};
@@ -1 +1 @@
1
- import {a as ae,l as le}from'./chunk-DvWh-Q5D.js';import {H as He}from'./chunk-hpn_m1ZC.js';import {C,$ as $$1,b0 as jn,R as J1,V as Ve,s,r as r$1,c as bi,i as ie,b2 as Le,b3 as Wn,q as qo,U as Uw,Z as ZE,d as $8,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,m as mh,I as Iw,P as Pw,J as Jc,o as gI,M as MD,w as lh,z as rl,p as Fw,G as FD,H as HD,L as Lh,O as Fu,Q as ju}from'./main-SI5AKDMC.js';import {b}from'./chunk-Dx92ksvP.js';import {a as ai,z}from'./chunk-BIL86kgf.js';function M(e){return e.inputSchema.filter(a=>a.required)}function A(e,a){return e.appliesTo!=="none"&&!a.subjectId?.trim()}function Y(e,a){return A(e,a)||M(e).length>0}function x(e,a){return e.appliesTo==="none"?void 0:a.subjectId?.trim()||void 0}function et(e,a){if(e&1){let t=FD();_i(0,"label",1)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"input",7),Pw(5,"transloco"),mh("input",function(o){Fu(t);let n=HD();return ju(n.setSubjectId(o))}),Jc()();}if(e&2){let t=HD();gI(2),Lh(Fw(3,3,"jobs.start.subjectId")),gI(2),lh("value",t.subjectId())("placeholder",Fw(5,5,"jobs.start.subjectIdPlaceholder"));}}function it(e,a){if(e&1){let t=FD();_i(0,"app-workflow-input-form",8),mh("valuesChange",function(o){Fu(t);let n=HD();return ju(n.inputValues.set(o))}),Jc();}if(e&2){let t=HD();lh("fields",t.requiredFields())("values",t.inputValues());}}function ot(e,a){if(e&1&&(_i(0,"p",3),Iw(1),Jc()),e&2){let t=HD();gI(),Lh(t.actionError());}}var $=(()=>{class e{constructor(){this.jobsApi=C($$1),this.router=C(J1),this.transloco=C(Ve),this.modalRef=C(Le),this.data=C(Wn),this.subjectId=qo(this.data.subjectId??""),this.inputValues=qo(ae(M(this.data.workflow))),this.starting=qo(false),this.actionError=qo(null),this.showSubjectPicker=Uw(()=>A(this.data.workflow,this.context())),this.requiredFields=Uw(()=>M(this.data.workflow));}setSubjectId(t){this.subjectId.set(t.target.value);}start(){let t=this.data.workflow;if(this.showSubjectPicker()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}let i={workflowId:t.id,subjectId:this.subjectId().trim()||this.data.subjectId},o=x(t,i);this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r$1({workflowId:t.id},o?{subjectId:o}:{}),{inputValues:r$1({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.modalRef.close(),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}cancel(){this.modalRef.close();}context(){return {workflowId:this.data.workflow.id,subjectId:this.data.subjectId}}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-start-job-modal"]],decls:11,vars:12,consts:[["data-testid","start-job-modal"],[1,"field"],[3,"fields","values"],["data-testid","action-error",1,"error"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","start-job-cancel",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","start-button",3,"click","nzLoading","disabled"],["nz-input","","data-testid","subject-id","type","text",3,"input","value","placeholder"],[3,"valuesChange","fields","values"]],template:function(i,o){i&1&&(_i(0,"div",0),_D(1,et,6,7,"label",1),_D(2,it,1,2,"app-workflow-input-form",2),_D(3,ot,2,1,"p",3),_i(4,"div",4)(5,"button",5),mh("click",function(){return o.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",6),mh("click",function(){return o.start()}),Iw(9),Pw(10,"transloco"),Jc()()()),i&2&&(gI(),MD(o.showSubjectPicker()?1:-1),gI(),MD(o.requiredFields().length>0?2:-1),gI(),MD(o.actionError()?3:-1),gI(2),lh("disabled",o.starting()),gI(),rl(" ",Fw(7,8,"common.cancel")," "),gI(2),lh("nzLoading",o.starting())("disabled",o.starting()),gI(),rl(" ",Fw(10,10,o.starting()?"jobs.start.starting":"jobs.start.button")," "));},dependencies:[$8,pf,bd,sp,fp,ai,z,le,Kt],styles:[".field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:0 0 1rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239;margin:0 0 1rem}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin-top:.5rem}"]});}}return e})();var At=(()=>{class e{constructor(){this.workflowsApi=C(b),this.jobsApi=C($$1),this.modal=C(jn),this.router=C(J1),this.transloco=C(Ve),this.message=C(He);}start(t){this.workflowsApi.get(t.workflowId).subscribe({next:i=>{if(!Y(i,t)){this.launch(i,t,{});return}this.modal.create({nzTitle:this.transloco.translate("jobs.start.heading"),nzContent:$,nzData:{workflow:i,subjectId:t.subjectId},nzFooter:null});},error:i=>{this.message.error(this.errorMessage(i,this.transloco.translate("jobs.errors.loadWorkflows")));}});}launch(t,i,o){let n=x(t,i);this.jobsApi.start(s(r$1({workflowId:t.id},n?{subjectId:n}:{}),{inputValues:o})).subscribe({next:k=>{this.router.navigate(["/jobs",k.id]);},error:k=>{this.message.error(this.errorMessage(k,this.transloco.translate("jobs.errors.startFailed")));}});}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{At as A};
1
+ import {a as ae,l as le}from'./chunk-EDwdt-Wk.js';import {H as He}from'./chunk-CwEMAptL.js';import {C,$ as $$1,b0 as jn,R as J1,V as Ve,s,r as r$1,c as bi,i as ie,b2 as Le,b3 as Wn,q as qo,U as Uw,Z as ZE,d as $8,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,m as mh,I as Iw,P as Pw,J as Jc,o as gI,M as MD,w as lh,z as rl,p as Fw,G as FD,H as HD,L as Lh,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {a as ai,z}from'./chunk-Dm_EWkUz.js';function M(e){return e.inputSchema.filter(a=>a.required)}function A(e,a){return e.appliesTo!=="none"&&!a.subjectId?.trim()}function Y(e,a){return A(e,a)||M(e).length>0}function x(e,a){return e.appliesTo==="none"?void 0:a.subjectId?.trim()||void 0}function et(e,a){if(e&1){let t=FD();_i(0,"label",1)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"input",7),Pw(5,"transloco"),mh("input",function(o){Fu(t);let n=HD();return ju(n.setSubjectId(o))}),Jc()();}if(e&2){let t=HD();gI(2),Lh(Fw(3,3,"jobs.start.subjectId")),gI(2),lh("value",t.subjectId())("placeholder",Fw(5,5,"jobs.start.subjectIdPlaceholder"));}}function it(e,a){if(e&1){let t=FD();_i(0,"app-workflow-input-form",8),mh("valuesChange",function(o){Fu(t);let n=HD();return ju(n.inputValues.set(o))}),Jc();}if(e&2){let t=HD();lh("fields",t.requiredFields())("values",t.inputValues());}}function ot(e,a){if(e&1&&(_i(0,"p",3),Iw(1),Jc()),e&2){let t=HD();gI(),Lh(t.actionError());}}var $=(()=>{class e{constructor(){this.jobsApi=C($$1),this.router=C(J1),this.transloco=C(Ve),this.modalRef=C(Le),this.data=C(Wn),this.subjectId=qo(this.data.subjectId??""),this.inputValues=qo(ae(M(this.data.workflow))),this.starting=qo(false),this.actionError=qo(null),this.showSubjectPicker=Uw(()=>A(this.data.workflow,this.context())),this.requiredFields=Uw(()=>M(this.data.workflow));}setSubjectId(t){this.subjectId.set(t.target.value);}start(){let t=this.data.workflow;if(this.showSubjectPicker()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}let i={workflowId:t.id,subjectId:this.subjectId().trim()||this.data.subjectId},o=x(t,i);this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r$1({workflowId:t.id},o?{subjectId:o}:{}),{inputValues:r$1({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.modalRef.close(),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}cancel(){this.modalRef.close();}context(){return {workflowId:this.data.workflow.id,subjectId:this.data.subjectId}}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-start-job-modal"]],decls:11,vars:12,consts:[["data-testid","start-job-modal"],[1,"field"],[3,"fields","values"],["data-testid","action-error",1,"error"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","start-job-cancel",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","start-button",3,"click","nzLoading","disabled"],["nz-input","","data-testid","subject-id","type","text",3,"input","value","placeholder"],[3,"valuesChange","fields","values"]],template:function(i,o){i&1&&(_i(0,"div",0),_D(1,et,6,7,"label",1),_D(2,it,1,2,"app-workflow-input-form",2),_D(3,ot,2,1,"p",3),_i(4,"div",4)(5,"button",5),mh("click",function(){return o.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",6),mh("click",function(){return o.start()}),Iw(9),Pw(10,"transloco"),Jc()()()),i&2&&(gI(),MD(o.showSubjectPicker()?1:-1),gI(),MD(o.requiredFields().length>0?2:-1),gI(),MD(o.actionError()?3:-1),gI(2),lh("disabled",o.starting()),gI(),rl(" ",Fw(7,8,"common.cancel")," "),gI(2),lh("nzLoading",o.starting())("disabled",o.starting()),gI(),rl(" ",Fw(10,10,o.starting()?"jobs.start.starting":"jobs.start.button")," "));},dependencies:[$8,pf,bd,sp,fp,ai,z,le,Kt],styles:[".field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:0 0 1rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239;margin:0 0 1rem}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin-top:.5rem}"]});}}return e})();var At=(()=>{class e{constructor(){this.workflowsApi=C(b),this.jobsApi=C($$1),this.modal=C(jn),this.router=C(J1),this.transloco=C(Ve),this.message=C(He);}start(t){this.workflowsApi.get(t.workflowId).subscribe({next:i=>{if(!Y(i,t)){this.launch(i,t,{});return}this.modal.create({nzTitle:this.transloco.translate("jobs.start.heading"),nzContent:$,nzData:{workflow:i,subjectId:t.subjectId},nzFooter:null});},error:i=>{this.message.error(this.errorMessage(i,this.transloco.translate("jobs.errors.loadWorkflows")));}});}launch(t,i,o){let n=x(t,i);this.jobsApi.start(s(r$1({workflowId:t.id},n?{subjectId:n}:{}),{inputValues:o})).subscribe({next:k=>{this.router.navigate(["/jobs",k.id]);},error:k=>{this.message.error(this.errorMessage(k,this.transloco.translate("jobs.errors.startFailed")));}});}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{At as A};
@@ -0,0 +1 @@
1
+ import {A as At}from'./chunk-BKYaECRn.js';import'./chunk-EDwdt-Wk.js';import {l}from'./chunk-D19C8Gcb.js';import {I,_,b as b$1,v,T,y,h,E,P,A,j}from'./chunk-SiaN7xSQ.js';import {w,F,L}from'./chunk-IjKs-6Cl.js';import {H as He}from'./chunk-CwEMAptL.js';import {z as ze,S as St}from'./chunk-BRAytoQl.js';import {f}from'./chunk--EZIkevK.js';import {o as ot$2}from'./chunk-Det50scT.js';import'./chunk-vINo5yVD.js';import {f as f$1}from'./chunk-BIJScqTM.js';import {C,a as C1,R as J1,b as at,V as Ve,bo as O,bp as de,ba as Se,q as qo$1,U as Uw,u as ue,s,r as r$1,c as bi$1,Z as ZE,d as $8,e as al,bb as er$1,f as rl,g as $i$1,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i$1,I as Iw,J as Jc,P as Pw,l as _D,m as mh,o as gI,L as Lh,p as Fw,M as MD,w as lh,z as rl$1,b0 as jn$1,a5 as q0,a6 as U0,T as id,t as t$1,bq as Ja,b1 as ts,x as xD,D as ch,B as AD,G as FD,H as HD,k as iE,N as ND,aO as SD,y as aE,a7 as KE,a8 as fu,aE as J0,av as K0,br as pn,bs as G0,bf as _r$1,bt as Ee,bg as Ci$1,ab as Oe,bu as ml,aD as Nr,bh as Bt,bv as pl,bw as Gw,bx as z0,by as Qr,bz as tl,bA as kr,bB as Xf,W as qw,bC as il,a3 as Ah,a4 as Th,bD as hl,au as w5,aj as $D,aw as rh,aT as Vw,bj as Nw,bk as St$1,bE as fn,bl as wo$1,bF as oD,bG as ir$1,aG as lw,bH as wh,bI as zD,bJ as Dh,bK as W0,bm as Xc,bL as yh,bn as el,al as Sh,n as uh,az as jw,E as Aw,aH as QD,O as Fu,Q as ju,bM as Hh,bN as Vh,ak as UD,aL as Fh,aR as xw,bO as Tw}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {N as Nt,K as Ke}from'./chunk-C7P7hUiX.js';import {G as Gn$1,u as un}from'./chunk-bSS_wejP.js';import {a as ai$1,z,o as ot$1,b as at$1,i as it$1,r as rt}from'./chunk-Dm_EWkUz.js';import {W,I as I$1}from'./chunk-Bok52e_k.js';import {w as w_,A as Ad,c as c_,i as ig,a as im,G as G_,n as nm,J as J_,F as F_,z as zg,U as Uu,j as j_}from'./chunk-8ezEUcxN.js';import {L as Lt,u as ut}from'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';var Dn=["input"],Ln=["inputNumberHost"],On=[[["","nzInputAddonBefore",""]],[["","nzInputAddonAfter",""]],[["","nzInputPrefix",""]],[["","nzInputSuffix",""]],[["","nzInputNumberUpIcon",""]],[["","nzInputNumberDownIcon",""]]],Wn=["[nzInputAddonBefore]","[nzInputAddonAfter]","[nzInputPrefix]","[nzInputSuffix]","[nzInputNumberUpIcon]","[nzInputNumberDownIcon]"];function jn(i,l){}function Rn(i,l){if(i&1&&rh(0,jn,0,0,"ng-template",8),i&2){HD();let e=QD(4);lh("ngTemplateOutlet",e);}}function Kn(i,l){}function Hn(i,l){if(i&1&&rh(0,Kn,0,0,"ng-template",8),i&2){HD();let e=QD(8);lh("ngTemplateOutlet",e);}}function qn(i,l){}function Gn(i,l){if(i&1&&rh(0,qn,0,0,"ng-template",8),i&2){HD();let e=QD(12);lh("ngTemplateOutlet",e);}}function Un(i,l){if(i&1&&Iw(0),i&2){let e=HD(3);Lh(e.nzAddonBefore());}}function Jn(i,l){i&1&&(_i$1(0,"div",10),UD(1,0,null,Un,1,1),Jc());}function Zn(i,l){}function Qn(i,l){if(i&1&&rh(0,Zn,0,0,"ng-template",8),i&2){HD(2);let e=QD(6);lh("ngTemplateOutlet",e);}}function Yn(i,l){}function Xn(i,l){if(i&1&&rh(0,Yn,0,0,"ng-template",8),i&2){HD(2);let e=QD(10);lh("ngTemplateOutlet",e);}}function ei(i,l){if(i&1&&Iw(0),i&2){let e=HD(3);Lh(e.nzAddonAfter());}}function ti(i,l){i&1&&(_i$1(0,"div",10),UD(1,1,null,ei,1,1),Jc());}function ni(i,l){if(i&1&&(_i$1(0,"div",9),_D(1,Jn,3,0,"div",10),_D(2,Qn,1,1,null,8)(3,Xn,1,1,null,8),_D(4,ti,3,0,"div",10),Jc()),i&2){let e=HD();gI(),MD(e.hasAddonBefore()?1:-1),gI(),MD(e.hasAffix()?2:3),gI(2),MD(e.hasAddonAfter()?4:-1);}}function ii(i,l){}function oi(i,l){if(i&1&&(_i$1(0,"div"),rh(1,ii,0,0,"ng-template",8),Jc()),i&2){let e=HD(),t=QD(8);lw(e.affixWrapperClass()),gI(),lh("ngTemplateOutlet",t);}}function ri(i,l){if(i&1&&Iw(0),i&2){let e=HD(3);Lh(e.nzPrefix());}}function ai(i,l){i&1&&(_i$1(0,"span",11),UD(1,2,null,ri,1,1),Jc());}function si(i,l){}function li(i,l){if(i&1&&Iw(0),i&2){let e=HD(3);Lh(e.nzSuffix());}}function pi(i,l){if(i&1&&uh(0,"nz-form-item-feedback-icon",13),i&2){let e=HD(3);lh("status",e.finalStatus());}}function di(i,l){if(i&1&&(_i$1(0,"span",12),UD(1,3,null,li,1,1),_D(3,pi,1,1,"nz-form-item-feedback-icon",13),Jc()),i&2){let e=HD(2);gI(3),MD(e.hasFeedback()&&e.finalStatus()?3:-1);}}function ci(i,l){if(i&1&&(_D(0,ai,3,0,"span",11),rh(1,si,0,0,"ng-template",8),_D(2,di,4,1,"span",12)),i&2){let e=HD(),t=QD(10);MD(e.hasPrefix()?0:-1),gI(),lh("ngTemplateOutlet",t),gI(),MD(e.hasSuffix()?2:-1);}}function _i(i,l){}function mi(i,l){if(i&1&&(_i$1(0,"div",null,5),rh(2,_i,0,0,"ng-template",8),Jc()),i&2){let e=HD(),t=QD(12);lw(e.inputNumberClass()),gI(2),lh("ngTemplateOutlet",t);}}function ui(i,l){i&1&&uh(0,"nz-icon",20);}function Ci(i,l){i&1&&uh(0,"nz-icon",21);}function xi(i,l){if(i&1){let e=FD();_i$1(0,"div",17,7),mh("mouseup",function(){Fu(e);let n=HD(2);return ju(n.stopAutoStep())})("mouseleave",function(){Fu(e);let n=HD(2);return ju(n.stopAutoStep())}),_i$1(2,"span",18),mh("mousedown",function(n){Fu(e);let o=HD(2);return ju(o.onStepMouseDown(n,true))}),UD(3,4,null,ui,1,0),Jc(),_i$1(5,"span",19),mh("mousedown",function(n){Fu(e);let o=HD(2);return ju(o.onStepMouseDown(n,false))}),UD(6,5,null,Ci,1,0),Jc()();}if(i&2){let e=HD(2);gI(2),Sh("ant-input-number-handler-up-disabled",e.upDisabled()),ch("aria-disabled",e.upDisabled()),gI(3),Sh("ant-input-number-handler-down-disabled",e.downDisabled()),ch("aria-disabled",e.downDisabled());}}function fi(i,l){if(i&1){let e=FD();_D(0,xi,8,6,"div",14),_i$1(1,"div",15)(2,"input",16,6),mh("input",function(){Fu(e);let n=QD(3),o=HD();return ju(o.onInput(n.value))})("wheel",function(n){Fu(e);let o=HD();return ju(o.onWheel(n))}),Jc()();}if(i&2){let e=HD();MD(e.nzControls()?0:-1),gI(2),lh("value",e.displayValue())("placeholder",e.nzPlaceHolder()??"")("disabled",e.finalDisabled())("readOnly",e.nzReadOnly()),ch("aria-valuemin",e.nzMin())("aria-valuemax",e.nzMax())("id",e.nzId())("step",e.nzStep())("value",e.displayValue());}}var ot=(()=>{class i{nzId=q0(null);nzSize=q0("default");nzPlaceHolder=q0(null);nzStatus=q0("");nzVariant=q0();nzStep=q0(1,{transform:J0});nzMin=q0(Number.MIN_SAFE_INTEGER,{transform:J0});nzMax=q0(Number.MAX_SAFE_INTEGER,{transform:J0});nzPrecision=q0(null);nzParser=q0();nzFormatter=q0();nzDisabled=q0(false,{transform:K0});nzReadOnly=q0(false,{transform:K0});nzAutoFocus=q0(false,{transform:K0});nzKeyboard=q0(true,{transform:K0});nzControls=q0(true,{transform:K0});nzChangeOnWheel=q0(true,{transform:K0});nzPrefix=q0();nzSuffix=q0();nzAddonBefore=q0();nzAddonAfter=q0();nzBlur=U0();nzFocus=U0();nzOnStep=U0();onChange=()=>{};onTouched=()=>{};isDisabledFirstChange=true;compactSize=C(pn,{optional:true});inputRef=G0.required("input");hostRef=G0("inputNumberHost");elementRef=C(_r$1);injector=C(Ee);focusMonitor=C(Ci$1);directionality=C(Oe);nzFormStatusService=C(ml,{optional:true});autoStepTimer=null;defaultFormatter=e=>{let t=this.nzPrecision();return Nr(t)?e.toFixed(t):e.toString()};value=qo$1(null);displayValue=qo$1("");formSize=C(Bt,{optional:true});formVariant=C(pl,{optional:true});dir=C(Oe).valueSignal;focused=qo$1(false);hasFeedback=qo$1(false);finalStatus=Gw(()=>this.nzStatus());finalDisabled=Gw(()=>this.nzDisabled());prefix=z0(ot$1);suffix=z0(at$1);addonBefore=z0(it$1);addonAfter=z0(rt);hasPrefix=Uw(()=>!!this.nzPrefix()||!!this.prefix());hasSuffix=Uw(()=>!!this.nzSuffix()||!!this.suffix()||this.hasFeedback());hasAffix=Uw(()=>this.hasPrefix()||this.hasSuffix());hasAddonBefore=Uw(()=>!!this.nzAddonBefore()||!!this.addonBefore());hasAddonAfter=Uw(()=>!!this.nzAddonAfter()||!!this.addonAfter());hasAddon=Uw(()=>this.hasAddonBefore()||this.hasAddonAfter());class=Uw(()=>this.hasAddon()?this.groupWrapperClass():this.hasAffix()?this.affixWrapperClass():this.inputNumberClass());inputNumberClass=Uw(()=>r$1(r$1({"ant-input-number":true,"ant-input-number-lg":this.finalSize()==="large","ant-input-number-sm":this.finalSize()==="small","ant-input-number-disabled":this.finalDisabled(),"ant-input-number-readonly":this.nzReadOnly(),"ant-input-number-focused":this.focused(),"ant-input-number-rtl":this.dir()==="rtl","ant-input-number-in-form-item":!!this.nzFormStatusService,"ant-input-number-out-of-range":this.value()!==null&&!it(this.value(),this.nzMin(),this.nzMax())},tl("ant-input-number",this.finalVariant())),Qr("ant-input-number",this.finalStatus(),this.hasFeedback())));affixWrapperClass=Uw(()=>r$1(r$1({"ant-input-number-affix-wrapper":true,"ant-input-number-affix-wrapper-disabled":this.finalDisabled(),"ant-input-number-affix-wrapper-readonly":this.nzReadOnly(),"ant-input-number-affix-wrapper-focused":this.focused(),"ant-input-number-affix-wrapper-rtl":this.dir()==="rtl"},Qr("ant-input-number-affix-wrapper",this.finalStatus(),this.hasFeedback())),tl("ant-input-number-affix-wrapper",this.finalVariant())));groupWrapperClass=Uw(()=>r$1(r$1({"ant-input-number-group-wrapper":true,"ant-input-number-group-wrapper-rtl":this.dir()==="rtl"},Qr("ant-input-number-group-wrapper",this.finalStatus(),this.hasFeedback())),tl("ant-input-number-group-wrapper",this.finalVariant())));finalSize=Uw(()=>this.formSize?.()?this.formSize():this.compactSize?this.compactSize():this.nzSize());finalVariant=Uw(()=>this.nzVariant()||this.formVariant?.()||"outlined");upDisabled=Uw(()=>!kr(this.value())&&this.value()>=this.nzMax());downDisabled=Uw(()=>!kr(this.value())&&this.value()<=this.nzMin());constructor(){let e=C(at);Xf(()=>{let t=this.hostRef(),n=t||this.elementRef;this.focusMonitor.monitor(n,true).pipe(ue(e)).subscribe(o=>{qw(()=>{this.focused.set(!!o),o?this.nzFocus.emit():(this.fixValue(),this.onTouched(),this.nzBlur.emit());});}),e.onDestroy(()=>{this.focusMonitor.stopMonitoring(n);});}),this.nzFormStatusService?.formStatusChanges.pipe(ue()).subscribe(({status:t,hasFeedback:n})=>{this.finalStatus.set(t),this.hasFeedback.set(n);});}ngOnInit(){this.nzAutoFocus()&&Xf(()=>this.focus(),{injector:this.injector});}writeValue(e){kr(e)&&(e=null),qw(()=>{this.value.set(e),this.setValue(e);});}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){qw(()=>{this.finalDisabled.set(this.isDisabledFirstChange&&this.nzDisabled()||e);}),this.isDisabledFirstChange=false;}focus(e){il(this.inputRef().nativeElement,e);}blur(){this.inputRef().nativeElement.blur();}step(e,t,n){if(t&&this.upDisabled()||!t&&this.downDisabled())return;let o=e.shiftKey?this.nzStep()*10:this.nzStep();t||(o=-o);let T=10**vn(o),J=bn((Math.round((this.value()||0)*T)+Math.round(o*T))/T,this.nzMin(),this.nzMax(),this.nzPrecision());this.setValue(J),this.nzOnStep.emit({type:t?"up":"down",value:this.value(),offset:this.nzStep(),emitter:n}),this.focus();}setValue(e){let t=this.nzFormatter()??this.defaultFormatter,n=this.nzPrecision();Nr(n)&&(e&&=+e.toFixed(n));let o=kr(e)?"":t(e);this.displayValue.set(o),this.updateValue(e);}setValueByTyping(e){if(this.displayValue.set(e),e===""){this.updateValue(null);return}let n=(this.nzParser()??hn)(e);if(bi(e)||Number.isNaN(n))return;let o=this.nzFormatter();if(o){let d=o(n);this.displayValue.set(d);}it(n,this.nzMin(),this.nzMax())&&this.updateValue(n);}updateValue(e){this.value()!==e&&(this.value.set(e),this.onChange(e));}fixValue(){let e=this.displayValue();if(e==="")return;let n=(this.nzParser()??hn)(e);if(Number.isNaN(n))n=this.value();else {let o=this.nzPrecision();Nr(o)&&vn(n)!==o&&(n=+n.toFixed(o)),it(n,this.nzMin(),this.nzMax())||(n=bn(n,this.nzMin(),this.nzMax(),o));}this.setValue(n);}stopAutoStep(){this.autoStepTimer!==null&&(clearTimeout(this.autoStepTimer),this.autoStepTimer=null);}onStepMouseDown(e,t){e.preventDefault(),this.stopAutoStep(),this.step(e,t,"handler");let n=()=>{this.step(e,t,"handler"),this.autoStepTimer=setTimeout(n,gi);};this.autoStepTimer=setTimeout(n,hi);}onKeyDown(e){switch(e.keyCode){case 38:e.preventDefault(),this.nzKeyboard()&&this.step(e,true,"keyboard");break;case 40:e.preventDefault(),this.nzKeyboard()&&this.step(e,false,"keyboard");break;case 13:this.fixValue();break}}onInput(e){this.setValueByTyping(e);}onWheel(e){this.finalDisabled()||this.nzReadOnly()||!this.nzChangeOnWheel()||(e.preventDefault(),this.step(e,e.deltaY<0,"wheel"));}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ZE({type:i,selectors:[["nz-input-number"]],contentQueries:function(t,n,o){t&1&&Dh(o,n.prefix,ot$1,5)(o,n.suffix,at$1,5)(o,n.addonBefore,it$1,5)(o,n.addonAfter,rt,5),t&2&&zD(4);},viewQuery:function(t,n){t&1&&wh(n.inputRef,Dn,5)(n.hostRef,Ln,5),t&2&&zD(2);},hostVars:2,hostBindings:function(t,n){t&1&&mh("keydown",function(d){return n.onKeyDown(d)}),t&2&&lw(n.class());},inputs:{nzId:[1,"nzId"],nzSize:[1,"nzSize"],nzPlaceHolder:[1,"nzPlaceHolder"],nzStatus:[1,"nzStatus"],nzVariant:[1,"nzVariant"],nzStep:[1,"nzStep"],nzMin:[1,"nzMin"],nzMax:[1,"nzMax"],nzPrecision:[1,"nzPrecision"],nzParser:[1,"nzParser"],nzFormatter:[1,"nzFormatter"],nzDisabled:[1,"nzDisabled"],nzReadOnly:[1,"nzReadOnly"],nzAutoFocus:[1,"nzAutoFocus"],nzKeyboard:[1,"nzKeyboard"],nzControls:[1,"nzControls"],nzChangeOnWheel:[1,"nzChangeOnWheel"],nzPrefix:[1,"nzPrefix"],nzSuffix:[1,"nzSuffix"],nzAddonBefore:[1,"nzAddonBefore"],nzAddonAfter:[1,"nzAddonAfter"]},outputs:{nzBlur:"nzBlur",nzFocus:"nzFocus",nzOnStep:"nzOnStep"},exportAs:["nzInputNumber"],features:[Nw([{provide:St$1,useExisting:wo$1(()=>i),multi:true},{provide:fn,useValue:"input-number"}]),oD([ir$1])],ngContentSelectors:Wn,decls:13,vars:1,consts:[["inputNumberWithAddonInner",""],["inputNumberWithAffix",""],["inputNumberWithAffixInner",""],["inputNumber",""],["inputNumberInner",""],["inputNumberHost",""],["input",""],["handlers",""],[3,"ngTemplateOutlet"],[1,"ant-input-number-wrapper","ant-input-number-group"],[1,"ant-input-number-group-addon"],[1,"ant-input-number-prefix"],[1,"ant-input-number-suffix"],[3,"status"],[1,"ant-input-number-handler-wrap"],[1,"ant-input-number-input-wrap"],["autocomplete","off","role","spinbutton",1,"ant-input-number-input",3,"input","wheel","value","placeholder","disabled","readOnly"],[1,"ant-input-number-handler-wrap",3,"mouseup","mouseleave"],["role","button","unselectable","on",1,"ant-input-number-handler","ant-input-number-handler-up",3,"mousedown"],["role","button","unselectable","on",1,"ant-input-number-handler","ant-input-number-handler-down",3,"mousedown"],["nzType","up",1,"ant-input-number-handler-up-inner"],["nzType","down",1,"ant-input-number-handler-down-inner"]],template:function(t,n){t&1&&($D(On),_D(0,Rn,1,1,null,8)(1,Hn,1,1,null,8)(2,Gn,1,1,null,8),rh(3,ni,5,3,"ng-template",null,0,Vw)(5,oi,2,3,"ng-template",null,1,Vw)(7,ci,3,3,"ng-template",null,2,Vw)(9,mi,3,3,"ng-template",null,3,Vw)(11,fi,4,10,"ng-template",null,4,Vw)),t&2&&MD(n.hasAddon()?0:n.hasAffix()?1:2);},dependencies:[Ah,Th,hl,w5],encapsulation:2})}return i})(),gi=200,hi=600;function hn(i){let l=i.trim().replace(/,/g,"").replace(/。/g,".");return l.length?+l:NaN}function it(i,l,e){return i>=l&&i<=e}function bn(i,l,e,t=null){if(t===null)return i<l?l:i>e?e:i;let n=+i.toFixed(t),o=Math.pow(10,t);return n<l?Math.ceil(l*o)/o:n>e?Math.floor(e*o)/o:n}function vn(i){return i.toString().split(".")[1]?.length||0}function bi(i){return /[.。](\d*0)?$/.test(i.toString())}var wn=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=KE({type:i});static \u0275inj=fu({imports:[ot]})}return i})();var wi=(i,l)=>l.id;function Si(i,l){if(i&1&&uh(0,"nz-option",2),i&2){let e=l.$implicit;lh("nzValue",e.id)("nzLabel",e.name);}}var Sn=(()=>{class i{constructor(){this.reposApi=C(f$1),this.destroyRef=C(at),this.path=W0(""),this.repoSelected=U0(),this.repos=qo$1([]),this.selectedCatalogId=Uw(()=>{let e=this.path();return this.repos().find(t=>t.localPath===e)?.id??null}),this.reposApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.repos.set(e),error:()=>this.repos.set([])});}onCatalogSelect(e){if(!e)return;let t=this.repos().find(n=>n.id===e);t&&this.repoSelected.emit(t);}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-repo-path-picker"]],inputs:{path:[1,"path"]},outputs:{path:"pathChange",repoSelected:"repoSelected"},decls:7,vars:8,consts:[["data-testid","repo-path-picker",1,"repo-path-picker"],["data-testid","repo-path-catalog",1,"catalog",3,"ngModelChange","ngModel","nzPlaceHolder"],[3,"nzValue","nzLabel"],["mode","directories",3,"pathChange","path","browseLabel"]],template:function(t,n){t&1&&(_i$1(0,"div",0)(1,"nz-select",1),Pw(2,"transloco"),mh("ngModelChange",function(d){return n.onCatalogSelect(d)}),xD(3,Si,1,2,"nz-option",2,wi),Jc(),iE(),_i$1(5,"app-path-picker",3),Pw(6,"transloco"),mh("pathChange",function(d){return n.path.set(d)}),Jc()()),t&2&&(gI(),lh("ngModel",n.selectedCatalogId())("nzPlaceHolder",Fw(2,4,"step-list.createWorktree.catalogPlaceholder")),aE(),gI(2),AD(n.repos()),gI(2),lh("path",n.path())("browseLabel",Fw(6,6,"step-list.createWorktree.browseManually")));},dependencies:[$8,al,rl,$i$1,ex,Fm,Am,ot$2,Kt],styles:["[_nghost-%COMP%]{display:block}.repo-path-picker[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.catalog[_ngcontent-%COMP%]{width:100%}"]});}}return i})();var yi=i=>({action:i}),zi=i=>({fields:i}),yn=(i,l)=>l.token,Mi=(i,l)=>l.subjectType,Ei=(i,l)=>l.id+l.name;function ki(i,l){i&1&&(Xc(0,"p",7),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.subWorkflowForEach")," "));}function Ti(i,l){if(i&1){let e=FD();Xc(0,"li")(1,"span",13),Iw(2),el(),Xc(3,"button",14),yh("click",function(){let n=Fu(e).$implicit,o=HD(3);return ju(o.copyToken(n.token))}),Iw(4),el()();}if(i&2){let e=l.$implicit,t=HD(3);gI(2),Lh(e.label),gI(),Sh("copied",t.copiedToken()===e.token),ch("data-testid","copy-token")("data-token",e.token),gI(),rl$1(" ",e.token," ");}}function Ii(i,l){if(i&1&&(Xc(0,"div",8)(1,"h5"),Iw(2),Pw(3,"transloco"),el(),Xc(4,"ul"),xD(5,Ti,5,6,"li",null,yn),el()()),i&2){let e=HD(2);gI(2),Lh(Fw(3,1,"step-list.availableParameters.inputs")),gI(3),AD(e.inputEntries());}}function Ni(i,l){if(i&1&&(Xc(0,"p",16),Iw(1),Pw(2,"transloco"),el()),i&2){let e=HD().$implicit;gI(),Lh(Fw(2,1,e.typeKey));}}function Fi(i,l){if(i&1){let e=FD();Xc(0,"li")(1,"button",14),yh("click",function(){let n=Fu(e).$implicit,o=HD(4);return ju(o.copyToken(n.token))}),Iw(2),el()();}if(i&2){let e=l.$implicit,t=HD(4);gI(),Sh("copied",t.copiedToken()===e.token),ch("data-testid","copy-token")("data-token",e.token),gI(),rl$1(" ",e.token," ");}}function Pi(i,l){if(i&1&&(_D(0,Ni,3,3,"p",16),Xc(1,"ul"),xD(2,Fi,3,5,"li",null,yn),el()),i&2){let e=l.$implicit,t=HD(3);MD(t.subjectGroups().length>1?0:-1),gI(2),AD(e.tokens);}}function Vi(i,l){if(i&1&&(Xc(0,"div",9)(1,"h5",15),Iw(2),Pw(3,"transloco"),el(),xD(4,Pi,4,1,null,null,Mi),el()),i&2){let e=HD(2);gI(2),Fh(" ",Fw(3,2,"step-list.availableParameters.subject")," (",e.subjectTypeHeading(),") "),gI(2),AD(e.subjectGroups());}}function Ai(i,l){i&1&&(Xc(0,"p",11),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.noPrevious")," "));}function $i(i,l){i&1&&(Xc(0,"span",19),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.loopOverwrite")," "));}function Bi(i,l){i&1&&(Xc(0,"p",5),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),Lh(Fw(2,1,"step-list.availableParameters.missingId")));}function Di(i,l){if(i&1){let e=FD();Xc(0,"button",14),yh("click",function(){let n=Fu(e).$implicit,o=HD(5);return ju(o.copyToken(n))}),Iw(1),el();}if(i&2){let e=l.$implicit,t=HD(5);Sh("copied",t.copiedToken()===e),ch("data-testid","copy-token")("data-token",e),gI(),rl$1(" ",e," ");}}function Li(i,l){if(i&1&&(Xc(0,"div",20),xD(1,Di,2,5,"button",25,ND),el()),i&2){let e=HD().$implicit;gI(),AD(e.tokens);}}function Oi(i,l){if(i&1&&(Xc(0,"p",21),Iw(1),Pw(2,"transloco"),el()),i&2){let e=HD().$implicit;gI(),rl$1(" ",jw(2,1,"step-list.availableParameters.providerOpaque",Aw(4,yi,e.actionLabel))," ");}}function Wi(i,l){i&1&&(Xc(0,"p",21),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.interactionOpaque")," "));}function ji(i,l){if(i&1&&(Xc(0,"p",22),Iw(1),Pw(2,"transloco"),el()),i&2){let e=HD().$implicit,t=HD(3);gI(),rl$1(" ",jw(2,1,"step-list.availableParameters.arrayOf",Aw(4,zi,t.arrayFields(e)))," ");}}function Ri(i,l){i&1&&(Xc(0,"p",23),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.subjectTypeUnion")," "));}function Ki(i,l){i&1&&(Xc(0,"p",24),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.noOutput")," "));}function Hi(i,l){if(i&1&&(Xc(0,"li",17),Pw(1,"transloco"),Xc(2,"div",18)(3,"span",13),Iw(4),el(),_D(5,$i,3,3,"span",19),el(),_D(6,Bi,3,3,"p",5),_D(7,Li,3,0,"div",20),_D(8,Oi,3,6,"p",21),_D(9,Wi,3,3,"p",21),_D(10,ji,3,6,"p",22),_D(11,Ri,3,3,"p",23),_D(12,Ki,3,3,"p",24),el()),i&2){let e=l.$implicit;ch("data-testid","previous-step-"+e.id)("title",e.inLoop?Fw(1,11,"step-list.availableParameters.loopOverwrite"):null),gI(4),Lh(e.name||e.id),gI(),MD(e.inLoop?5:-1),gI(),MD(e.id?-1:6),gI(),MD(e.tokens.length>0?7:-1),gI(),MD(e.shape.opaque&&e.isProvider?8:-1),gI(),MD(e.shape.opaque&&e.isInteraction?9:-1),gI(),MD(e.shape.isArray&&(e.shape.fields?.length??0)>0?10:-1),gI(),MD(e.shape.fieldsDependOnSubjectType?11:-1),gI(),MD(!e.shape.opaque&&(e.shape.fields?.length??0)===0&&!e.shape.isScalar?12:-1);}}function qi(i,l){if(i&1&&(Xc(0,"ul",12),xD(1,Hi,13,13,"li",17,Ei),el()),i&2){let e=HD(2);gI(),AD(e.previousEntries());}}function Gi(i,l){if(i&1&&(Xc(0,"div",4)(1,"p",5),Iw(2),Pw(3,"transloco"),el(),Xc(4,"p",6),Iw(5),Pw(6,"transloco"),el(),_D(7,ki,3,3,"p",7),_D(8,Ii,7,3,"div",8),_D(9,Vi,6,4,"div",9),Xc(10,"div",10)(11,"h5"),Iw(12),Pw(13,"transloco"),el(),_D(14,Ai,3,3,"p",11)(15,qi,3,0,"ul",12),el()()),i&2){let e=HD();gI(2),Lh(Fw(3,7,"step-list.availableParameters.hint")),gI(3),rl$1(" ",Fw(6,9,"step-list.availableParameters.condition")," "),gI(2),MD(e.currentStepType()==="sub_workflow"?7:-1),gI(),MD(e.inputEntries().length>0?8:-1),gI(),MD(e.subjectGroups().length>0?9:-1),gI(3),Lh(Fw(13,11,"step-list.availableParameters.previous")),gI(2),MD(e.previousEntries().length===0?14:15);}}var zn=(()=>{class i{constructor(){this.transloco=C(Ve),this.inputSchema=q0([]),this.appliesTo=q0("none"),this.previousSteps=q0([]),this.currentStepType=q0(null),this.expanded=qo$1(false),this.copiedToken=qo$1(null),this.inputEntries=Uw(()=>this.inputSchema().map(e=>({label:e.label.trim()||e.name,name:e.name.trim()})).filter(e=>e.name.length>0).map(e=>({label:e.label,token:nm(e.name)}))),this.subjectGroups=Uw(()=>J_(this.appliesTo()).map(e=>({subjectType:e.subjectType,typeKey:`workflow-editor.subjectType.${e.subjectType}`,tokens:e.fields.map(t=>({field:t,token:nm(`subject.${t}`)}))}))),this.previousEntries=Uw(()=>this.previousSteps().map(({step:e,inLoop:t})=>{let n=e;return {name:n.name,id:n.id,inLoop:t,shape:zg(n,this.appliesTo()),tokens:F_(n,this.appliesTo()),actionLabel:Ui(n),isProvider:n.type==="provider_action",isInteraction:n.type==="interaction"}}));}toggleExpanded(){this.expanded.update(e=>!e);}subjectTypeHeading(){return this.subjectGroups().map(e=>this.transloco.translate(e.typeKey)).join(", ")}arrayFields(e){return (e.shape.fields??[]).join(", ")}copyToken(e){let t=navigator.clipboard;if(!t?.writeText){this.copiedToken.set(e);return}t.writeText(e).then(()=>this.copiedToken.set(e),()=>this.copiedToken.set(e));}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-available-parameters"]],inputs:{inputSchema:[1,"inputSchema"],appliesTo:[1,"appliesTo"],previousSteps:[1,"previousSteps"],currentStepType:[1,"currentStepType"]},decls:8,vars:8,consts:[["data-testid","available-parameters",1,"available-parameters"],["type","button","data-testid","available-parameters-toggle",1,"panel-toggle",3,"click"],["aria-hidden","true",1,"chevron"],[1,"panel-title"],["data-testid","available-parameters-body",1,"panel-body"],[1,"hint"],["data-testid","step-condition-note",1,"hint"],["data-testid","sub-workflow-foreach-note",1,"hint"],["data-testid","available-parameters-inputs",1,"group"],["data-testid","available-parameters-subject",1,"group"],["data-testid","available-parameters-previous",1,"group"],["data-testid","available-parameters-no-previous",1,"hint"],[1,"previous-list"],[1,"entry-label"],["type","button",1,"param-token",3,"click"],["data-testid","available-parameters-subject-heading"],[1,"subject-type"],[1,"previous-entry"],[1,"previous-heading"],["data-testid","loop-overwrite-note",1,"loop-note"],[1,"token-row"],["data-testid","opaque-note",1,"hint"],["data-testid","array-note",1,"hint"],["data-testid","subject-type-union-note",1,"hint"],["data-testid","no-output-note",1,"hint"],["type","button",1,"param-token",3,"copied"]],template:function(t,n){t&1&&(Xc(0,"section",0)(1,"button",1),yh("click",function(){return n.toggleExpanded()}),Xc(2,"span",2),Iw(3),el(),Xc(4,"span",3),Iw(5),Pw(6,"transloco"),el()(),_D(7,Gi,16,13,"div",4),el()),t&2&&(Sh("expanded",n.expanded()),gI(),ch("aria-expanded",n.expanded()),gI(2),Lh(n.expanded()?"\u25BE":"\u25B8"),gI(2),Lh(Fw(6,6,"step-list.availableParameters.title")),gI(2),MD(n.expanded()?7:-1));},dependencies:[Kt],styles:[".available-parameters[_ngcontent-%COMP%]{margin:.85rem 0 .25rem;padding:.35rem .65rem;border:1px solid #e7e5e4;border-radius:.5rem;background:#fafaf9}.available-parameters.expanded[_ngcontent-%COMP%]{padding:.65rem .75rem .75rem}.panel-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;width:100%;margin:0;padding:.2rem 0;border:0;background:transparent;cursor:pointer;text-align:left;color:inherit}.chevron[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem;width:.9rem}.available-parameters[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:0 0 .35rem}.panel-title[_ngcontent-%COMP%]{font-size:.95rem;font-weight:600}.panel-body[_ngcontent-%COMP%]{margin-top:.5rem}.available-parameters[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{font-size:.8rem;text-transform:uppercase;letter-spacing:.03em;color:#57534e}.hint[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:.8rem;color:#78716c}.group[_ngcontent-%COMP%]{margin-top:.65rem}.group[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.35rem .5rem}.previous-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem}.previous-entry[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.3rem}.previous-heading[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem .65rem;align-items:baseline}.entry-label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:600;color:#44403c}.loop-note[_ngcontent-%COMP%]{font-size:.75rem;color:#78716c}.subject-type[_ngcontent-%COMP%]{margin:.35rem 0 .2rem;font-size:.8rem;color:#57534e}.token-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem}.param-token[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.75rem;line-height:1.2;padding:.15rem .45rem;border:1px solid #d6d3d1;border-radius:.3rem;background:#fff;color:#1c1917;cursor:pointer}.param-token[_ngcontent-%COMP%]:hover{border-color:#a8a29e}.param-token.copied[_ngcontent-%COMP%]{border-color:#57534e;background:#e7e5e4}"]});}}return i})();function Ui(i){return i.type!=="provider_action"?"":i.extendedAction?.actionId??i.action}function Ji(i,l){if(i&1&&(uh(0,"nz-option",3),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD();lh("nzValue",e)("nzLabel",Fw(1,2,t.typeKey(e)));}}function Zi(i,l){if(i&1){let e=FD();_i$1(0,"label",1)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"input",4),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.setValue(n))}),Jc(),iE(),Jc();}if(i&2){let e=HD();gI(2),Lh(Fw(3,3,"step-list.fieldCondition.value")),gI(2),lh("ngModel",e.valueText()),ch("data-testid",e.testIdPrefix()+"-value"),aE();}}var Qi=["field_empty","field_equals"],Mn=(()=>{class i{constructor(){this.condition=q0.required(),this.testIdPrefix=q0("field-condition"),this.conditionChange=U0(),this.conditionTypes=Qi;}typeKey(e){return `step-list.untilType.${e}`}valueText(){let e=this.condition();return e.type!=="field_equals"?"":Xi(e.value)}setType(e){let t=this.condition();if(e==="field_empty"){this.conditionChange.emit({type:e,stepId:t.stepId,field:t.field});return}let n=t.type==="field_equals"?t.value:"";this.conditionChange.emit({type:e,stepId:t.stepId,field:t.field,value:n});}setField(e,t){this.conditionChange.emit(s(r$1({},this.condition()),{[e]:t}));}setValue(e){let t=this.condition();t.type==="field_equals"&&this.conditionChange.emit(s(r$1({},t),{value:Yi(e)}));}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-field-condition-editor"]],inputs:{condition:[1,"condition"],testIdPrefix:[1,"testIdPrefix"]},outputs:{conditionChange:"conditionChange"},decls:19,vars:17,consts:[[1,"field-grid"],[1,"field"],[3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["nz-input","",3,"ngModelChange","ngModel"]],template:function(t,n){t&1&&(_i$1(0,"div",0)(1,"div",1)(2,"span"),Iw(3),Pw(4,"transloco"),Jc(),_i$1(5,"nz-select",2),mh("ngModelChange",function(d){return n.setType(d)}),xD(6,Ji,2,4,"nz-option",3,ND),Jc(),iE(),Jc(),_i$1(8,"label",1)(9,"span"),Iw(10),Pw(11,"transloco"),Jc(),_i$1(12,"input",4),mh("ngModelChange",function(d){return n.setField("stepId",d)}),Jc(),iE(),Jc(),_i$1(13,"label",1)(14,"span"),Iw(15),Pw(16,"transloco"),Jc(),_i$1(17,"input",4),mh("ngModelChange",function(d){return n.setField("field",d)}),Jc(),iE(),Jc(),_D(18,Zi,5,5,"label",1),Jc()),t&2&&(ch("data-testid",n.testIdPrefix()),gI(3),Lh(Fw(4,11,"step-list.fieldCondition.type")),gI(2),lh("ngModel",n.condition().type),ch("data-testid",n.testIdPrefix()+"-type"),aE(),gI(),AD(n.conditionTypes),gI(4),Lh(Fw(11,13,"step-list.fieldCondition.stepId")),gI(2),lh("ngModel",n.condition().stepId),ch("data-testid",n.testIdPrefix()+"-stepId"),aE(),gI(3),Lh(Fw(16,15,"step-list.fieldCondition.field")),gI(2),lh("ngModel",n.condition().field),ch("data-testid",n.testIdPrefix()+"-field"),aE(),gI(),MD(n.condition().type==="field_equals"?18:-1));},dependencies:[al,er$1,rl,$i$1,ai$1,z,ex,Fm,Am,Kt],styles:[".field-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));gap:.5rem 1rem}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.65rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}"]});}}return i})();function En(){return {type:"field_empty",stepId:"",field:""}}function Yi(i){let l=i.trim();if(l==="")return "";try{return JSON.parse(l)}catch(e){return i}}function Xi(i){if(i===void 0)return "";if(typeof i=="string")try{return JSON.parse(i),JSON.stringify(i)}catch(l){return i}return JSON.stringify(i)}function eo(i,l){if(i&1){let e=FD();_i$1(0,"div",1)(1,"input",3),Hh("ngModelChange",function(n){let o=Fu(e).$implicit;return Tw(o.key,n)||(o.key=n),ju(n)}),mh("ngModelChange",function(){Fu(e);let n=HD();return ju(n.emitRows())}),Jc(),iE(),_i$1(2,"input",4),Hh("ngModelChange",function(n){let o=Fu(e).$implicit;return Tw(o.value,n)||(o.value=n),ju(n)}),mh("ngModelChange",function(){Fu(e);let n=HD();return ju(n.emitRows())}),Jc(),iE(),_i$1(3,"button",5),mh("click",function(){let n=Fu(e).$index,o=HD();return ju(o.remove(n))}),Iw(4,"Remove"),Jc()();}if(i&2){let e=l.$implicit;gI(),Vh("ngModel",e.key),aE(),gI(),Vh("ngModel",e.value),aE();}}var Nn=(()=>{class i{constructor(){this.rows=W0.required();}add(){this.rows.update(e=>[...e,{key:"",value:""}]);}remove(e){this.rows.update(t=>t.filter((n,o)=>o!==e));}emitRows(){this.rows.set(this.rows().map(e=>r$1({},e)));}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-key-value-editor"]],inputs:{rows:[1,"rows"]},outputs:{rows:"rowsChange"},decls:5,vars:0,consts:[[1,"kv-editor"],[1,"kv-row"],["nz-button","","nzType","dashed","type","button",3,"click"],["nz-input","","placeholder","key",3,"ngModelChange","ngModel"],["nz-input","","placeholder","value",3,"ngModelChange","ngModel"],["nz-button","","nzType","default","type","button",3,"click"]],template:function(t,n){t&1&&(_i$1(0,"div",0),xD(1,eo,5,2,"div",1,SD),_i$1(3,"button",2),mh("click",function(){return n.add()}),Iw(4,"Add param"),Jc()()),t&2&&(gI(),AD(n.rows()));},dependencies:[al,er$1,rl,$i$1,pf,bd,sp,fp,ai$1,z],styles:[".kv-editor[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.kv-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr auto;gap:.5rem;align-items:center}"]});}}return i})();function $e(i,l){let e=Uu(i);return L(l,e).map(t=>t.id)}function Pn(i,l){return $e(i,l)[0]??""}function Fn(i,l,e){let t=$e(l,e);if(t.includes(i))return null;let n=(e?.providerInstances??[]).find(o=>o.id===i);return n?j_(n)&&Uu(l).includes(n.subjectType)?null:{required:i,active:t[0]??n.id}:{required:i,active:t[0]??""}}function Vn(i,l,e){if(i.extendedAction?.providerId){let t=Fn(i.extendedAction.providerId,l,e);if(t)return t}return i.target?.source?Fn(i.target.source,i.target.subjectType,e):null}function An(i){return i.extendedAction!=null}var $n=()=>[];function io(i,l){return this.trackKey(l)}var he=(i,l)=>l.id,oo=(i,l)=>l.actionId,ro=(i,l)=>l.name;function ao(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(3);lh("nzValue",e)("nzLabel",Fw(1,2,t.stepTypeKey(e)));}}function so(i,l){if(i&1){let e=FD();_i$1(0,"app-field-condition-editor",24),mh("conditionChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{condition:n}))}),Jc();}if(i&2){let e=HD(2).$index;lh("condition",l)("testIdPrefix","step-condition-"+e);}}function lo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.outputFormatKey(e)));}}function po(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function co(i,l){if(i&1){let e=FD();_i$1(0,"nz-tag",31),mh("nzOnClose",function(){let n=Fu(e).$implicit,o=HD(3).$index,d=HD();return ju(d.removeContextFile(o,n.id))}),Iw(1),Jc();}if(i&2){let e=l.$implicit;ch("data-testid","context-file-chip-"+e.id),gI(),rl$1(" ",e.name," ");}}function _o(i,l){i&1&&(_i$1(0,"span",29),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"step-list.contextFilesEmpty")));}function mo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"textarea",25),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{objective:n}))}),Jc(),iE(),Jc(),_i$1(5,"div",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{outputFormat:n}))}),xD(10,lo,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(12,"div",16)(13,"span"),Iw(14),Pw(15,"transloco"),Jc(),_i$1(16,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setAgentInstance(o,n))}),uh(17,"nz-option",15),Pw(18,"transloco"),xD(19,po,1,2,"nz-option",15,he),Jc(),iE(),Jc(),_i$1(21,"div",16)(22,"span"),Iw(23),Pw(24,"transloco"),Jc(),_i$1(25,"div",27),xD(26,co,2,2,"nz-tag",28,he,false,_o,3,3,"span",29),Jc(),_i$1(29,"button",30),mh("click",function(){Fu(e);let n=HD(2).$index,o=HD();return ju(o.openContextFilePicker(n))}),Iw(30),Pw(31,"transloco"),Jc()();}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(),ch("data-testid","agent-prompt-label-"+n),gI(),Lh(Fw(3,17,"step-list.objective")),gI(2),lh("ngModel",o.asAgent(t).objective),ch("data-testid","agent-objective-"+n),aE(),gI(3),Lh(Fw(8,19,"step-list.outputFormat.label")),gI(2),lh("ngModel",o.asAgent(t).outputFormat),ch("data-testid","agent-output-"+n),aE(),gI(),AD(o.outputFormats),gI(4),Lh(Fw(15,21,"step-list.agentInstance.label")),gI(2),lh("ngModel",o.asAgent(t).agentInstanceId??null),ch("data-testid","agent-instance-"+n),aE(),gI(),lh("nzValue",null)("nzLabel",Fw(18,23,"step-list.agentInstance.default")),gI(2),AD(o.agentInstanceOptions()),gI(2),ch("data-testid","agent-context-files-"+n),gI(2),Lh(Fw(24,25,"step-list.contextFiles")),gI(3),AD(o.selectedContextFiles(o.asAgent(t))),gI(3),ch("data-testid","select-context-files-"+n),gI(),rl$1(" ",Fw(31,27,"step-list.selectContextFiles")," ");}}function uo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.interactionKey(e)));}}function Co(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e.id)("nzLabel",e.label);}}function xo(i,l){i&1&&(_i$1(0,"p",19),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"step-list.sourceStepIds.empty")));}function fo(i,l){i&1&&(_i$1(0,"p",19),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"step-list.sourceStepIds.hint")));}function go(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",32),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.patchAt(o,{sourceStepIds:n}))}),xD(5,Co,1,2,"nz-option",15,he),Jc(),iE(),_D(7,xo,3,3,"p",19)(8,fo,3,3,"p",19),Jc();}if(i&2){let e=HD(3),t=e.$implicit,n=e.$index,o=HD();ch("data-testid","comment-review-sources-"+n),gI(2),Lh(Fw(3,5,"step-list.sourceStepIds.label")),gI(2),lh("ngModel",o.asInteraction(t).sourceStepIds??xw(7,$n)),ch("data-testid","comment-review-source-ids-"+n),aE(),gI(),AD(o.commentSuggestionSources(t)),gI(2),MD(o.commentSuggestionSources(t).length===0?7:8);}}function ho(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.onInteractionChange(o,n))}),xD(5,uo,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_D(7,go,9,8,"div",16);}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,4,"step-list.interaction.label")),gI(2),lh("ngModel",o.asInteraction(t).interaction),ch("data-testid","interaction-type-"+n),aE(),gI(),AD(o.interactions),gI(2),MD(o.asInteraction(t).interaction==="comment_review"?7:-1);}}function bo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"textarea",25),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{command:n}))}),Jc(),iE(),Jc();}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,3,"step-list.command")),gI(2),lh("ngModel",o.asShell(t).command),ch("data-testid","shell-command-"+n),aE();}}function vo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.onNoMatchKey(e)));}}function wo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"textarea",33),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{source:n}))}),Jc(),iE(),Jc(),_i$1(5,"label",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{path:n}))}),Jc(),iE(),Jc(),_i$1(10,"label",16)(11,"span"),Iw(12),Pw(13,"transloco"),Jc(),_i$1(14,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{pattern:n}))}),Jc(),iE(),Jc(),_i$1(15,"div",16)(16,"span"),Iw(17),Pw(18,"transloco"),Jc(),_i$1(19,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{onNoMatch:n}))}),xD(20,vo,2,4,"nz-option",15,ND),Jc(),iE(),Jc();}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,12,"step-list.extract.source")),gI(2),lh("ngModel",o.asExtract(t).source),ch("data-testid","extract-source-"+n),aE(),gI(3),Lh(Fw(8,14,"step-list.extract.path")),gI(2),lh("ngModel",o.asExtract(t).path??""),ch("data-testid","extract-path-"+n),aE(),gI(3),Lh(Fw(13,16,"step-list.extract.pattern")),gI(2),lh("ngModel",o.asExtract(t).pattern??""),ch("data-testid","extract-pattern-"+n),aE(),gI(3),Lh(Fw(18,18,"step-list.extract.onNoMatch")),gI(2),lh("ngModel",o.asExtract(t).onNoMatch),ch("data-testid","extract-on-no-match-"+n),aE(),gI(),AD(o.extractOnNoMatchActions);}}function So(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.gitOperationKey(e)));}}function yo(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"app-repo-path-picker",38),mh("pathChange",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.setGitParam(o,"repoPath",n))})("repoSelected",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.applyCreateWorktreeCatalogRepo(o,n))}),Jc()();}if(i&2){let e=HD(4),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,3,"step-list.createWorktree.repoPath")),gI(2),lh("path",o.gitParam(o.asGit(t),"repoPath")),ch("data-testid","git-repo-path-"+n);}}function zo(i,l){if(i&1&&(_i$1(0,"p",19),Iw(1),Pw(2,"transloco"),Jc()),i&2){let e=HD(4).$index;ch("data-testid","git-resolve-from-pr-hint-"+e),gI(),rl$1(" ",Fw(2,2,"step-list.createWorktree.resolveFromPrHint")," ");}}function Mo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.setGitParam(o,"baseBranch",n))}),Jc(),iE(),Jc(),_i$1(5,"label",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.setGitParam(o,"branchName",n))}),Jc(),iE(),Jc();}if(i&2){let e=HD(4),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,6,"step-list.createWorktree.baseBranch")),gI(2),lh("ngModel",o.gitParam(o.asGit(t),"baseBranch")),ch("data-testid","git-base-branch-"+n),aE(),gI(3),Lh(Fw(8,8,"step-list.createWorktree.branchName")),gI(2),lh("ngModel",o.gitParam(o.asGit(t),"branchName")),ch("data-testid","git-branch-name-"+n),aE();}}function Eo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.setGitParam(o,"branch",n))}),Jc(),iE(),Jc();}if(i&2){let e=HD(4),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,3,"step-list.createWorktree.branch")),gI(2),lh("ngModel",o.gitParam(o.asGit(t),"branch")),ch("data-testid","git-branch-"+n),aE();}}function ko(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setCreateWorktreeMode(o,n))}),uh(5,"nz-option",34),Pw(6,"transloco"),uh(7,"nz-option",35),Pw(8,"transloco"),Jc(),iE(),Jc(),_i$1(9,"div",16)(10,"span"),Iw(11),Pw(12,"transloco"),Jc(),_i$1(13,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setCreateWorktreeRepoSource(o,n))}),uh(14,"nz-option",36),Pw(15,"transloco"),uh(16,"nz-option",37),Pw(17,"transloco"),Jc(),iE(),Jc(),_D(18,yo,5,5,"div",16)(19,zo,3,4,"p",19),_D(20,Mo,10,10)(21,Eo,5,5,"label",16);}if(i&2){let e=HD(3),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,12,"step-list.createWorktree.mode")),gI(2),lh("ngModel",o.createWorktreeMode(o.asGit(t))),ch("data-testid","git-worktree-mode-"+n),aE(),gI(),lh("nzLabel",Fw(6,14,"step-list.createWorktree.newBranch")),gI(2),lh("nzLabel",Fw(8,16,"step-list.createWorktree.existingBranch")),gI(4),Lh(Fw(12,18,"step-list.createWorktree.repoSource")),gI(2),lh("ngModel",o.createWorktreeRepoSource(o.asGit(t))),ch("data-testid","git-worktree-repo-source-"+n),aE(),gI(),lh("nzLabel",Fw(15,20,"step-list.createWorktree.repoPathPick")),gI(2),lh("nzLabel",Fw(17,22,"step-list.createWorktree.resolveFromPr")),gI(2),MD(o.createWorktreeRepoSource(o.asGit(t))==="path"?18:19),gI(2),MD(o.createWorktreeMode(o.asGit(t))==="new-branch"?20:21);}}function To(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"app-key-value-editor",39),mh("rowsChange",function(n){Fu(e);let o=HD(3),d=o.$implicit,T=o.$index,J=HD();return ju(J.onParamRowsChange(T,d,n))}),Jc()();}if(i&2){let e=HD(3).$implicit,t=HD();gI(2),Lh(Fw(3,2,"step-list.params")),gI(2),lh("rows",t.paramRows(e));}}function Io(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{operation:n}))}),xD(5,So,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_D(7,ko,22,24)(8,To,5,4,"div",16);}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,4,"step-list.operation")),gI(2),lh("ngModel",o.asGit(t).operation),ch("data-testid","git-operation-"+n),aE(),gI(),AD(o.gitOperations),gI(2),MD(o.asGit(t).operation==="create_worktree"?7:8);}}function No(i,l){if(i&1&&uh(0,"nz-alert",40),i&2){let e=HD(3).$index;lh("nzMessage",l),ch("data-testid","extended-action-mismatch-"+e);}}function Fo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(5);lh("nzValue",e)("nzLabel",Fw(1,2,t.subjectTypeKey(e)));}}function Po(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function Vo(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setTargetSubjectType(o,n))}),xD(5,Fo,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"nz-select",43),Pw(12,"transloco"),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setTargetSource(o,n))}),xD(13,Po,1,2,"nz-option",15,he),Jc(),iE(),Jc(),_i$1(15,"label",16)(16,"span"),Iw(17),Pw(18,"transloco"),Jc(),_i$1(19,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setTargetSubjectId(o,n))}),Jc(),iE(),_i$1(20,"span",19),Iw(21),Pw(22,"transloco"),Jc()();}if(i&2){let e=l,t=HD(3),n=t.$implicit,o=t.$index,d=HD();gI(2),Lh(Fw(3,11,"step-list.target.subjectType")),gI(2),lh("ngModel",e.subjectType),ch("data-testid","provider-action-target-type-"+o),aE(),gI(),AD(d.targetSubjectTypes),gI(4),Lh(Fw(10,13,"step-list.target.source")),gI(2),lh("ngModel",e.source||null)("nzPlaceHolder",Fw(12,15,"step-list.target.sourcePlaceholder")),ch("data-testid","provider-action-target-source-"+o),aE(),gI(2),AD(d.targetInstanceOptions(d.asProvider(n))),gI(4),Lh(Fw(18,17,"step-list.target.subjectId")),gI(2),lh("ngModel",e.subjectId),ch("data-testid","provider-action-target-id-"+o),aE(),gI(2),Lh(Fw(22,19,"step-list.target.subjectIdHint"));}}function Ao(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit,t=HD(5);lh("nzValue",e)("nzLabel",t.providerLabel(e));}}function $o(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e.actionId)("nzLabel",e.label);}}function Bo(i,l){i&1&&(_i$1(0,"span",19),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"step-list.extendedAction.empty")));}function Do(i,l){i&1&&(_i$1(0,"span",44),Iw(1,"*"),Jc());}function Lo(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e)("nzLabel",e);}}function Oo(i,l){if(i&1){let e=FD();_i$1(0,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD().$implicit,d=HD(5).$index,T=HD();return ju(T.setExtendedParam(d,o.name,n))}),xD(1,Lo,1,2,"nz-option",15,ND),Jc(),iE();}if(i&2){let e=HD().$implicit,t=HD(5),n=t.$implicit,o=t.$index,d=HD();lh("ngModel",d.extendedParamValue(d.asProvider(n),e.name)),ch("data-testid","extended-action-param-"+e.name+"-"+o),aE(),gI(),AD(e.options??xw(2,$n));}}function Wo(i,l){if(i&1){let e=FD();_i$1(0,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD().$implicit,d=HD(5).$index,T=HD();return ju(T.setExtendedParam(d,o.name,n))}),Jc(),iE();}if(i&2){let e=HD().$implicit,t=HD(5),n=t.$implicit,o=t.$index,d=HD();lh("ngModel",d.extendedParamValue(d.asProvider(n),e.name)),ch("data-testid","extended-action-param-"+e.name+"-"+o),aE();}}function jo(i,l){if(i&1&&(_i$1(0,"label",16)(1,"span"),Iw(2),_D(3,Do,2,0,"span",44),Jc(),_D(4,Oo,3,3,"nz-select",45)(5,Wo,1,2,"input",46),Jc()),i&2){let e=l.$implicit;gI(2),rl$1(" ",e.label," "),gI(),MD(e.required?3:-1),gI(),MD(e.type==="select"?4:5);}}function Ro(i,l){i&1&&xD(0,jo,6,3,"label",16,ro),i&2&&AD(l.params);}function Ko(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setExtendedProvider(o,n))}),xD(5,Ao,1,2,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"nz-select",43),Pw(12,"transloco"),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setExtendedAction(o,n))}),xD(13,$o,1,2,"nz-option",15,oo),Jc(),iE(),_D(15,Bo,3,3,"span",19),Jc(),_D(16,Ro,2,0);}if(i&2){let e,t=HD(3),n=t.$implicit,o=t.$index,d=HD();gI(2),Lh(Fw(3,9,"step-list.extendedAction.provider")),gI(2),lh("ngModel",d.asProvider(n).extendedAction?.providerId),ch("data-testid","extended-action-provider-"+o),aE(),gI(),AD(d.extendedProviderOptions()),gI(4),Lh(Fw(10,11,"step-list.extendedAction.action")),gI(2),lh("ngModel",d.asProvider(n).extendedAction?.actionId||null)("nzPlaceHolder",Fw(12,13,"step-list.extendedAction.none")),ch("data-testid","extended-action-id-"+o),aE(),gI(2),AD(d.extendedDescriptors(d.asProvider(n))),gI(2),MD(d.extendedDescriptors(d.asProvider(n)).length===0?15:-1),gI(),MD((e=d.selectedExtendedDescriptor(d.asProvider(n)))?16:-1,e);}}function Ho(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(5);lh("nzValue",e)("nzLabel",Fw(1,2,t.providerActionKey(e)));}}function qo(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.patchAt(o,{action:n}))}),xD(5,Ho,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"app-key-value-editor",39),mh("rowsChange",function(n){Fu(e);let o=HD(3),d=o.$implicit,T=o.$index,J=HD();return ju(J.onParamRowsChange(T,d,n))}),Jc()();}if(i&2){let e=HD(3),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,5,"step-list.action")),gI(2),lh("ngModel",o.asProvider(t).action),ch("data-testid","provider-action-"+n),aE(),gI(),AD(o.providerActions),gI(4),Lh(Fw(10,7,"step-list.params")),gI(2),lh("rows",o.paramRows(t));}}function Go(i,l){if(i&1){let e=FD();_D(0,No,1,2,"nz-alert",40),_i$1(1,"label",22),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setTargetEnabled(o,n))}),Iw(2),Pw(3,"transloco"),Jc(),iE(),_D(4,Vo,23,21),_i$1(5,"div",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setActionMode(o,n))}),uh(10,"nz-option",41),Pw(11,"transloco"),uh(12,"nz-option",42),Pw(13,"transloco"),Jc(),iE(),Jc(),_D(14,Ko,17,15)(15,qo,12,9);}if(i&2){let e,t,n=HD(2),o=n.$implicit,d=n.$index,T=HD();MD((e=T.mismatchWarning(T.asProvider(o)))?0:-1,e),gI(),lh("ngModel",T.hasTarget(o)),ch("data-testid","provider-action-target-toggle-"+d),aE(),gI(),rl$1(" ",Fw(3,11,"step-list.target.toggle")," "),gI(2),MD((t=T.asProvider(o).target)?4:-1,t),gI(3),Lh(Fw(8,13,"step-list.extendedAction.mode")),gI(2),lh("ngModel",T.isExtended(o)?"extended":"portable"),ch("data-testid","provider-action-mode-"+d),aE(),gI(),lh("nzLabel",Fw(11,15,"step-list.extendedAction.portable")),gI(2),lh("nzLabel",Fw(13,17,"step-list.extendedAction.extended")),gI(2),MD(T.isExtended(o)?14:15);}}function Uo(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e.id)("nzLabel",t.workflowOptionLabel(e));}}function Jo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setSubWorkflowSource(o,n))}),Jc(),iE(),_i$1(5,"p",19),Iw(6),Pw(7,"transloco"),Jc()();}if(i&2){let e=HD(3),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,4,"step-list.forEach.sourcePath")),gI(2),lh("ngModel",o.subWorkflowSource(t)),ch("data-testid","sub-workflow-foreach-source-"+n),aE(),gI(2),Lh(Fw(7,6,"step-list.forEach.sourceHint"));}}function Zo(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",47),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{workflowId:n}))}),xD(5,Uo,1,2,"nz-option",15,he),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setSubWorkflowForEachMode(o,n))}),uh(12,"nz-option",48),Pw(13,"transloco"),uh(14,"nz-option",49),Pw(15,"transloco"),Jc(),iE(),Jc(),_D(16,Jo,8,8,"label",16);}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,9,"step-list.workflowId")),gI(2),lh("ngModel",o.asSubWorkflow(t).workflowId),ch("data-testid","sub-workflow-id-"+n),aE(),gI(),AD(o.childWorkflowOptions(t)),gI(4),Lh(Fw(10,11,"step-list.forEach")),gI(2),lh("ngModel",o.subWorkflowForEachMode(t)),ch("data-testid","sub-workflow-foreach-mode-"+n),aE(),gI(),lh("nzLabel",Fw(13,13,"step-list.forEach.selection")),gI(2),lh("nzLabel",Fw(15,15,"step-list.forEach.source")),gI(2),MD(o.subWorkflowForEachMode(t)==="source"?16:-1);}}function Qo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.onMaxIterationsKey(e)));}}function Yo(i,l){if(i&1){let e=FD();_i$1(0,"app-field-condition-editor",24),mh("conditionChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{until:n}))}),Jc(),_i$1(1,"div",50)(2,"label",16)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i$1(6,"nz-input-number",51),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{maxIterations:n??0}))}),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{onMaxIterations:{action:n}}))}),xD(12,Qo,2,4,"nz-option",15,ND),Jc(),iE(),Jc()(),_i$1(14,"div",52)(15,"h4"),Iw(16),Pw(17,"transloco"),Jc(),_i$1(18,"app-step-list",53),mh("stepsChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setNestedSteps(o,n))}),Jc()();}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();lh("condition",o.asLoop(t).until)("testIdPrefix","loop-until-"+n),gI(4),Lh(Fw(5,18,"step-list.maxIterations")),gI(2),lh("ngModel",o.asLoop(t).maxIterations)("nzMin",0),ch("data-testid","loop-max-"+n),aE(),gI(3),Lh(Fw(10,20,"step-list.onMaxIterations.action")),gI(2),lh("ngModel",o.asLoop(t).onMaxIterations.action),ch("data-testid","loop-on-max-"+n),aE(),gI(),AD(o.maxIterationActions),gI(2),ch("data-testid","loop-nested-"+n),gI(2),Lh(Fw(17,22,"step-list.nestedSteps")),gI(2),lh("steps",o.asLoop(t).steps)("rootSteps",o.effectiveRoot())("availableWorkflows",o.availableWorkflows())("appliesTo",o.appliesTo())("inputSchema",o.inputSchema())("settings",o.settings())("depth",o.depth()+1);}}function Xo(i,l){if(i&1){let e=FD();_i$1(0,"div",12)(1,"div",13)(2,"nz-select",14),mh("ngModelChange",function(n){Fu(e);let o=HD().$index,d=HD();return ju(d.changeType(o,n))}),xD(3,ao,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(5,"label",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"input",17),mh("ngModelChange",function(n){Fu(e);let o=HD().$index,d=HD();return ju(d.onNameChange(o,n))}),Jc(),iE(),Jc(),_i$1(10,"label",16)(11,"span"),Iw(12),Pw(13,"transloco"),Jc(),_i$1(14,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD().$index,d=HD();return ju(d.onIdChange(o,n))}),Jc(),iE(),_i$1(15,"p",19),Iw(16),Pw(17,"transloco"),Jc()(),uh(18,"app-available-parameters",20),_i$1(19,"section",21)(20,"label",22),mh("ngModelChange",function(n){Fu(e);let o=HD().$index,d=HD();return ju(d.setConditionEnabled(o,n))}),Iw(21),Pw(22,"transloco"),Jc(),iE(),_i$1(23,"p",19),Iw(24),Pw(25,"transloco"),Jc(),_D(26,so,1,2,"app-field-condition-editor",23),Jc(),_D(27,mo,32,29)(28,ho,8,6)(29,bo,5,5,"label",16)(30,wo,22,20)(31,Io,9,6)(32,Go,16,19)(33,Zo,17,17)(34,Yo,19,24),Jc();}if(i&2){let e,t,n=HD(),o=n.$implicit,d=n.$index,T=HD();ch("data-testid","step-body-"+d),gI(2),lh("ngModel",o.type),ch("data-testid","step-type-"+d),aE(),gI(),AD(T.stepTypes),gI(4),Lh(Fw(8,21,"step-list.name")),gI(2),lh("ngModel",o.name),ch("data-testid","step-name-"+d),aE(),gI(3),Lh(Fw(13,23,"step-list.id")),gI(2),lh("ngModel",o.id),ch("data-testid","step-id-"+d),aE(),gI(2),Lh(Fw(17,25,"step-list.idHint")),gI(2),lh("inputSchema",T.inputSchema())("appliesTo",T.appliesTo())("previousSteps",T.previousFor(o))("currentStepType",o.type),gI(),ch("data-testid","step-condition-"+d),gI(),lh("ngModel",!!o.condition),ch("data-testid","step-condition-toggle-"+d),aE(),gI(),rl$1(" ",Fw(22,27,"step-list.condition.title")," "),gI(3),Lh(Fw(25,29,"step-list.condition.hint")),gI(2),MD((e=o.condition)?26:-1,e),gI(),MD((t=o.type)==="agent"?27:t==="interaction"?28:t==="shell"?29:t==="extract"?30:t==="git"?31:t==="provider_action"?32:t==="sub_workflow"?33:t==="loop"?34:-1);}}function er(i,l){if(i&1){let e=FD();_i$1(0,"nz-card",3)(1,"div",4),mh("click",function(){let n=Fu(e).$implicit,o=HD();return ju(o.toggleExpanded(n))}),_i$1(2,"div",5)(3,"span",6),Iw(4),Jc(),_i$1(5,"span",7),Iw(6),Pw(7,"transloco"),Jc(),_i$1(8,"span",8),Iw(9),Pw(10,"transloco"),Jc()(),_i$1(11,"div",9),mh("click",function(n){return n.stopPropagation()}),_i$1(12,"button",10),mh("click",function(){let n=Fu(e).$index,o=HD();return ju(o.moveUp(n))}),Iw(13),Pw(14,"transloco"),Jc(),_i$1(15,"button",10),mh("click",function(){let n=Fu(e).$index,o=HD();return ju(o.moveDown(n))}),Iw(16),Pw(17,"transloco"),Jc(),_i$1(18,"button",11),mh("click",function(){let n=Fu(e).$index,o=HD();return ju(o.removeStep(n))}),Iw(19),Pw(20,"transloco"),Jc()()(),_D(21,Xo,35,31,"div",12),Jc();}if(i&2){let e=l.$implicit,t=l.$index,n=HD();Sh("step-card-expanded",n.isExpanded(e)),ch("data-testid","step-card-"+t),gI(),ch("data-testid","step-header-"+t),gI(3),Lh(n.isExpanded(e)?"\u25BE":"\u25B8"),gI(),ch("data-testid","step-header-name-"+t),gI(),rl$1(" ",e.name||Fw(7,18,"step-list.unnamed")," "),gI(2),ch("data-testid","step-type-label-"+t),gI(),rl$1(" ",Fw(10,20,n.stepTypeKey(e.type))," "),gI(3),lh("disabled",t===0),ch("data-testid","move-up-"+t),gI(),rl$1(" ",Fw(14,22,"step-list.moveUp")," "),gI(2),lh("disabled",t===n.steps().length-1),ch("data-testid","move-down-"+t),gI(),rl$1(" ",Fw(17,24,"step-list.moveDown")," "),gI(2),ch("data-testid","remove-"+t),gI(),rl$1(" ",Fw(20,26,"step-list.remove")," "),gI(2),MD(n.isExpanded(e)?21:-1);}}var Bn=(()=>{class i{constructor(){this.transloco=C(Ve),this.language=C(O),this.providersApi=C(w),this.contextFilesApi=C(ze),this.modal=C(jn$1),this.steps=q0.required(),this.rootSteps=q0([]),this.availableWorkflows=q0([]),this.appliesTo=q0("none"),this.inputSchema=q0([]),this.settings=q0(w_),this.depth=q0(0),this.stepsChange=U0(),this.stepTypes=y,this.outputFormats=["questionnaire","confirmation","comment_suggestions","free_text"],this.interactions=["questionnaire","confirmation","comment_review"],this.gitOperations=["create_worktree","checkout","create_branch","commit","push"],this.providerActions=["get_subject","get_comments","post_comment","update_status","get_content"],this.maxIterationActions=["fail","continue","ask_human"],this.extractOnNoMatchActions=["fail","empty","ask_human"],this.expandedKey=qo$1(null),this.contextFiles=qo$1([]),this.paramRowsByStepKey=new Map,this.actionsByProvider=new Map,this.loadingActions=new Set,this.targetSubjectTypes=F,this.contextFilesApi.list().pipe(ue()).subscribe({next:e=>this.contextFiles.set(e),error:()=>this.contextFiles.set([])}),id(()=>{for(let e of this.steps())e.type==="provider_action"&&e.extendedAction?.providerId&&this.ensureActionsLoaded(e.extendedAction.providerId);});}stepTypeKey(e){return `step-list.stepType.${e}`}outputFormatKey(e){return `step-list.outputFormat.${e}`}interactionKey(e){return `step-list.interaction.${e}`}gitOperationKey(e){return `step-list.gitOperation.${e}`}providerActionKey(e){return `step-list.providerAction.${e}`}onMaxIterationsKey(e){return `step-list.onMaxIterations.${e}`}onNoMatchKey(e){return `step-list.onNoMatch.${e}`}workflowOptionLabel(e){return this.language.currentLang(),this.transloco.translate("step-list.workflowOption",{name:e.name,id:e.id})}effectiveRoot(){let e=this.rootSteps();return e.length>0?e:this.steps()}previousFor(e){return im(this.effectiveRoot(),e)}commentSuggestionSources(e){return G_(this.effectiveRoot(),e).filter(t=>!!t.id).map(t=>({id:t.id,label:t.name?.trim()?`${t.name} (${t.id})`:t.id}))}onInteractionChange(e,t){if(t==="comment_review"){let n=this.asInteraction(this.steps()[e]);this.patchAt(e,{interaction:t,sourceStepIds:n.sourceStepIds??[]});return}this.patchAt(e,{interaction:t,sourceStepIds:void 0});}trackKey(e){return e._key}isExpanded(e){return this.expandedKey()===e._key}toggleExpanded(e){this.expandedKey.update(t=>t===e._key?null:e._key);}addStep(){this.emit([...this.steps(),h("agent")]);}removeStep(e){let t=this.steps()[e];t&&this.paramRowsByStepKey.delete(t._key),this.emit(this.steps().filter((n,o)=>o!==e));}moveUp(e){if(e<=0)return;let t=[...this.steps()],n=t[e-1];t[e-1]=t[e],t[e]=n,this.emit(t);}moveDown(e){if(e>=this.steps().length-1)return;let t=[...this.steps()],n=t[e+1];t[e+1]=t[e],t[e]=n,this.emit(t);}changeType(e,t){let n=this.steps()[e];if(!n||n.type===t)return;this.paramRowsByStepKey.delete(n._key);let o=h(t,{id:n.id,name:n.name,idAutoSync:n._idAutoSync,key:n._key});this.replaceAt(e,n.condition?s(r$1({},o),{condition:n.condition}):o);}patchAt(e,t){let n=this.steps()[e];n&&this.replaceAt(e,r$1(r$1({},n),t));}onNameChange(e,t){let n=this.steps()[e];n&&this.replaceAt(e,E(n,t,this.effectiveRoot()));}onIdChange(e,t){let n=this.steps()[e];n&&this.replaceAt(e,P(n,t));}setNestedSteps(e,t){let n=this.steps()[e];!n||n.type!=="loop"||this.replaceAt(e,s(r$1({},n),{steps:t}));}asAgent(e){return e}asInteraction(e){return e}asShell(e){return e}asExtract(e){return e}asGit(e){return e}createWorktreeMode(e){return e.params?.mode==="existing-branch"?"existing-branch":"new-branch"}createWorktreeRepoSource(e){return e.params?.resolveRepoFromSubject===true?"from-pr":"path"}gitParam(e,t){let n=e.params?.[t];return typeof n=="string"?n:""}setGitParam(e,t,n){let o=this.steps()[e];!o||o.type!=="git"||(this.paramRowsByStepKey.delete(o._key),this.patchAt(e,{params:s(r$1({},o.params),{[t]:n})}));}applyCreateWorktreeCatalogRepo(e,t){let n=this.steps()[e];if(!n||n.type!=="git")return;this.paramRowsByStepKey.delete(n._key);let o=s(r$1({},n.params),{repoPath:t.localPath});delete o.resolveRepoFromSubject;let d=this.gitParam(n,"baseBranch").trim(),T=t.defaultBranch?.trim();!d&&T&&(o.baseBranch=T),this.patchAt(e,{params:o});}setCreateWorktreeRepoSource(e,t){let n=this.steps()[e];if(!n||n.type!=="git")return;this.paramRowsByStepKey.delete(n._key);let o=r$1({},n.params);t==="from-pr"?(o.resolveRepoFromSubject=true,delete o.repoPath):delete o.resolveRepoFromSubject,this.patchAt(e,{params:o});}setCreateWorktreeMode(e,t){let n=this.steps()[e];if(!n||n.type!=="git")return;let o=n.params?.resolveRepoFromSubject===true,d=this.gitParam(n,"repoPath");this.paramRowsByStepKey.delete(n._key);let T=o?{resolveRepoFromSubject:true}:{repoPath:d};if(t==="existing-branch"){this.patchAt(e,{params:s(r$1({mode:"existing-branch"},T),{branch:this.gitParam(n,"branch")||this.gitParam(n,"branchName")})});return}this.patchAt(e,{params:s(r$1({},T),{baseBranch:this.gitParam(n,"baseBranch"),branchName:this.gitParam(n,"branchName")||this.gitParam(n,"branch")})});}asProvider(e){return e}asSubWorkflow(e){return e}subWorkflowForEachMode(e){return typeof this.asSubWorkflow(e).forEach=="object"?"source":"selection"}setSubWorkflowForEachMode(e,t){if(t==="selection"){this.patchAt(e,{forEach:"selection"});return}let n=this.asSubWorkflow(this.steps()[e]),o=typeof n.forEach=="object"?n.forEach.source:"";this.patchAt(e,{forEach:{source:o}});}subWorkflowSource(e){let t=this.asSubWorkflow(e).forEach;return typeof t=="object"?t.source:""}setSubWorkflowSource(e,t){this.patchAt(e,{forEach:{source:t}});}childWorkflowOptions(e){let t=this.availableWorkflows();return this.subWorkflowForEachMode(e)!=="source"?t:t.filter(n=>n.appliesTo==="none")}asLoop(e){return e}paramRows(e){let t=this.paramRowsByStepKey.get(e._key);if(!t){let n=e.type==="git"||e.type==="provider_action"?e.params:void 0;t=A(n),this.paramRowsByStepKey.set(e._key,t);}return t}onParamRowsChange(e,t,n){this.paramRowsByStepKey.set(t._key,n),this.patchAt(e,{params:j(n)});}isExtended(e){return e.type==="provider_action"&&An(this.asProvider(e))}setActionMode(e,t){let n=this.asProvider(this.steps()[e]);if(t==="portable"){let d=n,{extendedAction:T}=d,J=t$1(d,["extendedAction"]);this.replaceAt(e,J);return}let o=Pn(this.appliesTo(),this.settings());this.patchAt(e,{extendedAction:{providerId:o,actionId:"",params:{}}}),this.ensureActionsLoaded(o);}extendedProviderOptions(){return $e(this.appliesTo(),this.settings())}providerLabel(e){return (this.settings().providerInstances??[]).find(n=>n.id===e)?.displayName||e}agentInstanceOptions(){return (this.settings().providerInstances??[]).filter(e=>e.kind==="agent")}setAgentInstance(e,t){this.patchAt(e,{agentInstanceId:t||void 0});}selectedContextFiles(e){let t=e.contextFileIds??[],n=this.contextFiles();return t.map(o=>n.find(d=>d.id===o)??{id:o,name:o,tier:"user",path:""})}removeContextFile(e,t){let n=this.asAgent(this.steps()[e]);this.patchAt(e,{contextFileIds:(n.contextFileIds??[]).filter(o=>o!==t)});}openContextFilePicker(e){let t=this.asAgent(this.steps()[e]),n=this.modal.create({nzTitle:this.transloco.translate("context-files.selectTitle"),nzContent:St,nzData:{selectionMode:true,selectedIds:[...t.contextFileIds??[]]},nzWidth:800,nzOnOk:()=>{let o=n.getContentComponent();this.patchAt(e,{contextFileIds:o.currentSelectedIds()}),this.contextFilesApi.list().subscribe({next:d=>this.contextFiles.set(d)});}});}setExtendedProvider(e,t){this.patchAt(e,{extendedAction:{providerId:t,actionId:"",params:{}}}),this.ensureActionsLoaded(t);}setExtendedAction(e,t){let n=this.asProvider(this.steps()[e]),o=this.extendedDescriptors(n).find(d=>d.actionId===t);this.patchAt(e,{extendedAction:{providerId:n.extendedAction?.providerId??"",actionId:t,params:o?tr(o):{}}});}setExtendedParam(e,t,n){let d=this.asProvider(this.steps()[e]).extendedAction;d&&this.patchAt(e,{extendedAction:s(r$1({},d),{params:s(r$1({},d.params??{}),{[t]:n})})});}extendedParamValue(e,t){let n=e.extendedAction?.params?.[t];return n==null?"":String(n)}extendedDescriptors(e){let t=e.extendedAction?.providerId;return t?this.actionsByProvider.get(t)??[]:[]}selectedExtendedDescriptor(e){let t=e.extendedAction?.actionId;if(t)return this.extendedDescriptors(e).find(n=>n.actionId===t)}mismatchWarning(e){let t=Vn(e,this.appliesTo(),this.settings());return t?(this.language.currentLang(),this.transloco.translate("step-list.extendedAction.mismatch",t)):null}hasTarget(e){return e.type==="provider_action"&&this.asProvider(e).target!=null}setTargetEnabled(e,t){let n=this.asProvider(this.steps()[e]);if(!t){let o=n,{target:d}=o,T=t$1(o,["target"]);this.replaceAt(e,T);return}this.patchAt(e,{target:{subjectType:"ticket",source:"",subjectId:""}});}setTargetSubjectType(e,t){let n=this.asProvider(this.steps()[e]);this.patchAt(e,{target:{subjectType:t,source:"",subjectId:n.target?.subjectId??""}});}setTargetSource(e,t){let n=this.asProvider(this.steps()[e]);n.target&&this.patchAt(e,{target:s(r$1({},n.target),{source:t})});}setTargetSubjectId(e,t){let n=this.asProvider(this.steps()[e]);n.target&&this.patchAt(e,{target:s(r$1({},n.target),{subjectId:t})});}targetInstanceOptions(e){let t=e.target?.subjectType;return t?L(this.settings(),[t]):[]}setConditionEnabled(e,t){if(t){let n=this.steps()[e];this.patchAt(e,{condition:n?.condition??En()});return}this.patchAt(e,{condition:void 0});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}ensureActionsLoaded(e){!e||this.actionsByProvider.has(e)||this.loadingActions.has(e)||(this.loadingActions.add(e),this.providersApi.listExtendedActions(e).subscribe({next:t=>{this.loadingActions.delete(e),this.actionsByProvider.set(e,t);},error:()=>{this.loadingActions.delete(e),this.actionsByProvider.set(e,[]);}}));}replaceAt(e,t){this.emit(this.steps().map((n,o)=>o===e?t:n));}emit(e){this.stepsChange.emit(e);}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-step-list"]],inputs:{steps:[1,"steps"],rootSteps:[1,"rootSteps"],availableWorkflows:[1,"availableWorkflows"],appliesTo:[1,"appliesTo"],inputSchema:[1,"inputSchema"],settings:[1,"settings"],depth:[1,"depth"]},outputs:{stepsChange:"stepsChange"},decls:6,vars:4,consts:[["data-testid","step-list",1,"step-list"],[1,"step-card",3,"step-card-expanded"],["nz-button","","nzType","dashed","nzBlock","","type","button","data-testid","add-step",3,"click"],[1,"step-card"],[1,"step-header",3,"click"],[1,"step-header-meta"],["aria-hidden","true",1,"step-chevron"],[1,"step-name-preview"],[1,"step-type"],[1,"step-header-actions",3,"click"],["nz-button","","type","button",3,"click","disabled"],["nz-button","","nzDanger","","type","button",3,"click"],[1,"step-body"],[1,"step-toolbar"],[1,"type-select",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"field"],["nz-input","","required","",3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],[1,"hint"],[3,"inputSchema","appliesTo","previousSteps","currentStepType"],[1,"condition-section"],["nz-checkbox","",3,"ngModelChange","ngModel"],[3,"condition","testIdPrefix"],[3,"conditionChange","condition","testIdPrefix"],["nz-input","","rows","3",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],[1,"context-file-chips"],["nzMode","closeable"],["data-testid","context-files-empty",1,"hint"],["nz-button","","type","button",3,"click"],["nzMode","closeable",3,"nzOnClose"],["nzMode","multiple",3,"ngModelChange","ngModel"],["nz-input","","rows","2",3,"ngModelChange","ngModel"],["nzValue","new-branch",3,"nzLabel"],["nzValue","existing-branch",3,"nzLabel"],["nzValue","path",3,"nzLabel"],["nzValue","from-pr",3,"nzLabel"],[3,"pathChange","repoSelected","path"],[3,"rowsChange","rows"],["nzType","warning","nzShowIcon","",1,"mismatch",3,"nzMessage"],["nzValue","portable",3,"nzLabel"],["nzValue","extended",3,"nzLabel"],[3,"ngModelChange","ngModel","nzPlaceHolder"],[1,"required"],[3,"ngModel"],["nz-input","",3,"ngModel"],["nzShowSearch","","nzAllowClear","",3,"ngModelChange","ngModel"],["nzValue","selection",3,"nzLabel"],["nzValue","source",3,"nzLabel"],[1,"field-grid"],[3,"ngModelChange","ngModel","nzMin"],[1,"nested"],[3,"stepsChange","steps","rootSteps","availableWorkflows","appliesTo","inputSchema","settings","depth"]],template:function(t,n){t&1&&(_i$1(0,"div",0),xD(1,er,22,28,"nz-card",1,io,true),_i$1(3,"button",2),mh("click",function(){return n.addStep()}),Iw(4),Pw(5,"transloco"),Jc()()),t&2&&(ch("data-depth",n.depth()),gI(),AD(n.steps()),gI(3),rl$1(" ",Fw(5,2,"step-list.addStep")," "));},dependencies:[i,$8,al,er$1,rl,Ja,$i$1,pf,bd,sp,fp,Nt,Ke,Lt,ut,ai$1,z,wn,ot,ts,ex,Fm,Am,Gn$1,un,W,I$1,Nn,Mn,zn,Sn,Kt],styles:[".step-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.step-card[_ngcontent-%COMP%]{background:#fff}.step-header[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem;cursor:pointer;-webkit-user-select:none;user-select:none}.step-header-meta[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.step-chevron[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem;width:.9rem}.step-type[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:#57534e;background:#f5f5f4;border-radius:999px;padding:.15rem .55rem}.step-name-preview[_ngcontent-%COMP%]{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.step-header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.step-body[_ngcontent-%COMP%]{margin-top:.75rem;padding-top:.75rem;border-top:1px solid #e7e5e4}.step-toolbar[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.75rem;align-items:center}.type-select[_ngcontent-%COMP%]{min-width:11rem}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.65rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.field-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));gap:.5rem 1rem}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.mismatch[_ngcontent-%COMP%]{margin:.5rem 0}.required[_ngcontent-%COMP%]{color:#b91c1c}.nested[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;border-left:3px solid #d6d3d1;background:#fafaf9}.nested[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 .5rem}.condition-section[_ngcontent-%COMP%]{margin:.75rem 0;padding-top:.5rem}.condition-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.35rem 0 0}.context-file-chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;margin:.35rem 0}"]});}}return i})();function tr(i){let l={};for(let e of i.params)l[e.name]=e.type==="select"?e.options?.[0]??"":"";return l}var nr=i=>({ids:i});function ir(i,l){if(i&1){let e=FD();_i$1(0,"button",10),mh("click",function(){Fu(e);let n=HD();return ju(n.exportWorkflow())}),Iw(1),Pw(2,"transloco"),Jc();}if(i&2){let e=HD();lh("disabled",e.loading()||!!e.loadError()),gI(),rl$1(" ",Fw(2,2,"workflow-editor.export")," ");}}function or(i,l){if(i&1){let e=FD();_i$1(0,"button",11),mh("click",function(){Fu(e);let n=HD();return ju(n.startWorkflow())}),Iw(1),Pw(2,"transloco"),Jc();}i&2&&(gI(),rl$1(" ",Fw(2,1,"workflow-editor.start")," "));}function rr(i,l){i&1&&(_i$1(0,"p",8),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"workflow-editor.loading")));}function ar(i,l){if(i&1&&(_i$1(0,"p",9),Iw(1),Jc()),i&2){let e=HD();gI(),Lh(e.loadError());}}function sr(i,l){if(i&1&&(_i$1(0,"li"),Iw(1),Jc()),i&2){let e=l.$implicit;gI(),Lh(e);}}function lr(i,l){if(i&1&&(_i$1(0,"section",12)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"ul"),xD(5,sr,2,1,"li",null,ND),Jc()()),i&2){let e=HD(2);gI(2),Lh(Fw(3,1,"workflow-editor.validation")),gI(3),AD(e.validationErrors());}}function pr(i,l){if(i&1&&(uh(0,"nz-option",18),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(2);lh("nzValue",e)("nzLabel",Fw(1,2,t.subjectTypeKey(e)));}}function dr(i,l){if(i&1&&(uh(0,"nz-option",20),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(2);lh("nzValue",e)("nzLabel",Fw(1,3,t.subjectHandlingKey(e)))("nzDisabled",e==="collection"&&t.appliesToValue()==="none");}}function cr(i,l){if(i&1&&(uh(0,"nz-option",18),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(3);lh("nzValue",e)("nzLabel",Fw(1,2,t.inputTypeKey(e)));}}function _r(i,l){if(i&1){let e=FD();_i$1(0,"div",23)(1,"label",15)(2,"span"),Iw(3),Pw(4,"transloco"),Jc(),_i$1(5,"input",27),mh("ngModelChange",function(n){let o=Fu(e).$index,d=HD(2);return ju(d.patchInputField(o,{name:n}))}),Jc(),iE(),Jc(),_i$1(6,"label",15)(7,"span"),Iw(8),Pw(9,"transloco"),Jc(),_i$1(10,"input",27),mh("ngModelChange",function(n){let o=Fu(e).$index,d=HD(2);return ju(d.patchInputField(o,{label:n}))}),Jc(),iE(),Jc(),_i$1(11,"div",15)(12,"span"),Iw(13),Pw(14,"transloco"),Jc(),_i$1(15,"nz-select",28),mh("ngModelChange",function(n){let o=Fu(e).$index,d=HD(2);return ju(d.patchInputField(o,{type:n}))}),xD(16,cr,2,4,"nz-option",18,ND),Jc(),iE(),Jc(),_i$1(18,"label",29),mh("ngModelChange",function(n){let o=Fu(e).$index,d=HD(2);return ju(d.patchInputField(o,{required:n}))}),Iw(19),Pw(20,"transloco"),Jc(),iE(),_i$1(21,"button",30),mh("click",function(){let n=Fu(e).$index,o=HD(2);return ju(o.removeInputField(n))}),Iw(22),Pw(23,"transloco"),Jc()();}if(i&2){let e=l.$implicit,t=l.$index,n=HD(2);ch("data-testid","input-field-"+t),gI(3),Lh(Fw(4,10,"workflow-editor.fieldName")),gI(2),lh("ngModel",e.name),aE(),gI(3),Lh(Fw(9,12,"workflow-editor.fieldLabel")),gI(2),lh("ngModel",e.label),aE(),gI(3),Lh(Fw(14,14,"workflow-editor.fieldType")),gI(2),lh("ngModel",e.type),aE(),gI(),AD(n.inputFieldTypes),gI(2),lh("ngModel",e.required),aE(),gI(),rl$1(" ",Fw(20,16,"workflow-editor.required")," "),gI(3),rl$1(" ",Fw(23,18,"workflow-editor.remove")," ");}}function mr(i,l){if(i&1&&(_i$1(0,"p",25),Iw(1),Pw(2,"transloco"),Jc()),i&2){let e=HD(2);gI(),rl$1(" ",jw(2,1,"workflow-editor.duplicateStepIds",Aw(4,nr,e.duplicateStepIds().join(", ")))," ");}}function ur(i,l){if(i&1){let e=FD();_D(0,lr,7,3,"section",12),_i$1(1,"nz-card",13),Pw(2,"transloco"),_i$1(3,"div",14)(4,"label",15)(5,"span"),Iw(6),Pw(7,"transloco"),Jc(),_i$1(8,"input",16),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.patchWorkflow({name:n}))}),Jc(),iE(),Jc(),_i$1(9,"div",15)(10,"span"),Iw(11),Pw(12,"transloco"),Jc(),_i$1(13,"nz-select",17),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.setAppliesTo(n))}),xD(14,pr,2,4,"nz-option",18,ND),Jc(),iE(),Jc(),_i$1(16,"div",15)(17,"span"),Iw(18),Pw(19,"transloco"),Jc(),_i$1(20,"nz-select",19),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.patchWorkflow({subjectHandling:n}))}),xD(21,dr,2,5,"nz-option",20,ND),Jc(),iE(),_i$1(23,"p",21),Iw(24),Pw(25,"transloco"),Jc()()(),_i$1(26,"label",15)(27,"span"),Iw(28),Pw(29,"transloco"),Jc(),_i$1(30,"textarea",22),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.patchWorkflow({description:n||void 0}))}),Jc(),iE(),Jc()(),_i$1(31,"nz-card",13),Pw(32,"transloco"),xD(33,_r,24,20,"div",23,SD),_i$1(35,"button",24),mh("click",function(){Fu(e);let n=HD();return ju(n.addInputField())}),Iw(36),Pw(37,"transloco"),Jc()(),_i$1(38,"nz-card",13),Pw(39,"transloco"),_D(40,mr,3,6,"p",25),_i$1(41,"app-step-list",26),mh("stepsChange",function(n){Fu(e);let o=HD();return ju(o.onStepsChange(n))}),Jc()();}if(i&2){let e=HD();MD(e.validationErrors().length>0?0:-1),gI(),lh("nzTitle",Fw(2,21,"workflow-editor.basics")),gI(5),Lh(Fw(7,23,"workflow-editor.name")),gI(2),lh("ngModel",e.workflow().name),aE(),gI(3),Lh(Fw(12,25,"workflow-editor.appliesTo")),gI(2),lh("ngModel",e.appliesToValue()),aE(),gI(),AD(e.subjectTypes),gI(4),Lh(Fw(19,27,"workflow-editor.subjectHandling.label")),gI(2),lh("ngModel",e.workflow().subjectHandling),aE(),gI(),AD(e.subjectHandlingOptions),gI(3),rl$1(" ",Fw(25,29,e.subjectHandlingHelpKey())," "),gI(4),Lh(Fw(29,31,"workflow-editor.description")),gI(2),lh("ngModel",e.workflow().description??""),aE(),gI(),lh("nzTitle",Fw(32,33,"workflow-editor.inputSchema")),gI(2),AD(e.workflow().inputSchema),gI(3),rl$1(" ",Fw(37,35,"workflow-editor.addInputField")," "),gI(2),lh("nzTitle",Fw(39,37,"workflow-editor.steps")),gI(2),MD(e.duplicateStepIds().length>0?40:-1),gI(),lh("steps",e.workflow().steps)("rootSteps",e.workflow().steps)("availableWorkflows",e.availableWorkflows())("appliesTo",e.workflow().appliesTo)("inputSchema",e.workflow().inputSchema)("settings",e.settings());}}var Cs=(()=>{class i{constructor(){this.route=C(C1),this.router=C(J1),this.workflowsApi=C(b),this.settingsApi=C(f),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.language=C(O),this.startJob=C(At),this.routeId=de(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.workflow=qo$1(I()),this.availableWorkflows=qo$1([]),this.settings=qo$1(w_),this.loadError=qo$1(null),this.validationErrors=qo$1([]),this.duplicateStepIds=qo$1([]),this.saving=qo$1(false),this.loading=qo$1(true),this.isNew=Uw(()=>!this.routeId()),this.canStart=Uw(()=>!this.isNew()&&!this.loading()&&!this.loadError()&&this.workflow().subjectHandling==="per-subject"),this.pageTitle=Uw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("workflow-editor.titleNew"):this.transloco.translate("workflow-editor.titleEdit",{name:this.workflow().name.trim()}))),this.subjectTypes=["none","ticket","pull_request","documentation"],this.subjectHandlingOptions=["per-subject","collection"],this.inputFieldTypes=["string","number","boolean","select","localRepository"],this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.availableWorkflows.set(e),error:()=>{}}),this.settingsApi.getSettings().pipe(ue(this.destroyRef)).subscribe({next:e=>this.settings.set(e),error:()=>{}}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(e=>{let t=e.get("id");if(this.validationErrors.set([]),this.duplicateStepIds.set([]),this.loadError.set(null),!t){this.workflow.set(I()),this.loading.set(false);return}this.loading.set(true),this.workflowsApi.get(t).subscribe({next:n=>{this.workflow.set(s(r$1({},structuredClone(n)),{steps:_(n.steps,{idAutoSync:false})})),this.loading.set(false);},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,`Failed to load workflow ${t}`));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}subjectHandlingKey(e){return `workflow-editor.subjectHandling.${e}`}subjectHandlingHelpKey(){return `workflow-editor.subjectHandling.help.${this.workflow().subjectHandling}`}inputTypeKey(e){return `workflow-editor.inputType.${e}`}patchWorkflow(e){this.workflow.update(t=>r$1(r$1({},t),e));}setAppliesTo(e){if(e==="none"){this.patchWorkflow({appliesTo:e,subjectHandling:"per-subject"});return}this.patchWorkflow({appliesTo:e});}appliesToValue(){let e=this.workflow().appliesTo;return Array.isArray(e)?e[0]??"none":e}onStepsChange(e){this.patchWorkflow({steps:e}),this.duplicateStepIds.set(Ad(e));}addInputField(){this.patchWorkflow({inputSchema:[...this.workflow().inputSchema,b$1()]});}removeInputField(e){this.patchWorkflow({inputSchema:this.workflow().inputSchema.filter((t,n)=>n!==e)});}patchInputField(e,t){let n=this.workflow().inputSchema.map((o,d)=>d===e?r$1(r$1({},o),t):o);this.patchWorkflow({inputSchema:n});}save(){let e=this.workflow(),t=Ad(e.steps);if(this.duplicateStepIds.set(t),t.length>0){this.validationErrors.set([this.transloco.translate("workflow-editor.duplicateStepIds",{ids:t.join(", ")})]);return}let n=v(e,{omitWorkflowId:this.isNew()}),o=c_.safeParse(n);if(!o.success){this.validationErrors.set(T(o.error));return}this.validationErrors.set([]),this.saving.set(true);let d=o.data,T$1=this.routeId();(this.isNew()||!T$1?this.workflowsApi.create(d):this.workflowsApi.update(T$1,s(r$1({},d),{id:T$1}))).subscribe({next:me=>{this.saving.set(false),this.workflow.set(s(r$1({},structuredClone(me)),{steps:_(me.steps,{idAutoSync:false})})),this.message.success(this.isNew()?"Workflow created":"Workflow saved"),this.isNew()&&this.router.navigate(["/workflows",me.id,"edit"]);},error:me=>{this.saving.set(false),this.message.error(this.errorMessage(me,"Save failed"));}});}startWorkflow(){let e=this.routeId();!e||!this.canStart()||this.startJob.start({workflowId:e});}exportWorkflow(){let e=this.routeId();e&&this.workflowsApi.exportDefinition(e).subscribe({next:t=>{l(`${ig(t.name)}.json`,JSON.stringify(t,null,2),"application/json");},error:t=>{this.message.error(this.errorMessage(t,this.transloco.translate("workflow-editor.exportFailed")));}});}errorMessage(e,t){return e instanceof bi$1||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-editor"]],decls:17,vars:12,consts:[["data-testid","workflow-editor",1,"editor"],[1,"header"],["data-testid","page-title"],[1,"header-actions"],["routerLink","/workflows","data-testid","back-to-workflows"],["nz-button","","type","button","data-testid","export-workflow",3,"disabled"],["nz-button","","type","button","data-testid","start-workflow"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["nz-button","","type","button","data-testid","export-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","start-workflow",3,"click"],["data-testid","validation-errors",1,"errors"],[3,"nzTitle"],[1,"grid"],[1,"field"],["nz-input","","data-testid","workflow-name",3,"ngModelChange","ngModel"],["data-testid","workflow-applies-to",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","workflow-subject-handling",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel","nzDisabled"],["data-testid","workflow-subject-handling-help",1,"help"],["nz-input","","rows","2","data-testid","workflow-description",3,"ngModelChange","ngModel"],[1,"input-field-row"],["nz-button","","nzType","dashed","type","button",3,"click"],["data-testid","duplicate-step-ids",1,"error"],[3,"stepsChange","steps","rootSteps","availableWorkflows","appliesTo","inputSchema","settings"],["nz-input","",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],["nz-checkbox","",3,"ngModelChange","ngModel"],["nz-button","","nzDanger","","type","button",3,"click"]],template:function(t,n){t&1&&(_i$1(0,"main",0)(1,"header",1)(2,"div")(3,"h1",2),Iw(4),Jc()(),_i$1(5,"div",3)(6,"a",4),Iw(7),Pw(8,"transloco"),Jc(),_D(9,ir,3,4,"button",5),_D(10,or,3,3,"button",6),_i$1(11,"button",7),mh("click",function(){return n.save()}),Iw(12),Pw(13,"transloco"),Jc()()(),_D(14,rr,3,3,"p",8)(15,ar,2,1,"p",9)(16,ur,42,39),Jc()),t&2&&(gI(4),Lh(n.pageTitle()),gI(3),Lh(Fw(8,8,"workflow-editor.backToWorkflows")),gI(2),MD(n.isNew()?-1:9),gI(),MD(n.canStart()?10:-1),gI(),lh("nzLoading",n.saving())("disabled",n.loading()||!!n.loadError()),gI(),rl$1(" ",Fw(13,10,"common.save")," "),gI(2),MD(n.loading()?14:n.loadError()?15:16));},dependencies:[$8,al,er$1,rl,$i$1,v3,pf,bd,sp,fp,Nt,Ke,Lt,ut,ai$1,z,ex,Fm,Am,Bn,Kt],styles:[".editor[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));gap:.75rem 1rem}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.help[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.checkbox-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;margin-bottom:.5rem}.input-field-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 8rem auto auto;gap:.5rem;align-items:end;margin-bottom:.5rem}.input-field-row[_ngcontent-%COMP%] > .field[_ngcontent-%COMP%]{margin:0}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{Cs as WorkflowEditorComponent};
@@ -1 +1 @@
1
- import {o as ot}from'./chunk-BIdwV0jx.js';import {_ as _n,C as Cn}from'./chunk-CPNxRF7A.js';import {C,V as Ve$1,b as at,b3 as Wn,a5 as q0,U as Uw,q as qo,r as r$1,u as ue,c as bi,Z as ZE,d as $8,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,l as _D,J as Jc,al as Sh,D as ch,o as gI,M as MD,b4 as N2,aV as ix,b5 as cx,i as ie,G as FD,I as Iw,P as Pw,m as mh,L as Lh,p as Fw,z as rl$1,H as HD,k as iE,x as xD,N as ND,w as lh,y as aE,B as AD,aR as xw,n as uh,O as Fu,Q as ju}from'./main-SI5AKDMC.js';import {a as ai,z}from'./chunk-BIL86kgf.js';import {W,I}from'./chunk-5xJXPFlv.js';import {L as Lt,u as ut,p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-DAONFRT8.js';var ze=(()=>{class t{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/context-files`;}list(){return this.http.get(this.baseUrl).pipe(cx())}get(e){return this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}create(e){return this.http.post(this.baseUrl,e).pipe(cx())}update(e,n){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(e)}`,n).pipe(cx())}delete(e){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();var Te=()=>[".md"],Ie=(t,f)=>f.id;function Fe(t,f){if(t&1){let e=FD();_i(0,"header",1)(1,"h1"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",4),mh("click",function(){Fu(e);let r=HD();return ju(r.openCreateForm())}),Iw(5),Pw(6,"transloco"),Jc()();}t&2&&(gI(2),Lh(Fw(3,2,"context-files.title")),gI(3),rl$1(" ",Fw(6,4,"context-files.create")," "));}function ye(t,f){t&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Ne(t,f){if(t&1&&(_i(0,"p",3),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function De(t,f){if(t&1&&(_i(0,"p",5),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.deleteError());}}function we(t,f){if(t&1&&(_i(0,"p",9),Iw(1),Jc()),t&2){let e=HD(3);gI(),Lh(e.saveError());}}function ke(t,f){if(t&1&&(uh(0,"nz-option",13),Pw(1,"transloco")),t&2){let e=f.$implicit,n=HD(3);lh("nzValue",e)("nzLabel",Fw(1,2,n.tierKey(e)));}}function Le(t,f){if(t&1){let e=FD();_i(0,"button",20),mh("click",function(){Fu(e);let r=HD(3);return ju(r.cancelForm())}),Iw(1),Pw(2,"transloco"),Jc();}t&2&&(gI(),rl$1(" ",Fw(2,1,"context-files.form.cancel")," "));}function Pe(t,f){if(t&1){let e=FD();_i(0,"section",6),_D(1,we,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formName.set(r))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"nz-select",12),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formTier.set(r))}),xD(12,ke,2,4,"nz-option",13,ND),Jc(),iE(),Jc(),_i(14,"div",10)(15,"span"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"app-path-picker",14),mh("pathChange",function(r){Fu(e);let p=HD(2);return ju(p.formPath.set(r))}),Jc(),_i(19,"p",15),Iw(20),Pw(21,"transloco"),Jc()(),_i(22,"label",10)(23,"span"),Iw(24),Pw(25,"transloco"),Jc(),_i(26,"input",16),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formDescription.set(r))}),Jc(),iE(),Jc(),_i(27,"div",17)(28,"button",18),mh("click",function(){Fu(e);let r=HD(2);return ju(r.submitForm())}),Iw(29),Pw(30,"transloco"),Jc(),_D(31,Le,3,3,"button",19),Jc()();}if(t&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,14,"context-files.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,16,"context-files.form.tier")),gI(2),lh("ngModel",e.formTier()),aE(),gI(),AD(e.tiers),gI(4),Lh(Fw(17,18,"context-files.form.path")),gI(2),lh("extensions",xw(26,Te))("path",e.formPath()),gI(2),Lh(Fw(21,20,"context-files.form.pathHint")),gI(4),Lh(Fw(25,22,"context-files.form.description")),gI(2),lh("ngModel",e.formDescription()),aE(),gI(2),lh("nzLoading",e.saving()),gI(),rl$1(" ",Fw(30,24,e.editingId()?"context-files.form.save":"context-files.form.add")," "),gI(2),MD(e.inSelectionMode()?-1:31);}}function Ve(t,f){if(t&1){let e=FD();_i(0,"section",7)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",21),mh("click",function(){Fu(e);let r=HD(2);return ju(r.openCreateForm())}),Iw(5),Pw(6,"transloco"),Jc()();}t&2&&(gI(2),Lh(Fw(3,2,"context-files.emptyState")),gI(3),rl$1(" ",Fw(6,4,"context-files.create")," "));}function Be(t,f){t&1&&uh(0,"th");}function Oe(t,f){t&1&&(_i(0,"th"),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"context-files.column.actions")));}function $e(t,f){if(t&1){let e=FD();_i(0,"td")(1,"label",24),mh("nzCheckedChange",function(r){Fu(e);let p=HD().$implicit,T=HD(3);return ju(T.toggleSelected(p.id,r))}),Jc()();}if(t&2){let e=HD().$implicit,n=HD(3);gI(),lh("nzChecked",n.isSelected(e.id)),ch("data-testid","select-"+e.id);}}function Ae(t,f){if(t&1){let e=FD();_i(0,"td",23)(1,"button",25),mh("click",function(){Fu(e);let r=HD().$implicit,p=HD(3);return ju(p.openEditForm(r))}),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",26),Pw(5,"transloco"),Pw(6,"transloco"),Pw(7,"transloco"),mh("nzOnConfirm",function(){Fu(e);let r=HD().$implicit,p=HD(3);return ju(p.deleteFile(r.id))}),Iw(8),Pw(9,"transloco"),Jc()();}if(t&2){let e=HD().$implicit;gI(),ch("data-testid","edit-"+e.id),gI(),rl$1(" ",Fw(3,7,"context-files.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(5,9,"context-files.deleteConfirm"))("nzOkText",Fw(6,11,"context-files.delete"))("nzCancelText",Fw(7,13,"common.cancel")),ch("data-testid","delete-"+e.id),gI(4),rl$1(" ",Fw(9,15,"context-files.delete")," ");}}function Ue(t,f){if(t&1&&(_i(0,"tr"),_D(1,$e,2,2,"td"),_i(2,"td"),Iw(3),Jc(),_i(4,"td")(5,"nz-tag"),Iw(6),Pw(7,"transloco"),Jc()(),_i(8,"td",22),Iw(9),Jc(),_i(10,"td"),Iw(11),Jc(),_D(12,Ae,10,17,"td",23),Jc()),t&2){let e=f.$implicit,n=HD(3);ch("data-testid","context-file-"+e.id),gI(),MD(n.inSelectionMode()?1:-1),gI(),ch("data-testid","name-"+e.id),gI(),Lh(e.name),gI(2),ch("data-testid","tier-"+e.id),gI(),Lh(Fw(7,11,n.tierKey(e.tier))),gI(2),ch("data-testid","path-"+e.id),gI(),Lh(e.path),gI(),ch("data-testid","description-"+e.id),gI(),Lh(e.description),gI(),MD(n.inSelectionMode()?-1:12);}}function Re(t,f){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),_D(3,Be,1,0,"th"),_i(4,"th"),Iw(5),Pw(6,"transloco"),Jc(),_i(7,"th"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"th"),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"th"),Iw(14),Pw(15,"transloco"),Jc(),_D(16,Oe,3,3,"th"),Jc()(),_i(17,"tbody"),xD(18,Ue,13,13,"tr",null,Ie),Jc()()),t&2){let e=HD(2);lh("nzData",e.files())("nzFrontPagination",false)("nzShowPagination",false),gI(3),MD(e.inSelectionMode()?3:-1),gI(2),Lh(Fw(6,9,"context-files.column.name")),gI(3),Lh(Fw(9,11,"context-files.column.tier")),gI(3),Lh(Fw(12,13,"context-files.column.path")),gI(3),Lh(Fw(15,15,"context-files.column.description")),gI(2),MD(e.inSelectionMode()?-1:16),gI(2),AD(e.files());}}function je(t,f){if(t&1&&(_D(0,De,2,1,"p",5),_D(1,Pe,32,27,"section",6),_D(2,Ve,7,6,"section",7)(3,Re,20,17,"nz-table",8)),t&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.inSelectionMode()||e.formOpen()?1:-1),gI(),MD(e.files().length===0&&!e.inSelectionMode()&&!e.formOpen()?2:3);}}var Ke=["user","organization","project"],St=(()=>{class t{constructor(){this.filesApi=C(ze),this.transloco=C(Ve$1),this.destroyRef=C(at),this.modalData=C(Wn,{optional:true}),this.selectionModeInput=q0(false),this.inSelectionMode=Uw(()=>this.modalData?.selectionMode??this.selectionModeInput()),this.files=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.selectedIds=qo([...this.modalData?.selectedIds??[]]),this.formName=qo(""),this.formTier=qo("user"),this.formPath=qo(""),this.formDescription=qo(""),this.tiers=Ke,this.reload();}currentSelectedIds(){return this.selectedIds()}tierKey(e){return `context-files.tier.${e}`}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,n){this.selectedIds.update(r=>n?r.includes(e)?r:[...r,e]:r.filter(p=>p!==e));}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formTier.set(e.tier),this.formPath.set(e.path),this.formDescription.set(e.description??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r$1({name:this.formName().trim(),tier:this.formTier(),path:this.formPath().trim()},this.formDescription().trim()?{description:this.formDescription().trim()}:{description:void 0}),n=this.editingId();(n?this.filesApi.update(n,e):this.filesApi.create(e)).pipe(ue(this.destroyRef)).subscribe({next:p=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.files.update(T=>[...T.filter(N=>N.id!==p.id),p].sort((N,Ee)=>N.name.localeCompare(Ee.name))),this.inSelectionMode()&&!this.isSelected(p.id)&&this.selectedIds.update(T=>[...T,p.id]),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set("");},error:p=>{this.saving.set(false),this.saveError.set(this.errorMessage(p,this.transloco.translate("context-files.saveFailed")));}});}deleteFile(e){this.deleteError.set(null),this.filesApi.delete(e).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.files.update(n=>n.filter(r=>r.id!==e)),this.selectedIds.update(n=>n.filter(r=>r!==e));},error:n=>{this.deleteError.set(this.errorMessage(n,this.transloco.translate("context-files.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.filesApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.files.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("context-files.loadFailed")));}});}errorMessage(e,n){return e instanceof bi||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-context-file-list"]],inputs:{selectionModeInput:[1,"selectionModeInput"]},decls:5,vars:5,consts:[[1,"context-file-list"],[1,"header"],["data-testid","loading"],["data-testid","load-error",1,"error"],["nz-button","","nzType","primary","type","button","data-testid","create-context-file",3,"click"],["data-testid","delete-error",1,"error"],["data-testid","context-file-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","context-file-items",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","context-file-name",3,"ngModelChange","ngModel"],["data-testid","context-file-tier",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["mode","files",3,"pathChange","extensions","path"],[1,"hint"],["nz-input","","data-testid","context-file-description",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","context-file-submit",3,"click","nzLoading"],["nz-button","","type","button","data-testid","context-file-cancel"],["nz-button","","type","button","data-testid","context-file-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","empty-create",3,"click"],[1,"path-cell"],[1,"actions"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(n,r){n&1&&(_i(0,"div",0),_D(1,Fe,7,6,"header",1),_D(2,ye,3,3,"p",2)(3,Ne,2,1,"p",3)(4,je,4,3),Jc()),n&2&&(Sh("list-page",!r.inSelectionMode()),ch("data-testid",r.inSelectionMode()?"context-file-picker":"context-files-manage"),gI(),MD(r.inSelectionMode()?-1:1),gI(),MD(r.loading()?2:r.loadError()?3:4));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,Lt,ut,ai,z,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();export{St as S,ze as z};
1
+ import {o as ot}from'./chunk-Det50scT.js';import {_ as _n,C as Cn}from'./chunk-vINo5yVD.js';import {C,V as Ve$1,b as at,b3 as Wn,a5 as q0,U as Uw,q as qo,r as r$1,u as ue,c as bi,Z as ZE,d as $8,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,l as _D,J as Jc,al as Sh,D as ch,o as gI,M as MD,b4 as N2,aV as ix,b5 as cx,i as ie,G as FD,I as Iw,P as Pw,m as mh,L as Lh,p as Fw,z as rl$1,H as HD,k as iE,x as xD,N as ND,w as lh,y as aE,B as AD,aR as xw,n as uh,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import {a as ai,z}from'./chunk-Dm_EWkUz.js';import {W,I}from'./chunk-Bok52e_k.js';import {L as Lt,u as ut,p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-CtiubhW7.js';var ze=(()=>{class t{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/context-files`;}list(){return this.http.get(this.baseUrl).pipe(cx())}get(e){return this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}create(e){return this.http.post(this.baseUrl,e).pipe(cx())}update(e,n){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(e)}`,n).pipe(cx())}delete(e){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();var Te=()=>[".md"],Ie=(t,f)=>f.id;function Fe(t,f){if(t&1){let e=FD();_i(0,"header",1)(1,"h1"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",4),mh("click",function(){Fu(e);let r=HD();return ju(r.openCreateForm())}),Iw(5),Pw(6,"transloco"),Jc()();}t&2&&(gI(2),Lh(Fw(3,2,"context-files.title")),gI(3),rl$1(" ",Fw(6,4,"context-files.create")," "));}function ye(t,f){t&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Ne(t,f){if(t&1&&(_i(0,"p",3),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function De(t,f){if(t&1&&(_i(0,"p",5),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.deleteError());}}function we(t,f){if(t&1&&(_i(0,"p",9),Iw(1),Jc()),t&2){let e=HD(3);gI(),Lh(e.saveError());}}function ke(t,f){if(t&1&&(uh(0,"nz-option",13),Pw(1,"transloco")),t&2){let e=f.$implicit,n=HD(3);lh("nzValue",e)("nzLabel",Fw(1,2,n.tierKey(e)));}}function Le(t,f){if(t&1){let e=FD();_i(0,"button",20),mh("click",function(){Fu(e);let r=HD(3);return ju(r.cancelForm())}),Iw(1),Pw(2,"transloco"),Jc();}t&2&&(gI(),rl$1(" ",Fw(2,1,"context-files.form.cancel")," "));}function Pe(t,f){if(t&1){let e=FD();_i(0,"section",6),_D(1,we,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formName.set(r))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"nz-select",12),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formTier.set(r))}),xD(12,ke,2,4,"nz-option",13,ND),Jc(),iE(),Jc(),_i(14,"div",10)(15,"span"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"app-path-picker",14),mh("pathChange",function(r){Fu(e);let p=HD(2);return ju(p.formPath.set(r))}),Jc(),_i(19,"p",15),Iw(20),Pw(21,"transloco"),Jc()(),_i(22,"label",10)(23,"span"),Iw(24),Pw(25,"transloco"),Jc(),_i(26,"input",16),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formDescription.set(r))}),Jc(),iE(),Jc(),_i(27,"div",17)(28,"button",18),mh("click",function(){Fu(e);let r=HD(2);return ju(r.submitForm())}),Iw(29),Pw(30,"transloco"),Jc(),_D(31,Le,3,3,"button",19),Jc()();}if(t&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,14,"context-files.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,16,"context-files.form.tier")),gI(2),lh("ngModel",e.formTier()),aE(),gI(),AD(e.tiers),gI(4),Lh(Fw(17,18,"context-files.form.path")),gI(2),lh("extensions",xw(26,Te))("path",e.formPath()),gI(2),Lh(Fw(21,20,"context-files.form.pathHint")),gI(4),Lh(Fw(25,22,"context-files.form.description")),gI(2),lh("ngModel",e.formDescription()),aE(),gI(2),lh("nzLoading",e.saving()),gI(),rl$1(" ",Fw(30,24,e.editingId()?"context-files.form.save":"context-files.form.add")," "),gI(2),MD(e.inSelectionMode()?-1:31);}}function Ve(t,f){if(t&1){let e=FD();_i(0,"section",7)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",21),mh("click",function(){Fu(e);let r=HD(2);return ju(r.openCreateForm())}),Iw(5),Pw(6,"transloco"),Jc()();}t&2&&(gI(2),Lh(Fw(3,2,"context-files.emptyState")),gI(3),rl$1(" ",Fw(6,4,"context-files.create")," "));}function Be(t,f){t&1&&uh(0,"th");}function Oe(t,f){t&1&&(_i(0,"th"),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"context-files.column.actions")));}function $e(t,f){if(t&1){let e=FD();_i(0,"td")(1,"label",24),mh("nzCheckedChange",function(r){Fu(e);let p=HD().$implicit,T=HD(3);return ju(T.toggleSelected(p.id,r))}),Jc()();}if(t&2){let e=HD().$implicit,n=HD(3);gI(),lh("nzChecked",n.isSelected(e.id)),ch("data-testid","select-"+e.id);}}function Ae(t,f){if(t&1){let e=FD();_i(0,"td",23)(1,"button",25),mh("click",function(){Fu(e);let r=HD().$implicit,p=HD(3);return ju(p.openEditForm(r))}),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",26),Pw(5,"transloco"),Pw(6,"transloco"),Pw(7,"transloco"),mh("nzOnConfirm",function(){Fu(e);let r=HD().$implicit,p=HD(3);return ju(p.deleteFile(r.id))}),Iw(8),Pw(9,"transloco"),Jc()();}if(t&2){let e=HD().$implicit;gI(),ch("data-testid","edit-"+e.id),gI(),rl$1(" ",Fw(3,7,"context-files.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(5,9,"context-files.deleteConfirm"))("nzOkText",Fw(6,11,"context-files.delete"))("nzCancelText",Fw(7,13,"common.cancel")),ch("data-testid","delete-"+e.id),gI(4),rl$1(" ",Fw(9,15,"context-files.delete")," ");}}function Ue(t,f){if(t&1&&(_i(0,"tr"),_D(1,$e,2,2,"td"),_i(2,"td"),Iw(3),Jc(),_i(4,"td")(5,"nz-tag"),Iw(6),Pw(7,"transloco"),Jc()(),_i(8,"td",22),Iw(9),Jc(),_i(10,"td"),Iw(11),Jc(),_D(12,Ae,10,17,"td",23),Jc()),t&2){let e=f.$implicit,n=HD(3);ch("data-testid","context-file-"+e.id),gI(),MD(n.inSelectionMode()?1:-1),gI(),ch("data-testid","name-"+e.id),gI(),Lh(e.name),gI(2),ch("data-testid","tier-"+e.id),gI(),Lh(Fw(7,11,n.tierKey(e.tier))),gI(2),ch("data-testid","path-"+e.id),gI(),Lh(e.path),gI(),ch("data-testid","description-"+e.id),gI(),Lh(e.description),gI(),MD(n.inSelectionMode()?-1:12);}}function Re(t,f){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),_D(3,Be,1,0,"th"),_i(4,"th"),Iw(5),Pw(6,"transloco"),Jc(),_i(7,"th"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"th"),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"th"),Iw(14),Pw(15,"transloco"),Jc(),_D(16,Oe,3,3,"th"),Jc()(),_i(17,"tbody"),xD(18,Ue,13,13,"tr",null,Ie),Jc()()),t&2){let e=HD(2);lh("nzData",e.files())("nzFrontPagination",false)("nzShowPagination",false),gI(3),MD(e.inSelectionMode()?3:-1),gI(2),Lh(Fw(6,9,"context-files.column.name")),gI(3),Lh(Fw(9,11,"context-files.column.tier")),gI(3),Lh(Fw(12,13,"context-files.column.path")),gI(3),Lh(Fw(15,15,"context-files.column.description")),gI(2),MD(e.inSelectionMode()?-1:16),gI(2),AD(e.files());}}function je(t,f){if(t&1&&(_D(0,De,2,1,"p",5),_D(1,Pe,32,27,"section",6),_D(2,Ve,7,6,"section",7)(3,Re,20,17,"nz-table",8)),t&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.inSelectionMode()||e.formOpen()?1:-1),gI(),MD(e.files().length===0&&!e.inSelectionMode()&&!e.formOpen()?2:3);}}var Ke=["user","organization","project"],St=(()=>{class t{constructor(){this.filesApi=C(ze),this.transloco=C(Ve$1),this.destroyRef=C(at),this.modalData=C(Wn,{optional:true}),this.selectionModeInput=q0(false),this.inSelectionMode=Uw(()=>this.modalData?.selectionMode??this.selectionModeInput()),this.files=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.selectedIds=qo([...this.modalData?.selectedIds??[]]),this.formName=qo(""),this.formTier=qo("user"),this.formPath=qo(""),this.formDescription=qo(""),this.tiers=Ke,this.reload();}currentSelectedIds(){return this.selectedIds()}tierKey(e){return `context-files.tier.${e}`}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,n){this.selectedIds.update(r=>n?r.includes(e)?r:[...r,e]:r.filter(p=>p!==e));}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formTier.set(e.tier),this.formPath.set(e.path),this.formDescription.set(e.description??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r$1({name:this.formName().trim(),tier:this.formTier(),path:this.formPath().trim()},this.formDescription().trim()?{description:this.formDescription().trim()}:{description:void 0}),n=this.editingId();(n?this.filesApi.update(n,e):this.filesApi.create(e)).pipe(ue(this.destroyRef)).subscribe({next:p=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.files.update(T=>[...T.filter(N=>N.id!==p.id),p].sort((N,Ee)=>N.name.localeCompare(Ee.name))),this.inSelectionMode()&&!this.isSelected(p.id)&&this.selectedIds.update(T=>[...T,p.id]),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set("");},error:p=>{this.saving.set(false),this.saveError.set(this.errorMessage(p,this.transloco.translate("context-files.saveFailed")));}});}deleteFile(e){this.deleteError.set(null),this.filesApi.delete(e).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.files.update(n=>n.filter(r=>r.id!==e)),this.selectedIds.update(n=>n.filter(r=>r!==e));},error:n=>{this.deleteError.set(this.errorMessage(n,this.transloco.translate("context-files.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.filesApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.files.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("context-files.loadFailed")));}});}errorMessage(e,n){return e instanceof bi||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-context-file-list"]],inputs:{selectionModeInput:[1,"selectionModeInput"]},decls:5,vars:5,consts:[[1,"context-file-list"],[1,"header"],["data-testid","loading"],["data-testid","load-error",1,"error"],["nz-button","","nzType","primary","type","button","data-testid","create-context-file",3,"click"],["data-testid","delete-error",1,"error"],["data-testid","context-file-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","context-file-items",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","context-file-name",3,"ngModelChange","ngModel"],["data-testid","context-file-tier",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["mode","files",3,"pathChange","extensions","path"],[1,"hint"],["nz-input","","data-testid","context-file-description",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","context-file-submit",3,"click","nzLoading"],["nz-button","","type","button","data-testid","context-file-cancel"],["nz-button","","type","button","data-testid","context-file-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","empty-create",3,"click"],[1,"path-cell"],[1,"actions"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(n,r){n&1&&(_i(0,"div",0),_D(1,Fe,7,6,"header",1),_D(2,ye,3,3,"p",2)(3,Ne,2,1,"p",3)(4,je,4,3),Jc()),n&2&&(Sh("list-page",!r.inSelectionMode()),ch("data-testid",r.inSelectionMode()?"context-file-picker":"context-files-manage"),gI(),MD(r.inSelectionMode()?-1:1),gI(),MD(r.loading()?2:r.loadError()?3:4));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,Lt,ut,ai,z,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();export{St as S,ze as z};
@@ -1 +1 @@
1
- import {b}from'./chunk-Dx92ksvP.js';import {L as Lt$1}from'./chunk-DyiDg8XX.js';import'./chunk-D3JZ8ur5.js';import'./chunk-5xJXPFlv.js';import {L as Lt,u as ut,D as Di,m as mn}from'./chunk-DAONFRT8.js';import'./chunk-CLM-K-Vg.js';import {C,$,a as C1,V as Ve,b as at,q as qo,U as Uw,u as ue$1,s,r as r$1,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,h as ex,F as Fm,A as Am,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,k as iE,l as _D,n as uh,x as xD,N as ND,o as gI,L as Lh,p as Fw,w as lh,y as aE,z as rl$1,M as MD,B as AD,H as HD,D as ch,E as Aw,G as FD,O as Fu,Q as ju}from'./main-SI5AKDMC.js';import'./chunk-CV-FUe_H.js';var re=t=>["/jobs",t],oe=(t,a)=>a.id,ae=(t,a)=>a.jobId+a.stepExecutionId;function le(t,a){t&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function de(t,a){if(t&1&&(_i(0,"p",6),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.queuedError());}}function pe(t,a){t&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.queuedEmpty")," "));}function ue(t,a){if(t&1&&(_i(0,"tr")(1,"td")(2,"a",25),Iw(3),Jc()(),_i(4,"td",26),Iw(5),Jc(),_i(6,"td",27),Iw(7),Jc()()),t&2){let e=a.$implicit,s=HD(2);ch("data-testid","queued-row-"+e.jobId),gI(2),lh("routerLink",Aw(6,re,e.jobId)),ch("data-testid","queued-job-link-"+e.jobId),gI(),rl$1(" ",e.jobId," "),gI(2),Lh(e.agentInstanceId),gI(2),Lh(s.queuedWaitLabel(e.enqueuedAt));}}function ce(t,a){if(t&1&&(_i(0,"table",8)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc()()(),_i(12,"tbody"),xD(13,ue,8,8,"tr",null,ae),Jc()()),t&2){let e=HD();gI(4),Lh(Fw(5,3,"jobs.table.column.id")),gI(3),Lh(Fw(8,5,"jobs.list.queuedAgent")),gI(3),Lh(Fw(11,7,"jobs.list.queuedWait")),gI(3),AD(e.queuedSteps());}}function he(t,a){if(t&1&&uh(0,"nz-option",14),t&2){let e=a.$implicit;lh("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function me(t,a){t&1&&(_i(0,"p",15),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ge(t,a){if(t&1&&(_i(0,"p",16),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.runningError());}}function fe(t,a){t&1&&(_i(0,"p",17),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.runningEmpty")," "));}function be(t,a){if(t&1&&uh(0,"app-job-status-table",18),t&2){let e=HD();lh("jobs",e.runningJobs());}}function _e(t,a){if(t&1&&(uh(0,"nz-option",14),Pw(1,"transloco"),Pw(2,"transloco")),t&2){let e=a.$implicit,s=HD();lh("nzValue",e)("nzLabel",e==="all"?Fw(1,2,"jobs.list.filterAll"):Fw(2,4,s.statusKey(e)));}}function ye(t,a){if(t&1&&uh(0,"nz-option",14),t&2){let e=a.$implicit;lh("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function Ce(t,a){t&1&&(_i(0,"p",22),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function xe(t,a){if(t&1&&(_i(0,"p",23),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.historyError());}}function Me(t,a){t&1&&(_i(0,"p",24),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.historyEmpty")," "));}function ve(t,a){if(t&1){let e=FD();_i(0,"nz-pagination",29),mh("nzPageIndexChange",function(o){Fu(e);let m=HD(2);return ju(m.setHistoryPage(o))}),Jc();}if(t&2){let e=HD(2);lh("nzPageIndex",e.historyPageIndex())("nzPageSize",e.pageSize)("nzTotal",e.historyTotal());}}function Ie(t,a){if(t&1&&(uh(0,"app-job-status-table",18),_D(1,ve,1,3,"nz-pagination",28)),t&2){let e=HD();lh("jobs",e.historyJobs()),gI(),MD(e.historyTotal()>e.pageSize||e.historyPageIndex()>1?1:-1);}}var we=20,Se=50,Ee=3e3,se=["completed","failed","cancelled"],Qe=(()=>{class t{constructor(){this.jobsApi=C($),this.workflowsApi=C(b),this.route=C(C1),this.transloco=C(Ve),this.destroyRef=C(at),this.pageSize=we,this.historyStatusOptions=["all",...se],this.runningJobs=qo([]),this.queuedSteps=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.queuedLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.queuedError=qo(null),this.historyError=qo(null),this.runningWorkflowId=qo(""),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Uw(()=>{let e=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?e+s:e+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadQueued({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue$1(this.destroyRef)).subscribe(e=>{let s=e.get("status");s&&se.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadQueued(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(e){return `jobs.status.${e}`}isPolling(){return this.polling()}setHistoryStatusFilter(e){this.historyStatusFilter.set(e),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(e){this.runningWorkflowId.set(e),this.loadRunning();}setHistoryWorkflowId(e){this.historyWorkflowId.set(e),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(e){this.showChildJobs.set(e),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(e){this.historyPageIndex.set(e),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e);},error:()=>{this.workflows.set([]);}});}loadRunning(e={}){let s$1=this.runningWorkflowId();e.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r$1({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Se,offset:0})).pipe(ue$1(this.destroyRef)).subscribe({next:o=>{this.runningJobs.set(o),this.runningLoading.set(false);},error:o=>{this.runningLoading.set(false),!e.silent&&this.runningError.set(this.errorMessage(o,this.transloco.translate("jobs.list.loadFailed")));}});}queuedWaitLabel(e){let s=Date.now()-Date.parse(e),o=Number.isFinite(s)?Math.max(0,Math.floor(s/1e3)):0;if(o<60)return `${o}s`;let m=Math.floor(o/60);return m<60?`${m}m`:`${Math.floor(m/60)}h`}loadQueued(e={}){e.silent||(this.queuedLoading.set(true),this.queuedError.set(null)),this.jobsApi.listQueued().pipe(ue$1(this.destroyRef)).subscribe({next:s=>{this.queuedSteps.set(s),this.queuedLoading.set(false);},error:s=>{this.queuedLoading.set(false),!e.silent&&this.queuedError.set(this.errorMessage(s,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(e={}){let s$1=this.historyStatusFilter(),o=this.historyWorkflowId();e.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r$1(r$1({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),o?{workflowId:o}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue$1(this.destroyRef)).subscribe({next:m=>{this.historyJobs.set(m),this.historyLoading.set(false);},error:m=>{this.historyLoading.set(false),!e.silent&&this.historyError.set(this.errorMessage(m,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadQueued({silent:true}),this.loadHistory({silent:true});},Ee),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(e,s){return e instanceof bi||e instanceof Error?e.message:s}static{this.\u0275fac=function(s){return new(s||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-job-list"]],decls:62,vars:37,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-queued",1,"section"],[1,"section-header"],["data-testid","queued-loading"],["data-testid","queued-error",1,"error"],["data-testid","queued-empty",1,"section-empty"],["data-testid","jobs-queued-table",1,"queued-table"],["data-testid","jobs-running",1,"section"],[1,"filters"],[1,"field"],["data-testid","running-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],[3,"nzValue","nzLabel"],["data-testid","running-loading"],["data-testid","running-error",1,"error"],["data-testid","running-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-history",1,"section","section-history"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],[3,"routerLink"],["data-testid","queued-agent"],["data-testid","queued-wait"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,o){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc()(),_i(5,"label",2),mh("ngModelChange",function(b){return o.setShowChildJobs(b)}),Iw(6),Pw(7,"transloco"),Jc(),iE(),_i(8,"section",3)(9,"header",4)(10,"h2"),Iw(11),Pw(12,"transloco"),Jc()(),_D(13,le,3,3,"p",5)(14,de,2,1,"p",6)(15,pe,3,3,"p",7)(16,ce,15,9,"table",8),Jc(),_i(17,"section",9)(18,"header",4)(19,"h2"),Iw(20),Pw(21,"transloco"),Jc()(),_i(22,"div",10)(23,"div",11)(24,"span"),Iw(25),Pw(26,"transloco"),Jc(),_i(27,"nz-select",12),mh("ngModelChange",function(b){return o.setRunningWorkflowId(b)}),uh(28,"nz-option",13),Pw(29,"transloco"),xD(30,he,1,2,"nz-option",14,oe),Jc(),iE(),Jc()(),_D(32,me,3,3,"p",15)(33,ge,2,1,"p",16)(34,fe,3,3,"p",17)(35,be,1,1,"app-job-status-table",18),Jc(),_i(36,"section",19)(37,"header",4)(38,"h2"),Iw(39),Pw(40,"transloco"),Jc()(),_i(41,"div",10)(42,"div",11)(43,"span"),Iw(44),Pw(45,"transloco"),Jc(),_i(46,"nz-select",20),mh("ngModelChange",function(b){return o.setHistoryStatusFilter(b)}),xD(47,_e,3,6,"nz-option",14,ND),Jc(),iE(),Jc(),_i(49,"div",11)(50,"span"),Iw(51),Pw(52,"transloco"),Jc(),_i(53,"nz-select",21),mh("ngModelChange",function(b){return o.setHistoryWorkflowId(b)}),uh(54,"nz-option",13),Pw(55,"transloco"),xD(56,ye,1,2,"nz-option",14,oe),Jc(),iE(),Jc()(),_D(58,Ce,3,3,"p",22)(59,xe,2,1,"p",23)(60,Me,3,3,"p",24)(61,Ie,2,2),Jc()()),s&2&&(gI(3),Lh(Fw(4,17,"jobs.list.title")),gI(2),lh("ngModel",o.showChildJobs()),aE(),gI(),rl$1(" ",Fw(7,19,"jobs.list.showChildJobs")," "),gI(5),Lh(Fw(12,21,"jobs.list.queued")),gI(2),MD(o.queuedLoading()?13:o.queuedError()?14:o.queuedSteps().length===0?15:16),gI(7),Lh(Fw(21,23,"jobs.list.running")),gI(5),Lh(Fw(26,25,"jobs.list.filterByWorkflow")),gI(2),lh("ngModel",o.runningWorkflowId()),aE(),gI(),lh("nzLabel",Fw(29,27,"jobs.list.filterAll")),gI(2),AD(o.workflows()),gI(2),MD(o.runningLoading()?32:o.runningError()?33:o.runningJobs().length===0?34:35),gI(7),Lh(Fw(40,29,"jobs.list.history")),gI(5),Lh(Fw(45,31,"jobs.list.filterByStatus")),gI(2),lh("ngModel",o.historyStatusFilter()),aE(),gI(),AD(o.historyStatusOptions),gI(4),Lh(Fw(52,33,"jobs.list.filterByWorkflow")),gI(2),lh("ngModel",o.historyWorkflowId()),aE(),gI(),lh("nzLabel",Fw(55,35,"jobs.list.filterAll")),gI(2),AD(o.workflows()),gI(2),MD(o.historyLoading()?58:o.historyError()?59:o.historyJobs().length===0?60:61));},dependencies:[$8,al,rl,$i,v3,Lt,ut,Di,mn,ex,Fm,Am,Lt$1,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.child-toggle[_ngcontent-%COMP%]{align-self:flex-start}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-history[_ngcontent-%COMP%]{padding-top:1.25rem;border-top:1px solid #e7e5e4}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.queued-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .queued-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{text-align:left;padding:.5rem .75rem .5rem 0;border-bottom:1px solid #e7e5e4}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e;font-weight:600}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{we as JOB_LIST_PAGE_SIZE,Se as JOB_RUNNING_LIMIT,Ee as JOB_RUNNING_POLL_MS,Qe as JobListComponent,se as TERMINAL_JOB_STATUSES};
1
+ import {b}from'./chunk-BcDRgzYZ.js';import {L as Lt$1}from'./chunk-LPXHXTnJ.js';import'./chunk-8ezEUcxN.js';import'./chunk-Bok52e_k.js';import {L as Lt,u as ut,D as Di,m as mn}from'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';import {C,$,a as C1,V as Ve,b as at,q as qo,U as Uw,u as ue$1,s,r as r$1,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,h as ex,F as Fm,A as Am,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,k as iE,l as _D,n as uh,x as xD,N as ND,o as gI,L as Lh,p as Fw,w as lh,y as aE,z as rl$1,M as MD,B as AD,H as HD,D as ch,E as Aw,G as FD,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import'./chunk-D8qyjd0z.js';var re=t=>["/jobs",t],oe=(t,a)=>a.id,ae=(t,a)=>a.jobId+a.stepExecutionId;function le(t,a){t&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function de(t,a){if(t&1&&(_i(0,"p",6),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.queuedError());}}function pe(t,a){t&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.queuedEmpty")," "));}function ue(t,a){if(t&1&&(_i(0,"tr")(1,"td")(2,"a",25),Iw(3),Jc()(),_i(4,"td",26),Iw(5),Jc(),_i(6,"td",27),Iw(7),Jc()()),t&2){let e=a.$implicit,s=HD(2);ch("data-testid","queued-row-"+e.jobId),gI(2),lh("routerLink",Aw(6,re,e.jobId)),ch("data-testid","queued-job-link-"+e.jobId),gI(),rl$1(" ",e.jobId," "),gI(2),Lh(e.agentInstanceId),gI(2),Lh(s.queuedWaitLabel(e.enqueuedAt));}}function ce(t,a){if(t&1&&(_i(0,"table",8)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc()()(),_i(12,"tbody"),xD(13,ue,8,8,"tr",null,ae),Jc()()),t&2){let e=HD();gI(4),Lh(Fw(5,3,"jobs.table.column.id")),gI(3),Lh(Fw(8,5,"jobs.list.queuedAgent")),gI(3),Lh(Fw(11,7,"jobs.list.queuedWait")),gI(3),AD(e.queuedSteps());}}function he(t,a){if(t&1&&uh(0,"nz-option",14),t&2){let e=a.$implicit;lh("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function me(t,a){t&1&&(_i(0,"p",15),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ge(t,a){if(t&1&&(_i(0,"p",16),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.runningError());}}function fe(t,a){t&1&&(_i(0,"p",17),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.runningEmpty")," "));}function be(t,a){if(t&1&&uh(0,"app-job-status-table",18),t&2){let e=HD();lh("jobs",e.runningJobs());}}function _e(t,a){if(t&1&&(uh(0,"nz-option",14),Pw(1,"transloco"),Pw(2,"transloco")),t&2){let e=a.$implicit,s=HD();lh("nzValue",e)("nzLabel",e==="all"?Fw(1,2,"jobs.list.filterAll"):Fw(2,4,s.statusKey(e)));}}function ye(t,a){if(t&1&&uh(0,"nz-option",14),t&2){let e=a.$implicit;lh("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function Ce(t,a){t&1&&(_i(0,"p",22),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function xe(t,a){if(t&1&&(_i(0,"p",23),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.historyError());}}function Me(t,a){t&1&&(_i(0,"p",24),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.historyEmpty")," "));}function ve(t,a){if(t&1){let e=FD();_i(0,"nz-pagination",29),mh("nzPageIndexChange",function(o){Fu(e);let m=HD(2);return ju(m.setHistoryPage(o))}),Jc();}if(t&2){let e=HD(2);lh("nzPageIndex",e.historyPageIndex())("nzPageSize",e.pageSize)("nzTotal",e.historyTotal());}}function Ie(t,a){if(t&1&&(uh(0,"app-job-status-table",18),_D(1,ve,1,3,"nz-pagination",28)),t&2){let e=HD();lh("jobs",e.historyJobs()),gI(),MD(e.historyTotal()>e.pageSize||e.historyPageIndex()>1?1:-1);}}var we=20,Se=50,Ee=3e3,se=["completed","failed","cancelled"],Qe=(()=>{class t{constructor(){this.jobsApi=C($),this.workflowsApi=C(b),this.route=C(C1),this.transloco=C(Ve),this.destroyRef=C(at),this.pageSize=we,this.historyStatusOptions=["all",...se],this.runningJobs=qo([]),this.queuedSteps=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.queuedLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.queuedError=qo(null),this.historyError=qo(null),this.runningWorkflowId=qo(""),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Uw(()=>{let e=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?e+s:e+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadQueued({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue$1(this.destroyRef)).subscribe(e=>{let s=e.get("status");s&&se.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadQueued(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(e){return `jobs.status.${e}`}isPolling(){return this.polling()}setHistoryStatusFilter(e){this.historyStatusFilter.set(e),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(e){this.runningWorkflowId.set(e),this.loadRunning();}setHistoryWorkflowId(e){this.historyWorkflowId.set(e),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(e){this.showChildJobs.set(e),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(e){this.historyPageIndex.set(e),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e);},error:()=>{this.workflows.set([]);}});}loadRunning(e={}){let s$1=this.runningWorkflowId();e.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r$1({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Se,offset:0})).pipe(ue$1(this.destroyRef)).subscribe({next:o=>{this.runningJobs.set(o),this.runningLoading.set(false);},error:o=>{this.runningLoading.set(false),!e.silent&&this.runningError.set(this.errorMessage(o,this.transloco.translate("jobs.list.loadFailed")));}});}queuedWaitLabel(e){let s=Date.now()-Date.parse(e),o=Number.isFinite(s)?Math.max(0,Math.floor(s/1e3)):0;if(o<60)return `${o}s`;let m=Math.floor(o/60);return m<60?`${m}m`:`${Math.floor(m/60)}h`}loadQueued(e={}){e.silent||(this.queuedLoading.set(true),this.queuedError.set(null)),this.jobsApi.listQueued().pipe(ue$1(this.destroyRef)).subscribe({next:s=>{this.queuedSteps.set(s),this.queuedLoading.set(false);},error:s=>{this.queuedLoading.set(false),!e.silent&&this.queuedError.set(this.errorMessage(s,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(e={}){let s$1=this.historyStatusFilter(),o=this.historyWorkflowId();e.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r$1(r$1({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),o?{workflowId:o}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue$1(this.destroyRef)).subscribe({next:m=>{this.historyJobs.set(m),this.historyLoading.set(false);},error:m=>{this.historyLoading.set(false),!e.silent&&this.historyError.set(this.errorMessage(m,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadQueued({silent:true}),this.loadHistory({silent:true});},Ee),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(e,s){return e instanceof bi||e instanceof Error?e.message:s}static{this.\u0275fac=function(s){return new(s||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-job-list"]],decls:62,vars:37,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-queued",1,"section"],[1,"section-header"],["data-testid","queued-loading"],["data-testid","queued-error",1,"error"],["data-testid","queued-empty",1,"section-empty"],["data-testid","jobs-queued-table",1,"queued-table"],["data-testid","jobs-running",1,"section"],[1,"filters"],[1,"field"],["data-testid","running-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],[3,"nzValue","nzLabel"],["data-testid","running-loading"],["data-testid","running-error",1,"error"],["data-testid","running-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-history",1,"section","section-history"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],[3,"routerLink"],["data-testid","queued-agent"],["data-testid","queued-wait"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,o){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc()(),_i(5,"label",2),mh("ngModelChange",function(b){return o.setShowChildJobs(b)}),Iw(6),Pw(7,"transloco"),Jc(),iE(),_i(8,"section",3)(9,"header",4)(10,"h2"),Iw(11),Pw(12,"transloco"),Jc()(),_D(13,le,3,3,"p",5)(14,de,2,1,"p",6)(15,pe,3,3,"p",7)(16,ce,15,9,"table",8),Jc(),_i(17,"section",9)(18,"header",4)(19,"h2"),Iw(20),Pw(21,"transloco"),Jc()(),_i(22,"div",10)(23,"div",11)(24,"span"),Iw(25),Pw(26,"transloco"),Jc(),_i(27,"nz-select",12),mh("ngModelChange",function(b){return o.setRunningWorkflowId(b)}),uh(28,"nz-option",13),Pw(29,"transloco"),xD(30,he,1,2,"nz-option",14,oe),Jc(),iE(),Jc()(),_D(32,me,3,3,"p",15)(33,ge,2,1,"p",16)(34,fe,3,3,"p",17)(35,be,1,1,"app-job-status-table",18),Jc(),_i(36,"section",19)(37,"header",4)(38,"h2"),Iw(39),Pw(40,"transloco"),Jc()(),_i(41,"div",10)(42,"div",11)(43,"span"),Iw(44),Pw(45,"transloco"),Jc(),_i(46,"nz-select",20),mh("ngModelChange",function(b){return o.setHistoryStatusFilter(b)}),xD(47,_e,3,6,"nz-option",14,ND),Jc(),iE(),Jc(),_i(49,"div",11)(50,"span"),Iw(51),Pw(52,"transloco"),Jc(),_i(53,"nz-select",21),mh("ngModelChange",function(b){return o.setHistoryWorkflowId(b)}),uh(54,"nz-option",13),Pw(55,"transloco"),xD(56,ye,1,2,"nz-option",14,oe),Jc(),iE(),Jc()(),_D(58,Ce,3,3,"p",22)(59,xe,2,1,"p",23)(60,Me,3,3,"p",24)(61,Ie,2,2),Jc()()),s&2&&(gI(3),Lh(Fw(4,17,"jobs.list.title")),gI(2),lh("ngModel",o.showChildJobs()),aE(),gI(),rl$1(" ",Fw(7,19,"jobs.list.showChildJobs")," "),gI(5),Lh(Fw(12,21,"jobs.list.queued")),gI(2),MD(o.queuedLoading()?13:o.queuedError()?14:o.queuedSteps().length===0?15:16),gI(7),Lh(Fw(21,23,"jobs.list.running")),gI(5),Lh(Fw(26,25,"jobs.list.filterByWorkflow")),gI(2),lh("ngModel",o.runningWorkflowId()),aE(),gI(),lh("nzLabel",Fw(29,27,"jobs.list.filterAll")),gI(2),AD(o.workflows()),gI(2),MD(o.runningLoading()?32:o.runningError()?33:o.runningJobs().length===0?34:35),gI(7),Lh(Fw(40,29,"jobs.list.history")),gI(5),Lh(Fw(45,31,"jobs.list.filterByStatus")),gI(2),lh("ngModel",o.historyStatusFilter()),aE(),gI(),AD(o.historyStatusOptions),gI(4),Lh(Fw(52,33,"jobs.list.filterByWorkflow")),gI(2),lh("ngModel",o.historyWorkflowId()),aE(),gI(),lh("nzLabel",Fw(55,35,"jobs.list.filterAll")),gI(2),AD(o.workflows()),gI(2),MD(o.historyLoading()?58:o.historyError()?59:o.historyJobs().length===0?60:61));},dependencies:[$8,al,rl,$i,v3,Lt,ut,Di,mn,ex,Fm,Am,Lt$1,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.child-toggle[_ngcontent-%COMP%]{align-self:flex-start}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-history[_ngcontent-%COMP%]{padding-top:1.25rem;border-top:1px solid #e7e5e4}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.queued-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .queued-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{text-align:left;padding:.5rem .75rem .5rem 0;border-bottom:1px solid #e7e5e4}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e;font-weight:600}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{we as JOB_LIST_PAGE_SIZE,Se as JOB_RUNNING_LIMIT,Ee as JOB_RUNNING_POLL_MS,Qe as JobListComponent,se as TERMINAL_JOB_STATUSES};
@@ -1 +1 @@
1
- import {C,b4 as N2,aV as ix,b_ as u,b5 as cx,i as ie}from'./main-SI5AKDMC.js';var b=(()=>{class r{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflows`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(cx())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}create(t){return this.http.post(this.baseUrl,t).pipe(cx())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(cx())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}exportDefinition(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/export`).pipe(cx())}importDefinition(t){return this.http.post(`${this.baseUrl}/import`,t).pipe(cx())}getInstructions(){return this.http.get(`${this.baseUrl}/instructions`,{responseType:"text"}).pipe(cx())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{b};
1
+ import {C,b4 as N2,aV as ix,b_ as u,b5 as cx,i as ie}from'./main-3VZRFHGG.js';var b=(()=>{class r{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflows`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(cx())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}create(t){return this.http.post(this.baseUrl,t).pipe(cx())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(cx())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}exportDefinition(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/export`).pipe(cx())}importDefinition(t){return this.http.post(`${this.baseUrl}/import`,t).pipe(cx())}getInstructions(){return this.http.get(`${this.baseUrl}/instructions`,{responseType:"text"}).pipe(cx())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{b};