werkmeister 0.93.3 → 0.93.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{budget-M6Q2T6LB.js → budget-PGVVUWSC.js} +2 -2
- package/dist/{cache-JBZR4WPQ.js → cache-VT7GBHR2.js} +2 -2
- package/dist/{chunk-LOARA444.js → chunk-2YAWKN4B.js} +2 -2
- package/dist/{chunk-XDBPLBUZ.js → chunk-4ADQJ3NO.js} +2 -2
- package/dist/{chunk-SE4JKSDJ.js → chunk-4FGT5BTG.js} +2 -2
- package/dist/{chunk-ZQWOS5LL.js → chunk-4SK2WDFU.js} +2 -2
- package/dist/{chunk-FVBAAF7Z.js → chunk-5RTBQAT7.js} +4 -4
- package/dist/{chunk-CB4VFJEL.js → chunk-67CKCUOX.js} +2 -2
- package/dist/{chunk-76FS62DP.js → chunk-6EEGEZLE.js} +2 -2
- package/dist/{chunk-QDLSCYDM.js → chunk-6FXTI2WZ.js} +2 -2
- package/dist/{chunk-XY5RD66R.js → chunk-6MPWPONJ.js} +2 -2
- package/dist/{chunk-YUZPGBGJ.js → chunk-6REQWPAV.js} +2 -2
- package/dist/chunk-7D7R3M4U.js +111 -0
- package/dist/{chunk-GL2LH3ZK.js → chunk-A7TH7DWD.js} +2 -2
- package/dist/{chunk-DJAG45GG.js → chunk-ASZUX3IC.js} +2 -2
- package/dist/{chunk-X57IXE7Q.js → chunk-AXMV4XZL.js} +2 -2
- package/dist/{chunk-5QV4XDJZ.js → chunk-CMXQQKD3.js} +2 -2
- package/dist/{chunk-KXBHMOYS.js → chunk-CT5ZOPSZ.js} +2 -2
- package/dist/{chunk-K4WOL6WD.js → chunk-CWEZ7RUW.js} +2 -2
- package/dist/{chunk-3Y3BULLF.js → chunk-CYUCIEOU.js} +2 -2
- package/dist/{chunk-ZHIPODEL.js → chunk-EP6B44PA.js} +2 -2
- package/dist/{chunk-O4K73Q2I.js → chunk-ER73PEUY.js} +2 -2
- package/dist/{chunk-KR27O6KM.js → chunk-FCE6GV5P.js} +2 -2
- package/dist/{chunk-CTD3M3ZO.js → chunk-FQRFNYV3.js} +2 -2
- package/dist/{chunk-NORRRFBV.js → chunk-GK2EJLFI.js} +3 -3
- package/dist/{chunk-MUSFRIK3.js → chunk-GVAGLIEH.js} +2 -2
- package/dist/{chunk-3QVQNEW2.js → chunk-GWQPTTUF.js} +2 -2
- package/dist/{chunk-JB5CVVN2.js → chunk-IAXCJW3Y.js} +2 -2
- package/dist/{chunk-ULNRIE5C.js → chunk-K4ZH6HZB.js} +2 -2
- package/dist/{chunk-YE4G6SF3.js → chunk-K6FB7R3Q.js} +3 -3
- package/dist/{chunk-UKEGRHTM.js → chunk-K6LZ6MYO.js} +2 -2
- package/dist/{chunk-2RXLRCHL.js → chunk-KA2NIJJG.js} +2 -2
- package/dist/{chunk-RF3G4YRP.js → chunk-KIZ25SQA.js} +3 -3
- package/dist/{chunk-T3N2TU7T.js → chunk-KVUJVYPS.js} +2 -2
- package/dist/{chunk-EHFZN2TL.js → chunk-MEA4YAAA.js} +2 -2
- package/dist/{chunk-RTBYODJT.js → chunk-MO2LKTAN.js} +2 -2
- package/dist/{chunk-FER2NQNY.js → chunk-NILGDPG6.js} +2 -2
- package/dist/{chunk-4NCV6JR7.js → chunk-NWLMPCZE.js} +2 -2
- package/dist/{chunk-RJF7ZLAO.js → chunk-OB2ENKLA.js} +2 -2
- package/dist/{chunk-ACHONTIB.js → chunk-OSXCWDE3.js} +3 -3
- package/dist/{chunk-R4K233AX.js → chunk-PMHCVUVZ.js} +2 -2
- package/dist/{chunk-RPFKVTPE.js → chunk-PN7ZUG3R.js} +2 -2
- package/dist/{chunk-JDHBMVSN.js → chunk-QQ6BITFP.js} +2 -2
- package/dist/{chunk-5PLIRGOA.js → chunk-RAHGSCT6.js} +2 -2
- package/dist/{chunk-B7RRUAOW.js → chunk-RXOXD4KA.js} +2 -2
- package/dist/{chunk-JGUVBPJI.js → chunk-S6BMUOIS.js} +2 -2
- package/dist/{chunk-Q2YBMEPF.js → chunk-T7GQISYS.js} +2 -2
- package/dist/{chunk-QHKVGE7Y.js → chunk-THGF3KVB.js} +2 -2
- package/dist/{chunk-ORWGD7MD.js → chunk-TKQ5HXSL.js} +2 -2
- package/dist/{chunk-RXP24ITU.js → chunk-TSQUAG3D.js} +2 -2
- package/dist/{chunk-K6RCSRE3.js → chunk-TXZ3WERB.js} +2 -2
- package/dist/{chunk-EAQJ3OP2.js → chunk-UIHG7MJY.js} +2 -2
- package/dist/{chunk-5X3N6AZP.js → chunk-V6ABNI4V.js} +2 -2
- package/dist/{chunk-PZSUMAJA.js → chunk-V7Z5RKSZ.js} +2 -2
- package/dist/chunk-VI7SAKRI.js +82 -0
- package/dist/{chunk-XMDARS6Z.js → chunk-VJDVYESQ.js} +2 -2
- package/dist/{chunk-4FPAKI7C.js → chunk-WIMNMYJZ.js} +2 -2
- package/dist/{chunk-UJ6DPS4B.js → chunk-WNCAJR6C.js} +2 -2
- package/dist/chunk-WWR2XBXR.js +4 -0
- package/dist/{chunk-YGQHHRX3.js → chunk-WZXSZF5H.js} +2 -2
- package/dist/{chunk-B63EVTK3.js → chunk-XFJ6IA6A.js} +2 -2
- package/dist/{chunk-GRHGF46X.js → chunk-XKMV6M6E.js} +2 -2
- package/dist/{chunk-FR6GPITJ.js → chunk-XMPFPQR7.js} +2 -2
- package/dist/{chunk-O76M2QHE.js → chunk-YJNUGHQC.js} +2 -2
- package/dist/{chunk-WP5YT7VS.js → chunk-YXHHBENO.js} +2 -2
- package/dist/{chunk-UT262DG6.js → chunk-ZDES3QTI.js} +2 -2
- package/dist/{chunk-KQ3OMGNX.js → chunk-ZIQQKTQL.js} +2 -2
- package/dist/{chunk-F4IMOZQW.js → chunk-ZUL6VITT.js} +2 -2
- package/dist/clean-UMHA2CZW.js +8 -0
- package/dist/close_out-6QIFICEY.js +8 -0
- package/dist/code-KPLG4S4Q.js +4 -0
- package/dist/{config-OHK7YXIF.js → config-GFQPPHSQ.js} +2 -2
- package/dist/{connect-P23ZRHED.js → connect-LUMP5WGL.js} +2 -2
- package/dist/{daemon-2EIJPAZM.js → daemon-2GYHL7NR.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-E2F2QASJ.js → detect-YLGSUUK6.js} +2 -2
- package/dist/{down-6RCGHBG2.js → down-GCO7CXP2.js} +3 -3
- package/dist/{fixture-XFOURTGK.js → fixture-3PYLA2QP.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-A2N7MOHQ.js +4 -0
- package/dist/{hooks_gen-LIAHG2UF.js → hooks_gen-33QXMNK3.js} +2 -2
- package/dist/infra-BJBFWNYC.js +4 -0
- package/dist/init_workspace-KNZPCZ7S.js +4 -0
- package/dist/{intercept-C255V2OV.js → intercept-V4WSD2HC.js} +2 -2
- package/dist/{issue-RJLHB4VC.js → issue-KSQLNFFN.js} +2 -2
- package/dist/lib/agent_state.js +1 -1
- package/dist/lib/gate.js +1 -1
- package/dist/lib/pr_guard.js +1 -1
- package/dist/list_workspaces-OSB3UOFL.js +7 -0
- package/dist/logs-AXUBC2A5.js +6 -0
- package/dist/main.js +4 -4
- package/dist/mcp-proxy.js +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{migrate-Y76LMJRA.js → migrate-M6L2DJNT.js} +2 -2
- package/dist/notes-LYRXRKH6.js +4 -0
- package/dist/{open-UFINFQTM.js → open-EC7WIO6M.js} +2 -2
- package/dist/{optimize-OFAEZOA3.js → optimize-EZQC25XK.js} +2 -2
- package/dist/pause-3E3MFPFK.js +4 -0
- package/dist/pr-XWM6Z626.js +5 -0
- package/dist/proxy_reload-FFFETHCF.js +6 -0
- package/dist/{registry-QM5A4VPM.js → registry-NTJQLH6O.js} +2 -2
- package/dist/remove-WJQRF6YC.js +7 -0
- package/dist/remove_workspace-L7636Q7E.js +8 -0
- package/dist/restart-DBUOKL72.js +8 -0
- package/dist/resume-37G4RFXR.js +8 -0
- package/dist/{safari-5WV7JRN4.js → safari-KIIBWIP4.js} +2 -2
- package/dist/{sandbox-GXF43IY4.js → sandbox-W5W6PZP2.js} +2 -2
- package/dist/{services-6DREGT73.js → services-YOJGXYRZ.js} +2 -2
- package/dist/{setup-VODRPG5U.js → setup-PMD3POPQ.js} +2 -2
- package/dist/skills-GNYIC2MO.js +4 -0
- package/dist/{slots-WG2LH372.js → slots-C7ZEGGJ4.js} +2 -2
- package/dist/{standards-XXNNGBGT.js → standards-GRSOC6KW.js} +2 -2
- package/dist/start_args-LH56QN7T.js +4 -0
- package/dist/starting_prompt-4YEXCGD3.js +4 -0
- package/dist/stats-XWSD26T3.js +4 -0
- package/dist/{status-LUGHPZ2I.js → status-MFH7DYEC.js} +2 -2
- package/dist/{stop-UTIAHN4W.js → stop-HR4IXTQF.js} +2 -2
- package/dist/{telepresence-5NETEVMM.js → telepresence-R5BVS2K3.js} +2 -2
- package/dist/{test-XHXO7IVL.js → test-2YV4BCIU.js} +2 -2
- package/dist/{tokens-WLASHMKS.js → tokens-SPHIRGGH.js} +2 -2
- package/dist/{up-ODVE35OY.js → up-JBNSO2TH.js} +3 -3
- package/dist/{v4-V57BX2LR.js → v4-VGZU4RUI.js} +2 -2
- package/dist/wait_load-FRLSYOSG.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-R6NV7VSO.js → workspace-77ZSJKH6.js} +2 -2
- package/man/werkmeister-pr.1 +1 -1
- package/package.json +3 -3
- package/dist/chunk-ID5DURPG.js +0 -4
- package/dist/chunk-ZH3PHAJR.js +0 -82
- package/dist/chunk-ZTFZLNXX.js +0 -111
- package/dist/clean-RJ3UU47I.js +0 -8
- package/dist/close_out-XIQZEV4X.js +0 -8
- package/dist/code-45HVFOAZ.js +0 -4
- package/dist/hooks-BKAQWOPG.js +0 -4
- package/dist/infra-5O4SJKCC.js +0 -4
- package/dist/init_workspace-JHW77HJE.js +0 -4
- package/dist/list_workspaces-2ZIAWC44.js +0 -7
- package/dist/logs-NZDOMMJL.js +0 -6
- package/dist/notes-EEC3POAG.js +0 -4
- package/dist/pause-D7E4JCRV.js +0 -4
- package/dist/pr-XXYDX2GP.js +0 -5
- package/dist/proxy_reload-M7ZPWN7G.js +0 -6
- package/dist/remove-J5VGVFAF.js +0 -7
- package/dist/remove_workspace-ZTYN732K.js +0 -8
- package/dist/restart-PPKQGQ6V.js +0 -8
- package/dist/resume-67ZGI4WD.js +0 -8
- package/dist/skills-IB6LCOBR.js +0 -4
- package/dist/start_args-6MQ5NNOP.js +0 -4
- package/dist/starting_prompt-ZBOK5FP4.js +0 -4
- package/dist/stats-NCDLCTRZ.js +0 -4
- package/dist/wait_load-DPC7TY2Z.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{c as v,k as L}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=budget-
|
|
3
|
+
import{c as v,k as L}from"./chunk-5RTBQAT7.js";import"./chunk-NWLMPCZE.js";import"./chunk-UIHG7MJY.js";import"./chunk-ZIQQKTQL.js";import"./chunk-WZXSZF5H.js";import"./chunk-CYUCIEOU.js";import"./chunk-FQRFNYV3.js";import"./chunk-YXHHBENO.js";import"./chunk-2YAWKN4B.js";import"./chunk-WIMNMYJZ.js";import"./chunk-FCE6GV5P.js";import"./chunk-MO2LKTAN.js";import"./chunk-V6ABNI4V.js";import"./chunk-RAHGSCT6.js";import"./chunk-GK2EJLFI.js";import"./chunk-VI7SAKRI.js";import"./chunk-RXOXD4KA.js";import"./chunk-T7GQISYS.js";import{B as h,C as w,I as b,L as y,Q as k,v as f,w as $}from"./chunk-4SK2WDFU.js";import"./chunk-4ADQJ3NO.js";import"./chunk-6EEGEZLE.js";import"./chunk-AXMV4XZL.js";import"./chunk-6MPWPONJ.js";import{o as d}from"./chunk-ER73PEUY.js";import"./chunk-A7TH7DWD.js";import"./chunk-IAXCJW3Y.js";import"./chunk-ZDES3QTI.js";import"./chunk-CMXQQKD3.js";import"./chunk-67CKCUOX.js";import"./chunk-EP6B44PA.js";import"./chunk-K4ZH6HZB.js";import"./chunk-NILGDPG6.js";import{a as c,f as g}from"./chunk-ZUL6VITT.js";g();import N from"node:os";var M=2**30,x=c((r,t)=>Number.isFinite(r)?`${Number(r.toFixed(1))}${t}`:"no limit","limit");async function P(r){let t=await h(),m=w(N.cpus().length),u=$(),l=await k(),n=L(),a=f(y(l,n??[])).map((o,e)=>{let s=u[o.feature]?.workspace,i=s&&d(s)?.services||null,B=s?b(s,i??void 0):null;return{...o,position:e+1,services:i,cost:B}});if(r.json){let o=c(e=>Number.isFinite(e)?e:null,"n");console.log(JSON.stringify({budget:{memory:o(t.memory),cpus:o(t.cpus),preempt:t.preempt},host_load:m,leases:u,waiting:l,running:n?.map(e=>({feature:e.feature,cpus:e.cost.cpus,memory:e.cost.memory,rank:e.rank,busy:e.busy}))??null,waiters:a.map(e=>({feature:e.feature,position:e.position,services:e.services,cpus:e.cost?.cpus??null,memory:e.cost?.memory??null,waited_ms:e.waitedMs,gate:e.gate}))}));return}console.log(`Budget: ${x(t.memory/M," GiB")} memory, ${x(t.cpus," CPUs")}, host load ${m||"unchecked"}, preemption ${t.preempt?"on":"off"}`);let p=Object.entries(u).sort(([,o],[,e])=>o.slot-e.slot);console.log(p.length?"Slots:":"Slots: none held");for(let[o,e]of p)console.log(` ${e.slot} ${o}${e.workspace?` ${e.workspace}`:""}`);console.log(n?n.length?"Running:":"Running: none":"Running: docker unavailable");for(let o of[...n??[]].sort((e,s)=>s.cost.cpus-e.cost.cpus))console.log(` ${v(o)}`);console.log(a.length?"Waiting:":"Waiting: none");for(let o of a){let e=o.services?`${o.services.join(", ")}${o.gate?" for a running feature":""}`:"whole feature",s=o.cost?` (${Number(o.cost.cpus.toFixed(1))} CPUs, ${(o.cost.memory/M).toFixed(1)} GiB)`:"",i=o.waitedMs?` waited ${Math.round(o.waitedMs/6e4)} min${o.position===1&&o.waitedMs>=3e5?", gets the next free room":""}`:"";console.log(` ${o.position}. ${o.feature} ${e}${s}${i}`)}}c(P,"run");export{P as run};
|
|
4
|
+
//# sourceMappingURL=budget-PGVVUWSC.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import"./chunk-
|
|
4
|
-
//# sourceMappingURL=cache-
|
|
3
|
+
import"./chunk-WWR2XBXR.js";import{c as s}from"./chunk-CYUCIEOU.js";import"./chunk-RAHGSCT6.js";import"./chunk-4ADQJ3NO.js";import"./chunk-AXMV4XZL.js";import"./chunk-EP6B44PA.js";import{h as e,l as c}from"./chunk-K4ZH6HZB.js";import"./chunk-NILGDPG6.js";import{a as r,f as i}from"./chunk-ZUL6VITT.js";i();async function u(o){o.action!=="prune"&&(c(`Unknown action \`${String(o.action)}\` \u2014 the only action is \`prune\`.`),process.exit(2));let t=await s({name:typeof o.name=="string"?o.name:void 0,reset:!!o.reset,force:!!o.force,dryRun:!!o.dry_run});t.length||console.log("No caches in the registry.");for(let n of t){let a=n.ok?`${e.GREEN}\u2713${e.RESET}`:`${e.RED}\u2717${e.RESET}`;console.log(`${a} ${n.name} (${n.action}): ${n.detail}`)}t.some(n=>!n.ok)&&process.exit(1)}r(u,"run");export{u as run};
|
|
4
|
+
//# sourceMappingURL=cache-VT7GBHR2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{h as Ze}from"./chunk-
|
|
3
|
+
import{h as Ze}from"./chunk-WIMNMYJZ.js";import{b as ne}from"./chunk-MO2LKTAN.js";import{h as te}from"./chunk-V6ABNI4V.js";import{c as Xe,e as Ye,f as Ve,g as Qe,i as ze}from"./chunk-RAHGSCT6.js";import{C as oe,D as et,E as se,G as tt,H as re,_ as nt,b as T,c as F,d as We,da as ie,e as Ge,f as Ke,g as qe,i as I}from"./chunk-GK2EJLFI.js";import{a as Re,b as U,e as Ue,h as Fe,j as Le,k as S}from"./chunk-AXMV4XZL.js";import{c as Je,e as He}from"./chunk-ER73PEUY.js";import{b as R,c as je}from"./chunk-ZDES3QTI.js";import{b as Be,c as k}from"./chunk-EP6B44PA.js";import{G as Ie,M as Pe,R as De,S as Me,j as be,k as $e,l as C,t as Ne}from"./chunk-K4ZH6HZB.js";import{b as Te}from"./chunk-NILGDPG6.js";import{a as r,f as u}from"./chunk-ZUL6VITT.js";u();import*as m from"node:fs";import*as f from"node:path";u();var Jt=["mcp__plugin_werkmeister_werkmeister__"],ae=r(e=>Jt.map(t=>`${t}${e}`),"pluginTool"),Ht=["werkmeister","w9r"],_=r(e=>Ht.map(t=>`Bash(${t} ${e})`),"cli"),L=["Bash(git -c:*)","Bash(git config:*)",...["--config","--exec-path","--template"].flatMap(e=>[`Bash(git ${e}*)`,`Bash(git * ${e}*)`]),"Bash(git --git-dir*)","Bash(node:*)","Bash(python3:*)",...["proxy-reload","down","remove","remove-workspace","clean","setup","registry","connect","intercept","notes graduate","up infra","restart infra","stop infra","infra proxy-reload","feature down","infra down","feature drop","machine clean","machine setup","infra connect","infra intercept","workspace new","ws new","infra up","infra restart","infra stop","daemon install","daemon uninstall","daemon restart"].flatMap(e=>_(`${e}:*`)),...["stop","kill","rm","rmi","compose down","system prune","volume rm","network rm"].map(e=>`Bash(docker ${e}:*)`),...["npm","pnpm"].flatMap(e=>["publish","link","unlink","install -g","install --global","i -g","i --global","uninstall -g","uninstall --global"].map(t=>`Bash(${e} ${t}:*)`)),...["add -g","add --global","remove -g","remove --global"].map(e=>`Bash(pnpm ${e}:*)`),"Bash(gh pr merge:*)",...["kube-switch","up","stop","restart","down","create-workspace","create-workspace-form","pr-approve","ask-pr-review","claude-send","claude-resume","connect","proxy-reload","remove-service","intercept"].flatMap(ae)];u();import*as O from"node:fs";import*as G from"node:path";u();var W={id:"mcp",instructionsFile:"AGENTS.md",skillsDir:".agents/skills",hooks:{available:!1,reason:"a generic MCP harness has no hooks adapter; use harness: codex for Codex"},agents:!1,notice:r(()=>`
|
|
4
4
|
## Harness
|
|
5
5
|
|
|
6
6
|
This workspace was generated for the \`mcp\` harness. Werkmeister's tools come from the MCP server \`werkmeister\` at ${je()}/mcp (how to register it: docs/harnesses.md in the werkmeister repo). Hooks are unavailable on this harness: werkmeister's session-start context, standards gate, PR guard and agent state do not run here (Codex: use \`harness: codex\`). Open PRs only with \`werkmeister pr open\`.
|
|
@@ -143,4 +143,4 @@ export default {
|
|
|
143
143
|
`);return}m.rmSync(e,{force:!0});try{m.rmdirSync(f.dirname(e))}catch{}}r(Q,"_saveSettings");function z(e,t){let n=j(e),o=Oe(n);if(o===null)return n;"hooks"in o||(o.hooks={});let s=o.hooks;if(typeof s!="object"||s===null||Array.isArray(s))return n;for(let[a,i,c]of t)if(!Rn(s,a,i,c))return n;return Q(n,o),n}r(z,"_writeManaged");function tr(e){return z(e,[["SessionStart",Pn(),q],["PreToolUse",Dn(B(e)),X],["PreToolUse",Rt(),Y]])}r(tr,"writeWorkspaceHooks");function Mt(e){let t=B(e);return z(e,(t?$n:bn).map(n=>[n,Bn(t),V]))}r(Mt,"writeAgentStateHooks");function nr(e){return z(e,[["PreToolUse",Rt(),Y]])}r(nr,"writePrGuardHook");function or(e){return Ft(e,[["SessionStart",q],["PreToolUse",X]])}r(or,"removeWorkspaceHooks");function Bt(e,t){return t?z(e,[["SessionEnd",Mn(B(e)),K]]):(Ft(e,[["SessionEnd",K]]),j(e))}r(Bt,"writeAutoStopHook");function Ft(e,t){let n=j(e),o;try{o=JSON.parse(m.readFileSync(n,"utf8"))}catch{return[]}let s=o?.hooks;if(typeof s!="object"||s===null||Array.isArray(s))return[];let a=[];for(let[i,c]of t){let l=s[i];if(!Array.isArray(l))continue;let d=l.filter(h=>!Ut(h,c));for(let h of l)d.includes(h)||a.push(...h.hooks.map(p=>String(p.command)));d.length?s[i]=d:delete s[i]}return a.length?(Object.keys(s).length||delete o.hooks,Q(n,o),a):[]}r(Ft,"_removeManaged");var Un=["Bash(git diff:*)","Bash(git status:*)","Bash(git ls-files:*)"],jt=["Bash(git:*)",...["pr view","pr checks","pr diff","pr list","issue view","run view","run list"].map(e=>`Bash(gh ${e}:*)`),...["up","restart","feature up","feature restart"].flatMap(_),..._("feature up --service:*"),...["status","feature status","infra status","pr","issue view","issue start","init-workspace","workspace init","skills","standards","notes context"].flatMap(e=>_(`${e}:*`)),"Bash(docker ps:*)","Bash(claude plugin validate:*)","Bash(claude plugin test:*)",...["issue","issue-statuses","status","workspace-prs","kube-context","k8s-forwards-status"].flatMap(ae)];function Fn(e,t){return e?[...jt,...["up","restart","feature up","feature restart"].flatMap(n=>_(`${n} ${e}`)),..._(`feature up ${e} --service:*`),...["logs","test","services","feature logs","feature test","feature services"].flatMap(n=>_(`${n} ${e}:*`)),...t.flatMap(n=>[`Bash(docker logs ${e}-${n}:*)`,`Bash(docker restart ${e}-${n})`])]:jt}r(Fn,"autonomousRules");var Lt=r(e=>f.join(Te(e),"claude-permissions.json"),"permissionsRecord");function Ln(e,t,n,o,s="",a=[],i=[],c={}){let l=[],d=r(p=>p.split(/\s*&&\s*/).filter(Boolean),"segments");for(let p of[...t,...i]){let w=Xe(p,n[p],o);if(!w||(t.includes(p)&&(l.push(`Bash(${Ye(e,p,w)})`),Ve(w)&&l.push(...d(w).map(g=>`Bash(${g}:*)`))),!s))continue;let y=c[String(n[p]?.repo??"")]?.lint,E=Qe(s,w,y);l.push(E.startsWith(`${s} sh -c '`)?`Bash(${E})`:`Bash(${E}:*)`)}if(s)for(let p of a)l.push(`Bash(${s} ${p}:*)`);s&&a.length&&l.push(`Bash(${f.join(f.dirname(s),"with-fixture-workspace")}:*)`);let h=`Bash(${s} `;return s&&l.push(...l.filter(p=>p.startsWith(h)).map(p=>`${h}--no-wait ${p.slice(h.length)}`)),[...new Set([...l,...Un])]}r(Ln,"buildAllowRules");function Wn(e){let t;try{t=m.readFileSync(f.join(e,".env"),"utf8")}catch{return{}}let n={};for(let o of t.split(`
|
|
144
144
|
`)){let s=o.indexOf("=");s>0&&(n[o.slice(0,s).trim()]=o.slice(s+1).trim())}return n}r(Wn,"_readEnv");function Gn(e,t=oe(e)){let n=Wn(e),o=n.FEATURE??"",s=(n.SERVICES??"").split(",").map(g=>g.trim()).filter(Boolean),a=ne(e),i=Wt(e),c=te(e).map(g=>f.basename(g)),l=[],d={};try{(c.length||s.length)&&(d=De(),l=ze(c,d))}catch{}let h=l.filter(g=>!s.includes(g)),p=s.length>0||h.length>0,w=Ln(p?o:"",s,p?Pe():{},p?Me():{},a,i,h,d);if(w.push(...et(e).flatMap(_)),!t)return w;let y=Ie(),E=c.flatMap(g=>Ze(v=>m.existsSync(f.join(y,g,v))).map(v=>`Bash(${v})`));return[...new Set([...w,...Fn(o,s),...E])]}r(Gn,"workspaceAllowRules");function Wt(e){return te(e).map(t=>f.join(t,"apps","cli","werkmeister")).filter(t=>m.existsSync(t))}r(Wt,"builtCliWrappers");function Jn(e){let t=ne(e),n=[`Bash(${t} env WERKMEISTER_ROOT=* node --test*)`,`Bash(${t} --no-wait env WERKMEISTER_ROOT=* node --test*)`,`Bash(${t} node --test*)`,`Bash(${t} --no-wait node --test*)`,`Bash(docker exec * ${t} node --test*)`,`Bash(docker exec * ${t} --no-wait node --test*)`],o=Wt(e);if(!o.length)return n;let s=f.join(f.dirname(t),"with-fixture-workspace");return[`Bash(${s} --exec-runs:*)`,`Bash(${s} --no-wait --exec-runs:*)`,...o.flatMap(a=>[`Bash(${t} ${a} internal fixture --exec-runs:*)`,`Bash(${t} --no-wait ${a} internal fixture --exec-runs:*)`]),...n]}r(Jn,"workspaceAskRules");function Hn(e,t=oe(e)){return t?L:[]}r(Hn,"workspaceDenyRules");var _e=r(e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[],"_strings");function ve(e){try{let t=JSON.parse(m.readFileSync(e,"utf8"));return Ae(t)?{allow:_e(t.allow),deny:_e(t.deny),ask:_e(t.ask),model:typeof t.model=="string"?t.model:null}:{allow:[],deny:[],ask:[],model:null}}catch{return{allow:[],deny:[],ask:[],model:null}}}r(ve,"_readRecord");function Ee(e,t){let n={...t.allow.length?{allow:t.allow}:{},...t.deny.length?{deny:t.deny}:{},...t.ask.length?{ask:t.ask}:{},...t.model?{model:t.model}:{}},o=ve(e);JSON.stringify(t)!==JSON.stringify(o)&&(Object.keys(n).length?(m.mkdirSync(f.dirname(e),{recursive:!0}),m.writeFileSync(e,`${JSON.stringify(n,null,2)}
|
|
145
145
|
`)):m.rmSync(e,{force:!0}))}r(Ee,"_writeRecord");function Gt(e,t,n=[],o=[]){let s=j(e),a=Oe(s);if(a===null)return s;let i=a.permissions??{};if(!Ae(i))return s;let c={allow:t,deny:n,ask:o},l=["allow","deny","ask"];if(l.some(y=>!Array.isArray(i[y]??[])))return s;let d=Lt(e),h=ve(d),p={...h},w=!1;for(let y of l){let E=i[y]??[],g=new Set(h[y]),v=[...new Set(c[y])],Z=E.filter(A=>!(typeof A=="string"&&g.has(A)&&!v.includes(A))),ee=v.filter(A=>!Z.includes(A));if(p[y]=v.filter(A=>g.has(A)||ee.includes(A)),Z.length===E.length&&!ee.length)continue;w=!0;let Ce=[...Z,...ee];Ce.length?i[y]=Ce:delete i[y]}return w&&(Object.keys(i).length?a.permissions=i:delete a.permissions,Q(s,a)),Ee(d,p),s}r(Gt,"writeWorkspacePermissions");function sr(e){return Gt(e,[],[],[])}r(sr,"removeWorkspacePermissions");function Kn(e,t){let n=j(e),o=Oe(n);if(o===null)return n;let s=Lt(e),a=ve(s),i=o.model;return i!==void 0&&i!==a.model?(Ee(s,{...a,model:null}),n):(i!==(t??void 0)&&(t?o.model=t:delete o.model,Q(n,o)),Ee(s,{...a,model:t}),n)}r(Kn,"writeWorkspaceModel");function rr(e){if(B(e)){Bt(e,se(e)),Mt(e),rt(e),be(`codex: trust this folder in Codex, approve its hooks with /hooks, and start it as \`${P}\` (docs/harnesses.md \xA7 Codex)`);return}Gt(e,Gn(e),Hn(e),Jn(e)),Kn(e,tt(e)),Bt(e,se(e)),Mt(e)}r(rr,"writeWorkspaceSettings");export{L as a,P as b,Dt as c,ke as d,Sn as e,Fs as f,Ls as g,En as h,An as i,On as j,vn as k,Cn as l,Tn as m,bn as n,$n as o,Pn as p,Dn as q,Rt as r,Mn as s,Bn as t,tr as u,Mt as v,nr as w,or as x,Bt as y,Un as z,jt as A,Fn as B,Ln as C,Gn as D,Jn as E,Hn as F,Gt as G,sr as H,Kn as I,rr as J};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-2YAWKN4B.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{l as cr,m as hr}from"./chunk-X57IXE7Q.js";import{b as or,c as ar,d as sr,e as ur,f as fr,g as lr}from"./chunk-ULNRIE5C.js";import{a as i,b as L,c as S,e as Pi,f as c}from"./chunk-F4IMOZQW.js";var mr=S((Gs,vr)=>{"use strict";c();var C=L("fs"),re=L("path"),ki=C.lchown?"lchown":"chown",Ni=C.lchownSync?"lchownSync":"chownSync",pr=C.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),dr=i((e,t,r)=>{try{return C[Ni](e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"lchownSync"),Mi=i((e,t,r)=>{try{return C.chownSync(e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"chownSync"),Ai=pr?(e,t,r,n)=>o=>{!o||o.code!=="EISDIR"?n(o):C.chown(e,t,r,n)}:(e,t,r,n)=>n,ht=pr?(e,t,r)=>{try{return dr(e,t,r)}catch(n){if(n.code!=="EISDIR")throw n;Mi(e,t,r)}}:(e,t,r)=>dr(e,t,r),Di=process.version,yr=i((e,t,r)=>C.readdir(e,t,r),"readdir"),qi=i((e,t)=>C.readdirSync(e,t),"readdirSync");/^v4\./.test(Di)&&(yr=i((e,t,r)=>C.readdir(e,r),"readdir"));var Be=i((e,t,r,n)=>{C[ki](e,t,r,Ai(e,t,r,o=>{n(o&&o.code!=="ENOENT"?o:null)}))},"chown"),gr=i((e,t,r,n,o)=>{if(typeof t=="string")return C.lstat(re.resolve(e,t),(a,s)=>{if(a)return o(a.code!=="ENOENT"?a:null);s.name=t,gr(e,s,r,n,o)});if(t.isDirectory())dt(re.resolve(e,t.name),r,n,a=>{if(a)return o(a);let s=re.resolve(e,t.name);Be(s,r,n,o)});else{let a=re.resolve(e,t.name);Be(a,r,n,o)}},"chownrKid"),dt=i((e,t,r,n)=>{yr(e,{withFileTypes:!0},(o,a)=>{if(o){if(o.code==="ENOENT")return n();if(o.code!=="ENOTDIR"&&o.code!=="ENOTSUP")return n(o)}if(o||!a.length)return Be(e,t,r,n);let s=a.length,u=null,f=i(l=>{if(!u){if(l)return n(u=l);if(--s===0)return Be(e,t,r,n)}},"then");a.forEach(l=>gr(e,l,t,r,f))})},"chownr"),Ii=i((e,t,r,n)=>{if(typeof t=="string")try{let o=C.lstatSync(re.resolve(e,t));o.name=t,t=o}catch(o){if(o.code==="ENOENT")return;throw o}t.isDirectory()&&_r(re.resolve(e,t.name),r,n),ht(re.resolve(e,t.name),r,n)},"chownrKidSync"),_r=i((e,t,r)=>{let n;try{n=qi(e,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return;if(o.code==="ENOTDIR"||o.code==="ENOTSUP")return ht(e,t,r);throw o}return n&&n.length&&n.forEach(o=>Ii(e,o,t,r)),ht(e,t,r)},"chownrSync");vr.exports=dt;dt.sync=_r});var pt=S((Ys,wr)=>{c();wr.exports=L("stream")});var Or=S((Js,Tr)=>{"use strict";c();function br(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}i(br,"ownKeys");function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?br(Object(r),!0).forEach(function(n){Ci(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):br(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(Er,"_objectSpread");function Ci(e,t,r){return t=Rr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(Ci,"_defineProperty");function ji(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i(ji,"_classCallCheck");function Sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rr(n.key),n)}}i(Sr,"_defineProperties");function Bi(e,t,r){return t&&Sr(e.prototype,t),r&&Sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}i(Bi,"_createClass");function Rr(e){var t=Fi(e,"string");return typeof t=="symbol"?t:String(t)}i(Rr,"_toPropertyKey");function Fi(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(Fi,"_toPrimitive");var Ui=L("buffer"),Fe=Ui.Buffer,Wi=L("util"),yt=Wi.inspect,Hi=yt&&yt.custom||"inspect";function $i(e,t,r){Fe.prototype.copy.call(e,t,r)}i($i,"copyBuffer");Tr.exports=function(){function e(){ji(this,e),this.head=null,this.tail=null,this.length=0}return i(e,"BufferList"),Bi(e,[{key:"push",value:i(function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},"push")},{key:"unshift",value:i(function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},"unshift")},{key:"shift",value:i(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:i(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:i(function(r){if(this.length===0)return"";for(var n=this.head,o=""+n.data;n=n.next;)o+=r+n.data;return o},"join")},{key:"concat",value:i(function(r){if(this.length===0)return Fe.alloc(0);for(var n=Fe.allocUnsafe(r>>>0),o=this.head,a=0;o;)$i(o.data,n,a),a+=o.data.length,o=o.next;return n},"concat")},{key:"consume",value:i(function(r,n){var o;return r<this.head.data.length?(o=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?o=this.shift():o=n?this._getString(r):this._getBuffer(r),o},"consume")},{key:"first",value:i(function(){return this.head.data},"first")},{key:"_getString",value:i(function(r){var n=this.head,o=1,a=n.data;for(r-=a.length;n=n.next;){var s=n.data,u=r>s.length?s.length:r;if(u===s.length?a+=s:a+=s.slice(0,r),r-=u,r===0){u===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(u));break}++o}return this.length-=o,a},"_getString")},{key:"_getBuffer",value:i(function(r){var n=Fe.allocUnsafe(r),o=this.head,a=1;for(o.data.copy(n),r-=o.data.length;o=o.next;){var s=o.data,u=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,u),r-=u,r===0){u===s.length?(++a,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=s.slice(u));break}++a}return this.length-=a,n},"_getBuffer")},{key:Hi,value:i(function(r,n){return yt(this,Er(Er({},n),{},{depth:0,customInspect:!1}))},"value")}]),e}()});var _t=S((eu,Lr)=>{"use strict";c();function zi(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(gt,this,e)):process.nextTick(gt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(Ue,r):(r._writableState.errorEmitted=!0,process.nextTick(xr,r,a)):process.nextTick(xr,r,a):t?(process.nextTick(Ue,r),t(a)):process.nextTick(Ue,r)}),this)}i(zi,"destroy");function xr(e,t){gt(e,t),Ue(e)}i(xr,"emitErrorAndCloseNT");function Ue(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}i(Ue,"emitCloseNT");function Gi(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}i(Gi,"undestroy");function gt(e,t){e.emit("error",t)}i(gt,"emitErrorNT");function Vi(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}i(Vi,"errorOrDestroy");Lr.exports={destroy:zi,undestroy:Gi,errorOrDestroy:Vi}});var K=S((nu,Nr)=>{"use strict";c();var kr={};function j(e,t,r){r||(r=Error);function n(a,s,u){return typeof t=="string"?t:t(a,s,u)}i(n,"getMessage");class o extends r{static{i(this,"NodeError")}constructor(s,u,f){super(n(s,u,f))}}o.prototype.name=r.name,o.prototype.code=e,kr[e]=o}i(j,"createErrorType");function Pr(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}i(Pr,"oneOf");function Ki(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}i(Ki,"startsWith");function Yi(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}i(Yi,"endsWith");function Xi(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}i(Xi,"includes");j("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);j("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&Ki(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let o;if(Yi(e," argument"))o=`The ${e} ${n} ${Pr(t,"type")}`;else{let a=Xi(e,".")?"property":"argument";o=`The "${e}" ${a} ${n} ${Pr(t,"type")}`}return o+=`. Received type ${typeof r}`,o},TypeError);j("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");j("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});j("ERR_STREAM_PREMATURE_CLOSE","Premature close");j("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});j("ERR_MULTIPLE_CALLBACK","Callback called multiple times");j("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");j("ERR_STREAM_WRITE_AFTER_END","write after end");j("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);j("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);j("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Nr.exports.codes=kr});var vt=S((au,Mr)=>{"use strict";c();var Ji=K().codes.ERR_INVALID_OPT_VALUE;function Zi(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}i(Zi,"highWaterMarkFrom");function Qi(e,t,r,n){var o=Zi(t,n,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=n?r:"highWaterMark";throw new Ji(a,o)}return Math.floor(o)}return e.objectMode?16:16*1024}i(Qi,"getHighWaterMark");Mr.exports={getHighWaterMark:Qi}});var Ar=S((fu,mt)=>{c();typeof Object.create=="function"?mt.exports=i(function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):mt.exports=i(function(t,r){if(r){t.super_=r;var n=i(function(){},"TempCtor");n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}},"inherits")});var Y=S((hu,bt)=>{c();try{if(wt=L("util"),typeof wt.inherits!="function")throw"";bt.exports=wt.inherits}catch{bt.exports=Ar()}var wt});var qr=S((pu,Dr)=>{c();Dr.exports=L("util").deprecate});var Rt=S((gu,Ur)=>{"use strict";c();Ur.exports=k;function Cr(e){var t=this;this.next=null,this.entry=null,this.finish=function(){xo(t,e)}}i(Cr,"CorkedRequest");var le;k.WritableState=Ee;var eo={deprecate:qr()},jr=pt(),He=L("buffer").Buffer,to=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ro(e){return He.from(e)}i(ro,"_uint8ArrayToBuffer");function no(e){return He.isBuffer(e)||e instanceof to}i(no,"_isUint8Array");var St=_t(),io=vt(),oo=io.getHighWaterMark,X=K().codes,ao=X.ERR_INVALID_ARG_TYPE,so=X.ERR_METHOD_NOT_IMPLEMENTED,uo=X.ERR_MULTIPLE_CALLBACK,fo=X.ERR_STREAM_CANNOT_PIPE,lo=X.ERR_STREAM_DESTROYED,co=X.ERR_STREAM_NULL_VALUES,ho=X.ERR_STREAM_WRITE_AFTER_END,po=X.ERR_UNKNOWN_ENCODING,ce=St.errorOrDestroy;Y()(k,jr);function yo(){}i(yo,"nop");function Ee(e,t,r){le=le||ne(),e=e||{},typeof r!="boolean"&&(r=t instanceof le),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=oo(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){Eo(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Cr(this)}i(Ee,"WritableState");Ee.prototype.getBuffer=i(function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r},"getBuffer");(function(){try{Object.defineProperty(Ee.prototype,"buffer",{get:eo.deprecate(i(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var We;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(We=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:i(function(t){return We.call(this,t)?!0:this!==k?!1:t&&t._writableState instanceof Ee},"value")})):We=i(function(t){return t instanceof this},"realHasInstance");function k(e){le=le||ne();var t=this instanceof le;if(!t&&!We.call(k,this))return new k(e);this._writableState=new Ee(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),jr.call(this)}i(k,"Writable");k.prototype.pipe=function(){ce(this,new fo)};function go(e,t){var r=new ho;ce(e,r),process.nextTick(t,r)}i(go,"writeAfterEnd");function _o(e,t,r,n){var o;return r===null?o=new co:typeof r!="string"&&!t.objectMode&&(o=new ao("chunk",["string","Buffer"],r)),o?(ce(e,o),process.nextTick(n,o),!1):!0}i(_o,"validChunk");k.prototype.write=function(e,t,r){var n=this._writableState,o=!1,a=!n.objectMode&&no(e);return a&&!He.isBuffer(e)&&(e=ro(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=yo),n.ending?go(this,r):(a||_o(this,n,e,r))&&(n.pendingcb++,o=mo(this,n,a,e,t,r)),o};k.prototype.cork=function(){this._writableState.corked++};k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&Br(this,e))};k.prototype.setDefaultEncoding=i(function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new po(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:i(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function vo(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=He.from(t,r)),t}i(vo,"decodeChunk");Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});function mo(e,t,r,n,o,a){if(!r){var s=vo(t,n,o);n!==s&&(r=!0,o="buffer",n=s)}var u=t.objectMode?1:n.length;t.length+=u;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Et(e,t,!1,u,n,o,a);return f}i(mo,"writeOrBuffer");function Et(e,t,r,n,o,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new lo("write")):r?e._writev(o,t.onwrite):e._write(o,a,t.onwrite),t.sync=!1}i(Et,"doWrite");function wo(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(be,e,t),e._writableState.errorEmitted=!0,ce(e,n)):(o(n),e._writableState.errorEmitted=!0,ce(e,n),be(e,t))}i(wo,"onwriteError");function bo(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}i(bo,"onwriteStateUpdate");function Eo(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if(typeof o!="function")throw new uo;if(bo(r),t)wo(e,r,n,t,o);else{var a=Fr(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Br(e,r),n?process.nextTick(Ir,e,r,a,o):Ir(e,r,a,o)}}i(Eo,"onwrite");function Ir(e,t,r,n){r||So(e,t),t.pendingcb--,n(),be(e,t)}i(Ir,"afterWrite");function So(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}i(So,"onwriteDrain");function Br(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,Et(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Cr(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,l=r.encoding,g=r.callback,d=t.objectMode?1:f.length;if(Et(e,t,!1,d,f,l,g),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}i(Br,"clearBuffer");k.prototype._write=function(e,t,r){r(new so("_write()"))};k.prototype._writev=null;k.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||Oo(this,n,r),this};Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:i(function(){return this._writableState.length},"get")});function Fr(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}i(Fr,"needFinish");function Ro(e,t){e._final(function(r){t.pendingcb--,r&&ce(e,r),t.prefinished=!0,e.emit("prefinish"),be(e,t)})}i(Ro,"callFinal");function To(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(Ro,e,t)):(t.prefinished=!0,e.emit("prefinish")))}i(To,"prefinish");function be(e,t){var r=Fr(t);if(r&&(To(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}i(be,"finishMaybe");function Oo(e,t,r){t.ending=!0,be(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}i(Oo,"endWritable");function xo(e,t,r){var n=e.entry;for(e.entry=null;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}i(xo,"onCorkedFinish");Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:i(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")});k.prototype.destroy=St.destroy;k.prototype._undestroy=St.undestroy;k.prototype._destroy=function(e,t){t(e)}});var ne=S((mu,Hr)=>{"use strict";c();var Lo=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Hr.exports=U;var Wr=xt(),Ot=Rt();Y()(U,Wr);for(Tt=Lo(Ot.prototype),$e=0;$e<Tt.length;$e++)ze=Tt[$e],U.prototype[ze]||(U.prototype[ze]=Ot.prototype[ze]);var Tt,ze,$e;function U(e){if(!(this instanceof U))return new U(e);Wr.call(this,e),Ot.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Po)))}i(U,"Duplex");Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(U.prototype,"writableBuffer",{enumerable:!1,get:i(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(U.prototype,"writableLength",{enumerable:!1,get:i(function(){return this._writableState.length},"get")});function Po(){this._writableState.ended||process.nextTick(ko,this)}i(Po,"onend");function ko(e){e.end()}i(ko,"onEndNT");Object.defineProperty(U.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:i(function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")})});var Gr=S((Lt,zr)=>{c();var Ge=L("buffer"),W=Ge.Buffer;function $r(e,t){for(var r in e)t[r]=e[r]}i($r,"copyProps");W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow?zr.exports=Ge:($r(Ge,Lt),Lt.Buffer=ie);function ie(e,t,r){return W(e,t,r)}i(ie,"SafeBuffer");ie.prototype=Object.create(W.prototype);$r(W,ie);ie.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return W(e,t,r)};ie.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=W(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};ie.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return W(e)};ie.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ge.SlowBuffer(e)}});var Nt=S(Kr=>{"use strict";c();var kt=Gr().Buffer,Vr=kt.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function No(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}i(No,"_normalizeEncoding");function Mo(e){var t=No(e);if(typeof t!="string"&&(kt.isEncoding===Vr||!Vr(e)))throw new Error("Unknown encoding: "+e);return t||e}i(Mo,"normalizeEncoding");Kr.StringDecoder=Se;function Se(e){this.encoding=Mo(e);var t;switch(this.encoding){case"utf16le":this.text=jo,this.end=Bo,t=4;break;case"utf8":this.fillLast=qo,t=4;break;case"base64":this.text=Fo,this.end=Uo,t=3;break;default:this.write=Wo,this.end=Ho;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=kt.allocUnsafe(t)}i(Se,"StringDecoder");Se.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Se.prototype.end=Co;Se.prototype.text=Io;Se.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Pt(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}i(Pt,"utf8CheckByte");function Ao(e,t,r){var n=t.length-1;if(n<r)return 0;var o=Pt(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||o===-2?0:(o=Pt(t[n]),o>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||o===-2?0:(o=Pt(t[n]),o>=0?(o>0&&(o===2?o=0:e.lastNeed=o-3),o):0))}i(Ao,"utf8CheckIncomplete");function Do(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}i(Do,"utf8CheckExtraBytes");function qo(e){var t=this.lastTotal-this.lastNeed,r=Do(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}i(qo,"utf8FillLast");function Io(e,t){var r=Ao(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}i(Io,"utf8Text");function Co(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}i(Co,"utf8End");function jo(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}i(jo,"utf16Text");function Bo(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}i(Bo,"utf16End");function Fo(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}i(Fo,"base64Text");function Uo(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}i(Uo,"base64End");function Wo(e){return e.toString(this.encoding)}i(Wo,"simpleWrite");function Ho(e){return e&&e.length?this.write(e):""}i(Ho,"simpleEnd")});var Ve=S((xu,Jr)=>{"use strict";c();var Yr=K().codes.ERR_STREAM_PREMATURE_CLOSE;function $o(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}i($o,"once");function zo(){}i(zo,"noop");function Go(e){return e.setHeader&&typeof e.abort=="function"}i(Go,"isRequest");function Xr(e,t,r){if(typeof t=="function")return Xr(e,null,t);t||(t={}),r=$o(r||zo);var n=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,a=i(function(){e.writable||u()},"onlegacyfinish"),s=e._writableState&&e._writableState.finished,u=i(function(){o=!1,s=!0,n||r.call(e)},"onfinish"),f=e._readableState&&e._readableState.endEmitted,l=i(function(){n=!1,f=!0,o||r.call(e)},"onend"),g=i(function(w){r.call(e,w)},"onerror"),d=i(function(){var w;if(n&&!f)return(!e._readableState||!e._readableState.ended)&&(w=new Yr),r.call(e,w);if(o&&!s)return(!e._writableState||!e._writableState.ended)&&(w=new Yr),r.call(e,w)},"onclose"),y=i(function(){e.req.on("finish",u)},"onrequest");return Go(e)?(e.on("complete",u),e.on("abort",d),e.req?y():e.on("request",y)):o&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",l),e.on("finish",u),t.error!==!1&&e.on("error",g),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",y),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",g),e.removeListener("close",d)}}i(Xr,"eos");Jr.exports=Xr});var Qr=S((ku,Zr)=>{"use strict";c();var Ke;function J(e,t,r){return t=Vo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(J,"_defineProperty");function Vo(e){var t=Ko(e,"string");return typeof t=="symbol"?t:String(t)}i(Vo,"_toPropertyKey");function Ko(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(Ko,"_toPrimitive");var Yo=Ve(),Z=Symbol("lastResolve"),oe=Symbol("lastReject"),Re=Symbol("error"),Ye=Symbol("ended"),ae=Symbol("lastPromise"),Mt=Symbol("handlePromise"),se=Symbol("stream");function Q(e,t){return{value:e,done:t}}i(Q,"createIterResult");function Xo(e){var t=e[Z];if(t!==null){var r=e[se].read();r!==null&&(e[ae]=null,e[Z]=null,e[oe]=null,t(Q(r,!1)))}}i(Xo,"readAndResolve");function Jo(e){process.nextTick(Xo,e)}i(Jo,"onReadable");function Zo(e,t){return function(r,n){e.then(function(){if(t[Ye]){r(Q(void 0,!0));return}t[Mt](r,n)},n)}}i(Zo,"wrapForNext");var Qo=Object.getPrototypeOf(function(){}),ea=Object.setPrototypeOf((Ke={get stream(){return this[se]},next:i(function(){var t=this,r=this[Re];if(r!==null)return Promise.reject(r);if(this[Ye])return Promise.resolve(Q(void 0,!0));if(this[se].destroyed)return new Promise(function(s,u){process.nextTick(function(){t[Re]?u(t[Re]):s(Q(void 0,!0))})});var n=this[ae],o;if(n)o=new Promise(Zo(n,this));else{var a=this[se].read();if(a!==null)return Promise.resolve(Q(a,!1));o=new Promise(this[Mt])}return this[ae]=o,o},"next")},J(Ke,Symbol.asyncIterator,function(){return this}),J(Ke,"return",i(function(){var t=this;return new Promise(function(r,n){t[se].destroy(null,function(o){if(o){n(o);return}r(Q(void 0,!0))})})},"_return")),Ke),Qo),ta=i(function(t){var r,n=Object.create(ea,(r={},J(r,se,{value:t,writable:!0}),J(r,Z,{value:null,writable:!0}),J(r,oe,{value:null,writable:!0}),J(r,Re,{value:null,writable:!0}),J(r,Ye,{value:t._readableState.endEmitted,writable:!0}),J(r,Mt,{value:i(function(a,s){var u=n[se].read();u?(n[ae]=null,n[Z]=null,n[oe]=null,a(Q(u,!1))):(n[Z]=a,n[oe]=s)},"value"),writable:!0}),r));return n[ae]=null,Yo(t,function(o){if(o&&o.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[oe];a!==null&&(n[ae]=null,n[Z]=null,n[oe]=null,a(o)),n[Re]=o;return}var s=n[Z];s!==null&&(n[ae]=null,n[Z]=null,n[oe]=null,s(Q(void 0,!0))),n[Ye]=!0}),t.on("readable",Jo.bind(null,n)),n},"createReadableStreamAsyncIterator");Zr.exports=ta});var nn=S((Au,rn)=>{"use strict";c();function en(e,t,r,n,o,a,s){try{var u=e[a](s),f=u.value}catch(l){r(l);return}u.done?t(f):Promise.resolve(f).then(n,o)}i(en,"asyncGeneratorStep");function ra(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function s(f){en(a,n,o,s,u,"next",f)}i(s,"_next");function u(f){en(a,n,o,s,u,"throw",f)}i(u,"_throw"),s(void 0)})}}i(ra,"_asyncToGenerator");function tn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}i(tn,"ownKeys");function na(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tn(Object(r),!0).forEach(function(n){ia(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(na,"_objectSpread");function ia(e,t,r){return t=oa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(ia,"_defineProperty");function oa(e){var t=aa(e,"string");return typeof t=="symbol"?t:String(t)}i(oa,"_toPropertyKey");function aa(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(aa,"_toPrimitive");var sa=K().codes.ERR_INVALID_ARG_TYPE;function ua(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new sa("iterable",["Iterable"],t);var o=new e(na({objectMode:!0},r)),a=!1;o._read=function(){a||(a=!0,s())};function s(){return u.apply(this,arguments)}i(s,"next");function u(){return u=ra(function*(){try{var f=yield n.next(),l=f.value,g=f.done;g?o.push(null):o.push(yield l)?s():a=!1}catch(d){o.destroy(d)}}),u.apply(this,arguments)}return i(u,"_next2"),o}i(ua,"from");rn.exports=ua});var xt=S((Cu,pn)=>{"use strict";c();pn.exports=R;var he;R.ReadableState=un;var Iu=L("events").EventEmitter,sn=i(function(t,r){return t.listeners(r).length},"EElistenerCount"),Oe=pt(),Xe=L("buffer").Buffer,fa=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function la(e){return Xe.from(e)}i(la,"_uint8ArrayToBuffer");function ca(e){return Xe.isBuffer(e)||e instanceof fa}i(ca,"_isUint8Array");var At=L("util"),m;At&&At.debuglog?m=At.debuglog("stream"):m=i(function(){},"debug");var ha=Or(),Ft=_t(),da=vt(),pa=da.getHighWaterMark,Je=K().codes,ya=Je.ERR_INVALID_ARG_TYPE,ga=Je.ERR_STREAM_PUSH_AFTER_EOF,_a=Je.ERR_METHOD_NOT_IMPLEMENTED,va=Je.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,de,Dt,qt;Y()(R,Oe);var Te=Ft.errorOrDestroy,It=["error","close","destroy","pause","resume"];function ma(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}i(ma,"prependListener");function un(e,t,r){he=he||ne(),e=e||{},typeof r!="boolean"&&(r=t instanceof he),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=pa(this,e,"readableHighWaterMark",r),this.buffer=new ha,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(de||(de=Nt().StringDecoder),this.decoder=new de(e.encoding),this.encoding=e.encoding)}i(un,"ReadableState");function R(e){if(he=he||ne(),!(this instanceof R))return new R(e);var t=this instanceof he;this._readableState=new un(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Oe.call(this)}i(R,"Readable");Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:i(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")});R.prototype.destroy=Ft.destroy;R.prototype._undestroy=Ft.undestroy;R.prototype._destroy=function(e,t){t(e)};R.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Xe.from(e,t),t=""),n=!0),fn(this,e,t,!1,n)};R.prototype.unshift=function(e){return fn(this,e,null,!0,!1)};function fn(e,t,r,n,o){m("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,Ea(e,a);else{var s;if(o||(s=wa(a,t)),s)Te(e,s);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Xe.prototype&&(t=la(t)),n)a.endEmitted?Te(e,new va):Ct(e,a,t,!0);else if(a.ended)Te(e,new ga);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Ct(e,a,t,!1):Bt(e,a)):Ct(e,a,t,!1)}else n||(a.reading=!1,Bt(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}i(fn,"readableAddChunk");function Ct(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Ze(e)),Bt(e,t)}i(Ct,"addChunk");function wa(e,t){var r;return!ca(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new ya("chunk",["string","Buffer","Uint8Array"],t)),r}i(wa,"chunkInvalid");R.prototype.isPaused=function(){return this._readableState.flowing===!1};R.prototype.setEncoding=function(e){de||(de=Nt().StringDecoder);var t=new de(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var on=1073741824;function ba(e){return e>=on?e=on:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}i(ba,"computeNewHighWaterMark");function an(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=ba(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}i(an,"howMuchToRead");R.prototype.read=function(e){m("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return m("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?jt(this):Ze(this),null;if(e=an(e,t),e===0&&t.ended)return t.length===0&&jt(this),null;var n=t.needReadable;m("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,m("length less than watermark",n)),t.ended||t.reading?(n=!1,m("reading or ended",n)):n&&(m("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=an(r,t)));var o;return e>0?o=hn(e,t):o=null,o===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&jt(this)),o!==null&&this.emit("data",o),o};function Ea(e,t){if(m("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Ze(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,ln(e)))}}i(Ea,"onEofChunk");function Ze(e){var t=e._readableState;m("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(m("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(ln,e))}i(Ze,"emitReadable");function ln(e){var t=e._readableState;m("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Ut(e)}i(ln,"emitReadable_");function Bt(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Sa,e,t))}i(Bt,"maybeReadMore");function Sa(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(m("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}i(Sa,"maybeReadMore_");R.prototype._read=function(e){Te(this,new _a("_read()"))};R.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,m("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=o?u:T;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",s);function s(b,p){m("onunpipe"),b===r&&p&&p.hasUnpiped===!1&&(p.hasUnpiped=!0,g())}i(s,"onunpipe");function u(){m("onend"),e.end()}i(u,"onend");var f=Ra(r);e.on("drain",f);var l=!1;function g(){m("cleanup"),e.removeListener("close",_),e.removeListener("finish",w),e.removeListener("drain",f),e.removeListener("error",y),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",T),r.removeListener("data",d),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}i(g,"cleanup"),r.on("data",d);function d(b){m("ondata");var p=e.write(b);m("dest.write",p),p===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&dn(n.pipes,e)!==-1)&&!l&&(m("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}i(d,"ondata");function y(b){m("onerror",b),T(),e.removeListener("error",y),sn(e,"error")===0&&Te(e,b)}i(y,"onerror"),ma(e,"error",y);function _(){e.removeListener("finish",w),T()}i(_,"onclose"),e.once("close",_);function w(){m("onfinish"),e.removeListener("close",_),T()}i(w,"onfinish"),e.once("finish",w);function T(){m("unpipe"),r.unpipe(e)}return i(T,"unpipe"),e.emit("pipe",r),n.flowing||(m("pipe resume"),r.resume()),e};function Ra(e){return i(function(){var r=e._readableState;m("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&sn(e,"data")&&(r.flowing=!0,Ut(e))},"pipeOnDrainFunctionResult")}i(Ra,"pipeOnDrain");R.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<o;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=dn(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};R.prototype.on=function(e,t){var r=Oe.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,m("on readable",n.length,n.reading),n.length?Ze(this):n.reading||process.nextTick(Ta,this)),r};R.prototype.addListener=R.prototype.on;R.prototype.removeListener=function(e,t){var r=Oe.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(cn,this),r};R.prototype.removeAllListeners=function(e){var t=Oe.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(cn,this),t};function cn(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}i(cn,"updateReadableListening");function Ta(e){m("readable nexttick read 0"),e.read(0)}i(Ta,"nReadingNextTick");R.prototype.resume=function(){var e=this._readableState;return e.flowing||(m("resume"),e.flowing=!e.readableListening,Oa(this,e)),e.paused=!1,this};function Oa(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(xa,e,t))}i(Oa,"resume");function xa(e,t){m("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Ut(e),t.flowing&&!t.reading&&e.read(0)}i(xa,"resume_");R.prototype.pause=function(){return m("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(m("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ut(e){var t=e._readableState;for(m("flow",t.flowing);t.flowing&&e.read()!==null;);}i(Ut,"flow");R.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(m("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(m("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var u=t.push(s);u||(n=!0,e.pause())}});for(var o in e)this[o]===void 0&&typeof e[o]=="function"&&(this[o]=i(function(u){return i(function(){return e[u].apply(e,arguments)},"methodWrapReturnFunction")},"methodWrap")(o));for(var a=0;a<It.length;a++)e.on(It[a],this.emit.bind(this,It[a]));return this._read=function(s){m("wrapped _read",s),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(R.prototype[Symbol.asyncIterator]=function(){return Dt===void 0&&(Dt=Qr()),Dt(this)});Object.defineProperty(R.prototype,"readableHighWaterMark",{enumerable:!1,get:i(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(R.prototype,"readableBuffer",{enumerable:!1,get:i(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(R.prototype,"readableFlowing",{enumerable:!1,get:i(function(){return this._readableState.flowing},"get"),set:i(function(t){this._readableState&&(this._readableState.flowing=t)},"set")});R._fromList=hn;Object.defineProperty(R.prototype,"readableLength",{enumerable:!1,get:i(function(){return this._readableState.length},"get")});function hn(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}i(hn,"fromList");function jt(e){var t=e._readableState;m("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(La,t,e))}i(jt,"endReadable");function La(e,t){if(m("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}i(La,"endReadableNT");typeof Symbol=="function"&&(R.from=function(e,t){return qt===void 0&&(qt=nn()),qt(R,e,t)});function dn(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}i(dn,"indexOf")});var Wt=S((Fu,gn)=>{"use strict";c();gn.exports=z;var Qe=K().codes,Pa=Qe.ERR_METHOD_NOT_IMPLEMENTED,ka=Qe.ERR_MULTIPLE_CALLBACK,Na=Qe.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ma=Qe.ERR_TRANSFORM_WITH_LENGTH_0,et=ne();Y()(z,et);function Aa(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new ka);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}i(Aa,"afterTransform");function z(e){if(!(this instanceof z))return new z(e);et.call(this,e),this._transformState={afterTransform:Aa.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Da)}i(z,"Transform");function Da(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){yn(e,t,r)}):yn(this,null,null)}i(Da,"prefinish");z.prototype.push=function(e,t){return this._transformState.needTransform=!1,et.prototype.push.call(this,e,t)};z.prototype._transform=function(e,t,r){r(new Pa("_transform()"))};z.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}};z.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};z.prototype._destroy=function(e,t){et.prototype._destroy.call(this,e,function(r){t(r)})};function yn(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Ma;if(e._transformState.transforming)throw new Na;return e.push(null)}i(yn,"done")});var mn=S((Hu,vn)=>{"use strict";c();vn.exports=xe;var _n=Wt();Y()(xe,_n);function xe(e){if(!(this instanceof xe))return new xe(e);_n.call(this,e)}i(xe,"PassThrough");xe.prototype._transform=function(e,t,r){r(null,e)}});var Rn=S((Gu,Sn)=>{"use strict";c();var Ht;function qa(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}i(qa,"once");var En=K().codes,Ia=En.ERR_MISSING_ARGS,Ca=En.ERR_STREAM_DESTROYED;function wn(e){if(e)throw e}i(wn,"noop");function ja(e){return e.setHeader&&typeof e.abort=="function"}i(ja,"isRequest");function Ba(e,t,r,n){n=qa(n);var o=!1;e.on("close",function(){o=!0}),Ht===void 0&&(Ht=Ve()),Ht(e,{readable:t,writable:r},function(s){if(s)return n(s);o=!0,n()});var a=!1;return function(s){if(!o&&!a){if(a=!0,ja(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new Ca("pipe"))}}}i(Ba,"destroyer");function bn(e){e()}i(bn,"call");function Fa(e,t){return e.pipe(t)}i(Fa,"pipe");function Ua(e){return!e.length||typeof e[e.length-1]!="function"?wn:e.pop()}i(Ua,"popCallback");function Wa(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Ua(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Ia("streams");var o,a=t.map(function(s,u){var f=u<t.length-1,l=u>0;return Ba(s,f,l,function(g){o||(o=g),g&&a.forEach(bn),!f&&(a.forEach(bn),n(o))})});return t.reduce(Fa)}i(Wa,"pipeline");Sn.exports=Wa});var pe=S((B,Pe)=>{c();var Le=L("stream");process.env.READABLE_STREAM==="disable"&&Le?(Pe.exports=Le.Readable,Object.assign(Pe.exports,Le),Pe.exports.Stream=Le):(B=Pe.exports=xt(),B.Stream=Le||B,B.Readable=B,B.Writable=Rt(),B.Duplex=ne(),B.Transform=Wt(),B.PassThrough=mn(),B.finished=Ve(),B.pipeline=Rn())});var xn=S((Xu,On)=>{"use strict";c();var{Buffer:F}=L("buffer"),Tn=Symbol.for("BufferList");function x(e){if(!(this instanceof x))return new x(e);x._init.call(this,e)}i(x,"BufferList");x._init=i(function(t){Object.defineProperty(this,Tn,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},"_init");x.prototype._new=i(function(t){return new x(t)},"_new");x.prototype._offset=i(function(t){if(t===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let o=r+this._bufs[n].length;if(t<o||n===this._bufs.length-1)return[n,t-r];r=o}},"_offset");x.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let n=0;n<t;n++)r+=this._bufs[n].length;return r};x.prototype.get=i(function(t){if(t>this.length||t<0)return;let r=this._offset(t);return this._bufs[r[0]][r[1]]},"get");x.prototype.slice=i(function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)},"slice");x.prototype.copy=i(function(t,r,n,o){if((typeof n!="number"||n<0)&&(n=0),(typeof o!="number"||o>this.length)&&(o=this.length),n>=this.length||o<=0)return t||F.alloc(0);let a=!!t,s=this._offset(n),u=o-n,f=u,l=a&&r||0,g=s[1];if(n===0&&o===this.length){if(!a)return this._bufs.length===1?this._bufs[0]:F.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(t,l),l+=this._bufs[d].length;return t}if(f<=this._bufs[s[0]].length-g)return a?this._bufs[s[0]].copy(t,r,g,g+f):this._bufs[s[0]].slice(g,g+f);a||(t=F.allocUnsafe(u));for(let d=s[0];d<this._bufs.length;d++){let y=this._bufs[d].length-g;if(f>y)this._bufs[d].copy(t,l,g),l+=y;else{this._bufs[d].copy(t,l,g,g+f),l+=y;break}f-=y,g&&(g=0)}return t.length>l?t.slice(0,l):t},"copy");x.prototype.shallowSlice=i(function(t,r){if(t=t||0,r=typeof r!="number"?this.length:r,t<0&&(t+=this.length),r<0&&(r+=this.length),t===r)return this._new();let n=this._offset(t),o=this._offset(r),a=this._bufs.slice(n[0],o[0]+1);return o[1]===0?a.pop():a[a.length-1]=a[a.length-1].slice(0,o[1]),n[1]!==0&&(a[0]=a[0].slice(n[1])),this._new(a)},"shallowSlice");x.prototype.toString=i(function(t,r,n){return this.slice(r,n).toString(t)},"toString");x.prototype.consume=i(function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this},"consume");x.prototype.duplicate=i(function(){let t=this._new();for(let r=0;r<this._bufs.length;r++)t.append(this._bufs[r]);return t},"duplicate");x.prototype.append=i(function(t){if(t==null)return this;if(t.buffer)this._appendBuffer(F.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let r=0;r<t.length;r++)this.append(t[r]);else if(this._isBufferList(t))for(let r=0;r<t._bufs.length;r++)this.append(t._bufs[r]);else typeof t=="number"&&(t=t.toString()),this._appendBuffer(F.from(t));return this},"append");x.prototype._appendBuffer=i(function(t){this._bufs.push(t),this.length+=t.length},"appendBuffer");x.prototype.indexOf=function(e,t,r){if(r===void 0&&typeof t=="string"&&(r=t,t=void 0),typeof e=="function"||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof e=="number"?e=F.from([e]):typeof e=="string"?e=F.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=F.from(e.buffer,e.byteOffset,e.byteLength):F.isBuffer(e)||(e=F.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let n=this._offset(t),o=n[0],a=n[1];for(;o<this._bufs.length;o++){let s=this._bufs[o];for(;a<s.length;)if(s.length-a>=e.length){let f=s.indexOf(e,a);if(f!==-1)return this._reverseOffset([o,f]);a=s.length-e.length+1}else{let f=this._reverseOffset([o,a]);if(this._match(f,e))return f;a++}a=0}return-1};x.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0};(function(){let e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in e)(function(r){e[r]===null?x.prototype[r]=function(n,o){return this.slice(n,n+o)[r](0,o)}:x.prototype[r]=function(n=0){return this.slice(n,n+e[r])[r](0)}})(t)})();x.prototype._isBufferList=i(function(t){return t instanceof x||x.isBufferList(t)},"_isBufferList");x.isBufferList=i(function(t){return t!=null&&t[Tn]},"isBufferList");On.exports=x});var Ln=S((Qu,tt)=>{"use strict";c();var $t=pe().Duplex,Ha=Y(),ke=xn();function N(e){if(!(this instanceof N))return new N(e);if(typeof e=="function"){this._callback=e;let t=i(function(n){this._callback&&(this._callback(n),this._callback=null)},"piper").bind(this);this.on("pipe",i(function(n){n.on("error",t)},"onPipe")),this.on("unpipe",i(function(n){n.removeListener("error",t)},"onUnpipe")),e=null}ke._init.call(this,e),$t.call(this)}i(N,"BufferListStream");Ha(N,$t);Object.assign(N.prototype,ke.prototype);N.prototype._new=i(function(t){return new N(t)},"_new");N.prototype._write=i(function(t,r,n){this._appendBuffer(t),typeof n=="function"&&n()},"_write");N.prototype._read=i(function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)},"_read");N.prototype.end=i(function(t){$t.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)},"end");N.prototype._destroy=i(function(t,r){this._bufs.length=0,this.length=0,r(t)},"_destroy");N.prototype._isBufferList=i(function(t){return t instanceof N||t instanceof ke||N.isBufferList(t)},"_isBufferList");N.isBufferList=ke.isBufferList;tt.exports=N;tt.exports.BufferListStream=N;tt.exports.BufferList=ke});var Vt=S(ge=>{c();var $a=Buffer.alloc,za="0000000000000000000",Ga="7777777777777777777",Pn=48,kn=Buffer.from("ustar\0","binary"),Va=Buffer.from("00","binary"),Ka=Buffer.from("ustar ","binary"),Ya=Buffer.from(" \0","binary"),Xa=parseInt("7777",8),Ne=257,Gt=263,Ja=i(function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},"clamp"),Za=i(function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},"toType"),Qa=i(function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},"toTypeflag"),Nn=i(function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},"indexOf"),Mn=i(function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var n=156;n<512;n++)t+=e[n];return t},"cksum"),ee=i(function(e,t){return e=e.toString(8),e.length>t?Ga.slice(0,t)+" ":za.slice(0,t-e.length)+e+" "},"encodeOct");function es(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=[],n=e.length-1;n>0;n--){var o=e[n];t?r.push(o):r.push(255-o)}var a=0,s=r.length;for(n=0;n<s;n++)a+=r[n]*Math.pow(256,n);return t?a:-1*a}i(es,"parse256");var te=i(function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return es(e);for(;t<e.length&&e[t]===32;)t++;for(var n=Ja(Nn(e,32,t,e.length),e.length,e.length);t<n&&e[t]===0;)t++;return n===t?0:parseInt(e.slice(t,n).toString(),8)},"decodeOct"),ye=i(function(e,t,r,n){return e.slice(t,Nn(e,0,t,t+r)).toString(n)},"decodeStr"),zt=i(function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e},"addLength");ge.decodeLongPath=function(e,t){return ye(e,0,e.length,t)};ge.encodePax=function(e){var t="";e.name&&(t+=zt(" path="+e.name+`
|
|
3
|
+
import{l as cr,m as hr}from"./chunk-AXMV4XZL.js";import{b as or,c as ar,d as sr,e as ur,f as fr,g as lr}from"./chunk-K4ZH6HZB.js";import{a as i,b as L,c as S,e as Pi,f as c}from"./chunk-ZUL6VITT.js";var mr=S((Gs,vr)=>{"use strict";c();var C=L("fs"),re=L("path"),ki=C.lchown?"lchown":"chown",Ni=C.lchownSync?"lchownSync":"chownSync",pr=C.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),dr=i((e,t,r)=>{try{return C[Ni](e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"lchownSync"),Mi=i((e,t,r)=>{try{return C.chownSync(e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"chownSync"),Ai=pr?(e,t,r,n)=>o=>{!o||o.code!=="EISDIR"?n(o):C.chown(e,t,r,n)}:(e,t,r,n)=>n,ht=pr?(e,t,r)=>{try{return dr(e,t,r)}catch(n){if(n.code!=="EISDIR")throw n;Mi(e,t,r)}}:(e,t,r)=>dr(e,t,r),Di=process.version,yr=i((e,t,r)=>C.readdir(e,t,r),"readdir"),qi=i((e,t)=>C.readdirSync(e,t),"readdirSync");/^v4\./.test(Di)&&(yr=i((e,t,r)=>C.readdir(e,r),"readdir"));var Be=i((e,t,r,n)=>{C[ki](e,t,r,Ai(e,t,r,o=>{n(o&&o.code!=="ENOENT"?o:null)}))},"chown"),gr=i((e,t,r,n,o)=>{if(typeof t=="string")return C.lstat(re.resolve(e,t),(a,s)=>{if(a)return o(a.code!=="ENOENT"?a:null);s.name=t,gr(e,s,r,n,o)});if(t.isDirectory())dt(re.resolve(e,t.name),r,n,a=>{if(a)return o(a);let s=re.resolve(e,t.name);Be(s,r,n,o)});else{let a=re.resolve(e,t.name);Be(a,r,n,o)}},"chownrKid"),dt=i((e,t,r,n)=>{yr(e,{withFileTypes:!0},(o,a)=>{if(o){if(o.code==="ENOENT")return n();if(o.code!=="ENOTDIR"&&o.code!=="ENOTSUP")return n(o)}if(o||!a.length)return Be(e,t,r,n);let s=a.length,u=null,f=i(l=>{if(!u){if(l)return n(u=l);if(--s===0)return Be(e,t,r,n)}},"then");a.forEach(l=>gr(e,l,t,r,f))})},"chownr"),Ii=i((e,t,r,n)=>{if(typeof t=="string")try{let o=C.lstatSync(re.resolve(e,t));o.name=t,t=o}catch(o){if(o.code==="ENOENT")return;throw o}t.isDirectory()&&_r(re.resolve(e,t.name),r,n),ht(re.resolve(e,t.name),r,n)},"chownrKidSync"),_r=i((e,t,r)=>{let n;try{n=qi(e,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return;if(o.code==="ENOTDIR"||o.code==="ENOTSUP")return ht(e,t,r);throw o}return n&&n.length&&n.forEach(o=>Ii(e,o,t,r)),ht(e,t,r)},"chownrSync");vr.exports=dt;dt.sync=_r});var pt=S((Ys,wr)=>{c();wr.exports=L("stream")});var Or=S((Js,Tr)=>{"use strict";c();function br(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}i(br,"ownKeys");function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?br(Object(r),!0).forEach(function(n){Ci(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):br(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(Er,"_objectSpread");function Ci(e,t,r){return t=Rr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(Ci,"_defineProperty");function ji(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i(ji,"_classCallCheck");function Sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rr(n.key),n)}}i(Sr,"_defineProperties");function Bi(e,t,r){return t&&Sr(e.prototype,t),r&&Sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}i(Bi,"_createClass");function Rr(e){var t=Fi(e,"string");return typeof t=="symbol"?t:String(t)}i(Rr,"_toPropertyKey");function Fi(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(Fi,"_toPrimitive");var Ui=L("buffer"),Fe=Ui.Buffer,Wi=L("util"),yt=Wi.inspect,Hi=yt&&yt.custom||"inspect";function $i(e,t,r){Fe.prototype.copy.call(e,t,r)}i($i,"copyBuffer");Tr.exports=function(){function e(){ji(this,e),this.head=null,this.tail=null,this.length=0}return i(e,"BufferList"),Bi(e,[{key:"push",value:i(function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},"push")},{key:"unshift",value:i(function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},"unshift")},{key:"shift",value:i(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:i(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:i(function(r){if(this.length===0)return"";for(var n=this.head,o=""+n.data;n=n.next;)o+=r+n.data;return o},"join")},{key:"concat",value:i(function(r){if(this.length===0)return Fe.alloc(0);for(var n=Fe.allocUnsafe(r>>>0),o=this.head,a=0;o;)$i(o.data,n,a),a+=o.data.length,o=o.next;return n},"concat")},{key:"consume",value:i(function(r,n){var o;return r<this.head.data.length?(o=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?o=this.shift():o=n?this._getString(r):this._getBuffer(r),o},"consume")},{key:"first",value:i(function(){return this.head.data},"first")},{key:"_getString",value:i(function(r){var n=this.head,o=1,a=n.data;for(r-=a.length;n=n.next;){var s=n.data,u=r>s.length?s.length:r;if(u===s.length?a+=s:a+=s.slice(0,r),r-=u,r===0){u===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(u));break}++o}return this.length-=o,a},"_getString")},{key:"_getBuffer",value:i(function(r){var n=Fe.allocUnsafe(r),o=this.head,a=1;for(o.data.copy(n),r-=o.data.length;o=o.next;){var s=o.data,u=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,u),r-=u,r===0){u===s.length?(++a,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=s.slice(u));break}++a}return this.length-=a,n},"_getBuffer")},{key:Hi,value:i(function(r,n){return yt(this,Er(Er({},n),{},{depth:0,customInspect:!1}))},"value")}]),e}()});var _t=S((eu,Lr)=>{"use strict";c();function zi(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(gt,this,e)):process.nextTick(gt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(Ue,r):(r._writableState.errorEmitted=!0,process.nextTick(xr,r,a)):process.nextTick(xr,r,a):t?(process.nextTick(Ue,r),t(a)):process.nextTick(Ue,r)}),this)}i(zi,"destroy");function xr(e,t){gt(e,t),Ue(e)}i(xr,"emitErrorAndCloseNT");function Ue(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}i(Ue,"emitCloseNT");function Gi(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}i(Gi,"undestroy");function gt(e,t){e.emit("error",t)}i(gt,"emitErrorNT");function Vi(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}i(Vi,"errorOrDestroy");Lr.exports={destroy:zi,undestroy:Gi,errorOrDestroy:Vi}});var K=S((nu,Nr)=>{"use strict";c();var kr={};function j(e,t,r){r||(r=Error);function n(a,s,u){return typeof t=="string"?t:t(a,s,u)}i(n,"getMessage");class o extends r{static{i(this,"NodeError")}constructor(s,u,f){super(n(s,u,f))}}o.prototype.name=r.name,o.prototype.code=e,kr[e]=o}i(j,"createErrorType");function Pr(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}i(Pr,"oneOf");function Ki(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}i(Ki,"startsWith");function Yi(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}i(Yi,"endsWith");function Xi(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}i(Xi,"includes");j("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);j("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&Ki(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let o;if(Yi(e," argument"))o=`The ${e} ${n} ${Pr(t,"type")}`;else{let a=Xi(e,".")?"property":"argument";o=`The "${e}" ${a} ${n} ${Pr(t,"type")}`}return o+=`. Received type ${typeof r}`,o},TypeError);j("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");j("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});j("ERR_STREAM_PREMATURE_CLOSE","Premature close");j("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});j("ERR_MULTIPLE_CALLBACK","Callback called multiple times");j("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");j("ERR_STREAM_WRITE_AFTER_END","write after end");j("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);j("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);j("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Nr.exports.codes=kr});var vt=S((au,Mr)=>{"use strict";c();var Ji=K().codes.ERR_INVALID_OPT_VALUE;function Zi(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}i(Zi,"highWaterMarkFrom");function Qi(e,t,r,n){var o=Zi(t,n,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=n?r:"highWaterMark";throw new Ji(a,o)}return Math.floor(o)}return e.objectMode?16:16*1024}i(Qi,"getHighWaterMark");Mr.exports={getHighWaterMark:Qi}});var Ar=S((fu,mt)=>{c();typeof Object.create=="function"?mt.exports=i(function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):mt.exports=i(function(t,r){if(r){t.super_=r;var n=i(function(){},"TempCtor");n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}},"inherits")});var Y=S((hu,bt)=>{c();try{if(wt=L("util"),typeof wt.inherits!="function")throw"";bt.exports=wt.inherits}catch{bt.exports=Ar()}var wt});var qr=S((pu,Dr)=>{c();Dr.exports=L("util").deprecate});var Rt=S((gu,Ur)=>{"use strict";c();Ur.exports=k;function Cr(e){var t=this;this.next=null,this.entry=null,this.finish=function(){xo(t,e)}}i(Cr,"CorkedRequest");var le;k.WritableState=Ee;var eo={deprecate:qr()},jr=pt(),He=L("buffer").Buffer,to=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ro(e){return He.from(e)}i(ro,"_uint8ArrayToBuffer");function no(e){return He.isBuffer(e)||e instanceof to}i(no,"_isUint8Array");var St=_t(),io=vt(),oo=io.getHighWaterMark,X=K().codes,ao=X.ERR_INVALID_ARG_TYPE,so=X.ERR_METHOD_NOT_IMPLEMENTED,uo=X.ERR_MULTIPLE_CALLBACK,fo=X.ERR_STREAM_CANNOT_PIPE,lo=X.ERR_STREAM_DESTROYED,co=X.ERR_STREAM_NULL_VALUES,ho=X.ERR_STREAM_WRITE_AFTER_END,po=X.ERR_UNKNOWN_ENCODING,ce=St.errorOrDestroy;Y()(k,jr);function yo(){}i(yo,"nop");function Ee(e,t,r){le=le||ne(),e=e||{},typeof r!="boolean"&&(r=t instanceof le),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=oo(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){Eo(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Cr(this)}i(Ee,"WritableState");Ee.prototype.getBuffer=i(function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r},"getBuffer");(function(){try{Object.defineProperty(Ee.prototype,"buffer",{get:eo.deprecate(i(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var We;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(We=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:i(function(t){return We.call(this,t)?!0:this!==k?!1:t&&t._writableState instanceof Ee},"value")})):We=i(function(t){return t instanceof this},"realHasInstance");function k(e){le=le||ne();var t=this instanceof le;if(!t&&!We.call(k,this))return new k(e);this._writableState=new Ee(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),jr.call(this)}i(k,"Writable");k.prototype.pipe=function(){ce(this,new fo)};function go(e,t){var r=new ho;ce(e,r),process.nextTick(t,r)}i(go,"writeAfterEnd");function _o(e,t,r,n){var o;return r===null?o=new co:typeof r!="string"&&!t.objectMode&&(o=new ao("chunk",["string","Buffer"],r)),o?(ce(e,o),process.nextTick(n,o),!1):!0}i(_o,"validChunk");k.prototype.write=function(e,t,r){var n=this._writableState,o=!1,a=!n.objectMode&&no(e);return a&&!He.isBuffer(e)&&(e=ro(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=yo),n.ending?go(this,r):(a||_o(this,n,e,r))&&(n.pendingcb++,o=mo(this,n,a,e,t,r)),o};k.prototype.cork=function(){this._writableState.corked++};k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&Br(this,e))};k.prototype.setDefaultEncoding=i(function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new po(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:i(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function vo(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=He.from(t,r)),t}i(vo,"decodeChunk");Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});function mo(e,t,r,n,o,a){if(!r){var s=vo(t,n,o);n!==s&&(r=!0,o="buffer",n=s)}var u=t.objectMode?1:n.length;t.length+=u;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Et(e,t,!1,u,n,o,a);return f}i(mo,"writeOrBuffer");function Et(e,t,r,n,o,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new lo("write")):r?e._writev(o,t.onwrite):e._write(o,a,t.onwrite),t.sync=!1}i(Et,"doWrite");function wo(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(be,e,t),e._writableState.errorEmitted=!0,ce(e,n)):(o(n),e._writableState.errorEmitted=!0,ce(e,n),be(e,t))}i(wo,"onwriteError");function bo(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}i(bo,"onwriteStateUpdate");function Eo(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if(typeof o!="function")throw new uo;if(bo(r),t)wo(e,r,n,t,o);else{var a=Fr(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Br(e,r),n?process.nextTick(Ir,e,r,a,o):Ir(e,r,a,o)}}i(Eo,"onwrite");function Ir(e,t,r,n){r||So(e,t),t.pendingcb--,n(),be(e,t)}i(Ir,"afterWrite");function So(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}i(So,"onwriteDrain");function Br(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,Et(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Cr(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,l=r.encoding,g=r.callback,d=t.objectMode?1:f.length;if(Et(e,t,!1,d,f,l,g),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}i(Br,"clearBuffer");k.prototype._write=function(e,t,r){r(new so("_write()"))};k.prototype._writev=null;k.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||Oo(this,n,r),this};Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:i(function(){return this._writableState.length},"get")});function Fr(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}i(Fr,"needFinish");function Ro(e,t){e._final(function(r){t.pendingcb--,r&&ce(e,r),t.prefinished=!0,e.emit("prefinish"),be(e,t)})}i(Ro,"callFinal");function To(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(Ro,e,t)):(t.prefinished=!0,e.emit("prefinish")))}i(To,"prefinish");function be(e,t){var r=Fr(t);if(r&&(To(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}i(be,"finishMaybe");function Oo(e,t,r){t.ending=!0,be(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}i(Oo,"endWritable");function xo(e,t,r){var n=e.entry;for(e.entry=null;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}i(xo,"onCorkedFinish");Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:i(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")});k.prototype.destroy=St.destroy;k.prototype._undestroy=St.undestroy;k.prototype._destroy=function(e,t){t(e)}});var ne=S((mu,Hr)=>{"use strict";c();var Lo=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Hr.exports=U;var Wr=xt(),Ot=Rt();Y()(U,Wr);for(Tt=Lo(Ot.prototype),$e=0;$e<Tt.length;$e++)ze=Tt[$e],U.prototype[ze]||(U.prototype[ze]=Ot.prototype[ze]);var Tt,ze,$e;function U(e){if(!(this instanceof U))return new U(e);Wr.call(this,e),Ot.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Po)))}i(U,"Duplex");Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(U.prototype,"writableBuffer",{enumerable:!1,get:i(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(U.prototype,"writableLength",{enumerable:!1,get:i(function(){return this._writableState.length},"get")});function Po(){this._writableState.ended||process.nextTick(ko,this)}i(Po,"onend");function ko(e){e.end()}i(ko,"onEndNT");Object.defineProperty(U.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:i(function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")})});var Gr=S((Lt,zr)=>{c();var Ge=L("buffer"),W=Ge.Buffer;function $r(e,t){for(var r in e)t[r]=e[r]}i($r,"copyProps");W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow?zr.exports=Ge:($r(Ge,Lt),Lt.Buffer=ie);function ie(e,t,r){return W(e,t,r)}i(ie,"SafeBuffer");ie.prototype=Object.create(W.prototype);$r(W,ie);ie.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return W(e,t,r)};ie.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=W(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};ie.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return W(e)};ie.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ge.SlowBuffer(e)}});var Nt=S(Kr=>{"use strict";c();var kt=Gr().Buffer,Vr=kt.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function No(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}i(No,"_normalizeEncoding");function Mo(e){var t=No(e);if(typeof t!="string"&&(kt.isEncoding===Vr||!Vr(e)))throw new Error("Unknown encoding: "+e);return t||e}i(Mo,"normalizeEncoding");Kr.StringDecoder=Se;function Se(e){this.encoding=Mo(e);var t;switch(this.encoding){case"utf16le":this.text=jo,this.end=Bo,t=4;break;case"utf8":this.fillLast=qo,t=4;break;case"base64":this.text=Fo,this.end=Uo,t=3;break;default:this.write=Wo,this.end=Ho;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=kt.allocUnsafe(t)}i(Se,"StringDecoder");Se.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Se.prototype.end=Co;Se.prototype.text=Io;Se.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Pt(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}i(Pt,"utf8CheckByte");function Ao(e,t,r){var n=t.length-1;if(n<r)return 0;var o=Pt(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||o===-2?0:(o=Pt(t[n]),o>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||o===-2?0:(o=Pt(t[n]),o>=0?(o>0&&(o===2?o=0:e.lastNeed=o-3),o):0))}i(Ao,"utf8CheckIncomplete");function Do(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}i(Do,"utf8CheckExtraBytes");function qo(e){var t=this.lastTotal-this.lastNeed,r=Do(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}i(qo,"utf8FillLast");function Io(e,t){var r=Ao(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}i(Io,"utf8Text");function Co(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}i(Co,"utf8End");function jo(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}i(jo,"utf16Text");function Bo(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}i(Bo,"utf16End");function Fo(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}i(Fo,"base64Text");function Uo(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}i(Uo,"base64End");function Wo(e){return e.toString(this.encoding)}i(Wo,"simpleWrite");function Ho(e){return e&&e.length?this.write(e):""}i(Ho,"simpleEnd")});var Ve=S((xu,Jr)=>{"use strict";c();var Yr=K().codes.ERR_STREAM_PREMATURE_CLOSE;function $o(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}i($o,"once");function zo(){}i(zo,"noop");function Go(e){return e.setHeader&&typeof e.abort=="function"}i(Go,"isRequest");function Xr(e,t,r){if(typeof t=="function")return Xr(e,null,t);t||(t={}),r=$o(r||zo);var n=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,a=i(function(){e.writable||u()},"onlegacyfinish"),s=e._writableState&&e._writableState.finished,u=i(function(){o=!1,s=!0,n||r.call(e)},"onfinish"),f=e._readableState&&e._readableState.endEmitted,l=i(function(){n=!1,f=!0,o||r.call(e)},"onend"),g=i(function(w){r.call(e,w)},"onerror"),d=i(function(){var w;if(n&&!f)return(!e._readableState||!e._readableState.ended)&&(w=new Yr),r.call(e,w);if(o&&!s)return(!e._writableState||!e._writableState.ended)&&(w=new Yr),r.call(e,w)},"onclose"),y=i(function(){e.req.on("finish",u)},"onrequest");return Go(e)?(e.on("complete",u),e.on("abort",d),e.req?y():e.on("request",y)):o&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",l),e.on("finish",u),t.error!==!1&&e.on("error",g),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",y),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",g),e.removeListener("close",d)}}i(Xr,"eos");Jr.exports=Xr});var Qr=S((ku,Zr)=>{"use strict";c();var Ke;function J(e,t,r){return t=Vo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(J,"_defineProperty");function Vo(e){var t=Ko(e,"string");return typeof t=="symbol"?t:String(t)}i(Vo,"_toPropertyKey");function Ko(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(Ko,"_toPrimitive");var Yo=Ve(),Z=Symbol("lastResolve"),oe=Symbol("lastReject"),Re=Symbol("error"),Ye=Symbol("ended"),ae=Symbol("lastPromise"),Mt=Symbol("handlePromise"),se=Symbol("stream");function Q(e,t){return{value:e,done:t}}i(Q,"createIterResult");function Xo(e){var t=e[Z];if(t!==null){var r=e[se].read();r!==null&&(e[ae]=null,e[Z]=null,e[oe]=null,t(Q(r,!1)))}}i(Xo,"readAndResolve");function Jo(e){process.nextTick(Xo,e)}i(Jo,"onReadable");function Zo(e,t){return function(r,n){e.then(function(){if(t[Ye]){r(Q(void 0,!0));return}t[Mt](r,n)},n)}}i(Zo,"wrapForNext");var Qo=Object.getPrototypeOf(function(){}),ea=Object.setPrototypeOf((Ke={get stream(){return this[se]},next:i(function(){var t=this,r=this[Re];if(r!==null)return Promise.reject(r);if(this[Ye])return Promise.resolve(Q(void 0,!0));if(this[se].destroyed)return new Promise(function(s,u){process.nextTick(function(){t[Re]?u(t[Re]):s(Q(void 0,!0))})});var n=this[ae],o;if(n)o=new Promise(Zo(n,this));else{var a=this[se].read();if(a!==null)return Promise.resolve(Q(a,!1));o=new Promise(this[Mt])}return this[ae]=o,o},"next")},J(Ke,Symbol.asyncIterator,function(){return this}),J(Ke,"return",i(function(){var t=this;return new Promise(function(r,n){t[se].destroy(null,function(o){if(o){n(o);return}r(Q(void 0,!0))})})},"_return")),Ke),Qo),ta=i(function(t){var r,n=Object.create(ea,(r={},J(r,se,{value:t,writable:!0}),J(r,Z,{value:null,writable:!0}),J(r,oe,{value:null,writable:!0}),J(r,Re,{value:null,writable:!0}),J(r,Ye,{value:t._readableState.endEmitted,writable:!0}),J(r,Mt,{value:i(function(a,s){var u=n[se].read();u?(n[ae]=null,n[Z]=null,n[oe]=null,a(Q(u,!1))):(n[Z]=a,n[oe]=s)},"value"),writable:!0}),r));return n[ae]=null,Yo(t,function(o){if(o&&o.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[oe];a!==null&&(n[ae]=null,n[Z]=null,n[oe]=null,a(o)),n[Re]=o;return}var s=n[Z];s!==null&&(n[ae]=null,n[Z]=null,n[oe]=null,s(Q(void 0,!0))),n[Ye]=!0}),t.on("readable",Jo.bind(null,n)),n},"createReadableStreamAsyncIterator");Zr.exports=ta});var nn=S((Au,rn)=>{"use strict";c();function en(e,t,r,n,o,a,s){try{var u=e[a](s),f=u.value}catch(l){r(l);return}u.done?t(f):Promise.resolve(f).then(n,o)}i(en,"asyncGeneratorStep");function ra(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function s(f){en(a,n,o,s,u,"next",f)}i(s,"_next");function u(f){en(a,n,o,s,u,"throw",f)}i(u,"_throw"),s(void 0)})}}i(ra,"_asyncToGenerator");function tn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}i(tn,"ownKeys");function na(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tn(Object(r),!0).forEach(function(n){ia(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(na,"_objectSpread");function ia(e,t,r){return t=oa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(ia,"_defineProperty");function oa(e){var t=aa(e,"string");return typeof t=="symbol"?t:String(t)}i(oa,"_toPropertyKey");function aa(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(aa,"_toPrimitive");var sa=K().codes.ERR_INVALID_ARG_TYPE;function ua(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new sa("iterable",["Iterable"],t);var o=new e(na({objectMode:!0},r)),a=!1;o._read=function(){a||(a=!0,s())};function s(){return u.apply(this,arguments)}i(s,"next");function u(){return u=ra(function*(){try{var f=yield n.next(),l=f.value,g=f.done;g?o.push(null):o.push(yield l)?s():a=!1}catch(d){o.destroy(d)}}),u.apply(this,arguments)}return i(u,"_next2"),o}i(ua,"from");rn.exports=ua});var xt=S((Cu,pn)=>{"use strict";c();pn.exports=R;var he;R.ReadableState=un;var Iu=L("events").EventEmitter,sn=i(function(t,r){return t.listeners(r).length},"EElistenerCount"),Oe=pt(),Xe=L("buffer").Buffer,fa=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function la(e){return Xe.from(e)}i(la,"_uint8ArrayToBuffer");function ca(e){return Xe.isBuffer(e)||e instanceof fa}i(ca,"_isUint8Array");var At=L("util"),m;At&&At.debuglog?m=At.debuglog("stream"):m=i(function(){},"debug");var ha=Or(),Ft=_t(),da=vt(),pa=da.getHighWaterMark,Je=K().codes,ya=Je.ERR_INVALID_ARG_TYPE,ga=Je.ERR_STREAM_PUSH_AFTER_EOF,_a=Je.ERR_METHOD_NOT_IMPLEMENTED,va=Je.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,de,Dt,qt;Y()(R,Oe);var Te=Ft.errorOrDestroy,It=["error","close","destroy","pause","resume"];function ma(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}i(ma,"prependListener");function un(e,t,r){he=he||ne(),e=e||{},typeof r!="boolean"&&(r=t instanceof he),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=pa(this,e,"readableHighWaterMark",r),this.buffer=new ha,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(de||(de=Nt().StringDecoder),this.decoder=new de(e.encoding),this.encoding=e.encoding)}i(un,"ReadableState");function R(e){if(he=he||ne(),!(this instanceof R))return new R(e);var t=this instanceof he;this._readableState=new un(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Oe.call(this)}i(R,"Readable");Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:i(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")});R.prototype.destroy=Ft.destroy;R.prototype._undestroy=Ft.undestroy;R.prototype._destroy=function(e,t){t(e)};R.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Xe.from(e,t),t=""),n=!0),fn(this,e,t,!1,n)};R.prototype.unshift=function(e){return fn(this,e,null,!0,!1)};function fn(e,t,r,n,o){m("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,Ea(e,a);else{var s;if(o||(s=wa(a,t)),s)Te(e,s);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Xe.prototype&&(t=la(t)),n)a.endEmitted?Te(e,new va):Ct(e,a,t,!0);else if(a.ended)Te(e,new ga);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Ct(e,a,t,!1):Bt(e,a)):Ct(e,a,t,!1)}else n||(a.reading=!1,Bt(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}i(fn,"readableAddChunk");function Ct(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Ze(e)),Bt(e,t)}i(Ct,"addChunk");function wa(e,t){var r;return!ca(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new ya("chunk",["string","Buffer","Uint8Array"],t)),r}i(wa,"chunkInvalid");R.prototype.isPaused=function(){return this._readableState.flowing===!1};R.prototype.setEncoding=function(e){de||(de=Nt().StringDecoder);var t=new de(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var on=1073741824;function ba(e){return e>=on?e=on:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}i(ba,"computeNewHighWaterMark");function an(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=ba(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}i(an,"howMuchToRead");R.prototype.read=function(e){m("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return m("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?jt(this):Ze(this),null;if(e=an(e,t),e===0&&t.ended)return t.length===0&&jt(this),null;var n=t.needReadable;m("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,m("length less than watermark",n)),t.ended||t.reading?(n=!1,m("reading or ended",n)):n&&(m("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=an(r,t)));var o;return e>0?o=hn(e,t):o=null,o===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&jt(this)),o!==null&&this.emit("data",o),o};function Ea(e,t){if(m("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Ze(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,ln(e)))}}i(Ea,"onEofChunk");function Ze(e){var t=e._readableState;m("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(m("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(ln,e))}i(Ze,"emitReadable");function ln(e){var t=e._readableState;m("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Ut(e)}i(ln,"emitReadable_");function Bt(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Sa,e,t))}i(Bt,"maybeReadMore");function Sa(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(m("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}i(Sa,"maybeReadMore_");R.prototype._read=function(e){Te(this,new _a("_read()"))};R.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,m("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=o?u:T;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",s);function s(b,p){m("onunpipe"),b===r&&p&&p.hasUnpiped===!1&&(p.hasUnpiped=!0,g())}i(s,"onunpipe");function u(){m("onend"),e.end()}i(u,"onend");var f=Ra(r);e.on("drain",f);var l=!1;function g(){m("cleanup"),e.removeListener("close",_),e.removeListener("finish",w),e.removeListener("drain",f),e.removeListener("error",y),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",T),r.removeListener("data",d),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}i(g,"cleanup"),r.on("data",d);function d(b){m("ondata");var p=e.write(b);m("dest.write",p),p===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&dn(n.pipes,e)!==-1)&&!l&&(m("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}i(d,"ondata");function y(b){m("onerror",b),T(),e.removeListener("error",y),sn(e,"error")===0&&Te(e,b)}i(y,"onerror"),ma(e,"error",y);function _(){e.removeListener("finish",w),T()}i(_,"onclose"),e.once("close",_);function w(){m("onfinish"),e.removeListener("close",_),T()}i(w,"onfinish"),e.once("finish",w);function T(){m("unpipe"),r.unpipe(e)}return i(T,"unpipe"),e.emit("pipe",r),n.flowing||(m("pipe resume"),r.resume()),e};function Ra(e){return i(function(){var r=e._readableState;m("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&sn(e,"data")&&(r.flowing=!0,Ut(e))},"pipeOnDrainFunctionResult")}i(Ra,"pipeOnDrain");R.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<o;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=dn(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};R.prototype.on=function(e,t){var r=Oe.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,m("on readable",n.length,n.reading),n.length?Ze(this):n.reading||process.nextTick(Ta,this)),r};R.prototype.addListener=R.prototype.on;R.prototype.removeListener=function(e,t){var r=Oe.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(cn,this),r};R.prototype.removeAllListeners=function(e){var t=Oe.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(cn,this),t};function cn(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}i(cn,"updateReadableListening");function Ta(e){m("readable nexttick read 0"),e.read(0)}i(Ta,"nReadingNextTick");R.prototype.resume=function(){var e=this._readableState;return e.flowing||(m("resume"),e.flowing=!e.readableListening,Oa(this,e)),e.paused=!1,this};function Oa(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(xa,e,t))}i(Oa,"resume");function xa(e,t){m("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Ut(e),t.flowing&&!t.reading&&e.read(0)}i(xa,"resume_");R.prototype.pause=function(){return m("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(m("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ut(e){var t=e._readableState;for(m("flow",t.flowing);t.flowing&&e.read()!==null;);}i(Ut,"flow");R.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(m("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(m("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var u=t.push(s);u||(n=!0,e.pause())}});for(var o in e)this[o]===void 0&&typeof e[o]=="function"&&(this[o]=i(function(u){return i(function(){return e[u].apply(e,arguments)},"methodWrapReturnFunction")},"methodWrap")(o));for(var a=0;a<It.length;a++)e.on(It[a],this.emit.bind(this,It[a]));return this._read=function(s){m("wrapped _read",s),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(R.prototype[Symbol.asyncIterator]=function(){return Dt===void 0&&(Dt=Qr()),Dt(this)});Object.defineProperty(R.prototype,"readableHighWaterMark",{enumerable:!1,get:i(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(R.prototype,"readableBuffer",{enumerable:!1,get:i(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(R.prototype,"readableFlowing",{enumerable:!1,get:i(function(){return this._readableState.flowing},"get"),set:i(function(t){this._readableState&&(this._readableState.flowing=t)},"set")});R._fromList=hn;Object.defineProperty(R.prototype,"readableLength",{enumerable:!1,get:i(function(){return this._readableState.length},"get")});function hn(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}i(hn,"fromList");function jt(e){var t=e._readableState;m("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(La,t,e))}i(jt,"endReadable");function La(e,t){if(m("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}i(La,"endReadableNT");typeof Symbol=="function"&&(R.from=function(e,t){return qt===void 0&&(qt=nn()),qt(R,e,t)});function dn(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}i(dn,"indexOf")});var Wt=S((Fu,gn)=>{"use strict";c();gn.exports=z;var Qe=K().codes,Pa=Qe.ERR_METHOD_NOT_IMPLEMENTED,ka=Qe.ERR_MULTIPLE_CALLBACK,Na=Qe.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ma=Qe.ERR_TRANSFORM_WITH_LENGTH_0,et=ne();Y()(z,et);function Aa(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new ka);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}i(Aa,"afterTransform");function z(e){if(!(this instanceof z))return new z(e);et.call(this,e),this._transformState={afterTransform:Aa.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Da)}i(z,"Transform");function Da(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){yn(e,t,r)}):yn(this,null,null)}i(Da,"prefinish");z.prototype.push=function(e,t){return this._transformState.needTransform=!1,et.prototype.push.call(this,e,t)};z.prototype._transform=function(e,t,r){r(new Pa("_transform()"))};z.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}};z.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};z.prototype._destroy=function(e,t){et.prototype._destroy.call(this,e,function(r){t(r)})};function yn(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Ma;if(e._transformState.transforming)throw new Na;return e.push(null)}i(yn,"done")});var mn=S((Hu,vn)=>{"use strict";c();vn.exports=xe;var _n=Wt();Y()(xe,_n);function xe(e){if(!(this instanceof xe))return new xe(e);_n.call(this,e)}i(xe,"PassThrough");xe.prototype._transform=function(e,t,r){r(null,e)}});var Rn=S((Gu,Sn)=>{"use strict";c();var Ht;function qa(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}i(qa,"once");var En=K().codes,Ia=En.ERR_MISSING_ARGS,Ca=En.ERR_STREAM_DESTROYED;function wn(e){if(e)throw e}i(wn,"noop");function ja(e){return e.setHeader&&typeof e.abort=="function"}i(ja,"isRequest");function Ba(e,t,r,n){n=qa(n);var o=!1;e.on("close",function(){o=!0}),Ht===void 0&&(Ht=Ve()),Ht(e,{readable:t,writable:r},function(s){if(s)return n(s);o=!0,n()});var a=!1;return function(s){if(!o&&!a){if(a=!0,ja(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new Ca("pipe"))}}}i(Ba,"destroyer");function bn(e){e()}i(bn,"call");function Fa(e,t){return e.pipe(t)}i(Fa,"pipe");function Ua(e){return!e.length||typeof e[e.length-1]!="function"?wn:e.pop()}i(Ua,"popCallback");function Wa(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Ua(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Ia("streams");var o,a=t.map(function(s,u){var f=u<t.length-1,l=u>0;return Ba(s,f,l,function(g){o||(o=g),g&&a.forEach(bn),!f&&(a.forEach(bn),n(o))})});return t.reduce(Fa)}i(Wa,"pipeline");Sn.exports=Wa});var pe=S((B,Pe)=>{c();var Le=L("stream");process.env.READABLE_STREAM==="disable"&&Le?(Pe.exports=Le.Readable,Object.assign(Pe.exports,Le),Pe.exports.Stream=Le):(B=Pe.exports=xt(),B.Stream=Le||B,B.Readable=B,B.Writable=Rt(),B.Duplex=ne(),B.Transform=Wt(),B.PassThrough=mn(),B.finished=Ve(),B.pipeline=Rn())});var xn=S((Xu,On)=>{"use strict";c();var{Buffer:F}=L("buffer"),Tn=Symbol.for("BufferList");function x(e){if(!(this instanceof x))return new x(e);x._init.call(this,e)}i(x,"BufferList");x._init=i(function(t){Object.defineProperty(this,Tn,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},"_init");x.prototype._new=i(function(t){return new x(t)},"_new");x.prototype._offset=i(function(t){if(t===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let o=r+this._bufs[n].length;if(t<o||n===this._bufs.length-1)return[n,t-r];r=o}},"_offset");x.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let n=0;n<t;n++)r+=this._bufs[n].length;return r};x.prototype.get=i(function(t){if(t>this.length||t<0)return;let r=this._offset(t);return this._bufs[r[0]][r[1]]},"get");x.prototype.slice=i(function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)},"slice");x.prototype.copy=i(function(t,r,n,o){if((typeof n!="number"||n<0)&&(n=0),(typeof o!="number"||o>this.length)&&(o=this.length),n>=this.length||o<=0)return t||F.alloc(0);let a=!!t,s=this._offset(n),u=o-n,f=u,l=a&&r||0,g=s[1];if(n===0&&o===this.length){if(!a)return this._bufs.length===1?this._bufs[0]:F.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(t,l),l+=this._bufs[d].length;return t}if(f<=this._bufs[s[0]].length-g)return a?this._bufs[s[0]].copy(t,r,g,g+f):this._bufs[s[0]].slice(g,g+f);a||(t=F.allocUnsafe(u));for(let d=s[0];d<this._bufs.length;d++){let y=this._bufs[d].length-g;if(f>y)this._bufs[d].copy(t,l,g),l+=y;else{this._bufs[d].copy(t,l,g,g+f),l+=y;break}f-=y,g&&(g=0)}return t.length>l?t.slice(0,l):t},"copy");x.prototype.shallowSlice=i(function(t,r){if(t=t||0,r=typeof r!="number"?this.length:r,t<0&&(t+=this.length),r<0&&(r+=this.length),t===r)return this._new();let n=this._offset(t),o=this._offset(r),a=this._bufs.slice(n[0],o[0]+1);return o[1]===0?a.pop():a[a.length-1]=a[a.length-1].slice(0,o[1]),n[1]!==0&&(a[0]=a[0].slice(n[1])),this._new(a)},"shallowSlice");x.prototype.toString=i(function(t,r,n){return this.slice(r,n).toString(t)},"toString");x.prototype.consume=i(function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this},"consume");x.prototype.duplicate=i(function(){let t=this._new();for(let r=0;r<this._bufs.length;r++)t.append(this._bufs[r]);return t},"duplicate");x.prototype.append=i(function(t){if(t==null)return this;if(t.buffer)this._appendBuffer(F.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let r=0;r<t.length;r++)this.append(t[r]);else if(this._isBufferList(t))for(let r=0;r<t._bufs.length;r++)this.append(t._bufs[r]);else typeof t=="number"&&(t=t.toString()),this._appendBuffer(F.from(t));return this},"append");x.prototype._appendBuffer=i(function(t){this._bufs.push(t),this.length+=t.length},"appendBuffer");x.prototype.indexOf=function(e,t,r){if(r===void 0&&typeof t=="string"&&(r=t,t=void 0),typeof e=="function"||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof e=="number"?e=F.from([e]):typeof e=="string"?e=F.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=F.from(e.buffer,e.byteOffset,e.byteLength):F.isBuffer(e)||(e=F.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let n=this._offset(t),o=n[0],a=n[1];for(;o<this._bufs.length;o++){let s=this._bufs[o];for(;a<s.length;)if(s.length-a>=e.length){let f=s.indexOf(e,a);if(f!==-1)return this._reverseOffset([o,f]);a=s.length-e.length+1}else{let f=this._reverseOffset([o,a]);if(this._match(f,e))return f;a++}a=0}return-1};x.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0};(function(){let e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in e)(function(r){e[r]===null?x.prototype[r]=function(n,o){return this.slice(n,n+o)[r](0,o)}:x.prototype[r]=function(n=0){return this.slice(n,n+e[r])[r](0)}})(t)})();x.prototype._isBufferList=i(function(t){return t instanceof x||x.isBufferList(t)},"_isBufferList");x.isBufferList=i(function(t){return t!=null&&t[Tn]},"isBufferList");On.exports=x});var Ln=S((Qu,tt)=>{"use strict";c();var $t=pe().Duplex,Ha=Y(),ke=xn();function N(e){if(!(this instanceof N))return new N(e);if(typeof e=="function"){this._callback=e;let t=i(function(n){this._callback&&(this._callback(n),this._callback=null)},"piper").bind(this);this.on("pipe",i(function(n){n.on("error",t)},"onPipe")),this.on("unpipe",i(function(n){n.removeListener("error",t)},"onUnpipe")),e=null}ke._init.call(this,e),$t.call(this)}i(N,"BufferListStream");Ha(N,$t);Object.assign(N.prototype,ke.prototype);N.prototype._new=i(function(t){return new N(t)},"_new");N.prototype._write=i(function(t,r,n){this._appendBuffer(t),typeof n=="function"&&n()},"_write");N.prototype._read=i(function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)},"_read");N.prototype.end=i(function(t){$t.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)},"end");N.prototype._destroy=i(function(t,r){this._bufs.length=0,this.length=0,r(t)},"_destroy");N.prototype._isBufferList=i(function(t){return t instanceof N||t instanceof ke||N.isBufferList(t)},"_isBufferList");N.isBufferList=ke.isBufferList;tt.exports=N;tt.exports.BufferListStream=N;tt.exports.BufferList=ke});var Vt=S(ge=>{c();var $a=Buffer.alloc,za="0000000000000000000",Ga="7777777777777777777",Pn=48,kn=Buffer.from("ustar\0","binary"),Va=Buffer.from("00","binary"),Ka=Buffer.from("ustar ","binary"),Ya=Buffer.from(" \0","binary"),Xa=parseInt("7777",8),Ne=257,Gt=263,Ja=i(function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},"clamp"),Za=i(function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},"toType"),Qa=i(function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},"toTypeflag"),Nn=i(function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},"indexOf"),Mn=i(function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var n=156;n<512;n++)t+=e[n];return t},"cksum"),ee=i(function(e,t){return e=e.toString(8),e.length>t?Ga.slice(0,t)+" ":za.slice(0,t-e.length)+e+" "},"encodeOct");function es(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=[],n=e.length-1;n>0;n--){var o=e[n];t?r.push(o):r.push(255-o)}var a=0,s=r.length;for(n=0;n<s;n++)a+=r[n]*Math.pow(256,n);return t?a:-1*a}i(es,"parse256");var te=i(function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return es(e);for(;t<e.length&&e[t]===32;)t++;for(var n=Ja(Nn(e,32,t,e.length),e.length,e.length);t<n&&e[t]===0;)t++;return n===t?0:parseInt(e.slice(t,n).toString(),8)},"decodeOct"),ye=i(function(e,t,r,n){return e.slice(t,Nn(e,0,t,t+r)).toString(n)},"decodeStr"),zt=i(function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e},"addLength");ge.decodeLongPath=function(e,t){return ye(e,0,e.length,t)};ge.encodePax=function(e){var t="";e.name&&(t+=zt(" path="+e.name+`
|
|
4
4
|
`)),e.linkname&&(t+=zt(" linkpath="+e.linkname+`
|
|
5
5
|
`));var r=e.pax;if(r)for(var n in r)t+=zt(" "+n+"="+r[n]+`
|
|
6
6
|
`);return Buffer.from(t)};ge.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var n=parseInt(e.slice(0,r).toString(),10);if(!n)return t;var o=e.slice(r+1,n-1).toString(),a=o.indexOf("=");if(a===-1)return t;t[o.slice(0,a)]=o.slice(a+1),e=e.slice(n)}return t};ge.encode=function(e){var t=$a(512),r=e.name,n="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var o=r.indexOf("/");if(o===-1)return null;n+=n?"/"+r.slice(0,o):r.slice(0,o),r=r.slice(o+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(ee(e.mode&Xa,6),100),t.write(ee(e.uid,6),108),t.write(ee(e.gid,6),116),t.write(ee(e.size,11),124),t.write(ee(e.mtime.getTime()/1e3|0,11),136),t[156]=Pn+Qa(e.type),e.linkname&&t.write(e.linkname,157),kn.copy(t,Ne),Va.copy(t,Gt),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(ee(e.devmajor||0,6),329),t.write(ee(e.devminor||0,6),337),n&&t.write(n,345),t.write(ee(Mn(t),6),148),t)};ge.decode=function(e,t,r){var n=e[156]===0?0:e[156]-Pn,o=ye(e,0,100,t),a=te(e,100,8),s=te(e,108,8),u=te(e,116,8),f=te(e,124,12),l=te(e,136,12),g=Za(n),d=e[157]===0?null:ye(e,157,100,t),y=ye(e,265,32),_=ye(e,297,32),w=te(e,329,8),T=te(e,337,8),b=Mn(e);if(b===8*32)return null;if(b!==te(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(kn.compare(e,Ne,Ne+6)===0)e[345]&&(o=ye(e,345,155,t)+"/"+o);else if(!(Ka.compare(e,Ne,Ne+6)===0&&Ya.compare(e,Gt,Gt+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&o&&o[o.length-1]==="/"&&(n=5),{name:o,mode:a,uid:s,gid:u,size:f,mtime:new Date(1e3*l),type:g,linkname:d,uname:y,gname:_,devmajor:w,devminor:T}}});var Bn=S((af,jn)=>{c();var Dn=L("util"),ts=Ln(),Me=Vt(),qn=pe().Writable,In=pe().PassThrough,Cn=i(function(){},"noop"),An=i(function(e){return e&=511,e&&512-e},"overflow"),rs=i(function(e,t){var r=new rt(e,t);return r.end(),r},"emptyStream"),ns=i(function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},"mixinPax"),rt=i(function(e,t){this._parent=e,this.offset=t,In.call(this,{autoDestroy:!1})},"Source");Dn.inherits(rt,In);rt.prototype.destroy=function(e){this._parent.destroy(e)};var G=i(function(e){if(!(this instanceof G))return new G(e);qn.call(this,e),e=e||{},this._offset=0,this._buffer=ts(),this._missing=0,this._partial=!1,this._onparse=Cn,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=i(function(){t._continue()},"oncontinue"),o=i(function(y){if(t._locked=!1,y)return t.destroy(y);t._stream||n()},"onunlock"),a=i(function(){t._stream=null;var y=An(t._header.size);y?t._parse(y,s):t._parse(512,d),t._locked||n()},"onstreamend"),s=i(function(){t._buffer.consume(An(t._header.size)),t._parse(512,d),n()},"ondrain"),u=i(function(){var y=t._header.size;t._paxGlobal=Me.decodePax(r.slice(0,y)),r.consume(y),a()},"onpaxglobalheader"),f=i(function(){var y=t._header.size;t._pax=Me.decodePax(r.slice(0,y)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(y),a()},"onpaxheader"),l=i(function(){var y=t._header.size;this._gnuLongPath=Me.decodeLongPath(r.slice(0,y),e.filenameEncoding),r.consume(y),a()},"ongnulongpath"),g=i(function(){var y=t._header.size;this._gnuLongLinkPath=Me.decodeLongPath(r.slice(0,y),e.filenameEncoding),r.consume(y),a()},"ongnulonglinkpath"),d=i(function(){var y=t._offset,_;try{_=t._header=Me.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(w){t.emit("error",w)}if(r.consume(512),!_){t._parse(512,d),n();return}if(_.type==="gnu-long-path"){t._parse(_.size,l),n();return}if(_.type==="gnu-long-link-path"){t._parse(_.size,g),n();return}if(_.type==="pax-global-header"){t._parse(_.size,u),n();return}if(_.type==="pax-header"){t._parse(_.size,f),n();return}if(t._gnuLongPath&&(_.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(_.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=_=ns(_,t._pax),t._pax=null),t._locked=!0,!_.size||_.type==="directory"){t._parse(512,d),t.emit("entry",_,rs(t,y),o);return}t._stream=new rt(t,y),t.emit("entry",_,t._stream,o),t._parse(_.size,a),n()},"onheader");this._onheader=d,this._parse(512,d)},"Extract");Dn.inherits(G,qn);G.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};G.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};G.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=Cn,this._overflow?this._write(this._overflow,void 0,e):e()}};G.prototype._write=function(e,t,r){if(!this._destroyed){var n=this._stream,o=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,n?n.write(e,r):(o.append(e),r());this._cb=r,this._missing=0;var s=null;e.length>a&&(s=e.slice(a),e=e.slice(0,a)),n?n.end(e):o.append(e),this._overflow=s,this._onparse()}};G.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};jn.exports=G});var Un=S((ff,Fn)=>{c();Fn.exports=L("fs").constants||L("constants")});var $n=S((cf,Hn)=>{c();Hn.exports=Wn;function Wn(e,t){if(e&&t)return Wn(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),o=0;o<n.length;o++)n[o]=arguments[o];var a=e.apply(this,n),s=n[n.length-1];return typeof a=="function"&&a!==s&&Object.keys(s).forEach(function(u){a[u]=s[u]}),a}i(r,"wrapper")}i(Wn,"wrappy")});var Yt=S((pf,Kt)=>{c();var zn=$n();Kt.exports=zn(nt);Kt.exports.strict=zn(Gn);nt.proto=nt(function(){Object.defineProperty(Function.prototype,"once",{value:i(function(){return nt(this)},"value"),configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:i(function(){return Gn(this)},"value"),configurable:!0})});function nt(e){var t=i(function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))},"f");return t.called=!1,t}i(nt,"once");function Gn(e){var t=i(function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},"f"),r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}i(Gn,"onceStrict")});var Xt=S((_f,Kn)=>{c();var is=Yt(),os=i(function(){},"noop"),as=global.Bare?queueMicrotask:process.nextTick.bind(process),ss=i(function(e){return e.setHeader&&typeof e.abort=="function"},"isRequest"),us=i(function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},"isChildProcess"),Vn=i(function(e,t,r){if(typeof t=="function")return Vn(e,null,t);t||(t={}),r=is(r||os);var n=e._writableState,o=e._readableState,a=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,u=!1,f=i(function(){e.writable||l()},"onlegacyfinish"),l=i(function(){s=!1,a||r.call(e)},"onfinish"),g=i(function(){a=!1,s||r.call(e)},"onend"),d=i(function(b){r.call(e,b?new Error("exited with error code: "+b):null)},"onexit"),y=i(function(b){r.call(e,b)},"onerror"),_=i(function(){as(w)},"onclose"),w=i(function(){if(!u){if(a&&!(o&&o.ended&&!o.destroyed))return r.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},"onclosenexttick"),T=i(function(){e.req.on("finish",l)},"onrequest");return ss(e)?(e.on("complete",l),e.on("abort",_),e.req?T():e.on("request",T)):s&&!n&&(e.on("end",f),e.on("close",f)),us(e)&&e.on("exit",d),e.on("end",g),e.on("finish",l),t.error!==!1&&e.on("error",y),e.on("close",_),function(){u=!0,e.removeListener("complete",l),e.removeListener("abort",_),e.removeListener("request",T),e.req&&e.req.removeListener("finish",l),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",l),e.removeListener("exit",d),e.removeListener("end",g),e.removeListener("error",y),e.removeListener("close",_)}},"eos");Kn.exports=Vn});var Qn=S((wf,Zn)=>{c();var _e=Un(),Yn=Xt(),ot=Y(),fs=Buffer.alloc,Xn=pe().Readable,ve=pe().Writable,ls=L("string_decoder").StringDecoder,it=Vt(),cs=parseInt("755",8),hs=parseInt("644",8),Jn=fs(1024),Zt=i(function(){},"noop"),Jt=i(function(e,t){t&=511,t&&e.push(Jn.slice(0,512-t))},"overflow");function ds(e){switch(e&_e.S_IFMT){case _e.S_IFBLK:return"block-device";case _e.S_IFCHR:return"character-device";case _e.S_IFDIR:return"directory";case _e.S_IFIFO:return"fifo";case _e.S_IFLNK:return"symlink"}return"file"}i(ds,"modeToType");var at=i(function(e){ve.call(this),this.written=0,this._to=e,this._destroyed=!1},"Sink");ot(at,ve);at.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};at.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var st=i(function(){ve.call(this),this.linkname="",this._decoder=new ls("utf-8"),this._destroyed=!1},"LinkSink");ot(st,ve);st.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};st.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Ae=i(function(){ve.call(this),this._destroyed=!1},"Void");ot(Ae,ve);Ae.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};Ae.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var H=i(function(e){if(!(this instanceof H))return new H(e);Xn.call(this,e),this._drain=Zt,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null},"Pack");ot(H,Xn);H.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=Zt);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=ds(e.mode)),e.mode||(e.mode=e.type==="directory"?cs:hs),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)){e.size=t.length,this._encode(e);var o=this.push(t);return Jt(n,e.size),o?process.nextTick(r):this._drain=r,new Ae}if(e.type==="symlink"&&!e.linkname){var a=new st;return Yn(a,function(u){if(u)return n.destroy(),r(u);e.linkname=a.linkname,n._encode(e),r()}),a}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new Ae;var s=new at(this);return this._stream=s,Yn(s,function(u){if(n._stream=null,u)return n.destroy(),r(u);if(s.written!==e.size)return n.destroy(),r(new Error("size mismatch"));Jt(n,e.size),n._finalizing&&n.finalize(),r()}),s}};H.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(Jn),this.push(null))};H.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};H.prototype._encode=function(e){if(!e.pax){var t=it.encode(e);if(t){this.push(t);return}}this._encodePax(e)};H.prototype._encodePax=function(e){var t=it.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(it.encode(r)),this.push(t),Jt(this,t.length),r.size=e.size,r.type=e.type,this.push(it.encode(r))};H.prototype._read=function(e){var t=this._drain;this._drain=Zt,t()};Zn.exports=H});var ei=S(Qt=>{c();Qt.extract=Bn();Qt.pack=Qn()});var ni=S((Tf,ri)=>{c();var ps=Yt(),ys=Xt(),ut;try{ut=L("fs")}catch{}var De=i(function(){},"noop"),gs=typeof process>"u"?!1:/^v?\.0/.test(process.version),ft=i(function(e){return typeof e=="function"},"isFn"),_s=i(function(e){return!gs||!ut?!1:(e instanceof(ut.ReadStream||De)||e instanceof(ut.WriteStream||De))&&ft(e.close)},"isFS"),vs=i(function(e){return e.setHeader&&ft(e.abort)},"isRequest"),ms=i(function(e,t,r,n){n=ps(n);var o=!1;e.on("close",function(){o=!0}),ys(e,{readable:t,writable:r},function(s){if(s)return n(s);o=!0,n()});var a=!1;return function(s){if(!o&&!a){if(a=!0,_s(e))return e.close(De);if(vs(e))return e.abort();if(ft(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},"destroyer"),ti=i(function(e){e()},"call"),ws=i(function(e,t){return e.pipe(t)},"pipe"),bs=i(function(){var e=Array.prototype.slice.call(arguments),t=ft(e[e.length-1]||De)&&e.pop()||De;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,n=e.map(function(o,a){var s=a<e.length-1,u=a>0;return ms(o,s,u,function(f){r||(r=f),f&&n.forEach(ti),!s&&(n.forEach(ti),t(r))})});return e.reduce(ws)},"pump");ri.exports=bs});var si=S((Lf,ai)=>{c();var lt=L("path"),ii=L("fs"),oi=parseInt("0777",8);ai.exports=me.mkdirp=me.mkdirP=me;function me(e,t,r,n){typeof t=="function"?(r=t,t={}):(!t||typeof t!="object")&&(t={mode:t});var o=t.mode,a=t.fs||ii;o===void 0&&(o=oi&~process.umask()),n||(n=null);var s=r||function(){};e=lt.resolve(e),a.mkdir(e,o,function(u){if(!u)return n=n||e,s(null,n);switch(u.code){case"ENOENT":me(lt.dirname(e),t,function(f,l){f?s(f,l):me(e,t,s,l)});break;default:a.stat(e,function(f,l){f||!l.isDirectory()?s(u,n):s(null,n)});break}})}i(me,"mkdirP");me.sync=i(function e(t,r,n){(!r||typeof r!="object")&&(r={mode:r});var o=r.mode,a=r.fs||ii;o===void 0&&(o=oi&~process.umask()),n||(n=null),t=lt.resolve(t);try{a.mkdirSync(t,o),n=n||t}catch(u){switch(u.code){case"ENOENT":n=e(lt.dirname(t),r,n),e(t,r,n);break;default:var s;try{s=a.statSync(t)}catch{throw u}if(!s.isDirectory())throw u;break}}return n},"sync")});var gi=S(nr=>{c();var Es=mr(),fi=ei(),li=ni(),Ss=si(),ci=L("fs"),P=L("path"),Rs=L("os"),qe=Rs.platform()==="win32",Ie=i(function(){},"noop"),rr=i(function(e){return e},"echo"),er=qe?function(e){return e.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:rr,Ts=i(function(e,t,r,n,o,a){for(var s=o||["."],u=0;u<s.length;u++)if(!tr(P.resolve(r,s[u]),r))throw new Error(s[u]+" is not a valid path");return i(function(l){if(!s.length)return l();var g=s.shift(),d=P.join(r,g);t.call(e,d,function(y,_){if(y)return l(y);if(!_.isDirectory())return l(null,g,_);e.readdir(d,function(w,T){if(w)return l(w);a&&T.sort();for(var b=0;b<T.length;b++)n(P.join(r,g,T[b]))||s.push(P.join(g,T[b]));l(null,g,_)})})},"loop")},"statAll"),hi=i(function(e,t){return function(r){r.name=r.name.split("/").slice(t).join("/");var n=r.linkname;return n&&(r.type==="link"||P.isAbsolute(n))&&(r.linkname=n.split("/").slice(t).join("/")),e(r)}},"strip");nr.pack=function(e,t){e||(e="."),t||(t={});var r=t.fs||ci,n=t.ignore||t.filter||Ie,o=t.map||Ie,a=t.mapStream||rr,s=Ts(r,t.dereference?r.stat:r.lstat,e,n,t.entries,t.sort),u=t.strict!==!1,f=typeof t.umask=="number"?~t.umask:~di(),l=typeof t.dmode=="number"?t.dmode:0,g=typeof t.fmode=="number"?t.fmode:0,d=t.pack||fi.pack(),y=t.finish||Ie;t.strip&&(o=hi(o,t.strip)),t.readable&&(l|=parseInt(555,8),g|=parseInt(444,8)),t.writable&&(l|=parseInt(333,8),g|=parseInt(222,8));var _=i(function(b,p){r.readlink(P.join(e,b),function(v,h){if(v)return d.destroy(v);p.linkname=er(h),d.entry(p,T)})},"onsymlink"),w=i(function(b,p,v){if(b)return d.destroy(b);if(!p)return t.finalize!==!1&&d.finalize(),y(d);if(v.isSocket())return T();var h={name:er(p),mode:(v.mode|(v.isDirectory()?l:g))&f,mtime:v.mtime,size:v.size,type:"file",uid:v.uid,gid:v.gid};if(v.isDirectory())return h.size=0,h.type="directory",h=o(h)||h,d.entry(h,T);if(v.isSymbolicLink())return h.size=0,h.type="symlink",h=o(h)||h,_(p,h);if(h=o(h)||h,!v.isFile())return u?d.destroy(new Error("unsupported type for "+p)):T();var O=d.entry(h,T);if(O){var A=a(r.createReadStream(P.join(e,p),{start:0,end:h.size>0?h.size-1:h.size}),h);A.on("error",function(V){O.destroy(V)}),li(A,O)}},"onstat"),T=i(function(b){if(b)return d.destroy(b);s(w)},"onnextentry");return T(),d};var Os=i(function(e){return e.length?e[e.length-1]:null},"head"),xs=i(function(){return process.getuid?process.getuid():-1},"processGetuid"),di=i(function(){return process.umask?process.umask():0},"processUmask");nr.extract=function(e,t){e||(e="."),t||(t={});var r=t.fs||ci,n=t.ignore||t.filter||Ie,o=t.map||Ie,a=t.mapStream||rr,s=t.chown!==!1&&!qe&&xs()===0,u=t.extract||fi.extract(),f=[],l=new Date,g=typeof t.umask=="number"?~t.umask:~di(),d=typeof t.dmode=="number"?t.dmode:0,y=typeof t.fmode=="number"?t.fmode:0,_=t.strict!==!1;t.strip&&(o=hi(o,t.strip)),t.readable&&(d|=parseInt(555,8),y|=parseInt(444,8)),t.writable&&(d|=parseInt(333,8),y|=parseInt(222,8));var w=i(function(p,v){for(var h;(h=Os(f))&&p.slice(0,h[0].length)!==h[0];)f.pop();if(!h)return v();r.utimes(h[0],l,h[1],v)},"utimesParent"),T=i(function(p,v,h){if(t.utimes===!1)return h();if(v.type==="directory")return r.utimes(p,l,v.mtime,h);if(v.type==="symlink")return w(p,h);r.utimes(p,l,v.mtime,function(O){if(O)return h(O);w(p,h)})},"utimes"),b=i(function(p,v,h){var O=v.type==="symlink",A=O?r.lchmod:r.chmod,V=O?r.lchown:r.chown;if(!A)return h();var ct=(v.mode|(v.type==="directory"?d:y))&g&parseInt(777,8);V&&s?V.call(r,p,v.uid,v.gid,we):we(null);function we(ue){if(ue)return h(ue);if(!A)return h();A.call(r,p,ct,h)}i(we,"onchown")},"chperm");return u.on("entry",function(p,v,h){p=o(p)||p,p.name=er(p.name);var O=P.join(e,P.join("/",p.name));if(n(O,p))return v.resume(),h();var A=i(function(D){if(D)return h(D);if(P.join(O,".")===P.join(e,"."))return h();T(O,p,function(q){if(q)return h(q);if(qe)return h();b(O,p,h)})},"stat"),V=i(function(){if(qe)return h();r.unlink(O,function(){var D=P.resolve(P.dirname(O),p.linkname);if(!tr(D,e))return h(new Error(O+" is not a valid symlink"));yi(r,D,P.resolve(e),function(q,I){if(q)return h(q);if(!I)return h(new Error(O+" is not a valid symlink"));r.symlink(p.linkname,O,A)})})},"onsymlink"),ct=i(function(){if(qe)return h();r.unlink(O,function(){var D=P.join(e,P.join("/",p.linkname));r.realpath(D,function(q,I){if(q||!tr(I,e))return h(new Error(O+" is not a valid hardlink"));r.link(I,O,function(fe){if(fe&&fe.code==="EPERM"&&t.hardlinkAsFilesFallback)return v=r.createReadStream(D),we();A(fe)})})})},"onlink"),we=i(function(){r.lstat(O,function(q,I){if(!q&&I.isSymbolicLink())return r.unlink(O,D);D()});function D(q){if(q)return h(q);var I=r.createWriteStream(O),fe=a(v,p);I.on("error",function(je){fe.destroy(je)}),li(fe,I,function(je){if(je)return h(je);I.on("close",A)})}i(D,"onwrite")},"onfile");if(p.type==="directory")return f.push([O,p.mtime]),ui(O,{fs:r,own:s,uid:p.uid,gid:p.gid},A);var ue=P.dirname(O);pi(r,ue,P.join(e,"."),function(D,q){if(D)return h(D);if(!q)return h(new Error(ue+" is not a valid path"));ui(ue,{fs:r,own:s,uid:p.uid,gid:p.gid},function(I){if(I)return h(I);switch(p.type){case"file":return we();case"link":return ct();case"symlink":return V()}if(_)return h(new Error("unsupported type for "+O+" ("+p.type+")"));v.resume(),h()})})}),t.finish&&u.on("finish",t.finish),u};function pi(e,t,r,n){if(t===r)return n(null,!0);e.lstat(t,function(o,a){if(o&&o.code!=="ENOENT")return n(o);if(o||a.isDirectory())return pi(e,P.join(t,".."),r,n);n(null,!1)})}i(pi,"validate");function yi(e,t,r,n){if(t===r)return n(null,!0);if(!t.startsWith(r+P.sep))return n(null,!1);e.lstat(t,function(o,a){if(o&&o.code!=="ENOENT"&&o.code!=="EPERM")return n(o);if(o||!a.isSymbolicLink())return yi(e,P.join(t,".."),r,n);n(null,!1)})}i(yi,"validateNotSymlink");function ui(e,t,r){Ss(e,{fs:t.fs},function(n,o){!n&&o&&t.own?Es(o,t.uid,t.gid,r):r(n)})}i(ui,"mkdirfix");function tr(e,t){return t=P.resolve(t),t===e||e.startsWith(t+P.sep)}i(tr,"inCwd")});c();var Ti=Pi(gi(),1);import{createHash as Ps}from"node:crypto";import{readFileSync as Ei}from"node:fs";import*as Si from"node:os";import*as $ from"node:path";import{PassThrough as vi,Readable as Ri}from"node:stream";import{StringDecoder as ks}from"node:string_decoder";c();import{createRequire as Ls}from"node:module";function _i(){return Ls(import.meta.url)("dockerode")}i(_i,"loadDockerode");function Ns(){return process.env.NODE_TEST_CONTEXT&&!process.env.WERKMEISTER_DOCKER_ENGINE?(process.stderr.write(`Docker engine reached in a test without useDockerEngine() (fixtures.mjs); using a dead socket
|
|
@@ -12,4 +12,4 @@ import{l as cr,m as hr}from"./chunk-X57IXE7Q.js";import{b as or,c as ar,d as sr,
|
|
|
12
12
|
safe-buffer/index.js:
|
|
13
13
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
14
14
|
*/
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-4ADQJ3NO.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as R}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as R}from"./chunk-TXZ3WERB.js";import{o as x,s as j}from"./chunk-7D7R3M4U.js";import{c as y}from"./chunk-EP6B44PA.js";import{a as i,e as F,f as b}from"./chunk-ZUL6VITT.js";b();var g=F(R(),1);import{spawn as D}from"node:child_process";import L from"node:fs/promises";import l from"node:path";var S=import.meta.filename.endsWith(".ts")?l.join(import.meta.dirname,"..","..","dist"):l.basename(import.meta.dirname)==="lib"?l.join(import.meta.dirname,".."):import.meta.dirname;function C(o){let e=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",c=process.platform==="win32"?["/c","start","",o]:[o];try{D(e,c,{detached:!0,stdio:"ignore"}).unref()}catch{}}i(C,"openBrowser");function k(o){if(!o)return!1;let e=o.replace(/:\d+$/,"").replace(/^\[|\]$/g,"");return e==="localhost"||e==="127.0.0.1"||e==="::1"}i(k,"isLocalHost");function I(o,e,c){let m=o.headers.origin;if(m){let s=null;try{s=new URL(m).hostname}catch{}if(!k(s??void 0)){e.status(403).json({error:"cross-origin request refused"});return}}if(!k(o.headers.host)){e.status(403).json({error:"non-local host refused"});return}c()}i(I,"localOnly");function P(o,e={}){let c=e.timeoutMs??6e5;return new Promise(m=>{let s=(0,g.default)();s.use(g.default.json({limit:"1mb"}));let w=!1,d,u=i(n=>{w||(w=!0,d&&clearTimeout(d),setTimeout(()=>f.close(()=>m(n)),50))},"settle");s.get("/",async(n,t)=>{try{let p=await L.readFile(l.join(S,"form.html"),"utf-8");t.type("html").send(p)}catch{t.status(500).type("text").send("Form UI bundle missing \u2014 run `pnpm run build` in apps/werkmeister-dashboard.")}}),s.post("/api/tool",I,async(n,t)=>{let{name:p,arguments:a}=n.body??{};try{switch(p){case"workspace-form-schema":t.json({structuredContent:o});return;case"refine-prompt":{let r=a??{},h=await x(r.text??"",r.instruction??"",r.formData);t.json({structuredContent:{refined:h}});return}case"issue-form-data":{let r=typeof a?.ref=="string"?a.ref:"";t.json({structuredContent:{formData:await j(r)}});return}case"create-workspace":t.json({structuredContent:{output:"Submitted \u2014 return to Claude; the workspace is being created there."}}),u({status:"submitted",formData:a?.formData??{},open:typeof a?.open=="boolean"?a.open:void 0});return;case"cancel-form":t.json({structuredContent:null}),u({status:"cancelled"});return;default:t.status(400).json({error:`unknown tool ${String(p)}`})}}catch(r){let h=(r instanceof y,r.message);t.status(500).json({error:h})}});let f=s.listen(0,"127.0.0.1",()=>{let{port:n}=f.address(),t=`http://127.0.0.1:${n}/`;console.error(`[workspaces] workspace form: ${t}`),e.open!==!1&&C(t)});f.on("error",()=>u({status:"cancelled"})),d=setTimeout(()=>u({status:"timeout"}),c)})}i(P,"promptViaLocalhostForm");export{I as a,P as b};
|
|
4
|
+
//# sourceMappingURL=chunk-4FGT5BTG.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{c as v,d as q,i as ut}from"./chunk-
|
|
3
|
+
import{c as v,d as q,i as ut}from"./chunk-4ADQJ3NO.js";import{a as T,c as Q}from"./chunk-6EEGEZLE.js";import{l as j,m as _,n as It}from"./chunk-AXMV4XZL.js";import{j as Ft,k as Rt,o as X,q as Z,r as ct}from"./chunk-ER73PEUY.js";import{d as Ct,e as jt,m as Mt}from"./chunk-ZDES3QTI.js";import{n as z}from"./chunk-67CKCUOX.js";import{b as C}from"./chunk-EP6B44PA.js";import{D as At,F as Nt,H as Tt,M as it,Q as at,a as Et,h as B,j as y,k as h,l as m,m as b,n as k,o as Ot,s as _t,w as Lt}from"./chunk-K4ZH6HZB.js";import{b as V}from"./chunk-NILGDPG6.js";import{a as i,e as vt,f as w}from"./chunk-ZUL6VITT.js";w();import*as A from"node:fs";import*as we from"node:os";import*as ye from"node:path";w();var tt=vt(Et(),1);import*as L from"node:fs";import*as Pt from"node:os";import*as Dt from"node:path";function lt(t){let e=et(t);return e===null?null:Q(e)}i(lt,"composeFile");function et(t){let e=Ee(t);if(e!==null&&Q(e)!==null)return e;let o;try{o=Tt(t)}catch{return e}return Q(o)!==null&&ve(o,t)?o:e}i(et,"workspaceForFeature");function ve(t,e){let o;try{o=L.readFileSync(Dt.join(t,".env"),"utf8")}catch{return!1}return o.split(`
|
|
4
4
|
`).some(r=>{let n=/^\s*(?:WERKMEISTER_)?FEATURE=(.*)$/.exec(r);return n!==null&&n[1].trim()===e})}i(ve,"envNamesFeature");function ft(t){try{return L.statSync(t).isFile()}catch{return!1}}i(ft,"isFile");function Ee(t){for(let e of[pt,dt]){let o;try{o=_(["docker","ps","-a","--filter",`label=${e}=${t}`,"--format",'{{.Label "com.docker.compose.project.working_dir"}}'],{capture:!0,timeout:M})}catch(n){if(n instanceof j)return null;throw n}if(o.status!==0)return null;let r=o.stdout.split(`
|
|
5
5
|
`).map(n=>n.trim()).find(Boolean);if(r)return r}return null}i(Ee,"workspaceFromContainerLabel");function Oe(t,e,o){return["docker","compose",...o?["-f",o]:[],"-p",Bt(t,o),...e]}i(Oe,"workspaceComposeArgv");function Ut(t){return`werkmeister-${t}`}i(Ut,"projectName");function Wt(t){return`sandbox-${t}`}i(Wt,"legacyProjectName");async function Y(t){let e=Wt(t);return(await q(e))?.length?e:Ut(t)}i(Y,"liveProject");function Bt(t,e){try{let o=e&&(0,tt.parse)(L.readFileSync(e,"utf8"));if(o&&typeof o.name=="string")return o.name}catch{}return Ut(t)}i(Bt,"fileProject");function _e(t,e,{removeVolumes:o=!1}={}){let r=Wt(t);Bt(t,e)!==r&&Le(r,`'${t}''s pre-rename project`,{removeVolumes:o})}i(_e,"retireLegacyProject");function Le(t,e,{removeVolumes:o=!1}={}){let r=`label=com.docker.compose.project=${t}`;try{let n=[["docker","ps","-aq","--filter",r]];if(o&&n.push(["docker","volume","ls","-q","--filter",r]),!n.some(c=>_(c,{capture:!0,timeout:M}).stdout.trim()))return;y(`Taking down ${e} ${t}`);let s=["down","--remove-orphans",...o?["--volumes"]:[]],a=_(["docker","compose","-p",t,...s],{capture:!0,cwd:Pt.tmpdir(),timeout:M});a.status!==0&&m(`Could not take down ${t}: ${a.stderr.trim()}`)}catch(n){m(`Could not take down ${t}: ${n instanceof Error?n.message:String(n)}`)}}i(Le,"takeDownProject");var M=300,Ht=Number(process.env.WERKMEISTER_UP_TIMEOUT_S||20*60);function Yt(t,e,{capture:o=!1,stream:r=!1,composePath:n=null}={}){let s=Gt(t,e,n);if(s===null)return null;try{return r?(_(s,{stdio:"inherit"}),null):Kt(_(s,{capture:o,timeout:M}),o)}catch(a){return Jt(a,M)}}i(Yt,"runCompose");async function mt(t,e,{capture:o=!1,composePath:r=null,signal:n,timeout:s=M}={}){let a=Gt(t,e,r);if(a===null)return null;try{return Kt(await It(a,{capture:o,timeout:s,signal:n}),o)}catch(c){return Jt(c,s)}}i(mt,"runComposeAsync");function Gt(t,e,o){if(o??=lt(t),o===null||!ft(o))return b(`No ${T} found for feature '${t}'.
|
|
6
6
|
Run 'werkmeister workspace init' (and 'werkmeister feature up') from the feature's workspace first.`),null;e.includes("up")&&Ae(o),(e.includes("up")||e.includes("down"))&&_e(t,o,{removeVolumes:e.includes("--volumes")});let r=Oe(t,e,o);return y(`Running: ${r.join(" ")}`),r}i(Gt,"composeCommand");function Ae(t){try{let e=(0,tt.parse)(L.readFileSync(t,"utf8")),o=Object.entries(e?.volumes??{}).filter(([,r])=>r?.external===!0).map(([r,n])=>n?.name??r);for(let r of o){let n=_(["docker","volume","create",r],{capture:!0});n.status!==0&&m(`Could not create shared volume '${r}': ${n.stderr.trim()}`)}}catch(e){m(`Could not create shared volumes: ${e instanceof Error?e.message:String(e)}`)}}i(Ae,"ensureSharedVolumes");function Kt(t,e){if(t.status!==0){let o=e?t.stderr:"";b(`docker compose failed (exit ${t.status})`),o&&k(`${B.DIM}${o.trim()}${B.RESET}
|
|
@@ -10,4 +10,4 @@ import{c as v,d as q,i as ut}from"./chunk-XDBPLBUZ.js";import{a as T,c as Q}from
|
|
|
10
10
|
`)));return{stop:i(()=>r.abort(),"stop"),done:n}}i(_o,"composeLogsStream");async function Lo(t){return(await q(await Y(t))??[]).map(o=>({name:o.name,status:o.state,health:o.health,ports:o.ports,service:o.service,role:F(o.labels,"role"),exitCode:o.exitCode}))}i(Lo,"getContainerStatus");function Ce(t,e){return e==="setup"||t.endsWith("-setup")}i(Ce,"isOneShotService");w();import*as p from"node:fs";import*as zt from"node:os";import*as yt from"node:path";import{setTimeout as je}from"node:timers/promises";var Me=i(()=>yt.join(V(zt.homedir()),"locks"),"lockDir"),Fe=.1;function Re(t){let e;try{e=Number.parseInt(p.readFileSync(t,"utf8").trim(),10)}catch{return!1}if(!Number.isInteger(e)||e<=0)return!0;try{return process.kill(e,0),!1}catch(o){return o.code==="ESRCH"}}i(Re,"holderIsDead");function Ie(t){try{let e=p.openSync(t,"wx");return p.writeSync(e,String(process.pid)),p.closeSync(e),!0}catch(e){if(e.code==="EEXIST"){if(Re(t))try{p.unlinkSync(t)}catch{}return!1}throw e}}i(Ie,"tryAcquire");async function g(t,e,{timeout:o}={}){let r=Me();p.mkdirSync(r,{recursive:!0});let n=yt.join(r,`${t}.lock`),s=o!==void 0?performance.now()+o*1e3:null;for(;!Ie(n);){if(s!==null&&performance.now()>=s)throw new Error(`Timed out after ${o}s waiting for lock '${t}' (${n}). The previous holder may have crashed without releasing it; if no werkmeister process is running, it is safe to delete this file and retry.`);await je(Fe*1e3)}try{return await e()}finally{try{p.unlinkSync(n)}catch{}}}i(g,"sandboxLock");w();var Pe={"":1,b:1,k:1024,m:1048576,g:1073741824,t:1099511627776};function ht(t){if(typeof t=="number")return t;let e=/^\s*(\d+(?:\.\d+)?)\s*([bkmgt]?)b?\s*$/i.exec(t);if(!e)throw new Error(`Not a size: '${t}'`);return Math.round(Number(e[1])*(Pe[e[2].toLowerCase()]??1))}i(ht,"parseSize");var Xt=["idle","human-check","working"];function De(t){return[...t.filter(e=>e.gate),...t.filter(e=>!e.gate)]}i(De,"queueOrder");function Zt(t,e,o,r){if(!r.services&&e.some(f=>f.feature===r.feature))return{kind:"admit"};if(r.cost.memory>t.memory||r.cost.cpus>t.cpus)return{kind:"never-fits",cost:r.cost};let n=e.reduce((f,J)=>({memory:f.memory+J.cost.memory,cpus:f.cpus+J.cost.cpus}),{memory:0,cpus:0}),s=i(f=>n.memory-f.memory+r.cost.memory<=t.memory&&n.cpus-f.cpus+r.cost.cpus<=t.cpus,"fits"),a=!!r.gate||!!r.services&&e.some(f=>f.feature===r.feature),c=o.find(f=>f.feature===r.feature),u={feature:r.feature,waitedMs:c?.waitedMs??0,gate:a},l=De(c?o.map(f=>f===c?u:f):[...o,u]),d=l.indexOf(u)+1,N=d===1,O=!!r.services&&e.some(f=>f.feature===r.feature&&f.busy),D=l[0].cost,$e=!!D&&n.memory+D.memory<=t.memory&&n.cpus+D.cpus<=t.cpus,xe=!N&&!O&&!$e&&!l[0].parked&&(l[0].gate||l[0].waitedMs>=3e5);if(s({memory:0,cpus:0})&&(r.byPerson||!xe))return{kind:"admit"};let ke=N&&(!!r.services||u.waitedMs>=3e5);if(t.preempt&&(r.byPerson||ke)){let J=(r.byPerson?Xt:Xt.slice(0,2)).flatMap(U=>e.filter(W=>W.rank===U&&!W.busy&&W.feature!==r.feature&&(W.cost.memory||W.cost.cpus))),kt=[],st={memory:0,cpus:0};for(let U of J)if(kt.push(U.feature),st.memory+=U.cost.memory,st.cpus+=U.cost.cpus,s(st))return{kind:"preempt",victims:kt}}return{kind:"wait",position:d}}i(Zt,"admit");function qt(t,e,o,r){for(let[n,s]of e)if(s===t)return n;if(r!==null&&r>=1&&r<=o&&!e.has(r))return r;for(let n=1;n<=o;n++)if(!e.has(n))return n;return null}i(qt,"pickSlot");w();w();var ee=vt(Et(),1);import{execFileSync as Ue}from"node:child_process";import{createHash as We}from"node:crypto";import*as $ from"node:fs";import*as te from"node:net";import*as E from"node:os";import*as S from"node:path";import{setTimeout as Be}from"node:timers/promises";var rt=30,oe=i(()=>S.join(Lt(),"scheduler"),"stateDir"),re=i(()=>S.join(oe(),"leases.json"),"leasesPath"),ne=i(()=>S.join(oe(),"queue.json"),"queuePath");function se(t,e,o){try{let r=JSON.parse($.readFileSync(t,"utf8"));return e(r)?r:o}catch{return o}}i(se,"readJson");function ie(t,e){$.mkdirSync(S.dirname(t),{recursive:!0}),Rt(t,e)}i(ie,"writeJson");var x=i(t=>typeof t=="object"&&t!==null&&!Array.isArray(t),"isDict");function I(){let t=se(re(),x,{}),e={};for(let[o,r]of Object.entries(t))x(r)&&Number.isInteger(r.slot)&&(e[o]={slot:r.slot,workspace:String(r.workspace??"")});return e}i(I,"readLeases");function gt(t){ie(re(),t)}i(gt,"writeLeases");function P(){return se(ne(),t=>Array.isArray(t),[]).map(String)}i(P,"readQueue");function nt(t){ie(ne(),t)}i(nt,"writeQueue");function ae(t){return g("scheduler",async()=>nt(P().filter(e=>e!==t)),{timeout:rt})}i(ae,"dequeue");function Zo(t,e){return g("scheduler",async()=>{let o=P().filter(r=>r!==t);Z(e,{position:o.length+1,reason:"preempted",since:new Date().toISOString()}),nt([...o,t])},{timeout:rt})}i(Zo,"enqueue");function qo(t,e,o){return g("scheduler",async()=>(Z(e,{position:1,reason:"waiting for capacity",...o,since:new Date().toISOString()}),nt([t,...P().filter(r=>r!==t)]),1),{timeout:rt})}i(qo,"requeueFirst");async function tr(t=()=>v().info()){let e=z().budget,o=x(e)?e:{},r={};if(o.memory===void 0||o.cpus===void 0)try{r=await t()}catch{}let n=o.memory!==void 0?ht(o.memory):r.MemTotal?r.MemTotal-2**30:1/0,s=o.cpus!==void 0?Number(o.cpus):r.NCPU??1/0;return{memory:n,cpus:s,preempt:o.preempt!==!1}}i(tr,"loadBudget");function ce(t){let e=z().budget,o=x(e)?Number(e.host_load??Number.NaN):Number.NaN;return Number.isFinite(o)&&o>=0?o:2*t}i(ce,"hostLoadLimit");function He(){let t=z().budget,e=x(t)?Number(t.free_memory??Number.NaN):Number.NaN;return Number.isFinite(e)&&e>=0?e:15}i(He,"freeMemoryLimit");function ue(t=process.platform){let e=E.totalmem();if(t!=="darwin")return{free:E.freemem(),total:e};let o=Number(Ue("sysctl",["-n","kern.memorystatus_level"],{encoding:"utf8"}));return{free:e*o/100,total:e}}i(ue,"readHostMemory");function le(t=ue){let e=He();if(e===0)return"";let o;try{let{free:r,total:n}=t();o=100*r/n}catch{return""}return Number.isFinite(o)&&o<e?`${o.toFixed(0)}% free, under budget.free_memory ${e}%`:""}i(le,"lowMemory");var St=15e3,R=9e4,Ye=6e4,Ge=i(()=>({load:E.loadavg(),cores:E.availableParallelism()}),"readHostLoad"),fe={hostLoad:Ge,hostMemory:ue,sleep:i(t=>Be(t),"sleep")},ot=i(t=>Number((t/6e4).toFixed(1)),"minutes");async function Ke(t=fe,e=process.platform,o="with-temp-home; --no-wait skips"){if(_t("NO_WAIT"))return"";let r=i(()=>{let{load:c,cores:u}=t.hostLoad(),l=e==="darwin"?0:ce(u);return{load:c[0],limit:l,loadOver:l!==0&&c[0]>l,memory:le(t.hostMemory)}},"read"),n=r();if(!n.loadOver&&!n.memory)return"";let s=[n.loadOver&&"host load",n.memory&&"free memory"].filter(Boolean).join(" and ");y(`waiting up to ${ot(R)} min for ${[n.loadOver&&`host load ${n.load.toFixed(1)} to fall to ${n.limit} (budget.host_load)`,n.memory&&`free memory to rise (${n.memory})`].filter(Boolean).join(" and ")} before ${o}`);let a=i(()=>[n.loadOver&&`host load ${n.load.toFixed(1)} over ${n.limit}`,n.memory&&`low memory (${n.memory})`].filter(Boolean).join(", "),"state");for(let c=St;c<=R;c+=St){if(await t.sleep(St),n=r(),!n.loadOver&&!n.memory)return`waited ${c/1e3} s for ${s}`;c%Ye===0&&c<R&&y(`still waiting: ${a()}, ${c/1e3} s so far, up to ${ot(R-c)} min left`)}return`ran with ${a()}; the ${ot(R)} min host-load wait is spent`}i(Ke,"waitForHostLoadNow");async function er(t,e,o=fe,r=process.platform){let n=Object.entries(G(t)).filter(([O,D])=>e?e.includes(O):!D?.profiles).filter(([,O])=>O?.labels?.["com.werkmeister.role"]==="setup").map(([O])=>O);if(!n.length)return;let s=n.join(", "),a=await Ke(o,r,`starting ${s}; WERKMEISTER_NO_WAIT=1 skips`);if(!a.startsWith("ran with"))return;let{load:c,cores:u}=o.hostLoad(),l=ce(u),d=le(o.hostMemory),N=[r!=="darwin"&&l!==0&&c[0]>l&&`host load ${c[0].toFixed(1)} is over ${l} (budget.host_load)`,d&&`memory is low (${d})`].filter(Boolean).join(" and ");throw new C(`${N||a} after the ${ot(R)} min wait; ${s} not started. Retry when load falls or memory frees, or set WERKMEISTER_NO_WAIT=1 to start anyway.`,"HOST_LOAD")}i(er,"waitForSetupLoad");function G(t,e=S.join(t,T)){try{let o=ee.parse($.readFileSync(e,"utf8"));return x(o?.services)?o.services:{}}catch{return{}}}i(G,"composeServices");function bt(t,e){let o={memory:0,cpus:0};for(let[r,n]of Object.entries(G(t))){if(!x(n)||(e?!e.includes(r):n.profiles))continue;let s=n.deploy?.resources,a=s?.reservations?.memory;a!==void 0&&(o.memory+=ht(a)),o.cpus+=Number(s?.limits?.cpus??0)||0}return o}i(bt,"featureCost");var me=i(t=>{let e=t?.depends_on;return Array.isArray(e)?e.map(String):x(e)?Object.keys(e):[]},"dependsOn");function or(t,e){return[e,...me(G(t)[e])]}i(or,"serviceStarts");async function rr(t,e){let o=G(S.dirname(t),t),r=me(o[e]);if(!r.length||!r.every(n=>Je(o[n])))return!1;for(let n of r){let s=o[n]?.container_name,a=s?await v().getContainer(String(s)).inspect().then(c=>c.State,()=>null):null;if(a?.Status!=="exited"||a.ExitCode!==0)return!1}return!0}i(rr,"setupsCurrent");function Je(t){if(t?.labels?.["com.werkmeister.role"]!=="setup")return!1;let e=/^node:(\d+)/.exec(String(t.image??""))?.[1],o=(t.volumes??[]).map(String).find(a=>a.endsWith(":/app"));if(!e||!o)return!1;let r=o.slice(0,-5),n=Buffer.concat(["package-lock.json","pnpm-lock.yaml"].flatMap(a=>{try{return[$.readFileSync(S.join(r,a))]}catch{return[]}})),s=`${We("sha256").update(n).digest("hex")} v${e}`;try{return $.readFileSync(S.join(r,".turbo/.werkmeister-install-hash"),"utf8").trim()===s}catch{return!1}}i(Je,"installStamped");var Qe=6e4;function Ve(t){let e=I();return t.filter(o=>{let r=e[o]?.workspace,n=r?X(r):null;if(!r||!n?.services||n.parked)return!0;let s=$.statSync(Ft(r),{throwIfNoEntry:!1})?.mtimeMs??0;return Date.now()-s<Qe?!0:(ct(r),!1)})}i(Ve,"withoutDeadWaiters");function ze(t,e,o=Date.now()){let r=I();return t.map(n=>{let s=r[n]?.workspace,a=s?X(s):null,c=a?.since?Date.parse(a.since):Number.NaN;return s&&a?.parked?{feature:n,waitedMs:Number.isFinite(c)?Math.max(0,o-c):0,gate:!1,parked:!0,cost:bt(s,a.services)}:{feature:n,waitedMs:Number.isFinite(c)?Math.max(0,o-c):0,gate:!!a?.gate||!!a?.services&&e.some(u=>u.feature===n),...s&&!a?.services&&{cost:bt(s)}}})}i(ze,"waiters");function nr(t,e,o,r,n,s){let a=bt(e,s?.services);return!a.memory&&!a.cpus?Promise.resolve({kind:"admit"}):g("scheduler",async()=>{let c=P(),u=Ve(c),l=Zt(n,r,ze(u,r),{feature:t,cost:a,byPerson:o,services:s?.services,...s?.gate&&{gate:!0}}),d=u;return l.kind==="wait"?(Z(e,{position:l.position,reason:"waiting for capacity",...s,since:X(e)?.since??new Date().toISOString()}),u.includes(t)||(d=[...u,t])):(d=u.filter(N=>N!==t),ct(e)),d.join(`
|
|
11
11
|
`)!==c.join(`
|
|
12
12
|
`)&&nt(d),l},{timeout:rt})}i(nr,"requestAdmission");function Xe(t,e){let o=[];for(let[r,n]of Object.entries(G(t)))if(!(!x(n)||(e?!e.includes(r):n.profiles)))for(let s of n.ports??[]){let a=Number.parseInt(String(s).split(":").slice(-2)[0]??"",10);Number.isInteger(a)&&o.push(a)}return o}i(Xe,"publishedPorts");function Ze(t){return new Promise(e=>{let o=te.createServer();o.once("error",r=>e(r.code==="EADDRINUSE")),o.listen(t,"0.0.0.0",()=>o.close(()=>e(!1)))})}i(Ze,"bound");async function sr(t,e,o){let r=new Map;try{for(let s of await v().listContainers()){let a=(s.Names[0]??"").replace(/^\//,""),c=s.Labels?.["com.werkmeister.feature"]??"";for(let u of s.Ports??[])u.PublicPort&&r.set(u.PublicPort,{name:a,feature:c})}}catch{}let n=[];for(let s of Xe(e,o)){let a=r.get(s);a?.feature!==t&&(a||await Ze(s))&&n.push({port:s,holder:a?.name??"a host process"})}return n}i(sr,"portHolders");var de=!1,pe=!1;function mr(){de=!0}i(mr,"ownScheduler");async function K(t,e,o,r){if(de||!Ct())return o();try{let{data:n,text:s}=await Mt("scheduler",{op:t,...e},{timeoutMs:r});return s&&k(s),n.value}catch(n){if(!(n instanceof jt))throw n;return pe||m(`${n.message} Scheduling in this process instead.`),pe=!0,o()}}i(K,"schedulerOp");function pr(){return K("queue",{},async()=>P())}i(pr,"waitingQueue");var he="com.werkmeister",pt=`${he}.feature`,Se="com.sandbox.local",dt=`${Se}.feature`;function F(t,e){return t?.[`${he}.${e}`]??t?.[`${Se}.${e}`]??""}i(F,"labelOf");var $t=30,qe=1e4;async function to(){let t;try{let e=await Promise.all([pt,dt].map(r=>v().listContainers({all:!0,filters:{label:[r]},abortSignal:AbortSignal.timeout(qe)}))),o=new Set;t=e.flat().filter(r=>!o.has(r.Names[0])&&o.add(r.Names[0]))}catch{return null}return t.map(e=>({name:(e.Names[0]??"").replace(/^\//,""),feature:F(e.Labels,"feature"),slot:F(e.Labels,"slot"),service:F(e.Labels,"service")}))}i(to,"queryLabeledContainers");function eo(){let t=at().feature_slots;return(typeof t=="object"&&t!==null&&!Array.isArray(t)?t.count:void 0)??12}i(eo,"slotCount");function oo(){let t=it();if(typeof t!="object"||t===null)return new Set;let e=new Set;for(let[o,r]of Object.entries(t))typeof r=="object"&&r!==null&&!Array.isArray(r)&&r.port_offset!==null&&r.port_offset!==void 0&&e.add(o);return e}i(oo,"routableServiceNames");async function xt(){let t=await to();if(t===null)return null;let e=oo(),o={};for(let r of t){let n=r.feature,s=Number.parseInt(r.slot,10);if(Number.isNaN(s)){m(`Container '${r.name}' has unparseable slot label: '${r.slot}'`);continue}let a=r.service,c=o[n];c||(c={slot:s,services:[]},o[n]=c),c.slot!==s&&(m(`Feature '${n}' has inconsistent slot labels across containers (saw ${c.slot} and ${s}) -- using ${s}`),c.slot=s),a&&e.has(a)&&!c.services.includes(a)&&c.services.push(a)}return o}i(xt,"getAllSlotsFromDocker");var be={labels:xt};function ro(t){let e=I();for(let[r,n]of Object.entries(e))n.workspace&&!A.existsSync(n.workspace)&&delete e[r];for(let[r,n]of Object.entries(t??{}))e[r]??={slot:n.slot,workspace:et(r)??""};let o=new Map;for(let[r,n]of Object.entries(e))o.set(n.slot,r);for(let[r,n]of Object.entries(t??{})){let s=o.get(n.slot);s&&s!==r&&m(`Slot ${n.slot} is leased to '${s}' but '${r}' has containers on it`),o.set(n.slot,r)}return{leases:e,held:o}}i(ro,"heldSlots");function no(t,e,o,r=be){return K("allocate",{feature:t,preferredSlot:e??null,workspace:o??null},()=>so(t,e,o,r))}i(no,"allocateSlot");function so(t,e,o,r){let n=eo();return g("allocate",async()=>{let{leases:s,held:a}=ro(await r.labels()),c=qt(t,a,n,e??null);if(c===null)throw b(`All ${n} feature slots are occupied!`),new Error("No available slots. Stop an existing feature with 'werkmeister feature down <feature>' first.");return s[t]?.slot!==c&&h(`Allocated slot ${c} for '${t}'`),s[t]={slot:c,workspace:o??s[t]?.workspace??et(t)??""},gt(s),c},{timeout:$t})}i(so,"allocateSlotHere");async function Or(t,e,o,r=be){let n=await r.labels(),s=await io(t);if(!s)try{return await no(t,o,e,r)}catch(c){throw new C(c instanceof Error?c.message:String(c),"SLOT_ALLOC")}let a=Object.entries(n??{}).find(([c,u])=>c!==t&&u.slot===s.slot);if(a){let[c]=a;throw new C(`Slot ${s.slot} is leased to '${t}' but '${c}' has containers on it \u2014 stop it or run 'werkmeister feature down ${c}'`,"SLOT_ALLOC")}return s.slot}i(Or,"requireLeasedSlot");function io(t){return K("lease",{feature:t},()=>g("allocate",()=>I()[t]??null,{timeout:$t}))}i(io,"slotLease");function _r(t){return K("release",{feature:t},()=>ao(t))}i(_r,"releaseSlot");async function ao(t){await g("allocate",()=>{let e=I();t in e&&(delete e[t],gt(e))},{timeout:$t}),await ae(t)}i(ao,"releaseSlotHere");async function wt(t){let e=(await ge())[t];return e?e.slot:null}i(wt,"getSlot");async function ge(){let t=await xt();return t===null?{}:t}i(ge,"getAllSlots");function co(t){return Nt(t,at())}i(co,"getPortRange");function uo(t,e){let[o]=co(t);return o+e}i(uo,"getServicePort");function lo(t,e,o,r){let n=e.type??"unknown";if(o.includes(t)){let c=e.port_offset??0;return{service:t,source:"local",endpoint:`localhost:${uo(r,c)}`,type:n}}let s=At(t,e);if(s)return{service:t,source:"baseline",endpoint:`${s.host}:${s.port}`,type:n};let a=e.k8s_forward_port;return a?{service:t,source:"k8s",endpoint:`localhost:${a}`,type:n}:{service:t,source:"none",endpoint:null,type:n}}i(lo,"classifyEndpoint");async function Lr(t){let e=await wt(t);if(e===null)throw new C(`Feature '${t}' is not running (no slot allocated)`,"NOT_RUNNING");let o=(await ge())[t]?.services??[],r=it(),n=[];for(let s of Object.keys(r).sort()){let a=r[s]??{};typeof a!="object"||a===null||Array.isArray(a)||n.push(lo(s,a,o,e))}return{feature:t,slot:e,endpoints:n}}i(Lr,"featureServices");async function Ar(){let t=ye.join(V(we.homedir()),"slots.json");if(!A.existsSync(t))return;let e;try{let n=JSON.parse(A.readFileSync(t,"utf8"));e=typeof n=="object"&&n!==null?n:{}}catch{e={}}let o=await xt()??{},r=Object.keys(e).filter(n=>typeof e[n]=="object"&&e[n]!==null&&!Array.isArray(e[n])&&!(n in o));r.length>0&&(m(`~/.werkmeister/slots.json had features with no labeled containers: ${r.join(", ")}`),m("These are now forgotten \u2014 restart them with 'werkmeister feature up' to re-register.")),y("Migrating: removing legacy ~/.werkmeister/slots.json (labels are now authoritative)");try{A.unlinkSync(t)}catch(n){m(`Could not remove ${t}: ${n}`)}}i(Ar,"migrateSlotsJson");export{et as a,Oe as b,Ut as c,Y as d,_e as e,Le as f,Ae as g,bo as h,go as i,$o as j,xo as k,ko as l,vo as m,Eo as n,Vt as o,Te as p,Oo as q,_o as r,Lo as s,Ce as t,g as u,De as v,I as w,P as x,ae as y,Zo as z,qo as A,tr as B,ce as C,ue as D,le as E,Ge as F,Ke as G,er as H,bt as I,or as J,rr as K,ze as L,nr as M,sr as N,mr as O,K as P,pr as Q,he as R,pt as S,Se as T,dt as U,F as V,eo as W,xt as X,no as Y,Or as Z,io as _,_r as $,wt as aa,ge as ba,co as ca,uo as da,lo as ea,Lr as fa,Ar as ga};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-4SK2WDFU.js.map
|