@knoflows/engine 0.1.1-alpha.0 → 0.1.1-alpha.2
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 +31 -19
- package/dist/migrations/20260923070000_local_repo_default_reviewers/migration.sql +1 -0
- package/dist/migrations/20260923072051_hard_beast/migration.sql +2 -0
- package/dist/migrations/20260923072051_hard_beast/snapshot.json +1408 -0
- package/package.json +4 -4
- package/static/assets/i18n/en.json +23 -0
- package/static/assets/i18n/es.json +23 -0
- package/static/chunk-5P9quDD0.js +1 -0
- package/static/chunk-B1I44qNh.js +1 -0
- package/static/{chunk-BHko4hHm.js → chunk-B67hwr1X.js} +1 -1
- package/static/{chunk-CGHIKxZG.js → chunk-B7mctPQM.js} +1 -1
- package/static/{chunk-EDwdt-Wk.js → chunk-BAPXVTBt.js} +1 -1
- package/static/chunk-BNQus_d_.js +1 -0
- package/static/chunk-Bh5et471.js +1 -0
- package/static/{chunk--EZIkevK.js → chunk-BidviQhN.js} +1 -1
- package/static/chunk-BldTY6RI.js +1 -0
- package/static/chunk-BmEXmF8m.js +1 -0
- package/static/chunk-BqhxU3er.js +1 -0
- package/static/{chunk-Det50scT.js → chunk-Bv65hEw_.js} +1 -1
- package/static/{chunk-Dm_EWkUz.js → chunk-C07s4-rF.js} +1 -1
- package/static/chunk-C5eZIOiF.js +1 -0
- package/static/{chunk-BRAytoQl.js → chunk-C61nx2gP.js} +1 -1
- package/static/{chunk-DbQy6dR8.js → chunk-CI75Yj8J.js} +1 -1
- package/static/chunk-CNip9Ktj.js +1 -0
- package/static/chunk-CP6elnGc.js +1 -0
- package/static/{chunk-YU-Bg77r.js → chunk-Cf14heGp.js} +1 -1
- package/static/chunk-CiB-X52X.js +1 -0
- package/static/chunk-Cj5izLCS.js +1 -0
- package/static/{chunk-BIJScqTM.js → chunk-CxnyhsKe.js} +1 -1
- package/static/chunk-CyvupcYz.js +1 -0
- package/static/{chunk-CoQPYpxp.js → chunk-D1sSb3lO.js} +1 -1
- package/static/{chunk-iIEmH_ui.js → chunk-D5BPM_KC.js} +1 -1
- package/static/{chunk-D-ueyYEC.js → chunk-D9f8Ltay.js} +3 -3
- package/static/{chunk-DdDI9wRc.js → chunk-DBtN2lWe.js} +3 -3
- package/static/chunk-DD_o_6mU.js +1 -0
- package/static/chunk-DRe_kA_l.js +1 -0
- package/static/{chunk-BcDRgzYZ.js → chunk-Dt7AgNFd.js} +1 -1
- package/static/chunk-Dxa2JdVP.js +1 -0
- package/static/{chunk-CtiubhW7.js → chunk-DyGh8J3-.js} +1 -1
- package/static/chunk-IZZsw-Ul.js +1 -0
- package/static/{chunk-vINo5yVD.js → chunk-MciiAFro.js} +1 -1
- package/static/{chunk-CJWR0gwk.js → chunk-RWVebRsq.js} +1 -1
- package/static/chunk-doY5ozP9.js +1 -0
- package/static/{chunk-8ezEUcxN.js → chunk-g20-BKKx.js} +6 -6
- package/static/chunk-lPfYUUfU.js +1 -0
- package/static/chunk-vnmh6IU3.js +1 -0
- package/static/chunk-zWWkMLc1.js +1 -0
- package/static/index.html +1 -1
- package/static/{main-3VZRFHGG.js → main-GFNB573R.js} +1 -1
- package/static/chunk-B17yZLWe.js +0 -1
- package/static/chunk-B8OjWpOp.js +0 -1
- package/static/chunk-BKYaECRn.js +0 -1
- package/static/chunk-BLN4QkSi.js +0 -1
- package/static/chunk-BaLWULJh.js +0 -1
- package/static/chunk-Bok52e_k.js +0 -1
- package/static/chunk-BowAQ7m9.js +0 -1
- package/static/chunk-Bz7bE4tT.js +0 -1
- package/static/chunk-C7P7hUiX.js +0 -1
- package/static/chunk-CAxHAuhV.js +0 -1
- package/static/chunk-CZA-kp5w.js +0 -1
- package/static/chunk-CwEMAptL.js +0 -1
- package/static/chunk-D1355dNd.js +0 -1
- package/static/chunk-D8qyjd0z.js +0 -1
- package/static/chunk-DOAz4S6b.js +0 -1
- package/static/chunk-DoJknvak.js +0 -1
- package/static/chunk-DrncP2Qx.js +0 -1
- package/static/chunk-IjKs-6Cl.js +0 -1
- package/static/chunk-LPXHXTnJ.js +0 -1
- package/static/chunk-SiaN7xSQ.js +0 -1
- package/static/chunk-bSS_wejP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {w,P,d,K,N,_,D,M,q,V,B}from'./chunk-IjKs-6Cl.js';import {H as He}from'./chunk-CwEMAptL.js';import {f}from'./chunk--EZIkevK.js';import {_ as _n,C as Cn}from'./chunk-vINo5yVD.js';import {G as Gn,u as un}from'./chunk-bSS_wejP.js';import {a as ai,z}from'./chunk-Dm_EWkUz.js';import {W,I}from'./chunk-Bok52e_k.js';import {P as P_,I as I_,t as tm}from'./chunk-8ezEUcxN.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';import {C,b as at,V as Ve,q as qo,U as Uw,aW as Ng,u as ue,s,r as r$1,b9 as Nl,ba as Se,aX as es,aY as Dg,c as bi,Z as ZE,d as $8,e as al,bb as er,bc as Jc,f as rl,bd as Nc,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt$1,j as _i,I as Iw,P as Pw,J as Jc$1,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,a7 as KE,a8 as fu,aA as mT,be as E3,bf as _r,aa as oe,a9 as Z0,bg as Ci,aB as yT,ab as Oe,bh as Bt$1,aq as el,bi as cl,a3 as Ah,a4 as Th,as as st,at as Ee,ai as ly,av as K0,n as uh,al as Sh,w as lh,D as ch,bj as Nw,bk as St,bl as wo,ax as Eh,an as WD,ao as GD,H as HD,x as xD,B as AD,G as FD,k as iE,y as aE,aM as Yl,aw as rh,N as ND,aJ as tl,aK as nl,O as Fu,Q as ju}from'./main-3VZRFHGG.js';var wt=["switchElement"];function Tt(n,m){n&1&&uh(0,"nz-icon",3);}function It(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzCheckedChildren);}}function kt(n,m){if(n&1&&rh(0,It,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzCheckedChildren);}}function Nt(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzUnCheckedChildren);}}function Dt(n,m){if(n&1&&rh(0,Nt,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzUnCheckedChildren);}}var Vt="switch",X=(()=>{let n,m=[],e=[];return class q{static{let i=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],mT(null,null,n,{kind:"field",name:"nzSize",static:false,private:false,access:{has:s=>"nzSize"in s,get:s=>s.nzSize,set:(s,S)=>{s.nzSize=S;}},metadata:i},m,e),i&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:i});}_nzModuleName=Vt;nzConfigService=C(E3);el=C(_r).nativeElement;ngZone=C(oe);cdr=C(Z0);focusMonitor=C(Ci);destroyRef=C(at);isChecked=false;onChange=()=>{};onTouched=()=>{};switchElement;nzLoading=false;nzDisabled=false;nzControl=false;nzCheckedChildren=null;nzUnCheckedChildren=null;nzSize=yT(this,m,"default");nzId=(yT(this,e),null);dir=C(Oe).valueSignal;isNzDisableFirstChange=true;size=qo(this.nzSize);formSize=C(Bt$1,{optional:true});finalSize=Uw(()=>this.formSize?.()||this.size());updateValue(i){this.isChecked!==i&&(this.isChecked=i,this.onChange(this.isChecked));}focus(){this.focusMonitor.focusVia(this.switchElement.nativeElement,"keyboard");}blur(){this.switchElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.switchElement.nativeElement);});}ngOnChanges(i){let{nzSize:s}=i;s&&this.size.set(s.currentValue);}ngOnInit(){el(this.el,"click").pipe(ue(this.destroyRef)).subscribe(i=>{i.preventDefault(),!(this.nzControl||this.nzDisabled||this.nzLoading)&&this.ngZone.run(()=>{this.updateValue(!this.isChecked),this.cdr.markForCheck();});}),el(this.switchElement.nativeElement,"keydown").pipe(ue(this.destroyRef)).subscribe(i=>{if(this.nzControl||this.nzDisabled||this.nzLoading)return;let{keyCode:s}=i;s!==37&&s!==39&&s!==32&&s!==13||(i.preventDefault(),this.ngZone.run(()=>{s===37?this.updateValue(false):s===39?this.updateValue(true):(s===32||s===13)&&this.updateValue(!this.isChecked),this.cdr.markForCheck();}));});}ngAfterViewInit(){this.focusMonitor.monitor(this.switchElement.nativeElement,true).pipe(ue(this.destroyRef)).subscribe(i=>{i||Promise.resolve().then(()=>this.onTouched());});}writeValue(i){this.isChecked=i,this.cdr.markForCheck();}registerOnChange(i){this.onChange=i;}registerOnTouched(i){this.onTouched=i;}setDisabledState(i){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||i,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}static \u0275fac=function(s){return new(s||q)};static \u0275cmp=ZE({type:q,selectors:[["nz-switch"]],viewQuery:function(s,S){if(s&1&&Eh(wt,7),s&2){let j;WD(j=GD())&&(S.switchElement=j.first);}},inputs:{nzLoading:[2,"nzLoading","nzLoading",K0],nzDisabled:[2,"nzDisabled","nzDisabled",K0],nzControl:[2,"nzControl","nzControl",K0],nzCheckedChildren:"nzCheckedChildren",nzUnCheckedChildren:"nzUnCheckedChildren",nzSize:"nzSize",nzId:"nzId"},exportAs:["nzSwitch"],features:[Nw([{provide:St,useExisting:wo(()=>q),multi:true}]),ly],decls:8,vars:15,consts:[["switchElement",""],["nz-wave","","type","button",1,"ant-switch",3,"disabled","nzWaveExtraNode"],[1,"ant-switch-handle"],["nzType","loading",1,"ant-switch-loading-icon"],[1,"ant-switch-inner"],[1,"ant-click-animating-node"],[4,"nzStringTemplateOutlet"]],template:function(s,S){s&1&&(_i(0,"button",1,0)(2,"span",2),_D(3,Tt,1,0,"nz-icon",3),Jc$1(),_i(4,"span",4),_D(5,kt,1,1,"ng-container")(6,Dt,1,1,"ng-container"),Jc$1(),uh(7,"div",5),Jc$1()),s&2&&(Sh("ant-switch-checked",S.isChecked)("ant-switch-loading",S.nzLoading)("ant-switch-disabled",S.nzDisabled)("ant-switch-small",S.finalSize()==="small")("ant-switch-rtl",S.dir()==="rtl"),lh("disabled",S.nzDisabled)("nzWaveExtraNode",true),ch("id",S.nzId),gI(3),MD(S.nzLoading?3:-1),gI(2),MD(S.isChecked?5:6));},dependencies:[cl,fp,Ah,Th,st,Ee],encapsulation:2})}})(),xt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=KE({type:n});static \u0275inj=fu({imports:[X]})}return n})();var ee=(n,m)=>m.id,Pt=(n,m)=>m.key;function Rt(n,m){n&1&&(_i(0,"div",4),uh(1,"nz-alert",9),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),lh("nzMessage",Fw(2,1,"settings.restartRequired.message")));}function At(n,m){n&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Bt(n,m){if(n&1&&(_i(0,"p",6),Iw(1),Jc$1()),n&2){let e=HD();gI(),Lh(e.loadError());}}function Ft(n,m){if(n&1&&(_i(0,"nz-tag",11),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=HD().$implicit;ch("data-testid",e.id+"-default-chip"),gI(),Lh(Fw(2,2,"settings.defaultAgent.label"));}}function Lt(n,m){if(n&1&&(_i(0,"nz-tag",17),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=m,t=HD(2).$implicit,i=HD(2);lh("nzColor",i.testResultTone(e)),ch("title",e.message??"")("data-testid",t.id+"-test-result"),gI(),rl$1(" ",Fw(2,4,i.testResultLabelKey(e))," ");}}function Kt(n,m){if(n&1){let e=FD();_i(0,"span",13)(1,"button",16),mh("click",function(){Fu(e);let i=HD().$implicit,s=HD(2);return ju(s.testSavedConnection(i))}),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Lt,3,6,"nz-tag",17),Jc$1();}if(n&2){let e,t=HD().$implicit,i=HD(2);gI(),lh("nzLoading",i.listTestState(t.id)?.running===true)("disabled",i.listTestState(t.id)?.running===true),ch("data-testid",t.id+"-test-connection"),gI(),rl$1(" ",Fw(3,5,"settings.testConnection")," "),gI(2),MD((e=i.listTestState(t.id)?.result)?4:-1,e);}}function $t(n,m){if(n&1){let e=FD();_i(0,"tr")(1,"td",10)(2,"span"),Iw(3),Jc$1(),_D(4,Ft,3,4,"nz-tag",11),Jc$1(),_i(5,"td")(6,"nz-tag"),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"td"),Iw(10),Jc$1(),_i(11,"td",12),_D(12,Kt,5,7,"span",13),_i(13,"button",14),mh("click",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.openEdit(i))}),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"button",15),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.removeInstance(i.id))}),Iw(20),Pw(21,"transloco"),Jc$1()()();}if(n&2){let e=m.$implicit,t=HD(2);ch("data-testid","instance-"+e.id),gI(),ch("data-testid",e.id+"-name"),gI(2),Lh(e.displayName),gI(),MD(t.isDefaultAgent(e)?4:-1),gI(2),ch("data-testid",e.id+"-type"),gI(),Lh(Fw(8,16,t.typeLabelKey(e))),gI(2),ch("data-testid",e.id+"-expires"),gI(),rl$1(" ",e.expiresOn??""," "),gI(2),MD(t.supportsTestConnection(e.type)?12:-1),gI(),ch("data-testid",e.id+"-edit"),gI(),rl$1(" ",Fw(15,18,"settings.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,20,"settings.deleteConfirm"))("nzOkText",Fw(18,22,"settings.delete"))("nzCancelText",Fw(19,24,"common.cancel")),ch("data-testid",e.id+"-delete"),gI(4),rl$1(" ",Fw(21,26,"settings.delete")," ");}}function qt(n,m){if(n&1&&(_i(0,"nz-table",7)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc$1(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc$1(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc$1()()(),_i(15,"tbody"),xD(16,$t,22,28,"tr",null,ee),Jc$1()()),n&2){let e=HD();lh("nzData",e.instances())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,7,"settings.column.displayName")),gI(3),Lh(Fw(8,9,"settings.column.type")),gI(3),Lh(Fw(11,11,"settings.column.expiresOn")),gI(3),Lh(Fw(14,13,"settings.column.actions")),gI(3),AD(e.instances());}}function jt(n,m){if(n&1&&(_i(0,"li"),Iw(1),Jc$1()),n&2){let e=m.$implicit;gI(),Lh(e);}}function Ut(n,m){if(n&1&&(_i(0,"section",19)(1,"h3"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"ul"),xD(5,jt,2,1,"li",null,ND),Jc$1()()),n&2){let e=HD(2);gI(2),Lh(Fw(3,1,"settings.validation")),gI(3),AD(e.validationErrors());}}function Wt(n,m){if(n&1&&(_i(0,"p",20),Iw(1),Jc$1()),n&2){let e=HD(2);gI(),Lh(e.secretSaveError());}}function Zt(n,m){if(n&1&&(uh(0,"nz-option",27),Pw(1,"transloco")),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",Fw(1,2,e.labelKey));}}function Ht(n,m){if(n&1){let e=FD();_i(0,"label",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"input",37),mh("ngModelChange",function(i){let s=Fu(e).$implicit,S=HD(2);return ju(S.setDraftConfig(s.key,i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=m.$implicit,t=HD(2);gI(2),Lh(Fw(3,3,e.labelKey)),gI(2),lh("ngModel",t.configValue(t.draft().config,e.key)),ch("data-testid","provider-config-"+e.key),aE();}}function Qt(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",38),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setKnownRepoSlugs(i))}),Jc$1(),iE(),_i(5,"p",25),Iw(6),Pw(7,"transloco"),Jc$1()();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,3,"settings.bitbucket.knownRepoSlugs")),gI(2),lh("ngModel",e.draft().knownRepoSlugs),aE(),gI(2),Lh(Fw(7,5,"settings.bitbucket.knownRepoSlugsHint"));}}function Gt(n,m){if(n&1){let e=FD();_i(0,"button",39),mh("click",function(){Fu(e);let i=HD(2);return ju(i.fetchModels())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.fetchingModels())("disabled",!e.canFetchModels()),gI(),rl$1(" ",Fw(2,3,"settings.model.fetch")," ");}}function Jt(n,m){if(n&1){let e=FD();_i(0,"button",40),mh("click",function(){Fu(e);let i=HD(2);return ju(i.testDraftConnection())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.modalTestRunning())("disabled",!e.canTestConnection()),gI(),rl$1(" ",Fw(2,3,"settings.testConnection")," ");}}function Yt(n,m){if(n&1&&(_i(0,"p",42),Iw(1),Jc$1()),n&2){let e=HD();Sh("warning",e.identityMismatch)("error",!e.success),gI(),rl$1(" ",e.message," ");}}function Xt(n,m){if(n&1&&(_i(0,"div",32)(1,"nz-tag",17),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Yt,2,5,"p",41),Jc$1()),n&2){let e=m,t=HD(2);gI(),lh("nzColor",t.testResultTone(e)),gI(),rl$1(" ",Fw(3,3,t.testResultLabelKey(e))," "),gI(2),MD(e.message?4:-1);}}function ei(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=HD(3);lh("nzValue",e.configValue(e.draft().config,"model"))("nzLabel",e.configValue(e.draft().config,"model"));}}function ti(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function ii(n,m){if(n&1&&(_i(0,"p",44),Iw(1),Jc$1()),n&2){let e=HD(3);gI(),Lh(e.modelsError());}}function ni(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",43),Pw(5,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDraftConfig("model",i??""))}),_D(6,ei,1,2,"nz-option",27),xD(7,ti,1,2,"nz-option",27,ee),Jc$1(),iE(),_D(9,ii,2,1,"p",44),_i(10,"p",25),Iw(11),Pw(12,"transloco"),Jc$1()(),_i(13,"label",21)(14,"span"),Iw(15),Pw(16,"transloco"),Jc$1(),_i(17,"input",45),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setMaxConcurrent(i))}),Jc$1(),iE(),_i(18,"p",25),Iw(19),Pw(20,"transloco"),Jc$1()(),_i(21,"label",46)(22,"span"),Iw(23),Pw(24,"transloco"),Jc$1(),_i(25,"nz-switch",47),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDefaultAgentDraft(i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,11,"settings.model.label")),gI(2),lh("nzPlaceHolder",Fw(5,13,"settings.model.placeholder"))("ngModel",e.configValue(e.draft().config,"model")),aE(),gI(2),MD(e.selectedModelMissingFromList()?6:-1),gI(),AD(e.availableModels()),gI(2),MD(e.modelsError()?9:-1),gI(2),Lh(Fw(12,15,"settings.model.hint")),gI(4),Lh(Fw(16,17,"settings.maxConcurrent.label")),gI(2),lh("ngModel",e.draft().maxConcurrent),aE(),gI(2),Lh(Fw(20,19,"settings.maxConcurrent.hint")),gI(4),Lh(Fw(24,21,"settings.defaultAgent.toggle")),gI(2),lh("ngModel",e.draft().defaultAgent),aE();}}function oi(n,m){if(n&1){let e=FD();_i(0,"div",8)(1,"div",18)(2,"h2"),Iw(3),Pw(4,"transloco"),Jc$1(),_D(5,Ut,7,3,"section",19),_D(6,Wt,2,1,"p",20),_i(7,"label",21)(8,"span"),Iw(9),Pw(10,"transloco"),Jc$1(),_i(11,"input",22),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onDisplayNameChange(i))}),Jc$1(),iE(),Jc$1(),_i(12,"label",23)(13,"span"),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"input",24),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onIdChange(i))}),Jc$1(),iE(),_i(17,"p",25),Iw(18),Pw(19,"transloco"),Jc$1()(),_i(20,"div",21)(21,"span"),Iw(22),Pw(23,"transloco"),Jc$1(),_i(24,"nz-select",26),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onTypeChange(i))}),xD(25,Zt,2,4,"nz-option",27,ee),Jc$1(),iE(),Jc$1(),xD(27,Ht,5,5,"label",21,Pt),_D(29,Qt,8,7,"div",21),_i(30,"label",21)(31,"span"),Iw(32),Pw(33,"transloco"),Jc$1(),_i(34,"div",28)(35,"input",29),Pw(36,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setSecretValue(i))}),Jc$1(),iE(),_D(37,Gt,3,5,"button",30),_D(38,Jt,3,5,"button",31),Jc$1(),_D(39,Xt,5,5,"div",32),Jc$1(),_D(40,ni,26,23),_i(41,"label",21)(42,"span"),Iw(43),Pw(44,"transloco"),Jc$1(),_i(45,"input",33),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setExpiresOn(i))}),Jc$1(),iE(),_i(46,"p",25),Iw(47),Pw(48,"transloco"),Jc$1()(),_i(49,"div",34)(50,"button",35),mh("click",function(){Fu(e);let i=HD();return ju(i.closeModal())}),Iw(51),Pw(52,"transloco"),Jc$1(),_i(53,"button",36),mh("click",function(){Fu(e);let i=HD();return ju(i.saveModal())}),Iw(54),Pw(55,"transloco"),Jc$1()()()();}if(n&2){let e,t=HD();gI(3),rl$1(" ",Fw(4,24,t.draft().originalId?"settings.editProvider":"settings.addProvider")," "),gI(2),MD(t.validationErrors().length>0?5:-1),gI(),MD(t.secretSaveError()?6:-1),gI(3),Lh(Fw(10,26,"settings.displayName")),gI(2),lh("ngModel",t.draft().displayName),aE(),gI(3),Lh(Fw(15,28,"settings.instanceId")),gI(2),lh("ngModel",t.draft().id),aE(),gI(2),Lh(Fw(19,30,"settings.instanceIdHint")),gI(4),Lh(Fw(23,32,"settings.type.label")),gI(2),lh("ngModel",t.draft().optionId),aE(),gI(),AD(t.typeOptions),gI(2),AD(t.configFields(t.draft().type)),gI(2),MD(t.draft().type==="bitbucket"?29:-1),gI(3),Lh(Fw(33,34,"settings.apiKey.label")),gI(3),lh("ngModel",t.draft().secretValue)("placeholder",Fw(36,36,t.draft().originalId?"settings.apiKey.placeholderEdit":"settings.apiKey.placeholderCreate")),aE(),gI(2),MD(t.draft().kind==="agent"?37:-1),gI(),MD(t.supportsTestConnection(t.draft().type)?38:-1),gI(),MD((e=t.modalTestResult())?39:-1,e),gI(),MD(t.draft().kind==="agent"?40:-1),gI(3),Lh(Fw(44,38,"settings.expiresOn.label")),gI(2),lh("ngModel",t.draft().expiresOn),aE(),gI(2),Lh(Fw(48,40,"settings.expiresOn.hint")),gI(4),rl$1(" ",Fw(52,42,"common.cancel")," "),gI(2),lh("nzLoading",t.saving()),gI(),rl$1(" ",Fw(55,44,"common.save")," ");}}var en=(()=>{class n{constructor(){this.api=C(f),this.providersApi=C(w),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.loaded=qo({providerInstances:[]}),this.status=qo([]),this.draft=qo(P()),this.loading=qo(true),this.saving=qo(false),this.loadError=qo(null),this.validationErrors=qo([]),this.secretSaveError=qo(null),this.restartRequired=qo(false),this.modalOpen=qo(false),this.availableModels=qo([]),this.fetchingModels=qo(false),this.modelsError=qo(null),this.listTests=qo({}),this.modalTestRunning=qo(false),this.modalTestResult=qo(null),this.instances=Uw(()=>this.loaded().providerInstances??[]),this.typeOptions=d,this.configFields=K,this.typeLabelKey=N,this.isAgent=P_,this.supportsTestConnection=I_,Ng({settings:this.api.getSettings(),status:this.api.getProviderStatus()}).pipe(ue(this.destroyRef)).subscribe({next:({settings:e,status:t})=>{this.applySettings(e,false),this.status.set(t),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("settings.loadFailed")));}});}configValue(e,t){let i=e[t];return typeof i=="string"?i:""}isDefaultAgent(e){return P_(e)&&this.loaded().defaultAgentInstanceId===e.id}selectedModelMissingFromList(){let e=this.configValue(this.draft().config,"model");return e?!this.availableModels().some(t=>t.id===e):false}canFetchModels(){let e=this.draft();return e.kind==="agent"&&(e.secretValue.trim().length>0||e.originalId!=null)}canTestConnection(){let e=this.draft();return I_(e.type)&&(e.secretValue.trim().length>0||e.originalId!=null)}listTestState(e){return this.listTests()[e]}testResultTone(e){return e.identityMismatch?"warning":e.success?"success":"error"}testResultLabelKey(e){return e.identityMismatch?"settings.testConnection.mismatch":e.success?"settings.testConnection.connected":"settings.testConnection.failed"}openCreate(){this.resetModal(P());}openEdit(e){this.resetModal(_(e,this.isDefaultAgent(e)));}closeModal(){this.modalOpen.set(false);}onDisplayNameChange(e){this.draft.update(t=>D(t,e,this.existingIds(t)));}onIdChange(e){this.draft.update(t=>M(t,e));}onTypeChange(e){this.availableModels.set([]),this.modelsError.set(null),this.modalTestResult.set(null),this.draft.update(t=>{let i=q(t,e);return i.kind!=="agent"||t.kind==="agent"?i:s(r$1({},i),{defaultAgent:this.shouldDefaultNewAgent(t)})});}setDraftConfig(e,t){this.draft.update(i=>s(r$1({},i),{config:s(r$1({},i.config),{[e]:t})}));}setSecretValue(e){this.draft.update(t=>s(r$1({},t),{secretValue:e}));}setExpiresOn(e){this.draft.update(t=>s(r$1({},t),{expiresOn:e}));}setKnownRepoSlugs(e){this.draft.update(t=>s(r$1({},t),{knownRepoSlugs:Array.isArray(e)?e:[]}));}setDefaultAgentDraft(e){this.draft.update(t=>s(r$1({},t),{defaultAgent:e}));}setMaxConcurrent(e){let t=typeof e=="number"?e:Number(e),i=Number.isFinite(t)&&t>=1?Math.floor(t):1;this.draft.update(s$1=>s(r$1({},s$1),{maxConcurrent:i}));}fetchModels(){let e=this.draft();if(e.kind!=="agent"||!this.canFetchModels())return;let t=e.secretValue.trim();this.fetchingModels.set(true),this.modelsError.set(null),this.providersApi.previewModels(t?{type:e.type,apiKey:t}:{type:e.type,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.availableModels.set(i),this.fetchingModels.set(false);},error:i=>{this.fetchingModels.set(false),this.modelsError.set(this.errorMessage(i,this.transloco.translate("settings.model.fetchFailed")));}});}testSavedConnection(e){I_(e.type)&&(this.listTests()[e.id]?.running||(this.listTests.update(t=>s(r$1({},t),{[e.id]:{running:true,result:t[e.id]?.result}})),this.api.testProviderConnection(e.id).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:t}}));},error:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:{success:false,message:this.errorMessage(t,this.transloco.translate("settings.testConnection.failed"))}}}));}})));}testDraftConnection(){let e=this.draft();if(!this.canTestConnection()||this.modalTestRunning())return;let t=e.secretValue.trim();this.modalTestRunning.set(true),this.modalTestResult.set(null),this.providersApi.testConnection(t?{type:e.type,config:e.config,apiKey:t}:{type:e.type,config:e.config,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.modalTestRunning.set(false),this.modalTestResult.set(i);},error:i=>{this.modalTestRunning.set(false),this.modalTestResult.set({success:false,message:this.errorMessage(i,this.transloco.translate("settings.testConnection.failed"))});}});}saveModal(){let e=this.draft();if(this.validationErrors.set([]),this.secretSaveError.set(null),!e.displayName.trim()){this.validationErrors.set([this.transloco.translate("settings.displayNameRequired")]);return}if(e.originalId==null&&!e.secretValue.trim()){this.validationErrors.set([this.transloco.translate("settings.apiKey.required")]);return}let t=tm.safeParse(V(e));if(!t.success){this.validationErrors.set(B(t.error));return}this.saving.set(true);let i=t.data,s$1=i.kind==="agent"?{defaultAgent:e.defaultAgent}:{};(e.originalId==null?this.api.createProviderInstance(r$1(r$1({},i),s$1)):this.api.updateProviderInstance(e.originalId,r$1(r$1({displayName:i.displayName,config:i.config,secretKey:i.secretKey,expiresOn:i.expiresOn??null},i.kind==="agent"?{maxConcurrent:i.maxConcurrent}:{}),s$1))).pipe(Nl(D=>{this.applySettings(D.settings,D.restartRequired);let P=e.secretValue.trim();return P?this.api.setSecret(i.secretKey,P).pipe(Se(()=>({kind:"ok"})),es(vt=>Dg({kind:"secret-failed",err:vt}))):Dg({kind:"ok"})}),ue(this.destroyRef)).subscribe({next:D=>{if(this.saving.set(false),D.kind==="secret-failed"){this.draft.update(P=>s(r$1({},P),{originalId:i.id,id:i.id,idAutoSync:false,secretKey:i.secretKey})),this.secretSaveError.set(this.errorMessage(D.err,this.transloco.translate("settings.apiKey.setFailedAfterSave"))),this.refreshStatus();return}this.modalOpen.set(false),this.refreshStatus();},error:D=>{this.saving.set(false),this.message.error(this.errorMessage(D,this.transloco.translate("settings.saveFailed")));}});}removeInstance(e){this.api.deleteProviderInstance(e).subscribe({next:t=>this.applySettings(t.settings,t.restartRequired),error:t=>{this.message.error(this.errorMessage(t,this.transloco.translate("settings.saveFailed")));}});}resetModal(e){this.validationErrors.set([]),this.secretSaveError.set(null),this.availableModels.set([]),this.modelsError.set(null),this.fetchingModels.set(false),this.modalTestRunning.set(false),this.modalTestResult.set(null),this.draft.set(e),this.modalOpen.set(true);}shouldDefaultNewAgent(e){return e.originalId&&e.originalId===this.loaded().defaultAgentInstanceId?true:!this.loaded().defaultAgentInstanceId}existingIds(e){return this.instances().map(t=>t.id).filter(t=>t!==e.originalId)}applySettings(e,t){let i=e.providerInstances??[];this.loaded.set(r$1({providerInstances:i},e.defaultAgentInstanceId?{defaultAgentInstanceId:e.defaultAgentInstanceId}:{})),t&&this.restartRequired.set(true);}refreshStatus(){this.api.getProviderStatus().subscribe({next:e=>this.status.set(e),error:()=>{}});}errorMessage(e,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||n)};}static{this.\u0275cmp=ZE({type:n,selectors:[["app-settings"]],decls:17,vars:12,consts:[["data-testid","settings-page",1,"settings"],[1,"header"],[1,"lede"],["nz-button","","nzType","primary","type","button","data-testid","add-provider",3,"click"],["data-testid","restart-required-banner"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","provider-instances",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","provider-modal",1,"modal-backdrop"],["nzType","warning","nzShowIcon","","nzBanner","",3,"nzMessage"],[1,"name-cell"],["nzColor","blue"],[1,"actions"],[1,"test-connection"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"],["nz-button","","nzType","link","type","button",3,"click","nzLoading","disabled"],[3,"nzColor"],["role","dialog",1,"modal-panel"],["data-testid","validation-errors",1,"errors"],["data-testid","secret-save-error",1,"error"],[1,"field"],["nz-input","","data-testid","provider-display-name",3,"ngModelChange","ngModel"],[1,"field","field-id"],["nz-input","","data-testid","provider-id",3,"ngModelChange","ngModel"],[1,"hint"],["data-testid","provider-type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"api-key-row"],["nz-input","","type","password","autocomplete","off","data-testid","provider-api-key",3,"ngModelChange","ngModel","placeholder"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"nzLoading","disabled"],["data-testid","provider-test-result",1,"test-result-row"],["nz-input","","type","date","data-testid","provider-expires-on",3,"ngModelChange","ngModel"],[1,"modal-actions"],["nz-button","","type","button","data-testid","provider-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","provider-save",3,"click","nzLoading"],["nz-input","",3,"ngModelChange","ngModel"],["nzMode","tags","data-testid","provider-config-knownRepoSlugs",3,"ngModelChange","ngModel"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"click","nzLoading","disabled"],["data-testid","provider-test-result-message",1,"test-result-message",3,"warning","error"],["data-testid","provider-test-result-message",1,"test-result-message"],["data-testid","provider-model","nzAllowClear","",3,"ngModelChange","nzPlaceHolder","ngModel"],["data-testid","provider-models-error",1,"error"],["nz-input","","type","number","min","1","step","1","data-testid","provider-max-concurrent",3,"ngModelChange","ngModel"],[1,"field","field-switch"],["data-testid","provider-default-agent",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"p",2),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"button",3),mh("click",function(){return i.openCreate()}),Iw(10),Pw(11,"transloco"),Jc$1()(),_D(12,Rt,3,3,"div",4),_D(13,At,3,3,"p",5)(14,Bt,2,1,"p",6)(15,qt,18,15,"nz-table",7),_D(16,oi,56,46,"div",8),Jc$1()),t&2&&(gI(4),Lh(Fw(5,6,"settings.title")),gI(3),Lh(Fw(8,8,"settings.lede")),gI(3),rl$1(" ",Fw(11,10,"settings.addProvider")," "),gI(2),MD(i.restartRequired()?12:-1),gI(),MD(i.loading()?13:i.loadError()?14:15),gI(3),MD(i.modalOpen()?16:-1));},dependencies:[$8,al,er,Jc,rl,Nc,$i,Gn,un,pf,bd,sp,fp,ai,z,_n,Cn,ex,Fm,Am,xt,X,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".settings[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.field-id[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace;font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.15rem .25rem}.test-connection[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.api-key-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.api-key-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:10rem}.test-result-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.4rem .6rem;margin-top:.45rem}.test-result-message[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#57534e;flex:1;min-width:12rem}.test-result-message.warning[_ngcontent-%COMP%]{color:#b45309}.test-result-message.error[_ngcontent-%COMP%]{color:#9f1239}.field-switch[_ngcontent-%COMP%]{flex-direction:row;align-items:center;justify-content:space-between}.field[_ngcontent-%COMP%] nz-select[_ngcontent-%COMP%]{width:100%}.modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:4rem 1rem 2rem;background:#1c191759}.modal-panel[_ngcontent-%COMP%]{width:min(32rem,100%);max-height:calc(100vh - 6rem);overflow:auto;background:#fff;border-radius:.5rem;padding:1.25rem 1.5rem 1.5rem;box-shadow:0 10px 30px #1c19172e}.modal-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.15rem}.modal-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}"]});}}return n})();export{en as ProvidersManageComponent,en as SettingsComponent};
|
|
1
|
+
import {w,P,d,K,N,_,D,M,q,V,B}from'./chunk-doY5ozP9.js';import {H as He}from'./chunk-DRe_kA_l.js';import {f}from'./chunk-BidviQhN.js';import {_ as _n,C as Cn}from'./chunk-MciiAFro.js';import {G as Gn,u as un}from'./chunk-BqhxU3er.js';import {a as ai,z}from'./chunk-C07s4-rF.js';import {W,I}from'./chunk-zWWkMLc1.js';import {A as A_,T as T_,n as nm}from'./chunk-g20-BKKx.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-DyGh8J3-.js';import'./chunk-D5BPM_KC.js';import {C,b as at,V as Ve,q as qo,U as Uw,aW as Ng,u as ue,s,r as r$1,b9 as Nl,ba as Se,aX as es,aY as Dg,c as bi,Z as ZE,d as $8,e as al,bb as er,bc as Jc,f as rl,bd as Nc,g as $i,a0 as pf,a1 as bd,a2 as sp,a3 as fp,h as ex,F as Fm,A as Am,K as Kt$1,j as _i,I as Iw,P as Pw,J as Jc$1,m as mh,l as _D,n as gI,L as Lh,o as Fw,x as rl$1,M as MD,a8 as KE,a9 as fu,aA as mT,be as E3,bf as _r,ab as oe,aa as Z0,bg as Ci,aB as yT,ac as Oe,bh as Bt$1,aq as el,bi as cl,a4 as Ah,a5 as Th,as as st,at as Ee,aj as ly,av as K0,B as uh,S as Sh,p as lh,E as ch,bj as Nw,bk as St,bl as wo,ax as Eh,an as WD,ao as GD,H as HD,z as xD,D as AD,y as FD,k as iE,w as aE,aM as Yl,aw as rh,N as ND,aJ as tl,aK as nl,O as Fu,Q as ju}from'./main-GFNB573R.js';var wt=["switchElement"];function Tt(n,m){n&1&&uh(0,"nz-icon",3);}function It(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzCheckedChildren);}}function kt(n,m){if(n&1&&rh(0,It,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzCheckedChildren);}}function Nt(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzUnCheckedChildren);}}function Dt(n,m){if(n&1&&rh(0,Nt,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzUnCheckedChildren);}}var Vt="switch",X=(()=>{let n,m=[],e=[];return class q{static{let i=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],mT(null,null,n,{kind:"field",name:"nzSize",static:false,private:false,access:{has:s=>"nzSize"in s,get:s=>s.nzSize,set:(s,S)=>{s.nzSize=S;}},metadata:i},m,e),i&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:i});}_nzModuleName=Vt;nzConfigService=C(E3);el=C(_r).nativeElement;ngZone=C(oe);cdr=C(Z0);focusMonitor=C(Ci);destroyRef=C(at);isChecked=false;onChange=()=>{};onTouched=()=>{};switchElement;nzLoading=false;nzDisabled=false;nzControl=false;nzCheckedChildren=null;nzUnCheckedChildren=null;nzSize=yT(this,m,"default");nzId=(yT(this,e),null);dir=C(Oe).valueSignal;isNzDisableFirstChange=true;size=qo(this.nzSize);formSize=C(Bt$1,{optional:true});finalSize=Uw(()=>this.formSize?.()||this.size());updateValue(i){this.isChecked!==i&&(this.isChecked=i,this.onChange(this.isChecked));}focus(){this.focusMonitor.focusVia(this.switchElement.nativeElement,"keyboard");}blur(){this.switchElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.switchElement.nativeElement);});}ngOnChanges(i){let{nzSize:s}=i;s&&this.size.set(s.currentValue);}ngOnInit(){el(this.el,"click").pipe(ue(this.destroyRef)).subscribe(i=>{i.preventDefault(),!(this.nzControl||this.nzDisabled||this.nzLoading)&&this.ngZone.run(()=>{this.updateValue(!this.isChecked),this.cdr.markForCheck();});}),el(this.switchElement.nativeElement,"keydown").pipe(ue(this.destroyRef)).subscribe(i=>{if(this.nzControl||this.nzDisabled||this.nzLoading)return;let{keyCode:s}=i;s!==37&&s!==39&&s!==32&&s!==13||(i.preventDefault(),this.ngZone.run(()=>{s===37?this.updateValue(false):s===39?this.updateValue(true):(s===32||s===13)&&this.updateValue(!this.isChecked),this.cdr.markForCheck();}));});}ngAfterViewInit(){this.focusMonitor.monitor(this.switchElement.nativeElement,true).pipe(ue(this.destroyRef)).subscribe(i=>{i||Promise.resolve().then(()=>this.onTouched());});}writeValue(i){this.isChecked=i,this.cdr.markForCheck();}registerOnChange(i){this.onChange=i;}registerOnTouched(i){this.onTouched=i;}setDisabledState(i){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||i,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}static \u0275fac=function(s){return new(s||q)};static \u0275cmp=ZE({type:q,selectors:[["nz-switch"]],viewQuery:function(s,S){if(s&1&&Eh(wt,7),s&2){let j;WD(j=GD())&&(S.switchElement=j.first);}},inputs:{nzLoading:[2,"nzLoading","nzLoading",K0],nzDisabled:[2,"nzDisabled","nzDisabled",K0],nzControl:[2,"nzControl","nzControl",K0],nzCheckedChildren:"nzCheckedChildren",nzUnCheckedChildren:"nzUnCheckedChildren",nzSize:"nzSize",nzId:"nzId"},exportAs:["nzSwitch"],features:[Nw([{provide:St,useExisting:wo(()=>q),multi:true}]),ly],decls:8,vars:15,consts:[["switchElement",""],["nz-wave","","type","button",1,"ant-switch",3,"disabled","nzWaveExtraNode"],[1,"ant-switch-handle"],["nzType","loading",1,"ant-switch-loading-icon"],[1,"ant-switch-inner"],[1,"ant-click-animating-node"],[4,"nzStringTemplateOutlet"]],template:function(s,S){s&1&&(_i(0,"button",1,0)(2,"span",2),_D(3,Tt,1,0,"nz-icon",3),Jc$1(),_i(4,"span",4),_D(5,kt,1,1,"ng-container")(6,Dt,1,1,"ng-container"),Jc$1(),uh(7,"div",5),Jc$1()),s&2&&(Sh("ant-switch-checked",S.isChecked)("ant-switch-loading",S.nzLoading)("ant-switch-disabled",S.nzDisabled)("ant-switch-small",S.finalSize()==="small")("ant-switch-rtl",S.dir()==="rtl"),lh("disabled",S.nzDisabled)("nzWaveExtraNode",true),ch("id",S.nzId),gI(3),MD(S.nzLoading?3:-1),gI(2),MD(S.isChecked?5:6));},dependencies:[cl,fp,Ah,Th,st,Ee],encapsulation:2})}})(),xt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=KE({type:n});static \u0275inj=fu({imports:[X]})}return n})();var ee=(n,m)=>m.id,Pt=(n,m)=>m.key;function Rt(n,m){n&1&&(_i(0,"div",4),uh(1,"nz-alert",9),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),lh("nzMessage",Fw(2,1,"settings.restartRequired.message")));}function At(n,m){n&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Bt(n,m){if(n&1&&(_i(0,"p",6),Iw(1),Jc$1()),n&2){let e=HD();gI(),Lh(e.loadError());}}function Ft(n,m){if(n&1&&(_i(0,"nz-tag",11),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=HD().$implicit;ch("data-testid",e.id+"-default-chip"),gI(),Lh(Fw(2,2,"settings.defaultAgent.label"));}}function Lt(n,m){if(n&1&&(_i(0,"nz-tag",17),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=m,t=HD(2).$implicit,i=HD(2);lh("nzColor",i.testResultTone(e)),ch("title",e.message??"")("data-testid",t.id+"-test-result"),gI(),rl$1(" ",Fw(2,4,i.testResultLabelKey(e))," ");}}function Kt(n,m){if(n&1){let e=FD();_i(0,"span",13)(1,"button",16),mh("click",function(){Fu(e);let i=HD().$implicit,s=HD(2);return ju(s.testSavedConnection(i))}),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Lt,3,6,"nz-tag",17),Jc$1();}if(n&2){let e,t=HD().$implicit,i=HD(2);gI(),lh("nzLoading",i.listTestState(t.id)?.running===true)("disabled",i.listTestState(t.id)?.running===true),ch("data-testid",t.id+"-test-connection"),gI(),rl$1(" ",Fw(3,5,"settings.testConnection")," "),gI(2),MD((e=i.listTestState(t.id)?.result)?4:-1,e);}}function $t(n,m){if(n&1){let e=FD();_i(0,"tr")(1,"td",10)(2,"span"),Iw(3),Jc$1(),_D(4,Ft,3,4,"nz-tag",11),Jc$1(),_i(5,"td")(6,"nz-tag"),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"td"),Iw(10),Jc$1(),_i(11,"td",12),_D(12,Kt,5,7,"span",13),_i(13,"button",14),mh("click",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.openEdit(i))}),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"button",15),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.removeInstance(i.id))}),Iw(20),Pw(21,"transloco"),Jc$1()()();}if(n&2){let e=m.$implicit,t=HD(2);ch("data-testid","instance-"+e.id),gI(),ch("data-testid",e.id+"-name"),gI(2),Lh(e.displayName),gI(),MD(t.isDefaultAgent(e)?4:-1),gI(2),ch("data-testid",e.id+"-type"),gI(),Lh(Fw(8,16,t.typeLabelKey(e))),gI(2),ch("data-testid",e.id+"-expires"),gI(),rl$1(" ",e.expiresOn??""," "),gI(2),MD(t.supportsTestConnection(e.type)?12:-1),gI(),ch("data-testid",e.id+"-edit"),gI(),rl$1(" ",Fw(15,18,"settings.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,20,"settings.deleteConfirm"))("nzOkText",Fw(18,22,"settings.delete"))("nzCancelText",Fw(19,24,"common.cancel")),ch("data-testid",e.id+"-delete"),gI(4),rl$1(" ",Fw(21,26,"settings.delete")," ");}}function qt(n,m){if(n&1&&(_i(0,"nz-table",7)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc$1(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc$1(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc$1()()(),_i(15,"tbody"),xD(16,$t,22,28,"tr",null,ee),Jc$1()()),n&2){let e=HD();lh("nzData",e.instances())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,7,"settings.column.displayName")),gI(3),Lh(Fw(8,9,"settings.column.type")),gI(3),Lh(Fw(11,11,"settings.column.expiresOn")),gI(3),Lh(Fw(14,13,"settings.column.actions")),gI(3),AD(e.instances());}}function jt(n,m){if(n&1&&(_i(0,"li"),Iw(1),Jc$1()),n&2){let e=m.$implicit;gI(),Lh(e);}}function Ut(n,m){if(n&1&&(_i(0,"section",19)(1,"h3"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"ul"),xD(5,jt,2,1,"li",null,ND),Jc$1()()),n&2){let e=HD(2);gI(2),Lh(Fw(3,1,"settings.validation")),gI(3),AD(e.validationErrors());}}function Wt(n,m){if(n&1&&(_i(0,"p",20),Iw(1),Jc$1()),n&2){let e=HD(2);gI(),Lh(e.secretSaveError());}}function Zt(n,m){if(n&1&&(uh(0,"nz-option",27),Pw(1,"transloco")),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",Fw(1,2,e.labelKey));}}function Ht(n,m){if(n&1){let e=FD();_i(0,"label",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"input",37),mh("ngModelChange",function(i){let s=Fu(e).$implicit,S=HD(2);return ju(S.setDraftConfig(s.key,i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=m.$implicit,t=HD(2);gI(2),Lh(Fw(3,3,e.labelKey)),gI(2),lh("ngModel",t.configValue(t.draft().config,e.key)),ch("data-testid","provider-config-"+e.key),aE();}}function Qt(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",38),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setKnownRepoSlugs(i))}),Jc$1(),iE(),_i(5,"p",25),Iw(6),Pw(7,"transloco"),Jc$1()();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,3,"settings.bitbucket.knownRepoSlugs")),gI(2),lh("ngModel",e.draft().knownRepoSlugs),aE(),gI(2),Lh(Fw(7,5,"settings.bitbucket.knownRepoSlugsHint"));}}function Gt(n,m){if(n&1){let e=FD();_i(0,"button",39),mh("click",function(){Fu(e);let i=HD(2);return ju(i.fetchModels())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.fetchingModels())("disabled",!e.canFetchModels()),gI(),rl$1(" ",Fw(2,3,"settings.model.fetch")," ");}}function Jt(n,m){if(n&1){let e=FD();_i(0,"button",40),mh("click",function(){Fu(e);let i=HD(2);return ju(i.testDraftConnection())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.modalTestRunning())("disabled",!e.canTestConnection()),gI(),rl$1(" ",Fw(2,3,"settings.testConnection")," ");}}function Yt(n,m){if(n&1&&(_i(0,"p",42),Iw(1),Jc$1()),n&2){let e=HD();Sh("warning",e.identityMismatch)("error",!e.success),gI(),rl$1(" ",e.message," ");}}function Xt(n,m){if(n&1&&(_i(0,"div",32)(1,"nz-tag",17),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Yt,2,5,"p",41),Jc$1()),n&2){let e=m,t=HD(2);gI(),lh("nzColor",t.testResultTone(e)),gI(),rl$1(" ",Fw(3,3,t.testResultLabelKey(e))," "),gI(2),MD(e.message?4:-1);}}function ei(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=HD(3);lh("nzValue",e.configValue(e.draft().config,"model"))("nzLabel",e.configValue(e.draft().config,"model"));}}function ti(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function ii(n,m){if(n&1&&(_i(0,"p",44),Iw(1),Jc$1()),n&2){let e=HD(3);gI(),Lh(e.modelsError());}}function ni(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",43),Pw(5,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDraftConfig("model",i??""))}),_D(6,ei,1,2,"nz-option",27),xD(7,ti,1,2,"nz-option",27,ee),Jc$1(),iE(),_D(9,ii,2,1,"p",44),_i(10,"p",25),Iw(11),Pw(12,"transloco"),Jc$1()(),_i(13,"label",21)(14,"span"),Iw(15),Pw(16,"transloco"),Jc$1(),_i(17,"input",45),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setMaxConcurrent(i))}),Jc$1(),iE(),_i(18,"p",25),Iw(19),Pw(20,"transloco"),Jc$1()(),_i(21,"label",46)(22,"span"),Iw(23),Pw(24,"transloco"),Jc$1(),_i(25,"nz-switch",47),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDefaultAgentDraft(i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,11,"settings.model.label")),gI(2),lh("nzPlaceHolder",Fw(5,13,"settings.model.placeholder"))("ngModel",e.configValue(e.draft().config,"model")),aE(),gI(2),MD(e.selectedModelMissingFromList()?6:-1),gI(),AD(e.availableModels()),gI(2),MD(e.modelsError()?9:-1),gI(2),Lh(Fw(12,15,"settings.model.hint")),gI(4),Lh(Fw(16,17,"settings.maxConcurrent.label")),gI(2),lh("ngModel",e.draft().maxConcurrent),aE(),gI(2),Lh(Fw(20,19,"settings.maxConcurrent.hint")),gI(4),Lh(Fw(24,21,"settings.defaultAgent.toggle")),gI(2),lh("ngModel",e.draft().defaultAgent),aE();}}function oi(n,m){if(n&1){let e=FD();_i(0,"div",8)(1,"div",18)(2,"h2"),Iw(3),Pw(4,"transloco"),Jc$1(),_D(5,Ut,7,3,"section",19),_D(6,Wt,2,1,"p",20),_i(7,"label",21)(8,"span"),Iw(9),Pw(10,"transloco"),Jc$1(),_i(11,"input",22),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onDisplayNameChange(i))}),Jc$1(),iE(),Jc$1(),_i(12,"label",23)(13,"span"),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"input",24),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onIdChange(i))}),Jc$1(),iE(),_i(17,"p",25),Iw(18),Pw(19,"transloco"),Jc$1()(),_i(20,"div",21)(21,"span"),Iw(22),Pw(23,"transloco"),Jc$1(),_i(24,"nz-select",26),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onTypeChange(i))}),xD(25,Zt,2,4,"nz-option",27,ee),Jc$1(),iE(),Jc$1(),xD(27,Ht,5,5,"label",21,Pt),_D(29,Qt,8,7,"div",21),_i(30,"label",21)(31,"span"),Iw(32),Pw(33,"transloco"),Jc$1(),_i(34,"div",28)(35,"input",29),Pw(36,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setSecretValue(i))}),Jc$1(),iE(),_D(37,Gt,3,5,"button",30),_D(38,Jt,3,5,"button",31),Jc$1(),_D(39,Xt,5,5,"div",32),Jc$1(),_D(40,ni,26,23),_i(41,"label",21)(42,"span"),Iw(43),Pw(44,"transloco"),Jc$1(),_i(45,"input",33),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setExpiresOn(i))}),Jc$1(),iE(),_i(46,"p",25),Iw(47),Pw(48,"transloco"),Jc$1()(),_i(49,"div",34)(50,"button",35),mh("click",function(){Fu(e);let i=HD();return ju(i.closeModal())}),Iw(51),Pw(52,"transloco"),Jc$1(),_i(53,"button",36),mh("click",function(){Fu(e);let i=HD();return ju(i.saveModal())}),Iw(54),Pw(55,"transloco"),Jc$1()()()();}if(n&2){let e,t=HD();gI(3),rl$1(" ",Fw(4,24,t.draft().originalId?"settings.editProvider":"settings.addProvider")," "),gI(2),MD(t.validationErrors().length>0?5:-1),gI(),MD(t.secretSaveError()?6:-1),gI(3),Lh(Fw(10,26,"settings.displayName")),gI(2),lh("ngModel",t.draft().displayName),aE(),gI(3),Lh(Fw(15,28,"settings.instanceId")),gI(2),lh("ngModel",t.draft().id),aE(),gI(2),Lh(Fw(19,30,"settings.instanceIdHint")),gI(4),Lh(Fw(23,32,"settings.type.label")),gI(2),lh("ngModel",t.draft().optionId),aE(),gI(),AD(t.typeOptions),gI(2),AD(t.configFields(t.draft().type)),gI(2),MD(t.draft().type==="bitbucket"?29:-1),gI(3),Lh(Fw(33,34,"settings.apiKey.label")),gI(3),lh("ngModel",t.draft().secretValue)("placeholder",Fw(36,36,t.draft().originalId?"settings.apiKey.placeholderEdit":"settings.apiKey.placeholderCreate")),aE(),gI(2),MD(t.draft().kind==="agent"?37:-1),gI(),MD(t.supportsTestConnection(t.draft().type)?38:-1),gI(),MD((e=t.modalTestResult())?39:-1,e),gI(),MD(t.draft().kind==="agent"?40:-1),gI(3),Lh(Fw(44,38,"settings.expiresOn.label")),gI(2),lh("ngModel",t.draft().expiresOn),aE(),gI(2),Lh(Fw(48,40,"settings.expiresOn.hint")),gI(4),rl$1(" ",Fw(52,42,"common.cancel")," "),gI(2),lh("nzLoading",t.saving()),gI(),rl$1(" ",Fw(55,44,"common.save")," ");}}var en=(()=>{class n{constructor(){this.api=C(f),this.providersApi=C(w),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.loaded=qo({providerInstances:[]}),this.status=qo([]),this.draft=qo(P()),this.loading=qo(true),this.saving=qo(false),this.loadError=qo(null),this.validationErrors=qo([]),this.secretSaveError=qo(null),this.restartRequired=qo(false),this.modalOpen=qo(false),this.availableModels=qo([]),this.fetchingModels=qo(false),this.modelsError=qo(null),this.listTests=qo({}),this.modalTestRunning=qo(false),this.modalTestResult=qo(null),this.instances=Uw(()=>this.loaded().providerInstances??[]),this.typeOptions=d,this.configFields=K,this.typeLabelKey=N,this.isAgent=A_,this.supportsTestConnection=T_,Ng({settings:this.api.getSettings(),status:this.api.getProviderStatus()}).pipe(ue(this.destroyRef)).subscribe({next:({settings:e,status:t})=>{this.applySettings(e,false),this.status.set(t),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("settings.loadFailed")));}});}configValue(e,t){let i=e[t];return typeof i=="string"?i:""}isDefaultAgent(e){return A_(e)&&this.loaded().defaultAgentInstanceId===e.id}selectedModelMissingFromList(){let e=this.configValue(this.draft().config,"model");return e?!this.availableModels().some(t=>t.id===e):false}canFetchModels(){let e=this.draft();return e.kind==="agent"&&(e.secretValue.trim().length>0||e.originalId!=null)}canTestConnection(){let e=this.draft();return T_(e.type)&&(e.secretValue.trim().length>0||e.originalId!=null)}listTestState(e){return this.listTests()[e]}testResultTone(e){return e.identityMismatch?"warning":e.success?"success":"error"}testResultLabelKey(e){return e.identityMismatch?"settings.testConnection.mismatch":e.success?"settings.testConnection.connected":"settings.testConnection.failed"}openCreate(){this.resetModal(P());}openEdit(e){this.resetModal(_(e,this.isDefaultAgent(e)));}closeModal(){this.modalOpen.set(false);}onDisplayNameChange(e){this.draft.update(t=>D(t,e,this.existingIds(t)));}onIdChange(e){this.draft.update(t=>M(t,e));}onTypeChange(e){this.availableModels.set([]),this.modelsError.set(null),this.modalTestResult.set(null),this.draft.update(t=>{let i=q(t,e);return i.kind!=="agent"||t.kind==="agent"?i:s(r$1({},i),{defaultAgent:this.shouldDefaultNewAgent(t)})});}setDraftConfig(e,t){this.draft.update(i=>s(r$1({},i),{config:s(r$1({},i.config),{[e]:t})}));}setSecretValue(e){this.draft.update(t=>s(r$1({},t),{secretValue:e}));}setExpiresOn(e){this.draft.update(t=>s(r$1({},t),{expiresOn:e}));}setKnownRepoSlugs(e){this.draft.update(t=>s(r$1({},t),{knownRepoSlugs:Array.isArray(e)?e:[]}));}setDefaultAgentDraft(e){this.draft.update(t=>s(r$1({},t),{defaultAgent:e}));}setMaxConcurrent(e){let t=typeof e=="number"?e:Number(e),i=Number.isFinite(t)&&t>=1?Math.floor(t):1;this.draft.update(s$1=>s(r$1({},s$1),{maxConcurrent:i}));}fetchModels(){let e=this.draft();if(e.kind!=="agent"||!this.canFetchModels())return;let t=e.secretValue.trim();this.fetchingModels.set(true),this.modelsError.set(null),this.providersApi.previewModels(t?{type:e.type,apiKey:t}:{type:e.type,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.availableModels.set(i),this.fetchingModels.set(false);},error:i=>{this.fetchingModels.set(false),this.modelsError.set(this.errorMessage(i,this.transloco.translate("settings.model.fetchFailed")));}});}testSavedConnection(e){T_(e.type)&&(this.listTests()[e.id]?.running||(this.listTests.update(t=>s(r$1({},t),{[e.id]:{running:true,result:t[e.id]?.result}})),this.api.testProviderConnection(e.id).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:t}}));},error:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:{success:false,message:this.errorMessage(t,this.transloco.translate("settings.testConnection.failed"))}}}));}})));}testDraftConnection(){let e=this.draft();if(!this.canTestConnection()||this.modalTestRunning())return;let t=e.secretValue.trim();this.modalTestRunning.set(true),this.modalTestResult.set(null),this.providersApi.testConnection(t?{type:e.type,config:e.config,apiKey:t}:{type:e.type,config:e.config,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.modalTestRunning.set(false),this.modalTestResult.set(i);},error:i=>{this.modalTestRunning.set(false),this.modalTestResult.set({success:false,message:this.errorMessage(i,this.transloco.translate("settings.testConnection.failed"))});}});}saveModal(){let e=this.draft();if(this.validationErrors.set([]),this.secretSaveError.set(null),!e.displayName.trim()){this.validationErrors.set([this.transloco.translate("settings.displayNameRequired")]);return}if(e.originalId==null&&!e.secretValue.trim()){this.validationErrors.set([this.transloco.translate("settings.apiKey.required")]);return}let t=nm.safeParse(V(e));if(!t.success){this.validationErrors.set(B(t.error));return}this.saving.set(true);let i=t.data,s$1=i.kind==="agent"?{defaultAgent:e.defaultAgent}:{};(e.originalId==null?this.api.createProviderInstance(r$1(r$1({},i),s$1)):this.api.updateProviderInstance(e.originalId,r$1(r$1({displayName:i.displayName,config:i.config,secretKey:i.secretKey,expiresOn:i.expiresOn??null},i.kind==="agent"?{maxConcurrent:i.maxConcurrent}:{}),s$1))).pipe(Nl(D=>{this.applySettings(D.settings,D.restartRequired);let P=e.secretValue.trim();return P?this.api.setSecret(i.secretKey,P).pipe(Se(()=>({kind:"ok"})),es(vt=>Dg({kind:"secret-failed",err:vt}))):Dg({kind:"ok"})}),ue(this.destroyRef)).subscribe({next:D=>{if(this.saving.set(false),D.kind==="secret-failed"){this.draft.update(P=>s(r$1({},P),{originalId:i.id,id:i.id,idAutoSync:false,secretKey:i.secretKey})),this.secretSaveError.set(this.errorMessage(D.err,this.transloco.translate("settings.apiKey.setFailedAfterSave"))),this.refreshStatus();return}this.modalOpen.set(false),this.refreshStatus();},error:D=>{this.saving.set(false),this.message.error(this.errorMessage(D,this.transloco.translate("settings.saveFailed")));}});}removeInstance(e){this.api.deleteProviderInstance(e).subscribe({next:t=>this.applySettings(t.settings,t.restartRequired),error:t=>{this.message.error(this.errorMessage(t,this.transloco.translate("settings.saveFailed")));}});}resetModal(e){this.validationErrors.set([]),this.secretSaveError.set(null),this.availableModels.set([]),this.modelsError.set(null),this.fetchingModels.set(false),this.modalTestRunning.set(false),this.modalTestResult.set(null),this.draft.set(e),this.modalOpen.set(true);}shouldDefaultNewAgent(e){return e.originalId&&e.originalId===this.loaded().defaultAgentInstanceId?true:!this.loaded().defaultAgentInstanceId}existingIds(e){return this.instances().map(t=>t.id).filter(t=>t!==e.originalId)}applySettings(e,t){let i=e.providerInstances??[];this.loaded.set(r$1({providerInstances:i},e.defaultAgentInstanceId?{defaultAgentInstanceId:e.defaultAgentInstanceId}:{})),t&&this.restartRequired.set(true);}refreshStatus(){this.api.getProviderStatus().subscribe({next:e=>this.status.set(e),error:()=>{}});}errorMessage(e,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||n)};}static{this.\u0275cmp=ZE({type:n,selectors:[["app-settings"]],decls:17,vars:12,consts:[["data-testid","settings-page",1,"settings"],[1,"header"],[1,"lede"],["nz-button","","nzType","primary","type","button","data-testid","add-provider",3,"click"],["data-testid","restart-required-banner"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","provider-instances",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","provider-modal",1,"modal-backdrop"],["nzType","warning","nzShowIcon","","nzBanner","",3,"nzMessage"],[1,"name-cell"],["nzColor","blue"],[1,"actions"],[1,"test-connection"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"],["nz-button","","nzType","link","type","button",3,"click","nzLoading","disabled"],[3,"nzColor"],["role","dialog",1,"modal-panel"],["data-testid","validation-errors",1,"errors"],["data-testid","secret-save-error",1,"error"],[1,"field"],["nz-input","","data-testid","provider-display-name",3,"ngModelChange","ngModel"],[1,"field","field-id"],["nz-input","","data-testid","provider-id",3,"ngModelChange","ngModel"],[1,"hint"],["data-testid","provider-type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"api-key-row"],["nz-input","","type","password","autocomplete","off","data-testid","provider-api-key",3,"ngModelChange","ngModel","placeholder"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"nzLoading","disabled"],["data-testid","provider-test-result",1,"test-result-row"],["nz-input","","type","date","data-testid","provider-expires-on",3,"ngModelChange","ngModel"],[1,"modal-actions"],["nz-button","","type","button","data-testid","provider-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","provider-save",3,"click","nzLoading"],["nz-input","",3,"ngModelChange","ngModel"],["nzMode","tags","data-testid","provider-config-knownRepoSlugs",3,"ngModelChange","ngModel"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"click","nzLoading","disabled"],["data-testid","provider-test-result-message",1,"test-result-message",3,"warning","error"],["data-testid","provider-test-result-message",1,"test-result-message"],["data-testid","provider-model","nzAllowClear","",3,"ngModelChange","nzPlaceHolder","ngModel"],["data-testid","provider-models-error",1,"error"],["nz-input","","type","number","min","1","step","1","data-testid","provider-max-concurrent",3,"ngModelChange","ngModel"],[1,"field","field-switch"],["data-testid","provider-default-agent",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"p",2),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"button",3),mh("click",function(){return i.openCreate()}),Iw(10),Pw(11,"transloco"),Jc$1()(),_D(12,Rt,3,3,"div",4),_D(13,At,3,3,"p",5)(14,Bt,2,1,"p",6)(15,qt,18,15,"nz-table",7),_D(16,oi,56,46,"div",8),Jc$1()),t&2&&(gI(4),Lh(Fw(5,6,"settings.title")),gI(3),Lh(Fw(8,8,"settings.lede")),gI(3),rl$1(" ",Fw(11,10,"settings.addProvider")," "),gI(2),MD(i.restartRequired()?12:-1),gI(),MD(i.loading()?13:i.loadError()?14:15),gI(3),MD(i.modalOpen()?16:-1));},dependencies:[$8,al,er,Jc,rl,Nc,$i,Gn,un,pf,bd,sp,fp,ai,z,_n,Cn,ex,Fm,Am,xt,X,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".settings[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.field-id[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace;font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.15rem .25rem}.test-connection[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.api-key-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.api-key-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:10rem}.test-result-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.4rem .6rem;margin-top:.45rem}.test-result-message[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#57534e;flex:1;min-width:12rem}.test-result-message.warning[_ngcontent-%COMP%]{color:#b45309}.test-result-message.error[_ngcontent-%COMP%]{color:#9f1239}.field-switch[_ngcontent-%COMP%]{flex-direction:row;align-items:center;justify-content:space-between}.field[_ngcontent-%COMP%] nz-select[_ngcontent-%COMP%]{width:100%}.modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:4rem 1rem 2rem;background:#1c191759}.modal-panel[_ngcontent-%COMP%]{width:min(32rem,100%);max-height:calc(100vh - 6rem);overflow:auto;background:#fff;border-radius:.5rem;padding:1.25rem 1.5rem 1.5rem;box-shadow:0 10px 30px #1c19172e}.modal-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.15rem}.modal-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}"]});}}return n})();export{en as ProvidersManageComponent,en as SettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {aZ as H,Z as ZE,a_ as D6,v as v3,a$ as Yc,
|
|
1
|
+
import {aZ as H,Z as ZE,a_ as D6,v as v3,a$ as Yc,a4 as Ah,a5 as Th,K as Kt,j as _i,z as xD,J as Jc,B as uh,n as gI,D as AD,I as Iw,P as Pw,aH as QD,H as HD,p as lh,G as Aw,aR as xw,E as ch,x as rl,o as Fw}from'./main-GFNB573R.js';var A=e=>["/manage",e],z=()=>({exact:true}),K=(e,i)=>i.path;function L(e,i){if(e&1&&(_i(0,"a",3,0),uh(2,"span",4),Iw(3),Pw(4,"transloco"),Jc()),e&2){let t=i.$implicit,n=QD(1),r=HD();lh("routerLink",Aw(8,A,t.path))("routerLinkActiveOptions",xw(10,z)),ch("data-testid","manage-tab-"+t.path),gI(2),lh("nzType",t.icon)("nzTheme",r.navIconTheme(n.isActive,t.icon)),gI(),rl(" ",Fw(4,6,t.labelKey)," ");}}var I=[{path:"workflows",labelKey:"manage.tab.workflows",icon:"partition"},{path:"views",labelKey:"manage.tab.views",icon:"appstore"},{path:"providers",labelKey:"manage.tab.providers",icon:"api"},{path:"context-files",labelKey:"manage.tab.contextFiles",icon:"file"},{path:"local-repositories",labelKey:"manage.tab.localRepositories",icon:"database"},{path:"worktrees",labelKey:"manage.tab.worktrees",icon:"deployment-unit"},{path:"preferences",labelKey:"manage.tab.preferences",icon:"setting"}],B=(()=>{class e{constructor(){this.tabs=I,this.navIconTheme=H;}static{this.\u0275fac=function(n){return new(n||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-manage-shell"]],decls:5,vars:0,consts:[["rla","routerLinkActive"],["data-testid","manage-shell",1,"manage-shell"],["data-testid","manage-tabs","role","tablist",1,"manage-tabs"],["role","tab","routerLinkActive","active",3,"routerLink","routerLinkActiveOptions"],["nz-icon","",1,"tab-icon",3,"nzType","nzTheme"]],template:function(n,r){n&1&&(_i(0,"section",1)(1,"nav",2),xD(2,L,5,11,"a",3,K),Jc(),uh(4,"router-outlet"),Jc()),n&2&&(gI(2),AD(r.tabs));},dependencies:[D6,v3,Yc,Ah,Th,Kt],styles:[".manage-shell[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%}.manage-tabs[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.25rem;padding:.5rem 1.5rem 0;border-bottom:1px solid var(--knoflows-border, #e1dacb);background:var(--knoflows-surface, #fff)}.manage-tabs[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;padding:.65rem .9rem;color:var(--knoflows-text-secondary, inherit);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px}.tab-icon[_ngcontent-%COMP%]{font-size:16px;color:currentColor}.manage-tabs[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:var(--knoflows-text, inherit)}.manage-tabs[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{color:var(--knoflows-link, inherit);font-weight:600;border-bottom-color:var(--knoflows-link, currentColor)}"]});}}return e})();export{I as MANAGE_TABS,B as ManageShellComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f}from'./chunk-
|
|
1
|
+
import {f}from'./chunk-CxnyhsKe.js';import {C,b as at,a6 as q0,a7 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,z as xD,bn as el,n as gI,D as AD,I as Iw,l as _D,x as rl,M as MD,y as FD,bL as yh,O as Fu,H as HD,Q as ju,c_ as hh,E as ch,N as ND,aR as xw,P as Pw,L as Lh,o as Fw}from'./main-GFNB573R.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 {f as f$1}from'./chunk-BidviQhN.js';import {o as ot}from'./chunk-Bv65hEw_.js';import {_ as _n,C as Cn}from'./chunk-MciiAFro.js';import {f}from'./chunk-CxnyhsKe.js';import {Z as ZE,B as uh,C,V as Ve,b as at,q as qo,U as Uw,u as ue,r as r$1,s,c as bi,d as $8,e as al,bb as er,f as rl,g as $i,a0 as pf,a1 as bd,a2 as sp,a3 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,n as gI,L as Lh,o as Fw,x as rl$1,M as MD,H as HD,y as FD,k as iE,z as xD,p as lh,w as aE,D as AD,E as ch,O as Fu,Q as ju}from'./main-GFNB573R.js';import {a as ai,z}from'./chunk-C07s4-rF.js';import {E as E_,L as L_}from'./chunk-g20-BKKx.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-DyGh8J3-.js';import'./chunk-D5BPM_KC.js';var ge=(o,u)=>u.id;function Re(o,u){o&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),o&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function be(o,u){if(o&1&&(_i(0,"p",4),Iw(1),Jc()),o&2){let e=HD();gI(),Lh(e.loadError());}}function ye(o,u){if(o&1&&(_i(0,"p",5),Iw(1),Jc()),o&2){let e=HD(2);gI(),Lh(e.deleteError());}}function Me(o,u){if(o&1&&(_i(0,"p",9),Iw(1),Jc()),o&2){let e=HD(3);gI(),Lh(e.saveError());}}function Ee(o,u){if(o&1&&uh(0,"nz-option",16),o&2){let e=u.$implicit,i=HD(3);lh("nzValue",e.id)("nzLabel",i.instanceLabel(e));}}function Le(o,u){if(o&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 c=HD(3);return ju(c.formRemoteIdentifier.set(a))}),Jc(),iE(),Jc(),_i(6,"label",10)(7,"span"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"p",13),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"nz-select",21),Pw(14,"transloco"),mh("ngModelChange",function(a){Fu(e);let c=HD(3);return ju(c.formDefaultReviewers.set(a??[]))}),Jc(),iE(),Jc();}if(o&2){let e=HD(3);gI(2),Lh(Fw(3,8,"local-repos.form.remoteIdentifier")),gI(2),lh("nzOptions",e.remoteIdentifierOptions())("nzPlaceHolder",Fw(5,10,"local-repos.form.remoteIdentifierPlaceholder"))("ngModel",e.formRemoteIdentifier()),aE(),gI(4),Lh(Fw(9,12,"local-repos.form.defaultReviewers")),gI(3),Lh(Fw(12,14,"local-repos.form.defaultReviewersHint")),gI(2),lh("nzPlaceHolder",Fw(14,16,"local-repos.form.defaultReviewersPlaceholder"))("ngModel",e.formDefaultReviewers()),aE();}}function ze(o,u){if(o&1){let e=FD();_i(0,"section",6),_D(1,Me,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 c=HD(2);return ju(c.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 c=HD(2);return ju(c.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 c=HD(2);return ju(c.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 c=HD(2);return ju(c.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 c=HD(2);return ju(c.onRemoteInstanceChange(a))}),xD(34,Ee,1,2,"nz-option",16,ge),Jc(),iE(),Jc(),_D(36,Le,15,18),_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(o&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 we(o,u){o&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),o&2&&(gI(),Lh(Fw(2,1,"local-repos.emptyState")));}function Be(o,u){if(o&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td",22),Iw(4),Jc(),_i(5,"td",22),Iw(6),Jc(),_i(7,"td"),Iw(8),Jc(),_i(9,"td"),Iw(10),Jc(),_i(11,"td",23)(12,"button",24),mh("click",function(){let a=Fu(e).$implicit,c=HD(3);return ju(c.openEditForm(a))}),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"button",25),Pw(16,"transloco"),mh("nzOnConfirm",function(){let a=Fu(e).$implicit,c=HD(3);return ju(c.deleteRepo(a))}),Iw(17),Pw(18,"transloco"),Jc()()();}if(o&2){let e=u.$implicit,i=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(i.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(o,u){if(o&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,ge),Jc()()),o&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(o,u){if(o&1&&(_D(0,ye,2,1,"p",5),_D(1,ze,44,38,"section",6),_D(2,we,3,3,"p",7)(3,Pe,24,20,"nz-table",8)),o&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 De=[],Ce=(()=>{class o{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.formDefaultReviewers=qo([]),this.repoCapableInstances=Uw(()=>(this.settings()?.providerInstances??[]).filter(e=>E_(e)&&e.subjectType==="pull_request")),this.selectedRemoteInstance=Uw(()=>{let e=this.formRemoteInstanceId();return this.repoCapableInstances().find(i=>i.id===e)??null}),this.remoteIdentifierOptions=Uw(()=>{let e=this.selectedRemoteInstance(),i=e?L_(e.config):De,a=this.formRemoteIdentifier()?.trim()??"";return (a&&!i.includes(a)?[a,...i]:i).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 i=e.remoteRepo;if(!i)return "\u2014";let c=this.repoCapableInstances().find(x=>x.id===i.providerInstanceId)?.displayName||i.providerInstanceId;return `${i.identifier} (${c})`}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.formDefaultReviewers.set([]),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formLocalPath.set(e.localPath),this.formWorktreeBasePath.set(e.worktreeBasePath??""),this.formDefaultBranch.set(e.defaultBranch??""),this.formRemoteInstanceId.set(e.remoteRepo?.providerInstanceId??null),this.formRemoteIdentifier.set(e.remoteRepo?.identifier??null),this.formDefaultReviewers.set([...e.remoteRepo?.defaultReviewers??[]]),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 i=e?L_(this.repoCapableInstances().find(c=>c.id===e)?.config):[],a=this.formRemoteIdentifier();a&&!i.includes(a)?this.formRemoteIdentifier.set(i[0]??null):!a&&i.length===1?this.formRemoteIdentifier.set(i[0]):e||(this.formRemoteIdentifier.set(null),this.formDefaultReviewers.set([]));}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=this.formRemoteInstanceId()?.trim()??"",i=this.formRemoteIdentifier()?.trim()??"",a=this.formDefaultReviewers().map(R=>R.trim()).filter(Boolean),c=e&&i?r$1({providerInstanceId:e,identifier:i},a.length>0?{defaultReviewers:a}:{}):null,x=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:c??void 0}),F=this.editingId();(F?this.reposApi.update(F,s(r$1({},x),{remoteRepo:c})):this.reposApi.create(x)).pipe(ue(this.destroyRef)).subscribe({next:R=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.repos.update(xe=>[...xe.filter(N=>N.id!==R.id),R].sort((N,ve)=>N.name.localeCompare(ve.name))),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.set(""),this.formRemoteInstanceId.set(null),this.formRemoteIdentifier.set(null),this.formDefaultReviewers.set([]);},error:R=>{this.saving.set(false),this.saveError.set(this.errorMessage(R,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(i=>i.filter(a=>a.id!==e.id));},error:i=>{this.deleteError.set(this.errorMessage(i,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,i){return e instanceof bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275cmp=ZE({type:o,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"],["data-testid","local-repo-default-reviewers","nzMode","tags",3,"ngModelChange","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(i,a){i&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,Re,3,3,"p",3)(9,be,2,1,"p",4)(10,Se,4,3),Jc()),i&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 o})();var pt=(()=>{class o{static{this.\u0275fac=function(i){return new(i||o)};}static{this.\u0275cmp=ZE({type:o,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(i,a){i&1&&uh(0,"app-local-repository-list");},dependencies:[Ce],encapsulation:2});}}return o})();export{pt as LocalRepositoriesManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-Dt7AgNFd.js';import {K as Kt}from'./chunk-CiB-X52X.js';import {T}from'./chunk-IZZsw-Ul.js';import'./chunk-zWWkMLc1.js';import'./chunk-g20-BKKx.js';import {L as Lt$1,u as ut$1,D as Di,m as mn}from'./chunk-DyGh8J3-.js';import'./chunk-D5BPM_KC.js';import {C,$,a as C1,V as Ve,b as at,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,f as rl,g as $i,v as v3,h as ex,F as Fm,A as Am,K as Kt$1,j as _i,I as Iw,P as Pw,J as Jc,m as mh,k as iE,l as _D,n as gI,L as Lh,o as Fw,p as lh,w as aE,x as rl$1,S as Sh,M as MD,H as HD,y as FD,z as xD,N as ND,B as uh,D as AD,E as ch,G as Aw,O as Fu,Q as ju}from'./main-GFNB573R.js';var rt=e=>["/jobs",e];function lt(e,r){return this.queuedTrack(r)}var dt=(e,r)=>r.id;function pt(e,r){e&1&&(_i(0,"p",8),Iw(1),Pw(2,"transloco"),Jc()),e&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ct(e,r){if(e&1&&(_i(0,"p",9),Iw(1),Jc()),e&2){let t=HD(2);gI(),Lh(t.activeError());}}function mt(e,r){e&1&&(_i(0,"p",12),Iw(1),Pw(2,"transloco"),Jc()),e&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.waitingEmpty")," "));}function ht(e,r){if(e&1&&uh(0,"app-job-status-table",13),e&2){let t=HD(3);lh("jobs",t.active().waitingForHuman)("showCompleted",false);}}function ut(e,r){e&1&&(_i(0,"p",15),Iw(1),Pw(2,"transloco"),Jc()),e&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.runningEmpty")," "));}function gt(e,r){if(e&1&&uh(0,"app-job-status-table",13),e&2){let t=HD(3);lh("jobs",t.active().running)("showCompleted",false);}}function _t(e,r){e&1&&(_i(0,"p",17),Iw(1),Pw(2,"transloco"),Jc()),e&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.queuedEmpty")," "));}function bt(e,r){if(e&1&&(_i(0,"tr")(1,"td")(2,"a",19),Iw(3),Jc(),_i(4,"div",20),Iw(5),Jc()(),_i(6,"td",21),Iw(7),Jc(),_i(8,"td",22)(9,"time"),Iw(10),Jc(),_i(11,"span",23),Iw(12),Jc()()()),e&2){let t=r.$implicit,o=HD(4);ch("data-testid","queued-row-"+t.jobId),gI(2),lh("routerLink",Aw(9,rt,t.jobId)),ch("data-testid","queued-job-link-"+t.jobId),gI(),rl$1(" ",o.composeJobTitle(t.job)," "),gI(2),Lh(t.jobId),gI(2),Lh(t.agentInstanceId),gI(2),ch("datetime",t.enqueuedAt),gI(),Lh(t.enqueuedAt),gI(2),Lh(o.queuedWaitLabel(t.enqueuedAt));}}function ft(e,r){if(e&1&&(_i(0,"table",18)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc()()(),_i(12,"tbody"),xD(13,bt,13,11,"tr",null,lt,true),Jc()()),e&2){let t=HD(3);gI(4),Lh(Fw(5,3,"jobs.table.column.id")),gI(3),Lh(Fw(8,5,"jobs.list.queuedAgent")),gI(3),Lh(Fw(11,7,"jobs.list.queuedAt")),gI(3),AD(t.active().queued);}}function Ct(e,r){if(e&1&&(_i(0,"section",10)(1,"header",11)(2,"h2"),Iw(3),Pw(4,"transloco"),Jc()(),_D(5,mt,3,3,"p",12)(6,ht,1,2,"app-job-status-table",13),Jc(),_i(7,"section",14)(8,"header",11)(9,"h2"),Iw(10),Pw(11,"transloco"),Jc()(),_D(12,ut,3,3,"p",15)(13,gt,1,2,"app-job-status-table",13),Jc(),_i(14,"section",16)(15,"header",11)(16,"h2"),Iw(17),Pw(18,"transloco"),Jc()(),_D(19,_t,3,3,"p",17)(20,ft,15,9,"table",18),Jc()),e&2){let t=HD(2);gI(3),Lh(Fw(4,6,"jobs.list.waitingForHuman")),gI(2),MD(t.active().waitingForHuman.length===0?5:6),gI(5),Lh(Fw(11,8,"jobs.list.running")),gI(2),MD(t.active().running.length===0?12:13),gI(5),Lh(Fw(18,10,"jobs.list.queued")),gI(2),MD(t.active().queued.length===0?19:20);}}function xt(e,r){if(e&1&&(_i(0,"div",6),_D(1,pt,3,3,"p",8)(2,ct,2,1,"p",9)(3,Ct,21,12),Jc()),e&2){let t=HD();gI(),MD(t.activeLoading()?1:t.activeError()?2:3);}}function yt(e,r){if(e&1&&(uh(0,"nz-option",27),Pw(1,"transloco"),Pw(2,"transloco")),e&2){let t=r.$implicit,o=HD(2);lh("nzValue",t)("nzLabel",t==="all"?Fw(1,2,"jobs.list.filterAll"):Fw(2,4,o.statusKey(t)));}}function vt(e,r){if(e&1&&uh(0,"nz-option",27),e&2){let t=r.$implicit;lh("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function wt(e,r){e&1&&(_i(0,"p",30),Iw(1),Pw(2,"transloco"),Jc()),e&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Mt(e,r){if(e&1&&(_i(0,"p",31),Iw(1),Jc()),e&2){let t=HD(2);gI(),Lh(t.historyError());}}function St(e,r){e&1&&(_i(0,"p",32),Iw(1),Pw(2,"transloco"),Jc()),e&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.historyEmpty")," "));}function Lt(e,r){if(e&1){let t=FD();_i(0,"nz-pagination",35),mh("nzPageIndexChange",function(l){Fu(t);let h=HD(3);return ju(h.setHistoryPage(l))}),Jc();}if(e&2){let t=HD(3);lh("nzPageIndex",t.historyPageIndex())("nzPageSize",t.pageSize)("nzTotal",t.historyTotal());}}function Pt(e,r){if(e&1&&(uh(0,"app-job-status-table",33),_D(1,Lt,1,3,"nz-pagination",34)),e&2){let t=HD(2);lh("jobs",t.historyJobs()),gI(),MD(t.historyTotal()>t.pageSize||t.historyPageIndex()>1?1:-1);}}function It(e,r){if(e&1){let t=FD();_i(0,"div",7)(1,"div",24)(2,"div",25)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"nz-select",26),mh("ngModelChange",function(l){Fu(t);let h=HD();return ju(h.setHistoryStatusFilter(l))}),xD(7,yt,3,6,"nz-option",27,ND),Jc(),iE(),Jc(),_i(9,"div",25)(10,"span"),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"nz-select",28),mh("ngModelChange",function(l){Fu(t);let h=HD();return ju(h.setHistoryWorkflowId(l))}),uh(14,"nz-option",29),Pw(15,"transloco"),xD(16,vt,1,2,"nz-option",27,dt),Jc(),iE(),Jc()(),_D(18,wt,3,3,"p",30)(19,Mt,2,1,"p",31)(20,St,3,3,"p",32)(21,Pt,2,2),Jc();}if(e&2){let t=HD();gI(4),Lh(Fw(5,6,"jobs.list.filterByStatus")),gI(2),lh("ngModel",t.historyStatusFilter()),aE(),gI(),AD(t.historyStatusOptions),gI(4),Lh(Fw(12,8,"jobs.list.filterByWorkflow")),gI(2),lh("ngModel",t.historyWorkflowId()),aE(),gI(),lh("nzLabel",Fw(15,10,"jobs.list.filterAll")),gI(2),AD(t.workflows()),gI(2),MD(t.historyLoading()?18:t.historyError()?19:t.historyJobs().length===0?20:21);}}var Et=20,jt=3e3,st=["pending","planning","waiting_for_human","waiting_for_children","implementing","testing","completed","failed","cancelled"],zt={waitingForHuman:[],running:[],queued:[]},Qt=(()=>{class e{constructor(){this.jobsApi=C($),this.workflowsApi=C(b),this.route=C(C1),this.transloco=C(Ve),this.destroyRef=C(at),this.pageSize=Et,this.historyStatusOptions=["all",...st],this.composeJobTitle=T,this.tab=qo("active"),this.active=qo(zt),this.historyJobs=qo([]),this.workflows=qo([]),this.activeLoading=qo(true),this.historyLoading=qo(true),this.activeError=qo(null),this.historyError=qo(null),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Uw(()=>{let t=(this.historyPageIndex()-1)*this.pageSize,o=this.historyJobs().length;return o<this.pageSize?t+o:t+o+1}),this.pollHandle=null,this.activeLoadGen=0,this.historyLoadGen=0,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadActive({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue(this.destroyRef)).subscribe(t=>{let o=t.get("status");o==="waiting_for_human"?(this.tab.set("active"),this.historyStatusFilter.set("all")):o&&st.includes(o)?(this.tab.set("history"),this.historyStatusFilter.set(o)):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadActive(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(t){return `jobs.status.${t}`}isPolling(){return this.polling()}setTab(t){this.tab.set(t);}setHistoryStatusFilter(t){this.historyStatusFilter.set(t),this.historyPageIndex.set(1),this.loadHistory();}setHistoryWorkflowId(t){this.historyWorkflowId.set(t),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(t){this.showChildJobs.set(t),this.historyPageIndex.set(1),this.loadActive(),this.loadHistory();}setHistoryPage(t){this.historyPageIndex.set(t),this.loadHistory();}queuedWaitLabel(t){let o=Date.now()-Date.parse(t),l=Number.isFinite(o)?Math.max(0,Math.floor(o/1e3)):0;if(l<60)return `${l}s`;let h=Math.floor(l/60);return h<60?`${h}m`:`${Math.floor(h/60)}h`}queuedTrack(t){return `${t.jobId}:${t.stepExecutionId}`}loadWorkflows(){this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.workflows.set(t);},error:()=>{this.workflows.set([]);}});}loadActive(t={}){let o=++this.activeLoadGen;t.silent||(this.activeLoading.set(true),this.activeError.set(null)),this.jobsApi.listActive({topLevelOnly:!this.showChildJobs()}).pipe(ue(this.destroyRef)).subscribe({next:l=>{o===this.activeLoadGen&&(this.active.set(l),this.activeLoading.set(false));},error:l=>{o===this.activeLoadGen&&(this.activeLoading.set(false),!t.silent&&this.activeError.set(this.errorMessage(l,this.transloco.translate("jobs.list.loadFailed"))));}});}loadHistory(t={}){let o=++this.historyLoadGen,l=this.historyStatusFilter(),h=this.historyWorkflowId();t.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r$1(r$1({topLevelOnly:!this.showChildJobs()},l==="all"?{}:{status:l}),h?{workflowId:h}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue(this.destroyRef)).subscribe({next:v=>{o===this.historyLoadGen&&(this.historyJobs.set(v),this.historyLoading.set(false));},error:v=>{o===this.historyLoadGen&&(this.historyLoading.set(false),!t.silent&&this.historyError.set(this.errorMessage(v,this.transloco.translate("jobs.list.loadFailed"))));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadActive({silent:true}),this.loadHistory({silent:true});},jt),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(t,o){return t instanceof bi||t instanceof Error?t.message:o}static{this.\u0275fac=function(o){return new(o||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-job-list"]],decls:17,vars:18,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-tabs","aria-label","Jobs sections",1,"tabs"],["type","button","data-testid","jobs-tab-active",1,"tab",3,"click"],["type","button","data-testid","jobs-tab-history",1,"tab",3,"click"],["data-testid","jobs-active",1,"tab-panel"],["data-testid","jobs-history",1,"tab-panel","section-history"],["data-testid","active-loading"],["data-testid","active-error",1,"error"],["data-testid","jobs-waiting",1,"section"],[1,"section-header"],["data-testid","waiting-empty",1,"section-empty"],[3,"jobs","showCompleted"],["data-testid","jobs-running",1,"section"],["data-testid","running-empty",1,"section-empty"],["data-testid","jobs-queued",1,"section"],["data-testid","queued-empty",1,"section-empty"],["data-testid","jobs-queued-table",1,"queued-table"],[3,"routerLink"],[1,"job-row-id","mono"],["data-testid","queued-agent"],["data-testid","queued-at"],[1,"queued-wait"],[1,"filters"],[1,"field"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(o,l){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"label",2),mh("ngModelChange",function(v){return l.setShowChildJobs(v)}),Iw(6),Pw(7,"transloco"),Jc(),iE(),Jc(),_i(8,"nav",3)(9,"button",4),mh("click",function(){return l.setTab("active")}),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"button",5),mh("click",function(){return l.setTab("history")}),Iw(13),Pw(14,"transloco"),Jc()(),_D(15,xt,4,1,"div",6)(16,It,22,12,"div",7),Jc()),o&2&&(gI(3),Lh(Fw(4,10,"jobs.list.title")),gI(2),lh("ngModel",l.showChildJobs()),aE(),gI(),rl$1(" ",Fw(7,12,"jobs.list.showChildJobs")," "),gI(3),Sh("tab-active",l.tab()==="active"),gI(),rl$1(" ",Fw(11,14,"jobs.list.tabActive")," "),gI(2),Sh("tab-active",l.tab()==="history"),gI(),rl$1(" ",Fw(14,16,"jobs.list.tabHistory")," "),gI(2),MD(l.tab()==="active"?15:16));},dependencies:[$8,al,rl,$i,v3,Lt$1,ut$1,Di,mn,ex,Fm,Am,Kt,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:center}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.child-toggle[_ngcontent-%COMP%]{flex-shrink:0;white-space:nowrap}.tabs[_ngcontent-%COMP%]{display:flex;gap:.25rem;border-bottom:1px solid #e7e5e4}.tab[_ngcontent-%COMP%]{appearance:none;background:transparent;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;padding:.5rem .85rem;cursor:pointer;font:inherit;color:#57534e}.tab-active[_ngcontent-%COMP%]{color:#1c1917;border-bottom-color:#1c1917;font-weight:600}.tab-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.queued-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .queued-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{text-align:left;padding:.5rem .75rem .5rem 0;border-bottom:1px solid #e7e5e4;vertical-align:top}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e;font-weight:600}.job-row-id[_ngcontent-%COMP%]{font-size:.75rem;color:#78716c;margin-top:.15rem}.queued-wait[_ngcontent-%COMP%]{display:block;font-size:.8rem;color:#78716c;margin-top:.15rem}.mono[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return e})();export{st as ALL_JOB_STATUSES,Et as JOB_LIST_PAGE_SIZE,jt as JOB_RUNNING_POLL_MS,Qt as JobListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,b4 as N2,aV as ix,b5 as cx,ba as Se,i as ie}from'./main-
|
|
1
|
+
import {C,b4 as N2,aV as ix,b5 as cx,ba as Se,i as ie}from'./main-GFNB573R.js';var f=(()=>{class i{constructor(){this.http=C(N2),this.apiBase=ix.apiBaseUrl;}getSettings(){return this.http.get(`${this.apiBase}/settings`).pipe(cx())}updateSettings(t){return this.http.patch(`${this.apiBase}/settings`,t).pipe(cx())}listProviderInstances(){return this.http.get(`${this.apiBase}/provider-instances`).pipe(cx())}createProviderInstance(t){return this.http.post(`${this.apiBase}/provider-instances`,t).pipe(cx())}updateProviderInstance(t,r){return this.http.patch(`${this.apiBase}/provider-instances/${encodeURIComponent(t)}`,r).pipe(cx())}deleteProviderInstance(t){return this.http.delete(`${this.apiBase}/provider-instances/${encodeURIComponent(t)}`).pipe(cx())}testProviderConnection(t){return this.http.post(`${this.apiBase}/provider-instances/${encodeURIComponent(t)}/test-connection`,{}).pipe(cx())}getProviderStatus(){return this.http.get(`${this.apiBase}/providers/status`).pipe(cx())}setSecret(t,r){return this.http.post(`${this.apiBase}/secrets/${encodeURIComponent(t)}`,{value:r},{responseType:"text"}).pipe(Se(()=>{}),cx())}static{this.\u0275fac=function(r){return new(r||i)};}static{this.\u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();export{f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {p as pc,a as as,d as dc,K as Kl,U as Ul,c as cc,J as Ji,l as ls,e as es}from'./chunk-DyGh8J3-.js';import {a6 as q0,a7 as U0,q as qo,U as Uw,Z as ZE,d as $8,v as v3,a0 as pf,a1 as bd,a2 as sp,a3 as fp,K as Kt,j as _i,l as _D,I as Iw,P as Pw,J as Jc,z as xD,n as gI,M as MD,p as lh,L as Lh,o as Fw,D as AD,y as FD,m as mh,H as HD,x as rl,az as jw,G as Aw,E as ch,O as Fu,Q as ju}from'./main-GFNB573R.js';var Q=t=>({count:t}),U=t=>["/jobs",t],X=(t,c)=>c.id;function Y(t,c){if(t&1){let e=FD();_i(0,"div",1)(1,"button",4),mh("click",function(){Fu(e);let o=HD();return ju(o.emitBulk())}),Iw(2),Pw(3,"transloco"),Jc()();}if(t&2){let e=HD();gI(),lh("disabled",e.checkedCount()===0),gI(),rl(" ",jw(3,2,"runnableTable.runSelected",Aw(5,Q,e.checkedCount()))," ");}}function Z(t,c){if(t&1){let e=FD();_i(0,"th",5),mh("nzCheckedChange",function(o){Fu(e);let s=HD();return ju(s.onAllChecked(o))}),Jc();}if(t&2){let e=HD();lh("nzChecked",e.allChecked())("nzIndeterminate",e.someChecked());}}function ee(t,c){t&1&&(_i(0,"th"),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"runnableTable.column.actions")));}function te(t,c){if(t&1){let e=FD();_i(0,"td",12),mh("nzCheckedChange",function(o){Fu(e);let s=HD().$implicit,H=HD();return ju(H.onItemChecked(s.id,o))}),Jc();}if(t&2){let e=HD().$implicit,n=HD();lh("nzChecked",n.checkedIds().has(e.id)),ch("data-testid","check-"+e.id);}}function ne(t,c){if(t&1&&(_i(0,"span",9),Iw(1),Jc()),t&2){let e=HD().$implicit;ch("data-testid","subtitle-"+e.id),gI(),Lh(e.subtitle);}}function ie(t,c){if(t&1&&(_i(0,"a",10),Iw(1),Pw(2,"transloco"),Jc()),t&2){let e=c,n=HD().$implicit,o=HD();lh("routerLink",Aw(5,U,e.id)),ch("data-testid","latest-"+n.id),gI(),rl(" ",Fw(2,3,o.statusKey(e.status))," ");}}function oe(t,c){if(t&1&&(_i(0,"span",11),Iw(1),Pw(2,"transloco"),Jc()),t&2){let e=HD().$implicit;ch("data-testid","latest-"+e.id),gI(),Lh(Fw(2,2,"runnableTable.neverRun"));}}function ae(t,c){if(t&1){let e=FD();_i(0,"td")(1,"button",13),mh("click",function(){Fu(e);let o=HD().$implicit,s=HD();return ju(s.emitRow(o.id))}),Iw(2),Pw(3,"transloco"),Jc()();}if(t&2){let e=HD().$implicit;gI(),ch("data-testid","run-"+e.id),gI(),rl(" ",Fw(3,2,"runnableTable.run")," ");}}function le(t,c){if(t&1&&(_i(0,"tr"),_D(1,te,1,2,"td",6),_i(2,"td")(3,"div",7)(4,"span",8),Iw(5),Jc(),_D(6,ne,2,2,"span",9),Jc()(),_i(7,"td"),_D(8,ie,3,7,"a",10)(9,oe,3,4,"span",11),Jc(),_D(10,ae,4,4,"td"),Jc()),t&2){let e,n=c.$implicit,o=HD();ch("data-testid","row-"+n.id),gI(),MD(o.selectable()?1:-1),gI(3),ch("data-testid","label-"+n.id),gI(),Lh(n.primaryLabel),gI(),MD(n.subtitle?6:-1),gI(2),MD((e=n.latestJob)?8:9,e),gI(2),MD(o.showRowAction()?10:-1);}}var we=(()=>{class t{constructor(){this.rows=q0([]),this.selectable=q0(false),this.showRowAction=q0(true),this.rowAction=U0(),this.bulkAction=U0(),this.checkedIds=qo(new Set),this.checkedCount=Uw(()=>this.checkedIds().size),this.allChecked=Uw(()=>{let e=this.rows();return e.length>0&&e.every(n=>this.checkedIds().has(n.id))}),this.someChecked=Uw(()=>{let e=this.checkedCount();return e>0&&e<this.rows().length});}onItemChecked(e,n){this.checkedIds.update(o=>{let s=new Set(o);return n?s.add(e):s.delete(e),s});}onAllChecked(e){this.checkedIds.set(e?new Set(this.rows().map(n=>n.id)):new Set);}emitBulk(){this.bulkAction.emit([...this.checkedIds()]);}emitRow(e){this.rowAction.emit(e);}statusKey(e){return `jobs.status.${e}`}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-runnable-items-table"]],inputs:{rows:[1,"rows"],selectable:[1,"selectable"],showRowAction:[1,"showRowAction"]},outputs:{rowAction:"rowAction",bulkAction:"bulkAction"},decls:16,vars:12,consts:[["data-testid","runnable-items-table",1,"runnable-table"],["data-testid","bulk-bar",1,"bulk-bar"],[3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","select-all",3,"nzChecked","nzIndeterminate"],["nz-button","","type","button","data-testid","run-selected",3,"click","disabled"],["data-testid","select-all",3,"nzCheckedChange","nzChecked","nzIndeterminate"],[3,"nzChecked"],[1,"item"],[1,"primary"],[1,"subtitle"],[3,"routerLink"],[1,"never"],[3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"]],template:function(n,o){n&1&&(_i(0,"div",0),_D(1,Y,4,7,"div",1),_i(2,"nz-table",2)(3,"thead")(4,"tr"),_D(5,Z,1,2,"th",3),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_D(12,ee,3,3,"th"),Jc()(),_i(13,"tbody"),xD(14,le,11,7,"tr",null,X),Jc()()()),n&2&&(gI(),MD(o.selectable()?1:-1),gI(),lh("nzData",o.rows())("nzFrontPagination",false)("nzShowPagination",false),gI(3),MD(o.selectable()?5:-1),gI(2),Lh(Fw(8,8,"runnableTable.column.item")),gI(3),Lh(Fw(11,10,"runnableTable.column.latestRun")),gI(2),MD(o.showRowAction()?12:-1),gI(2),AD(o.rows()));},dependencies:[$8,v3,pf,bd,sp,fp,pc,as,dc,Kl,Ul,cc,Ji,ls,es,Kt],styles:[".runnable-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.bulk-bar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.15rem}.primary[_ngcontent-%COMP%]{font-weight:600}.subtitle[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.never[_ngcontent-%COMP%]{color:#78716c}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return t})();export{we as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a8 as KE,a9 as fu,bP as hn,aA as mT,C,aa as Z0,ac as Oe$1,aB as yT,aC as zt,Z as ZE,as as st,at as Ee$1,au as w5,av as K0,ak as $D,l as _D,j as _i,J as Jc,M as MD,n as gI,aQ as aw,S as Sh,am as Ih,an as WD,ao as GD,aM as Yl,bQ as Wr,r as r$1,aj as ly,H as HD,aw as rh,p as lh,B as uh,aR as xw,al as UD,z as xD,aO as SD,D as AD,bR as eD,bS as dh,aP as Mh,aJ as tl,I as Iw,aK as nl,L as Lh,bT as oh,ax as Eh,ad as Er,N as ND}from'./main-GFNB573R.js';var Ce=["*"];function fe(e,a){if(e&1&&(_i(0,"div",0),uh(1,"nz-skeleton-element",4),Jc()),e&2){let t=HD(2);gI(),lh("nzSize",t.avatar.size||"default")("nzShape",t.avatar.shape||"circle");}}function _e(e,a){if(e&1&&uh(0,"h3",5),e&2){let t=HD(2);Mh("width",t.toCSSUnit(t.title.width));}}function ve(e,a){if(e&1&&uh(0,"li"),e&2){let t=a.$index,n=HD(3);Mh("width",n.toCSSUnit(n.widthList[t]));}}function ge(e,a){if(e&1&&(_i(0,"ul",3),xD(1,ve,1,2,"li",6,ND),Jc()),e&2){let t=HD(2);gI(),AD(t.rowsList);}}function he(e,a){if(e&1&&(_D(0,fe,2,2,"div",0),_i(1,"div",1),_D(2,_e,1,2,"h3",2),_D(3,ge,3,0,"ul",3),Jc()),e&2){let t=HD();MD(t.nzAvatar?0:-1),gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzParagraph?3:-1);}}function Se(e,a){e&1&&UD(0);}var Te=(()=>{class e{nzActive=false;nzType;nzBlock=false;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["nz-skeleton-element"]],hostAttrs:[1,"ant-skeleton","ant-skeleton-element"],hostVars:4,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-active",i.nzActive)("ant-skeleton-block",i.nzBlock);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzType:"nzType",nzBlock:[2,"nzBlock","nzBlock",K0]}})}return e})();var ye=(()=>{class e{nzShape="circle";nzSize="default";styleMap={};ngOnChanges(t){if(t.nzSize&&typeof this.nzSize=="number"){let n=`${this.nzSize}px`;this.styleMap={width:n,height:n,"line-height":n};}else this.styleMap={};}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton-element","nzType","avatar"]],inputs:{nzShape:"nzShape",nzSize:"nzSize"},features:[ly],decls:1,vars:10,consts:[[1,"ant-skeleton-avatar"]],template:function(n,i){n&1&&dh(0,"span",0),n&2&&(aw(i.styleMap),Sh("ant-skeleton-avatar-square",i.nzShape==="square")("ant-skeleton-avatar-circle",i.nzShape==="circle")("ant-skeleton-avatar-lg",i.nzSize==="large")("ant-skeleton-avatar-sm",i.nzSize==="small"));},encapsulation:2})}return e})();var ce=(()=>{class e{cdr=C(Z0);nzActive=false;nzLoading=true;nzRound=false;nzTitle=true;nzAvatar=false;nzParagraph=true;title;avatar;paragraph;rowsList=[];widthList=[];toCSSUnit(t=""){return Wr(t)}getTitleProps(){let t=!!this.nzAvatar,n=!!this.nzParagraph,i="";return !t&&n?i="38%":t&&n&&(i="50%"),r$1({width:i},this.getProps(this.nzTitle))}getAvatarProps(){let t=this.nzTitle&&!this.nzParagraph?"square":"circle";return r$1({shape:t,size:"large"},this.getProps(this.nzAvatar))}getParagraphProps(){let t=!!this.nzAvatar,n=!!this.nzTitle,i={};return (!t||!n)&&(i.width="61%"),!t&&n?i.rows=3:i.rows=2,r$1(r$1({},i),this.getProps(this.nzParagraph))}getProps(t){return t&&typeof t=="object"?t:{}}getWidthList(){let{width:t,rows:n}=this.paragraph,i=[];return t&&Array.isArray(t)?i=t:t&&!Array.isArray(t)&&(i=[],i[n-1]=t),i}updateProps(){this.title=this.getTitleProps(),this.avatar=this.getAvatarProps(),this.paragraph=this.getParagraphProps(),this.rowsList=[...Array(this.paragraph.rows)],this.widthList=this.getWidthList(),this.cdr.markForCheck();}ngOnInit(){this.updateProps();}ngOnChanges(t){(t.nzTitle||t.nzAvatar||t.nzParagraph)&&this.updateProps();}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton"]],hostAttrs:[1,"ant-skeleton"],hostVars:6,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-with-avatar",!!i.nzAvatar)("ant-skeleton-active",i.nzActive)("ant-skeleton-round",i.nzRound);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzRound:[2,"nzRound","nzRound",K0],nzTitle:"nzTitle",nzAvatar:"nzAvatar",nzParagraph:"nzParagraph"},exportAs:["nzSkeleton"],features:[ly],ngContentSelectors:Ce,decls:2,vars:1,consts:[[1,"ant-skeleton-header"],[1,"ant-skeleton-content"],[1,"ant-skeleton-title",3,"width"],[1,"ant-skeleton-paragraph"],["nzType","avatar",3,"nzSize","nzShape"],[1,"ant-skeleton-title"],[3,"width"]],template:function(n,i){n&1&&($D(),_D(0,he,4,3)(1,Se,1,0)),n&2&&MD(i.nzLoading?0:1);},dependencies:[Te,ye],encapsulation:2})}return e})(),pe=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({})}return e})();function Ne(e,a){}function ke(e,a){if(e&1&&(_i(0,"div",0),rh(1,Ne,0,0,"ng-template",2),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzAvatar);}}function be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Me(e,a){if(e&1&&(_i(0,"div",3),rh(1,be,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Ae(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzDescription);}}function De(e,a){if(e&1&&(_i(0,"div",4),rh(1,Ae,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzDescription);}}function Ee(e,a){if(e&1&&(_i(0,"div",1),_D(1,Me,2,1,"div",3),_D(2,De,2,1,"div",4),Jc()),e&2){let t=HD();gI(),MD(t.nzTitle?1:-1),gI(),MD(t.nzDescription?2:-1);}}var me=["*"];function we(e,a){e&1&&UD(0);}var Pe=()=>({rows:4});function Be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Oe(e,a){if(e&1&&(_i(0,"div",6),rh(1,Be,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Fe(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzExtra);}}function Le(e,a){if(e&1&&(_i(0,"div",7),rh(1,Fe,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzExtra);}}function He(e,a){}function Ie(e,a){if(e&1&&rh(0,He,0,0,"ng-template",8),e&2){let t=HD(2);lh("ngTemplateOutlet",t.listOfNzCardTabComponent.template);}}function qe(e,a){if(e&1&&(_i(0,"div",0)(1,"div",5),_D(2,Oe,2,1,"div",6),_D(3,Le,2,1,"div",7),Jc(),_D(4,Ie,1,1,null,8),Jc()),e&2){let t=HD();gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzExtra?3:-1),gI(),MD(t.listOfNzCardTabComponent?4:-1);}}function je(e,a){}function Re(e,a){if(e&1&&(_i(0,"div",1),rh(1,je,0,0,"ng-template",8),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzCover);}}function Ge(e,a){e&1&&uh(0,"nz-skeleton",3),e&2&&lh("nzActive",true)("nzTitle",false)("nzParagraph",xw(3,Pe));}function Qe(e,a){e&1&&UD(0);}function Ve(e,a){}function $e(e,a){if(e&1&&(_i(0,"li")(1,"span"),rh(2,Ve,0,0,"ng-template",8),Jc()()),e&2){let t=a.$implicit,n=a.$count;Mh("width",100/n,"%"),gI(2),lh("ngTemplateOutlet",t);}}function Ue(e,a){if(e&1&&(_i(0,"ul",4),xD(1,$e,3,3,"li",10,SD),Jc()),e&2){let t=HD();gI(),AD(t.nzActions);}}var We=(()=>{class e{nzHoverable=true;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["","nz-card-grid",""]],hostAttrs:[1,"ant-card-grid"],hostVars:2,hostBindings:function(n,i){n&2&&Sh("ant-card-hoverable",i.nzHoverable);},inputs:{nzHoverable:[2,"nzHoverable","nzHoverable",K0]},exportAs:["nzCardGrid"]})}return e})(),Ze=(()=>{class e{nzTitle=null;nzDescription=null;nzAvatar=null;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-meta"]],hostAttrs:[1,"ant-card-meta"],inputs:{nzTitle:"nzTitle",nzDescription:"nzDescription",nzAvatar:"nzAvatar"},exportAs:["nzCardMeta"],decls:2,vars:2,consts:[[1,"ant-card-meta-avatar"],[1,"ant-card-meta-detail"],[3,"ngTemplateOutlet"],[1,"ant-card-meta-title"],[1,"ant-card-meta-description"],[4,"nzStringTemplateOutlet"]],template:function(n,i){n&1&&(_D(0,ke,2,1,"div",0),_D(1,Ee,3,2,"div",1)),n&2&&(MD(i.nzAvatar?0:-1),gI(),MD(i.nzTitle||i.nzDescription?1:-1));},dependencies:[w5,st,Ee$1],encapsulation:2})}return e})(),Je=(()=>{class e{template;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-tab"]],viewQuery:function(n,i){if(n&1&&Eh(Er,7),n&2){let S;WD(S=GD())&&(i.template=S.first);}},exportAs:["nzCardTab"],ngContentSelectors:me,decls:1,vars:0,template:function(n,i){n&1&&($D(),oh(0,we,1,0,"ng-template"));},encapsulation:2})}return e})(),ze="card",Ke=(()=>{let e,a=[],t=[],n,i=[],S=[],W,Z=[],J=[];return class U{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[Yl()],n=[Yl()],W=[Yl()],mT(null,null,e,{kind:"field",name:"nzBordered",static:false,private:false,access:{has:r=>"nzBordered"in r,get:r=>r.nzBordered,set:(r,l)=>{r.nzBordered=l;}},metadata:C},a,t),mT(null,null,n,{kind:"field",name:"nzHoverable",static:false,private:false,access:{has:r=>"nzHoverable"in r,get:r=>r.nzHoverable,set:(r,l)=>{r.nzHoverable=l;}},metadata:C},i,S),mT(null,null,W,{kind:"field",name:"nzSize",static:false,private:false,access:{has:r=>"nzSize"in r,get:r=>r.nzSize,set:(r,l)=>{r.nzSize=l;}},metadata:C},Z,J),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}cdr=C(Z0);dir=C(Oe$1).valueSignal;_nzModuleName=ze;nzBordered=yT(this,a,true);nzLoading=(yT(this,t),false);nzHoverable=yT(this,i,false);nzBodyStyle=(yT(this,S),null);nzCover;nzActions=[];nzType=null;nzSize=yT(this,Z,"default");nzTitle=yT(this,J);nzExtra;listOfNzCardTabComponent;listOfNzCardGridDirective;constructor(){zt(ze,()=>this.cdr.markForCheck());}static \u0275fac=function(r){return new(r||U)};static \u0275cmp=ZE({type:U,selectors:[["nz-card"]],contentQueries:function(r,l,K){if(r&1&&Ih(K,Je,5)(K,We,4),r&2){let E;WD(E=GD())&&(l.listOfNzCardTabComponent=E.first),WD(E=GD())&&(l.listOfNzCardGridDirective=E);}},hostAttrs:[1,"ant-card"],hostVars:16,hostBindings:function(r,l){r&2&&Sh("ant-card-loading",l.nzLoading)("ant-card-bordered",l.nzBordered)("ant-card-hoverable",l.nzHoverable)("ant-card-small",l.nzSize==="small")("ant-card-contain-grid",l.listOfNzCardGridDirective&&l.listOfNzCardGridDirective.length)("ant-card-type-inner",l.nzType==="inner")("ant-card-contain-tabs",!!l.listOfNzCardTabComponent)("ant-card-rtl",l.dir()==="rtl");},inputs:{nzBordered:[2,"nzBordered","nzBordered",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzHoverable:[2,"nzHoverable","nzHoverable",K0],nzBodyStyle:"nzBodyStyle",nzCover:"nzCover",nzActions:"nzActions",nzType:"nzType",nzSize:"nzSize",nzTitle:"nzTitle",nzExtra:"nzExtra"},exportAs:["nzCard"],ngContentSelectors:me,decls:6,vars:6,consts:[[1,"ant-card-head"],[1,"ant-card-cover"],[1,"ant-card-body"],[3,"nzActive","nzTitle","nzParagraph"],[1,"ant-card-actions"],[1,"ant-card-head-wrapper"],[1,"ant-card-head-title"],[1,"ant-card-extra"],[3,"ngTemplateOutlet"],[4,"nzStringTemplateOutlet"],[3,"width"]],template:function(r,l){r&1&&($D(),_D(0,qe,5,3,"div",0),_D(1,Re,2,1,"div",1),_i(2,"div",2),_D(3,Ge,1,4,"nz-skeleton",3)(4,Qe,1,0),Jc(),_D(5,Ue,3,0,"ul",4)),r&2&&(MD(l.nzTitle||l.nzExtra||l.listOfNzCardTabComponent?0:-1),gI(),MD(l.nzCover?1:-1),gI(),aw(l.nzBodyStyle),gI(),MD(l.nzLoading?3:4),gI(2),MD(l.nzActions.length?5:-1));},dependencies:[st,Ee$1,w5,pe,ce],encapsulation:2})}})(),Nt=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({imports:[Ke,Ze,hn]})}return e})();export{Ke as K,Nt as N};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a8 as KE,a9 as fu,aA as mT,C,aa as Z0,b$ as Gm,ac as Oe,aB as yT,af as Le$1,aC as zt,Z as ZE,a4 as Ah,a5 as Th,as as st,at as Ee,c0 as Mn,aj as ly,av as K0,l as _D,M as MD,aM as Yl,y as FD,j as _i,c1 as tc,J as Jc,H as HD,S as Sh,p as lh,n as gI,aw as rh,m as mh,B as uh,aJ as tl,I as Iw,aK as nl,L as Lh,O as Fu,Q as ju,c2 as ph}from'./main-GFNB573R.js';function X(n,i){n&1&&ph(0);}function $(n,i){if(n&1&&rh(0,X,1,0,"ng-container",7),n&2){let e=HD(3);lh("nzStringTemplateOutlet",e.nzIcon);}}function nn(n,i){if(n&1&&uh(0,"nz-icon",6),n&2){let e=HD(3);lh("nzType",e.nzIconType||e.inferredIconType)("nzTheme",e.iconTheme);}}function en(n,i){if(n&1&&(_i(0,"div",2),_D(1,$,1,1,"ng-container")(2,nn,1,2,"nz-icon",6),Jc()),n&2){let e=HD(2);gI(),MD(e.nzIcon?1:2);}}function tn(n,i){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(4);gI(),Lh(e.nzMessage);}}function on(n,i){if(n&1&&(_i(0,"span",8),rh(1,tn,2,1,"ng-container",7),Jc()),n&2){let e=HD(3);gI(),lh("nzStringTemplateOutlet",e.nzMessage);}}function an(n,i){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(4);gI(),Lh(e.nzDescription);}}function rn(n,i){if(n&1&&(_i(0,"span",9),rh(1,an,2,1,"ng-container",7),Jc()),n&2){let e=HD(3);gI(),lh("nzStringTemplateOutlet",e.nzDescription);}}function ln(n,i){if(n&1&&(_i(0,"div",3),_D(1,on,2,1,"span",8),_D(2,rn,2,1,"span",9),Jc()),n&2){let e=HD(2);gI(),MD(e.nzMessage?1:-1),gI(),MD(e.nzDescription?2:-1);}}function cn(n,i){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(3);gI(),Lh(e.nzAction);}}function sn(n,i){if(n&1&&(_i(0,"div",4),rh(1,cn,2,1,"ng-container",7),Jc()),n&2){let e=HD(2);gI(),lh("nzStringTemplateOutlet",e.nzAction);}}function dn(n,i){if(n&1&&(tl(0),_i(1,"span",12),Iw(2),Jc(),nl()),n&2){let e=HD(4);gI(2),Lh(e.nzCloseText);}}function mn(n,i){if(n&1&&rh(0,dn,3,1,"ng-container",7),n&2){let e=HD(3);lh("nzStringTemplateOutlet",e.nzCloseText);}}function pn(n,i){n&1&&uh(0,"nz-icon",11);}function _n(n,i){if(n&1){let e=FD();_i(0,"button",10),mh("click",function(){Fu(e);let z=HD(2);return ju(z.closeAlert())}),_D(1,mn,1,1,"ng-container")(2,pn,1,0,"nz-icon",11),Jc();}if(n&2){let e=HD(2);gI(),MD(e.nzCloseText?1:2);}}function zn(n,i){if(n&1){let e=FD();_i(0,"div",1),tc(function(z){Fu(e);let T=HD();return ju(T.onLeaveAnimationDone(z))}),_D(1,en,3,1,"div",2),_D(2,ln,3,2,"div",3),_D(3,sn,2,1,"div",4),_D(4,_n,3,1,"button",5),Jc();}if(n&2){let e=HD();Sh("ant-alert-rtl",e.dir()==="rtl")("ant-alert-success",e.nzType==="success")("ant-alert-info",e.nzType==="info")("ant-alert-warning",e.nzType==="warning")("ant-alert-error",e.nzType==="error")("ant-alert-no-icon",!e.nzShowIcon)("ant-alert-banner",e.nzBanner)("ant-alert-closable",e.nzCloseable)("ant-alert-with-description",!!e.nzDescription),lh("nzNoAnimation",e.nzNoAnimation),gI(),MD(e.nzShowIcon?1:-1),gI(),MD(e.nzMessage||e.nzDescription?2:-1),gI(),MD(e.nzAction?3:-1),gI(),MD(e.nzCloseable||e.nzCloseText?4:-1);}}var Z="alert",un=(()=>{let n,i=[],e=[],_,z=[],T=[];return class D{static{let r=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],_=[Yl()],mT(null,null,n,{kind:"field",name:"nzCloseable",static:false,private:false,access:{has:t=>"nzCloseable"in t,get:t=>t.nzCloseable,set:(t,l)=>{t.nzCloseable=l;}},metadata:r},i,e),mT(null,null,_,{kind:"field",name:"nzShowIcon",static:false,private:false,access:{has:t=>"nzShowIcon"in t,get:t=>t.nzShowIcon,set:(t,l)=>{t.nzShowIcon=l;}},metadata:r},z,T),r&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:r});}cdr=C(Z0);animationType=C(Gm,{optional:true});dir=C(Oe).valueSignal;_nzModuleName=Z;nzAction=null;nzCloseText=null;nzIconType=null;nzMessage=null;nzDescription=null;nzType="info";nzCloseable=yT(this,i,false);nzShowIcon=(yT(this,e),yT(this,z,false));nzBanner=(yT(this,T),false);nzNoAnimation=false;nzIcon=null;nzOnClose=new Le$1;closed=false;iconTheme="fill";inferredIconType="info-circle";isTypeSet=false;isShowIconSet=false;constructor(){zt(Z,()=>this.cdr.markForCheck());}closeAlert(){this.closed=true,(this.nzNoAnimation||this.animationType==="NoopAnimations")&&this.nzOnClose.emit(true);}onLeaveAnimationDone(r){let t=r.target;if(this.nzNoAnimation||this.animationType==="NoopAnimations"){r.animationComplete();return}t.classList.add("ant-alert-motion-leave","ant-alert-motion-leave-active");let l=()=>{t.removeEventListener("transitionend",l),this.nzOnClose.emit(true),r.animationComplete();};t.addEventListener("transitionend",l);}ngOnChanges(r){let{nzShowIcon:t,nzDescription:l,nzType:J,nzBanner:K}=r;if(t&&(this.isShowIconSet=true),J)switch(this.isTypeSet=true,this.nzType){case "error":this.inferredIconType="close-circle";break;case "success":this.inferredIconType="check-circle";break;case "info":this.inferredIconType="info-circle";break;case "warning":this.inferredIconType="exclamation-circle";break}l&&(this.iconTheme=this.nzDescription?"outline":"fill"),K&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=true));}static \u0275fac=function(t){return new(t||D)};static \u0275cmp=ZE({type:D,selectors:[["nz-alert"]],inputs:{nzAction:"nzAction",nzCloseText:"nzCloseText",nzIconType:"nzIconType",nzMessage:"nzMessage",nzDescription:"nzDescription",nzType:"nzType",nzCloseable:[2,"nzCloseable","nzCloseable",K0],nzShowIcon:[2,"nzShowIcon","nzShowIcon",K0],nzBanner:[2,"nzBanner","nzBanner",K0],nzNoAnimation:[2,"nzNoAnimation","nzNoAnimation",K0],nzIcon:"nzIcon"},outputs:{nzOnClose:"nzOnClose"},exportAs:["nzAlert"],features:[ly],decls:1,vars:1,consts:[[1,"ant-alert",3,"nzNoAnimation","ant-alert-rtl","ant-alert-success","ant-alert-info","ant-alert-warning","ant-alert-error","ant-alert-no-icon","ant-alert-banner","ant-alert-closable","ant-alert-with-description"],[1,"ant-alert",3,"nzNoAnimation"],[1,"ant-alert-icon"],[1,"ant-alert-content"],[1,"ant-alert-action"],["type","button","tabindex","0",1,"ant-alert-close-icon"],[3,"nzType","nzTheme"],[4,"nzStringTemplateOutlet"],[1,"ant-alert-message"],[1,"ant-alert-description"],["type","button","tabindex","0",1,"ant-alert-close-icon",3,"click"],["nzType","close"],[1,"ant-alert-close-text"]],template:function(t,l){t&1&&_D(0,zn,5,23,"div",0),t&2&&MD(l.closed?-1:0);},dependencies:[Ah,Th,st,Ee,Mn],encapsulation:2})}})(),Gn=(()=>{class n{static \u0275fac=function(_){return new(_||n)};static \u0275mod=KE({type:n});static \u0275inj=fu({imports:[un]})}return n})();export{Gn as G,un as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,b0 as jn,V as Ve,bK as W0,
|
|
1
|
+
import {C,b0 as jn,V as Ve,bK as W0,a6 as q0,Z as ZE,e as al,bb as er,f as rl,g as $i,a0 as pf,a1 as bd,a2 as sp,a3 as fp,b1 as ts,j as _i,m as mh,J as Jc,k as iE,I as Iw,n as gI,p as lh,w as aE,x 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,z as xD,l as _D,o as Fw,D 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,E as ch,y as FD,S as Sh,aL as Fh,O as Fu,Q as ju}from'./main-GFNB573R.js';import {a as ai,z}from'./chunk-C07s4-rF.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-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};
|
|
1
|
+
import {a8 as KE,a9 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,a6 as q0,av as K0,ac 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,W as id,ah 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,E as ch,aG as lw,S as Sh,bx as z0,ad as Er,a7 as U0,r as r$1,bz as tl,b9 as Nl,aD as Nr,dl as Zr,bB as Xf,Z as ZE,a4 as Ah,a5 as Th,a0 as pf,a1 as bd,a2 as sp,a3 as fp,au as w5,ak 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,aj as ly,aE as J0,z as xD,aO as SD,D as AD,bk as St$1,ax as Eh,an as WD,ao as GD,bK as W0,H as HD,aH as QD,p as lh,j as _i,J as Jc,n as gI,al as UD,y as FD,O as Fu,Q as ju,k as iE,w as aE,ck as $h,dt as Cw,I as Iw,L as Lh,B as uh,G as Aw,du as bw,x as rl$1}from'./main-GFNB573R.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 {S as St}from'./chunk-C61nx2gP.js';import'./chunk-Bv65hEw_.js';import'./chunk-MciiAFro.js';import {Z as ZE,B as uh}from'./main-GFNB573R.js';import'./chunk-C07s4-rF.js';import'./chunk-zWWkMLc1.js';import'./chunk-DyGh8J3-.js';import'./chunk-D5BPM_KC.js';var c=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-context-files-manage"]],decls:1,vars:0,template:function(t,a){t&1&&uh(0,"app-context-file-list");},dependencies:[St],encapsulation:2});}}return e})();export{c as ContextFilesManageComponent};
|