@knoflows/engine 0.1.0-alpha.10 → 0.1.0-alpha.12

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 (51) hide show
  1. package/dist/engine.js +12 -12
  2. package/package.json +2 -2
  3. package/static/assets/i18n/en.json +34 -0
  4. package/static/assets/i18n/es.json +34 -0
  5. package/static/{chunk-CgqRVtSF.js → chunk--F2Y9kLC.js} +1 -1
  6. package/static/{chunk-jct1_zOr.js → chunk-A3t8CipM.js} +1 -1
  7. package/static/{chunk-2KSNHCgb.js → chunk-BAgwFLbm.js} +1 -1
  8. package/static/{chunk-B2hO-qT3.js → chunk-BLSuZA6j.js} +1 -1
  9. package/static/{chunk-W5GAgssE.js → chunk-Bc9kVhav.js} +1 -1
  10. package/static/{chunk-BUuwGTt7.js → chunk-BdrifDCS.js} +7 -7
  11. package/static/{chunk-CJDp11v5.js → chunk-BkJuaRUH.js} +1 -1
  12. package/static/chunk-BmP-Xct3.js +1 -0
  13. package/static/{chunk-XLpSkczx.js → chunk-BqB1I-vg.js} +1 -1
  14. package/static/{chunk-eSxb3-OU.js → chunk-BquoV7tV.js} +1 -1
  15. package/static/{chunk-BVw7xkK9.js → chunk-C3Ej8Ue9.js} +1 -1
  16. package/static/chunk-C5T1qa5G.js +1 -0
  17. package/static/{chunk-DNOjVPY0.js → chunk-CK-2DsDH.js} +1 -1
  18. package/static/{chunk-cHfOiAJm.js → chunk-CKFZoQzp.js} +1 -1
  19. package/static/{chunk-DblClAqu.js → chunk-CLNhyiRm.js} +1 -1
  20. package/static/{chunk-A4AkMf2s.js → chunk-CN5_Adst.js} +1 -1
  21. package/static/{chunk-DQnMulwi.js → chunk-COSsVdG3.js} +1 -1
  22. package/static/chunk-Cj-KtAk-.js +1 -0
  23. package/static/{chunk-3mppll1n.js → chunk-CrD5w72_.js} +1 -1
  24. package/static/chunk-D5Bqg3D5.js +7 -0
  25. package/static/chunk-DAfnL0eP.js +1 -0
  26. package/static/{chunk-Cd8F2jeN.js → chunk-Dc3mv2RT.js} +1 -1
  27. package/static/chunk-Dc7Nho4-.js +1 -0
  28. package/static/{chunk-BjZIiizu.js → chunk-Df_jRm7U.js} +1 -1
  29. package/static/{chunk-mzyds3TS.js → chunk-Dl9xoaKd.js} +1 -1
  30. package/static/{chunk-Ojn34cvU.js → chunk-DqECIHE5.js} +1 -1
  31. package/static/{chunk-B8MrNxxk.js → chunk-Dtfc5XNc.js} +1 -1
  32. package/static/chunk-DxtF2GQ1.js +1 -0
  33. package/static/{chunk-CJRNatUw.js → chunk-KhdCYqqN.js} +1 -1
  34. package/static/{chunk-BAc0DRm8.js → chunk-TkjFi8lV.js} +1 -1
  35. package/static/{chunk-DjibVmY7.js → chunk-UArWmYDU.js} +1 -1
  36. package/static/{chunk-CWbxWv5I.js → chunk-WGWZEfc0.js} +1 -1
  37. package/static/{chunk-CEcbtdnK.js → chunk-hEYSTlD1.js} +1 -1
  38. package/static/{chunk-Cf_xd8ER.js → chunk-jg6TAN9F.js} +1 -1
  39. package/static/{chunk-CDWIMt6y.js → chunk-mb666CWY.js} +1 -1
  40. package/static/{chunk-hZzW00VR.js → chunk-nXCKNQUo.js} +1 -1
  41. package/static/{chunk-wbdetocK.js → chunk-ndsN8K7Q.js} +3 -3
  42. package/static/{chunk-tYnBYi0l.js → chunk-tnTBlRRN.js} +1 -1
  43. package/static/index.html +1 -1
  44. package/static/{main-MNK6ZYDO.js → main-RRKPLQCF.js} +1 -1
  45. package/static/chunk-6BQlxALO.js +0 -1
  46. package/static/chunk-BFkZ796p.js +0 -7
  47. package/static/chunk-BNOYZq-b.js +0 -1
  48. package/static/chunk-BbcTWKT2.js +0 -1
  49. package/static/chunk-BhGgxvgu.js +0 -1
  50. package/static/chunk-D6YfO72h.js +0 -1
  51. package/static/chunk-DoXxOh8j.js +0 -1
@@ -0,0 +1,7 @@
1
+ import {G as Gn,u as un}from'./chunk-BquoV7tV.js';import {f}from'./chunk-KhdCYqqN.js';import {B as Bt}from'./chunk-Df_jRm7U.js';import {c,u,f as f$1,o as o$1,l}from'./chunk-CxBYhrEj.js';import {W,I}from'./chunk-CK-2DsDH.js';import'./chunk-CrD5w72_.js';import'./chunk-hEYSTlD1.js';import {C,a as ae,T as Ie$1,$,V as Ve$1,b as at$1,q as qo,H as Hw,u as ue$1,W as rd,Y as Bw,o,Q as QE,M as Mi,L as Ln,d as dd,z as zc,c as t7,Z as y7,K as Kt,f as _i,m as bD,g as Kc,p as gI,B as _D,a0 as $0,a1 as B0,v as vw,R as Rw,P as Ph,O as Ow,E as VD,F as LD,h as gh,G as Pu,I as Lu,w as nl,a2 as Pw,a3 as xw,x as ch,N as ND,A as xD,l as lh,a4 as Mh,a5 as ah,U as Lh,a6 as Nw,a7 as MD}from'./main-RRKPLQCF.js';var ue=t=>({index:t}),me=()=>[],he=(t,l)=>l.definition.id,ve=(t,l)=>l.index;function Se(t,l){if(t&1){let e=LD();_i(0,"div",1)(1,"button",2),gh("click",function(){Pu(e);let o=VD();return Lu(o.closeIteration())}),vw(2),Rw(3,"transloco"),Kc(),_i(4,"p",3),vw(5),Rw(6,"transloco"),Kc(),_i(7,"app-job-step-workspace",4),gh("selectExecution",function(o){Pu(e);let x=VD();return Lu(x.onNestedSelect(o))})("retryStep",function(){Pu(e);let o=VD();return Lu(o.retryStep.emit())}),Kc()();}if(t&2){let e=l,i=VD();gI(2),nl(" ",Ow(3,11,"jobs.detail.loopBack")," "),gI(3),nl(" ",Pw(6,13,"jobs.detail.loopIteration",xw(16,ue,e.index+1))," "),gI(2),ch("definitions",i.nestedLoopDefinition().steps)("executions",e.stepExecutions)("job",i.job())("selectedExecutionId",i.nestedSelectedId())("currentExecutionId",i.currentExecutionId())("waitingEvent",null)("canResume",false)("canRetryStep",i.canRetryStep())("retryingStep",i.retryingStep());}}function Ee(t,l){if(t&1&&(_i(0,"nz-tag"),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=VD().$implicit,i=VD(2);ah("data-testid","step-status-"+e.definition.id),gI(),Ph(Ow(2,2,i.stepStatusKey(l.status)));}}function ye(t,l){if(t&1){let e=LD();_i(0,"li")(1,"button",9),gh("click",function(){let o=Pu(e).$implicit,x=VD(2);return Lu(x.onStepClick(o))}),_i(2,"span",10),vw(3),Kc(),_i(4,"span",11)(5,"span",12),vw(6),Rw(7,"transloco"),Kc(),bD(8,Ee,3,4,"nz-tag"),Kc()()();}if(t&2){let e,i=l.$implicit,o=VD(2);gI(),Mh("selected",o.isSelected(i))("current",o.isCurrent(i))("unreached",!i.reached),ch("disabled",!i.reached),ah("data-testid","step-"+i.definition.id),gI(2),Ph(i.definition.name),gI(3),Ph(Ow(7,11,o.stepTypeKey(i.definition.type))),gI(2),_D((e=i.execution)?8:-1,e);}}function we(t,l){t&1&&(_i(0,"p",8),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.noStepSelected")," "));}function ke(t,l){t&1&&(_i(0,"p",17),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"jobs.detail.inProgress.loop")));}function Te(t,l){if(t&1){let e=LD();_i(0,"li")(1,"button",20),gh("click",function(){let o=Pu(e).$implicit,x=VD(4);return Lu(x.openIteration(x.selectedDefinition(),o))}),vw(2),Rw(3,"transloco"),Kc()();}if(t&2){let e=l.$implicit;gI(),ah("data-testid","loop-iteration-"+e.index),gI(),nl(" ",Pw(3,2,"jobs.detail.loopIteration",xw(5,ue,e.index+1))," ");}}function Ie(t,l){t&1&&(_i(0,"li",12),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"jobs.detail.noIterations")));}function je(t,l){if(t&1&&(_i(0,"p",19),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function De(t,l){if(t&1&&(_i(0,"div",13)(1,"h3"),vw(2),Kc(),bD(3,ke,3,3,"p",17),_i(4,"ul",18),ND(5,Te,4,7,"li",null,ve,false,Ie,3,3,"li",12),Kc(),bD(8,je,2,1,"p",19),Kc()),t&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:-1),gI(2),xD(e.selectedExecution().iterations??Nw(4,me)),gI(3),_D(e.selectedExecution().error?8:-1);}}function Me(t,l){t&1&&(_i(0,"p",17),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress.sub_workflow")," "));}function Je(t,l){if(t&1&&(_i(0,"p",19),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function Pe(t,l){if(t&1&&(_i(0,"div",14)(1,"h3"),vw(2),Kc(),bD(3,Me,3,3,"p",17),lh(4,"app-job-status-table",21),bD(5,Je,2,1,"p",19),Kc()),t&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:-1),gI(),ch("jobIds",e.selectedExecution().childJobIds??Nw(4,me)),gI(),_D(e.selectedExecution().error?5:-1);}}function Ne(t,l){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=l.$implicit;gI(),Ph(e);}}function Ve(t,l){t&1&&(_i(0,"li",12),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"jobs.resume.noQuestions")));}function Re(t,l){if(t&1&&(_i(0,"p",26),vw(1),Kc()),t&2){let e=VD(5);gI(),Ph(e.resumeParseError());}}function We(t,l){if(t&1){let e=LD();_i(0,"section",22)(1,"h4"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul",24),ND(5,Ne,2,1,"li",null,MD,false,Ve,3,3,"li",12),Kc(),_i(8,"label"),vw(9),Rw(10,"transloco"),_i(11,"textarea",25),gh("input",function(o){Pu(e);let x=VD(4);return Lu(x.onResumeTextInput(o))}),Kc()(),bD(12,Re,2,1,"p",26),_i(13,"button",27),gh("click",function(){Pu(e);let o=VD(4);return Lu(o.resumeSubmit.emit())}),vw(14),Rw(15,"transloco"),Kc()();}if(t&2){let e=VD(4);gI(2),Ph(Ow(3,7,"jobs.resume.heading")),gI(3),xD(e.waitingPrompts()),gI(4),nl(" ",Ow(10,9,"jobs.resume.jsonLabel")," "),gI(2),ch("value",e.resumeText()),gI(),_D(e.resumeParseError()?12:-1),gI(),ch("disabled",e.resuming()),gI(),nl(" ",Ow(15,11,e.resuming()?"jobs.resume.submitting":"jobs.resume.button")," ");}}function ze(t,l){if(t&1&&(_i(0,"pre",23),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function Oe(t,l){if(t&1&&(_i(0,"div",15)(1,"h3"),vw(2),Kc(),bD(3,We,16,13,"section",22)(4,ze,2,1,"pre",23),Kc()),t&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.showResume()?3:4);}}function Be(t,l){t&1&&(_i(0,"p",17),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress.extract")," "));}function Fe(t,l){t&1&&(_i(0,"p",12),vw(1),Rw(2,"transloco"),_i(3,"code",36),vw(4),Kc()()),t&2&&(gI(),nl(" ",Ow(2,2,"jobs.extract.pattern")," "),gI(3),Ph(l));}function Ae(t,l){if(t&1){let e=LD();_i(0,"section",28)(1,"h4"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"p",12),vw(5),Rw(6,"transloco"),Kc(),_i(7,"pre",30),vw(8),Kc(),bD(9,Fe,5,4,"p",12),_i(10,"label"),vw(11),Rw(12,"transloco"),_i(13,"input",31),gh("input",function(o){Pu(e);let x=VD(4);return Lu(x.onExtractValueInput(o))}),Kc()(),_i(14,"div",32)(15,"button",33),gh("click",function(){Pu(e);let o=VD(4);return Lu(o.provideExtractValue())}),vw(16),Rw(17,"transloco"),Kc(),_i(18,"button",34),gh("click",function(){Pu(e);let o=VD(4);return Lu(o.continueExtract())}),vw(19),Rw(20,"transloco"),Kc(),_i(21,"button",35),gh("click",function(){Pu(e);let o=VD(4);return Lu(o.cancelExtract())}),vw(22),Rw(23,"transloco"),Kc()()();}if(t&2){let e,i=VD(4);gI(2),Ph(Ow(3,12,"jobs.extract.heading")),gI(3),Ph(Ow(6,14,"jobs.extract.sourceValue")),gI(3),Ph(i.extractSourceDisplay()),gI(),_D((e=i.extractPauseData()?.pattern)?9:-1,e),gI(2),nl(" ",Ow(12,16,"jobs.extract.valueLabel")," "),gI(2),ch("value",i.extractValue()),gI(2),ch("disabled",i.resuming()),gI(),nl(" ",Ow(17,18,"jobs.extract.provideValue")," "),gI(2),ch("disabled",i.resuming()),gI(),nl(" ",Ow(20,20,"jobs.extract.continue")," "),gI(2),ch("disabled",i.resuming()),gI(),nl(" ",Ow(23,22,"jobs.extract.cancel")," ");}}function Le(t,l){if(t&1&&(_i(0,"p",29),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function $e(t,l){if(t&1&&(_i(0,"pre",23),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function qe(t,l){if(t&1&&(_i(0,"div",16)(1,"h3"),vw(2),Kc(),bD(3,Be,3,3,"p",17)(4,Ae,24,24,"section",28)(5,Le,2,1,"p",29)(6,$e,2,1,"pre",23),Kc()),t&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:e.showExtractResume()?4:e.selectedExecution().error||e.selectedExecution().status==="failed"?5:6);}}function Ke(t,l){if(t&1&&(_i(0,"p",17),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=VD(4);gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress."+e.selectedExecution().type)," ");}}function Qe(t,l){if(t&1){let e=LD();_i(0,"button",38),gh("click",function(){Pu(e);let o=VD(5);return Lu(o.retryStep.emit())}),vw(1),Rw(2,"transloco"),Kc();}if(t&2){let e=VD(5);ch("disabled",e.retryingStep()),gI(),nl(" ",Ow(2,2,e.retryingStep()?"jobs.detail.retrying":"jobs.detail.retryStep")," ");}}function He(t,l){if(t&1&&(_i(0,"p",29),vw(1),Kc(),bD(2,Qe,3,4,"button",37)),t&2){let e=VD(4);gI(),Ph(e.selectedExecution().error),gI(),_D(e.showRetryStep()?2:-1);}}function Ue(t,l){if(t&1&&(_i(0,"pre",23),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function Ge(t,l){if(t&1&&(_i(0,"div")(1,"h3"),vw(2),Kc(),bD(3,Ke,3,3,"p",17)(4,He,3,2)(5,Ue,2,1,"pre",23),Kc()),t&2){let e=VD(3);ah("data-testid",e.selectedExecution().type+"-view"),gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:e.selectedExecution().error||e.selectedExecution().status==="failed"?4:5);}}function Xe(t,l){if(t&1&&bD(0,De,9,5,"div",13)(1,Pe,6,5,"div",14)(2,Oe,5,2,"div",15)(3,qe,7,2,"div",16)(4,Ge,6,3,"div"),t&2){let e,i=VD(2);_D((e=i.selectedExecution().type)==="loop"?0:e==="sub_workflow"?1:e==="interaction"?2:e==="extract"?3:4);}}function Ye(t,l){if(t&1&&(_i(0,"aside",5)(1,"h3"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul",6),ND(5,ye,9,13,"li",null,he),Kc()(),_i(7,"section",7),bD(8,we,3,3,"p",8)(9,Xe,5,1),Kc()),t&2){let e=VD();gI(2),Ph(Ow(3,2,"jobs.detail.stepsHeading")),gI(3),xD(e.rows()),gI(3),_D(e.selectedExecution()?9:8);}}var _e=(()=>{class t{constructor(){this.definitions=$0.required(),this.executions=$0.required(),this.job=$0.required(),this.selectedExecutionId=$0(null),this.currentExecutionId=$0(null),this.waitingEvent=$0(null),this.resumeText=$0(`{
2
+
3
+ }`),this.resumeParseError=$0(null),this.resuming=$0(false),this.canResume=$0(false),this.canRetryStep=$0(false),this.retryingStep=$0(false),this.selectExecution=B0(),this.resumeTextChange=B0(),this.resumeSubmit=B0(),this.extractResume=B0(),this.retryStep=B0(),this.nestedIteration=qo(null),this.nestedLoopDefinition=qo(null),this.nestedSelectedId=qo(null),this.extractValue=qo(""),this.rows=Hw(()=>o$1(this.definitions(),this.executions())),this.selectedExecution=Hw(()=>{let e=this.selectedExecutionId();return e?this.executions().find(i=>i.id===e)??null:null}),this.selectedDefinition=Hw(()=>{let e=this.selectedExecution();return e?this.definitions().find(i=>i.id===e.stepDefinitionId)??null:null}),this.waitingPrompts=Hw(()=>{let e=this.waitingEvent();return e?e.questions.length>0?e.questions:e.data!=null?[JSON.stringify(e.data,null,2)]:[]:[]}),this.showResume=Hw(()=>{if(!this.canResume())return false;let e=this.selectedExecution(),i=this.currentExecutionId();return e!=null&&e.id===i&&e.type==="interaction"&&this.job().status==="waiting_for_human"}),this.showExtractResume=Hw(()=>{if(!this.canResume())return false;let e=this.selectedExecution(),i=this.currentExecutionId();return e!=null&&e.id===i&&e.type==="extract"&&this.job().status==="waiting_for_human"}),this.extractPauseData=Hw(()=>{let e=this.waitingEvent();if(e&&pe(e.data))return e.data;let i=this.selectedExecution()?.output;return pe(i)?i:null}),this.showRetryStep=Hw(()=>{if(!this.canRetryStep())return false;let e=this.selectedExecution();return !e||e.status!=="failed"||e.id!==this.currentExecutionId()?false:l(e.type)});}stepStatusKey(e){return `jobs.stepStatus.${e}`}stepTypeKey(e){return `step-list.stepType.${e}`}onStepClick(e){!e.reached||!e.execution||(this.nestedIteration.set(null),this.nestedLoopDefinition.set(null),this.selectExecution.emit(e.execution.id));}openIteration(e,i){this.nestedLoopDefinition.set(e),this.nestedIteration.set(i);let o=i.stepExecutions[0];this.nestedSelectedId.set(o?.id??null);}closeIteration(){this.nestedIteration.set(null),this.nestedLoopDefinition.set(null),this.nestedSelectedId.set(null);}onNestedSelect(e){this.nestedSelectedId.set(e);}onResumeTextInput(e){this.resumeTextChange.emit(e.target.value);}onExtractValueInput(e){this.extractValue.set(e.target.value);}extractSourceDisplay(){let e=this.extractPauseData();return e?Ze(e.sourceValue):""}provideExtractValue(){this.extractResume.emit({action:"provide_value",value:this.extractValue()});}continueExtract(){this.extractResume.emit({action:"continue"});}cancelExtract(){this.extractResume.emit({action:"cancel"});}formatOutput(e){return e.error?e.error:e.output===void 0?"":typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2)}isRunning(e){return e?.status==="running"}isSelected(e){return e.execution!=null&&e.execution.id===this.selectedExecutionId()}isCurrent(e){return e.execution!=null&&e.execution.id===this.currentExecutionId()}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-job-step-workspace"]],inputs:{definitions:[1,"definitions"],executions:[1,"executions"],job:[1,"job"],selectedExecutionId:[1,"selectedExecutionId"],currentExecutionId:[1,"currentExecutionId"],waitingEvent:[1,"waitingEvent"],resumeText:[1,"resumeText"],resumeParseError:[1,"resumeParseError"],resuming:[1,"resuming"],canResume:[1,"canResume"],canRetryStep:[1,"canRetryStep"],retryingStep:[1,"retryingStep"]},outputs:{selectExecution:"selectExecution",resumeTextChange:"resumeTextChange",resumeSubmit:"resumeSubmit",extractResume:"extractResume",retryStep:"retryStep"},decls:3,vars:1,consts:[["data-testid","job-step-workspace",1,"workspace"],["data-testid","loop-drill-in",1,"nested"],["nz-button","","nzType","link","type","button","data-testid","loop-back",3,"click"],[1,"nested-label"],[3,"selectExecution","retryStep","definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","canResume","canRetryStep","retryingStep"],["data-testid","step-side-panel",1,"side-panel"],[1,"step-list"],["data-testid","step-main-area",1,"main-area"],["data-testid","no-step-selected",1,"muted"],["type","button",1,"step-button",3,"click","disabled"],[1,"step-name"],[1,"step-meta"],[1,"muted"],["data-testid","loop-view"],["data-testid","sub-workflow-view"],["data-testid","interaction-view"],["data-testid","extract-view"],["data-testid","step-in-progress"],["data-testid","loop-iterations",1,"iteration-list"],[1,"error"],["nz-button","","nzType","link","type","button",3,"click"],[3,"jobIds"],["data-testid","resume-form",1,"resume"],["data-testid","step-output"],["data-testid","waiting-questions"],["data-testid","resume-json","rows","8",3,"input","value"],["data-testid","resume-parse-error",1,"error"],["nz-button","","nzType","primary","type","button","data-testid","resume-button",3,"click","disabled"],["data-testid","extract-resume-form",1,"resume"],["data-testid","step-error",1,"error"],["data-testid","extract-source-value"],["data-testid","extract-value",3,"input","value"],[1,"extract-actions"],["nz-button","","nzType","primary","type","button","data-testid","extract-provide",3,"click","disabled"],["nz-button","","type","button","data-testid","extract-continue",3,"click","disabled"],["nz-button","","nzDanger","","type","button","data-testid","extract-cancel",3,"click","disabled"],["data-testid","extract-pattern"],["nz-button","","nzType","primary","type","button","data-testid","retry-step",3,"disabled"],["nz-button","","nzType","primary","type","button","data-testid","retry-step",3,"click","disabled"]],template:function(i,o){if(i&1&&(_i(0,"div",0),bD(1,Se,8,18,"div",1)(2,Ye,10,4),Kc()),i&2){let x;gI(),_D((x=o.nestedIteration())?1:2,x);}},dependencies:[t,Mi,dd,zc,t7,y7,W,I,Bt,Kt],styles:[".workspace[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(14rem,18rem) 1fr;gap:1rem;align-items:start;min-height:20rem}.nested[_ngcontent-%COMP%]{grid-column:1 / -1}.nested-label[_ngcontent-%COMP%]{margin:0 0 .75rem;color:#57534e}.side-panel[_ngcontent-%COMP%]{border:1px solid #d6d3d1;background:#ffffffbf;padding:.75rem}.side-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem}.step-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.35rem}.step-button[_ngcontent-%COMP%]{width:100%;text-align:left;font:inherit;padding:.45rem .55rem;border:1px solid transparent;background:transparent;cursor:pointer;display:flex;flex-direction:column;gap:.2rem}.step-button[_ngcontent-%COMP%]:hover:not(:disabled){background:#f5f5f4}.step-button.selected[_ngcontent-%COMP%]{border-color:#a8a29e;background:#fafaf9}.step-button.current[_ngcontent-%COMP%]{box-shadow:inset 3px 0 #0c0a09}.step-button[_ngcontent-%COMP%]:disabled, .step-button.unreached[_ngcontent-%COMP%]{opacity:.55;cursor:not-allowed}.step-name[_ngcontent-%COMP%]{font-weight:600}.step-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;font-size:.8rem}.main-area[_ngcontent-%COMP%]{border:1px solid #d6d3d1;background:#ffffffd9;padding:1rem;min-height:16rem}.main-area[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:0}.muted[_ngcontent-%COMP%]{color:#78716c}.error[_ngcontent-%COMP%]{color:#9f1239}[data-testid=retry-step][_ngcontent-%COMP%]{margin-top:.5rem}pre[_ngcontent-%COMP%]{overflow:auto;padding:.75rem;background:#f5f5f4;border:1px solid #d6d3d1;font-size:.85rem}.iteration-list[_ngcontent-%COMP%]{padding-left:1.1rem}.resume[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0}.resume[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .resume[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font:inherit;font-family:ui-monospace,Consolas,monospace;padding:.4rem .5rem;border:1px solid #a8a29e}.extract-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}@media(max-width:48rem){.workspace[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]});}}return t})();function pe(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)&&"sourceValue"in t}function Ze(t){return t==null?"":typeof t=="string"?t:JSON.stringify(t,null,2)}function et(t,l){t&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function tt(t,l){if(t&1&&(_i(0,"p",2),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function it(t,l){if(t&1&&(vw(0),Rw(1,"transloco")),t&2){let e=VD(2);Lh(" ",Ow(1,2,"jobs.detail.worktreeDeleted")," ",e.worktreeDeletedAt," ");}}function nt(t,l){if(t&1&&vw(0),t&2){let e=VD(3);nl(" (",e.branch,") ");}}function ot(t,l){if(t&1&&(vw(0),Rw(1,"transloco"),bD(2,nt,1,1)),t&2){let e=VD(2);Lh(" ",Ow(1,3,"jobs.detail.worktree")," ",e.worktreePath," "),gI(2),_D(e.branch?2:-1);}}function rt(t,l){if(t&1&&(_i(0,"p",10),bD(1,it,2,4)(2,ot,3,5),Kc()),t&2){let e=VD();gI(),_D(e.worktreeDeletedAt?1:2);}}function at(t,l){if(t&1){let e=LD();_i(0,"button",19),gh("click",function(){Pu(e);let o=VD(2);return Lu(o.cancelJob())}),vw(1),Rw(2,"transloco"),Kc();}if(t&2){let e=VD(2);ch("disabled",e.cancelling()),gI(),nl(" ",Ow(2,2,e.cancelling()?"jobs.detail.cancelling":"jobs.detail.cancel")," ");}}function st(t,l){if(t&1){let e=LD();_i(0,"button",20),gh("click",function(){Pu(e);let o=VD(2);return Lu(o.retryWorkflow())}),vw(1),Rw(2,"transloco"),Kc();}if(t&2){let e=VD(2);ch("disabled",e.retryingWorkflow()),gI(),nl(" ",Ow(2,2,e.retryingWorkflow()?"jobs.detail.retrying":"jobs.detail.retryWorkflow")," ");}}function lt(t,l){if(t&1){let e=LD();_i(0,"button",21),gh("click",function(){Pu(e);let o=VD(2);return Lu(o.jumpToCurrent())}),vw(1),Rw(2,"transloco"),Kc();}t&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.jumpToCurrent")," "));}function ct(t,l){if(t&1&&(_i(0,"p",15),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.actionError());}}function dt(t,l){t&1&&(lh(0,"nz-alert",16),Rw(1,"transloco")),t&2&&ch("nzMessage",Ow(1,1,"jobs.detail.queued"));}function pt(t,l){if(t&1){let e=LD();_i(0,"app-job-step-workspace",22),gh("selectExecution",function(o){Pu(e);let x=VD(2);return Lu(x.onSelectExecution(o))})("resumeTextChange",function(o){Pu(e);let x=VD(2);return Lu(x.setResumeText(o))})("resumeSubmit",function(){Pu(e);let o=VD(2);return Lu(o.submitResume())})("extractResume",function(o){Pu(e);let x=VD(2);return Lu(x.submitExtractResume(o))})("retryStep",function(){Pu(e);let o=VD(2);return Lu(o.retryThisStep())}),Kc();}if(t&2){let e=VD(),i=VD();ch("definitions",l.steps)("executions",e.stepHistory)("job",e)("selectedExecutionId",i.viewedExecutionId())("currentExecutionId",i.blockingExecutionId()??i.currentStep()?.id??null)("waitingEvent",i.waitingEvent())("resumeText",i.resumeText())("resumeParseError",i.resumeParseError())("resuming",i.resuming())("canResume",true)("canRetryStep",e.status==="failed")("retryingStep",i.retryingStep());}}function ut(t,l){t&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.workflowMissing")," "));}function mt(t,l){if(t&1&&(_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"span",7),vw(9),Kc(),vw(10," \xB7 "),_i(11,"nz-tag",8),vw(12),Rw(13,"transloco"),Kc(),vw(14," \xB7 "),_i(15,"span",9),vw(16),Kc()(),bD(17,rt,3,1,"p",10),Kc(),_i(18,"div",11),bD(19,at,3,4,"button",12),bD(20,st,3,4,"button",13),bD(21,lt,3,3,"button",14),Kc()(),bD(22,ct,2,1,"p",15),bD(23,dt,2,3,"nz-alert",16)(24,pt,1,12,"app-job-step-workspace",17)(25,ut,3,3,"p",18)),t&2){let e,i=l,o=VD();gI(3),Ph(Ow(4,11,"jobs.detail.backToStart")),gI(3),Ph(i.id),gI(3),Ph(i.workflowId),gI(3),Ph(Ow(13,13,o.statusKey(i.status))),gI(4),Ph(o.subjectText()),gI(),_D(i.worktreePath?17:-1),gI(2),_D(o.isTerminalStatus(i.status)?-1:19),gI(),_D(i.status==="failed"?20:-1),gI(),_D(o.showJumpToCurrent()?21:-1),gI(),_D(o.actionError()?22:-1),gI(),_D(o.showQueued()?23:(e=o.workflow())?24:25,e);}}var zt=(()=>{class t{constructor(){this.route=C(ae),this.router=C(Ie$1),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve$1),this.destroyRef=C(at$1),this.job=qo(null),this.workflow=qo(null),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.eventStream=qo(null),this.eventsSnapshot=qo([]),this.autoFollow=qo(true),this.viewedExecutionId=qo(null),this.resumeText=qo(`{
4
+
5
+ }`),this.resumeParseError=qo(null),this.resuming=qo(false),this.retryingWorkflow=qo(false),this.retryingStep=qo(false),this.cancelling=qo(false),this.currentStep=Hw(()=>{let e=this.job();return e?c(e):null}),this.showQueued=Hw(()=>{let e=this.job();return e!=null&&c(e)==null}),this.showJumpToCurrent=Hw(()=>{let e=this.currentStep();return e?this.viewedExecutionId()!==e.id:false}),this.eventLog=Hw(()=>this.eventStream()?.events()??this.eventsSnapshot()),this.waitingEvent=Hw(()=>{let e=this.eventLog();for(let i=e.length-1;i>=0;i-=1){let o=e[i];if(o?.type==="waiting_for_human")return o}return null}),this.blockingExecutionId=Hw(()=>this.job()?.currentStepExecutionId??null),this.destroyRef.onDestroy(()=>this.closeStream()),this.route.paramMap.pipe(ue$1(this.destroyRef)).subscribe(e=>{let i=e.get("id");if(!i){this.loading.set(false),this.loadError.set(this.transloco.translate("jobs.detail.loadFailed"));return}this.load(i);}),rd(()=>{let e=this.eventStream();if(!e)return;let i=e.latest();i&&Bw(()=>{(i.type==="step_started"||i.type==="step_completed"||i.type==="step_failed"||i.type==="waiting_for_human"||i.type==="waiting_for_children"||i.type==="human_answered"||i.type==="job_completed"||i.type==="job_failed"||i.type==="job_cancelled")&&this.refreshJob(i.jobId),(i.type==="job_completed"||i.type==="job_failed"||i.type==="job_cancelled")&&this.closeStream();});}),rd(()=>{let e=this.currentStep();this.autoFollow()&&Bw(()=>{this.viewedExecutionId.set(e?.id??null);});});}statusKey(e){return `jobs.status.${e}`}isTerminalStatus(e){return u(e)}subjectText(){return f$1(this.job()?.subjectContext)??"\u2014"}onSelectExecution(e){this.autoFollow.set(false),this.viewedExecutionId.set(e);}jumpToCurrent(){this.autoFollow.set(true),this.viewedExecutionId.set(this.currentStep()?.id??null);}setResumeText(e){this.resumeText.set(e),this.resumeParseError.set(null);}submitResume(){let e=this.job();if(!e)return;let i;try{i=JSON.parse(this.resumeText());}catch(o){this.resumeParseError.set(o instanceof Error?o.message:this.transloco.translate("jobs.resume.invalidJson"));return}this.resumeParseError.set(null),this.actionError.set(null),this.resuming.set(true),this.jobsApi.resume(e.id,i).subscribe({next:o=>{this.resuming.set(false),this.applyJob(o),u(o.status)&&this.closeStream();},error:o=>{this.resuming.set(false),this.actionError.set(this.errorMessage(o,this.transloco.translate("jobs.errors.resumeFailed")));}});}submitExtractResume(e){let i=this.job();i&&(this.actionError.set(null),this.resuming.set(true),this.jobsApi.resume(i.id,e).subscribe({next:o=>{this.resuming.set(false),this.applyJob(o),u(o.status)&&this.closeStream();},error:o=>{this.resuming.set(false),this.actionError.set(this.errorMessage(o,this.transloco.translate("jobs.errors.resumeFailed")));}}));}retryWorkflow(){let e=this.job();!e||e.status!=="failed"||this.retryingWorkflow()||(this.actionError.set(null),this.retryingWorkflow.set(true),this.jobsApi.retry(e.id).subscribe({next:i=>{this.retryingWorkflow.set(false),this.router.navigate(["/jobs",i.id]);},error:i=>{this.retryingWorkflow.set(false),this.actionError.set(this.errorMessage(i,this.transloco.translate("jobs.errors.retryFailed")));}}));}retryThisStep(){let e=this.job();!e||e.status!=="failed"||this.retryingStep()||(this.actionError.set(null),this.retryingStep.set(true),this.jobsApi.retryStep(e.id).subscribe({next:i=>{this.retryingStep.set(false),this.applyJob(i),u(i.status)?this.closeStream():(this.closeStream(),this.eventStream.set(this.eventsService.connect({jobId:i.id})));},error:i=>{this.retryingStep.set(false),this.actionError.set(this.errorMessage(i,this.transloco.translate("jobs.errors.retryStepFailed")));}}));}cancelJob(){let e=this.job();!e||u(e.status)||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.jobsApi.cancel(e.id).subscribe({next:i=>{this.cancelling.set(false),this.applyJob(i),u(i.status)&&this.closeStream();},error:i=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(i,this.transloco.translate("jobs.errors.cancelFailed")));}}));}load(e){this.loading.set(true),this.loadError.set(null),this.actionError.set(null),this.autoFollow.set(true),this.viewedExecutionId.set(null),this.resumeText.set(`{
6
+
7
+ }`),this.resumeParseError.set(null),this.retryingWorkflow.set(false),this.retryingStep.set(false),this.cancelling.set(false),this.closeStream(),this.eventsSnapshot.set([]),this.jobsApi.get(e).pipe(ue$1(this.destroyRef)).subscribe({next:i=>{this.applyJob(i),this.loading.set(false),u(i.status)||this.eventStream.set(this.eventsService.connect({jobId:i.id}));},error:i=>{this.loading.set(false),this.loadError.set(this.errorMessage(i,this.transloco.translate("jobs.detail.loadFailed")));}});}applyJob(e){this.job.set(e),this.workflow.set(e.workflowSnapshot??null),this.autoFollow()&&this.viewedExecutionId.set(c(e)?.id??null);}refreshJob(e){this.jobsApi.get(e).subscribe({next:i=>this.applyJob(i),error:i=>{this.actionError.set(this.errorMessage(i,this.transloco.translate("jobs.errors.refreshFailed")));}});}closeStream(){let e=this.eventStream();e&&(this.eventsSnapshot.set(e.events()),e.close(),this.eventStream.set(null));}errorMessage(e,i){return e instanceof o||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-job-detail"]],decls:4,vars:1,consts:[["data-testid","job-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/jobs"],["data-testid","job-id"],[1,"meta"],["data-testid","job-workflow"],["data-testid","job-status"],["data-testid","job-subject"],["data-testid","job-worktree",1,"meta"],[1,"header-actions"],["nz-button","","nzDanger","","type","button","data-testid","cancel-job",3,"disabled"],["nz-button","","nzType","primary","type","button","data-testid","retry-workflow",3,"disabled"],["nz-button","","type","button","data-testid","jump-to-current"],["data-testid","action-error",1,"error"],["data-testid","queued-message","nzType","info",3,"nzMessage"],[3,"definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resumeText","resumeParseError","resuming","canResume","canRetryStep","retryingStep"],["data-testid","missing-workflow",1,"muted"],["nz-button","","nzDanger","","type","button","data-testid","cancel-job",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","retry-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","jump-to-current",3,"click"],[3,"selectExecution","resumeTextChange","resumeSubmit","extractResume","retryStep","definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resumeText","resumeParseError","resuming","canResume","canRetryStep","retryingStep"]],template:function(i,o){if(i&1&&(_i(0,"main",0),bD(1,et,3,3,"p",1)(2,tt,2,1,"p",2)(3,mt,26,15),Kc()),i&2){let x;gI(),_D(o.loading()?1:o.loadError()?2:(x=o.job())?3:-1,x);}},dependencies:[Mi,Ln,Gn,un,dd,zc,t7,y7,W,I,_e,Kt],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;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:.5rem;align-items:center}.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}.error[_ngcontent-%COMP%]{color:#9f1239}.muted[_ngcontent-%COMP%]{color:#78716c}"]});}}return t})();export{zt as JobDetailComponent};
@@ -0,0 +1 @@
1
+ import {I,_,b,v,T,y,h,E,P,A,j}from'./chunk-C5T1qa5G.js';import {N as Nt,K as Ke}from'./chunk-TkjFi8lV.js';import {$ as $$1,F,B}from'./chunk-CN5_Adst.js';import {C as Cx,h as hy,U as Um,t as ty,P as Py,Y as Ym,a as Uy,j as jy,l as lv,M as Mm,$ as $y}from'./chunk-BdrifDCS.js';import {z as ze,S as St}from'./chunk-BmP-Xct3.js';import'./chunk-DxtF2GQ1.js';import {X as Xt,Z as Zn$1}from'./chunk-mb666CWY.js';import {a as ai$1,z,o as ot,b as at$1,i as it,r as rt}from'./chunk-WGWZEfc0.js';import'./chunk-DqECIHE5.js';import {C,a as ae,T as Ie,aj as $,b as at,V as Ve$1,aS as O,aT as de,al as Se,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi$1,n as n8,am as S4,J as J6,k as k3,L as Ln$1,d as dd,z as zc,c as t7,Z as y7,X as Xb,e as V5,D as D5,K as Kt,f as _i$1,v as vw,g as Kc,R as Rw,h as gh,m as bD,p as gI,P as Ph,O as Ow,x as ch,w as nl,B as _D,a0 as $0,a1 as B0,W as rd,t as t$1,aU as $6,N as ND,a5 as ah,A as xD,E as VD,F as LD,j as oE,S as SD,a7 as MD,y as sE,an as YE,ao as uu,aV as Y0,aF as Z0,aW as N1,aX as q0,ar as _r,aY as Ee,au as a3,aw as Le,aZ as ga,a_ as j3,ax as m1,a$ as za,b0 as Uw,b1 as W0,b2 as D8,b3 as p9,b4 as a9,b5 as Kf,Y as Bw,b6 as g9,aA as pt,aB as Se$1,b7 as va,b8 as es,b9 as BD,aN as nh,ba as Lw,aG as Sw,aH as h1,bb as B1,aI as wo$1,bc as rD,bd as R4,be as cw,bf as Dh,bg as GD,bh as Eh,bi as U0,aQ as Jc,bj as mh,aR as Xc,a4 as Mh,l as lh,a2 as Pw,a3 as xw,bk as zD,G as Pu,I as Lu,bl as Vh,bm as jh,bn as $D,U as Lh,bo as ww,a6 as Nw}from'./main-RRKPLQCF.js';import {U}from'./chunk-jg6TAN9F.js';import {G as Gn$1,u as un$1}from'./chunk-BquoV7tV.js';import {W,I as I$1}from'./chunk-CK-2DsDH.js';import {L as Lt,u as ut}from'./chunk-CrD5w72_.js';import'./chunk-hEYSTlD1.js';var En=["input"],Tn=["inputNumberHost"],kn=[[["","nzInputAddonBefore",""]],[["","nzInputAddonAfter",""]],[["","nzInputPrefix",""]],[["","nzInputSuffix",""]],[["","nzInputNumberUpIcon",""]],[["","nzInputNumberDownIcon",""]]],In=["[nzInputAddonBefore]","[nzInputAddonAfter]","[nzInputPrefix]","[nzInputSuffix]","[nzInputNumberUpIcon]","[nzInputNumberDownIcon]"];function Nn(i,l){}function Fn(i,l){if(i&1&&nh(0,Nn,0,0,"ng-template",8),i&2){VD();let e=zD(4);ch("ngTemplateOutlet",e);}}function Vn(i,l){}function An(i,l){if(i&1&&nh(0,Vn,0,0,"ng-template",8),i&2){VD();let e=zD(8);ch("ngTemplateOutlet",e);}}function Pn(i,l){}function $n(i,l){if(i&1&&nh(0,Pn,0,0,"ng-template",8),i&2){VD();let e=zD(12);ch("ngTemplateOutlet",e);}}function Bn(i,l){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzAddonBefore());}}function Dn(i,l){i&1&&(_i$1(0,"div",10),$D(1,0,null,Bn,1,1),Kc());}function Ln(i,l){}function On(i,l){if(i&1&&nh(0,Ln,0,0,"ng-template",8),i&2){VD(2);let e=zD(6);ch("ngTemplateOutlet",e);}}function Wn(i,l){}function jn(i,l){if(i&1&&nh(0,Wn,0,0,"ng-template",8),i&2){VD(2);let e=zD(10);ch("ngTemplateOutlet",e);}}function Rn(i,l){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzAddonAfter());}}function Kn(i,l){i&1&&(_i$1(0,"div",10),$D(1,1,null,Rn,1,1),Kc());}function Hn(i,l){if(i&1&&(_i$1(0,"div",9),bD(1,Dn,3,0,"div",10),bD(2,On,1,1,null,8)(3,jn,1,1,null,8),bD(4,Kn,3,0,"div",10),Kc()),i&2){let e=VD();gI(),_D(e.hasAddonBefore()?1:-1),gI(),_D(e.hasAffix()?2:3),gI(2),_D(e.hasAddonAfter()?4:-1);}}function qn(i,l){}function Gn(i,l){if(i&1&&(_i$1(0,"div"),nh(1,qn,0,0,"ng-template",8),Kc()),i&2){let e=VD(),n=zD(8);cw(e.affixWrapperClass()),gI(),ch("ngTemplateOutlet",n);}}function Un(i,l){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzPrefix());}}function Zn(i,l){i&1&&(_i$1(0,"span",11),$D(1,2,null,Un,1,1),Kc());}function Qn(i,l){}function Yn(i,l){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzSuffix());}}function Jn(i,l){if(i&1&&lh(0,"nz-form-item-feedback-icon",13),i&2){let e=VD(3);ch("status",e.finalStatus());}}function Xn(i,l){if(i&1&&(_i$1(0,"span",12),$D(1,3,null,Yn,1,1),bD(3,Jn,1,1,"nz-form-item-feedback-icon",13),Kc()),i&2){let e=VD(2);gI(3),_D(e.hasFeedback()&&e.finalStatus()?3:-1);}}function ei(i,l){if(i&1&&(bD(0,Zn,3,0,"span",11),nh(1,Qn,0,0,"ng-template",8),bD(2,Xn,4,1,"span",12)),i&2){let e=VD(),n=zD(10);_D(e.hasPrefix()?0:-1),gI(),ch("ngTemplateOutlet",n),gI(),_D(e.hasSuffix()?2:-1);}}function ti(i,l){}function ni(i,l){if(i&1&&(_i$1(0,"div",null,5),nh(2,ti,0,0,"ng-template",8),Kc()),i&2){let e=VD(),n=zD(12);cw(e.inputNumberClass()),gI(2),ch("ngTemplateOutlet",n);}}function ii(i,l){i&1&&lh(0,"nz-icon",20);}function oi(i,l){i&1&&lh(0,"nz-icon",21);}function ai(i,l){if(i&1){let e=LD();_i$1(0,"div",17,7),gh("mouseup",function(){Pu(e);let t=VD(2);return Lu(t.stopAutoStep())})("mouseleave",function(){Pu(e);let t=VD(2);return Lu(t.stopAutoStep())}),_i$1(2,"span",18),gh("mousedown",function(t){Pu(e);let o=VD(2);return Lu(o.onStepMouseDown(t,true))}),$D(3,4,null,ii,1,0),Kc(),_i$1(5,"span",19),gh("mousedown",function(t){Pu(e);let o=VD(2);return Lu(o.onStepMouseDown(t,false))}),$D(6,5,null,oi,1,0),Kc()();}if(i&2){let e=VD(2);gI(2),Mh("ant-input-number-handler-up-disabled",e.upDisabled()),ah("aria-disabled",e.upDisabled()),gI(3),Mh("ant-input-number-handler-down-disabled",e.downDisabled()),ah("aria-disabled",e.downDisabled());}}function ri(i,l){if(i&1){let e=LD();bD(0,ai,8,6,"div",14),_i$1(1,"div",15)(2,"input",16,6),gh("input",function(){Pu(e);let t=zD(3),o=VD();return Lu(o.onInput(t.value))})("wheel",function(t){Pu(e);let o=VD();return Lu(o.onWheel(t))}),Kc()();}if(i&2){let e=VD();_D(e.nzControls()?0:-1),gI(2),ch("value",e.displayValue())("placeholder",e.nzPlaceHolder()??"")("disabled",e.finalDisabled())("readOnly",e.nzReadOnly()),ah("aria-valuemin",e.nzMin())("aria-valuemax",e.nzMax())("id",e.nzId())("step",e.nzStep())("value",e.displayValue());}}var tt=(()=>{class i{nzId=$0(null);nzSize=$0("default");nzPlaceHolder=$0(null);nzStatus=$0("");nzVariant=$0();nzStep=$0(1,{transform:Y0});nzMin=$0(Number.MIN_SAFE_INTEGER,{transform:Y0});nzMax=$0(Number.MAX_SAFE_INTEGER,{transform:Y0});nzPrecision=$0(null);nzParser=$0();nzFormatter=$0();nzDisabled=$0(false,{transform:Z0});nzReadOnly=$0(false,{transform:Z0});nzAutoFocus=$0(false,{transform:Z0});nzKeyboard=$0(true,{transform:Z0});nzControls=$0(true,{transform:Z0});nzChangeOnWheel=$0(true,{transform:Z0});nzPrefix=$0();nzSuffix=$0();nzAddonBefore=$0();nzAddonAfter=$0();nzBlur=B0();nzFocus=B0();nzOnStep=B0();onChange=()=>{};onTouched=()=>{};isDisabledFirstChange=true;compactSize=C(N1,{optional:true});inputRef=q0.required("input");hostRef=q0("inputNumberHost");elementRef=C(_r);injector=C(Ee);focusMonitor=C(a3);directionality=C(Le);nzFormStatusService=C(ga,{optional:true});autoStepTimer=null;defaultFormatter=e=>{let n=this.nzPrecision();return j3(n)?e.toFixed(n):e.toString()};value=qo(null);displayValue=qo("");formSize=C(m1,{optional:true});formVariant=C(za,{optional:true});dir=C(Le).valueSignal;focused=qo(false);hasFeedback=qo(false);finalStatus=Uw(()=>this.nzStatus());finalDisabled=Uw(()=>this.nzDisabled());prefix=W0(ot);suffix=W0(at$1);addonBefore=W0(it);addonAfter=W0(rt);hasPrefix=Hw(()=>!!this.nzPrefix()||!!this.prefix());hasSuffix=Hw(()=>!!this.nzSuffix()||!!this.suffix()||this.hasFeedback());hasAffix=Hw(()=>this.hasPrefix()||this.hasSuffix());hasAddonBefore=Hw(()=>!!this.nzAddonBefore()||!!this.addonBefore());hasAddonAfter=Hw(()=>!!this.nzAddonAfter()||!!this.addonAfter());hasAddon=Hw(()=>this.hasAddonBefore()||this.hasAddonAfter());class=Hw(()=>this.hasAddon()?this.groupWrapperClass():this.hasAffix()?this.affixWrapperClass():this.inputNumberClass());inputNumberClass=Hw(()=>r(r({"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&&!et(this.value(),this.nzMin(),this.nzMax())},p9("ant-input-number",this.finalVariant())),D8("ant-input-number",this.finalStatus(),this.hasFeedback())));affixWrapperClass=Hw(()=>r(r({"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"},D8("ant-input-number-affix-wrapper",this.finalStatus(),this.hasFeedback())),p9("ant-input-number-affix-wrapper",this.finalVariant())));groupWrapperClass=Hw(()=>r(r({"ant-input-number-group-wrapper":true,"ant-input-number-group-wrapper-rtl":this.dir()==="rtl"},D8("ant-input-number-group-wrapper",this.finalStatus(),this.hasFeedback())),p9("ant-input-number-group-wrapper",this.finalVariant())));finalSize=Hw(()=>this.formSize?.()?this.formSize():this.compactSize?this.compactSize():this.nzSize());finalVariant=Hw(()=>this.nzVariant()||this.formVariant?.()||"outlined");upDisabled=Hw(()=>!a9(this.value())&&this.value()>=this.nzMax());downDisabled=Hw(()=>!a9(this.value())&&this.value()<=this.nzMin());constructor(){let e=C(at);Kf(()=>{let n=this.hostRef(),t=n||this.elementRef;this.focusMonitor.monitor(t,true).pipe(ue(e)).subscribe(o=>{Bw(()=>{this.focused.set(!!o),o?this.nzFocus.emit():(this.fixValue(),this.onTouched(),this.nzBlur.emit());});}),e.onDestroy(()=>{this.focusMonitor.stopMonitoring(t);});}),this.nzFormStatusService?.formStatusChanges.pipe(ue()).subscribe(({status:n,hasFeedback:t})=>{this.finalStatus.set(n),this.hasFeedback.set(t);});}ngOnInit(){this.nzAutoFocus()&&Kf(()=>this.focus(),{injector:this.injector});}writeValue(e){a9(e)&&(e=null),Bw(()=>{this.value.set(e),this.setValue(e);});}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){Bw(()=>{this.finalDisabled.set(this.isDisabledFirstChange&&this.nzDisabled()||e);}),this.isDisabledFirstChange=false;}focus(e){g9(this.inputRef().nativeElement,e);}blur(){this.inputRef().nativeElement.blur();}step(e,n,t){if(n&&this.upDisabled()||!n&&this.downDisabled())return;let o=e.shiftKey?this.nzStep()*10:this.nzStep();n||(o=-o);let A=10**_n(o),K=cn((Math.round((this.value()||0)*A)+Math.round(o*A))/A,this.nzMin(),this.nzMax(),this.nzPrecision());this.setValue(K),this.nzOnStep.emit({type:n?"up":"down",value:this.value(),offset:this.nzStep(),emitter:t}),this.focus();}setValue(e){let n=this.nzFormatter()??this.defaultFormatter,t=this.nzPrecision();j3(t)&&(e&&=+e.toFixed(t));let o=a9(e)?"":n(e);this.displayValue.set(o),this.updateValue(e);}setValueByTyping(e){if(this.displayValue.set(e),e===""){this.updateValue(null);return}let t=(this.nzParser()??dn)(e);if(pi(e)||Number.isNaN(t))return;let o=this.nzFormatter();if(o){let d=o(t);this.displayValue.set(d);}et(t,this.nzMin(),this.nzMax())&&this.updateValue(t);}updateValue(e){this.value()!==e&&(this.value.set(e),this.onChange(e));}fixValue(){let e=this.displayValue();if(e==="")return;let t=(this.nzParser()??dn)(e);if(Number.isNaN(t))t=this.value();else {let o=this.nzPrecision();j3(o)&&_n(t)!==o&&(t=+t.toFixed(o)),et(t,this.nzMin(),this.nzMax())||(t=cn(t,this.nzMin(),this.nzMax(),o));}this.setValue(t);}stopAutoStep(){this.autoStepTimer!==null&&(clearTimeout(this.autoStepTimer),this.autoStepTimer=null);}onStepMouseDown(e,n){e.preventDefault(),this.stopAutoStep(),this.step(e,n,"handler");let t=()=>{this.step(e,n,"handler"),this.autoStepTimer=setTimeout(t,si);};this.autoStepTimer=setTimeout(t,li);}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(n){return new(n||i)};static \u0275cmp=QE({type:i,selectors:[["nz-input-number"]],contentQueries:function(n,t,o){n&1&&Eh(o,t.prefix,ot,5)(o,t.suffix,at$1,5)(o,t.addonBefore,it,5)(o,t.addonAfter,rt,5),n&2&&GD(4);},viewQuery:function(n,t){n&1&&Dh(t.inputRef,En,5)(t.hostRef,Tn,5),n&2&&GD(2);},hostVars:2,hostBindings:function(n,t){n&1&&gh("keydown",function(d){return t.onKeyDown(d)}),n&2&&cw(t.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:[Sw([{provide:h1,useExisting:wo$1(()=>i),multi:true},{provide:B1,useValue:"input-number"}]),rD([R4])],ngContentSelectors:In,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(n,t){n&1&&(BD(kn),bD(0,Fn,1,1,null,8)(1,An,1,1,null,8)(2,$n,1,1,null,8),nh(3,Hn,5,3,"ng-template",null,0,Lw)(5,Gn,2,3,"ng-template",null,1,Lw)(7,ei,3,3,"ng-template",null,2,Lw)(9,ni,3,3,"ng-template",null,3,Lw)(11,ri,4,10,"ng-template",null,4,Lw)),n&2&&_D(t.hasAddon()?0:t.hasAffix()?1:2);},dependencies:[pt,Se$1,va,es],encapsulation:2})}return i})(),si=200,li=600;function dn(i){let l=i.trim().replace(/,/g,"").replace(/。/g,".");return l.length?+l:NaN}function et(i,l,e){return i>=l&&i<=e}function cn(i,l,e,n=null){if(n===null)return i<l?l:i>e?e:i;let t=+i.toFixed(n),o=Math.pow(10,n);return t<l?Math.ceil(l*o)/o:t>e?Math.floor(e*o)/o:t}function _n(i){return i.toString().split(".")[1]?.length||0}function pi(i){return /[.。](\d*0)?$/.test(i.toString())}var mn=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=YE({type:i});static \u0275inj=uu({imports:[tt]})}return i})();var ci=i=>({action:i}),un=(i,l)=>l.token,_i=(i,l)=>l.subjectType,mi=(i,l)=>l.id+l.name;function ui(i,l){if(i&1){let e=LD();Jc(0,"li")(1,"span",11),vw(2),Xc(),Jc(3,"button",12),mh("click",function(){let t=Pu(e).$implicit,o=VD(3);return Lu(o.copyToken(t.token))}),vw(4),Xc()();}if(i&2){let e=l.$implicit,n=VD(3);gI(2),Ph(e.label),gI(),Mh("copied",n.copiedToken()===e.token),ah("data-testid","copy-token")("data-token",e.token),gI(),nl(" ",e.token," ");}}function xi(i,l){if(i&1&&(Jc(0,"div",6)(1,"h5"),vw(2),Rw(3,"transloco"),Xc(),Jc(4,"ul"),ND(5,ui,5,6,"li",null,un),Xc()()),i&2){let e=VD(2);gI(2),Ph(Ow(3,1,"step-list.availableParameters.inputs")),gI(3),xD(e.inputEntries());}}function Ci(i,l){if(i&1&&(Jc(0,"p",14),vw(1),Rw(2,"transloco"),Xc()),i&2){let e=VD().$implicit;gI(),Ph(Ow(2,1,e.typeKey));}}function fi(i,l){if(i&1){let e=LD();Jc(0,"li")(1,"button",12),mh("click",function(){let t=Pu(e).$implicit,o=VD(4);return Lu(o.copyToken(t.token))}),vw(2),Xc()();}if(i&2){let e=l.$implicit,n=VD(4);gI(),Mh("copied",n.copiedToken()===e.token),ah("data-testid","copy-token")("data-token",e.token),gI(),nl(" ",e.token," ");}}function gi(i,l){if(i&1&&(bD(0,Ci,3,3,"p",14),Jc(1,"ul"),ND(2,fi,3,5,"li",null,un),Xc()),i&2){let e=l.$implicit,n=VD(3);_D(n.subjectGroups().length>1?0:-1),gI(2),xD(e.tokens);}}function hi(i,l){if(i&1&&(Jc(0,"div",7)(1,"h5",13),vw(2),Rw(3,"transloco"),Xc(),ND(4,gi,4,1,null,null,_i),Xc()),i&2){let e=VD(2);gI(2),Lh(" ",Ow(3,2,"step-list.availableParameters.subject")," (",e.subjectTypeHeading(),") "),gI(2),xD(e.subjectGroups());}}function bi(i,l){i&1&&(Jc(0,"p",9),vw(1),Rw(2,"transloco"),Xc()),i&2&&(gI(),nl(" ",Ow(2,1,"step-list.availableParameters.noPrevious")," "));}function vi(i,l){i&1&&(Jc(0,"span",17),vw(1),Rw(2,"transloco"),Xc()),i&2&&(gI(),nl(" ",Ow(2,1,"step-list.availableParameters.loopOverwrite")," "));}function wi(i,l){i&1&&(Jc(0,"p",5),vw(1),Rw(2,"transloco"),Xc()),i&2&&(gI(),Ph(Ow(2,1,"step-list.availableParameters.missingId")));}function zi(i,l){if(i&1){let e=LD();Jc(0,"button",12),mh("click",function(){let t=Pu(e).$implicit,o=VD(5);return Lu(o.copyToken(t))}),vw(1),Xc();}if(i&2){let e=l.$implicit,n=VD(5);Mh("copied",n.copiedToken()===e),ah("data-testid","copy-token")("data-token",e),gI(),nl(" ",e," ");}}function Si(i,l){if(i&1&&(Jc(0,"div",18),ND(1,zi,2,5,"button",22,SD),Xc()),i&2){let e=VD().$implicit;gI(),xD(e.tokens);}}function yi(i,l){if(i&1&&(Jc(0,"p",19),vw(1),Rw(2,"transloco"),Xc()),i&2){let e=VD().$implicit;gI(),nl(" ",Pw(2,1,"step-list.availableParameters.providerOpaque",xw(4,ci,e.actionLabel))," ");}}function Mi(i,l){i&1&&(Jc(0,"p",19),vw(1),Rw(2,"transloco"),Xc()),i&2&&(gI(),nl(" ",Ow(2,1,"step-list.availableParameters.interactionOpaque")," "));}function Ei(i,l){i&1&&(Jc(0,"p",20),vw(1),Rw(2,"transloco"),Xc()),i&2&&(gI(),nl(" ",Ow(2,1,"step-list.availableParameters.subWorkflowArray")," "));}function Ti(i,l){i&1&&(Jc(0,"p",21),vw(1),Rw(2,"transloco"),Xc()),i&2&&(gI(),nl(" ",Ow(2,1,"step-list.availableParameters.noOutput")," "));}function ki(i,l){if(i&1&&(Jc(0,"li",15),Rw(1,"transloco"),Jc(2,"div",16)(3,"span",11),vw(4),Xc(),bD(5,vi,3,3,"span",17),Xc(),bD(6,wi,3,3,"p",5),bD(7,Si,3,0,"div",18),bD(8,yi,3,6,"p",19),bD(9,Mi,3,3,"p",19),bD(10,Ei,3,3,"p",20),bD(11,Ti,3,3,"p",21),Xc()),i&2){let e=l.$implicit;ah("data-testid","previous-step-"+e.id)("title",e.inLoop?Ow(1,10,"step-list.availableParameters.loopOverwrite"):null),gI(4),Ph(e.name||e.id),gI(),_D(e.inLoop?5:-1),gI(),_D(e.id?-1:6),gI(),_D(e.tokens.length>0?7:-1),gI(),_D(e.isProvider?8:-1),gI(),_D(e.isInteraction?9:-1),gI(),_D(e.isSubWorkflow?10:-1),gI(),_D(!e.shape.opaque&&(e.shape.fields?.length??0)===0&&!e.shape.isScalar?11:-1);}}function Ii(i,l){if(i&1&&(Jc(0,"ul",10),ND(1,ki,12,12,"li",15,mi),Xc()),i&2){let e=VD(2);gI(),xD(e.previousEntries());}}function Ni(i,l){if(i&1&&(Jc(0,"div",4)(1,"p",5),vw(2),Rw(3,"transloco"),Xc(),bD(4,xi,7,3,"div",6),bD(5,hi,6,4,"div",7),Jc(6,"div",8)(7,"h5"),vw(8),Rw(9,"transloco"),Xc(),bD(10,bi,3,3,"p",9)(11,Ii,3,0,"ul",10),Xc()()),i&2){let e=VD();gI(2),Ph(Ow(3,5,"step-list.availableParameters.hint")),gI(2),_D(e.inputEntries().length>0?4:-1),gI(),_D(e.subjectGroups().length>0?5:-1),gI(3),Ph(Ow(9,7,"step-list.availableParameters.previous")),gI(2),_D(e.previousEntries().length===0?10:11);}}var xn=(()=>{class i{constructor(){this.transloco=C(Ve$1),this.inputSchema=$0([]),this.appliesTo=$0("none"),this.previousSteps=$0([]),this.expanded=qo(false),this.copiedToken=qo(null),this.inputEntries=Hw(()=>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:Ym(e.name)}))),this.subjectGroups=Hw(()=>Uy(this.appliesTo()).map(e=>({subjectType:e.subjectType,typeKey:`workflow-editor.subjectType.${e.subjectType}`,tokens:e.fields.map(n=>({field:n,token:Ym(`subject.${n}`)}))}))),this.previousEntries=Hw(()=>this.previousSteps().map(({step:e,inLoop:n})=>{let t=e;return {name:t.name,id:t.id,inLoop:n,shape:lv(t),tokens:jy(t),actionLabel:Fi(t),isProvider:t.type==="provider_action",isInteraction:t.type==="interaction",isSubWorkflow:t.type==="sub_workflow"}}));}toggleExpanded(){this.expanded.update(e=>!e);}subjectTypeHeading(){return this.subjectGroups().map(e=>this.transloco.translate(e.typeKey)).join(", ")}copyToken(e){let n=navigator.clipboard;if(!n?.writeText){this.copiedToken.set(e);return}n.writeText(e).then(()=>this.copiedToken.set(e),()=>this.copiedToken.set(e));}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-available-parameters"]],inputs:{inputSchema:[1,"inputSchema"],appliesTo:[1,"appliesTo"],previousSteps:[1,"previousSteps"]},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","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","sub-workflow-note",1,"hint"],["data-testid","no-output-note",1,"hint"],["type","button",1,"param-token",3,"copied"]],template:function(n,t){n&1&&(Jc(0,"section",0)(1,"button",1),mh("click",function(){return t.toggleExpanded()}),Jc(2,"span",2),vw(3),Xc(),Jc(4,"span",3),vw(5),Rw(6,"transloco"),Xc()(),bD(7,Ni,12,9,"div",4),Xc()),n&2&&(Mh("expanded",t.expanded()),gI(),ah("aria-expanded",t.expanded()),gI(2),Ph(t.expanded()?"\u25BE":"\u25B8"),gI(2),Ph(Ow(6,6,"step-list.availableParameters.title")),gI(2),_D(t.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;align-items:center}.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 Fi(i){return i.type!=="provider_action"?"":i.extendedAction?.actionId??i.action}function Vi(i,l){if(i&1){let e=LD();_i$1(0,"div",1)(1,"input",3),Vh("ngModelChange",function(t){let o=Pu(e).$implicit;return ww(o.key,t)||(o.key=t),Lu(t)}),gh("ngModelChange",function(){Pu(e);let t=VD();return Lu(t.emitRows())}),Kc(),oE(),_i$1(2,"input",4),Vh("ngModelChange",function(t){let o=Pu(e).$implicit;return ww(o.value,t)||(o.value=t),Lu(t)}),gh("ngModelChange",function(){Pu(e);let t=VD();return Lu(t.emitRows())}),Kc(),oE(),_i$1(3,"button",5),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.remove(t))}),vw(4,"Remove"),Kc()();}if(i&2){let e=l.$implicit;gI(),jh("ngModel",e.key),sE(),gI(),jh("ngModel",e.value),sE();}}var vn=(()=>{class i{constructor(){this.rows=U0.required();}add(){this.rows.update(e=>[...e,{key:"",value:""}]);}remove(e){this.rows.update(n=>n.filter((t,o)=>o!==e));}emitRows(){this.rows.set(this.rows().map(e=>r({},e)));}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({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(n,t){n&1&&(_i$1(0,"div",0),ND(1,Vi,5,2,"div",1,MD),_i$1(3,"button",2),gh("click",function(){return t.add()}),vw(4,"Add param"),Kc()()),n&2&&(gI(),xD(t.rows()));},dependencies:[n8,S4,J6,k3,dd,zc,t7,y7,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 Ve(i,l){let e=Mm(i);return B(l,e).map(n=>n.id)}function zn(i,l){return Ve(i,l)[0]??""}function wn(i,l,e){let n=Ve(l,e);if(n.includes(i))return null;let t=(e?.providerInstances??[]).find(o=>o.id===i);return t?$y(t)&&Mm(l).includes(t.subjectType)?null:{required:i,active:n[0]??t.id}:{required:i,active:n[0]??""}}function Sn(i,l,e){if(i.extendedAction?.providerId){let n=wn(i.extendedAction.providerId,l,e);if(n)return n}return i.target?.source?wn(i.target.source,i.target.subjectType,e):null}function yn(i){return i.extendedAction!=null}var Bi=()=>[];function Di(i,l){return this.trackKey(l)}var Ae=(i,l)=>l.id,Li=(i,l)=>l.actionId,Oi=(i,l)=>l.name;function Wi(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.stepTypeKey(e)));}}function ji(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(4);ch("nzValue",e)("nzLabel",Ow(1,2,n.outputFormatKey(e)));}}function Ri(i,l){if(i&1&&lh(0,"nz-option",15),i&2){let e=l.$implicit;ch("nzValue",e.id)("nzLabel",e.displayName);}}function Ki(i,l){if(i&1){let e=LD();_i$1(0,"nz-tag",27),gh("nzOnClose",function(){let t=Pu(e).$implicit,o=VD(3).$index,d=VD();return Lu(d.removeContextFile(o,t.id))}),vw(1),Kc();}if(i&2){let e=l.$implicit;ah("data-testid","context-file-chip-"+e.id),gI(),nl(" ",e.name," ");}}function Hi(i,l){i&1&&(_i$1(0,"span",25),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"step-list.contextFilesEmpty")));}function qi(i,l){if(i&1){let e=LD();_i$1(0,"label",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"textarea",21),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{objective:t}))}),Kc(),oE(),Kc(),_i$1(5,"div",16)(6,"span"),vw(7),Rw(8,"transloco"),Kc(),_i$1(9,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{outputFormat:t}))}),ND(10,ji,2,4,"nz-option",15,SD),Kc(),oE(),Kc(),_i$1(12,"div",16)(13,"span"),vw(14),Rw(15,"transloco"),Kc(),_i$1(16,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.setAgentInstance(o,t))}),lh(17,"nz-option",15),Rw(18,"transloco"),ND(19,Ri,1,2,"nz-option",15,Ae),Kc(),oE(),Kc(),_i$1(21,"div",16)(22,"span"),vw(23),Rw(24,"transloco"),Kc(),_i$1(25,"div",23),ND(26,Ki,2,2,"nz-tag",24,Ae,false,Hi,3,3,"span",25),Kc(),_i$1(29,"button",26),gh("click",function(){Pu(e);let t=VD(2).$index,o=VD();return Lu(o.openContextFilePicker(t))}),vw(30),Rw(31,"transloco"),Kc()();}if(i&2){let e=VD(2),n=e.$implicit,t=e.$index,o=VD();gI(),ah("data-testid","agent-prompt-label-"+t),gI(),Ph(Ow(3,17,"step-list.objective")),gI(2),ch("ngModel",o.asAgent(n).objective),ah("data-testid","agent-objective-"+t),sE(),gI(3),Ph(Ow(8,19,"step-list.outputFormat.label")),gI(2),ch("ngModel",o.asAgent(n).outputFormat),ah("data-testid","agent-output-"+t),sE(),gI(),xD(o.outputFormats),gI(4),Ph(Ow(15,21,"step-list.agentInstance.label")),gI(2),ch("ngModel",o.asAgent(n).agentInstanceId??null),ah("data-testid","agent-instance-"+t),sE(),gI(),ch("nzValue",null)("nzLabel",Ow(18,23,"step-list.agentInstance.default")),gI(2),xD(o.agentInstanceOptions()),gI(2),ah("data-testid","agent-context-files-"+t),gI(2),Ph(Ow(24,25,"step-list.contextFiles")),gI(3),xD(o.selectedContextFiles(o.asAgent(n))),gI(3),ah("data-testid","select-context-files-"+t),gI(),nl(" ",Ow(31,27,"step-list.selectContextFiles")," ");}}function Gi(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(4);ch("nzValue",e)("nzLabel",Ow(1,2,n.interactionKey(e)));}}function Ui(i,l){if(i&1){let e=LD();_i$1(0,"div",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{interaction:t}))}),ND(5,Gi,2,4,"nz-option",15,SD),Kc(),oE(),Kc();}if(i&2){let e=VD(2),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,3,"step-list.interaction.label")),gI(2),ch("ngModel",o.asInteraction(n).interaction),ah("data-testid","interaction-type-"+t),sE(),gI(),xD(o.interactions);}}function Zi(i,l){if(i&1){let e=LD();_i$1(0,"label",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"textarea",21),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{command:t}))}),Kc(),oE(),Kc();}if(i&2){let e=VD(2),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,3,"step-list.command")),gI(2),ch("ngModel",o.asShell(n).command),ah("data-testid","shell-command-"+t),sE();}}function Qi(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(4);ch("nzValue",e)("nzLabel",Ow(1,2,n.onNoMatchKey(e)));}}function Yi(i,l){if(i&1){let e=LD();_i$1(0,"label",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"textarea",28),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{source:t}))}),Kc(),oE(),Kc(),_i$1(5,"label",16)(6,"span"),vw(7),Rw(8,"transloco"),Kc(),_i$1(9,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{path:t}))}),Kc(),oE(),Kc(),_i$1(10,"label",16)(11,"span"),vw(12),Rw(13,"transloco"),Kc(),_i$1(14,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{pattern:t}))}),Kc(),oE(),Kc(),_i$1(15,"div",16)(16,"span"),vw(17),Rw(18,"transloco"),Kc(),_i$1(19,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{onNoMatch:t}))}),ND(20,Qi,2,4,"nz-option",15,SD),Kc(),oE(),Kc();}if(i&2){let e=VD(2),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,12,"step-list.extract.source")),gI(2),ch("ngModel",o.asExtract(n).source),ah("data-testid","extract-source-"+t),sE(),gI(3),Ph(Ow(8,14,"step-list.extract.path")),gI(2),ch("ngModel",o.asExtract(n).path??""),ah("data-testid","extract-path-"+t),sE(),gI(3),Ph(Ow(13,16,"step-list.extract.pattern")),gI(2),ch("ngModel",o.asExtract(n).pattern??""),ah("data-testid","extract-pattern-"+t),sE(),gI(3),Ph(Ow(18,18,"step-list.extract.onNoMatch")),gI(2),ch("ngModel",o.asExtract(n).onNoMatch),ah("data-testid","extract-on-no-match-"+t),sE(),gI(),xD(o.extractOnNoMatchActions);}}function Ji(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(4);ch("nzValue",e)("nzLabel",Ow(1,2,n.gitOperationKey(e)));}}function Xi(i,l){if(i&1){let e=LD();_i$1(0,"label",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(4).$index,d=VD();return Lu(d.setGitParam(o,"baseBranch",t))}),Kc(),oE(),Kc(),_i$1(5,"label",16)(6,"span"),vw(7),Rw(8,"transloco"),Kc(),_i$1(9,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(4).$index,d=VD();return Lu(d.setGitParam(o,"branchName",t))}),Kc(),oE(),Kc();}if(i&2){let e=VD(4),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,6,"step-list.createWorktree.baseBranch")),gI(2),ch("ngModel",o.gitParam(o.asGit(n),"baseBranch")),ah("data-testid","git-base-branch-"+t),sE(),gI(3),Ph(Ow(8,8,"step-list.createWorktree.branchName")),gI(2),ch("ngModel",o.gitParam(o.asGit(n),"branchName")),ah("data-testid","git-branch-name-"+t),sE();}}function eo(i,l){if(i&1){let e=LD();_i$1(0,"label",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(4).$index,d=VD();return Lu(d.setGitParam(o,"branch",t))}),Kc(),oE(),Kc();}if(i&2){let e=VD(4),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,3,"step-list.createWorktree.branch")),gI(2),ch("ngModel",o.gitParam(o.asGit(n),"branch")),ah("data-testid","git-branch-"+t),sE();}}function to(i,l){if(i&1){let e=LD();_i$1(0,"div",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(3).$index,d=VD();return Lu(d.setCreateWorktreeMode(o,t))}),lh(5,"nz-option",29),Rw(6,"transloco"),lh(7,"nz-option",30),Rw(8,"transloco"),Kc(),oE(),Kc(),_i$1(9,"label",16)(10,"span"),vw(11),Rw(12,"transloco"),Kc(),_i$1(13,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(3).$index,d=VD();return Lu(d.setGitParam(o,"repoPath",t))}),Kc(),oE(),Kc(),bD(14,Xi,10,10)(15,eo,5,5,"label",16);}if(i&2){let e=VD(3),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,9,"step-list.createWorktree.mode")),gI(2),ch("ngModel",o.createWorktreeMode(o.asGit(n))),ah("data-testid","git-worktree-mode-"+t),sE(),gI(),ch("nzLabel",Ow(6,11,"step-list.createWorktree.newBranch")),gI(2),ch("nzLabel",Ow(8,13,"step-list.createWorktree.existingBranch")),gI(4),Ph(Ow(12,15,"step-list.createWorktree.repoPath")),gI(2),ch("ngModel",o.gitParam(o.asGit(n),"repoPath")),ah("data-testid","git-repo-path-"+t),sE(),gI(),_D(o.createWorktreeMode(o.asGit(n))==="new-branch"?14:15);}}function no(i,l){if(i&1){let e=LD();_i$1(0,"div",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"app-key-value-editor",31),gh("rowsChange",function(t){Pu(e);let o=VD(3),d=o.$implicit,A=o.$index,K=VD();return Lu(K.onParamRowsChange(A,d,t))}),Kc()();}if(i&2){let e=VD(3).$implicit,n=VD();gI(2),Ph(Ow(3,2,"step-list.params")),gI(2),ch("rows",n.paramRows(e));}}function io(i,l){if(i&1){let e=LD();_i$1(0,"div",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{operation:t}))}),ND(5,Ji,2,4,"nz-option",15,SD),Kc(),oE(),Kc(),bD(7,to,16,17)(8,no,5,4,"div",16);}if(i&2){let e=VD(2),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,4,"step-list.operation")),gI(2),ch("ngModel",o.asGit(n).operation),ah("data-testid","git-operation-"+t),sE(),gI(),xD(o.gitOperations),gI(2),_D(o.asGit(n).operation==="create_worktree"?7:8);}}function oo(i,l){if(i&1&&lh(0,"nz-alert",32),i&2){let e=VD(3).$index;ch("nzMessage",l),ah("data-testid","extended-action-mismatch-"+e);}}function ao(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(5);ch("nzValue",e)("nzLabel",Ow(1,2,n.subjectTypeKey(e)));}}function ro(i,l){if(i&1&&lh(0,"nz-option",15),i&2){let e=l.$implicit;ch("nzValue",e.id)("nzLabel",e.displayName);}}function so(i,l){if(i&1){let e=LD();_i$1(0,"div",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(3).$index,d=VD();return Lu(d.setTargetSubjectType(o,t))}),ND(5,ao,2,4,"nz-option",15,SD),Kc(),oE(),Kc(),_i$1(7,"div",16)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i$1(11,"nz-select",36),Rw(12,"transloco"),gh("ngModelChange",function(t){Pu(e);let o=VD(3).$index,d=VD();return Lu(d.setTargetSource(o,t))}),ND(13,ro,1,2,"nz-option",15,Ae),Kc(),oE(),Kc(),_i$1(15,"label",16)(16,"span"),vw(17),Rw(18,"transloco"),Kc(),_i$1(19,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(3).$index,d=VD();return Lu(d.setTargetSubjectId(o,t))}),Kc(),oE(),_i$1(20,"span",19),vw(21),Rw(22,"transloco"),Kc()();}if(i&2){let e=l,n=VD(3),t=n.$implicit,o=n.$index,d=VD();gI(2),Ph(Ow(3,11,"step-list.target.subjectType")),gI(2),ch("ngModel",e.subjectType),ah("data-testid","provider-action-target-type-"+o),sE(),gI(),xD(d.targetSubjectTypes),gI(4),Ph(Ow(10,13,"step-list.target.source")),gI(2),ch("ngModel",e.source||null)("nzPlaceHolder",Ow(12,15,"step-list.target.sourcePlaceholder")),ah("data-testid","provider-action-target-source-"+o),sE(),gI(2),xD(d.targetInstanceOptions(d.asProvider(t))),gI(4),Ph(Ow(18,17,"step-list.target.subjectId")),gI(2),ch("ngModel",e.subjectId),ah("data-testid","provider-action-target-id-"+o),sE(),gI(2),Ph(Ow(22,19,"step-list.target.subjectIdHint"));}}function lo(i,l){if(i&1&&lh(0,"nz-option",15),i&2){let e=l.$implicit,n=VD(5);ch("nzValue",e)("nzLabel",n.providerLabel(e));}}function po(i,l){if(i&1&&lh(0,"nz-option",15),i&2){let e=l.$implicit;ch("nzValue",e.actionId)("nzLabel",e.label);}}function co(i,l){i&1&&(_i$1(0,"span",19),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"step-list.extendedAction.empty")));}function _o(i,l){i&1&&(_i$1(0,"span",37),vw(1,"*"),Kc());}function mo(i,l){if(i&1&&lh(0,"nz-option",15),i&2){let e=l.$implicit;ch("nzValue",e)("nzLabel",e);}}function uo(i,l){if(i&1){let e=LD();_i$1(0,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD().$implicit,d=VD(5).$index,A=VD();return Lu(A.setExtendedParam(d,o.name,t))}),ND(1,mo,1,2,"nz-option",15,SD),Kc(),oE();}if(i&2){let e=VD().$implicit,n=VD(5),t=n.$implicit,o=n.$index,d=VD();ch("ngModel",d.extendedParamValue(d.asProvider(t),e.name)),ah("data-testid","extended-action-param-"+e.name+"-"+o),sE(),gI(),xD(e.options??Nw(2,Bi));}}function xo(i,l){if(i&1){let e=LD();_i$1(0,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD().$implicit,d=VD(5).$index,A=VD();return Lu(A.setExtendedParam(d,o.name,t))}),Kc(),oE();}if(i&2){let e=VD().$implicit,n=VD(5),t=n.$implicit,o=n.$index,d=VD();ch("ngModel",d.extendedParamValue(d.asProvider(t),e.name)),ah("data-testid","extended-action-param-"+e.name+"-"+o),sE();}}function Co(i,l){if(i&1&&(_i$1(0,"label",16)(1,"span"),vw(2),bD(3,_o,2,0,"span",37),Kc(),bD(4,uo,3,3,"nz-select",38)(5,xo,1,2,"input",39),Kc()),i&2){let e=l.$implicit;gI(2),nl(" ",e.label," "),gI(),_D(e.required?3:-1),gI(),_D(e.type==="select"?4:5);}}function fo(i,l){i&1&&ND(0,Co,6,3,"label",16,Oi),i&2&&xD(l.params);}function go(i,l){if(i&1){let e=LD();_i$1(0,"div",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(3).$index,d=VD();return Lu(d.setExtendedProvider(o,t))}),ND(5,lo,1,2,"nz-option",15,SD),Kc(),oE(),Kc(),_i$1(7,"div",16)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i$1(11,"nz-select",36),Rw(12,"transloco"),gh("ngModelChange",function(t){Pu(e);let o=VD(3).$index,d=VD();return Lu(d.setExtendedAction(o,t))}),ND(13,po,1,2,"nz-option",15,Li),Kc(),oE(),bD(15,co,3,3,"span",19),Kc(),bD(16,fo,2,0);}if(i&2){let e,n=VD(3),t=n.$implicit,o=n.$index,d=VD();gI(2),Ph(Ow(3,9,"step-list.extendedAction.provider")),gI(2),ch("ngModel",d.asProvider(t).extendedAction?.providerId),ah("data-testid","extended-action-provider-"+o),sE(),gI(),xD(d.extendedProviderOptions()),gI(4),Ph(Ow(10,11,"step-list.extendedAction.action")),gI(2),ch("ngModel",d.asProvider(t).extendedAction?.actionId||null)("nzPlaceHolder",Ow(12,13,"step-list.extendedAction.none")),ah("data-testid","extended-action-id-"+o),sE(),gI(2),xD(d.extendedDescriptors(d.asProvider(t))),gI(2),_D(d.extendedDescriptors(d.asProvider(t)).length===0?15:-1),gI(),_D((e=d.selectedExtendedDescriptor(d.asProvider(t)))?16:-1,e);}}function ho(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(5);ch("nzValue",e)("nzLabel",Ow(1,2,n.providerActionKey(e)));}}function bo(i,l){if(i&1){let e=LD();_i$1(0,"div",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(3).$index,d=VD();return Lu(d.patchAt(o,{action:t}))}),ND(5,ho,2,4,"nz-option",15,SD),Kc(),oE(),Kc(),_i$1(7,"div",16)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i$1(11,"app-key-value-editor",31),gh("rowsChange",function(t){Pu(e);let o=VD(3),d=o.$implicit,A=o.$index,K=VD();return Lu(K.onParamRowsChange(A,d,t))}),Kc()();}if(i&2){let e=VD(3),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,5,"step-list.action")),gI(2),ch("ngModel",o.asProvider(n).action),ah("data-testid","provider-action-"+t),sE(),gI(),xD(o.providerActions),gI(4),Ph(Ow(10,7,"step-list.params")),gI(2),ch("rows",o.paramRows(n));}}function vo(i,l){if(i&1){let e=LD();bD(0,oo,1,2,"nz-alert",32),_i$1(1,"label",33),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.setTargetEnabled(o,t))}),vw(2),Rw(3,"transloco"),Kc(),oE(),bD(4,so,23,21),_i$1(5,"div",16)(6,"span"),vw(7),Rw(8,"transloco"),Kc(),_i$1(9,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.setActionMode(o,t))}),lh(10,"nz-option",34),Rw(11,"transloco"),lh(12,"nz-option",35),Rw(13,"transloco"),Kc(),oE(),Kc(),bD(14,go,17,15)(15,bo,12,9);}if(i&2){let e,n,t=VD(2),o=t.$implicit,d=t.$index,A=VD();_D((e=A.mismatchWarning(A.asProvider(o)))?0:-1,e),gI(),ch("ngModel",A.hasTarget(o)),ah("data-testid","provider-action-target-toggle-"+d),sE(),gI(),nl(" ",Ow(3,11,"step-list.target.toggle")," "),gI(2),_D((n=A.asProvider(o).target)?4:-1,n),gI(3),Ph(Ow(8,13,"step-list.extendedAction.mode")),gI(2),ch("ngModel",A.isExtended(o)?"extended":"portable"),ah("data-testid","provider-action-mode-"+d),sE(),gI(),ch("nzLabel",Ow(11,15,"step-list.extendedAction.portable")),gI(2),ch("nzLabel",Ow(13,17,"step-list.extendedAction.extended")),gI(2),_D(A.isExtended(o)?14:15);}}function wo(i,l){if(i&1&&lh(0,"nz-option",15),i&2){let e=l.$implicit,n=VD(4);ch("nzValue",e.id)("nzLabel",n.workflowOptionLabel(e));}}function zo(i,l){if(i&1){let e=LD();_i$1(0,"div",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"nz-select",40),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{workflowId:t}))}),ND(5,wo,1,2,"nz-option",15,Ae),Kc(),oE(),Kc(),_i$1(7,"p",16)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i$1(11,"code",41),vw(12,"selection"),Kc()();}if(i&2){let e=VD(2),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,4,"step-list.workflowId")),gI(2),ch("ngModel",o.asSubWorkflow(n).workflowId),ah("data-testid","sub-workflow-id-"+t),sE(),gI(),xD(o.availableWorkflows()),gI(4),Ph(Ow(10,6,"step-list.forEach"));}}function So(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(4);ch("nzValue",e)("nzLabel",Ow(1,2,n.untilTypeKey(e)));}}function yo(i,l){if(i&1){let e=LD();_i$1(0,"label",16)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(3).$index,d=VD();return Lu(d.setUntilValue(o,t))}),Kc(),oE(),Kc();}if(i&2){let e=VD(3),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,3,"step-list.until.value")),gI(2),ch("ngModel",o.untilValue(o.asLoop(n))),ah("data-testid","loop-until-value-"+t),sE();}}function Mo(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(4);ch("nzValue",e)("nzLabel",Ow(1,2,n.onMaxIterationsKey(e)));}}function Eo(i,l){if(i&1){let e=LD();_i$1(0,"div",42)(1,"div",16)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i$1(5,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.setUntilType(o,t))}),ND(6,So,2,4,"nz-option",15,SD),Kc(),oE(),Kc(),_i$1(8,"label",16)(9,"span"),vw(10),Rw(11,"transloco"),Kc(),_i$1(12,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.setUntilField(o,"stepId",t))}),Kc(),oE(),Kc(),_i$1(13,"label",16)(14,"span"),vw(15),Rw(16,"transloco"),Kc(),_i$1(17,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.setUntilField(o,"field",t))}),Kc(),oE(),Kc(),bD(18,yo,5,5,"label",16),_i$1(19,"label",16)(20,"span"),vw(21),Rw(22,"transloco"),Kc(),_i$1(23,"nz-input-number",43),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{maxIterations:t??0}))}),Kc(),oE(),Kc(),_i$1(24,"div",16)(25,"span"),vw(26),Rw(27,"transloco"),Kc(),_i$1(28,"nz-select",22),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.patchAt(o,{onMaxIterations:{action:t}}))}),ND(29,Mo,2,4,"nz-option",15,SD),Kc(),oE(),Kc()(),_i$1(31,"div",44)(32,"h4"),vw(33),Rw(34,"transloco"),Kc(),_i$1(35,"app-step-list",45),gh("stepsChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.setNestedSteps(o,t))}),Kc()();}if(i&2){let e=VD(2),n=e.$implicit,t=e.$index,o=VD();gI(3),Ph(Ow(4,26,"step-list.until.type")),gI(2),ch("ngModel",o.asLoop(n).until.type),ah("data-testid","loop-until-type-"+t),sE(),gI(),xD(o.untilTypes),gI(4),Ph(Ow(11,28,"step-list.until.stepId")),gI(2),ch("ngModel",o.asLoop(n).until.stepId),ah("data-testid","loop-until-stepId-"+t),sE(),gI(3),Ph(Ow(16,30,"step-list.until.field")),gI(2),ch("ngModel",o.asLoop(n).until.field),ah("data-testid","loop-until-field-"+t),sE(),gI(),_D(o.asLoop(n).until.type==="field_equals"?18:-1),gI(3),Ph(Ow(22,32,"step-list.maxIterations")),gI(2),ch("ngModel",o.asLoop(n).maxIterations)("nzMin",0),ah("data-testid","loop-max-"+t),sE(),gI(3),Ph(Ow(27,34,"step-list.onMaxIterations.action")),gI(2),ch("ngModel",o.asLoop(n).onMaxIterations.action),ah("data-testid","loop-on-max-"+t),sE(),gI(),xD(o.maxIterationActions),gI(2),ah("data-testid","loop-nested-"+t),gI(2),Ph(Ow(34,36,"step-list.nestedSteps")),gI(2),ch("steps",o.asLoop(n).steps)("rootSteps",o.effectiveRoot())("availableWorkflows",o.availableWorkflows())("appliesTo",o.appliesTo())("inputSchema",o.inputSchema())("settings",o.settings())("depth",o.depth()+1);}}function To(i,l){if(i&1){let e=LD();_i$1(0,"div",12)(1,"div",13)(2,"nz-select",14),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.changeType(o,t))}),ND(3,Wi,2,4,"nz-option",15,SD),Kc(),oE(),Kc(),_i$1(5,"label",16)(6,"span"),vw(7),Rw(8,"transloco"),Kc(),_i$1(9,"input",17),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.onNameChange(o,t))}),Kc(),oE(),Kc(),_i$1(10,"label",16)(11,"span"),vw(12),Rw(13,"transloco"),Kc(),_i$1(14,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.onIdChange(o,t))}),Kc(),oE(),_i$1(15,"p",19),vw(16),Rw(17,"transloco"),Kc()(),lh(18,"app-available-parameters",20),bD(19,qi,32,29)(20,Ui,7,5,"div",16)(21,Zi,5,5,"label",16)(22,Yi,22,20)(23,io,9,6)(24,vo,16,19)(25,zo,13,8)(26,Eo,36,38),Kc();}if(i&2){let e,n=VD(),t=n.$implicit,o=n.$index,d=VD();ah("data-testid","step-body-"+o),gI(2),ch("ngModel",t.type),ah("data-testid","step-type-"+o),sE(),gI(),xD(d.stepTypes),gI(4),Ph(Ow(8,14,"step-list.name")),gI(2),ch("ngModel",t.name),ah("data-testid","step-name-"+o),sE(),gI(3),Ph(Ow(13,16,"step-list.id")),gI(2),ch("ngModel",t.id),ah("data-testid","step-id-"+o),sE(),gI(2),Ph(Ow(17,18,"step-list.idHint")),gI(2),ch("inputSchema",d.inputSchema())("appliesTo",d.appliesTo())("previousSteps",d.previousFor(t)),gI(),_D((e=t.type)==="agent"?19:e==="interaction"?20:e==="shell"?21:e==="extract"?22:e==="git"?23:e==="provider_action"?24:e==="sub_workflow"?25:e==="loop"?26:-1);}}function ko(i,l){if(i&1){let e=LD();_i$1(0,"nz-card",3)(1,"div",4),gh("click",function(){let t=Pu(e).$implicit,o=VD();return Lu(o.toggleExpanded(t))}),_i$1(2,"div",5)(3,"span",6),vw(4),Kc(),_i$1(5,"span",7),vw(6),Rw(7,"transloco"),Kc(),_i$1(8,"span",8),vw(9),Rw(10,"transloco"),Kc()(),_i$1(11,"div",9),gh("click",function(t){return t.stopPropagation()}),_i$1(12,"button",10),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.moveUp(t))}),vw(13),Rw(14,"transloco"),Kc(),_i$1(15,"button",10),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.moveDown(t))}),vw(16),Rw(17,"transloco"),Kc(),_i$1(18,"button",11),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.removeStep(t))}),vw(19),Rw(20,"transloco"),Kc()()(),bD(21,To,27,20,"div",12),Kc();}if(i&2){let e=l.$implicit,n=l.$index,t=VD();Mh("step-card-expanded",t.isExpanded(e)),ah("data-testid","step-card-"+n),gI(),ah("data-testid","step-header-"+n),gI(3),Ph(t.isExpanded(e)?"\u25BE":"\u25B8"),gI(),ah("data-testid","step-header-name-"+n),gI(),nl(" ",e.name||Ow(7,18,"step-list.unnamed")," "),gI(2),ah("data-testid","step-type-label-"+n),gI(),nl(" ",Ow(10,20,t.stepTypeKey(e.type))," "),gI(3),ch("disabled",n===0),ah("data-testid","move-up-"+n),gI(),nl(" ",Ow(14,22,"step-list.moveUp")," "),gI(2),ch("disabled",n===t.steps().length-1),ah("data-testid","move-down-"+n),gI(),nl(" ",Ow(17,24,"step-list.moveDown")," "),gI(2),ah("data-testid","remove-"+n),gI(),nl(" ",Ow(20,26,"step-list.remove")," "),gI(2),_D(t.isExpanded(e)?21:-1);}}var Mn=(()=>{class i{constructor(){this.transloco=C(Ve$1),this.language=C(O),this.providersApi=C($$1),this.contextFilesApi=C(ze),this.modal=C(Xt),this.steps=$0.required(),this.rootSteps=$0([]),this.availableWorkflows=$0([]),this.appliesTo=$0("none"),this.inputSchema=$0([]),this.settings=$0(hy),this.depth=$0(0),this.stepsChange=B0(),this.stepTypes=y,this.outputFormats=["questionnaire","confirmation","comment_suggestions","free_text"],this.interactions=["questionnaire","confirmation"],this.gitOperations=["create_worktree","checkout","create_branch","commit","push"],this.providerActions=["get_subject","get_comments","post_comment","update_status","get_content"],this.untilTypes=["field_empty","field_equals"],this.maxIterationActions=["fail","continue","ask_human"],this.extractOnNoMatchActions=["fail","empty","ask_human"],this.expandedKey=qo(null),this.contextFiles=qo([]),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([])}),rd(()=>{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}`}untilTypeKey(e){return `step-list.untilType.${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 Py(this.effectiveRoot(),e)}trackKey(e){return e._key}isExpanded(e){return this.expandedKey()===e._key}toggleExpanded(e){this.expandedKey.update(n=>n===e._key?null:e._key);}addStep(){this.emit([...this.steps(),h("agent")]);}removeStep(e){let n=this.steps()[e];n&&this.paramRowsByStepKey.delete(n._key),this.emit(this.steps().filter((t,o)=>o!==e));}moveUp(e){if(e<=0)return;let n=[...this.steps()],t=n[e-1];n[e-1]=n[e],n[e]=t,this.emit(n);}moveDown(e){if(e>=this.steps().length-1)return;let n=[...this.steps()],t=n[e+1];n[e+1]=n[e],n[e]=t,this.emit(n);}changeType(e,n){let t=this.steps()[e];if(!t||t.type===n)return;this.paramRowsByStepKey.delete(t._key);let o=h(n,{id:t.id,name:t.name,idAutoSync:t._idAutoSync,key:t._key});this.replaceAt(e,o);}patchAt(e,n){let t=this.steps()[e];t&&this.replaceAt(e,r(r({},t),n));}onNameChange(e,n){let t=this.steps()[e];t&&this.replaceAt(e,E(t,n,this.effectiveRoot()));}onIdChange(e,n){let t=this.steps()[e];t&&this.replaceAt(e,P(t,n));}setNestedSteps(e,n){let t=this.steps()[e];!t||t.type!=="loop"||this.replaceAt(e,s(r({},t),{steps:n}));}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"}gitParam(e,n){let t=e.params?.[n];return typeof t=="string"?t:""}setGitParam(e,n,t){let o=this.steps()[e];!o||o.type!=="git"||(this.paramRowsByStepKey.delete(o._key),this.patchAt(e,{params:s(r({},o.params),{[n]:t})}));}setCreateWorktreeMode(e,n){let t=this.steps()[e];if(!t||t.type!=="git")return;let o=this.gitParam(t,"repoPath");if(this.paramRowsByStepKey.delete(t._key),n==="existing-branch"){this.patchAt(e,{params:{mode:"existing-branch",repoPath:o,branch:this.gitParam(t,"branch")||this.gitParam(t,"branchName")}});return}this.patchAt(e,{params:{repoPath:o,baseBranch:this.gitParam(t,"baseBranch"),branchName:this.gitParam(t,"branchName")||this.gitParam(t,"branch")}});}asProvider(e){return e}asSubWorkflow(e){return e}asLoop(e){return e}paramRows(e){let n=this.paramRowsByStepKey.get(e._key);if(!n){let t=e.type==="git"||e.type==="provider_action"?e.params:void 0;n=A(t),this.paramRowsByStepKey.set(e._key,n);}return n}onParamRowsChange(e,n,t){this.paramRowsByStepKey.set(n._key,t),this.patchAt(e,{params:j(t)});}isExtended(e){return e.type==="provider_action"&&yn(this.asProvider(e))}setActionMode(e,n){let t=this.asProvider(this.steps()[e]);if(n==="portable"){let d=t,{extendedAction:A}=d,K=t$1(d,["extendedAction"]);this.replaceAt(e,K);return}let o=zn(this.appliesTo(),this.settings());this.patchAt(e,{extendedAction:{providerId:o,actionId:"",params:{}}}),this.ensureActionsLoaded(o);}extendedProviderOptions(){return Ve(this.appliesTo(),this.settings())}providerLabel(e){return (this.settings().providerInstances??[]).find(t=>t.id===e)?.displayName||e}agentInstanceOptions(){return (this.settings().providerInstances??[]).filter(e=>e.kind==="agent")}setAgentInstance(e,n){this.patchAt(e,{agentInstanceId:n||void 0});}selectedContextFiles(e){let n=e.contextFileIds??[],t=this.contextFiles();return n.map(o=>t.find(d=>d.id===o)??{id:o,name:o,tier:"user",path:""})}removeContextFile(e,n){let t=this.asAgent(this.steps()[e]);this.patchAt(e,{contextFileIds:(t.contextFileIds??[]).filter(o=>o!==n)});}openContextFilePicker(e){let n=this.asAgent(this.steps()[e]),t=this.modal.create({nzTitle:this.transloco.translate("context-files.selectTitle"),nzContent:St,nzData:{selectionMode:true,selectedIds:[...n.contextFileIds??[]]},nzWidth:800,nzOnOk:()=>{let o=t.getContentComponent();this.patchAt(e,{contextFileIds:o.currentSelectedIds()}),this.contextFilesApi.list().subscribe({next:d=>this.contextFiles.set(d)});}});}setExtendedProvider(e,n){this.patchAt(e,{extendedAction:{providerId:n,actionId:"",params:{}}}),this.ensureActionsLoaded(n);}setExtendedAction(e,n){let t=this.asProvider(this.steps()[e]),o=this.extendedDescriptors(t).find(d=>d.actionId===n);this.patchAt(e,{extendedAction:{providerId:t.extendedAction?.providerId??"",actionId:n,params:o?Io(o):{}}});}setExtendedParam(e,n,t){let d=this.asProvider(this.steps()[e]).extendedAction;d&&this.patchAt(e,{extendedAction:s(r({},d),{params:s(r({},d.params??{}),{[n]:t})})});}extendedParamValue(e,n){let t=e.extendedAction?.params?.[n];return t==null?"":String(t)}extendedDescriptors(e){let n=e.extendedAction?.providerId;return n?this.actionsByProvider.get(n)??[]:[]}selectedExtendedDescriptor(e){let n=e.extendedAction?.actionId;if(n)return this.extendedDescriptors(e).find(t=>t.actionId===n)}mismatchWarning(e){let n=Sn(e,this.appliesTo(),this.settings());return n?(this.language.currentLang(),this.transloco.translate("step-list.extendedAction.mismatch",n)):null}hasTarget(e){return e.type==="provider_action"&&this.asProvider(e).target!=null}setTargetEnabled(e,n){let t=this.asProvider(this.steps()[e]);if(!n){let o=t,{target:d}=o,A=t$1(o,["target"]);this.replaceAt(e,A);return}this.patchAt(e,{target:{subjectType:"ticket",source:"",subjectId:""}});}setTargetSubjectType(e,n){let t=this.asProvider(this.steps()[e]);this.patchAt(e,{target:{subjectType:n,source:"",subjectId:t.target?.subjectId??""}});}setTargetSource(e,n){let t=this.asProvider(this.steps()[e]);t.target&&this.patchAt(e,{target:s(r({},t.target),{source:n})});}setTargetSubjectId(e,n){let t=this.asProvider(this.steps()[e]);t.target&&this.patchAt(e,{target:s(r({},t.target),{subjectId:n})});}targetInstanceOptions(e){let n=e.target?.subjectType;return n?B(this.settings(),[n]):[]}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:n=>{this.loadingActions.delete(e),this.actionsByProvider.set(e,n);},error:()=>{this.loadingActions.delete(e),this.actionsByProvider.set(e,[]);}}));}setUntilType(e,n){let t=this.asLoop(this.steps()[e]);if(n==="field_empty"){this.patchAt(e,{until:{type:n,stepId:t.until.stepId,field:t.until.field}});return}let o=t.until.type==="field_equals"?t.until.value:"";this.patchAt(e,{until:{type:n,stepId:t.until.stepId,field:t.until.field,value:o}});}setUntilField(e,n,t){let o=this.asLoop(this.steps()[e]);this.patchAt(e,{until:s(r({},o.until),{[n]:t})});}setUntilValue(e,n){let t=this.asLoop(this.steps()[e]);t.until.type==="field_equals"&&this.patchAt(e,{until:s(r({},t.until),{value:n})});}untilValue(e){return e.until.type==="field_equals"?String(e.until.value??""):""}replaceAt(e,n){this.emit(this.steps().map((t,o)=>o===e?n:t));}emit(e){this.stepsChange.emit(e);}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({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"],["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"],["nz-input","","rows","2",3,"ngModelChange","ngModel"],["nzValue","new-branch",3,"nzLabel"],["nzValue","existing-branch",3,"nzLabel"],[3,"rowsChange","rows"],["nzType","warning","nzShowIcon","",1,"mismatch",3,"nzMessage"],["nz-checkbox","",3,"ngModelChange","ngModel"],["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"],["data-testid","sub-workflow-foreach"],[1,"field-grid"],[3,"ngModelChange","ngModel","nzMin"],[1,"nested"],[3,"stepsChange","steps","rootSteps","availableWorkflows","appliesTo","inputSchema","settings","depth"]],template:function(n,t){n&1&&(_i$1(0,"div",0),ND(1,ko,22,28,"nz-card",1,Di,true),_i$1(3,"button",2),gh("click",function(){return t.addStep()}),vw(4),Rw(5,"transloco"),Kc()()),n&2&&(ah("data-depth",t.depth()),gI(),xD(t.steps()),gI(3),nl(" ",Ow(5,2,"step-list.addStep")," "));},dependencies:[i,Mi$1,n8,S4,J6,$6,k3,dd,zc,t7,y7,Nt,Ke,Lt,ut,ai$1,z,mn,tt,Zn$1,Xb,V5,D5,Gn$1,un$1,W,I$1,vn,xn,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}.context-file-chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;margin:.35rem 0}"]});}}return i})();function Io(i){let l={};for(let e of i.params)l[e.name]=e.type==="select"?e.options?.[0]??"":"";return l}var No=i=>({ids:i});function Fo(i,l){i&1&&(_i$1(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"workflow-editor.loading")));}function Vo(i,l){if(i&1&&(_i$1(0,"p",6),vw(1),Kc()),i&2){let e=VD();gI(),Ph(e.loadError());}}function Ao(i,l){if(i&1&&(_i$1(0,"li"),vw(1),Kc()),i&2){let e=l.$implicit;gI(),Ph(e);}}function Po(i,l){if(i&1&&(_i$1(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i$1(4,"ul"),ND(5,Ao,2,1,"li",null,SD),Kc()()),i&2){let e=VD(2);gI(2),Ph(Ow(3,1,"workflow-editor.validation")),gI(3),xD(e.validationErrors());}}function $o(i,l){if(i&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(2);ch("nzValue",e)("nzLabel",Ow(1,2,n.subjectTypeKey(e)));}}function Bo(i,l){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(2);ch("nzValue",e)("nzLabel",Ow(1,3,n.subjectHandlingKey(e)))("nzDisabled",e==="collection"&&n.appliesToValue()==="none");}}function Do(i,l){if(i&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),i&2){let e=l.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.inputTypeKey(e)));}}function Lo(i,l){if(i&1){let e=LD();_i$1(0,"div",18)(1,"label",10)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i$1(5,"input",22),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{name:t}))}),Kc(),oE(),Kc(),_i$1(6,"label",10)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i$1(10,"input",22),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{label:t}))}),Kc(),oE(),Kc(),_i$1(11,"div",10)(12,"span"),vw(13),Rw(14,"transloco"),Kc(),_i$1(15,"nz-select",23),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{type:t}))}),ND(16,Do,2,4,"nz-option",13,SD),Kc(),oE(),Kc(),_i$1(18,"label",24),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{required:t}))}),vw(19),Rw(20,"transloco"),Kc(),oE(),_i$1(21,"button",25),gh("click",function(){let t=Pu(e).$index,o=VD(2);return Lu(o.removeInputField(t))}),vw(22),Rw(23,"transloco"),Kc()();}if(i&2){let e=l.$implicit,n=l.$index,t=VD(2);ah("data-testid","input-field-"+n),gI(3),Ph(Ow(4,10,"workflow-editor.fieldName")),gI(2),ch("ngModel",e.name),sE(),gI(3),Ph(Ow(9,12,"workflow-editor.fieldLabel")),gI(2),ch("ngModel",e.label),sE(),gI(3),Ph(Ow(14,14,"workflow-editor.fieldType")),gI(2),ch("ngModel",e.type),sE(),gI(),xD(t.inputFieldTypes),gI(2),ch("ngModel",e.required),sE(),gI(),nl(" ",Ow(20,16,"workflow-editor.required")," "),gI(3),nl(" ",Ow(23,18,"workflow-editor.remove")," ");}}function Oo(i,l){if(i&1&&(_i$1(0,"p",20),vw(1),Rw(2,"transloco"),Kc()),i&2){let e=VD(2);gI(),nl(" ",Pw(2,1,"workflow-editor.duplicateStepIds",xw(4,No,e.duplicateStepIds().join(", ")))," ");}}function Wo(i,l){if(i&1){let e=LD();bD(0,Po,7,3,"section",7),_i$1(1,"nz-card",8),Rw(2,"transloco"),_i$1(3,"div",9)(4,"label",10)(5,"span"),vw(6),Rw(7,"transloco"),Kc(),_i$1(8,"input",11),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({name:t}))}),Kc(),oE(),Kc(),_i$1(9,"div",10)(10,"span"),vw(11),Rw(12,"transloco"),Kc(),_i$1(13,"nz-select",12),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.setAppliesTo(t))}),ND(14,$o,2,4,"nz-option",13,SD),Kc(),oE(),Kc(),_i$1(16,"div",10)(17,"span"),vw(18),Rw(19,"transloco"),Kc(),_i$1(20,"nz-select",14),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({subjectHandling:t}))}),ND(21,Bo,2,5,"nz-option",15,SD),Kc(),oE(),_i$1(23,"p",16),vw(24),Rw(25,"transloco"),Kc()()(),_i$1(26,"label",10)(27,"span"),vw(28),Rw(29,"transloco"),Kc(),_i$1(30,"textarea",17),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({description:t||void 0}))}),Kc(),oE(),Kc()(),_i$1(31,"nz-card",8),Rw(32,"transloco"),ND(33,Lo,24,20,"div",18,MD),_i$1(35,"button",19),gh("click",function(){Pu(e);let t=VD();return Lu(t.addInputField())}),vw(36),Rw(37,"transloco"),Kc()(),_i$1(38,"nz-card",8),Rw(39,"transloco"),bD(40,Oo,3,6,"p",20),_i$1(41,"app-step-list",21),gh("stepsChange",function(t){Pu(e);let o=VD();return Lu(o.onStepsChange(t))}),Kc()();}if(i&2){let e=VD();_D(e.validationErrors().length>0?0:-1),gI(),ch("nzTitle",Ow(2,21,"workflow-editor.basics")),gI(5),Ph(Ow(7,23,"workflow-editor.name")),gI(2),ch("ngModel",e.workflow().name),sE(),gI(3),Ph(Ow(12,25,"workflow-editor.appliesTo")),gI(2),ch("ngModel",e.appliesToValue()),sE(),gI(),xD(e.subjectTypes),gI(4),Ph(Ow(19,27,"workflow-editor.subjectHandling.label")),gI(2),ch("ngModel",e.workflow().subjectHandling),sE(),gI(),xD(e.subjectHandlingOptions),gI(3),nl(" ",Ow(25,29,e.subjectHandlingHelpKey())," "),gI(4),Ph(Ow(29,31,"workflow-editor.description")),gI(2),ch("ngModel",e.workflow().description??""),sE(),gI(),ch("nzTitle",Ow(32,33,"workflow-editor.inputSchema")),gI(2),xD(e.workflow().inputSchema),gI(3),nl(" ",Ow(37,35,"workflow-editor.addInputField")," "),gI(2),ch("nzTitle",Ow(39,37,"workflow-editor.steps")),gI(2),_D(e.duplicateStepIds().length>0?40:-1),gI(),ch("steps",e.workflow().steps)("rootSteps",e.workflow().steps)("availableWorkflows",e.availableWorkflows())("appliesTo",e.workflow().appliesTo)("inputSchema",e.workflow().inputSchema)("settings",e.settings());}}var br=(()=>{class i{constructor(){this.route=C(ae),this.router=C(Ie),this.workflowsApi=C(U),this.settingsApi=C($),this.message=C(Cx),this.destroyRef=C(at),this.transloco=C(Ve$1),this.language=C(O),this.routeId=de(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.workflow=qo(I()),this.availableWorkflows=qo([]),this.settings=qo(hy),this.loadError=qo(null),this.validationErrors=qo([]),this.duplicateStepIds=qo([]),this.saving=qo(false),this.loading=qo(true),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("workflow-editor.titleNew"):this.transloco.translate("workflow-editor.titleEdit",{id:this.workflow().id||this.routeId()}))),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 n=e.get("id");if(this.validationErrors.set([]),this.duplicateStepIds.set([]),this.loadError.set(null),!n){this.workflow.set(I()),this.loading.set(false);return}this.loading.set(true),this.workflowsApi.get(n).subscribe({next:t=>{this.workflow.set(s(r({},structuredClone(t)),{steps:_(t.steps,{idAutoSync:false})})),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,`Failed to load workflow ${n}`));}});});}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(n=>r(r({},n),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(Um(e));}addInputField(){this.patchWorkflow({inputSchema:[...this.workflow().inputSchema,b()]});}removeInputField(e){this.patchWorkflow({inputSchema:this.workflow().inputSchema.filter((n,t)=>t!==e)});}patchInputField(e,n){let t=this.workflow().inputSchema.map((o,d)=>d===e?r(r({},o),n):o);this.patchWorkflow({inputSchema:t});}save(){let e=this.workflow(),n=Um(e.steps);if(this.duplicateStepIds.set(n),n.length>0){this.validationErrors.set([this.transloco.translate("workflow-editor.duplicateStepIds",{ids:n.join(", ")})]);return}let t=v(e,{omitWorkflowId:this.isNew()}),o=ty.safeParse(t);if(!o.success){this.validationErrors.set(T(o.error));return}this.validationErrors.set([]),this.saving.set(true);let d=o.data,A=this.routeId();(this.isNew()||!A?this.workflowsApi.create(d):this.workflowsApi.update(A,s(r({},d),{id:A}))).subscribe({next:se=>{this.saving.set(false),this.workflow.set(s(r({},structuredClone(se)),{steps:_(se.steps,{idAutoSync:false})})),this.message.success(this.isNew()?"Workflow created":"Workflow saved"),this.isNew()&&this.router.navigate(["/workflows",se.id,"edit"]);},error:se=>{this.saving.set(false),this.message.error(this.errorMessage(se,"Save failed"));}});}errorMessage(e,n){return e instanceof o||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-workflow-editor"]],decls:15,vars:10,consts:[["data-testid","workflow-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/workflows","data-testid","back-to-workflows"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["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(n,t){n&1&&(_i$1(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Kc()(),_i$1(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i$1(9,"button",4),gh("click",function(){return t.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,Fo,3,3,"p",5)(13,Vo,2,1,"p",6)(14,Wo,42,39),Kc()),n&2&&(gI(4),Ph(t.pageTitle()),gI(3),Ph(Ow(8,6,"workflow-editor.backToWorkflows")),gI(2),ch("nzLoading",t.saving())("disabled",t.loading()||!!t.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(t.loading()?12:t.loadError()?13:14));},dependencies:[Mi$1,n8,S4,J6,k3,Ln$1,dd,zc,t7,y7,Nt,Ke,Lt,ut,ai$1,z,Xb,V5,D5,Mn,Kt],styles:[".editor[_ngcontent-%COMP%]{max-width:56rem;margin:0 auto;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;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{br as WorkflowEditorComponent};
@@ -1 +1 @@
1
- import {U}from'./chunk-W5GAgssE.js';import {f as f$1}from'./chunk-CJRNatUw.js';import {B as Bt}from'./chunk-BjZIiizu.js';import {W,I}from'./chunk-DNOjVPY0.js';import'./chunk-3mppll1n.js';import'./chunk-CEcbtdnK.js';import {C,a as ae,$,V as Ve,b as at,q as qo,u as ue,W as rd,Y as Bw,o,Q as QE,M as Mi,L as Ln,d as dd,z as zc,c as t7,Z as y7,K as Kt,f as _i,m as bD,g as Kc,p as gI,B as _D,v as vw,R as Rw,P as Ph,O as Ow,E as VD,l as lh,a2 as Pw,a3 as xw,x as ch,F as LD,h as gh,w as nl,G as Pu,I as Lu}from'./main-MNK6ZYDO.js';import'./chunk-CxBYhrEj.js';var G=i=>({count:i});function Q(i,p){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function X(i,p){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function Y(i,p){if(i&1){let t=LD();_i(0,"button",15),gh("click",function(){Pu(t);let u=VD(2);return Lu(u.cancelBatch())}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let t=VD(2);ch("disabled",t.cancelling()),gI(),nl(" ",Ow(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function Z(i,p){if(i&1&&(_i(0,"p",12),vw(1),Kc()),i&2){let t=VD(2);gI(),Ph(t.actionError());}}function tt(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"nz-tag",7),vw(9),Rw(10,"transloco"),Kc(),_i(11,"span",8),vw(12),Kc(),vw(13," \xB7 "),_i(14,"span",9),vw(15),Rw(16,"transloco"),Kc(),vw(17," \xB7 "),_i(18,"span",10),vw(19),Rw(20,"transloco"),Kc()()(),bD(21,Y,3,4,"button",11),Kc(),bD(22,Z,2,1,"p",12),_i(23,"section",13)(24,"h2"),vw(25),Rw(26,"transloco"),Kc(),lh(27,"app-job-status-table",14),Kc()),i&2){let t=p,e=VD();gI(3),Ph(Ow(4,10,"batches.detail.backHint")),gI(3),Ph(t.id),gI(3),Ph(Ow(10,12,e.statusKey(t.status))),gI(3),Ph(t.workflowId),gI(3),Ph(Pw(16,14,"batches.detail.subjectCount",xw(21,G,t.resolvedSubjects.length))),gI(4),Ph(Ow(20,17,e.triggeredByKey(t.triggeredBy))),gI(2),_D(t.status==="running"?21:-1),gI(),_D(e.actionError()?22:-1),gI(3),Ph(Ow(26,19,"batches.detail.membersHeading")),gI(2),ch("jobs",e.memberJobs());}}var et=3e3;function f(i){return i!=="running"}var _t=(()=>{class i{constructor(){this.route=C(ae),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f$1),this.transloco=C(Ve),this.destroyRef=C(at),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);}),rd(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&Bw(()=>{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(),f(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(),f(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),f(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||f(t.status)){this.stopPolling();return}this.refreshMembers();},et));}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 o||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=QE({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"],["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),bD(1,Q,3,3,"p",1)(2,X,2,1,"p",2)(3,tt,28,23),Kc()),e&2){let _;gI(),_D(u.loading()?1:u.loadError()?2:(_=u.batch())?3:-1,_);}},dependencies:[Mi,Ln,dd,zc,t7,y7,W,I,Bt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;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{_t as BatchDetailComponent};
1
+ import {U}from'./chunk-Bc9kVhav.js';import {f as f$1}from'./chunk-KhdCYqqN.js';import {B as Bt}from'./chunk-Df_jRm7U.js';import {W,I}from'./chunk-CK-2DsDH.js';import'./chunk-CrD5w72_.js';import'./chunk-hEYSTlD1.js';import {C,a as ae,$,V as Ve,b as at,q as qo,u as ue,W as rd,Y as Bw,o,Q as QE,M as Mi,L as Ln,d as dd,z as zc,c as t7,Z as y7,K as Kt,f as _i,m as bD,g as Kc,p as gI,B as _D,v as vw,R as Rw,P as Ph,O as Ow,E as VD,l as lh,a2 as Pw,a3 as xw,x as ch,F as LD,h as gh,w as nl,G as Pu,I as Lu}from'./main-RRKPLQCF.js';import'./chunk-CxBYhrEj.js';var G=i=>({count:i});function Q(i,p){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function X(i,p){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function Y(i,p){if(i&1){let t=LD();_i(0,"button",15),gh("click",function(){Pu(t);let u=VD(2);return Lu(u.cancelBatch())}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let t=VD(2);ch("disabled",t.cancelling()),gI(),nl(" ",Ow(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function Z(i,p){if(i&1&&(_i(0,"p",12),vw(1),Kc()),i&2){let t=VD(2);gI(),Ph(t.actionError());}}function tt(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"nz-tag",7),vw(9),Rw(10,"transloco"),Kc(),_i(11,"span",8),vw(12),Kc(),vw(13," \xB7 "),_i(14,"span",9),vw(15),Rw(16,"transloco"),Kc(),vw(17," \xB7 "),_i(18,"span",10),vw(19),Rw(20,"transloco"),Kc()()(),bD(21,Y,3,4,"button",11),Kc(),bD(22,Z,2,1,"p",12),_i(23,"section",13)(24,"h2"),vw(25),Rw(26,"transloco"),Kc(),lh(27,"app-job-status-table",14),Kc()),i&2){let t=p,e=VD();gI(3),Ph(Ow(4,10,"batches.detail.backHint")),gI(3),Ph(t.id),gI(3),Ph(Ow(10,12,e.statusKey(t.status))),gI(3),Ph(t.workflowId),gI(3),Ph(Pw(16,14,"batches.detail.subjectCount",xw(21,G,t.resolvedSubjects.length))),gI(4),Ph(Ow(20,17,e.triggeredByKey(t.triggeredBy))),gI(2),_D(t.status==="running"?21:-1),gI(),_D(e.actionError()?22:-1),gI(3),Ph(Ow(26,19,"batches.detail.membersHeading")),gI(2),ch("jobs",e.memberJobs());}}var et=3e3;function f(i){return i!=="running"}var _t=(()=>{class i{constructor(){this.route=C(ae),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f$1),this.transloco=C(Ve),this.destroyRef=C(at),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);}),rd(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&Bw(()=>{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(),f(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(),f(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),f(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||f(t.status)){this.stopPolling();return}this.refreshMembers();},et));}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 o||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=QE({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"],["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),bD(1,Q,3,3,"p",1)(2,X,2,1,"p",2)(3,tt,28,23),Kc()),e&2){let _;gI(),_D(u.loading()?1:u.loadError()?2:(_=u.batch())?3:-1,_);}},dependencies:[Mi,Ln,dd,zc,t7,y7,W,I,Bt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;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{_t as BatchDetailComponent};
@@ -0,0 +1 @@
1
+ import {o as ot}from'./chunk-DxtF2GQ1.js';import'./chunk-mb666CWY.js';import {a as ai,z}from'./chunk-WGWZEfc0.js';import {_ as _n,C as Cn}from'./chunk-DqECIHE5.js';import {Q as QE,l as lh,C,V as Ve,b as at,q as qo,r,u as ue$1,o,M as Mi,n as n8,am as S4,J as J6,k as k3,d as dd,z as zc,c as t7,Z as y7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,h as gh,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,F as LD,j as oE,x as ch,y as sE,N as ND,A as xD,a5 as ah,G as Pu,I as Lu}from'./main-RRKPLQCF.js';import {f}from'./chunk-BAgwFLbm.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-CrD5w72_.js';import'./chunk-hEYSTlD1.js';var ce=(t,_)=>_.id;function de(t,_){t&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function me(t,_){if(t&1&&(_i(0,"p",4),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function fe(t,_){if(t&1&&(_i(0,"p",5),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function _e(t,_){if(t&1&&(_i(0,"p",9),vw(1),Kc()),t&2){let e=VD(3);gI(),Ph(e.saveError());}}function he(t,_){if(t&1){let e=LD();_i(0,"section",6),bD(1,_e,2,1,"p",9),_i(2,"label",10)(3,"span"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"input",11),gh("ngModelChange",function(l){Pu(e);let d=VD(2);return Lu(d.formName.set(l))}),Kc(),oE(),Kc(),_i(7,"div",10)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"app-path-picker",12),gh("pathChange",function(l){Pu(e);let d=VD(2);return Lu(d.formLocalPath.set(l))}),Kc()(),_i(12,"div",10)(13,"span"),vw(14),Rw(15,"transloco"),Kc(),_i(16,"p",13),vw(17),Rw(18,"transloco"),Kc(),_i(19,"app-path-picker",12),gh("pathChange",function(l){Pu(e);let d=VD(2);return Lu(d.formWorktreeBasePath.set(l))}),Kc()(),_i(20,"div",14)(21,"button",15),gh("click",function(){Pu(e);let l=VD(2);return Lu(l.submitForm())}),vw(22),Rw(23,"transloco"),Kc(),_i(24,"button",16),gh("click",function(){Pu(e);let l=VD(2);return Lu(l.cancelForm())}),vw(25),Rw(26,"transloco"),Kc()()();}if(t&2){let e=VD(2);gI(),_D(e.saveError()?1:-1),gI(3),Ph(Ow(5,11,"local-repos.form.name")),gI(2),ch("ngModel",e.formName()),sE(),gI(3),Ph(Ow(10,13,"local-repos.form.localPath")),gI(2),ch("path",e.formLocalPath()),gI(3),Ph(Ow(15,15,"local-repos.form.worktreeBasePath")),gI(3),Ph(Ow(18,17,"local-repos.form.worktreeBaseHint")),gI(2),ch("path",e.formWorktreeBasePath()),gI(2),ch("disabled",e.saving()),gI(),nl(" ",Ow(23,19,"common.save")," "),gI(3),nl(" ",Ow(26,21,"common.cancel")," ");}}function ue(t,_){t&1&&(_i(0,"p",7),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"local-repos.emptyState")));}function Ce(t,_){if(t&1){let e=LD();_i(0,"tr")(1,"td"),vw(2),Kc(),_i(3,"td",17),vw(4),Kc(),_i(5,"td",17),vw(6),Kc(),_i(7,"td",18)(8,"button",19),gh("click",function(){let l=Pu(e).$implicit,d=VD(3);return Lu(d.openEditForm(l))}),vw(9),Rw(10,"transloco"),Kc(),_i(11,"button",20),Rw(12,"transloco"),gh("nzOnConfirm",function(){let l=Pu(e).$implicit,d=VD(3);return Lu(d.deleteRepo(l))}),vw(13),Rw(14,"transloco"),Kc()()();}if(t&2){let e=_.$implicit;ah("data-testid","local-repo-row-"+e.id),gI(2),Ph(e.name),gI(2),Ph(e.localPath),gI(2),Ph(e.worktreeBasePath||"\u2014"),gI(2),ah("data-testid","edit-local-repo-"+e.id),gI(),nl(" ",Ow(10,9,"local-repos.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(12,11,"local-repos.deleteConfirm")),ah("data-testid","delete-local-repo-"+e.id),gI(2),nl(" ",Ow(14,13,"local-repos.delete")," ");}}function ge(t,_){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc()()(),_i(15,"tbody"),ND(16,Ce,15,15,"tr",null,ce),Kc()()),t&2){let e=VD(2);ch("nzData",e.repos())("nzShowPagination",false),gI(4),Ph(Ow(5,6,"local-repos.column.name")),gI(3),Ph(Ow(8,8,"local-repos.column.localPath")),gI(3),Ph(Ow(11,10,"local-repos.column.worktreeBasePath")),gI(3),Ph(Ow(14,12,"local-repos.column.actions")),gI(3),xD(e.repos());}}function xe(t,_){if(t&1&&(bD(0,fe,2,1,"p",5),bD(1,he,27,23,"section",6),bD(2,ue,3,3,"p",7)(3,ge,18,14,"nz-table",8)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.formOpen()?1:-1),gI(),_D(e.repos().length===0&&!e.formOpen()?2:e.repos().length>0?3:-1);}}var ae=(()=>{class t{constructor(){this.reposApi=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.repos=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.formName=qo(""),this.formLocalPath=qo(""),this.formWorktreeBasePath=qo(""),this.reload();}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formLocalPath.set(e.localPath),this.formWorktreeBasePath.set(e.worktreeBasePath??""),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({name:this.formName().trim(),localPath:this.formLocalPath().trim()},this.formWorktreeBasePath().trim()?{worktreeBasePath:this.formWorktreeBasePath().trim()}:{worktreeBasePath:void 0}),r$1=this.editingId();(r$1?this.reposApi.update(r$1,e):this.reposApi.create(e)).pipe(ue$1(this.destroyRef)).subscribe({next:d=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.repos.update(le=>[...le.filter(M=>M.id!==d.id),d].sort((M,se)=>M.name.localeCompare(se.name))),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set("");},error:d=>{this.saving.set(false),this.saveError.set(this.errorMessage(d,this.transloco.translate("local-repos.saveFailed")));}});}deleteRepo(e){this.deleteError.set(null),this.reposApi.delete(e.id).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.repos.update(r=>r.filter(l=>l.id!==e.id));},error:r=>{this.deleteError.set(this.errorMessage(r,this.transloco.translate("local-repos.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.reposApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.repos.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("local-repos.loadFailed")));}});}errorMessage(e,r){return e instanceof o||e instanceof Error?e.message:r}static{this.\u0275fac=function(r){return new(r||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-local-repository-list"]],decls:11,vars:7,consts:[["data-testid","local-repos-manage",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","type","button","data-testid","create-local-repo",3,"click"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","local-repo-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","local-repo-table",3,"nzData","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","local-repo-name",3,"ngModelChange","ngModel"],["mode","directories",3,"pathChange","path"],[1,"hint"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","save-local-repo",3,"click","disabled"],["nz-button","","type","button","data-testid","cancel-local-repo",3,"click"],[1,"path-cell"],[1,"actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle"]],template:function(r,l){r&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"button",2),gh("click",function(){return l.openCreateForm()}),vw(6),Rw(7,"transloco"),Kc()(),bD(8,de,3,3,"p",3)(9,me,2,1,"p",4)(10,xe,4,3),Kc()),r&2&&(gI(3),Ph(Ow(4,3,"local-repos.title")),gI(3),nl(" ",Ow(7,5,"local-repos.create")," "),gI(2),_D(l.loading()?8:l.loadError()?9:10));},dependencies:[Mi,n8,S4,J6,k3,dd,zc,t7,y7,ai,z,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;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})();var qe=(()=>{class t{static{this.\u0275fac=function(r){return new(r||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(r,l){r&1&&lh(0,"app-local-repository-list");},dependencies:[ae],encapsulation:2});}}return t})();export{qe as LocalRepositoriesManageComponent};
@@ -1 +1 @@
1
- import {u,f}from'./chunk-CxBYhrEj.js';import {W,I}from'./chunk-DNOjVPY0.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-3mppll1n.js';import {C,$,T as Ie,V as Ve,b as at,a0 as $0,q as qo,W as rd,Y as Bw,a9 as Ng,aa as Xi,ab as Dg,u as ue,o,s,r,Q as QE,M as Mi,L as Ln,d as dd,z as zc,c as t7,K as Kt,m as bD,B as _D,f as _i,v as vw,R as Rw,g as Kc,p as gI,P as Ph,O as Ow,E as VD,N as ND,x as ch,A as xD,a5 as ah,a3 as xw,w as nl,F as LD,h as gh,G as Pu,I as Lu}from'./main-MNK6ZYDO.js';var st=n=>["/jobs",n],lt=(n,m)=>m.id;function dt(n,m){n&1&&(_i(0,"p",0),vw(1),Rw(2,"transloco"),Kc()),n&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ct(n,m){if(n&1&&(_i(0,"p",1),vw(1),Kc()),n&2){let t=VD();gI(),Ph(t.loadError());}}function pt(n,m){if(n&1){let t=LD();_i(0,"button",6),gh("click",function(e){Pu(t);let d=VD().$implicit,g=VD(2);return Lu(g.retryJob(d,e))}),vw(1),Rw(2,"transloco"),Kc();}if(n&2){let t=VD().$implicit,i=VD(2);ch("disabled",i.retryingJobId()===t.id),ah("data-testid","job-retry-"+t.id),gI(),nl(" ",Ow(2,3,i.retryingJobId()===t.id?"jobs.detail.retrying":"jobs.table.retry")," ");}}function bt(n,m){if(n&1){let t=LD();_i(0,"button",7),gh("click",function(e){Pu(t);let d=VD().$implicit,g=VD(2);return Lu(g.cancelJob(d,e))}),vw(1),Rw(2,"transloco"),Kc();}if(n&2){let t=VD().$implicit,i=VD(2);ch("disabled",i.cancellingJobId()===t.id),ah("data-testid","job-cancel-"+t.id),gI(),nl(" ",Ow(2,3,i.cancellingJobId()===t.id?"jobs.detail.cancelling":"jobs.table.cancel")," ");}}function ut(n,m){if(n&1&&(_i(0,"tr")(1,"td")(2,"a",3),vw(3),Kc()(),_i(4,"td")(5,"nz-tag"),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"td")(9,"span"),vw(10),Kc()(),_i(11,"td")(12,"span"),vw(13),Kc()(),_i(14,"td")(15,"span"),vw(16),Kc()(),_i(17,"td"),bD(18,pt,3,5,"button",4),bD(19,bt,3,5,"button",5),Kc()()),n&2){let t=m.$implicit,i=VD(2);ah("data-testid","job-row-"+t.id),gI(2),ch("routerLink",xw(16,st,t.id)),ah("data-testid","job-link-"+t.id),gI(),nl(" ",t.id," "),gI(2),ah("data-testid","job-status-"+t.id),gI(),Ph(Ow(7,14,i.statusKey(t.status))),gI(3),ah("data-testid","job-subject-"+t.id),gI(),Ph(i.subjectText(t)),gI(2),ah("data-testid","job-started-"+t.id),gI(),Ph(t.createdAt),gI(2),ah("data-testid","job-completed-"+t.id),gI(),Ph(t.completedAt??"\u2014"),gI(2),_D(t.status==="failed"?18:-1),gI(),_D(i.isTerminalStatus(t.status)?-1:19);}}function mt(n,m){if(n&1&&(_i(0,"nz-table",2)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"th"),vw(19),Rw(20,"transloco"),Kc()()(),_i(21,"tbody"),ND(22,ut,20,18,"tr",null,lt),Kc()()),n&2){let t=VD();ch("nzData",t.displayJobs())("nzFrontPagination",false)("nzShowPagination",false)("nzSize","middle"),gI(4),Ph(Ow(5,10,"jobs.table.column.id")),gI(3),Ph(Ow(8,12,"jobs.table.column.status")),gI(3),Ph(Ow(11,14,"jobs.table.column.subject")),gI(3),Ph(Ow(14,16,"jobs.table.column.started")),gI(3),Ph(Ow(17,18,"jobs.table.column.completed")),gI(3),Ph(Ow(20,20,"jobs.table.column.actions")),gI(3),xD(t.displayJobs());}}var Bt=(()=>{class n{constructor(){this.jobsApi=C($),this.router=C(Ie),this.transloco=C(Ve),this.destroyRef=C(at),this.jobs=$0(null),this.jobIds=$0([]),this.loaded=qo([]),this.loading=qo(false),this.loadError=qo(null),this.retryingJobId=qo(null),this.cancellingJobId=qo(null),this.patched=qo({}),rd(()=>{let t=this.jobs(),i=this.jobIds();if(t!=null){Bw(()=>{this.loaded.set([]),this.loading.set(false),this.loadError.set(null),this.patched.set({});});return}if(i.length===0){Bw(()=>{this.loaded.set([]),this.loading.set(false);});return}Bw(()=>{this.loading.set(true),this.loadError.set(null),Ng(i.map(e=>this.jobsApi.get(e).pipe(Xi(()=>Dg(null))))).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.loaded.set(e.filter(d=>d!=null)),this.loading.set(false);},error:()=>{this.loading.set(false),this.loadError.set("Failed to load jobs");}});});});}displayJobs(){let t=this.jobs(),i=t??this.loaded(),e=this.patched();return i.map(d=>e[d.id]??d)}isTerminalStatus(t){return u(t)}statusKey(t){return `jobs.status.${t}`}subjectText(t){return f(t.subjectContext)??"\u2014"}retryJob(t,i){i.preventDefault(),i.stopPropagation(),!(t.status!=="failed"||this.retryingJobId()===t.id)&&(this.retryingJobId.set(t.id),this.loadError.set(null),this.jobsApi.retry(t.id).subscribe({next:e=>{this.retryingJobId.set(null),this.router.navigate(["/jobs",e.id]);},error:e=>{this.retryingJobId.set(null),this.loadError.set(e instanceof o||e instanceof Error?e.message:this.transloco.translate("jobs.errors.retryFailed"));}}));}cancelJob(t,i){i.preventDefault(),i.stopPropagation(),!(u(t.status)||this.cancellingJobId()===t.id)&&(this.cancellingJobId.set(t.id),this.loadError.set(null),this.jobsApi.cancel(t.id).subscribe({next:e=>{this.cancellingJobId.set(null),this.patched.update(d=>s(r({},d),{[e.id]:e})),this.loaded.update(d=>d.map(g=>g.id===e.id?e:g));},error:e=>{this.cancellingJobId.set(null),this.loadError.set(e instanceof o||e instanceof Error?e.message:this.transloco.translate("jobs.errors.cancelFailed"));}}));}static{this.\u0275fac=function(i){return new(i||n)};}static{this.\u0275cmp=QE({type:n,selectors:[["app-job-status-table"]],inputs:{jobs:[1,"jobs"],jobIds:[1,"jobIds"]},decls:3,vars:1,consts:[["data-testid","job-status-loading"],["data-testid","job-status-error",1,"error"],["data-testid","job-status-table",3,"nzData","nzFrontPagination","nzShowPagination","nzSize"],[3,"routerLink"],["nz-button","","nzType","link","type","button",3,"disabled"],["nz-button","","nzType","link","nzDanger","","type","button",3,"disabled"],["nz-button","","nzType","link","type","button",3,"click","disabled"],["nz-button","","nzType","link","nzDanger","","type","button",3,"click","disabled"]],template:function(i,e){i&1&&bD(0,dt,3,3,"p",0)(1,ct,2,1,"p",1)(2,mt,24,22,"nz-table",2),i&2&&_D(e.loading()&&e.jobs()==null?0:e.loadError()?1:2);},dependencies:[Mi,Ln,dd,zc,t7,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".error[_ngcontent-%COMP%]{color:#9f1239}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return n})();export{Bt as B};
1
+ import {u,f}from'./chunk-CxBYhrEj.js';import {W,I}from'./chunk-CK-2DsDH.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-CrD5w72_.js';import {C,$,T as Ie,V as Ve,b as at,a0 as $0,q as qo,W as rd,Y as Bw,a9 as Ng,aa as Xi,ab as Dg,u as ue,o,s,r,Q as QE,M as Mi,L as Ln,d as dd,z as zc,c as t7,K as Kt,m as bD,B as _D,f as _i,v as vw,R as Rw,g as Kc,p as gI,P as Ph,O as Ow,E as VD,N as ND,x as ch,A as xD,a5 as ah,a3 as xw,w as nl,F as LD,h as gh,G as Pu,I as Lu}from'./main-RRKPLQCF.js';var st=n=>["/jobs",n],lt=(n,m)=>m.id;function dt(n,m){n&1&&(_i(0,"p",0),vw(1),Rw(2,"transloco"),Kc()),n&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ct(n,m){if(n&1&&(_i(0,"p",1),vw(1),Kc()),n&2){let t=VD();gI(),Ph(t.loadError());}}function pt(n,m){if(n&1){let t=LD();_i(0,"button",6),gh("click",function(e){Pu(t);let d=VD().$implicit,g=VD(2);return Lu(g.retryJob(d,e))}),vw(1),Rw(2,"transloco"),Kc();}if(n&2){let t=VD().$implicit,i=VD(2);ch("disabled",i.retryingJobId()===t.id),ah("data-testid","job-retry-"+t.id),gI(),nl(" ",Ow(2,3,i.retryingJobId()===t.id?"jobs.detail.retrying":"jobs.table.retry")," ");}}function bt(n,m){if(n&1){let t=LD();_i(0,"button",7),gh("click",function(e){Pu(t);let d=VD().$implicit,g=VD(2);return Lu(g.cancelJob(d,e))}),vw(1),Rw(2,"transloco"),Kc();}if(n&2){let t=VD().$implicit,i=VD(2);ch("disabled",i.cancellingJobId()===t.id),ah("data-testid","job-cancel-"+t.id),gI(),nl(" ",Ow(2,3,i.cancellingJobId()===t.id?"jobs.detail.cancelling":"jobs.table.cancel")," ");}}function ut(n,m){if(n&1&&(_i(0,"tr")(1,"td")(2,"a",3),vw(3),Kc()(),_i(4,"td")(5,"nz-tag"),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"td")(9,"span"),vw(10),Kc()(),_i(11,"td")(12,"span"),vw(13),Kc()(),_i(14,"td")(15,"span"),vw(16),Kc()(),_i(17,"td"),bD(18,pt,3,5,"button",4),bD(19,bt,3,5,"button",5),Kc()()),n&2){let t=m.$implicit,i=VD(2);ah("data-testid","job-row-"+t.id),gI(2),ch("routerLink",xw(16,st,t.id)),ah("data-testid","job-link-"+t.id),gI(),nl(" ",t.id," "),gI(2),ah("data-testid","job-status-"+t.id),gI(),Ph(Ow(7,14,i.statusKey(t.status))),gI(3),ah("data-testid","job-subject-"+t.id),gI(),Ph(i.subjectText(t)),gI(2),ah("data-testid","job-started-"+t.id),gI(),Ph(t.createdAt),gI(2),ah("data-testid","job-completed-"+t.id),gI(),Ph(t.completedAt??"\u2014"),gI(2),_D(t.status==="failed"?18:-1),gI(),_D(i.isTerminalStatus(t.status)?-1:19);}}function mt(n,m){if(n&1&&(_i(0,"nz-table",2)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"th"),vw(19),Rw(20,"transloco"),Kc()()(),_i(21,"tbody"),ND(22,ut,20,18,"tr",null,lt),Kc()()),n&2){let t=VD();ch("nzData",t.displayJobs())("nzFrontPagination",false)("nzShowPagination",false)("nzSize","middle"),gI(4),Ph(Ow(5,10,"jobs.table.column.id")),gI(3),Ph(Ow(8,12,"jobs.table.column.status")),gI(3),Ph(Ow(11,14,"jobs.table.column.subject")),gI(3),Ph(Ow(14,16,"jobs.table.column.started")),gI(3),Ph(Ow(17,18,"jobs.table.column.completed")),gI(3),Ph(Ow(20,20,"jobs.table.column.actions")),gI(3),xD(t.displayJobs());}}var Bt=(()=>{class n{constructor(){this.jobsApi=C($),this.router=C(Ie),this.transloco=C(Ve),this.destroyRef=C(at),this.jobs=$0(null),this.jobIds=$0([]),this.loaded=qo([]),this.loading=qo(false),this.loadError=qo(null),this.retryingJobId=qo(null),this.cancellingJobId=qo(null),this.patched=qo({}),rd(()=>{let t=this.jobs(),i=this.jobIds();if(t!=null){Bw(()=>{this.loaded.set([]),this.loading.set(false),this.loadError.set(null),this.patched.set({});});return}if(i.length===0){Bw(()=>{this.loaded.set([]),this.loading.set(false);});return}Bw(()=>{this.loading.set(true),this.loadError.set(null),Ng(i.map(e=>this.jobsApi.get(e).pipe(Xi(()=>Dg(null))))).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.loaded.set(e.filter(d=>d!=null)),this.loading.set(false);},error:()=>{this.loading.set(false),this.loadError.set("Failed to load jobs");}});});});}displayJobs(){let t=this.jobs(),i=t??this.loaded(),e=this.patched();return i.map(d=>e[d.id]??d)}isTerminalStatus(t){return u(t)}statusKey(t){return `jobs.status.${t}`}subjectText(t){return f(t.subjectContext)??"\u2014"}retryJob(t,i){i.preventDefault(),i.stopPropagation(),!(t.status!=="failed"||this.retryingJobId()===t.id)&&(this.retryingJobId.set(t.id),this.loadError.set(null),this.jobsApi.retry(t.id).subscribe({next:e=>{this.retryingJobId.set(null),this.router.navigate(["/jobs",e.id]);},error:e=>{this.retryingJobId.set(null),this.loadError.set(e instanceof o||e instanceof Error?e.message:this.transloco.translate("jobs.errors.retryFailed"));}}));}cancelJob(t,i){i.preventDefault(),i.stopPropagation(),!(u(t.status)||this.cancellingJobId()===t.id)&&(this.cancellingJobId.set(t.id),this.loadError.set(null),this.jobsApi.cancel(t.id).subscribe({next:e=>{this.cancellingJobId.set(null),this.patched.update(d=>s(r({},d),{[e.id]:e})),this.loaded.update(d=>d.map(g=>g.id===e.id?e:g));},error:e=>{this.cancellingJobId.set(null),this.loadError.set(e instanceof o||e instanceof Error?e.message:this.transloco.translate("jobs.errors.cancelFailed"));}}));}static{this.\u0275fac=function(i){return new(i||n)};}static{this.\u0275cmp=QE({type:n,selectors:[["app-job-status-table"]],inputs:{jobs:[1,"jobs"],jobIds:[1,"jobIds"]},decls:3,vars:1,consts:[["data-testid","job-status-loading"],["data-testid","job-status-error",1,"error"],["data-testid","job-status-table",3,"nzData","nzFrontPagination","nzShowPagination","nzSize"],[3,"routerLink"],["nz-button","","nzType","link","type","button",3,"disabled"],["nz-button","","nzType","link","nzDanger","","type","button",3,"disabled"],["nz-button","","nzType","link","type","button",3,"click","disabled"],["nz-button","","nzType","link","nzDanger","","type","button",3,"click","disabled"]],template:function(i,e){i&1&&bD(0,dt,3,3,"p",0)(1,ct,2,1,"p",1)(2,mt,24,22,"nz-table",2),i&2&&_D(e.loading()&&e.jobs()==null?0:e.loadError()?1:2);},dependencies:[Mi,Ln,dd,zc,t7,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".error[_ngcontent-%COMP%]{color:#9f1239}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return n})();export{Bt as B};