@yinuo-ngm/server 1.0.11 → 1.0.13
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/lib/app.js +3 -1
- package/lib/plugins/error-handler.plugin.js +14 -0
- package/lib/plugins/static.plugin.js +4 -12
- package/lib/plugins/ws/topics/index.d.ts +2 -0
- package/lib/plugins/ws/topics/index.js +2 -0
- package/lib/plugins/ws/topics/svn.ws.d.ts +9 -0
- package/lib/plugins/ws/topics/svn.ws.js +46 -0
- package/lib/plugins/ws/ws.plugin.js +27 -11
- package/lib/routes/index.js +6 -0
- package/lib/routes/project.routes.js +16 -2
- package/lib/routes/sprite-browse.routes.d.ts +2 -0
- package/lib/routes/sprite-browse.routes.js +107 -0
- package/lib/routes/sprite.routes.js +40 -61
- package/lib/routes/static-files.routes.d.ts +2 -0
- package/lib/routes/static-files.routes.js +83 -0
- package/lib/routes/svn.routes.d.ts +2 -0
- package/lib/routes/svn.routes.js +53 -0
- package/package.json +6 -5
- package/www/3rdpartylicenses.txt +26 -0
- package/www/browser/{chunk-DJJC6FPO.js → chunk-25RT7L2O.js} +1 -1
- package/www/browser/{chunk-EP45FT55.js → chunk-2P5WKSWB.js} +2 -2
- package/www/browser/{chunk-FNLA2MNI.js → chunk-2XZHN52E.js} +1 -1
- package/www/browser/chunk-3MBM5AMR.js +1 -0
- package/www/browser/{chunk-AZV6AWGC.js → chunk-3V5PIKHE.js} +1 -1
- package/www/browser/{chunk-EC33AXSR.js → chunk-42JVTVYH.js} +1 -1
- package/www/browser/chunk-4IQIZX7Y.js +1 -0
- package/www/browser/{chunk-3MAJTMXX.js → chunk-4UAHOL42.js} +1 -1
- package/www/browser/{chunk-YVSVIACA.js → chunk-56SDBJDG.js} +1 -1
- package/www/browser/{chunk-IMQG3SAE.js → chunk-5DD65JMJ.js} +1 -1
- package/www/browser/{chunk-PTMJ422K.js → chunk-5EQOKH7G.js} +6 -6
- package/www/browser/chunk-6JH45SUC.js +1 -0
- package/www/browser/{chunk-G73D24UX.js → chunk-6X6PEDE5.js} +1 -1
- package/www/browser/{chunk-CO7S3LZV.js → chunk-AI6SNMEH.js} +1 -1
- package/www/browser/chunk-AMXCOT2F.js +1 -0
- package/www/browser/{chunk-J2JNFWJN.js → chunk-DP3VTELD.js} +1 -1
- package/www/browser/chunk-E6LF4XBJ.js +3 -0
- package/www/browser/chunk-EMK65RIU.js +1 -0
- package/www/browser/chunk-EYGWZTTT.js +1 -0
- package/www/browser/{chunk-CJISJEP3.js → chunk-GKY4LJF4.js} +1 -1
- package/www/browser/{chunk-V27A2EK4.js → chunk-HJC5MNP5.js} +1 -1
- package/www/browser/chunk-ITXWAN4J.js +1 -0
- package/www/browser/{chunk-GCKL62DR.js → chunk-IZNTCWTR.js} +1 -1
- package/www/browser/{chunk-CPA2B3DD.js → chunk-KN3WZJH7.js} +1 -1
- package/www/browser/chunk-KPO75P5E.js +1 -0
- package/www/browser/chunk-LWBZC6ZL.js +2 -0
- package/www/browser/{chunk-HCBKQAGF.js → chunk-NYXWJKSW.js} +1 -1
- package/www/browser/{chunk-ROB7EMN5.js → chunk-OC62FHHS.js} +1 -1
- package/www/browser/{chunk-POZS3PD3.js → chunk-QM5ROT66.js} +1 -1
- package/www/browser/{chunk-35COW2FA.js → chunk-W633D3VG.js} +1 -1
- package/www/browser/{chunk-53YRDYLS.js → chunk-X3HFJACM.js} +2 -2
- package/www/browser/chunk-YFAKNLWB.js +2 -0
- package/www/browser/{chunk-3PWCJ3D5.js → chunk-ZSPNEYSK.js} +1 -1
- package/www/browser/images/placeholder.png +0 -0
- package/www/browser/index.html +1 -1
- package/www/browser/main-O5GAJRDW.js +34 -0
- package/www/browser/chunk-37KQ3UTB.js +0 -1
- package/www/browser/chunk-3LDMO67C.js +0 -1
- package/www/browser/chunk-MD6RDGU4.js +0 -1
- package/www/browser/chunk-OUE23ZE4.js +0 -2
- package/www/browser/chunk-W6TCGG53.js +0 -1
- package/www/browser/chunk-XN5C33GH.js +0 -3
- package/www/browser/main-V3VSEZ7K.js +0 -29
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as k,b as f}from"./chunk-6JH45SUC.js";import{b as v}from"./chunk-SNCDDYQR.js";import{Ha as m,a as n,b as u,fd as c,gd as j,l as S,ma as g,qa as T,ra as l,z as b}from"./chunk-SJG2JCPL.js";var y=class p{constructor(t,e){this.ws=t;this.runtimeStore=e;this.ws.messages().subscribe(s=>this.onMessage(s)),this.ws.stateChanges().subscribe(s=>{s==="open"&&this.lastWsState!=="open"&&this.replaySubs(),this.lastWsState=s})}outputByTaskId=new Map;event$=new S;subs=new Map;lastWsState="idle";ensureConnected(){this.ws.connect()}subscribeTask(t,e=200){let s=t.trim();if(!s)return;let r=Math.max(0,Math.min(5e3,e|0));this.subs.get(s)!==r&&(this.subs.set(s,r),this.ws.isOpen()&&this.ws.send({op:"sub",topic:"task",taskId:s,tail:r}))}unsubscribeTask(t){let e=t.trim();this.subs.has(e)&&(this.subs.delete(e),this.ws.isOpen()&&this.ws.send({op:"unsub",topic:"task",taskId:e}))}resize(t,e,s){let r=String(t??"").trim();r&&this.ws.isOpen()&&this.ws.send({op:"resize",topic:"task",taskId:r,cols:e,rows:s})}output$(t){return this.ensureOutput(t).asObservable()}events$(){return this.event$.asObservable()}status$(t){return this.runtimeStore.status$(t)}replaySubs(){for(let[t,e]of this.subs.entries())this.ws.send({op:"sub",topic:"task",taskId:t,tail:e})}onMessage(t){let e=t?.op;if(e==="task.output"){let s=t.payload,r=String(s.taskId??"").trim();if(!r)return;this.ensureOutput(r).next(t);return}if(e==="task.event"){let s=t.payload,r=t.type,d=String(s.taskId??"").trim();if(!d)return;this.event$.next(t);let i=this.applyEventToRuntime(r,s);if(i&&this.runtimeStore.setRuntime(i),(r==="exited"||r==="failed")&&setTimeout(()=>this.outputByTaskId.delete(d),300*1e3),r==="failed"){let a=s,h=`[failed] ${a?.error??""}`.trim(),o={runId:a.runId,taskId:d,stream:"stderr",text:h+`
|
|
2
|
+
`};this.ensureOutput(d).next({op:"task.output",payload:o,ts:t.ts})}}}ensureOutput(t){let e=String(t??"").trim();return this.outputByTaskId.has(e)||this.outputByTaskId.set(e,new S),this.outputByTaskId.get(e)}applyEventToRuntime(t,e){let s=String(e?.taskId??"").trim(),r=String(e?.runId??"").trim();if(!s||!r)return null;let d=this.runtimeStore.runtimeSignal(s)(),i=d&&d.runId===r?n({},d):{taskId:s,runId:r,projectId:String(e?.projectId??d?.projectId??"").trim(),status:"idle"};switch(t){case"snapshot":let a=e;return i.projectId=String(a?.projectId??i.projectId??"").trim(),i.status=a.status,i.startedAt=a.startedAt,i.stoppedAt=a.stoppedAt,i.pid=a.pid,i.exitCode=a.exitCode,i.signal=a.signal,i;case"started":return i.projectId=String(e?.projectId??i.projectId??"").trim(),i.status="running",i.pid=e?.pid??i.pid,i.startedAt=e?.startedAt??i.startedAt??Date.now(),i.stoppedAt=void 0,i.exitCode=void 0,i.signal=void 0,i;case"stopRequested":return i.status="stopping",i;case"exited":return i.status="stopped",i.exitCode=e?.exitCode??null,i.signal=e?.signal??null,i.stoppedAt=e?.stoppedAt??Date.now(),i;case"failed":return i.status="failed",i.stoppedAt=i.stoppedAt??Date.now(),i.exitCode=i.exitCode??null,i.signal=i.signal??null,i;default:return null}}static \u0275fac=function(e){return new(e||p)(T(v),T(f))};static \u0275prov=g({token:p,factory:p.\u0275fac,providedIn:"root"})};var w=class p{api=l(k);runtimeStore=l(f);state=m({rowsByProject:{},loadingByProject:{},loadedAtByProject:{}});rowsOf(t){let e=(t??"").trim();return c(()=>this.state().rowsByProject[e]??[])}isLoading(t){let e=(t??"").trim();return c(()=>!!this.state().loadingByProject[e])}isLoaded(t){let e=(t??"").trim();return c(()=>this.state().loadedAtByProject[e]!=null)}async ensureLoaded(t,e){let s=(t??"").trim();if(!s)return;let r=this.state(),d=r.loadedAtByProject[s]!=null,i=!!r.loadingByProject[s];if(!(!e?.force&&(d||i))){this.state.update(a=>u(n({},a),{loadingByProject:u(n({},a.loadingByProject),{[s]:!0})}));try{let h=(await b(this.api.getViews(s))??[]).map(o=>({spec:o.spec,runtime:o.runtime?{taskId:o.runtime.taskId,projectId:o.runtime.projectId,runId:o.runtime.runId,status:o.runtime.status,pid:o.runtime.pid,startedAt:o.runtime.startedAt,stoppedAt:o.runtime.stoppedAt,exitCode:o.runtime.exitCode,signal:o.runtime.signal}:void 0}));for(let o of h)o.runtime&&this.runtimeStore.setRuntime(o.runtime);this.state.update(o=>u(n({},o),{rowsByProject:u(n({},o.rowsByProject),{[s]:h}),loadedAtByProject:u(n({},o.loadedAtByProject),{[s]:Date.now()})}))}finally{this.state.update(a=>u(n({},a),{loadingByProject:u(n({},a.loadingByProject),{[s]:!1})}))}}}setRows(t,e){let s=(t??"").trim();if(s){for(let r of e??[])r.runtime&&this.runtimeStore.setRuntime(r.runtime);this.state.update(r=>u(n({},r),{rowsByProject:u(n({},r.rowsByProject),{[s]:e??[]}),loadedAtByProject:u(n({},r.loadedAtByProject),{[s]:Date.now()})}))}}clear(t){let e=(t??"").trim();e&&this.state.update(s=>{let r=n({},s.rowsByProject),d=n({},s.loadingByProject),i=n({},s.loadedAtByProject);return delete r[e],delete d[e],delete i[e],{rowsByProject:r,loadingByProject:d,loadedAtByProject:i}})}static \u0275fac=function(e){return new(e||p)};static \u0275prov=g({token:p,factory:p.\u0275fac,providedIn:"root"})};var P=class p{api=l(k);stream=l(y);runtimeStore=l(f);catalog=l(w);projectId=m("");keyword=m("");loading=m(!1);selectedTaskId=m("");rows=c(()=>{let t=this.projectId();return t?this.catalog.rowsOf(t)():[]});rowsView=c(()=>this.rows().map(e=>{let s=e.spec.id,r=this.getRuntimeSignal(s);return u(n({},e),{runtime:r??e.runtime})}));rowsViewFiltered=c(()=>{let t=this.keyword().trim().toLowerCase(),e=this.rowsView();return t?e.filter(s=>s.spec.name?.toLowerCase().includes(t)):e});selectedRow=c(()=>{let t=this.selectedTaskId();return this.rowsView().find(e=>e.spec.id===t)??null});selectedRuntimeStatus=c(()=>{let t=this.selectedTaskId();return t?this.getRuntime(t):{status:"idle"}});isRunning=c(()=>this.selectedRuntimeStatus().status==="running");isStopping=c(()=>this.selectedRuntimeStatus().status==="stopping");isStopped=c(()=>{let t=this.selectedRuntimeStatus().status;return t==="idle"||t==="stopped"||t==="failed"||t==="success"});constructor(){j(t=>{let e=this.selectedTaskId();if(!e)return;this.stream.ensureConnected(),this.stream.subscribeTask(e,200);let s=this.runtimeStore.status$(e).subscribe();t(()=>{s.unsubscribe(),this.stream.unsubscribeTask(e)})})}getRuntime(t){return this.runtimeStore.statusSignal(t)()}getRuntimeSignal(t){return this.runtimeStore.runtimeSignal(t)()}async setProject(t){let e=t?.trim();if(!e||this.projectId()===e)return;this.projectId.set(e),this.selectedTaskId.set(""),this.keyword.set(""),await this.catalog.ensureLoaded(e);let s=this.rows()[0];s&&this.select(s.spec.id)}refresh(){let t=this.projectId();t&&(this.loading.set(!0),this.api.refresh(t).subscribe({next:e=>{this.catalog.setRows(t,e??[]),this.loading.set(!1)},error:e=>{this.loading.set(!1)}}))}select(t){this.selectedTaskId.set(t)}toggleTask(){this.isRunning()?this.stopSelected():this.isStopped()&&this.startSelected()}startSelected(t){t=t?.trim()||this.selectedRow()?.spec?.id,t&&this.api.start(t).subscribe()}stopSelected(t){if(t=t?.trim()||this.selectedTaskId(),!t)return;let e=this.getRuntimeSignal(t);e&&this.runtimeStore.setRuntime(u(n({},e),{status:"stopping"})),this.api.stop(t).subscribe({next:()=>{},error:()=>{e&&e.status==="running"&&this.runtimeStore.setRuntime(e)}})}rowsViewOf(t){return c(()=>{let e=t?.trim();return e?this.catalog.rowsOf(e)().map(r=>{let d=r.spec.id,i=this.getRuntime(d);return u(n({},r),{runtime:u(n({},r.runtime??{}),{status:i.status})})}):[]})}ensureProjectLoaded(t){return this.catalog.ensureLoaded(t)}static \u0275fac=function(e){return new(e||p)};static \u0275prov=g({token:p,factory:p.\u0275fac,providedIn:"root"})};export{y as a,P as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A,b as B}from"./chunk-
|
|
1
|
+
import{a as A,b as B}from"./chunk-IZNTCWTR.js";import{M as T,N as y,T as k,U as b,V as x,W as S,Y as E,Z as v}from"./chunk-5EQOKH7G.js";import{Eb as C,Ic as r,Vb as g,Xb as _,bc as i,cc as o,dc as s,kc as c,mb as z,qc as l,rb as d,tc as f,xa as m,ya as u}from"./chunk-SJG2JCPL.js";function N(n,p){if(n&1){let t=c();i(0,"button",3),l("click",function(){m(t);let a=f();return u(a.toggle.emit())}),s(1,"span",4),r(2," \u8FD0\u884C "),o()}}function F(n,p){n&1&&(i(0,"button",1),s(1,"span",5),r(2," \u505C\u6B62\u4E2D... "),o())}function w(n,p){if(n&1){let t=c();i(0,"button",6),l("nzOnConfirm",function(){m(t);let a=f();return u(a.stopTask())}),s(1,"span",7),r(2," \u505C\u6B62 "),o()}}var D=class n{isRunning=!1;isStopping=!1;isStopped=!1;toggle=new d;stopTask(){this.toggle.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=C({type:n,selectors:[["app-task-actions"]],inputs:{isRunning:"isRunning",isStopping:"isStopping",isStopped:"isStopped"},outputs:{toggle:"toggle"},decls:4,vars:1,consts:[["nz-button","","nzType","primary"],["nz-button","","nzType","primary","nzDanger",""],["nz-button","","nzType","primary","nzDanger","","nz-popconfirm","","nzPopconfirmTitle","\u786E\u5B9A\u8981\u505C\u6B62\u8BE5\u4EFB\u52A1\u5417\uFF1F"],["nz-button","","nzType","primary",3,"click"],["nz-icon","","nzType","play-circle"],["nz-icon","","nzType","loading"],["nz-button","","nzType","primary","nzDanger","","nz-popconfirm","","nzPopconfirmTitle","\u786E\u5B9A\u8981\u505C\u6B62\u8BE5\u4EFB\u52A1\u5417\uFF1F",3,"nzOnConfirm"],["nz-icon","","nzType","pause"]],template:function(t,e){t&1&&(i(0,"nz-space"),g(1,N,3,0,"button",0)(2,F,3,0,"button",1)(3,w,3,0,"button",2),o()),t&2&&(z(),_(e.isStopped?1:e.isStopping?2:e.isRunning?3:-1))},dependencies:[b,k,v,E,x,S,y,T,B,A],styles:["[_nghost-%COMP%]{padding:0 16px;display:flex;flex-direction:row;align-items:center;position:relative}"]})};export{D as a};
|
|
Binary file
|
package/www/browser/index.html
CHANGED
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
<link rel="stylesheet" href="styles-ROAHD7MY.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-ROAHD7MY.css"></noscript></head>
|
|
10
10
|
<body>
|
|
11
11
|
<app-root></app-root>
|
|
12
|
-
<link rel="modulepreload" href="chunk-
|
|
12
|
+
<link rel="modulepreload" href="chunk-AI6SNMEH.js"><link rel="modulepreload" href="chunk-42JVTVYH.js"><link rel="modulepreload" href="chunk-DP3VTELD.js"><link rel="modulepreload" href="chunk-HZ73CM45.js"><link rel="modulepreload" href="chunk-6JH45SUC.js"><link rel="modulepreload" href="chunk-KPO75P5E.js"><link rel="modulepreload" href="chunk-SNCDDYQR.js"><link rel="modulepreload" href="chunk-2P5WKSWB.js"><link rel="modulepreload" href="chunk-5EQOKH7G.js"><link rel="modulepreload" href="chunk-HFZLJHYR.js"><script src="main-O5GAJRDW.js" type="module"></script></body>
|
|
13
13
|
</html>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{a as bn,b as xn,c as wn,d as Sn,e as Pn,f as R}from"./chunk-AI6SNMEH.js";import{a as on,b as rn,c as an}from"./chunk-42JVTVYH.js";import{a as Nn,b as Tn,c as On}from"./chunk-DP3VTELD.js";import"./chunk-HZ73CM45.js";import{a as yn,b as be}from"./chunk-6JH45SUC.js";import{a as zn,b as Mn}from"./chunk-KPO75P5E.js";import{b as Me}from"./chunk-SNCDDYQR.js";import{A as Cn,B as ze,C as _n,D as vn,I as te,a as qt,b as Jt,j as Z,k as dn,l as Q,m as un,n as fn,o as A,p as K,q as ve,r as ye,s as ee,y as gn,z as hn}from"./chunk-2P5WKSWB.js";import{A as Zt,Ab as sn,Cb as cn,Db as pn,Eb as mn,Hb as Ce,Jb as _e,L as Qt,M as S,N as b,O as Kt,P as en,T as tn,U as nn,V as F,W as ue,Y as k,Z as B,a as Yt,kb as ln,mb as fe,qb as ge,x as Xt,xb as he,z as Ue}from"./chunk-5EQOKH7G.js";import"./chunk-HFZLJHYR.js";import{A as X,B as Gt,C as D,e as me,h as Ft,i as kt,j as L,k as Bt,m as At,n as Rt,s as Vt,t as Wt,v as Ht,w as de,x as Ut,y as $t,z as G}from"./chunk-X3HFJACM.js";import{$b as j,$c as He,Aa as ae,Ba as st,Bc as wt,Ca as ct,Cc as St,Dc as T,Eb as _,Fa as pt,Fb as yt,Fc as I,Ha as M,Ia as mt,Ic as m,Jc as N,Kb as P,Kc as $,M as q,Mc as Pt,Nc as Nt,Oc as Tt,Pb as zt,Ra as dt,Tb as Mt,Ub as bt,Uc as Ot,Vb as v,Vc as pe,Wc as Ve,Xa as ut,Xb as y,Zb as xt,Zc as oe,_b as E,_c as We,ac as d,ad as J,bc as r,ca as tt,cc as l,cd as Dt,dc as p,fd as O,gd as ie,hc as H,ic as U,ja as nt,jc as Re,kb as ft,kc as z,la as ot,ma as w,mb as s,md as Et,na as it,pa as rt,pd as jt,qa as re,qb as gt,qc as C,ra as f,rd as It,sa as at,sb as ht,ta as lt,tc as c,uc as se,vc as ce,vd as Lt,wb as Ct,xa as g,xb as _t,ya as h,yb as le,z as et,zb as vt}from"./chunk-SJG2JCPL.js";function Jn(t){let n=t;return 5}var Dn=["zh",[["\u4E0A\u5348","\u4E0B\u5348"]],void 0,[["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"],["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"]],void 0,[["1","2","3","4","5","6","7","8","9","10","11","12"],["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"]],void 0,[["\u516C\u5143\u524D","\u516C\u5143"]],0,[6,0],["y/M/d","y\u5E74M\u6708d\u65E5",void 0,"y\u5E74M\u6708d\u65E5EEEE"],["HH:mm","HH:mm:ss","z HH:mm:ss","zzzz HH:mm:ss"],["{1} {0}",void 0,void 0,void 0],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"CNY","\xA5","\u4EBA\u6C11\u5E01",{AUD:["AU$","$"],BYN:[void 0,"\u0440."],CNY:["\xA5"],ILR:["ILS"],JPY:["JP\xA5","\xA5"],KRW:["\uFFE6","\u20A9"],PHP:[void 0,"\u20B1"],RUR:[void 0,"\u0440."],TWD:["NT$"],USD:["US$","$"],XXX:[]},"ltr",Jn];var Xn="@",Zn=(()=>{class t{doc;delegate;zone;animationType;moduleImpl;_rendererFactoryPromise=null;scheduler=null;injector=f(ae);loadingSchedulerFn=f(Qn,{optional:!0});_engine;constructor(e,o,i,a,u){this.doc=e,this.delegate=o,this.zone=i,this.animationType=a,this.moduleImpl=u}ngOnDestroy(){this._engine?.flush()}loadImpl(){let e=()=>this.moduleImpl??import("./chunk-HEKO7RQP.js").then(i=>i),o;return this.loadingSchedulerFn?o=this.loadingSchedulerFn(e):o=e(),o.catch(i=>{throw new nt(5300,!1)}).then(({\u0275createEngine:i,\u0275AnimationRendererFactory:a})=>{this._engine=i(this.animationType,this.doc);let u=new a(this.delegate,this._engine,this.zone);return this.delegate=u,u})}createRenderer(e,o){let i=this.delegate.createRenderer(e,o);if(i.\u0275type===0)return i;typeof i.throwOnSyntheticProps=="boolean"&&(i.throwOnSyntheticProps=!1);let a=new $e(i);return o?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(u=>{let W=u.createRenderer(e,o);a.use(W),this.scheduler??=this.injector.get(mt,null,{optional:!0}),this.scheduler?.notify(10)}).catch(u=>{a.use(i)}),a}begin(){this.delegate.begin?.()}end(){this.delegate.end?.()}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}componentReplaced(e){this._engine?.flush(),this.delegate.componentReplaced?.(e)}static \u0275fac=function(o){vt()};static \u0275prov=w({token:t,factory:t.\u0275fac})}return t})(),$e=class{delegate;replay=[];\u0275type=1;constructor(n){this.delegate=n}use(n){if(this.delegate=n,this.replay!==null){for(let e of this.replay)e(n);this.replay=null}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy()}createElement(n,e){return this.delegate.createElement(n,e)}createComment(n){return this.delegate.createComment(n)}createText(n){return this.delegate.createText(n)}get destroyNode(){return this.delegate.destroyNode}appendChild(n,e){this.delegate.appendChild(n,e)}insertBefore(n,e,o,i){this.delegate.insertBefore(n,e,o,i)}removeChild(n,e,o,i){this.delegate.removeChild(n,e,o,i)}selectRootElement(n,e){return this.delegate.selectRootElement(n,e)}parentNode(n){return this.delegate.parentNode(n)}nextSibling(n){return this.delegate.nextSibling(n)}setAttribute(n,e,o,i){this.delegate.setAttribute(n,e,o,i)}removeAttribute(n,e,o){this.delegate.removeAttribute(n,e,o)}addClass(n,e){this.delegate.addClass(n,e)}removeClass(n,e){this.delegate.removeClass(n,e)}setStyle(n,e,o,i){this.delegate.setStyle(n,e,o,i)}removeStyle(n,e,o){this.delegate.removeStyle(n,e,o)}setProperty(n,e,o){this.shouldReplay(e)&&this.replay.push(i=>i.setProperty(n,e,o)),this.delegate.setProperty(n,e,o)}setValue(n,e){this.delegate.setValue(n,e)}listen(n,e,o,i){return this.shouldReplay(e)&&this.replay.push(a=>a.listen(n,e,o,i)),this.delegate.listen(n,e,o,i)}shouldReplay(n){return this.replay!==null&&n.startsWith(Xn)}},Qn=new rt("");function En(t="animations"){return gt("NgAsyncAnimations"),at([{provide:Ct,useFactory:(n,e,o)=>new Zn(n,e,o,t),deps:[st,At,ht]},{provide:ut,useValue:t==="noop"?"NoopAnimations":"BrowserAnimations"}])}var xe=class t{currentTheme="default";constructor(){}reverseTheme(n){return n==="dark"?"default":"dark"}removeUnusedTheme(n){document.documentElement.classList.remove(n);let e=document.getElementById(n);e&&document.head.removeChild(e)}loadCss(n,e){return new Promise((o,i)=>{let a=document.createElement("link");a.rel="stylesheet",a.href=n,a.id=e,a.onload=o,a.onerror=i,document.head.append(a)})}loadTheme(n=!0){let e=this.currentTheme;return n&&document.documentElement.classList.add(e),new Promise((o,i)=>{this.loadCss(`${e}.css`,e).then(a=>{n||document.documentElement.classList.add(e),this.removeUnusedTheme(this.reverseTheme(e)),o(a)},a=>i(a))})}toggleTheme(){return this.currentTheme=this.reverseTheme(this.currentTheme),this.loadTheme(!1)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=w({token:t,factory:t.\u0275fac,providedIn:"root"})};var jn={provide:zt,useFactory:t=>()=>t.loadTheme(),deps:[xe],multi:!0};var In=[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-4UAHOL42.js").then(t=>t.DashboardModule)},{path:"tasks",loadChildren:()=>import("./chunk-5DD65JMJ.js").then(t=>t.TasksModule)},{path:"projects",loadChildren:()=>import("./chunk-4IQIZX7Y.js").then(t=>t.ProjectsModule)},{path:"settings",loadChildren:()=>import("./chunk-HJC5MNP5.js").then(t=>t.SettingModule)},{path:"configuration",loadChildren:()=>import("./chunk-3V5PIKHE.js").then(t=>t.ConfigurationModule)},{path:"dependencies",loadChildren:()=>import("./chunk-3MBM5AMR.js").then(t=>t.DependenciesModule)},{path:"rquest",loadChildren:()=>import("./chunk-AMXCOT2F.js").then(t=>t.ApiClientModule)},{path:"sprite",loadChildren:()=>import("./chunk-LWBZC6ZL.js").then(t=>t.SpriteModule)},{path:"about",loadChildren:()=>import("./chunk-KN3WZJH7.js").then(t=>t.AboutRoutingModule)},{path:"**",redirectTo:"dashboard"}];Bt(Dn);var Ln={providers:[jn,pt(),Dt(),Gt(In),Jt(qt),En(),lt(ze),Vt(Wt([On]))]};var Ge=["*"];function Kn(t,n){}function eo(t,n){if(t&1&&(r(0,"span",1),P(1,Kn,0,0,"ng-template",2),p(2,"nz-icon",3),l()),t&2){let e=c(),o=T(4);d("nzDropdownMenu",e.nzOverlay),s(),d("ngTemplateOutlet",o)}}function to(t,n){}function no(t,n){if(t&1&&P(0,to,0,0,"ng-template",2),t&2){c();let e=T(4);d("ngTemplateOutlet",e)}}function oo(t,n){if(t&1&&(H(0),m(1),U()),t&2){let e=c(2);s(),$(" ",e.nzBreadCrumbComponent.nzSeparator," ")}}function io(t,n){if(t&1&&(r(0,"nz-breadcrumb-separator"),P(1,oo,2,1,"ng-container",4),l()),t&2){let e=c();s(),d("nzStringTemplateOutlet",e.nzBreadCrumbComponent.nzSeparator)}}function ro(t,n){t&1&&(r(0,"span",5),ce(1),l())}var ao=(t,n)=>n.url;function lo(t,n){if(t&1){let e=z();r(0,"nz-breadcrumb-item")(1,"a",0),C("click",function(i){let a=g(e).$implicit,u=c(2);return h(u.navigate(a.url,i))}),m(2),l()()}if(t&2){let e=n.$implicit;s(),Mt("href",e.url,ft),s(),N(e.label)}}function so(t,n){if(t&1&&E(0,lo,3,2,"nz-breadcrumb-item",null,ao),t&2){let e=c();j(e.breadcrumbs)}}var we=class{},co=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275cmp=_({type:t,selectors:[["nz-breadcrumb-separator"]],hostAttrs:[1,"ant-breadcrumb-separator"],exportAs:["nzBreadcrumbSeparator"],ngContentSelectors:Ge,decls:1,vars:0,template:function(o,i){o&1&&(se(),ce(0))},encapsulation:2})}return t})(),kn=(()=>{class t{nzBreadCrumbComponent=f(we);nzOverlay;static \u0275fac=function(o){return new(o||t)};static \u0275cmp=_({type:t,selectors:[["nz-breadcrumb-item"]],inputs:{nzOverlay:"nzOverlay"},exportAs:["nzBreadcrumbItem"],ngContentSelectors:Ge,decls:5,vars:2,consts:[["noMenuTpl",""],["nz-dropdown","",1,"ant-breadcrumb-overlay-link",3,"nzDropdownMenu"],[3,"ngTemplateOutlet"],["nzType","down"],[4,"nzStringTemplateOutlet"],[1,"ant-breadcrumb-link"]],template:function(o,i){o&1&&(se(),v(0,eo,3,2,"span",1)(1,no,1,1,null,2),v(2,io,2,1,"nz-breadcrumb-separator"),P(3,ro,2,0,"ng-template",null,0,J)),o&2&&(y(i.nzOverlay?0:1),s(2),y(i.nzBreadCrumbComponent.nzSeparator?2:-1))},dependencies:[me,co,ee,K,b,S,en,Kt],encapsulation:2,changeDetection:0})}return t})(),po=(()=>{class t{injector=f(ae);cdr=f(It);elementRef=f(dt);renderer=f(_t);directionality=f(Xt);destroyRef=f(ct);nzAutoGenerate=!1;nzSeparator="/";nzRouteLabel="breadcrumb";nzRouteLabelFn=e=>e;nzRouteFn=e=>e;breadcrumbs=[];dir="ltr";ngOnInit(){this.nzAutoGenerate&&this.registerRouterChange(),this.directionality.change?.pipe(Ue(this.destroyRef)).subscribe(e=>{this.dir=e,this.prepareComponentForRtl(),this.cdr.detectChanges()}),this.dir=this.directionality.value,this.prepareComponentForRtl()}navigate(e,o){o.preventDefault(),this.injector.get(G).navigateByUrl(e)}registerRouterChange(){try{let e=this.injector.get(G),o=this.injector.get(Ut);e.events.pipe(q(i=>i instanceof de),Ue(this.destroyRef),tt(!0)).subscribe(()=>{this.breadcrumbs=this.getBreadcrumbs(o.root),this.cdr.markForCheck()})}catch{throw new Error(`${Yt} You should import RouterModule if you want to use 'NzAutoGenerate'.`)}}getBreadcrumbs(e,o="",i=[]){let a=e.children;if(a.length===0)return i;for(let u of a)if(u.outlet===Ht){let W=u.snapshot.url.map(ne=>ne.path).filter(ne=>ne).join("/"),Qe=W?`${o}/${W}`:o,Ke=this.nzRouteLabelFn(u.snapshot.data[this.nzRouteLabel]),qn=this.nzRouteFn(Qe);if(W&&Ke){let ne={label:Ke,params:u.snapshot.params,url:qn};i.push(ne)}return this.getBreadcrumbs(u,Qe,i)}return i}prepareComponentForRtl(){this.dir==="rtl"?this.renderer.addClass(this.elementRef.nativeElement,"ant-breadcrumb-rtl"):this.renderer.removeClass(this.elementRef.nativeElement,"ant-breadcrumb-rtl")}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=_({type:t,selectors:[["nz-breadcrumb"]],hostAttrs:[1,"ant-breadcrumb"],inputs:{nzAutoGenerate:[2,"nzAutoGenerate","nzAutoGenerate",Lt],nzSeparator:"nzSeparator",nzRouteLabel:"nzRouteLabel",nzRouteLabelFn:"nzRouteLabelFn",nzRouteFn:"nzRouteFn"},exportAs:["nzBreadcrumb"],features:[Ot([{provide:we,useExisting:ot(()=>t)}])],ngContentSelectors:Ge,decls:2,vars:1,consts:[[3,"click"]],template:function(o,i){o&1&&(se(),ce(0),v(1,so,2,0)),o&2&&(s(),y(i.nzAutoGenerate&&i.breadcrumbs.length?1:-1))},dependencies:[kn],encapsulation:2,changeDetection:0})}return t})(),Bn=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=yt({type:t});static \u0275inj=it({imports:[po,kn]})}return t})();function mo(t){return t.op==="syslog.tail"}function uo(t){return t.op==="syslog.append"}function Ye(t,n){return n?!(n.scope!==void 0&&t?.scope!==n.scope||n.level!==void 0&&t?.level!==n.level||n.source!==void 0&&t?.source!==n.source||n.refId!==void 0&&t?.refId!==n.refId):!0}var Se=class t{constructor(n){this.ws=n;this.msgSub=this.ws.messages().pipe(q(e=>mo(e)||uo(e))).subscribe(e=>this.onWsMessage(e)),this.wsStateSub=this.ws.stateChanges().subscribe(e=>{let o=this.lastWsState==="open",i=e==="open";!o&&i&&(this.subSentForCurrentConnection=!1,this.sendSubIfNeeded()),o&&!i&&(this.subSentForCurrentConnection=!1),this.lastWsState=e})}msgSub;wsStateSub;enabled=M(!1);filter=M({});logs=M([]);unread=M(0);drawerOpen=M(!1);capacity=2e3;tail=300;subSentForCurrentConnection=!1;lastWsState="idle";setDrawerOpen(n){this.drawerOpen.set(n),n&&this.unread.set(0)}setFilter(n){this.filter.set(n??{});let e=this.logs();if(!e.length)return;let o=e.filter(i=>Ye(i,this.filter()));this.logs.set(o.slice(-this.capacity))}enable(n=300){let e=Math.max(0,Math.min(5e3,n|0));if(this.tail=e,this.enabled()){this.ws.isOpen()&&(this.subSentForCurrentConnection=!1,this.sendSubIfNeeded());return}this.enabled.set(!0),this.ws.connect(),this.sendSubIfNeeded()}disable(){this.enabled.set(!1),this.subSentForCurrentConnection=!1}markRead(){this.unread.set(0)}clear(){this.logs.set([]),this.unread.set(0)}sendSubIfNeeded(){this.enabled()&&this.ws.isOpen()&&(this.subSentForCurrentConnection||(this.ws.send({op:"sub",topic:"syslog",tail:this.tail}),this.subSentForCurrentConnection=!0))}onWsMessage(n){let e=this.filter();if(n.op==="syslog.tail"){let u=(n.entries??[]).filter(W=>Ye(W,e));this.logs.set(u.slice(-this.capacity));return}let o=n.entry;if(!Ye(o,e))return;let i=this.logs(),a=i.length>=this.capacity?i.slice(1):i.slice();a.push(o),this.logs.set(a),this.drawerOpen()||this.unread.set(this.unread()+1)}static \u0275fac=function(e){return new(e||t)(re(Me))};static \u0275prov=w({token:t,factory:t.\u0275fac,providedIn:"root"})};var go=["logBox"],ho=()=>({padding:"0px",overflow:"hidden"});function Co(t,n){if(t&1&&(r(0,"nz-tag",12),m(1),oe(2,"uppercase"),l(),r(3,"div",13),m(4),l(),r(5,"div",14),m(6),oe(7,"date"),l()),t&2){let e,o,i,a,u=c();d("nzColor",u.getColor((e=u.lastLine())==null?null:e.level)),s(),$(" ",We(2,4,(o=u.lastLine())==null?null:o.level)," "),s(3),N((i=u.lastLine())==null?null:i.text),s(2),N(He(7,6,(a=u.lastLine())==null?null:a.ts,"yyyy-MM-dd HH:mm:ss"))}}function _o(t,n){t&1&&(r(0,"nz-tag",15),m(1,"INFO"),l(),r(2,"div",13),m(3,"\u6682\u65E0\u65E5\u5FD7"),l(),r(4,"div",14),m(5,"--"),l())}function vo(t,n){if(t&1&&m(0),t&2){let e=c().$implicit;$(" ",e.data==null?null:e.data.icon," ")}}function yo(t,n){if(t&1&&(r(0,"div",18)(1,"nz-tag",12),m(2),oe(3,"uppercase"),l(),r(4,"span",14),m(5),oe(6,"date"),l(),r(7,"span",19),v(8,vo,1,1),m(9),l()()),t&2){let e=n.$implicit,o=c(2);I("err",e.level==="error")("warn",e.level==="warn")("info",e.level==="info")("debug",e.level==="debug")("success",e.level==="success"),s(),d("nzColor",o.getColor(e.level)),s(),$(" ",We(3,15,e.level)," "),s(3),N(He(6,17,e.ts,"yyyy-MM-dd HH:mm:ss")),s(3),y(e.data!=null&&e.data.icon?8:-1),s(),$(" ",e.text," ")}}function zo(t,n){if(t&1&&(H(0),r(1,"div",16,1),E(3,yo,10,20,"div",17,bt().trackByLine,!0),l(),U()),t&2){let e=c();s(3),j(e.lines())}}function Mo(t,n){if(t&1){let e=z();r(0,"nz-space",20)(1,"button",21),C("click",function(){g(e);let i=c();return h(i.clearLog())}),p(2,"nz-icon",22),l(),r(3,"button",23),C("click",function(){g(e);let i=c();return h(i.toBottom())}),p(4,"nz-icon",24),l()()}}var Pe=class t{sysLogStream=f(Se);projectState=f(te);logBox=Et("logBox");autoFollow=M(!0);isOpen=M(!1);curProjectPath=O(()=>this.projectState.currentProject()?.root||"");lines=O(()=>this.sysLogStream.logs());lastLine=O(()=>{let n=this.sysLogStream.logs();return n.length?n[n.length-1]:null});unread=O(()=>this.sysLogStream.unread());constructor(){ie(()=>{this.sysLogStream.setDrawerOpen(this.isOpen()),this.isOpen()&&queueMicrotask(()=>this.toBottom())}),ie(()=>{this.lines(),this.isOpen()&&this.autoFollow()&&queueMicrotask(()=>this.toBottom())})}ngOnInit(){this.sysLogStream.enable(300)}openLog(){this.isOpen.set(!0)}closeLog(){this.isOpen.set(!1)}clearLog(){this.sysLogStream.clear()}toBottom(){let n=this.logBox()?.nativeElement;n&&(n.scrollTop=n.scrollHeight)}trackByLine=(n,e)=>`${e.ts}-${e.refId??""}-${e.text}`;getColor(n){if(!n)return"#000000";switch(n){case"success":return"#22c55e";case"info":return"#18bdfd";case"debug":return"#94a3b8";case"error":return"#ef4444";case"warn":return"#f59e0b";default:return"#000000"}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=_({type:t,selectors:[["app-system-log"]],viewQuery:function(e,o){e&1&&wt(o.logBox,go,5),e&2&&St()},decls:16,vars:10,consts:[["extra",""],["logBox",""],[1,"status-bar"],[1,"project-path"],["nz-button","","nzType","text","routerLink","/projects","nz-tooltip","\u9879\u76EE\u7BA1\u7406","nzTooltipPlacement","top",1,"home"],["nzType","home","nzTheme","outline",1,"icon"],["nz-button","","nzType","text","nzTooltipPlacement","top",1,"path",3,"nz-tooltip"],["nzType","folder","nzTheme","outline",1,"icon"],["nz-tooltip","\u6253\u5F00\u65E5\u5FD7",1,"last-log",3,"click"],["nzType","profile","nzTheme","outline",1,"icon"],["nzTitle","\u65E5\u5FD7","nzPlacement","bottom",3,"nzOnClose","nzVisible","nzMaskClosable","nzMask","nzExtra","nzHeight","nzBodyStyle"],[4,"nzDrawerContent"],[1,"level-tag",3,"nzColor"],[1,"info"],[1,"time"],["nzColor","default"],[1,"log"],[1,"line",3,"err","warn","info","debug","success"],[1,"line"],[1,"msg"],["nzAlign","center"],["nz-button","","nzType","text","nz-tooltip","\u6E05\u7A7A\u65E5\u5FD7",3,"click"],["nzType","clear","nzTheme","outline"],["nz-button","","nzType","text","nz-tooltip","\u6EDA\u52A8\u5230\u5E95\u90E8",3,"click"],["nzType","vertical-align-bottom","nzTheme","outline"]],template:function(e,o){if(e&1){let i=z();r(0,"div",2)(1,"div",3)(2,"a",4),p(3,"nz-icon",5),l(),r(4,"button",6),p(5,"nz-icon",7),r(6,"span"),m(7),l()()(),r(8,"div",8),C("click",function(){return g(i),h(o.openLog())}),p(9,"nz-icon",9),v(10,Co,8,9)(11,_o,6,0),l()(),r(12,"nz-drawer",10),C("nzOnClose",function(){return g(i),h(o.closeLog())}),P(13,zo,5,0,"ng-container",11),l(),P(14,Mo,5,0,"ng-template",null,0,J)}if(e&2){let i=T(15);s(4),d("nz-tooltip",o.curProjectPath()),s(3),N(o.curProjectPath()),s(3),y(o.lastLine()?10:11),s(2),d("nzVisible",o.isOpen())("nzMaskClosable",!1)("nzMask",!1)("nzExtra",i)("nzHeight",300)("nzBodyStyle",pe(9,ho))}},dependencies:[L,Tn,Nn,an,rn,on,B,k,F,nn,tn,b,S,_e,Ce,D,X,Ft,kt],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:3;flex:0 0 auto}.status-bar[_ngcontent-%COMP%]{height:32px;display:flex;align-items:center;width:100%;-webkit-user-select:none;user-select:none}.status-bar[_ngcontent-%COMP%] .project-path[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;padding:0 8px;gap:4px}.status-bar[_ngcontent-%COMP%] .project-path[_ngcontent-%COMP%] .home[_ngcontent-%COMP%], .status-bar[_ngcontent-%COMP%] .project-path[_ngcontent-%COMP%] .path[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:0;max-width:360px}.status-bar[_ngcontent-%COMP%] .project-path[_ngcontent-%COMP%] .home[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .status-bar[_ngcontent-%COMP%] .project-path[_ngcontent-%COMP%] .path[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.status-bar[_ngcontent-%COMP%] .project-path[_ngcontent-%COMP%] .home[_ngcontent-%COMP%]{justify-content:center}.status-bar[_ngcontent-%COMP%] .project-path[_ngcontent-%COMP%] .path[_ngcontent-%COMP%]{min-width:240px;justify-content:flex-start}.status-bar[_ngcontent-%COMP%] .last-log[_ngcontent-%COMP%]{cursor:pointer;flex:1;display:flex;align-items:center;padding:0 12px;gap:8px;width:0}.status-bar[_ngcontent-%COMP%] .last-log[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.status-bar[_ngcontent-%COMP%] .last-log[_ngcontent-%COMP%] .time[_ngcontent-%COMP%]{flex:0 0 auto;opacity:.75;font-size:14px}.status-bar[_ngcontent-%COMP%] .last-log[_ngcontent-%COMP%]:hover{background:#f5f7fa}.icon[_ngcontent-%COMP%]{margin-right:8px;font-size:18px;display:inline-flex}.log[_ngcontent-%COMP%]{height:100%;overflow:auto;padding:8px 12px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:14px;line-height:18px}.line[_ngcontent-%COMP%]{display:flex;gap:12px;padding:2px 0;align-items:center}.line[_ngcontent-%COMP%] .time[_ngcontent-%COMP%]{flex:0 0 auto;opacity:.65;font-variant-numeric:tabular-nums}.line[_ngcontent-%COMP%] .msg[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.line.err[_ngcontent-%COMP%] .msg[_ngcontent-%COMP%]{font-weight:600}.line.warn[_ngcontent-%COMP%] .msg[_ngcontent-%COMP%]{font-weight:500}.level-tag[_ngcontent-%COMP%]{font-size:12px;padding:0 4px;line-height:1.5;display:inline-flex;align-items:center;justify-content:center;min-width:58px;border-radius:4px}"],changeDetection:0})};var Ne=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=_({type:t,selectors:[["ngm-footer"]],decls:2,vars:0,template:function(e,o){e&1&&(r(0,"nz-footer"),p(1,"app-system-log"),l())},dependencies:[R,xn,Pe],styles:["nz-footer[_ngcontent-%COMP%]{padding:0;align-items:center;display:flex}app-system-log[_ngcontent-%COMP%]{width:100%}"]})};var Te=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=_({type:t,selectors:[["ngm-header"]],decls:4,vars:0,consts:[[1,"app-header"],["nzType","disconnect","nzTheme","outline"]],template:function(e,o){e&1&&(r(0,"nz-header",0),p(1,"nz-icon",1),r(2,"span"),m(3,"\u8FDE\u63A5\u5DF2\u65AD\u5F00"),l()())},dependencies:[L,R,wn,b,S],styles:["nz-header.app-header[_ngcontent-%COMP%]{padding:0;width:100%;position:relative;height:48px;line-height:48px;background:var(--header-error-background);color:#fff;display:flex;align-items:center;justify-content:center;font-size:18px;gap:8px}"],changeDetection:0})};var Oe=class t{isCollapsed=M(!1);static \u0275fac=function(e){return new(e||t)};static \u0275prov=w({token:t,factory:t.\u0275fac,providedIn:"root"})};var De=class t{currentMenu=M(null);router=f(G);menus=[{title:"\u4EEA\u8868\u76D8",path:"/dashboard",icon:"dashboard",level:1},{title:"\u4F9D\u8D56",path:"/dependencies",icon:"codepen",level:1},{title:"\u4EFB\u52A1",path:"/tasks",icon:"schedule",level:1,taskCountBadge:!0},{title:"\u914D\u7F6E",path:"/configuration",icon:"setting",level:1},{title:"API",path:"/rquest",icon:"api",level:1},{title:"\u96EA\u78A7\u56FE",path:"/sprite",icon:"smile",level:1}];constructor(){this.syncByUrl(this.router.url),this.router.events.pipe(q(n=>n instanceof de)).subscribe(n=>this.syncByUrl(n.urlAfterRedirects))}isActive(n){return this.router.isActive(n,{paths:"subset",queryParams:"ignored",fragment:"ignored",matrixParams:"ignored"})}getMenus(){return this.menus}clickMenu(n){n.path&&this.router.navigateByUrl(n.path),this.currentMenu.set(n)}syncByUrl(n){let e=this.normalizeUrl(n),o=this.findBestMatch(this.menus,e);this.currentMenu.set(o)}normalizeUrl(n){return n.split("?")[0].split("#")[0]}findBestMatch(n,e){let o=this.flatten(n).filter(a=>!!a.path),i=null;for(let a of o){let u=a.path;(e===u||e.startsWith(u+"/"))&&(!i||u.length>i.path.length)&&(i=a)}return i}flatten(n){let e=[];for(let o of n)e.push(o),o.children?.length&&e.push(...this.flatten(o.children));return e}static \u0275fac=function(e){return new(e||t)};static \u0275prov=w({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ee=class t{api=f(yn);runtimeStore=f(be);async initActiveSnapshot(){let n=await et(this.api.active());for(let e of n??[])this.runtimeStore.setRuntime(e)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=w({token:t,factory:t.\u0275fac,providedIn:"root"})};var Rn=t=>({$implicit:t});function bo(t,n){t&1&&Re(0)}function xo(t,n){if(t&1&&p(0,"nz-icon",6),t&2){let e=c(2).$implicit;d("nzType",e.icon)}}function wo(t,n){t&1&&p(0,"nz-badge",7)}function So(t,n){if(t&1){let e=z();r(0,"li",5),C("click",function(){g(e);let i=c().$implicit,a=c(2);return h(a.menuService.clickMenu(i))}),v(1,xo,1,1,"nz-icon",6),r(2,"span"),m(3),l(),v(4,wo,1,0,"nz-badge",7),l()}if(t&2){let e=c().$implicit,o=c(2);d("nzPaddingLeft",e.level*24)("nzDisabled",e.disabled)("nzSelected",o.menuService.isActive(e.path))("nz-tooltip",e.taskCountBadge===!0&&o.runningTaskCount()>0?o.runningTaskCount()+"\u4E2A\u4EFB\u52A1\u6B63\u5728\u8FD0\u884C":null),s(),y(e.icon?1:-1),s(2),N(e.title),s(),y(e.taskCountBadge===!0&&o.runningTaskCount()>0?4:-1)}}function Po(t,n){t&1&&Re(0)}function No(t,n){if(t&1&&(r(0,"li",4)(1,"ul"),P(2,Po,1,0,"ng-container",2),l()()),t&2){let e=c().$implicit;c(2);let o=T(3);d("nzPaddingLeft",e.level*24)("nzOpen",e.open)("nzTitle",e.title)("nzIcon",e.icon)("nzDisabled",e.disabled),s(2),d("ngTemplateOutlet",o)("ngTemplateOutletContext",Ve(7,Rn,e.children))}}function To(t,n){if(t&1&&v(0,So,5,7,"li",3)(1,No,3,9,"li",4),t&2){let e=n.$implicit;y(e.children?1:0)}}function Oo(t,n){if(t&1&&E(0,To,2,1,null,null,xt),t&2){let e=n.$implicit;j(e)}}var je=class t{isCollapsed=!1;menus=[];menuService=f(De);taskBootstrap=f(Ee);runtimeStore=f(be);runningTaskCount=O(()=>this.runtimeStore.totalRunningCountSignal()());ngOnInit(){this.menus=this.menuService.getMenus(),this.taskBootstrap.initActiveSnapshot()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=_({type:t,selectors:[["ngm-menu"]],inputs:{isCollapsed:"isCollapsed"},decls:4,vars:5,consts:[["menuTpl",""],["nz-menu","","nzMode","inline",3,"nzInlineCollapsed"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["nz-menu-item","","nzTooltipPlacement","right",3,"nzPaddingLeft","nzDisabled","nzSelected","nz-tooltip"],["nz-submenu","",3,"nzPaddingLeft","nzOpen","nzTitle","nzIcon","nzDisabled"],["nz-menu-item","","nzTooltipPlacement","right",3,"click","nzPaddingLeft","nzDisabled","nzSelected","nz-tooltip"],["nzTheme","outline",2,"font-size","18px",3,"nzType"],["nzStatus","processing",2,"margin-left","12px"]],template:function(e,o){if(e&1&&(r(0,"ul",1),P(1,bo,1,0,"ng-container",2)(2,Oo,2,0,"ng-template",null,0,J),l()),e&2){let i=T(3);d("nzInlineCollapsed",o.isCollapsed),s(),d("ngTemplateOutlet",i)("ngTemplateOutletContext",Ve(3,Rn,o.menus))}},dependencies:[me,A,Q,Z,dn,b,S,D,_e,Ce,Mn,zn],encapsulation:2})};function jo(t,n){if(t&1){let e=z();r(0,"div",3)(1,"label",4),m(2,"\u540D\u79F0"),l(),r(3,"nz-input-wrapper")(4,"input",5),C("ngModelChange",function(i){g(e);let a=c(2);return h(a.projectState.editingProject().name=i)})("keydown.enter",function(){g(e);let i=c(2);return h(i.projectState.confirmEditProject())}),l(),p(5,"nz-icon",6),l(),r(6,"div",7),m(7,"\u8F93\u5165\u65B0\u540D\u79F0\uFF0C\u5C06\u540C\u6B65\u66F4\u65B0\u9879\u76EE\u663E\u793A\u540D\u79F0\uFF08\u4E0D\u4F1A\u91CD\u547D\u540D\u78C1\u76D8\u76EE\u5F55\uFF09\u3002"),l(),r(8,"label",4),m(9,"Git\u4ED3\u5E93\u5730\u5740"),l(),r(10,"nz-input-wrapper")(11,"input",8),C("ngModelChange",function(i){g(e);let a=c(2);return h(a.projectState.editingProject().repoPageUrl=i)}),l(),p(12,"nz-icon",9),l(),r(13,"label",4),m(14,"\u63CF\u8FF0"),l(),r(15,"nz-input-wrapper")(16,"textarea",10),C("ngModelChange",function(i){g(e);let a=c(2);return h(a.projectState.editingProject().description=i)})("keydown.enter",function(){g(e);let i=c(2);return h(i.projectState.confirmEditProject())}),l()()()}if(t&2){let e=c(2);s(4),d("ngModel",e.editingProject().name),s(7),d("ngModel",e.editingProject().repoPageUrl),s(5),d("ngModel",e.editingProject().description)}}function Io(t,n){if(t&1&&(H(0),v(1,jo,17,3,"div",3),U()),t&2){let e=c();s(),y(e.editingProject()?1:-1)}}function Lo(t,n){if(t&1){let e=z();H(0),r(1,"button",11),C("click",function(){g(e);let i=c();return h(i.projectState.closeEditModal())}),m(2,"\u53D6\u6D88"),l(),r(3,"button",12),C("click",function(){g(e);let i=c();return h(i.projectState.confirmEditProject())}),m(4," \u786E\u5B9A "),l(),U()}if(t&2){let e,o=c();s(3),d("disabled",!(!((e=o.projectState.editingProject())==null||e.name==null)&&e.name.trim())||o.projectState.isEditSaving())("nzLoading",o.projectState.isEditSaving())}}var Ie=class t{projectState=f(te);editingProject=this.projectState.editingProject;static \u0275fac=function(e){return new(e||t)};static \u0275cmp=_({type:t,selectors:[["app-project-edit-modal"]],decls:3,vars:3,consts:[["nzTitle","\u7F16\u8F91\u9879\u76EE",3,"nzOnCancel","nzClosable","nzMaskClosable","nzVisible"],[4,"nzModalContent"],[4,"nzModalFooter"],[1,"modal-body"],[1,"label"],["nz-input","","placeholder","\u8BF7\u8F93\u5165\u65B0\u540D\u79F0","autofocus","",3,"ngModelChange","keydown.enter","ngModel"],["nzInputPrefix","","nzType","folder","nzTheme","fill"],[1,"hint"],["nz-input","","placeholder","Git\u4ED3\u5E93\u5730\u5740",3,"ngModelChange","ngModel"],["nzInputPrefix","","nzType","github","nzTheme","outline"],["nz-input","","rows","3","placeholder","\u8BF7\u8F93\u5165\u65B0\u63CF\u8FF0",2,"resize","none",3,"ngModelChange","keydown.enter","ngModel"],["nz-button","",3,"click"],["nz-button","","nzType","primary",3,"click","disabled","nzLoading"]],template:function(e,o){e&1&&(r(0,"nz-modal",0),C("nzOnCancel",function(){return o.projectState.closeEditModal()}),P(1,Io,2,1,"ng-container",1)(2,Lo,5,2,"ng-container",2),l()),e&2&&d("nzClosable",!1)("nzMaskClosable",!1)("nzVisible",o.projectState.isEditModalVisible())},dependencies:[L,he,ln,fe,ge,mn,cn,pn,sn,B,k,F,ue,ze,Cn,hn,gn,b,S],styles:[".modal-body[_ngcontent-%COMP%]{display:grid;gap:12px}.hint[_ngcontent-%COMP%]{font-size:12px;opacity:.75}"]})};var Fo=()=>({width:"100%"}),Vn=(t,n)=>n.id;function ko(t,n){t&1&&p(0,"nz-icon",2)}function Bo(t,n){if(t&1){let e=z();r(0,"li",7),p(1,"nz-icon",11),r(2,"span"),m(3,"\u6DFB\u52A0/\u53D6\u6D88\u6536\u85CF"),l(),r(4,"nz-switch",12),C("ngModelChange",function(){let i;g(e);let a=c();return h(a.projectState.toggleFavorite((i=a.projectState.currentProject())==null?null:i.id))}),l()(),r(5,"li",13),C("click",function(){let i;g(e);let a=c();return h(a.projectState.openInEditor((i=a.projectState.currentProject())==null?null:i.id))}),p(6,"nz-icon",14),r(7,"span"),m(8,"\u5728\u7F16\u8F91\u5668\u4E2D\u6253\u5F00"),l()(),r(9,"li",13),C("click",function(){g(e);let i=c();return h(i.projectState.openEditModal(i.projectState.currentProject()))}),p(10,"nz-icon",15),r(11,"span"),m(12,"\u7F16\u8F91\u9879\u76EE"),l()()}if(t&2){let e,o,i,a=c();s(),d("nzTheme",(e=a.projectState.currentProject())!=null&&e.isFavorite?"fill":"outline"),s(3),d("nzDisabled",!((o=a.projectState.currentProject())!=null&&o.id))("ngModel",(i=a.projectState.currentProject())==null?null:i.isFavorite)}}function Ao(t,n){if(t&1){let e=z();r(0,"li",13),C("click",function(){let i=g(e).$implicit,a=c();return h(a.projectState.selectProject(i))}),p(1,"nz-icon",16),r(2,"span"),m(3),l()()}if(t&2){let e=n.$implicit;s(3),N(e.name)}}function Ro(t,n){if(t&1){let e=z();r(0,"li",13),C("click",function(){let i=g(e).$implicit,a=c();return h(a.projectState.selectProject(i))}),p(1,"nz-icon",11),r(2,"span"),m(3),l()()}if(t&2){let e=n.$implicit;s(),d("nzTheme",e.isFavorite?"fill":"outline"),s(2),N(e.name)}}var Le=class t{constructor(n){this.projectState=n}isCollapsed=jt(!1);curProjectName=O(()=>{let n=this.projectState.currentProject()?.name||"\u8BF7\u9009\u62E9\u9879\u76EE";return this.isCollapsed()?n?.charAt(0).toUpperCase():n});ngOnInit(){this.projectState.getProjects()}static \u0275fac=function(e){return new(e||t)(le(te))};static \u0275cmp=_({type:t,selectors:[["ngm-project-nav"]],inputs:{isCollapsed:[1,"isCollapsed"]},outputs:{isCollapsed:"isCollapsedChange"},decls:23,vars:9,consts:[["menu","nzDropdownMenu"],["nz-button","","nzType","primary","nzSize","large","nz-dropdown","","nzTrigger","click",1,"project-quick-dropdown",3,"nzDropdownMenu","nzPlacement","nzOverlayStyle"],["nzType","down"],[2,"width","100%"],["nz-menu",""],["nz-menu-divider",""],["nz-menu-group","","nzTitle","\u6536\u85CF\u7684\u9879\u76EE"],["nz-menu-item","",1,"item"],["nz-menu-group","","nzTitle","\u6700\u8FD1\u4F7F\u7528"],["routerLink","/projects"],["nzType","project"],["nzType","star",3,"nzTheme"],[2,"margin-left","6px",3,"ngModelChange","nzDisabled","ngModel"],["nz-menu-item","",1,"item",3,"click"],["nzType","code"],["nzType","edit"],["nzType","star","nzTheme","fill"]],template:function(e,o){if(e&1&&(r(0,"button",1)(1,"span"),m(2),l(),v(3,ko,1,0,"nz-icon",2),l(),r(4,"nz-dropdown-menu",3,0)(6,"ul",4),v(7,Bo,13,3),p(8,"li",5)(9,"li",6),E(10,Ao,4,1,"li",7,Vn),p(12,"li",5)(13,"li",8),E(14,Ro,4,2,"li",7,Vn),p(16,"li",5),r(17,"li",7)(18,"a",9),p(19,"nz-icon",10),r(20,"span"),m(21,"\u9879\u76EE\u7BA1\u7406"),l()()()()(),p(22,"app-project-edit-modal")),e&2){let i=T(5);I("collapsed",o.isCollapsed()),d("nzDropdownMenu",i)("nzPlacement","bottomCenter")("nzOverlayStyle",pe(8,Fo)),s(2),N(o.curProjectName()),s(),y(o.isCollapsed()?-1:3),s(4),y(o.projectState.currentProject()?7:-1),s(3),j(o.projectState.favoriteProjects()),s(4),j(o.projectState.recentProjects())}},dependencies:[L,he,fe,ge,ee,Q,Z,fn,un,K,ye,ve,A,b,S,vn,_n,B,k,F,ue,D,X,Ie],styles:["[_nghost-%COMP%]{display:flex;padding:16px}[_nghost-%COMP%] .project-quick-dropdown[_ngcontent-%COMP%]{flex:1;width:100%;display:flex;align-items:center;gap:8px;justify-content:center;border-radius:20px;font-weight:500}[_nghost-%COMP%] .project-quick-dropdown[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item[_ngcontent-%COMP%] .ant-menu-title-content{display:flex;align-items:center;gap:8px;overflow:hidden}.item[_ngcontent-%COMP%] .ant-menu-title-content span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--app-text-color);display:flex;width:100%;align-items:center;gap:8px}"]})};var Fe=class t{router=f(G);state=f(Oe);isCollapsed=this.state.isCollapsed;constructor(){}isActive(n){return this.router.url.startsWith(n)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=_({type:t,selectors:[["ngm-sidebar"]],hostVars:4,hostBindings:function(e,o){e&2&&I("collapsed",o.isCollapsed())("ant-layout-sider",!0)},decls:20,vars:5,consts:[["menu","nzDropdownMenu"],["nzCollapsible","","nzWidth","256px","nzBreakpoint","md",1,"menu-sidebar",3,"nzCollapsedChange","nzCollapsed","nzTrigger"],[1,"header"],[3,"isCollapsed"],[1,"content"],["nz-button","","nzType","link","nz-dropdown","","nzPlacement","bottomRight","nzTrigger","click",1,"more-btn",3,"nzDropdownMenu"],["nzType","more"],["nz-menu",""],["nz-menu-item","",1,"item"],["routerLink","/projects"],["nzType","project","nzTheme","outline"],["routerLink","/about"],["nzType","info-circle","nzTheme","outline"]],template:function(e,o){if(e&1){let i=z();r(0,"nz-sider",1),Tt("nzCollapsedChange",function(u){return g(i),Nt(o.isCollapsed,u)||(o.isCollapsed=u),h(u)}),r(1,"div",2),p(2,"ngm-project-nav",3),l(),r(3,"div",4),p(4,"ngm-menu",3),r(5,"button",5),p(6,"nz-icon",6),l()()(),r(7,"nz-dropdown-menu",null,0)(9,"ul",7)(10,"li",8)(11,"a",9),p(12,"nz-icon",10),r(13,"span"),m(14,"\u9879\u76EE\u7BA1\u7406"),l()()(),r(15,"li",8)(16,"a",11),p(17,"nz-icon",12),r(18,"span"),m(19,"\u5173\u4E8E"),l()()()()()}if(e&2){let i=T(8);Pt("nzCollapsed",o.isCollapsed),d("nzTrigger",null),s(2),d("isCollapsed",o.isCollapsed()),s(2),d("isCollapsed",o.isCollapsed()),s(),d("nzDropdownMenu",i)}},dependencies:[R,Sn,b,S,A,Q,Z,je,Le,B,k,F,ee,K,ye,ve,D,X],styles:["html.default[_ngcontent-%COMP%] [_ngcontent-%COMP%]:root{--app-gray: #e6f7ff;--app-primary: #1890ff;--app-primary-1: #e6f7ff;--app-primary-2: #bae7ff;--app-primary-3: #91d5ff;--app-primary-4: #69c0ff;--app-primary-5: #40a9ff;--app-primary-6: #1890ff;--app-text-color: rgba(0, 0, 0, .85);--app-text-secondary: rgba(0, 0, 0, .45);--text-color-primary: #1890ff;--app-component-bg: #fff;--app-border-color: #d9d9d9;--header-error-background: #ff4d4f}html.default[_ngcontent-%COMP%] [_ngcontent-%COMP%]:root{--text-color-gray: #888}html.default [_nghost-%COMP%] .sidebar-logo[_ngcontent-%COMP%]{background:var(--ant-primary-1)}html.default [_nghost-%COMP%] .sidebar-logo[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{color:var(--ant-text-color)}html.dark[_ngcontent-%COMP%] [_ngcontent-%COMP%]:root{--text-color-gray: #bbb}html.dark [_nghost-%COMP%] .sidebar-logo[_ngcontent-%COMP%]{background:var(--ant-primary-1)}html.dark [_nghost-%COMP%] .sidebar-logo[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{color:var(--ant-text-color)}[_nghost-%COMP%]{display:block;box-sizing:border-box;position:relative;z-index:10;box-shadow:2px 0 6px #00152959;width:256px;transition:all .2s;flex:0 0 auto}.collapsed[_nghost-%COMP%]{width:80px}.menu-sidebar[_ngcontent-%COMP%]{height:100%}.menu-sidebar[_ngcontent-%COMP%] .ant-layout-sider-children{display:flex;flex-direction:column;height:100%}.menu-sidebar[_ngcontent-%COMP%] .ant-menu-inline{border-right:none}.menu-sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{flex:0 0 auto}.menu-sidebar[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{flex:1 1 auto;height:0;display:flex;flex-direction:column}.menu-sidebar[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] ngm-menu[_ngcontent-%COMP%]{flex:1 1 auto;height:0}.menu-sidebar[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin:12px;flex:0 0 auto}.menu-sidebar[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background-color:var(--app-primary-2)}.sidebar-logo[_ngcontent-%COMP%]{position:relative;height:64px;padding-left:24px;overflow:hidden;line-height:64px;transition:all .3s}.sidebar-logo[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{display:inline-block;height:32px;width:32px;vertical-align:middle}.sidebar-logo[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{display:inline-block;margin:0 0 0 20px;font-weight:600;font-size:14px;font-family:Avenir,Helvetica Neue,Arial,Helvetica,sans-serif;vertical-align:middle}.item[_ngcontent-%COMP%] .ant-menu-title-content{display:flex;align-items:center;gap:8px}.item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--app-text-color);display:flex;width:100%;align-items:center;gap:8px}"]})};function Vo(t,n){if(t&1){let e=z();r(0,"div",4),C("transitionend",function(i){g(e);let a=c();return h(a.onWrapTransitionEnd(i))}),r(1,"div",5),C("animationend",function(i){g(e);let a=c();return h(a.onInnerAnimationEnd(i))}),p(2,"ngm-header"),l()()}if(t&2){let e=c();I("leaving",e.leaving()),s(),I("leaving",e.leaving())}}var ke=class t{ws=f(Me);constructor(){this.ws.connect(),ie(()=>this.syncVisible())}wsState=Zt(this.ws.stateChanges(),{initialValue:"idle"});shouldShow=O(()=>this.wsState()!=="open");visible=M(!1);leaving=M(!1);SHOW_DELAY_MS=200;showTimer;removed=!1;syncVisible(){if(this.shouldShow()){if(this.removed=!1,this.visible()){this.leaving.set(!1);return}this.startShowDelay();return}this.clearShowDelay(),this.visible()&&!this.leaving()&&this.leaving.set(!0)}startShowDelay(){this.showTimer||(this.showTimer=setTimeout(()=>{this.showTimer=void 0,this.shouldShow()&&(this.visible.set(!0),this.leaving.set(!1),this.removed=!1)},this.SHOW_DELAY_MS))}clearShowDelay(){this.showTimer&&(clearTimeout(this.showTimer),this.showTimer=void 0)}onInnerAnimationEnd(n){}onWrapTransitionEnd(n){n.propertyName==="height"&&(this.removed||!this.shouldShow()&&this.leaving()&&(this.removed=!0,this.visible.set(!1),this.leaving.set(!1)))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=_({type:t,selectors:[["ngm-layout"]],decls:9,vars:1,consts:[[1,"app-layout"],[1,"ws-banner-wrap",3,"leaving"],[1,"app-content"],[1,"inner-content"],[1,"ws-banner-wrap",3,"transitionend"],[1,"ws-banner-inner",3,"animationend"]],template:function(e,o){e&1&&(r(0,"nz-layout",0),v(1,Vo,3,4,"div",1),r(2,"nz-layout",2),p(3,"ngm-sidebar"),r(4,"nz-layout")(5,"nz-content")(6,"div",3),p(7,"router-outlet"),l()()()(),p(8,"ngm-footer"),l()),e&2&&(s(),y(o.visible()?1:-1))},dependencies:[D,$t,R,Pn,bn,Bn,b,A,Fe,Te,Ne],styles:["html.default[_ngcontent-%COMP%] [_ngcontent-%COMP%]:root{--app-gray: #e6f7ff;--app-primary: #1890ff;--app-primary-1: #e6f7ff;--app-primary-2: #bae7ff;--app-primary-3: #91d5ff;--app-primary-4: #69c0ff;--app-primary-5: #40a9ff;--app-primary-6: #1890ff;--app-text-color: rgba(0, 0, 0, .85);--app-text-secondary: rgba(0, 0, 0, .45);--text-color-primary: #1890ff;--app-component-bg: #fff;--app-border-color: #d9d9d9;--header-error-background: #ff4d4f}html.default[_ngcontent-%COMP%] [_ngcontent-%COMP%]:root{--text-color-gray: #888}html.default [_nghost-%COMP%] .inner-content[_ngcontent-%COMP%]{background:#fff}html.dark[_ngcontent-%COMP%] [_ngcontent-%COMP%]:root{--text-color-gray: #bbb}html.dark [_nghost-%COMP%] .inner-content[_ngcontent-%COMP%]{background:#141414}[_nghost-%COMP%]{display:flex;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[_nghost-%COMP%] .app-layout[_ngcontent-%COMP%]{height:100vh;width:100%}[_nghost-%COMP%] .app-layout[_ngcontent-%COMP%] ngm-header[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .app-content[_ngcontent-%COMP%]{flex-direction:row}[_nghost-%COMP%] nz-content[_ngcontent-%COMP%] .inner-content[_ngcontent-%COMP%]{border-radius:8px;height:100%}[_nghost-%COMP%] nz-footer[_ngcontent-%COMP%]{text-align:center}.ws-banner-wrap[_ngcontent-%COMP%]{height:48px;overflow:hidden;transition:height .35s ease}.ws-banner-wrap.leaving[_ngcontent-%COMP%]{height:0}.ws-banner-inner[_ngcontent-%COMP%]{height:48px;display:flex;align-items:stretch}.ws-banner-inner.leaving[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeOutUpSoft .35s ease forwards}@keyframes _ngcontent-%COMP%_fadeOutUpSoft{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-30%)}}"]})};var Wn=`
|
|
2
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M435.8 536.2H512V353z" fill="#DD0031"/>
|
|
4
|
+
<path d="M400.9 616.8l-52.4 130.8h-97.2L512 163V64L94.9 212.7l63.6 551.5L512 960V616.8z" fill="#DD0031"/>
|
|
5
|
+
<path d="M512 353v183.2h76.2z" fill="#C3002F"/>
|
|
6
|
+
<path d="M512 64v99l259.8 584.6h-97.2l-52.4-130.8H512V960l353.5-195.8 63.6-551.5z" fill="#C3002F"/>
|
|
7
|
+
</svg>
|
|
8
|
+
`,Hn=`
|
|
9
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
|
10
|
+
<path d="M615.6 123.6h165.5L512 589.7 242.9 123.6H63.5L512 900.4l448.5-776.9z" fill="#41B883"/>
|
|
11
|
+
<path d="M781.1 123.6H615.6L512 303 408.4 123.6H242.9L512 589.7z" fill="#34495E"/>
|
|
12
|
+
</svg>
|
|
13
|
+
`,Un=`
|
|
14
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
+
<svg t="1767603739899" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9231" width="200" height="200">
|
|
16
|
+
<path d="M512 511.8m-80 0a80 80 0 1 0 160 0 80 80 0 1 0-160 0Z" fill="#61DAFB" p-id="9232"></path>
|
|
17
|
+
<path d="M960.5 511.8c0-62.8-73.8-117.2-188.5-150.1 28.9-115.8 18.7-206.9-35.7-238.3-54.5-31.4-138.5 5.3-224.3 88.2-85.8-82.9-169.8-119.6-224.3-88.2-54.4 31.4-64.6 122.6-35.7 238.3C137.3 394.6 63.5 449 63.5 511.8S137.3 629 252 661.9c-28.9 115.7-18.7 206.9 35.7 238.3 13.4 7.8 28.6 11.6 45.2 11.6 39.7 0 87.8-21.8 140-64.2 13-10.6 26.1-22.6 39.1-35.2 13 12.6 26.1 24.6 39.1 35.2 52.2 42.4 100.2 64.2 140 64.2 16.6 0 31.8-3.8 45.2-11.6 54.4-31.4 64.6-122.5 35.7-238.3 114.7-32.9 188.5-87.3 188.5-150.1zM716.8 157.2c35.3 20.4 42.7 94.3 17.6 194.8-36.7-8.4-76.7-14.7-119.3-18.6-24.7-34.9-50.2-66.4-75.8-94 59.2-57.3 114.2-88.4 152-88.4 9.6-0.1 18.2 2 25.5 6.2zM637 584c-13.8 24-28.4 47-43.3 69-26.1 2-53.3 3.1-81.7 3.1-28.3 0-55.5-1.1-81.6-3.1-15-22-29.5-45.1-43.3-69-14.1-24.5-26.7-48.6-38.1-72.2 11.4-23.6 24-47.7 38.1-72.2 14.1-24.5 28.7-47.4 43.4-69.1 26.1-2 53.3-3.1 81.6-3.1 28.3 0 55.5 1.1 81.6 3.1 14.7 21.6 29.3 44.6 43.4 69 14.1 24.5 26.7 48.6 38.1 72.2-11.5 23.7-24.1 47.8-38.2 72.3z m58.8-26.4c11.2 26.6 20.4 52.1 28 76.5-24.9 5.6-51.7 10.4-80.3 14 9.3-14.5 18.4-29.3 27.3-44.6 8.8-15.4 17.1-30.7 25-45.9zM512 756.5c-17.7-19.2-35.1-40.1-52.2-62.6 17.1 0.8 34.5 1.3 52.2 1.3 17.7 0 35.1-0.5 52.2-1.3-17.1 22.5-34.5 43.4-52.2 62.6zM380.5 648.1c-28.6-3.6-55.3-8.4-80.3-14 7.6-24.4 16.8-49.9 28-76.5 7.9 15.2 16.1 30.5 25 45.9 8.9 15.2 18 30 27.3 44.6zM328.2 466c-11.2-26.6-20.4-52.1-28-76.5 24.9-5.6 51.6-10.4 80.2-14-9.2 14.4-18.4 29.2-27.2 44.6-8.8 15.4-17.1 30.7-25 45.9zM512 267.1c17.3 18.7 34.8 39.8 52.1 62.7-17.1-0.8-34.4-1.3-52.1-1.3-17.7 0-35 0.5-52.1 1.3 17.3-22.9 34.8-44 52.1-62.7z m158.7 153c-8.9-15.3-18-30.1-27.2-44.6 28.6 3.6 55.3 8.4 80.2 14-7.6 24.4-16.8 49.9-28 76.5-7.8-15.2-16.1-30.5-25-45.9zM307.2 157.2c7.2-4.2 15.8-6.2 25.6-6.2 37.8 0 92.7 31.1 151.9 88.4-25.6 27.6-51.1 59.2-75.8 94-42.5 3.9-82.6 10.2-119.3 18.6-25.1-100.6-17.6-174.5 17.6-194.8zM102.5 511.8c0-40.8 60.3-84.2 160-112.6 11.1 36 25.6 73.8 43.5 112.6-17.8 38.8-32.4 76.6-43.5 112.6-99.7-28.4-160-71.9-160-112.6z m345.8 305.5c-59.7 48.5-111.1 66.4-141.1 49.2-35.3-20.4-42.7-94.3-17.6-194.8 36.7 8.4 76.7 14.7 119.3 18.6 24.4 34.5 49.9 66.1 75.8 94.2-12.1 11.7-24.2 22.9-36.4 32.8z m268.5 49.2c-29.9 17.3-81.4-0.6-141.1-49.2-12.1-9.9-24.3-21.1-36.5-32.8 26-28.1 51.4-59.7 75.8-94.2 42.5-3.9 82.6-10.2 119.3-18.7 25.2 100.6 17.7 174.5-17.5 194.9z m44.8-242.1c-11.1-36-25.6-73.8-43.5-112.6 17.8-38.8 32.4-76.6 43.5-112.6 99.7 28.5 160 71.9 160 112.6-0.1 40.7-60.4 84.2-160 112.6z" fill="#61DAFB" p-id="9233"></path></svg>
|
|
18
|
+
</svg>
|
|
19
|
+
`,$n=`
|
|
20
|
+
<svg t="1767598826450" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8231" width="200" height="200">
|
|
21
|
+
<path d="M875.2 262.3L546.7 72.7c-20.7-11.8-48.3-11.8-69 0L148.8 262.3c-21.5 12.2-34.5 34.9-34.5 59.7v379.2c0 24.8 13.4 47.9 34.5 60.1l86.1 49.5c41.8 20.7 56.8 20.7 75.9 20.7 62.1 0 97.4-37.8 97.4-102.7V354.4c0-5.3-4.1-9.3-9.3-9.3h-41.4c-5.3 0-9.3 4.1-9.3 9.3v374.3c0 28.8-30 57.7-78.8 33.3l-90.1-52c-3.2-2-5.3-5.3-5.3-8.9V321.9c0-3.7 2-7.3 5.3-8.9l328.1-190c3.2-1.6 7.3-1.6 10.2 0l328.5 189.6c3.2 1.6 5.3 5.3 5.3 8.9v379.2c0 3.7-2 7.3-4.9 8.9L517.9 899.3c-2.8 1.6-7.3 1.6-10.2 0l-84.4-49.9c-2.4-1.2-5.7-1.6-8.1-0.4-23.1 13.4-27.6 15-49.5 22.7-5.7 1.6-13.4 4.9 2.8 14.2l109.6 65c10.6 6.1 22.3 9.3 34.5 9.3 11.8-0.4 24-3.2 34.1-9.7l328.5-189.6c21.1-12.2 34.5-34.9 34.5-59.7V321.9c0-24.3-13.4-47.5-34.5-59.6z" fill="#689F63" p-id="8232"></path>
|
|
22
|
+
<path d="M614.1 641.1c-86.9 0-106-21.9-112.5-65-0.8-4.9-4.5-8.1-9.3-8.1h-42.6c-5.3 0-9.3 4.1-9.3 9.3 0 55.2 30 121.4 173.8 121.4l-0.4-0.4c103.9 0 163.6-41 163.6-112.5 0-70.6-47.9-89.7-149-103.1-101.9-13.4-112.5-20.3-112.5-44.3 0-19.5 8.9-45.9 84.4-45.9 67.8 0 92.6 14.6 102.7 60.1 1.2 4.1 4.9 7.3 9.3 7.3H755c2.4 0 5.3-0.8 6.9-2.8 1.6-2 2.8-4.5 2.4-7.3-6.9-78.4-58.9-114.9-164-114.9-93.4 0-149.4 39.4-149.4 105.6 0 71.9 55.6 91.8 145.8 100.7 107.6 10.6 116.1 26.4 116.1 47.5 0 36.5-29.3 52.4-98.7 52.4z" fill="#689F63" p-id="8233"></path>
|
|
23
|
+
</svg>
|
|
24
|
+
`,Gn=`
|
|
25
|
+
<svg t="1768726164973" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4725" width="200" height="200">
|
|
26
|
+
<path d="M332.72493 412.535453l171.001167-98.72725a13.830826 13.830826 0 0 1 13.83424 0l171.007994 98.72725a13.841066 13.841066 0 0 1 6.915413 11.9808v197.4545a13.858133 13.858133 0 0 1-6.918826 11.980799l-171.004581 98.72725a13.830826 13.830826 0 0 1-13.83424 0l-171.001167-98.72725a13.841066 13.841066 0 0 1-6.915413-11.980799V424.516253a13.847893 13.847893 0 0 1 6.915413-11.9808" fill="#7986CB" p-id="4726"></path>
|
|
27
|
+
<path d="M955.265709 502.476783L750.950409 147.036155c-7.420586-12.8512-21.128533-22.330026-35.969705-22.330026H306.329624c-14.844586 0-28.555946 9.478826-35.976532 22.330026L66.037792 501.701957c-7.420586 12.854613-7.420586 29.081599 0 41.932798L270.353092 896.170637c7.420586 12.8512 21.131946 19.421866 35.976532 19.421866h408.65108c14.83776 0 28.552532-6.372693 35.969705-19.227306l204.3153-353.109322c7.427413-12.847786 7.427413-27.921066 0-40.768852m-169.181861 170.922661c0 5.2224-3.14368 10.059093-7.676586 12.673706l-260.249592 150.152529a14.80704 14.80704 0 0 1-14.725119 0l-260.450978-150.152529c-4.52608-2.614613-7.693653-7.44448-7.693653-12.673706v-300.30847c0-5.229226 3.119787-10.059093 7.649279-12.677119l260.242765-150.152529a14.779733 14.779733 0 0 1 14.71488 0l260.471458 150.152529c4.529493 2.618027 7.717546 7.447893 7.717546 12.677119z" fill="#3F51B5" p-id="4727"></path>
|
|
28
|
+
</svg>
|
|
29
|
+
`,Yn=`
|
|
30
|
+
<svg t="1772087297160" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12394" data-spm-anchor-id="a313x.search_index.0.i16.3dc23a81kNbNJb" width="48" height="48">
|
|
31
|
+
<path d="M0 512c0 282.848 229.312 512 512 512 282.848 0 512-229.312 512-512 0-282.848-229.312-512-512-512C229.152 0 0 229.152 0 512z" fill="#333333" p-id="12395" data-spm-anchor-id="a313x.search_index.0.i13.3dc23a81kNbNJb" class="selected"></path>
|
|
32
|
+
<path d="M948.48 449.824c-34.912 45.408-101.056 22.272-131.456 40.032-44.288 26.016-42.88 89.152-151.264 173.952-26.336 20.64 27.968 128.768 4.48 152.928-23.872 24.544-119.84 25.792-143.104 12.384-34.08-19.808-7.36-71.2 0.192-146.304-70.016 7.232-92.672 5.984-162.912 3.104 10.816 56.96 26.336 120.512 3.68 141.376-18.592 16.928-108.608 18.784-136.768 0.192-35.328-23.328 25.504-156 4.896-158.272-23.68-2.464-168.416 3.296-142.88-155.808 27.136 40.032 73.28 77.792 126.368 60.864 3.072-58.208 20-113.92 48.384-158.496 37.568-58.624 95.328-97.824 168.416-97.824 72.256 0 132.48 31.776 171.872 81.728 30.816 39.2 48.8 89.984 48.992 145.088 76.352-58.208 20.224-200.8 111.648-254.24 65.12-37.984 141.248-18.368 177.6 41.888 19.392 31.584 25.312 87.072 1.824 117.408z" fill="#ffffff" p-id="12396" data-spm-anchor-id="a313x.search_index.0.i14.3dc23a81kNbNJb" class=""></path>
|
|
33
|
+
</svg>
|
|
34
|
+
`;var Be=class t{constructor(n){this.icons=n}inited=!1;init(){this.inited||(this.inited=!0,this.icons.addIconLiteral("proj:angular",Wn),this.icons.addIconLiteral("proj:vue",Hn),this.icons.addIconLiteral("proj:react",Un),this.icons.addIconLiteral("proj:node",$n),this.icons.addIconLiteral("proj:eslint",Gn),this.icons.addIconLiteral("proj:svn",Yn))}static \u0275fac=function(e){return new(e||t)(re(Qt))};static \u0275prov=w({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ae=class t{constructor(n){n.init()}static \u0275fac=function(e){return new(e||t)(le(Be))};static \u0275cmp=_({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(e,o){e&1&&p(0,"ngm-layout")},dependencies:[ke],styles:["[_nghost-%COMP%]{display:block;height:100vh}"]})};Rt(Ae,Ln).catch(t=>console.error(t));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Ie,b as Oe}from"./chunk-GCKL62DR.js";import"./chunk-SIVPP74B.js";import{b as je}from"./chunk-POZS3PD3.js";import{a as Se,b as Fe}from"./chunk-J2JNFWJN.js";import"./chunk-HZ73CM45.js";import{b as ce,c as de,d as ue,e as De,g as Pe,h as Te}from"./chunk-ROB7EMN5.js";import"./chunk-SNCDDYQR.js";import{E as be,G as Ne,g as we}from"./chunk-EP45FT55.js";import{Ab as ve,Bb as he,Cb as xe,Fb as ye,Hb as Me,M as oe,N as re,O as ae,P as pe,V as se,Y as le,Z as me,jb as ge,lb as fe,pb as _e,vb as ze,yb as Ce}from"./chunk-PTMJ422K.js";import"./chunk-HFZLJHYR.js";import{B as U,d as ie,i as E}from"./chunk-53YRDYLS.js";import{$b as J,B as q,Dc as K,Eb as O,Fb as y,Fc as Q,Ha as z,Ic as s,Jc as b,Kb as M,Kc as F,Mc as X,Nc as Y,Oc as Z,Tc as ee,Ub as W,V as P,Vb as C,Wc as $,Xb as v,_b as H,a as d,ac as c,ad as te,b as u,bc as r,cc as a,dc as g,fd as N,gd as ne,hc as j,ic as S,jc as R,kc as T,ma as G,mb as p,na as h,qc as w,ra as _,tc as l,vd as A,xa as x,ya as D}from"./chunk-SJG2JCPL.js";function Ve(n,t){if(n&1&&(j(0),s(1),S()),n&2){let e=l(2);p(),b(e.nzText)}}function Be(n,t){if(n&1&&(r(0,"span",0),M(1,Ve,2,1,"ng-container",1),a()),n&2){let e=l();p(),c("nzStringTemplateOutlet",e.nzText)}}var L=(()=>{class n{nzText;nzType="horizontal";nzOrientation="center";nzVariant="solid";nzSize;nzDashed=!1;nzPlain=!1;static \u0275fac=function(o){return new(o||n)};static \u0275cmp=O({type:n,selectors:[["nz-divider"]],hostAttrs:[1,"ant-divider"],hostVars:22,hostBindings:function(o,i){o&2&&Q("ant-divider-horizontal",i.nzType==="horizontal")("ant-divider-vertical",i.nzType==="vertical")("ant-divider-with-text",i.nzText)("ant-divider-plain",i.nzPlain)("ant-divider-with-text-left",i.nzText&&i.nzOrientation==="left")("ant-divider-with-text-right",i.nzText&&i.nzOrientation==="right")("ant-divider-with-text-center",i.nzText&&i.nzOrientation==="center")("ant-divider-dashed",i.nzDashed||i.nzVariant==="dashed")("ant-divider-dotted",i.nzVariant==="dotted")("ant-divider-sm",i.nzSize==="small")("ant-divider-md",i.nzSize==="middle")},inputs:{nzText:"nzText",nzType:"nzType",nzOrientation:"nzOrientation",nzVariant:"nzVariant",nzSize:"nzSize",nzDashed:[2,"nzDashed","nzDashed",A],nzPlain:[2,"nzPlain","nzPlain",A]},exportAs:["nzDivider"],decls:1,vars:1,consts:[[1,"ant-divider-inner-text"],[4,"nzStringTemplateOutlet"]],template:function(o,i){o&1&&C(0,Be,2,1,"span",0),o&2&&v(i.nzText?0:-1)},dependencies:[pe,ae],encapsulation:2,changeDetection:0})}return n})(),Ee=(()=>{class n{static \u0275fac=function(o){return new(o||n)};static \u0275mod=y({type:n});static \u0275inj=h({imports:[L]})}return n})();var I=class n{api=_(we);getDeps(t){return this.api.get(`/api/deps/list/${t}`).pipe(q(e=>({items:[...e.dependencies.map(i=>u(d({},i),{group:"dependencies"})),...e.devDependencies.map(i=>u(d({},i),{group:"devDependencies"}))],meta:e.meta})))}install(t,e){return this.api.post(`/api/deps/install/${t}`,e)}uninstall(t,e){return this.api.post(`/api/deps/uninstall/${t}`,e)}installDevtools(t){return this.api.post(`/api/deps/devtools/install/${t}`,{tool:"devtools"})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})};var $e=["class","component"],Ae=n=>({$implicit:n,title:"\u8FD0\u884C\u4F9D\u8D56"}),Ue=n=>({$implicit:n,title:"\u5F00\u53D1\u4F9D\u8D56"});function Le(n,t){n&1&&R(0)}function qe(n,t){n&1&&R(0)}function Ge(n,t){n&1&&(r(0,"nz-tag",20),s(1,"\u5DF2\u5B89\u88C5"),a())}function We(n,t){n&1&&(r(0,"nz-tag",21),s(1,"\u672A\u5B89\u88C5"),a())}function He(n,t){if(n&1){let e=T();r(0,"button",27),w("click",function(){x(e);let i=l().$implicit,m=l(2);return D(m.installOrUpdate(i))}),g(1,"nz-icon",28),a()}if(n&2){let e=l().$implicit,o=l(2);c("nzLoading",o.installing()[e.name])("nz-tooltip",e.hasUpdate?"\u66F4\u65B0\u5230\u6700\u65B0\u7248\u672C":"\u5B89\u88C5\u4F9D\u8D56")}}function Je(n,t){if(n&1){let e=T();r(0,"button",29),w("nzOnConfirm",function(){x(e);let i=l().$implicit,m=l(2);return D(m.uninstall(i))}),g(1,"nz-icon",30),a()}if(n&2){let e=l().$implicit;c("nzPopconfirmTitle",ee("\u786E\u5B9A\u5378\u8F7D ",e.name,"\uFF1F")),p(),c("nz-tooltip","\u5378\u8F7D"+e.name)}}function Ke(n,t){if(n&1){let e=T();r(0,"div",9)(1,"div",11)(2,"div",12)(3,"div",13),g(4,"span",14),a(),r(5,"div",15)(6,"div",16),s(7),a(),r(8,"div",17)(9,"span"),s(10),a(),r(11,"span",18),s(12,"\xB7"),a(),r(13,"span"),s(14),a(),r(15,"span",18),s(16,"\xB7"),a(),r(17,"span"),s(18),a()()()(),r(19,"div",19),C(20,Ge,2,0,"nz-tag",20)(21,We,2,0,"nz-tag",21),r(22,"a",22),w("click",function(){let i=x(e).$implicit,m=l(2);return D(m.openDetail(i))}),g(23,"span",23),s(24," \u67E5\u770B\u8BE6\u60C5 "),a()(),r(25,"div",24),C(26,He,2,2,"button",25),C(27,Je,2,3,"button",26),a()()()}if(n&2){let e=t.$implicit;p(7),b(e.name),p(3),F("\u7248\u672C ",e.current||"-"),p(4),F("\u8981\u6C42 ",e.required||"-"),p(4),F("\u6700\u65B0 ",e.latest||"-"),p(2),v(e.installed?20:21),p(6),v(e.hasUpdate||!e.installed?26:-1),p(),v(e.installed?27:-1)}}function Qe(n,t){n&1&&(r(0,"div",10),s(1,"\u65E0\u6570\u636E"),a())}function Xe(n,t){if(n&1&&(r(0,"div",7),s(1),a(),r(2,"div",8),H(3,Ke,28,7,"div",9,W().trackByName,!0),C(5,Qe,2,0,"div",10),a()),n&2){let e=t.$implicit,o=t.title;p(),b(o),p(2),J(e),p(2),v(e.length===0?5:-1)}}var V=class n{api=_(I);msg=_(be);projectId=N(()=>this.projectState.currentProjectId()||"");loading=z(!1);keyword=z("");items=z([]);meta=z(null);installing=z({});uninstalling=z({});runtimeItems=N(()=>this.filterItems(this.items().filter(t=>t.group==="dependencies")));devItems=N(()=>this.filterItems(this.items().filter(t=>t.group==="devDependencies")));runningCount=N(()=>this.items().filter(t=>t.hasUpdate).length);projectState=_(Ne);depsState=_(I);constructor(){ne(async()=>{this.refresh()})}filterItems(t){let e=this.keyword().trim().toLowerCase();return e?t.filter(o=>o.name.toLowerCase().includes(e)):t}refresh(){this.loading.set(!0),this.api.getDeps(this.projectId()).pipe(P(()=>this.loading.set(!1))).subscribe({next:({items:t,meta:e})=>{this.items.set(t),this.meta.set(e)},error:t=>this.msg.error(t?.message||"\u52A0\u8F7D\u4F9D\u8D56\u5931\u8D25")})}openDetail(t){t.homepage?window.open(t.homepage,"_blank"):window.open(`https://www.npmjs.com/package/${encodeURIComponent(t.name)}`,"_blank")}installOrUpdate(t){let e=t.name;this.installing.set(u(d({},this.installing()),{[e]:!0}));let o=t.installed&&t.hasUpdate?"latest":"required",i=t.installed&&t.hasUpdate?"\u5DF2\u66F4\u65B0":"\u5DF2\u5B89\u88C5";this.api.install(this.projectId(),{name:t.name,group:t.group,target:o}).pipe(P(()=>this.installing.set(u(d({},this.installing()),{[e]:!1})))).subscribe({next:()=>{this.msg.success(i),this.refresh()}})}uninstall(t){let e=t.name;this.uninstalling.set(u(d({},this.uninstalling()),{[e]:!0})),this.api.uninstall(this.projectId(),{name:t.name,group:t.group}).pipe(P(()=>this.uninstalling.set(u(d({},this.uninstalling()),{[e]:!1})))).subscribe({next:()=>{this.msg.success("\u5DF2\u5378\u8F7D"),this.refresh()}})}installDevtools(){this.loading.set(!0),this.api.installDevtools(this.projectId()).pipe(P(()=>this.loading.set(!1))).subscribe({next:()=>{this.msg.success("devtools \u5DF2\u5B89\u88C5"),this.refresh()},error:t=>this.msg.error(t?.message||"devtools \u5B89\u88C5\u5931\u8D25")})}installAll(){let t=this.items().filter(o=>!o.installed);if(!t.length){this.msg.info("\u6CA1\u6709\u9700\u8981\u5B89\u88C5\u7684\u4F9D\u8D56");return}(async()=>{this.loading.set(!0);try{for(let o of t)await new Promise((i,m)=>{this.api.install(this.projectId(),{name:o.name,group:o.group,target:"required"}).subscribe({next:()=>i(),error:f=>m(f)})});this.msg.success("\u5DF2\u5B8C\u6210\u5B89\u88C5"),this.refresh()}catch{this.msg.error("\u6279\u91CF\u5B89\u88C5\u5931\u8D25")}finally{this.loading.set(!1)}})()}trackByName(t,e){return e.group+":"+e.name}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-project-deps",8,"component"]],attrs:$e,decls:12,vars:11,consts:[["contentTemplate",""],[3,"title","loading"],["ngProjectAs","actions",5,["actions"]],["nz-input","","placeholder","\u641C\u7D22",1,"search",3,"ngModelChange","ngModel"],["nzType","search","nzInputPrefix",""],[1,"panel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"group-title"],[1,"list"],[1,"row"],[1,"empty"],["nz-row","","nzAlign","middle",1,"row-inner"],["nz-col","","nzFlex","400px",1,"left"],[1,"pkg-icon"],["nz-icon","","nzType","appstore"],[1,"pkg"],[1,"name"],[1,"sub"],[1,"sep"],["nz-col","","nzFlex","auto",1,"mid"],["nzColor","success"],["nzColor","warning"],[1,"detail",3,"click"],["nz-icon","","nzType","link"],["nz-col","","nzFlex","180px",1,"right"],["nz-button","","nzType","text",3,"nzLoading","nz-tooltip"],["nz-button","","nzType","text","nz-popconfirm","",3,"nzPopconfirmTitle"],["nz-button","","nzType","text",3,"click","nzLoading","nz-tooltip"],["nzType","download"],["nz-button","","nzType","text","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle"],["nzType","delete","nzTheme","fill",3,"nz-tooltip"]],template:function(e,o){if(e&1){let i=T();r(0,"app-page-layout",1),j(1,2),g(2,"app-ng-devtool"),r(3,"nz-input-wrapper")(4,"input",3),Z("ngModelChange",function(f){return x(i),Y(o.keyword,f)||(o.keyword=f),D(f)}),w("ngModelChange",function(f){return x(i),D(o.keyword.set(f))}),a(),g(5,"nz-icon",4),a(),S(),r(6,"div",5),M(7,Le,1,0,"ng-container",6),g(8,"nz-divider"),M(9,qe,1,0,"ng-container",6),a()(),M(10,Xe,6,2,"ng-template",null,0,te)}if(e&2){let i=K(11);c("title","\u9879\u76EE\u914D\u7F6E")("loading",o.loading()),p(4),X("ngModel",o.keyword),p(3),c("ngTemplateOutlet",i)("ngTemplateOutletContext",$(7,Ae,o.runtimeItems())),p(2),c("ngTemplateOutlet",i)("ngTemplateOutletContext",$(9,Ue,o.devItems()))}},dependencies:[E,ie,ze,ge,fe,_e,ue,de,ce,me,le,se,xe,ve,he,Ce,re,oe,Me,ye,Fe,Se,je,Ee,L,Oe,Ie,Pe,Te,De],styles:[".panel[_ngcontent-%COMP%]{border-radius:10px;padding:16px 18px;box-shadow:0 2px 8px #0000000f}.group-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;margin:6px 0 12px;opacity:.65}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.row[_ngcontent-%COMP%]{border-radius:10px}.row[_ngcontent-%COMP%]:hover{box-shadow:0 4px 12px #0000001a;background:var(--app-primary-3)}.row-inner[_ngcontent-%COMP%]{padding:10px 12px}.left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.left[_ngcontent-%COMP%] .pkg-icon[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:8px;opacity:.65;display:inline-flex;align-items:center;justify-content:center}.left[_ngcontent-%COMP%] .pkg[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{font-weight:600;line-height:18px}.left[_ngcontent-%COMP%] .pkg[_ngcontent-%COMP%] .sub[_ngcontent-%COMP%]{margin-top:2px;font-size:12px;opacity:.55}.left[_ngcontent-%COMP%] .pkg[_ngcontent-%COMP%] .sub[_ngcontent-%COMP%] .sep[_ngcontent-%COMP%]{margin:0 6px}.mid[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px}.mid[_ngcontent-%COMP%] .detail[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;color:var(--text-color-primary)}.right[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:6px}.empty[_ngcontent-%COMP%]{padding:16px 0;text-align:center}"]})};var Ye=[{path:"",component:V}],B=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=y({type:n});static \u0275inj=h({imports:[U.forChild(Ye),U]})};var ke=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=y({type:n});static \u0275inj=h({imports:[E,B]})};export{ke as DependenciesModule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as wn,f as bn}from"./chunk-CO7S3LZV.js";import{a as it,b as De}from"./chunk-GCKL62DR.js";import{b as at,c as st,d as ct}from"./chunk-HCBKQAGF.js";import{a as cn,b as pn,c as Ge}from"./chunk-EC33AXSR.js";import{a as ot,b as rt,d as zn,e as Mn}from"./chunk-35COW2FA.js";import"./chunk-SIVPP74B.js";import{a as lt,b as Ve}from"./chunk-POZS3PD3.js";import{a as ye,b as xe}from"./chunk-J2JNFWJN.js";import{a as $e}from"./chunk-HZ73CM45.js";import{d as he,e as ve,f as ne}from"./chunk-DJJC6FPO.js";import{e as un,f as Ye,g as Xe}from"./chunk-ROB7EMN5.js";import"./chunk-SNCDDYQR.js";import{E as Se,G as xn,g as _n,j as Re,l as Pe,n as Cn,o as et,p as gn,q as fn,r as hn,s as vn,t as yn,u as tt,v as nt}from"./chunk-EP45FT55.js";import{Ab as H,Bb as fe,Cb as F,Fb as qe,G as nn,H as St,Hb as Ie,La as sn,M as J,N as U,O as on,P as rn,T as ln,U as an,V,W as X,Y as O,Z as I,jb as $,lb as K,pb as j,rb as dn,ub as mn,vb as P,x as en,yb as Qe,z as tn}from"./chunk-PTMJ422K.js";import"./chunk-HFZLJHYR.js";import{B as Pt,d as Ze,i as A,o as me}from"./chunk-53YRDYLS.js";import{$b as D,Ca as Lt,Dc as Q,Eb as T,Ec as Zt,Fb as ke,Fc as Y,Ha as E,Ic as m,Jc as k,Kb as W,Kc as se,Lc as Gt,Mc as ce,Nc as pe,Oa as te,Oc as de,Vb as g,Vc as Je,Wc as je,Xb as f,Xc as Qt,Zb as _e,_b as S,a as w,ac as d,ad as ge,b as z,bc as l,cc as a,dc as h,e as Be,f as qt,fd as v,gd as Rt,hc as le,ic as ae,jc as Ce,kc as b,ld as Le,ma as Ae,mb as s,na as Ne,pd as Yt,qc as C,r as It,ra as q,rb as y,rd as Xt,s as Ke,tc as c,uc as Ut,vc as $t,vd as Ue,xa as u,xc as Ht,ya as _,yc as Wt,z as L,zc as Jt}from"./chunk-SJG2JCPL.js";var $n=(i,t)=>t.id;function Hn(i,t){i&1&&h(0,"nz-spin")}function Wn(i,t){if(i&1&&(l(0,"nz-tag"),m(1),a()),i&2){let e=c().$implicit;s(),se("HTTP ",e.response.status)}}function Jn(i,t){i&1&&(l(0,"nz-tag",8),m(1,"ERR"),a())}function Zn(i,t){if(i&1){let e=b();l(0,"button",10),C("click",function(){u(e);let o=c().$implicit,r=c(3);return _(r.copy(o.resolved.curl.bash))}),m(1,"curl"),a()}}function Gn(i,t){if(i&1){let e=b();l(0,"div",3)(1,"div",5)(2,"nz-tag"),m(3),a(),l(4,"span",6),m(5),a()(),l(6,"div",7)(7,"span"),m(8),a(),g(9,Wn,2,1,"nz-tag"),g(10,Jn,2,0,"nz-tag",8),a(),l(11,"div",9)(12,"button",10),C("click",function(){let o=u(e).$implicit,r=c(3);return _(r.replay.emit(o))}),m(13,"\u91CD\u653E"),a(),g(14,Zn,2,0,"button",11),a()()}if(i&2){let e=t.$implicit;s(3),k(e.requestSnapshot.method),s(2),k(e.requestSnapshot.url),s(3),se("",e.metrics.durationMs," ms"),s(),f(e.response?9:-1),s(),f(e.error?10:-1),s(4),f(e.resolved.curl?14:-1)}}function Qn(i,t){i&1&&(l(0,"div",4),m(1,"\u6682\u65E0\u5386\u53F2\u8BB0\u5F55"),a())}function Yn(i,t){if(i&1&&(l(0,"div",2),S(1,Gn,15,6,"div",3,$n),g(3,Qn,2,0,"div",4),a()),i&2){let e=c(2);s(),D(e.histories),s(2),f(e.histories.length?-1:3)}}function Xn(i,t){if(i&1&&(le(0),g(1,Hn,1,0,"nz-spin")(2,Yn,4,1,"div",2),ae()),i&2){let e=c();s(),f(e.loading?1:2)}}var pt=class i{loading=!1;histories=[];close=new y;replay=new y;copy(t){navigator.clipboard.writeText(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-api-history-drawer"]],inputs:{loading:"loading",histories:"histories"},outputs:{close:"close",replay:"replay"},decls:2,vars:2,consts:[["nzTitle","\u8BF7\u6C42\u5386\u53F2","nzPlacement","right",3,"nzOnClose","nzVisible","nzWidth"],[4,"nzDrawerContent"],[1,"list"],[1,"item"],[1,"empty"],[1,"row"],[1,"url"],[1,"meta"],["nzColor","red"],[1,"actions"],["nz-button","","nzSize","small",3,"click"],["nz-button","","nzSize","small"]],template:function(e,n){e&1&&(l(0,"nz-drawer",0),C("nzOnClose",function(){return n.close.emit()}),W(1,Xn,3,1,"ng-container",1),a()),e&2&&d("nzVisible",!0)("nzWidth",520)},dependencies:[A,Ge,pn,cn,I,O,V,X,Ve,lt,xe,ye],styles:[".list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.item[_ngcontent-%COMP%]{border:1px solid #f0f0f0;border-radius:8px;padding:10px}.row[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center;font-weight:500}.url[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.meta[_ngcontent-%COMP%]{margin-top:6px;display:flex;gap:8px;font-size:12px;opacity:.7}.actions[_ngcontent-%COMP%]{margin-top:8px;display:flex;gap:8px}.empty[_ngcontent-%COMP%]{padding:16px;opacity:.6;text-align:center}"]})};var ni=["*"];function ii(i,t){if(i&1){let e=b();l(0,"button",12),C("click",function(o){u(e);let r=c();return r.toggle.emit(r.node.key),_(o.stopPropagation())}),h(1,"nz-icon",13),a()}if(i&2){let e=c();s(),d("nzType",e.hasChildren?e.expanded?"down":"right":"minus")}}function oi(i,t){if(i&1&&(l(0,"nz-tag",5),m(1),a()),i&2){let e=c();s(),k(e.node.method||"")}}function ri(i,t){if(i&1&&(l(0,"div",8),m(1),a()),i&2){let e=c();s(),k(e.node.subtitle)}}function li(i,t){if(i&1){let e=b();l(0,"li",16),C("click",function(){u(e);let o=c(3);return o.createFolder.emit(o.node.id),_(o.visible=!1)}),h(1,"nz-icon",22),l(2,"span"),m(3,"\u65B0\u5EFA\u76EE\u5F55"),a()()}}function ai(i,t){if(i&1){let e=b();l(0,"li",16),C("click",function(){u(e);let o=c(3);return o.move.emit(o.node.id),_(o.visible=!1)}),h(1,"nz-icon",22),l(2,"span"),m(3,"\u79FB\u52A8\u5230"),a()()}}function si(i,t){if(i&1){let e=b();g(0,li,4,0,"li",15),l(1,"li",16),C("click",function(){u(e);let o=c(2);return o.createRequest.emit(o.node.id),_(o.visible=!1)}),h(2,"nz-icon",17),l(3,"span"),m(4,"\u65B0\u5EFA\u8BF7\u6C42"),a()(),g(5,ai,4,0,"li",15),l(6,"li",16),C("click",function(){u(e);let o=c(2);return o.rename.emit(o.node.id),_(o.visible=!1)}),h(7,"nz-icon",18),l(8,"span"),m(9,"\u91CD\u547D\u540D"),a()(),h(10,"li",19),l(11,"li",20),C("nzOnConfirm",function(){u(e);let o=c(2);return _(o.delete.emit(o.node.id))}),h(12,"nz-icon",21),l(13,"span"),m(14,"\u5220\u9664"),a()()}if(i&2){let e=c(2);f(e.node.kind==="collection"?0:-1),s(5),f(e.node.kind==="folder"?5:-1)}}function ci(i,t){if(i&1){let e=b();l(0,"li",16),C("click",function(){u(e);let o=c(2);return o.move.emit(o.node.id),_(o.visible=!1)}),h(1,"nz-icon",22),l(2,"span"),m(3,"\u79FB\u52A8\u5230"),a()(),l(4,"li",16),C("click",function(){u(e);let o=c(2);return o.rename.emit(o.node.id),_(o.visible=!1)}),h(5,"nz-icon",18),l(6,"span"),m(7,"\u91CD\u547D\u540D"),a()(),h(8,"li",19),l(9,"li",20),C("nzOnConfirm",function(){u(e);let o=c(2);return _(o.delete.emit(o.node.id))}),h(10,"nz-icon",21),l(11,"span"),m(12,"\u5220\u9664"),a()()}}function pi(i,t){if(i&1&&(l(0,"ul",14),g(1,si,15,2)(2,ci,13,0),a()),i&2){let e=c();s(),f(e.node.kind!=="request"?1:2)}}function di(i,t){i&1&&(l(0,"div",11),$t(1),a())}var dt=class i{node;expanded=!1;activeKey=null;toggle=new y;selectRequest=new y;selectCollection=new y;createRequest=new y;createFolder=new y;rename=new y;move=new y;copyCurl=new y;delete=new y;visible=!1;get hasChildren(){return(this.node.children?.length??0)>0}get iconType(){return this.node.kind==="request"?"api":this.node.kind==="folder"?"folder":"database"}onClick(){this.node.kind==="request"?this.selectRequest.emit(this.node.id):this.selectCollection.emit(this.node.id)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-collection-tree-item"]],hostVars:2,hostBindings:function(e,n){e&2&&Y("ctree-item",!0)},inputs:{node:"node",expanded:"expanded",activeKey:"activeKey"},outputs:{toggle:"toggle",selectRequest:"selectRequest",selectCollection:"selectCollection",createRequest:"createRequest",createFolder:"createFolder",rename:"rename",move:"move",copyCurl:"copyCurl",delete:"delete"},ngContentSelectors:ni,decls:14,vars:11,consts:[["menuTpl",""],[1,"row"],["nz-button","","nzType","text","nzSize","small",1,"chev"],[1,"main",3,"click"],[1,"icon",3,"nzType"],[1,"method"],[1,"texts"],[1,"title"],[1,"sub"],["nz-button","","nzType","text","nzSize","small","nz-popover","","nzPopoverTrigger","click","nzPopover","","nzPopoverPlacement","right",1,"more",3,"click","nzPopoverVisibleChange","nzPopoverVisible","nzPopoverContent","nzPopoverOverlayClassName"],["nzType","more","nzTheme","outline"],[1,"children"],["nz-button","","nzType","text","nzSize","small",1,"chev",3,"click"],[3,"nzType"],["nz-menu",""],["nz-menu-item",""],["nz-menu-item","",3,"click"],["nzType","plus"],["nzType","edit"],["nz-menu-divider",""],["nz-menu-item","","nzDanger","","nz-popconfirm","","nzPopconfirmTitle","\u786E\u8BA4\u5220\u9664\u5417\uFF1F",3,"nzOnConfirm"],["nzType","delete"],["nzType","folder"]],template:function(e,n){if(e&1){let o=b();Ut(),l(0,"div",1),g(1,ii,2,1,"button",2),l(2,"div",3),C("click",function(){return u(o),_(n.onClick())}),h(3,"nz-icon",4),g(4,oi,2,1,"nz-tag",5),l(5,"div",6)(6,"div",7),m(7),a(),g(8,ri,2,1,"div",8),a()(),l(9,"button",9),C("click",function(p){return u(o),_(p.stopPropagation())}),de("nzPopoverVisibleChange",function(p){return u(o),pe(n.visible,p)||(n.visible=p),_(p)}),h(10,"nz-icon",10),a(),W(11,pi,3,1,"ng-template",null,0,ge),a(),g(13,di,2,0,"div",11)}if(e&2){let o=Q(12);Y("active",n.activeKey===n.node.key),s(),f(n.hasChildren?1:-1),s(2),d("nzType",n.iconType),s(),f(n.node.kind==="request"?4:-1),s(3),k(n.node.title),s(),f(n.node.subtitle?8:-1),s(),ce("nzPopoverVisible",n.visible),d("nzPopoverContent",o)("nzPopoverOverlayClassName","project-item-popover"),s(4),f(n.hasChildren&&n.expanded?13:-1)}},dependencies:[A,I,O,V,P,U,J,Xe,Ye,et,Pe,Re,Cn,xe,ye,De,it],styles:[".item[_nghost-%COMP%]{display:block}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:6px 8px;border:1px solid #f0f0f0;border-radius:10px;cursor:pointer;transition:background .15s,border-color .15s}.row.active[_ngcontent-%COMP%]{background:#f5f5f5;border-color:#d9d9d9}.chev[_ngcontent-%COMP%]{flex:0 0 auto}.chev[_ngcontent-%COMP%] nz-icon[_ngcontent-%COMP%]{font-size:12px;transition:transform .15s}.main[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.icon[_ngcontent-%COMP%]{opacity:.75}.method[_ngcontent-%COMP%]{flex:0 0 auto}.texts[_ngcontent-%COMP%]{flex:1;min-width:0}.title[_ngcontent-%COMP%]{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sub[_ngcontent-%COMP%]{font-size:12px;opacity:.65;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.more[_ngcontent-%COMP%]{flex:0 0 auto;visibility:hidden}.row[_ngcontent-%COMP%]:hover .more[_ngcontent-%COMP%]{visibility:visible}.children[_ngcontent-%COMP%]{margin-left:18px;padding-top:6px;display:flex;flex-direction:column;gap:6px}"]})};var En=i=>({$implicit:i}),An=(i,t)=>t.key;function ui(i,t){if(i&1&&Ce(0,1),i&2){let e=t.$implicit;c();let n=Q(4);d("ngTemplateOutlet",n)("ngTemplateOutletContext",je(2,En,e))}}function _i(i,t){i&1&&(l(0,"div",2),m(1,"\u6682\u65E0\u8BF7\u6C42"),a())}function Ci(i,t){if(i&1&&Ce(0,1),i&2){let e=t.$implicit;c(2);let n=Q(4);d("ngTemplateOutlet",n)("ngTemplateOutletContext",je(2,En,e))}}function gi(i,t){if(i&1){let e=b();l(0,"app-collection-tree-item",3),C("toggle",function(o){u(e);let r=c();return _(r.toggle(o))})("selectRequest",function(o){u(e);let r=c();return _(r.onSelectRequest(o))})("selectCollection",function(o){u(e);let r=c();return _(r.onSelectCollection(o))})("createRequest",function(o){u(e);let r=c();return _(r.createRequest.emit({collectionId:o}))})("createFolder",function(o){u(e);let r=c();return _(r.createFolder.emit({collectionId:o}))})("rename",function(o){let r=u(e).$implicit,p=c();return _(p.rename.emit({id:o,kind:r.kind}))})("move",function(o){let r=u(e).$implicit,p=c();return _(p.move.emit({id:o,kind:r.kind}))})("copyCurl",function(o){u(e);let r=c();return _(r.copyCurl.emit(o))})("delete",function(o){let r=u(e).$implicit,p=c();return _(p.delete.emit({id:o,kind:r.kind}))}),S(1,Ci,1,4,"ng-container",1,An),a()}if(i&2){let e=t.$implicit,n=c();d("node",e)("expanded",n.expanded(e.key))("activeKey",n.activeKey()),s(),D(e.children)}}var mt=class i{nodes=[];activeRequestId=Le(null);selectRequest=new y;selectCollection=new y;createRequest=new y;createFolder=new y;rename=new y;move=new y;copyCurl=new y;delete=new y;activeKey=v(()=>this.activeRequestId()?`r:${this.activeRequestId()}`:null);_activeCollectionId=E(null);activeCollectionId=v(()=>this._activeCollectionId());expandedMap=E({});expanded(t){return!!this.expandedMap()[t]}toggle(t){let e=w({},this.expandedMap());e[t]=!e[t],this.expandedMap.set(e)}onSelectRequest(t){this.selectRequest.emit(t)}onSelectCollection(t){this._activeCollectionId.set(t),this.selectCollection.emit(t);let e=`c:${t}`,n=w({},this.expandedMap());n[e]=!0,this.expandedMap.set(n)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-collection-tree"]],hostVars:2,hostBindings:function(e,n){e&2&&Y("tree-body",!0)},inputs:{nodes:"nodes",activeRequestId:[1,"activeRequestId"]},outputs:{selectRequest:"selectRequest",selectCollection:"selectCollection",createRequest:"createRequest",createFolder:"createFolder",rename:"rename",move:"move",copyCurl:"copyCurl",delete:"delete"},decls:5,vars:1,consts:[["nodeTpl",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"empty"],[3,"toggle","selectRequest","selectCollection","createRequest","createFolder","rename","move","copyCurl","delete","node","expanded","activeKey"]],template:function(e,n){e&1&&(S(0,ui,1,4,"ng-container",1,An),g(2,_i,2,0,"div",2),W(3,gi,3,3,"ng-template",null,0,ge)),e&2&&(D(n.nodes),s(2),f(n.nodes.length?-1:2))},dependencies:[A,Ze,P,F,U,I,dt],styles:[".tree-body[_nghost-%COMP%]{flex:1 1 auto;height:0;overflow:auto;padding:10px;display:flex;flex-direction:column;gap:8px}.tree-body[_nghost-%COMP%] .empty[_ngcontent-%COMP%]{padding:16px;opacity:.6;text-align:center}"]})};function fi(i,t){if(i&1){let e=b();l(0,"ul",11)(1,"li",12),C("click",function(){u(e);let o=c();return o.createRequest.emit({collectionId:null}),_(o.visible=!1)}),h(2,"nz-icon",13),l(3,"span"),m(4,"\u65B0\u5EFA\u8BF7\u6C42"),a()(),l(5,"li",12),C("click",function(){u(e);let o=c();return _(o.createCollection.emit())}),h(6,"nz-icon",14),l(7,"span"),m(8,"\u65B0\u5EFA\u96C6\u5408"),a()()()}}var ut=class i{nodes=Le([]);q=Yt("");activeId=Le(null);loading=!1;select=new y;createRequest=new y;createCollection=new y;createFolder=new y;reload=new y;delete=new y;rename=new y;move=new y;visible=!1;static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-request-collections"]],inputs:{nodes:[1,"nodes"],q:[1,"q"],activeId:[1,"activeId"],loading:"loading"},outputs:{q:"qChange",select:"select",createRequest:"createRequest",createCollection:"createCollection",createFolder:"createFolder",reload:"reload",delete:"delete",rename:"rename",move:"move"},decls:13,vars:7,consts:[["menuTpl",""],[1,"wrap"],[1,"header"],["nzInputPrefix","","nzType","search",1,"search-icon"],["nz-input","","placeholder","\u641C\u7D22",3,"ngModelChange","ngModel"],["nz-button","","nzType","text",3,"click"],["nzTheme","outline",3,"nzType"],["nz-button","","nz-popover","","nzPopoverTrigger","click","nzPopoverPlacement","bottomCenter","nzType","text",3,"nzPopoverVisibleChange","nzPopoverVisible","nzPopoverContent","nzPopoverOverlayClassName"],["nzType","plus","nzTheme","outline"],[1,"body"],[3,"selectRequest","createRequest","createFolder","rename","move","delete","nodes","activeRequestId"],["nz-menu",""],["nz-menu-item","",1,"item",3,"click"],["nzType","api"],["nzType","folder-add"]],template:function(e,n){if(e&1){let o=b();l(0,"div",1)(1,"div",2)(2,"nz-input-wrapper"),h(3,"nz-icon",3),l(4,"input",4),de("ngModelChange",function(p){return u(o),pe(n.q,p)||(n.q=p),_(p)}),a()(),l(5,"button",5),C("click",function(){return u(o),_(n.reload.emit())}),h(6,"nz-icon",6),a(),l(7,"button",7),de("nzPopoverVisibleChange",function(p){return u(o),pe(n.visible,p)||(n.visible=p),_(p)}),h(8,"nz-icon",8),a()(),l(9,"div",9)(10,"app-collection-tree",10),C("selectRequest",function(p){return u(o),_(n.select.emit(p))})("createRequest",function(p){return u(o),_(n.createRequest.emit({collectionId:p.collectionId}))})("createFolder",function(p){return u(o),_(n.createFolder.emit({collectionId:p.collectionId??null}))})("rename",function(p){return u(o),_(n.rename.emit(p))})("move",function(p){return u(o),_(n.move.emit(p))})("delete",function(p){return u(o),_(n.delete.emit({id:p.id,kind:p.kind}))}),a()()(),W(11,fi,9,0,"ng-template",null,0,ge)}if(e&2){let o=Q(12);s(4),ce("ngModel",n.q),s(2),d("nzType",n.loading?"loading":"reload"),s(),ce("nzPopoverVisible",n.visible),d("nzPopoverContent",o)("nzPopoverOverlayClassName","project-item-popover"),s(3),d("nodes",n.nodes())("activeRequestId",n.activeId())}},dependencies:[A,P,$,K,j,I,O,V,F,H,fe,Qe,U,J,et,Pe,Re,Xe,Ye,mt],styles:["[_nghost-%COMP%]{height:100%;display:flex;flex-direction:column;width:320px;flex:0 0 320px}.wrap[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:hidden}.header[_ngcontent-%COMP%]{width:100%;padding:10px 12px;display:flex;gap:10px;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,.12);flex:0 0 auto}.header[_ngcontent-%COMP%] nz-input-wrapper[_ngcontent-%COMP%]{width:100%;border-radius:18px}.body[_ngcontent-%COMP%]{flex:1 1 auto;height:0;display:flex;flex-direction:column}"]})};function hi(i,t){i&1&&Ce(0)}function vi(i,t){if(i&1&&W(0,hi,1,0,"ng-container",7),i&2){let e=c(3);d("nzStringTemplateOutlet",e.nzIcon)}}function yi(i,t){if(i&1&&h(0,"nz-icon",6),i&2){let e=c(3);d("nzType",e.nzIconType||e.inferredIconType)("nzTheme",e.iconTheme)}}function xi(i,t){if(i&1&&(l(0,"div",2),g(1,vi,1,1,"ng-container")(2,yi,1,2,"nz-icon",6),a()),i&2){let e=c(2);s(),f(e.nzIcon?1:2)}}function wi(i,t){if(i&1&&(le(0),m(1),ae()),i&2){let e=c(4);s(),k(e.nzMessage)}}function bi(i,t){if(i&1&&(l(0,"span",8),W(1,wi,2,1,"ng-container",7),a()),i&2){let e=c(3);s(),d("nzStringTemplateOutlet",e.nzMessage)}}function zi(i,t){if(i&1&&(le(0),m(1),ae()),i&2){let e=c(4);s(),k(e.nzDescription)}}function Mi(i,t){if(i&1&&(l(0,"span",9),W(1,zi,2,1,"ng-container",7),a()),i&2){let e=c(3);s(),d("nzStringTemplateOutlet",e.nzDescription)}}function Ti(i,t){if(i&1&&(l(0,"div",3),g(1,bi,2,1,"span",8),g(2,Mi,2,1,"span",9),a()),i&2){let e=c(2);s(),f(e.nzMessage?1:-1),s(),f(e.nzDescription?2:-1)}}function Ei(i,t){if(i&1&&(le(0),m(1),ae()),i&2){let e=c(3);s(),k(e.nzAction)}}function Ai(i,t){if(i&1&&(l(0,"div",4),W(1,Ei,2,1,"ng-container",7),a()),i&2){let e=c(2);s(),d("nzStringTemplateOutlet",e.nzAction)}}function Ni(i,t){if(i&1&&(le(0),l(1,"span",12),m(2),a(),ae()),i&2){let e=c(4);s(2),k(e.nzCloseText)}}function ki(i,t){if(i&1&&W(0,Ni,3,1,"ng-container",7),i&2){let e=c(3);d("nzStringTemplateOutlet",e.nzCloseText)}}function qi(i,t){i&1&&h(0,"nz-icon",11)}function Ii(i,t){if(i&1){let e=b();l(0,"button",10),C("click",function(){u(e);let o=c(2);return _(o.closeAlert())}),g(1,ki,1,1,"ng-container")(2,qi,1,0,"nz-icon",11),a()}if(i&2){let e=c(2);s(),f(e.nzCloseText?1:2)}}function Ri(i,t){if(i&1){let e=b();l(0,"div",1),C("@slideAlertMotion.done",function(){u(e);let o=c();return _(o.onFadeAnimationDone())}),g(1,xi,3,1,"div",2),g(2,Ti,3,2,"div",3),g(3,Ai,2,1,"div",4),g(4,Ii,3,1,"button",5),a()}if(i&2){let e=c();Y("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),d("@.disabled",e.nzNoAnimation)("@slideAlertMotion",void 0),s(),f(e.nzShowIcon?1:-1),s(),f(e.nzMessage||e.nzDescription?2:-1),s(),f(e.nzAction?3:-1),s(),f(e.nzCloseable||e.nzCloseText?4:-1)}}var Nn="alert",Te=(()=>{var p;let i,t=[],e=[],n,o=[],r=[];return p=class{cdr=q(Xt);directionality=q(en);destroyRef=q(Lt);_nzModuleName=Nn;nzAction=null;nzCloseText=null;nzIconType=null;nzMessage=null;nzDescription=null;nzType="info";nzCloseable=Ke(this,t,!1);nzShowIcon=(Ke(this,e),Ke(this,o,!1));nzBanner=(Ke(this,r),!1);nzNoAnimation=!1;nzIcon=null;nzOnClose=new y;closed=!1;iconTheme="fill";inferredIconType="info-circle";dir="ltr";isTypeSet=!1;isShowIconSet=!1;constructor(){nn(Nn,()=>this.cdr.markForCheck())}ngOnInit(){this.directionality.change?.pipe(tn(this.destroyRef)).subscribe(M=>{this.dir=M,this.cdr.detectChanges()}),this.dir=this.directionality.value}closeAlert(){this.closed=!0}onFadeAnimationDone(){this.closed&&this.nzOnClose.emit(!0)}ngOnChanges(M){let{nzShowIcon:N,nzDescription:G,nzType:At,nzBanner:R}=M;if(N&&(this.isShowIconSet=!0),At)switch(this.isTypeSet=!0,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}G&&(this.iconTheme=this.nzDescription?"outline":"fill"),R&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=!0))}},(()=>{let M=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[St()],n=[St()],It(null,null,i,{kind:"field",name:"nzCloseable",static:!1,private:!1,access:{has:N=>"nzCloseable"in N,get:N=>N.nzCloseable,set:(N,G)=>{N.nzCloseable=G}},metadata:M},t,e),It(null,null,n,{kind:"field",name:"nzShowIcon",static:!1,private:!1,access:{has:N=>"nzShowIcon"in N,get:N=>N.nzShowIcon,set:(N,G)=>{N.nzShowIcon=G}},metadata:M},o,r),M&&Object.defineProperty(p,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:M})})(),qt(p,"\u0275fac",function(N){return new(N||p)}),qt(p,"\u0275cmp",T({type:p,selectors:[["nz-alert"]],inputs:{nzAction:"nzAction",nzCloseText:"nzCloseText",nzIconType:"nzIconType",nzMessage:"nzMessage",nzDescription:"nzDescription",nzType:"nzType",nzCloseable:[2,"nzCloseable","nzCloseable",Ue],nzShowIcon:[2,"nzShowIcon","nzShowIcon",Ue],nzBanner:[2,"nzBanner","nzBanner",Ue],nzNoAnimation:[2,"nzNoAnimation","nzNoAnimation",Ue],nzIcon:"nzIcon"},outputs:{nzOnClose:"nzOnClose"},exportAs:["nzAlert"],features:[te],decls:1,vars:1,consts:[[1,"ant-alert",3,"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"],[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(N,G){N&1&&g(0,Ri,5,24,"div",0),N&2&&f(G.closed?-1:0)},dependencies:[U,J,rn,on],encapsulation:2,data:{animation:[sn]},changeDetection:0})),p})(),Oe=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=ke({type:i});static \u0275inj=Ne({imports:[Te]})}return i})();function Pi(i,t){if(i&1&&h(0,"nz-option",3),i&2){let e=t.$implicit;d("nzValue",e)("nzLabel",e)}}function Si(i,t){if(i&1){let e=b();l(0,"nz-select",8),C("ngModelChange",function(o){u(e);let r=c();return _(r.setApiKeyIn(o))}),h(1,"nz-option",9)(2,"nz-option",10),a()}if(i&2){let e=c();d("ngModel",e.apiKeyIn())}}function Di(i,t){i&1&&(l(0,"div",6),m(1,"\u65E0\u9274\u6743"),a())}function Vi(i,t){if(i&1){let e=b();l(0,"div",7)(1,"div",11)(2,"div",12),m(3,"Username"),a(),l(4,"input",13),C("ngModelChange",function(o){u(e);let r=c();return _(r.setBasicUsername(o))}),a()(),l(5,"div",11)(6,"div",12),m(7,"Password"),a(),l(8,"input",14),C("ngModelChange",function(o){u(e);let r=c();return _(r.setBasicPassword(o))}),a()()()}if(i&2){let e=c();s(4),d("ngModel",e.basicUsername()),s(4),d("ngModel",e.basicPassword())}}function Oi(i,t){if(i&1){let e=b();l(0,"div",7)(1,"div",11)(2,"div",12),m(3,"Token"),a(),l(4,"input",15),C("ngModelChange",function(o){u(e);let r=c();return _(r.setBearerToken(o))}),a()()()}if(i&2){let e=c();s(4),d("ngModel",e.bearerToken())}}function Fi(i,t){i&1&&h(0,"nz-alert",18)}function Bi(i,t){i&1&&h(0,"nz-alert",19)}function Ki(i,t){if(i&1){let e=b();l(0,"div",7)(1,"div",11)(2,"div",12),m(3,"Key"),a(),l(4,"input",16),C("ngModelChange",function(o){u(e);let r=c();return _(r.setApiKeyKey(o))}),a()(),l(5,"div",11)(6,"div",12),m(7,"Value"),a(),l(8,"input",17),C("ngModelChange",function(o){u(e);let r=c();return _(r.setApiKeyValue(o))}),a()(),g(9,Fi,1,0,"nz-alert",18),g(10,Bi,1,0,"nz-alert",19),a()}if(i&2){let e=c();s(4),d("ngModel",e.apiKeyKey()),s(4),d("ngModel",e.apiKeyValue()),s(),f(e.apiKeyIn()==="query"?9:-1),s(),f(e.apiKeyIn()==="header"?10:-1)}}var _t=class i{auth;authChange=new y;types=["none","basic","bearer","apikey"];type=v(()=>this.auth?.type??"none");basicUsername=v(()=>this.auth?.type==="basic"?this.auth.basic?.username??"":"");basicPassword=v(()=>this.auth?.type==="basic"?this.auth.basic?.password??"":"");bearerToken=v(()=>this.auth?.type==="bearer"?this.auth.bearer?.token??"":"");apiKeyIn=v(()=>this.auth?.type!=="apikey"?"header":this.auth.apikey?.in??"header");apiKeyKey=v(()=>this.auth?.type==="apikey"?this.auth.apikey?.key??"":"");apiKeyValue=v(()=>this.auth?.type==="apikey"?this.auth.apikey?.value??"":"");setType(t){if(t==="none"){this.authChange.emit({type:"none"});return}if(t==="basic"){this.authChange.emit({type:"basic",basic:{username:"",password:""}});return}if(t==="bearer"){this.authChange.emit({type:"bearer",bearer:{token:""}});return}if(t==="apikey"){this.authChange.emit({type:"apikey",apikey:{in:"header",key:"",value:""}});return}}setBasicUsername(t){let e=z(w({},this.auth??{type:"basic"}),{type:"basic",basic:z(w({},this.auth?.basic),{username:t})});this.authChange.emit(e)}setBasicPassword(t){let e=z(w({},this.auth??{type:"basic"}),{type:"basic",basic:z(w({},this.auth?.basic),{password:t})});this.authChange.emit(e)}setBearerToken(t){let e=z(w({},this.auth??{type:"bearer"}),{type:"bearer",bearer:z(w({},this.auth?.bearer),{token:t})});this.authChange.emit(e)}setApiKeyIn(t){let e=z(w({},this.auth??{type:"apikey"}),{type:"apikey",apikey:z(w({},this.auth?.apikey),{in:t,key:this.apiKeyKey(),value:this.apiKeyValue()})});this.authChange.emit(e)}setApiKeyKey(t){let e=z(w({},this.auth??{type:"apikey"}),{type:"apikey",apikey:z(w({},this.auth?.apikey),{in:this.apiKeyIn(),key:t,value:this.apiKeyValue()})});this.authChange.emit(e)}setApiKeyValue(t){let e=z(w({},this.auth??{type:"apikey"}),{type:"apikey",apikey:z(w({},this.auth?.apikey),{in:this.apiKeyIn(),key:this.apiKeyKey(),value:t})});this.authChange.emit(e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-auth-editor"]],inputs:{auth:"auth"},outputs:{authChange:"authChange"},decls:11,vars:3,consts:[[1,"wrap"],[1,"bar"],[1,"type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"in",3,"ngModel"],[1,"main"],[1,"empty"],[1,"grid"],[1,"in",3,"ngModelChange","ngModel"],["nzValue","header","nzLabel","in: header"],["nzValue","query","nzLabel","in: query"],[1,"row"],[1,"label"],["nz-input","","placeholder","username",3,"ngModelChange","ngModel"],["nz-input","","placeholder","password","type","password",3,"ngModelChange","ngModel"],["nz-input","","placeholder","Bearer token",3,"ngModelChange","ngModel"],["nz-input","","placeholder","x-api-key / api_key",3,"ngModelChange","ngModel"],["nz-input","","placeholder","value",3,"ngModelChange","ngModel"],["nzType","info","nzShowIcon","","nzMessage","\u63D0\u793A\uFF1Aquery \u578B API Key \u4E0D\u4F1A\u5199\u5165\u8BF7\u6C42\u5934\uFF0C\u4F1A\u5728\u53D1\u9001\u65F6\u62FC\u63A5\u5230 URL \u67E5\u8BE2\u53C2\u6570\u4E2D\u3002"],["nzType","info","nzShowIcon","","nzMessage","\u63D0\u793A\uFF1Aheader \u578B API Key \u4F1A\u5728\u53D1\u9001\u65F6\u5199\u5165\u8BF7\u6C42\u5934\u3002"]],template:function(e,n){if(e&1&&(l(0,"div",0)(1,"div",1)(2,"nz-select",2),C("ngModelChange",function(r){return n.setType(r)}),S(3,Pi,1,2,"nz-option",3,_e),a(),g(5,Si,3,1,"nz-select",4),a(),l(6,"div",5),g(7,Di,2,0,"div",6)(8,Vi,9,2,"div",7)(9,Oi,5,1,"div",7)(10,Ki,11,4,"div",7),a()()),e&2){let o;s(2),d("ngModel",n.type()),s(),D(n.types),s(2),f(n.type()==="apikey"?5:-1),s(2),f((o=n.type())==="none"?7:o==="basic"?8:o==="bearer"?9:o==="apikey"?10:-1)}},dependencies:[A,P,$,K,j,ne,he,ve,F,H,Oe,Te],styles:[".wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:220px}.bar[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid #f0f0f0}.type[_ngcontent-%COMP%]{width:160px}.in[_ngcontent-%COMP%]{width:140px}.main[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding-top:10px}.empty[_ngcontent-%COMP%]{padding:12px;opacity:.7}.grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:100px 1fr;align-items:center;gap:10px}.label[_ngcontent-%COMP%]{font-size:12px;opacity:.8}"]})};var qn=Be($e());var Li=(i,t)=>t.id;function Ui(i,t){if(i&1){let e=b();l(0,"label",10),C("ngModelChange",function(o){u(e);let r=c();return _(r.toggleEnabled(o))}),a()}if(i&2){let e=c();d("ngModel",e.isAllEnabled())}}function $i(i,t){if(i&1){let e=b();l(0,"div",9)(1,"div",2)(2,"label",11),C("ngModelChange",function(o){let r=u(e).$index,p=c();return _(p.setEnabled(r,o))}),a()(),l(3,"div",12)(4,"input",13),C("ngModelChange",function(o){let r=u(e).$index,p=c();return _(p.setKey(r,o))}),a()(),l(5,"div",5)(6,"input",14),C("ngModelChange",function(o){let r=u(e).$index,p=c();return _(p.setValue(r,o))}),a()(),l(7,"div",6)(8,"input",14),C("ngModelChange",function(o){let r=u(e).$index,p=c();return _(p.setDescription(r,o))}),a()(),l(9,"div",7)(10,"button",15),C("click",function(){let o=u(e).$index,r=c();return _(r.removeRow(o))}),h(11,"nz-icon",16),a()()()}if(i&2){let e=t.$implicit,n=c();s(2),d("ngModel",e.enabled)("nzDisabled",!n.keepTrailingBlank),s(),d("nz-tooltip",n.keepTrailingBlank?"":"\u81EA\u52A8\u63D0\u53D6Url \u4E2D\u7684 Path \u53C2\u6570\uFF0C\u652F\u6301{param} \u4E0E :param"),s(),d("readonly",!n.keepTrailingBlank)("placeholder",n.keyPlaceholder)("ngModel",e.key),s(2),d("placeholder",n.valuePlaceholder)("ngModel",e.value),s(2),d("placeholder",n.descriptionLabel)("ngModel",e.description)}}var be=class i{ngOnChanges(t){t.rows&&(this.rows=this.withTrailingBlank(this.rows))}rows=[];rowsChange=new y;keyLabel="Key";valueLabel="Value";keyPlaceholder="key";valuePlaceholder="value";descriptionLabel="Description";keepTrailingBlank=!0;enabledCount=v(()=>this.rows.filter(t=>t.enabled).length);isAllEnabled(){return this.rows.length>0&&this.rows.every(t=>t.enabled)}toggleEnabled(t){let e=this.rows.map(n=>z(w({},n),{enabled:t}));this.emit(e)}emit(t){this.rowsChange.emit(t)}withTrailingBlank(t){return this.keepTrailingBlank?this.ensureTrailingBlank(t):t}createBlankRow(){return{id:(0,qn.uniqueId)(),key:"",value:"",description:"",enabled:!0}}isBlankRow(t){if(!t)return!0;let e=(t.key??"").trim(),n=(t.value??"").trim(),o=(t.description??"").trim();return!e&&!n&&!o}ensureTrailingBlank(t){let e=Array.isArray(t)?t:[];if(e.length===0)return[this.createBlankRow()];let n=e[e.length-1];return this.isBlankRow(n)?e:[...e,this.createBlankRow()]}sameRowsRefOrContent(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;let n=this.isBlankRow(t[t.length-1]),o=this.isBlankRow(e[e.length-1]);return n===o}removeRow(t){let e=this.rows.filter((n,o)=>o!==t);this.emit(this.withTrailingBlank(e))}setEnabled(t,e){let n=this.rows.map((o,r)=>r===t?z(w({},o),{enabled:e}):o);this.emit(n)}setValue(t,e){this.patchRow(t,{value:e})}setKey(t,e){this.patchRow(t,{key:e})}setDescription(t,e){this.patchRow(t,{description:e})}patchRow(t,e){let n=this.rows.map((o,r)=>r===t?w(w({},o),e):o);this.emit(this.withTrailingBlank(n))}addRow(){let t=[...this.rows,this.createBlankRow()];this.emit(this.withTrailingBlank(t))}clearDisabled(){let t=this.rows.filter(e=>e.enabled);this.emit(this.withTrailingBlank(t))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-kv-table"]],inputs:{rows:"rows",keyLabel:"keyLabel",valueLabel:"valueLabel",keyPlaceholder:"keyPlaceholder",valuePlaceholder:"valuePlaceholder",descriptionLabel:"descriptionLabel",keepTrailingBlank:"keepTrailingBlank"},outputs:{rowsChange:"rowsChange"},features:[te],decls:14,vars:4,consts:[[1,"kv-wrap"],[1,"kv-head"],[1,"c-check"],["nz-checkbox","",3,"ngModel"],[1,"c-key"],[1,"c-val"],[1,"c-des"],[1,"c-op"],[1,"kv-body"],[1,"kv-row"],["nz-checkbox","",3,"ngModelChange","ngModel"],["nz-checkbox","",3,"ngModelChange","ngModel","nzDisabled"],[1,"c-key",3,"nz-tooltip"],["nz-input","",3,"ngModelChange","readonly","placeholder","ngModel"],["nz-input","",3,"ngModelChange","placeholder","ngModel"],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u5220\u9664",3,"click"],["nzType","minus-circle","nzTheme","outline"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),g(3,Ui,1,1,"label",3),a(),l(4,"div",4),m(5),a(),l(6,"div",5),m(7),a(),l(8,"div",6),m(9),a(),h(10,"div",7),a(),l(11,"div",8),S(12,$i,12,10,"div",9,Li),a()()),e&2&&(s(3),f(n.keepTrailingBlank?3:-1),s(2),k(n.keyLabel),s(2),k(n.valueLabel),s(2),k(n.descriptionLabel),s(3),D(n.rows))},dependencies:[A,P,$,K,j,I,O,V,rt,ot,F,H,U,J,Ie,qe],styles:[".kv-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.kv-toolbar[_ngcontent-%COMP%]{padding:8px 0;display:flex;justify-content:space-between;align-items:center;gap:10px}.kv-toolbar[_ngcontent-%COMP%] .left[_ngcontent-%COMP%], .kv-toolbar[_ngcontent-%COMP%] .right[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}.hint[_ngcontent-%COMP%]{font-size:12px;opacity:.7}.kv-head[_ngcontent-%COMP%]{display:grid;grid-template-columns:40px 1fr 1fr 2fr 44px;gap:8px;padding:6px 0;font-size:14px;border-bottom:1px solid #f0f0f0;align-items:center}.kv-head[_ngcontent-%COMP%] .c-key[_ngcontent-%COMP%], .kv-head[_ngcontent-%COMP%] .c-val[_ngcontent-%COMP%], .kv-head[_ngcontent-%COMP%] .c-des[_ngcontent-%COMP%]{opacity:.75}.kv-body[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding:8px 0}.kv-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:40px 1fr 1fr 2fr 44px;gap:8px;align-items:center;padding:6px 0;border-bottom:1px dashed #f0f0f0}.c-check[_ngcontent-%COMP%], .c-op[_ngcontent-%COMP%]{display:flex;justify-content:center}.kv-empty[_ngcontent-%COMP%]{padding:16px;opacity:.75;display:flex;align-items:center;justify-content:space-between;border:1px dashed #e8e8e8;border-radius:8px;margin-top:8px}"]})};var In=Be($e());function Hi(i,t){if(i&1&&h(0,"nz-option",3),i&2){let e=t.$implicit;d("nzValue",e)("nzLabel",e)}}function Wi(i,t){if(i&1){let e=b();l(0,"button",10),C("click",function(){u(e);let o=c();return _(o.formatJson())}),m(1,"\u683C\u5F0F\u5316 JSON"),a()}}function Ji(i,t){i&1&&(l(0,"div",7),m(1,"\u65E0 Body"),a())}function Zi(i,t){if(i&1){let e=b();l(0,"textarea",11),C("ngModelChange",function(o){u(e);let r=c();return _(r.setTextBody(o))}),a()}if(i&2){let e=c();d("ngModel",e.textBody())}}function Gi(i,t){if(i&1&&(l(0,"div",13),m(1),a()),i&2){let e=c(2);s(),k(e.jsonError())}}function Qi(i,t){if(i&1){let e=b();l(0,"textarea",12),C("ngModelChange",function(o){u(e);let r=c();return _(r.setJsonText(o))}),a(),g(1,Gi,2,1,"div",13)}if(i&2){let e=c();d("ngModel",e.jsonText()),s(),f(e.jsonError()?1:-1)}}function Yi(i,t){if(i&1){let e=b();l(0,"app-kv-table",14),C("rowsChange",function(o){u(e);let r=c();return _(r.setUrlRows(o))}),a()}if(i&2){let e=c();d("rows",e.urlRows())}}function Xi(i,t){i&1&&(l(0,"div",7),m(1,"MVP \u4EC5\u652F\u6301 none/json/text/urlencoded"),a())}var Ct=class i{msg=q(Se);body;bodyChange=new y;bodySig=E(void 0);modes=["none","json","text","urlencoded","form","binary"];_jsonText=E("");mode=v(()=>this.bodySig()?.mode??"none");contentType=v(()=>this.bodySig()?.contentType??"");jsonText=v(()=>{if(this.mode()!=="json")return"";let t=this.body?.content;if(typeof t=="string")return t;if(t==null)return this._jsonText()||"";try{return JSON.stringify(t,null,2)}catch{return this._jsonText()||""}});jsonError=E("");textBody=v(()=>this.body?.mode==="text"?String(this.body?.content??""):"");urlRows=v(()=>{if(this.body?.mode!=="urlencoded")return[];let t=this.body?.content;return!t||typeof t!="object"||Array.isArray(t)?[]:Object.entries(t).map(([e,n])=>({key:e,value:String(n??""),enabled:!0,id:(0,In.uniqueId)()}))});setMode(t){let e=this.body,n=z(w({},e??{}),{mode:t});if(n.contentType||(t==="json"&&(n.contentType="application/json; charset=utf-8"),t==="text"&&(n.contentType="text/plain; charset=utf-8"),t==="urlencoded"&&(n.contentType="application/x-www-form-urlencoded; charset=utf-8"),t==="none"&&(n.contentType=void 0)),t==="none"){this.bodyChange.emit({mode:"none"});return}t==="json"&&e?.mode!=="json"&&(n.content={}),t==="text"&&e?.mode!=="text"&&(n.content=""),t==="urlencoded"&&e?.mode!=="urlencoded"&&(n.content={}),this.bodyChange.emit(n)}ngOnChanges(t){if(t.body){let e=t.body.currentValue;this.bodySig.set(e),e?.mode==="json"&&(typeof e.content=="string"?this._jsonText.set(e.content):this._jsonText.set(e.content?JSON.stringify(e.content,null,2):""),this.jsonError.set(""))}}setContentType(t){let e=this.mode(),n=z(w({},this.body??{mode:e}),{contentType:t});this.bodyChange.emit(n)}setTextBody(t){let e=z(w({},this.body??{mode:"text"}),{mode:"text",content:t});this.bodyChange.emit(e)}setJsonText(t){this._jsonText.set(t),this.jsonError.set("");try{let e=t.trim()?JSON.parse(t):{},n=z(w({},this.body??{mode:"json"}),{mode:"json",content:e});this.bodyChange.emit(n)}catch{this.jsonError.set("JSON \u4E0D\u5408\u6CD5\uFF08\u7EE7\u7EED\u8F93\u5165\u5373\u53EF\uFF09")}}formatJson(){if(this.mode()!=="json")return;let e=this.body?.content;try{let n=JSON.stringify(e??{},null,2);this._jsonText.set(n),this.jsonError.set("");let o=z(w({},this.body??{mode:"json"}),{mode:"json",content:e??{}});this.bodyChange.emit(o),this.msg.success("\u5DF2\u683C\u5F0F\u5316")}catch{this.msg.error("\u683C\u5F0F\u5316\u5931\u8D25")}}setUrlRows(t){let e={};for(let o of t){if(!o.enabled)continue;let r=(o.key??"").trim();r&&(e[r]=String(o.value??""))}let n=z(w({},this.body??{mode:"urlencoded"}),{mode:"urlencoded",content:e});this.bodyChange.emit(n)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-body-editor"]],inputs:{body:"body"},outputs:{bodyChange:"bodyChange"},features:[te],decls:13,vars:4,consts:[[1,"wrap"],[1,"bar"],[1,"mode",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["nz-input","","placeholder","content-type\uFF08\u53EF\u9009\uFF09",1,"ctype",3,"ngModelChange","ngModel"],["nz-button","","nzType","default"],[1,"main"],[1,"empty"],["nz-input","","placeholder","\u6587\u672C\u5185\u5BB9",1,"ta",3,"ngModel"],["keyLabel","Key","valueLabel","Value","keyPlaceholder","a","valuePlaceholder","1",3,"rows"],["nz-button","","nzType","default",3,"click"],["nz-input","","placeholder","\u6587\u672C\u5185\u5BB9",1,"ta",3,"ngModelChange","ngModel"],["nz-input","","placeholder","{ }",1,"ta",3,"ngModelChange","ngModel"],[1,"err"],["keyLabel","Key","valueLabel","Value","keyPlaceholder","a","valuePlaceholder","1",3,"rowsChange","rows"]],template:function(e,n){if(e&1&&(l(0,"div",0)(1,"div",1)(2,"nz-select",2),C("ngModelChange",function(r){return n.setMode(r)}),S(3,Hi,1,2,"nz-option",3,_e),a(),l(5,"input",4),C("ngModelChange",function(r){return n.setContentType(r)}),a(),g(6,Wi,2,0,"button",5),a(),l(7,"div",6),g(8,Ji,2,0,"div",7)(9,Zi,1,1,"textarea",8)(10,Qi,2,2)(11,Yi,1,1,"app-kv-table",9)(12,Xi,2,0,"div",7),a()()),e&2){let o;s(2),d("ngModel",n.mode()),s(),D(n.modes),s(2),d("ngModel",n.contentType()),s(),f(n.mode()==="json"?6:-1),s(2),f((o=n.mode())==="none"?8:o==="text"?9:o==="json"?10:o==="urlencoded"?11:12)}},dependencies:[A,P,$,K,j,I,O,V,X,F,H,ne,he,ve,be],styles:[".wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:260px}.bar[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid #f0f0f0}.mode[_ngcontent-%COMP%]{width:140px}.ctype[_ngcontent-%COMP%]{flex:1 1 auto}.main[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding-top:10px}.ta[_ngcontent-%COMP%]{width:100%;height:100%;min-height:240px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px}.empty[_ngcontent-%COMP%]{padding:12px;opacity:.7}.err[_ngcontent-%COMP%]{margin-top:8px;color:#a8071a;font-size:12px}"]})};var gt=class i{http=q(_n);base="/api/client";async listRequests(t,e){let n=new me().set("scope",t);return e&&(n=n.set("projectId",e)),await L(this.http.get(`${this.base}/requests`,n))}async saveRequest(t,e,n){return await L(this.http.post(`${this.base}/requests`,{scope:t,projectId:e,request:n}))}async updateRequest(t,e,n){return await L(this.http.post(`${this.base}/requests/update`,{scope:t,projectId:e,request:n}))}async deleteRequest(t,e,n){let o=new me().set("scope",e);return n&&(o=o.set("projectId",n)),await L(this.http.delete(`${this.base}/requests/${t}`,o))}async send(t){return await L(this.http.post(`${this.base}/send`,t))}async listHistory(t,e){let n=new me().set("scope",t);return e&&(n=n.set("projectId",e)),await L(this.http.get(`${this.base}/history`,n))}async listEnvs(t,e){let n=new me().set("scope",t);return e&&(n=n.set("projectId",e)),await L(this.http.get(`${this.base}/envs`,n))}async saveEnv(t,e,n){return await L(this.http.post(`${this.base}/envs`,{scope:t,projectId:e,env:n}))}async deleteEnv(t,e,n){let o=new me().set("scope",e);return n&&(o=o.set("projectId",n)),await L(this.http.delete(`${this.base}/envs/${t}`,o))}async listCollections(t,e){let n=new me().set("scope",t);return e&&(n=n.set("projectId",e)),await L(this.http.get(`${this.base}/collections`,n))}async createCollection(t){return await L(this.http.post(`${this.base}/collections`,t))}async updateCollection(t,e,n,o){let r=new me().set("scope",n).set("projectId",o??"");return await L(this.http.post(`${this.base}/collections/${t}`,e,r))}async deleteCollection(t,e,n){let o=new me().set("scope",e).set("projectId",n??"");return await L(this.http.delete(`${this.base}/collections/${t}`,o))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ae({token:i,factory:i.\u0275fac,providedIn:"root"})};var eo=/\{\{\s*([a-zA-Z0-9_.-]+)\s*\}\}/g;function Rn(i=[]){let t={};for(let e of i)e.enabled&&(t[e.key]=String(e.value??""));return t}function to(i,t){let e=new Set;return{out:i.replace(eo,(o,r)=>r in t?String(t[r]??""):(e.add(r),`{{${r}}}`)),missing:[...e]}}function Pn(i,t){let e=new Set;for(let n of i){if(!n)continue;let{missing:o}=to(n,t);o.forEach(r=>e.add(r))}return[...e]}var Sn=Be($e());function Fe(i){if(!i)return[];let t=i;try{t=new URL(i).pathname||""}catch{t=i.split("?")[0].split("#")[0]||"";let x=t.indexOf("/");x>=0&&(t=t.slice(x))}let e=no(t),n=[],o=/(?:^|\/):([A-Za-z_][A-Za-z0-9_]*)/g,r;for(;r=o.exec(e);)n.push(r[1]);let p=/\{([A-Za-z_][A-Za-z0-9_]*)\}/g;for(;r=p.exec(e);)n.push(r[1]);return n}function no(i){try{return decodeURIComponent(i)}catch{return i}}function Ft(i,t){let e=Fe(i),n=Array.isArray(t)?t:[],o=new Map;for(let p of n){let x=(p.key??"").trim();x&&(o.has(x)||o.set(x,p))}return e.map(p=>{let x=o.get(p);return x?z(w({},x),{key:p,enabled:!0}):{key:p,value:"",description:"",enabled:!0,id:(0,Sn.uniqueId)()}})}var Dn=Be($e());function Bt(i){return(i??[]).map(t=>({key:t.key,value:t.value,enabled:t.enabled,id:(0,Dn.uniqueId)(),description:t.description}))}function Vn(i,t){let e=new Map(t?.map(n=>[n.key,n]));return i.filter(n=>n.key?.trim()).map(n=>({key:n.key.trim(),value:String(n.value??""),enabled:n.enabled!==!1,secret:e.get(n.key)?.secret}))}function io(i,t){if(!t)return!0;let e=(i.name??"").toLowerCase(),n=(i.url??"").toLowerCase();return e.includes(t)||n.includes(t)}function We(i){if(i==null)return null;let t=String(i).trim();if(!t)return null;let e=t.toLowerCase();return e==="null"||e==="undefined"?null:t}function oo(i,t){return(i.parentId??"").localeCompare(t.parentId??"")||(i.order??0)-(t.order??0)||(i.name??"").localeCompare(t.name??"")}function ro(i,t){return(We(i.collectionId)??"").localeCompare(We(t.collectionId)??"")||(i.order??0)-(t.order??0)||(i.name??"").localeCompare(t.name??"")||(i.url??"").localeCompare(t.url??"")}function Kt(i,t,e){let n=e?.trim().toLowerCase()||"",o=[...i??[]].sort(oo),r=[...t??[]].sort(ro),p=new Map;for(let R of o){let re=We(R.parentId),ee=p.get(re)??[];ee.push(R),p.set(re,ee)}let x=new Map;for(let R of r){if(!io(R,n))continue;let re=We(R.collectionId),ee=x.get(re)??[];ee.push(R),x.set(re,ee)}let M=(R,re)=>({key:`r:${String(R.id)}`,kind:"request",id:String(R.id),title:R.name??"\u672A\u547D\u540D",name:R.name,subtitle:R.url??"",method:R.method??"",parentKey:re,children:[]}),N=(R,re)=>{let ee=We(R.id),Nt=`c:${ee}`,jn=p.get(ee)??[],Ln=x.get(ee)??[];return{key:Nt,kind:R.kind??"collection",id:ee,title:R.name??"\u672A\u547D\u540D",name:R.name,parentKey:re,children:[...jn.map(kt=>N(kt,Nt)),...Ln.map(kt=>M(kt,Nt))]}},G=p.get(null)??[],At=x.get(null)??[];return[...G.map(R=>N(R,null)),...At.map(R=>M(R,null))]}var Fn=Be($e());var lo=i=>({$implicit:i,level:0}),ao=(i,t)=>({$implicit:i,level:t}),On=(i,t)=>t.key;function so(i,t){if(i&1&&(l(0,"div",8),m(1),a()),i&2){let e=c(2);s(),k(e.nameErr())}}function co(i,t){if(i&1){let e=b();l(0,"label",5),m(1,"\u540D\u79F0"),a(),l(2,"nz-input-wrapper")(3,"input",6),C("ngModelChange",function(o){u(e);let r=c();return _(r.name.set(o))}),a(),h(4,"nz-icon",7),a(),g(5,so,2,1,"div",8)}if(i&2){let e=c();s(3),d("ngModel",e.name()),s(),d("nzType",e.iconForKind()),s(),f(e.nameErr()?5:-1)}}function po(i,t){if(i&1&&Ce(0,12),i&2){let e=t.$implicit;c(2);let n=Q(9);d("ngTemplateOutlet",n)("ngTemplateOutletContext",je(2,lo,e))}}function mo(i,t){i&1&&(l(0,"div",13),m(1,"\u6682\u65E0\u76EE\u5F55"),a())}function uo(i,t){if(i&1&&(l(0,"div",8),m(1),a()),i&2){let e=c(2);s(),k(e.moveErr())}}function _o(i,t){if(i&1){let e=b();l(0,"div",9)(1,"div",10),C("click",function(){u(e);let o=c();return _(o.select(null))}),h(2,"nz-icon",11),l(3,"span"),m(4,"\u6839\u76EE\u5F55"),a()(),S(5,po,1,4,"ng-container",12,On),g(7,mo,2,0,"div",13),a(),g(8,uo,2,1,"div",8)}if(i&2){let e=c();s(),Y("selected",e.selectedKey()===null),s(4),D(e.filteredNodes()),s(2),f(e.filteredNodes().length?-1:7),s(),f(e.moveErr()?8:-1)}}function Co(i,t){if(i&1&&Ce(0,12),i&2){let e=t.$implicit,n=c(2).level;c();let o=Q(9);d("ngTemplateOutlet",o)("ngTemplateOutletContext",Qt(2,ao,e,n+1))}}function go(i,t){if(i&1&&S(0,Co,1,5,"ng-container",12,On),i&2){let e=c().$implicit;D(e.children)}}function fo(i,t){if(i&1){let e=b();l(0,"div",14),C("click",function(){let o=u(e).$implicit,r=c();return _(r.select(o.key))}),l(1,"button",15),C("click",function(o){let r=u(e).$implicit;return c().toggle(r.key),_(o.stopPropagation())}),h(2,"nz-icon",16),a(),h(3,"nz-icon",17),l(4,"span",18),m(5),a()(),g(6,go,2,0)}if(i&2){let e=t.$implicit,n=t.level,o=c();Zt("padding-left",8+n*16,"px"),Y("selected",o.selectedKey()===e.key),s(),d("disabled",!(e.children!=null&&e.children.length)),s(),d("nzType",e.children!=null&&e.children.length?o.expanded(e.key)?"down":"right":"minus"),s(),d("nzType",e.kind==="folder"?"folder":"database"),s(2),k(e.title),s(),f(((e.children==null?null:e.children.length)??0)&&o.expanded(e.key)?6:-1)}}function ho(i){return i?`c:${i}`:null}function vo(i){return i&&i.startsWith("c:")?i.slice(2):null}var Ee=class i{data=q(yn);modalRef=q(tt);q=E("");name=E("");selectedKey=E(null);expandedMap=E({});mode=v(()=>this.data.mode??this.data.handleType);showParentPicker=v(()=>this.mode()==="move"||this.mode()==="pick");showName=v(()=>this.mode()==="create"||this.mode()==="rename");iconForKind=v(()=>{let t=this.data.kind??this.data.createBody?.kind??"collection";return t==="folder"?"folder":t==="request"?"api":"database"});ngOnInit(){let t=this.mode();if(t==="create"){let r=this.data.createBody;this.name.set(r?.name??""),this.selectedKey.set(null);return}if(t==="rename"||t==="update"){let r=this.data;this.name.set(r?.initialName??""),this.selectedKey.set(null);return}let e=this.data.initialParentId;this.selectedKey.set(e?e.startsWith("c:")?e:ho(e):null);let n=this.data.nodes??[],o={};for(let r of n)o[r.key]=!0;this.expandedMap.set(o)}expanded(t){return!!this.expandedMap()[t]}toggle(t){let e=w({},this.expandedMap());e[t]=!e[t],this.expandedMap.set(e)}select(t){this.selectedKey.set(t)}forbiddenKeys=v(()=>{if(this.mode()!=="move"||this.mode()!=="pick")return new Set;let t=this.data.target;if(!t||t.kind==="request")return new Set;let e=`c:${t.id}`,n=new Set([e]),o=this.data.nodes??[],r=x=>{for(let M of x.children??[])M.kind!=="request"&&(n.add(M.key),r(M))},p=x=>{for(let M of x)M.key===e?r(M):M.children?.length&&p(M.children)};return p(o),n});nodesForPicker=v(()=>{let t=(this.data.nodes??[]).filter(o=>o.kind!=="request"),e=this.forbiddenKeys(),n=o=>{let r=[];for(let p of o){if(p.kind==="request"||e.has(p.key))continue;let x=n(p.children??[]);r.push(z(w({},p),{children:x}))}return r};return n(t)});filteredNodes=v(()=>{if(!this.showParentPicker())return[];let t=this.q().trim().toLowerCase();if(!t)return this.nodesForPicker();let e=x=>(x.title??"").toLowerCase().includes(t),n=x=>{let M=[];for(let N of x){let G=n(N.children??[]);(e(N)||G.length)&&M.push(z(w({},N),{children:G}))}return M},o=n(this.nodesForPicker()),r=w({},this.expandedMap()),p=x=>{for(let M of x)M.children?.length&&(r[M.key]=!0),M.children?.length&&p(M.children)};return p(o),this.expandedMap.set(r),o});nameErr=v(()=>{if(!this.showName())return"";let t=(this.name()??"").trim();return t?t.length>50?"\u540D\u79F0\u8FC7\u957F\uFF08<= 50\uFF09":"":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"});moveErr=v(()=>(this.showParentPicker(),""));canSubmit=v(()=>this.showName()&&this.nameErr()?!1:(this.showParentPicker(),!0));ok(){let t=this.mode();if(t==="rename"||t==="update"){let n={name:(this.name()??"").trim()};this.modalRef.close(n);return}if(t==="create"){let n=this.data.createBody,o=z(w({},n),{name:(this.name()??"").trim(),parentId:n.parentId??null});this.modalRef.close(o);return}let e=vo(this.selectedKey());this.modalRef.close({parentId:e})}cancel(){this.modalRef.close(null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-collection-modal"]],decls:10,vars:3,consts:[["nodeTpl",""],[1,"modal-body"],[1,"footer"],["nz-button","",3,"click"],["nz-button","","nzType","primary",3,"click","disabled"],[1,"label"],["nz-input","","placeholder","\u8BF7\u8F93\u5165\u540D\u79F0","autofocus","",3,"ngModelChange","ngModel"],["nzInputPrefix","","nzTheme","outline",3,"nzType"],[1,"hint","err"],[1,"picker"],[1,"row","root",3,"click"],["nzType","home"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"empty"],[1,"row",3,"click"],["nz-button","","nzType","text","nzSize","small",1,"chev",3,"click","disabled"],[3,"nzType"],[1,"icon",3,"nzType"],[1,"title"]],template:function(e,n){if(e&1){let o=b();l(0,"div",1),g(1,co,6,3),g(2,_o,9,4),a(),l(3,"div",2)(4,"button",3),C("click",function(){return u(o),_(n.cancel())}),m(5,"\u53D6\u6D88"),a(),l(6,"button",4),C("click",function(){return u(o),_(n.ok())}),m(7," \u786E\u5B9A "),a()(),W(8,fo,7,9,"ng-template",null,0,ge)}e&2&&(s(),f(n.showName()?1:-1),s(),f(n.showParentPicker()?2:-1),s(4),d("disabled",!n.canSubmit()))},dependencies:[A,Ze,P,$,K,j,F,H,fe,Qe,I,O,V,X,U,J],styles:[".modal-body[_ngcontent-%COMP%]{display:grid;gap:12px}.label[_ngcontent-%COMP%]{font-weight:600}.hint[_ngcontent-%COMP%]{font-size:12px;opacity:.75}.hint.err[_ngcontent-%COMP%]{color:#cf1322;opacity:1}.picker[_ngcontent-%COMP%]{max-height:52vh;overflow:auto;border:1px solid rgba(0,0,0,.08);border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:6px}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px;border-radius:10px;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .15s;border:1px solid transparent}.row[_ngcontent-%COMP%]:hover{background:#0000000a}.row.selected[_ngcontent-%COMP%]{background:#00000014;border-color:#00000014}.row.root[_ngcontent-%COMP%]{font-weight:600}.chev[_ngcontent-%COMP%]{flex:0 0 auto}.chev[_ngcontent-%COMP%] nz-icon[_ngcontent-%COMP%]{font-size:12px;transition:transform .15s}.icon[_ngcontent-%COMP%]{opacity:.75}.title[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.empty[_ngcontent-%COMP%]{padding:16px;opacity:.6;text-align:center}.footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}"]})};var ft=class i{modal=q(nt);async createCollection(t){let e=this.modal.create({nzTitle:t.kind==="folder"?"\u65B0\u5EFA\u76EE\u5F55":"\u65B0\u5EFA\u96C6\u5408",nzContent:Ee,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"create",createBody:t.createBody,nodes:t.nodes}});return await L(e.afterClose)}async renameCollection(t){let e=this.modal.create({nzTitle:"\u91CD\u547D\u540D",nzContent:Ee,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"rename",kind:t.kind,nodes:t.nodes,targetId:t.targetId,initialName:t.initialName}});return await L(e.afterClose)}async moveTarget(t){let e=this.modal.create({nzTitle:"\u79FB\u52A8\u5230",nzContent:Ee,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"move",nodes:t.nodes,target:t.target,initialParentId:t.initialParentId??null}});return await L(e.afterClose)}async pickCollection(t){let e=this.modal.create({nzTitle:"\u9009\u62E9\u96C6\u5408/\u76EE\u5F55",nzContent:Ee,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"pick",nodes:t.nodes}});return await L(e.afterClose)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ae({token:i,factory:i.\u0275fac,providedIn:"root"})};function yo(){return Date.now()}function xo(i){let t=Math.random().toString(16).slice(2,10);return`${i}_${t}_${Date.now().toString(16)}`}var ze=class i{api=q(gt);msg=q(Se);projectState=q(xn);collectionModal=q(ft);scope=E("project");loading=E(!1);q=E("");sending=E(!1);requests=E([]);activeRequestId=E(null);collections=E([]);activeCollectionId=E(null);nodes=v(()=>Kt(this.collections(),this.requests(),"").filter(t=>t.kind!=="request"));filteredNodes=v(()=>{let t=this.q().toLowerCase();return Kt(this.collections(),this.requests(),t??"")});historyOpen=E(!1);historyLoading=E(!1);histories=E([]);envs=E([]);envLoading=E(!1);activeEnvId=E(null);lastResult=E(null);projectId=v(()=>this.projectState.currentProject()?.id??"");activeRequest=E(null);activeEnv=v(()=>{let t=this.activeEnvId();return t?this.envs().find(e=>e.id===t)??null:null});envVarRecord=v(()=>{let t=this.activeEnv();return t?Rn(t.variables):{}});collectionPath=v(()=>{let t=this.activeCollectionId();if(!t)return null;let e=this.collections().find(r=>r.id===t);if(!e)return null;let n=[],o=`${e.id}`;for(;o;){let r=this.collections().find(p=>p.id===o);r?(n.unshift(r.name||"\u672A\u547D\u540D"),o=r.parentId?`${r.parentId}`:null):o=null}return n.join(" / ")});projectCtx=v(()=>{let t=this.projectState.currentProject();return t?{scope:"project",projectId:t.id}:null});constructor(){Rt(()=>{this.scope()!=="project"||!this.projectId()||this.loadAll()}),Rt(()=>{if(this.scope()!=="project"){this.loadEnvs();return}this.projectId()&&this.loadEnvs()})}async loadAll(){let t=this.projectCtx();if(t){this.loading.set(!0);try{let[e,n]=await Promise.all([this.api.listCollections(t.scope,t.projectId),this.api.listRequests(t.scope,t.projectId)]);this.collections.set(e??[]),this.requests.set(n??[])}finally{this.loading.set(!1)}}}async reloadCollections(){let t=this.projectCtx();if(!t)return;let e=await this.api.listCollections(t.scope,t.projectId);this.collections.set(e??[])}async reloadRequests(){let t=this.projectCtx();if(!t)return;let e=await this.api.listRequests(t.scope,t.projectId);this.requests.set(e??[])}async loadRequests(){let t=this.projectCtx();if(t){this.loading.set(!0);try{let e=await this.api.listRequests(t.scope,t.projectId);this.requests.set(e);let n=this.activeRequestId();if(n&&e.some(o=>o.id===n))return;e.length?this.setActive(e[0]):(this.setActive(null),this.activeRequestId.set(null),this.lastResult.set(null),this.newRequest())}catch(e){this.msg.error(e?.message??"\u52A0\u8F7D\u8BF7\u6C42\u5931\u8D25")}finally{this.loading.set(!1)}}}selectRequest(t){let e=this.requests().find(n=>n.id===t)||null;this.setActive(e),this.activeCollectionId.set(e?.collectionId??null)}selectCollection(t){this.activeCollectionId.set(t)}async newCollection(t){let e=this.projectCtx();if(!e)return;let n={scope:e.scope,projectId:e.projectId,name:t.name??"",kind:t.kind??"collection",parentId:t.parentId??null},o=this.nodes(),r=await this.collectionModal.createCollection({createBody:n,nodes:o,kind:n.kind,initialParentId:n.parentId??null});if(r){let p=await this.api.createCollection(r);this.msg.success("\u521B\u5EFA\u6210\u529F"),this.collections.update(x=>[...x,p]),this.activeCollectionId.set(p.id)}}async deleteCollection(t,e){if(e==="request"){this.removeRequest(t);return}if(await this.api.deleteCollection(t,this.scope(),this.projectId()),this.msg.success("\u5DF2\u5220\u9664"),this.collections.update(n=>n.filter(o=>o.id!==t)),this.activeCollectionId()===t){let n=this.collections()[0];this.activeCollectionId.set(n?.id??null)}}async moveCollection(t,e){let n="";if(e=="request"){let p=this.requests().find(x=>x.id===t);if(!p){this.msg.error("\u8BF7\u6C42\u4E0D\u5B58\u5728");return}n=p.collectionId??""}else{let p=this.collections().find(x=>x.id===t);if(!p){this.msg.error("\u96C6\u5408\u4E0D\u5B58\u5728");return}n=p.parentId??""}let o=this.nodes(),{parentId:r}=await this.collectionModal.moveTarget({nodes:o,target:{kind:e,id:t},initialParentId:n})||{};if(r!==void 0)if(e==="request"){let p=this.requests().find(M=>M.id===t);if(!p){this.msg.error("\u8BF7\u6C42\u4E0D\u5B58\u5728");return}let x={collectionId:r??null,id:p.id};p.collectionId=r??null,await this.api.updateRequest(this.scope(),this.projectId(),x),this.requests.update(M=>M.map(N=>N.id===t?z(w({},N),{collectionId:r??null}):N)),this.setActive(p.id===this.activeRequestId()?z(w({},p),{collectionId:r??null}):p),this.msg.success("\u4FEE\u6539\u6210\u529F")}else{let p={parentId:r??null},x=await this.api.updateCollection(t,p,this.scope(),this.projectId());this.collections.update(M=>M.map(N=>N.id===t?x:N)),this.activeCollectionId.set(x.id),this.msg.success("\u4FEE\u6539\u6210\u529F")}}async renameCollection(t,e){let n="";if(e=="request"){let p=this.requests().find(x=>x.id===t);if(!p){this.msg.error("\u8BF7\u6C42\u4E0D\u5B58\u5728");return}n=p.name??""}else{let p=this.collections().find(x=>x.id===t);if(!p){this.msg.error("\u96C6\u5408\u4E0D\u5B58\u5728");return}n=p.name??""}let o=this.nodes(),r=await this.collectionModal.renameCollection({nodes:o,kind:e,targetId:t,initialName:n});if(r)if(e==="request")await this.api.updateRequest(this.scope(),this.projectId(),{id:t,name:r.name}),this.requests.update(p=>p.map(x=>x.id===t?z(w({},x),{name:r.name??x.name}):x)),this.msg.success("\u4FEE\u6539\u6210\u529F"),this.reloadRequests();else{let p=await this.api.updateCollection(t,r,this.scope(),this.projectId());this.collections.update(x=>x.map(M=>M.id===t?p:M)),this.msg.success("\u4FEE\u6539\u6210\u529F"),this.reloadCollections()}}newRequest(t={}){let e=this.projectId();if(this.scope()==="project"&&!e){this.msg.warning("\u8BF7\u5148\u9009\u62E9\u9879\u76EE");return}let n=yo(),o={id:xo("req"),name:"",method:"GET",url:"",collectionId:t.collectionId??null,query:[],pathParams:[],headers:[],body:{mode:"none"},auth:{type:"none"},options:{followRedirects:!0,timeoutMs:3e4},tags:[],createdAt:n,updatedAt:n};this.setActive(o),this.activeCollectionId.set(t.collectionId??null)}patchActive(t){let e=this.activeRequest();if(!e)return;let n=z(w(w({},e),t),{updatedAt:Date.now()});this.activeRequest.set(n)}async saveActive(){let t=this.activeRequest();if(!t)return;let e=this.scope(),n=e==="project"?this.projectId():void 0;if(e==="project"&&!n)throw new Error("projectId missing");if(!t.name?.trim()){this.msg.warning("\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");return}if(!t.url?.trim()){this.msg.warning("URL \u4E0D\u80FD\u4E3A\u7A7A");return}if(!t.collectionId){let o=this.nodes(),{parentId:r}=await this.collectionModal.pickCollection({nodes:o})||{};t.collectionId=r??null}this.loading.set(!0);try{await this.api.saveRequest(e,n,t),this.msg.success("\u5DF2\u4FDD\u5B58"),this.activeRequest.set(w({},t)),await this.loadRequests()}catch(o){this.msg.error(o?.message??"\u4FDD\u5B58\u5931\u8D25")}finally{this.loading.set(!1)}}async sendActive(){let t=this.activeRequest();t&&await this.sendResolvedRequest(t)}async removeRequest(t){await this.api.deleteRequest(t,this.scope(),this.projectId()),this.msg.success("\u5DF2\u5220\u9664");let e=this.requests().filter(n=>n.id!==t);if(this.requests.set(e),this.activeRequestId()===t){let n=e[0]?.id??null;this.activeRequestId.set(n)}}setActive(t){!t||!t.id||t.id===this.activeRequestId()||(t.headers.length&&(t.headers=this.ensureKvId(t.headers)),t.query.length&&(t.query=this.ensureKvId(t.query)),t.pathParams.length&&(t.pathParams=this.ensureKvId(t.pathParams)),this.activeRequest.set(t),this.activeRequestId.set(t.id),this.lastResult.set(null))}ensureKvId(t){return t.map(e=>(e.id||(e.id=(0,Fn.uniqueId)()),e))}openHistory(){this.historyOpen.set(!0),this.loadHistory()}closeHistory(){this.historyOpen.set(!1)}async loadHistory(){this.historyLoading.set(!0);try{let t=await this.api.listHistory(this.scope(),this.projectId());this.histories.set(t)}finally{this.historyLoading.set(!1)}}async replayHistory(t){await this.sendResolvedRequest(t.requestSnapshot)}async sendResolvedRequest(t){let e=this.scope(),n=e==="project"?this.projectId():void 0;if(e==="project"&&!n){this.msg.warning("\u8BF7\u5148\u9009\u62E9\u9879\u76EE");return}this.sending.set(!0),this.lastResult.set(null);try{let o=await this.api.send({scope:e,projectId:n||void 0,request:t,envId:this.activeEnvId()??void 0,projectRoot:this.projectState.currentProject()?.root});this.lastResult.set(o),o.error?this.msg.error(`${o.error.code}: ${o.error.message}`):this.msg.success(`HTTP ${o.response?.status??""} (${o.metrics.durationMs}ms)`)}catch(o){this.msg.error(o?.message??"\u53D1\u9001\u5931\u8D25")}finally{this.sending.set(!1)}}async loadEnvs(){let t=this.scope(),e=t==="project"?this.projectId():void 0;if(!(t==="project"&&!e)){this.envLoading.set(!0);try{let n=await this.api.listEnvs(t,e);this.envs.set(n);let o=this.activeEnvId();if(o&&n.some(r=>r.id===o))return;this.activeEnvId.set(n[0]?.id??null)}finally{this.envLoading.set(!1)}}}setActiveEnv(t){this.activeEnvId.set(t)}async saveEnv(t){let e=this.scope(),n=e==="project"?this.projectId():void 0;await this.api.saveEnv(e,n||void 0,t),await this.loadEnvs()}async deleteEnv(t){await this.api.deleteEnv(t,this.scope(),this.projectId()),this.activeEnvId()===t&&this.activeEnvId.set(null),await this.loadEnvs()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ae({token:i,factory:i.\u0275fac,providedIn:"root"})};var wo=["class","component"],bo=(i,t)=>t.id;function zo(i,t){if(i&1){let e=b();l(0,"div",9),C("click",function(){let o=u(e).$implicit,r=c();return _(r.selectEditEnv(o.id))}),l(1,"div",10),m(2),a(),l(3,"div",11),m(4),a()()}if(i&2){let e,n=t.$implicit,o=c();Y("active",n.id===((e=o.draft())==null?null:e.id)),s(2),k(n.name),s(2),se("",n.variables.length," vars")}}function Mo(i,t){i&1&&(l(0,"div",6),m(1,"\u6682\u65E0\u73AF\u5883"),a())}function To(i,t){i&1&&(l(0,"div",6),m(1,"\u9009\u62E9\u4E00\u4E2A\u73AF\u5883\u8FDB\u884C\u7F16\u8F91"),a())}function Eo(i,t){if(i&1){let e=b();l(0,"div",8)(1,"div",12)(2,"div",13),m(3,"\u540D\u79F0"),a(),l(4,"input",14),C("ngModelChange",function(o){u(e);let r=c();return _(r.setName(o))}),a()(),l(5,"div",12)(6,"div",13),m(7,"\u524D\u7F6EURL"),a(),l(8,"input",14),C("ngModelChange",function(o){u(e);let r=c();return _(r.setBaseUrl(o))}),a()(),l(9,"div",15)(10,"app-kv-table",16),C("rowsChange",function(o){u(e);let r=c();return _(r.varsRows.set(o))}),a()(),l(11,"div",17)(12,"button",3),C("click",function(){u(e);let o=c();return _(o.save())}),m(13,"\u4FDD\u5B58"),a(),l(14,"button",18),C("nzOnConfirm",function(){u(e);let o=c();return _(o.remove())}),m(15," \u5220\u9664 "),a(),l(16,"button",19),C("click",function(){u(e);let o=c();return _(o.useThisEnv())}),m(17,"\u8BBE\u4E3A\u5F53\u524D"),a()()()}if(i&2){let e=c();s(4),d("ngModel",e.draft().name),s(4),d("ngModel",e.draft().baseUrl),s(2),d("rows",e.varsRows())}}function Bn(){return Date.now()}function Ao(i){let t=Math.random().toString(16).slice(2,10);return`${i}_${t}_${Date.now().toString(16)}`}var ht=class i{envChange=new y;store=q(ze);modalRef=q(tt);msg=q(Se);draft=E(null);varsRows=E([]);selectEditEnv(t){this.store.activeEnvId.set(t);let e=this.store.envs().find(n=>n.id===t);e&&(this.draft.set(z(w({},e),{variables:e.variables})),this.varsRows.set(Bt(e.variables)))}createEnv(){let t=Bn(),e={id:Ao("env"),scope:"project",name:"\u672A\u547D\u540D\u73AF\u5883",variables:[],createdAt:t,updatedAt:t};this.draft.set(e),this.varsRows.set(Bt(e.variables))}setName(t){let e=this.draft();e&&this.draft.set(z(w({},e),{name:t}))}setBaseUrl(t){let e=this.draft();e&&this.draft.set(z(w({},e),{baseUrl:t}))}async save(){let t=this.draft();if(!t)return;let e=z(w({},t),{variables:Vn(this.varsRows(),t.variables),updatedAt:Bn()});await this.store.saveEnv(e),this.store.activeEnvId.set(e.id),this.msg.success("\u73AF\u5883\u53D8\u91CF\u4FDD\u5B58\u6210\u529F"),this.draft.set(e)}async remove(){let t=this.store.activeEnvId();t&&(await this.store.deleteEnv(t),this.store.activeEnvId.set(null),this.draft.set(null),this.varsRows.set([]),this.msg.success("\u73AF\u5883\u53D8\u91CF\u5220\u9664\u6210\u529F"))}useThisEnv(){let t=this.store.activeEnvId();t&&this.store.setActiveEnv(t)}close(){this.modalRef.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-env-modal",8,"component"]],outputs:{envChange:"envChange"},attrs:wo,decls:12,vars:2,consts:[[1,"drawer"],[1,"left"],[1,"toolbar"],["nz-button","","nzType","primary",3,"click"],[1,"env-list"],[1,"env-item",3,"active"],[1,"empty"],[1,"right"],[1,"form"],[1,"env-item",3,"click"],[1,"name"],[1,"meta"],[1,"row"],[1,"label"],["nz-input","",3,"ngModelChange","ngModel"],[1,"vars"],["keyLabel","Key","valueLabel","Value","keyPlaceholder","TOKEN","valuePlaceholder","xxx",3,"rowsChange","rows"],[1,"actions"],["nz-button","","nzType","default","nzDanger","","nz-popconfirm","","nzPopconfirmTitle","\u786E\u8BA4\u5220\u9664\u8BE5\u73AF\u5883\uFF1F",3,"nzOnConfirm"],["nz-button","","nzType","default",3,"click"]],template:function(e,n){if(e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),C("click",function(){return n.createEnv()}),m(4,"\u65B0\u5EFA"),a()(),l(5,"div",4),S(6,zo,5,4,"div",5,bo),g(8,Mo,2,0,"div",6),a()(),l(9,"div",7),g(10,To,2,0,"div",6)(11,Eo,18,3,"div",8),a()()),e&2){let o;s(6),D(n.store.envs()),s(2),f(n.store.envs().length?-1:8),s(2),f((o=n.draft())!=null&&o.id?11:10)}},dependencies:[A,P,$,K,j,be,I,O,V,X,F,H,De,it],styles:[".drawer[_ngcontent-%COMP%]{display:grid;grid-template-columns:180px 1fr;gap:12px;height:100%}.left[_ngcontent-%COMP%]{border-right:1px solid #f0f0f0;padding-right:12px}.toolbar[_ngcontent-%COMP%]{padding-bottom:10px}.env-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.env-item[_ngcontent-%COMP%]{padding:8px;border:1px solid #f0f0f0;border-radius:8px;cursor:pointer}.env-item.active[_ngcontent-%COMP%]{background:#f5f5f5}.name[_ngcontent-%COMP%]{font-weight:600}.meta[_ngcontent-%COMP%]{font-size:12px;opacity:.7}.right[_ngcontent-%COMP%]{min-width:0}.empty[_ngcontent-%COMP%]{padding:12px;opacity:.7}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:70px 1fr;gap:10px;align-items:center;margin-bottom:10px}.label[_ngcontent-%COMP%]{font-size:14px;opacity:.8}.vars[_ngcontent-%COMP%]{height:420px}.actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-top:12px}"]})};var No=(i,t)=>t.id;function ko(i,t){if(i&1&&h(0,"nz-option",2),i&2){let e=t.$implicit;d("nzValue",e.id)("nzLabel",e.name)}}var vt=class i{store=q(ze);modalService=q(nt);openEnvModal(){let t=this.modalService.create({nzTitle:"\u73AF\u5883\u53D8\u91CF",nzFooter:null,nzMaskClosable:!1,nzContent:ht,nzWidth:"1020px",nzCentered:!0});t.afterOpen.subscribe(()=>{let e=t.getContentComponent();e&&this.store.activeEnvId()?e.selectEditEnv(this.store.activeEnvId()??""):e.createEnv()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-env-picker"]],decls:6,vars:3,consts:[[1,"picker"],[1,"sel",3,"ngModelChange","nzPlaceHolder","ngModel","nzAllowClear"],[3,"nzValue","nzLabel"],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u7BA1\u7406\u73AF\u5883\u53D8\u91CF",3,"click"],["nzType","setting","nzTheme","outline"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"nz-select",1),C("ngModelChange",function(r){return n.store.setActiveEnv(r)}),S(2,ko,1,2,"nz-option",2,No),a(),l(4,"button",3),C("click",function(){return n.openEnvModal()}),h(5,"nz-icon",4),a()()),e&2&&(s(),d("nzPlaceHolder","Env")("ngModel",n.store.activeEnvId())("nzAllowClear",!0),s(),D(n.store.envs()))},dependencies:[A,P,K,j,ne,he,ve,I,O,V,Ge,F,Ie,qe,U,J,De],styles:[".picker[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}.sel[_ngcontent-%COMP%]{width:160px}"]})};var yt=class i{options;optionsChange=new y;timeoutMs=v(()=>this.options?.timeoutMs??3e4);followRedirects=v(()=>this.options?.followRedirects??!0);insecureTLS=v(()=>this.options?.insecureTLS??!1);proxy=v(()=>this.options?.proxy??"");emit(t){this.optionsChange.emit(t)}setTimeout(t){let e=Number(t);this.emit(z(w({},this.options??{}),{timeoutMs:isNaN(e)?void 0:e}))}setFollowRedirects(t){this.emit(z(w({},this.options??{}),{followRedirects:t}))}setInsecureTLS(t){this.emit(z(w({},this.options??{}),{insecureTLS:t}))}setProxy(t){this.emit(z(w({},this.options??{}),{proxy:t||void 0}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-advanced-editor"]],inputs:{options:"options"},outputs:{optionsChange:"optionsChange"},decls:25,vars:4,consts:[[1,"wrap"],[1,"grid"],[1,"row"],[1,"label"],["nz-input","","type","number","min","0","placeholder","30000",3,"ngModelChange","ngModel"],[1,"desc"],[1,"row","checkbox"],["nz-checkbox","",3,"ngModelChange","ngModel"],["nz-input","","placeholder","http://127.0.0.1:7890",3,"ngModelChange","ngModel"],[1,"desc","muted"],["nzType","info","nzShowIcon","","nzMessage","\u8BF4\u660E\uFF1AProxy \u914D\u7F6E\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5F53\u524D NodeHttpClient \u5C1A\u672A\u5B9E\u73B0\u4EE3\u7406\u652F\u6301\uFF0C\u8BF7\u52FF\u4F9D\u8D56\u8BE5\u9009\u9879\u8FDB\u884C\u8C03\u8BD5\u3002"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),m(4,"Timeout (ms)"),a(),l(5,"input",4),C("ngModelChange",function(r){return n.setTimeout(r)}),a(),l(6,"div",5),m(7,"\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF080 \u8868\u793A\u4E0D\u8D85\u65F6\uFF09"),a()(),l(8,"div",6)(9,"label",7),C("ngModelChange",function(r){return n.setFollowRedirects(r)}),m(10," Follow Redirects "),a(),l(11,"div",5),m(12,"\u662F\u5426\u81EA\u52A8\u8DDF\u968F HTTP \u91CD\u5B9A\u5411\uFF08302 / 301\uFF09"),a()(),l(13,"div",6)(14,"label",7),C("ngModelChange",function(r){return n.setInsecureTLS(r)}),m(15," Insecure TLS "),a(),l(16,"div",5),m(17,"\u8DF3\u8FC7 TLS \u8BC1\u4E66\u6821\u9A8C\uFF08\u4EC5\u5728 Node \u73AF\u5883\u4E0B\u5C3D\u529B\u652F\u6301\uFF09"),a()(),l(18,"div",2)(19,"div",3),m(20,"Proxy"),a(),l(21,"input",8),C("ngModelChange",function(r){return n.setProxy(r)}),a(),l(22,"div",9),m(23,"\u4EE3\u7406\u5730\u5740\uFF08\u5F53\u524D\u7248\u672C\u4EC5\u4FDD\u5B58\uFF0C\u4E0D\u53C2\u4E0E\u5B9E\u9645\u8BF7\u6C42\uFF09"),a()(),h(24,"nz-alert",10),a()()),e&2&&(s(5),d("ngModel",n.timeoutMs()),s(4),d("ngModel",n.followRedirects()),s(5),d("ngModel",n.insecureTLS()),s(7),d("ngModel",n.proxy()))},dependencies:[A,P,$,dn,K,mn,j,rt,ot,F,H,Oe,Te],styles:[".wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:240px}.grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:10px}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:center;gap:10px}.row.checkbox[_ngcontent-%COMP%]{grid-template-columns:1fr}.label[_ngcontent-%COMP%]{font-size:12px;opacity:.8}.desc[_ngcontent-%COMP%]{grid-column:2 / span 1;font-size:12px;opacity:.65}.row.checkbox[_ngcontent-%COMP%] .desc[_ngcontent-%COMP%]{grid-column:1 / span 1;margin-left:24px}.muted[_ngcontent-%COMP%]{color:#999}"]})};var jt=()=>[];function Io(i,t){if(i&1){let e=b();l(0,"div",3)(1,"div",4),m(2,"Path \u53C2\u6570"),a(),l(3,"app-kv-table",14),C("rowsChange",function(o){u(e);let r=c();return _(r.patch.emit({pathParams:o}))}),a()()}if(i&2){let e=c();s(3),d("keepTrailingBlank",!1)("rows",(e.req==null?null:e.req.pathParams)||Je(2,jt))}}var xt=class i{req=null;patch=new y;static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-request-tabs"]],inputs:{req:"req"},outputs:{patch:"patch"},decls:20,vars:8,consts:[[1,"tabs"],["nzTitle","Params"],[1,"tab"],[1,"item"],[1,"title"],["keyLabel","\u53C2\u6570\u540D","valueLabel","\u53C2\u6570\u503C","descriptionLabel","\u8BF4\u660E","keyPlaceholder","param","valuePlaceholder","value",3,"rowsChange","rows"],["nzTitle","Headers"],["keyLabel","Header","valueLabel","Value","keyPlaceholder","x-header","valuePlaceholder","value",3,"rowsChange","rows"],["nzTitle","Body"],[3,"bodyChange","body"],["nzTitle","Auth"],[3,"authChange","auth"],["nzTitle","Advanced"],[3,"optionsChange","options"],["keyLabel","\u53C2\u6570\u540D","valueLabel","\u53C2\u6570\u503C","descriptionLabel","\u8BF4\u660E","keyPlaceholder","param","valuePlaceholder","value",3,"rowsChange","keepTrailingBlank","rows"]],template:function(e,n){e&1&&(l(0,"nz-tabs",0)(1,"nz-tab",1)(2,"div",2)(3,"div",3)(4,"div",4),m(5,"Query \u53C2\u6570"),a(),l(6,"app-kv-table",5),C("rowsChange",function(r){return n.patch.emit({query:r})}),a()(),g(7,Io,4,3,"div",3),a()(),l(8,"nz-tab",6)(9,"div",2)(10,"app-kv-table",7),C("rowsChange",function(r){return n.patch.emit({headers:r})}),a()()(),l(11,"nz-tab",8)(12,"div",2)(13,"app-body-editor",9),C("bodyChange",function(r){return n.patch.emit({body:r})}),a()()(),l(14,"nz-tab",10)(15,"div",2)(16,"app-auth-editor",11),C("authChange",function(r){return n.patch.emit({auth:r})}),a()()(),l(17,"nz-tab",12)(18,"div",2)(19,"app-advanced-editor",13),C("optionsChange",function(r){return n.patch.emit({options:r})}),a()()()()),e&2&&(s(6),d("rows",(n.req==null?null:n.req.query)||Je(6,jt)),s(),f(!(n.req==null||n.req.pathParams==null)&&n.req.pathParams.length?7:-1),s(3),d("rows",(n.req==null?null:n.req.headers)||Je(7,jt)),s(3),d("body",n.req==null?null:n.req.body),s(3),d("auth",n.req==null?null:n.req.auth),s(3),d("options",n.req==null?null:n.req.options))},dependencies:[ct,st,at,be,Ct,_t,yt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0}app-kv-table[_ngcontent-%COMP%]{display:block;height:100%}.tabs[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;height:100%}.tab[_ngcontent-%COMP%]{height:100%;overflow:hidden auto} nz-tabs.tabs .ant-tabs-content{height:100%} nz-tabs.tabs .ant-tabs-content .ant-tabs-tabpane{height:100%}"]})};function Ro(i,t){if(i&1&&h(0,"nz-option",2),i&2){let e=t.$implicit;d("nzValue",e)("nzLabel",e)}}function Po(i,t){if(i&1){let e=b();l(0,"div",7)(1,"nz-tag",8),m(2),a(),l(3,"a",9),C("click",function(){u(e);let o=c();return _(o.openEnv())}),m(4,"\u53BB\u914D\u7F6E"),a()()}if(i&2){let e=c();s(2),se(" \u672A\u89E3\u6790\u53D8\u91CF\uFF1A",e.missingVars().join(", ")," ")}}var wt=class i{envVars={};openEnv;method="GET";url="";sending=!1;envName=null;baseUrl=null;methodChange=new y;urlChange=new y;urlCommit=new y;send=new y;save=new y;methods=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"];missingVars=v(()=>Pn([this.draftUrl],this.envVars));draftUrl="";t;ngOnChanges(t){t.url&&(this.draftUrl=this.url??"")}onDraftChange(t){this.draftUrl=t??"",this.t&&window.clearTimeout(this.t),this.t=window.setTimeout(()=>{this.urlChange.emit(this.draftUrl)},250)}commit(){this.t&&(window.clearTimeout(this.t),this.t=void 0),this.urlChange.emit(this.draftUrl),this.urlCommit.emit(this.draftUrl)}placeholder=v(()=>this.baseUrl?'"/"\u5F00\u5934':"http://...");previewUrl=v(()=>{let t=(this.url??"").trim();if(!t||So(t))return"";let e=(this.baseUrl??"").trim();if(!e)return"";try{return new URL(t,e).toString()}catch{return""}});static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-request-urlbar"]],inputs:{envVars:"envVars",openEnv:"openEnv",method:"method",url:"url",sending:"sending",envName:"envName",baseUrl:"baseUrl"},outputs:{methodChange:"methodChange",urlChange:"urlChange",urlCommit:"urlCommit",send:"send",save:"save"},features:[te],decls:11,vars:6,consts:[[1,"bar"],[1,"method",3,"ngModelChange","ngModel"],[1,"m",3,"nzValue","nzLabel"],[1,"url",3,"nzAddonBefore"],["nz-input","",3,"ngModelChange","blur","keydown.enter","placeholder","ngModel"],["nz-button","","nzType","primary",3,"click","nzLoading"],["nz-button","","nzType","default",3,"click"],[1,"var-hint"],["nzColor","warning"],[3,"click"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"nz-select",1),C("ngModelChange",function(r){return n.methodChange.emit(r)}),S(2,Ro,1,2,"nz-option",2,_e),a(),l(4,"nz-input-wrapper",3)(5,"input",4),C("ngModelChange",function(r){return n.onDraftChange(r)})("blur",function(){return n.commit()})("keydown.enter",function(){return n.commit()}),a()(),l(6,"button",5),C("click",function(){return n.send.emit()}),m(7,"\u53D1\u9001"),a(),l(8,"button",6),C("click",function(){return n.save.emit()}),m(9,"\u4FDD\u5B58"),a()(),g(10,Po,5,1,"div",7)),e&2&&(s(),d("ngModel",n.method),s(),D(n.methods),s(2),d("nzAddonBefore",n.baseUrl?n.baseUrl+" ":void 0),s(),d("placeholder",n.placeholder())("ngModel",n.draftUrl),s(),d("nzLoading",n.sending),s(4),f(n.missingVars().length?10:-1))},dependencies:[A,P,$,K,j,I,O,V,X,F,H,fe,ne,he,ve,xe,ye],styles:[".bar[_ngcontent-%COMP%]{display:flex;gap:10px;padding:10px;border-bottom:1px solid #f0f0f0;align-items:center}.method[_ngcontent-%COMP%]{width:120px}.url[_ngcontent-%COMP%]{flex:1 1 auto}.var-hint[_ngcontent-%COMP%]{padding:4px 10px 8px;font-size:12px;display:flex;gap:8px;align-items:center}"]})};function So(i){return/^https?:\/\//i.test(i)}function Do(i,t){if(i&1){let e=b();l(0,"app-request-urlbar",0),C("methodChange",function(o){u(e);let r=c();return _(r.patch.emit({method:o}))})("urlChange",function(o){u(e);let r=c();return _(r.onUrlChange(o))})("urlCommit",function(o){u(e);let r=c();return _(r.onUrlCommit(o))})("send",function(){u(e);let o=c();return _(o.send.emit())})("save",function(){u(e);let o=c();return _(o.save.emit())}),a(),l(1,"div",1)(2,"nz-input-wrapper",2)(3,"input",3),C("ngModelChange",function(o){u(e);let r=c();return _(r.patch.emit({name:o}))}),a()()(),l(4,"app-request-tabs",4),C("patch",function(o){u(e);let r=c();return _(r.patch.emit(o))}),a()}if(i&2){let e=c();d("method",e.request.method)("baseUrl",e.baseUrl)("envVars",e.envVars)("openEnv",e.openEnv)("url",e.request.url)("sending",e.sending),s(2),d("nzAddonBefore",e.collectionPath||"\u672A\u5206\u7C7B"),s(),d("ngModel",e.request.name),s(),d("req",e.request)}}var bt=class i{request=null;sending=!1;envVars={};openEnv;baseUrl=null;patch=new y;send=new y;save=new y;collectionPath=null;methods=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"];onUrlCommit(t){let e=this.request;if(!e)return;let n=Ft(t,e.pathParams),o=Fe(e.url??""),r=Fe(t??"");(o.length!==r.length||o.some((x,M)=>x!==r[M]))&&this.patch.emit({pathParams:n})}onUrlChange(t){let e=this.request;if(!e){this.patch.emit({url:t});return}let n=Ft(t,e.pathParams),o=Fe(e.url??""),r=Fe(t??"");o.length!==r.length||o.some((x,M)=>x!==r[M])?this.patch.emit({url:t,pathParams:n}):this.patch.emit({url:t})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-request-editor"]],inputs:{request:"request",sending:"sending",envVars:"envVars",openEnv:"openEnv",baseUrl:"baseUrl",collectionPath:"collectionPath"},outputs:{patch:"patch",send:"send",save:"save"},decls:1,vars:1,consts:[[3,"methodChange","urlChange","urlCommit","send","save","method","baseUrl","envVars","openEnv","url","sending"],[1,"name"],[3,"nzAddonBefore"],["nz-input","","placeholder","\u672A\u547D\u540D\u63A5\u53E3\u540D\u79F0",3,"ngModelChange","ngModel"],[1,"tabs",3,"patch","req"]],template:function(e,n){e&1&&g(0,Do,5,9),e&2&&f(n.request?0:-1)},dependencies:[A,P,$,K,j,I,F,H,fe,ne,Ve,xt,wt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}.name[_ngcontent-%COMP%]{padding:10px;border-bottom:1px solid #f0f0f0}.tabs[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;padding:0 10px}app-request-tabs[_ngcontent-%COMP%]{flex:1 1 auto;height:0}"]})};var zt=class i{clipboard=q(zn);curl=null;copy(t){this.clipboard.copy(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-curl-actions"]],inputs:{curl:"curl"},decls:17,vars:5,consts:[["menu","nzDropdownMenu"],[1,"wrap"],["nz-button","","nz-dropdown","","nzType","default","nzTrigger","hover","nzPlacement","bottomCenter",3,"disabled","nzDropdownMenu"],["nzType","copy","nzTheme","outline"],["nz-menu",""],["nz-menu-item",""],["nz-button","","nzType","text",3,"click","disabled"]],template:function(e,n){if(e&1){let o=b();l(0,"div",1)(1,"nz-space")(2,"button",2),h(3,"nz-icon",3),m(4," cURL "),a()(),l(5,"nz-dropdown-menu",null,0)(7,"ul",4)(8,"li",5)(9,"button",6),C("click",function(){return u(o),_(n.copy(n.curl.bash))}),m(10," cURL (Bash) "),a()(),l(11,"li",5)(12,"button",6),C("click",function(){return u(o),_(n.copy(n.curl.powershell))}),m(13," cURL (PS) "),a()(),l(14,"li",5)(15,"button",6),C("click",function(){return u(o),_(n.copy(n.curl.cmd))}),m(16," cURL (CMD) "),a()()()()()}if(e&2){let o=Q(6);s(2),d("disabled",!n.curl)("nzDropdownMenu",o),s(7),d("disabled",!(n.curl!=null&&n.curl.bash)),s(3),d("disabled",!(n.curl!=null&&n.curl.powershell)),s(3),d("disabled",!(n.curl!=null&&n.curl.cmd))}},dependencies:[A,Mn,an,ln,I,O,V,X,U,J,vn,Pe,Re,gn,hn,fn],encapsulation:2})};function Vo(i,t){if(i&1&&(l(0,"nz-tag",11),m(1),a(),l(2,"span",4),m(3),a()),i&2){let e,n,o=c();d("nzColor",o.statusColor()),s(),Gt(" ",(e=o.response())==null?null:e.status," ",((e=o.response())==null?null:e.statusText)||""," "),s(2),se("",(n=o.response())==null?null:n.bodySize," bytes")}}function Oo(i,t){i&1&&(l(0,"span",4),m(1,"-"),a())}function Fo(i,t){i&1&&(l(0,"div",7),h(1,"nz-spin"),a())}function Bo(i,t){if(i&1&&h(0,"nz-alert",8),i&2){let e=c();d("nzMessage",e.error())}}function Ko(i,t){i&1&&(l(0,"div",9),m(1,"\u53D1\u9001\u8BF7\u6C42\u540E\u5728\u6B64\u67E5\u770B\u54CD\u5E94"),a())}function jo(i,t){if(i&1&&(l(0,"pre",15),m(1),a()),i&2){let e=c(2);s(),k(e.prettyJson())}}function Lo(i,t){if(i&1&&(l(0,"pre",15),m(1),a()),i&2){let e,n=c(2);s(),k((e=n.response())==null?null:e.bodyText)}}function Uo(i,t){if(i&1&&(l(0,"div",18)(1,"div",20),m(2),a(),l(3,"div",21),m(4),a()()),i&2){let e,n=t.$implicit,o=c(2);s(2),k(n),s(2),k((e=o.response())==null||e.headers==null?null:e.headers[n])}}function $o(i,t){if(i&1){let e=b();l(0,"nz-tabs",12),de("nzSelectedIndexChange",function(o){u(e);let r=c();return pe(r.tabIndex,o)||(r.tabIndex=o),_(o)}),l(1,"nz-tab",13)(2,"div",14),g(3,jo,2,1,"pre",15)(4,Lo,2,1,"pre",15),a()(),l(5,"nz-tab",16)(6,"div",14)(7,"div",17),S(8,Uo,5,2,"div",18,_e),a()()(),l(10,"nz-tab",19)(11,"div",14)(12,"pre",15),m(13),a()()()()}if(i&2){let e=c();ce("nzSelectedIndex",e.tabIndex),s(3),f(e.isJson()?3:4),s(5),D(e.headerKeys()),s(5),k(e.rawDump())}}var Mt=class i{sending=!1;result=null;resultSig=E(null);tabIndex=0;ngOnChanges(t){if(t.result){let e=t.result.currentValue;this.resultSig.set(e)}}error=v(()=>{let t=this.resultSig();return t&&t.error?t.error.message:null});curl=v(()=>{let t=this.resultSig();return t&&t.curl?t.curl:null});response=v(()=>{let t=this.resultSig();return t?t.response:null});headerKeys=v(()=>{let t=this.response()?.headers??{};return Object.keys(t).sort((e,n)=>e.localeCompare(n))});statusColor=v(()=>{let t=this.response()?.status??0;return t?t>=200&&t<300?"green":t>=300&&t<400?"blue":t>=400&&t<500?"orange":"red":"default"});isJson=v(()=>{let t=this.response();if(!t)return!1;if((t.headers?.["content-type"]??t.headers?.["Content-Type"]??"").toLowerCase().includes("application/json"))return!0;let n=(t.bodyText??"").trim();return n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]")});prettyJson=v(()=>{let t=(this.response()?.bodyText??"").trim();try{let e=JSON.parse(t);return JSON.stringify(e,null,2)}catch{return this.response()?.bodyText??""}});rawDump=v(()=>this.response()?JSON.stringify(this.response(),null,2):"");static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-response-viewer"]],inputs:{sending:"sending",result:"result"},features:[te],decls:13,vars:3,consts:[[1,"wrap"],[1,"top"],[1,"left"],[1,"title"],[1,"meta"],[1,"right"],[3,"curl"],[1,"loading"],["nzType","error","nzShowIcon","",3,"nzMessage"],[1,"empty"],[1,"tabs",3,"nzSelectedIndex"],[3,"nzColor"],[1,"tabs",3,"nzSelectedIndexChange","nzSelectedIndex"],["nzTitle","Body"],[1,"pane"],[1,"code"],["nzTitle","Headers"],[1,"hlist"],[1,"hrow"],["nzTitle","Raw"],[1,"hk"],[1,"hv"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),m(4,"Response"),a(),g(5,Vo,4,4)(6,Oo,2,0,"span",4),a(),l(7,"div",5),h(8,"app-curl-actions",6),a()(),g(9,Fo,2,0,"div",7)(10,Bo,1,1,"nz-alert",8)(11,Ko,2,0,"div",9)(12,$o,14,3,"nz-tabs",10),a()),e&2&&(s(5),f(n.response()?5:6),s(3),d("curl",n.curl()),s(),f(n.sending?9:n.error()?10:n.response()?12:11))},dependencies:[A,ct,st,at,xe,ye,Ve,lt,Oe,Te,zt],styles:["[_nghost-%COMP%]{display:flex;height:100%;min-height:0}.wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;width:100%}.top[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid #f0f0f0}.left[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center}.title[_ngcontent-%COMP%]{font-weight:700}.meta[_ngcontent-%COMP%]{font-size:12px;opacity:.65}.loading[_ngcontent-%COMP%]{padding:16px}.empty[_ngcontent-%COMP%]{padding:16px;opacity:.6}.tabs[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.pane[_ngcontent-%COMP%]{height:100%;min-height:0;overflow:auto;padding:10px 12px}.code[_ngcontent-%COMP%]{margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px;line-height:1.5;white-space:pre-wrap;word-break:break-word}.hlist[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.hrow[_ngcontent-%COMP%]{display:grid;grid-template-columns:200px 1fr;gap:10px;padding:8px;border:1px solid #f0f0f0;border-radius:8px}.hk[_ngcontent-%COMP%]{font-weight:600;font-size:12px}.hv[_ngcontent-%COMP%]{font-size:12px;opacity:.85;word-break:break-word}"]})};var Ho=["envPicker"],Wo=["class","component"];function Jo(i,t){if(i&1){let e=b();l(0,"app-request-editor",8),C("patch",function(o){u(e);let r=c();return _(r.store.patchActive(o))})("save",function(){u(e);let o=c();return _(o.store.saveActive())})("send",function(){u(e);let o=c();return _(o.store.sendActive())}),a(),h(1,"app-response-viewer",9)}if(i&2){let e,n=c();d("collectionPath",n.store.collectionPath())("baseUrl",((e=n.store.activeEnv())==null?null:e.baseUrl)??null)("request",n.store.activeRequest())("sending",n.store.sending())("envVars",n.store.envVarRecord())("openEnv",n.openEnv),s(),d("sending",n.store.sending())("result",n.store.lastResult())}}function Zo(i,t){if(i&1){let e=b();l(0,"app-api-history-drawer",10),C("close",function(){u(e);let o=c();return _(o.store.closeHistory())})("replay",function(o){u(e);let r=c();return _(r.store.replayHistory(o))}),a()}if(i&2){let e=c();d("loading",e.store.historyLoading())("histories",e.store.histories())}}var Tt=class i{store=q(ze);envPicker;openEnv=()=>{this.envPicker.openEnvModal()};static \u0275fac=function(e){return new(e||i)};static \u0275cmp=T({type:i,selectors:[["app-api-client",8,"component"]],viewQuery:function(e,n){if(e&1&&Ht(Ho,5),e&2){let o;Wt(o=Jt())&&(n.envPicker=o.first)}},attrs:Wo,decls:10,vars:10,consts:[[3,"title","loading","isFullscreen","isOverflowYAuto"],["ngProjectAs","actions",5,["actions"]],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u5386\u53F2\u8BB0\u5F55",3,"click"],["nzType","history","nzTheme","outline"],[1,"page"],[3,"qChange","select","createRequest","createCollection","createFolder","reload","delete","rename","move","nodes","q","activeId","loading"],[1,"content"],[3,"loading","histories"],[3,"patch","save","send","collectionPath","baseUrl","request","sending","envVars","openEnv"],[3,"sending","result"],[3,"close","replay","loading","histories"]],template:function(e,n){e&1&&(l(0,"app-page-layout",0),le(1,1),h(2,"app-env-picker"),l(3,"button",2),C("click",function(){return n.store.openHistory()}),h(4,"nz-icon",3),a(),ae(),l(5,"nz-layout",4)(6,"app-request-collections",5),de("qChange",function(r){return pe(n.store.q,r)||(n.store.q=r),r}),C("select",function(r){return n.store.selectRequest(r)})("createRequest",function(r){return n.store.newRequest({collectionId:r.collectionId})})("createCollection",function(){return n.store.newCollection({kind:"collection"})})("createFolder",function(r){return n.store.newCollection({kind:"folder",parentId:r.collectionId})})("reload",function(){return n.store.loadAll()})("delete",function(r){return n.store.deleteCollection(r.id,r.kind)})("rename",function(r){return n.store.renameCollection(r.id,r.kind)})("move",function(r){return n.store.moveCollection(r.id,r.kind)}),a(),l(7,"div",6),g(8,Jo,2,8),a()()(),g(9,Zo,1,2,"app-api-history-drawer",7)),e&2&&(d("title","API \u8BF7\u6C42")("loading",n.store.loading())("isFullscreen",!0)("isOverflowYAuto",!1),s(6),d("nodes",n.store.filteredNodes()),ce("q",n.store.q),d("activeId",n.store.activeRequestId())("loading",n.store.loading()),s(2),f(n.store.activeRequest()?8:-1),s(),f(n.store.historyOpen()?9:-1))},dependencies:[A,un,I,O,V,U,J,bn,wn,Ie,qe,ut,bt,Mt,pt,vt],styles:[".page[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:row;overflow:hidden;gap:16px;padding:0 16px}.content[_ngcontent-%COMP%]{flex:1 1 auto;width:0;display:flex;flex-direction:column;height:100%;overflow:hidden}app-request-editor[_ngcontent-%COMP%]{flex:0 0 auto;height:50%}app-response-viewer[_ngcontent-%COMP%]{flex:0 0 auto;height:50%;overflow:auto}"]})};var Go=[{path:"",component:Tt}],Et=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=ke({type:i});static \u0275inj=Ne({imports:[Pt.forChild(Go),Pt]})};var Kn=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=ke({type:i});static \u0275inj=Ne({imports:[A,Et]})};export{Kn as ApiClientModule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Me}from"./chunk-FNLA2MNI.js";import{a as xe,e as ke,f as ve}from"./chunk-CO7S3LZV.js";import{a as he}from"./chunk-3PWCJ3D5.js";import"./chunk-GCKL62DR.js";import"./chunk-CJISJEP3.js";import{d as be,e as ye}from"./chunk-35COW2FA.js";import"./chunk-SIVPP74B.js";import"./chunk-POZS3PD3.js";import{b as ze}from"./chunk-J2JNFWJN.js";import"./chunk-HZ73CM45.js";import{b as S,c as ge,d as E}from"./chunk-OUE23ZE4.js";import{f as F}from"./chunk-DJJC6FPO.js";import{a as A,e as de}from"./chunk-ROB7EMN5.js";import{c as _e,d as Ce}from"./chunk-W6TCGG53.js";import"./chunk-SNCDDYQR.js";import{F as ue,G as fe}from"./chunk-EP45FT55.js";import{Ab as ce,Bb as me,Cb as N,Fb as I,Hb as D,M as h,N as f,T as oe,U as x,V as P,W as ae,Y as O,Z as k,jb as se,lb as re,pb as le,vb as v,yb as pe,z as ie}from"./chunk-PTMJ422K.js";import"./chunk-HFZLJHYR.js";import{i as C}from"./chunk-53YRDYLS.js";import{$b as K,Ca as G,Eb as u,Fc as te,Ic as d,Jc as M,Kc as z,Q as H,U as Q,Vb as T,Xb as w,_b as J,ac as c,bc as o,cc as a,dc as l,g as b,gd as ne,kc as X,l as U,mb as r,qc as m,ra as g,tc as _,xa as W,xc as Y,ya as q,yb as y,yc as Z,zc as ee}from"./chunk-SJG2JCPL.js";var L=class n{constructor(t,e,i){this.stream=t;this.clipboard=e;this.notify=i;this.resizeSub.add(this.resize$.pipe(H(350),Q((s,p)=>s.cols===p.cols&&s.rows===p.rows),ie(this.destroyRef)).subscribe(s=>{this._taskId&&this.stream.resize(this._taskId,s.cols,s.rows)}))}_taskId="";destroyRef=g(G);set taskId(t){let e=(t??"").trim();e&&e!==this._taskId&&(this._taskId&&(this.stream.unsubscribeTask(this._taskId),this.term?.clear()),this._taskId=e,this.bind(e))}get taskId(){return this._taskId}tail=200;follow=!0;status={status:"idle"};term;sub=new b;resizeSub=new b;resize$=new U;bind(t){this.stream.subscribeTask(t,this.tail),this.sub.unsubscribe(),this.sub=new b,this.sub.add(this.stream.output$(t).subscribe(e=>{this.term&&(this.term.follow=this.follow,this.term.write(e.payload.text))})),this.sub.add(this.stream.status$(t).subscribe(e=>this.status=e))}ngOnDestroy(){this._taskId&&this.stream.unsubscribeTask(this._taskId),this.sub.unsubscribe(),this.resizeSub.unsubscribe()}toggleFollow(){this.follow=!this.follow,this.follow&&this.term?.scrollToBottom()}clear(){this.term?.clear()}toBottom(){this.term?.scrollToBottom()}async copy(){let t=this.term?.copyAll()??"";if(!t)return;this.clipboard.copy(t)?this.notify.success("Console output copied to clipboard."):this.notify.error("Failed to copy console output.")}onTermResized(t){this.resize$.next(t)}static \u0275fac=function(e){return new(e||n)(y(ge),y(be),y(ue))};static \u0275cmp=u({type:n,selectors:[["app-task-console"]],viewQuery:function(e,i){if(e&1&&Y(A,5),e&2){let s;Z(s=ee())&&(i.term=s.first)}},inputs:{taskId:"taskId",tail:"tail"},decls:16,vars:1,consts:[[1,"console-card"],[1,"header"],[1,"title"],["nzType","desktop","nzTheme","outline"],[1,"id"],[1,"actions"],["nzAlign","center"],["nz-button","","nz-tooltip","\u6E05\u7A7A\u65E5\u5FD7",3,"click"],["nzType","clear","nzTheme","outline"],["nz-button","","nz-tooltip","\u590D\u5236\u65E5\u5FD7",3,"click"],["nzType","copy","nzTheme","outline"],["nz-button","","nz-tooltip","\u6EDA\u52A8\u5230\u5E95\u90E8",3,"click"],["nzType","vertical-align-bottom","nzTheme","outline"],[1,"viewport"],[3,"resized","follow"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1)(2,"div",2),l(3,"nz-icon",3),o(4,"div",4),d(5,"\u8F93\u51FA"),a()(),o(6,"div",5)(7,"nz-space",6)(8,"button",7),m("click",function(){return i.clear()}),l(9,"nz-icon",8),a(),o(10,"button",9),m("click",function(){return i.copy()}),l(11,"nz-icon",10),a(),o(12,"button",11),m("click",function(){return i.toBottom()}),l(13,"nz-icon",12),a()()()(),o(14,"div",13)(15,"app-terminal-view",14),m("resized",function(p){return i.onTermResized(p)}),a()()()),e&2&&(r(15),c("follow",i.follow))},dependencies:[v,k,O,P,ae,x,oe,f,h,D,I,A,ye],styles:[".console-card[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;border:1px solid rgba(255,255,255,.08);border-radius:8px;overflow:hidden;min-height:0}.header[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:8px 12px}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .status[_ngcontent-%COMP%]{margin-left:8px;font-size:12px}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .status[_ngcontent-%COMP%] .running[_ngcontent-%COMP%]{opacity:.9}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .status[_ngcontent-%COMP%] .stopped[_ngcontent-%COMP%]{opacity:.8}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .status[_ngcontent-%COMP%] .idle[_ngcontent-%COMP%]{opacity:.6}.viewport[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:hidden;padding:8px;background:#000;border-radius:8px}"]})};var j=class n{name;description;command;static \u0275fac=function(e){return new(e||n)};static \u0275cmp=u({type:n,selectors:[["app-task-header"]],inputs:{name:"name",description:"description",command:"command"},decls:7,vars:3,consts:[[1,"name"],["nzType","appstore"],[1,"description"],[1,"command"]],template:function(e,i){e&1&&(o(0,"div",0),l(1,"nz-icon",1),d(2),a(),o(3,"div",2),d(4),a(),o(5,"div",3),d(6),a()),e&2&&(r(2),z(" ",i.name||"\u672A\u9009\u62E9\u4EFB\u52A1"),r(2),M(i.description||"-"),r(2),M(i.command||"-"))},dependencies:[C,f,h],styles:["[_nghost-%COMP%]{padding:0 16px;display:flex;flex-direction:row;align-items:center}[_nghost-%COMP%] .name[_ngcontent-%COMP%]{font-size:22px;position:relative;top:-1px}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{flex:1;color:var(--app-text-secondary);font-size:15px;margin:0 16px;overflow:hidden;-ms-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .command[_ngcontent-%COMP%]{font-family:Roboto Mono,monospace;font-size:13px;background:var(--app-primary-3);height:32px;line-height:32px;padding:0 12px;border-radius:3px;overflow:hidden;-ms-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}"]})};var Ne=(n,t)=>t.spec.id;function Ie(n,t){n&1&&(o(0,"div",7),d(1,"Loading..."),a())}function De(n,t){if(n&1&&(o(0,"div",7),d(1),a()),n&2){let e=_(2);r(),z("No tasks for project: ",e.projectId())}}function Ee(n,t){n&1&&l(0,"nz-badge",14)}function Fe(n,t){n&1&&l(0,"nz-badge",15)}function Le(n,t){n&1&&l(0,"nz-badge",16)}function je(n,t){if(n&1){let e=X();o(0,"div",10),m("click",function(){let s=W(e).$implicit,p=_(3);return q(p.state.select(s.spec.id))}),o(1,"div",11)(2,"div",12),l(3,"nz-icon",13),T(4,Ee,1,0,"nz-badge",14)(5,Fe,1,0,"nz-badge",15)(6,Le,1,0,"nz-badge",16),a(),o(7,"div",17)(8,"div",18),d(9),a(),o(10,"div",19),d(11),a()()()()}if(n&2){let e=t.$implicit,i=_(3);te("active",e.spec.id===i.selectedId()),r(),c("nz-tooltip",e.spec.description||""),r(3),w((e==null||e.runtime==null?null:e.runtime.status)==="running"?4:(e==null||e.runtime==null?null:e.runtime.status)==="stopping"?5:6),r(4),c("title",e.spec.name),r(),M(e.spec.name),r(2),z(" ",(e.runtime==null?null:e.runtime.status)==="running"?"\u8FD0\u884C\u4E2D":(e.runtime==null?null:e.runtime.status)==="stopping"?"\u505C\u6B62\u4E2D":(e.runtime==null?null:e.runtime.status)==="stopped"?"\u5DF2\u505C\u6B62":e.spec.description||"\u7A7A\u95F2\u4E2D"," ")}}function Be(n,t){if(n&1&&(o(0,"div",8),J(1,je,12,7,"div",9,Ne),a()),n&2){let e=_(2);r(),K(e.list())}}function Re(n,t){if(n&1&&T(0,De,2,1,"div",7)(1,Be,3,0,"div",8),n&2){let e=_();w(e.list().length===0?0:1)}}var B=class n{state=g(E);keyword=this.state.keyword;loading=this.state.loading;list=this.state.rowsViewFiltered;selectedId=this.state.selectedTaskId;projectId=this.state.projectId;badge(t){return t??""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=u({type:n,selectors:[["app-task-list"]],decls:10,vars:2,consts:[[1,"wrap"],[1,"header"],["nzInputPrefix","","nzType","search",1,"search-icon"],["nz-input","","placeholder","\u641C\u7D22\u4EFB\u52A1",3,"ngModelChange","ngModel"],["nz-button","","nzType","text",3,"click"],["nz-icon","","nzType","reload"],[1,"body"],[1,"hint"],[1,"items"],[1,"item",3,"active"],[1,"item",3,"click"],["nzTooltipPlacement","right",1,"row",3,"nz-tooltip"],[1,"icon"],["nzType","codepen-circle","nzTheme","outline"],["nzStatus","processing"],["nzStatus","warning"],["nzStatus","default"],[1,"info"],[1,"name",3,"title"],[1,"description"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1)(2,"nz-input-wrapper"),l(3,"nz-icon",2),o(4,"input",3),m("ngModelChange",function(p){return i.keyword.set(p)}),a()(),o(5,"button",4),m("click",function(){return i.state.refresh()}),l(6,"span",5),a()(),o(7,"div",6),T(8,Ie,2,0,"div",7)(9,Re,2,1),a()()),e&2&&(r(4),c("ngModel",i.keyword()),r(4),w(i.loading()?8:9))},dependencies:[C,v,se,re,le,k,O,P,f,h,S,x,F,N,ce,me,pe,D,I,Ce,_e],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:320px;flex:0 0 320px}.wrap[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:hidden}.header[_ngcontent-%COMP%]{width:100%;padding:10px 12px;display:flex;gap:10px;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,.12);flex:0 0 auto}.header[_ngcontent-%COMP%] nz-input-wrapper[_ngcontent-%COMP%]{width:100%;border-radius:18px}.body[_ngcontent-%COMP%]{flex:1 1 auto;height:0;display:flex;flex-direction:column}.error[_ngcontent-%COMP%]{padding:10px 12px;color:#b42318;flex:0 0 auto}.hint[_ngcontent-%COMP%]{padding:12px;opacity:.7;flex:0 0 auto}.items[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding:8px;display:flex;flex-direction:column;gap:8px;height:100%;overflow-x:hidden;overflow-y:auto}.item[_ngcontent-%COMP%]{border-radius:3px;padding:10px;cursor:pointer}.item[_ngcontent-%COMP%]:hover, .item.active[_ngcontent-%COMP%]{background:var(--app-primary-3)}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;overflow:hidden;justify-content:space-between}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{font-size:42px;flex:0 0 auto;position:relative}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;overflow:hidden}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .info[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:13px;color:var(--app-text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item[_ngcontent-%COMP%] .badge[_ngcontent-%COMP%]{font-size:12px;padding:2px 8px;border-radius:999px;border:1px solid rgba(0,0,0,.2);opacity:.85}.item[_ngcontent-%COMP%] .badge[data-status=running][_ngcontent-%COMP%]{font-weight:700}.item[_ngcontent-%COMP%] .badge[data-status=stopped][_ngcontent-%COMP%]{opacity:.7}.item[_ngcontent-%COMP%] .badge[data-status=failed][_ngcontent-%COMP%]{font-weight:700}.item[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{margin-top:6px;font-size:12px;opacity:.75;display:flex;align-items:center;gap:6px}.item[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .mono[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace}.item[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .sep[_ngcontent-%COMP%]{opacity:.5}"]})};var we=class n{projectState=g(fe);taskState=g(E);selectedTask=this.taskState.selectedRow;constructor(){ne(async()=>{let t=this.projectState.currentProjectId();t&&await this.taskState.setProject(t)})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=u({type:n,selectors:[["app-tasks"]],decls:7,vars:9,consts:[[3,"title","isFullscreen"],[1,"page"],[1,"content"],[3,"name","description","command"],[3,"toggle","isStopping","isRunning","isStopped"],[3,"taskId"]],template:function(e,i){if(e&1&&(o(0,"app-page-layout",0)(1,"nz-layout",1),l(2,"app-task-list"),o(3,"nz-content",2),l(4,"app-task-header",3),o(5,"app-task-actions",4),m("toggle",function(){return i.taskState.toggleTask()}),a(),l(6,"app-task-console",5),a()()()),e&2){let s,p,R;c("title","\u4EFB\u52A1")("isFullscreen",!0),r(4),c("name",(s=i.selectedTask())==null||s.spec==null?null:s.spec.name)("description",(p=i.selectedTask())==null||p.spec==null?null:p.spec.description)("command",(R=i.selectedTask())==null||R.spec==null?null:R.spec.command),r(),c("isStopping",i.taskState.isStopping())("isRunning",i.taskState.isRunning())("isStopped",i.taskState.isStopped()),r(),c("taskId",i.taskState.selectedTaskId())}},dependencies:[C,v,x,F,k,N,Me,S,ze,f,ve,ke,xe,L,B,he,j,de],styles:[".page[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:row;overflow:hidden;gap:16px;padding:0 16px}.content[_ngcontent-%COMP%]{flex:1 1 auto;width:0;display:flex;flex-direction:column;gap:16px;height:100%;overflow:hidden}app-task-header[_ngcontent-%COMP%], app-task-actions[_ngcontent-%COMP%]{flex:0 0 auto}app-task-console[_ngcontent-%COMP%]{flex:1 1 auto;display:block;height:0}"]})};export{we as TasksComponent};
|