@knoflows/engine 0.1.0 → 0.1.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine.js +19 -19
- package/dist/migrations/20260921193000_local_repo_remote/migration.sql +3 -0
- package/dist/migrations/20260921193000_local_repo_remote/snapshot.json +1378 -0
- package/package.json +1 -1
- package/static/assets/i18n/en.json +14 -0
- package/static/assets/i18n/es.json +14 -0
- package/static/chunk--EZIkevK.js +1 -0
- package/static/{chunk-D3JZ8ur5.js → chunk-8ezEUcxN.js} +6 -6
- package/static/chunk-B17yZLWe.js +1 -0
- package/static/{chunk-7NTQwN96.js → chunk-B8OjWpOp.js} +1 -1
- package/static/chunk-BHko4hHm.js +1 -0
- package/static/{chunk-DSgUAlqN.js → chunk-BIJScqTM.js} +1 -1
- package/static/{chunk-B_R_vsLt.js → chunk-BKYaECRn.js} +1 -1
- package/static/chunk-BLN4QkSi.js +1 -0
- package/static/{chunk-BrP_q6LZ.js → chunk-BRAytoQl.js} +1 -1
- package/static/{chunk-xeQj_hSF.js → chunk-BaLWULJh.js} +1 -1
- package/static/{chunk-Dx92ksvP.js → chunk-BcDRgzYZ.js} +1 -1
- package/static/{chunk-5xJXPFlv.js → chunk-Bok52e_k.js} +1 -1
- package/static/{chunk-CuwZV6XG.js → chunk-BowAQ7m9.js} +1 -1
- package/static/{chunk-C9PkSfMb.js → chunk-Bz7bE4tT.js} +1 -1
- package/static/{chunk-BCHj6l85.js → chunk-C7P7hUiX.js} +1 -1
- package/static/{chunk-BcQQgpKh.js → chunk-CAxHAuhV.js} +1 -1
- package/static/{chunk-Cvoe3MtC.js → chunk-CGHIKxZG.js} +1 -1
- package/static/{chunk-CZoPJsBm.js → chunk-CJWR0gwk.js} +1 -1
- package/static/{chunk-BRZ5T52h.js → chunk-CZA-kp5w.js} +1 -1
- package/static/{chunk-ZqQUQSE8.js → chunk-CoQPYpxp.js} +1 -1
- package/static/{chunk-DAONFRT8.js → chunk-CtiubhW7.js} +1 -1
- package/static/{chunk-hpn_m1ZC.js → chunk-CwEMAptL.js} +1 -1
- package/static/{chunk-CRGkNzel.js → chunk-D-ueyYEC.js} +3 -3
- package/static/{chunk-DHC_yfIa.js → chunk-D1355dNd.js} +1 -1
- package/static/{chunk-CV-FUe_H.js → chunk-D8qyjd0z.js} +1 -1
- package/static/{chunk-Dg-4XevL.js → chunk-DOAz4S6b.js} +1 -1
- package/static/{chunk-VXZaUyyE.js → chunk-DbQy6dR8.js} +1 -1
- package/static/chunk-DdDI9wRc.js +5 -0
- package/static/{chunk-BIdwV0jx.js → chunk-Det50scT.js} +1 -1
- package/static/{chunk-BIL86kgf.js → chunk-Dm_EWkUz.js} +1 -1
- package/static/chunk-DoJknvak.js +1 -0
- package/static/{chunk-DEF7Ge5B.js → chunk-DrncP2Qx.js} +1 -1
- package/static/{chunk-DvWh-Q5D.js → chunk-EDwdt-Wk.js} +1 -1
- package/static/chunk-IjKs-6Cl.js +1 -0
- package/static/{chunk-DyiDg8XX.js → chunk-LPXHXTnJ.js} +1 -1
- package/static/{chunk-DVJ9L-aC.js → chunk-SiaN7xSQ.js} +1 -1
- package/static/{chunk-Bv1r1Ly-.js → chunk-YU-Bg77r.js} +1 -1
- package/static/{chunk-Ysn4Fbgj.js → chunk-bSS_wejP.js} +1 -1
- package/static/{chunk-CLM-K-Vg.js → chunk-iIEmH_ui.js} +1 -1
- package/static/{chunk-CPNxRF7A.js → chunk-vINo5yVD.js} +1 -1
- package/static/index.html +1 -1
- package/static/{main-SI5AKDMC.js → main-3VZRFHGG.js} +1 -1
- package/static/chunk--WRMKpmO.js +0 -5
- package/static/chunk-BaYdwXIA.js +0 -1
- package/static/chunk-C3Xml1YG.js +0 -1
- package/static/chunk-DDhSFoAE.js +0 -1
- package/static/chunk-DaO-gpzS.js +0 -1
- package/static/chunk-pi-mtheN.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {w as we}from'./chunk-
|
|
1
|
+
import {w as we}from'./chunk-BowAQ7m9.js';import {_ as _n}from'./chunk-vINo5yVD.js';import {C,b7 as m,b8 as y,$,R as J1,V as Ve,b as at,q as qo,U as Uw,u as ue,aW as Ng,c as bi,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,l as _D,o as gI,L as Lh,p as Fw,z as rl,M as MD,H as HD,G as FD,m as mh,w as lh,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';function G(i,b){i&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function H(i,b){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function K(i,b){if(i&1&&(_i(0,"p",5),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.actionError());}}function Q(i,b){i&1&&(_i(0,"section",6)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"a",8),Iw(5),Pw(6,"transloco"),Jc()()),i&2&&(gI(2),Lh(Fw(3,2,"shortcuts.list.emptyState")),gI(3),rl(" ",Fw(6,4,"shortcuts.list.emptyCreateButton")," "));}function X(i,b){if(i&1){let t=FD();_i(0,"app-runnable-items-table",9),mh("rowAction",function(e){Fu(t);let c=HD(2);return ju(c.onRowAction(e))}),Jc();}if(i&2){let t=HD(2);lh("rows",t.rows())("selectable",false)("showRowAction",true);}}function Y(i,b){if(i&1&&(_D(0,K,2,1,"p",5),_D(1,Q,7,6,"section",6)(2,X,1,3,"app-runnable-items-table",7)),i&2){let t=HD();MD(t.actionError()?0:-1),gI(),MD(t.shortcuts().length===0?1:2);}}var bt=(()=>{class i{constructor(){this.shortcutsApi=C(m),this.nav=C(y),this.workflowsApi=C(b),this.jobsApi=C($),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.shortcuts=qo([]),this.workflows=qo([]),this.jobsById=qo({}),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.rows=Uw(()=>{let t=this.jobsById(),o=this.workflows();return this.shortcuts().map(e=>({id:e.id,primaryLabel:e.name,subtitle:o.find(c=>c.id===e.workflowId)?.name,latestJob:e.lastJobId?t[e.lastJobId]??null:null}))}),this.load();}onRowAction(t){let o=this.shortcuts().find(e=>e.id===t);o&&(this.actionError.set(null),this.jobsApi.start({workflowId:o.workflowId,inputValues:o.inputValues}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.shortcutsApi.update(o.id,{lastJobId:e.id}).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.shortcuts.update(q=>q.map(C=>C.id===c.id?c:C)),this.router.navigate(["/jobs",e.id]);},error:()=>{this.router.navigate(["/jobs",e.id]);}});},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("shortcuts.list.runFailed")));}}));}deleteShortcut(t){this.actionError.set(null),this.shortcutsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.nav.refresh(),this.shortcuts.update(o=>o.filter(e=>e.id!==t));},error:o=>{this.actionError.set(this.errorMessage(o,this.transloco.translate("shortcuts.list.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({shortcuts:t,workflows:o})=>{this.shortcuts.set(t),this.workflows.set(o),this.loading.set(false),this.loadLatestJobs(t);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("shortcuts.list.loadFailed")));}});}loadLatestJobs(t){let o=t.map(e=>e.lastJobId).filter(e=>e!=null);if(o.length===0){this.jobsById.set({});return}Ng(Object.fromEntries(o.map(e=>[e,this.jobsApi.get(e)]))).pipe(ue(this.destroyRef)).subscribe({next:e=>this.jobsById.set(e),error:()=>this.jobsById.set({})});}errorMessage(t,o){return t instanceof bi||t instanceof Error?t.message:o}static{this.\u0275fac=function(o){return new(o||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-shortcut-list"]],decls:11,vars:7,consts:[["data-testid","shortcuts-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","action-error",1,"error"],["data-testid","empty-state",1,"empty"],[3,"rows","selectable","showRowAction"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","empty-create"],[3,"rowAction","rows","selectable","showRowAction"]],template:function(o,e){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"a",2),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,G,3,3,"p",3)(9,H,2,1,"p",4)(10,Y,3,2),Jc()),o&2&&(gI(3),Lh(Fw(4,3,"shortcuts.list.title")),gI(3),rl(" ",Fw(7,5,"shortcuts.list.createButton")," "),gI(2),MD(e.loading()?8:e.loadError()?9:10));},dependencies:[$8,v3,pf,bd,sp,_n,we,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}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{bt as ShortcutListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {T as Ty}from'./chunk-8ezEUcxN.js';function p(t){switch(t){case "completed":return "success";case "failed":return "error";case "waiting_for_human":case "waiting_for_children":return "info";case "pending":case "cancelled":return "muted";case "planning":case "implementing":case "testing":return "primary"}}function d(t){switch(t){case "completed":return "success";case "failed":return "error";case "completed_with_issues":case "cancelled":return "warning";default:return null}}function m(t){switch(t){case "completed":return "success";case "failed":return "error";case "queued":case "waiting_for_children":return "info";case "running":return "primary";case "pending":case "skipped":return "muted"}}function a(t,e){if(!(!t||e==="dark"))switch(t){case "success":return "success";case "warning":return "warning";case "error":return "error";case "info":case "primary":case "muted":return}}function f(t,e){return !t||e!=="dark"&&!(t==="info"||t==="primary"||t==="muted")?"":`knoflows-tag-${t}`}function x(t,e){return f(p(t),e)}function h(t,e){return a(p(t),e)}function y(t,e){return f(d(t),e)}function S(t,e){return a(d(t),e)}function T(t,e){return f(m(t),e)}function _(t,e){return a(m(t),e)}var g=new Set(["completed","failed","cancelled"]);function C(t){return t==="agent"||t==="shell"||t==="git"||t==="provider_action"}function w(t){return g.has(t)}function I(t){let e=t.stepHistory.find(r=>r.status==="running");if(e)return e;let n=t.stepHistory.find(r=>r.status==="queued");if(n)return n;if((t.status==="waiting_for_human"||t.status==="waiting_for_children")&&t.currentStepExecutionId){let r=t.stepHistory.find(i=>i.id===t.currentStepExecutionId);if(r)return r}return w(t.status)&&t.stepHistory.length>0?t.stepHistory[t.stepHistory.length-1]??null:null}function k(t,e){let n=new Map;for(let r of e)n.set(r.stepDefinitionId,r);return t.map(r=>{let i=n.get(r.id)??null;return {definition:r,execution:i,reached:i!=null}})}function O(t){if(!t)return null;if(t.mode==="single"){let n=t.subject;return `${n.id} \xB7 ${n.title}`}let e=t.subjects.length;if(e===0)return null;if(e===1){let n=t.subjects[0];return `${n.id} \xB7 ${n.title}`}return `${e} subjects`}function b(t){let e=t.workflowSnapshot?.name??t.workflowId;return t.subjectContext?t.subjectContext.mode==="single"?`${e} \u2014 ${t.subjectContext.subject.title}`:`${e} \u2014 ${t.subjectContext.subjects.length} items`:e}function v(t,e,n,r){let i=t.findIndex(s=>s.id===n);if(!(i<0))for(let s=i-1;s>=0;s-=1){let o=t[s];if(o.type!=="agent")continue;let c=e.find(u=>u.stepDefinitionId===o.id);if(c?.output!==void 0)return c.output;if(Object.prototype.hasOwnProperty.call(r.context,o.id))return r.context[o.id]}}function D(t){let e=t.waitingEvent;if(e&&e.questions.length>0)return e.questions;let n=e?.data??t.selectedOutput??t.priorOutput,r=Ty(t.interaction,n);return r.length>0?r:e?.data!=null?[JSON.stringify(e.data,null,2)]:[]}function E(t){return t.waitingEvent?.data??t.selectedOutput??t.priorOutput}function H(t){if(!t||typeof t!="object")return [];let e=t.questions;if(!Array.isArray(e))return [];let n=new Set,r=[];return e.forEach((i,s)=>{let o="",c="";if(typeof i=="string")c=i.trim();else if(i&&typeof i=="object"){let u=i;typeof u.prompt=="string"&&(c=u.prompt.trim()),typeof u.id=="string"&&(o=u.id.trim());}if(c){if(!o){let u=`q${s+1}`;for(;n.has(u);)u=`${u}_${s}`;o=u;}n.add(o),r.push({id:o,prompt:c});}}),r}function A(t,e){return t.every(n=>(e[n.id]??"").trim()!=="")}function P(t,e,n){let r={};for(let s of t)r[s.id]=(e[s.id]??"").trim();let i=n.trim();return i&&(r.additionalComments=i),r}function J(t,e){let n=e.trim();return n?{approved:t,comment:n}:{approved:t}}export{A,C,D,E,H,I,J,O,P,S,T,_,b,h,k,v,w,x,y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {_ as _n,C as Cn}from'./chunk-
|
|
1
|
+
import {_ as _n,C as Cn}from'./chunk-vINo5yVD.js';import {C,b6 as U,b7 as m,b8 as y,V as Ve,b as at,q as qo,u as ue,aW as Ng,c as bi,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,l as _D,o as gI,L as Lh,p as Fw,z as rl,M as MD,H as HD,x as xD,w as lh,B as AD,G as FD,m as mh,D as ch,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {W,I}from'./chunk-Bok52e_k.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';function ee(t,p){return [...t.map(i=>({type:"view",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:i.subjectType})),...p.map(i=>({type:"shortcut",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:null}))].sort((i,c)=>i.name.localeCompare(c.name))}var te=(t,p)=>p.type+p.id;function ie(t,p){t&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ne(t,p){if(t&1&&(_i(0,"p",6),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function oe(t,p){if(t&1&&(_i(0,"p",7),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.deleteError());}}function ae(t,p){t&1&&(_i(0,"section",8)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"a",10),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",11),Iw(9),Pw(10,"transloco"),Jc()()()),t&2&&(gI(2),Lh(Fw(3,3,"manage.views.emptyState")),gI(4),rl(" ",Fw(7,5,"manage.views.createView")," "),gI(3),rl(" ",Fw(10,7,"manage.views.createShortcut")," "));}function re(t,p){if(t&1&&(Iw(0),Pw(1,"transloco")),t&2){let e=HD().$implicit,i=HD(3);rl(" ",Fw(1,1,i.subjectTypeKey(e.subjectType))," ");}}function se(t,p){t&1&&(Iw(0),Pw(1,"transloco")),t&2&&rl(" ",Fw(1,1,"manage.views.noSubjectType")," ");}function de(t,p){if(t&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td")(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"td"),Iw(8),Jc(),_i(9,"td"),_D(10,re,2,3)(11,se,2,3),Jc(),_i(12,"td",12)(13,"a",13),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",14),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let c=Fu(e).$implicit,v=HD(3);return ju(v.deleteItem(c))}),Iw(20),Pw(21,"transloco"),Jc()()();}if(t&2){let e=p.$implicit,i=HD(3);ch("data-testid","item-"+e.type+"-"+e.id),gI(),ch("data-testid","name-"+e.type+"-"+e.id),gI(),Lh(e.name),gI(2),ch("data-testid","type-"+e.type+"-"+e.id),gI(),Lh(Fw(6,17,i.typeKey(e.type))),gI(2),ch("data-testid","workflow-"+e.type+"-"+e.id),gI(),rl(" ",i.workflowName(e)," "),gI(),ch("data-testid","subject-type-"+e.type+"-"+e.id),gI(),MD(e.subjectType?10:11),gI(3),lh("routerLink",i.editLink(e)),ch("data-testid","edit-"+e.type+"-"+e.id),gI(),rl(" ",Fw(15,19,"manage.views.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,21,i.deleteConfirmKey(e)))("nzOkText",Fw(18,23,"manage.views.delete"))("nzCancelText",Fw(19,25,"common.cancel")),ch("data-testid","delete-"+e.type+"-"+e.id),gI(4),rl(" ",Fw(21,27,"manage.views.delete")," ");}}function pe(t,p){if(t&1&&(_i(0,"nz-table",9)(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,de,22,29,"tr",null,te),Jc()()),t&2){let e=HD(2);lh("nzData",e.items())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,8,"manage.views.column.name")),gI(3),Lh(Fw(8,10,"manage.views.column.type")),gI(3),Lh(Fw(11,12,"manage.views.column.workflow")),gI(3),Lh(Fw(14,14,"manage.views.column.subjectType")),gI(3),Lh(Fw(17,16,"manage.views.column.actions")),gI(3),AD(e.items());}}function le(t,p){if(t&1&&(_D(0,oe,2,1,"p",7),_D(1,ae,11,9,"section",8)(2,pe,21,18,"nz-table",9)),t&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.items().length===0?1:2);}}var Pe=(()=>{class t{constructor(){this.viewsApi=C(U),this.shortcutsApi=C(m),this.nav=C(y),this.workflowsApi=C(b),this.transloco=C(Ve),this.destroyRef=C(at),this.items=qo([]),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.load();}typeKey(e){return `manage.views.type.${e}`}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}workflowName(e){return this.workflows().find(i=>i.id===e.workflowId)?.name??e.workflowId}editLink(e){return e.type==="view"?["/views",e.id,"edit"]:["/shortcuts",e.id,"edit"]}deleteConfirmKey(e){return e.type==="view"?"manage.views.deleteConfirmView":"manage.views.deleteConfirmShortcut"}deleteItem(e){this.deleteError.set(null),(e.type==="view"?this.viewsApi.delete(e.id):this.shortcutsApi.delete(e.id)).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.nav.refresh(),this.items.update(c=>c.filter(v=>!(v.type===e.type&&v.id===e.id)));},error:c=>{this.deleteError.set(this.errorMessage(c,this.transloco.translate("manage.views.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({views:this.viewsApi.list(),shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({views:e,shortcuts:i,workflows:c})=>{this.items.set(ee(e,i)),this.workflows.set(c),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("manage.views.loadFailed")));}});}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-views-and-shortcuts-manage"]],decls:15,vars:10,consts:[["data-testid","views-shortcuts-manage",1,"list-page"],[1,"header"],[1,"header-actions"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","managed-items",3,"nzData","nzFrontPagination","nzShowPagination"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","empty-create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","empty-create-shortcut"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(i,c){i&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",2)(6,"a",3),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"a",4),Iw(10),Pw(11,"transloco"),Jc()()(),_D(12,ie,3,3,"p",5)(13,ne,2,1,"p",6)(14,le,3,2),Jc()),i&2&&(gI(3),Lh(Fw(4,4,"manage.views.title")),gI(4),rl(" ",Fw(8,6,"manage.views.createView")," "),gI(3),rl(" ",Fw(11,8,"manage.views.createShortcut")," "),gI(2),MD(c.loading()?12:c.loadError()?13:14));},dependencies:[$8,v3,pf,bd,sp,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.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 t})();export{Pe as ViewsAndShortcutsManageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Z as ZE,K as Kt,bm as Xc,I as Iw,P as Pw,bn as el,o as gI,L as Lh,p as Fw}from'./main-
|
|
1
|
+
import {Z as ZE,K as Kt,bm as Xc,I as Iw,P as Pw,bn as el,o as gI,L as Lh,p as Fw}from'./main-3VZRFHGG.js';var x=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-preferences-manage"]],decls:9,vars:6,consts:[["data-testid","preferences-manage",1,"list-page"],[1,"header"],[1,"lede"]],template:function(t,l){t&1&&(Xc(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),el(),Xc(6,"p",2),Iw(7),Pw(8,"transloco"),el()()()()),t&2&&(gI(4),Lh(Fw(5,2,"manage.preferences.title")),gI(3),Lh(Fw(8,4,"manage.preferences.body")));},dependencies:[Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}"]});}}return e})();export{x as PreferencesManageComponent};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {T}from'./chunk-SiaN7xSQ.js';import {w,L as L$1}from'./chunk-IjKs-6Cl.js';import {H as He$1}from'./chunk-CwEMAptL.js';import {f}from'./chunk--EZIkevK.js';import {C,a as C1,R as J1,b6 as U,b8 as y,b as at$1,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-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {a as ai,z}from'./chunk-Dm_EWkUz.js';import {U as Uu,b as bg,w as w_,j as j_,d as B$,X as X$}from'./chunk-8ezEUcxN.js';import'./chunk-iIEmH_ui.js';var Ve=()=>[],L=(t,o)=>o.id,ke=(t,o)=>o.name;function Se(t,o){t&1&&(_i(0,"p",6),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ze(t,o){if(t&1&&(_i(0,"p",7),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function Pe(t,o){if(t&1&&(_i(0,"li"),Iw(1),Jc()),t&2){let e=o.$implicit;gI(),Lh(e);}}function Ne(t,o){if(t&1&&(_i(0,"section",8)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"ul"),xD(5,Pe,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 qe(t,o){if(t&1&&uh(0,"nz-option",12),t&2){let e=o.$implicit;lh("nzValue",e.id)("nzLabel",e.name);}}function Re(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 De(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 Ae(t,o){if(t&1&&uh(0,"nz-option",12),t&2){let e=o.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function Fe(t,o){if(t&1){let e=FD();_i(0,"div",16),_D(1,De,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,Ae,1,2,"nz-option",12,L),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 Oe(t,o){if(t&1&&_D(0,Re,3,3,"p",14)(1,Fe,9,10,"div",15),t&2){let e=HD(2);MD(e.eligibleInstances().length===0?0:1);}}function Le(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 Be(t,o){if(t&1&&uh(0,"nz-option",12),t&2){let e=o.$implicit;lh("nzValue",e.id)("nzLabel",e.label);}}function je(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 $e(t,o){t&1&&(_i(0,"span",25),Iw(1,"*"),Jc());}function We(t,o){if(t&1&&uh(0,"nz-option",12),t&2){let e=o.$implicit;lh("nzValue",e)("nzLabel",e);}}function Je(t,o){if(t&1){let e=FD();_i(0,"nz-select",28),mh("ngModelChange",function(n){Fu(e);let s=HD().$implicit,y=HD(5);return ju(y.setTemplateParam(s.name,n))}),xD(1,We,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,Ve));}}function Ue(t,o){if(t&1){let e=FD();_i(0,"button",33),mh("click",function(){Fu(e);let n=HD(2).$implicit,s=HD(5);return ju(s.useAllKnownRepos(n.name))}),Iw(1),Pw(2,"transloco"),Jc();}t&2&&(gI(),rl$1(" ",Fw(2,1,"views.editor.useAllKnownRepos")," "));}function Ke(t,o){t&1&&(_i(0,"p",32),Iw(1),Jc()),t&2&&(gI(),Lh(o));}function Qe(t,o){if(t&1){let e=FD();_i(0,"div",29)(1,"nz-select",30),mh("ngModelChange",function(n){Fu(e);let s=HD().$implicit,y=HD(5);return ju(y.setTemplateParam(s.name,n))}),Jc(),iE(),_D(2,Ue,3,3,"button",31),Jc(),_D(3,Ke,2,1,"p",32);}if(t&2){let e,i=HD().$implicit,n=HD(5);gI(),lh("nzOptions",n.knownRepoSlugOptions())("ngModel",n.templateParamListValue(i.name)),ch("data-testid","template-param-"+i.name),aE(),gI(),MD(n.showUseAllKnownRepos()&&i.name==="repoSlugs"?2:-1),gI(),MD((e=n.knownReposLimitMessage())?3:-1,e);}}function He(t,o){if(t&1){let e=FD();_i(0,"input",34),mh("ngModelChange",function(n){Fu(e);let s=HD().$implicit,y=HD(5);return ju(y.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 Ge(t,o){if(t&1&&(_i(0,"label",9)(1,"span"),Iw(2),_D(3,$e,2,0,"span",25),Jc(),_D(4,Je,3,3,"nz-select",26)(5,Qe,4,5)(6,He,1,2,"input",27),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 Ye(t,o){if(t&1&&xD(0,Ge,7,3,"label",9,ke),t&2){let e=HD();AD(e.params);}}function Ze(t,o){if(t&1&&_D(0,je,8,7,"label",9)(1,Ye,2,0),t&2){let e=HD(3);MD(e.isRawSeedTemplate()?0:1);}}function Xe(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,Be,1,2,"nz-option",12,L),Jc(),iE(),Jc(),_D(7,Ze,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 et(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",35),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 tt(t,o){if(t&1){let e=FD();_D(0,Ne,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,qe,1,2,"nz-option",12,L),Jc(),iE(),Jc(),_D(13,Oe,2,1),_D(14,Le,11,11,"div",13),_D(15,Xe,8,5)(16,et,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 it(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 Ie=[];function nt(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 Ee(t,o){let e=r$1(r$1({},nt(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 ot(t){let o=t?.trim()??"";return o.length>0?o:null}var Dt=(()=>{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(f),this.providersApi=C(w),this.message=C(He$1),this.destroyRef=C(at$1),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(()=>L$1(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.knownRepoSlugs=Uw(()=>{let e=this.selectedInstance();return !e||e.type!=="bitbucket"?Ie:bg(e.config)}),this.showUseAllKnownRepos=Uw(()=>this.knownRepoSlugs().length>0),this.knownRepoSlugOptions=Uw(()=>this.knownRepoSlugs().map(e=>({label:e,value:e}))),this.knownReposLimitMessage=qo(null),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(w_),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(ot(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({}),this.knownReposLimitMessage.set(null);let n=L$1(this.settings(),i);if(n.length===1)this.applyInstance(n[0]);else {let s=this.providerInstanceId(),y=n.find(P=>P.id===s);y?this.applyInstance(y):(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({}),this.knownReposLimitMessage.set(null),i&&this.applyInstance(i),this.refreshTemplates();}applyInstance(e){this.providerInstanceId.set(e.id),j_(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?Ee(i,{}):{}),this.knownReposLimitMessage.set(null),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:Ie}setTemplateParam(e,i){this.templateParams.set(s(r$1({},this.templateParams()),{[e]:i}));}useAllKnownRepos(e){let i=this.knownRepoSlugs();if(i.length>B$){this.knownReposLimitMessage.set(this.transloco.translate("views.editor.knownReposOverLimit",{count:i.length,limit:B$}));return}this.knownReposLimitMessage.set(null),this.setTemplateParam(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?at(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??it(this.name()),name:this.name().trim(),subjectType:n??"",providerInstanceId:this.providerInstanceId()??"",workflowId:this.workflowId(),query:e.query},e.queryTemplate?{queryTemplate:e.queryTemplate}:{}),y=X$.safeParse(s);if(!y.success){this.saving.set(false),this.validationErrors.set(T(y.error));return}this.validationErrors.set([]),this.saving.set(true);let P=y.data;(this.isNew()||!i?this.viewsApi.create(P):this.viewsApi.update(i,P)).subscribe({next:R=>{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",R.id,"edit"]);},error:R=>{this.saving.set(false),this.message.error(this.errorMessage(R,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(Ee(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"],["nz-input","",3,"ngModel"],[3,"ngModelChange","ngModel"],[1,"param-with-action"],["nzMode","tags",3,"ngModelChange","nzOptions","ngModel"],["nz-button","","type","button","data-testid","use-all-known-repos"],["data-testid","known-repos-limit",1,"error"],["nz-button","","type","button","data-testid","use-all-known-repos",3,"click"],["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,Se,3,3,"p",6)(13,ze,2,1,"p",7)(14,tt,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,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}.param-with-action[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.param-with-action[_ngcontent-%COMP%] nz-select[_ngcontent-%COMP%]{flex:1;min-width:0}.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 at(t){return t==null?true:typeof t=="string"?t.trim()==="":Array.isArray(t)?t.every(o=>String(o).trim()===""):false}export{Dt as ViewEditorComponent};
|
|
@@ -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-
|
|
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-3VZRFHGG.js';import {a as ai,z}from'./chunk-Dm_EWkUz.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 {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
|
+
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-3VZRFHGG.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f as f$1}from'./chunk--EZIkevK.js';import {o as ot}from'./chunk-Det50scT.js';import {_ as _n,C as Cn}from'./chunk-vINo5yVD.js';import {f}from'./chunk-BIJScqTM.js';import {Z as ZE,n as uh,C,V as Ve,b as at,q as qo,U as Uw,u as ue,s,r as r$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,h as ex,F as Fm,A as Am,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,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,x as xD,w as lh,y as aE,B as AD,D as ch,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import {a as ai,z}from'./chunk-Dm_EWkUz.js';import {j as j_,O as O_}from'./chunk-8ezEUcxN.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';var _e=(n,h)=>h.id;function Ie(n,h){n&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),n&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function be(n,h){if(n&1&&(_i(0,"p",4),Iw(1),Jc()),n&2){let e=HD();gI(),Lh(e.loadError());}}function ye(n,h){if(n&1&&(_i(0,"p",5),Iw(1),Jc()),n&2){let e=HD(2);gI(),Lh(e.deleteError());}}function Re(n,h){if(n&1&&(_i(0,"p",9),Iw(1),Jc()),n&2){let e=HD(3);gI(),Lh(e.saveError());}}function Me(n,h){if(n&1&&uh(0,"nz-option",16),n&2){let e=h.$implicit,t=HD(3);lh("nzValue",e.id)("nzLabel",t.instanceLabel(e));}}function Ee(n,h){if(n&1){let e=FD();_i(0,"label",10)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nz-select",20),Pw(5,"transloco"),mh("ngModelChange",function(a){Fu(e);let d=HD(3);return ju(d.formRemoteIdentifier.set(a))}),Jc(),iE(),Jc();}if(n&2){let e=HD(3);gI(2),Lh(Fw(3,4,"local-repos.form.remoteIdentifier")),gI(2),lh("nzOptions",e.remoteIdentifierOptions())("nzPlaceHolder",Fw(5,6,"local-repos.form.remoteIdentifierPlaceholder"))("ngModel",e.formRemoteIdentifier()),aE();}}function Le(n,h){if(n&1){let e=FD();_i(0,"section",6),_D(1,Re,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(a){Fu(e);let d=HD(2);return ju(d.formName.set(a))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"app-path-picker",12),mh("pathChange",function(a){Fu(e);let d=HD(2);return ju(d.formLocalPath.set(a))}),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(a){Fu(e);let d=HD(2);return ju(d.formWorktreeBasePath.set(a))}),Jc()(),_i(20,"label",10)(21,"span"),Iw(22),Pw(23,"transloco"),Jc(),_i(24,"input",14),mh("ngModelChange",function(a){Fu(e);let d=HD(2);return ju(d.formDefaultBranch.set(a))}),Jc(),iE(),Jc(),_i(25,"label",10)(26,"span"),Iw(27),Pw(28,"transloco"),Jc(),_i(29,"p",13),Iw(30),Pw(31,"transloco"),Jc(),_i(32,"nz-select",15),Pw(33,"transloco"),mh("ngModelChange",function(a){Fu(e);let d=HD(2);return ju(d.onRemoteInstanceChange(a))}),xD(34,Me,1,2,"nz-option",16,_e),Jc(),iE(),Jc(),_D(36,Ee,6,8,"label",10),_i(37,"div",17)(38,"button",18),mh("click",function(){Fu(e);let a=HD(2);return ju(a.submitForm())}),Iw(39),Pw(40,"transloco"),Jc(),_i(41,"button",19),mh("click",function(){Fu(e);let a=HD(2);return ju(a.cancelForm())}),Iw(42),Pw(43,"transloco"),Jc()()();}if(n&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,18,"local-repos.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,20,"local-repos.form.localPath")),gI(2),lh("path",e.formLocalPath()),gI(3),Lh(Fw(15,22,"local-repos.form.worktreeBasePath")),gI(3),Lh(Fw(18,24,"local-repos.form.worktreeBaseHint")),gI(2),lh("path",e.formWorktreeBasePath()),gI(3),Lh(Fw(23,26,"local-repos.form.defaultBranch")),gI(2),lh("ngModel",e.formDefaultBranch()),aE(),gI(3),Lh(Fw(28,28,"local-repos.form.remoteInstance")),gI(3),Lh(Fw(31,30,"local-repos.form.remoteHint")),gI(2),lh("nzPlaceHolder",Fw(33,32,"local-repos.form.remoteInstancePlaceholder"))("ngModel",e.formRemoteInstanceId()),aE(),gI(2),AD(e.repoCapableInstances()),gI(2),MD(e.formRemoteInstanceId()?36:-1),gI(2),lh("disabled",e.saving()),gI(),rl$1(" ",Fw(40,34,"common.save")," "),gI(3),rl$1(" ",Fw(43,36,"common.cancel")," ");}}function ze(n,h){n&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),n&2&&(gI(),Lh(Fw(2,1,"local-repos.emptyState")));}function Be(n,h){if(n&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td",21),Iw(4),Jc(),_i(5,"td",21),Iw(6),Jc(),_i(7,"td"),Iw(8),Jc(),_i(9,"td"),Iw(10),Jc(),_i(11,"td",22)(12,"button",23),mh("click",function(){let a=Fu(e).$implicit,d=HD(3);return ju(d.openEditForm(a))}),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"button",24),Pw(16,"transloco"),mh("nzOnConfirm",function(){let a=Fu(e).$implicit,d=HD(3);return ju(d.deleteRepo(a))}),Iw(17),Pw(18,"transloco"),Jc()()();}if(n&2){let e=h.$implicit,t=HD(3);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),Lh(t.remoteRepoLabel(e)),gI(2),ch("data-testid","edit-local-repo-"+e.id),gI(),rl$1(" ",Fw(14,11,"local-repos.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(16,13,"local-repos.deleteConfirm")),ch("data-testid","delete-local-repo-"+e.id),gI(2),rl$1(" ",Fw(18,15,"local-repos.delete")," ");}}function Pe(n,h){if(n&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,"th"),Iw(19),Pw(20,"transloco"),Jc()()(),_i(21,"tbody"),xD(22,Be,19,17,"tr",null,_e),Jc()()),n&2){let e=HD(2);lh("nzData",e.repos())("nzShowPagination",false),gI(4),Lh(Fw(5,8,"local-repos.column.name")),gI(3),Lh(Fw(8,10,"local-repos.column.localPath")),gI(3),Lh(Fw(11,12,"local-repos.column.worktreeBasePath")),gI(3),Lh(Fw(14,14,"local-repos.column.defaultBranch")),gI(3),Lh(Fw(17,16,"local-repos.column.remoteRepo")),gI(3),Lh(Fw(20,18,"local-repos.column.actions")),gI(3),AD(e.repos());}}function Se(n,h){if(n&1&&(_D(0,ye,2,1,"p",5),_D(1,Le,44,38,"section",6),_D(2,ze,3,3,"p",7)(3,Pe,24,20,"nz-table",8)),n&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 Ne=[],ge=(()=>{class n{constructor(){this.reposApi=C(f),this.settingsApi=C(f$1),this.transloco=C(Ve),this.destroyRef=C(at),this.repos=qo([]),this.settings=qo(null),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.formRemoteInstanceId=qo(null),this.formRemoteIdentifier=qo(null),this.repoCapableInstances=Uw(()=>(this.settings()?.providerInstances??[]).filter(e=>j_(e)&&e.subjectType==="pull_request")),this.selectedRemoteInstance=Uw(()=>{let e=this.formRemoteInstanceId();return this.repoCapableInstances().find(t=>t.id===e)??null}),this.remoteIdentifierOptions=Uw(()=>{let e=this.selectedRemoteInstance(),t=e?O_(e.config):Ne,a=this.formRemoteIdentifier()?.trim()??"";return (a&&!t.includes(a)?[a,...t]:t).map(x=>({label:x,value:x}))}),this.reload(),this.settingsApi.getSettings().pipe(ue(this.destroyRef)).subscribe({next:e=>this.settings.set(e),error:()=>this.settings.set({providerInstances:[]})});}instanceLabel(e){return e.displayName||e.id}remoteRepoLabel(e){let t=e.remoteRepo;if(!t)return "\u2014";let d=this.repoCapableInstances().find(x=>x.id===t.providerInstanceId)?.displayName||t.providerInstanceId;return `${t.identifier} (${d})`}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.set(""),this.formRemoteInstanceId.set(null),this.formRemoteIdentifier.set(null),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.formRemoteInstanceId.set(e.remoteRepo?.providerInstanceId??null),this.formRemoteIdentifier.set(e.remoteRepo?.identifier??null),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}onRemoteInstanceChange(e){this.formRemoteInstanceId.set(e);let t=e?O_(this.repoCapableInstances().find(d=>d.id===e)?.config):[],a=this.formRemoteIdentifier();a&&!t.includes(a)?this.formRemoteIdentifier.set(t[0]??null):!a&&t.length===1?this.formRemoteIdentifier.set(t[0]):e||this.formRemoteIdentifier.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=this.formRemoteInstanceId()?.trim()??"",t=this.formRemoteIdentifier()?.trim()??"",a=e&&t?{providerInstanceId:e,identifier:t}:null,d=s(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}),{remoteRepo:a??void 0}),x=this.editingId();(x?this.reposApi.update(x,s(r$1({},d),{remoteRepo:a})):this.reposApi.create(d)).pipe(ue(this.destroyRef)).subscribe({next:L=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.repos.update(Ce=>[...Ce.filter(T=>T.id!==L.id),L].sort((T,xe)=>T.name.localeCompare(xe.name))),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.set(""),this.formRemoteInstanceId.set(null),this.formRemoteIdentifier.set(null);},error:L=>{this.saving.set(false),this.saveError.set(this.errorMessage(L,this.transloco.translate("local-repos.saveFailed")));}});}deleteRepo(e){this.deleteError.set(null),this.reposApi.delete(e.id).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.repos.update(t=>t.filter(a=>a.id!==e.id));},error:t=>{this.deleteError.set(this.errorMessage(t,this.transloco.translate("local-repos.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.reposApi.list().pipe(ue(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,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||n)};}static{this.\u0275cmp=ZE({type:n,selectors:[["app-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"],["data-testid","local-repo-remote-instance","nzAllowClear","",3,"ngModelChange","nzPlaceHolder","ngModel"],[3,"nzValue","nzLabel"],[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"],["data-testid","local-repo-remote-identifier","nzAllowClear","",3,"ngModelChange","nzOptions","nzPlaceHolder","ngModel"],[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(t,a){t&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"button",2),mh("click",function(){return a.openCreateForm()}),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,Ie,3,3,"p",3)(9,be,2,1,"p",4)(10,Se,4,3),Jc()),t&2&&(gI(3),Lh(Fw(4,3,"local-repos.title")),gI(3),rl$1(" ",Fw(7,5,"local-repos.create")," "),gI(2),MD(a.loading()?8:a.loadError()?9:10));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,ai,z,_n,Cn,ex,Fm,Am,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 n})();var st=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)};}static{this.\u0275cmp=ZE({type:n,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(t,a){t&1&&uh(0,"app-local-repository-list");},dependencies:[ge],encapsulation:2});}}return n})();export{st as LocalRepositoriesManageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {l}from'./chunk-D19C8Gcb.js';import {T}from'./chunk-DVJ9L-aC.js';import {_ as _n,C as Cn}from'./chunk-CPNxRF7A.js';import {C,V as Ve,b as at,b0 as jn,R as J1,q as qo,u as ue,aS as v,aY as Dg,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,h as ex,F as Fm,A as Am,K as Kt$1,G as FD,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,w as lh,z as rl$1,M as MD,b2 as Le,b3 as Wn,az as jw,E as Aw,H as HD,x as xD,N as ND,k as iE,y as aE,B as AD,b4 as N2,aV as ix,b5 as cx,i as ie$1,n as uh,D as ch,aO as SD,aP as Mh,O as Fu,Q as ju,aH as QD}from'./main-SI5AKDMC.js';import {b}from'./chunk-Dx92ksvP.js';import {N as Nt,K as Ke}from'./chunk-BCHj6l85.js';import {n as ng,i as i_}from'./chunk-D3JZ8ur5.js';import {W,I}from'./chunk-5xJXPFlv.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 Ot=i=>({name:i}),Lt=(()=>{class i{constructor(){this.modalRef=C(Le),this.data=C(Wn);}cancel(){this.modalRef.close(void 0);}choose(t){this.modalRef.close(t);}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-import-conflict"]],decls:14,vars:15,consts:[["data-testid","import-conflict-dialog"],["data-testid","import-conflict-message"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","import-conflict-cancel",3,"click"],["nz-button","","type","button","data-testid","import-conflict-create-new",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","import-conflict-update",3,"click"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"button",3),mh("click",function(){return a.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",4),mh("click",function(){return a.choose("create_new")}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",5),mh("click",function(){return a.choose("update")}),Iw(12),Pw(13,"transloco"),Jc()()()),e&2&&(gI(2),rl$1(" ",jw(3,4,"workflows.import.conflictBody",Aw(13,Ot,a.data.name))," "),gI(4),rl$1(" ",Fw(7,7,"common.cancel")," "),gI(3),rl$1(" ",Fw(10,9,"workflows.import.createNew")," "),gI(3),rl$1(" ",Fw(13,11,"workflows.import.update")," "));},dependencies:[pf,bd,sp,fp,Kt$1],styles:["p[_ngcontent-%COMP%]{margin:0 0 1.25rem;color:#44403c}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}"]});}}return i})();var Pt=(()=>{class i{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflow-library`;}list(){return this.http.get(this.baseUrl).pipe(cx())}add(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/add`,{}).pipe(cx())}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275prov=ie$1({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();var At=(i,d)=>d.id;function Vt(i,d){i&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Rt(i,d){if(i&1&&(_i(0,"p",3),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function Ht(i,d){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.addError());}}function Kt(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD(3);gI(),Lh(Fw(2,1,e.subjectTypeKey(t)));}}function Ut(i,d){if(i&1&&(_i(0,"li")(1,"span"),Iw(2),Jc(),_i(3,"span",14),Iw(4),Pw(5,"transloco"),Jc()()),i&2){let t=d.$implicit,e=HD(4);Mh("margin-left",t.depth,"rem"),gI(2),Lh(t.name),gI(2),Lh(Fw(5,4,e.stepTypeKey(t.type)));}}function Jt(i,d){if(i&1&&(_i(0,"ol",12),xD(1,Ut,6,6,"li",13,SD),Jc()),i&2){let t=HD().$implicit,e=HD(2);ch("data-testid","library-steps-"+t.id),gI(),AD(e.previewSteps(t));}}function Zt(i,d){if(i&1){let t=FD();_i(0,"nz-card")(1,"div",6)(2,"h2"),Iw(3),Jc(),_i(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"p",7),Iw(8),Jc(),_i(9,"div",8),xD(10,Kt,3,3,"nz-tag",null,ND),Jc(),_i(12,"div",9)(13,"button",10),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.togglePreview(a.id))}),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",11),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.addToMyWorkflows(a.id))}),Iw(17),Pw(18,"transloco"),Jc()(),_D(19,Jt,3,1,"ol",12),Jc();}if(i&2){let t=d.$implicit,e=HD(2);ch("data-testid","library-entry-"+t.id),gI(2),ch("data-testid","library-name-"+t.id),gI(),Lh(t.name),gI(),ch("data-testid","library-source-"+t.id),gI(),Lh(Fw(6,13,e.sourceKey(t.source))),gI(2),ch("data-testid","library-description-"+t.id),gI(),rl$1(" ",t.description," "),gI(2),AD(e.appliesToValues(t)),gI(3),ch("data-testid","library-preview-"+t.id),gI(),rl$1(" ",Fw(15,15,e.isExpanded(t.id)?"workflow-library.hideSteps":"workflow-library.previewSteps")," "),gI(2),lh("disabled",e.addingId()!==null),ch("data-testid","library-add-"+t.id),gI(),rl$1(" ",Fw(18,17,e.addingId()===t.id?"workflow-library.adding":"workflow-library.add")," "),gI(2),MD(e.isExpanded(t.id)?19:-1);}}function qt(i,d){if(i&1&&(_D(0,Ht,2,1,"p",4),_i(1,"div",5),xD(2,Zt,20,19,"nz-card",null,At),Jc()),i&2){let t=HD();MD(t.addError()?0:-1),gI(2),AD(t.entries());}}var jt=(()=>{class i{constructor(){this.libraryApi=C(Pt),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.modalRef=C(Le,{optional:true}),this.entries=qo([]),this.loading=qo(true),this.loadError=qo(null),this.addError=qo(null),this.addingId=qo(null),this.expandedIds=qo(new Set),this.libraryApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.entries.set(t),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("workflow-library.loadFailed")));}});}sourceKey(t){return `workflow-library.source.${t}`}appliesToValues(t){let e=t.workflowDefinition.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}stepTypeKey(t){return `step-list.stepType.${t}`}isExpanded(t){return this.expandedIds().has(t)}togglePreview(t){this.expandedIds.update(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a});}previewSteps(t){return Dt(t.workflowDefinition.steps,0)}addToMyWorkflows(t){this.addingId()||(this.addError.set(null),this.addingId.set(t),this.libraryApi.add(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.addingId.set(null),this.modalRef?.close(),this.router.navigate(["/workflows",e.id,"edit"]);},error:e=>{this.addingId.set(null),this.addError.set(this.errorMessage(e,this.transloco.translate("workflow-library.addFailed")));}}));}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-workflow-library-browser"]],decls:7,vars:4,consts:[["data-testid","workflow-library-browser",1,"library"],[1,"lede"],["data-testid","library-loading"],["data-testid","library-load-error",1,"error"],["data-testid","library-add-error",1,"error"],[1,"cards"],[1,"card-head"],[1,"description"],[1,"applies-to"],[1,"card-actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","primary","type","button",3,"click","disabled"],[1,"steps-preview"],[3,"margin-left"],[1,"step-type"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_D(4,Vt,3,3,"p",2)(5,Rt,2,1,"p",3)(6,qt,4,1),Jc()),e&2&&(gI(2),Lh(Fw(3,2,"workflow-library.lede")),gI(2),MD(a.loading()?4:a.loadError()?5:6));},dependencies:[$8,pf,bd,sp,fp,Nt,Ke,W,I,Kt$1],styles:[".library[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.lede[_ngcontent-%COMP%]{margin:0;color:#57534e}.cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.card-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}.card-head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600}.description[_ngcontent-%COMP%]{margin:.5rem 0 0;color:#57534e}.applies-to[_ngcontent-%COMP%]{margin-top:.5rem}.card-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.steps-preview[_ngcontent-%COMP%]{margin:.75rem 0 0;padding-left:1.25rem;color:#44403c}.steps-preview[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;margin:.25rem 0}.step-type[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();function Dt(i,d){let t=[];for(let e of i)t.push({name:e.name,type:e.type,depth:d}),e.type==="loop"&&Array.isArray(e.steps)&&t.push(...Dt(e.steps,d+1));return t}var Gt=i=>({count:i}),Qt=i=>["/workflows",i,"edit"],Xt=(i,d)=>d.id;function Yt(i,d){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.actionError());}}function te(i,d){i&1&&(_i(0,"p",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ee(i,d){if(i&1&&(_i(0,"p",11),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ie(i,d){if(i&1&&(uh(0,"nz-option",14),Pw(1,"transloco")),i&2){let t=d.$implicit,e=HD(2);lh("nzValue",t)("nzLabel",Fw(1,2,e.subjectHandlingFilterKey(t)));}}function ne(i,d){if(i&1&&(_i(0,"p",15),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.deleteError());}}function oe(i,d){if(i&1){let t=FD();_i(0,"section",16)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",18)(5,"button",19),mh("click",function(){Fu(t);let a=HD(2);return ju(a.openLibrary())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",20),Iw(9),Pw(10,"transloco"),Jc()()();}i&2&&(gI(2),Lh(Fw(3,3,"workflows.list.emptyState")),gI(4),rl$1(" ",Fw(7,5,"workflows.list.emptyBrowseLibrary")," "),gI(3),rl$1(" ",Fw(10,7,"workflows.list.emptyCreateButton")," "));}function re(i,d){if(i&1&&(_i(0,"span"),Iw(1),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(t.description);}}function ae(i,d){if(i&1&&(_i(0,"span",22),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(Fw(2,2,"workflows.list.noDescription"));}}function le(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD().$implicit,a=HD(3);ch("data-testid","applies-to-"+e.id),gI(),Lh(Fw(2,2,a.subjectTypeKey(t)));}}function se(i,d){if(i&1){let t=FD();_i(0,"tr")(1,"td")(2,"span"),Iw(3),Jc()(),_i(4,"td",21),_D(5,re,2,2,"span")(6,ae,3,4,"span",22),Jc(),_i(7,"td"),xD(8,le,3,4,"nz-tag",null,ND),Jc(),_i(10,"td")(11,"nz-tag"),Iw(12),Pw(13,"transloco"),Jc()(),_i(14,"td")(15,"span"),Iw(16),Pw(17,"transloco"),Jc()(),_i(18,"td",23)(19,"a",24),Iw(20),Pw(21,"transloco"),Jc(),_i(22,"button",25),mh("click",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.exportWorkflow(a))}),Iw(23),Pw(24,"transloco"),Jc(),_i(25,"button",26),Pw(26,"transloco"),Pw(27,"transloco"),Pw(28,"transloco"),mh("nzOnConfirm",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.deleteWorkflow(a.id))}),Iw(29),Pw(30,"transloco"),Jc()()();}if(i&2){let t=d.$implicit,e=HD(3);ch("data-testid","workflow-"+t.id),gI(2),ch("data-testid","name-"+t.id),gI(),Lh(t.name),gI(2),MD(t.description?.trim()?5:6),gI(3),AD(e.appliesToValues(t)),gI(3),ch("data-testid","subject-handling-"+t.id),gI(),Lh(Fw(13,18,e.subjectHandlingKey(t.subjectHandling))),gI(3),ch("data-testid","step-count-"+t.id),gI(),Lh(jw(17,20,"workflows.list.stepCount",Aw(35,Gt,t.steps.length))),gI(3),lh("routerLink",Aw(37,Qt,t.id)),ch("data-testid","edit-"+t.id),gI(),rl$1(" ",Fw(21,23,"workflows.list.edit")," "),gI(2),ch("data-testid","export-"+t.id),gI(),rl$1(" ",Fw(24,25,"workflows.list.export")," "),gI(2),lh("nzPopconfirmTitle",Fw(26,27,"workflows.list.deleteConfirm"))("nzOkText",Fw(27,29,"workflows.list.delete"))("nzCancelText",Fw(28,31,"common.cancel")),ch("data-testid","delete-"+t.id),gI(4),rl$1(" ",Fw(30,33,"workflows.list.delete")," ");}}function pe(i,d){if(i&1&&(_i(0,"nz-table",17)(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,"th"),Iw(19),Pw(20,"transloco"),Jc()()(),_i(21,"tbody"),xD(22,se,31,39,"tr",null,Xt),Jc()()),i&2){let t=HD(2);lh("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,9,"workflows.list.column.name")),gI(3),Lh(Fw(8,11,"workflows.list.column.description")),gI(3),Lh(Fw(11,13,"workflow-editor.appliesTo")),gI(3),Lh(Fw(14,15,"workflow-editor.subjectHandling.label")),gI(3),Lh(Fw(17,17,"workflows.list.column.steps")),gI(3),Lh(Fw(20,19,"workflows.list.column.actions")),gI(3),AD(t.workflows());}}function de(i,d){if(i&1){let t=FD();_i(0,"div",12)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nz-select",13),mh("ngModelChange",function(a){Fu(t);let f=HD();return ju(f.setSubjectHandlingFilter(a))}),xD(5,ie,2,4,"nz-option",14,ND),Jc(),iE(),Jc(),_D(7,ne,2,1,"p",15),_D(8,oe,11,9,"section",16)(9,pe,24,21,"nz-table",17);}if(i&2){let t=HD();gI(2),Lh(Fw(3,4,"workflows.list.filterBySubjectHandling")),gI(2),lh("ngModel",t.subjectHandlingFilter()),aE(),gI(),AD(t.subjectHandlingOptions),gI(2),MD(t.deleteError()?7:-1),gI(),MD(t.workflows().length===0?8:9);}}var si=(()=>{class i{constructor(){this.workflowsApi=C(b),this.transloco=C(Ve),this.destroyRef=C(at),this.modal=C(jn),this.router=C(J1),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.actionError=qo(null),this.importing=qo(false),this.subjectHandlingFilter=qo("all"),this.subjectHandlingOptions=["all","per-subject","collection"],this.load();}setSubjectHandlingFilter(t){this.subjectHandlingFilter.set(t),this.load();}appliesToValues(t){let e=t.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}subjectHandlingKey(t){return `workflow-editor.subjectHandling.${t}`}subjectHandlingFilterKey(t){return t==="all"?"workflows.list.filterAll":`workflow-editor.subjectHandling.${t}`}deleteWorkflow(t){this.deleteError.set(null),this.workflowsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.workflows.update(e=>e.filter(a=>a.id!==t));},error:e=>{this.deleteError.set(this.errorMessage(e,this.transloco.translate("workflows.list.deleteFailed")));}});}openLibrary(){this.modal.create({nzTitle:this.transloco.translate("workflow-library.title"),nzContent:jt,nzFooter:null,nzWidth:720});}exportWorkflow(t){this.actionError.set(null),this.workflowsApi.exportDefinition(t.id).pipe(ue(this.destroyRef)).subscribe({next:e=>{l(`${ng(e.name)}.json`,JSON.stringify(e,null,2),"application/json");},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("workflows.list.exportFailed")));}});}downloadInstructions(){this.actionError.set(null),this.workflowsApi.getInstructions().pipe(ue(this.destroyRef)).subscribe({next:t=>{l("knoflows-workflow-agent-instructions.md",t,"text/markdown;charset=utf-8");},error:t=>{this.actionError.set(this.errorMessage(t,this.transloco.translate("workflows.list.instructionsFailed")));}});}onImportFile(t){let e=t.target,a=e.files?.[0];e.value="",!(!a||this.importing())&&this.readAndImport(a);}importJsonText(t){this.actionError.set(null);let e;try{e=JSON.parse(t);}catch(f){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));return}let a=i_.safeParse(e);if(!a.success){let f=T(a.error);this.actionError.set(`${this.transloco.translate("workflows.list.importInvalidSchema")}: ${f[0]??""}`);return}this.postImport(e);}readAndImport(t){return v(this,null,function*(){try{this.importJsonText(yield t.text());}catch(e){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));}})}postImport(t,e){this.importing.set(true),this.actionError.set(null),this.workflowsApi.importDefinition(e?{workflowDefinition:t,resolution:e}:{workflowDefinition:t}).pipe(ue(this.destroyRef)).subscribe({next:a=>{this.importing.set(false),this.router.navigate(["/workflows",a.id,"edit"]);},error:a=>{this.importing.set(false);let f=this.importConflict(a);if(f&&!e){this.openImportConflict(t,f.name);return}this.actionError.set(this.errorMessage(a,this.transloco.translate("workflows.list.importFailed")));}});}openImportConflict(t,e){(this.modal.create({nzTitle:this.transloco.translate("workflows.import.conflictTitle"),nzContent:Lt,nzData:{name:e},nzFooter:null}).afterClose??Dg(void 0)).pipe(ue(this.destroyRef)).subscribe(T=>{(T==="update"||T==="create_new")&&this.postImport(t,T);});}importConflict(t){if(!(t instanceof bi)||t.httpStatus!==409||!t.details)return null;let e=t.details.conflictingWorkflowId,a=t.details.conflictingWorkflowName;return typeof e!="string"||typeof a!="string"?null:{id:e,name:a}}load(){let t=this.subjectHandlingFilter();this.loading.set(true),this.loadError.set(null),this.workflowsApi.list(t==="all"?void 0:{subjectHandling:t}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("workflows.list.loadFailed")));}});}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-workflow-list"]],decls:24,vars:18,consts:[["importFileInput",""],["data-testid","workflows-list",1,"list-page"],[1,"header"],[1,"header-actions"],["type","file","accept","application/json,.json","hidden","","data-testid","import-file",3,"change"],["nz-button","","type","button","data-testid","import-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","download-instructions",3,"click"],["nz-button","","type","button","data-testid","browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","action-error",1,"error"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"field"],["data-testid","subject-handling-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","workflow-items",3,"nzData","nzFrontPagination","nzShowPagination"],[1,"empty-actions"],["nz-button","","type","button","data-testid","empty-browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","empty-create"],[1,"description-cell"],[1,"muted"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(e,a){if(e&1){let f=FD();_i(0,"main",1)(1,"header",2)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",3)(6,"input",4,0),mh("change",function(U){return a.onImportFile(U)}),Jc(),_i(8,"button",5),mh("click",function(){Fu(f);let U=QD(7);return ju(U.click())}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",6),mh("click",function(){return a.downloadInstructions()}),Iw(12),Pw(13,"transloco"),Jc(),_i(14,"button",7),mh("click",function(){return a.openLibrary()}),Iw(15),Pw(16,"transloco"),Jc(),_i(17,"a",8),Iw(18),Pw(19,"transloco"),Jc()()(),_D(20,Yt,2,1,"p",9),_D(21,te,3,3,"p",10)(22,ee,2,1,"p",11)(23,de,10,6),Jc();}e&2&&(gI(3),Lh(Fw(4,8,"workflows.list.title")),gI(5),lh("disabled",a.importing()),gI(),rl$1(" ",Fw(10,10,"workflows.list.import")," "),gI(3),rl$1(" ",Fw(13,12,"workflows.list.downloadInstructions")," "),gI(3),rl$1(" ",Fw(16,14,"workflows.list.browseLibrary")," "),gI(3),rl$1(" ",Fw(19,16,"workflows.list.createButton")," "),gI(2),MD(a.actionError()?20:-1),gI(),MD(a.loading()?21:a.loadError()?22:23));},dependencies:[$8,al,rl,$i,v3,pf,bd,sp,fp,ts,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;flex-shrink:0;justify-content:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;max-width:16rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.muted[_ngcontent-%COMP%]{color:#a8a29e;font-style:italic}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.empty-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.description-cell{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;text-overflow:unset;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{si as WorkflowListComponent,si as WorkflowsManageComponent};
|
|
1
|
+
import {l}from'./chunk-D19C8Gcb.js';import {T}from'./chunk-SiaN7xSQ.js';import {_ as _n,C as Cn}from'./chunk-vINo5yVD.js';import {C,V as Ve,b as at,b0 as jn,R as J1,q as qo,u as ue,aS as v,aY as Dg,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,h as ex,F as Fm,A as Am,K as Kt$1,G as FD,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,w as lh,z as rl$1,M as MD,b2 as Le,b3 as Wn,az as jw,E as Aw,H as HD,x as xD,N as ND,k as iE,y as aE,B as AD,b4 as N2,aV as ix,b5 as cx,i as ie$1,n as uh,D as ch,aO as SD,aP as Mh,O as Fu,Q as ju,aH as QD}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {N as Nt,K as Ke}from'./chunk-C7P7hUiX.js';import {W,I}from'./chunk-Bok52e_k.js';import {i as ig,c as c_}from'./chunk-8ezEUcxN.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';var Ot=i=>({name:i}),Lt=(()=>{class i{constructor(){this.modalRef=C(Le),this.data=C(Wn);}cancel(){this.modalRef.close(void 0);}choose(t){this.modalRef.close(t);}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-import-conflict"]],decls:14,vars:15,consts:[["data-testid","import-conflict-dialog"],["data-testid","import-conflict-message"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","import-conflict-cancel",3,"click"],["nz-button","","type","button","data-testid","import-conflict-create-new",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","import-conflict-update",3,"click"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"button",3),mh("click",function(){return a.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",4),mh("click",function(){return a.choose("create_new")}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",5),mh("click",function(){return a.choose("update")}),Iw(12),Pw(13,"transloco"),Jc()()()),e&2&&(gI(2),rl$1(" ",jw(3,4,"workflows.import.conflictBody",Aw(13,Ot,a.data.name))," "),gI(4),rl$1(" ",Fw(7,7,"common.cancel")," "),gI(3),rl$1(" ",Fw(10,9,"workflows.import.createNew")," "),gI(3),rl$1(" ",Fw(13,11,"workflows.import.update")," "));},dependencies:[pf,bd,sp,fp,Kt$1],styles:["p[_ngcontent-%COMP%]{margin:0 0 1.25rem;color:#44403c}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}"]});}}return i})();var Pt=(()=>{class i{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflow-library`;}list(){return this.http.get(this.baseUrl).pipe(cx())}add(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/add`,{}).pipe(cx())}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275prov=ie$1({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();var At=(i,d)=>d.id;function Vt(i,d){i&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Rt(i,d){if(i&1&&(_i(0,"p",3),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function Ht(i,d){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.addError());}}function Kt(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD(3);gI(),Lh(Fw(2,1,e.subjectTypeKey(t)));}}function Ut(i,d){if(i&1&&(_i(0,"li")(1,"span"),Iw(2),Jc(),_i(3,"span",14),Iw(4),Pw(5,"transloco"),Jc()()),i&2){let t=d.$implicit,e=HD(4);Mh("margin-left",t.depth,"rem"),gI(2),Lh(t.name),gI(2),Lh(Fw(5,4,e.stepTypeKey(t.type)));}}function Jt(i,d){if(i&1&&(_i(0,"ol",12),xD(1,Ut,6,6,"li",13,SD),Jc()),i&2){let t=HD().$implicit,e=HD(2);ch("data-testid","library-steps-"+t.id),gI(),AD(e.previewSteps(t));}}function Zt(i,d){if(i&1){let t=FD();_i(0,"nz-card")(1,"div",6)(2,"h2"),Iw(3),Jc(),_i(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"p",7),Iw(8),Jc(),_i(9,"div",8),xD(10,Kt,3,3,"nz-tag",null,ND),Jc(),_i(12,"div",9)(13,"button",10),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.togglePreview(a.id))}),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",11),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.addToMyWorkflows(a.id))}),Iw(17),Pw(18,"transloco"),Jc()(),_D(19,Jt,3,1,"ol",12),Jc();}if(i&2){let t=d.$implicit,e=HD(2);ch("data-testid","library-entry-"+t.id),gI(2),ch("data-testid","library-name-"+t.id),gI(),Lh(t.name),gI(),ch("data-testid","library-source-"+t.id),gI(),Lh(Fw(6,13,e.sourceKey(t.source))),gI(2),ch("data-testid","library-description-"+t.id),gI(),rl$1(" ",t.description," "),gI(2),AD(e.appliesToValues(t)),gI(3),ch("data-testid","library-preview-"+t.id),gI(),rl$1(" ",Fw(15,15,e.isExpanded(t.id)?"workflow-library.hideSteps":"workflow-library.previewSteps")," "),gI(2),lh("disabled",e.addingId()!==null),ch("data-testid","library-add-"+t.id),gI(),rl$1(" ",Fw(18,17,e.addingId()===t.id?"workflow-library.adding":"workflow-library.add")," "),gI(2),MD(e.isExpanded(t.id)?19:-1);}}function qt(i,d){if(i&1&&(_D(0,Ht,2,1,"p",4),_i(1,"div",5),xD(2,Zt,20,19,"nz-card",null,At),Jc()),i&2){let t=HD();MD(t.addError()?0:-1),gI(2),AD(t.entries());}}var jt=(()=>{class i{constructor(){this.libraryApi=C(Pt),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.modalRef=C(Le,{optional:true}),this.entries=qo([]),this.loading=qo(true),this.loadError=qo(null),this.addError=qo(null),this.addingId=qo(null),this.expandedIds=qo(new Set),this.libraryApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.entries.set(t),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("workflow-library.loadFailed")));}});}sourceKey(t){return `workflow-library.source.${t}`}appliesToValues(t){let e=t.workflowDefinition.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}stepTypeKey(t){return `step-list.stepType.${t}`}isExpanded(t){return this.expandedIds().has(t)}togglePreview(t){this.expandedIds.update(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a});}previewSteps(t){return Dt(t.workflowDefinition.steps,0)}addToMyWorkflows(t){this.addingId()||(this.addError.set(null),this.addingId.set(t),this.libraryApi.add(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.addingId.set(null),this.modalRef?.close(),this.router.navigate(["/workflows",e.id,"edit"]);},error:e=>{this.addingId.set(null),this.addError.set(this.errorMessage(e,this.transloco.translate("workflow-library.addFailed")));}}));}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-workflow-library-browser"]],decls:7,vars:4,consts:[["data-testid","workflow-library-browser",1,"library"],[1,"lede"],["data-testid","library-loading"],["data-testid","library-load-error",1,"error"],["data-testid","library-add-error",1,"error"],[1,"cards"],[1,"card-head"],[1,"description"],[1,"applies-to"],[1,"card-actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","primary","type","button",3,"click","disabled"],[1,"steps-preview"],[3,"margin-left"],[1,"step-type"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_D(4,Vt,3,3,"p",2)(5,Rt,2,1,"p",3)(6,qt,4,1),Jc()),e&2&&(gI(2),Lh(Fw(3,2,"workflow-library.lede")),gI(2),MD(a.loading()?4:a.loadError()?5:6));},dependencies:[$8,pf,bd,sp,fp,Nt,Ke,W,I,Kt$1],styles:[".library[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.lede[_ngcontent-%COMP%]{margin:0;color:#57534e}.cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.card-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}.card-head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600}.description[_ngcontent-%COMP%]{margin:.5rem 0 0;color:#57534e}.applies-to[_ngcontent-%COMP%]{margin-top:.5rem}.card-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.steps-preview[_ngcontent-%COMP%]{margin:.75rem 0 0;padding-left:1.25rem;color:#44403c}.steps-preview[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;margin:.25rem 0}.step-type[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();function Dt(i,d){let t=[];for(let e of i)t.push({name:e.name,type:e.type,depth:d}),e.type==="loop"&&Array.isArray(e.steps)&&t.push(...Dt(e.steps,d+1));return t}var Gt=i=>({count:i}),Qt=i=>["/workflows",i,"edit"],Xt=(i,d)=>d.id;function Yt(i,d){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.actionError());}}function te(i,d){i&1&&(_i(0,"p",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ee(i,d){if(i&1&&(_i(0,"p",11),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ie(i,d){if(i&1&&(uh(0,"nz-option",14),Pw(1,"transloco")),i&2){let t=d.$implicit,e=HD(2);lh("nzValue",t)("nzLabel",Fw(1,2,e.subjectHandlingFilterKey(t)));}}function ne(i,d){if(i&1&&(_i(0,"p",15),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.deleteError());}}function oe(i,d){if(i&1){let t=FD();_i(0,"section",16)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",18)(5,"button",19),mh("click",function(){Fu(t);let a=HD(2);return ju(a.openLibrary())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",20),Iw(9),Pw(10,"transloco"),Jc()()();}i&2&&(gI(2),Lh(Fw(3,3,"workflows.list.emptyState")),gI(4),rl$1(" ",Fw(7,5,"workflows.list.emptyBrowseLibrary")," "),gI(3),rl$1(" ",Fw(10,7,"workflows.list.emptyCreateButton")," "));}function re(i,d){if(i&1&&(_i(0,"span"),Iw(1),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(t.description);}}function ae(i,d){if(i&1&&(_i(0,"span",22),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(Fw(2,2,"workflows.list.noDescription"));}}function le(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD().$implicit,a=HD(3);ch("data-testid","applies-to-"+e.id),gI(),Lh(Fw(2,2,a.subjectTypeKey(t)));}}function se(i,d){if(i&1){let t=FD();_i(0,"tr")(1,"td")(2,"span"),Iw(3),Jc()(),_i(4,"td",21),_D(5,re,2,2,"span")(6,ae,3,4,"span",22),Jc(),_i(7,"td"),xD(8,le,3,4,"nz-tag",null,ND),Jc(),_i(10,"td")(11,"nz-tag"),Iw(12),Pw(13,"transloco"),Jc()(),_i(14,"td")(15,"span"),Iw(16),Pw(17,"transloco"),Jc()(),_i(18,"td",23)(19,"a",24),Iw(20),Pw(21,"transloco"),Jc(),_i(22,"button",25),mh("click",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.exportWorkflow(a))}),Iw(23),Pw(24,"transloco"),Jc(),_i(25,"button",26),Pw(26,"transloco"),Pw(27,"transloco"),Pw(28,"transloco"),mh("nzOnConfirm",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.deleteWorkflow(a.id))}),Iw(29),Pw(30,"transloco"),Jc()()();}if(i&2){let t=d.$implicit,e=HD(3);ch("data-testid","workflow-"+t.id),gI(2),ch("data-testid","name-"+t.id),gI(),Lh(t.name),gI(2),MD(t.description?.trim()?5:6),gI(3),AD(e.appliesToValues(t)),gI(3),ch("data-testid","subject-handling-"+t.id),gI(),Lh(Fw(13,18,e.subjectHandlingKey(t.subjectHandling))),gI(3),ch("data-testid","step-count-"+t.id),gI(),Lh(jw(17,20,"workflows.list.stepCount",Aw(35,Gt,t.steps.length))),gI(3),lh("routerLink",Aw(37,Qt,t.id)),ch("data-testid","edit-"+t.id),gI(),rl$1(" ",Fw(21,23,"workflows.list.edit")," "),gI(2),ch("data-testid","export-"+t.id),gI(),rl$1(" ",Fw(24,25,"workflows.list.export")," "),gI(2),lh("nzPopconfirmTitle",Fw(26,27,"workflows.list.deleteConfirm"))("nzOkText",Fw(27,29,"workflows.list.delete"))("nzCancelText",Fw(28,31,"common.cancel")),ch("data-testid","delete-"+t.id),gI(4),rl$1(" ",Fw(30,33,"workflows.list.delete")," ");}}function pe(i,d){if(i&1&&(_i(0,"nz-table",17)(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,"th"),Iw(19),Pw(20,"transloco"),Jc()()(),_i(21,"tbody"),xD(22,se,31,39,"tr",null,Xt),Jc()()),i&2){let t=HD(2);lh("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,9,"workflows.list.column.name")),gI(3),Lh(Fw(8,11,"workflows.list.column.description")),gI(3),Lh(Fw(11,13,"workflow-editor.appliesTo")),gI(3),Lh(Fw(14,15,"workflow-editor.subjectHandling.label")),gI(3),Lh(Fw(17,17,"workflows.list.column.steps")),gI(3),Lh(Fw(20,19,"workflows.list.column.actions")),gI(3),AD(t.workflows());}}function de(i,d){if(i&1){let t=FD();_i(0,"div",12)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nz-select",13),mh("ngModelChange",function(a){Fu(t);let f=HD();return ju(f.setSubjectHandlingFilter(a))}),xD(5,ie,2,4,"nz-option",14,ND),Jc(),iE(),Jc(),_D(7,ne,2,1,"p",15),_D(8,oe,11,9,"section",16)(9,pe,24,21,"nz-table",17);}if(i&2){let t=HD();gI(2),Lh(Fw(3,4,"workflows.list.filterBySubjectHandling")),gI(2),lh("ngModel",t.subjectHandlingFilter()),aE(),gI(),AD(t.subjectHandlingOptions),gI(2),MD(t.deleteError()?7:-1),gI(),MD(t.workflows().length===0?8:9);}}var si=(()=>{class i{constructor(){this.workflowsApi=C(b),this.transloco=C(Ve),this.destroyRef=C(at),this.modal=C(jn),this.router=C(J1),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.actionError=qo(null),this.importing=qo(false),this.subjectHandlingFilter=qo("all"),this.subjectHandlingOptions=["all","per-subject","collection"],this.load();}setSubjectHandlingFilter(t){this.subjectHandlingFilter.set(t),this.load();}appliesToValues(t){let e=t.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}subjectHandlingKey(t){return `workflow-editor.subjectHandling.${t}`}subjectHandlingFilterKey(t){return t==="all"?"workflows.list.filterAll":`workflow-editor.subjectHandling.${t}`}deleteWorkflow(t){this.deleteError.set(null),this.workflowsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.workflows.update(e=>e.filter(a=>a.id!==t));},error:e=>{this.deleteError.set(this.errorMessage(e,this.transloco.translate("workflows.list.deleteFailed")));}});}openLibrary(){this.modal.create({nzTitle:this.transloco.translate("workflow-library.title"),nzContent:jt,nzFooter:null,nzWidth:720});}exportWorkflow(t){this.actionError.set(null),this.workflowsApi.exportDefinition(t.id).pipe(ue(this.destroyRef)).subscribe({next:e=>{l(`${ig(e.name)}.json`,JSON.stringify(e,null,2),"application/json");},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("workflows.list.exportFailed")));}});}downloadInstructions(){this.actionError.set(null),this.workflowsApi.getInstructions().pipe(ue(this.destroyRef)).subscribe({next:t=>{l("knoflows-workflow-agent-instructions.md",t,"text/markdown;charset=utf-8");},error:t=>{this.actionError.set(this.errorMessage(t,this.transloco.translate("workflows.list.instructionsFailed")));}});}onImportFile(t){let e=t.target,a=e.files?.[0];e.value="",!(!a||this.importing())&&this.readAndImport(a);}importJsonText(t){this.actionError.set(null);let e;try{e=JSON.parse(t);}catch(f){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));return}let a=c_.safeParse(e);if(!a.success){let f=T(a.error);this.actionError.set(`${this.transloco.translate("workflows.list.importInvalidSchema")}: ${f[0]??""}`);return}this.postImport(e);}readAndImport(t){return v(this,null,function*(){try{this.importJsonText(yield t.text());}catch(e){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));}})}postImport(t,e){this.importing.set(true),this.actionError.set(null),this.workflowsApi.importDefinition(e?{workflowDefinition:t,resolution:e}:{workflowDefinition:t}).pipe(ue(this.destroyRef)).subscribe({next:a=>{this.importing.set(false),this.router.navigate(["/workflows",a.id,"edit"]);},error:a=>{this.importing.set(false);let f=this.importConflict(a);if(f&&!e){this.openImportConflict(t,f.name);return}this.actionError.set(this.errorMessage(a,this.transloco.translate("workflows.list.importFailed")));}});}openImportConflict(t,e){(this.modal.create({nzTitle:this.transloco.translate("workflows.import.conflictTitle"),nzContent:Lt,nzData:{name:e},nzFooter:null}).afterClose??Dg(void 0)).pipe(ue(this.destroyRef)).subscribe(T=>{(T==="update"||T==="create_new")&&this.postImport(t,T);});}importConflict(t){if(!(t instanceof bi)||t.httpStatus!==409||!t.details)return null;let e=t.details.conflictingWorkflowId,a=t.details.conflictingWorkflowName;return typeof e!="string"||typeof a!="string"?null:{id:e,name:a}}load(){let t=this.subjectHandlingFilter();this.loading.set(true),this.loadError.set(null),this.workflowsApi.list(t==="all"?void 0:{subjectHandling:t}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("workflows.list.loadFailed")));}});}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-workflow-list"]],decls:24,vars:18,consts:[["importFileInput",""],["data-testid","workflows-list",1,"list-page"],[1,"header"],[1,"header-actions"],["type","file","accept","application/json,.json","hidden","","data-testid","import-file",3,"change"],["nz-button","","type","button","data-testid","import-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","download-instructions",3,"click"],["nz-button","","type","button","data-testid","browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","action-error",1,"error"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"field"],["data-testid","subject-handling-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","workflow-items",3,"nzData","nzFrontPagination","nzShowPagination"],[1,"empty-actions"],["nz-button","","type","button","data-testid","empty-browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","empty-create"],[1,"description-cell"],[1,"muted"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(e,a){if(e&1){let f=FD();_i(0,"main",1)(1,"header",2)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",3)(6,"input",4,0),mh("change",function(U){return a.onImportFile(U)}),Jc(),_i(8,"button",5),mh("click",function(){Fu(f);let U=QD(7);return ju(U.click())}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",6),mh("click",function(){return a.downloadInstructions()}),Iw(12),Pw(13,"transloco"),Jc(),_i(14,"button",7),mh("click",function(){return a.openLibrary()}),Iw(15),Pw(16,"transloco"),Jc(),_i(17,"a",8),Iw(18),Pw(19,"transloco"),Jc()()(),_D(20,Yt,2,1,"p",9),_D(21,te,3,3,"p",10)(22,ee,2,1,"p",11)(23,de,10,6),Jc();}e&2&&(gI(3),Lh(Fw(4,8,"workflows.list.title")),gI(5),lh("disabled",a.importing()),gI(),rl$1(" ",Fw(10,10,"workflows.list.import")," "),gI(3),rl$1(" ",Fw(13,12,"workflows.list.downloadInstructions")," "),gI(3),rl$1(" ",Fw(16,14,"workflows.list.browseLibrary")," "),gI(3),rl$1(" ",Fw(19,16,"workflows.list.createButton")," "),gI(2),MD(a.actionError()?20:-1),gI(),MD(a.loading()?21:a.loadError()?22:23));},dependencies:[$8,al,rl,$i,v3,pf,bd,sp,fp,ts,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;flex-shrink:0;justify-content:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;max-width:16rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.muted[_ngcontent-%COMP%]{color:#a8a29e;font-style:italic}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.empty-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.description-cell{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;text-overflow:unset;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{si as WorkflowListComponent,si as WorkflowsManageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f}from'./chunk-
|
|
1
|
+
import {f}from'./chunk-BIJScqTM.js';import {C,b as at,a5 as q0,a6 as U0,q as qo,u as ue,s,r as r$1,Z as ZE,d as $8,K as Kt,bm as Xc,x as xD,bn as el,o as gI,B as AD,I as Iw,l as _D,z as rl,M as MD,G as FD,bL as yh,O as Fu,H as HD,Q as ju,c_ as hh,D as ch,N as ND,aR as xw,P as Pw,L as Lh,p as Fw}from'./main-3VZRFHGG.js';var q=()=>[],A=(t,o)=>o.name,B=(t,o)=>o.id;function j(t,o){t&1&&(Xc(0,"span",1),Iw(1,"*"),el());}function z(t,o){if(t&1){let e=FD();Xc(0,"input",6),yh("change",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),el();}if(t&2){let e=HD().$implicit,n=HD();hh("checked",n.checked(e)),ch("data-testid","input-"+e.name);}}function U(t,o){if(t&1){let e=FD();Xc(0,"input",7),yh("input",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name);}}function G(t,o){if(t&1&&(Xc(0,"option",4),Iw(1),el()),t&2){let e=o.$implicit;hh("value",e),gI(),Lh(e);}}function H(t,o){if(t&1){let e=FD();Xc(0,"select",8),yh("change",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),xD(1,G,2,2,"option",4,ND),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name),gI(),AD(e.options??xw(2,q));}}function J(t,o){if(t&1&&(Xc(0,"option",4),Iw(1),el()),t&2){let e=o.$implicit;hh("value",e.id),gI(),Lh(e.name);}}function K(t,o){if(t&1){let e=FD();Xc(0,"select",8),yh("change",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),Xc(1,"option",9),Iw(2),Pw(3,"transloco"),el(),xD(4,J,2,2,"option",4,B),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name),gI(2),Lh(Fw(3,3,"workflow-input.localRepositoryPlaceholder")),gI(2),AD(n.localRepositories());}}function Q(t,o){if(t&1){let e=FD();Xc(0,"input",10),yh("input",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name);}}function X(t,o){if(t&1&&(Xc(0,"label"),Iw(1),_D(2,j,2,0,"span",1),_D(3,z,1,2,"input",2)(4,U,1,2,"input",3)(5,H,3,3,"select",4)(6,K,6,5,"select",4)(7,Q,1,2,"input",5),el()),t&2){let e,n=o.$implicit;gI(),rl(" ",n.label," "),gI(),MD(n.required?2:-1),gI(),MD((e=n.type)==="boolean"?3:e==="number"?4:e==="select"?5:e==="localRepository"?6:7);}}function Y(t){if(t.defaultValue!==void 0)return t.defaultValue;switch(t.type){case "boolean":return false;case "number":return "";case "select":return t.options?.[0]??"";default:return ""}}function ae(t){let o={};for(let e of t)o[e.name]=Y(e);return o}var le=(()=>{class t{constructor(){this.reposApi=C(f),this.destroyRef=C(at),this.fields=q0([]),this.values=q0({}),this.valuesChange=U0(),this.localRepositories=qo([]),this.reposApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.localRepositories.set(e),error:()=>this.localRepositories.set([])});}displayValue(e){let n=this.values()[e.name];return n==null?"":String(n)}checked(e){return !!this.values()[e.name]}setValue(e,n){let r=n.target,a=r.value;e.type==="boolean"?a=r.checked:e.type==="number"&&(a=r.value===""?"":Number(r.value)),this.valuesChange.emit(s(r$1({},this.values()),{[e.name]:a}));}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-workflow-input-form"]],inputs:{fields:[1,"fields"],values:[1,"values"]},outputs:{valuesChange:"valuesChange"},decls:3,vars:0,consts:[["data-testid","workflow-input-form",1,"input-form"],[1,"required"],["type","checkbox",3,"checked"],["type","number",3,"value"],[3,"value"],["type","text",3,"value"],["type","checkbox",3,"change","checked"],["type","number",3,"input","value"],[3,"change","value"],["value",""],["type","text",3,"input","value"]],template:function(n,r){n&1&&(Xc(0,"div",0),xD(1,X,8,3,"label",null,A),el()),n&2&&(gI(),AD(r.fields()));},dependencies:[$8,Kt],styles:["label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}input[type=checkbox][_ngcontent-%COMP%]{width:1.1rem;height:1.1rem}.required[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{ae as a,le as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {e as h_,f as U_,P as P_,b as bg,g as e_,j as j_}from'./chunk-8ezEUcxN.js';import {C,b4 as N2,aV as ix,b5 as cx,i as ie,s,r as r$1}from'./main-3VZRFHGG.js';var w=(()=>{class e{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/providers`;}listQueryTemplates(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/query-templates`).pipe(cx())}listExtendedActions(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/actions`).pipe(cx())}resolveQueryTemplate(t,i,s){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/query-templates/${encodeURIComponent(i)}/resolve`,{params:s}).pipe(cx())}previewModels(t){return this.http.post(`${this.baseUrl}/preview-models`,t).pipe(cx())}testConnection(t){return this.http.post(`${this.baseUrl}/test-connection`,t).pipe(cx())}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();var d=[{id:"jira",labelKey:"settings.typeOption.jira",kind:"subject",type:"jira",subjectType:"ticket"},{id:"bitbucket",labelKey:"settings.typeOption.bitbucket",kind:"subject",type:"bitbucket",subjectType:"pull_request"},{id:"github",labelKey:"settings.typeOption.github",kind:"subject",type:"github",subjectType:"ticket"},{id:"confluence",labelKey:"settings.typeOption.confluence",kind:"subject",type:"confluence",subjectType:"documentation"},{id:"manual-ticket",labelKey:"settings.typeOption.manualTicket",kind:"subject",type:"manual",subjectType:"ticket"},{id:"manual-documentation",labelKey:"settings.typeOption.manualDocumentation",kind:"subject",type:"manual",subjectType:"documentation"},{id:"claude",labelKey:"settings.typeOption.claude",kind:"agent",type:"claude"},{id:"cursor",labelKey:"settings.typeOption.cursor",kind:"agent",type:"cursor"}],F=["ticket","pull_request","documentation"];function f(e){return d.find(n=>n.id===e)??d[0]}function T(e){return d.find(t=>t.kind!==e.kind||t.type!==e.type?false:t.kind==="agent"?true:j_(e)&&t.subjectType===e.subjectType)?.id??e.type}function N(e){let n=T(e);return f(n).labelKey}function K(e){return e==="jira"?[{key:"baseUrl",labelKey:"settings.jira.baseUrl"},{key:"email",labelKey:"settings.jira.email"}]:e==="bitbucket"?[{key:"email",labelKey:"settings.bitbucket.email"},{key:"workspace",labelKey:"settings.bitbucket.workspace"}]:e==="github"?[{key:"username",labelKey:"settings.github.username"}]:e==="confluence"?[{key:"baseUrl",labelKey:"settings.confluence.baseUrl"},{key:"email",labelKey:"settings.confluence.email"}]:[]}function P(){let e=d[0];return {originalId:null,id:"",idAutoSync:true,optionId:e.id,kind:e.kind,type:e.type,subjectType:e.subjectType??null,displayName:"",config:{},secretKey:U_("instance",e.kind),secretValue:"",expiresOn:"",knownRepoSlugs:[],defaultAgent:false,maxConcurrent:h_}}function _(e,n=false){let t={};for(let o of K(e.type)){let r=e.config[o.key];typeof r=="string"&&(t[o.key]=r);}if(P_(e)){let o=e.config.model;typeof o=="string"&&o.trim()&&(t.model=o.trim());}let i=T(e),s=f(i);return {originalId:e.id,id:e.id,idAutoSync:false,optionId:i,kind:s.kind,type:s.type,subjectType:s.subjectType??null,displayName:e.displayName,config:t,secretKey:e.secretKey,secretValue:"",expiresOn:e.expiresOn??"",knownRepoSlugs:e.type==="bitbucket"?bg(e.config):[],defaultAgent:s.kind==="agent"?n:false,maxConcurrent:P_(e)?e.maxConcurrent??h_:h_}}function q(e,n){let t=f(n);return s(r$1({},e),{optionId:t.id,kind:t.kind,type:t.type,subjectType:t.subjectType??null,config:{},secretKey:U_(e.id||"instance",t.kind),knownRepoSlugs:[],defaultAgent:t.kind==="agent"?e.defaultAgent:false,maxConcurrent:t.kind==="agent"?e.maxConcurrent||h_:e.maxConcurrent})}function D(e,n,t){if(!e.idAutoSync)return s(r$1({},e),{displayName:n});let i=n.trim().length>0?e_(n,t):"";return s(r$1({},e),{displayName:n,id:i,secretKey:U_(i||"instance",e.kind)})}function M(e,n){return s(r$1({},e),{id:n,idAutoSync:false,secretKey:U_(n.trim()||"instance",e.kind)})}function V(e){let n={};for(let r of K(e.type)){let g=(e.config[r.key]??"").trim();g&&(n[r.key]=g);}if(e.type==="bitbucket"){let r=bg({knownRepoSlugs:e.knownRepoSlugs});r.length>0&&(n.knownRepoSlugs=r);}let t=e.id.trim(),i=e.displayName.trim()||t,s=e.secretKey.trim()||U_(t,e.kind),o=e.expiresOn.trim()||void 0;if(e.kind==="agent"){let r=(e.config.model??"").trim();return r&&(n.model=r),r$1({id:t,kind:"agent",type:e.type,displayName:i,config:n,secretKey:s,maxConcurrent:Math.max(1,Math.floor(Number(e.maxConcurrent)||h_))},o?{expiresOn:o}:{})}return r$1({id:t,kind:"subject",type:e.type,subjectType:e.subjectType??"ticket",displayName:i,config:n,secretKey:s},o?{expiresOn:o}:{})}function B(e){return e.issues.map(n=>`${n.path.length>0?n.path.map(String).join("."):"(root)"}: ${n.message}`)}function U(e){return (e?.providerInstances??[]).filter(j_)}function L(e,n){return U(e).filter(t=>j_(t)&&n.includes(t.subjectType))}export{B,D,F,K,L,M,N,P,V,_,d,q,w};
|