@knoflows/engine 0.1.0-beta.16 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/engine.js +19 -19
  2. package/package.json +3 -3
  3. package/static/assets/i18n/en.json +1 -0
  4. package/static/assets/i18n/es.json +1 -0
  5. package/static/chunk--WRMKpmO.js +5 -0
  6. package/static/{chunk-iE460Kz5.js → chunk-5xJXPFlv.js} +1 -1
  7. package/static/{chunk-DfcFBVF4.js → chunk-7NTQwN96.js} +1 -1
  8. package/static/{chunk-Edaw7VGW.js → chunk-BCHj6l85.js} +1 -1
  9. package/static/{chunk-B2Xol2Un.js → chunk-BIL86kgf.js} +1 -1
  10. package/static/{chunk-C0HCwfa5.js → chunk-BIdwV0jx.js} +1 -1
  11. package/static/{chunk-B0kZCuEt.js → chunk-BRZ5T52h.js} +1 -1
  12. package/static/{chunk-Th9whP36.js → chunk-B_R_vsLt.js} +1 -1
  13. package/static/{chunk-DtQtDE8q.js → chunk-BaYdwXIA.js} +1 -1
  14. package/static/{chunk-HUIPNwd9.js → chunk-BcQQgpKh.js} +1 -1
  15. package/static/{chunk-Bgl02GNl.js → chunk-BrP_q6LZ.js} +1 -1
  16. package/static/{chunk-Fwpw-z7T.js → chunk-Bv1r1Ly-.js} +1 -1
  17. package/static/chunk-C3Xml1YG.js +1 -0
  18. package/static/{chunk-DYzSLsNo.js → chunk-C9PkSfMb.js} +1 -1
  19. package/static/{chunk-Cg2E0vnT.js → chunk-CLM-K-Vg.js} +1 -1
  20. package/static/{chunk-NZ-CPWJ2.js → chunk-CPNxRF7A.js} +1 -1
  21. package/static/{chunk-BhF-m2HP.js → chunk-CRGkNzel.js} +1 -1
  22. package/static/{chunk-9U0WIegY.js → chunk-CV-FUe_H.js} +1 -1
  23. package/static/{chunk-CeywzbyD.js → chunk-CZoPJsBm.js} +1 -1
  24. package/static/{chunk-yoe_30RI.js → chunk-CuwZV6XG.js} +1 -1
  25. package/static/{chunk-CenXuPs5.js → chunk-Cvoe3MtC.js} +1 -1
  26. package/static/{chunk-C2BVYtVN.js → chunk-D3JZ8ur5.js} +2 -2
  27. package/static/{chunk-BhTujCrk.js → chunk-DAONFRT8.js} +1 -1
  28. package/static/{chunk-CsQ_HDGC.js → chunk-DDhSFoAE.js} +1 -1
  29. package/static/{chunk-DZJZYEZl.js → chunk-DEF7Ge5B.js} +1 -1
  30. package/static/{chunk-bCuvpgQS.js → chunk-DHC_yfIa.js} +1 -1
  31. package/static/{chunk-z2vvQAle.js → chunk-DSgUAlqN.js} +1 -1
  32. package/static/{chunk-FOJfn_t9.js → chunk-DVJ9L-aC.js} +1 -1
  33. package/static/{chunk-Bu6_39Nh.js → chunk-DaO-gpzS.js} +1 -1
  34. package/static/{chunk-CRv0PDB7.js → chunk-Dg-4XevL.js} +1 -1
  35. package/static/{chunk-CRdEWPUM.js → chunk-DvWh-Q5D.js} +1 -1
  36. package/static/{chunk-B7WkIFy0.js → chunk-Dx92ksvP.js} +1 -1
  37. package/static/{chunk-CecXf-CU.js → chunk-DyiDg8XX.js} +1 -1
  38. package/static/{chunk-DGC4TkAL.js → chunk-VXZaUyyE.js} +1 -1
  39. package/static/{chunk-Dp4H7MY0.js → chunk-Ysn4Fbgj.js} +1 -1
  40. package/static/{chunk-BW9BdLk-.js → chunk-ZqQUQSE8.js} +1 -1
  41. package/static/{chunk-C7h8oMzu.js → chunk-hpn_m1ZC.js} +1 -1
  42. package/static/{chunk-DUkiyf7y.js → chunk-pi-mtheN.js} +1 -1
  43. package/static/{chunk-Dv5GyY6h.js → chunk-xeQj_hSF.js} +1 -1
  44. package/static/index.html +1 -1
  45. package/static/{main-CHQMTVIP.js → main-SI5AKDMC.js} +1 -1
  46. package/static/chunk-DixyYfV_.js +0 -1
  47. package/static/chunk-p6dftaf8.js +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knoflows/engine",
3
- "version": "0.1.0-beta.16",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -30,9 +30,9 @@
30
30
  "test:providers": "tsx src/providers/test/provider-test.ts",
31
31
  "test:secrets": "tsx src/secrets/secret-store.test.ts",
32
32
  "test:jira": "tsx src/providers/ticket/adf.test.ts && tsx src/providers/ticket/jira-ticket-provider.test.ts && tsx src/providers/query-templates/jira-query-templates.test.ts",
33
- "test:confluence": "tsx src/providers/documentation/confluence-documentation-provider.test.ts",
33
+ "test:confluence": "tsx src/providers/documentation/confluence-documentation-provider.test.ts && tsx src/providers/query-templates/confluence-query-templates.test.ts",
34
34
  "test:github": "tsx src/providers/ticket/github-issues-provider.test.ts",
35
- "test:bitbucket": "tsx src/providers/repo/bitbucket-repo-provider.test.ts",
35
+ "test:bitbucket": "tsx src/providers/query-repo-list.test.ts && tsx src/providers/repo/bitbucket-repo-provider.test.ts",
36
36
  "test:registry": "tsx src/providers/provider-registry.service.test.ts",
37
37
  "test:claude-agent": "tsx src/providers/agent/claude-agent-provider.test.ts",
38
38
  "test:cursor-agent": "tsx src/providers/agent/cursor-agent-provider.test.ts",
@@ -556,6 +556,7 @@
556
556
  "views.editor.subjectType": "Subject type",
557
557
  "views.editor.query": "Query (JSON)",
558
558
  "views.editor.queryHint": "Raw provider filter object. Use this when no template covers what you need.",
559
+ "views.editor.manualListHint": "This list holds Confluence page IDs. Copy the number from a page URL, right after /pages/.",
559
560
  "views.editor.queryMode": "Query",
560
561
  "views.editor.queryMode.template": "Template",
561
562
  "views.editor.queryMode.raw": "Raw JSON",
@@ -556,6 +556,7 @@
556
556
  "views.editor.subjectType": "Tipo de sujeto",
557
557
  "views.editor.query": "Consulta (JSON)",
558
558
  "views.editor.queryHint": "Objeto de filtro del proveedor en crudo. Úsalo cuando ninguna plantilla cubra lo que necesitas.",
559
+ "views.editor.manualListHint": "Esta lista contiene IDs de páginas de Confluence. Copia el número de la URL de la página, justo después de /pages/.",
559
560
  "views.editor.queryMode": "Consulta",
560
561
  "views.editor.queryMode.template": "Plantilla",
561
562
  "views.editor.queryMode.raw": "JSON en crudo",
@@ -0,0 +1,5 @@
1
+ import {T}from'./chunk-DVJ9L-aC.js';import {D,B as B$1,z}from'./chunk-pi-mtheN.js';import {H as He$1}from'./chunk-hpn_m1ZC.js';import {C,a as C1,R as J1,b6 as U,b8 as y,b as at,V as Ve$1,bo as O,bp as de,ba as Se$1,q as qo,U as Uw,u as ue,s,r as r$1,c as bi,Z as ZE,d as $8,e as al,bb as er,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,I as Iw,J as Jc,P as Pw,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl$1,M as MD,H as HD,G as FD,k as iE,x as xD,y as aE,B as AD,N as ND,n as uh,O as Fu,Q as ju,al as Sh,D as ch,aR as xw}from'./main-SI5AKDMC.js';import {b}from'./chunk-Dx92ksvP.js';import {a as ai,z as z$1}from'./chunk-BIL86kgf.js';import {e as Uu,z as z_,S as S_,G as G$}from'./chunk-D3JZ8ur5.js';import'./chunk-CLM-K-Vg.js';var be=()=>[],B=(t,o)=>o.id,Ie=(t,o)=>o.name;function Ee(t,o){t&1&&(_i(0,"p",6),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Ve(t,o){if(t&1&&(_i(0,"p",7),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function Se(t,o){if(t&1&&(_i(0,"li"),Iw(1),Jc()),t&2){let e=o.$implicit;gI(),Lh(e);}}function ze(t,o){if(t&1&&(_i(0,"section",8)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"ul"),xD(5,Se,2,1,"li",null,ND),Jc()()),t&2){let e=HD(2);gI(2),Lh(Fw(3,1,"views.editor.validation")),gI(3),AD(e.validationErrors());}}function Pe(t,o){if(t&1&&uh(0,"nz-option",12),t&2){let e=o.$implicit;lh("nzValue",e.id)("nzLabel",e.name);}}function ke(t,o){t&1&&(_i(0,"p",14),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"views.editor.noEligibleInstances")," "));}function qe(t,o){t&1&&(_i(0,"p",17),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"views.editor.instanceNeeded")," "));}function Ne(t,o){if(t&1&&uh(0,"nz-option",12),t&2){let e=o.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function De(t,o){if(t&1){let e=FD();_i(0,"div",16),_D(1,qe,3,3,"p",17),_i(2,"span"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"nz-select",18),Pw(6,"transloco"),mh("ngModelChange",function(n){Fu(e);let s=HD(3);return ju(s.onInstanceChange(n))}),xD(7,Ne,1,2,"nz-option",12,B),Jc(),iE(),Jc();}if(t&2){let e=HD(3);Sh("field-attention",e.needsInstanceAttention()),gI(),MD(e.needsInstanceAttention()?1:-1),gI(2),Lh(Fw(4,6,"views.editor.instance")),gI(2),lh("nzPlaceHolder",Fw(6,8,"views.editor.instancePlaceholder"))("ngModel",e.providerInstanceId()),aE(),gI(2),AD(e.eligibleInstances());}}function Ae(t,o){if(t&1&&_D(0,ke,3,3,"p",14)(1,De,9,10,"div",15),t&2){let e=HD(2);MD(e.eligibleInstances().length===0?0:1);}}function Fe(t,o){if(t&1){let e=FD();_i(0,"div",13)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",19)(5,"button",20),mh("click",function(){Fu(e);let n=HD(2);return ju(n.setQueryMode("template"))}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",21),mh("click",function(){Fu(e);let n=HD(2);return ju(n.setQueryMode("raw"))}),Iw(9),Pw(10,"transloco"),Jc()()();}if(t&2){let e=HD(2);gI(2),Lh(Fw(3,5,"views.editor.queryMode")),gI(3),lh("nzType",e.queryMode()==="template"?"primary":"default"),gI(),rl$1(" ",Fw(7,7,"views.editor.queryMode.template")," "),gI(2),lh("nzType",e.queryMode()==="raw"?"primary":"default"),gI(),rl$1(" ",Fw(10,9,"views.editor.queryMode.raw")," ");}}function je(t,o){if(t&1&&uh(0,"nz-option",12),t&2){let e=o.$implicit;lh("nzValue",e.id)("nzLabel",e.label);}}function Be(t,o){if(t&1){let e=FD();_i(0,"label",9)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"textarea",23),mh("ngModelChange",function(n){Fu(e);let s=HD(4);return ju(s.queryText.set(n))}),Jc(),iE(),_i(5,"span",24),Iw(6),Pw(7,"transloco"),Jc()();}if(t&2){let e=HD(4);gI(2),Lh(Fw(3,3,"views.editor.query")),gI(2),lh("ngModel",e.queryText()),aE(),gI(2),Lh(Fw(7,5,"views.editor.manualListHint"));}}function Oe(t,o){t&1&&(_i(0,"span",25),Iw(1,"*"),Jc());}function Le(t,o){if(t&1&&uh(0,"nz-option",12),t&2){let e=o.$implicit;lh("nzValue",e)("nzLabel",e);}}function $e(t,o){if(t&1){let e=FD();_i(0,"nz-select",29),mh("ngModelChange",function(n){Fu(e);let s=HD().$implicit,C=HD(5);return ju(C.setTemplateParam(s.name,n))}),xD(1,Le,1,2,"nz-option",12,ND),Jc(),iE();}if(t&2){let e=HD().$implicit,i=HD(5);lh("ngModel",i.templateParamValue(e.name)),ch("data-testid","template-param-"+e.name),aE(),gI(),AD(e.options??xw(2,be));}}function Re(t,o){if(t&1){let e=FD();_i(0,"nz-select",30),mh("ngModelChange",function(n){Fu(e);let s=HD().$implicit,C=HD(5);return ju(C.setTemplateParam(s.name,n))}),Jc(),iE();}if(t&2){let e=HD().$implicit,i=HD(5);lh("ngModel",i.templateParamListValue(e.name)),ch("data-testid","template-param-"+e.name),aE();}}function We(t,o){if(t&1){let e=FD();_i(0,"input",31),mh("ngModelChange",function(n){Fu(e);let s=HD().$implicit,C=HD(5);return ju(C.setTemplateParam(s.name,n))}),Jc(),iE();}if(t&2){let e=HD().$implicit,i=HD(5);lh("ngModel",i.templateParamValue(e.name)),ch("data-testid","template-param-"+e.name),aE();}}function Je(t,o){if(t&1&&(_i(0,"label",9)(1,"span"),Iw(2),_D(3,Oe,2,0,"span",25),Jc(),_D(4,$e,3,3,"nz-select",26)(5,Re,1,2,"nz-select",27)(6,We,1,2,"input",28),Jc()),t&2){let e=o.$implicit;gI(2),rl$1(" ",e.label," "),gI(),MD(e.required?3:-1),gI(),MD(e.type==="select"?4:e.type==="string[]"?5:6);}}function Qe(t,o){if(t&1&&xD(0,Je,7,3,"label",9,Ie),t&2){let e=HD();AD(e.params);}}function He(t,o){if(t&1&&_D(0,Be,8,7,"label",9)(1,Qe,2,0),t&2){let e=HD(3);MD(e.isRawSeedTemplate()?0:1);}}function Ue(t,o){if(t&1){let e=FD();_i(0,"div",9)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nz-select",22),mh("ngModelChange",function(n){Fu(e);let s=HD(2);return ju(s.selectTemplate(n))}),xD(5,je,1,2,"nz-option",12,B),Jc(),iE(),Jc(),_D(7,He,2,1);}if(t&2){let e,i=HD(2);gI(2),Lh(Fw(3,3,"views.editor.template")),gI(2),lh("ngModel",i.selectedTemplateId()),aE(),gI(),AD(i.templates()),gI(2),MD((e=i.selectedTemplate())?7:-1,e);}}function Ge(t,o){if(t&1){let e=FD();_i(0,"label",9)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"textarea",23),mh("ngModelChange",function(n){Fu(e);let s=HD(2);return ju(s.queryText.set(n))}),Jc(),iE(),_i(5,"span",32),Iw(6),Pw(7,"transloco"),Jc()();}if(t&2){let e=HD(2);gI(2),Lh(Fw(3,3,"views.editor.query")),gI(2),lh("ngModel",e.queryText()),aE(),gI(2),Lh(Fw(7,5,"views.editor.queryHint"));}}function Ke(t,o){if(t&1){let e=FD();_D(0,ze,7,3,"section",8),_i(1,"label",9)(2,"span"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"input",10),mh("ngModelChange",function(n){Fu(e);let s=HD();return ju(s.name.set(n))}),Jc(),iE(),Jc(),_i(6,"div",9)(7,"span"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"nz-select",11),mh("ngModelChange",function(n){Fu(e);let s=HD();return ju(s.onWorkflowChange(n))}),xD(11,Pe,1,2,"nz-option",12,B),Jc(),iE(),Jc(),_D(13,Ae,2,1),_D(14,Fe,11,11,"div",13),_D(15,Ue,8,5)(16,Ge,8,7,"label",9);}if(t&2){let e=HD();MD(e.validationErrors().length>0?0:-1),gI(3),Lh(Fw(4,8,"views.editor.name")),gI(2),lh("ngModel",e.name()),aE(),gI(3),Lh(Fw(9,10,"views.editor.workflow")),gI(2),lh("ngModel",e.workflowId()),aE(),gI(),AD(e.bindableWorkflows()),gI(2),MD(e.selectedWorkflow()&&e.settings()?13:-1),gI(),MD(e.hasTemplates()?14:-1),gI(),MD(e.queryMode()==="template"&&e.hasTemplates()?15:16);}}function Ye(t){let o=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return o.length>0?`${o}-${e}`:`view-${e}`}var Ze=[];function Xe(t){let o={};for(let e of t.params)e.type==="select"?o[e.name]=e.options?.[0]??"":e.type==="string[]"?o[e.name]=[]:o[e.name]="";return o}function Me(t,o){let e=r$1(r$1({},Xe(t)),o);for(let i of t.params){if(i.type!=="string[]")continue;let n=e[i.name];e[i.name]=Array.isArray(n)?n.map(s=>String(s)):[];}return e}function et(t){let o=t?.trim()??"";return o.length>0?o:null}var kt=(()=>{class t{constructor(){this.route=C(C1),this.router=C(J1),this.viewsApi=C(U),this.nav=C(y),this.workflowsApi=C(b),this.settingsApi=C(D),this.providersApi=C(B$1),this.message=C(He$1),this.destroyRef=C(at),this.transloco=C(Ve$1),this.language=C(O),this.routeId=de(this.route.paramMap.pipe(Se$1(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.providerInstanceId=qo(null),this.workflows=qo([]),this.subjectType=qo(null),this.queryText=qo(`{
2
+
3
+ }`),this.queryMode=qo("template"),this.templates=qo([]),this.selectedTemplateId=qo(null),this.templateParams=qo({}),this.settings=qo(null),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.bindableWorkflows=Uw(()=>this.workflows().filter(e=>e.appliesTo!=="none")),this.selectedWorkflow=Uw(()=>this.bindableWorkflows().find(e=>e.id===this.workflowId())??null),this.subjectTypeOptions=Uw(()=>Uu(this.selectedWorkflow()?.appliesTo??"none")),this.eligibleInstances=Uw(()=>z(this.settings(),this.subjectTypeOptions())),this.selectedInstance=Uw(()=>this.eligibleInstances().find(e=>e.id===this.providerInstanceId())??null),this.needsInstanceAttention=Uw(()=>this.selectedWorkflow()!=null&&this.settings()!=null&&this.eligibleInstances().length>0&&this.selectedInstance()==null),this.isNew=Uw(()=>!this.routeId()),this.pageTitle=Uw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("views.editor.titleNew"):this.transloco.translate("views.editor.titleEdit",{name:this.name().trim()}))),this.selectedTemplate=Uw(()=>this.templates().find(e=>e.id===this.selectedTemplateId())??null),this.hasTemplates=Uw(()=>this.templates().length>0),this.isRawSeedTemplate=Uw(()=>this.selectedTemplateId()==="manual-list"),this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.settingsApi.getSettings().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.settings.set(e),this.refreshTemplates();},error:e=>{this.settings.set(z_),this.refreshTemplates(),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(e=>{let i=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),this.pendingProvenance=void 0,!i){this.name.set(""),this.workflowId.set(""),this.providerInstanceId.set(null),this.subjectType.set(null),this.queryText.set(`{
4
+
5
+ }`),this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.loading.set(false),this.refreshTemplates();return}this.loading.set(true),this.viewsApi.get(i).subscribe({next:n=>{this.name.set(n.name),this.workflowId.set(n.workflowId),this.providerInstanceId.set(et(n.providerInstanceId)),this.subjectType.set(n.subjectType),this.queryText.set(JSON.stringify(n.query,null,2)),this.pendingProvenance=n.queryTemplate,this.queryMode.set(n.queryTemplate?"template":"raw"),this.loading.set(false),this.refreshTemplates();},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,this.transloco.translate("views.editor.loadFailed")));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}onWorkflowChange(e){this.workflowId.set(e);let i=Uu(this.bindableWorkflows().find(s=>s.id===e)?.appliesTo??"none");this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({});let n=z(this.settings(),i);if(n.length===1)this.applyInstance(n[0]);else {let s=this.providerInstanceId(),C=n.find(k=>k.id===s);C?this.applyInstance(C):(this.providerInstanceId.set(null),this.subjectType.set(null));}this.refreshTemplates();}onInstanceChange(e){let i=this.eligibleInstances().find(n=>n.id===e);this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),i&&this.applyInstance(i),this.refreshTemplates();}applyInstance(e){this.providerInstanceId.set(e.id),S_(e)&&this.subjectType.set(e.subjectType);}setQueryMode(e){this.queryMode.set(e),e==="template"&&!this.selectedTemplateId()&&this.templates()[0]&&this.selectTemplate(this.templates()[0].id);}selectTemplate(e){let i=this.templates().find(n=>n.id===e);this.selectedTemplateId.set(e),this.templateParams.set(i?Me(i,{}):{}),e==="manual-list"&&this.resolveRawSeedTemplate();}templateParamValue(e){let i=this.templateParams()[e];return i==null?"":String(i)}templateParamListValue(e){let i=this.templateParams()[e];return Array.isArray(i)?i:Ze}setTemplateParam(e,i){this.templateParams.set(s(r$1({},this.templateParams()),{[e]:i}));}save(){if(!this.selectedInstance()){this.validationErrors.set([this.transloco.translate("views.editor.pickInstance")]);return}if(this.queryMode()==="template"&&this.hasTemplates()){this.saveFromTemplate();return}this.saveFromRawJson();}saveFromTemplate(){let e=this.selectedTemplate(),i=this.providerInstanceId();if(!e||!i){this.validationErrors.set([this.transloco.translate("views.editor.pickTemplate")]);return}let n=e.params.filter(s=>s.required?tt(this.templateParams()[s.name]):false);if(n.length>0){this.validationErrors.set(n.map(s=>this.transloco.translate("views.editor.missingParam",{label:s.label})));return}if(e.id==="manual-list"){this.saveFromRawJson({templateId:e.id,params:this.templateParams()});return}this.validationErrors.set([]),this.saving.set(true),this.providersApi.resolveQueryTemplate(i,e.id,this.templateParams()).subscribe({next:s=>{this.persist({query:s.query,queryTemplate:{templateId:e.id,params:this.templateParams()}});},error:s=>{this.saving.set(false),this.message.error(this.errorMessage(s,this.transloco.translate("views.editor.resolveFailed")));}});}saveFromRawJson(e){let i;try{i=JSON.parse(this.queryText());}catch(n){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}if(i===null||typeof i!="object"||Array.isArray(i)){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}this.persist({query:i,queryTemplate:e});}persist(e){let i=this.routeId(),n=this.subjectType(),s=r$1({id:i??Ye(this.name()),name:this.name().trim(),subjectType:n??"",providerInstanceId:this.providerInstanceId()??"",workflowId:this.workflowId(),query:e.query},e.queryTemplate?{queryTemplate:e.queryTemplate}:{}),C=G$.safeParse(s);if(!C.success){this.saving.set(false),this.validationErrors.set(T(C.error));return}this.validationErrors.set([]),this.saving.set(true);let k=C.data;(this.isNew()||!i?this.viewsApi.create(k):this.viewsApi.update(i,k)).subscribe({next:D=>{this.saving.set(false),this.nav.refresh(),this.message.success(this.transloco.translate(this.isNew()?"views.editor.created":"views.editor.saved")),this.isNew()&&this.router.navigate(["/views",D.id,"edit"]);},error:D=>{this.saving.set(false),this.message.error(this.errorMessage(D,this.transloco.translate("views.editor.saveFailed")));}});}refreshTemplates(){let e=this.providerInstanceId();if(!e){this.templates.set([]),this.applyLoadedTemplates([]);return}this.providersApi.listQueryTemplates(e).subscribe({next:i=>{this.templates.set(i),this.applyLoadedTemplates(i);},error:()=>{this.templates.set([]),this.applyLoadedTemplates([]);}});}resolveRawSeedTemplate(){let e=this.providerInstanceId();e&&this.providersApi.resolveQueryTemplate(e,"manual-list",{}).subscribe({next:i=>{this.selectedTemplateId()==="manual-list"&&this.queryText.set(JSON.stringify(i.query,null,2));},error:i=>{this.message.error(this.errorMessage(i,this.transloco.translate("views.editor.resolveFailed")));}});}applyLoadedTemplates(e){let i=this.pendingProvenance;if(i){let n=e.find(s=>s.id===i.templateId);n?(this.queryMode.set("template"),this.selectedTemplateId.set(n.id),this.templateParams.set(Me(n,i.params))):(this.queryMode.set("raw"),this.selectedTemplateId.set(null)),this.pendingProvenance=void 0;return}if(this.queryMode()!=="raw"){if(e.length===0){this.queryMode.set("raw"),this.selectedTemplateId.set(null),this.templateParams.set({});return}e.some(n=>n.id===this.selectedTemplateId())||this.selectTemplate(e[0].id);}}errorMessage(e,i){return e instanceof bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-view-editor"]],decls:15,vars:10,consts:[["data-testid","view-editor",1,"editor"],[1,"header"],["data-testid","page-title"],[1,"header-actions"],["routerLink","/views"],["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"],[1,"field"],["nz-input","","data-testid","view-name",3,"ngModelChange","ngModel"],["data-testid","view-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","query-mode-toggle",1,"field"],["data-testid","view-instance-empty",1,"error"],["data-testid","view-instance-field",1,"field",3,"field-attention"],["data-testid","view-instance-field",1,"field"],["data-testid","view-instance-needed",1,"attention"],["data-testid","view-instance",3,"ngModelChange","nzPlaceHolder","ngModel"],[1,"mode-toggle"],["nz-button","","type","button","data-testid","query-mode-template",3,"click","nzType"],["nz-button","","type","button","data-testid","query-mode-raw",3,"click","nzType"],["data-testid","view-template",3,"ngModelChange","ngModel"],["nz-input","","rows","8","data-testid","view-query",3,"ngModelChange","ngModel"],["data-testid","manual-list-hint",1,"hint"],[1,"required"],[3,"ngModel"],["nzMode","tags",3,"ngModel"],["nz-input","",3,"ngModel"],[3,"ngModelChange","ngModel"],["nzMode","tags",3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],[1,"hint"]],template:function(i,n){i&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1",2),Iw(4),Jc()(),_i(5,"div",3)(6,"a",4),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"button",5),mh("click",function(){return n.save()}),Iw(10),Pw(11,"transloco"),Jc()()(),_D(12,Ee,3,3,"p",6)(13,Ve,2,1,"p",7)(14,Ke,17,12),Jc()),i&2&&(gI(4),Lh(n.pageTitle()),gI(3),Lh(Fw(8,6,"views.editor.backToList")),gI(2),lh("nzLoading",n.saving())("disabled",n.loading()||!!n.loadError()),gI(),rl$1(" ",Fw(11,8,"common.save")," "),gI(2),MD(n.loading()?12:n.loadError()?13:14));},dependencies:[$8,al,er,rl,$i,v3,pf,bd,sp,fp,ai,z$1,ex,Fm,Am,Kt],styles:[".editor[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{font-size:.8rem;color:#78716c}.field-attention[_ngcontent-%COMP%]{border:1px solid #f59e0b;background:#fffbeb;padding:.75rem 1rem;border-radius:.35rem}.attention[_ngcontent-%COMP%]{margin:0;color:#b45309;font-size:.85rem}.mode-toggle[_ngcontent-%COMP%]{display:flex;gap:.5rem}.required[_ngcontent-%COMP%]{color:#9f1239}.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}textarea[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace}"]});}}return t})();function tt(t){return t==null?true:typeof t=="string"?t.trim()==="":Array.isArray(t)?t.every(o=>String(o).trim()===""):false}export{kt as ViewEditorComponent};
@@ -1 +1 @@
1
- import {a7 as KE,a8 as fu,C,bV as XI,bf as _r,ab as Oe,ae as Le$1,bW as Bl,bX as _l,Z as ZE,a3 as Ah,a4 as Th,ai as ly,av as K0,aj as $D,ak as UD,l as _D,o as gI,M as MD,m as mh,aP as Mh,al as Sh,bY as qn,bZ as $n,G as FD,j as _i,J as Jc,O as Fu,H as HD,Q as ju}from'./main-CHQMTVIP.js';var V=["*"];function x(o,A){if(o&1){let n=FD();_i(0,"nz-icon",1),mh("click",function(e){Fu(n);let i=HD();return ju(i.closeTag(e))}),Jc();}}var I=(()=>{class o{renderer=C(XI);el=C(_r).nativeElement;dir=C(Oe).valueSignal;nzMode="default";nzColor;nzChecked=false;nzBordered=true;nzOnClose=new Le$1;nzCheckedChange=new Le$1;isPresetColor=false;updateCheckedStatus(){this.nzMode==="checkable"&&(this.nzChecked=!this.nzChecked,this.nzCheckedChange.emit(this.nzChecked));}closeTag(n){this.nzOnClose.emit(n),n.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.el),this.el);}clearPresetColor(){let n=new RegExp(`(ant-tag-(?:${[...qn,...$n].join("|")}))`,"g"),t=this.el.classList.toString(),e=[],i=n.exec(t);for(;i!==null;)e.push(i[1]),i=n.exec(t);this.el.classList.remove(...e);}setPresetColor(){this.clearPresetColor(),this.nzColor?this.isPresetColor=Bl(this.nzColor)||_l(this.nzColor):this.isPresetColor=false,this.isPresetColor&&this.el.classList.add(`ant-tag-${this.nzColor}`);}ngOnChanges(n){let{nzColor:t}=n;t&&this.setPresetColor();}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=ZE({type:o,selectors:[["nz-tag"]],hostAttrs:[1,"ant-tag"],hostVars:12,hostBindings:function(t,e){t&1&&mh("click",function(){return e.updateCheckedStatus()}),t&2&&(Mh("background-color",e.isPresetColor?"":e.nzColor),Sh("ant-tag-has-color",e.nzColor&&!e.isPresetColor)("ant-tag-checkable",e.nzMode==="checkable")("ant-tag-checkable-checked",e.nzChecked)("ant-tag-rtl",e.dir()==="rtl")("ant-tag-borderless",!e.nzBordered));},inputs:{nzMode:"nzMode",nzColor:"nzColor",nzChecked:[2,"nzChecked","nzChecked",K0],nzBordered:[2,"nzBordered","nzBordered",K0]},outputs:{nzOnClose:"nzOnClose",nzCheckedChange:"nzCheckedChange"},exportAs:["nzTag"],features:[ly],ngContentSelectors:V,decls:2,vars:1,consts:[["nzType","close","tabindex","-1",1,"ant-tag-close-icon"],["nzType","close","tabindex","-1",1,"ant-tag-close-icon",3,"click"]],template:function(t,e){t&1&&($D(),UD(0),_D(1,x,1,0,"nz-icon",0)),t&2&&(gI(),MD(e.nzMode==="closeable"?1:-1));},dependencies:[Ah,Th],encapsulation:2})}return o})(),W=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=KE({type:o});static \u0275inj=fu({imports:[I]})}return o})();export{I,W};
1
+ import {a7 as KE,a8 as fu,C,bV as XI,bf as _r,ab as Oe,ae as Le$1,bW as Bl,bX as _l,Z as ZE,a3 as Ah,a4 as Th,ai as ly,av as K0,aj as $D,ak as UD,l as _D,o as gI,M as MD,m as mh,aP as Mh,al as Sh,bY as qn,bZ as $n,G as FD,j as _i,J as Jc,O as Fu,H as HD,Q as ju}from'./main-SI5AKDMC.js';var V=["*"];function x(o,A){if(o&1){let n=FD();_i(0,"nz-icon",1),mh("click",function(e){Fu(n);let i=HD();return ju(i.closeTag(e))}),Jc();}}var I=(()=>{class o{renderer=C(XI);el=C(_r).nativeElement;dir=C(Oe).valueSignal;nzMode="default";nzColor;nzChecked=false;nzBordered=true;nzOnClose=new Le$1;nzCheckedChange=new Le$1;isPresetColor=false;updateCheckedStatus(){this.nzMode==="checkable"&&(this.nzChecked=!this.nzChecked,this.nzCheckedChange.emit(this.nzChecked));}closeTag(n){this.nzOnClose.emit(n),n.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.el),this.el);}clearPresetColor(){let n=new RegExp(`(ant-tag-(?:${[...qn,...$n].join("|")}))`,"g"),t=this.el.classList.toString(),e=[],i=n.exec(t);for(;i!==null;)e.push(i[1]),i=n.exec(t);this.el.classList.remove(...e);}setPresetColor(){this.clearPresetColor(),this.nzColor?this.isPresetColor=Bl(this.nzColor)||_l(this.nzColor):this.isPresetColor=false,this.isPresetColor&&this.el.classList.add(`ant-tag-${this.nzColor}`);}ngOnChanges(n){let{nzColor:t}=n;t&&this.setPresetColor();}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=ZE({type:o,selectors:[["nz-tag"]],hostAttrs:[1,"ant-tag"],hostVars:12,hostBindings:function(t,e){t&1&&mh("click",function(){return e.updateCheckedStatus()}),t&2&&(Mh("background-color",e.isPresetColor?"":e.nzColor),Sh("ant-tag-has-color",e.nzColor&&!e.isPresetColor)("ant-tag-checkable",e.nzMode==="checkable")("ant-tag-checkable-checked",e.nzChecked)("ant-tag-rtl",e.dir()==="rtl")("ant-tag-borderless",!e.nzBordered));},inputs:{nzMode:"nzMode",nzColor:"nzColor",nzChecked:[2,"nzChecked","nzChecked",K0],nzBordered:[2,"nzBordered","nzBordered",K0]},outputs:{nzOnClose:"nzOnClose",nzCheckedChange:"nzCheckedChange"},exportAs:["nzTag"],features:[ly],ngContentSelectors:V,decls:2,vars:1,consts:[["nzType","close","tabindex","-1",1,"ant-tag-close-icon"],["nzType","close","tabindex","-1",1,"ant-tag-close-icon",3,"click"]],template:function(t,e){t&1&&($D(),UD(0),_D(1,x,1,0,"nz-icon",0)),t&2&&(gI(),MD(e.nzMode==="closeable"?1:-1));},dependencies:[Ah,Th],encapsulation:2})}return o})(),W=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=KE({type:o});static \u0275inj=fu({imports:[I]})}return o})();export{I,W};
@@ -1 +1 @@
1
- import {U}from'./chunk-Fwpw-z7T.js';import {f}from'./chunk-CeywzbyD.js';import {L as Lt}from'./chunk-CecXf-CU.js';import {y,S}from'./chunk-9U0WIegY.js';import'./chunk-C2BVYtVN.js';import {W,I}from'./chunk-iE460Kz5.js';import'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';import {C,a as C1,$,V as Ve,b as at$1,S as p,q as qo,u as ue,T as id,W as qw,c as bi,Z as ZE,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,n as uh,w as lh,az as jw,E as Aw,G as FD,m as mh,z as rl,O as Fu,Q as ju}from'./main-CHQMTVIP.js';var Z=i=>({count:i});function tt(i,p){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function et(i,p){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function it(i,p){if(i&1){let t=FD();_i(0,"button",15),mh("click",function(){Fu(t);let u=HD(2);return ju(u.cancelBatch())}),Iw(1),Pw(2,"transloco"),Jc();}if(i&2){let t=HD(2);lh("disabled",t.cancelling()),gI(),rl(" ",Fw(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function nt(i,p){if(i&1&&(_i(0,"p",12),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.actionError());}}function at(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"h1",5),Iw(6),Jc(),_i(7,"p",6)(8,"nz-tag",7),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"span",8),Iw(12),Jc(),Iw(13," \xB7 "),_i(14,"span",9),Iw(15),Pw(16,"transloco"),Jc(),Iw(17," \xB7 "),_i(18,"span",10),Iw(19),Pw(20,"transloco"),Jc()()(),_D(21,it,3,4,"button",11),Jc(),_D(22,nt,2,1,"p",12),_i(23,"section",13)(24,"h2"),Iw(25),Pw(26,"transloco"),Jc(),uh(27,"app-job-status-table",14),Jc()),i&2){let t=p,e=HD();gI(3),Lh(Fw(4,12,"batches.detail.backHint")),gI(3),Lh(t.id),gI(2),lh("nzColor",e.batchStatusTagColor(t.status,e.theme.theme()))("ngClass",e.batchStatusTagClass(t.status,e.theme.theme())),gI(),Lh(Fw(10,14,e.statusKey(t.status))),gI(3),Lh(t.workflowId),gI(3),Lh(jw(16,16,"batches.detail.subjectCount",Aw(23,Z,t.resolvedSubjects.length))),gI(4),Lh(Fw(20,19,e.triggeredByKey(t.triggeredBy))),gI(2),MD(t.status==="running"?21:-1),gI(),MD(e.actionError()?22:-1),gI(3),Lh(Fw(26,21,"batches.detail.membersHeading")),gI(2),lh("jobs",e.memberJobs());}}var ot=3e3;function v(i){return i!=="running"}var Dt=(()=>{class i{constructor(){this.route=C(C1),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve),this.destroyRef=C(at$1),this.theme=C(p),this.batchStatusTagClass=y,this.batchStatusTagColor=S,this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.cancelling=qo(false),this.actionError=qo(null),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),id(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&qw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();}));});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}cancelBatch(){let t=this.batch();!t||t.status!=="running"||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.batchesApi.cancel(t.id).subscribe({next:e=>{this.cancelling.set(false),this.batch.set(e),this.refreshMembers(),v(e.status)&&(this.stopPolling(),this.closeStream());},error:e=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("batches.errors.cancelFailed")));}}));}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),v(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),v(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||v(t.status)){this.stopPolling();return}this.refreshMembers();},ot));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status",3,"nzColor","ngClass"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"disabled"],["data-testid","action-error",1,"error"],["data-testid","batch-members",1,"members"],[3,"jobs"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"click","disabled"]],template:function(e,u){if(e&1&&(_i(0,"main",0),_D(1,tt,3,3,"p",1)(2,et,2,1,"p",2)(3,at,28,25),Jc()),e&2){let C;gI(),MD(u.loading()?1:u.loadError()?2:(C=u.batch())?3:-1,C);}},dependencies:[$8,M5,v3,pf,bd,sp,fp,W,I,Lt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{Dt as BatchDetailComponent};
1
+ import {U}from'./chunk-Bv1r1Ly-.js';import {f}from'./chunk-CZoPJsBm.js';import {L as Lt}from'./chunk-DyiDg8XX.js';import {y,S}from'./chunk-CV-FUe_H.js';import'./chunk-D3JZ8ur5.js';import {W,I}from'./chunk-5xJXPFlv.js';import'./chunk-DAONFRT8.js';import'./chunk-CLM-K-Vg.js';import {C,a as C1,$,V as Ve,b as at$1,S as p,q as qo,u as ue,T as id,W as qw,c as bi,Z as ZE,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,n as uh,w as lh,az as jw,E as Aw,G as FD,m as mh,z as rl,O as Fu,Q as ju}from'./main-SI5AKDMC.js';var Z=i=>({count:i});function tt(i,p){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function et(i,p){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function it(i,p){if(i&1){let t=FD();_i(0,"button",15),mh("click",function(){Fu(t);let u=HD(2);return ju(u.cancelBatch())}),Iw(1),Pw(2,"transloco"),Jc();}if(i&2){let t=HD(2);lh("disabled",t.cancelling()),gI(),rl(" ",Fw(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function nt(i,p){if(i&1&&(_i(0,"p",12),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.actionError());}}function at(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"h1",5),Iw(6),Jc(),_i(7,"p",6)(8,"nz-tag",7),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"span",8),Iw(12),Jc(),Iw(13," \xB7 "),_i(14,"span",9),Iw(15),Pw(16,"transloco"),Jc(),Iw(17," \xB7 "),_i(18,"span",10),Iw(19),Pw(20,"transloco"),Jc()()(),_D(21,it,3,4,"button",11),Jc(),_D(22,nt,2,1,"p",12),_i(23,"section",13)(24,"h2"),Iw(25),Pw(26,"transloco"),Jc(),uh(27,"app-job-status-table",14),Jc()),i&2){let t=p,e=HD();gI(3),Lh(Fw(4,12,"batches.detail.backHint")),gI(3),Lh(t.id),gI(2),lh("nzColor",e.batchStatusTagColor(t.status,e.theme.theme()))("ngClass",e.batchStatusTagClass(t.status,e.theme.theme())),gI(),Lh(Fw(10,14,e.statusKey(t.status))),gI(3),Lh(t.workflowId),gI(3),Lh(jw(16,16,"batches.detail.subjectCount",Aw(23,Z,t.resolvedSubjects.length))),gI(4),Lh(Fw(20,19,e.triggeredByKey(t.triggeredBy))),gI(2),MD(t.status==="running"?21:-1),gI(),MD(e.actionError()?22:-1),gI(3),Lh(Fw(26,21,"batches.detail.membersHeading")),gI(2),lh("jobs",e.memberJobs());}}var ot=3e3;function v(i){return i!=="running"}var Dt=(()=>{class i{constructor(){this.route=C(C1),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve),this.destroyRef=C(at$1),this.theme=C(p),this.batchStatusTagClass=y,this.batchStatusTagColor=S,this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.cancelling=qo(false),this.actionError=qo(null),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),id(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&qw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();}));});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}cancelBatch(){let t=this.batch();!t||t.status!=="running"||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.batchesApi.cancel(t.id).subscribe({next:e=>{this.cancelling.set(false),this.batch.set(e),this.refreshMembers(),v(e.status)&&(this.stopPolling(),this.closeStream());},error:e=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("batches.errors.cancelFailed")));}}));}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),v(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),v(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||v(t.status)){this.stopPolling();return}this.refreshMembers();},ot));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status",3,"nzColor","ngClass"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"disabled"],["data-testid","action-error",1,"error"],["data-testid","batch-members",1,"members"],[3,"jobs"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"click","disabled"]],template:function(e,u){if(e&1&&(_i(0,"main",0),_D(1,tt,3,3,"p",1)(2,et,2,1,"p",2)(3,at,28,25),Jc()),e&2){let C;gI(),MD(u.loading()?1:u.loadError()?2:(C=u.batch())?3:-1,C);}},dependencies:[$8,M5,v3,pf,bd,sp,fp,W,I,Lt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{Dt as BatchDetailComponent};
@@ -1 +1 @@
1
- import {a7 as KE,a8 as fu,bP as hn,aA as mT,C,a9 as Z0,ab as Oe$1,aB as yT,aC as zt,Z as ZE,as as st,at as Ee$1,au as w5,av as K0,aj as $D,l as _D,j as _i,J as Jc,M as MD,o as gI,aQ as aw,al as Sh,am as Ih,an as WD,ao as GD,aM as Yl,bQ as Wr,r as r$1,ai as ly,H as HD,aw as rh,w as lh,n as uh,aR as xw,ak as UD,x as xD,aO as SD,B as AD,bR as eD,bS as dh,aP as Mh,aJ as tl,I as Iw,aK as nl,L as Lh,bT as oh,ax as Eh,ac as Er,N as ND}from'./main-CHQMTVIP.js';var Ce=["*"];function fe(e,a){if(e&1&&(_i(0,"div",0),uh(1,"nz-skeleton-element",4),Jc()),e&2){let t=HD(2);gI(),lh("nzSize",t.avatar.size||"default")("nzShape",t.avatar.shape||"circle");}}function _e(e,a){if(e&1&&uh(0,"h3",5),e&2){let t=HD(2);Mh("width",t.toCSSUnit(t.title.width));}}function ve(e,a){if(e&1&&uh(0,"li"),e&2){let t=a.$index,n=HD(3);Mh("width",n.toCSSUnit(n.widthList[t]));}}function ge(e,a){if(e&1&&(_i(0,"ul",3),xD(1,ve,1,2,"li",6,ND),Jc()),e&2){let t=HD(2);gI(),AD(t.rowsList);}}function he(e,a){if(e&1&&(_D(0,fe,2,2,"div",0),_i(1,"div",1),_D(2,_e,1,2,"h3",2),_D(3,ge,3,0,"ul",3),Jc()),e&2){let t=HD();MD(t.nzAvatar?0:-1),gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzParagraph?3:-1);}}function Se(e,a){e&1&&UD(0);}var Te=(()=>{class e{nzActive=false;nzType;nzBlock=false;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["nz-skeleton-element"]],hostAttrs:[1,"ant-skeleton","ant-skeleton-element"],hostVars:4,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-active",i.nzActive)("ant-skeleton-block",i.nzBlock);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzType:"nzType",nzBlock:[2,"nzBlock","nzBlock",K0]}})}return e})();var ye=(()=>{class e{nzShape="circle";nzSize="default";styleMap={};ngOnChanges(t){if(t.nzSize&&typeof this.nzSize=="number"){let n=`${this.nzSize}px`;this.styleMap={width:n,height:n,"line-height":n};}else this.styleMap={};}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton-element","nzType","avatar"]],inputs:{nzShape:"nzShape",nzSize:"nzSize"},features:[ly],decls:1,vars:10,consts:[[1,"ant-skeleton-avatar"]],template:function(n,i){n&1&&dh(0,"span",0),n&2&&(aw(i.styleMap),Sh("ant-skeleton-avatar-square",i.nzShape==="square")("ant-skeleton-avatar-circle",i.nzShape==="circle")("ant-skeleton-avatar-lg",i.nzSize==="large")("ant-skeleton-avatar-sm",i.nzSize==="small"));},encapsulation:2})}return e})();var ce=(()=>{class e{cdr=C(Z0);nzActive=false;nzLoading=true;nzRound=false;nzTitle=true;nzAvatar=false;nzParagraph=true;title;avatar;paragraph;rowsList=[];widthList=[];toCSSUnit(t=""){return Wr(t)}getTitleProps(){let t=!!this.nzAvatar,n=!!this.nzParagraph,i="";return !t&&n?i="38%":t&&n&&(i="50%"),r$1({width:i},this.getProps(this.nzTitle))}getAvatarProps(){let t=this.nzTitle&&!this.nzParagraph?"square":"circle";return r$1({shape:t,size:"large"},this.getProps(this.nzAvatar))}getParagraphProps(){let t=!!this.nzAvatar,n=!!this.nzTitle,i={};return (!t||!n)&&(i.width="61%"),!t&&n?i.rows=3:i.rows=2,r$1(r$1({},i),this.getProps(this.nzParagraph))}getProps(t){return t&&typeof t=="object"?t:{}}getWidthList(){let{width:t,rows:n}=this.paragraph,i=[];return t&&Array.isArray(t)?i=t:t&&!Array.isArray(t)&&(i=[],i[n-1]=t),i}updateProps(){this.title=this.getTitleProps(),this.avatar=this.getAvatarProps(),this.paragraph=this.getParagraphProps(),this.rowsList=[...Array(this.paragraph.rows)],this.widthList=this.getWidthList(),this.cdr.markForCheck();}ngOnInit(){this.updateProps();}ngOnChanges(t){(t.nzTitle||t.nzAvatar||t.nzParagraph)&&this.updateProps();}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton"]],hostAttrs:[1,"ant-skeleton"],hostVars:6,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-with-avatar",!!i.nzAvatar)("ant-skeleton-active",i.nzActive)("ant-skeleton-round",i.nzRound);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzRound:[2,"nzRound","nzRound",K0],nzTitle:"nzTitle",nzAvatar:"nzAvatar",nzParagraph:"nzParagraph"},exportAs:["nzSkeleton"],features:[ly],ngContentSelectors:Ce,decls:2,vars:1,consts:[[1,"ant-skeleton-header"],[1,"ant-skeleton-content"],[1,"ant-skeleton-title",3,"width"],[1,"ant-skeleton-paragraph"],["nzType","avatar",3,"nzSize","nzShape"],[1,"ant-skeleton-title"],[3,"width"]],template:function(n,i){n&1&&($D(),_D(0,he,4,3)(1,Se,1,0)),n&2&&MD(i.nzLoading?0:1);},dependencies:[Te,ye],encapsulation:2})}return e})(),pe=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({})}return e})();function Ne(e,a){}function ke(e,a){if(e&1&&(_i(0,"div",0),rh(1,Ne,0,0,"ng-template",2),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzAvatar);}}function be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Me(e,a){if(e&1&&(_i(0,"div",3),rh(1,be,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Ae(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzDescription);}}function De(e,a){if(e&1&&(_i(0,"div",4),rh(1,Ae,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzDescription);}}function Ee(e,a){if(e&1&&(_i(0,"div",1),_D(1,Me,2,1,"div",3),_D(2,De,2,1,"div",4),Jc()),e&2){let t=HD();gI(),MD(t.nzTitle?1:-1),gI(),MD(t.nzDescription?2:-1);}}var me=["*"];function we(e,a){e&1&&UD(0);}var Pe=()=>({rows:4});function Be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Oe(e,a){if(e&1&&(_i(0,"div",6),rh(1,Be,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Fe(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzExtra);}}function Le(e,a){if(e&1&&(_i(0,"div",7),rh(1,Fe,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzExtra);}}function He(e,a){}function Ie(e,a){if(e&1&&rh(0,He,0,0,"ng-template",8),e&2){let t=HD(2);lh("ngTemplateOutlet",t.listOfNzCardTabComponent.template);}}function qe(e,a){if(e&1&&(_i(0,"div",0)(1,"div",5),_D(2,Oe,2,1,"div",6),_D(3,Le,2,1,"div",7),Jc(),_D(4,Ie,1,1,null,8),Jc()),e&2){let t=HD();gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzExtra?3:-1),gI(),MD(t.listOfNzCardTabComponent?4:-1);}}function je(e,a){}function Re(e,a){if(e&1&&(_i(0,"div",1),rh(1,je,0,0,"ng-template",8),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzCover);}}function Ge(e,a){e&1&&uh(0,"nz-skeleton",3),e&2&&lh("nzActive",true)("nzTitle",false)("nzParagraph",xw(3,Pe));}function Qe(e,a){e&1&&UD(0);}function Ve(e,a){}function $e(e,a){if(e&1&&(_i(0,"li")(1,"span"),rh(2,Ve,0,0,"ng-template",8),Jc()()),e&2){let t=a.$implicit,n=a.$count;Mh("width",100/n,"%"),gI(2),lh("ngTemplateOutlet",t);}}function Ue(e,a){if(e&1&&(_i(0,"ul",4),xD(1,$e,3,3,"li",10,SD),Jc()),e&2){let t=HD();gI(),AD(t.nzActions);}}var We=(()=>{class e{nzHoverable=true;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["","nz-card-grid",""]],hostAttrs:[1,"ant-card-grid"],hostVars:2,hostBindings:function(n,i){n&2&&Sh("ant-card-hoverable",i.nzHoverable);},inputs:{nzHoverable:[2,"nzHoverable","nzHoverable",K0]},exportAs:["nzCardGrid"]})}return e})(),Ze=(()=>{class e{nzTitle=null;nzDescription=null;nzAvatar=null;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-meta"]],hostAttrs:[1,"ant-card-meta"],inputs:{nzTitle:"nzTitle",nzDescription:"nzDescription",nzAvatar:"nzAvatar"},exportAs:["nzCardMeta"],decls:2,vars:2,consts:[[1,"ant-card-meta-avatar"],[1,"ant-card-meta-detail"],[3,"ngTemplateOutlet"],[1,"ant-card-meta-title"],[1,"ant-card-meta-description"],[4,"nzStringTemplateOutlet"]],template:function(n,i){n&1&&(_D(0,ke,2,1,"div",0),_D(1,Ee,3,2,"div",1)),n&2&&(MD(i.nzAvatar?0:-1),gI(),MD(i.nzTitle||i.nzDescription?1:-1));},dependencies:[w5,st,Ee$1],encapsulation:2})}return e})(),Je=(()=>{class e{template;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-tab"]],viewQuery:function(n,i){if(n&1&&Eh(Er,7),n&2){let S;WD(S=GD())&&(i.template=S.first);}},exportAs:["nzCardTab"],ngContentSelectors:me,decls:1,vars:0,template:function(n,i){n&1&&($D(),oh(0,we,1,0,"ng-template"));},encapsulation:2})}return e})(),ze="card",Ke=(()=>{let e,a=[],t=[],n,i=[],S=[],W,Z=[],J=[];return class U{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[Yl()],n=[Yl()],W=[Yl()],mT(null,null,e,{kind:"field",name:"nzBordered",static:false,private:false,access:{has:r=>"nzBordered"in r,get:r=>r.nzBordered,set:(r,l)=>{r.nzBordered=l;}},metadata:C},a,t),mT(null,null,n,{kind:"field",name:"nzHoverable",static:false,private:false,access:{has:r=>"nzHoverable"in r,get:r=>r.nzHoverable,set:(r,l)=>{r.nzHoverable=l;}},metadata:C},i,S),mT(null,null,W,{kind:"field",name:"nzSize",static:false,private:false,access:{has:r=>"nzSize"in r,get:r=>r.nzSize,set:(r,l)=>{r.nzSize=l;}},metadata:C},Z,J),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}cdr=C(Z0);dir=C(Oe$1).valueSignal;_nzModuleName=ze;nzBordered=yT(this,a,true);nzLoading=(yT(this,t),false);nzHoverable=yT(this,i,false);nzBodyStyle=(yT(this,S),null);nzCover;nzActions=[];nzType=null;nzSize=yT(this,Z,"default");nzTitle=yT(this,J);nzExtra;listOfNzCardTabComponent;listOfNzCardGridDirective;constructor(){zt(ze,()=>this.cdr.markForCheck());}static \u0275fac=function(r){return new(r||U)};static \u0275cmp=ZE({type:U,selectors:[["nz-card"]],contentQueries:function(r,l,K){if(r&1&&Ih(K,Je,5)(K,We,4),r&2){let E;WD(E=GD())&&(l.listOfNzCardTabComponent=E.first),WD(E=GD())&&(l.listOfNzCardGridDirective=E);}},hostAttrs:[1,"ant-card"],hostVars:16,hostBindings:function(r,l){r&2&&Sh("ant-card-loading",l.nzLoading)("ant-card-bordered",l.nzBordered)("ant-card-hoverable",l.nzHoverable)("ant-card-small",l.nzSize==="small")("ant-card-contain-grid",l.listOfNzCardGridDirective&&l.listOfNzCardGridDirective.length)("ant-card-type-inner",l.nzType==="inner")("ant-card-contain-tabs",!!l.listOfNzCardTabComponent)("ant-card-rtl",l.dir()==="rtl");},inputs:{nzBordered:[2,"nzBordered","nzBordered",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzHoverable:[2,"nzHoverable","nzHoverable",K0],nzBodyStyle:"nzBodyStyle",nzCover:"nzCover",nzActions:"nzActions",nzType:"nzType",nzSize:"nzSize",nzTitle:"nzTitle",nzExtra:"nzExtra"},exportAs:["nzCard"],ngContentSelectors:me,decls:6,vars:6,consts:[[1,"ant-card-head"],[1,"ant-card-cover"],[1,"ant-card-body"],[3,"nzActive","nzTitle","nzParagraph"],[1,"ant-card-actions"],[1,"ant-card-head-wrapper"],[1,"ant-card-head-title"],[1,"ant-card-extra"],[3,"ngTemplateOutlet"],[4,"nzStringTemplateOutlet"],[3,"width"]],template:function(r,l){r&1&&($D(),_D(0,qe,5,3,"div",0),_D(1,Re,2,1,"div",1),_i(2,"div",2),_D(3,Ge,1,4,"nz-skeleton",3)(4,Qe,1,0),Jc(),_D(5,Ue,3,0,"ul",4)),r&2&&(MD(l.nzTitle||l.nzExtra||l.listOfNzCardTabComponent?0:-1),gI(),MD(l.nzCover?1:-1),gI(),aw(l.nzBodyStyle),gI(),MD(l.nzLoading?3:4),gI(2),MD(l.nzActions.length?5:-1));},dependencies:[st,Ee$1,w5,pe,ce],encapsulation:2})}})(),Nt=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({imports:[Ke,Ze,hn]})}return e})();export{Ke as K,Nt as N};
1
+ import {a7 as KE,a8 as fu,bP as hn,aA as mT,C,a9 as Z0,ab as Oe$1,aB as yT,aC as zt,Z as ZE,as as st,at as Ee$1,au as w5,av as K0,aj as $D,l as _D,j as _i,J as Jc,M as MD,o as gI,aQ as aw,al as Sh,am as Ih,an as WD,ao as GD,aM as Yl,bQ as Wr,r as r$1,ai as ly,H as HD,aw as rh,w as lh,n as uh,aR as xw,ak as UD,x as xD,aO as SD,B as AD,bR as eD,bS as dh,aP as Mh,aJ as tl,I as Iw,aK as nl,L as Lh,bT as oh,ax as Eh,ac as Er,N as ND}from'./main-SI5AKDMC.js';var Ce=["*"];function fe(e,a){if(e&1&&(_i(0,"div",0),uh(1,"nz-skeleton-element",4),Jc()),e&2){let t=HD(2);gI(),lh("nzSize",t.avatar.size||"default")("nzShape",t.avatar.shape||"circle");}}function _e(e,a){if(e&1&&uh(0,"h3",5),e&2){let t=HD(2);Mh("width",t.toCSSUnit(t.title.width));}}function ve(e,a){if(e&1&&uh(0,"li"),e&2){let t=a.$index,n=HD(3);Mh("width",n.toCSSUnit(n.widthList[t]));}}function ge(e,a){if(e&1&&(_i(0,"ul",3),xD(1,ve,1,2,"li",6,ND),Jc()),e&2){let t=HD(2);gI(),AD(t.rowsList);}}function he(e,a){if(e&1&&(_D(0,fe,2,2,"div",0),_i(1,"div",1),_D(2,_e,1,2,"h3",2),_D(3,ge,3,0,"ul",3),Jc()),e&2){let t=HD();MD(t.nzAvatar?0:-1),gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzParagraph?3:-1);}}function Se(e,a){e&1&&UD(0);}var Te=(()=>{class e{nzActive=false;nzType;nzBlock=false;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["nz-skeleton-element"]],hostAttrs:[1,"ant-skeleton","ant-skeleton-element"],hostVars:4,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-active",i.nzActive)("ant-skeleton-block",i.nzBlock);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzType:"nzType",nzBlock:[2,"nzBlock","nzBlock",K0]}})}return e})();var ye=(()=>{class e{nzShape="circle";nzSize="default";styleMap={};ngOnChanges(t){if(t.nzSize&&typeof this.nzSize=="number"){let n=`${this.nzSize}px`;this.styleMap={width:n,height:n,"line-height":n};}else this.styleMap={};}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton-element","nzType","avatar"]],inputs:{nzShape:"nzShape",nzSize:"nzSize"},features:[ly],decls:1,vars:10,consts:[[1,"ant-skeleton-avatar"]],template:function(n,i){n&1&&dh(0,"span",0),n&2&&(aw(i.styleMap),Sh("ant-skeleton-avatar-square",i.nzShape==="square")("ant-skeleton-avatar-circle",i.nzShape==="circle")("ant-skeleton-avatar-lg",i.nzSize==="large")("ant-skeleton-avatar-sm",i.nzSize==="small"));},encapsulation:2})}return e})();var ce=(()=>{class e{cdr=C(Z0);nzActive=false;nzLoading=true;nzRound=false;nzTitle=true;nzAvatar=false;nzParagraph=true;title;avatar;paragraph;rowsList=[];widthList=[];toCSSUnit(t=""){return Wr(t)}getTitleProps(){let t=!!this.nzAvatar,n=!!this.nzParagraph,i="";return !t&&n?i="38%":t&&n&&(i="50%"),r$1({width:i},this.getProps(this.nzTitle))}getAvatarProps(){let t=this.nzTitle&&!this.nzParagraph?"square":"circle";return r$1({shape:t,size:"large"},this.getProps(this.nzAvatar))}getParagraphProps(){let t=!!this.nzAvatar,n=!!this.nzTitle,i={};return (!t||!n)&&(i.width="61%"),!t&&n?i.rows=3:i.rows=2,r$1(r$1({},i),this.getProps(this.nzParagraph))}getProps(t){return t&&typeof t=="object"?t:{}}getWidthList(){let{width:t,rows:n}=this.paragraph,i=[];return t&&Array.isArray(t)?i=t:t&&!Array.isArray(t)&&(i=[],i[n-1]=t),i}updateProps(){this.title=this.getTitleProps(),this.avatar=this.getAvatarProps(),this.paragraph=this.getParagraphProps(),this.rowsList=[...Array(this.paragraph.rows)],this.widthList=this.getWidthList(),this.cdr.markForCheck();}ngOnInit(){this.updateProps();}ngOnChanges(t){(t.nzTitle||t.nzAvatar||t.nzParagraph)&&this.updateProps();}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton"]],hostAttrs:[1,"ant-skeleton"],hostVars:6,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-with-avatar",!!i.nzAvatar)("ant-skeleton-active",i.nzActive)("ant-skeleton-round",i.nzRound);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzRound:[2,"nzRound","nzRound",K0],nzTitle:"nzTitle",nzAvatar:"nzAvatar",nzParagraph:"nzParagraph"},exportAs:["nzSkeleton"],features:[ly],ngContentSelectors:Ce,decls:2,vars:1,consts:[[1,"ant-skeleton-header"],[1,"ant-skeleton-content"],[1,"ant-skeleton-title",3,"width"],[1,"ant-skeleton-paragraph"],["nzType","avatar",3,"nzSize","nzShape"],[1,"ant-skeleton-title"],[3,"width"]],template:function(n,i){n&1&&($D(),_D(0,he,4,3)(1,Se,1,0)),n&2&&MD(i.nzLoading?0:1);},dependencies:[Te,ye],encapsulation:2})}return e})(),pe=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({})}return e})();function Ne(e,a){}function ke(e,a){if(e&1&&(_i(0,"div",0),rh(1,Ne,0,0,"ng-template",2),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzAvatar);}}function be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Me(e,a){if(e&1&&(_i(0,"div",3),rh(1,be,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Ae(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzDescription);}}function De(e,a){if(e&1&&(_i(0,"div",4),rh(1,Ae,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzDescription);}}function Ee(e,a){if(e&1&&(_i(0,"div",1),_D(1,Me,2,1,"div",3),_D(2,De,2,1,"div",4),Jc()),e&2){let t=HD();gI(),MD(t.nzTitle?1:-1),gI(),MD(t.nzDescription?2:-1);}}var me=["*"];function we(e,a){e&1&&UD(0);}var Pe=()=>({rows:4});function Be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Oe(e,a){if(e&1&&(_i(0,"div",6),rh(1,Be,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Fe(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzExtra);}}function Le(e,a){if(e&1&&(_i(0,"div",7),rh(1,Fe,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzExtra);}}function He(e,a){}function Ie(e,a){if(e&1&&rh(0,He,0,0,"ng-template",8),e&2){let t=HD(2);lh("ngTemplateOutlet",t.listOfNzCardTabComponent.template);}}function qe(e,a){if(e&1&&(_i(0,"div",0)(1,"div",5),_D(2,Oe,2,1,"div",6),_D(3,Le,2,1,"div",7),Jc(),_D(4,Ie,1,1,null,8),Jc()),e&2){let t=HD();gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzExtra?3:-1),gI(),MD(t.listOfNzCardTabComponent?4:-1);}}function je(e,a){}function Re(e,a){if(e&1&&(_i(0,"div",1),rh(1,je,0,0,"ng-template",8),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzCover);}}function Ge(e,a){e&1&&uh(0,"nz-skeleton",3),e&2&&lh("nzActive",true)("nzTitle",false)("nzParagraph",xw(3,Pe));}function Qe(e,a){e&1&&UD(0);}function Ve(e,a){}function $e(e,a){if(e&1&&(_i(0,"li")(1,"span"),rh(2,Ve,0,0,"ng-template",8),Jc()()),e&2){let t=a.$implicit,n=a.$count;Mh("width",100/n,"%"),gI(2),lh("ngTemplateOutlet",t);}}function Ue(e,a){if(e&1&&(_i(0,"ul",4),xD(1,$e,3,3,"li",10,SD),Jc()),e&2){let t=HD();gI(),AD(t.nzActions);}}var We=(()=>{class e{nzHoverable=true;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["","nz-card-grid",""]],hostAttrs:[1,"ant-card-grid"],hostVars:2,hostBindings:function(n,i){n&2&&Sh("ant-card-hoverable",i.nzHoverable);},inputs:{nzHoverable:[2,"nzHoverable","nzHoverable",K0]},exportAs:["nzCardGrid"]})}return e})(),Ze=(()=>{class e{nzTitle=null;nzDescription=null;nzAvatar=null;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-meta"]],hostAttrs:[1,"ant-card-meta"],inputs:{nzTitle:"nzTitle",nzDescription:"nzDescription",nzAvatar:"nzAvatar"},exportAs:["nzCardMeta"],decls:2,vars:2,consts:[[1,"ant-card-meta-avatar"],[1,"ant-card-meta-detail"],[3,"ngTemplateOutlet"],[1,"ant-card-meta-title"],[1,"ant-card-meta-description"],[4,"nzStringTemplateOutlet"]],template:function(n,i){n&1&&(_D(0,ke,2,1,"div",0),_D(1,Ee,3,2,"div",1)),n&2&&(MD(i.nzAvatar?0:-1),gI(),MD(i.nzTitle||i.nzDescription?1:-1));},dependencies:[w5,st,Ee$1],encapsulation:2})}return e})(),Je=(()=>{class e{template;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-tab"]],viewQuery:function(n,i){if(n&1&&Eh(Er,7),n&2){let S;WD(S=GD())&&(i.template=S.first);}},exportAs:["nzCardTab"],ngContentSelectors:me,decls:1,vars:0,template:function(n,i){n&1&&($D(),oh(0,we,1,0,"ng-template"));},encapsulation:2})}return e})(),ze="card",Ke=(()=>{let e,a=[],t=[],n,i=[],S=[],W,Z=[],J=[];return class U{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[Yl()],n=[Yl()],W=[Yl()],mT(null,null,e,{kind:"field",name:"nzBordered",static:false,private:false,access:{has:r=>"nzBordered"in r,get:r=>r.nzBordered,set:(r,l)=>{r.nzBordered=l;}},metadata:C},a,t),mT(null,null,n,{kind:"field",name:"nzHoverable",static:false,private:false,access:{has:r=>"nzHoverable"in r,get:r=>r.nzHoverable,set:(r,l)=>{r.nzHoverable=l;}},metadata:C},i,S),mT(null,null,W,{kind:"field",name:"nzSize",static:false,private:false,access:{has:r=>"nzSize"in r,get:r=>r.nzSize,set:(r,l)=>{r.nzSize=l;}},metadata:C},Z,J),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}cdr=C(Z0);dir=C(Oe$1).valueSignal;_nzModuleName=ze;nzBordered=yT(this,a,true);nzLoading=(yT(this,t),false);nzHoverable=yT(this,i,false);nzBodyStyle=(yT(this,S),null);nzCover;nzActions=[];nzType=null;nzSize=yT(this,Z,"default");nzTitle=yT(this,J);nzExtra;listOfNzCardTabComponent;listOfNzCardGridDirective;constructor(){zt(ze,()=>this.cdr.markForCheck());}static \u0275fac=function(r){return new(r||U)};static \u0275cmp=ZE({type:U,selectors:[["nz-card"]],contentQueries:function(r,l,K){if(r&1&&Ih(K,Je,5)(K,We,4),r&2){let E;WD(E=GD())&&(l.listOfNzCardTabComponent=E.first),WD(E=GD())&&(l.listOfNzCardGridDirective=E);}},hostAttrs:[1,"ant-card"],hostVars:16,hostBindings:function(r,l){r&2&&Sh("ant-card-loading",l.nzLoading)("ant-card-bordered",l.nzBordered)("ant-card-hoverable",l.nzHoverable)("ant-card-small",l.nzSize==="small")("ant-card-contain-grid",l.listOfNzCardGridDirective&&l.listOfNzCardGridDirective.length)("ant-card-type-inner",l.nzType==="inner")("ant-card-contain-tabs",!!l.listOfNzCardTabComponent)("ant-card-rtl",l.dir()==="rtl");},inputs:{nzBordered:[2,"nzBordered","nzBordered",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzHoverable:[2,"nzHoverable","nzHoverable",K0],nzBodyStyle:"nzBodyStyle",nzCover:"nzCover",nzActions:"nzActions",nzType:"nzType",nzSize:"nzSize",nzTitle:"nzTitle",nzExtra:"nzExtra"},exportAs:["nzCard"],ngContentSelectors:me,decls:6,vars:6,consts:[[1,"ant-card-head"],[1,"ant-card-cover"],[1,"ant-card-body"],[3,"nzActive","nzTitle","nzParagraph"],[1,"ant-card-actions"],[1,"ant-card-head-wrapper"],[1,"ant-card-head-title"],[1,"ant-card-extra"],[3,"ngTemplateOutlet"],[4,"nzStringTemplateOutlet"],[3,"width"]],template:function(r,l){r&1&&($D(),_D(0,qe,5,3,"div",0),_D(1,Re,2,1,"div",1),_i(2,"div",2),_D(3,Ge,1,4,"nz-skeleton",3)(4,Qe,1,0),Jc(),_D(5,Ue,3,0,"ul",4)),r&2&&(MD(l.nzTitle||l.nzExtra||l.listOfNzCardTabComponent?0:-1),gI(),MD(l.nzCover?1:-1),gI(),aw(l.nzBodyStyle),gI(),MD(l.nzLoading?3:4),gI(2),MD(l.nzActions.length?5:-1));},dependencies:[st,Ee$1,w5,pe,ce],encapsulation:2})}})(),Nt=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({imports:[Ke,Ze,hn]})}return e})();export{Ke as K,Nt as N};
@@ -1 +1 @@
1
- import {a7 as KE,a8 as fu,C,bf as _r,br as pn,b as at$1,bu as ml,cz as A,bg as Ci,cl as Vi,dj as lt$1,q as qo,U as Uw,a5 as q0,av as K0,ab as Oe,bw as Gw,bh as Bt$1,bv as pl,bp as de,ba as Se,cG as mt,by as Qr,dk as Me,u as ue,T as id,ag as Ql,bD as hl,bC as il,bR as eD,bj as Nw,bE as fn,bF as oD,bG as ir,m as mh,D as ch,aG as lw,al as Sh,bx as z0,ac as Er,a6 as U0,r as r$1,bz as tl,b9 as Nl,aD as Nr,dl as Zr,bB as Xf,Z as ZE,a3 as Ah,a4 as Th,Y as pf,a0 as bd,a1 as sp,a2 as fp,au as w5,aj as $D,l as _D,aw as rh,aT as Vw,M as MD,bl as wo,bJ as Dh,bI as zD,dm as tp,dn as Ai,dp as Zl,dq as np,bb as er,f as rl,dr as jc,ds as td,ai as ly,aE as J0,x as xD,aO as SD,B as AD,bk as St$1,ax as Eh,an as WD,ao as GD,bK as W0,H as HD,aH as QD,w as lh,j as _i,J as Jc,o as gI,ak as UD,G as FD,O as Fu,Q as ju,k as iE,y as aE,ck as $h,dt as Cw,I as Iw,L as Lh,n as uh,E as Aw,du as bw,z as rl$1}from'./main-CHQMTVIP.js';var nt=new A("");var ht=["otpInput"];function gt(t,o){if(t&1){let e=FD();_i(0,"input",2,0),mh("input",function(i){let r=Fu(e).$index,l=HD();return ju(l.onInput(r,i))})("focus",function(i){Fu(e);let r=HD();return ju(r.onFocus(i))})("keydown",function(i){let r=Fu(e).$index,l=HD();return ju(l.onKeyDown(r,i))})("paste",function(i){let r=Fu(e).$index,l=HD();return ju(l.onPaste(r,i))}),Jc(),iE();}if(t&2){let e=o.$implicit,n=HD();lh("nzSize",n.nzSize)("formControl",e)("nzStatus",n.nzStatus),aE();}}var _t=[[["","nzInputAddonBefore",""]],[["","nzInputAddonAfter",""]],[["","nzInputSearchEnterButton",""]],[["","nzInputPrefix",""]],[["","nzInputSuffix",""]],[["","nzInputClearIcon",""]],[["","nz-input",""]]],vt=["[nzInputAddonBefore]","[nzInputAddonAfter]","[nzInputSearchEnterButton]","[nzInputPrefix]","[nzInputSuffix]","[nzInputClearIcon]","[nz-input]"],Ct=t=>({$implicit:t});function zt(t,o){}function bt(t,o){if(t&1&&rh(0,zt,0,0,"ng-template",4),t&2){HD();let e=QD(4);lh("ngTemplateOutlet",e);}}function yt(t,o){}function Nt(t,o){if(t&1&&rh(0,yt,0,0,"ng-template",4),t&2){HD();let e=QD(8);lh("ngTemplateOutlet",e);}}function Dt(t,o){}function xt(t,o){if(t&1&&rh(0,Dt,0,0,"ng-template",4),t&2){HD();let e=QD(10);lh("ngTemplateOutlet",e);}}function Mt(t,o){if(t&1&&Iw(0),t&2){let e=HD(3);Lh(e.nzAddonBefore());}}function St(t,o){t&1&&(_i(0,"span",6),UD(1,0,null,Mt,1,1),Jc());}function It(t,o){}function wt(t,o){if(t&1&&rh(0,It,0,0,"ng-template",4),t&2){HD(2);let e=QD(6);lh("ngTemplateOutlet",e);}}function At(t,o){}function Et(t,o){if(t&1&&rh(0,At,0,0,"ng-template",4),t&2){HD(2);let e=QD(10);lh("ngTemplateOutlet",e);}}function Tt(t,o){if(t&1&&Iw(0),t&2){HD(2);let e=bw(0);rl$1(" ",e," ");}}function Ft(t,o){t&1&&uh(0,"nz-icon",9);}function Vt(t,o){if(t&1&&_D(0,Tt,1,1)(1,Ft,1,0,"nz-icon",9),t&2){HD();let e=bw(0);MD(e&&typeof e=="string"?0:1);}}function Rt(t,o){if(t&1){let e=FD();$h(0),_i(1,"button",8),mh("click",function(i){Fu(e);let r=HD(3);return ju(r.inputSearchDir.search(i))}),UD(2,2,null,Vt,2,1),Jc();}if(t&2){let e=HD(3),n=Cw(e.inputSearchDir.nzEnterButton()),i=e.inputSearchEnterButton()??n!==false;gI(),lh("nzType",i?"primary":"default")("nzSize",e.size())("nzLoading",e.inputSearchDir.nzLoading());}}function kt(t,o){if(t&1&&Iw(0),t&2){let e=HD(3);Lh(e.nzAddonAfter());}}function Pt(t,o){if(t&1&&(_i(0,"span",6),_D(1,Rt,4,4,"button",7),UD(2,1,null,kt,1,1),Jc()),t&2){let e=HD(2);gI(),MD(e.inputSearchDir?1:-1);}}function Ot(t,o){if(t&1&&(_i(0,"span",5),_D(1,St,3,0,"span",6),_D(2,wt,1,1,null,4)(3,Et,1,1,null,4),_D(4,Pt,4,1,"span",6),Jc()),t&2){let e=HD();gI(),MD(e.hasAddonBefore()?1:-1),gI(),MD(e.hasAffix()?2:3),gI(2),MD(e.hasAddonAfter()?4:-1);}}function Bt(t,o){}function Wt(t,o){if(t&1&&(_i(0,"span"),rh(1,Bt,0,0,"ng-template",4),Jc()),t&2){let e=HD(),n=QD(8);lw(e.affixWrapperClass()),gI(),lh("ngTemplateOutlet",n);}}function Lt(t,o){if(t&1&&Iw(0),t&2){let e=HD(3);Lh(e.nzPrefix());}}function jt(t,o){t&1&&(_i(0,"span",10),UD(1,3,null,Lt,1,1),Jc());}function $t(t,o){}function qt(t,o){t&1&&uh(0,"nz-icon",17);}function Ut(t,o){if(t&1){let e=FD();_i(0,"span",16),mh("click",function(i){Fu(e);let r=HD(3);return r.clear(),ju(r.inputSearchDir?.search(i,"clear"))}),UD(1,5,null,qt,1,0),Jc();}if(t&2){let e=HD(3);Sh("ant-input-clear-icon-has-suffix",e.nzSuffix()||e.suffix()||e.hasFeedback()||e.inputPasswordDir?.nzVisibilityToggle())("ant-input-clear-icon-hidden",!e.inputDir().value()||e.disabled()||e.readOnly());}}function Ht(t,o){if(t&1&&(_i(0,"span",13),Iw(1),Jc()),t&2){let e=HD(3);gI(),Lh(e.dataCount());}}function Gt(t,o){}function Qt(t,o){if(t&1&&rh(0,Gt,0,0,"ng-template",19),t&2){let e=HD(4);lh("ngTemplateOutlet",o)("ngTemplateOutletContext",Aw(2,Ct,e.inputPasswordDir.nzVisible()));}}function Zt(t,o){if(t&1&&uh(0,"nz-icon",20),t&2){let e=HD(4);lh("nzType",e.inputPasswordDir.nzVisible()?"eye":"eye-invisible");}}function Kt(t,o){if(t&1){let e=FD();_i(0,"span",18),mh("click",function(){Fu(e);let i=HD(3);return ju(i.inputPasswordDir.toggleVisible())}),_D(1,Qt,1,4,null,19)(2,Zt,1,1,"nz-icon",20),Jc();}if(t&2){let e,n=HD(3);gI(),MD((e=n.inputPasswordIconTmpl())?1:2,e);}}function Xt(t,o){if(t&1&&Iw(0),t&2){let e=HD(3);Lh(e.nzSuffix());}}function Yt(t,o){if(t&1&&uh(0,"nz-form-item-feedback-icon",15),t&2){let e=HD(3);lh("status",e.status());}}function Jt(t,o){if(t&1&&(_i(0,"span",11),_D(1,Ut,3,4,"span",12),_D(2,Ht,2,1,"span",13),_D(3,Kt,3,1,"span",14),UD(4,4,null,Xt,1,1),_D(6,Yt,1,1,"nz-form-item-feedback-icon",15),Jc()),t&2){let e=HD(2);gI(),MD(e.nzAllowClear()?1:-1),gI(),MD(e.nzShowCount()?2:-1),gI(),MD(e.inputPasswordDir&&e.inputPasswordDir.nzVisibilityToggle()?3:-1),gI(3),MD(e.hasFeedback()&&e.status()?6:-1);}}function en(t,o){if(t&1&&(_D(0,jt,3,0,"span",10),rh(1,$t,0,0,"ng-template",4),_D(2,Jt,7,4,"span",11)),t&2){let e=HD(),n=QD(10);MD(e.hasPrefix()?0:-1),gI(),lh("ngTemplateOutlet",n),gI(),MD(e.hasSuffix()?2:-1);}}function tn(t,o){t&1&&UD(0,6);}var it=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputAddonBefore",""]]})}return t})(),rt=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputAddonAfter",""]]})}return t})(),ot=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputPrefix",""]]})}return t})(),at=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputSuffix",""]]})}return t})(),lt=(()=>{class t{nzVisibilityToggle=q0(true);nzVisible=W0(false);toggleVisible(){this.nzVisible.update(e=>!e);}static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["nz-input-password"]],hostAttrs:[1,"ant-input-password"],inputs:{nzVisibilityToggle:[1,"nzVisibilityToggle"],nzVisible:[1,"nzVisible"]},outputs:{nzVisible:"nzVisibleChange"},exportAs:["nzInputPassword"]})}return t})(),st=(()=>{class t{static ngTemplateContextGuard(e,n){return true}static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputPasswordIcon",""]]})}return t})(),dt=new A(""),ct=new A(""),nn="ant-input",z=(()=>{class t{elementRef=C(_r);compactSize=C(pn,{optional:true});destroyRef=C(at$1);nzFormStatusService=C(ml,{optional:true});inputWrapper=C(dt,{host:true,optional:true});focusMonitor=C(Ci);hostView=C(Vi);inputPasswordDir=C(lt,{host:true,optional:true});inputSearchDir=C(ct,{host:true,optional:true});formField=C(nt,{self:true,optional:true});ngControl=C(lt$1,{self:true,optional:true});nativeValue=qo(this.elementRef.nativeElement.value);value=Uw(()=>this.formField?String(this.formField.state().value()??""):this.nativeValue());nzVariant=q0();nzSize=q0("default");nzStatus=q0("");disabled=q0(false,{transform:K0});readonly=q0(false,{transform:K0});controlDisabled=qo(false);finalDisabled=Uw(()=>this.formField?this.formField.state().disabled():this.ngControl?this.controlDisabled():this.disabled());dir=C(Oe).valueSignal;size=Gw(this.nzSize);formSize=C(Bt$1,{optional:true});formVariant=C(pl,{optional:true});status=this.nzFormStatusService?de(this.nzFormStatusService.formStatusChanges.pipe(Se(e=>e.status)),{initialValue:""}):this.nzStatus;hasFeedback=de(this.nzFormStatusService?.formStatusChanges.pipe(Se(e=>e.hasFeedback))??mt,{initialValue:false});classes=Uw(()=>Qr(nn,this.status(),this.hasFeedback()));type=Uw(()=>this.inputPasswordDir?this.inputPasswordDir.nzVisible()?"text":"password":this.inputSearchDir?"search":this.elementRef.nativeElement.getAttribute("type")||"text");focused=qo(false);finalSize=Uw(()=>this.formSize?.()?this.formSize():this.compactSize?this.compactSize():this.size());finalVariant=Uw(()=>this.nzVariant()||this.formVariant?.()||"outlined");feedbackRef=null;disabled$=Me(this.finalDisabled);constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.elementRef);}),this.focusMonitor.monitor(this.elementRef,false).pipe(ue()).subscribe(e=>this.focused.set(!!e)),id(()=>{this.renderFeedbackIcon();});}ngOnInit(){this.ngControl?.statusChanges?.pipe(Ql(null),ue(this.destroyRef)).subscribe(()=>{this.controlDisabled.set(!!this.ngControl.disabled);}),this.ngControl?.valueChanges?.pipe(Ql(this.ngControl?.control?.value),ue(this.destroyRef)).subscribe(e=>{this.nativeValue.set(e??"");});}onInput(e){this.nativeValue.set(e.target.value);}renderFeedbackIcon(){if(!this.status()||!this.hasFeedback()||this.inputWrapper){this.hostView.clear(),this.feedbackRef=null;return}this.feedbackRef=this.feedbackRef||this.hostView.createComponent(hl),this.feedbackRef.location.nativeElement.classList.add("ant-input-suffix"),this.feedbackRef.setInput("status",this.status());}focus(e){il(this.elementRef.nativeElement,e);}blur(){this.elementRef.nativeElement.blur();}static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["input","nz-input",""],["textarea","nz-input",""]],hostAttrs:[1,"ant-input"],hostVars:23,hostBindings:function(n,i){n&1&&mh("input",function(l){return i.onInput(l)}),n&2&&(ch("type",i.type())("disabled",i.finalDisabled()||null)("readonly",i.readonly()||null),lw(i.classes()),Sh("ant-input-disabled",i.finalDisabled())("ant-input-outlined",i.finalVariant()==="outlined")("ant-input-borderless",i.finalVariant()==="borderless")("ant-input-filled",i.finalVariant()==="filled")("ant-input-underlined",i.finalVariant()==="underlined")("ant-input-lg",i.finalSize()==="large")("ant-input-sm",i.finalSize()==="small")("ant-input-rtl",i.dir()==="rtl")("ant-input-focused",i.focused()));},inputs:{nzVariant:[1,"nzVariant"],nzSize:[1,"nzSize"],nzStatus:[1,"nzStatus"],disabled:[1,"disabled"],readonly:[1,"readonly"]},exportAs:["nzInput"],features:[Nw([{provide:fn,useValue:"input"}]),oD([ir])]})}return t})(),rn=(()=>{class t{formBuilder=C(tp);destroyRef=C(at$1);otpInputs;nzLength=6;nzSize="default";disabled=false;nzStatus="";nzFormatter=e=>e;nzMask=null;otpArray;internalValue=[];onChangeCallback;onTouched=()=>{};constructor(){this.createFormArray();}ngOnChanges(e){e.nzLength?.currentValue&&this.createFormArray(),e.disabled&&this.setDisabledState(this.disabled);}onInput(e,n){let i=n.target,r=this.otpInputs.toArray()[e+1];i.value&&r?r.nativeElement.focus():r||this.selectInputBox(e);}onFocus(e){e.target.select();}onKeyDown(e,n){let i=this.otpInputs.toArray()[e-1];n.keyCode===8?(n.preventDefault(),this.internalValue[e]="",this.otpArray.at(e).setValue("",{emitEvent:false}),i&&this.selectInputBox(e-1),this.emitValue()):n.keyCode===37?(n.preventDefault(),this.selectInputBox(e-1)):n.keyCode===39&&(n.preventDefault(),this.selectInputBox(e+1));}writeValue(e){if(!e){this.otpArray.reset();return}let n=e.split("");this.internalValue=n,n.forEach((i,r)=>{let l=this.nzFormatter(i),G=this.nzMask?this.nzMask:l;this.otpArray.at(r).setValue(G,{emitEvent:false});});}registerOnChange(e){this.onChangeCallback=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){e?this.otpArray.disable():this.otpArray.enable();}onPaste(e,n){let i=n.clipboardData?.getData("text")||"";if(!i)return;let r=e;for(let l of i.split(""))if(r<this.nzLength){let G=this.nzFormatter(l);this.internalValue[r]=l;let pt=this.nzMask?this.nzMask:G;this.otpArray.at(r).setValue(pt,{emitEvent:false}),r++;}else break;n.preventDefault(),this.selectInputBox(r),this.emitValue();}createFormArray(){this.otpArray=this.formBuilder.array([]),this.internalValue=new Array(this.nzLength).fill("");for(let e=0;e<this.nzLength;e++){let n=this.formBuilder.nonNullable.control("",[Ai.required]);n.valueChanges.pipe(Zl(i=>{let r=this.nzFormatter(i);this.internalValue[e]=r,n.setValue(this.nzMask??r,{emitEvent:false}),this.emitValue();}),ue(this.destroyRef)).subscribe(),this.otpArray.push(n);}}emitValue(){let e=this.internalValue.join("");this.onChangeCallback&&this.onChangeCallback(e);}selectInputBox(e){let n=this.otpInputs.toArray();e<=0&&(e=0),e>=n.length&&(e=n.length-1),n[e].nativeElement.select();}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ZE({type:t,selectors:[["nz-input-otp"]],viewQuery:function(n,i){if(n&1&&Eh(ht,5),n&2){let r;WD(r=GD())&&(i.otpInputs=r);}},hostAttrs:[1,"ant-otp"],inputs:{nzLength:[2,"nzLength","nzLength",J0],nzSize:"nzSize",disabled:[2,"disabled","disabled",K0],nzStatus:"nzStatus",nzFormatter:"nzFormatter",nzMask:"nzMask"},exportAs:["nzInputOtp"],features:[Nw([{provide:St$1,useExisting:wo(()=>t),multi:true}]),ly],decls:2,vars:0,consts:[["otpInput",""],["nz-input","","type","text","maxlength","1","size","1",1,"ant-otp-input",3,"nzSize","formControl","nzStatus"],["nz-input","","type","text","maxlength","1","size","1",1,"ant-otp-input",3,"input","focus","keydown","paste","nzSize","formControl","nzStatus"]],template:function(n,i){n&1&&xD(0,gt,2,3,"input",1,SD),n&2&&AD(i.otpArray.controls);},dependencies:[z,np,er,rl,jc,td],encapsulation:2})}return t})(),on=(()=>{class t{inputDir=z0.required(z);inputRef=z0.required(z,{read:_r});nzEnterButton=q0(false);nzLoading=q0(false,{transform:K0});nzSearch=U0();size=Uw(()=>this.inputDir().nzSize());search(e,n="input"){this.nzLoading()||this.nzSearch.emit({value:this.inputRef().nativeElement.value,event:e,source:n});}onEnter(e){e.target===this.inputRef().nativeElement&&this.search(e);}static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["nz-input-search"]],contentQueries:function(n,i,r){n&1&&Dh(r,i.inputDir,z,5)(r,i.inputRef,z,5,_r),n&2&&zD(2);},hostAttrs:[1,"ant-input-search"],hostVars:6,hostBindings:function(n,i){n&1&&mh("keydown.enter",function(l){return i.onEnter(l)}),n&2&&Sh("ant-input-search-large",i.size()==="large")("ant-input-search-small",i.size()==="small")("ant-input-search-with-button",i.nzEnterButton()!==false);},inputs:{nzEnterButton:[1,"nzEnterButton"],nzLoading:[1,"nzLoading"]},outputs:{nzSearch:"nzSearch"},exportAs:["nzInputSearch"],features:[Nw([{provide:ct,useExisting:wo(()=>t)}])]})}return t})(),ut=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputSearchEnterButton",""]]})}return t})(),an=(()=>{class t{focusMonitor=C(Ci);inputPasswordDir=C(lt,{self:true,optional:true});inputSearchDir=C(on,{self:true,optional:true});inputRef=z0.required(z,{read:_r});inputDir=z0.required(z);prefix=z0(ot);suffix=z0(at);addonBefore=z0(it);addonAfter=z0(rt);inputPasswordIconTmpl=z0(st,{read:Er});inputSearchEnterButton=z0(ut);nzAllowClear=q0(false,{transform:K0});nzPrefix=q0();nzSuffix=q0();nzAddonBefore=q0();nzAddonAfter=q0();nzShowCount=q0(false,{transform:K0});nzCount=q0();nzClear=U0();size=Uw(()=>this.inputDir().nzSize());variant=Uw(()=>this.inputDir().nzVariant());disabled=Uw(()=>this.inputDir().finalDisabled());readOnly=Uw(()=>this.inputDir().readonly());status=Uw(()=>this.inputDir().status());hasFeedback=Uw(()=>this.inputDir().hasFeedback());hasPrefix=Uw(()=>!!this.nzPrefix()||!!this.prefix());hasSuffix=Uw(()=>!!this.nzSuffix()||!!this.suffix()||this.nzAllowClear()||this.hasFeedback()||this.nzShowCount()||this.inputPasswordDir);hasAffix=Uw(()=>this.hasPrefix()||this.hasSuffix());hasAddonBefore=Uw(()=>!!this.nzAddonBefore()||!!this.addonBefore());hasAddonAfter=Uw(()=>!!this.nzAddonAfter()||!!this.addonAfter()||!!this.inputSearchDir);hasAddon=Uw(()=>this.hasAddonBefore()||this.hasAddonAfter());compactSize=C(pn,{optional:true});dir=C(Oe).valueSignal;focused=qo(false);isTextarea=Uw(()=>this.inputRef().nativeElement instanceof HTMLTextAreaElement);finalSize=Uw(()=>this.compactSize?this.compactSize():this.size());class=Uw(()=>this.hasAddon()?this.groupWrapperClass():this.hasAffix()?this.affixWrapperClass():null);affixWrapperClass=Uw(()=>r$1(r$1({"ant-input-affix-wrapper":true,"ant-input-affix-wrapper-lg":this.finalSize()==="large","ant-input-affix-wrapper-sm":this.finalSize()==="small","ant-input-affix-wrapper-disabled":this.disabled(),"ant-input-affix-wrapper-readonly":this.readOnly(),"ant-input-affix-wrapper-focused":this.focused(),"ant-input-affix-wrapper-rtl":this.dir()==="rtl"},Qr("ant-input-affix-wrapper",this.status(),this.hasFeedback())),tl("ant-input-affix-wrapper",this.variant())));groupWrapperClass=Uw(()=>r$1(r$1({"ant-input-group-wrapper":true,"ant-input-group-wrapper-sm":this.finalSize()==="small","ant-input-group-wrapper-lg":this.finalSize()==="large","ant-input-group-wrapper-rtl":this.dir()==="rtl"},Qr("ant-input-group-wrapper",this.status(),this.hasFeedback())),tl("ant-input-group-wrapper",this.variant())));inputValue=de(Me(this.inputDir).pipe(Nl(e=>{let n=e.ngControl;return n?(n.valueChanges??mt).pipe(Ql(n.value)):mt})));formattedValue=Uw(()=>{let e=this.nzCount(),n=this.inputValue(),i=e?.max??0,r=Nr(n)?String(n):"",l=r;return e?.exceedFormatter&&(l=e.exceedFormatter(r,{max:i})),l});computedCount=Uw(()=>{let e=this.nzCount(),n=this.formattedValue(),i=n.length;return e?.strategy&&(i=e.strategy(n)),i});dataCount=Uw(()=>{let e=this.nzCount(),n=this.computedCount(),i=e?.max;return `${n}${i?`/${i}`:""}`});isOutOfRange=Uw(()=>{let n=this.nzCount()?.max;return Zr(n)?this.computedCount()>n:false});constructor(){let e=C(at$1);Xf(()=>{let n=this.inputRef();this.focusMonitor.monitor(n).pipe(ue(e)).subscribe(i=>{this.focused.set(!!i);}),e.onDestroy(()=>{this.focusMonitor.stopMonitoring(n);});}),id(()=>{if(this.nzCount()){let n=this.inputValue(),i=this.formattedValue();Nr(n)&&i!==n&&this.inputDir().ngControl?.control?.setValue(i);}});}clear(){this.inputDir().ngControl?.control?.setValue(""),this.nzClear.emit();}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ZE({type:t,selectors:[["nz-input-wrapper"],["nz-input-password"],["nz-input-search"]],contentQueries:function(n,i,r){n&1&&Dh(r,i.inputRef,z,5,_r)(r,i.inputDir,z,5)(r,i.prefix,ot,5)(r,i.suffix,at,5)(r,i.addonBefore,it,5)(r,i.addonAfter,rt,5)(r,i.inputPasswordIconTmpl,st,5,Er)(r,i.inputSearchEnterButton,ut,5),n&2&&zD(8);},hostVars:8,hostBindings:function(n,i){n&2&&(lw(i.class()),Sh("ant-input-disabled",i.disabled())("ant-input-out-of-range",i.nzShowCount()&&i.isOutOfRange())("ant-input-affix-wrapper-textarea-with-clear-btn",i.nzAllowClear()&&i.isTextarea()));},inputs:{nzAllowClear:[1,"nzAllowClear"],nzPrefix:[1,"nzPrefix"],nzSuffix:[1,"nzSuffix"],nzAddonBefore:[1,"nzAddonBefore"],nzAddonAfter:[1,"nzAddonAfter"],nzShowCount:[1,"nzShowCount"],nzCount:[1,"nzCount"]},outputs:{nzClear:"nzClear"},exportAs:["nzInputWrapper"],features:[Nw([{provide:fn,useValue:"input"},{provide:dt,useExisting:wo(()=>t)}]),oD([ir])],ngContentSelectors:vt,decls:11,vars:1,consts:[["inputWithAddonInner",""],["inputWithAffix",""],["inputWithAffixInner",""],["input",""],[3,"ngTemplateOutlet"],[1,"ant-input-wrapper","ant-input-group"],[1,"ant-input-group-addon"],["nz-button","","type","button",1,"ant-input-search-button",3,"nzType","nzSize","nzLoading"],["nz-button","","type","button",1,"ant-input-search-button",3,"click","nzType","nzSize","nzLoading"],["nzType","search","nzTheme","outline"],[1,"ant-input-prefix"],[1,"ant-input-suffix"],["role","button","tabindex","-1",1,"ant-input-clear-icon",3,"ant-input-clear-icon-has-suffix","ant-input-clear-icon-hidden"],[1,"ant-input-show-count-suffix"],["role","button","tabindex","-1",1,"ant-input-password-icon"],[3,"status"],["role","button","tabindex","-1",1,"ant-input-clear-icon",3,"click"],["nzType","close-circle","nzTheme","fill"],["role","button","tabindex","-1",1,"ant-input-password-icon",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["nzTheme","outline",3,"nzType"]],template:function(n,i){n&1&&($D(_t),_D(0,bt,1,1,null,4)(1,Nt,1,1,null,4)(2,xt,1,1,null,4),rh(3,Ot,5,3,"ng-template",null,0,Vw)(5,Wt,2,3,"ng-template",null,1,Vw)(7,en,3,3,"ng-template",null,2,Vw)(9,tn,1,0,"ng-template",null,3,Vw)),n&2&&MD(i.hasAddon()?0:i.hasAffix()?1:2);},dependencies:[Ah,Th,pf,bd,sp,fp,hl,w5],encapsulation:2})}return t})();var ai=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=KE({type:t});static \u0275inj=fu({imports:[an,rn]})}return t})();export{ai as a,at as b,it as i,ot as o,rt as r,z};
1
+ import {a7 as KE,a8 as fu,C,bf as _r,br as pn,b as at$1,bu as ml,cz as A,bg as Ci,cl as Vi,dj as lt$1,q as qo,U as Uw,a5 as q0,av as K0,ab as Oe,bw as Gw,bh as Bt$1,bv as pl,bp as de,ba as Se,cG as mt,by as Qr,dk as Me,u as ue,T as id,ag as Ql,bD as hl,bC as il,bR as eD,bj as Nw,bE as fn,bF as oD,bG as ir,m as mh,D as ch,aG as lw,al as Sh,bx as z0,ac as Er,a6 as U0,r as r$1,bz as tl,b9 as Nl,aD as Nr,dl as Zr,bB as Xf,Z as ZE,a3 as Ah,a4 as Th,Y as pf,a0 as bd,a1 as sp,a2 as fp,au as w5,aj as $D,l as _D,aw as rh,aT as Vw,M as MD,bl as wo,bJ as Dh,bI as zD,dm as tp,dn as Ai,dp as Zl,dq as np,bb as er,f as rl,dr as jc,ds as td,ai as ly,aE as J0,x as xD,aO as SD,B as AD,bk as St$1,ax as Eh,an as WD,ao as GD,bK as W0,H as HD,aH as QD,w as lh,j as _i,J as Jc,o as gI,ak as UD,G as FD,O as Fu,Q as ju,k as iE,y as aE,ck as $h,dt as Cw,I as Iw,L as Lh,n as uh,E as Aw,du as bw,z as rl$1}from'./main-SI5AKDMC.js';var nt=new A("");var ht=["otpInput"];function gt(t,o){if(t&1){let e=FD();_i(0,"input",2,0),mh("input",function(i){let r=Fu(e).$index,l=HD();return ju(l.onInput(r,i))})("focus",function(i){Fu(e);let r=HD();return ju(r.onFocus(i))})("keydown",function(i){let r=Fu(e).$index,l=HD();return ju(l.onKeyDown(r,i))})("paste",function(i){let r=Fu(e).$index,l=HD();return ju(l.onPaste(r,i))}),Jc(),iE();}if(t&2){let e=o.$implicit,n=HD();lh("nzSize",n.nzSize)("formControl",e)("nzStatus",n.nzStatus),aE();}}var _t=[[["","nzInputAddonBefore",""]],[["","nzInputAddonAfter",""]],[["","nzInputSearchEnterButton",""]],[["","nzInputPrefix",""]],[["","nzInputSuffix",""]],[["","nzInputClearIcon",""]],[["","nz-input",""]]],vt=["[nzInputAddonBefore]","[nzInputAddonAfter]","[nzInputSearchEnterButton]","[nzInputPrefix]","[nzInputSuffix]","[nzInputClearIcon]","[nz-input]"],Ct=t=>({$implicit:t});function zt(t,o){}function bt(t,o){if(t&1&&rh(0,zt,0,0,"ng-template",4),t&2){HD();let e=QD(4);lh("ngTemplateOutlet",e);}}function yt(t,o){}function Nt(t,o){if(t&1&&rh(0,yt,0,0,"ng-template",4),t&2){HD();let e=QD(8);lh("ngTemplateOutlet",e);}}function Dt(t,o){}function xt(t,o){if(t&1&&rh(0,Dt,0,0,"ng-template",4),t&2){HD();let e=QD(10);lh("ngTemplateOutlet",e);}}function Mt(t,o){if(t&1&&Iw(0),t&2){let e=HD(3);Lh(e.nzAddonBefore());}}function St(t,o){t&1&&(_i(0,"span",6),UD(1,0,null,Mt,1,1),Jc());}function It(t,o){}function wt(t,o){if(t&1&&rh(0,It,0,0,"ng-template",4),t&2){HD(2);let e=QD(6);lh("ngTemplateOutlet",e);}}function At(t,o){}function Et(t,o){if(t&1&&rh(0,At,0,0,"ng-template",4),t&2){HD(2);let e=QD(10);lh("ngTemplateOutlet",e);}}function Tt(t,o){if(t&1&&Iw(0),t&2){HD(2);let e=bw(0);rl$1(" ",e," ");}}function Ft(t,o){t&1&&uh(0,"nz-icon",9);}function Vt(t,o){if(t&1&&_D(0,Tt,1,1)(1,Ft,1,0,"nz-icon",9),t&2){HD();let e=bw(0);MD(e&&typeof e=="string"?0:1);}}function Rt(t,o){if(t&1){let e=FD();$h(0),_i(1,"button",8),mh("click",function(i){Fu(e);let r=HD(3);return ju(r.inputSearchDir.search(i))}),UD(2,2,null,Vt,2,1),Jc();}if(t&2){let e=HD(3),n=Cw(e.inputSearchDir.nzEnterButton()),i=e.inputSearchEnterButton()??n!==false;gI(),lh("nzType",i?"primary":"default")("nzSize",e.size())("nzLoading",e.inputSearchDir.nzLoading());}}function kt(t,o){if(t&1&&Iw(0),t&2){let e=HD(3);Lh(e.nzAddonAfter());}}function Pt(t,o){if(t&1&&(_i(0,"span",6),_D(1,Rt,4,4,"button",7),UD(2,1,null,kt,1,1),Jc()),t&2){let e=HD(2);gI(),MD(e.inputSearchDir?1:-1);}}function Ot(t,o){if(t&1&&(_i(0,"span",5),_D(1,St,3,0,"span",6),_D(2,wt,1,1,null,4)(3,Et,1,1,null,4),_D(4,Pt,4,1,"span",6),Jc()),t&2){let e=HD();gI(),MD(e.hasAddonBefore()?1:-1),gI(),MD(e.hasAffix()?2:3),gI(2),MD(e.hasAddonAfter()?4:-1);}}function Bt(t,o){}function Wt(t,o){if(t&1&&(_i(0,"span"),rh(1,Bt,0,0,"ng-template",4),Jc()),t&2){let e=HD(),n=QD(8);lw(e.affixWrapperClass()),gI(),lh("ngTemplateOutlet",n);}}function Lt(t,o){if(t&1&&Iw(0),t&2){let e=HD(3);Lh(e.nzPrefix());}}function jt(t,o){t&1&&(_i(0,"span",10),UD(1,3,null,Lt,1,1),Jc());}function $t(t,o){}function qt(t,o){t&1&&uh(0,"nz-icon",17);}function Ut(t,o){if(t&1){let e=FD();_i(0,"span",16),mh("click",function(i){Fu(e);let r=HD(3);return r.clear(),ju(r.inputSearchDir?.search(i,"clear"))}),UD(1,5,null,qt,1,0),Jc();}if(t&2){let e=HD(3);Sh("ant-input-clear-icon-has-suffix",e.nzSuffix()||e.suffix()||e.hasFeedback()||e.inputPasswordDir?.nzVisibilityToggle())("ant-input-clear-icon-hidden",!e.inputDir().value()||e.disabled()||e.readOnly());}}function Ht(t,o){if(t&1&&(_i(0,"span",13),Iw(1),Jc()),t&2){let e=HD(3);gI(),Lh(e.dataCount());}}function Gt(t,o){}function Qt(t,o){if(t&1&&rh(0,Gt,0,0,"ng-template",19),t&2){let e=HD(4);lh("ngTemplateOutlet",o)("ngTemplateOutletContext",Aw(2,Ct,e.inputPasswordDir.nzVisible()));}}function Zt(t,o){if(t&1&&uh(0,"nz-icon",20),t&2){let e=HD(4);lh("nzType",e.inputPasswordDir.nzVisible()?"eye":"eye-invisible");}}function Kt(t,o){if(t&1){let e=FD();_i(0,"span",18),mh("click",function(){Fu(e);let i=HD(3);return ju(i.inputPasswordDir.toggleVisible())}),_D(1,Qt,1,4,null,19)(2,Zt,1,1,"nz-icon",20),Jc();}if(t&2){let e,n=HD(3);gI(),MD((e=n.inputPasswordIconTmpl())?1:2,e);}}function Xt(t,o){if(t&1&&Iw(0),t&2){let e=HD(3);Lh(e.nzSuffix());}}function Yt(t,o){if(t&1&&uh(0,"nz-form-item-feedback-icon",15),t&2){let e=HD(3);lh("status",e.status());}}function Jt(t,o){if(t&1&&(_i(0,"span",11),_D(1,Ut,3,4,"span",12),_D(2,Ht,2,1,"span",13),_D(3,Kt,3,1,"span",14),UD(4,4,null,Xt,1,1),_D(6,Yt,1,1,"nz-form-item-feedback-icon",15),Jc()),t&2){let e=HD(2);gI(),MD(e.nzAllowClear()?1:-1),gI(),MD(e.nzShowCount()?2:-1),gI(),MD(e.inputPasswordDir&&e.inputPasswordDir.nzVisibilityToggle()?3:-1),gI(3),MD(e.hasFeedback()&&e.status()?6:-1);}}function en(t,o){if(t&1&&(_D(0,jt,3,0,"span",10),rh(1,$t,0,0,"ng-template",4),_D(2,Jt,7,4,"span",11)),t&2){let e=HD(),n=QD(10);MD(e.hasPrefix()?0:-1),gI(),lh("ngTemplateOutlet",n),gI(),MD(e.hasSuffix()?2:-1);}}function tn(t,o){t&1&&UD(0,6);}var it=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputAddonBefore",""]]})}return t})(),rt=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputAddonAfter",""]]})}return t})(),ot=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputPrefix",""]]})}return t})(),at=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputSuffix",""]]})}return t})(),lt=(()=>{class t{nzVisibilityToggle=q0(true);nzVisible=W0(false);toggleVisible(){this.nzVisible.update(e=>!e);}static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["nz-input-password"]],hostAttrs:[1,"ant-input-password"],inputs:{nzVisibilityToggle:[1,"nzVisibilityToggle"],nzVisible:[1,"nzVisible"]},outputs:{nzVisible:"nzVisibleChange"},exportAs:["nzInputPassword"]})}return t})(),st=(()=>{class t{static ngTemplateContextGuard(e,n){return true}static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputPasswordIcon",""]]})}return t})(),dt=new A(""),ct=new A(""),nn="ant-input",z=(()=>{class t{elementRef=C(_r);compactSize=C(pn,{optional:true});destroyRef=C(at$1);nzFormStatusService=C(ml,{optional:true});inputWrapper=C(dt,{host:true,optional:true});focusMonitor=C(Ci);hostView=C(Vi);inputPasswordDir=C(lt,{host:true,optional:true});inputSearchDir=C(ct,{host:true,optional:true});formField=C(nt,{self:true,optional:true});ngControl=C(lt$1,{self:true,optional:true});nativeValue=qo(this.elementRef.nativeElement.value);value=Uw(()=>this.formField?String(this.formField.state().value()??""):this.nativeValue());nzVariant=q0();nzSize=q0("default");nzStatus=q0("");disabled=q0(false,{transform:K0});readonly=q0(false,{transform:K0});controlDisabled=qo(false);finalDisabled=Uw(()=>this.formField?this.formField.state().disabled():this.ngControl?this.controlDisabled():this.disabled());dir=C(Oe).valueSignal;size=Gw(this.nzSize);formSize=C(Bt$1,{optional:true});formVariant=C(pl,{optional:true});status=this.nzFormStatusService?de(this.nzFormStatusService.formStatusChanges.pipe(Se(e=>e.status)),{initialValue:""}):this.nzStatus;hasFeedback=de(this.nzFormStatusService?.formStatusChanges.pipe(Se(e=>e.hasFeedback))??mt,{initialValue:false});classes=Uw(()=>Qr(nn,this.status(),this.hasFeedback()));type=Uw(()=>this.inputPasswordDir?this.inputPasswordDir.nzVisible()?"text":"password":this.inputSearchDir?"search":this.elementRef.nativeElement.getAttribute("type")||"text");focused=qo(false);finalSize=Uw(()=>this.formSize?.()?this.formSize():this.compactSize?this.compactSize():this.size());finalVariant=Uw(()=>this.nzVariant()||this.formVariant?.()||"outlined");feedbackRef=null;disabled$=Me(this.finalDisabled);constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.elementRef);}),this.focusMonitor.monitor(this.elementRef,false).pipe(ue()).subscribe(e=>this.focused.set(!!e)),id(()=>{this.renderFeedbackIcon();});}ngOnInit(){this.ngControl?.statusChanges?.pipe(Ql(null),ue(this.destroyRef)).subscribe(()=>{this.controlDisabled.set(!!this.ngControl.disabled);}),this.ngControl?.valueChanges?.pipe(Ql(this.ngControl?.control?.value),ue(this.destroyRef)).subscribe(e=>{this.nativeValue.set(e??"");});}onInput(e){this.nativeValue.set(e.target.value);}renderFeedbackIcon(){if(!this.status()||!this.hasFeedback()||this.inputWrapper){this.hostView.clear(),this.feedbackRef=null;return}this.feedbackRef=this.feedbackRef||this.hostView.createComponent(hl),this.feedbackRef.location.nativeElement.classList.add("ant-input-suffix"),this.feedbackRef.setInput("status",this.status());}focus(e){il(this.elementRef.nativeElement,e);}blur(){this.elementRef.nativeElement.blur();}static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["input","nz-input",""],["textarea","nz-input",""]],hostAttrs:[1,"ant-input"],hostVars:23,hostBindings:function(n,i){n&1&&mh("input",function(l){return i.onInput(l)}),n&2&&(ch("type",i.type())("disabled",i.finalDisabled()||null)("readonly",i.readonly()||null),lw(i.classes()),Sh("ant-input-disabled",i.finalDisabled())("ant-input-outlined",i.finalVariant()==="outlined")("ant-input-borderless",i.finalVariant()==="borderless")("ant-input-filled",i.finalVariant()==="filled")("ant-input-underlined",i.finalVariant()==="underlined")("ant-input-lg",i.finalSize()==="large")("ant-input-sm",i.finalSize()==="small")("ant-input-rtl",i.dir()==="rtl")("ant-input-focused",i.focused()));},inputs:{nzVariant:[1,"nzVariant"],nzSize:[1,"nzSize"],nzStatus:[1,"nzStatus"],disabled:[1,"disabled"],readonly:[1,"readonly"]},exportAs:["nzInput"],features:[Nw([{provide:fn,useValue:"input"}]),oD([ir])]})}return t})(),rn=(()=>{class t{formBuilder=C(tp);destroyRef=C(at$1);otpInputs;nzLength=6;nzSize="default";disabled=false;nzStatus="";nzFormatter=e=>e;nzMask=null;otpArray;internalValue=[];onChangeCallback;onTouched=()=>{};constructor(){this.createFormArray();}ngOnChanges(e){e.nzLength?.currentValue&&this.createFormArray(),e.disabled&&this.setDisabledState(this.disabled);}onInput(e,n){let i=n.target,r=this.otpInputs.toArray()[e+1];i.value&&r?r.nativeElement.focus():r||this.selectInputBox(e);}onFocus(e){e.target.select();}onKeyDown(e,n){let i=this.otpInputs.toArray()[e-1];n.keyCode===8?(n.preventDefault(),this.internalValue[e]="",this.otpArray.at(e).setValue("",{emitEvent:false}),i&&this.selectInputBox(e-1),this.emitValue()):n.keyCode===37?(n.preventDefault(),this.selectInputBox(e-1)):n.keyCode===39&&(n.preventDefault(),this.selectInputBox(e+1));}writeValue(e){if(!e){this.otpArray.reset();return}let n=e.split("");this.internalValue=n,n.forEach((i,r)=>{let l=this.nzFormatter(i),G=this.nzMask?this.nzMask:l;this.otpArray.at(r).setValue(G,{emitEvent:false});});}registerOnChange(e){this.onChangeCallback=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){e?this.otpArray.disable():this.otpArray.enable();}onPaste(e,n){let i=n.clipboardData?.getData("text")||"";if(!i)return;let r=e;for(let l of i.split(""))if(r<this.nzLength){let G=this.nzFormatter(l);this.internalValue[r]=l;let pt=this.nzMask?this.nzMask:G;this.otpArray.at(r).setValue(pt,{emitEvent:false}),r++;}else break;n.preventDefault(),this.selectInputBox(r),this.emitValue();}createFormArray(){this.otpArray=this.formBuilder.array([]),this.internalValue=new Array(this.nzLength).fill("");for(let e=0;e<this.nzLength;e++){let n=this.formBuilder.nonNullable.control("",[Ai.required]);n.valueChanges.pipe(Zl(i=>{let r=this.nzFormatter(i);this.internalValue[e]=r,n.setValue(this.nzMask??r,{emitEvent:false}),this.emitValue();}),ue(this.destroyRef)).subscribe(),this.otpArray.push(n);}}emitValue(){let e=this.internalValue.join("");this.onChangeCallback&&this.onChangeCallback(e);}selectInputBox(e){let n=this.otpInputs.toArray();e<=0&&(e=0),e>=n.length&&(e=n.length-1),n[e].nativeElement.select();}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ZE({type:t,selectors:[["nz-input-otp"]],viewQuery:function(n,i){if(n&1&&Eh(ht,5),n&2){let r;WD(r=GD())&&(i.otpInputs=r);}},hostAttrs:[1,"ant-otp"],inputs:{nzLength:[2,"nzLength","nzLength",J0],nzSize:"nzSize",disabled:[2,"disabled","disabled",K0],nzStatus:"nzStatus",nzFormatter:"nzFormatter",nzMask:"nzMask"},exportAs:["nzInputOtp"],features:[Nw([{provide:St$1,useExisting:wo(()=>t),multi:true}]),ly],decls:2,vars:0,consts:[["otpInput",""],["nz-input","","type","text","maxlength","1","size","1",1,"ant-otp-input",3,"nzSize","formControl","nzStatus"],["nz-input","","type","text","maxlength","1","size","1",1,"ant-otp-input",3,"input","focus","keydown","paste","nzSize","formControl","nzStatus"]],template:function(n,i){n&1&&xD(0,gt,2,3,"input",1,SD),n&2&&AD(i.otpArray.controls);},dependencies:[z,np,er,rl,jc,td],encapsulation:2})}return t})(),on=(()=>{class t{inputDir=z0.required(z);inputRef=z0.required(z,{read:_r});nzEnterButton=q0(false);nzLoading=q0(false,{transform:K0});nzSearch=U0();size=Uw(()=>this.inputDir().nzSize());search(e,n="input"){this.nzLoading()||this.nzSearch.emit({value:this.inputRef().nativeElement.value,event:e,source:n});}onEnter(e){e.target===this.inputRef().nativeElement&&this.search(e);}static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["nz-input-search"]],contentQueries:function(n,i,r){n&1&&Dh(r,i.inputDir,z,5)(r,i.inputRef,z,5,_r),n&2&&zD(2);},hostAttrs:[1,"ant-input-search"],hostVars:6,hostBindings:function(n,i){n&1&&mh("keydown.enter",function(l){return i.onEnter(l)}),n&2&&Sh("ant-input-search-large",i.size()==="large")("ant-input-search-small",i.size()==="small")("ant-input-search-with-button",i.nzEnterButton()!==false);},inputs:{nzEnterButton:[1,"nzEnterButton"],nzLoading:[1,"nzLoading"]},outputs:{nzSearch:"nzSearch"},exportAs:["nzInputSearch"],features:[Nw([{provide:ct,useExisting:wo(()=>t)}])]})}return t})(),ut=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=eD({type:t,selectors:[["","nzInputSearchEnterButton",""]]})}return t})(),an=(()=>{class t{focusMonitor=C(Ci);inputPasswordDir=C(lt,{self:true,optional:true});inputSearchDir=C(on,{self:true,optional:true});inputRef=z0.required(z,{read:_r});inputDir=z0.required(z);prefix=z0(ot);suffix=z0(at);addonBefore=z0(it);addonAfter=z0(rt);inputPasswordIconTmpl=z0(st,{read:Er});inputSearchEnterButton=z0(ut);nzAllowClear=q0(false,{transform:K0});nzPrefix=q0();nzSuffix=q0();nzAddonBefore=q0();nzAddonAfter=q0();nzShowCount=q0(false,{transform:K0});nzCount=q0();nzClear=U0();size=Uw(()=>this.inputDir().nzSize());variant=Uw(()=>this.inputDir().nzVariant());disabled=Uw(()=>this.inputDir().finalDisabled());readOnly=Uw(()=>this.inputDir().readonly());status=Uw(()=>this.inputDir().status());hasFeedback=Uw(()=>this.inputDir().hasFeedback());hasPrefix=Uw(()=>!!this.nzPrefix()||!!this.prefix());hasSuffix=Uw(()=>!!this.nzSuffix()||!!this.suffix()||this.nzAllowClear()||this.hasFeedback()||this.nzShowCount()||this.inputPasswordDir);hasAffix=Uw(()=>this.hasPrefix()||this.hasSuffix());hasAddonBefore=Uw(()=>!!this.nzAddonBefore()||!!this.addonBefore());hasAddonAfter=Uw(()=>!!this.nzAddonAfter()||!!this.addonAfter()||!!this.inputSearchDir);hasAddon=Uw(()=>this.hasAddonBefore()||this.hasAddonAfter());compactSize=C(pn,{optional:true});dir=C(Oe).valueSignal;focused=qo(false);isTextarea=Uw(()=>this.inputRef().nativeElement instanceof HTMLTextAreaElement);finalSize=Uw(()=>this.compactSize?this.compactSize():this.size());class=Uw(()=>this.hasAddon()?this.groupWrapperClass():this.hasAffix()?this.affixWrapperClass():null);affixWrapperClass=Uw(()=>r$1(r$1({"ant-input-affix-wrapper":true,"ant-input-affix-wrapper-lg":this.finalSize()==="large","ant-input-affix-wrapper-sm":this.finalSize()==="small","ant-input-affix-wrapper-disabled":this.disabled(),"ant-input-affix-wrapper-readonly":this.readOnly(),"ant-input-affix-wrapper-focused":this.focused(),"ant-input-affix-wrapper-rtl":this.dir()==="rtl"},Qr("ant-input-affix-wrapper",this.status(),this.hasFeedback())),tl("ant-input-affix-wrapper",this.variant())));groupWrapperClass=Uw(()=>r$1(r$1({"ant-input-group-wrapper":true,"ant-input-group-wrapper-sm":this.finalSize()==="small","ant-input-group-wrapper-lg":this.finalSize()==="large","ant-input-group-wrapper-rtl":this.dir()==="rtl"},Qr("ant-input-group-wrapper",this.status(),this.hasFeedback())),tl("ant-input-group-wrapper",this.variant())));inputValue=de(Me(this.inputDir).pipe(Nl(e=>{let n=e.ngControl;return n?(n.valueChanges??mt).pipe(Ql(n.value)):mt})));formattedValue=Uw(()=>{let e=this.nzCount(),n=this.inputValue(),i=e?.max??0,r=Nr(n)?String(n):"",l=r;return e?.exceedFormatter&&(l=e.exceedFormatter(r,{max:i})),l});computedCount=Uw(()=>{let e=this.nzCount(),n=this.formattedValue(),i=n.length;return e?.strategy&&(i=e.strategy(n)),i});dataCount=Uw(()=>{let e=this.nzCount(),n=this.computedCount(),i=e?.max;return `${n}${i?`/${i}`:""}`});isOutOfRange=Uw(()=>{let n=this.nzCount()?.max;return Zr(n)?this.computedCount()>n:false});constructor(){let e=C(at$1);Xf(()=>{let n=this.inputRef();this.focusMonitor.monitor(n).pipe(ue(e)).subscribe(i=>{this.focused.set(!!i);}),e.onDestroy(()=>{this.focusMonitor.stopMonitoring(n);});}),id(()=>{if(this.nzCount()){let n=this.inputValue(),i=this.formattedValue();Nr(n)&&i!==n&&this.inputDir().ngControl?.control?.setValue(i);}});}clear(){this.inputDir().ngControl?.control?.setValue(""),this.nzClear.emit();}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ZE({type:t,selectors:[["nz-input-wrapper"],["nz-input-password"],["nz-input-search"]],contentQueries:function(n,i,r){n&1&&Dh(r,i.inputRef,z,5,_r)(r,i.inputDir,z,5)(r,i.prefix,ot,5)(r,i.suffix,at,5)(r,i.addonBefore,it,5)(r,i.addonAfter,rt,5)(r,i.inputPasswordIconTmpl,st,5,Er)(r,i.inputSearchEnterButton,ut,5),n&2&&zD(8);},hostVars:8,hostBindings:function(n,i){n&2&&(lw(i.class()),Sh("ant-input-disabled",i.disabled())("ant-input-out-of-range",i.nzShowCount()&&i.isOutOfRange())("ant-input-affix-wrapper-textarea-with-clear-btn",i.nzAllowClear()&&i.isTextarea()));},inputs:{nzAllowClear:[1,"nzAllowClear"],nzPrefix:[1,"nzPrefix"],nzSuffix:[1,"nzSuffix"],nzAddonBefore:[1,"nzAddonBefore"],nzAddonAfter:[1,"nzAddonAfter"],nzShowCount:[1,"nzShowCount"],nzCount:[1,"nzCount"]},outputs:{nzClear:"nzClear"},exportAs:["nzInputWrapper"],features:[Nw([{provide:fn,useValue:"input"},{provide:dt,useExisting:wo(()=>t)}]),oD([ir])],ngContentSelectors:vt,decls:11,vars:1,consts:[["inputWithAddonInner",""],["inputWithAffix",""],["inputWithAffixInner",""],["input",""],[3,"ngTemplateOutlet"],[1,"ant-input-wrapper","ant-input-group"],[1,"ant-input-group-addon"],["nz-button","","type","button",1,"ant-input-search-button",3,"nzType","nzSize","nzLoading"],["nz-button","","type","button",1,"ant-input-search-button",3,"click","nzType","nzSize","nzLoading"],["nzType","search","nzTheme","outline"],[1,"ant-input-prefix"],[1,"ant-input-suffix"],["role","button","tabindex","-1",1,"ant-input-clear-icon",3,"ant-input-clear-icon-has-suffix","ant-input-clear-icon-hidden"],[1,"ant-input-show-count-suffix"],["role","button","tabindex","-1",1,"ant-input-password-icon"],[3,"status"],["role","button","tabindex","-1",1,"ant-input-clear-icon",3,"click"],["nzType","close-circle","nzTheme","fill"],["role","button","tabindex","-1",1,"ant-input-password-icon",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["nzTheme","outline",3,"nzType"]],template:function(n,i){n&1&&($D(_t),_D(0,bt,1,1,null,4)(1,Nt,1,1,null,4)(2,xt,1,1,null,4),rh(3,Ot,5,3,"ng-template",null,0,Vw)(5,Wt,2,3,"ng-template",null,1,Vw)(7,en,3,3,"ng-template",null,2,Vw)(9,tn,1,0,"ng-template",null,3,Vw)),n&2&&MD(i.hasAddon()?0:i.hasAffix()?1:2);},dependencies:[Ah,Th,pf,bd,sp,fp,hl,w5],encapsulation:2})}return t})();var ai=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=KE({type:t});static \u0275inj=fu({imports:[an,rn]})}return t})();export{ai as a,at as b,it as i,ot as o,rt as r,z};
@@ -1 +1 @@
1
- import {C,b0 as jn,V as Ve,bK as W0,a5 as q0,Z as ZE,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,j as _i,m as mh,J as Jc,k as iE,I as Iw,o as gI,w as lh,y as aE,z as rl$1,b as at,b3 as Wn,q as qo,U as Uw,u as ue,r as r$1,c as bi,d as $8,K as Kt,P as Pw,x as xD,l as _D,p as Fw,B as AD,M as MD,b4 as N2,aV as ix,bU as M1,b5 as cx,i as ie,L as Lh,H as HD,D as ch,G as FD,al as Sh,aL as Fh,O as Fu,Q as ju}from'./main-CHQMTVIP.js';import {a as ai,z}from'./chunk-B2Xol2Un.js';var fe=(()=>{class t{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/filesystem`;}browse(e,i){let n=new M1;return e!=null&&e.trim()!==""&&(n=n.set("path",e.trim())),i?.mode&&(n=n.set("mode",i.mode)),i?.extensions&&i.extensions.length>0&&(n=n.set("extensions",i.extensions.join(","))),this.http.get(`${this.baseUrl}/browse`,{params:n}).pipe(cx())}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();function L(t){if(!t)return [];if(/^[A-Za-z]:/.test(t)){let r=t.includes("\\")?"\\":"/",h=`${t.slice(0,2)}${r}`,_=t.slice(2).replace(/^[\\/]+/,"").split(/[\\/]/).filter(Boolean),R=[{label:t.slice(0,2),path:h}],f=h;for(let O of _)f=f.endsWith(r)?f+O:f+r+O,R.push({label:O,path:f});return R}if(t.startsWith("/")){let r=t.split("/").filter(Boolean),h=[{label:"/",path:"/"}],z="";for(let _ of r)z+=`/${_}`,h.push({label:_,path:z});return h}let o=t.includes("\\")?"\\":"/",e=t.split(/[\\/]/).filter(Boolean),i=[],n="";for(let r of e)n=n?n+o+r:r,i.push({label:r,path:n});return i}function j(t){let o=L(t);return o.length<2?null:o[o.length-2].path}var be=(t,o)=>o.path;function xe(t,o){if(t&1){let e=FD();_i(0,"button",7),mh("click",function(){Fu(e);let n=HD().$implicit,r=HD();return ju(r.loadDir(n.path))}),Iw(1),Jc(),_i(2,"span",8),Iw(3,"/"),Jc();}if(t&2){let e=HD().$implicit;ch("data-testid","file-browser-crumb-"+e.label),gI(),rl$1(" ",e.label," ");}}function we(t,o){if(t&1&&(_i(0,"span",6),Iw(1),Jc()),t&2){let e=HD().$implicit;ch("data-testid","file-browser-crumb-"+e.label),gI(),Lh(e.label);}}function De(t,o){if(t&1&&_D(0,xe,4,2)(1,we,2,2,"span",6),t&2){let e=o.$index,i=o.$count;MD(e!==i-1?0:1);}}function ve(t,o){t&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ye(t,o){if(t&1&&(_i(0,"p",4),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.error());}}function Me(t,o){if(t&1){let e=FD();_i(0,"li")(1,"button",9),mh("click",function(){let n=Fu(e),r=HD(2);return ju(r.loadDir(n))}),Iw(2," ../ "),Jc()();}}function ke(t,o){if(t&1){let e=FD();_i(0,"li")(1,"button",10),mh("click",function(){let n=Fu(e).$implicit,r=HD(2);return ju(r.onEntry(n))}),Iw(2),Jc()();}if(t&2){let e=o.$implicit,i=HD(2);gI(),Sh("dir",e.isDirectory)("selected",i.isSelected(e)),ch("data-testid","file-browser-entry-"+e.name),gI(),Fh(" ",e.name,"",e.isDirectory?"/":""," ");}}function Fe(t,o){if(t&1&&(_i(0,"ul",5),_D(1,Me,3,0,"li"),xD(2,ke,3,7,"li",null,be),Jc()),t&2){let e,i=HD();gI(),MD((e=i.parentDir())?1:-1,e),gI(),AD(i.entries());}}var ge=(()=>{class t{constructor(){this.filesystem=C(fe),this.transloco=C(Ve),this.destroyRef=C(at),this.modalData=C(Wn,{optional:true}),this.path=W0(this.modalData?.path??""),this.mode=q0(this.modalData?.mode??"files"),this.extensions=q0(this.modalData?.extensions??[]),this.currentDir=qo(""),this.entries=qo([]),this.loading=qo(false),this.error=qo(null),this.crumbs=Uw(()=>L(this.currentDir())),this.parentDir=Uw(()=>j(this.currentDir()));}ngOnInit(){this.openAround(this.path());}isSelected(e){return this.mode()==="directories"?e.isDirectory&&e.path===this.path():!e.isDirectory&&e.path===this.path()}onEntry(e){if(e.isDirectory){this.loadDir(e.path);return}this.mode()==="files"&&this.path.set(e.path);}loadDir(e){this.loading.set(true),this.error.set(null),this.filesystem.browse(e,this.browseFilter()).pipe(ue(this.destroyRef)).subscribe({next:i=>this.applyListing(i),error:i=>{this.loading.set(false),this.error.set(this.errorMessage(i,this.transloco.translate("file-browser.loadFailed")));}});}browseFilter(){let e=this.extensions();return r$1({mode:this.mode()},e.length>0?{extensions:e}:{})}openAround(e){let i=e.trim();if(!i){this.loadDir(void 0);return}this.loading.set(true),this.error.set(null),this.filesystem.browse(i,this.browseFilter()).pipe(ue(this.destroyRef)).subscribe({next:n=>this.applyListing(n),error:()=>this.loadDir(j(i)??void 0)});}applyListing(e){this.currentDir.set(e.path),this.entries.set(e.entries),this.mode()==="directories"&&this.path.set(e.path),this.loading.set(false),this.error.set(null);}errorMessage(e,i){return e instanceof bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-file-browser"]],inputs:{path:[1,"path"],mode:[1,"mode"],extensions:[1,"extensions"]},outputs:{path:"pathChange"},decls:10,vars:4,consts:[["data-testid","file-browser",1,"file-browser"],["data-testid","file-browser-selected",1,"selected"],["data-testid","file-browser-breadcrumbs",1,"crumbs"],["data-testid","file-browser-loading"],["data-testid","file-browser-error",1,"error"],["data-testid","file-browser-entries",1,"entries"],[1,"current"],["nz-button","","nzType","link","type","button",3,"click"],["aria-hidden","true",1,"sep"],["type","button","data-testid","file-browser-up",1,"entry","dir",3,"click"],["type","button",1,"entry",3,"click"]],template:function(i,n){i&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nav",2),xD(5,De,2,1,null,null,be),Jc(),_D(7,ve,3,3,"p",3)(8,ye,2,1,"p",4)(9,Fe,4,1,"ul",5),Jc()),i&2&&(gI(2),rl$1(" ",n.path()||Fw(3,2,n.mode()==="directories"?"file-browser.emptySelectionDirectory":"file-browser.emptySelection")," "),gI(3),AD(n.crumbs()),gI(2),MD(n.loading()?7:n.error()?8:9));},dependencies:[$8,pf,bd,sp,Kt],styles:[".file-browser[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.45rem}.selected[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#44403c;overflow-wrap:anywhere;word-break:break-word}.crumbs[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.1rem;font-size:.85rem}.crumbs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding-inline:.15rem;height:auto}.sep[_ngcontent-%COMP%]{color:#a8a29e}.current[_ngcontent-%COMP%]{color:#1c1917;font-weight:600}.entries[_ngcontent-%COMP%]{list-style:none;margin:0;padding:.2rem 0;max-height:20rem;overflow:auto;border:1px solid #e7e5e4;background:#fff}.entry[_ngcontent-%COMP%]{display:block;width:100%;text-align:left;border:0;background:transparent;padding:.3rem .6rem;cursor:pointer;font:inherit;color:inherit}.entry[_ngcontent-%COMP%]:hover{background:#f5f5f4}.entry.dir[_ngcontent-%COMP%]{font-weight:600}.entry.selected[_ngcontent-%COMP%]{background:#e7e5e4}.error[_ngcontent-%COMP%]{margin:0;color:#9f1239}"]});}}return t})();var ot=(()=>{class t{constructor(){this.modal=C(jn),this.transloco=C(Ve),this.path=W0(""),this.mode=q0("files"),this.extensions=q0([]),this.placeholder=q0(void 0),this.browseLabel=q0(void 0);}placeholderText(){return this.placeholder()||this.transloco.translate(this.mode()==="directories"?"path-picker.placeholderDirectory":"path-picker.placeholderFile")}browseButtonText(){return this.browseLabel()||this.transloco.translate("path-picker.browse")}openBrowse(){let e=this.mode(),i=this.modal.create({nzTitle:this.transloco.translate(e==="directories"?"path-picker.modalTitleDirectory":"path-picker.modalTitleFile"),nzContent:ge,nzData:{path:this.path(),mode:e,extensions:this.extensions()},nzWidth:640,nzOkText:this.transloco.translate(e==="directories"?"file-browser.useFolder":"path-picker.selectFile"),nzCancelText:this.transloco.translate("common.cancel"),nzOnOk:()=>{let n=i.getContentComponent();this.path.set(n.path());}});}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-path-picker"]],inputs:{path:[1,"path"],mode:[1,"mode"],extensions:[1,"extensions"],placeholder:[1,"placeholder"],browseLabel:[1,"browseLabel"]},outputs:{path:"pathChange"},decls:4,vars:3,consts:[["data-testid","path-picker",1,"path-picker"],["nz-input","","data-testid","path-picker-input",3,"ngModelChange","placeholder","ngModel"],["nz-button","","type","button","data-testid","path-picker-browse",3,"click"]],template:function(i,n){i&1&&(_i(0,"div",0)(1,"input",1),mh("ngModelChange",function(h){return n.path.set(h)}),Jc(),iE(),_i(2,"button",2),mh("click",function(){return n.openBrowse()}),Iw(3),Jc()()),i&2&&(gI(),lh("placeholder",n.placeholderText())("ngModel",n.path()),aE(),gI(2),rl$1(" ",n.browseButtonText()," "));},dependencies:[al,er,rl,$i,pf,bd,sp,fp,ai,z,ts],styles:[".path-picker[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.path-picker[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0}"]});}}return t})();export{ot as o};
1
+ import {C,b0 as jn,V as Ve,bK as W0,a5 as q0,Z as ZE,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,j as _i,m as mh,J as Jc,k as iE,I as Iw,o as gI,w as lh,y as aE,z as rl$1,b as at,b3 as Wn,q as qo,U as Uw,u as ue,r as r$1,c as bi,d as $8,K as Kt,P as Pw,x as xD,l as _D,p as Fw,B as AD,M as MD,b4 as N2,aV as ix,bU as M1,b5 as cx,i as ie,L as Lh,H as HD,D as ch,G as FD,al as Sh,aL as Fh,O as Fu,Q as ju}from'./main-SI5AKDMC.js';import {a as ai,z}from'./chunk-BIL86kgf.js';var fe=(()=>{class t{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/filesystem`;}browse(e,i){let n=new M1;return e!=null&&e.trim()!==""&&(n=n.set("path",e.trim())),i?.mode&&(n=n.set("mode",i.mode)),i?.extensions&&i.extensions.length>0&&(n=n.set("extensions",i.extensions.join(","))),this.http.get(`${this.baseUrl}/browse`,{params:n}).pipe(cx())}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();function L(t){if(!t)return [];if(/^[A-Za-z]:/.test(t)){let r=t.includes("\\")?"\\":"/",h=`${t.slice(0,2)}${r}`,_=t.slice(2).replace(/^[\\/]+/,"").split(/[\\/]/).filter(Boolean),R=[{label:t.slice(0,2),path:h}],f=h;for(let O of _)f=f.endsWith(r)?f+O:f+r+O,R.push({label:O,path:f});return R}if(t.startsWith("/")){let r=t.split("/").filter(Boolean),h=[{label:"/",path:"/"}],z="";for(let _ of r)z+=`/${_}`,h.push({label:_,path:z});return h}let o=t.includes("\\")?"\\":"/",e=t.split(/[\\/]/).filter(Boolean),i=[],n="";for(let r of e)n=n?n+o+r:r,i.push({label:r,path:n});return i}function j(t){let o=L(t);return o.length<2?null:o[o.length-2].path}var be=(t,o)=>o.path;function xe(t,o){if(t&1){let e=FD();_i(0,"button",7),mh("click",function(){Fu(e);let n=HD().$implicit,r=HD();return ju(r.loadDir(n.path))}),Iw(1),Jc(),_i(2,"span",8),Iw(3,"/"),Jc();}if(t&2){let e=HD().$implicit;ch("data-testid","file-browser-crumb-"+e.label),gI(),rl$1(" ",e.label," ");}}function we(t,o){if(t&1&&(_i(0,"span",6),Iw(1),Jc()),t&2){let e=HD().$implicit;ch("data-testid","file-browser-crumb-"+e.label),gI(),Lh(e.label);}}function De(t,o){if(t&1&&_D(0,xe,4,2)(1,we,2,2,"span",6),t&2){let e=o.$index,i=o.$count;MD(e!==i-1?0:1);}}function ve(t,o){t&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ye(t,o){if(t&1&&(_i(0,"p",4),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.error());}}function Me(t,o){if(t&1){let e=FD();_i(0,"li")(1,"button",9),mh("click",function(){let n=Fu(e),r=HD(2);return ju(r.loadDir(n))}),Iw(2," ../ "),Jc()();}}function ke(t,o){if(t&1){let e=FD();_i(0,"li")(1,"button",10),mh("click",function(){let n=Fu(e).$implicit,r=HD(2);return ju(r.onEntry(n))}),Iw(2),Jc()();}if(t&2){let e=o.$implicit,i=HD(2);gI(),Sh("dir",e.isDirectory)("selected",i.isSelected(e)),ch("data-testid","file-browser-entry-"+e.name),gI(),Fh(" ",e.name,"",e.isDirectory?"/":""," ");}}function Fe(t,o){if(t&1&&(_i(0,"ul",5),_D(1,Me,3,0,"li"),xD(2,ke,3,7,"li",null,be),Jc()),t&2){let e,i=HD();gI(),MD((e=i.parentDir())?1:-1,e),gI(),AD(i.entries());}}var ge=(()=>{class t{constructor(){this.filesystem=C(fe),this.transloco=C(Ve),this.destroyRef=C(at),this.modalData=C(Wn,{optional:true}),this.path=W0(this.modalData?.path??""),this.mode=q0(this.modalData?.mode??"files"),this.extensions=q0(this.modalData?.extensions??[]),this.currentDir=qo(""),this.entries=qo([]),this.loading=qo(false),this.error=qo(null),this.crumbs=Uw(()=>L(this.currentDir())),this.parentDir=Uw(()=>j(this.currentDir()));}ngOnInit(){this.openAround(this.path());}isSelected(e){return this.mode()==="directories"?e.isDirectory&&e.path===this.path():!e.isDirectory&&e.path===this.path()}onEntry(e){if(e.isDirectory){this.loadDir(e.path);return}this.mode()==="files"&&this.path.set(e.path);}loadDir(e){this.loading.set(true),this.error.set(null),this.filesystem.browse(e,this.browseFilter()).pipe(ue(this.destroyRef)).subscribe({next:i=>this.applyListing(i),error:i=>{this.loading.set(false),this.error.set(this.errorMessage(i,this.transloco.translate("file-browser.loadFailed")));}});}browseFilter(){let e=this.extensions();return r$1({mode:this.mode()},e.length>0?{extensions:e}:{})}openAround(e){let i=e.trim();if(!i){this.loadDir(void 0);return}this.loading.set(true),this.error.set(null),this.filesystem.browse(i,this.browseFilter()).pipe(ue(this.destroyRef)).subscribe({next:n=>this.applyListing(n),error:()=>this.loadDir(j(i)??void 0)});}applyListing(e){this.currentDir.set(e.path),this.entries.set(e.entries),this.mode()==="directories"&&this.path.set(e.path),this.loading.set(false),this.error.set(null);}errorMessage(e,i){return e instanceof bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-file-browser"]],inputs:{path:[1,"path"],mode:[1,"mode"],extensions:[1,"extensions"]},outputs:{path:"pathChange"},decls:10,vars:4,consts:[["data-testid","file-browser",1,"file-browser"],["data-testid","file-browser-selected",1,"selected"],["data-testid","file-browser-breadcrumbs",1,"crumbs"],["data-testid","file-browser-loading"],["data-testid","file-browser-error",1,"error"],["data-testid","file-browser-entries",1,"entries"],[1,"current"],["nz-button","","nzType","link","type","button",3,"click"],["aria-hidden","true",1,"sep"],["type","button","data-testid","file-browser-up",1,"entry","dir",3,"click"],["type","button",1,"entry",3,"click"]],template:function(i,n){i&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nav",2),xD(5,De,2,1,null,null,be),Jc(),_D(7,ve,3,3,"p",3)(8,ye,2,1,"p",4)(9,Fe,4,1,"ul",5),Jc()),i&2&&(gI(2),rl$1(" ",n.path()||Fw(3,2,n.mode()==="directories"?"file-browser.emptySelectionDirectory":"file-browser.emptySelection")," "),gI(3),AD(n.crumbs()),gI(2),MD(n.loading()?7:n.error()?8:9));},dependencies:[$8,pf,bd,sp,Kt],styles:[".file-browser[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.45rem}.selected[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#44403c;overflow-wrap:anywhere;word-break:break-word}.crumbs[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.1rem;font-size:.85rem}.crumbs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding-inline:.15rem;height:auto}.sep[_ngcontent-%COMP%]{color:#a8a29e}.current[_ngcontent-%COMP%]{color:#1c1917;font-weight:600}.entries[_ngcontent-%COMP%]{list-style:none;margin:0;padding:.2rem 0;max-height:20rem;overflow:auto;border:1px solid #e7e5e4;background:#fff}.entry[_ngcontent-%COMP%]{display:block;width:100%;text-align:left;border:0;background:transparent;padding:.3rem .6rem;cursor:pointer;font:inherit;color:inherit}.entry[_ngcontent-%COMP%]:hover{background:#f5f5f4}.entry.dir[_ngcontent-%COMP%]{font-weight:600}.entry.selected[_ngcontent-%COMP%]{background:#e7e5e4}.error[_ngcontent-%COMP%]{margin:0;color:#9f1239}"]});}}return t})();var ot=(()=>{class t{constructor(){this.modal=C(jn),this.transloco=C(Ve),this.path=W0(""),this.mode=q0("files"),this.extensions=q0([]),this.placeholder=q0(void 0),this.browseLabel=q0(void 0);}placeholderText(){return this.placeholder()||this.transloco.translate(this.mode()==="directories"?"path-picker.placeholderDirectory":"path-picker.placeholderFile")}browseButtonText(){return this.browseLabel()||this.transloco.translate("path-picker.browse")}openBrowse(){let e=this.mode(),i=this.modal.create({nzTitle:this.transloco.translate(e==="directories"?"path-picker.modalTitleDirectory":"path-picker.modalTitleFile"),nzContent:ge,nzData:{path:this.path(),mode:e,extensions:this.extensions()},nzWidth:640,nzOkText:this.transloco.translate(e==="directories"?"file-browser.useFolder":"path-picker.selectFile"),nzCancelText:this.transloco.translate("common.cancel"),nzOnOk:()=>{let n=i.getContentComponent();this.path.set(n.path());}});}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-path-picker"]],inputs:{path:[1,"path"],mode:[1,"mode"],extensions:[1,"extensions"],placeholder:[1,"placeholder"],browseLabel:[1,"browseLabel"]},outputs:{path:"pathChange"},decls:4,vars:3,consts:[["data-testid","path-picker",1,"path-picker"],["nz-input","","data-testid","path-picker-input",3,"ngModelChange","placeholder","ngModel"],["nz-button","","type","button","data-testid","path-picker-browse",3,"click"]],template:function(i,n){i&1&&(_i(0,"div",0)(1,"input",1),mh("ngModelChange",function(h){return n.path.set(h)}),Jc(),iE(),_i(2,"button",2),mh("click",function(){return n.openBrowse()}),Iw(3),Jc()()),i&2&&(gI(),lh("placeholder",n.placeholderText())("ngModel",n.path()),aE(),gI(2),rl$1(" ",n.browseButtonText()," "));},dependencies:[al,er,rl,$i,pf,bd,sp,fp,ai,z,ts],styles:[".path-picker[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.path-picker[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0}"]});}}return t})();export{ot as o};
@@ -1 +1 @@
1
- import {w as we}from'./chunk-yoe_30RI.js';import {A as At}from'./chunk-Th9whP36.js';import {a as ae,l as le}from'./chunk-CRdEWPUM.js';import'./chunk-C7h8oMzu.js';import'./chunk-z2vvQAle.js';import {C,a as C1,b6 as U,$,V as Ve,b as at$1,q as qo,U as Uw,u as ue,r as r$1,aW as Ng,aY as Dg,c as bi,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,G as FD,m as mh,w as lh,z as rl,O as Fu,Q as ju,n as uh,E as Aw}from'./main-CHQMTVIP.js';import {b}from'./chunk-B7WkIFy0.js';import {G as Gn,u as un}from'./chunk-Dp4H7MY0.js';import'./chunk-B2Xol2Un.js';import {U as U$1}from'./chunk-Fwpw-z7T.js';import'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';var et=i=>["/batches",i];function it(i,r){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function nt(i,r){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ot(i,r){i&1&&(_i(0,"a",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(lh("routerLink",Aw(4,et,r)),gI(),rl(" ",Fw(2,2,"views.detail.openBatch")," "));}function at(i,r){if(i&1&&(uh(0,"nz-alert",9),_D(1,ot,3,6,"a",10)),i&2){let t,e=HD(2);lh("nzMessage",e.confirmation()),gI(),MD((t=e.confirmationBatchId())?1:-1,t);}}function lt(i,r){i&1&&(_i(0,"p",11),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),rl(" ",Fw(2,1,"views.detail.noBulkWorkflows")," "));}function rt(i,r){if(i&1&&(_i(0,"p",14),Iw(1),Jc()),i&2){let t=HD(4);gI(),Lh(t.launchError());}}function st(i,r){if(i&1){let t=FD();_i(0,"p",12),Iw(1),Jc(),_i(2,"app-workflow-input-form",13),mh("valuesChange",function(n){Fu(t);let s=HD(3);return ju(s.setInputValues(n))}),Jc(),_D(3,rt,2,1,"p",14),_i(4,"div",15)(5,"button",16),mh("click",function(){Fu(t);let n=HD(3);return ju(n.launch())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",17),mh("click",function(){Fu(t);let n=HD(3);return ju(n.cancelLaunch())}),Iw(9),Pw(10,"transloco"),Jc()();}if(i&2){let t=r,e=HD(3);gI(),Lh(t.name),gI(),lh("fields",t.inputSchema)("values",e.inputValues()),gI(),MD(e.launchError()?3:-1),gI(2),lh("nzLoading",e.launching())("disabled",e.launching()),gI(),rl(" ",Fw(7,8,e.launching()?"views.detail.launching":"views.detail.launch")," "),gI(3),rl(" ",Fw(10,10,"views.detail.cancelLaunch")," ");}}function ct(i,r){if(i&1&&(_i(0,"section",6)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_D(4,lt,3,3,"p",11)(5,st,11,12),Jc()),i&2){let t,e=HD(2);gI(2),rl(" ",Fw(3,2,r==="view"?"views.detail.launchViewTitle":"views.detail.launchSelectedTitle")," "),gI(2),MD(e.canBulkLaunch()?(t=e.boundWorkflow())?5:-1:4,t);}}function dt(i,r){i&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"views.detail.emptySubjects")));}function ut(i,r){if(i&1){let t=FD();_i(0,"app-runnable-items-table",18),mh("rowAction",function(n){Fu(t);let s=HD(2);return ju(s.onRowAction(n))})("bulkAction",function(n){Fu(t);let s=HD(2);return ju(s.onBulkAction(n))}),Jc();}if(i&2){let t=HD(2);lh("rows",t.rows())("selectable",true)("showRowAction",t.showRowAction());}}function pt(i,r){if(i&1){let t=FD();_i(0,"header",3)(1,"h1",4),Iw(2),Jc(),_i(3,"button",5),mh("click",function(){Fu(t);let n=HD();return ju(n.beginLaunch("view"))}),Iw(4),Pw(5,"transloco"),Jc()(),_D(6,at,2,2),_D(7,ct,6,4,"section",6),_D(8,dt,3,3,"p",7)(9,ut,1,3,"app-runnable-items-table",8);}if(i&2){let t,e=HD();gI(2),Lh(r.name),gI(),lh("disabled",!e.canBulkLaunch()),gI(),rl(" ",Fw(5,6,"views.detail.runOnAll")," "),gI(2),MD(e.confirmation()?6:-1),gI(),MD((t=e.launchMode())?7:-1,t),gI(),MD(e.subjects().length===0?8:9);}}var zt=(()=>{class i{constructor(){this.route=C(C1),this.viewsApi=C(U),this.workflowsApi=C(b),this.batchesApi=C(U$1),this.jobsApi=C($),this.startJob=C(At),this.transloco=C(Ve),this.destroyRef=C(at$1),this.view=qo(null),this.subjects=qo([]),this.workflows=qo([]),this.latestBySubject=qo({}),this.loading=qo(true),this.loadError=qo(null),this.selectedIds=qo([]),this.launchMode=qo(null),this.inputValues=qo({}),this.launching=qo(false),this.launchError=qo(null),this.confirmation=qo(null),this.confirmationBatchId=qo(null),this.boundWorkflow=Uw(()=>{let t=this.view();return t?this.workflows().find(e=>e.id===t.workflowId)??null:null}),this.canBulkLaunch=Uw(()=>this.boundWorkflow()!=null),this.showRowAction=Uw(()=>this.boundWorkflow()?.subjectHandling==="per-subject"),this.rows=Uw(()=>{let t=this.latestBySubject();return this.subjects().map(e=>({id:e.id,primaryLabel:e.title,subtitle:this.subjectDetails(e),latestJob:t[e.id]??null}))}),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("views.detail.loadFailed"));return}this.load(e);});}subjectDetails(t){if(t.subjectType==="ticket")return [t.status,t.assignee].filter(Boolean).join(" \xB7 ");if(t.subjectType==="pull_request"){let e=`${t.sourceBranch} \u2192 ${t.targetBranch}`;return t.author?`${t.author} \xB7 ${e}`:e}return t.url??""}onBulkAction(t){this.selectedIds.set(t),this.beginLaunch("manual");}onRowAction(t){let e=this.view();e&&this.startJob.start({workflowId:e.workflowId,subjectId:t});}beginLaunch(t){t==="manual"&&this.selectedIds().length===0||(this.launchError.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),this.launchMode.set(t),this.inputValues.set(ae(this.boundWorkflow()?.inputSchema??[])));}cancelLaunch(){this.launchMode.set(null),this.launchError.set(null);}setInputValues(t){this.inputValues.set(t);}launch(){let t=this.view(),e=this.boundWorkflow(),n=this.launchMode();if(!t||!e||!n)return;let s=n==="view"?{mode:"view",viewId:t.id}:{mode:"manual",subjectType:t.subjectType,subjectIds:[...this.selectedIds()]};this.launching.set(true),this.launchError.set(null),this.batchesApi.launch({workflowId:e.id,selection:s,triggeredBy:n==="view"?"view_bulk":"multiselect",inputValues:r$1({},this.inputValues())}).pipe(ue(this.destroyRef)).subscribe({next:w=>{this.launching.set(false),this.confirmation.set(this.confirmationMessage(w)),this.confirmationBatchId.set(w.kind==="batch"?w.batch.id:null),this.launchMode.set(null),this.refreshLatest(t.workflowId,this.subjects().map(tt=>tt.id));},error:w=>{this.launching.set(false),this.launchError.set(this.errorMessage(w,this.transloco.translate("views.detail.launchFailed")));}});}confirmationMessage(t){return t.kind==="batch"?this.transloco.translate("views.detail.confirmation.batch",{id:t.batch.id,count:t.batch.jobIds.length}):this.transloco.translate("views.detail.confirmation.job",{id:t.job.id})}load(t){this.loading.set(true),this.loadError.set(null),this.selectedIds.set([]),this.launchMode.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),Ng({view:this.viewsApi.get(t),subjects:this.viewsApi.getSubjects(t),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({view:e,subjects:n,workflows:s})=>{this.view.set(e),this.subjects.set(n),this.workflows.set(s),this.loading.set(false),this.refreshLatest(e.workflowId,n.map(w=>w.id));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("views.detail.loadFailed")));}});}refreshLatest(t,e){(e.length===0?Dg({}):this.jobsApi.latestBySubject(t,e)).pipe(ue(this.destroyRef)).subscribe({next:s=>this.latestBySubject.set(s),error:()=>this.latestBySubject.set({})});}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-view-detail"]],decls:4,vars:1,consts:[["data-testid","view-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["data-testid","view-name"],["nz-button","","nzType","primary","type","button","data-testid","run-on-all",3,"click","disabled"],["data-testid","launch-panel",1,"launch-panel"],["data-testid","empty-subjects",1,"muted"],[3,"rows","selectable","showRowAction"],["data-testid","launch-confirmation","nzType","success",3,"nzMessage"],["nz-button","","nzType","link","data-testid","open-batch",3,"routerLink"],["data-testid","no-bulk-workflows",1,"muted"],["data-testid","launch-workflow",1,"muted"],[3,"valuesChange","fields","values"],["data-testid","launch-error",1,"error"],[1,"launch-actions"],["nz-button","","nzType","primary","type","button","data-testid","launch-submit",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","launch-cancel",3,"click"],[3,"rowAction","bulkAction","rows","selectable","showRowAction"]],template:function(e,n){if(e&1&&(_i(0,"main",0),_D(1,it,3,3,"p",1)(2,nt,2,1,"p",2)(3,pt,10,8),Jc()),e&2){let s;gI(),MD(n.loading()?1:n.loadError()?2:(s=n.view())?3:-1,s);}},dependencies:[$8,v3,Gn,un,pf,bd,sp,fp,le,we,Kt],styles:[".detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:center}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:14rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.launch-panel[_ngcontent-%COMP%]{padding:1rem;border:1px solid #d6d3d1;background:#ffffffb3}.launch-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.launch-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-top:.5rem}.muted[_ngcontent-%COMP%]{color:#78716c}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{zt as ViewDetailComponent};
1
+ import {w as we}from'./chunk-CuwZV6XG.js';import {A as At}from'./chunk-B_R_vsLt.js';import {a as ae,l as le}from'./chunk-DvWh-Q5D.js';import'./chunk-hpn_m1ZC.js';import'./chunk-DSgUAlqN.js';import {C,a as C1,b6 as U,$,V as Ve,b as at$1,q as qo,U as Uw,u as ue,r as r$1,aW as Ng,aY as Dg,c as bi,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,G as FD,m as mh,w as lh,z as rl,O as Fu,Q as ju,n as uh,E as Aw}from'./main-SI5AKDMC.js';import {b}from'./chunk-Dx92ksvP.js';import {G as Gn,u as un}from'./chunk-Ysn4Fbgj.js';import'./chunk-BIL86kgf.js';import {U as U$1}from'./chunk-Bv1r1Ly-.js';import'./chunk-DAONFRT8.js';import'./chunk-CLM-K-Vg.js';var et=i=>["/batches",i];function it(i,r){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function nt(i,r){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ot(i,r){i&1&&(_i(0,"a",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(lh("routerLink",Aw(4,et,r)),gI(),rl(" ",Fw(2,2,"views.detail.openBatch")," "));}function at(i,r){if(i&1&&(uh(0,"nz-alert",9),_D(1,ot,3,6,"a",10)),i&2){let t,e=HD(2);lh("nzMessage",e.confirmation()),gI(),MD((t=e.confirmationBatchId())?1:-1,t);}}function lt(i,r){i&1&&(_i(0,"p",11),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),rl(" ",Fw(2,1,"views.detail.noBulkWorkflows")," "));}function rt(i,r){if(i&1&&(_i(0,"p",14),Iw(1),Jc()),i&2){let t=HD(4);gI(),Lh(t.launchError());}}function st(i,r){if(i&1){let t=FD();_i(0,"p",12),Iw(1),Jc(),_i(2,"app-workflow-input-form",13),mh("valuesChange",function(n){Fu(t);let s=HD(3);return ju(s.setInputValues(n))}),Jc(),_D(3,rt,2,1,"p",14),_i(4,"div",15)(5,"button",16),mh("click",function(){Fu(t);let n=HD(3);return ju(n.launch())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",17),mh("click",function(){Fu(t);let n=HD(3);return ju(n.cancelLaunch())}),Iw(9),Pw(10,"transloco"),Jc()();}if(i&2){let t=r,e=HD(3);gI(),Lh(t.name),gI(),lh("fields",t.inputSchema)("values",e.inputValues()),gI(),MD(e.launchError()?3:-1),gI(2),lh("nzLoading",e.launching())("disabled",e.launching()),gI(),rl(" ",Fw(7,8,e.launching()?"views.detail.launching":"views.detail.launch")," "),gI(3),rl(" ",Fw(10,10,"views.detail.cancelLaunch")," ");}}function ct(i,r){if(i&1&&(_i(0,"section",6)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_D(4,lt,3,3,"p",11)(5,st,11,12),Jc()),i&2){let t,e=HD(2);gI(2),rl(" ",Fw(3,2,r==="view"?"views.detail.launchViewTitle":"views.detail.launchSelectedTitle")," "),gI(2),MD(e.canBulkLaunch()?(t=e.boundWorkflow())?5:-1:4,t);}}function dt(i,r){i&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"views.detail.emptySubjects")));}function ut(i,r){if(i&1){let t=FD();_i(0,"app-runnable-items-table",18),mh("rowAction",function(n){Fu(t);let s=HD(2);return ju(s.onRowAction(n))})("bulkAction",function(n){Fu(t);let s=HD(2);return ju(s.onBulkAction(n))}),Jc();}if(i&2){let t=HD(2);lh("rows",t.rows())("selectable",true)("showRowAction",t.showRowAction());}}function pt(i,r){if(i&1){let t=FD();_i(0,"header",3)(1,"h1",4),Iw(2),Jc(),_i(3,"button",5),mh("click",function(){Fu(t);let n=HD();return ju(n.beginLaunch("view"))}),Iw(4),Pw(5,"transloco"),Jc()(),_D(6,at,2,2),_D(7,ct,6,4,"section",6),_D(8,dt,3,3,"p",7)(9,ut,1,3,"app-runnable-items-table",8);}if(i&2){let t,e=HD();gI(2),Lh(r.name),gI(),lh("disabled",!e.canBulkLaunch()),gI(),rl(" ",Fw(5,6,"views.detail.runOnAll")," "),gI(2),MD(e.confirmation()?6:-1),gI(),MD((t=e.launchMode())?7:-1,t),gI(),MD(e.subjects().length===0?8:9);}}var zt=(()=>{class i{constructor(){this.route=C(C1),this.viewsApi=C(U),this.workflowsApi=C(b),this.batchesApi=C(U$1),this.jobsApi=C($),this.startJob=C(At),this.transloco=C(Ve),this.destroyRef=C(at$1),this.view=qo(null),this.subjects=qo([]),this.workflows=qo([]),this.latestBySubject=qo({}),this.loading=qo(true),this.loadError=qo(null),this.selectedIds=qo([]),this.launchMode=qo(null),this.inputValues=qo({}),this.launching=qo(false),this.launchError=qo(null),this.confirmation=qo(null),this.confirmationBatchId=qo(null),this.boundWorkflow=Uw(()=>{let t=this.view();return t?this.workflows().find(e=>e.id===t.workflowId)??null:null}),this.canBulkLaunch=Uw(()=>this.boundWorkflow()!=null),this.showRowAction=Uw(()=>this.boundWorkflow()?.subjectHandling==="per-subject"),this.rows=Uw(()=>{let t=this.latestBySubject();return this.subjects().map(e=>({id:e.id,primaryLabel:e.title,subtitle:this.subjectDetails(e),latestJob:t[e.id]??null}))}),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("views.detail.loadFailed"));return}this.load(e);});}subjectDetails(t){if(t.subjectType==="ticket")return [t.status,t.assignee].filter(Boolean).join(" \xB7 ");if(t.subjectType==="pull_request"){let e=`${t.sourceBranch} \u2192 ${t.targetBranch}`;return t.author?`${t.author} \xB7 ${e}`:e}return t.url??""}onBulkAction(t){this.selectedIds.set(t),this.beginLaunch("manual");}onRowAction(t){let e=this.view();e&&this.startJob.start({workflowId:e.workflowId,subjectId:t});}beginLaunch(t){t==="manual"&&this.selectedIds().length===0||(this.launchError.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),this.launchMode.set(t),this.inputValues.set(ae(this.boundWorkflow()?.inputSchema??[])));}cancelLaunch(){this.launchMode.set(null),this.launchError.set(null);}setInputValues(t){this.inputValues.set(t);}launch(){let t=this.view(),e=this.boundWorkflow(),n=this.launchMode();if(!t||!e||!n)return;let s=n==="view"?{mode:"view",viewId:t.id}:{mode:"manual",subjectType:t.subjectType,subjectIds:[...this.selectedIds()]};this.launching.set(true),this.launchError.set(null),this.batchesApi.launch({workflowId:e.id,selection:s,triggeredBy:n==="view"?"view_bulk":"multiselect",inputValues:r$1({},this.inputValues())}).pipe(ue(this.destroyRef)).subscribe({next:w=>{this.launching.set(false),this.confirmation.set(this.confirmationMessage(w)),this.confirmationBatchId.set(w.kind==="batch"?w.batch.id:null),this.launchMode.set(null),this.refreshLatest(t.workflowId,this.subjects().map(tt=>tt.id));},error:w=>{this.launching.set(false),this.launchError.set(this.errorMessage(w,this.transloco.translate("views.detail.launchFailed")));}});}confirmationMessage(t){return t.kind==="batch"?this.transloco.translate("views.detail.confirmation.batch",{id:t.batch.id,count:t.batch.jobIds.length}):this.transloco.translate("views.detail.confirmation.job",{id:t.job.id})}load(t){this.loading.set(true),this.loadError.set(null),this.selectedIds.set([]),this.launchMode.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),Ng({view:this.viewsApi.get(t),subjects:this.viewsApi.getSubjects(t),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({view:e,subjects:n,workflows:s})=>{this.view.set(e),this.subjects.set(n),this.workflows.set(s),this.loading.set(false),this.refreshLatest(e.workflowId,n.map(w=>w.id));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("views.detail.loadFailed")));}});}refreshLatest(t,e){(e.length===0?Dg({}):this.jobsApi.latestBySubject(t,e)).pipe(ue(this.destroyRef)).subscribe({next:s=>this.latestBySubject.set(s),error:()=>this.latestBySubject.set({})});}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-view-detail"]],decls:4,vars:1,consts:[["data-testid","view-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["data-testid","view-name"],["nz-button","","nzType","primary","type","button","data-testid","run-on-all",3,"click","disabled"],["data-testid","launch-panel",1,"launch-panel"],["data-testid","empty-subjects",1,"muted"],[3,"rows","selectable","showRowAction"],["data-testid","launch-confirmation","nzType","success",3,"nzMessage"],["nz-button","","nzType","link","data-testid","open-batch",3,"routerLink"],["data-testid","no-bulk-workflows",1,"muted"],["data-testid","launch-workflow",1,"muted"],[3,"valuesChange","fields","values"],["data-testid","launch-error",1,"error"],[1,"launch-actions"],["nz-button","","nzType","primary","type","button","data-testid","launch-submit",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","launch-cancel",3,"click"],[3,"rowAction","bulkAction","rows","selectable","showRowAction"]],template:function(e,n){if(e&1&&(_i(0,"main",0),_D(1,it,3,3,"p",1)(2,nt,2,1,"p",2)(3,pt,10,8),Jc()),e&2){let s;gI(),MD(n.loading()?1:n.loadError()?2:(s=n.view())?3:-1,s);}},dependencies:[$8,v3,Gn,un,pf,bd,sp,fp,le,we,Kt],styles:[".detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:center}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:14rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.launch-panel[_ngcontent-%COMP%]{padding:1rem;border:1px solid #d6d3d1;background:#ffffffb3}.launch-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.launch-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-top:.5rem}.muted[_ngcontent-%COMP%]{color:#78716c}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{zt as ViewDetailComponent};
@@ -1 +1 @@
1
- import {a as ae,l as le}from'./chunk-CRdEWPUM.js';import {H as He}from'./chunk-C7h8oMzu.js';import {C,$ as $$1,b0 as jn,R as J1,V as Ve,s,r as r$1,c as bi,i as ie,b2 as Le,b3 as Wn,q as qo,U as Uw,Z as ZE,d as $8,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,m as mh,I as Iw,P as Pw,J as Jc,o as gI,M as MD,w as lh,z as rl,p as Fw,G as FD,H as HD,L as Lh,O as Fu,Q as ju}from'./main-CHQMTVIP.js';import {b}from'./chunk-B7WkIFy0.js';import {a as ai,z}from'./chunk-B2Xol2Un.js';function M(e){return e.inputSchema.filter(a=>a.required)}function A(e,a){return e.appliesTo!=="none"&&!a.subjectId?.trim()}function Y(e,a){return A(e,a)||M(e).length>0}function x(e,a){return e.appliesTo==="none"?void 0:a.subjectId?.trim()||void 0}function et(e,a){if(e&1){let t=FD();_i(0,"label",1)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"input",7),Pw(5,"transloco"),mh("input",function(o){Fu(t);let n=HD();return ju(n.setSubjectId(o))}),Jc()();}if(e&2){let t=HD();gI(2),Lh(Fw(3,3,"jobs.start.subjectId")),gI(2),lh("value",t.subjectId())("placeholder",Fw(5,5,"jobs.start.subjectIdPlaceholder"));}}function it(e,a){if(e&1){let t=FD();_i(0,"app-workflow-input-form",8),mh("valuesChange",function(o){Fu(t);let n=HD();return ju(n.inputValues.set(o))}),Jc();}if(e&2){let t=HD();lh("fields",t.requiredFields())("values",t.inputValues());}}function ot(e,a){if(e&1&&(_i(0,"p",3),Iw(1),Jc()),e&2){let t=HD();gI(),Lh(t.actionError());}}var $=(()=>{class e{constructor(){this.jobsApi=C($$1),this.router=C(J1),this.transloco=C(Ve),this.modalRef=C(Le),this.data=C(Wn),this.subjectId=qo(this.data.subjectId??""),this.inputValues=qo(ae(M(this.data.workflow))),this.starting=qo(false),this.actionError=qo(null),this.showSubjectPicker=Uw(()=>A(this.data.workflow,this.context())),this.requiredFields=Uw(()=>M(this.data.workflow));}setSubjectId(t){this.subjectId.set(t.target.value);}start(){let t=this.data.workflow;if(this.showSubjectPicker()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}let i={workflowId:t.id,subjectId:this.subjectId().trim()||this.data.subjectId},o=x(t,i);this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r$1({workflowId:t.id},o?{subjectId:o}:{}),{inputValues:r$1({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.modalRef.close(),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}cancel(){this.modalRef.close();}context(){return {workflowId:this.data.workflow.id,subjectId:this.data.subjectId}}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-start-job-modal"]],decls:11,vars:12,consts:[["data-testid","start-job-modal"],[1,"field"],[3,"fields","values"],["data-testid","action-error",1,"error"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","start-job-cancel",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","start-button",3,"click","nzLoading","disabled"],["nz-input","","data-testid","subject-id","type","text",3,"input","value","placeholder"],[3,"valuesChange","fields","values"]],template:function(i,o){i&1&&(_i(0,"div",0),_D(1,et,6,7,"label",1),_D(2,it,1,2,"app-workflow-input-form",2),_D(3,ot,2,1,"p",3),_i(4,"div",4)(5,"button",5),mh("click",function(){return o.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",6),mh("click",function(){return o.start()}),Iw(9),Pw(10,"transloco"),Jc()()()),i&2&&(gI(),MD(o.showSubjectPicker()?1:-1),gI(),MD(o.requiredFields().length>0?2:-1),gI(),MD(o.actionError()?3:-1),gI(2),lh("disabled",o.starting()),gI(),rl(" ",Fw(7,8,"common.cancel")," "),gI(2),lh("nzLoading",o.starting())("disabled",o.starting()),gI(),rl(" ",Fw(10,10,o.starting()?"jobs.start.starting":"jobs.start.button")," "));},dependencies:[$8,pf,bd,sp,fp,ai,z,le,Kt],styles:[".field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:0 0 1rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239;margin:0 0 1rem}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin-top:.5rem}"]});}}return e})();var At=(()=>{class e{constructor(){this.workflowsApi=C(b),this.jobsApi=C($$1),this.modal=C(jn),this.router=C(J1),this.transloco=C(Ve),this.message=C(He);}start(t){this.workflowsApi.get(t.workflowId).subscribe({next:i=>{if(!Y(i,t)){this.launch(i,t,{});return}this.modal.create({nzTitle:this.transloco.translate("jobs.start.heading"),nzContent:$,nzData:{workflow:i,subjectId:t.subjectId},nzFooter:null});},error:i=>{this.message.error(this.errorMessage(i,this.transloco.translate("jobs.errors.loadWorkflows")));}});}launch(t,i,o){let n=x(t,i);this.jobsApi.start(s(r$1({workflowId:t.id},n?{subjectId:n}:{}),{inputValues:o})).subscribe({next:k=>{this.router.navigate(["/jobs",k.id]);},error:k=>{this.message.error(this.errorMessage(k,this.transloco.translate("jobs.errors.startFailed")));}});}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{At as A};
1
+ import {a as ae,l as le}from'./chunk-DvWh-Q5D.js';import {H as He}from'./chunk-hpn_m1ZC.js';import {C,$ as $$1,b0 as jn,R as J1,V as Ve,s,r as r$1,c as bi,i as ie,b2 as Le,b3 as Wn,q as qo,U as Uw,Z as ZE,d as $8,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,m as mh,I as Iw,P as Pw,J as Jc,o as gI,M as MD,w as lh,z as rl,p as Fw,G as FD,H as HD,L as Lh,O as Fu,Q as ju}from'./main-SI5AKDMC.js';import {b}from'./chunk-Dx92ksvP.js';import {a as ai,z}from'./chunk-BIL86kgf.js';function M(e){return e.inputSchema.filter(a=>a.required)}function A(e,a){return e.appliesTo!=="none"&&!a.subjectId?.trim()}function Y(e,a){return A(e,a)||M(e).length>0}function x(e,a){return e.appliesTo==="none"?void 0:a.subjectId?.trim()||void 0}function et(e,a){if(e&1){let t=FD();_i(0,"label",1)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"input",7),Pw(5,"transloco"),mh("input",function(o){Fu(t);let n=HD();return ju(n.setSubjectId(o))}),Jc()();}if(e&2){let t=HD();gI(2),Lh(Fw(3,3,"jobs.start.subjectId")),gI(2),lh("value",t.subjectId())("placeholder",Fw(5,5,"jobs.start.subjectIdPlaceholder"));}}function it(e,a){if(e&1){let t=FD();_i(0,"app-workflow-input-form",8),mh("valuesChange",function(o){Fu(t);let n=HD();return ju(n.inputValues.set(o))}),Jc();}if(e&2){let t=HD();lh("fields",t.requiredFields())("values",t.inputValues());}}function ot(e,a){if(e&1&&(_i(0,"p",3),Iw(1),Jc()),e&2){let t=HD();gI(),Lh(t.actionError());}}var $=(()=>{class e{constructor(){this.jobsApi=C($$1),this.router=C(J1),this.transloco=C(Ve),this.modalRef=C(Le),this.data=C(Wn),this.subjectId=qo(this.data.subjectId??""),this.inputValues=qo(ae(M(this.data.workflow))),this.starting=qo(false),this.actionError=qo(null),this.showSubjectPicker=Uw(()=>A(this.data.workflow,this.context())),this.requiredFields=Uw(()=>M(this.data.workflow));}setSubjectId(t){this.subjectId.set(t.target.value);}start(){let t=this.data.workflow;if(this.showSubjectPicker()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}let i={workflowId:t.id,subjectId:this.subjectId().trim()||this.data.subjectId},o=x(t,i);this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r$1({workflowId:t.id},o?{subjectId:o}:{}),{inputValues:r$1({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.modalRef.close(),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}cancel(){this.modalRef.close();}context(){return {workflowId:this.data.workflow.id,subjectId:this.data.subjectId}}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-start-job-modal"]],decls:11,vars:12,consts:[["data-testid","start-job-modal"],[1,"field"],[3,"fields","values"],["data-testid","action-error",1,"error"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","start-job-cancel",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","start-button",3,"click","nzLoading","disabled"],["nz-input","","data-testid","subject-id","type","text",3,"input","value","placeholder"],[3,"valuesChange","fields","values"]],template:function(i,o){i&1&&(_i(0,"div",0),_D(1,et,6,7,"label",1),_D(2,it,1,2,"app-workflow-input-form",2),_D(3,ot,2,1,"p",3),_i(4,"div",4)(5,"button",5),mh("click",function(){return o.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",6),mh("click",function(){return o.start()}),Iw(9),Pw(10,"transloco"),Jc()()()),i&2&&(gI(),MD(o.showSubjectPicker()?1:-1),gI(),MD(o.requiredFields().length>0?2:-1),gI(),MD(o.actionError()?3:-1),gI(2),lh("disabled",o.starting()),gI(),rl(" ",Fw(7,8,"common.cancel")," "),gI(2),lh("nzLoading",o.starting())("disabled",o.starting()),gI(),rl(" ",Fw(10,10,o.starting()?"jobs.start.starting":"jobs.start.button")," "));},dependencies:[$8,pf,bd,sp,fp,ai,z,le,Kt],styles:[".field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:0 0 1rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239;margin:0 0 1rem}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin-top:.5rem}"]});}}return e})();var At=(()=>{class e{constructor(){this.workflowsApi=C(b),this.jobsApi=C($$1),this.modal=C(jn),this.router=C(J1),this.transloco=C(Ve),this.message=C(He);}start(t){this.workflowsApi.get(t.workflowId).subscribe({next:i=>{if(!Y(i,t)){this.launch(i,t,{});return}this.modal.create({nzTitle:this.transloco.translate("jobs.start.heading"),nzContent:$,nzData:{workflow:i,subjectId:t.subjectId},nzFooter:null});},error:i=>{this.message.error(this.errorMessage(i,this.transloco.translate("jobs.errors.loadWorkflows")));}});}launch(t,i,o){let n=x(t,i);this.jobsApi.start(s(r$1({workflowId:t.id},n?{subjectId:n}:{}),{inputValues:o})).subscribe({next:k=>{this.router.navigate(["/jobs",k.id]);},error:k=>{this.message.error(this.errorMessage(k,this.transloco.translate("jobs.errors.startFailed")));}});}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{At as A};
@@ -1 +1 @@
1
- import {o as ot}from'./chunk-C0HCwfa5.js';import {_ as _n,C as Cn}from'./chunk-NZ-CPWJ2.js';import {f}from'./chunk-z2vvQAle.js';import {Z as ZE,n as uh,C,V as Ve,b as at,q as qo,r as r$1,u as ue$1,c as bi,d as $8,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,H as HD,G as FD,k as iE,w as lh,y as aE,x as xD,B as AD,D as ch,O as Fu,Q as ju}from'./main-CHQMTVIP.js';import {a as ai,z}from'./chunk-B2Xol2Un.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-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';var ce=(i,h)=>h.id;function de(i,h){i&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function me(i,h){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let e=HD();gI(),Lh(e.loadError());}}function fe(i,h){if(i&1&&(_i(0,"p",5),Iw(1),Jc()),i&2){let e=HD(2);gI(),Lh(e.deleteError());}}function he(i,h){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let e=HD(3);gI(),Lh(e.saveError());}}function ue(i,h){if(i&1){let e=FD();_i(0,"section",6),_D(1,he,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formName.set(l))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formLocalPath.set(l))}),Jc()(),_i(12,"div",10)(13,"span"),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"p",13),Iw(17),Pw(18,"transloco"),Jc(),_i(19,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formWorktreeBasePath.set(l))}),Jc()(),_i(20,"label",10)(21,"span"),Iw(22),Pw(23,"transloco"),Jc(),_i(24,"input",14),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formDefaultBranch.set(l))}),Jc(),iE(),Jc(),_i(25,"div",15)(26,"button",16),mh("click",function(){Fu(e);let l=HD(2);return ju(l.submitForm())}),Iw(27),Pw(28,"transloco"),Jc(),_i(29,"button",17),mh("click",function(){Fu(e);let l=HD(2);return ju(l.cancelForm())}),Iw(30),Pw(31,"transloco"),Jc()()();}if(i&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,13,"local-repos.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,15,"local-repos.form.localPath")),gI(2),lh("path",e.formLocalPath()),gI(3),Lh(Fw(15,17,"local-repos.form.worktreeBasePath")),gI(3),Lh(Fw(18,19,"local-repos.form.worktreeBaseHint")),gI(2),lh("path",e.formWorktreeBasePath()),gI(3),Lh(Fw(23,21,"local-repos.form.defaultBranch")),gI(2),lh("ngModel",e.formDefaultBranch()),aE(),gI(2),lh("disabled",e.saving()),gI(),rl$1(" ",Fw(28,23,"common.save")," "),gI(3),rl$1(" ",Fw(31,25,"common.cancel")," ");}}function _e(i,h){i&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"local-repos.emptyState")));}function Ce(i,h){if(i&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td",18),Iw(4),Jc(),_i(5,"td",18),Iw(6),Jc(),_i(7,"td"),Iw(8),Jc(),_i(9,"td",19)(10,"button",20),mh("click",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.openEditForm(l))}),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"button",21),Pw(14,"transloco"),mh("nzOnConfirm",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.deleteRepo(l))}),Iw(15),Pw(16,"transloco"),Jc()()();}if(i&2){let e=h.$implicit;ch("data-testid","local-repo-row-"+e.id),gI(2),Lh(e.name),gI(2),Lh(e.localPath),gI(2),Lh(e.worktreeBasePath||"\u2014"),gI(2),Lh(e.defaultBranch||"\u2014"),gI(2),ch("data-testid","edit-local-repo-"+e.id),gI(),rl$1(" ",Fw(12,10,"local-repos.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(14,12,"local-repos.deleteConfirm")),ch("data-testid","delete-local-repo-"+e.id),gI(2),rl$1(" ",Fw(16,14,"local-repos.delete")," ");}}function ge(i,h){if(i&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc()()(),_i(18,"tbody"),xD(19,Ce,17,16,"tr",null,ce),Jc()()),i&2){let e=HD(2);lh("nzData",e.repos())("nzShowPagination",false),gI(4),Lh(Fw(5,7,"local-repos.column.name")),gI(3),Lh(Fw(8,9,"local-repos.column.localPath")),gI(3),Lh(Fw(11,11,"local-repos.column.worktreeBasePath")),gI(3),Lh(Fw(14,13,"local-repos.column.defaultBranch")),gI(3),Lh(Fw(17,15,"local-repos.column.actions")),gI(3),AD(e.repos());}}function xe(i,h){if(i&1&&(_D(0,fe,2,1,"p",5),_D(1,ue,32,27,"section",6),_D(2,_e,3,3,"p",7)(3,ge,21,17,"nz-table",8)),i&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.formOpen()?1:-1),gI(),MD(e.repos().length===0&&!e.formOpen()?2:e.repos().length>0?3:-1);}}var ae=(()=>{class i{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.formDefaultBranch=qo(""),this.reload();}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.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.formDefaultBranch.set(e.defaultBranch??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r$1(r$1({name:this.formName().trim(),localPath:this.formLocalPath().trim()},this.formWorktreeBasePath().trim()?{worktreeBasePath:this.formWorktreeBasePath().trim()}:{worktreeBasePath:void 0}),this.formDefaultBranch().trim()?{defaultBranch:this.formDefaultBranch().trim()}:{defaultBranch:void 0}),a=this.editingId();(a?this.reposApi.update(a,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(""),this.formDefaultBranch.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(a=>a.filter(l=>l.id!==e.id));},error:a=>{this.deleteError.set(this.errorMessage(a,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,a){return e instanceof bi||e instanceof Error?e.message:a}static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,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"],["nz-input","","data-testid","local-repo-default-branch",3,"ngModelChange","ngModel"],[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(a,l){a&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"button",2),mh("click",function(){return l.openCreateForm()}),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,de,3,3,"p",3)(9,me,2,1,"p",4)(10,xe,4,3),Jc()),a&2&&(gI(3),Lh(Fw(4,3,"local-repos.title")),gI(3),rl$1(" ",Fw(7,5,"local-repos.create")," "),gI(2),MD(l.loading()?8:l.loadError()?9:10));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,ai,z,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return i})();var qe=(()=>{class i{static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(a,l){a&1&&uh(0,"app-local-repository-list");},dependencies:[ae],encapsulation:2});}}return i})();export{qe as LocalRepositoriesManageComponent};
1
+ import {o as ot}from'./chunk-BIdwV0jx.js';import {_ as _n,C as Cn}from'./chunk-CPNxRF7A.js';import {f}from'./chunk-DSgUAlqN.js';import {Z as ZE,n as uh,C,V as Ve,b as at,q as qo,r as r$1,u as ue$1,c as bi,d as $8,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,H as HD,G as FD,k as iE,w as lh,y as aE,x as xD,B as AD,D as ch,O as Fu,Q as ju}from'./main-SI5AKDMC.js';import {a as ai,z}from'./chunk-BIL86kgf.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-DAONFRT8.js';import'./chunk-CLM-K-Vg.js';var ce=(i,h)=>h.id;function de(i,h){i&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function me(i,h){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let e=HD();gI(),Lh(e.loadError());}}function fe(i,h){if(i&1&&(_i(0,"p",5),Iw(1),Jc()),i&2){let e=HD(2);gI(),Lh(e.deleteError());}}function he(i,h){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let e=HD(3);gI(),Lh(e.saveError());}}function ue(i,h){if(i&1){let e=FD();_i(0,"section",6),_D(1,he,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formName.set(l))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formLocalPath.set(l))}),Jc()(),_i(12,"div",10)(13,"span"),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"p",13),Iw(17),Pw(18,"transloco"),Jc(),_i(19,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formWorktreeBasePath.set(l))}),Jc()(),_i(20,"label",10)(21,"span"),Iw(22),Pw(23,"transloco"),Jc(),_i(24,"input",14),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formDefaultBranch.set(l))}),Jc(),iE(),Jc(),_i(25,"div",15)(26,"button",16),mh("click",function(){Fu(e);let l=HD(2);return ju(l.submitForm())}),Iw(27),Pw(28,"transloco"),Jc(),_i(29,"button",17),mh("click",function(){Fu(e);let l=HD(2);return ju(l.cancelForm())}),Iw(30),Pw(31,"transloco"),Jc()()();}if(i&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,13,"local-repos.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,15,"local-repos.form.localPath")),gI(2),lh("path",e.formLocalPath()),gI(3),Lh(Fw(15,17,"local-repos.form.worktreeBasePath")),gI(3),Lh(Fw(18,19,"local-repos.form.worktreeBaseHint")),gI(2),lh("path",e.formWorktreeBasePath()),gI(3),Lh(Fw(23,21,"local-repos.form.defaultBranch")),gI(2),lh("ngModel",e.formDefaultBranch()),aE(),gI(2),lh("disabled",e.saving()),gI(),rl$1(" ",Fw(28,23,"common.save")," "),gI(3),rl$1(" ",Fw(31,25,"common.cancel")," ");}}function _e(i,h){i&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"local-repos.emptyState")));}function Ce(i,h){if(i&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td",18),Iw(4),Jc(),_i(5,"td",18),Iw(6),Jc(),_i(7,"td"),Iw(8),Jc(),_i(9,"td",19)(10,"button",20),mh("click",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.openEditForm(l))}),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"button",21),Pw(14,"transloco"),mh("nzOnConfirm",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.deleteRepo(l))}),Iw(15),Pw(16,"transloco"),Jc()()();}if(i&2){let e=h.$implicit;ch("data-testid","local-repo-row-"+e.id),gI(2),Lh(e.name),gI(2),Lh(e.localPath),gI(2),Lh(e.worktreeBasePath||"\u2014"),gI(2),Lh(e.defaultBranch||"\u2014"),gI(2),ch("data-testid","edit-local-repo-"+e.id),gI(),rl$1(" ",Fw(12,10,"local-repos.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(14,12,"local-repos.deleteConfirm")),ch("data-testid","delete-local-repo-"+e.id),gI(2),rl$1(" ",Fw(16,14,"local-repos.delete")," ");}}function ge(i,h){if(i&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc()()(),_i(18,"tbody"),xD(19,Ce,17,16,"tr",null,ce),Jc()()),i&2){let e=HD(2);lh("nzData",e.repos())("nzShowPagination",false),gI(4),Lh(Fw(5,7,"local-repos.column.name")),gI(3),Lh(Fw(8,9,"local-repos.column.localPath")),gI(3),Lh(Fw(11,11,"local-repos.column.worktreeBasePath")),gI(3),Lh(Fw(14,13,"local-repos.column.defaultBranch")),gI(3),Lh(Fw(17,15,"local-repos.column.actions")),gI(3),AD(e.repos());}}function xe(i,h){if(i&1&&(_D(0,fe,2,1,"p",5),_D(1,ue,32,27,"section",6),_D(2,_e,3,3,"p",7)(3,ge,21,17,"nz-table",8)),i&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.formOpen()?1:-1),gI(),MD(e.repos().length===0&&!e.formOpen()?2:e.repos().length>0?3:-1);}}var ae=(()=>{class i{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.formDefaultBranch=qo(""),this.reload();}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.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.formDefaultBranch.set(e.defaultBranch??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r$1(r$1({name:this.formName().trim(),localPath:this.formLocalPath().trim()},this.formWorktreeBasePath().trim()?{worktreeBasePath:this.formWorktreeBasePath().trim()}:{worktreeBasePath:void 0}),this.formDefaultBranch().trim()?{defaultBranch:this.formDefaultBranch().trim()}:{defaultBranch:void 0}),a=this.editingId();(a?this.reposApi.update(a,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(""),this.formDefaultBranch.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(a=>a.filter(l=>l.id!==e.id));},error:a=>{this.deleteError.set(this.errorMessage(a,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,a){return e instanceof bi||e instanceof Error?e.message:a}static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,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"],["nz-input","","data-testid","local-repo-default-branch",3,"ngModelChange","ngModel"],[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(a,l){a&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"button",2),mh("click",function(){return l.openCreateForm()}),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,de,3,3,"p",3)(9,me,2,1,"p",4)(10,xe,4,3),Jc()),a&2&&(gI(3),Lh(Fw(4,3,"local-repos.title")),gI(3),rl$1(" ",Fw(7,5,"local-repos.create")," "),gI(2),MD(l.loading()?8:l.loadError()?9:10));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,ai,z,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return i})();var qe=(()=>{class i{static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(a,l){a&1&&uh(0,"app-local-repository-list");},dependencies:[ae],encapsulation:2});}}return i})();export{qe as LocalRepositoriesManageComponent};