@crowdedkingdoms/crowdy-dsh 0.2.0-dev.1
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/LICENSE +21 -0
- package/README.md +175 -0
- package/dist/dsh-web/BUILD.json +118 -0
- package/dist/dsh-web/LICENSE.deepseek-harness +21 -0
- package/dist/dsh-web/THIRD_PARTY_NOTICES.md +226 -0
- package/dist/dsh-web/assets/client-Dbm2RGSD.js +159 -0
- package/dist/dsh-web/assets/fonts/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/dsh-web/assets/fonts/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/dsh-web/assets/index-BKQ_L1z6.js +117 -0
- package/dist/dsh-web/assets/index-DPX2bQLO.css +1 -0
- package/dist/dsh-web/assets/langs/c-BIGW1oBm.js +2 -0
- package/dist/dsh-web/assets/langs/cpp-DIPi6g--.js +2 -0
- package/dist/dsh-web/assets/langs/csharp-DSvCPggb.js +2 -0
- package/dist/dsh-web/assets/langs/css-CLj8gQPS.js +2 -0
- package/dist/dsh-web/assets/langs/go-C27-OAKa.js +2 -0
- package/dist/dsh-web/assets/langs/html-CfGypltT.js +2 -0
- package/dist/dsh-web/assets/langs/ini-BEwlwnbL.js +2 -0
- package/dist/dsh-web/assets/langs/java-CylS5w8V.js +2 -0
- package/dist/dsh-web/assets/langs/kotlin-BdnUsdx6.js +2 -0
- package/dist/dsh-web/assets/langs/less-B1dDrJ26.js +2 -0
- package/dist/dsh-web/assets/langs/lua-BaeVxFsk.js +2 -0
- package/dist/dsh-web/assets/langs/markdown-Cvjx9yec.js +2 -0
- package/dist/dsh-web/assets/langs/mdx-Cmh6b_Ma.js +2 -0
- package/dist/dsh-web/assets/langs/php-DJl5gRdb.js +2 -0
- package/dist/dsh-web/assets/langs/python-B6aJPvgy.js +2 -0
- package/dist/dsh-web/assets/langs/ruby-5eNB0pDK.js +2 -0
- package/dist/dsh-web/assets/langs/rust-B1yitclQ.js +2 -0
- package/dist/dsh-web/assets/langs/scss-D5BDwBP9.js +2 -0
- package/dist/dsh-web/assets/langs/sql-CRqJ_cUM.js +2 -0
- package/dist/dsh-web/assets/langs/swift-D82vCrfD.js +2 -0
- package/dist/dsh-web/assets/langs/toml-vGWfd6FD.js +2 -0
- package/dist/dsh-web/assets/langs/xml-sdJ4AIDG.js +2 -0
- package/dist/dsh-web/assets/langs/yaml-Buea-lGh.js +2 -0
- package/dist/dsh-web/assets/vendor-BNsW4eBh.css +1 -0
- package/dist/dsh-web/assets/vendor-CCJJTK99.js +411 -0
- package/dist/dsh-web/crowdy.html +17 -0
- package/dist/dsh-web/favicon.svg +8 -0
- package/dist/dsh-web/index.html +17 -0
- package/dist/dsh-web/manifest.webmanifest +16 -0
- package/dist/dsh-web/preview/bootstrap-CYECZNXt.js +2 -0
- package/dist/dsh-web/preview/crowdy-boot-D0e56jZN.js +2 -0
- package/dist/dsh-web/preview/vfs-image.tar.gz +0 -0
- package/dist/dsh-web/preview/worker-C8-_ANaz.js +109 -0
- package/package.json +101 -0
- package/presets/crowdy/agent.cordis.yml +140 -0
- package/presets/crowdy/preset.yml +3 -0
- package/profile/crowdy-node.patch.yml +34 -0
- package/profile/crowdy-web.patch.yml +97 -0
- package/upstream.json +7 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
(function(){"use strict";var zc={},Vc=Object.create,Mr=Object.defineProperty,Kc=Object.getOwnPropertyDescriptor,Xc=Object.getOwnPropertyNames,Yc=Object.getPrototypeOf,Qc=Object.prototype.hasOwnProperty,De=(e,r)=>()=>(r||(e((r={exports:{}}).exports,r),e=null),r.exports),We=(e,r)=>{let n={};for(var i in e)Mr(n,i,{get:e[i],enumerable:!0});return Mr(n,Symbol.toStringTag,{value:"Module"}),n},Zc=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(var o=Xc(r),s=0,c=o.length,t;s<c;s++)t=o[s],!Qc.call(e,t)&&t!==n&&Mr(e,t,{get:(d=>r[d]).bind(null,t),enumerable:!(i=Kc(r,t))||i.enumerable});return e},ji=(e,r,n)=>(n=e!=null?Vc(Yc(e)):{},Zc(Mr(n,"default",{value:e,enumerable:!0}),e));function Jc(e){const r=()=>e?.snapshot(),n=i=>{e?.restore(i)};return{snapshot:r,pause:i=>{const o=r();return Promise.resolve(i).then(s=>({ok:!0,value:s,snapshot:o}),s=>({ok:!1,error:s,snapshot:o}))},resume:i=>{if(n(i.snapshot),i.ok)return i.value;throw i.error},afterYield:(i,o)=>(n(i),o),iterator:i=>{const o=i,s=o[Symbol.asyncIterator];if(typeof s=="function")return s.call(o);const c=o[Symbol.iterator];if(typeof c!="function")throw new TypeError("webworker als: for-await source is neither async nor sync iterable");const t=c.call(o);return{next:async(...d)=>{const p=t.next(...d);return{done:p.done??!1,value:await p.value}},return:async d=>{const p=t.return?.(d)??{done:!0,value:void 0};return{done:p.done??!0,value:await p.value}}}},close:async i=>{try{return await i.return?.(void 0)}catch{return}}}}function Vt(e){const r=e.startsWith("/"),n=e.length>1&&e.endsWith("/"),i=[];for(const s of e.split("/"))if(!(s===""||s===".")){if(s===".."&&i.length>0&&i[i.length-1]!==".."){i.pop();continue}s===".."&&r||i.push(s)}const o=i.join("/");return r?"/"+o+(n&&o!==""?"/":""):o===""?n?"./":".":o+(n?"/":"")}function Ve(...e){const r=e.filter(n=>n!=="").join("/");return r===""?".":Vt(r)}function et(...e){let r="";for(const n of[...e].reverse())if(n!==""&&(r=r===""?n:`${n}/${r}`,n.startsWith("/")))break;return Vt(r.startsWith("/")?r:`/${r}`)}function ze(e){const r=Vt(e).replace(/\/+$/,""),n=r.lastIndexOf("/");return n<0?".":n===0?"/":r.slice(0,n)}function Or(e,r){const n=Vt(e).replace(/\/+$/,""),i=n.slice(n.lastIndexOf("/")+1);return r!==void 0&&r!==i&&i.endsWith(r)?i.slice(0,-r.length):i}function eu(e){return e.startsWith("/")}function Rn(e){return`file://${et(e).split("/").map(r=>encodeURIComponent(r)).join("/")}`}function qi(e){const r=typeof e=="string"?e:e.href;if(!r.startsWith("file://"))throw new Error(`webworker vfs: not a file URL: ${r}`);return decodeURIComponent(r.slice(7).replace(/[?#].*$/,""))||"/"}const tu="home",ru=["home/","workspace/","tmp/"],Gi=["home","workspace"],zi="dsh-worker-transform/1",nu=["exports","require","module","__filename","__dirname","__dsh$meta","__als"],iu=["browser","require","import","default"],su=[".js",".json",".mjs",".cjs"];function ou(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var au=class{vfs;root;staticModules;staticPrefixes;conditions;als;modules=new Map;manifests=new Map;stack=[];internal;constructor(e){this.vfs=e.vfs,this.root=e.root??"/dsh",this.staticModules=new Map(Object.entries(e.staticModules)),this.staticPrefixes=Object.entries(e.staticModulePrefixes??{}).sort(([n],[i])=>i.length-n.length),this.conditions=new Set(e.conditions??iu),this.als=Jc(e.alsCausality);const r=(n,i)=>{const o=i===void 0?this.root:this.baseDirectoryOf(i),s=this.resolve(n,o);return s.kind==="static"?{format:"builtin",url:s.specifier}:{format:s.path.endsWith(".json")?"json":"commonjs",url:Rn(s.path)}};this.internal={version:"worker",import:async(n,i)=>{const o=i===void 0?this.root:this.baseDirectoryOf(i);return this.load(this.resolve(n,o))},resolve:async(n,i)=>r(n,i),resolveSync:r}}fail(e){const r=this.stack.length===0?"":` (importer chain: ${this.stack.join(" -> ")})`;throw new Error(`webworker modules: ${e}${r}`)}baseDirectoryOf(e){const r=typeof e=="string"?e:e.href,n=r.startsWith("file://")?qi(r):r;return n.endsWith("/")||this.vfs.existsSync(n)&&this.vfs.statSync(n).isDirectory()?et(n):ze(n)}manifestOf(e){const r=this.manifests.get(e);if(r!==void 0)return r;const n=Ve(e,"package.json"),i=this.vfs.readFileSync(n,"utf8");let o;try{o=JSON.parse(i)}catch(c){this.fail(`${n} is not valid JSON: ${c.message}`)}ou(o)||this.fail(`${n} does not hold an object`);const s=o;return this.manifests.set(e,s),s}selectExport(e,r,n){if(e===null)return;if(typeof e=="string")return r==="."?e:void 0;if(Array.isArray(e)){for(const o of e){const s=this.selectExport(o,r,n);if(s!==void 0)return s}return}const i=Object.entries(e);if(!i.some(([o])=>o==="."||o.startsWith("./")))return r!=="."?void 0:this.selectCondition(e,n);for(const[o,s]of i)if(o===r)return typeof s=="string"?s:this.selectCondition(s,n,r);for(const[o,s]of i){const c=o.indexOf("*");if(c<0)continue;const t=o.slice(0,c),d=o.slice(c+1);if(!r.startsWith(t)||!r.endsWith(d))continue;const p=r.slice(t.length,r.length-d.length),y=typeof s=="string"?s:this.selectCondition(s,n,r);if(y!==void 0)return y.replaceAll("*",p)}}selectCondition(e,r,n="."){if(e!==null){if(typeof e=="string")return e;if(Array.isArray(e)){for(const i of e){const o=this.selectCondition(i,r,n);if(o!==void 0)return o}return}for(const[i,o]of Object.entries(e)){if(!this.conditions.has(i))continue;const s=this.selectCondition(o,r,n);if(s!==void 0)return s}}}probe(e,r){const n=[e,...su.map(i=>e+i)];for(const i of n)if(this.vfs.existsSync(i)&&this.vfs.statSync(i).isFile())return i;if(this.vfs.existsSync(e)&&this.vfs.statSync(e).isDirectory()){if(this.vfs.existsSync(Ve(e,"package.json"))){const i=this.manifestOf(e).main;if(i!==void 0)return this.probe(Ve(e,i),r)}return this.probe(Ve(e,"index"),r)}return this.fail(`cannot resolve "${r}": no file at ${n.join(", ")}`)}staticModule(e){const r=this.staticModules.get(e);if(r!==void 0)return r;for(const[n,i]of this.staticPrefixes)if(e.startsWith(n))return i;return this.staticModules.get(`node:${e}`)}resolve(e,r){const n=this.staticModule(e);if(n!==void 0)return{kind:"static",specifier:e,factory:n};if(e.startsWith("cordis:")||e.startsWith("node:"))return this.fail(`no static module is registered for "${e}"`);if(e.startsWith("file://"))return{kind:"file",path:this.probe(qi(e),e)};if(e.startsWith("."))return{kind:"file",path:this.probe(Ve(r,e),e)};if(eu(e))return{kind:"file",path:this.probe(e,e)};const i=e.split("/"),o=e.startsWith("@")?i.slice(0,2).join("/"):i[0]??e,s=e.slice(o.length).replace(/^\//,""),c=Ve(this.root,"node_modules",o);if(!this.vfs.existsSync(Ve(c,"package.json")))return this.fail(`cannot resolve "${e}": ${c}/package.json is not in the image`);const t=this.manifestOf(c),d=s===""?".":`./${s}`;if(t.exports!==void 0){const y=this.selectExport(t.exports,d,o);return y===void 0?this.fail(`"${o}" does not export "${d}" under conditions [${[...this.conditions].join(", ")}]`):{kind:"file",path:this.probe(Ve(c,y),e)}}const p=d==="."?t.main??"index.js":s;return{kind:"file",path:this.probe(Ve(c,p),e)}}load(e){if(e.kind==="static")return e.factory();const r=e.path,n=this.modules.get(r);if(n!==void 0)return n.module.exports;if(r.endsWith(".json")){const o=JSON.parse(this.vfs.readFileSync(r,"utf8"));return this.modules.set(r,{module:{exports:o}}),o}const i={module:{exports:{}}};this.modules.set(r,i),this.stack.push(r);try{const o=this.vfs.readFileSync(r,"utf8"),s=this.compile(o,r),c=ze(r);return s(i.module.exports,this.requireFrom(c),i.module,r,c,{url:Rn(r),resolve:t=>{const d=this.resolve(t,c);return d.kind==="static"?d.specifier:Rn(d.path)}},this.als),i.module.exports}catch(o){throw this.modules.delete(r),o}finally{this.stack.pop()}}compile(e,r){try{return new Function(...nu,e)}catch(n){n instanceof SyntaxError&&/await/i.test(n.message)&&this.fail(`${r} uses top-level await, which cannot run as CommonJS in the worker: ${n.message}`),n instanceof SyntaxError&&/import|export/i.test(n.message)&&this.fail(`${r} still carries module syntax, so the image was not lowered by the packer (${n.message}); rebuild the image`),this.fail(`${r} failed to compile: ${n.message}`)}}requireFrom(e){const r=i=>this.load(this.resolve(i,e)),n=(i=>{const o=this.resolve(i,e);return o.kind==="static"?this.fail(`"${i}" is a worker-provided module and has no VFS path`):o.path});return n.paths=i=>this.staticModule(i)!==void 0||i.startsWith("node:")?null:i.startsWith(".")?[et(e,".")]:[Ve(this.root,"node_modules")],Object.assign(r,{resolve:n})}createRequire(e){return this.requireFrom(this.baseDirectoryOf(e))}usage(){return{modules:this.modules.size}}};let Tn;function lu(e){Tn=e}function Vi(){if(Tn===void 0)throw new Error("webworker modules: no loader is mounted; the worker entry must call setActiveModuleLoader before any createRequire use");return Tn}const Nr=new Map;let Ki=1;function cu(){Ki+=1;const e={pid:Ki,signal:void 0,process:void 0};return Nr.set(e.pid,e),e}function Xi(e){Nr.delete(e)}function uu(e){return Nr.has(Math.abs(e))}function Yi(e,r){const n=Nr.get(Math.abs(e));return n===void 0?!1:(n.signal??=r,r==="SIGKILL"?n.process?.destroy():n.process?.interrupt(),!0)}function Qi(e){const r=performance.now(),n=o=>s=>(console[o](s.replace(/\n$/,"")),!0),i={env:{...e.env},argv:[...e.argv??["node","dsh-webworker"]],execArgv:[],title:"dsh-webworker",platform:"linux",arch:"x64",pid:1,version:"v0.0.0",versions:{node:"0.0.0"},cwd:()=>e.cwd,getBuiltinModule:o=>{let s;try{s=Vi().resolve(o,"/")}catch{return}return s.kind==="static"?s.factory():void 0},kill:(o,s="SIGTERM")=>{if(s===0){if(uu(o))return!0;const c=new Error("kill ESRCH");throw c.code="ESRCH",c.syscall="kill",c}return Yi(o,s)},nextTick:(o,...s)=>{queueMicrotask(()=>{o(...s)})},stdout:{write:n("log")},stderr:{write:n("error")},on:()=>i,off:()=>i,once:()=>i,prependListener:()=>i,prependOnceListener:()=>i,removeListener:()=>i,removeAllListeners:()=>i,listeners:()=>[],listenerCount:()=>0,setMaxListeners:()=>i,emit:()=>!1,hrtime:{bigint:()=>BigInt(Math.round((performance.now()-r)*1e6))},uptime:()=>(performance.now()-r)/1e3,exit:o=>{console.warn(`webworker process: exit(${String(o??0)}) requested; the worker keeps running`)}};return globalThis.process=i,i}function fu(e){if(typeof e!="object"||e===null)throw new Error(`webworker tunnel: message is not a frame: ${String(e)}`);const r=e;if(r.t==="init"){if(typeof r.image!="string")throw new Error("webworker tunnel: init frame needs a string image url");if(!Array.isArray(r.overlays)||r.overlays.some(s=>typeof s!="string"))throw new Error("webworker tunnel: init frame needs an array of string overlay urls");return{t:"init",image:r.image,overlays:r.overlays}}const n=r.id;if(typeof n!="string"&&typeof n!="number")throw new Error(`webworker tunnel: frame has no usable id: ${JSON.stringify(r.id)}`);if(r.t==="abort")return{t:"abort",id:n};if(r.t==="stream-open"){if(typeof r.endpoint!="string"||r.endpoint.length===0)throw new Error(`webworker tunnel: stream ${String(n)} needs a non-empty endpoint`);return{t:"stream-open",id:n,endpoint:r.endpoint,payload:r.payload}}if(r.t!=="req")throw new Error(`webworker tunnel: unknown frame type ${JSON.stringify(r.t)}`);if(typeof r.method!="string"||typeof r.url!="string")throw new Error(`webworker tunnel: request ${String(n)} needs string method and url`);if(typeof r.headers!="object"||r.headers===null)throw new Error(`webworker tunnel: request ${String(n)} needs a headers object`);const i={};for(const[s,c]of Object.entries(r.headers))typeof c=="string"&&(i[s.toLowerCase()]=c);const o=r.body;if(o!==void 0&&!(o instanceof ArrayBuffer)&&!(o instanceof Blob)&&!(o instanceof ReadableStream))throw new Error(`webworker tunnel: request ${String(n)} body must be an ArrayBuffer, Blob, or ReadableStream`);return{t:"req",id:n,method:r.method,url:r.url,headers:i,body:o}}const Zi=new TextEncoder;function du(e,r){const n=new Map;let i=200,o={},s=!1,c=!1,t=!1;const d=m=>{for(const v of[...n.get(m)??[]])v()},p={url:e.url,method:e.method,headers:e.headers,destroy:()=>{t=!0},async*[Symbol.asyncIterator](){if(e.body!==void 0){if(e.body instanceof Blob){for await(const m of e.body.stream()){if(t)return;m.byteLength>0&&(yield m)}return}if(e.body instanceof ReadableStream){for await(const m of e.body){if(t)return;if(!(m instanceof Uint8Array))throw new TypeError("webworker tunnel: request stream produced a non-Uint8Array chunk");m.byteLength>0&&(yield m)}return}t||e.body.byteLength===0||(yield new Uint8Array(e.body))}}},y={writeHead:(m,v)=>{if(i=m,v!==void 0){o={};for(const[T,$]of Object.entries(v))o[T.toLowerCase()]=String($)}return y},write:m=>c||t?!1:(s||(s=!0,r.head(i,o)),r.chunk(typeof m=="string"?Zi.encode(m):m),!0),end:m=>{if(c)return y;c=!0;const v=m===void 0?void 0:typeof m=="string"?Zi.encode(m):m;return s?(v!==void 0&&r.chunk(v),r.end()):r.end({status:i,headers:o,body:v}),d("close"),y},destroy:()=>{c||(c=!0,r.fail(`response destroyed for ${e.method} ${e.url}`),d("close"))},on:(m,v)=>{const T=n.get(m)??new Set;return T.add(v),n.set(m,T),y},off:(m,v)=>(n.get(m)?.delete(v),y)};return y.once=y.on,Object.defineProperty(y,"headersSent",{get:()=>s}),Object.defineProperty(y,"writableEnded",{get:()=>c}),{req:p,res:y,get aborted(){return t},abort:()=>{c||(t=!0,c=!0,d("aborted"),d("close"))}}}const In="127.0.0.1",Ji=new TextEncoder;function hu(e){const r=new Set,n=[],i=(o,s)=>{if(o==null||r.has(o)||s>6)return;r.add(o);const c=" ".repeat(s);if(!(o instanceof Error)){const t=typeof o=="string"?o:JSON.stringify(o);n.push(`${c}${t??typeof o}`);return}if(n.push(`${c}${o.name}: ${o.message}`),o instanceof AggregateError)for(const t of o.errors)i(t,s+1);i(o.cause,s+1)};return i(e,0),n.join(`
|
|
2
|
+
`)}function kn(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}var pu=class{calls=[];target;settle;settled=new Promise(e=>{this.settle=e});sink={head:(e,r)=>{this.record(()=>{this.target?.head(e,r)}),this.settle?.({streamed:!0,status:e})},chunk:e=>{this.record(()=>{this.target?.chunk(e)})},end:e=>{this.record(()=>{this.target?.end(e)}),this.settle?.({streamed:e===void 0,status:e?.status??200})},fail:e=>{this.record(()=>{this.target?.fail(e)}),this.settle?.({streamed:!0,status:500})}};record(e){this.target===void 0?this.calls.push(e):e()}flushTo(e){this.target=e;for(const r of this.calls.splice(0))r()}},yu=class{port;requestListener;privilegedMethods;unaryApiLane;queue=[];inFlight=new Map;seams;failure;listener;constructor(e){this.port=e.port,this.requestListener=e.requestListener,this.privilegedMethods=e.privilegedMethods,this.unaryApiLane=e.unaryApiLane??"route"}handleMessage(e){const r=fu(e);if(r.t==="init")throw new Error("webworker tunnel: duplicate init frame; the tunnel is already open");if(r.t==="abort"){this.inFlight.get(r.id)?.abort(),this.inFlight.delete(r.id);const n=this.queue.findIndex(i=>i.id===r.id);n!==-1&&this.queue.splice(n,1);return}if(this.failure!==void 0){this.refuse(r,this.failure);return}if(this.seams===void 0){this.queue.push(r);return}this.dispatchFrame(r)}serve(e){this.seams=e,console.info(`webworker tunnel: serving (unary /api lane=${this.unaryApiLane}${this.unaryApiLane==="route"?" with 401/403 retry":""}, privileged set=${this.privilegedMethods===void 0?"none":String(this.privilegedMethods.size)}, queued=${String(this.queue.length)})`);for(const r of this.queue.splice(0))this.dispatchFrame(r)}fail(e){const r=hu(e);this.failure=r;for(const n of this.queue.splice(0))this.refuse(n,r)}send(e,r){this.port.postMessage(e,r)}refuse(e,r){if(e.t==="stream-open"){this.send({t:"stream-error",id:e.id,failure:{kind:"carrier",message:r}});return}const n=kn(Ji.encode(r));this.send({t:"res",id:e.id,status:503,headers:{"content-type":"text/plain; charset=utf-8"},body:n,message:r},[n])}dispatchFrame(e){e.t==="stream-open"?this.serveStream(e):this.serveRequest(e)}async serveStream(e){if(this.seams===void 0){this.refuse(e,"webworker tunnel: Remote stream requested before the host tree is serving");return}const r=this.seams,n=new AbortController;this.inFlight.set(e.id,{abort:()=>{n.abort()}});try{const i=await r.openStream(e.endpoint,e.payload,n.signal);for await(const o of i){if(n.signal.aborted)return;this.send({t:"stream-item",id:e.id,value:o})}n.signal.aborted||this.send({t:"stream-end",id:e.id})}catch(i){if(!n.signal.aborted){const o=r.streamFailure(i);this.send({t:"stream-error",id:e.id,failure:{kind:"remote",...o}})}}finally{this.inFlight.delete(e.id)}}sinkFor(e){const r=this.send.bind(this),n=this.inFlight;return{head(i,o){r({t:"res-head",id:e,status:i,headers:o})},chunk(i){const o=kn(i);r({t:"res-chunk",id:e,chunk:o},[o])},end(i){if(i===void 0)r({t:"res-end",id:e});else{const o=i.body===void 0?void 0:kn(i.body);r({t:"res",id:e,status:i.status,headers:i.headers,body:o},o===void 0?void 0:[o])}n.delete(e)},fail(i){r({t:"res-err",id:e,message:i}),n.delete(e)}}}pathFrame(e){const r=new URL(e.url,`http://${In}`);return{frame:{...e,url:`${r.pathname}${r.search}`,headers:{...e.headers,host:In}},path:r.pathname}}async serveRequest(e){const r=this.sinkFor(e.id);try{const{frame:n,path:i}=this.pathFrame(e);if(i==="/__boot__"){this.serveBoot(e,r);return}if(i.startsWith("/api/")){await this.serveApi(e,n,i,r);return}this.dispatch(n,r)}catch(n){r.fail(n instanceof Error?n.message:String(n))}}async whenListener(){return this.listener??=await this.requestListener(),this.listener}dispatch(e,r,n){const i=du(e,n??r);this.inFlight.set(e.id,i);const o=this.listener;return o!==void 0?(o(i.req,i.res),i):(this.whenListener().then(s=>{i.aborted||s(i.req,i.res)},s=>{r.fail(s instanceof Error?s.message:String(s))}),i)}async serveApi(e,r,n,i){const o=n.slice(5);if(this.unaryApiLane==="direct"||this.privilegedMethods?.has(o)===!0){await this.serveDirect(e,i);return}const s=new pu,c=this.dispatch(r,i,s.sink);let t=()=>{};const d=new Promise(y=>{t=()=>{y("aborted")}});this.inFlight.set(r.id,{abort:()=>{c.abort(),t()}});const p=await Promise.race([s.settled,d]);if(!(p==="aborted"||c.aborted)){if(p.status===401||p.status===403){console.debug(`webworker tunnel: route lane refused ${o} with ${String(p.status)}; answering on the direct lane`),await this.serveDirect(e,i);return}s.flushTo(i)}}serveBoot(e,r){if(this.seams===void 0)throw new Error("webworker tunnel: boot payload requested before the host tree is serving");if(e.method!=="GET"){r.end({status:405,headers:{allow:"GET"}});return}const n=Ji.encode(JSON.stringify(this.seams.bootPayload()));r.end({status:200,headers:{"content-type":"application/json; charset=utf-8","cache-control":"no-store"},body:n})}async serveDirect(e,r){if(this.seams===void 0)throw new Error("webworker tunnel: direct fetch requested before the host tree is serving");const n=new AbortController;this.inFlight.set(e.id,{abort:()=>{n.abort()}});const i=new Headers;for(const[d,p]of Object.entries(e.headers))try{i.set(d,p)}catch{}const o=new Request(new URL(e.url,`http://${In}`),{method:e.method,headers:i,body:e.body===void 0||e.method==="GET"||e.method==="HEAD"?null:e.body,signal:n.signal}),s=await this.seams.directFetch(o),c={};if(s.headers.forEach((d,p)=>{c[p]=d}),!(s.body!==null&&(c["content-type"]??"").startsWith("text/event-stream"))){const d=await s.arrayBuffer();r.end({status:s.status,headers:c,body:d.byteLength===0?void 0:new Uint8Array(d)});return}r.head(s.status,c);const t=s.body.getReader();this.inFlight.set(e.id,{abort:()=>{n.abort(),t.cancel().catch(()=>{})}});try{for(;;){const{done:d,value:p}=await t.read();if(d)break;r.chunk(p)}r.end()}catch(d){r.fail(d instanceof Error?d.message:String(d))}finally{t.releaseLock()}}};const es=[31,139],gu=8,wu=e=>[...e.slice(0,gu)].map(r=>r.toString(16).padStart(2,"0")).join(" ");function bu(e){let r=new Uint8Array(0),n=!1;const i=o=>new Error(`webworker image: ${e} is not the gzip-compressed tar this deployment serves as its image (expected a member starting 1f 8b, read ${o.byteLength===0?"an empty body":wu(o)}); a host that answered with a Content-Encoding the transport already decoded, or a build that wrote the archive uncompressed, arrives exactly this way`);return new TransformStream({transform:(o,s)=>{if(n){s.enqueue(o);return}const c=new Uint8Array(r.byteLength+o.byteLength);if(c.set(r),c.set(o,r.byteLength),r=c,!(r.byteLength<es.length)){if(es.some((t,d)=>r[d]!==t))throw i(r);n=!0,s.enqueue(r)}},flush:()=>{if(!n)throw i(r)}})}async function ts(e,r){const n=e.pipeThrough(bu(r)).pipeThrough(new DecompressionStream("gzip"));return new Uint8Array(await new Response(n).arrayBuffer())}async function mu(e,r){const n=new Response(e).body;if(n===null)throw new Error(`webworker image: ${r} produced no readable body`);return await ts(n,r)}new TextEncoder;const vu=new TextDecoder,lr=512;function Dr(e,r,n){let i=r;for(;i<r+n&&e[i]!==0;)i+=1;return vu.decode(e.subarray(r,i))}function rs(e){const r=[];let n=0;for(;n+lr<=e.length;){const i=e.subarray(n,n+lr);if(i.every(v=>v===0))break;const o=Dr(i,0,100),s=Dr(i,345,155),c=s===""?o:`${s}/${o}`,t=Number.parseInt(Dr(i,124,12).trim()||"0",8),d=Number.parseInt(Dr(i,100,8).trim()||"0",8)&511,p=i[156],y=p===53||c.endsWith("/");if(p!==48&&p!==0&&p!==53)throw new Error(`vfs tar: unsupported entry type ${String.fromCharCode(p??0)} for "${c}"`);const m=n+lr;r.push({name:c,bytes:e.subarray(m,m+t),directory:y,mode:d}),n=m+Math.ceil(t/lr)*lr}return r}const ns=new TextDecoder,cr=new TextEncoder,is=420,Pr=493;function Pe(e,r,n,i){const o=new Error(`${e}: ${r} failed, ${r} '${n}'`);throw o.code=e,o.path=n,o.syscall=r,o}function ss(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}function os(e,r,n,i,o){return{size:e,ino:Number(i),mtimeMs:r,ctimeMs:r,atimeMs:r,birthtimeMs:r,mtime:new Date(r),mode:(n?16384:32768)|o&511,isFile:()=>!n,isDirectory:()=>n,isSymbolicLink:()=>!1,isFIFO:()=>!1,isSocket:()=>!1,isBlockDevice:()=>!1,isCharacterDevice:()=>!1}}function as(e,r,n,i,o,s=1){const c=BigInt(Math.trunc(r)),t=c*1000000n,d=new Date(r);return{size:BigInt(e),mode:BigInt((n?16384:32768)|o&511),dev:1n,ino:i,nlink:BigInt(s),mtimeMs:c,mtimeNs:t,ctimeMs:c,ctimeNs:t,atimeMs:c,atimeNs:t,birthtimeMs:c,birthtimeNs:t,mtime:d,ctime:d,atime:d,birthtime:d,isFile:()=>!n,isDirectory:()=>n,isSymbolicLink:()=>!1,isFIFO:()=>!1,isSocket:()=>!1,isBlockDevice:()=>!1,isCharacterDevice:()=>!1}}function _u(e){const r=e[0],n=e.slice(1).split(""),i=n.every(s=>s==="+"||s==="x"||s==="s"),o=new Set(n).size===n.length;if(r!=="r"&&r!=="w"&&r!=="a"||!i||!o||r==="r"&&e.includes("x")){const s=new TypeError(`The argument 'flags' is invalid. Received '${e}'`);throw s.code="ERR_INVALID_ARG_VALUE",s}return{readable:r==="r"||e.includes("+"),writable:r!=="r"||e.includes("+"),append:r==="a",create:r==="w"||r==="a",truncate:r==="w",exclusive:e.includes("x")}}function Su(e,r){if(!Number.isSafeInteger(r)||r<0){const i=new RangeError(`The value of "len" is out of range. It must be >= 0. Received ${String(r)}`);throw i.code="ERR_OUT_OF_RANGE",i}const n=new Uint8Array(r);return n.set(e.subarray(0,r)),n}var Eu=class{files=new Map;directories=new Set(["/"]);directoryModes=new Map;directoryMtimes=new Map;mutationListeners=new Set;sink;temporaries=0;identities=new Map;lastIdentity=0n;constructor(e={}){this.sink=e.sink}async flush(){await this.sink?.flush()}subscribe(e){return this.mutationListeners.add(e),()=>{this.mutationListeners.delete(e)}}publish(e){const r=[...this.sink===void 0?[]:[n=>{this.sink?.record(n)}],...this.mutationListeners];for(const n of r)try{n(e)}catch(i){console.error("webworker vfs: mutation observer failed",i)}}promises={readFile:async(e,r)=>this.readFileSync(e,r),writeFile:async(e,r,n)=>{this.writeFileSync(e,r,n)},appendFile:async(e,r)=>{this.appendFileSync(e,r)},mkdir:async(e,r)=>this.mkdirSync(e,r),readdir:async(e,r)=>this.readdirSync(e,r),stat:async(e,r)=>this.statSync(e,r),lstat:async(e,r)=>this.statSync(e,r),realpath:async e=>this.realpathSync(e),rename:async(e,r)=>{this.renameSync(e,r)},unlink:async e=>{this.unlinkSync(e)},rm:async(e,r)=>{this.rmSync(e,r)},mkdtemp:async e=>this.mkdtempSync(e),link:async(e,r)=>{this.linkSync(e,r)},truncate:async(e,r)=>{this.truncateSync(e,r)},chmod:async(e,r)=>{this.chmodSync(e,r)},opendir:async e=>this.opendir(e),open:async(e,r,n)=>this.open(e,r,n),access:async e=>{const r=Vt(et(e));!this.files.has(r)&&!this.directories.has(r)&&Pe("ENOENT","access",r)}};key(e){const r=Vt(et(e));return r.length>1&&r.endsWith("/")?r.slice(0,-1):r}readFileSync(e,r){const n=this.key(e),i=this.files.get(n);return i===void 0&&(this.directories.has(n)&&Pe("EISDIR","read",n),Pe("ENOENT","open",n)),ss(r)===void 0?i.bytes:ns.decode(i.bytes)}existsSync(e){const r=this.key(e);return this.files.has(r)||this.directories.has(r)}statSync(e,r){const n=this.key(e),i=this.files.get(n),[o,s,c,t]=i!==void 0?[i.bytes.length,i.mtimeMs,!1,i.mode]:this.directories.has(n)?[0,this.directoryMtimes.get(n)??0,!0,this.directoryModes.get(n)??Pr]:Pe("ENOENT","stat",n),d=i===void 0?this.identityOf(n):this.identityOfFile(i);return r?.bigint===!0?as(o,s,c,d,t,i===void 0?1:this.fileLinkCount(i)):os(o,s,c,d,t)}plainStats(e){return this.statSync(e)}identityOf(e){const r=this.identities.get(e);return r!==void 0?r:(this.lastIdentity+=1n,this.identities.set(e,this.lastIdentity),this.lastIdentity)}identityOfFile(e){return e.identity!==void 0||(this.lastIdentity+=1n,e.identity=this.lastIdentity),e.identity}fileLinkCount(e){return typeof e.paths=="string"?1:e.paths?.size??0}addFilePath(e,r){e.paths===void 0?e.paths=r:typeof e.paths=="string"?e.paths=new Set([e.paths,r]):e.paths.add(r)}removeFilePath(e,r){if(typeof e.paths=="string"){e.paths=void 0;return}if(e.paths!==void 0&&(e.paths.delete(r),e.paths.size===1)){const[n]=e.paths;e.paths=n}}setFile(e,r){const n=this.files.get(e);n!==r&&(n!==void 0&&this.removeFilePath(n,e),this.files.set(e,r),this.addFilePath(r,e))}deleteFile(e){const r=this.files.get(e);if(r!==void 0)return this.files.delete(e),this.removeFilePath(r,e),r}publishFilePath(e,r,n){this.publish({kind:"write",path:r,bytes:e.bytes,mode:e.mode,entryChanged:!1,...n===void 0?{}:{appendedFrom:n}})}publishFile(e,r){if(typeof e.paths=="string"){this.publishFilePath(e,e.paths,r);return}if(e.paths!==void 0)for(const n of e.paths)this.publishFilePath(e,n,r)}replaceFile(e,r,n){e.bytes=r,e.mtimeMs=this.touchNode(e),this.publishFile(e,n)}writeFileNode(e,r,n){const i=Math.max(0,r),o=e.bytes.length,s=new Uint8Array(Math.max(o,i+n.length));return s.set(e.bytes),s.set(n,i),this.replaceFile(e,s,i===o?o:void 0),n.length}truncateFile(e,r){this.replaceFile(e,Su(e.bytes,r))}chmodFile(e,r){if(e.mode=r&511,typeof e.paths=="string")this.publish({kind:"chmod",path:e.paths,mode:e.mode});else if(e.paths!==void 0)for(const n of e.paths)this.publish({kind:"chmod",path:n,mode:e.mode})}fileStats(e){return os(e.bytes.length,e.mtimeMs,!1,this.identityOfFile(e),e.mode)}fileBigIntStats(e){return as(e.bytes.length,e.mtimeMs,!1,this.identityOfFile(e),e.mode,this.fileLinkCount(e))}forgetIdentity(e){this.identities.delete(e);const r=`${e}/`;for(const n of[...this.identities.keys()])n.startsWith(r)&&this.identities.delete(n)}touch(e){return this.touchNode(this.files.get(e))}touchNode(e){const r=e?.mtimeMs,n=Date.now();return r===void 0?n:Math.max(n,r+1)}touchDirectory(e){const r=this.directoryMtimes.get(e),n=Date.now();this.directoryMtimes.set(e,r===void 0?n:Math.max(n,r+1))}readdirSync(e,r){const n=this.key(e);this.directories.has(n)||(this.files.has(n)&&Pe("ENOTDIR","scandir",n),Pe("ENOENT","scandir",n));const i=n==="/"?"/":`${n}/`,o=new Set;for(const c of[...this.files.keys(),...this.directories]){if(!c.startsWith(i)||c===n)continue;const t=c.slice(i.length);if(t==="")continue;const[d=t]=t.split("/");o.add(d)}const s=[...o].sort();return r?.withFileTypes!==!0?s:s.map(c=>this.direntOf(n,c))}direntOf(e,r){const n=this.plainStats(Ve(e,r));return{name:r,parentPath:e,isFile:()=>n.isFile(),isDirectory:()=>n.isDirectory(),isSymbolicLink:()=>!1}}realpathSync(e){const r=this.key(e);return this.existsSync(r)||Pe("ENOENT","realpath",r),r}mkdirSync(e,r){const n=this.key(e);if(this.files.has(n)&&Pe("EEXIST","mkdir",n),this.directories.has(n)){if(r?.recursive===!0)return;Pe("EEXIST","mkdir",n)}const i=ze(n);this.directories.has(i)||(r?.recursive!==!0&&Pe("ENOENT","mkdir",n),this.mkdirSync(i,r)),this.directories.add(n),this.touchDirectory(n),this.touchDirectory(i);const o=(r?.mode??Pr)&511;return o!==Pr&&this.directoryModes.set(n,o),this.publish({kind:"mkdir",path:n,mode:o}),n}writeFileSync(e,r,n){const i=this.key(e);this.directories.has(i)&&Pe("EISDIR","open",i),this.directories.has(ze(i))||Pe("ENOENT","open",i);const o=n?.flag??"w";if(o.startsWith("wx")&&this.files.has(i)&&Pe("EEXIST","open",i),o.startsWith("a")){this.appendFileSync(i,r);return}const s=this.files.get(i),c=s?.mode??(n?.mode!==void 0?n.mode&511:is),t=typeof r=="string"?cr.encode(r):r;if(s!==void 0){this.replaceFile(s,t);return}const d={bytes:t,mtimeMs:this.touch(i),mode:c,paths:void 0};this.setFile(i,d),this.touchDirectory(ze(i)),this.publish({kind:"write",path:i,bytes:t,mode:c,entryChanged:!0})}opendir(e){const r=this.key(e),n=this.readdirSync(r);let i=0;const o=s=>this.direntOf(r,s);return{path:r,close:async()=>{},read:async()=>{const s=n[i];return i+=1,s===void 0?null:o(s)},async*[Symbol.asyncIterator](){for(const s of n)yield o(s)}}}open(e,r="r",n){const i=this.key(e);if(this.directories.has(i))return r.startsWith("r")||Pe("EISDIR","open",i),{write:async()=>Pe("EISDIR","write",i),writeFile:async()=>Pe("EISDIR","write",i),readFile:async()=>Pe("EISDIR","read",i),truncate:async()=>Pe("EISDIR","ftruncate",i),...this.handleTail(i)};const o=this.openFileSync(i,r,n);let s=0,c=!1;const t=d=>(c&&Pe("EBADF",d,i),o);return{write:async d=>{const p=typeof d=="string"?cr.encode(d):d,y=t("write"),m=y.append?y.stat().size:s,v=y.write(m,p);return s=m+v,{bytesWritten:v}},writeFile:async d=>{const p=typeof d=="string"?cr.encode(d):d,y=t("write"),m=y.append?y.stat().size:s;s=m+y.write(m,p)},readFile:async d=>{const p=t("read"),y=p.read(s,Math.max(0,p.stat().size-s));return s+=y.length,ss(d)===void 0?y:ns.decode(y)},truncate:async(d=0)=>{t("ftruncate").truncate(d)},chmod:async d=>{t("fchmod").chmod(d)},stat:async d=>d?.bigint===!0?t("fstat").statBigInt():t("fstat").stat(),sync:async()=>{t("fsync"),await this.flush()},datasync:async()=>{t("fdatasync"),await this.flush()},close:async()=>{c=!0}}}openFileSync(e,r="r",n){const i=this.key(e),o=_u(r),s=this.files.get(i);this.directories.has(i)&&Pe("EISDIR","open",i),o.exclusive&&s!==void 0&&Pe("EEXIST","open",i),!o.create&&s===void 0&&Pe("ENOENT","open",i),o.create&&s===void 0?this.writeFileSync(i,new Uint8Array,n===void 0?void 0:{mode:n}):o.truncate&&s!==void 0&&this.truncateFile(s,0);const c=this.files.get(i);return c===void 0&&Pe("ENOENT","open",i),{readable:o.readable,writable:o.writable,append:o.append,read:(t,d)=>(o.readable||Pe("EBADF","read",i),c.bytes.subarray(t,t+d)),write:(t,d)=>(o.writable||Pe("EBADF","write",i),this.writeFileNode(c,o.append?c.bytes.length:t,d)),truncate:t=>{o.writable||Pe("EINVAL","ftruncate",i),this.truncateFile(c,t)},chmod:t=>{this.chmodFile(c,t)},stat:()=>this.fileStats(c),statBigInt:()=>this.fileBigIntStats(c)}}handleTail(e){return{chmod:async r=>{this.chmodSync(e,r)},stat:async r=>this.statSync(e,r),sync:async()=>{await this.flush()},datasync:async()=>{await this.flush()},close:async()=>{}}}appendFileSync(e,r){const n=this.key(e),i=this.files.get(n),o=typeof r=="string"?cr.encode(r):r;if(i===void 0){this.writeFileSync(n,o);return}this.writeFileNode(i,i.bytes.length,o)}renameSync(e,r){const n=this.key(e),i=this.key(r);if(n===i)return;const o=this.files.get(n);if(o!==void 0){if(this.directories.has(i)&&Pe("EISDIR","rename",i),this.directories.has(ze(i))||Pe("ENOENT","rename",i),this.files.get(i)===o)return;this.deleteFile(n),this.setFile(i,o),this.forgetIdentity(n),this.forgetIdentity(i),this.touchDirectory(ze(n)),this.touchDirectory(ze(i)),this.publish({kind:"remove",path:n}),this.publish({kind:"write",path:i,bytes:o.bytes,mode:o.mode,entryChanged:!0});return}this.directories.has(n)||Pe("ENOENT","rename",n),this.files.has(i)&&Pe("ENOTDIR","rename",i),this.directories.has(ze(i))||Pe("ENOENT","rename",i),this.directories.has(i)&&(this.readdirSync(i).length>0&&Pe("ENOTEMPTY","rename",i),this.directories.delete(i),this.directoryModes.delete(i),this.directoryMtimes.delete(i));const s=`${n}/`,c=[];for(const[d,p]of[...this.files]){if(!d.startsWith(s))continue;this.deleteFile(d);const y=Ve(i,d.slice(s.length));this.setFile(y,p),c.push({path:y,bytes:p.bytes,mode:p.mode})}const t=[];for(const d of[...this.directories]){if(!d.startsWith(s)&&d!==n)continue;const p=d===n?i:Ve(i,d.slice(s.length));this.directories.delete(d),this.directories.add(p);const y=this.directoryModes.get(d);this.directoryModes.delete(d),y!==void 0&&this.directoryModes.set(p,y),t.push({path:p,mode:y??Pr});const m=this.directoryMtimes.get(d);this.directoryMtimes.delete(d),m!==void 0&&this.directoryMtimes.set(p,m)}this.forgetIdentity(n),this.forgetIdentity(i),this.touchDirectory(ze(n)),this.touchDirectory(ze(i)),this.publish({kind:"remove",path:n});for(const d of t)this.publish({kind:"mkdir",path:d.path,mode:d.mode});for(const d of c)this.publish({kind:"write",path:d.path,bytes:d.bytes,mode:d.mode,entryChanged:!0})}linkSync(e,r){const n=this.key(e),i=this.key(r),o=this.files.get(n);o===void 0&&Pe("ENOENT","link",n),(this.files.has(i)||this.directories.has(i))&&Pe("EEXIST","link",i),this.directories.has(ze(i))||Pe("ENOENT","link",i),this.setFile(i,o),this.touchDirectory(ze(i)),this.publish({kind:"write",path:i,bytes:o.bytes,mode:o.mode,entryChanged:!0})}truncateSync(e,r=0){const n=this.key(e),i=this.files.get(n);i===void 0&&Pe("ENOENT","truncate",n),this.truncateFile(i,r)}chmodSync(e,r){const n=this.key(e),i=this.files.get(n);if(i!==void 0){this.chmodFile(i,r);return}if(this.directories.has(n)){const o=r&511;this.directoryModes.set(n,o),this.publish({kind:"chmod",path:n,mode:o});return}Pe("ENOENT","chmod",n)}unlinkSync(e){const r=this.key(e);this.deleteFile(r)===void 0&&Pe("ENOENT","unlink",r),this.forgetIdentity(r),this.touchDirectory(ze(r)),this.publish({kind:"remove",path:r})}rmSync(e,r){const n=this.key(e);if(this.deleteFile(n)!==void 0){this.forgetIdentity(n),this.touchDirectory(ze(n)),this.publish({kind:"remove",path:n});return}if(this.directories.has(n)){r?.recursive!==!0&&Pe("ERR_FS_EISDIR","rm",n);const i=`${n}/`;for(const o of[...this.files.keys()])o.startsWith(i)&&this.deleteFile(o);for(const o of[...this.directories])o.startsWith(i)&&(this.directories.delete(o),this.directoryModes.delete(o),this.directoryMtimes.delete(o));this.directories.delete(n),this.directoryModes.delete(n),this.directoryMtimes.delete(n),this.forgetIdentity(n),this.touchDirectory(ze(n)),this.publish({kind:"remove",path:n});return}r?.force!==!0&&Pe("ENOENT","rm",n)}mkdtempSync(e){this.temporaries+=1;const r=`${e}${Date.now().toString(36)}${this.temporaries.toString(36)}`;return this.mkdirSync(r,{recursive:!0}),this.key(r)}seed(e,r,n={}){const i=this.key(e);this.seedDirectory(ze(i)),this.setFile(i,{bytes:typeof r=="string"?cr.encode(r):r,mtimeMs:n.mtimeMs??this.touch(i),mode:(n.mode??is)&511,paths:void 0}),this.touchDirectory(ze(i))}seedDirectory(e,r={}){const n=this.key(e);if(!this.directories.has(n)){const i=ze(n);i!==n&&this.seedDirectory(i),this.files.has(n)&&Pe("EEXIST","mkdir",n),this.directories.add(n),this.directoryMtimes.set(n,r.mtimeMs??Date.now()),this.touchDirectory(i)}r.mode!==void 0&&this.directoryModes.set(n,r.mode&511),r.mtimeMs!==void 0&&this.directoryMtimes.set(n,r.mtimeMs)}usage(){let e=0;for(const r of this.files.values())e+=r.bytes.length;return{files:this.files.size,directories:this.directories.size,bytes:e}}};function Au(e,r="/dsh",n=new Eu){n.seedDirectory(r);for(const i of rs(e)){const o=i.name.startsWith("./")?i.name.slice(2):i.name;if(o.startsWith("/"))throw new Error(`webworker vfs: image entry must be relative to ${r}, received "${i.name}"`);const s=Ve(r,o);if(i.directory){n.seedDirectory(s,{mode:i.mode});continue}n.seed(s,i.bytes,{mode:i.mode})}return n}function xu(e,r,n){for(const i of rs(e)){const o=i.name.startsWith("./")?i.name.slice(2):i.name,s=o.endsWith("/")?o.slice(0,-1):o,c=s.split("/");if(s===""||o.startsWith("/")||c.some(d=>d===""||d==="."||d==="..")||!Gi.includes(c[0]??""))throw new Error(`webworker vfs: overlay entry must stay under ${Gi.join("/ or ")}, received "${i.name}"`);const t=Ve(r,s);if(i.directory){n.seedDirectory(t,{mode:i.mode});continue}if(n.existsSync(t)&&n.statSync(t).isDirectory())throw new Error(`webworker vfs: overlay file cannot replace directory "${t}"`);n.seed(t,i.bytes,{mode:i.mode})}return n}let Ln;function $u(e){Ln=e}function Kt(){if(Ln===void 0)throw new Error("webworker vfs: no filesystem is mounted; the worker entry must call setActiveVfs before any node:fs access");return Ln}function Ru(e){if(e!==void 0)return e;const r=globalThis.postMessage;if(typeof r!="function")throw new Error("webworker host: no channel; pass options.channel outside a dedicated worker");return{postMessage:(n,i)=>{r(n,i)}}}async function ls(e){if(typeof e!="string")return await mu(e,"the image bytes given to createWorkerHost");const r=await fetch(e);if(!r.ok)throw new Error(`webworker host: image fetch failed with ${String(r.status)} for ${e}`);if(r.body===null)throw new Error(`webworker host: image response for ${e} carried no body`);return await ts(r.body,e)}function Tu(e){const r=e.root??"/dsh",n=e.configPath??Ve(r,"config/cordis.yml"),i=e.port??3080,o=new yu({port:Ru(e.channel),requestListener:e.requestListener,...e.privilegedMethods===void 0?{}:{privilegedMethods:e.privilegedMethods},...e.unaryApiLane===void 0?{}:{unaryApiLane:e.unaryApiLane}});let s,c,t;return{handleMessage:p=>{o.handleMessage(p)},start:async()=>{try{const p=Ve(r,tu);Qi({cwd:r,env:{DSH_HOME:p,HOME:p,...e.env}});const[y,m]=await Promise.all([ls(e.image),Promise.all((e.overlays??[]).map(ls))]),v=Au(y,r);for(const Y of m)xu(Y,r,v);for(const Y of ru)v.seedDirectory(Ve(r,Y.replace(/\/$/,"")));$u(v),s=v,ku(v,e.manifestPath??Ve(r,"config/vfs-manifest.json"));const T={...e.staticModules};for(const Y of["node:process","process"])T[Y]??=()=>globalThis.process;const $=new au({vfs:v,root:r,staticModules:T,...e.staticModulePrefixes===void 0?{}:{staticModulePrefixes:e.staticModulePrefixes},...e.alsCausality===void 0?{}:{alsCausality:e.alsCausality}});lu($),c=$;const N=$.requireFrom(ze(n)),P=N("@deepseek-ai/dsh-app-boot"),q=N("@deepseek-ai/dsh-cmdline"),{patches:_,presetOverlay:D}=Lu($,v,n,r),k=await P.boot("dsh-webworker",n,_,Y=>{Y.loader.internal=$.internal,Iu(Y,N),q.provideCmdline(Y,{args:[...e.cmdlineArgs??["--host","127.0.0.1","--port",String(i),"--no-open"]],exit:V=>{console.warn(`webworker host: tree requested exit(${String(V)})`)}})});t=k;const C=k.get("connection");if(C===void 0)throw new Error("webworker host: the tree activated without a Connection service");const S=k.get("typertGateway");if(S===void 0)throw new Error("webworker host: the tree activated without a typertGateway service");const O=C.createSharedFetchHandler("/api"),z=$.usage();console.info(`webworker host: tree active (modules=${String(z.modules)}, data overlays=${String(m.length)}, preset root overlay=${D?"applied":"already in roster"}, direct lane=connection.createSharedFetchHandler, als causality=${e.alsCausality===void 0?"inert":"snapshot/restore"}, image lowering=${zi})`),o.serve({directFetch:Y=>O.fetch(Y),bootPayload:()=>Cu(k),openStream:S.wireStream.open,streamFailure:S.wireStream.failure})}catch(p){throw o.fail(p),p}},stop:async()=>{o.fail(new Error("webworker host: the tree was disposed")),await t?.fiber.dispose()},get vfs(){return s},get modules(){return c}}}function Iu(e,r){const{Logger:n}=r("@deepseek-ai/cordis"),i={colors:!1,levels:{default:2},export:o=>{if(o.type!=="warn"&&o.type!=="error")return;const s=`${o.name}: ${n.format(i,o)}`;o.type==="error"?console.error(s):console.warn(s)}};e.logger.exporter(i)}function ku(e,r){if(!e.existsSync(r))throw new Error(`webworker host: ${r} is missing, so the image records no lowering; rebuild the image`);const n=JSON.parse(e.readFileSync(r,"utf8"));if(typeof n!="object"||n===null)throw new Error(`webworker host: ${r} does not hold an object`);const i=n.lowered;if(i!=="dsh-worker-transform/1")throw new Error(`webworker host: image was lowered by ${String(i)}, this build runs ${zi}; rebuild the image`)}function Lu(e,r,n,i){const o=r.readFileSync(n,"utf8");let s;if(n.endsWith(".json"))s=JSON.parse(o);else{const v=e.load(e.resolve("@deepseek-ai/cordis-plugin-include",i));s=e.load(e.resolve("js-yaml",i)).load(o,{schema:v.entryListSchema})}const c=(v,T)=>{if(Array.isArray(v))for(const $ of v){if($.id===T)return $;const N=c($.config,T);if(N!==void 0)return N}},t=v=>typeof v.config=="object"&&v.config!==null&&!Array.isArray(v.config)?v.config:{},d=[];let p=!1;const y=c(s,"agent-presets");y!==void 0&&t(y).roots===void 0&&(p=!0,d.push({id:"agent-presets",config:{...t(y),roots:[{path:Ve(i,"config/agent-presets"),trust:"system"}]}}));const m=c(s,"session-persistence-jsonl");return m!==void 0&&d.push({id:"session-persistence-jsonl",config:{...t(m),compression:"none"}}),{patches:d,presetOverlay:p}}function Cu(e){const r=e.get("webServer");if(r===void 0)throw new Error("webworker host: no webServer service, so the page cannot receive its boot injections");return{injections:r.collectIndexInjections()}}var Mu=De((e=>{e.byteLength=d,e.toByteArray=y,e.fromByteArray=T;for(var r=[],n=[],i=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=o.length;s<c;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;n[45]=62,n[95]=63;function t($){var N=$.length;if(N%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=$.indexOf("=");P===-1&&(P=N);var q=P===N?0:4-P%4;return[P,q]}function d($){var N=t($),P=N[0],q=N[1];return(P+q)*3/4-q}function p($,N,P){return(N+P)*3/4-P}function y($){var N,P=t($),q=P[0],_=P[1],D=new i(p($,q,_)),k=0,C=_>0?q-4:q,S;for(S=0;S<C;S+=4)N=n[$.charCodeAt(S)]<<18|n[$.charCodeAt(S+1)]<<12|n[$.charCodeAt(S+2)]<<6|n[$.charCodeAt(S+3)],D[k++]=N>>16&255,D[k++]=N>>8&255,D[k++]=N&255;return _===2&&(N=n[$.charCodeAt(S)]<<2|n[$.charCodeAt(S+1)]>>4,D[k++]=N&255),_===1&&(N=n[$.charCodeAt(S)]<<10|n[$.charCodeAt(S+1)]<<4|n[$.charCodeAt(S+2)]>>2,D[k++]=N>>8&255,D[k++]=N&255),D}function m($){return r[$>>18&63]+r[$>>12&63]+r[$>>6&63]+r[$&63]}function v($,N,P){for(var q,_=[],D=N;D<P;D+=3)q=($[D]<<16&16711680)+($[D+1]<<8&65280)+($[D+2]&255),_.push(m(q));return _.join("")}function T($){for(var N,P=$.length,q=P%3,_=[],D=16383,k=0,C=P-q;k<C;k+=D)_.push(v($,k,k+D>C?C:k+D));return q===1?(N=$[P-1],_.push(r[N>>2]+r[N<<4&63]+"==")):q===2&&(N=($[P-2]<<8)+$[P-1],_.push(r[N>>10]+r[N>>4&63]+r[N<<2&63]+"=")),_.join("")}})),Ou=De((e=>{/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */e.read=function(r,n,i,o,s){var c,t,d=s*8-o-1,p=(1<<d)-1,y=p>>1,m=-7,v=i?s-1:0,T=i?-1:1,$=r[n+v];for(v+=T,c=$&(1<<-m)-1,$>>=-m,m+=d;m>0;c=c*256+r[n+v],v+=T,m-=8);for(t=c&(1<<-m)-1,c>>=-m,m+=o;m>0;t=t*256+r[n+v],v+=T,m-=8);if(c===0)c=1-y;else{if(c===p)return t?NaN:($?-1:1)*(1/0);t=t+Math.pow(2,o),c=c-y}return($?-1:1)*t*Math.pow(2,c-o)},e.write=function(r,n,i,o,s,c){var t,d,p,y=c*8-s-1,m=(1<<y)-1,v=m>>1,T=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,$=o?0:c-1,N=o?1:-1,P=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(d=isNaN(n)?1:0,t=m):(t=Math.floor(Math.log(n)/Math.LN2),n*(p=Math.pow(2,-t))<1&&(t--,p*=2),t+v>=1?n+=T/p:n+=T*Math.pow(2,1-v),n*p>=2&&(t++,p/=2),t+v>=m?(d=0,t=m):t+v>=1?(d=(n*p-1)*Math.pow(2,s),t=t+v):(d=n*Math.pow(2,v-1)*Math.pow(2,s),t=0));s>=8;r[i+$]=d&255,$+=N,d/=256,s-=8);for(t=t<<s|d,y+=s;y>0;r[i+$]=t&255,$+=N,t/=256,y-=8);r[i+$-N]|=P*128}}));/*!
|
|
3
|
+
* The buffer module from node.js, for the browser.
|
|
4
|
+
*
|
|
5
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/var mt=De((e=>{const r=Mu(),n=Ou(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=t,e.SlowBuffer=_,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,t.TYPED_ARRAY_SUPPORT=s(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const g=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(g,l),g.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function c(g){if(g>o)throw new RangeError('The value "'+g+'" is invalid for option "size"');const l=new Uint8Array(g);return Object.setPrototypeOf(l,t.prototype),l}function t(g,l,u){if(typeof g=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(g)}return d(g,l,u)}t.poolSize=8192;function d(g,l,u){if(typeof g=="string")return v(g,l);if(ArrayBuffer.isView(g))return $(g);if(g==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g);if(ne(g,ArrayBuffer)||g&&ne(g.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ne(g,SharedArrayBuffer)||g&&ne(g.buffer,SharedArrayBuffer)))return N(g,l,u);if(typeof g=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const b=g.valueOf&&g.valueOf();if(b!=null&&b!==g)return t.from(b,l,u);const M=P(g);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof g[Symbol.toPrimitive]=="function")return t.from(g[Symbol.toPrimitive]("string"),l,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof g)}t.from=function(g,l,u){return d(g,l,u)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function p(g){if(typeof g!="number")throw new TypeError('"size" argument must be of type number');if(g<0)throw new RangeError('The value "'+g+'" is invalid for option "size"')}function y(g,l,u){return p(g),g<=0?c(g):l!==void 0?typeof u=="string"?c(g).fill(l,u):c(g).fill(l):c(g)}t.alloc=function(g,l,u){return y(g,l,u)};function m(g){return p(g),c(g<0?0:q(g)|0)}t.allocUnsafe=function(g){return m(g)},t.allocUnsafeSlow=function(g){return m(g)};function v(g,l){if((typeof l!="string"||l==="")&&(l="utf8"),!t.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const u=D(g,l)|0;let b=c(u);const M=b.write(g,l);return M!==u&&(b=b.slice(0,M)),b}function T(g){const l=g.length<0?0:q(g.length)|0,u=c(l);for(let b=0;b<l;b+=1)u[b]=g[b]&255;return u}function $(g){if(ne(g,Uint8Array)){const l=new Uint8Array(g);return N(l.buffer,l.byteOffset,l.byteLength)}return T(g)}function N(g,l,u){if(l<0||g.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(g.byteLength<l+(u||0))throw new RangeError('"length" is outside of buffer bounds');let b;return l===void 0&&u===void 0?b=new Uint8Array(g):u===void 0?b=new Uint8Array(g,l):b=new Uint8Array(g,l,u),Object.setPrototypeOf(b,t.prototype),b}function P(g){if(t.isBuffer(g)){const l=q(g.length)|0,u=c(l);return u.length===0||g.copy(u,0,0,l),u}if(g.length!==void 0)return typeof g.length!="number"||he(g.length)?c(0):T(g);if(g.type==="Buffer"&&Array.isArray(g.data))return T(g.data)}function q(g){if(g>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return g|0}function _(g){return+g!=g&&(g=0),t.alloc(+g)}t.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==t.prototype},t.compare=function(l,u){if(ne(l,Uint8Array)&&(l=t.from(l,l.offset,l.byteLength)),ne(u,Uint8Array)&&(u=t.from(u,u.offset,u.byteLength)),!t.isBuffer(l)||!t.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===u)return 0;let b=l.length,M=u.length;for(let W=0,Q=Math.min(b,M);W<Q;++W)if(l[W]!==u[W]){b=l[W],M=u[W];break}return b<M?-1:M<b?1:0},t.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(l,u){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return t.alloc(0);let b;if(u===void 0)for(u=0,b=0;b<l.length;++b)u+=l[b].length;const M=t.allocUnsafe(u);let W=0;for(b=0;b<l.length;++b){let Q=l[b];if(ne(Q,Uint8Array))W+Q.length>M.length?(t.isBuffer(Q)||(Q=t.from(Q)),Q.copy(M,W)):Uint8Array.prototype.set.call(M,Q,W);else if(t.isBuffer(Q))Q.copy(M,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=Q.length}return M};function D(g,l){if(t.isBuffer(g))return g.length;if(ArrayBuffer.isView(g)||ne(g,ArrayBuffer))return g.byteLength;if(typeof g!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof g);const u=g.length,b=arguments.length>2&&arguments[2]===!0;if(!b&&u===0)return 0;let M=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":return K(g).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return fe(g).length;default:if(M)return b?-1:K(g).length;l=(""+l).toLowerCase(),M=!0}}t.byteLength=D;function k(g,l,u){let b=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,l>>>=0,u<=l))return"";for(g||(g="utf8");;)switch(g){case"hex":return Te(this,l,u);case"utf8":case"utf-8":return ee(this,l,u);case"ascii":return Ae(this,l,u);case"latin1":case"binary":return $e(this,l,u);case"base64":return H(this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,l,u);default:if(b)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),b=!0}}t.prototype._isBuffer=!0;function C(g,l,u){const b=g[l];g[l]=g[u],g[u]=b}t.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<l;u+=2)C(this,u,u+1);return this},t.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<l;u+=4)C(this,u,u+3),C(this,u+1,u+2);return this},t.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<l;u+=8)C(this,u,u+7),C(this,u+1,u+6),C(this,u+2,u+5),C(this,u+3,u+4);return this},t.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?ee(this,0,l):k.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(l){if(!t.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:t.compare(this,l)===0},t.prototype.inspect=function(){let l="";const u=e.INSPECT_MAX_BYTES;return l=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(l+=" ... "),"<Buffer "+l+">"},i&&(t.prototype[i]=t.prototype.inspect),t.prototype.compare=function(l,u,b,M,W){if(ne(l,Uint8Array)&&(l=t.from(l,l.offset,l.byteLength)),!t.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(u===void 0&&(u=0),b===void 0&&(b=l?l.length:0),M===void 0&&(M=0),W===void 0&&(W=this.length),u<0||b>l.length||M<0||W>this.length)throw new RangeError("out of range index");if(M>=W&&u>=b)return 0;if(M>=W)return-1;if(u>=b)return 1;if(u>>>=0,b>>>=0,M>>>=0,W>>>=0,this===l)return 0;let Q=W-M,ke=b-u;const Be=Math.min(Q,ke),Fe=this.slice(M,W),He=l.slice(u,b);for(let Ue=0;Ue<Be;++Ue)if(Fe[Ue]!==He[Ue]){Q=Fe[Ue],ke=He[Ue];break}return Q<ke?-1:ke<Q?1:0};function S(g,l,u,b,M){if(g.length===0)return-1;if(typeof u=="string"?(b=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,he(u)&&(u=M?0:g.length-1),u<0&&(u=g.length+u),u>=g.length){if(M)return-1;u=g.length-1}else if(u<0)if(M)u=0;else return-1;if(typeof l=="string"&&(l=t.from(l,b)),t.isBuffer(l))return l.length===0?-1:O(g,l,u,b,M);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(g,l,u):Uint8Array.prototype.lastIndexOf.call(g,l,u):O(g,[l],u,b,M);throw new TypeError("val must be string, number or Buffer")}function O(g,l,u,b,M){let W=1,Q=g.length,ke=l.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(g.length<2||l.length<2)return-1;W=2,Q/=2,ke/=2,u/=2}function Be(He,Ue){return W===1?He[Ue]:He.readUInt16BE(Ue*W)}let Fe;if(M){let He=-1;for(Fe=u;Fe<Q;Fe++)if(Be(g,Fe)===Be(l,He===-1?0:Fe-He)){if(He===-1&&(He=Fe),Fe-He+1===ke)return He*W}else He!==-1&&(Fe-=Fe-He),He=-1}else for(u+ke>Q&&(u=Q-ke),Fe=u;Fe>=0;Fe--){let He=!0;for(let Ue=0;Ue<ke;Ue++)if(Be(g,Fe+Ue)!==Be(l,Ue)){He=!1;break}if(He)return Fe}return-1}t.prototype.includes=function(l,u,b){return this.indexOf(l,u,b)!==-1},t.prototype.indexOf=function(l,u,b){return S(this,l,u,b,!0)},t.prototype.lastIndexOf=function(l,u,b){return S(this,l,u,b,!1)};function z(g,l,u,b){u=Number(u)||0;const M=g.length-u;b?(b=Number(b),b>M&&(b=M)):b=M;const W=l.length;b>W/2&&(b=W/2);let Q;for(Q=0;Q<b;++Q){const ke=parseInt(l.substr(Q*2,2),16);if(he(ke))return Q;g[u+Q]=ke}return Q}function Y(g,l,u,b){return B(K(l,g.length-u),g,u,b)}function V(g,l,u,b){return B(ue(l),g,u,b)}function le(g,l,u,b){return B(fe(l),g,u,b)}function G(g,l,u,b){return B(ce(l,g.length-u),g,u,b)}t.prototype.write=function(l,u,b,M){if(u===void 0)M="utf8",b=this.length,u=0;else if(b===void 0&&typeof u=="string")M=u,b=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(b)?(b=b>>>0,M===void 0&&(M="utf8")):(M=b,b=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const W=this.length-u;if((b===void 0||b>W)&&(b=W),l.length>0&&(b<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let Q=!1;for(;;)switch(M){case"hex":return z(this,l,u,b);case"utf8":case"utf-8":return Y(this,l,u,b);case"ascii":case"latin1":case"binary":return V(this,l,u,b);case"base64":return le(this,l,u,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,l,u,b);default:if(Q)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),Q=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function H(g,l,u){return l===0&&u===g.length?r.fromByteArray(g):r.fromByteArray(g.slice(l,u))}function ee(g,l,u){u=Math.min(g.length,u);const b=[];let M=l;for(;M<u;){const W=g[M];let Q=null,ke=W>239?4:W>223?3:W>191?2:1;if(M+ke<=u){let Be,Fe,He,Ue;switch(ke){case 1:W<128&&(Q=W);break;case 2:Be=g[M+1],(Be&192)===128&&(Ue=(W&31)<<6|Be&63,Ue>127&&(Q=Ue));break;case 3:Be=g[M+1],Fe=g[M+2],(Be&192)===128&&(Fe&192)===128&&(Ue=(W&15)<<12|(Be&63)<<6|Fe&63,Ue>2047&&(Ue<55296||Ue>57343)&&(Q=Ue));break;case 4:Be=g[M+1],Fe=g[M+2],He=g[M+3],(Be&192)===128&&(Fe&192)===128&&(He&192)===128&&(Ue=(W&15)<<18|(Be&63)<<12|(Fe&63)<<6|He&63,Ue>65535&&Ue<1114112&&(Q=Ue))}}Q===null?(Q=65533,ke=1):Q>65535&&(Q-=65536,b.push(Q>>>10&1023|55296),Q=56320|Q&1023),b.push(Q),M+=ke}return me(b)}const j=4096;function me(g){const l=g.length;if(l<=j)return String.fromCharCode.apply(String,g);let u="",b=0;for(;b<l;)u+=String.fromCharCode.apply(String,g.slice(b,b+=j));return u}function Ae(g,l,u){let b="";u=Math.min(g.length,u);for(let M=l;M<u;++M)b+=String.fromCharCode(g[M]&127);return b}function $e(g,l,u){let b="";u=Math.min(g.length,u);for(let M=l;M<u;++M)b+=String.fromCharCode(g[M]);return b}function Te(g,l,u){const b=g.length;(!l||l<0)&&(l=0),(!u||u<0||u>b)&&(u=b);let M="";for(let W=l;W<u;++W)M+=te[g[W]];return M}function re(g,l,u){const b=g.slice(l,u);let M="";for(let W=0;W<b.length-1;W+=2)M+=String.fromCharCode(b[W]+b[W+1]*256);return M}t.prototype.slice=function(l,u){const b=this.length;l=~~l,u=u===void 0?b:~~u,l<0?(l+=b,l<0&&(l=0)):l>b&&(l=b),u<0?(u+=b,u<0&&(u=0)):u>b&&(u=b),u<l&&(u=l);const M=this.subarray(l,u);return Object.setPrototypeOf(M,t.prototype),M};function be(g,l,u){if(g%1!==0||g<0)throw new RangeError("offset is not uint");if(g+l>u)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(l,u,b){l=l>>>0,u=u>>>0,b||be(l,u,this.length);let M=this[l],W=1,Q=0;for(;++Q<u&&(W*=256);)M+=this[l+Q]*W;return M},t.prototype.readUintBE=t.prototype.readUIntBE=function(l,u,b){l=l>>>0,u=u>>>0,b||be(l,u,this.length);let M=this[l+--u],W=1;for(;u>0&&(W*=256);)M+=this[l+--u]*W;return M},t.prototype.readUint8=t.prototype.readUInt8=function(l,u){return l=l>>>0,u||be(l,1,this.length),this[l]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(l,u){return l=l>>>0,u||be(l,2,this.length),this[l]|this[l+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(l,u){return l=l>>>0,u||be(l,2,this.length),this[l]<<8|this[l+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(l,u){return l=l>>>0,u||be(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(l,u){return l=l>>>0,u||be(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},t.prototype.readBigUInt64LE=xe(function(l){l=l>>>0,Ee(l,"offset");const u=this[l],b=this[l+7];(u===void 0||b===void 0)&&F(l,this.length-8);const M=u+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,W=this[++l]+this[++l]*2**8+this[++l]*2**16+b*2**24;return BigInt(M)+(BigInt(W)<<BigInt(32))}),t.prototype.readBigUInt64BE=xe(function(l){l=l>>>0,Ee(l,"offset");const u=this[l],b=this[l+7];(u===void 0||b===void 0)&&F(l,this.length-8);const M=u*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],W=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+b;return(BigInt(M)<<BigInt(32))+BigInt(W)}),t.prototype.readIntLE=function(l,u,b){l=l>>>0,u=u>>>0,b||be(l,u,this.length);let M=this[l],W=1,Q=0;for(;++Q<u&&(W*=256);)M+=this[l+Q]*W;return W*=128,M>=W&&(M-=Math.pow(2,8*u)),M},t.prototype.readIntBE=function(l,u,b){l=l>>>0,u=u>>>0,b||be(l,u,this.length);let M=u,W=1,Q=this[l+--M];for(;M>0&&(W*=256);)Q+=this[l+--M]*W;return W*=128,Q>=W&&(Q-=Math.pow(2,8*u)),Q},t.prototype.readInt8=function(l,u){return l=l>>>0,u||be(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},t.prototype.readInt16LE=function(l,u){l=l>>>0,u||be(l,2,this.length);const b=this[l]|this[l+1]<<8;return b&32768?b|4294901760:b},t.prototype.readInt16BE=function(l,u){l=l>>>0,u||be(l,2,this.length);const b=this[l+1]|this[l]<<8;return b&32768?b|4294901760:b},t.prototype.readInt32LE=function(l,u){return l=l>>>0,u||be(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},t.prototype.readInt32BE=function(l,u){return l=l>>>0,u||be(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},t.prototype.readBigInt64LE=xe(function(l){l=l>>>0,Ee(l,"offset");const u=this[l],b=this[l+7];(u===void 0||b===void 0)&&F(l,this.length-8);const M=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(b<<24);return(BigInt(M)<<BigInt(32))+BigInt(u+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),t.prototype.readBigInt64BE=xe(function(l){l=l>>>0,Ee(l,"offset");const u=this[l],b=this[l+7];(u===void 0||b===void 0)&&F(l,this.length-8);const M=(u<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(M)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+b)}),t.prototype.readFloatLE=function(l,u){return l=l>>>0,u||be(l,4,this.length),n.read(this,l,!0,23,4)},t.prototype.readFloatBE=function(l,u){return l=l>>>0,u||be(l,4,this.length),n.read(this,l,!1,23,4)},t.prototype.readDoubleLE=function(l,u){return l=l>>>0,u||be(l,8,this.length),n.read(this,l,!0,52,8)},t.prototype.readDoubleBE=function(l,u){return l=l>>>0,u||be(l,8,this.length),n.read(this,l,!1,52,8)};function R(g,l,u,b,M,W){if(!t.isBuffer(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>M||l<W)throw new RangeError('"value" argument is out of bounds');if(u+b>g.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(l,u,b,M){if(l=+l,u=u>>>0,b=b>>>0,!M){const ke=Math.pow(2,8*b)-1;R(this,l,u,b,ke,0)}let W=1,Q=0;for(this[u]=l&255;++Q<b&&(W*=256);)this[u+Q]=l/W&255;return u+b},t.prototype.writeUintBE=t.prototype.writeUIntBE=function(l,u,b,M){if(l=+l,u=u>>>0,b=b>>>0,!M){const ke=Math.pow(2,8*b)-1;R(this,l,u,b,ke,0)}let W=b-1,Q=1;for(this[u+W]=l&255;--W>=0&&(Q*=256);)this[u+W]=l/Q&255;return u+b},t.prototype.writeUint8=t.prototype.writeUInt8=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,1,255,0),this[u]=l&255,u+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,2,65535,0),this[u]=l&255,this[u+1]=l>>>8,u+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,2,65535,0),this[u]=l>>>8,this[u+1]=l&255,u+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,4,4294967295,0),this[u+3]=l>>>24,this[u+2]=l>>>16,this[u+1]=l>>>8,this[u]=l&255,u+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,4,4294967295,0),this[u]=l>>>24,this[u+1]=l>>>16,this[u+2]=l>>>8,this[u+3]=l&255,u+4};function ie(g,l,u,b,M){pe(l,b,M,g,u,7);let W=Number(l&BigInt(4294967295));g[u++]=W,W=W>>8,g[u++]=W,W=W>>8,g[u++]=W,W=W>>8,g[u++]=W;let Q=Number(l>>BigInt(32)&BigInt(4294967295));return g[u++]=Q,Q=Q>>8,g[u++]=Q,Q=Q>>8,g[u++]=Q,Q=Q>>8,g[u++]=Q,u}function ve(g,l,u,b,M){pe(l,b,M,g,u,7);let W=Number(l&BigInt(4294967295));g[u+7]=W,W=W>>8,g[u+6]=W,W=W>>8,g[u+5]=W,W=W>>8,g[u+4]=W;let Q=Number(l>>BigInt(32)&BigInt(4294967295));return g[u+3]=Q,Q=Q>>8,g[u+2]=Q,Q=Q>>8,g[u+1]=Q,Q=Q>>8,g[u]=Q,u+8}t.prototype.writeBigUInt64LE=xe(function(l,u=0){return ie(this,l,u,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=xe(function(l,u=0){return ve(this,l,u,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(l,u,b,M){if(l=+l,u=u>>>0,!M){const Be=Math.pow(2,8*b-1);R(this,l,u,b,Be-1,-Be)}let W=0,Q=1,ke=0;for(this[u]=l&255;++W<b&&(Q*=256);)l<0&&ke===0&&this[u+W-1]!==0&&(ke=1),this[u+W]=(l/Q>>0)-ke&255;return u+b},t.prototype.writeIntBE=function(l,u,b,M){if(l=+l,u=u>>>0,!M){const Be=Math.pow(2,8*b-1);R(this,l,u,b,Be-1,-Be)}let W=b-1,Q=1,ke=0;for(this[u+W]=l&255;--W>=0&&(Q*=256);)l<0&&ke===0&&this[u+W+1]!==0&&(ke=1),this[u+W]=(l/Q>>0)-ke&255;return u+b},t.prototype.writeInt8=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,1,127,-128),l<0&&(l=255+l+1),this[u]=l&255,u+1},t.prototype.writeInt16LE=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,2,32767,-32768),this[u]=l&255,this[u+1]=l>>>8,u+2},t.prototype.writeInt16BE=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,2,32767,-32768),this[u]=l>>>8,this[u+1]=l&255,u+2},t.prototype.writeInt32LE=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,4,2147483647,-2147483648),this[u]=l&255,this[u+1]=l>>>8,this[u+2]=l>>>16,this[u+3]=l>>>24,u+4},t.prototype.writeInt32BE=function(l,u,b){return l=+l,u=u>>>0,b||R(this,l,u,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[u]=l>>>24,this[u+1]=l>>>16,this[u+2]=l>>>8,this[u+3]=l&255,u+4},t.prototype.writeBigInt64LE=xe(function(l,u=0){return ie(this,l,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=xe(function(l,u=0){return ve(this,l,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Z(g,l,u,b,M,W){if(u+b>g.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function ge(g,l,u,b,M){return l=+l,u=u>>>0,M||Z(g,l,u,4),n.write(g,l,u,b,23,4),u+4}t.prototype.writeFloatLE=function(l,u,b){return ge(this,l,u,!0,b)},t.prototype.writeFloatBE=function(l,u,b){return ge(this,l,u,!1,b)};function Re(g,l,u,b,M){return l=+l,u=u>>>0,M||Z(g,l,u,8),n.write(g,l,u,b,52,8),u+8}t.prototype.writeDoubleLE=function(l,u,b){return Re(this,l,u,!0,b)},t.prototype.writeDoubleBE=function(l,u,b){return Re(this,l,u,!1,b)},t.prototype.copy=function(l,u,b,M){if(!t.isBuffer(l))throw new TypeError("argument should be a Buffer");if(b||(b=0),!M&&M!==0&&(M=this.length),u>=l.length&&(u=l.length),u||(u=0),M>0&&M<b&&(M=b),M===b||l.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),l.length-u<M-b&&(M=l.length-u+b);const W=M-b;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,b,M):Uint8Array.prototype.set.call(l,this.subarray(b,M),u),W},t.prototype.fill=function(l,u,b,M){if(typeof l=="string"){if(typeof u=="string"?(M=u,u=0,b=this.length):typeof b=="string"&&(M=b,b=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!t.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(l.length===1){const Q=l.charCodeAt(0);(M==="utf8"&&Q<128||M==="latin1")&&(l=Q)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(u<0||this.length<u||this.length<b)throw new RangeError("Out of range index");if(b<=u)return this;u=u>>>0,b=b===void 0?this.length:b>>>0,l||(l=0);let W;if(typeof l=="number")for(W=u;W<b;++W)this[W]=l;else{const Q=t.isBuffer(l)?l:t.from(l,M),ke=Q.length;if(ke===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(W=0;W<b-u;++W)this[W+u]=Q[W%ke]}return this};const Le={};function de(g,l,u){Le[g]=class extends u{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${g}]`,this.stack,delete this.name}get code(){return g}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${g}]: ${this.message}`}}}de("ERR_BUFFER_OUT_OF_BOUNDS",function(g){return g?`${g} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),de("ERR_INVALID_ARG_TYPE",function(g,l){return`The "${g}" argument must be of type number. Received type ${typeof l}`},TypeError),de("ERR_OUT_OF_RANGE",function(g,l,u){let b=`The value of "${g}" is out of range.`,M=u;return Number.isInteger(u)&&Math.abs(u)>2**32?M=I(String(u)):typeof u=="bigint"&&(M=String(u),(u>BigInt(2)**BigInt(32)||u<-(BigInt(2)**BigInt(32)))&&(M=I(M)),M+="n"),b+=` It must be ${l}. Received ${M}`,b},RangeError);function I(g){let l="",u=g.length;const b=g[0]==="-"?1:0;for(;u>=b+4;u-=3)l=`_${g.slice(u-3,u)}${l}`;return`${g.slice(0,u)}${l}`}function J(g,l,u){Ee(l,"offset"),(g[l]===void 0||g[l+u]===void 0)&&F(l,g.length-(u+1))}function pe(g,l,u,b,M,W){if(g>u||g<l){const Q=typeof l=="bigint"?"n":"";let ke;throw l===0||l===BigInt(0)?ke=`>= 0${Q} and < 2${Q} ** ${(W+1)*8}${Q}`:ke=`>= -(2${Q} ** ${(W+1)*8-1}${Q}) and < 2 ** ${(W+1)*8-1}${Q}`,new Le.ERR_OUT_OF_RANGE("value",ke,g)}J(b,M,W)}function Ee(g,l){if(typeof g!="number")throw new Le.ERR_INVALID_ARG_TYPE(l,"number",g)}function F(g,l,u){throw Math.floor(g)!==g?(Ee(g,u),new Le.ERR_OUT_OF_RANGE("offset","an integer",g)):l<0?new Le.ERR_BUFFER_OUT_OF_BOUNDS:new Le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,g)}const E=/[^+/0-9A-Za-z-_]/g;function U(g){if(g=g.split("=")[0],g=g.trim().replace(E,""),g.length<2)return"";for(;g.length%4!==0;)g=g+"=";return g}function K(g,l){l=l||1/0;let u;const b=g.length;let M=null;const W=[];for(let Q=0;Q<b;++Q){if(u=g.charCodeAt(Q),u>55295&&u<57344){if(!M){if(u>56319){(l-=3)>-1&&W.push(239,191,189);continue}else if(Q+1===b){(l-=3)>-1&&W.push(239,191,189);continue}M=u;continue}if(u<56320){(l-=3)>-1&&W.push(239,191,189),M=u;continue}u=(M-55296<<10|u-56320)+65536}else M&&(l-=3)>-1&&W.push(239,191,189);if(M=null,u<128){if((l-=1)<0)break;W.push(u)}else if(u<2048){if((l-=2)<0)break;W.push(u>>6|192,u&63|128)}else if(u<65536){if((l-=3)<0)break;W.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((l-=4)<0)break;W.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return W}function ue(g){const l=[];for(let u=0;u<g.length;++u)l.push(g.charCodeAt(u)&255);return l}function ce(g,l){let u,b,M;const W=[];for(let Q=0;Q<g.length&&!((l-=2)<0);++Q)u=g.charCodeAt(Q),b=u>>8,M=u%256,W.push(M),W.push(b);return W}function fe(g){return r.toByteArray(U(g))}function B(g,l,u,b){let M;for(M=0;M<b&&!(M+u>=l.length||M>=g.length);++M)l[M+u]=g[M];return M}function ne(g,l){return g instanceof l||g!=null&&g.constructor!=null&&g.constructor.name!=null&&g.constructor.name===l.name}function he(g){return g!==g}const te=(function(){const g="0123456789abcdef",l=new Array(256);for(let u=0;u<16;++u){const b=u*16;for(let M=0;M<16;++M)l[b+M]=g[u]+g[M]}return l})();function xe(g){return typeof BigInt>"u"?Qe:g}function Qe(){throw new Error("BigInt not supported")}})),Nu=We({Buffer:()=>tt.Buffer,__esModule:()=>!0,constants:()=>cs,default:()=>Du,kMaxLength:()=>tt.kMaxLength}),tt=mt();Object.defineProperty(globalThis,"Buffer",{value:tt.Buffer,writable:!0,configurable:!0});const cs={MAX_LENGTH:tt.kMaxLength,MAX_STRING_LENGTH:536870888};var Du={Buffer:tt.Buffer,constants:cs,kMaxLength:tt.kMaxLength};function Ce(e,r){return(function(){throw us(e,r)})}function us(e,r){const n=`web-preview: ${e}.${r} is not available in the worker host`;return console.error(n),new Error(n)}var Pu=We({AsyncLocalStorage:()=>Bt,AsyncResource:()=>ws,__esModule:()=>!0,__restoreAll:()=>ds,__snapshotAll:()=>fs,alsCausality:()=>hs,bindAsyncContext:()=>Fr,captureAsyncContext:()=>Xt,createHook:()=>gs,default:()=>Uu,executionAsyncId:()=>ps,runAtAsyncContextRoot:()=>Cn,runWithAsyncContext:()=>It,triggerAsyncId:()=>ys});const Bu=Promise.prototype.then,Br=new Set;function Fu(e){return e===null||typeof e!="object"&&typeof e!="function"?!1:typeof e.then=="function"}var Bt=class Hi{entries=[];overlay;ambients=[];resumed;constructor(){Br.add(this)}run(r,n,...i){const o={store:r};this.entries.push(o);const s=()=>{const m=this.entries.lastIndexOf(o);m!==-1&&this.entries.splice(m,1)},c={store:r};this.ambients.push(c);const t=()=>{const m=this.ambients.lastIndexOf(c);m!==-1&&this.ambients.splice(m,1),this.resumed===void 0&&(this.resumed=p),s()},d=this.overlay,p=this.resumed;this.overlay=void 0,this.resumed=void 0;let y;try{y=n(...i)}catch(m){throw this.overlay=d,t(),m}if(this.overlay=d,!Fu(y))return t(),y;try{Bu.call(y,t,t)}catch{t()}return y}getStore(){if(this.overlay!==void 0)return this.overlay.store;if(this.resumed!==void 0)return this.resumed.store;const r=this.ambients.at(-1);return r!==void 0?r.store:this.entries.at(-1)?.store}exit(r,...n){return this.run(void 0,r,...n)}enterWith(r){this.entries.push({store:r})}disable(){this.entries.length=0,this.overlay=void 0,this.ambients.length=0,this.resumed=void 0}static snapshotAll(){return[...Br].map(r=>({instance:r,store:r.getStore()}))}static restoreAll(r){const n=r.map(({instance:i,store:o})=>{const s={store:o},c=i.resumed;return i.resumed=s,{instance:i,slot:s,before:c}});return()=>{for(const{instance:i,slot:o,before:s}of n)i.resumed===o&&(i.resumed=s)}}static captureContext(){let r;for(const n of Br){const i=n.getStore();i!==void 0&&(r??=[],r.push({instance:n,store:i}))}return r}static runWithContext(r,n){if(r===void 0)return n();const i=r.map(({instance:o,store:s})=>{const c=o.overlay;return o.overlay={store:s},{instance:o,before:c}});try{return n()}finally{for(const{instance:o,before:s}of i)o.overlay=s}}static liveInstances(){return[...Br]}static bind(r){return Fr(r)}static snapshot(){const r=Hi.captureContext();return n=>Hi.runWithContext(r,n)}};function Xt(){return Bt.captureContext()}function It(e,r){return Bt.runWithContext(e,r)}function Fr(e){const r=Xt();return r===void 0?e:(...i)=>It(r,()=>e(...i))}function Cn(e){return It(Bt.liveInstances().map(r=>({instance:r,store:void 0})),e)}function fs(){return Bt.snapshotAll()}function ds(e){return Bt.restoreAll(e)}const hs={snapshot:()=>fs(),restore:e=>{ds(e)}};function ps(){return 1}function ys(){return 0}function gs(){throw new Error("web-preview: node:async_hooks.createHook is not available in the worker host")}const ws=Ce("node:async_hooks","AsyncResource");var Uu={AsyncLocalStorage:Bt,AsyncResource:ws,executionAsyncId:ps,triggerAsyncId:ys,createHook:gs};let bs=!1;const ms=(e,r)=>typeof e!="function"?e:n=>It(r,()=>e(n));function Wu(){if(bs)return;bs=!0;const e=Promise.prototype.then;Promise.prototype.then=function(o,s){const c=Xt();return c===void 0?e.call(this,o,s):e.call(this,ms(o,c),ms(s,c))};const r=globalThis.queueMicrotask.bind(globalThis);globalThis.queueMicrotask=i=>{r(Fr(i))};const n=globalThis.fetch.bind(globalThis);globalThis.fetch=((i,o)=>{const s=Xt();return s===void 0?n(i,o):e.call(n(i,o),c=>It(s,()=>c),c=>It(s,()=>{throw c}))})}const Ur=BigInt(2**32-1),vs=BigInt(32);function Hu(e,r=!1){return r?{h:Number(e&Ur),l:Number(e>>vs&Ur)}:{h:Number(e>>vs&Ur)|0,l:Number(e&Ur)|0}}function ju(e,r=!1){const n=e.length;let i=new Uint32Array(n),o=new Uint32Array(n);for(let s=0;s<n;s++){const{h:c,l:t}=Hu(e[s],r);[i[s],o[s]]=[c,t]}return[i,o]}const qu=e=>e/2**32|0,Gu=e=>e>>>0;function zu(e,r,n,i){const o=qu(n),s=Gu(n);e.setUint32(r,i?s:o,i),e.setUint32(r+4,i?o:s,i)}const _s=(e,r,n)=>e>>>n,Ss=(e,r,n)=>e<<32-n|r>>>n,Yt=(e,r,n)=>e>>>n|r<<32-n,Qt=(e,r,n)=>e<<32-n|r>>>n,Wr=(e,r,n)=>e<<64-n|r>>>n-32,Hr=(e,r,n)=>e>>>n-32|r<<64-n;function vt(e,r,n,i){const o=(r>>>0)+(i>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}const Vu=(e,r,n)=>(e>>>0)+(r>>>0)+(n>>>0),Ku=(e,r,n,i)=>r+n+i+(e/2**32|0)|0,Xu=(e,r,n,i)=>(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Yu=(e,r,n,i,o)=>r+n+i+o+(e/2**32|0)|0,Qu=(e,r,n,i,o)=>(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0)+(o>>>0),Zu=(e,r,n,i,o,s)=>r+n+i+o+s+(e/2**32|0)|0;function Es(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const Ju=e=>e?`"${e}" `:"";function As(e,r,n=""){if(Es(e)&&r===void 0)return e;const i=Es(e),o="",s=i?`length=${e.length}`:`type=${typeof e}`,c=Ju(n)+"expected Uint8Array"+o+", got "+s;throw i?new RangeError(c):new TypeError(c)}const xs=(e,r)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((r==="object"?"":`"${r}" `)+"expected object, got type="+typeof e)};function $s(e,r=!0){if(e.destroyed)throw new Error("hash was destroyed");if(r&&e.finished)throw new Error("digest() was already called")}function ef(e,r){As(e,void 0,"output");const n=r.outputLen;if(!(e.length>=n))throw new RangeError('"output" expected length >= '+n)}function Zt(...e){for(let r=0;r<e.length;r++)e[r].fill(0)}function Mn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function pt(e,r){return e<<32-r|e>>>r}function On(e,r){return e<<r|e>>>32-r>>>0}function tf(e,r,n="opts"){return xs(e,"defaults"),r!==void 0&&xs(r,n),Object.assign(e,r)}function Nn(e,r={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);r=tf({},r,"info");const n=(o,s)=>e(s).update(o).digest(),i=e(void 0);return n.outputLen=i.outputLen,n.blockLen=i.blockLen,n.canXOF=i.canXOF,n.create=o=>e(o),Object.assign(n,r),Object.freeze(n)}const Rs=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function Ts(e,r,n){return e&r^~e&n}function Is(e,r,n){return e&r^e&n^r&n}var Dn=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,r,n,i){this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Mn(this.buffer)}update(e){$s(this),As(e);const{view:r,buffer:n,blockLen:i}=this,o=e.length;let s=!1;for(let c=0;c<o;){const t=Math.min(i-this.pos,o-c);if(t===i){const d=Mn(e);for(;i<=o-c;c+=i)this.process(d,c);s=!0;continue}n.set(c===0&&t===o?e:e.subarray(c,c+t),this.pos),this.pos+=t,c+=t,this.pos===i&&(this.process(r,0),this.pos=0,s=!0)}return this.length+=e.length,s&&this.roundClean(),this}digestInto(e){$s(this),ef(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:o}=this;let{pos:s}=this;r[s++]=128,r.fill(0,s),this.padOffset>i-s&&(this.process(n,0),r.fill(0)),zu(n,i-8,this.length*8,o),this.process(n,0),this.roundClean();const c=e===r?n:Mn(e),t=this.outputLen,d=t/4,p=this.get();if(t%4||d>p.length)throw new Error("invalid outputLen");for(let y=0;y<d;y++)c.setUint32(4*y,p[y],o)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneIntoMeta(e){const{buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=n,e.pos=s,s&&e.buffer.set(r),e}clone(){return this._cloneInto()}};const rf=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),nf=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ur=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),kt=new Uint32Array(80);var sf=class extends Dn{A=ur[0]|0;B=ur[1]|0;C=ur[2]|0;D=ur[3]|0;E=ur[4]|0;constructor(){super(64,20,8,!1)}get(){const{A:e,B:r,C:n,D:i,E:o}=this;return[e,r,n,i,o]}set(e,r,n,i,o){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,r){for(let t=0;t<16;t++,r+=4)kt[t]=e.getUint32(r,!1);for(let t=16;t<80;t++)kt[t]=On(kt[t-3]^kt[t-8]^kt[t-14]^kt[t-16],1);let{A:n,B:i,C:o,D:s,E:c}=this;for(let t=0;t<80;t++){let d,p;t<20?(d=Ts(i,o,s),p=1518500249):t<40?(d=i^o^s,p=1859775393):t<60?(d=Is(i,o,s),p=2400959708):(d=i^o^s,p=3395469782);const y=On(n,5)+d+c+p+kt[t]|0;c=s,s=o,o=On(i,30),i=n,n=y}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,c=c+this.E|0,this.set(n,i,o,s,c)}roundClean(){Zt(kt)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0),Zt(this.buffer)}};const of=Nn(()=>new sf),af=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Lt=new Uint32Array(64);var lf=class extends Dn{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(e,r){super(64,e,8,!1),this.A=r[0]|0,this.B=r[1]|0,this.C=r[2]|0,this.D=r[3]|0,this.E=r[4]|0,this.F=r[5]|0,this.G=r[6]|0,this.H=r[7]|0}get(){const{A:e,B:r,C:n,D:i,E:o,F:s,G:c,H:t}=this;return[e,r,n,i,o,s,c,t]}set(e,r,n,i,o,s,c,t){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=c|0,this.H=t|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,r){for(let y=0;y<16;y++,r+=4)Lt[y]=e.getUint32(r,!1);for(let y=16;y<64;y++){const m=Lt[y-15],v=Lt[y-2],T=pt(m,7)^pt(m,18)^m>>>3;Lt[y]=(pt(v,17)^pt(v,19)^v>>>10)+Lt[y-7]+T+Lt[y-16]|0}let{A:n,B:i,C:o,D:s,E:c,F:t,G:d,H:p}=this;for(let y=0;y<64;y++){const m=pt(c,6)^pt(c,11)^pt(c,25),v=p+m+Ts(c,t,d)+af[y]+Lt[y]|0,T=(pt(n,2)^pt(n,13)^pt(n,22))+Is(n,i,o)|0;p=d,d=t,t=c,c=s+v|0,s=o,o=i,i=n,n=v+T|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,c=c+this.E|0,t=t+this.F|0,d=d+this.G|0,p=p+this.H|0,this.set(n,i,o,s,c,t,d,p)}roundClean(){Zt(Lt)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Zt(this.buffer)}},cf=class extends lf{constructor(){super(32,rf)}};const ks=ju(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),uf=ks[0],ff=ks[1],Ct=new Uint32Array(80),Mt=new Uint32Array(80);var df=class extends Dn{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(e,r){super(128,e,16,!1),this.Ah=r[0]|0,this.Al=r[1]|0,this.Bh=r[2]|0,this.Bl=r[3]|0,this.Ch=r[4]|0,this.Cl=r[5]|0,this.Dh=r[6]|0,this.Dl=r[7]|0,this.Eh=r[8]|0,this.El=r[9]|0,this.Fh=r[10]|0,this.Fl=r[11]|0,this.Gh=r[12]|0,this.Gl=r[13]|0,this.Hh=r[14]|0,this.Hl=r[15]|0}get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:o,Cl:s,Dh:c,Dl:t,Eh:d,El:p,Fh:y,Fl:m,Gh:v,Gl:T,Hh:$,Hl:N}=this;return[e,r,n,i,o,s,c,t,d,p,y,m,v,T,$,N]}set(e,r,n,i,o,s,c,t,d,p,y,m,v,T,$,N){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=c|0,this.Dl=t|0,this.Eh=d|0,this.El=p|0,this.Fh=y|0,this.Fl=m|0,this.Gh=v|0,this.Gl=T|0,this.Hh=$|0,this.Hl=N|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,r){for(let _=0;_<16;_++,r+=4)Ct[_]=e.getUint32(r),Mt[_]=e.getUint32(r+=4);for(let _=16;_<80;_++){const D=Ct[_-15]|0,k=Mt[_-15]|0,C=Yt(D,k,1)^Yt(D,k,8)^_s(D,k,7),S=Qt(D,k,1)^Qt(D,k,8)^Ss(D,k,7),O=Ct[_-2]|0,z=Mt[_-2]|0,Y=Yt(O,z,19)^Wr(O,z,61)^_s(O,z,6),V=Xu(S,Qt(O,z,19)^Hr(O,z,61)^Ss(O,z,6),Mt[_-7],Mt[_-16]);Ct[_]=Yu(V,C,Y,Ct[_-7],Ct[_-16])|0,Mt[_]=V|0}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:c,Cl:t,Dh:d,Dl:p,Eh:y,El:m,Fh:v,Fl:T,Gh:$,Gl:N,Hh:P,Hl:q}=this;for(let _=0;_<80;_++){const D=Yt(y,m,14)^Yt(y,m,18)^Wr(y,m,41),k=Qt(y,m,14)^Qt(y,m,18)^Hr(y,m,41),C=y&v^~y&$,S=m&T^~m&N,O=Qu(q,k,S,ff[_],Mt[_]),z=Zu(O,P,D,C,uf[_],Ct[_]),Y=O|0,V=Yt(n,i,28)^Wr(n,i,34)^Wr(n,i,39),le=Qt(n,i,28)^Hr(n,i,34)^Hr(n,i,39),G=n&o^n&c^o&c,H=i&s^i&t^s&t;P=$|0,q=N|0,$=v|0,N=T|0,v=y|0,T=m|0,{h:y,l:m}=vt(d|0,p|0,z|0,Y|0),d=c|0,p=t|0,c=o|0,t=s|0,o=n|0,s=i|0;const ee=Vu(Y,le,H);n=Ku(ee,z,V,G),i=ee|0}({h:n,l:i}=vt(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:s}=vt(this.Bh|0,this.Bl|0,o|0,s|0),{h:c,l:t}=vt(this.Ch|0,this.Cl|0,c|0,t|0),{h:d,l:p}=vt(this.Dh|0,this.Dl|0,d|0,p|0),{h:y,l:m}=vt(this.Eh|0,this.El|0,y|0,m|0),{h:v,l:T}=vt(this.Fh|0,this.Fl|0,v|0,T|0),{h:$,l:N}=vt(this.Gh|0,this.Gl|0,$|0,N|0),{h:P,l:q}=vt(this.Hh|0,this.Hl|0,P|0,q|0),this.set(n,i,o,s,c,t,d,p,y,m,v,T,$,N,P,q)}roundClean(){Zt(Ct,Mt)}destroy(){this.destroyed=!0,Zt(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},hf=class extends df{constructor(){super(64,nf)}};const pf=Nn(()=>new cf,Rs(1)),yf=Nn(()=>new hf,Rs(3));function Ls(){const e=globalThis.crypto.getRandomValues(new Uint8Array(16)),r=Array.from(e,(n,i)=>(i===6?n&15|64:i===8?n&63|128:n).toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}var gf=We({__esModule:()=>!0,createHash:()=>Cs,default:()=>vf,getRandomValues:()=>Ns,randomBytes:()=>Ms,randomInt:()=>Ds,randomUUID:()=>Os,webcrypto:()=>Ps});const wf={sha1:of,sha256:pf,sha512:yf},bf=new TextEncoder,mf=e=>typeof e=="string"?bf.encode(e):e instanceof ArrayBuffer?new Uint8Array(e):e;function Cs(e){const r=wf[e.toLowerCase().replace("-","")];if(r===void 0)throw new Error(`web-preview: node:crypto.createHash("${e}") is not available in the worker host`);const n=[],i={update(o){return n.push(mf(o)),i},digest(o){const s=n.reduce((p,y)=>p+y.byteLength,0),c=new Uint8Array(s);let t=0;for(const p of n)c.set(p,t),t+=p.byteLength;const d=tt.Buffer.from(r(c));return o===void 0?d:d.toString(o)}};return i}function Ms(e){const r=new Uint8Array(e);return globalThis.crypto.getRandomValues(r),tt.Buffer.from(r)}function Os(){return Ls()}function Ns(e){return globalThis.crypto.getRandomValues(e)}function Ds(e){const r=globalThis.crypto.getRandomValues(new Uint32Array(1))[0]??0;return Math.floor(r/2**32*e)}const Ps=globalThis.crypto;var vf={createHash:Cs,randomBytes:Ms,randomUUID:Os,getRandomValues:Ns,randomInt:Ds,webcrypto:Ps},_f=We({__esModule:()=>!0,default:()=>Sf,lookup:()=>Bs});const Bs=Ce("node:dns/promises","lookup");var Sf={lookup:Bs},Ef=We({EventEmitter:()=>Ft,__esModule:()=>!0,default:()=>Af}),Ft=class{registry=new Map;on(e,r){const n=this.registry.get(e)??[];return n.push(r),this.registry.set(e,n),this}once(e,r){const n=((...i)=>{this.off(e,n),r(...i)});return n.listener=r,this.on(e,n)}prependListener(e,r){const n=this.registry.get(e)??[];return n.unshift(r),this.registry.set(e,n),this}off(e,r){const n=this.registry.get(e);if(n!==void 0)for(let i=n.length-1;i>=0;i--){const o=n[i];if(o===r||o?.listener===r){n.splice(i,1);break}}return this}removeListener(e,r){return this.off(e,r)}removeAllListeners(e){return e===void 0?this.registry.clear():this.registry.delete(e),this}emit(e,...r){const n=this.registry.get(e);if(n===void 0||n.length===0)return!1;for(const i of[...n])i(...r);return!0}listeners(e){return[...this.registry.get(e)??[]]}listenerCount(e){return this.registry.get(e)?.length??0}setMaxListeners(){return this}},Af={EventEmitter:Ft},qe=De(((e,r)=>{var n=class extends Error{constructor(i){if(!Array.isArray(i))throw new TypeError(`Expected input to be an Array, got ${typeof i}`);let o="";for(let s=0;s<i.length;s++)o+=` ${i[s].stack}
|
|
8
|
+
`;super(o),this.name="AggregateError",this.errors=i}};r.exports={AggregateError:n,ArrayIsArray(i){return Array.isArray(i)},ArrayPrototypeIncludes(i,o){return i.includes(o)},ArrayPrototypeIndexOf(i,o){return i.indexOf(o)},ArrayPrototypeJoin(i,o){return i.join(o)},ArrayPrototypeMap(i,o){return i.map(o)},ArrayPrototypePop(i,o){return i.pop(o)},ArrayPrototypePush(i,o){return i.push(o)},ArrayPrototypeSlice(i,o,s){return i.slice(o,s)},Error,FunctionPrototypeCall(i,o,...s){return i.call(o,...s)},FunctionPrototypeSymbolHasInstance(i,o){return Function.prototype[Symbol.hasInstance].call(i,o)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(i,o){return Object.defineProperties(i,o)},ObjectDefineProperty(i,o,s){return Object.defineProperty(i,o,s)},ObjectGetOwnPropertyDescriptor(i,o){return Object.getOwnPropertyDescriptor(i,o)},ObjectKeys(i){return Object.keys(i)},ObjectSetPrototypeOf(i,o){return Object.setPrototypeOf(i,o)},Promise,PromisePrototypeCatch(i,o){return i.catch(o)},PromisePrototypeThen(i,o,s){return i.then(o,s)},PromiseReject(i){return Promise.reject(i)},PromiseResolve(i){return Promise.resolve(i)},ReflectApply:Reflect.apply,RegExpPrototypeTest(i,o){return i.test(o)},SafeSet:Set,String,StringPrototypeSlice(i,o,s){return i.slice(o,s)},StringPrototypeToLowerCase(i){return i.toLowerCase()},StringPrototypeToUpperCase(i){return i.toUpperCase()},StringPrototypeTrim(i){return i.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(i,o,s){return i.set(o,s)},Boolean,Uint8Array}})),Fs=De(((e,r)=>{r.exports={format(n,...i){return n.replace(/%([sdifj])/g,function(...[o,s]){const c=i.shift();return s==="f"?c.toFixed(6):s==="j"?JSON.stringify(c):s==="s"&&typeof c=="object"?`${c.constructor!==Object?c.constructor.name:""} {}`.trim():c.toString()})},inspect(n){switch(typeof n){case"string":if(n.includes("'"))if(n.includes('"')){if(!n.includes("`")&&!n.includes("${"))return`\`${n}\``}else return`"${n}"`;return`'${n}'`;case"number":return isNaN(n)?"NaN":Object.is(n,-0)?String(n):n;case"bigint":return`${String(n)}n`;case"boolean":case"undefined":return String(n);case"object":return"{}"}}}})),rt=De(((e,r)=>{const{format:n,inspect:i}=Fs(),{AggregateError:o}=qe(),s=globalThis.AggregateError||o,c=Symbol("kIsNodeError"),t=["string","function","number","object","Function","Object","boolean","bigint","symbol"],d=/^([A-Z][a-z0-9]*)+$/,p="__node_internal_",y={};function m(_,D){if(!_)throw new y.ERR_INTERNAL_ASSERTION(D)}function v(_){let D="",k=_.length;const C=_[0]==="-"?1:0;for(;k>=C+4;k-=3)D=`_${_.slice(k-3,k)}${D}`;return`${_.slice(0,k)}${D}`}function T(_,D,k){if(typeof D=="function")return m(D.length<=k.length,`Code: ${_}; The provided arguments length (${k.length}) does not match the required ones (${D.length}).`),D(...k);const C=(D.match(/%[dfijoOs]/g)||[]).length;return m(C===k.length,`Code: ${_}; The provided arguments length (${k.length}) does not match the required ones (${C}).`),k.length===0?D:n(D,...k)}function $(_,D,k){k||(k=Error);class C extends k{constructor(...O){super(T(_,D,O))}toString(){return`${this.name} [${_}]: ${this.message}`}}Object.defineProperties(C.prototype,{name:{value:k.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${_}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),C.prototype.code=_,C.prototype[c]=!0,y[_]=C}function N(_){const D=p+_.name;return Object.defineProperty(_,"name",{value:D}),_}function P(_,D){if(_&&D&&_!==D){if(Array.isArray(D.errors))return D.errors.push(_),D;const k=new s([D,_],D.message);return k.code=D.code,k}return _||D}var q=class extends Error{constructor(_="The operation was aborted",D=void 0){if(D!==void 0&&typeof D!="object")throw new y.ERR_INVALID_ARG_TYPE("options","Object",D);super(_,D),this.code="ABORT_ERR",this.name="AbortError"}};$("ERR_ASSERTION","%s",Error),$("ERR_INVALID_ARG_TYPE",(_,D,k)=>{m(typeof _=="string","'name' must be a string"),Array.isArray(D)||(D=[D]);let C="The ";_.endsWith(" argument")?C+=`${_} `:C+=`"${_}" ${_.includes(".")?"property":"argument"} `,C+="must be ";const S=[],O=[],z=[];for(const V of D)m(typeof V=="string","All expected entries have to be of type string"),t.includes(V)?S.push(V.toLowerCase()):d.test(V)?O.push(V):(m(V!=="object",'The value "object" should be written as "Object"'),z.push(V));if(O.length>0){const V=S.indexOf("object");V!==-1&&(S.splice(S,V,1),O.push("Object"))}if(S.length>0){switch(S.length){case 1:C+=`of type ${S[0]}`;break;case 2:C+=`one of type ${S[0]} or ${S[1]}`;break;default:{const V=S.pop();C+=`one of type ${S.join(", ")}, or ${V}`}}(O.length>0||z.length>0)&&(C+=" or ")}if(O.length>0){switch(O.length){case 1:C+=`an instance of ${O[0]}`;break;case 2:C+=`an instance of ${O[0]} or ${O[1]}`;break;default:{const V=O.pop();C+=`an instance of ${O.join(", ")}, or ${V}`}}z.length>0&&(C+=" or ")}switch(z.length){case 0:break;case 1:z[0].toLowerCase()!==z[0]&&(C+="an "),C+=`${z[0]}`;break;case 2:C+=`one of ${z[0]} or ${z[1]}`;break;default:{const V=z.pop();C+=`one of ${z.join(", ")}, or ${V}`}}if(k==null)C+=`. Received ${k}`;else if(typeof k=="function"&&k.name)C+=`. Received function ${k.name}`;else if(typeof k=="object"){var Y;if((Y=k.constructor)!==null&&Y!==void 0&&Y.name)C+=`. Received an instance of ${k.constructor.name}`;else{const V=i(k,{depth:-1});C+=`. Received ${V}`}}else{let V=i(k,{colors:!1});V.length>25&&(V=`${V.slice(0,25)}...`),C+=`. Received type ${typeof k} (${V})`}return C},TypeError),$("ERR_INVALID_ARG_VALUE",(_,D,k="is invalid")=>{let C=i(D);return C.length>128&&(C=C.slice(0,128)+"..."),`The ${_.includes(".")?"property":"argument"} '${_}' ${k}. Received ${C}`},TypeError),$("ERR_INVALID_RETURN_VALUE",(_,D,k)=>{var C;return`Expected ${_} to be returned from the "${D}" function but got ${k!=null&&(C=k.constructor)!==null&&C!==void 0&&C.name?`instance of ${k.constructor.name}`:`type ${typeof k}`}.`},TypeError),$("ERR_MISSING_ARGS",(..._)=>{m(_.length>0,"At least one arg needs to be specified");let D;const k=_.length;switch(_=(Array.isArray(_)?_:[_]).map(C=>`"${C}"`).join(" or "),k){case 1:D+=`The ${_[0]} argument`;break;case 2:D+=`The ${_[0]} and ${_[1]} arguments`;break;default:{const C=_.pop();D+=`The ${_.join(", ")}, and ${C} arguments`}break}return`${D} must be specified`},TypeError),$("ERR_OUT_OF_RANGE",(_,D,k)=>{m(D,'Missing "range" argument');let C;if(Number.isInteger(k)&&Math.abs(k)>2**32)C=v(String(k));else if(typeof k=="bigint"){C=String(k);const S=BigInt(2)**BigInt(32);(k>S||k<-S)&&(C=v(C)),C+="n"}else C=i(k);return`The value of "${_}" is out of range. It must be ${D}. Received ${C}`},RangeError),$("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),$("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),$("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),$("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),$("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),$("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),$("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),$("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),$("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),$("ERR_STREAM_WRITE_AFTER_END","write after end",Error),$("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),r.exports={AbortError:q,aggregateTwoErrors:N(P),hideStackFrames:N,codes:y}})),fr=De(((e,r)=>{const{AbortController:n,AbortSignal:i}=typeof self<"u"?self:typeof window<"u"?window:void 0;r.exports=n,r.exports.AbortSignal=i,r.exports.default=n})),jr=De(((e,r)=>{var n=typeof Reflect=="object"?Reflect:null,i=n&&typeof n.apply=="function"?n.apply:function(O,z,Y){return Function.prototype.apply.call(O,z,Y)},o;n&&typeof n.ownKeys=="function"?o=n.ownKeys:Object.getOwnPropertySymbols?o=function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:o=function(O){return Object.getOwnPropertyNames(O)};function s(S){console&&console.warn&&console.warn(S)}var c=Number.isNaN||function(O){return O!==O};function t(){t.init.call(this)}r.exports=t,r.exports.once=D,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var d=10;function p(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(S){if(typeof S!="number"||S<0||c(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");d=S}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(O){if(typeof O!="number"||O<0||c(O))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+O+".");return this._maxListeners=O,this};function y(S){return S._maxListeners===void 0?t.defaultMaxListeners:S._maxListeners}t.prototype.getMaxListeners=function(){return y(this)},t.prototype.emit=function(O){for(var z=[],Y=1;Y<arguments.length;Y++)z.push(arguments[Y]);var V=O==="error",le=this._events;if(le!==void 0)V=V&&le.error===void 0;else if(!V)return!1;if(V){var G;if(z.length>0&&(G=z[0]),G instanceof Error)throw G;var H=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw H.context=G,H}var ee=le[O];if(ee===void 0)return!1;if(typeof ee=="function")i(ee,this,z);else for(var j=ee.length,me=P(ee,j),Y=0;Y<j;++Y)i(me[Y],this,z);return!0};function m(S,O,z,Y){var V,le,G;if(p(z),le=S._events,le===void 0?(le=S._events=Object.create(null),S._eventsCount=0):(le.newListener!==void 0&&(S.emit("newListener",O,z.listener?z.listener:z),le=S._events),G=le[O]),G===void 0)G=le[O]=z,++S._eventsCount;else if(typeof G=="function"?G=le[O]=Y?[z,G]:[G,z]:Y?G.unshift(z):G.push(z),V=y(S),V>0&&G.length>V&&!G.warned){G.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=S,H.type=O,H.count=G.length,s(H)}return S}t.prototype.addListener=function(O,z){return m(this,O,z,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(O,z){return m(this,O,z,!0)};function v(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function T(S,O,z){var Y={fired:!1,wrapFn:void 0,target:S,type:O,listener:z},V=v.bind(Y);return V.listener=z,Y.wrapFn=V,V}t.prototype.once=function(O,z){return p(z),this.on(O,T(this,O,z)),this},t.prototype.prependOnceListener=function(O,z){return p(z),this.prependListener(O,T(this,O,z)),this},t.prototype.removeListener=function(O,z){var Y,V,le,G,H;if(p(z),V=this._events,V===void 0)return this;if(Y=V[O],Y===void 0)return this;if(Y===z||Y.listener===z)--this._eventsCount===0?this._events=Object.create(null):(delete V[O],V.removeListener&&this.emit("removeListener",O,Y.listener||z));else if(typeof Y!="function"){for(le=-1,G=Y.length-1;G>=0;G--)if(Y[G]===z||Y[G].listener===z){H=Y[G].listener,le=G;break}if(le<0)return this;le===0?Y.shift():q(Y,le),Y.length===1&&(V[O]=Y[0]),V.removeListener!==void 0&&this.emit("removeListener",O,H||z)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(O){var z,Y=this._events,V;if(Y===void 0)return this;if(Y.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Y[O]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Y[O]),this;if(arguments.length===0){var le=Object.keys(Y),G;for(V=0;V<le.length;++V)G=le[V],G!=="removeListener"&&this.removeAllListeners(G);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(z=Y[O],typeof z=="function")this.removeListener(O,z);else if(z!==void 0)for(V=z.length-1;V>=0;V--)this.removeListener(O,z[V]);return this};function $(S,O,z){var Y=S._events;if(Y===void 0)return[];var V=Y[O];return V===void 0?[]:typeof V=="function"?z?[V.listener||V]:[V]:z?_(V):P(V,V.length)}t.prototype.listeners=function(O){return $(this,O,!0)},t.prototype.rawListeners=function(O){return $(this,O,!1)},t.listenerCount=function(S,O){return typeof S.listenerCount=="function"?S.listenerCount(O):N.call(S,O)},t.prototype.listenerCount=N;function N(S){var O=this._events;if(O!==void 0){var z=O[S];if(typeof z=="function")return 1;if(z!==void 0)return z.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]};function P(S,O){for(var z=new Array(O),Y=0;Y<O;++Y)z[Y]=S[Y];return z}function q(S,O){for(;O+1<S.length;O++)S[O]=S[O+1];S.pop()}function _(S){for(var O=new Array(S.length),z=0;z<O.length;++z)O[z]=S[z].listener||S[z];return O}function D(S,O){return new Promise(function(z,Y){function V(G){S.removeListener(O,le),Y(G)}function le(){typeof S.removeListener=="function"&&S.removeListener("error",V),z([].slice.call(arguments))}C(S,O,le,{once:!0}),O!=="error"&&k(S,V,{once:!0})})}function k(S,O,z){typeof S.on=="function"&&C(S,"error",O,z)}function C(S,O,z,Y){if(typeof S.on=="function")Y.once?S.once(O,z):S.on(O,z);else if(typeof S.addEventListener=="function")S.addEventListener(O,function V(le){Y.once&&S.removeEventListener(O,V),z(le)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}})),nt=De(((e,r)=>{const n=mt(),{format:i,inspect:o}=Fs(),{codes:{ERR_INVALID_ARG_TYPE:s}}=rt(),{kResistStopPropagation:c,AggregateError:t,SymbolDispose:d}=qe(),p=globalThis.AbortSignal||fr().AbortSignal,y=globalThis.AbortController||fr().AbortController,m=Object.getPrototypeOf(async function(){}).constructor,v=globalThis.Blob||n.Blob,T=typeof v<"u"?function(q){return q instanceof v}:function(q){return!1},$=(P,q)=>{if(P!==void 0&&(P===null||typeof P!="object"||!("aborted"in P)))throw new s(q,"AbortSignal",P)},N=(P,q)=>{if(typeof P!="function")throw new s(q,"Function",P)};r.exports={AggregateError:t,kEmptyObject:Object.freeze({}),once(P){let q=!1;return function(..._){q||(q=!0,P.apply(this,_))}},createDeferredPromise:function(){let P,q;return{promise:new Promise((_,D)=>{P=_,q=D}),resolve:P,reject:q}},promisify(P){return new Promise((q,_)=>{P((D,...k)=>D?_(D):q(...k))})},debuglog(){return function(){}},format:i,inspect:o,types:{isAsyncFunction(P){return P instanceof m},isArrayBufferView(P){return ArrayBuffer.isView(P)}},isBlob:T,deprecate(P,q){return P},addAbortListener:jr().addAbortListener||function(q,_){if(q===void 0)throw new s("signal","AbortSignal",q);$(q,"signal"),N(_,"listener");let D;return q.aborted?queueMicrotask(()=>_()):(q.addEventListener("abort",_,{__proto__:null,once:!0,[c]:!0}),D=()=>{q.removeEventListener("abort",_)}),{__proto__:null,[d](){var k;(k=D)===null||k===void 0||k()}}},AbortSignalAny:p.any||function(q){if(q.length===1)return q[0];const _=new y,D=()=>_.abort();return q.forEach(k=>{$(k,"signals"),k.addEventListener("abort",D,{once:!0})}),_.signal.addEventListener("abort",()=>{q.forEach(k=>k.removeEventListener("abort",D))},{once:!0}),_.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})),dr=De(((e,r)=>{const{ArrayIsArray:n,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:s,NumberIsInteger:c,NumberIsNaN:t,NumberMAX_SAFE_INTEGER:d,NumberMIN_SAFE_INTEGER:p,NumberParseInt:y,ObjectPrototypeHasOwnProperty:m,RegExpPrototypeExec:v,String:T,StringPrototypeToUpperCase:$,StringPrototypeTrim:N}=qe(),{hideStackFrames:P,codes:{ERR_SOCKET_BAD_PORT:q,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:D,ERR_OUT_OF_RANGE:k,ERR_UNKNOWN_SIGNAL:C}}=rt(),{normalizeEncoding:S}=nt(),{isAsyncFunction:O,isArrayBufferView:z}=nt().types,Y={};function V(B){return B===(B|0)}function le(B){return B===B>>>0}const G=/^[0-7]+$/,H="must be a 32-bit unsigned integer or an octal string";function ee(B,ne,he){if(typeof B>"u"&&(B=he),typeof B=="string"){if(v(G,B)===null)throw new D(ne,B,H);B=y(B,8)}return Ae(B,ne),B}const j=P((B,ne,he=p,te=d)=>{if(typeof B!="number")throw new _(ne,"number",B);if(!c(B))throw new k(ne,"an integer",B);if(B<he||B>te)throw new k(ne,`>= ${he} && <= ${te}`,B)}),me=P((B,ne,he=-2147483648,te=2147483647)=>{if(typeof B!="number")throw new _(ne,"number",B);if(!c(B))throw new k(ne,"an integer",B);if(B<he||B>te)throw new k(ne,`>= ${he} && <= ${te}`,B)}),Ae=P((B,ne,he=!1)=>{if(typeof B!="number")throw new _(ne,"number",B);if(!c(B))throw new k(ne,"an integer",B);const te=he?1:0,xe=4294967295;if(B<te||B>xe)throw new k(ne,`>= ${te} && <= ${xe}`,B)});function $e(B,ne){if(typeof B!="string")throw new _(ne,"string",B)}function Te(B,ne,he=void 0,te){if(typeof B!="number")throw new _(ne,"number",B);if(he!=null&&B<he||te!=null&&B>te||(he!=null||te!=null)&&t(B))throw new k(ne,`${he!=null?`>= ${he}`:""}${he!=null&&te!=null?" && ":""}${te!=null?`<= ${te}`:""}`,B)}const re=P((B,ne,he)=>{if(!i(he,B))throw new D(ne,B,"must be one of: "+o(s(he,te=>typeof te=="string"?`'${te}'`:T(te)),", "))});function be(B,ne){if(typeof B!="boolean")throw new _(ne,"boolean",B)}function R(B,ne,he){return B==null||!m(B,ne)?he:B[ne]}const ie=P((B,ne,he=null)=>{const te=R(he,"allowArray",!1),xe=R(he,"allowFunction",!1);if(!R(he,"nullable",!1)&&B===null||!te&&n(B)||typeof B!="object"&&(!xe||typeof B!="function"))throw new _(ne,"Object",B)}),ve=P((B,ne)=>{if(B!=null&&typeof B!="object"&&typeof B!="function")throw new _(ne,"a dictionary",B)}),Z=P((B,ne,he=0)=>{if(!n(B))throw new _(ne,"Array",B);if(B.length<he)throw new D(ne,B,`must be longer than ${he}`)});function ge(B,ne){Z(B,ne);for(let he=0;he<B.length;he++)$e(B[he],`${ne}[${he}]`)}function Re(B,ne){Z(B,ne);for(let he=0;he<B.length;he++)be(B[he],`${ne}[${he}]`)}function Le(B,ne){Z(B,ne);for(let he=0;he<B.length;he++){const te=B[he],xe=`${ne}[${he}]`;if(te==null)throw new _(xe,"AbortSignal",te);Ee(te,xe)}}function de(B,ne="signal"){if($e(B,ne),Y[B]===void 0)throw Y[$(B)]!==void 0?new C(B+" (signals must use all capital letters)"):new C(B)}const I=P((B,ne="buffer")=>{if(!z(B))throw new _(ne,["Buffer","TypedArray","DataView"],B)});function J(B,ne){const he=S(ne),te=B.length;if(he==="hex"&&te%2!==0)throw new D("encoding",ne,`is invalid for data of length ${te}`)}function pe(B,ne="Port",he=!0){if(typeof B!="number"&&typeof B!="string"||typeof B=="string"&&N(B).length===0||+B!==+B>>>0||B>65535||B===0&&!he)throw new q(ne,B,he);return B|0}const Ee=P((B,ne)=>{if(B!==void 0&&(B===null||typeof B!="object"||!("aborted"in B)))throw new _(ne,"AbortSignal",B)}),F=P((B,ne)=>{if(typeof B!="function")throw new _(ne,"Function",B)}),E=P((B,ne)=>{if(typeof B!="function"||O(B))throw new _(ne,"Function",B)}),U=P((B,ne)=>{if(B!==void 0)throw new _(ne,"undefined",B)});function K(B,ne,he){if(!i(he,B))throw new _(ne,`('${o(he,"|")}')`,B)}const ue=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ce(B,ne){if(typeof B>"u"||!v(ue,B))throw new D(ne,B,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function fe(B){if(typeof B=="string")return ce(B,"hints"),B;if(n(B)){const ne=B.length;let he="";if(ne===0)return he;for(let te=0;te<ne;te++){const xe=B[te];ce(xe,"hints"),he+=xe,te!==ne-1&&(he+=", ")}return he}throw new D("hints",B,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}r.exports={isInt32:V,isUint32:le,parseFileMode:ee,validateArray:Z,validateStringArray:ge,validateBooleanArray:Re,validateAbortSignalArray:Le,validateBoolean:be,validateBuffer:I,validateDictionary:ve,validateEncoding:J,validateFunction:F,validateInt32:me,validateInteger:j,validateNumber:Te,validateObject:ie,validateOneOf:re,validatePlainFunction:E,validatePort:pe,validateSignalName:de,validateString:$e,validateUint32:Ae,validateUndefined:U,validateUnion:K,validateAbortSignal:Ee,validateLinkHeaderValue:fe}})),Ut=De(((e,r)=>{var n=r.exports={},i,o;function s(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?i=setTimeout:i=s}catch{i=s}try{typeof clearTimeout=="function"?o=clearTimeout:o=c}catch{o=c}})();function t(q){if(i===setTimeout)return setTimeout(q,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(q,0);try{return i(q,0)}catch{try{return i.call(null,q,0)}catch{return i.call(this,q,0)}}}function d(q){if(o===clearTimeout)return clearTimeout(q);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(q);try{return o(q)}catch{try{return o.call(null,q)}catch{return o.call(this,q)}}}var p=[],y=!1,m,v=-1;function T(){!y||!m||(y=!1,m.length?p=m.concat(p):v=-1,p.length&&$())}function $(){if(!y){var q=t(T);y=!0;for(var _=p.length;_;){for(m=p,p=[];++v<_;)m&&m[v].run();v=-1,_=p.length}m=null,y=!1,d(q)}}n.nextTick=function(q){var _=new Array(arguments.length-1);if(arguments.length>1)for(var D=1;D<arguments.length;D++)_[D-1]=arguments[D];p.push(new N(q,_)),p.length===1&&!y&&t($)};function N(q,_){this.fun=q,this.array=_}N.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function P(){}n.on=P,n.addListener=P,n.once=P,n.off=P,n.removeListener=P,n.removeAllListeners=P,n.emit=P,n.prependListener=P,n.prependOnceListener=P,n.listeners=function(q){return[]},n.binding=function(q){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(q){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}})),_t=De(((e,r)=>{const{SymbolAsyncIterator:n,SymbolIterator:i,SymbolFor:o}=qe(),s=o("nodejs.stream.destroyed"),c=o("nodejs.stream.errored"),t=o("nodejs.stream.readable"),d=o("nodejs.stream.writable"),p=o("nodejs.stream.disturbed"),y=o("nodejs.webstream.isClosedPromise"),m=o("nodejs.webstream.controllerErrorFunction");function v(R,ie=!1){var ve;return!!(R&&typeof R.pipe=="function"&&typeof R.on=="function"&&(!ie||typeof R.pause=="function"&&typeof R.resume=="function")&&(!R._writableState||((ve=R._readableState)===null||ve===void 0?void 0:ve.readable)!==!1)&&(!R._writableState||R._readableState))}function T(R){var ie;return!!(R&&typeof R.write=="function"&&typeof R.on=="function"&&(!R._readableState||((ie=R._writableState)===null||ie===void 0?void 0:ie.writable)!==!1))}function $(R){return!!(R&&typeof R.pipe=="function"&&R._readableState&&typeof R.on=="function"&&typeof R.write=="function")}function N(R){return R&&(R._readableState||R._writableState||typeof R.write=="function"&&typeof R.on=="function"||typeof R.pipe=="function"&&typeof R.on=="function")}function P(R){return!!(R&&!N(R)&&typeof R.pipeThrough=="function"&&typeof R.getReader=="function"&&typeof R.cancel=="function")}function q(R){return!!(R&&!N(R)&&typeof R.getWriter=="function"&&typeof R.abort=="function")}function _(R){return!!(R&&!N(R)&&typeof R.readable=="object"&&typeof R.writable=="object")}function D(R){return P(R)||q(R)||_(R)}function k(R,ie){return R==null?!1:ie===!0?typeof R[n]=="function":ie===!1?typeof R[i]=="function":typeof R[n]=="function"||typeof R[i]=="function"}function C(R){if(!N(R))return null;const ie=R._writableState,ve=R._readableState,Z=ie||ve;return!!(R.destroyed||R[s]||Z!=null&&Z.destroyed)}function S(R){if(!T(R))return null;if(R.writableEnded===!0)return!0;const ie=R._writableState;return ie!=null&&ie.errored?!1:typeof ie?.ended!="boolean"?null:ie.ended}function O(R,ie){if(!T(R))return null;if(R.writableFinished===!0)return!0;const ve=R._writableState;return ve!=null&&ve.errored?!1:typeof ve?.finished!="boolean"?null:!!(ve.finished||ie===!1&&ve.ended===!0&&ve.length===0)}function z(R){if(!v(R))return null;if(R.readableEnded===!0)return!0;const ie=R._readableState;return!ie||ie.errored?!1:typeof ie?.ended!="boolean"?null:ie.ended}function Y(R,ie){if(!v(R))return null;const ve=R._readableState;return ve!=null&&ve.errored?!1:typeof ve?.endEmitted!="boolean"?null:!!(ve.endEmitted||ie===!1&&ve.ended===!0&&ve.length===0)}function V(R){return R&&R[t]!=null?R[t]:typeof R?.readable!="boolean"?null:C(R)?!1:v(R)&&R.readable&&!Y(R)}function le(R){return R&&R[d]!=null?R[d]:typeof R?.writable!="boolean"?null:C(R)?!1:T(R)&&R.writable&&!S(R)}function G(R,ie){return N(R)?C(R)?!0:!(ie?.readable!==!1&&V(R)||ie?.writable!==!1&&le(R)):null}function H(R){var ie,ve;return N(R)?R.writableErrored?R.writableErrored:(ie=(ve=R._writableState)===null||ve===void 0?void 0:ve.errored)!==null&&ie!==void 0?ie:null:null}function ee(R){var ie,ve;return N(R)?R.readableErrored?R.readableErrored:(ie=(ve=R._readableState)===null||ve===void 0?void 0:ve.errored)!==null&&ie!==void 0?ie:null:null}function j(R){if(!N(R))return null;if(typeof R.closed=="boolean")return R.closed;const ie=R._writableState,ve=R._readableState;return typeof ie?.closed=="boolean"||typeof ve?.closed=="boolean"?ie?.closed||ve?.closed:typeof R._closed=="boolean"&&me(R)?R._closed:null}function me(R){return typeof R._closed=="boolean"&&typeof R._defaultKeepAlive=="boolean"&&typeof R._removedConnection=="boolean"&&typeof R._removedContLen=="boolean"}function Ae(R){return typeof R._sent100=="boolean"&&me(R)}function $e(R){var ie;return typeof R._consuming=="boolean"&&typeof R._dumped=="boolean"&&((ie=R.req)===null||ie===void 0?void 0:ie.upgradeOrConnect)===void 0}function Te(R){if(!N(R))return null;const ie=R._writableState,ve=R._readableState,Z=ie||ve;return!Z&&Ae(R)||!!(Z&&Z.autoDestroy&&Z.emitClose&&Z.closed===!1)}function re(R){var ie;return!!(R&&((ie=R[p])!==null&&ie!==void 0?ie:R.readableDidRead||R.readableAborted))}function be(R){var ie,ve,Z,ge,Re,Le,de,I,J,pe;return!!(R&&((ie=(ve=(Z=(ge=(Re=(Le=R[c])!==null&&Le!==void 0?Le:R.readableErrored)!==null&&Re!==void 0?Re:R.writableErrored)!==null&&ge!==void 0?ge:(de=R._readableState)===null||de===void 0?void 0:de.errorEmitted)!==null&&Z!==void 0?Z:(I=R._writableState)===null||I===void 0?void 0:I.errorEmitted)!==null&&ve!==void 0?ve:(J=R._readableState)===null||J===void 0?void 0:J.errored)!==null&&ie!==void 0?ie:!((pe=R._writableState)===null||pe===void 0)&&pe.errored))}r.exports={isDestroyed:C,kIsDestroyed:s,isDisturbed:re,kIsDisturbed:p,isErrored:be,kIsErrored:c,isReadable:V,kIsReadable:t,kIsClosedPromise:y,kControllerErrorFunction:m,kIsWritable:d,isClosed:j,isDuplexNodeStream:$,isFinished:G,isIterable:k,isReadableNodeStream:v,isReadableStream:P,isReadableEnded:z,isReadableFinished:Y,isReadableErrored:ee,isNodeStream:N,isWebStream:D,isWritable:le,isWritableNodeStream:T,isWritableStream:q,isWritableEnded:S,isWritableFinished:O,isWritableErrored:H,isServerRequest:$e,isServerResponse:Ae,willEmitClose:Te,isTransformStream:_}})),Ot=De(((e,r)=>{const n=Ut(),{AbortError:i,codes:o}=rt(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:c}=o,{kEmptyObject:t,once:d}=nt(),{validateAbortSignal:p,validateFunction:y,validateObject:m,validateBoolean:v}=dr(),{Promise:T,PromisePrototypeThen:$,SymbolDispose:N}=qe(),{isClosed:P,isReadable:q,isReadableNodeStream:_,isReadableStream:D,isReadableFinished:k,isReadableErrored:C,isWritable:S,isWritableNodeStream:O,isWritableStream:z,isWritableFinished:Y,isWritableErrored:V,isNodeStream:le,willEmitClose:G,kIsClosedPromise:H}=_t();let ee;function j(re){return re.setHeader&&typeof re.abort=="function"}const me=()=>{};function Ae(re,be,R){var ie,ve;if(arguments.length===2?(R=be,be=t):be==null?be=t:m(be,"options"),y(R,"callback"),p(be.signal,"options.signal"),R=d(R),D(re)||z(re))return $e(re,be,R);if(!le(re))throw new s("stream",["ReadableStream","WritableStream","Stream"],re);const Z=(ie=be.readable)!==null&&ie!==void 0?ie:_(re),ge=(ve=be.writable)!==null&&ve!==void 0?ve:O(re),Re=re._writableState,Le=re._readableState,de=()=>{re.writable||pe()};let I=G(re)&&_(re)===Z&&O(re)===ge,J=Y(re,!1);const pe=()=>{J=!0,re.destroyed&&(I=!1),!(I&&(!re.readable||Z))&&(!Z||Ee)&&R.call(re)};let Ee=k(re,!1);const F=()=>{Ee=!0,re.destroyed&&(I=!1),!(I&&(!re.writable||ge))&&(!ge||J)&&R.call(re)},E=B=>{R.call(re,B)};let U=P(re);const K=()=>{U=!0;const B=V(re)||C(re);if(B&&typeof B!="boolean")return R.call(re,B);if(Z&&!Ee&&_(re,!0)&&!k(re,!1))return R.call(re,new c);if(ge&&!J&&!Y(re,!1))return R.call(re,new c);R.call(re)},ue=()=>{U=!0;const B=V(re)||C(re);if(B&&typeof B!="boolean")return R.call(re,B);R.call(re)},ce=()=>{re.req.on("finish",pe)};j(re)?(re.on("complete",pe),I||re.on("abort",K),re.req?ce():re.on("request",ce)):ge&&!Re&&(re.on("end",de),re.on("close",de)),!I&&typeof re.aborted=="boolean"&&re.on("aborted",K),re.on("end",F),re.on("finish",pe),be.error!==!1&&re.on("error",E),re.on("close",K),U?n.nextTick(K):Re!=null&&Re.errorEmitted||Le!=null&&Le.errorEmitted?I||n.nextTick(ue):(!Z&&(!I||q(re))&&(J||S(re)===!1)||!ge&&(!I||S(re))&&(Ee||q(re)===!1)||Le&&re.req&&re.aborted)&&n.nextTick(ue);const fe=()=>{R=me,re.removeListener("aborted",K),re.removeListener("complete",pe),re.removeListener("abort",K),re.removeListener("request",ce),re.req&&re.req.removeListener("finish",pe),re.removeListener("end",de),re.removeListener("close",de),re.removeListener("finish",pe),re.removeListener("end",F),re.removeListener("error",E),re.removeListener("close",K)};if(be.signal&&!U){const B=()=>{const ne=R;fe(),ne.call(re,new i(void 0,{cause:be.signal.reason}))};if(be.signal.aborted)n.nextTick(B);else{ee=ee||nt().addAbortListener;const ne=ee(be.signal,B),he=R;R=d((...te)=>{ne[N](),he.apply(re,te)})}}return fe}function $e(re,be,R){let ie=!1,ve=me;if(be.signal)if(ve=()=>{ie=!0,R.call(re,new i(void 0,{cause:be.signal.reason}))},be.signal.aborted)n.nextTick(ve);else{ee=ee||nt().addAbortListener;const ge=ee(be.signal,ve),Re=R;R=d((...Le)=>{ge[N](),Re.apply(re,Le)})}const Z=(...ge)=>{ie||n.nextTick(()=>R.apply(re,ge))};return $(re[H].promise,Z,Z),me}function Te(re,be){var R;let ie=!1;return be===null&&(be=t),(R=be)!==null&&R!==void 0&&R.cleanup&&(v(be.cleanup,"cleanup"),ie=be.cleanup),new T((ve,Z)=>{const ge=Ae(re,be,Re=>{ie&&ge(),Re?Z(Re):ve()})})}r.exports=Ae,r.exports.finished=Te})),Jt=De(((e,r)=>{const n=Ut(),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:s}=rt(),{Symbol:c}=qe(),{kIsDestroyed:t,isDestroyed:d,isFinished:p,isServerRequest:y}=_t(),m=c("kDestroy"),v=c("kConstruct");function T(G,H,ee){G&&(G.stack,H&&!H.errored&&(H.errored=G),ee&&!ee.errored&&(ee.errored=G))}function $(G,H){const ee=this._readableState,j=this._writableState,me=j||ee;return j!=null&&j.destroyed||ee!=null&&ee.destroyed?(typeof H=="function"&&H(),this):(T(G,j,ee),j&&(j.destroyed=!0),ee&&(ee.destroyed=!0),me.constructed?N(this,G,H):this.once(m,function(Ae){N(this,i(Ae,G),H)}),this)}function N(G,H,ee){let j=!1;function me(Ae){if(j)return;j=!0;const $e=G._readableState,Te=G._writableState;T(Ae,Te,$e),Te&&(Te.closed=!0),$e&&($e.closed=!0),typeof ee=="function"&&ee(Ae),Ae?n.nextTick(P,G,Ae):n.nextTick(q,G)}try{G._destroy(H||null,me)}catch(Ae){me(Ae)}}function P(G,H){_(G,H),q(G)}function q(G){const H=G._readableState,ee=G._writableState;ee&&(ee.closeEmitted=!0),H&&(H.closeEmitted=!0),(ee!=null&&ee.emitClose||H!=null&&H.emitClose)&&G.emit("close")}function _(G,H){const ee=G._readableState,j=G._writableState;j!=null&&j.errorEmitted||ee!=null&&ee.errorEmitted||(j&&(j.errorEmitted=!0),ee&&(ee.errorEmitted=!0),G.emit("error",H))}function D(){const G=this._readableState,H=this._writableState;G&&(G.constructed=!0,G.closed=!1,G.closeEmitted=!1,G.destroyed=!1,G.errored=null,G.errorEmitted=!1,G.reading=!1,G.ended=G.readable===!1,G.endEmitted=G.readable===!1),H&&(H.constructed=!0,H.destroyed=!1,H.closed=!1,H.closeEmitted=!1,H.errored=null,H.errorEmitted=!1,H.finalCalled=!1,H.prefinished=!1,H.ended=H.writable===!1,H.ending=H.writable===!1,H.finished=H.writable===!1)}function k(G,H,ee){const j=G._readableState,me=G._writableState;if(me!=null&&me.destroyed||j!=null&&j.destroyed)return this;j!=null&&j.autoDestroy||me!=null&&me.autoDestroy?G.destroy(H):H&&(H.stack,me&&!me.errored&&(me.errored=H),j&&!j.errored&&(j.errored=H),ee?n.nextTick(_,G,H):_(G,H))}function C(G,H){if(typeof G._construct!="function")return;const ee=G._readableState,j=G._writableState;ee&&(ee.constructed=!1),j&&(j.constructed=!1),G.once(v,H),!(G.listenerCount(v)>1)&&n.nextTick(S,G)}function S(G){let H=!1;function ee(j){if(H){k(G,j??new o);return}H=!0;const me=G._readableState,Ae=G._writableState,$e=Ae||me;me&&(me.constructed=!0),Ae&&(Ae.constructed=!0),$e.destroyed?G.emit(m,j):j?k(G,j,!0):n.nextTick(O,G)}try{G._construct(j=>{n.nextTick(ee,j)})}catch(j){n.nextTick(ee,j)}}function O(G){G.emit(v)}function z(G){return G?.setHeader&&typeof G.abort=="function"}function Y(G){G.emit("close")}function V(G,H){G.emit("error",H),n.nextTick(Y,G)}function le(G,H){!G||d(G)||(!H&&!p(G)&&(H=new s),y(G)?(G.socket=null,G.destroy(H)):z(G)?G.abort():z(G.req)?G.req.abort():typeof G.destroy=="function"?G.destroy(H):typeof G.close=="function"?G.close():H?n.nextTick(V,G,H):n.nextTick(Y,G),G.destroyed||(G[t]=!0))}r.exports={construct:C,destroyer:le,destroy:$,undestroy:D,errorOrDestroy:k}})),Pn=De(((e,r)=>{const{ArrayIsArray:n,ObjectSetPrototypeOf:i}=qe(),{EventEmitter:o}=jr();function s(t){o.call(this,t)}i(s.prototype,o.prototype),i(s,o),s.prototype.pipe=function(t,d){const p=this;function y(q){t.writable&&t.write(q)===!1&&p.pause&&p.pause()}p.on("data",y);function m(){p.readable&&p.resume&&p.resume()}t.on("drain",m),!t._isStdio&&(!d||d.end!==!1)&&(p.on("end",T),p.on("close",$));let v=!1;function T(){v||(v=!0,t.end())}function $(){v||(v=!0,typeof t.destroy=="function"&&t.destroy())}function N(q){P(),o.listenerCount(this,"error")===0&&this.emit("error",q)}c(p,"error",N),c(t,"error",N);function P(){p.removeListener("data",y),t.removeListener("drain",m),p.removeListener("end",T),p.removeListener("close",$),p.removeListener("error",N),t.removeListener("error",N),p.removeListener("end",P),p.removeListener("close",P),t.removeListener("close",P)}return p.on("end",P),p.on("close",P),t.on("close",P),t.emit("pipe",p),t};function c(t,d,p){if(typeof t.prependListener=="function")return t.prependListener(d,p);!t._events||!t._events[d]?t.on(d,p):n(t._events[d])?t._events[d].unshift(p):t._events[d]=[p,t._events[d]]}r.exports={Stream:s,prependListener:c}})),qr=De(((e,r)=>{const{SymbolDispose:n}=qe(),{AbortError:i,codes:o}=rt(),{isNodeStream:s,isWebStream:c,kControllerErrorFunction:t}=_t(),d=Ot(),{ERR_INVALID_ARG_TYPE:p}=o;let y;const m=(v,T)=>{if(typeof v!="object"||!("aborted"in v))throw new p(T,"AbortSignal",v)};r.exports.addAbortSignal=function(T,$){if(m(T,"signal"),!s($)&&!c($))throw new p("stream",["ReadableStream","WritableStream","Stream"],$);return r.exports.addAbortSignalNoValidate(T,$)},r.exports.addAbortSignalNoValidate=function(v,T){if(typeof v!="object"||!("aborted"in v))return T;const $=s(T)?()=>{T.destroy(new i(void 0,{cause:v.reason}))}:()=>{T[t](new i(void 0,{cause:v.reason}))};return v.aborted?$():(y=y||nt().addAbortListener,d(T,y(v,$)[n])),T}})),xf=De(((e,r)=>{const{StringPrototypeSlice:n,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:s}=qe(),{Buffer:c}=mt(),{inspect:t}=nt();r.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(p){const y={data:p,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}unshift(p){const y={data:p,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}shift(){if(this.length===0)return;const p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}clear(){this.head=this.tail=null,this.length=0}join(p){if(this.length===0)return"";let y=this.head,m=""+y.data;for(;(y=y.next)!==null;)m+=p+y.data;return m}concat(p){if(this.length===0)return c.alloc(0);const y=c.allocUnsafe(p>>>0);let m=this.head,v=0;for(;m;)o(y,m.data,v),v+=m.data.length,m=m.next;return y}consume(p,y){const m=this.head.data;if(p<m.length){const v=m.slice(0,p);return this.head.data=m.slice(p),v}return p===m.length?this.shift():y?this._getString(p):this._getBuffer(p)}first(){return this.head.data}*[i](){for(let p=this.head;p;p=p.next)yield p.data}_getString(p){let y="",m=this.head,v=0;do{const T=m.data;if(p>T.length)y+=T,p-=T.length;else{p===T.length?(y+=T,++v,m.next?this.head=m.next:this.head=this.tail=null):(y+=n(T,0,p),this.head=m,m.data=n(T,p));break}++v}while((m=m.next)!==null);return this.length-=v,y}_getBuffer(p){const y=c.allocUnsafe(p),m=p;let v=this.head,T=0;do{const $=v.data;if(p>$.length)o(y,$,m-p),p-=$.length;else{p===$.length?(o(y,$,m-p),++T,v.next?this.head=v.next:this.head=this.tail=null):(o(y,new s($.buffer,$.byteOffset,p),m-p),this.head=v,v.data=$.slice(p));break}++T}while((v=v.next)!==null);return this.length-=T,y}[Symbol.for("nodejs.util.inspect.custom")](p,y){return t(this,{...y,depth:0,customInspect:!1})}}})),Gr=De(((e,r)=>{const{MathFloor:n,NumberIsInteger:i}=qe(),{validateInteger:o}=dr(),{ERR_INVALID_ARG_VALUE:s}=rt().codes;let c=16*1024,t=16;function d(v,T,$){return v.highWaterMark!=null?v.highWaterMark:T?v[$]:null}function p(v){return v?t:c}function y(v,T){o(T,"value",0),v?t=T:c=T}function m(v,T,$,N){const P=d(T,N,$);if(P!=null){if(!i(P)||P<0)throw new s(N?`options.${$}`:"options.highWaterMark",P);return n(P)}return p(v.objectMode)}r.exports={getHighWaterMark:m,getDefaultHighWaterMark:p,setDefaultHighWaterMark:y}})),$f=De(((e,r)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=mt(),i=n.Buffer;function o(c,t){for(var d in c)t[d]=c[d]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?r.exports=n:(o(n,e),e.Buffer=s);function s(c,t,d){return i(c,t,d)}s.prototype=Object.create(i.prototype),o(i,s),s.from=function(c,t,d){if(typeof c=="number")throw new TypeError("Argument must not be a number");return i(c,t,d)},s.alloc=function(c,t,d){if(typeof c!="number")throw new TypeError("Argument must be a number");var p=i(c);return t!==void 0?typeof d=="string"?p.fill(t,d):p.fill(t):p.fill(0),p},s.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return i(c)},s.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(c)}})),Rf=De((e=>{var r=$f().Buffer,n=r.isEncoding||function(_){switch(_=""+_,_&&_.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 i(_){if(!_)return"utf8";for(var D;;)switch(_){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 _;default:if(D)return;_=(""+_).toLowerCase(),D=!0}}function o(_){var D=i(_);if(typeof D!="string"&&(r.isEncoding===n||!n(_)))throw new Error("Unknown encoding: "+_);return D||_}e.StringDecoder=s;function s(_){this.encoding=o(_);var D;switch(this.encoding){case"utf16le":this.text=v,this.end=T,D=4;break;case"utf8":this.fillLast=p,D=4;break;case"base64":this.text=$,this.end=N,D=3;break;default:this.write=P,this.end=q;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(D)}s.prototype.write=function(_){if(_.length===0)return"";var D,k;if(this.lastNeed){if(D=this.fillLast(_),D===void 0)return"";k=this.lastNeed,this.lastNeed=0}else k=0;return k<_.length?D?D+this.text(_,k):this.text(_,k):D||""},s.prototype.end=m,s.prototype.text=y,s.prototype.fillLast=function(_){if(this.lastNeed<=_.length)return _.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_.length),this.lastNeed-=_.length};function c(_){return _<=127?0:_>>5===6?2:_>>4===14?3:_>>3===30?4:_>>6===2?-1:-2}function t(_,D,k){var C=D.length-1;if(C<k)return 0;var S=c(D[C]);return S>=0?(S>0&&(_.lastNeed=S-1),S):--C<k||S===-2?0:(S=c(D[C]),S>=0?(S>0&&(_.lastNeed=S-2),S):--C<k||S===-2?0:(S=c(D[C]),S>=0?(S>0&&(S===2?S=0:_.lastNeed=S-3),S):0))}function d(_,D,k){if((D[0]&192)!==128)return _.lastNeed=0,"�";if(_.lastNeed>1&&D.length>1){if((D[1]&192)!==128)return _.lastNeed=1,"�";if(_.lastNeed>2&&D.length>2&&(D[2]&192)!==128)return _.lastNeed=2,"�"}}function p(_){var D=this.lastTotal-this.lastNeed,k=d(this,_);if(k!==void 0)return k;if(this.lastNeed<=_.length)return _.copy(this.lastChar,D,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,D,0,_.length),this.lastNeed-=_.length}function y(_,D){var k=t(this,_,D);if(!this.lastNeed)return _.toString("utf8",D);this.lastTotal=k;var C=_.length-(k-this.lastNeed);return _.copy(this.lastChar,0,C),_.toString("utf8",D,C)}function m(_){var D=_&&_.length?this.write(_):"";return this.lastNeed?D+"�":D}function v(_,D){if((_.length-D)%2===0){var k=_.toString("utf16le",D);if(k){var C=k.charCodeAt(k.length-1);if(C>=55296&&C<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1],k.slice(0,-1)}return k}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_[_.length-1],_.toString("utf16le",D,_.length-1)}function T(_){var D=_&&_.length?this.write(_):"";if(this.lastNeed){var k=this.lastTotal-this.lastNeed;return D+this.lastChar.toString("utf16le",0,k)}return D}function $(_,D){var k=(_.length-D)%3;return k===0?_.toString("base64",D):(this.lastNeed=3-k,this.lastTotal=3,k===1?this.lastChar[0]=_[_.length-1]:(this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1]),_.toString("base64",D,_.length-k))}function N(_){var D=_&&_.length?this.write(_):"";return this.lastNeed?D+this.lastChar.toString("base64",0,3-this.lastNeed):D}function P(_){return _.toString(this.encoding)}function q(_){return _&&_.length?this.write(_):""}})),Us=De(((e,r)=>{const n=Ut(),{PromisePrototypeThen:i,SymbolAsyncIterator:o,SymbolIterator:s}=qe(),{Buffer:c}=mt(),{ERR_INVALID_ARG_TYPE:t,ERR_STREAM_NULL_VALUES:d}=rt().codes;function p(y,m,v){let T;if(typeof m=="string"||m instanceof c)return new y({objectMode:!0,...v,read(){this.push(m),this.push(null)}});let $;if(m&&m[o])$=!0,T=m[o]();else if(m&&m[s])$=!1,T=m[s]();else throw new t("iterable",["Iterable"],m);const N=new y({objectMode:!0,highWaterMark:1,...v});let P=!1;N._read=function(){P||(P=!0,_())},N._destroy=function(D,k){i(q(D),()=>n.nextTick(k,D),C=>n.nextTick(k,C||D))};async function q(D){const k=D!=null,C=typeof T.throw=="function";if(k&&C){const{value:S,done:O}=await T.throw(D);if(await S,O)return}if(typeof T.return=="function"){const{value:S}=await T.return();await S}}async function _(){for(;;){try{const{value:D,done:k}=$?await T.next():T.next();if(k)N.push(null);else{const C=D&&typeof D.then=="function"?await D:D;if(C===null)throw P=!1,new d;if(N.push(C))continue;P=!1}}catch(D){N.destroy(D)}break}}return N}r.exports=p})),zr=De(((e,r)=>{const n=Ut(),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:s,NumberParseInt:c,ObjectDefineProperties:t,ObjectKeys:d,ObjectSetPrototypeOf:p,Promise:y,SafeSet:m,SymbolAsyncDispose:v,SymbolAsyncIterator:T,Symbol:$}=qe();r.exports=te,te.ReadableState=he;const{EventEmitter:N}=jr(),{Stream:P,prependListener:q}=Pn(),{Buffer:_}=mt(),{addAbortSignal:D}=qr(),k=Ot();let C=nt().debuglog("stream",A=>{C=A});const S=xf(),O=Jt(),{getHighWaterMark:z,getDefaultHighWaterMark:Y}=Gr(),{aggregateTwoErrors:V,codes:{ERR_INVALID_ARG_TYPE:le,ERR_METHOD_NOT_IMPLEMENTED:G,ERR_OUT_OF_RANGE:H,ERR_STREAM_PUSH_AFTER_EOF:ee,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:j},AbortError:me}=rt(),{validateObject:Ae}=dr(),$e=$("kPaused"),{StringDecoder:Te}=Rf(),re=Us();p(te.prototype,P.prototype),p(te,P);const be=()=>{},{errorOrDestroy:R}=O,ie=1,ve=2,Z=4,ge=8,Re=16,Le=32,de=64,I=128,J=256,pe=512,Ee=1024,F=2048,E=4096,U=8192,K=16384,ue=32768,ce=65536,fe=1<<17,B=1<<18;function ne(A){return{enumerable:!1,get(){return(this.state&A)!==0},set(L){L?this.state|=A:this.state&=~A}}}t(he.prototype,{objectMode:ne(ie),ended:ne(ve),endEmitted:ne(Z),reading:ne(ge),constructed:ne(Re),sync:ne(Le),needReadable:ne(de),emittedReadable:ne(I),readableListening:ne(J),resumeScheduled:ne(pe),errorEmitted:ne(Ee),emitClose:ne(F),autoDestroy:ne(E),destroyed:ne(U),closed:ne(K),closeEmitted:ne(ue),multiAwaitDrain:ne(ce),readingMore:ne(fe),dataEmitted:ne(B)});function he(A,L,_e){typeof _e!="boolean"&&(_e=L instanceof St()),this.state=6192,A&&A.objectMode&&(this.state|=ie),_e&&A&&A.readableObjectMode&&(this.state|=ie),this.highWaterMark=A?z(this,A,"readableHighWaterMark",_e):Y(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this[$e]=null,A&&A.emitClose===!1&&(this.state&=-2049),A&&A.autoDestroy===!1&&(this.state&=-4097),this.errored=null,this.defaultEncoding=A&&A.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,A&&A.encoding&&(this.decoder=new Te(A.encoding),this.encoding=A.encoding)}function te(A){if(!(this instanceof te))return new te(A);const L=this instanceof St();this._readableState=new he(A,this,L),A&&(typeof A.read=="function"&&(this._read=A.read),typeof A.destroy=="function"&&(this._destroy=A.destroy),typeof A.construct=="function"&&(this._construct=A.construct),A.signal&&!L&&D(A.signal,this)),P.call(this,A),O.construct(this,()=>{this._readableState.needReadable&&Q(this,this._readableState)})}te.prototype.destroy=O.destroy,te.prototype._undestroy=O.undestroy,te.prototype._destroy=function(A,L){L(A)},te.prototype[N.captureRejectionSymbol]=function(A){this.destroy(A)},te.prototype[v]=function(){let A;return this.destroyed||(A=this.readableEnded?null:new me,this.destroy(A)),new y((L,_e)=>k(this,Se=>Se&&Se!==A?_e(Se):L(null)))},te.prototype.push=function(A,L){return xe(this,A,L,!1)},te.prototype.unshift=function(A,L){return xe(this,A,L,!0)};function xe(A,L,_e,Se){C("readableAddChunk",L);const Ie=A._readableState;let Ze;if((Ie.state&ie)===0&&(typeof L=="string"?(_e=_e||Ie.defaultEncoding,Ie.encoding!==_e&&(Se&&Ie.encoding?L=_.from(L,_e).toString(Ie.encoding):(L=_.from(L,_e),_e=""))):L instanceof _?_e="":P._isUint8Array(L)?(L=P._uint8ArrayToBuffer(L),_e=""):L!=null&&(Ze=new le("chunk",["string","Buffer","Uint8Array"],L))),Ze)R(A,Ze);else if(L===null)Ie.state&=-9,b(A,Ie);else if((Ie.state&ie)!==0||L&&L.length>0)if(Se)if((Ie.state&Z)!==0)R(A,new j);else{if(Ie.destroyed||Ie.errored)return!1;Qe(A,Ie,L,!0)}else if(Ie.ended)R(A,new ee);else{if(Ie.destroyed||Ie.errored)return!1;Ie.state&=-9,Ie.decoder&&!_e?(L=Ie.decoder.write(L),Ie.objectMode||L.length!==0?Qe(A,Ie,L,!1):Q(A,Ie)):Qe(A,Ie,L,!1)}else Se||(Ie.state&=-9,Q(A,Ie));return!Ie.ended&&(Ie.length<Ie.highWaterMark||Ie.length===0)}function Qe(A,L,_e,Se){L.flowing&&L.length===0&&!L.sync&&A.listenerCount("data")>0?((L.state&ce)!==0?L.awaitDrainWriters.clear():L.awaitDrainWriters=null,L.dataEmitted=!0,A.emit("data",_e)):(L.length+=L.objectMode?1:_e.length,Se?L.buffer.unshift(_e):L.buffer.push(_e),(L.state&de)!==0&&M(A)),Q(A,L)}te.prototype.isPaused=function(){const A=this._readableState;return A[$e]===!0||A.flowing===!1},te.prototype.setEncoding=function(A){const L=new Te(A);this._readableState.decoder=L,this._readableState.encoding=this._readableState.decoder.encoding;const _e=this._readableState.buffer;let Se="";for(const Ie of _e)Se+=L.write(Ie);return _e.clear(),Se!==""&&_e.push(Se),this._readableState.length=Se.length,this};const g=1073741824;function l(A){if(A>g)throw new H("size","<= 1GiB",A);return A--,A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A++,A}function u(A,L){return A<=0||L.length===0&&L.ended?0:(L.state&ie)!==0?1:s(A)?L.flowing&&L.length?L.buffer.first().length:L.length:A<=L.length?A:L.ended?L.length:0}te.prototype.read=function(A){C("read",A),A===void 0?A=NaN:o(A)||(A=c(A,10));const L=this._readableState,_e=A;if(A>L.highWaterMark&&(L.highWaterMark=l(A)),A!==0&&(L.state&=-129),A===0&&L.needReadable&&((L.highWaterMark!==0?L.length>=L.highWaterMark:L.length>0)||L.ended))return C("read: emitReadable",L.length,L.ended),L.length===0&&L.ended?$r(this):M(this),null;if(A=u(A,L),A===0&&L.ended)return L.length===0&&$r(this),null;let Se=(L.state&de)!==0;if(C("need readable",Se),(L.length===0||L.length-A<L.highWaterMark)&&(Se=!0,C("length less than watermark",Se)),L.ended||L.reading||L.destroyed||L.errored||!L.constructed)Se=!1,C("reading, ended or constructing",Se);else if(Se){C("do read"),L.state|=40,L.length===0&&(L.state|=de);try{this._read(L.highWaterMark)}catch(Ze){R(this,Ze)}L.state&=-33,L.reading||(A=u(_e,L))}let Ie;return A>0?Ie=xr(A,L):Ie=null,Ie===null?(L.needReadable=L.length<=L.highWaterMark,A=0):(L.length-=A,L.multiAwaitDrain?L.awaitDrainWriters.clear():L.awaitDrainWriters=null),L.length===0&&(L.ended||(L.needReadable=!0),_e!==A&&L.ended&&$r(this)),Ie!==null&&!L.errorEmitted&&!L.closeEmitted&&(L.dataEmitted=!0,this.emit("data",Ie)),Ie};function b(A,L){if(C("onEofChunk"),!L.ended){if(L.decoder){const _e=L.decoder.end();_e&&_e.length&&(L.buffer.push(_e),L.length+=L.objectMode?1:_e.length)}L.ended=!0,L.sync?M(A):(L.needReadable=!1,L.emittedReadable=!0,W(A))}}function M(A){const L=A._readableState;C("emitReadable",L.needReadable,L.emittedReadable),L.needReadable=!1,L.emittedReadable||(C("emitReadable",L.flowing),L.emittedReadable=!0,n.nextTick(W,A))}function W(A){const L=A._readableState;C("emitReadable_",L.destroyed,L.length,L.ended),!L.destroyed&&!L.errored&&(L.length||L.ended)&&(A.emit("readable"),L.emittedReadable=!1),L.needReadable=!L.flowing&&!L.ended&&L.length<=L.highWaterMark,yn(A)}function Q(A,L){!L.readingMore&&L.constructed&&(L.readingMore=!0,n.nextTick(ke,A,L))}function ke(A,L){for(;!L.reading&&!L.ended&&(L.length<L.highWaterMark||L.flowing&&L.length===0);){const _e=L.length;if(C("maybeReadMore read 0"),A.read(0),_e===L.length)break}L.readingMore=!1}te.prototype._read=function(A){throw new G("_read()")},te.prototype.pipe=function(A,L){const _e=this,Se=this._readableState;Se.pipes.length===1&&(Se.multiAwaitDrain||(Se.multiAwaitDrain=!0,Se.awaitDrainWriters=new m(Se.awaitDrainWriters?[Se.awaitDrainWriters]:[]))),Se.pipes.push(A),C("pipe count=%d opts=%j",Se.pipes.length,L);const Ie=(!L||L.end!==!1)&&A!==n.stdout&&A!==n.stderr?it:Pt;Se.endEmitted?n.nextTick(Ie):_e.once("end",Ie),A.on("unpipe",Ze);function Ze(Tt,ht){C("onunpipe"),Tt===_e&&ht&&ht.hasUnpiped===!1&&(ht.hasUnpiped=!0,Mi())}function it(){C("onend"),A.end()}let st,Rt=!1;function Mi(){C("cleanup"),A.removeListener("close",Tr),A.removeListener("finish",Ir),st&&A.removeListener("drain",st),A.removeListener("error",or),A.removeListener("unpipe",Ze),_e.removeListener("end",it),_e.removeListener("end",Pt),_e.removeListener("data",dt),Rt=!0,st&&Se.awaitDrainWriters&&(!A._writableState||A._writableState.needDrain)&&st()}function wn(){Rt||(Se.pipes.length===1&&Se.pipes[0]===A?(C("false write response, pause",0),Se.awaitDrainWriters=A,Se.multiAwaitDrain=!1):Se.pipes.length>1&&Se.pipes.includes(A)&&(C("false write response, pause",Se.awaitDrainWriters.size),Se.awaitDrainWriters.add(A)),_e.pause()),st||(st=Be(_e,A),A.on("drain",st))}_e.on("data",dt);function dt(Tt){C("ondata");const ht=A.write(Tt);C("dest.write",ht),ht===!1&&wn()}function or(Tt){if(C("onerror",Tt),Pt(),A.removeListener("error",or),A.listenerCount("error")===0){const ht=A._writableState||A._readableState;ht&&!ht.errorEmitted?R(A,Tt):A.emit("error",Tt)}}q(A,"error",or);function Tr(){A.removeListener("finish",Ir),Pt()}A.once("close",Tr);function Ir(){C("onfinish"),A.removeListener("close",Tr),Pt()}A.once("finish",Ir);function Pt(){C("unpipe"),_e.unpipe(A)}return A.emit("pipe",_e),A.writableNeedDrain===!0?wn():Se.flowing||(C("pipe resume"),_e.resume()),A};function Be(A,L){return function(){const Se=A._readableState;Se.awaitDrainWriters===L?(C("pipeOnDrain",1),Se.awaitDrainWriters=null):Se.multiAwaitDrain&&(C("pipeOnDrain",Se.awaitDrainWriters.size),Se.awaitDrainWriters.delete(L)),(!Se.awaitDrainWriters||Se.awaitDrainWriters.size===0)&&A.listenerCount("data")&&A.resume()}}te.prototype.unpipe=function(A){const L=this._readableState,_e={hasUnpiped:!1};if(L.pipes.length===0)return this;if(!A){const Ie=L.pipes;L.pipes=[],this.pause();for(let Ze=0;Ze<Ie.length;Ze++)Ie[Ze].emit("unpipe",this,{hasUnpiped:!1});return this}const Se=i(L.pipes,A);return Se===-1?this:(L.pipes.splice(Se,1),L.pipes.length===0&&this.pause(),A.emit("unpipe",this,_e),this)},te.prototype.on=function(A,L){const _e=P.prototype.on.call(this,A,L),Se=this._readableState;return A==="data"?(Se.readableListening=this.listenerCount("readable")>0,Se.flowing!==!1&&this.resume()):A==="readable"&&!Se.endEmitted&&!Se.readableListening&&(Se.readableListening=Se.needReadable=!0,Se.flowing=!1,Se.emittedReadable=!1,C("on readable",Se.length,Se.reading),Se.length?M(this):Se.reading||n.nextTick(He,this)),_e},te.prototype.addListener=te.prototype.on,te.prototype.removeListener=function(A,L){const _e=P.prototype.removeListener.call(this,A,L);return A==="readable"&&n.nextTick(Fe,this),_e},te.prototype.off=te.prototype.removeListener,te.prototype.removeAllListeners=function(A){const L=P.prototype.removeAllListeners.apply(this,arguments);return(A==="readable"||A===void 0)&&n.nextTick(Fe,this),L};function Fe(A){const L=A._readableState;L.readableListening=A.listenerCount("readable")>0,L.resumeScheduled&&L[$e]===!1?L.flowing=!0:A.listenerCount("data")>0?A.resume():L.readableListening||(L.flowing=null)}function He(A){C("readable nexttick read 0"),A.read(0)}te.prototype.resume=function(){const A=this._readableState;return A.flowing||(C("resume"),A.flowing=!A.readableListening,Ue(this,A)),A[$e]=!1,this};function Ue(A,L){L.resumeScheduled||(L.resumeScheduled=!0,n.nextTick(pn,A,L))}function pn(A,L){C("resume",L.reading),L.reading||A.read(0),L.resumeScheduled=!1,A.emit("resume"),yn(A),L.flowing&&!L.reading&&A.read(0)}te.prototype.pause=function(){return C("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(C("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[$e]=!0,this};function yn(A){const L=A._readableState;for(C("flow",L.flowing);L.flowing&&A.read()!==null;);}te.prototype.wrap=function(A){let L=!1;A.on("data",Se=>{!this.push(Se)&&A.pause&&(L=!0,A.pause())}),A.on("end",()=>{this.push(null)}),A.on("error",Se=>{R(this,Se)}),A.on("close",()=>{this.destroy()}),A.on("destroy",()=>{this.destroy()}),this._read=()=>{L&&A.resume&&(L=!1,A.resume())};const _e=d(A);for(let Se=1;Se<_e.length;Se++){const Ie=_e[Se];this[Ie]===void 0&&typeof A[Ie]=="function"&&(this[Ie]=A[Ie].bind(A))}return this},te.prototype[T]=function(){return gn(this)},te.prototype.iterator=function(A){return A!==void 0&&Ae(A,"options"),gn(this,A)};function gn(A,L){typeof A.read!="function"&&(A=te.wrap(A,{objectMode:!0}));const _e=ki(A,L);return _e.stream=A,_e}async function*ki(A,L){let _e=be;function Se(it){this===A?(_e(),_e=be):_e=it}A.on("readable",Se);let Ie;const Ze=k(A,{writable:!1},it=>{Ie=it?V(Ie,it):null,_e(),_e=be});try{for(;;){const it=A.destroyed?null:A.read();if(it!==null)yield it;else{if(Ie)throw Ie;if(Ie===null)return;await new y(Se)}}}catch(it){throw Ie=V(Ie,it),Ie}finally{(Ie||L?.destroyOnReturn!==!1)&&(Ie===void 0||A._readableState.autoDestroy)?O.destroyer(A,null):(A.off("readable",Se),Ze())}}t(te.prototype,{readable:{__proto__:null,get(){const A=this._readableState;return!!A&&A.readable!==!1&&!A.destroyed&&!A.errorEmitted&&!A.endEmitted},set(A){this._readableState&&(this._readableState.readable=!!A)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(A){this._readableState&&(this._readableState.flowing=A)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(A){this._readableState&&(this._readableState.destroyed=A)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),t(he.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[$e]!==!1},set(A){this[$e]=!!A}}}),te._fromList=xr;function xr(A,L){if(L.length===0)return null;let _e;return L.objectMode?_e=L.buffer.shift():!A||A>=L.length?(L.decoder?_e=L.buffer.join(""):L.buffer.length===1?_e=L.buffer.first():_e=L.buffer.concat(L.length),L.buffer.clear()):_e=L.buffer.consume(A,L.decoder),_e}function $r(A){const L=A._readableState;C("endReadable",L.endEmitted),L.endEmitted||(L.ended=!0,n.nextTick(Li,L,A))}function Li(A,L){if(C("endReadableNT",A.endEmitted,A.length),!A.errored&&!A.closeEmitted&&!A.endEmitted&&A.length===0){if(A.endEmitted=!0,L.emit("end"),L.writable&&L.allowHalfOpen===!1)n.nextTick(Ci,L);else if(A.autoDestroy){const _e=L._writableState;(!_e||_e.autoDestroy&&(_e.finished||_e.writable===!1))&&L.destroy()}}}function Ci(A){A.writable&&!A.writableEnded&&!A.destroyed&&A.end()}te.from=function(A,L){return re(te,A,L)};let Rr;function Gt(){return Rr===void 0&&(Rr={}),Rr}te.fromWeb=function(A,L){return Gt().newStreamReadableFromReadableStream(A,L)},te.toWeb=function(A,L){return Gt().newReadableStreamFromStreamReadable(A,L)},te.wrap=function(A,L){var _e,Se;return new te({objectMode:(_e=(Se=A.readableObjectMode)!==null&&Se!==void 0?Se:A.objectMode)!==null&&_e!==void 0?_e:!0,...L,destroy(Ie,Ze){O.destroyer(A,Ie),Ze(Ie)}}).wrap(A)}})),Bn=De(((e,r)=>{const n=Ut(),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:c,ObjectDefineProperties:t,ObjectSetPrototypeOf:d,StringPrototypeToLowerCase:p,Symbol:y,SymbolHasInstance:m}=qe();r.exports=Ae,Ae.WritableState=j;const{EventEmitter:v}=jr(),T=Pn().Stream,{Buffer:$}=mt(),N=Jt(),{addAbortSignal:P}=qr(),{getHighWaterMark:q,getDefaultHighWaterMark:_}=Gr(),{ERR_INVALID_ARG_TYPE:D,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_MULTIPLE_CALLBACK:C,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:O,ERR_STREAM_ALREADY_FINISHED:z,ERR_STREAM_NULL_VALUES:Y,ERR_STREAM_WRITE_AFTER_END:V,ERR_UNKNOWN_ENCODING:le}=rt().codes,{errorOrDestroy:G}=N;d(Ae.prototype,T.prototype),d(Ae,T);function H(){}const ee=y("kOnFinished");function j(E,U,K){typeof K!="boolean"&&(K=U instanceof St()),this.objectMode=!!(E&&E.objectMode),K&&(this.objectMode=this.objectMode||!!(E&&E.writableObjectMode)),this.highWaterMark=E?q(this,E,"writableHighWaterMark",K):_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ue=!!(E&&E.decodeStrings===!1);this.decodeStrings=!ue,this.defaultEncoding=E&&E.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=R.bind(void 0,U),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,me(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!E||E.emitClose!==!1,this.autoDestroy=!E||E.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ee]=[]}function me(E){E.buffered=[],E.bufferedIndex=0,E.allBuffers=!0,E.allNoop=!0}j.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},c(j.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Ae(E){const U=this instanceof St();if(!U&&!s(Ae,this))return new Ae(E);this._writableState=new j(E,this,U),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),typeof E.construct=="function"&&(this._construct=E.construct),E.signal&&P(E.signal,this)),T.call(this,E),N.construct(this,()=>{const K=this._writableState;K.writing||ge(this,K),I(this,K)})}c(Ae,m,{__proto__:null,value:function(E){return s(this,E)?!0:this!==Ae?!1:E&&E._writableState instanceof j}}),Ae.prototype.pipe=function(){G(this,new S)};function $e(E,U,K,ue){const ce=E._writableState;if(typeof K=="function")ue=K,K=ce.defaultEncoding;else{if(!K)K=ce.defaultEncoding;else if(K!=="buffer"&&!$.isEncoding(K))throw new le(K);typeof ue!="function"&&(ue=H)}if(U===null)throw new Y;if(!ce.objectMode)if(typeof U=="string")ce.decodeStrings!==!1&&(U=$.from(U,K),K="buffer");else if(U instanceof $)K="buffer";else if(T._isUint8Array(U))U=T._uint8ArrayToBuffer(U),K="buffer";else throw new D("chunk",["string","Buffer","Uint8Array"],U);let fe;return ce.ending?fe=new V:ce.destroyed&&(fe=new O("write")),fe?(n.nextTick(ue,fe),G(E,fe,!0),fe):(ce.pendingcb++,Te(E,ce,U,K,ue))}Ae.prototype.write=function(E,U,K){return $e(this,E,U,K)===!0},Ae.prototype.cork=function(){this._writableState.corked++},Ae.prototype.uncork=function(){const E=this._writableState;E.corked&&(E.corked--,E.writing||ge(this,E))},Ae.prototype.setDefaultEncoding=function(U){if(typeof U=="string"&&(U=p(U)),!$.isEncoding(U))throw new le(U);return this._writableState.defaultEncoding=U,this};function Te(E,U,K,ue,ce){const fe=U.objectMode?1:K.length;U.length+=fe;const B=U.length<U.highWaterMark;return B||(U.needDrain=!0),U.writing||U.corked||U.errored||!U.constructed?(U.buffered.push({chunk:K,encoding:ue,callback:ce}),U.allBuffers&&ue!=="buffer"&&(U.allBuffers=!1),U.allNoop&&ce!==H&&(U.allNoop=!1)):(U.writelen=fe,U.writecb=ce,U.writing=!0,U.sync=!0,E._write(K,ue,U.onwrite),U.sync=!1),B&&!U.errored&&!U.destroyed}function re(E,U,K,ue,ce,fe,B){U.writelen=ue,U.writecb=B,U.writing=!0,U.sync=!0,U.destroyed?U.onwrite(new O("write")):K?E._writev(ce,U.onwrite):E._write(ce,fe,U.onwrite),U.sync=!1}function be(E,U,K,ue){--U.pendingcb,ue(K),Z(U),G(E,K)}function R(E,U){const K=E._writableState,ue=K.sync,ce=K.writecb;if(typeof ce!="function"){G(E,new C);return}K.writing=!1,K.writecb=null,K.length-=K.writelen,K.writelen=0,U?(U.stack,K.errored||(K.errored=U),E._readableState&&!E._readableState.errored&&(E._readableState.errored=U),ue?n.nextTick(be,E,K,U,ce):be(E,K,U,ce)):(K.buffered.length>K.bufferedIndex&&ge(E,K),ue?K.afterWriteTickInfo!==null&&K.afterWriteTickInfo.cb===ce?K.afterWriteTickInfo.count++:(K.afterWriteTickInfo={count:1,cb:ce,stream:E,state:K},n.nextTick(ie,K.afterWriteTickInfo)):ve(E,K,1,ce))}function ie({stream:E,state:U,count:K,cb:ue}){return U.afterWriteTickInfo=null,ve(E,U,K,ue)}function ve(E,U,K,ue){for(!U.ending&&!E.destroyed&&U.length===0&&U.needDrain&&(U.needDrain=!1,E.emit("drain"));K-- >0;)U.pendingcb--,ue();U.destroyed&&Z(U),I(E,U)}function Z(E){if(E.writing)return;for(let ce=E.bufferedIndex;ce<E.buffered.length;++ce){var U;const{chunk:fe,callback:B}=E.buffered[ce],ne=E.objectMode?1:fe.length;E.length-=ne,B((U=E.errored)!==null&&U!==void 0?U:new O("write"))}const K=E[ee].splice(0);for(let ce=0;ce<K.length;ce++){var ue;K[ce]((ue=E.errored)!==null&&ue!==void 0?ue:new O("end"))}me(E)}function ge(E,U){if(U.corked||U.bufferProcessing||U.destroyed||!U.constructed)return;const{buffered:K,bufferedIndex:ue,objectMode:ce}=U,fe=K.length-ue;if(!fe)return;let B=ue;if(U.bufferProcessing=!0,fe>1&&E._writev){U.pendingcb-=fe-1;const ne=U.allNoop?H:te=>{for(let xe=B;xe<K.length;++xe)K[xe].callback(te)},he=U.allNoop&&B===0?K:i(K,B);he.allBuffers=U.allBuffers,re(E,U,!0,U.length,he,"",ne),me(U)}else{do{const{chunk:ne,encoding:he,callback:te}=K[B];K[B++]=null,re(E,U,!1,ce?1:ne.length,ne,he,te)}while(B<K.length&&!U.writing);B===K.length?me(U):B>256?(K.splice(0,B),U.bufferedIndex=0):U.bufferedIndex=B}U.bufferProcessing=!1}Ae.prototype._write=function(E,U,K){if(this._writev)this._writev([{chunk:E,encoding:U}],K);else throw new k("_write()")},Ae.prototype._writev=null,Ae.prototype.end=function(E,U,K){const ue=this._writableState;typeof E=="function"?(K=E,E=null,U=null):typeof U=="function"&&(K=U,U=null);let ce;if(E!=null){const fe=$e(this,E,U);fe instanceof o&&(ce=fe)}return ue.corked&&(ue.corked=1,this.uncork()),ce||(!ue.errored&&!ue.ending?(ue.ending=!0,I(this,ue,!0),ue.ended=!0):ue.finished?ce=new z("end"):ue.destroyed&&(ce=new O("end"))),typeof K=="function"&&(ce||ue.finished?n.nextTick(K,ce):ue[ee].push(K)),this};function Re(E){return E.ending&&!E.destroyed&&E.constructed&&E.length===0&&!E.errored&&E.buffered.length===0&&!E.finished&&!E.writing&&!E.errorEmitted&&!E.closeEmitted}function Le(E,U){let K=!1;function ue(ce){if(K){G(E,ce??C());return}if(K=!0,U.pendingcb--,ce){const fe=U[ee].splice(0);for(let B=0;B<fe.length;B++)fe[B](ce);G(E,ce,U.sync)}else Re(U)&&(U.prefinished=!0,E.emit("prefinish"),U.pendingcb++,n.nextTick(J,E,U))}U.sync=!0,U.pendingcb++;try{E._final(ue)}catch(ce){ue(ce)}U.sync=!1}function de(E,U){!U.prefinished&&!U.finalCalled&&(typeof E._final=="function"&&!U.destroyed?(U.finalCalled=!0,Le(E,U)):(U.prefinished=!0,E.emit("prefinish")))}function I(E,U,K){Re(U)&&(de(E,U),U.pendingcb===0&&(K?(U.pendingcb++,n.nextTick((ue,ce)=>{Re(ce)?J(ue,ce):ce.pendingcb--},E,U)):Re(U)&&(U.pendingcb++,J(E,U))))}function J(E,U){U.pendingcb--,U.finished=!0;const K=U[ee].splice(0);for(let ue=0;ue<K.length;ue++)K[ue]();if(E.emit("finish"),U.autoDestroy){const ue=E._readableState;(!ue||ue.autoDestroy&&(ue.endEmitted||ue.readable===!1))&&E.destroy()}}t(Ae.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(E){this._writableState&&(this._writableState.destroyed=E)}},writable:{__proto__:null,get(){const E=this._writableState;return!!E&&E.writable!==!1&&!E.destroyed&&!E.errored&&!E.ending&&!E.ended},set(E){this._writableState&&(this._writableState.writable=!!E)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const E=this._writableState;return E?!E.destroyed&&!E.ending&&E.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const pe=N.destroy;Ae.prototype.destroy=function(E,U){const K=this._writableState;return!K.destroyed&&(K.bufferedIndex<K.buffered.length||K[ee].length)&&n.nextTick(Z,K),pe.call(this,E,U),this},Ae.prototype._undestroy=N.undestroy,Ae.prototype._destroy=function(E,U){U(E)},Ae.prototype[v.captureRejectionSymbol]=function(E){this.destroy(E)};let Ee;function F(){return Ee===void 0&&(Ee={}),Ee}Ae.fromWeb=function(E,U){return F().newStreamWritableFromWritableStream(E,U)},Ae.toWeb=function(E){return F().newWritableStreamFromStreamWritable(E)}})),Tf=De(((e,r)=>{const n=Ut(),i=mt(),{isReadable:o,isWritable:s,isIterable:c,isNodeStream:t,isReadableNodeStream:d,isWritableNodeStream:p,isDuplexNodeStream:y,isReadableStream:m,isWritableStream:v}=_t(),T=Ot(),{AbortError:$,codes:{ERR_INVALID_ARG_TYPE:N,ERR_INVALID_RETURN_VALUE:P}}=rt(),{destroyer:q}=Jt(),_=St(),D=zr(),k=Bn(),{createDeferredPromise:C}=nt(),S=Us(),O=globalThis.Blob||i.Blob,z=typeof O<"u"?function(j){return j instanceof O}:function(j){return!1},Y=globalThis.AbortController||fr().AbortController,{FunctionPrototypeCall:V}=qe();var le=class extends _{constructor(ee){super(ee),ee?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),ee?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};r.exports=function ee(j,me){if(y(j))return j;if(d(j))return H({readable:j});if(p(j))return H({writable:j});if(t(j))return H({writable:!1,readable:!1});if(m(j))return H({readable:D.fromWeb(j)});if(v(j))return H({writable:k.fromWeb(j)});if(typeof j=="function"){const{value:$e,write:Te,final:re,destroy:be}=G(j);if(c($e))return S(le,$e,{objectMode:!0,write:Te,final:re,destroy:be});const R=$e?.then;if(typeof R=="function"){let ie;const ve=V(R,$e,Z=>{if(Z!=null)throw new P("nully","body",Z)},Z=>{q(ie,Z)});return ie=new le({objectMode:!0,readable:!1,write:Te,final(Z){re(async()=>{try{await ve,n.nextTick(Z,null)}catch(ge){n.nextTick(Z,ge)}})},destroy:be})}throw new P("Iterable, AsyncIterable or AsyncFunction",me,$e)}if(z(j))return ee(j.arrayBuffer());if(c(j))return S(le,j,{objectMode:!0,writable:!1});if(m(j?.readable)&&v(j?.writable))return le.fromWeb(j);if(typeof j?.writable=="object"||typeof j?.readable=="object")return H({readable:j!=null&&j.readable?d(j?.readable)?j?.readable:ee(j.readable):void 0,writable:j!=null&&j.writable?p(j?.writable)?j?.writable:ee(j.writable):void 0});const Ae=j?.then;if(typeof Ae=="function"){let $e;return V(Ae,j,Te=>{Te!=null&&$e.push(Te),$e.push(null)},Te=>{q($e,Te)}),$e=new le({objectMode:!0,writable:!1,read(){}})}throw new N(me,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],j)};function G(ee){let{promise:j,resolve:me}=C();const Ae=new Y,$e=Ae.signal;return{value:ee((async function*(){for(;;){const Te=j;j=null;const{chunk:re,done:be,cb:R}=await Te;if(n.nextTick(R),be)return;if($e.aborted)throw new $(void 0,{cause:$e.reason});({promise:j,resolve:me}=C()),yield re}})(),{signal:$e}),write(Te,re,be){const R=me;me=null,R({chunk:Te,done:!1,cb:be})},final(Te){const re=me;me=null,re({done:!0,cb:Te})},destroy(Te,re){Ae.abort(),re(Te)}}}function H(ee){const j=ee.readable&&typeof ee.readable.read!="function"?D.wrap(ee.readable):ee.readable,me=ee.writable;let Ae=!!o(j),$e=!!s(me),Te,re,be,R,ie;function ve(Z){const ge=R;R=null,ge?ge(Z):Z&&ie.destroy(Z)}return ie=new le({readableObjectMode:!!(j!=null&&j.readableObjectMode),writableObjectMode:!!(me!=null&&me.writableObjectMode),readable:Ae,writable:$e}),$e&&(T(me,Z=>{$e=!1,Z&&q(j,Z),ve(Z)}),ie._write=function(Z,ge,Re){me.write(Z,ge)?Re():Te=Re},ie._final=function(Z){me.end(),re=Z},me.on("drain",function(){if(Te){const Z=Te;Te=null,Z()}}),me.on("finish",function(){if(re){const Z=re;re=null,Z()}})),Ae&&(T(j,Z=>{Ae=!1,Z&&q(j,Z),ve(Z)}),j.on("readable",function(){if(be){const Z=be;be=null,Z()}}),j.on("end",function(){ie.push(null)}),ie._read=function(){for(;;){const Z=j.read();if(Z===null){be=ie._read;return}if(!ie.push(Z))return}}),ie._destroy=function(Z,ge){!Z&&R!==null&&(Z=new $),be=null,Te=null,re=null,R===null?ge(Z):(R=ge,q(me,Z),q(j,Z))},ie}})),St=De(((e,r)=>{const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:o,ObjectSetPrototypeOf:s}=qe();r.exports=d;const c=zr(),t=Bn();s(d.prototype,c.prototype),s(d,c);{const v=o(t.prototype);for(let T=0;T<v.length;T++){const $=v[T];d.prototype[$]||(d.prototype[$]=t.prototype[$])}}function d(v){if(!(this instanceof d))return new d(v);c.call(this,v),t.call(this,v),v?(this.allowHalfOpen=v.allowHalfOpen!==!1,v.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),v.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(d.prototype,{writable:{__proto__:null,...i(t.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(t.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(t.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(t.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(t.prototype,"writableLength")},writableFinished:{__proto__:null,...i(t.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(t.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(t.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(t.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(v){this._readableState&&this._writableState&&(this._readableState.destroyed=v,this._writableState.destroyed=v)}}});let p;function y(){return p===void 0&&(p={}),p}d.fromWeb=function(v,T){return y().newStreamDuplexFromReadableWritablePair(v,T)},d.toWeb=function(v){return y().newReadableWritablePairFromDuplex(v)};let m;d.from=function(v){return m||(m=Tf()),m(v,"body")}})),Ws=De(((e,r)=>{const{ObjectSetPrototypeOf:n,Symbol:i}=qe();r.exports=d;const{ERR_METHOD_NOT_IMPLEMENTED:o}=rt().codes,s=St(),{getHighWaterMark:c}=Gr();n(d.prototype,s.prototype),n(d,s);const t=i("kCallback");function d(m){if(!(this instanceof d))return new d(m);const v=m?c(this,m,"readableHighWaterMark",!0):null;v===0&&(m={...m,highWaterMark:null,readableHighWaterMark:v,writableHighWaterMark:m.writableHighWaterMark||0}),s.call(this,m),this._readableState.sync=!1,this[t]=null,m&&(typeof m.transform=="function"&&(this._transform=m.transform),typeof m.flush=="function"&&(this._flush=m.flush)),this.on("prefinish",y)}function p(m){typeof this._flush=="function"&&!this.destroyed?this._flush((v,T)=>{if(v){m?m(v):this.destroy(v);return}T!=null&&this.push(T),this.push(null),m&&m()}):(this.push(null),m&&m())}function y(){this._final!==p&&p.call(this)}d.prototype._final=p,d.prototype._transform=function(m,v,T){throw new o("_transform()")},d.prototype._write=function(m,v,T){const $=this._readableState,N=this._writableState,P=$.length;this._transform(m,v,(q,_)=>{if(q){T(q);return}_!=null&&this.push(_),N.ended||P===$.length||$.length<$.highWaterMark?T():this[t]=T})},d.prototype._read=function(){if(this[t]){const m=this[t];this[t]=null,m()}}})),Hs=De(((e,r)=>{const{ObjectSetPrototypeOf:n}=qe();r.exports=o;const i=Ws();n(o.prototype,i.prototype),n(o,i);function o(s){if(!(this instanceof o))return new o(s);i.call(this,s)}o.prototype._transform=function(s,c,t){t(null,s)}})),Fn=De(((e,r)=>{const n=Ut(),{ArrayIsArray:i,Promise:o,SymbolAsyncIterator:s,SymbolDispose:c}=qe(),t=Ot(),{once:d}=nt(),p=Jt(),y=St(),{aggregateTwoErrors:m,codes:{ERR_INVALID_ARG_TYPE:v,ERR_INVALID_RETURN_VALUE:T,ERR_MISSING_ARGS:$,ERR_STREAM_DESTROYED:N,ERR_STREAM_PREMATURE_CLOSE:P},AbortError:q}=rt(),{validateFunction:_,validateAbortSignal:D}=dr(),{isIterable:k,isReadable:C,isReadableNodeStream:S,isNodeStream:O,isTransformStream:z,isWebStream:Y,isReadableStream:V,isReadableFinished:le}=_t(),G=globalThis.AbortController||fr().AbortController;let H,ee,j;function me(Z,ge,Re){let Le=!1;return Z.on("close",()=>{Le=!0}),{destroy:de=>{Le||(Le=!0,p.destroyer(Z,de||new N("pipe")))},cleanup:t(Z,{readable:ge,writable:Re},de=>{Le=!de})}}function Ae(Z){return _(Z[Z.length-1],"streams[stream.length - 1]"),Z.pop()}function $e(Z){if(k(Z))return Z;if(S(Z))return Te(Z);throw new v("val",["Readable","Iterable","AsyncIterable"],Z)}async function*Te(Z){ee||(ee=zr()),yield*ee.prototype[s].call(Z)}async function re(Z,ge,Re,{end:Le}){let de,I=null;const J=F=>{if(F&&(de=F),I){const E=I;I=null,E()}},pe=()=>new o((F,E)=>{de?E(de):I=()=>{de?E(de):F()}});ge.on("drain",J);const Ee=t(ge,{readable:!1},J);try{ge.writableNeedDrain&&await pe();for await(const F of Z)ge.write(F)||await pe();Le&&(ge.end(),await pe()),Re()}catch(F){Re(de!==F?m(de,F):F)}finally{Ee(),ge.off("drain",J)}}async function be(Z,ge,Re,{end:Le}){z(ge)&&(ge=ge.writable);const de=ge.getWriter();try{for await(const I of Z)await de.ready,de.write(I).catch(()=>{});await de.ready,Le&&await de.close(),Re()}catch(I){try{await de.abort(I),Re(I)}catch(J){Re(J)}}}function R(...Z){return ie(Z,d(Ae(Z)))}function ie(Z,ge,Re){if(Z.length===1&&i(Z[0])&&(Z=Z[0]),Z.length<2)throw new $("streams");const Le=new G,de=Le.signal,I=Re?.signal,J=[];D(I,"options.signal");function pe(){ce(new q)}j=j||nt().addAbortListener;let Ee;I&&(Ee=j(I,pe));let F,E;const U=[];let K=0;function ue(he){ce(he,--K===0)}function ce(he,te){var xe;if(he&&(!F||F.code==="ERR_STREAM_PREMATURE_CLOSE")&&(F=he),!(!F&&!te)){for(;U.length;)U.shift()(F);(xe=Ee)===null||xe===void 0||xe[c](),Le.abort(),te&&(F||J.forEach(Qe=>Qe()),n.nextTick(ge,F,E))}}let fe;for(let he=0;he<Z.length;he++){const te=Z[he],xe=he<Z.length-1,Qe=he>0,g=xe||Re?.end!==!1,l=he===Z.length-1;if(O(te)){let u=function(b){b&&b.name!=="AbortError"&&b.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ue(b)};if(g){const{destroy:b,cleanup:M}=me(te,xe,Qe);U.push(b),C(te)&&l&&J.push(M)}te.on("error",u),C(te)&&l&&J.push(()=>{te.removeListener("error",u)})}if(he===0)if(typeof te=="function"){if(fe=te({signal:de}),!k(fe))throw new T("Iterable, AsyncIterable or Stream","source",fe)}else k(te)||S(te)||z(te)?fe=te:fe=y.from(te);else if(typeof te=="function"){if(z(fe)){var B;fe=$e((B=fe)===null||B===void 0?void 0:B.readable)}else fe=$e(fe);if(fe=te(fe,{signal:de}),xe){if(!k(fe,!0))throw new T("AsyncIterable",`transform[${he-1}]`,fe)}else{var ne;H||(H=Hs());const u=new H({objectMode:!0}),b=(ne=fe)===null||ne===void 0?void 0:ne.then;if(typeof b=="function")K++,b.call(fe,Q=>{E=Q,Q!=null&&u.write(Q),g&&u.end(),n.nextTick(ue)},Q=>{u.destroy(Q),n.nextTick(ue,Q)});else if(k(fe,!0))K++,re(fe,u,ue,{end:g});else if(V(fe)||z(fe)){const Q=fe.readable||fe;K++,re(Q,u,ue,{end:g})}else throw new T("AsyncIterable or Promise","destination",fe);fe=u;const{destroy:M,cleanup:W}=me(fe,!1,!0);U.push(M),l&&J.push(W)}}else if(O(te)){if(S(fe)){K+=2;const u=ve(fe,te,ue,{end:g});C(te)&&l&&J.push(u)}else if(z(fe)||V(fe)){const u=fe.readable||fe;K++,re(u,te,ue,{end:g})}else if(k(fe))K++,re(fe,te,ue,{end:g});else throw new v("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],fe);fe=te}else if(Y(te)){if(S(fe))K++,be($e(fe),te,ue,{end:g});else if(V(fe)||k(fe))K++,be(fe,te,ue,{end:g});else if(z(fe))K++,be(fe.readable,te,ue,{end:g});else throw new v("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],fe);fe=te}else fe=y.from(te)}return(de!=null&&de.aborted||I!=null&&I.aborted)&&n.nextTick(pe),fe}function ve(Z,ge,Re,{end:Le}){let de=!1;if(ge.on("close",()=>{de||Re(new P)}),Z.pipe(ge,{end:!1}),Le){let I=function(){de=!0,ge.end()};le(Z)?n.nextTick(I):Z.once("end",I)}else Re();return t(Z,{readable:!0,writable:!1},I=>{const J=Z._readableState;I&&I.code==="ERR_STREAM_PREMATURE_CLOSE"&&J&&J.ended&&!J.errored&&!J.errorEmitted?Z.once("end",Re).once("error",Re):Re(I)}),t(ge,{readable:!1,writable:!0},Re)}r.exports={pipelineImpl:ie,pipeline:R}})),js=De(((e,r)=>{const{pipeline:n}=Fn(),i=St(),{destroyer:o}=Jt(),{isNodeStream:s,isReadable:c,isWritable:t,isWebStream:d,isTransformStream:p,isWritableStream:y,isReadableStream:m}=_t(),{AbortError:v,codes:{ERR_INVALID_ARG_VALUE:T,ERR_MISSING_ARGS:$}}=rt(),N=Ot();r.exports=function(...q){if(q.length===0)throw new $("streams");if(q.length===1)return i.from(q[0]);const _=[...q];if(typeof q[0]=="function"&&(q[0]=i.from(q[0])),typeof q[q.length-1]=="function"){const H=q.length-1;q[H]=i.from(q[H])}for(let H=0;H<q.length;++H)if(!(!s(q[H])&&!d(q[H]))){if(H<q.length-1&&!(c(q[H])||m(q[H])||p(q[H])))throw new T(`streams[${H}]`,_[H],"must be readable");if(H>0&&!(t(q[H])||y(q[H])||p(q[H])))throw new T(`streams[${H}]`,_[H],"must be writable")}let D,k,C,S,O;function z(H){const ee=S;S=null,ee?ee(H):H?O.destroy(H):!G&&!le&&O.destroy()}const Y=q[0],V=n(q,z),le=!!(t(Y)||y(Y)||p(Y)),G=!!(c(V)||m(V)||p(V));if(O=new i({writableObjectMode:!!(Y!=null&&Y.writableObjectMode),readableObjectMode:!!(V!=null&&V.readableObjectMode),writable:le,readable:G}),le){if(s(Y))O._write=function(H,ee,j){Y.write(H,ee)?j():D=j},O._final=function(H){Y.end(),k=H},Y.on("drain",function(){if(D){const H=D;D=null,H()}});else if(d(Y)){const H=(p(Y)?Y.writable:Y).getWriter();O._write=async function(ee,j,me){try{await H.ready,H.write(ee).catch(()=>{}),me()}catch(Ae){me(Ae)}},O._final=async function(ee){try{await H.ready,H.close().catch(()=>{}),k=ee}catch(j){ee(j)}}}N(p(V)?V.readable:V,()=>{if(k){const H=k;k=null,H()}})}if(G){if(s(V))V.on("readable",function(){if(C){const H=C;C=null,H()}}),V.on("end",function(){O.push(null)}),O._read=function(){for(;;){const H=V.read();if(H===null){C=O._read;return}if(!O.push(H))return}};else if(d(V)){const H=(p(V)?V.readable:V).getReader();O._read=async function(){for(;;)try{const{value:ee,done:j}=await H.read();if(!O.push(ee))return;if(j){O.push(null);return}}catch{return}}}}return O._destroy=function(H,ee){!H&&S!==null&&(H=new v),C=null,D=null,k=null,S===null?ee(H):(S=ee,s(V)&&o(V,H))},O}})),If=De(((e,r)=>{const n=globalThis.AbortController||fr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:c},AbortError:t}=rt(),{validateAbortSignal:d,validateInteger:p,validateObject:y}=dr(),m=qe().Symbol("kWeak"),v=qe().Symbol("kResistStopPropagation"),{finished:T}=Ot(),$=js(),{addAbortSignalNoValidate:N}=qr(),{isWritable:P,isNodeStream:q}=_t(),{deprecate:_}=nt(),{ArrayPrototypePush:D,Boolean:k,MathFloor:C,Number:S,NumberIsNaN:O,Promise:z,PromiseReject:Y,PromiseResolve:V,PromisePrototypeThen:le,Symbol:G}=qe(),H=G("kEmpty"),ee=G("kEof");function j(I,J){if(J!=null&&y(J,"options"),J?.signal!=null&&d(J.signal,"options.signal"),q(I)&&!P(I))throw new i("stream",I,"must be writable");const pe=$(this,I);return J!=null&&J.signal&&N(J.signal,pe),pe}function me(I,J){if(typeof I!="function")throw new o("fn",["Function","AsyncFunction"],I);J!=null&&y(J,"options"),J?.signal!=null&&d(J.signal,"options.signal");let pe=1;J?.concurrency!=null&&(pe=C(J.concurrency));let Ee=pe-1;return J?.highWaterMark!=null&&(Ee=C(J.highWaterMark)),p(pe,"options.concurrency",1),p(Ee,"options.highWaterMark",0),Ee+=pe,async function*(){const E=nt().AbortSignalAny([J?.signal].filter(k)),U=this,K=[],ue={signal:E};let ce,fe,B=!1,ne=0;function he(){B=!0,te()}function te(){ne-=1,xe()}function xe(){fe&&!B&&ne<pe&&K.length<Ee&&(fe(),fe=null)}async function Qe(){try{for await(let g of U){if(B)return;if(E.aborted)throw new t;try{if(g=I(g,ue),g===H)continue;g=V(g)}catch(l){g=Y(l)}ne+=1,le(g,te,he),K.push(g),ce&&(ce(),ce=null),!B&&(K.length>=Ee||ne>=pe)&&await new z(l=>{fe=l})}K.push(ee)}catch(g){const l=Y(g);le(l,te,he),K.push(l)}finally{B=!0,ce&&(ce(),ce=null)}}Qe();try{for(;;){for(;K.length>0;){const g=await K[0];if(g===ee)return;if(E.aborted)throw new t;g!==H&&(yield g),K.shift(),xe()}await new z(g=>{ce=g})}}finally{B=!0,fe&&(fe(),fe=null)}}.call(this)}function Ae(I=void 0){return I!=null&&y(I,"options"),I?.signal!=null&&d(I.signal,"options.signal"),async function*(){let pe=0;for await(const F of this){var Ee;if(I!=null&&(Ee=I.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new t({cause:I.signal.reason});yield[pe++,F]}}.call(this)}async function $e(I,J=void 0){for await(const pe of R.call(this,I,J))return!0;return!1}async function Te(I,J=void 0){if(typeof I!="function")throw new o("fn",["Function","AsyncFunction"],I);return!await $e.call(this,async(...pe)=>!await I(...pe),J)}async function re(I,J){for await(const pe of R.call(this,I,J))return pe}async function be(I,J){if(typeof I!="function")throw new o("fn",["Function","AsyncFunction"],I);async function pe(Ee,F){return await I(Ee,F),H}for await(const Ee of me.call(this,pe,J));}function R(I,J){if(typeof I!="function")throw new o("fn",["Function","AsyncFunction"],I);async function pe(Ee,F){return await I(Ee,F)?Ee:H}return me.call(this,pe,J)}var ie=class extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function ve(I,J,pe){var Ee;if(typeof I!="function")throw new o("reducer",["Function","AsyncFunction"],I);pe!=null&&y(pe,"options"),pe?.signal!=null&&d(pe.signal,"options.signal");let F=arguments.length>1;if(pe!=null&&(Ee=pe.signal)!==null&&Ee!==void 0&&Ee.aborted){const ce=new t(void 0,{cause:pe.signal.reason});throw this.once("error",()=>{}),await T(this.destroy(ce)),ce}const E=new n,U=E.signal;if(pe!=null&&pe.signal){const ce={once:!0,[m]:this,[v]:!0};pe.signal.addEventListener("abort",()=>E.abort(),ce)}let K=!1;try{for await(const ce of this){var ue;if(K=!0,pe!=null&&(ue=pe.signal)!==null&&ue!==void 0&&ue.aborted)throw new t;F?J=await I(J,ce,{signal:U}):(J=ce,F=!0)}if(!K&&!F)throw new ie}finally{E.abort()}return J}async function Z(I){I!=null&&y(I,"options"),I?.signal!=null&&d(I.signal,"options.signal");const J=[];for await(const Ee of this){var pe;if(I!=null&&(pe=I.signal)!==null&&pe!==void 0&&pe.aborted)throw new t(void 0,{cause:I.signal.reason});D(J,Ee)}return J}function ge(I,J){const pe=me.call(this,I,J);return async function*(){for await(const F of pe)yield*F}.call(this)}function Re(I){if(I=S(I),O(I))return 0;if(I<0)throw new c("number",">= 0",I);return I}function Le(I,J=void 0){return J!=null&&y(J,"options"),J?.signal!=null&&d(J.signal,"options.signal"),I=Re(I),async function*(){var Ee;if(J!=null&&(Ee=J.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new t;for await(const E of this){var F;if(J!=null&&(F=J.signal)!==null&&F!==void 0&&F.aborted)throw new t;I--<=0&&(yield E)}}.call(this)}function de(I,J=void 0){return J!=null&&y(J,"options"),J?.signal!=null&&d(J.signal,"options.signal"),I=Re(I),async function*(){var Ee;if(J!=null&&(Ee=J.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new t;for await(const E of this){var F;if(J!=null&&(F=J.signal)!==null&&F!==void 0&&F.aborted)throw new t;if(I-- >0&&(yield E),I<=0)return}}.call(this)}r.exports.streamReturningOperators={asIndexedPairs:_(Ae,"readable.asIndexedPairs will be removed in a future version."),drop:Le,filter:R,flatMap:ge,map:me,take:de,compose:j},r.exports.promiseReturningOperators={every:Te,forEach:be,reduce:ve,toArray:Z,some:$e,find:re}})),qs=De(((e,r)=>{const{ArrayPrototypePop:n,Promise:i}=qe(),{isIterable:o,isNodeStream:s,isWebStream:c}=_t(),{pipelineImpl:t}=Fn(),{finished:d}=Ot();Gs();function p(...y){return new i((m,v)=>{let T,$;const N=y[y.length-1];if(N&&typeof N=="object"&&!s(N)&&!o(N)&&!c(N)){const P=n(y);T=P.signal,$=P.end}t(y,(P,q)=>{P?v(P):m(q)},{signal:T,end:$})})}r.exports={finished:d,pipeline:p}})),Gs=De(((e,r)=>{const{Buffer:n}=mt(),{ObjectDefineProperty:i,ObjectKeys:o,ReflectApply:s}=qe(),{promisify:{custom:c}}=nt(),{streamReturningOperators:t,promiseReturningOperators:d}=If(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:p}}=rt(),y=js(),{setDefaultHighWaterMark:m,getDefaultHighWaterMark:v}=Gr(),{pipeline:T}=Fn(),{destroyer:$}=Jt(),N=Ot(),P=qs(),q=_t(),_=r.exports=Pn().Stream;_.isDestroyed=q.isDestroyed,_.isDisturbed=q.isDisturbed,_.isErrored=q.isErrored,_.isReadable=q.isReadable,_.isWritable=q.isWritable,_.Readable=zr();for(const k of o(t)){let C=function(...O){if(new.target)throw p();return _.Readable.from(s(S,this,O))};const S=t[k];i(C,"name",{__proto__:null,value:S.name}),i(C,"length",{__proto__:null,value:S.length}),i(_.Readable.prototype,k,{__proto__:null,value:C,enumerable:!1,configurable:!0,writable:!0})}for(const k of o(d)){let C=function(...O){if(new.target)throw p();return s(S,this,O)};const S=d[k];i(C,"name",{__proto__:null,value:S.name}),i(C,"length",{__proto__:null,value:S.length}),i(_.Readable.prototype,k,{__proto__:null,value:C,enumerable:!1,configurable:!0,writable:!0})}_.Writable=Bn(),_.Duplex=St(),_.Transform=Ws(),_.PassThrough=Hs(),_.pipeline=T;const{addAbortSignal:D}=qr();_.addAbortSignal=D,_.finished=N,_.destroy=$,_.compose=y,_.setDefaultHighWaterMark=m,_.getDefaultHighWaterMark=v,i(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return P}}),i(T,c,{__proto__:null,enumerable:!0,get(){return P.pipeline}}),i(N,c,{__proto__:null,enumerable:!0,get(){return P.finished}}),_.Stream=_,_._isUint8Array=function(C){return C instanceof Uint8Array},_._uint8ArrayToBuffer=function(C){return n.from(C.buffer,C.byteOffset,C.byteLength)}})),kf=De(((e,r)=>{const n=Gs(),i=qs(),o=n.Readable.destroy;r.exports=n.Readable,r.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,r.exports._isUint8Array=n._isUint8Array,r.exports.isDisturbed=n.isDisturbed,r.exports.isErrored=n.isErrored,r.exports.isReadable=n.isReadable,r.exports.Readable=n.Readable,r.exports.Writable=n.Writable,r.exports.Duplex=n.Duplex,r.exports.Transform=n.Transform,r.exports.PassThrough=n.PassThrough,r.exports.addAbortSignal=n.addAbortSignal,r.exports.finished=n.finished,r.exports.destroy=n.destroy,r.exports.destroy=o,r.exports.pipeline=n.pipeline,r.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get(){return i}}),r.exports.Stream=n.Stream,r.exports.default=r.exports})),Lf=We({Duplex:()=>Cf,PassThrough:()=>Mf,Readable:()=>zs,Stream:()=>Un,Transform:()=>Of,Writable:()=>Vs,__esModule:()=>!0,_isArrayBufferView:()=>Ys,addAbortSignal:()=>Nf,compose:()=>Df,default:()=>qf,destroy:()=>Pf,finished:()=>Bf,getDefaultHighWaterMark:()=>Wn,isDestroyed:()=>Ks,isDisturbed:()=>Ff,isErrored:()=>Uf,isReadable:()=>Wf,isWritable:()=>Xs,pipeline:()=>Hf,promises:()=>jf,setDefaultHighWaterMark:()=>Hn});const{Duplex:Cf,PassThrough:Mf,Readable:zs,Stream:Un,Transform:Of,Writable:Vs,addAbortSignal:Nf,compose:Df,destroy:Pf,finished:Bf,isDisturbed:Ff,isErrored:Uf,isReadable:Wf,pipeline:Hf,promises:jf}=ji(kf()).default,{getDefaultHighWaterMark:Wn,isDestroyed:Ks,isWritable:Xs,setDefaultHighWaterMark:Hn}=Un;Wn(!1)!==64*1024&&Hn(!1,64*1024);const Ys=e=>ArrayBuffer.isView(e),qf=Object.assign(Un,{_isArrayBufferView:Ys,getDefaultHighWaterMark:Wn,isDestroyed:Ks,isWritable:Xs,setDefaultHighWaterMark:Hn}),Qs="/dsh",Gf=`${Qs}/home`,jn=`${Qs}/tmp`;var Zs=We({__esModule:()=>!0,basename:()=>Xr,default:()=>Kn,delimiter:()=>":",dirname:()=>zn,extname:()=>Vn,format:()=>to,isAbsolute:()=>Gn,join:()=>eo,normalize:()=>qn,parse:()=>ro,posix:()=>Kn,relative:()=>Kr,resolve:()=>Wt,sep:()=>"/",toNamespacedPath:()=>no,win32:()=>io});const Vr=46,ot=47,zf=()=>globalThis.process?.cwd?.()??"/dsh";function yt(e){if(typeof e!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function Js(e,r){let n="",i=0,o=-1,s=0,c=0;for(let t=0;t<=e.length;++t){if(t<e.length)c=e.charCodeAt(t);else{if(c===ot)break;c=ot}if(c===ot){if(!(o===t-1||s===1))if(s===2){if(n.length<2||i!==2||n.charCodeAt(n.length-1)!==Vr||n.charCodeAt(n.length-2)!==Vr){if(n.length>2){const d=n.lastIndexOf("/");d===-1?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),o=t,s=0;continue}else if(n.length!==0){n="",i=0,o=t,s=0;continue}}r&&(n+=n.length>0?"/..":"..",i=2)}else n.length>0?n+=`/${e.slice(o+1,t)}`:n=e.slice(o+1,t),i=t-o-1;o=t,s=0}else c===Vr&&s!==-1?++s:s=-1}return n}function Wt(...e){let r="",n=!1;for(let o=e.length-1;o>=0&&!n;o--){const s=e[o];yt(s),s.length!==0&&(r=r.length===0?s:`${s}/${r}`,n=s.charCodeAt(0)===ot)}if(!n){const o=zf();r=r.length===0?o:`${o}/${r}`,n=o.charCodeAt(0)===ot}const i=Js(r,!n);return n?`/${i}`:i.length>0?i:"."}function qn(e){if(yt(e),e.length===0)return".";const r=e.charCodeAt(0)===ot,n=e.charCodeAt(e.length-1)===ot;let i=Js(e,!r);return i.length===0?r?"/":n?"./":".":(n&&(i+="/"),r?`/${i}`:i)}function Gn(e){return yt(e),e.length>0&&e.charCodeAt(0)===ot}function eo(...e){if(e.length===0)return".";let r;for(const n of e)yt(n),n.length!==0&&(r=r===void 0?n:`${r}/${n}`);return r===void 0?".":qn(r)}function Kr(e,r){if(yt(e),yt(r),e===r)return"";const n=Wt(e),i=Wt(r);if(n===i)return"";const o=n.split("/").filter(t=>t.length>0),s=i.split("/").filter(t=>t.length>0);let c=0;for(;c<o.length&&c<s.length&&o[c]===s[c];)c++;return[...Array.from({length:o.length-c},()=>".."),...s.slice(c)].join("/")}function zn(e){if(yt(e),e.length===0)return".";const r=e.charCodeAt(0)===ot;let n=-1,i=!0;for(let o=e.length-1;o>=1;--o)if(e.charCodeAt(o)===ot){if(!i){n=o;break}}else i=!1;return n===-1?r?"/":".":r&&n===1?"//":e.slice(0,n)}function Xr(e,r){yt(e);let n=0,i=-1,o=!0;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r===e)return"";let s=r.length-1,c=-1;for(let t=e.length-1;t>=0;--t){const d=e.charCodeAt(t);if(d===ot){if(!o){n=t+1;break}continue}c===-1&&(o=!1,c=t+1),s>=0&&(d===r.charCodeAt(s)?--s===-1&&(i=t):(s=-1,i=c))}return n===i?i=c:i===-1&&(i=e.length),e.slice(n,i)}for(let s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===ot){if(!o){n=s+1;break}}else i===-1&&(o=!1,i=s+1);return i===-1?"":e.slice(n,i)}function Vn(e){yt(e);let r=-1,n=0,i=-1,o=!0,s=0;for(let c=e.length-1;c>=0;--c){const t=e.charCodeAt(c);if(t===ot){if(!o){n=c+1;break}continue}i===-1&&(o=!1,i=c+1),t===Vr?r===-1?r=c:s!==1&&(s=1):r!==-1&&(s=-1)}return r===-1||i===-1||s===0||s===1&&r===i-1&&r===n+1?"":e.slice(r,i)}function to(e){const r=e.dir??e.root??"",n=e.base??`${e.name??""}${e.ext??""}`;return r===""?n:r===e.root?`${r}${n}`:`${r}/${n}`}function ro(e){yt(e);const r=Xr(e),n=Vn(e),i=e.length>1?e.replace(/\/+$/,""):e,o=i.lastIndexOf("/"),s=Gn(e)?"/":"";return{root:s,dir:i===""?s:o===-1?"":o===0?"/":i.slice(0,o),base:r,ext:n,name:n.length>0?r.slice(0,r.length-n.length):r}}function no(e){return e}const Kn={resolve:Wt,normalize:qn,isAbsolute:Gn,join:eo,relative:Kr,dirname:zn,basename:Xr,extname:Vn,format:to,parse:ro,sep:"/",delimiter:":",toNamespacedPath:no,get posix(){return Kn},get win32(){return io}},ut=e=>()=>{throw new Error(`web-preview: node:path.win32.${e} is unreachable — the worker host reports platform "linux"`)},io={resolve:ut("resolve"),normalize:ut("normalize"),isAbsolute:ut("isAbsolute"),join:ut("join"),relative:ut("relative"),dirname:ut("dirname"),basename:ut("basename"),extname:ut("extname"),format:ut("format"),parse:ut("parse"),toNamespacedPath:ut("toNamespacedPath"),sep:"\\",delimiter:";"};function er(e){const r=new Error("The operation was aborted");return r.name="AbortError",r.code="ABORT_ERR",e!==void 0&&(r.cause=e),r}const Xn=e=>typeof e=="string"?Wt(e):e instanceof URL?Wt(decodeURIComponent(e.pathname)):Wt(new TextDecoder().decode(e)),Vf=e=>({size:e?0n:0,ino:e?0n:0,mtimeMs:e?0n:0,ctimeMs:e?0n:0,atimeMs:e?0n:0,birthtimeMs:e?0n:0,mtime:new Date(0),mode:e?0n:0,...e?{dev:0n,nlink:0n,mtimeNs:0n,ctimeNs:0n,atimeNs:0n,birthtimeNs:0n,ctime:new Date(0),atime:new Date(0),birthtime:new Date(0)}:{},isFile:()=>!1,isDirectory:()=>!1,isSymbolicLink:()=>!1,isFIFO:()=>!1,isSocket:()=>!1,isBlockDevice:()=>!1,isCharacterDevice:()=>!1}),so=(e,r)=>{try{return Kt().statSync(e,{bigint:r})}catch(n){if(n.code==="ENOENT")return Vf(r);throw n}},Kf=(e,r)=>e.size!==r.size||e.mtimeMs!==r.mtimeMs||e.mode!==r.mode||e.ino!==r.ino||e.isFile()!==r.isFile()||e.isDirectory()!==r.isDirectory(),hr=(e,r)=>e==="/"||r===e||r.startsWith(`${e}/`),Xf=(e,r)=>hr(e,r)||hr(r,e);var Yn=class extends Ft{target;directory;options;disposeMutation;signal;onAbort;closed=!1;referenced;constructor(e,r,n,i){super(),this.target=e,this.directory=r,this.options=n,this.referenced=n.persistent??!0;const o=Xt();if(i!==void 0&&this.on("change",i),this.disposeMutation=Kt().subscribe(s=>{if(!this.matches(s))return;const c=s.kind==="write"&&!s.entryChanged||s.kind==="chmod"?"change":"rename",t=this.filename(s.path);queueMicrotask(()=>{this.closed||It(o,()=>{this.emit("change",c,t)})})}),this.signal=n.signal,this.onAbort=n.signal===void 0?void 0:()=>{this.close()},n.signal?.aborted===!0){this.close();return}n.signal?.addEventListener("abort",this.onAbort,{once:!0})}matches(e){if(e.path===this.target||e.kind==="remove"&&hr(e.path,this.target))return!0;if(!this.directory||!hr(this.target,e.path))return!1;if(this.options.recursive===!0)return!0;const r=Kr(this.target,e.path);return r!==""&&!r.startsWith("..")&&!r.includes("/")}filename(e){const r=Kr(this.target,e),n=this.directory&&hr(this.target,e)?this.options.recursive===!0?r:r.split("/")[0]??"":Xr(this.target);return this.options.encoding==="buffer"?tt.Buffer.from(n):n}close(){this.closed||(this.closed=!0,this.disposeMutation(),this.onAbort!==void 0&&this.signal?.removeEventListener("abort",this.onAbort),queueMicrotask(()=>{this.emit("close")}))}ref(){return this.referenced=!0,this}unref(){return this.referenced=!1,this}hasRef(){return this.referenced}};function Qn(e,r,n){const i=typeof r=="object"?r:typeof r=="string"?{encoding:r}:{},o=typeof r=="function"?r:n,s=Xn(e);return new Yn(s,Kt().statSync(s).isDirectory(),i,o)}var Zn=class extends Ft{path;disposeMutation;timer;previous;stopped=!1;referenced;context;interval;bigint;constructor(e,r){super(),this.path=e,this.referenced=r.persistent??!0,this.interval=r.interval??5007,this.bigint=r.bigint??!1,this.previous=so(e,this.bigint),this.context=Xt(),this.disposeMutation=Kt().subscribe(n=>{Xf(e,n.path)&&this.schedule()}),!this.previous.isFile()&&!this.previous.isDirectory()&&this.schedule(!0)}schedule(e=!1){this.stopped||this.timer!==void 0||(this.timer=setTimeout(()=>{if(this.timer=void 0,this.stopped)return;const r=so(this.path,this.bigint),n=this.previous;this.previous=r,(e||Kf(r,n))&&It(this.context,()=>{this.emit("change",r,n)})},this.interval),this.referenced||oo(this.timer))}stop(){this.stopped||(this.stopped=!0,this.disposeMutation(),this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0,this.emit("stop"))}close(){this.stop()}ref(){return this.referenced=!0,this.timer!==void 0&&Yf(this.timer),this}unref(){return this.referenced=!1,this.timer!==void 0&&oo(this.timer),this}hasRef(){return this.referenced}};const Yf=e=>{e.ref?.()},oo=e=>{e.unref?.()},Yr=new Map;function ao(e,r,n){const i=typeof r=="function"?{}:r,o=typeof r=="function"?r:n;if(o===void 0)throw new TypeError('The "listener" argument must be of type function');const s=Xn(e);let c=Yr.get(s);return c===void 0&&(c=new Zn(s,i),Yr.set(s,c),c.once("stop",()=>{Yr.delete(s)})),c.on("change",o),c}function lo(e,r){const n=Xn(e),i=Yr.get(n);i!==void 0&&(r===void 0?i.removeAllListeners("change"):i.removeListener("change",r),i.listenerCount("change")===0&&i.stop())}function Qf(e,r={}){const n=[],i=[];let o,s,c=!1;const t=()=>{r.signal?.removeEventListener("abort",p),o?.close()},d=v=>{if(c)return;const T=v instanceof Error?v:new Error(String(v));c=!0,n.length=0,t();const $=i.shift();$===void 0?s=T:$.reject(T);for(const N of i.splice(0))N.resolve({done:!0,value:void 0})},p=()=>{d(er(r.signal?.reason))},y=()=>{if(!(o!==void 0||c||s!==void 0)){if(r.signal?.aborted===!0){d(er(r.signal.reason));return}try{o=Qn(e,r,(v,T)=>{const $={eventType:v,filename:T},N=i.shift();N===void 0?n.push($):N.resolve({done:!1,value:$})}),o.on("error",d),r.signal?.addEventListener("abort",p,{once:!0})}catch(v){d(v)}}},m=()=>{const v=c;c=!0,n.length=0,s=void 0,v||t();for(const T of i.splice(0))T.resolve({done:!0,value:void 0})};return{[Symbol.asyncIterator](){return this},next(){if(y(),s!==void 0){const T=s;return s=void 0,Promise.reject(T)}const v=n.shift();return v!==void 0?Promise.resolve({done:!1,value:v}):c?Promise.resolve({done:!0,value:void 0}):new Promise((T,$)=>{i.push({resolve:T,reject:$})})},return(){return m(),Promise.resolve({done:!0,value:void 0})},throw(v){return m(),Promise.reject(v)}}}var Zf=We({Dirent:()=>Zr,FSWatcher:()=>Yn,ReadStream:()=>di,StatWatcher:()=>Zn,WriteStream:()=>hi,__esModule:()=>!0,accessSync:()=>li,appendFileSync:()=>en,chmodSync:()=>tn,closeSync:()=>sn,constants:()=>Jn,createReadStream:()=>bo,createWriteStream:()=>mo,default:()=>ed,existsSync:()=>ei,linkSync:()=>ui,lstat:()=>ho,lstatSync:()=>ri,mkdirSync:()=>pr,mkdtempSync:()=>ii,openHandleSync:()=>fi,openSync:()=>yr,opendirSync:()=>pi,promises:()=>br,readFileSync:()=>Jr,readSync:()=>nn,readdirSync:()=>rn,realpathSync:()=>ni,renameSync:()=>ai,rmSync:()=>si,stat:()=>ti,statSync:()=>Ht,unlinkSync:()=>oi,unwatchFile:()=>lo,watch:()=>Qn,watchFile:()=>ao,writeFileSync:()=>tr,writeSync:()=>wr});const Ge=()=>Kt(),je=e=>typeof e=="string"?e:e instanceof URL?decodeURIComponent(e.pathname):new TextDecoder().decode(e),co=e=>{if(e!=null)return typeof e=="string"?e:e.encoding??void 0},uo=e=>typeof e=="string"?Number.parseInt(e,8):e,fo=e=>Ge().readFileSync(e),Qr=e=>tt.Buffer.from(e.buffer,e.byteOffset,e.byteLength);var Zr=class{name;parentPath;file;constructor(e,r,n){this.name=e,this.parentPath=r,this.file=n}isFile(){return this.file}isDirectory(){return!this.file}isSymbolicLink(){return!1}};const Jn={F_OK:0,R_OK:4,W_OK:2,X_OK:1,COPYFILE_EXCL:1,O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:64,O_TRUNC:512,O_APPEND:1024};function Jr(e,r){const n=co(r),i=fo(je(e));return n===void 0||n==="utf8"||n==="utf-8"?n===void 0?Qr(i):new TextDecoder().decode(i):Qr(i).toString(n)}function tr(e,r,n){Ge().writeFileSync(je(e),r,n)}function en(e,r){Ge().appendFileSync(je(e),r)}function ei(e){return Ge().existsSync(je(e))}function Ht(e,r){return Ge().statSync(je(e),r)}function ti(e,r,n){const i=typeof r=="function"?void 0:r,o=typeof r=="function"?r:n;if(o===void 0)throw new TypeError('The "callback" argument must be of type function');queueMicrotask(()=>{let s;try{s=Ht(e,i)}catch(c){o(c);return}o(null,s)})}function tn(e,r){Ge().chmodSync(je(e),uo(r))}function ri(e,r){return Ht(e,r)}function ho(e,r,n){ti(e,r,n)}function ni(e){return Ge().realpathSync(je(e))}function rn(e,r){const n=je(e),i=Ge().readdirSync(n);return typeof r!="object"||r===null||r.withFileTypes!==!0?i:i.map(o=>new Zr(o,n,Ge().statSync(`${n}/${o}`).isFile()))}function pr(e,r){return Ge().mkdirSync(je(e),r)}function ii(e){const r=`${e}${Array.from(globalThis.crypto.getRandomValues(new Uint8Array(3)),n=>n.toString(16).padStart(2,"0")).join("")}`;return Ge().mkdirSync(r,{recursive:!0}),r}function si(e,r){Ge().rmSync(je(e),r)}function oi(e){Ge().rmSync(je(e))}function ai(e,r){Ge().renameSync(je(e),je(r))}function li(e){Ge().realpathSync(je(e))}const ci=new Map;let Jf=3;function yr(e,r="r",n){const i=je(e),o=Ge().openFileSync(i,r,n),s=Jf++;return ci.set(s,{file:o,position:0}),s}const po=e=>{const r=new Error(`EBADF: bad file descriptor, ${e}`);throw r.code="EBADF",r.syscall=e,r},gr=(e,r)=>{const n=ci.get(e);return n===void 0?po(r):n};function nn(e,r,n=0,i=r.byteLength,o=null){const s=gr(e,"read"),c=o??s.position,t=s.file.read(c,i);return r.set(t,n),o===null&&(s.position=c+t.byteLength),t.byteLength}function wr(e,r){const n=gr(e,"write"),i=typeof r=="string"?new TextEncoder().encode(r):r,o=n.file.append?n.file.stat().size:n.position,s=n.file.write(o,i);return n.position=o+s,s}function sn(e){ci.delete(e)||gr(e,"close")}function ui(e,r){Ge().linkSync(je(e),je(r))}function fi(e,r="r",n){const i=je(e),o=Ge().existsSync(i)&&Ge().statSync(i).isDirectory(),s=o?-1:yr(i,r,n);let c=!1;const t=d=>gr(s,d);return{fd:s,readFile:async d=>{if(o)return Jr(i,d);const p=t("read"),y=p.file.read(p.position,Math.max(0,p.file.stat().size-p.position));p.position+=y.length;const m=co(d);return m===void 0||m==="utf8"||m==="utf-8"?m===void 0?Qr(y):new TextDecoder().decode(y):Qr(y).toString(m)},writeFile:async d=>{o?tr(i,d):wr(s,d)},write:async d=>({bytesWritten:wr(s,d)}),read:async(d,p=0,y=d.byteLength,m=null)=>({bytesRead:nn(s,d,p,y,m),buffer:d}),chmod:async d=>{o?tn(i,d):t("fchmod").file.chmod(uo(d))},stat:async d=>o?Ht(i,d):d?.bigint===!0?t("fstat").file.statBigInt():t("fstat").file.stat(),truncate:async(d=0)=>{o?tr(i,new Uint8Array(d)):t("ftruncate").file.truncate(d)},sync:async()=>{await Ge().flush()},datasync:async()=>{await Ge().flush()},close:async()=>{c||(c=!0,s!==-1&&sn(s))}}}const yo=e=>e??!0;function go(e,r,n,i,o){r?.removeEventListener("abort",n),e.fd!==null&&sn(e.fd),e.fd=null,e.pending=!1,o(i)}function wo(e,r){r!==void 0&&e.once("close",()=>{r(null)}),e.destroy()}var di=class extends zs{path;fd=null;pending=!0;bytesRead=0;start;end;flags;signal;onAbort;position;constructor(e,r={}){super({autoDestroy:yo(r.autoClose),emitClose:r.emitClose??!0,highWaterMark:r.highWaterMark??64*1024}),this.path=je(e),this.start=r.start??0,this.end=r.end??Number.POSITIVE_INFINITY,this.flags=r.flags??"r",this.position=this.start,this.signal=r.signal,this.onAbort=r.signal===void 0?void 0:()=>{this.destroy(er(r.signal?.reason))},r.encoding!==void 0&&r.encoding!==null&&this.setEncoding(r.encoding),r.signal?.addEventListener("abort",this.onAbort,{once:!0})}_construct(e){if(this.start<0||this.end<this.start){e(new RangeError('The value of "start" is out of range'));return}if(this.signal?.aborted===!0){e(er(this.signal.reason));return}let r;try{r=yr(this.path,this.flags)}catch(n){e(n);return}this.fd=r,this.pending=!1,e(),this.emit("open",r),this.emit("ready")}_read(e){if(this.fd===null)return;const r=this.end===Number.POSITIVE_INFINITY?e:Math.min(e,this.end-this.position+1);if(r<=0){this.push(null);return}const n=tt.Buffer.allocUnsafe(r);let i;try{i=nn(this.fd,n,0,r,this.position)}catch(o){this.destroy(o);return}if(i===0){this.push(null);return}this.position+=i,this.bytesRead+=i,this.push(n.subarray(0,i))}_destroy(e,r){go(this,this.signal,this.onAbort,e,r)}close(e){wo(this,e)}},hi=class extends Vs{path;fd=null;pending=!0;bytesWritten=0;flags;mode;start;signal;onAbort;constructor(e,r={}){super({autoDestroy:yo(r.autoClose),decodeStrings:!0,defaultEncoding:r.encoding??"utf8",emitClose:r.emitClose??!0,highWaterMark:r.highWaterMark??64*1024}),this.path=je(e),this.flags=r.flags??"w",this.mode=r.mode,this.start=r.start,this.signal=r.signal,this.onAbort=r.signal===void 0?void 0:()=>{this.destroy(er(r.signal?.reason))},r.signal?.addEventListener("abort",this.onAbort,{once:!0})}_construct(e){if(this.start!==void 0&&this.start<0){e(new RangeError('The value of "start" is out of range'));return}if(this.signal?.aborted===!0){e(er(this.signal.reason));return}let r;try{r=yr(this.path,this.flags,this.mode)}catch(n){e(n);return}this.fd=r,this.start!==void 0&&(gr(r,"write").position=this.start),this.pending=!1,e(),this.emit("open",r),this.emit("ready")}_write(e,r,n){try{const i=this.fd;if(i===null)return po("write");const o=typeof e=="string"?tt.Buffer.from(e,r):e;this.bytesWritten+=wr(i,o),n()}catch(i){n(i)}}_destroy(e,r){go(this,this.signal,this.onAbort,e,r)}close(e){wo(this,e)}};function bo(e,r){return new di(e,typeof r=="string"?{encoding:r}:r)}function mo(e,r){return new hi(e,typeof r=="string"?{encoding:r}:r)}function pi(e){const r=je(e),n=rn(r,{withFileTypes:!0});let i=0;const o=()=>n[i++]??null;return{path:r,read:async()=>o(),close:async()=>{i=n.length},closeSync:()=>{i=n.length},async*[Symbol.asyncIterator](){for(let s=o();s!==null;s=o())yield s}}}const br={readFile:async(e,r)=>Jr(e,r),writeFile:async(e,r,n)=>{const i=typeof n=="object"&&n!==null?n.flag:void 0,o=typeof n=="object"&&n!==null?n.mode:void 0;if(i!==void 0&&i.includes("x")&&ei(e)){const s=new Error(`EEXIST: file already exists, open '${je(e)}'`);throw s.code="EEXIST",s}i!==void 0&&i.startsWith("a")?en(e,r):tr(e,r,{...i===void 0?{}:{flag:i},...o===void 0?{}:{mode:o}})},appendFile:async(e,r)=>{en(e,r)},mkdir:async(e,r)=>pr(e,r),mkdtemp:async e=>ii(e),readdir:async(e,r)=>rn(e,r),stat:async(e,r)=>Ht(e,r),lstat:async(e,r)=>ri(e,r),realpath:async e=>ni(e),rm:async(e,r)=>{si(e,r)},unlink:async e=>{oi(e)},rename:async(e,r)=>{ai(e,r)},access:async e=>{li(e)},chmod:async(e,r)=>{tn(e,r)},cp:async(e,r)=>{const n=je(e),i=je(r);if(Ht(n).isDirectory()){pr(i,{recursive:!0});for(const o of Ge().readdirSync(n))await br.cp(`${n}/${o}`,`${i}/${o}`);return}pr(zn(i),{recursive:!0}),tr(i,fo(n))},link:async(e,r)=>{ui(e,r)},open:async(e,r,n)=>fi(e,r,n),opendir:async e=>pi(e),truncate:async(e,r=0)=>{Ge().truncateSync(je(e),r)},watch:Qf,constants:Jn};var ed={constants:Jn,promises:br,Dirent:Zr,FSWatcher:Yn,StatWatcher:Zn,ReadStream:di,WriteStream:hi,readFileSync:Jr,writeFileSync:tr,appendFileSync:en,existsSync:ei,statSync:Ht,stat:ti,lstatSync:ri,lstat:ho,realpathSync:ni,chmodSync:tn,readdirSync:rn,mkdirSync:pr,mkdtempSync:ii,rmSync:si,unlinkSync:oi,renameSync:ai,accessSync:li,opendirSync:pi,openHandleSync:fi,linkSync:ui,openSync:yr,readSync:nn,writeSync:wr,closeSync:sn,watch:Qn,watchFile:ao,unwatchFile:lo,createReadStream:bo,createWriteStream:mo},td=We({Dirent:()=>Zr,__esModule:()=>!0,access:()=>pd,appendFile:()=>id,chmod:()=>yd,constants:()=>Sd,cp:()=>gd,default:()=>Ed,link:()=>wd,lstat:()=>cd,mkdir:()=>sd,mkdtemp:()=>od,open:()=>bd,opendir:()=>md,readFile:()=>rd,readdir:()=>ad,realpath:()=>ud,rename:()=>hd,rm:()=>fd,stat:()=>ld,truncate:()=>vd,unlink:()=>dd,watch:()=>_d,writeFile:()=>nd});const{readFile:rd,writeFile:nd,appendFile:id,mkdir:sd,mkdtemp:od,readdir:ad,stat:ld,lstat:cd,realpath:ud,rm:fd,unlink:dd,rename:hd,access:pd,chmod:yd,cp:gd,link:wd,open:bd,opendir:md,truncate:vd,watch:_d,constants:Sd}=br;var Ed=br,Ad=We({STATUS_CODES:()=>xo,Server:()=>gi,ServerResponse:()=>_o,__esModule:()=>!0,createServer:()=>So,default:()=>Rd,get:()=>Ao,request:()=>Eo,requestListener:()=>$d,whenRequestListener:()=>vo});const xd=3080;let on;const yi=new Set;function $d(){return on}async function vo(){return on!==void 0?on:await new Promise(e=>yi.add(e))}var gi=class{listeners=new Map;on(e,r){const n=this.listeners.get(e)??new Set;return n.add(r),this.listeners.set(e,n),this}once(e,r){return this.on(e,r)}off(e,r){return this.listeners.get(e)?.delete(r),this}listen(...e){const r=e.at(-1);return typeof r=="function"&&queueMicrotask(()=>{r()}),this}address(){return{address:"127.0.0.1",family:"IPv4",port:xd}}close(e){return e!==void 0&&queueMicrotask(()=>{e()}),this}closeAllConnections(){}closeIdleConnections(){}},_o=class{};function So(e){if(e!==void 0){on=e;for(const r of yi)r(e);yi.clear()}return new gi}function Eo(){throw new Error("web-preview: node:http.request is not available in the worker host — use fetch")}function Ao(){throw new Error("web-preview: node:http.get is not available in the worker host — use fetch")}const xo={200:"OK",204:"No Content",304:"Not Modified",400:"Bad Request",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",413:"Payload Too Large",415:"Unsupported Media Type",426:"Upgrade Required",500:"Internal Server Error",503:"Service Unavailable"};var Rd={createServer:So,request:Eo,get:Ao,STATUS_CODES:xo,Server:gi,ServerResponse:_o},Td=We({__esModule:()=>!0,builtinModules:()=>wi,createRequire:()=>$o,default:()=>Id,isBuiltin:()=>Ro,register:()=>Io,stripTypeScriptTypes:()=>To,syncBuiltinESMExports:()=>ko});function $o(e){return Vi().createRequire(e)}const wi=["assert","async_hooks","buffer","child_process","crypto","events","fs","http","module","net","os","path","process","stream","tty","url","util","worker_threads"];function Ro(e){return wi.includes(e.replace(/^node:/,""))}function To(){throw new Error("web-preview: node:module.stripTypeScriptTypes is not available in the worker host")}function Io(){throw new Error("web-preview: node:module.register is not available in the worker host")}function ko(){}var Id={createRequire:$o,builtinModules:wi,isBuiltin:Ro,register:Io,syncBuiltinESMExports:ko,stripTypeScriptTypes:To},kd=We({EOL:()=>`
|
|
9
|
+
`,__esModule:()=>!0,arch:()=>No,availableParallelism:()=>Bo,constants:()=>Wo,cpus:()=>Fo,default:()=>Ld,homedir:()=>Co,hostname:()=>Po,networkInterfaces:()=>Uo,platform:()=>Mo,release:()=>Do,tmpdir:()=>Lo,type:()=>Oo});function Lo(){return jn}function Co(){return Gf}function Mo(){return"linux"}function Oo(){return"Linux"}function No(){return"x64"}function Do(){return"0.0.0-dsh-worker"}function Po(){return"dsh-worker"}function Bo(){return Math.max(1,navigator.hardwareConcurrency)}function Fo(){return[]}function Uo(){return{}}const Wo={signals:{SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGBUS:7,SIGFPE:8,SIGKILL:9,SIGUSR1:10,SIGSEGV:11,SIGUSR2:12,SIGPIPE:13,SIGALRM:14,SIGTERM:15},errno:{},priority:{}};var Ld={EOL:`
|
|
10
|
+
`,tmpdir:Lo,homedir:Co,platform:Mo,type:Oo,arch:No,release:Do,hostname:Po,availableParallelism:Bo,cpus:Fo,networkInterfaces:Uo,constants:Wo},Cd=We({PerformanceObserver:()=>jo,__esModule:()=>!0,default:()=>Od,performance:()=>Ho});const Md="node:perf_hooks",Ho=globalThis.performance,jo=Ce(Md,"PerformanceObserver");var Od={performance:Ho,PerformanceObserver:jo},Nd=We({__esModule:()=>!0,default:()=>Dd,scheduler:()=>zo,setImmediate:()=>Go,setTimeout:()=>mr});const qo=()=>new DOMException("The operation was aborted.","AbortError");function mr(e,r,n){return new Promise((i,o)=>{if(n?.signal?.aborted===!0){o(qo());return}const s=globalThis.setTimeout(()=>{i(r)},e);n?.signal?.addEventListener("abort",()=>{globalThis.clearTimeout(s),o(qo())},{once:!0})})}function Go(e){return mr(0,e)}const zo={wait:async(e,r)=>{await mr(e,void 0,r)},yield:async()=>{await mr(0)}};var Dd={setTimeout:mr,setImmediate:Go,scheduler:zo},Pd=We({__esModule:()=>!0,default:()=>Bd,isatty:()=>Vo});function Vo(e){return!1}var Bd={isatty:Vo},Fd=We({URL:()=>Qo,URLSearchParams:()=>Zo,__esModule:()=>!0,default:()=>Ud,fileURLToPath:()=>Ko,pathToFileURL:()=>Xo,resolve:()=>Yo});function Ko(e){const r=typeof e=="string"?new URL(e):e;if(r.protocol!=="file:")throw new TypeError(`The URL must be of scheme file (received ${r.protocol})`);return decodeURIComponent(r.pathname)}function Xo(e){const r=e.replaceAll("%","%25").replaceAll("\\","%5C").replaceAll(`
|
|
11
|
+
`,"%0A").replaceAll("\r","%0D").replaceAll(" ","%09"),n=new globalThis.URL("file:///");return n.pathname=r.startsWith("/")?r:`/${r}`,n}function Yo(e,r){return new URL(e,r).toString()}const Qo=globalThis.URL,Zo=globalThis.URLSearchParams;var Ud={fileURLToPath:Ko,pathToFileURL:Xo,resolve:Yo,URL:Qo,URLSearchParams:Zo},Wd=We({TextDecoder:()=>ia,TextEncoder:()=>sa,__esModule:()=>!0,callbackify:()=>ea,default:()=>Hd,deprecate:()=>na,format:()=>ta,inspect:()=>jt,isDeepStrictEqual:()=>bi,parseArgs:()=>ra,promisify:()=>Jo,types:()=>an});function Jo(e){return(...r)=>new Promise((n,i)=>{e(...r,(o,s)=>{o!=null?i(o instanceof Error?o:new Error(jt(o))):n(s)})})}function ea(e){return(...r)=>{const n=r.at(-1);e(...r.slice(0,-1)).then(i=>{n(null,i)},i=>{n(i)})}}function jt(e){if(typeof e=="string")return`'${e}'`;if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;try{return JSON.stringify(e,(r,n)=>typeof n=="bigint"?n.toString():n)??String(e)}catch{return String(e)}}function ta(e,...r){if(typeof e!="string")return[e,...r].map(s=>jt(s)).join(" ");let n=0;const i=e.replaceAll(/%[sdifjoO%]/g,s=>{if(s==="%%")return"%";if(n>=r.length)return s;const c=r[n++];return s==="%d"||s==="%i"||s==="%f"?String(Number(c)):s==="%s"&&typeof c=="string"?c:jt(c)}),o=r.slice(n);return o.length===0?i:`${i} ${o.map(s=>jt(s)).join(" ")}`}function bi(e,r){if(Object.is(e,r))return!0;if(typeof e!="object"||typeof r!="object"||e===null||r===null||Array.isArray(e)!==Array.isArray(r))return!1;const n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(o=>o in r&&bi(e[o],r[o]))}const an={isPromise:e=>e instanceof Promise||typeof e=="object"&&e!==null&&typeof e.then=="function",isDate:e=>e instanceof Date,isRegExp:e=>e instanceof RegExp,isTypedArray:e=>ArrayBuffer.isView(e)&&!(e instanceof DataView)};function ra(){throw new Error("web-preview: node:util.parseArgs is not available in the worker host")}function na(e){return e}const ia=globalThis.TextDecoder,sa=globalThis.TextEncoder;var Hd={promisify:Jo,callbackify:ea,inspect:jt,format:ta,isDeepStrictEqual:bi,types:an,parseArgs:ra,deprecate:na,TextDecoder:ia,TextEncoder:sa},jd=We({__esModule:()=>!0,default:()=>Kd,isDate:()=>Gd,isPromise:()=>qd,isRegExp:()=>zd,isTypedArray:()=>Vd});const{isPromise:qd,isDate:Gd,isRegExp:zd,isTypedArray:Vd}=an;var Kd=an,Xd=We({__esModule:()=>!0,constants:()=>oa,createZstdCompress:()=>da,createZstdDecompress:()=>fa,default:()=>Yd,gunzip:()=>ya,gunzipSync:()=>ga,gzip:()=>ha,gzipSync:()=>pa,zstdCompress:()=>ca,zstdCompressSync:()=>aa,zstdDecompress:()=>ua,zstdDecompressSync:()=>la});const Et="node:zlib",oa={ZSTD_c_compressionLevel:100,ZSTD_c_checksumFlag:201,ZSTD_e_continue:0,ZSTD_e_flush:1,ZSTD_e_end:2,ZSTD_CLEVEL_DEFAULT:3,Z_NO_FLUSH:0,Z_SYNC_FLUSH:2,Z_FINISH:4},aa=Ce(Et,"zstdCompressSync"),la=Ce(Et,"zstdDecompressSync"),ca=Ce(Et,"zstdCompress"),ua=Ce(Et,"zstdDecompress");function fa(){return{close:()=>{}}}const da=Ce(Et,"createZstdCompress"),ha=Ce(Et,"gzip"),pa=Ce(Et,"gzipSync"),ya=Ce(Et,"gunzip"),ga=Ce(Et,"gunzipSync");var Yd={constants:oa,zstdCompress:ca,zstdCompressSync:aa,zstdDecompress:ua,zstdDecompressSync:la,createZstdCompress:da,createZstdDecompress:fa,gzip:ha,gzipSync:pa,gunzip:ya,gunzipSync:ga},Qd=De(((e,r)=>{function n(s,c){function t(){this.constructor=s}t.prototype=c.prototype,s.prototype=new t}function i(s,c,t,d){this.message=s,this.expected=c,this.found=t,this.location=d,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i)}n(i,Error),i.buildMessage=function(s,c){var t={literal:function($){return'"'+p($.text)+'"'},class:function($){var N="",P;for(P=0;P<$.parts.length;P++)N+=$.parts[P]instanceof Array?y($.parts[P][0])+"-"+y($.parts[P][1]):y($.parts[P]);return"["+($.inverted?"^":"")+N+"]"},any:function($){return"any character"},end:function($){return"end of input"},other:function($){return $.description}};function d($){return $.charCodeAt(0).toString(16).toUpperCase()}function p($){return $.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(N){return"\\x0"+d(N)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(N){return"\\x"+d(N)})}function y($){return $.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(N){return"\\x0"+d(N)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(N){return"\\x"+d(N)})}function m($){return t[$.type]($)}function v($){var N=new Array($.length),P,q;for(P=0;P<$.length;P++)N[P]=m($[P]);if(N.sort(),N.length>0){for(P=1,q=1;P<N.length;P++)N[P-1]!==N[P]&&(N[q]=N[P],q++);N.length=q}switch(N.length){case 1:return N[0];case 2:return N[0]+" or "+N[1];default:return N.slice(0,-1).join(", ")+", or "+N[N.length-1]}}function T($){return $?'"'+p($)+'"':"end of input"}return"Expected "+v(s)+" but "+T(c)+" found."};function o(s,c){c=c!==void 0?c:{};var t={},d={Start:Tc},p=Tc,y=function(a){return a||[]},m=function(a,h,w){return[{command:a,type:h}].concat(w||[])},v=function(a,h){return[{command:a,type:h||";"}]},T=function(a){return a},$=";",N=Oe(";",!1),P="&",q=Oe("&",!1),_=function(a,h){return h?{chain:a,then:h}:{chain:a}},D=function(a,h){return{type:a,line:h}},k="&&",C=Oe("&&",!1),S="||",O=Oe("||",!1),z=function(a,h){return h?{...a,then:h}:a},Y=function(a,h){return{type:a,chain:h}},V="|&",le=Oe("|&",!1),G="|",H=Oe("|",!1),ee="=",j=Oe("=",!1),me=function(a,h){return{name:a,args:[h]}},Ae=function(a){return{name:a,args:[]}},$e="(",Te=Oe("(",!1),re=")",be=Oe(")",!1),R=function(a,h){return{type:"subshell",subshell:a,args:h}},ie="{",ve=Oe("{",!1),Z="}",ge=Oe("}",!1),Re=function(a,h){return{type:"group",group:a,args:h}},Le=function(a,h){return{type:"command",args:h,envs:a}},de=function(a){return{type:"envs",envs:a}},I=function(a){return a},J=function(a){return a},pe=/^[0-9]/,Ee=at([["0","9"]],!1,!1),F=function(a,h,w){return{type:"redirection",subtype:h,fd:a!==null?parseInt(a):null,args:[w]}},E=">>",U=Oe(">>",!1),K=">&",ue=Oe(">&",!1),ce=">",fe=Oe(">",!1),B="<<<",ne=Oe("<<<",!1),he="<&",te=Oe("<&",!1),xe="<",Qe=Oe("<",!1),g=function(a){return{type:"argument",segments:[].concat(...a)}},l=function(a){return a},u="$'",b=Oe("$'",!1),M="'",W=Oe("'",!1),Q=function(a){return[{type:"text",text:a}]},ke='""',Be=Oe('""',!1),Fe=function(){return{type:"text",text:""}},He='"',Ue=Oe('"',!1),pn=function(a){return a},yn=function(a){return{type:"arithmetic",arithmetic:a,quoted:!0}},gn=function(a){return{type:"shell",shell:a,quoted:!0}},ki=function(a){return{type:"variable",...a,quoted:!0}},xr=function(a){return{type:"text",text:a}},$r=function(a){return{type:"arithmetic",arithmetic:a,quoted:!1}},Li=function(a){return{type:"shell",shell:a,quoted:!1}},Ci=function(a){return{type:"variable",...a,quoted:!1}},Rr=function(a){return{type:"glob",pattern:a}},Gt=/^[^']/,A=at(["'"],!0,!1),L=function(a){return a.join("")},_e=/^[^$"]/,Se=at(["$",'"'],!0,!1),Ie=`\\
|
|
12
|
+
`,Ze=Oe(`\\
|
|
13
|
+
`,!1),it=function(){return""},st="\\",Rt=Oe("\\",!1),Mi=/^[\\$"`]/,wn=at(["\\","$",'"',"`"],!1,!1),dt=function(a){return a},or="\\a",Tr=Oe("\\a",!1),Ir=function(){return"a"},Pt="\\b",Tt=Oe("\\b",!1),ht=function(){return"\b"},Np=/^[Ee]/,Dp=at(["E","e"],!1,!1),Pp=function(){return"\x1B"},Kl="\\f",Bp=Oe("\\f",!1),Fp=function(){return"\f"},Xl="\\n",Up=Oe("\\n",!1),Wp=function(){return`
|
|
14
|
+
`},Yl="\\r",Hp=Oe("\\r",!1),jp=function(){return"\r"},Ql="\\t",qp=Oe("\\t",!1),Gp=function(){return" "},Zl="\\v",zp=Oe("\\v",!1),Vp=function(){return"\v"},Kp=/^[\\'"?]/,Xp=at(["\\","'",'"',"?"],!1,!1),Oi=function(a){return String.fromCharCode(parseInt(a,16))},Jl="\\x",Yp=Oe("\\x",!1),ec="\\u",Qp=Oe("\\u",!1),tc="\\U",Zp=Oe("\\U",!1),Jp=function(a){return String.fromCodePoint(parseInt(a,16))},ey=/^[0-7]/,ty=at([["0","7"]],!1,!1),ry=/^[0-9a-fA-f]/,ny=at([["0","9"],["a","f"],["A","f"]],!1,!1),ar=My(),bn="{}",rc=Oe("{}",!1),nc=function(){return"{}"},mn="-",vn=Oe("-",!1),_n="+",Sn=Oe("+",!1),iy=".",sy=Oe(".",!1),oy=function(a,h,w){return{type:"number",value:(a==="-"?-1:1)*parseFloat(h.join("")+"."+w.join(""))}},ay=function(a,h){return{type:"number",value:(a==="-"?-1:1)*parseInt(h.join(""))}},ly=function(a){return{type:"variable",...a}},cy=function(a){return{type:"variable",name:a}},uy=function(a){return a},ic="*",sc=Oe("*",!1),oc="/",ac=Oe("/",!1),lc=function(a,h,w){return{type:h==="*"?"multiplication":"division",right:w}},cc=function(a,h){return h.reduce((w,x)=>({left:w,...x}),a)},uc=function(a,h,w){return{type:h==="+"?"addition":"subtraction",right:w}},fc="$((",fy=Oe("$((",!1),dc="))",dy=Oe("))",!1),hy=function(a){return a},hc="$(",py=Oe("$(",!1),yy=function(a){return a},wt="${",kr=Oe("${",!1),pc=":-",gy=Oe(":-",!1),wy=function(a,h){return{name:a,defaultValue:h}},yc=":-}",by=Oe(":-}",!1),my=function(a){return{name:a,defaultValue:[]}},gc=":+",vy=Oe(":+",!1),_y=function(a,h){return{name:a,alternativeValue:h}},wc=":+}",Sy=Oe(":+}",!1),Ey=function(a){return{name:a,alternativeValue:[]}},bc=function(a){return{name:a}},Ay="$",xy=Oe("$",!1),$y=function(a){return c.isGlobPattern(a)},Ry=function(a){return a},mc=/^[a-zA-Z0-9_]/,vc=at([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),_c=function(){return Cy()},Sc=/^[$@*?#a-zA-Z0-9_\-]/,Ec=at(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),Ty=/^[()}<>$|&; \t"']/,Iy=at(["(",")","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),ky=/^[<>&; \t"']/,Ly=at(["<",">","&",";"," "," ",'"',"'"],!1,!1),Ac=/^[ \t]/,xc=at([" "," "],!1,!1),f=0,we=0,En=[{line:1,column:1}],bt=0,Ni=[],se=0,An;if("startRule"in c){if(!(c.startRule in d))throw new Error(`Can't start parsing from rule "`+c.startRule+'".');p=d[c.startRule]}function Cy(){return s.substring(we,f)}function Oe(a,h){return{type:"literal",text:a,ignoreCase:h}}function at(a,h,w){return{type:"class",parts:a,inverted:h,ignoreCase:w}}function My(){return{type:"any"}}function Oy(){return{type:"end"}}function $c(a){var h=En[a],w;if(h)return h;for(w=a-1;!En[w];)w--;for(h=En[w],h={line:h.line,column:h.column};w<a;)s.charCodeAt(w)===10?(h.line++,h.column=1):h.column++,w++;return En[a]=h,h}function Rc(a,h){var w=$c(a),x=$c(h);return{start:{offset:a,line:w.line,column:w.column},end:{offset:h,line:x.line,column:x.column}}}function ae(a){f<bt||(f>bt&&(bt=f,Ni=[]),Ni.push(a))}function Ny(a,h,w){return new i(i.buildMessage(a,h),a,h,w)}function Tc(){for(var a=f,h=[],w=ye();w!==t;)h.push(w),w=ye();return h!==t?(w=Lr(),w===t&&(w=null),w!==t?(we=a,h=y(w),a=h):(f=a,a=t)):(f=a,a=t),a}function Lr(){var a=f,h=Di(),w,x,X;if(h!==t){for(w=[],x=ye();x!==t;)w.push(x),x=ye();w!==t?(x=Ic(),x!==t?(X=Dy(),X===t&&(X=null),X!==t?(we=a,h=m(h,x,X),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t)}else f=a,a=t;if(a===t)if(a=f,h=Di(),h!==t){for(w=[],x=ye();x!==t;)w.push(x),x=ye();w!==t?(x=Ic(),x===t&&(x=null),x!==t?(we=a,h=v(h,x),a=h):(f=a,a=t)):(f=a,a=t)}else f=a,a=t;return a}function Dy(){for(var a=f,h=[],w=ye(),x,X;w!==t;)h.push(w),w=ye();if(h!==t)if(w=Lr(),w!==t){for(x=[],X=ye();X!==t;)x.push(X),X=ye();x!==t?(we=a,h=T(w),a=h):(f=a,a=t)}else f=a,a=t;else f=a,a=t;return a}function Ic(){var a;return s.charCodeAt(f)===59?(a=$,f++):(a=t,se===0&&ae(N)),a===t&&(s.charCodeAt(f)===38?(a=P,f++):(a=t,se===0&&ae(q))),a}function Di(){var a=f,h=kc(),w;return h!==t?(w=Py(),w===t&&(w=null),w!==t?(we=a,h=_(h,w),a=h):(f=a,a=t)):(f=a,a=t),a}function Py(){for(var a=f,h=[],w=ye(),x,X,oe,Me;w!==t;)h.push(w),w=ye();if(h!==t)if(w=By(),w!==t){for(x=[],X=ye();X!==t;)x.push(X),X=ye();if(x!==t)if(X=Di(),X!==t){for(oe=[],Me=ye();Me!==t;)oe.push(Me),Me=ye();oe!==t?(we=a,h=D(w,X),a=h):(f=a,a=t)}else f=a,a=t;else f=a,a=t}else f=a,a=t;else f=a,a=t;return a}function By(){var a;return s.substr(f,2)===k?(a=k,f+=2):(a=t,se===0&&ae(C)),a===t&&(s.substr(f,2)===S?(a=S,f+=2):(a=t,se===0&&ae(O))),a}function kc(){var a=f,h=Wy(),w;return h!==t?(w=Fy(),w===t&&(w=null),w!==t?(we=a,h=z(h,w),a=h):(f=a,a=t)):(f=a,a=t),a}function Fy(){for(var a=f,h=[],w=ye(),x,X,oe,Me;w!==t;)h.push(w),w=ye();if(h!==t)if(w=Uy(),w!==t){for(x=[],X=ye();X!==t;)x.push(X),X=ye();if(x!==t)if(X=kc(),X!==t){for(oe=[],Me=ye();Me!==t;)oe.push(Me),Me=ye();oe!==t?(we=a,h=Y(w,X),a=h):(f=a,a=t)}else f=a,a=t;else f=a,a=t}else f=a,a=t;else f=a,a=t;return a}function Uy(){var a;return s.substr(f,2)===V?(a=V,f+=2):(a=t,se===0&&ae(le)),a===t&&(s.charCodeAt(f)===124?(a=G,f++):(a=t,se===0&&ae(H))),a}function xn(){var a=f,h=Hc(),w,x,X,oe;if(h!==t)if(s.charCodeAt(f)===61?(w=ee,f++):(w=t,se===0&&ae(j)),w!==t)if(x=Mc(),x!==t){for(X=[],oe=ye();oe!==t;)X.push(oe),oe=ye();X!==t?(we=a,h=me(h,x),a=h):(f=a,a=t)}else f=a,a=t;else f=a,a=t;else f=a,a=t;if(a===t)if(a=f,h=Hc(),h!==t)if(s.charCodeAt(f)===61?(w=ee,f++):(w=t,se===0&&ae(j)),w!==t){for(x=[],X=ye();X!==t;)x.push(X),X=ye();x!==t?(we=a,h=Ae(h),a=h):(f=a,a=t)}else f=a,a=t;else f=a,a=t;return a}function Wy(){for(var a=f,h=[],w=ye(),x,X,oe,Me,Ne,Xe,Je,ct;w!==t;)h.push(w),w=ye();if(h!==t)if(s.charCodeAt(f)===40?(w=$e,f++):(w=t,se===0&&ae(Te)),w!==t){for(x=[],X=ye();X!==t;)x.push(X),X=ye();if(x!==t)if(X=Lr(),X!==t){for(oe=[],Me=ye();Me!==t;)oe.push(Me),Me=ye();if(oe!==t)if(s.charCodeAt(f)===41?(Me=re,f++):(Me=t,se===0&&ae(be)),Me!==t){for(Ne=[],Xe=ye();Xe!==t;)Ne.push(Xe),Xe=ye();if(Ne!==t){for(Xe=[],Je=Cr();Je!==t;)Xe.push(Je),Je=Cr();if(Xe!==t){for(Je=[],ct=ye();ct!==t;)Je.push(ct),ct=ye();Je!==t?(we=a,h=R(X,Xe),a=h):(f=a,a=t)}else f=a,a=t}else f=a,a=t}else f=a,a=t;else f=a,a=t}else f=a,a=t;else f=a,a=t}else f=a,a=t;else f=a,a=t;if(a===t){for(a=f,h=[],w=ye();w!==t;)h.push(w),w=ye();if(h!==t)if(s.charCodeAt(f)===123?(w=ie,f++):(w=t,se===0&&ae(ve)),w!==t){for(x=[],X=ye();X!==t;)x.push(X),X=ye();if(x!==t)if(X=Lr(),X!==t){for(oe=[],Me=ye();Me!==t;)oe.push(Me),Me=ye();if(oe!==t)if(s.charCodeAt(f)===125?(Me=Z,f++):(Me=t,se===0&&ae(ge)),Me!==t){for(Ne=[],Xe=ye();Xe!==t;)Ne.push(Xe),Xe=ye();if(Ne!==t){for(Xe=[],Je=Cr();Je!==t;)Xe.push(Je),Je=Cr();if(Xe!==t){for(Je=[],ct=ye();ct!==t;)Je.push(ct),ct=ye();Je!==t?(we=a,h=Re(X,Xe),a=h):(f=a,a=t)}else f=a,a=t}else f=a,a=t}else f=a,a=t;else f=a,a=t}else f=a,a=t;else f=a,a=t}else f=a,a=t;else f=a,a=t;if(a===t){for(a=f,h=[],w=ye();w!==t;)h.push(w),w=ye();if(h!==t){for(w=[],x=xn();x!==t;)w.push(x),x=xn();if(w!==t){for(x=[],X=ye();X!==t;)x.push(X),X=ye();if(x!==t){if(X=[],oe=Cc(),oe!==t)for(;oe!==t;)X.push(oe),oe=Cc();else X=t;if(X!==t){for(oe=[],Me=ye();Me!==t;)oe.push(Me),Me=ye();oe!==t?(we=a,h=Le(w,X),a=h):(f=a,a=t)}else f=a,a=t}else f=a,a=t}else f=a,a=t}else f=a,a=t;if(a===t){for(a=f,h=[],w=ye();w!==t;)h.push(w),w=ye();if(h!==t){if(w=[],x=xn(),x!==t)for(;x!==t;)w.push(x),x=xn();else w=t;if(w!==t){for(x=[],X=ye();X!==t;)x.push(X),X=ye();x!==t?(we=a,h=de(w),a=h):(f=a,a=t)}else f=a,a=t}else f=a,a=t}}}return a}function Lc(){for(var a=f,h=[],w=ye(),x,X;w!==t;)h.push(w),w=ye();if(h!==t){if(w=[],x=$n(),x!==t)for(;x!==t;)w.push(x),x=$n();else w=t;if(w!==t){for(x=[],X=ye();X!==t;)x.push(X),X=ye();x!==t?(we=a,h=I(w),a=h):(f=a,a=t)}else f=a,a=t}else f=a,a=t;return a}function Cc(){for(var a=f,h=[],w=ye();w!==t;)h.push(w),w=ye();if(h!==t?(w=Cr(),w!==t?(we=a,h=J(w),a=h):(f=a,a=t)):(f=a,a=t),a===t){for(a=f,h=[],w=ye();w!==t;)h.push(w),w=ye();h!==t?(w=$n(),w!==t?(we=a,h=J(w),a=h):(f=a,a=t)):(f=a,a=t)}return a}function Cr(){for(var a=f,h=[],w=ye(),x,X;w!==t;)h.push(w),w=ye();return h!==t?(pe.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(Ee)),w===t&&(w=null),w!==t?(x=Hy(),x!==t?(X=$n(),X!==t?(we=a,h=F(w,x,X),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t)):(f=a,a=t),a}function Hy(){var a;return s.substr(f,2)===E?(a=E,f+=2):(a=t,se===0&&ae(U)),a===t&&(s.substr(f,2)===K?(a=K,f+=2):(a=t,se===0&&ae(ue)),a===t&&(s.charCodeAt(f)===62?(a=ce,f++):(a=t,se===0&&ae(fe)),a===t&&(s.substr(f,3)===B?(a=B,f+=3):(a=t,se===0&&ae(ne)),a===t&&(s.substr(f,2)===he?(a=he,f+=2):(a=t,se===0&&ae(te)),a===t&&(s.charCodeAt(f)===60?(a=xe,f++):(a=t,se===0&&ae(Qe))))))),a}function $n(){for(var a=f,h=[],w=ye();w!==t;)h.push(w),w=ye();return h!==t?(w=Mc(),w!==t?(we=a,h=J(w),a=h):(f=a,a=t)):(f=a,a=t),a}function Mc(){var a=f,h=[],w=Oc();if(w!==t)for(;w!==t;)h.push(w),w=Oc();else h=t;return h!==t&&(we=a,h=g(h)),a=h,a}function Oc(){var a=f,h=jy();return h!==t&&(we=a,h=l(h)),a=h,a===t&&(a=f,h=qy(),h!==t&&(we=a,h=l(h)),a=h,a===t&&(a=f,h=Gy(),h!==t&&(we=a,h=l(h)),a=h,a===t&&(a=f,h=zy(),h!==t&&(we=a,h=l(h)),a=h))),a}function jy(){var a=f,h,w,x;return s.substr(f,2)===u?(h=u,f+=2):(h=t,se===0&&ae(b)),h!==t?(w=Xy(),w!==t?(s.charCodeAt(f)===39?(x=M,f++):(x=t,se===0&&ae(W)),x!==t?(we=a,h=Q(w),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t),a}function qy(){var a=f,h,w,x;return s.charCodeAt(f)===39?(h=M,f++):(h=t,se===0&&ae(W)),h!==t?(w=Vy(),w!==t?(s.charCodeAt(f)===39?(x=M,f++):(x=t,se===0&&ae(W)),x!==t?(we=a,h=Q(w),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t),a}function Gy(){var a=f,h,w,x;if(s.substr(f,2)===ke?(h=ke,f+=2):(h=t,se===0&&ae(Be)),h!==t&&(we=a,h=Fe()),a=h,a===t)if(a=f,s.charCodeAt(f)===34?(h=He,f++):(h=t,se===0&&ae(Ue)),h!==t){for(w=[],x=Nc();x!==t;)w.push(x),x=Nc();w!==t?(s.charCodeAt(f)===34?(x=He,f++):(x=t,se===0&&ae(Ue)),x!==t?(we=a,h=pn(w),a=h):(f=a,a=t)):(f=a,a=t)}else f=a,a=t;return a}function zy(){var a=f,h=[],w=Dc();if(w!==t)for(;w!==t;)h.push(w),w=Dc();else h=t;return h!==t&&(we=a,h=pn(h)),a=h,a}function Nc(){var a=f,h=Uc();return h!==t&&(we=a,h=yn(h)),a=h,a===t&&(a=f,h=Wc(),h!==t&&(we=a,h=gn(h)),a=h,a===t&&(a=f,h=Ui(),h!==t&&(we=a,h=ki(h)),a=h,a===t&&(a=f,h=Ky(),h!==t&&(we=a,h=xr(h)),a=h))),a}function Dc(){var a=f,h=Uc();return h!==t&&(we=a,h=$r(h)),a=h,a===t&&(a=f,h=Wc(),h!==t&&(we=a,h=Li(h)),a=h,a===t&&(a=f,h=Ui(),h!==t&&(we=a,h=Ci(h)),a=h,a===t&&(a=f,h=Zy(),h!==t&&(we=a,h=Rr(h)),a=h,a===t&&(a=f,h=Qy(),h!==t&&(we=a,h=xr(h)),a=h)))),a}function Vy(){var a=f,h=[],w;for(Gt.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(A));w!==t;)h.push(w),Gt.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(A));return h!==t&&(we=a,h=L(h)),a=h,a}function Ky(){var a=f,h=[],w=Pc();if(w===t&&(_e.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(Se))),w!==t)for(;w!==t;)h.push(w),w=Pc(),w===t&&(_e.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(Se)));else h=t;return h!==t&&(we=a,h=L(h)),a=h,a}function Pc(){var a=f,h,w;return s.substr(f,2)===Ie?(h=Ie,f+=2):(h=t,se===0&&ae(Ze)),h!==t&&(we=a,h=it()),a=h,a===t&&(a=f,s.charCodeAt(f)===92?(h=st,f++):(h=t,se===0&&ae(Rt)),h!==t?(Mi.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(wn)),w!==t?(we=a,h=dt(w),a=h):(f=a,a=t)):(f=a,a=t)),a}function Xy(){var a=f,h=[],w=Bc();for(w===t&&(Gt.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(A)));w!==t;)h.push(w),w=Bc(),w===t&&(Gt.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(A)));return h!==t&&(we=a,h=L(h)),a=h,a}function Bc(){var a=f,h,w;return s.substr(f,2)===or?(h=or,f+=2):(h=t,se===0&&ae(Tr)),h!==t&&(we=a,h=Ir()),a=h,a===t&&(a=f,s.substr(f,2)===Pt?(h=Pt,f+=2):(h=t,se===0&&ae(Tt)),h!==t&&(we=a,h=ht()),a=h,a===t&&(a=f,s.charCodeAt(f)===92?(h=st,f++):(h=t,se===0&&ae(Rt)),h!==t?(Np.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(Dp)),w!==t?(we=a,h=Pp(),a=h):(f=a,a=t)):(f=a,a=t),a===t&&(a=f,s.substr(f,2)===Kl?(h=Kl,f+=2):(h=t,se===0&&ae(Bp)),h!==t&&(we=a,h=Fp()),a=h,a===t&&(a=f,s.substr(f,2)===Xl?(h=Xl,f+=2):(h=t,se===0&&ae(Up)),h!==t&&(we=a,h=Wp()),a=h,a===t&&(a=f,s.substr(f,2)===Yl?(h=Yl,f+=2):(h=t,se===0&&ae(Hp)),h!==t&&(we=a,h=jp()),a=h,a===t&&(a=f,s.substr(f,2)===Ql?(h=Ql,f+=2):(h=t,se===0&&ae(qp)),h!==t&&(we=a,h=Gp()),a=h,a===t&&(a=f,s.substr(f,2)===Zl?(h=Zl,f+=2):(h=t,se===0&&ae(zp)),h!==t&&(we=a,h=Vp()),a=h,a===t&&(a=f,s.charCodeAt(f)===92?(h=st,f++):(h=t,se===0&&ae(Rt)),h!==t?(Kp.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(Xp)),w!==t?(we=a,h=dt(w),a=h):(f=a,a=t)):(f=a,a=t),a===t&&(a=Yy()))))))))),a}function Yy(){var a=f,h,w,x,X,oe,Me,Ne,Xe,Je,ct,Wi;return s.charCodeAt(f)===92?(h=st,f++):(h=t,se===0&&ae(Rt)),h!==t?(w=Pi(),w!==t?(we=a,h=Oi(w),a=h):(f=a,a=t)):(f=a,a=t),a===t&&(a=f,s.substr(f,2)===Jl?(h=Jl,f+=2):(h=t,se===0&&ae(Yp)),h!==t?(w=f,x=f,X=Pi(),X!==t?(oe=lt(),oe!==t?(X=[X,oe],x=X):(f=x,x=t)):(f=x,x=t),x===t&&(x=Pi()),x!==t?w=s.substring(w,f):w=x,w!==t?(we=a,h=Oi(w),a=h):(f=a,a=t)):(f=a,a=t),a===t&&(a=f,s.substr(f,2)===ec?(h=ec,f+=2):(h=t,se===0&&ae(Qp)),h!==t?(w=f,x=f,X=lt(),X!==t?(oe=lt(),oe!==t?(Me=lt(),Me!==t?(Ne=lt(),Ne!==t?(X=[X,oe,Me,Ne],x=X):(f=x,x=t)):(f=x,x=t)):(f=x,x=t)):(f=x,x=t),x!==t?w=s.substring(w,f):w=x,w!==t?(we=a,h=Oi(w),a=h):(f=a,a=t)):(f=a,a=t),a===t&&(a=f,s.substr(f,2)===tc?(h=tc,f+=2):(h=t,se===0&&ae(Zp)),h!==t?(w=f,x=f,X=lt(),X!==t?(oe=lt(),oe!==t?(Me=lt(),Me!==t?(Ne=lt(),Ne!==t?(Xe=lt(),Xe!==t?(Je=lt(),Je!==t?(ct=lt(),ct!==t?(Wi=lt(),Wi!==t?(X=[X,oe,Me,Ne,Xe,Je,ct,Wi],x=X):(f=x,x=t)):(f=x,x=t)):(f=x,x=t)):(f=x,x=t)):(f=x,x=t)):(f=x,x=t)):(f=x,x=t)):(f=x,x=t),x!==t?w=s.substring(w,f):w=x,w!==t?(we=a,h=Jp(w),a=h):(f=a,a=t)):(f=a,a=t)))),a}function Pi(){var a;return ey.test(s.charAt(f))?(a=s.charAt(f),f++):(a=t,se===0&&ae(ty)),a}function lt(){var a;return ry.test(s.charAt(f))?(a=s.charAt(f),f++):(a=t,se===0&&ae(ny)),a}function Qy(){var a=f,h=[],w=f,x,X;if(s.charCodeAt(f)===92?(x=st,f++):(x=t,se===0&&ae(Rt)),x!==t?(s.length>f?(X=s.charAt(f),f++):(X=t,se===0&&ae(ar)),X!==t?(we=w,x=dt(X),w=x):(f=w,w=t)):(f=w,w=t),w===t&&(w=f,s.substr(f,2)===bn?(x=bn,f+=2):(x=t,se===0&&ae(rc)),x!==t&&(we=w,x=nc()),w=x,w===t&&(w=f,x=f,se++,X=jc(),se--,X===t?x=void 0:(f=x,x=t),x!==t?(s.length>f?(X=s.charAt(f),f++):(X=t,se===0&&ae(ar)),X!==t?(we=w,x=dt(X),w=x):(f=w,w=t)):(f=w,w=t))),w!==t)for(;w!==t;)h.push(w),w=f,s.charCodeAt(f)===92?(x=st,f++):(x=t,se===0&&ae(Rt)),x!==t?(s.length>f?(X=s.charAt(f),f++):(X=t,se===0&&ae(ar)),X!==t?(we=w,x=dt(X),w=x):(f=w,w=t)):(f=w,w=t),w===t&&(w=f,s.substr(f,2)===bn?(x=bn,f+=2):(x=t,se===0&&ae(rc)),x!==t&&(we=w,x=nc()),w=x,w===t&&(w=f,x=f,se++,X=jc(),se--,X===t?x=void 0:(f=x,x=t),x!==t?(s.length>f?(X=s.charAt(f),f++):(X=t,se===0&&ae(ar)),X!==t?(we=w,x=dt(X),w=x):(f=w,w=t)):(f=w,w=t)));else h=t;return h!==t&&(we=a,h=L(h)),a=h,a}function Bi(){var a=f,h,w,x,X,oe;if(s.charCodeAt(f)===45?(h=mn,f++):(h=t,se===0&&ae(vn)),h===t&&(s.charCodeAt(f)===43?(h=_n,f++):(h=t,se===0&&ae(Sn))),h===t&&(h=null),h!==t){if(w=[],pe.test(s.charAt(f))?(x=s.charAt(f),f++):(x=t,se===0&&ae(Ee)),x!==t)for(;x!==t;)w.push(x),pe.test(s.charAt(f))?(x=s.charAt(f),f++):(x=t,se===0&&ae(Ee));else w=t;if(w!==t)if(s.charCodeAt(f)===46?(x=iy,f++):(x=t,se===0&&ae(sy)),x!==t){if(X=[],pe.test(s.charAt(f))?(oe=s.charAt(f),f++):(oe=t,se===0&&ae(Ee)),oe!==t)for(;oe!==t;)X.push(oe),pe.test(s.charAt(f))?(oe=s.charAt(f),f++):(oe=t,se===0&&ae(Ee));else X=t;X!==t?(we=a,h=oy(h,w,X),a=h):(f=a,a=t)}else f=a,a=t;else f=a,a=t}else f=a,a=t;if(a===t){if(a=f,s.charCodeAt(f)===45?(h=mn,f++):(h=t,se===0&&ae(vn)),h===t&&(s.charCodeAt(f)===43?(h=_n,f++):(h=t,se===0&&ae(Sn))),h===t&&(h=null),h!==t){if(w=[],pe.test(s.charAt(f))?(x=s.charAt(f),f++):(x=t,se===0&&ae(Ee)),x!==t)for(;x!==t;)w.push(x),pe.test(s.charAt(f))?(x=s.charAt(f),f++):(x=t,se===0&&ae(Ee));else w=t;w!==t?(we=a,h=ay(h,w),a=h):(f=a,a=t)}else f=a,a=t;if(a===t&&(a=f,h=Ui(),h!==t&&(we=a,h=ly(h)),a=h,a===t&&(a=f,h=zt(),h!==t&&(we=a,h=cy(h)),a=h,a===t)))if(a=f,s.charCodeAt(f)===40?(h=$e,f++):(h=t,se===0&&ae(Te)),h!==t){for(w=[],x=ye();x!==t;)w.push(x),x=ye();if(w!==t)if(x=Fc(),x!==t){for(X=[],oe=ye();oe!==t;)X.push(oe),oe=ye();X!==t?(s.charCodeAt(f)===41?(oe=re,f++):(oe=t,se===0&&ae(be)),oe!==t?(we=a,h=uy(x),a=h):(f=a,a=t)):(f=a,a=t)}else f=a,a=t;else f=a,a=t}else f=a,a=t}return a}function Fi(){var a=f,h=Bi(),w,x,X,oe,Me,Ne;if(h!==t){for(w=[],x=f,X=[],oe=ye();oe!==t;)X.push(oe),oe=ye();if(X!==t)if(s.charCodeAt(f)===42?(oe=ic,f++):(oe=t,se===0&&ae(sc)),oe===t&&(s.charCodeAt(f)===47?(oe=oc,f++):(oe=t,se===0&&ae(ac))),oe!==t){for(Me=[],Ne=ye();Ne!==t;)Me.push(Ne),Ne=ye();Me!==t?(Ne=Bi(),Ne!==t?(we=x,X=lc(h,oe,Ne),x=X):(f=x,x=t)):(f=x,x=t)}else f=x,x=t;else f=x,x=t;for(;x!==t;){for(w.push(x),x=f,X=[],oe=ye();oe!==t;)X.push(oe),oe=ye();if(X!==t)if(s.charCodeAt(f)===42?(oe=ic,f++):(oe=t,se===0&&ae(sc)),oe===t&&(s.charCodeAt(f)===47?(oe=oc,f++):(oe=t,se===0&&ae(ac))),oe!==t){for(Me=[],Ne=ye();Ne!==t;)Me.push(Ne),Ne=ye();Me!==t?(Ne=Bi(),Ne!==t?(we=x,X=lc(h,oe,Ne),x=X):(f=x,x=t)):(f=x,x=t)}else f=x,x=t;else f=x,x=t}w!==t?(we=a,h=cc(h,w),a=h):(f=a,a=t)}else f=a,a=t;return a}function Fc(){var a=f,h=Fi(),w,x,X,oe,Me,Ne;if(h!==t){for(w=[],x=f,X=[],oe=ye();oe!==t;)X.push(oe),oe=ye();if(X!==t)if(s.charCodeAt(f)===43?(oe=_n,f++):(oe=t,se===0&&ae(Sn)),oe===t&&(s.charCodeAt(f)===45?(oe=mn,f++):(oe=t,se===0&&ae(vn))),oe!==t){for(Me=[],Ne=ye();Ne!==t;)Me.push(Ne),Ne=ye();Me!==t?(Ne=Fi(),Ne!==t?(we=x,X=uc(h,oe,Ne),x=X):(f=x,x=t)):(f=x,x=t)}else f=x,x=t;else f=x,x=t;for(;x!==t;){for(w.push(x),x=f,X=[],oe=ye();oe!==t;)X.push(oe),oe=ye();if(X!==t)if(s.charCodeAt(f)===43?(oe=_n,f++):(oe=t,se===0&&ae(Sn)),oe===t&&(s.charCodeAt(f)===45?(oe=mn,f++):(oe=t,se===0&&ae(vn))),oe!==t){for(Me=[],Ne=ye();Ne!==t;)Me.push(Ne),Ne=ye();Me!==t?(Ne=Fi(),Ne!==t?(we=x,X=uc(h,oe,Ne),x=X):(f=x,x=t)):(f=x,x=t)}else f=x,x=t;else f=x,x=t}w!==t?(we=a,h=cc(h,w),a=h):(f=a,a=t)}else f=a,a=t;return a}function Uc(){var a=f,h,w,x,X,oe;if(s.substr(f,3)===fc?(h=fc,f+=3):(h=t,se===0&&ae(fy)),h!==t){for(w=[],x=ye();x!==t;)w.push(x),x=ye();if(w!==t)if(x=Fc(),x!==t){for(X=[],oe=ye();oe!==t;)X.push(oe),oe=ye();X!==t?(s.substr(f,2)===dc?(oe=dc,f+=2):(oe=t,se===0&&ae(dy)),oe!==t?(we=a,h=hy(x),a=h):(f=a,a=t)):(f=a,a=t)}else f=a,a=t;else f=a,a=t}else f=a,a=t;return a}function Wc(){var a=f,h,w,x;return s.substr(f,2)===hc?(h=hc,f+=2):(h=t,se===0&&ae(py)),h!==t?(w=Lr(),w!==t?(s.charCodeAt(f)===41?(x=re,f++):(x=t,se===0&&ae(be)),x!==t?(we=a,h=yy(w),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t),a}function Ui(){var a=f,h,w,x,X,oe;return s.substr(f,2)===wt?(h=wt,f+=2):(h=t,se===0&&ae(kr)),h!==t?(w=zt(),w!==t?(s.substr(f,2)===pc?(x=pc,f+=2):(x=t,se===0&&ae(gy)),x!==t?(X=Lc(),X!==t?(s.charCodeAt(f)===125?(oe=Z,f++):(oe=t,se===0&&ae(ge)),oe!==t?(we=a,h=wy(w,X),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t)):(f=a,a=t)):(f=a,a=t),a===t&&(a=f,s.substr(f,2)===wt?(h=wt,f+=2):(h=t,se===0&&ae(kr)),h!==t?(w=zt(),w!==t?(s.substr(f,3)===yc?(x=yc,f+=3):(x=t,se===0&&ae(by)),x!==t?(we=a,h=my(w),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t),a===t&&(a=f,s.substr(f,2)===wt?(h=wt,f+=2):(h=t,se===0&&ae(kr)),h!==t?(w=zt(),w!==t?(s.substr(f,2)===gc?(x=gc,f+=2):(x=t,se===0&&ae(vy)),x!==t?(X=Lc(),X!==t?(s.charCodeAt(f)===125?(oe=Z,f++):(oe=t,se===0&&ae(ge)),oe!==t?(we=a,h=_y(w,X),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t)):(f=a,a=t)):(f=a,a=t),a===t&&(a=f,s.substr(f,2)===wt?(h=wt,f+=2):(h=t,se===0&&ae(kr)),h!==t?(w=zt(),w!==t?(s.substr(f,3)===wc?(x=wc,f+=3):(x=t,se===0&&ae(Sy)),x!==t?(we=a,h=Ey(w),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t),a===t&&(a=f,s.substr(f,2)===wt?(h=wt,f+=2):(h=t,se===0&&ae(kr)),h!==t?(w=zt(),w!==t?(s.charCodeAt(f)===125?(x=Z,f++):(x=t,se===0&&ae(ge)),x!==t?(we=a,h=bc(w),a=h):(f=a,a=t)):(f=a,a=t)):(f=a,a=t),a===t&&(a=f,s.charCodeAt(f)===36?(h=Ay,f++):(h=t,se===0&&ae(xy)),h!==t?(w=zt(),w!==t?(we=a,h=bc(w),a=h):(f=a,a=t)):(f=a,a=t)))))),a}function Zy(){var a=f,h=Jy(),w;return h!==t?(we=f,w=$y(h),w?w=void 0:w=t,w!==t?(we=a,h=Ry(h),a=h):(f=a,a=t)):(f=a,a=t),a}function Jy(){var a=f,h=[],w=f,x=f,X;if(se++,X=qc(),se--,X===t?x=void 0:(f=x,x=t),x!==t?(s.length>f?(X=s.charAt(f),f++):(X=t,se===0&&ae(ar)),X!==t?(we=w,x=dt(X),w=x):(f=w,w=t)):(f=w,w=t),w!==t)for(;w!==t;)h.push(w),w=f,x=f,se++,X=qc(),se--,X===t?x=void 0:(f=x,x=t),x!==t?(s.length>f?(X=s.charAt(f),f++):(X=t,se===0&&ae(ar)),X!==t?(we=w,x=dt(X),w=x):(f=w,w=t)):(f=w,w=t);else h=t;return h!==t&&(we=a,h=L(h)),a=h,a}function Hc(){var a=f,h=[],w;if(mc.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(vc)),w!==t)for(;w!==t;)h.push(w),mc.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(vc));else h=t;return h!==t&&(we=a,h=_c()),a=h,a}function zt(){var a=f,h=[],w;if(Sc.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(Ec)),w!==t)for(;w!==t;)h.push(w),Sc.test(s.charAt(f))?(w=s.charAt(f),f++):(w=t,se===0&&ae(Ec));else h=t;return h!==t&&(we=a,h=_c()),a=h,a}function jc(){var a;return Ty.test(s.charAt(f))?(a=s.charAt(f),f++):(a=t,se===0&&ae(Iy)),a}function qc(){var a;return ky.test(s.charAt(f))?(a=s.charAt(f),f++):(a=t,se===0&&ae(Ly)),a}function ye(){var a=[],h;if(Ac.test(s.charAt(f))?(h=s.charAt(f),f++):(h=t,se===0&&ae(xc)),h!==t)for(;h!==t;)a.push(h),Ac.test(s.charAt(f))?(h=s.charAt(f),f++):(h=t,se===0&&ae(xc));else a=t;return a}if(An=p(),An!==t&&f===s.length)return An;throw An!==t&&f<s.length&&ae(Oy()),Ny(Ni,bt<s.length?s.charAt(bt):null,bt<s.length?Rc(bt,bt+1):Rc(bt,bt))}r.exports={SyntaxError:i,parse:o}})),Zd=De((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseShell=n;const r=Qd();function n(o,s={isGlobPattern:()=>!1}){try{return(0,r.parse)(o,s)}catch(c){throw c.location&&(c.message=c.message.replace(/(\.)?$/,` (line ${c.location.start.line}, column ${c.location.start.column})$1`)),c}}const i=new Map([["\f","\\f"],[`
|
|
15
|
+
`,"\\n"],["\r","\\r"],[" ","\\t"],["\v","\\v"],["\0","\\0"]]);new Map([["\\","\\\\"],["$","\\$"],['"','\\"'],...Array.from(i,([o,s])=>[o,`"$'${s}'"`])])})),ln=De(((e,r)=>{const i="[^\\\\/]",p="(?=.)",y="[^/]",m="(?:\\/|$)",v="(?:^|\\/)",T=`\\.{1,2}${m}`,$={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:p,QMARK:y,END_ANCHOR:m,DOTS_SLASH:T,NO_DOT:"(?!\\.)",NO_DOTS:`(?!${v}${T})`,NO_DOT_SLASH:`(?!\\.{0,1}${m})`,NO_DOTS_SLASH:`(?!${T})`,QMARK_NO_DOT:"[^.\\/]",STAR:`${y}*?`,START_ANCHOR:v,SEP:"/"},N={...$,SLASH_LITERAL:"[\\\\/]",QMARK:i,STAR:`${i}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"};r.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(P){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${P.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(P){return P===!0?N:$}}})),cn=De((e=>{const{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=ln();e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>i.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(o,"\\$1"),e.toPosixSlashes=s=>s.replace(r,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1},e.removeBackslashes=s=>s.replace(n,c=>c==="\\"?"":c),e.escapeLast=(s,c,t)=>{const d=s.lastIndexOf(c,t);return d===-1?s:s[d-1]==="\\"?e.escapeLast(s,c,d-1):`${s.slice(0,d)}\\${s.slice(d)}`},e.removePrefix=(s,c={})=>{let t=s;return t.startsWith("./")&&(t=t.slice(2),c.prefix="./"),t},e.wrapOutput=(s,c={},t={})=>{let d=`${t.contains?"":"^"}(?:${s})${t.contains?"":"$"}`;return c.negated===!0&&(d=`(?:^(?!${d}).*$)`),d},e.basename=(s,{windows:c}={})=>{const t=s.split(c?/[\\/]/:"/"),d=t[t.length-1];return d===""?t[t.length-2]:d}})),Jd=De(((e,r)=>{const n=cn(),{CHAR_ASTERISK:i,CHAR_AT:o,CHAR_BACKWARD_SLASH:s,CHAR_COMMA:c,CHAR_DOT:t,CHAR_EXCLAMATION_MARK:d,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:y,CHAR_LEFT_PARENTHESES:m,CHAR_LEFT_SQUARE_BRACKET:v,CHAR_PLUS:T,CHAR_QUESTION_MARK:$,CHAR_RIGHT_CURLY_BRACE:N,CHAR_RIGHT_PARENTHESES:P,CHAR_RIGHT_SQUARE_BRACKET:q}=ln(),_=C=>C===p||C===s,D=C=>{C.isPrefix!==!0&&(C.depth=C.isGlobstar?1/0:1)},k=(C,S)=>{const O=S||{},z=C.length-1,Y=O.parts===!0||O.scanToEnd===!0,V=[],le=[],G=[];let H=C,ee=-1,j=0,me=0,Ae=!1,$e=!1,Te=!1,re=!1,be=!1,R=!1,ie=!1,ve=!1,Z=!1,ge=!1,Re=0,Le,de,I={value:"",depth:0,isGlob:!1};const J=()=>ee>=z,pe=()=>H.charCodeAt(ee+1),Ee=()=>(Le=de,H.charCodeAt(++ee));for(;ee<z;){de=Ee();let ue;if(de===s){ie=I.backslashes=!0,de=Ee(),de===y&&(R=!0);continue}if(R===!0||de===y){for(Re++;J()!==!0&&(de=Ee());){if(de===s){ie=I.backslashes=!0,Ee();continue}if(de===y){Re++;continue}if(R!==!0&&de===t&&(de=Ee())===t){if(Ae=I.isBrace=!0,Te=I.isGlob=!0,ge=!0,Y===!0)continue;break}if(R!==!0&&de===c){if(Ae=I.isBrace=!0,Te=I.isGlob=!0,ge=!0,Y===!0)continue;break}if(de===N&&(Re--,Re===0)){R=!1,Ae=I.isBrace=!0,ge=!0;break}}if(Y===!0)continue;break}if(de===p){if(V.push(ee),le.push(I),I={value:"",depth:0,isGlob:!1},ge===!0)continue;if(Le===t&&ee===j+1){j+=2;continue}me=ee+1;continue}if(O.noext!==!0&&(de===T||de===o||de===i||de===$||de===d)&&pe()===m){if(Te=I.isGlob=!0,re=I.isExtglob=!0,ge=!0,de===d&&ee===j&&(Z=!0),Y===!0){for(;J()!==!0&&(de=Ee());){if(de===s){ie=I.backslashes=!0,de=Ee();continue}if(de===P){Te=I.isGlob=!0,ge=!0;break}}continue}break}if(de===i){if(Le===i&&(be=I.isGlobstar=!0),Te=I.isGlob=!0,ge=!0,Y===!0)continue;break}if(de===$){if(Te=I.isGlob=!0,ge=!0,Y===!0)continue;break}if(de===v){for(;J()!==!0&&(ue=Ee());){if(ue===s){ie=I.backslashes=!0,Ee();continue}if(ue===q){$e=I.isBracket=!0,Te=I.isGlob=!0,ge=!0;break}}if(Y===!0)continue;break}if(O.nonegate!==!0&&de===d&&ee===j){ve=I.negated=!0,j++;continue}if(O.noparen!==!0&&de===m){if(Te=I.isGlob=!0,Y===!0){for(;J()!==!0&&(de=Ee());){if(de===m){ie=I.backslashes=!0,de=Ee();continue}if(de===P){ge=!0;break}}continue}break}if(Te===!0){if(ge=!0,Y===!0)continue;break}}O.noext===!0&&(re=!1,Te=!1);let F=H,E="",U="";j>0&&(E=H.slice(0,j),H=H.slice(j),me-=j),F&&Te===!0&&me>0?(F=H.slice(0,me),U=H.slice(me)):Te===!0?(F="",U=H):F=H,F&&F!==""&&F!=="/"&&F!==H&&_(F.charCodeAt(F.length-1))&&(F=F.slice(0,-1)),O.unescape===!0&&(U&&(U=n.removeBackslashes(U)),F&&ie===!0&&(F=n.removeBackslashes(F)));const K={prefix:E,input:C,start:j,base:F,glob:U,isBrace:Ae,isBracket:$e,isGlob:Te,isExtglob:re,isGlobstar:be,negated:ve,negatedExtglob:Z};if(O.tokens===!0&&(K.maxDepth=0,_(de)||le.push(I),K.tokens=le),O.parts===!0||O.tokens===!0){let ue;for(let ce=0;ce<V.length;ce++){const fe=ue?ue+1:j,B=V[ce],ne=C.slice(fe,B);O.tokens&&(ce===0&&j!==0?(le[ce].isPrefix=!0,le[ce].value=E):le[ce].value=ne,D(le[ce]),K.maxDepth+=le[ce].depth),(ce!==0||ne!=="")&&G.push(ne),ue=B}if(ue&&ue+1<C.length){const ce=C.slice(ue+1);G.push(ce),O.tokens&&(le[le.length-1].value=ce,D(le[le.length-1]),K.maxDepth+=le[le.length-1].depth)}K.slashes=V,K.parts=G}return K};r.exports=k})),eh=De(((e,r)=>{const n=ln(),i=cn(),{MAX_LENGTH:o,POSIX_REGEX_SOURCE:s,REGEX_NON_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_BACKREF:t,REPLACEMENTS:d}=n,p=(k,C)=>{if(typeof C.expandRange=="function")return C.expandRange(...k,C);k.sort();const S=`[${k.join("-")}]`;try{new RegExp(S)}catch{return k.map(z=>i.escapeRegex(z)).join("..")}return S},y=(k,C)=>`Missing ${k}: "${C}" - use "\\\\${C}" to match literal characters`,m=k=>{const C=[];let S=0,O=0,z=0,Y="",V=!1;for(const le of k){if(V===!0){Y+=le,V=!1;continue}if(le==="\\"){Y+=le,V=!0;continue}if(le==='"'){z=z===1?0:1,Y+=le;continue}if(z===0){if(le==="[")S++;else if(le==="]"&&S>0)S--;else if(S===0){if(le==="(")O++;else if(le===")"&&O>0)O--;else if(le==="|"&&O===0){C.push(Y),Y="";continue}}}Y+=le}return C.push(Y),C},v=k=>{let C=!1;for(const S of k){if(C===!0){C=!1;continue}if(S==="\\"){C=!0;continue}if(/[?*+@!()[\]{}]/.test(S))return!1}return!0},T=k=>{let C=k.trim(),S=!0;for(;S===!0;)S=!1,/^@\([^\\()[\]{}|]+\)$/.test(C)&&(C=C.slice(2,-1),S=!0);if(v(C))return C.replace(/\\(.)/g,"$1")},$=k=>{const C=k.map(T).filter(Boolean);for(let S=0;S<C.length;S++)for(let O=S+1;O<C.length;O++){const z=C[S],Y=C[O],V=z[0];if(!(!V||z!==V.repeat(z.length)||Y!==V.repeat(Y.length))&&(z===Y||z.startsWith(Y)||Y.startsWith(z)))return!0}return!1},N=(k,C=!0)=>{if(k[0]!=="+"&&k[0]!=="*"||k[1]!=="(")return;let S=0,O=0,z=0,Y=!1;for(let V=1;V<k.length;V++){const le=k[V];if(Y===!0){Y=!1;continue}if(le==="\\"){Y=!0;continue}if(le==='"'){z=z===1?0:1;continue}if(z!==1){if(le==="["){S++;continue}if(le==="]"&&S>0){S--;continue}if(!(S>0)){if(le==="("){O++;continue}if(le===")"&&(O--,O===0))return C===!0&&V!==k.length-1?void 0:{type:k[0],body:k.slice(2,V),end:V}}}}},P=k=>{let C=0;const S=[];for(;C<k.length;){const O=N(k.slice(C),!1);if(!O||O.type!=="*")return;const z=m(O.body).map(V=>V.trim());if(z.length!==1)return;const Y=T(z[0]);if(!Y||Y.length!==1)return;S.push(Y),C+=O.end+1}if(!(S.length<1))return`${S.length===1?i.escapeRegex(S[0]):`[${S.map(O=>i.escapeRegex(O)).join("")}]`}*`},q=k=>{let C=0,S=k.trim(),O=N(S);for(;O;)C++,S=O.body.trim(),O=N(S);return C},_=(k,C)=>{if(C.maxExtglobRecursion===!1)return{risky:!1};const S=typeof C.maxExtglobRecursion=="number"?C.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,O=m(k).map(z=>z.trim());if(O.length>1&&(O.some(z=>z==="")||O.some(z=>/^[*?]+$/.test(z))||$(O)))return{risky:!0};for(const z of O){const Y=P(z);if(Y)return{risky:!0,safeOutput:Y};if(q(z)>S)return{risky:!0}}return{risky:!1}},D=(k,C)=>{if(typeof k!="string")throw new TypeError("Expected a string");k=d[k]||k;const S={...C},O=typeof S.maxLength=="number"?Math.min(o,S.maxLength):o;let z=k.length;if(z>O)throw new SyntaxError(`Input length: ${z}, exceeds maximum allowed length: ${O}`);const Y={type:"bos",value:"",output:S.prepend||""},V=[Y],le=S.capture?"":"?:",G=n.globChars(S.windows),H=n.extglobChars(G),{DOT_LITERAL:ee,PLUS_LITERAL:j,SLASH_LITERAL:me,ONE_CHAR:Ae,DOTS_SLASH:$e,NO_DOT:Te,NO_DOT_SLASH:re,NO_DOTS_SLASH:be,QMARK:R,QMARK_NO_DOT:ie,STAR:ve,START_ANCHOR:Z}=G,ge=l=>`(${le}(?:(?!${Z}${l.dot?$e:ee}).)*?)`,Re=S.dot?"":Te,Le=S.dot?R:ie;let de=S.bash===!0?ge(S):ve;S.capture&&(de=`(${de})`),typeof S.noext=="boolean"&&(S.noextglob=S.noext);const I={input:k,index:-1,start:0,dot:S.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};k=i.removePrefix(k,I),z=k.length;const J=[],pe=[],Ee=[];let F=Y,E;const U=()=>I.index===z-1,K=I.peek=(l=1)=>k[I.index+l],ue=I.advance=()=>k[++I.index]||"",ce=()=>k.slice(I.index+1),fe=(l="",u=0)=>{I.consumed+=l,I.index+=u},B=l=>{I.output+=l.output!=null?l.output:l.value,fe(l.value)},ne=()=>{let l=1;for(;K()==="!"&&(K(2)!=="("||K(3)==="?");)ue(),I.start++,l++;return l%2===0?!1:(I.negated=!0,I.start++,!0)},he=l=>{I[l]++,Ee.push(l)},te=l=>{I[l]--,Ee.pop()},xe=l=>{if(F.type==="globstar"){const u=I.braces>0&&(l.type==="comma"||l.type==="brace"),b=l.extglob===!0||J.length&&(l.type==="pipe"||l.type==="paren");l.type!=="slash"&&l.type!=="paren"&&!u&&!b&&(I.output=I.output.slice(0,-F.output.length),F.type="star",F.value="*",F.output=de,I.output+=F.output)}if(J.length&&l.type!=="paren"&&(J[J.length-1].inner+=l.value),(l.value||l.output)&&B(l),F&&F.type==="text"&&l.type==="text"){F.output=(F.output||F.value)+l.value,F.value+=l.value;return}l.prev=F,V.push(l),F=l},Qe=(l,u)=>{const b={...H[u],conditions:1,inner:""};b.prev=F,b.parens=I.parens,b.output=I.output,b.startIndex=I.index,b.tokensIndex=V.length;const M=(S.capture?"(":"")+b.open;he("parens"),xe({type:l,value:u,output:I.output?"":Ae}),xe({type:"paren",extglob:!0,value:ue(),output:M}),J.push(b)},g=l=>{const u=k.slice(l.startIndex,I.index+1),b=_(k.slice(l.startIndex+2,I.index),S);if((l.type==="plus"||l.type==="star")&&b.risky){const Q=b.safeOutput?(l.output?"":Ae)+(S.capture?`(${b.safeOutput})`:b.safeOutput):void 0,ke=V[l.tokensIndex];ke.type="text",ke.value=u,ke.output=Q||i.escapeRegex(u);for(let Be=l.tokensIndex+1;Be<V.length;Be++)V[Be].value="",V[Be].output="",delete V[Be].suffix;I.output=l.output+ke.output,I.backtrack=!0,xe({type:"paren",extglob:!0,value:E,output:""}),te("parens");return}let M=l.close+(S.capture?")":""),W;if(l.type==="negate"){let Q=de;l.inner&&l.inner.length>1&&l.inner.includes("/")&&(Q=ge(S)),(Q!==de||U()||/^\)+$/.test(ce()))&&(M=l.close=`)$))${Q}`),l.inner.includes("*")&&(W=ce())&&/^\.[^\\/.]+$/.test(W)&&(M=l.close=`)${D(W,{...C,fastpaths:!1}).output})${Q})`),l.prev.type==="bos"&&(I.negatedExtglob=!0)}xe({type:"paren",extglob:!0,value:E,output:M}),te("parens")};if(S.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(k)){let l=!1,u=k.replace(t,(b,M,W,Q,ke,Be)=>Q==="\\"?(l=!0,b):Q==="?"?M?M+Q+(ke?R.repeat(ke.length):""):Be===0?Le+(ke?R.repeat(ke.length):""):R.repeat(W.length):Q==="."?ee.repeat(W.length):Q==="*"?M?M+Q+(ke?de:""):de:M?b:`\\${b}`);return l===!0&&(S.unescape===!0?u=u.replace(/\\/g,""):u=u.replace(/\\+/g,b=>b.length%2===0?"\\\\":b?"\\":"")),u===k&&S.contains===!0?(I.output=k,I):(I.output=i.wrapOutput(u,I,C),I)}for(;!U();){if(E=ue(),E==="\0")continue;if(E==="\\"){const b=K();if(b==="/"&&S.bash!==!0||b==="."||b===";")continue;if(!b){E+="\\",xe({type:"text",value:E});continue}const M=/^\\+/.exec(ce());let W=0;if(M&&M[0].length>2&&(W=M[0].length,I.index+=W,W%2!==0&&(E+="\\")),S.unescape===!0?E=ue():E+=ue(),I.brackets===0){xe({type:"text",value:E});continue}}if(I.brackets>0&&(E!=="]"||F.value==="["||F.value==="[^")){if(S.posix!==!1&&E===":"){const b=F.value.slice(1);if(b.includes("[")&&(F.posix=!0,b.includes(":"))){const M=F.value.lastIndexOf("["),W=F.value.slice(0,M),Q=s[F.value.slice(M+2)];if(Q){F.value=W+Q,I.backtrack=!0,ue(),!Y.output&&V.indexOf(F)===1&&(Y.output=Ae);continue}}}(E==="["&&K()!==":"||E==="-"&&K()==="]")&&(E=`\\${E}`),E==="]"&&(F.value==="["||F.value==="[^")&&(E=`\\${E}`),S.posix===!0&&E==="!"&&F.value==="["&&(E="^"),F.value+=E,B({value:E});continue}if(I.quotes===1&&E!=='"'){E=i.escapeRegex(E),F.value+=E,B({value:E});continue}if(E==='"'){I.quotes=I.quotes===1?0:1,S.keepQuotes===!0&&xe({type:"text",value:E});continue}if(E==="("){he("parens"),xe({type:"paren",value:E});continue}if(E===")"){if(I.parens===0&&S.strictBrackets===!0)throw new SyntaxError(y("opening","("));const b=J[J.length-1];if(b&&I.parens===b.parens+1){g(J.pop());continue}xe({type:"paren",value:E,output:I.parens?")":"\\)"}),te("parens");continue}if(E==="["){if(S.nobracket===!0||!ce().includes("]")){if(S.nobracket!==!0&&S.strictBrackets===!0)throw new SyntaxError(y("closing","]"));E=`\\${E}`}else he("brackets");xe({type:"bracket",value:E});continue}if(E==="]"){if(S.nobracket===!0||F&&F.type==="bracket"&&F.value.length===1){xe({type:"text",value:E,output:`\\${E}`});continue}if(I.brackets===0){if(S.strictBrackets===!0)throw new SyntaxError(y("opening","["));xe({type:"text",value:E,output:`\\${E}`});continue}te("brackets");const b=F.value.slice(1);if(F.posix!==!0&&b[0]==="^"&&!b.includes("/")&&(E=`/${E}`),F.value+=E,B({value:E}),S.literalBrackets===!1||i.hasRegexChars(b))continue;const M=i.escapeRegex(F.value);if(I.output=I.output.slice(0,-F.value.length),S.literalBrackets===!0){I.output+=M,F.value=M;continue}F.value=`(${le}${M}|${F.value})`,I.output+=F.value;continue}if(E==="{"&&S.nobrace!==!0){he("braces");const b={type:"brace",value:E,output:"(",outputIndex:I.output.length,tokensIndex:I.tokens.length};pe.push(b),xe(b);continue}if(E==="}"){const b=pe[pe.length-1];if(S.nobrace===!0||!b){xe({type:"text",value:E,output:E});continue}let M=")";if(b.dots===!0){const W=V.slice(),Q=[];for(let ke=W.length-1;ke>=0&&(V.pop(),W[ke].type!=="brace");ke--)W[ke].type!=="dots"&&Q.unshift(W[ke].value);M=p(Q,S),I.backtrack=!0}if(b.comma!==!0&&b.dots!==!0){const W=I.output.slice(0,b.outputIndex),Q=I.tokens.slice(b.tokensIndex);b.value=b.output="\\{",E=M="\\}",I.output=W;for(const ke of Q)I.output+=ke.output||ke.value}xe({type:"brace",value:E,output:M}),te("braces"),pe.pop();continue}if(E==="|"){J.length>0&&J[J.length-1].conditions++,xe({type:"text",value:E});continue}if(E===","){let b=E;const M=pe[pe.length-1];M&&Ee[Ee.length-1]==="braces"&&(M.comma=!0,b="|"),xe({type:"comma",value:E,output:b});continue}if(E==="/"){if(F.type==="dot"&&I.index===I.start+1){I.start=I.index+1,I.consumed="",I.output="",V.pop(),F=Y;continue}xe({type:"slash",value:E,output:me});continue}if(E==="."){if(I.braces>0&&F.type==="dot"){F.value==="."&&(F.output=ee);const b=pe[pe.length-1];F.type="dots",F.output+=E,F.value+=E,b.dots=!0;continue}if(I.braces+I.parens===0&&F.type!=="bos"&&F.type!=="slash"){xe({type:"text",value:E,output:ee});continue}xe({type:"dot",value:E,output:ee});continue}if(E==="?"){if(!(F&&F.value==="(")&&S.noextglob!==!0&&K()==="("&&K(2)!=="?"){Qe("qmark",E);continue}if(F&&F.type==="paren"){const b=K();let M=E;(F.value==="("&&!/[!=<:]/.test(b)||b==="<"&&!/<([!=]|\w+>)/.test(ce()))&&(M=`\\${E}`),xe({type:"text",value:E,output:M});continue}if(S.dot!==!0&&(F.type==="slash"||F.type==="bos")){xe({type:"qmark",value:E,output:ie});continue}xe({type:"qmark",value:E,output:R});continue}if(E==="!"){if(S.noextglob!==!0&&K()==="("&&(K(2)!=="?"||!/[!=<:]/.test(K(3)))){Qe("negate",E);continue}if(S.nonegate!==!0&&I.index===0){ne();continue}}if(E==="+"){if(S.noextglob!==!0&&K()==="("&&K(2)!=="?"){Qe("plus",E);continue}if(F&&F.value==="("||S.regex===!1){xe({type:"plus",value:E,output:j});continue}if(F&&(F.type==="bracket"||F.type==="paren"||F.type==="brace")||I.parens>0){xe({type:"plus",value:E});continue}xe({type:"plus",value:j});continue}if(E==="@"){if(S.noextglob!==!0&&K()==="("&&K(2)!=="?"){xe({type:"at",extglob:!0,value:E,output:""});continue}xe({type:"text",value:E});continue}if(E!=="*"){(E==="$"||E==="^")&&(E=`\\${E}`);const b=c.exec(ce());b&&(E+=b[0],I.index+=b[0].length),xe({type:"text",value:E});continue}if(F&&(F.type==="globstar"||F.star===!0)){F.type="star",F.star=!0,F.value+=E,F.output=de,I.backtrack=!0,I.globstar=!0,fe(E);continue}let l=ce();if(S.noextglob!==!0&&/^\([^?]/.test(l)){Qe("star",E);continue}if(F.type==="star"){if(S.noglobstar===!0){fe(E);continue}const b=F.prev,M=b.prev,W=b.type==="slash"||b.type==="bos",Q=M&&(M.type==="star"||M.type==="globstar");if(S.bash===!0&&(!W||l[0]&&l[0]!=="/")){xe({type:"star",value:E,output:""});continue}const ke=I.braces>0&&(b.type==="comma"||b.type==="brace"),Be=J.length&&(b.type==="pipe"||b.type==="paren");if(!W&&b.type!=="paren"&&!ke&&!Be){xe({type:"star",value:E,output:""});continue}for(;l.slice(0,3)==="/**";){const Fe=k[I.index+4];if(Fe&&Fe!=="/")break;l=l.slice(3),fe("/**",3)}if(b.type==="bos"&&U()){F.type="globstar",F.value+=E,F.output=ge(S),I.output=F.output,I.globstar=!0,fe(E);continue}if(b.type==="slash"&&b.prev.type!=="bos"&&!Q&&U()){I.output=I.output.slice(0,-(b.output+F.output).length),b.output=`(?:${b.output}`,F.type="globstar",F.output=ge(S)+(S.strictSlashes?")":"|$)"),F.value+=E,I.globstar=!0,I.output+=b.output+F.output,fe(E);continue}if(b.type==="slash"&&b.prev.type!=="bos"&&l[0]==="/"){const Fe=l[1]!==void 0?"|$":"";I.output=I.output.slice(0,-(b.output+F.output).length),b.output=`(?:${b.output}`,F.type="globstar",F.output=`${ge(S)}${me}|${me}${Fe})`,F.value+=E,I.output+=b.output+F.output,I.globstar=!0,fe(E+ue()),xe({type:"slash",value:"/",output:""});continue}if(b.type==="bos"&&l[0]==="/"){F.type="globstar",F.value+=E,F.output=`(?:^|${me}|${ge(S)}${me})`,I.output=F.output,I.globstar=!0,fe(E+ue()),xe({type:"slash",value:"/",output:""});continue}I.output=I.output.slice(0,-F.output.length),F.type="globstar",F.output=ge(S),F.value+=E,I.output+=F.output,I.globstar=!0,fe(E);continue}const u={type:"star",value:E,output:de};if(S.bash===!0){u.output=".*?",(F.type==="bos"||F.type==="slash")&&(u.output=Re+u.output),xe(u);continue}if(F&&(F.type==="bracket"||F.type==="paren")&&S.regex===!0){u.output=E,xe(u);continue}(I.index===I.start||F.type==="slash"||F.type==="dot")&&(F.type==="dot"?(I.output+=re,F.output+=re):S.dot===!0?(I.output+=be,F.output+=be):(I.output+=Re,F.output+=Re),K()!=="*"&&(I.output+=Ae,F.output+=Ae)),xe(u)}for(;I.brackets>0;){if(S.strictBrackets===!0)throw new SyntaxError(y("closing","]"));I.output=i.escapeLast(I.output,"["),te("brackets")}for(;I.parens>0;){if(S.strictBrackets===!0)throw new SyntaxError(y("closing",")"));I.output=i.escapeLast(I.output,"("),te("parens")}for(;I.braces>0;){if(S.strictBrackets===!0)throw new SyntaxError(y("closing","}"));I.output=i.escapeLast(I.output,"{"),te("braces")}if(S.strictSlashes!==!0&&(F.type==="star"||F.type==="bracket")&&xe({type:"maybe_slash",value:"",output:`${me}?`}),I.backtrack===!0){I.output="";for(const l of I.tokens)I.output+=l.output!=null?l.output:l.value,l.suffix&&(I.output+=l.suffix)}return I};D.fastpaths=(k,C)=>{const S={...C},O=typeof S.maxLength=="number"?Math.min(o,S.maxLength):o,z=k.length;if(z>O)throw new SyntaxError(`Input length: ${z}, exceeds maximum allowed length: ${O}`);k=d[k]||k;const{DOT_LITERAL:Y,SLASH_LITERAL:V,ONE_CHAR:le,DOTS_SLASH:G,NO_DOT:H,NO_DOTS:ee,NO_DOTS_SLASH:j,STAR:me,START_ANCHOR:Ae}=n.globChars(S.windows),$e=S.dot?ee:H,Te=S.dot?j:H,re=S.capture?"":"?:",be={negated:!1,prefix:""};let R=S.bash===!0?".*?":me;S.capture&&(R=`(${R})`);const ie=ge=>ge.noglobstar===!0?R:`(${re}(?:(?!${Ae}${ge.dot?G:Y}).)*?)`,ve=ge=>{switch(ge){case"*":return`${$e}${le}${R}`;case".*":return`${Y}${le}${R}`;case"*.*":return`${$e}${R}${Y}${le}${R}`;case"*/*":return`${$e}${R}${V}${le}${Te}${R}`;case"**":return $e+ie(S);case"**/*":return`(?:${$e}${ie(S)}${V})?${Te}${le}${R}`;case"**/*.*":return`(?:${$e}${ie(S)}${V})?${Te}${R}${Y}${le}${R}`;case"**/.*":return`(?:${$e}${ie(S)}${V})?${Y}${le}${R}`;default:{const Re=/^(.*?)\.(\w+)$/.exec(ge);if(!Re)return;const Le=ve(Re[1]);return Le?Le+Y+Re[2]:void 0}}};let Z=ve(i.removePrefix(k,be));return Z&&S.strictSlashes!==!0&&(Z+=`${V}?`),Z},r.exports=D})),th=De(((e,r)=>{const n=Jd(),i=eh(),o=cn(),s=ln(),c=d=>d&&typeof d=="object"&&!Array.isArray(d),t=(d,p,y=!1)=>{if(Array.isArray(d)){const _=d.map(k=>t(k,p,y));return k=>{for(const C of _){const S=C(k);if(S)return S}return!1}}const m=c(d)&&d.tokens&&d.input;if(d===""||typeof d!="string"&&!m)throw new TypeError("Expected pattern to be a non-empty string");const v=p||{},T=v.windows,$=m?t.compileRe(d,p):t.makeRe(d,p,!1,!0),N=$.state;delete $.state;let P=()=>!1;if(v.ignore){const _={...p,ignore:null,onMatch:null,onResult:null};P=t(v.ignore,_,y)}const q=(_,D=!1)=>{const{isMatch:k,match:C,output:S}=t.test(_,$,p,{glob:d,posix:T}),O={glob:d,state:N,regex:$,posix:T,input:_,output:S,match:C,isMatch:k};return typeof v.onResult=="function"&&v.onResult(O),k===!1?(O.isMatch=!1,D?O:!1):P(_)?(typeof v.onIgnore=="function"&&v.onIgnore(O),O.isMatch=!1,D?O:!1):(typeof v.onMatch=="function"&&v.onMatch(O),D?O:!0)};return y&&(q.state=N),q};t.test=(d,p,y,{glob:m,posix:v}={})=>{if(typeof d!="string")throw new TypeError("Expected input to be a string");if(d==="")return{isMatch:!1,output:""};const T=y||{},$=T.format||(v?o.toPosixSlashes:null);let N=d===m,P=N&&$?$(d):d;return N===!1&&(P=$?$(d):d,N=P===m),(N===!1||T.capture===!0)&&(T.matchBase===!0||T.basename===!0?N=t.matchBase(d,p,y,v):N=p.exec(P)),{isMatch:!!N,match:N,output:P}},t.matchBase=(d,p,y)=>(p instanceof RegExp?p:t.makeRe(p,y)).test(o.basename(d)),t.isMatch=(d,p,y)=>t(p,y)(d),t.parse=(d,p)=>Array.isArray(d)?d.map(y=>t.parse(y,p)):i(d,{...p,fastpaths:!1}),t.scan=(d,p)=>n(d,p),t.compileRe=(d,p,y=!1,m=!1)=>{if(y===!0)return d.output;const v=p||{},T=v.contains?"":"^",$=v.contains?"":"$";let N=`${T}(?:${d.output})${$}`;d&&d.negated===!0&&(N=`^(?!${N}).*$`);const P=t.toRegex(N,p);return m===!0&&(P.state=d),P},t.makeRe=(d,p={},y=!1,m=!1)=>{if(!d||typeof d!="string")throw new TypeError("Expected a non-empty string");let v={negated:!1,fastpaths:!0};return p.fastpaths!==!1&&(d[0]==="."||d[0]==="*")&&(v.output=i.fastpaths(d,p)),v.output||(v=i(d,p)),t.compileRe(v,p,y,m)},t.toRegex=(d,p)=>{try{const y=p||{};return new RegExp(d,y.flags||(y.nocase?"i":""))}catch(y){if(p&&p.debug===!0)throw y;return/$^/}},t.constants=s,r.exports=t})),rh=De(((e,r)=>{const n=th(),i=cn();function o(s,c,t=!1){return c&&(c.windows===null||c.windows===void 0)&&(c={...c,windows:i.isWindows()}),n(s,c,t)}Object.assign(o,n),r.exports=o})),nh=Zd(),wa=ji(rh());const ih=/[*?]|\[[^\]]*\]/;function ba(e){return ih.test(e)}function mi(e,r){switch(r){case"?":return String(e.lastStatus);case"$":return"1";case"0":return"bash";case"#":return"0";case"@":case"*":return"";default:return e.variables[r]??e.environment[r]}}function At(e,r){switch(e.type){case"number":return e.value;case"variable":return Number.parseInt(mi(r,e.name)??"0",10)||0;case"addition":return At(e.left,r)+At(e.right,r);case"subtraction":return At(e.left,r)-At(e.right,r);case"multiplication":return At(e.left,r)*At(e.right,r);case"division":return Math.trunc(At(e.left,r)/At(e.right,r))}}async function sh(e,r,n){const i=e.startsWith("/"),o=e.split("/").filter(t=>t!==""),s=async t=>{try{return await n.list(t)}catch{return[]}};let c=[{path:i?"/":r,display:i?"/":""}];for(const[t,d]of o.entries()){const p=t===o.length-1,y=[];for(const m of c){if(d==="**"){const T=[m];for(;T.length>0;){const $=T.pop();y.push($);for(const N of await s($.path))N.directory&&T.push({path:et($.path,N.name),display:`${$.display}${N.name}/`})}continue}if(!ba(d)){const T=et(m.path,d);if(await n.stat(T)===void 0)continue;y.push({path:T,display:`${m.display}${d}${p?"":"/"}`});continue}const v=(0,wa.default)(d,{dot:d.startsWith(".")});for(const T of await s(m.path))v(T.name)&&(!p&&!T.directory||y.push({path:et(m.path,T.name),display:`${m.display}${T.name}${p?"":"/"}`}))}c=y}return[...new Set(c.map(t=>t.display.replace(/\/$/,"")))].filter(t=>t!=="").sort()}async function un(e,r){const n=[];let i;const o=c=>{i=(i??"")+c},s=c=>{const t=c.split(/\s+/);for(const[d,p]of t.entries())d>0&&(i!==void 0&&n.push(i),i=void 0),p!==""&&o(p)};for(const c of e.segments)switch(c.type){case"text":o(c.text);break;case"arithmetic":o(String(At(c.arithmetic,r.state)));break;case"variable":{const t=await oh(c,r);c.quoted?o(t):s(t);break}case"shell":{const t=await r.substitute(c.shell);c.quoted?o(t):s(t);break}case"glob":{const t=await sh(c.pattern,r.state.cwd,r.fs);if(t.length===0){o(c.pattern);break}for(const[d,p]of t.entries())d>0&&(n.push(i),i=void 0),o(p);break}}return i!==void 0&&n.push(i),n}async function oh(e,r){const n=mi(r.state,e.name),i=n!==void 0&&n!=="";return!i&&e.defaultValue!==void 0?await ma(e.defaultValue,r):i&&e.alternativeValue!==void 0?await ma(e.alternativeValue,r):n??""}async function ma(e,r){const n=[];for(const i of e)n.push(...await un(i,r));return n.join(" ")}function Ye(e,r){return et(e,r)}function gt(e,r,n){const i=n.code;return`${e}: ${r}: ${i==="ENOENT"?"No such file or directory":i==="ENOTDIR"?"Not a directory":i==="EISDIR"?"Is a directory":i==="ENOTEMPTY"?"Directory not empty":i==="EEXIST"?"File exists":n instanceof Error?n.message:String(n)}`}function rr(e,r,n){const i=e==="EACCES"?"permission denied":`${r} failed`,o=new Error(`${e}: ${i}, ${r} '${n}'`);return o.code=e,o.path=n,o.syscall=r,o}function ah(e){return{directory:e.isDirectory(),size:e.size,mtimeMs:e.mtimeMs}}function vr(){const e=()=>Kt(),r=n=>{try{return Promise.resolve(ah(e().statSync(n)))}catch{return Promise.resolve(void 0)}};return{stat:r,list:async n=>{const i=[...e().readdirSync(n)].sort(),o=[];for(const s of i)o.push({name:s,directory:(await r(et(n,s)))?.directory??!1});return o},readText:async n=>{if((await r(n))?.directory===!0)throw rr("EISDIR","read",n);return e().readFileSync(n,"utf8")},writeText:(n,i,o=!1)=>(o?e().appendFileSync(n,i):e().writeFileSync(n,i),Promise.resolve()),mkdir:(n,i)=>(e().mkdirSync(n,{recursive:i}),Promise.resolve()),remove:(n,i)=>(e().rmSync(n,i),Promise.resolve()),rename:(n,i)=>(e().renameSync(n,i),Promise.resolve())}}function Ke(e,r=new Set){const n=new Set,i=new Map,o=[],s=e.slice(1);let c=!1;for(let t=0;t<s.length;t+=1){const d=s[t];if(c||d==="-"||!d.startsWith("-")){o.push(d);continue}if(d==="--"){c=!0;continue}if(d.startsWith("--")){const[p,y]=lh(d.slice(2));n.add(p),y!==void 0&&i.set(p,y);continue}for(let p=1;p<d.length;p+=1){const y=d[p];if(n.add(y),!r.has(y))continue;const m=d.slice(p+1);m!==""?i.set(y,m):(t+=1,i.set(y,s[t]??""));break}}return{flags:n,values:i,operands:o}}function lh(e){const r=e.indexOf("=");return r<0?[e,void 0]:[e.slice(0,r),e.slice(r+1)]}function va(e,r,n){const i=e.values.get(r);if(i===void 0)return n;const o=Number.parseInt(i,10);return Number.isFinite(o)?o:n}function xt(e){if(e==="")return[];const r=e.split(`
|
|
16
|
+
`);return r[r.length-1]===""&&r.pop(),r}const ch=130,uh=async(e,r,n,i)=>{const o=e[1]??n.environment.HOME??"/",s=o==="-"?n.variables.OLDPWD??n.cwd:Ye(n.cwd,o),c=await i.stat(s);return c===void 0?(r.err(`cd: ${o}: No such file or directory
|
|
17
|
+
`),1):c.directory?(n.variables.OLDPWD=n.cwd,n.cwd=s,"PWD"in n.environment&&(n.environment.PWD=s),0):(r.err(`cd: ${o}: Not a directory
|
|
18
|
+
`),1)},fh=(e,r,n)=>(r.out(`${n.cwd}
|
|
19
|
+
`),0),dh=(e,r,n)=>{const i=Ke(e);if(i.operands.length===0){for(const[o,s]of Object.entries(n.environment).sort())r.out(`declare -x ${o}="${s}"
|
|
20
|
+
`);return 0}for(const o of i.operands){const s=o.indexOf("=");if(s<0){n.environment[o]=n.variables[o]??n.environment[o]??"";continue}n.environment[o.slice(0,s)]=o.slice(s+1)}return 0},hh=(e,r,n)=>{const i=new Set(e.slice(1)),o=s=>Object.fromEntries(Object.entries(s).filter(([c])=>!i.has(c)));return n.environment=o(n.environment),n.variables=o(n.variables),0},ph=(e,r,n)=>{for(const[i,o]of Object.entries(n.environment).sort())r.out(`${i}=${o}
|
|
21
|
+
`);return 0},yh=(e,r,n)=>{const i=e[1]===void 0?n.lastStatus:Number.parseInt(e[1],10)||0;return n.exitRequested=i,i},_a=async(e,r,n,i)=>{const o=e[0]==="["?e.slice(1,e[e.length-1]==="]"?-1:void 0):e.slice(1),s=t=>t?0:1,c=async t=>await i.stat(Ye(n.cwd,t));if(o.length===1)return s(o[0]!=="");if(o.length===2){const t=o[0],d=o[1]??"";switch(t){case"-e":return s(await c(d)!==void 0);case"-f":return s((await c(d))?.directory===!1);case"-d":return s((await c(d))?.directory===!0);case"-s":return s(((await c(d))?.size??0)>0);case"-r":case"-w":return s(await c(d)!==void 0);case"-z":return s(d==="");case"-n":return s(d!=="");case"!":return s(d==="");default:return r.err(`test: ${t}: unsupported unary operator
|
|
22
|
+
`),2}}if(o.length===3){const[t,d,p]=o;switch(d){case"=":case"==":return s(t===p);case"!=":return s(t!==p);case"-eq":return s(Number(t)===Number(p));case"-ne":return s(Number(t)!==Number(p));case"-lt":return s(Number(t)<Number(p));case"-le":return s(Number(t)<=Number(p));case"-gt":return s(Number(t)>Number(p));case"-ge":return s(Number(t)>=Number(p));default:return r.err(`test: ${d}: unsupported binary operator
|
|
23
|
+
`),2}}return r.err(`test: unsupported expression
|
|
24
|
+
`),2},gh={cd:uh,pwd:fh,export:dh,unset:hh,env:ph,printenv:(e,r,n)=>{const i=e[1];if(i===void 0){for(const[s,c]of Object.entries(n.environment).sort())r.out(`${s}=${c}
|
|
25
|
+
`);return 0}const o=mi(n,i);return o===void 0?1:(r.out(`${o}
|
|
26
|
+
`),0)},exit:yh,test:_a,"[":_a,sleep:async(e,r,n)=>{const i=Number.parseFloat(e[1]??"");return!Number.isFinite(i)||i<0?(r.err(`sleep: invalid time interval '${e[1]??""}'
|
|
27
|
+
`),2):await new Promise(o=>{const s=setTimeout(()=>{n.signal?.removeEventListener("abort",c),o(!1)},i*1e3);function c(){clearTimeout(s),o(!0)}n.signal?.aborted===!0?c():n.signal?.addEventListener("abort",c,{once:!0})})?ch:0},date:(e,r)=>(r.out(`${new Date().toISOString()}
|
|
28
|
+
`),0),seq:(e,r)=>{const n=e.slice(1).map(p=>Number.parseInt(p,10)),[i,o,s]=n,c=n.length>1?i:1,t=n.length>2?o:1,d=n.length>2?s:n.length>1?o:i;if(d===void 0||!Number.isFinite(d)||t===0)return r.err(`seq: expected numeric bounds
|
|
29
|
+
`),2;for(let p=c;t>0?p<=d:p>=d;p+=t)r.out(`${String(p)}
|
|
30
|
+
`);return 0},true:()=>0,false:()=>1,":":()=>0};function Sa(e,r){const n=String(e?.size??0).padStart(8),i=new Date(e?.mtimeMs??0).toISOString().replace("T"," ").slice(0,16);return`${e?.directory===!0?"drwxr-xr-x":"-rw-r--r--"} ${n} ${i} ${r}`}const wh=async(e,r,n,i)=>{const o=Ke(e),s=o.operands.length>0?o.operands:["."];let c=0;for(const[t,d]of s.entries()){const p=Ye(n.cwd,d),y=await i.stat(p);if(y===void 0){r.err(`ls: ${d}: No such file or directory
|
|
31
|
+
`),c=2;continue}if(s.length>1&&r.out(`${t>0?`
|
|
32
|
+
`:""}${d}:
|
|
33
|
+
`),!y.directory){r.out(`${o.flags.has("l")?Sa(y,d):d}
|
|
34
|
+
`);continue}const m=(await i.list(p)).filter(v=>o.flags.has("a")||!v.name.startsWith("."));for(const v of m){const T=o.flags.has("l")?Sa(await i.stat(et(p,v.name)),v.name):v.name;r.out(`${T}
|
|
35
|
+
`)}}return c},bh=async(e,r,n,i)=>{const o=[];let s,c,t=Number.POSITIVE_INFINITY;const d=e.slice(1);for(let v=0;v<d.length;v+=1){const T=d[v];if(T==="-name"){v+=1,s=d[v];continue}if(T==="-type"){v+=1,c=d[v];continue}if(T==="-maxdepth"){v+=1,t=Number.parseInt(d[v]??"",10);continue}if(T.startsWith("-"))return r.err(`find: unsupported predicate ${T}
|
|
36
|
+
`),2;o.push(T)}const p=s===void 0?void 0:(0,wa.default)(s,{dot:!0});let y=0;const m=async(v,T,$)=>{const N=await i.stat(v);if(N===void 0){r.err(`find: ${T}: No such file or directory
|
|
37
|
+
`),y=1;return}if((p===void 0||p(Or(T)))&&(c===void 0||c==="d"===N.directory)&&r.out(`${T}
|
|
38
|
+
`),!(!N.directory||$>=t))for(const P of await i.list(v))await m(et(v,P.name),`${T==="/"?"":T}/${P.name}`,$+1)};for(const v of o.length>0?o:["."])await m(Ye(n.cwd,v),v,0);return y},mh=async(e,r,n,i)=>{const o=Ke(e);let s=0;for(const c of o.operands)try{await i.mkdir(Ye(n.cwd,c),o.flags.has("p"))}catch(t){r.err(`${gt("mkdir",c,t)}
|
|
39
|
+
`),s=1}return s},vh=async(e,r,n,i)=>{const o=Ke(e);let s=0;for(const c of o.operands){const t=Ye(n.cwd,c);if((await i.list(t)).length>0){r.err(`rmdir: ${c}: Directory not empty
|
|
40
|
+
`),s=1;continue}try{await i.remove(t,{recursive:!0,force:!1})}catch(d){r.err(`${gt("rmdir",c,d)}
|
|
41
|
+
`),s=1}}return s},_h=async(e,r,n,i)=>{const o=Ke(e),s=o.flags.has("r")||o.flags.has("R"),c=o.flags.has("f");let t=0;for(const d of o.operands){const p=Ye(n.cwd,d),y=await i.stat(p);if(y===void 0){if(c)continue;r.err(`rm: ${d}: No such file or directory
|
|
42
|
+
`),t=1;continue}if(y.directory&&!s){r.err(`rm: ${d}: Is a directory
|
|
43
|
+
`),t=1;continue}try{await i.remove(p,{recursive:s,force:c})}catch(m){r.err(`${gt("rm",d,m)}
|
|
44
|
+
`),t=1}}return t};async function Ea(e,r,n){if((await n.stat(e))?.directory!==!0){await n.writeText(r,await n.readText(e));return}await n.mkdir(r,!0);for(const i of await n.list(e))await Ea(et(e,i.name),et(r,i.name),n)}async function Aa(e,r,n){return(await n.stat(e))?.directory===!0?et(e,Or(r)):e}const Sh=async(e,r,n,i)=>{const o=Ke(e),s=o.operands.slice(0,-1),c=o.operands[o.operands.length-1];if(c===void 0||s.length===0)return r.err(`cp: expected a source and a destination
|
|
45
|
+
`),2;const t=Ye(n.cwd,c);let d=0;for(const p of s){const y=Ye(n.cwd,p),m=await i.stat(y);if(m===void 0){r.err(`cp: ${p}: No such file or directory
|
|
46
|
+
`),d=1;continue}if(m.directory&&!(o.flags.has("r")||o.flags.has("R"))){r.err(`cp: ${p}: Is a directory
|
|
47
|
+
`),d=1;continue}try{await Ea(y,await Aa(t,p,i),i)}catch(v){r.err(`${gt("cp",p,v)}
|
|
48
|
+
`),d=1}}return d},Eh=async(e,r,n,i)=>{const o=Ke(e),s=o.operands.slice(0,-1),c=o.operands[o.operands.length-1];if(c===void 0||s.length===0)return r.err(`mv: expected a source and a destination
|
|
49
|
+
`),2;const t=Ye(n.cwd,c);let d=0;for(const p of s)try{await i.rename(Ye(n.cwd,p),await Aa(t,p,i))}catch(y){r.err(`${gt("mv",p,y)}
|
|
50
|
+
`),d=1}return d},Ah=async(e,r,n,i)=>{const o=Ke(e);let s=0;for(const c of o.operands){const t=Ye(n.cwd,c);try{await i.writeText(t,await i.stat(t)===void 0?"":await i.readText(t))}catch(d){r.err(`${gt("touch",c,d)}
|
|
51
|
+
`),s=1}}return s},xh=async(e,r,n,i)=>{const o=Ke(e);let s=0;for(const c of o.operands){const t=Ye(n.cwd,c),d=await i.stat(t);if(d===void 0){r.err(`stat: ${c}: No such file or directory
|
|
52
|
+
`),s=1;continue}r.out(`${t} ${d.directory?"directory":"file"} ${String(d.size)} ${new Date(d.mtimeMs).toISOString()}
|
|
53
|
+
`)}return s},$h=(e,r)=>{for(const n of e.slice(1))r.out(`${ze(n)}
|
|
54
|
+
`);return e.length>1?0:2},Rh=(e,r)=>{const[,n,i]=e;return n===void 0?(r.err(`basename: expected a path
|
|
55
|
+
`),2):(r.out(`${Or(n,i)}
|
|
56
|
+
`),0)},xa=e=>(r,n)=>(n.err(`${e}: not available in the worker host
|
|
57
|
+
`),127),Th={ls:wh,find:bh,mkdir:mh,rmdir:vh,rm:_h,cp:Sh,mv:Eh,touch:Ah,stat:xh,dirname:$h,basename:Rh,ln:xa("ln"),readlink:xa("readlink")};async function Nt(e,r,n,i,o){if(r.length===0)return{sources:[{name:"-",text:n.stdin}],status:0};const s=[];let c=0;for(const t of r){if(t==="-"){s.push({name:"-",text:n.stdin});continue}const d=Ye(i.cwd,t);try{s.push({name:t,text:await o.readText(d)})}catch(p){n.err(`${gt(e,t,p)}
|
|
58
|
+
`),c=1}}return{sources:s,status:c}}function vi(e){return e===""||e.endsWith(`
|
|
59
|
+
`)?e:`${e}
|
|
60
|
+
`}const Ih=(e,r)=>{const n=e[1]==="-n",i=e.slice(n?2:1);return r.out(`${i.join(" ")}${n?"":`
|
|
61
|
+
`}`),0},kh=(e,r)=>{const n=e[1]??"",i=e.slice(2);let o=0;const s=n.replace(/%[sdi%]/g,c=>{if(c==="%%")return"%";const t=i[o]??"";if(o+=1,c==="%s")return t;const d=Number.parseInt(t,10);return String(Number.isFinite(d)?d:0)});return r.out(s.replace(/\\n/g,`
|
|
62
|
+
`).replace(/\\t/g," ")),0},Lh=async(e,r,n,i)=>{const o=Ke(e),{sources:s,status:c}=await Nt("cat",o.operands,r,n,i);let t=1;for(const d of s){if(!o.flags.has("n")){r.out(d.text);continue}for(const p of xt(d.text))r.out(`${String(t).padStart(6)} ${p}
|
|
63
|
+
`),t+=1}return c},Ch=async(e,r,n,i)=>{const o=Ke(e,new Set(["n"])),s=va(o,"n",10),{sources:c,status:t}=await Nt("head",o.operands,r,n,i);for(const[d,p]of c.entries())c.length>1&&r.out(`${d>0?`
|
|
64
|
+
`:""}==> ${p.name} <==
|
|
65
|
+
`),r.out(vi(xt(p.text).slice(0,s).join(`
|
|
66
|
+
`)));return t},Mh=async(e,r,n,i)=>{const o=Ke(e,new Set(["n"])),s=va(o,"n",10),{sources:c,status:t}=await Nt("tail",o.operands,r,n,i);for(const[d,p]of c.entries())c.length>1&&r.out(`${d>0?`
|
|
67
|
+
`:""}==> ${p.name} <==
|
|
68
|
+
`),r.out(vi(xt(p.text).slice(-s).join(`
|
|
69
|
+
`)));return t},Oh=async(e,r,n,i)=>{const o=Ke(e),{sources:s,status:c}=await Nt("wc",o.operands,r,n,i),t=["l","w","c"].filter(p=>o.flags.has(p)),d=t.length>0?t:["l","w","c"];for(const p of s){const y={l:xt(p.text).length,w:p.text.split(/\s+/).filter(v=>v!=="").length,c:p.text.length},m=d.map(v=>String(y[v]??0).padStart(d.length>1?8:1));r.out(`${m.join(" ")}${p.name==="-"?"":` ${p.name}`}
|
|
70
|
+
`)}return c};async function $a(e,r,n,i){for(const o of await i.list(e)){const s=`${e.endsWith("/")?e:`${e}/`}${o.name}`,c=`${r.endsWith("/")?r:`${r}/`}${o.name}`;o.directory?await $a(s,c,n,i):n.push({path:s,display:c})}}const Nh=async(e,r,n,i)=>{const o=Ke(e,new Set(["e"])),s=o.values.get("e")??o.operands[0],c=o.values.get("e")===void 0?o.operands.slice(1):o.operands;if(s===void 0)return r.err(`grep: no pattern given
|
|
71
|
+
`),2;const t=o.flags.has("F")?s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):s;let d;try{d=new RegExp(t,o.flags.has("i")?"i":"")}catch(T){return r.err(`grep: invalid pattern: ${T instanceof Error?T.message:String(T)}
|
|
72
|
+
`),2}const p=[];let y=0;if(c.length===0)p.push({name:"",text:r.stdin});else for(const T of c){const $=Ye(n.cwd,T);if((await i.stat($))?.directory===!0){if(!o.flags.has("r")&&!o.flags.has("R")){r.err(`grep: ${T}: Is a directory
|
|
73
|
+
`),y=Math.max(y,2);continue}const N=[];await $a($,T,N,i);for(const P of N)p.push({name:P.display,text:await i.readText(P.path)});continue}try{p.push({name:T,text:await i.readText($)})}catch(N){r.err(`${gt("grep",T,N)}
|
|
74
|
+
`),y=Math.max(y,2)}}const m=p.length>1||o.flags.has("H");let v=!1;for(const T of p){const $=xt(T.text).map((N,P)=>({text:N,number:P+1})).filter(N=>d.test(N.text)!==o.flags.has("v"));if($.length>0&&(v=!0),o.flags.has("l")){$.length>0&&r.out(`${T.name}
|
|
75
|
+
`);continue}if(o.flags.has("c")){r.out(`${m&&T.name!==""?`${T.name}:`:""}${String($.length)}
|
|
76
|
+
`);continue}for(const N of $){const P=`${m&&T.name!==""?`${T.name}:`:""}${o.flags.has("n")?`${String(N.number)}:`:""}`;r.out(`${P}${N.text}
|
|
77
|
+
`)}}return y!==0?y:v?0:1},Dh=async(e,r,n,i)=>{const o=Ke(e),{sources:s,status:c}=await Nt("sort",o.operands,r,n,i);let t=s.flatMap(d=>xt(d.text));return t=o.flags.has("n")?[...t].sort((d,p)=>(Number.parseFloat(d)||0)-(Number.parseFloat(p)||0)):[...t].sort((d,p)=>d<p?-1:d>p?1:0),o.flags.has("r")&&t.reverse(),o.flags.has("u")&&(t=[...new Set(t)]),r.out(vi(t.join(`
|
|
78
|
+
`))),c},Ph=async(e,r,n,i)=>{const o=Ke(e),{sources:s,status:c}=await Nt("uniq",o.operands,r,n,i),t=s.flatMap(y=>xt(y.text)),d=[];for(const y of t){const m=d[d.length-1];m!==void 0&&m.text===y?m.count+=1:d.push({text:y,count:1})}const p=o.flags.has("d")?d.filter(y=>y.count>1):o.flags.has("u")?d.filter(y=>y.count===1):d;for(const y of p)r.out(`${o.flags.has("c")?`${String(y.count).padStart(7)} `:""}${y.text}
|
|
79
|
+
`);return c},Bh=async(e,r,n,i)=>{const o=Ke(e,new Set(["d","f","c"])),s=o.values.get("d")??" ",c=(o.values.get("f")??"").split(",").map(y=>Number.parseInt(y,10)).filter(Number.isFinite),t=o.values.get("c"),{sources:d,status:p}=await Nt("cut",o.operands,r,n,i);if(c.length===0&&t===void 0)return r.err(`cut: expected -f or -c
|
|
80
|
+
`),2;for(const y of d)for(const m of xt(y.text)){if(t!==void 0){const[T,$]=t.split("-"),N=Number.parseInt(T??"1",10)||1,P=$===void 0||$===""?N:Number.parseInt($,10);r.out(`${m.slice(N-1,P)}
|
|
81
|
+
`);continue}const v=m.split(s);r.out(`${c.map(T=>v[T-1]??"").join(s)}
|
|
82
|
+
`)}return p};function Ra(e){const r=[...e],n=[];for(let i=0;i<r.length;i+=1){const o=r[i],s=r[i+2];if(r[i+1]==="-"&&s!==void 0){for(let c=o.codePointAt(0);c<=s.codePointAt(0);c+=1)n.push(String.fromCodePoint(c));i+=2;continue}n.push(o)}return n}const Fh={echo:Ih,printf:kh,cat:Lh,head:Ch,tail:Mh,wc:Oh,grep:Nh,sort:Dh,uniq:Ph,cut:Bh,tr:(e,r)=>{const n=Ke(e),[i,o]=n.operands,s=i===void 0?void 0:Ra(i).join(""),c=o===void 0?void 0:Ra(o).join("");return s===void 0?(r.err(`tr: expected a source set
|
|
83
|
+
`),2):n.flags.has("d")?(r.out([...r.stdin].filter(t=>!s.includes(t)).join("")),0):c===void 0?(r.err(`tr: expected a replacement set
|
|
84
|
+
`),2):(r.out([...r.stdin].map(t=>{const d=s.indexOf(t);return d<0?t:c[Math.min(d,c.length-1)]}).join("")),0)},sed:async(e,r,n,i)=>{const o=Ke(e,new Set(["e"])),s=o.values.get("e")??o.operands[0],c=o.values.get("e")===void 0?o.operands.slice(1):o.operands,t=/^s(.)(.*?[^\\])?\1(.*?)\1([gi]*)$/.exec(s??"");if(t===null)return r.err(`sed: only substitution scripts (s/pattern/replacement/) run in the worker host
|
|
85
|
+
`),2;const[,,d="",p="",y=""]=t;let m;try{m=new RegExp(d,y.includes("g")?`g${y.replace("g","")}`:y)}catch($){return r.err(`sed: invalid pattern: ${$ instanceof Error?$.message:String($)}
|
|
86
|
+
`),2}const{sources:v,status:T}=await Nt("sed",c,r,n,i);for(const $ of v)for(const N of xt($.text))r.out(`${N.replace(m,p.replace(/\\(\d)/g,"$$$1"))}
|
|
87
|
+
`);return T},tee:async(e,r,n,i)=>{const o=Ke(e);r.out(r.stdin);for(const s of o.operands)try{await i.writeText(Ye(n.cwd,s),r.stdin,o.flags.has("a"))}catch(c){return r.err(`${gt("tee",s,c)}
|
|
88
|
+
`),1}return 0}};let Ta;function _r(){return Ta??=new Map([...Object.entries(gh),...Object.entries(Th),...Object.entries(Fh),["which",Uh]]),Ta}const Uh=(e,r)=>{const n=_r();let i=0;for(const o of e.slice(1)){if(n.has(o)){r.out(`${o}: shell built-in command
|
|
89
|
+
`);continue}r.err(`which: no ${o} in the worker host command table
|
|
90
|
+
`),i=1}return i},_i=130,Ia=127,ka=16;function fn(){const e=[];return{write:r=>{e.push(r)},text:()=>e.join("")}}async function La(e,r){const n=Ma(r);let i;try{i=(0,nh.parseShell)(e,{isGlobPattern:ba})}catch(s){return n.io.err(`bash: syntax error: ${s instanceof Error?s.message.split(`
|
|
91
|
+
`)[0]:String(s)}
|
|
92
|
+
`),n.settle(2)}const o=new Wh(_r(),r.fs??vr(),r.signal);return n.settle(await o.line(i,n.state,n.io))}async function Ca(e,r){const n=Ma(r),i=e[0],o=i===void 0?void 0:_r().get(i);if(i===void 0||o===void 0)return n.io.err(`bash: ${i??""}: command not found
|
|
93
|
+
`),n.settle(Ia);if(r.signal?.aborted===!0)return n.settle(_i);try{return n.settle(await o(e,n.io,n.state,r.fs??vr()))}catch(s){return n.io.err(`bash: ${i}: ${s instanceof Error?s.message:String(s)}
|
|
94
|
+
`),n.settle(1)}}function Ma(e){const r=fn(),n=fn(),i=e.onOutput;return{state:{cwd:e.cwd,environment:{...e.env},variables:{},lastStatus:0,exitRequested:void 0,signal:e.signal},io:{stdin:e.stdin??"",out:o=>{r.write(o),i?.("stdout",o)},err:o=>{n.write(o),i?.("stderr",o)}},settle:o=>({exitCode:o,stdout:r.text(),stderr:n.text()})}}var Wh=class Gc{programs;fs;signal;depth;constructor(r,n,i,o=0){this.programs=r,this.fs=n,this.signal=i,this.depth=o}async line(r,n,i){let o=n.lastStatus;for(const s of r){if(this.signal?.aborted===!0)return _i;if(o=await this.commandLine(s.command,n,i),n.lastStatus=o,n.exitRequested!==void 0)return n.exitRequested}return o}async commandLine(r,n,i){const o=[];for(let c=r.then;c!==void 0;c=c.line.then)o.push({type:c.type,chain:c.line.chain});let s=await this.pipeline(r.chain,n,i);n.lastStatus=s;for(const c of o){if(n.exitRequested!==void 0)return s;(c.type==="&&"?s!==0:s===0)||(s=await this.pipeline(c.chain,n,i),n.lastStatus=s)}return s}async pipeline(r,n,i){const o=[];for(let t=r;t!==void 0;){const d=t.then;o.push({command:t,mergesStderr:d?.type==="|&"}),t=d?.chain}let s=i.stdin,c=0;for(const[t,d]of o.entries()){if(this.signal?.aborted===!0)return _i;const p=t===o.length-1,y=fn(),m=p?{stdin:s,out:i.out,err:i.err}:{stdin:s,out:y.write,err:d.mergesStderr?y.write:i.err};if(c=await this.command(d.command,n,m),p||(s=y.text()),n.exitRequested!==void 0)return c}return c}async command(r,n,i){switch(r.type){case"envs":for(const o of r.envs)Oa(n,o.name,await this.assignedValue(o.args[0],n));return 0;case"subshell":{const o={...n,environment:{...n.environment},variables:{...n.variables}};return await this.redirected(r.args,n,i,async s=>await this.line(r.subshell,o,s))}case"group":return await this.redirected(r.args,n,i,async o=>await this.line(r.group,n,o));case"command":return await this.program(r,n,i)}}async program(r,n,i){const o=[],s=[];for(const y of r.args){if(y.type==="redirection"){s.push(y);continue}o.push(...await un(y,this.context(n)))}const c={};for(const y of r.envs)c[y.name]=await this.assignedValue(y.args[0],n);if(o.length===0){for(const[y,m]of Object.entries(c))Oa(n,y,m);return 0}const t=Object.keys(c).length===0?n:{...n,environment:{...n.environment,...c}},d=o[0],p=this.programs.get(d);return p===void 0?(i.err(`bash: ${d}: command not found
|
|
95
|
+
`),Ia):await this.redirected(s,n,i,async y=>{try{return await p(o,y,t,this.fs)}catch(m){return y.err(`bash: ${d}: ${m instanceof Error?m.message:String(m)}
|
|
96
|
+
`),1}})}async redirected(r,n,i,o){let s=i.stdin,c=i.out,t=i.err;const d=[];for(const y of r){const m=[];for(const T of y.args)m.push(...await un(T,this.context(n)));const v=m[0];if(v===void 0||m.length>1)return i.err(`bash: ambiguous redirect
|
|
97
|
+
`),1;try{switch(y.subtype){case"<":s=await this.fs.readText(Ye(n.cwd,v));break;case"<<<":s=`${v}
|
|
98
|
+
`;break;case">":case">>":{const T=Ye(n.cwd,v);y.subtype===">"&&await this.fs.writeText(T,"");let $=Promise.resolve();const N=P=>{$=$.then(async()=>{await this.fs.writeText(T,P,!0)}),d.push($)};y.fd===2?t=N:c=N;break}case">&":if(y.fd===2&&v==="1")t=c;else if((y.fd===null||y.fd===1)&&v==="2")c=t;else return i.err(`bash: ${String(y.fd??1)}>&${v}: unsupported descriptor redirection
|
|
99
|
+
`),1;break;case"<&":return i.err(`bash: <&${v}: unsupported descriptor redirection
|
|
100
|
+
`),1}}catch(T){return i.err(`${gt("bash",Ye(n.cwd,v),T)}
|
|
101
|
+
`),1}}const p=await o({stdin:s,out:c,err:t});return await Promise.all(d),p}context(r){return{state:r,fs:this.fs,substitute:async n=>{if(this.depth>=ka)throw new Error(`command substitution nested deeper than ${String(ka)} levels`);const i=fn(),o={...r,environment:{...r.environment},variables:{...r.variables}};return await new Gc(this.programs,this.fs,this.signal,this.depth+1).line(n,o,{stdin:"",out:i.write,err:()=>{}}),i.text().replace(/\n+$/,"")}}}async assignedValue(r,n){return r===void 0?"":(await un(r,this.context(n))).join(" ")}};function Oa(e,r,n){r in e.environment?e.environment[r]=n:e.variables[r]=n}function Hh(e,r){const n=new Map,i=new AbortController;let o=0;r.addEventListener("message",t=>{const d=t.data;if(d.t==="shell-signal"){i.abort(new Error("killed by signal"));return}if(d.t!=="fs-reply")return;const p=n.get(d.id);p!==void 0&&(n.delete(d.id),d.failure===void 0?p.settle(d.value):p.fail(rr(d.failure.code??"EIO","fs",d.failure.message)))});const s=async(t,d)=>{o+=1;const p=o,y=new Promise((m,v)=>{n.set(p,{settle:m,fail:v})});return r.postMessage({t:"fs-call",id:p,op:t,args:d}),await y},c={cwd:e.cwd,env:e.env,stdin:e.stdin,signal:i.signal,fs:{stat:async t=>await s("stat",[t]),list:async t=>await s("list",[t]),readText:async t=>await s("readText",[t]),writeText:async(t,d,p=!1)=>{await s("writeText",[t,d,p])},mkdir:async(t,d)=>{await s("mkdir",[t,d])},remove:async(t,d)=>{await s("remove",[t,d])},rename:async(t,d)=>{await s("rename",[t,d])}},onOutput:(t,d)=>{r.postMessage({t:"shell-out",stream:t,text:d})}};(e.script===void 0?Ca(e.argv,c):La(e.script,c)).then(t=>{r.postMessage({t:"shell-exit",code:t.exitCode}),r.close()},t=>{r.postMessage({t:"shell-out",stream:"stderr",text:`bash: ${String(t)}
|
|
102
|
+
`}),r.postMessage({t:"shell-exit",code:1}),r.close()})}function jh(){return typeof Worker=="function"&&typeof self<"u"&&typeof self.location.href=="string"}function qh(e){return jh()?zh(e):Vh(e)}async function Gh(e,r,n){switch(r){case"stat":return await e.stat(n[0]);case"list":return await e.list(n[0]);case"readText":return await e.readText(n[0]);case"writeText":await e.writeText(n[0],n[1],n[2]);return;case"mkdir":await e.mkdir(n[0],n[1]);return;case"remove":await e.remove(n[0],n[1]);return;case"rename":await e.rename(n[0],n[1]);return;default:throw new Error(`webworker shell: unknown filesystem op ${String(r)}`)}}function zh(e){const r=e.fs??vr(),n=new Worker(self.location.href,{type:"module"});let i=!1;const o=c=>{i||(i=!0,n.terminate(),e.onExit(c))};n.addEventListener("message",c=>{const t=c.data;if(t.t==="shell-out"){e.onOutput(t.stream,t.text);return}if(t.t==="shell-exit"){o(t.code);return}Gh(r,t.op,t.args).then(d=>{n.postMessage({t:"fs-reply",id:t.id,value:d})},d=>{const p={code:d.code,message:d instanceof Error?d.message:String(d)};n.postMessage({t:"fs-reply",id:t.id,failure:p})})}),n.addEventListener("error",c=>{e.onOutput("stderr",`bash: process worker failed: ${c.message}
|
|
103
|
+
`),o(1)});const s={t:"shell-start",script:e.script,argv:e.argv,cwd:e.cwd,env:e.env,stdin:e.stdin};return n.postMessage(s),{interrupt:()=>{i||n.postMessage({t:"shell-signal"})},destroy:()=>{o(130)}}}function Vh(e){const r=new AbortController,n={cwd:e.cwd,env:e.env,stdin:e.stdin,signal:r.signal,fs:e.fs??vr(),onOutput:e.onOutput};(e.script===void 0?Ca(e.argv,n):La(e.script,n)).then(o=>{e.onExit(o.exitCode)},o=>{e.onOutput("stderr",`bash: ${String(o)}
|
|
104
|
+
`),e.onExit(1)});const i=()=>{r.abort(new Error("killed by signal"))};return{interrupt:i,destroy:i}}var Dt=class extends Error{};function Na(e){const r=[],n=[];for(let i=0;i<e.length;){const o=e[i];if(o==="--probe"){if(e.length!==1)throw new Dt("usage error: --probe takes no other arguments");return{kind:"probe"}}if(o==="--ro"||o==="--rw"){const s=e[i+1];if(s===void 0)throw new Dt(`usage error: ${o} requires a path`);(o==="--ro"?r:n).push(s),i+=2;continue}if(o==="--"){const s=e.slice(i+1);if(s.length===0)throw new Dt("usage error: missing `-- <argv>...` command");return{kind:"run",readOnly:r,readWrite:n,argv:s}}throw new Dt(`usage error: unknown argument: ${o}`)}throw new Dt("usage error: missing `-- <argv>...` command")}function Da(e,r){const n=et(r,e),i=n.length>1?n.replace(/\/+$/u,""):n;return i==="/tmp"?jn:i.startsWith("/tmp/")?`${jn}${i.slice(4)}`:i}function Pa(e,r){return e==="/"||r===e||r.startsWith(`${e}/`)}function dn(e,r){throw rr("EACCES",e,r)}const Kh={directory:!1,size:0,mtimeMs:0},Si="/dev",ft="/dev/null";function hn(e,r="",n=""){return{kind:"exit",exitCode:e,stdout:r,stderr:n}}function Ba(e){return hn(125,"",`landlock-run: ${e instanceof Dt?e.message:String(e)}
|
|
105
|
+
`)}async function Xh(e,r,n){const i=async y=>{if(y==="")throw new Dt("cannot open rule path: : No such file or directory");const m=Da(y,n);if(m!==Si&&m!==ft&&await e.stat(m)===void 0)throw new Dt(`cannot open rule path: ${y}: No such file or directory`);return m},o=await Promise.all(r.readOnly.map(i)),s=await Promise.all(r.readWrite.map(i)),c=[...o,...s],t=(y,m)=>{const v=Da(y,n);if(v.startsWith(`${ft}/`))throw rr("ENOTDIR",m,y);return v},d=(y,m)=>{const v=t(y,m);return c.some(T=>Pa(T,v))||dn(m,y),v},p=(y,m)=>{const v=t(y,m);return s.some(T=>Pa(T,v))||dn(m,y),v};return{stat:async y=>{const m=d(y,"stat");return m===ft?Kh:m===Si&&!await e.stat(m)?{directory:!0,size:0,mtimeMs:0}:await e.stat(m)},list:async y=>{const m=d(y,"scandir");if(m===Si)return[{name:"null",directory:!1}];if(m===ft)throw rr("ENOTDIR","scandir",y);return await e.list(m)},readText:async y=>{const m=d(y,"open");return m===ft?"":await e.readText(m)},writeText:async(y,m,v=!1)=>{const T=p(y,"open");T!==ft&&await e.writeText(T,m,v)},mkdir:async(y,m)=>{const v=p(y,"mkdir");if(v===ft)throw rr("EEXIST","mkdir",y);await e.mkdir(v,m)},remove:async(y,m)=>{const v=p(y,"rm");v===ft&&dn("rm",y),await e.remove(v,m)},rename:async(y,m)=>{const v=p(y,"rename"),T=p(m,"rename");(v===ft||T===ft)&&dn("rename",v===ft?y:m),await e.rename(v,T)}}}const Fa={name:"landlock-run",async prepare(e,r){try{const n=Na(e);return n.kind==="probe"?hn(0,`landlock: fully enforced
|
|
106
|
+
`):{kind:"delegate",argv:n.argv,filesystem:await Xh(r.filesystem,n,r.cwd),missingExecutable:hn(125,"",`landlock-run: exec failed: No such file or directory
|
|
107
|
+
`)}}catch(n){return Ba(n)}},runSync(e){try{return Na(e).kind==="probe"?hn(0,`landlock: fully enforced
|
|
108
|
+
`):{kind:"asynchronous"}}catch(r){return Ba(r)}}},Yh=new Map([[Fa.name,Fa]]);function Ua(e){return Yh.get(Or(e))}var Qh=We({WorkerChildProcess:()=>Ha,__esModule:()=>!0,default:()=>rp,exec:()=>za,execFile:()=>Va,execFileSync:()=>Ya,execSync:()=>Xa,fork:()=>Qa,spawn:()=>Ei,spawnSync:()=>qa});const Sr="node:child_process";var Wa=class extends Ft{destroyed=!1;setEncoding(){return this}pause(){return this}resume(){return this}push(e){this.destroyed||e===""||this.emit("data",tt.Buffer.from(e,"utf8"))}finish(){this.destroyed||this.emit("end")}destroy(){this.destroyed=!0,this.emit("close")}},Zh=class extends Ft{text="";write(e){return this.text+=typeof e=="string"?e:tt.Buffer.from(e).toString("utf8"),!0}end(e){e!==void 0&&this.write(e),this.emit("finish")}contents(){return this.text}},Ha=class extends Ft{pid;stdin;stdout;stderr;exitCode=null;signalCode=null;constructor(e,r){super(),this.pid=e,this.stdin=r[0]==="pipe"?new Zh:null,this.stdout=r[1]==="pipe"?new Wa:null,this.stderr=r[2]==="pipe"?new Wa:null}kill(e="SIGTERM"){return Yi(this.pid,e)}};function Jh(e){return typeof e=="string"?[e,e,e]:e===void 0?["pipe","pipe","pipe"]:[e[0]??"pipe",e[1]??"pipe",e[2]??"pipe"]}function ep(e){return Object.fromEntries(Object.entries(e??(zc??{})).filter(([,n])=>n!==void 0))}function ja(e){const r=new Error(`spawn ${e} ENOENT`);return r.code="ENOENT",r.errno=-2,r.path=e,r.syscall=`spawn ${e}`,r}function tp(e){const[r,n,i]=e;if(!(r!=="bash"&&r!=="sh"||n!=="-c"))return i??""}function Ei(e,r=[],n={}){if(typeof e!="string"||e===""){const m=new TypeError(`The "file" argument must be a non-empty string. Received ${e}`);throw m.code="ERR_INVALID_ARG_TYPE",m}const i=[e,...r],o=Jh(n.stdio),s=cu(),c=new Ha(s.pid,o),t=(m,v)=>{if(v==="")return;const T=m==="stdout"?c.stdout:c.stderr;if(T!==null){T.push(v);return}o[m==="stdout"?1:2]==="inherit"&&(m==="stdout"?console.log:console.error)(v.replace(/\n$/,""))};let d=!1;const p=m=>{if(d)return;d=!0,Xi(s.pid);const v=s.signal??null;c.exitCode=v===null?m:null,c.signalCode=v,c.stdout?.finish(),c.stderr?.finish(),c.emit("exit",c.exitCode,v),c.emit("close",c.exitCode,v)},y=m=>{d||(d=!0,Xi(s.pid),c.emit("error",m))};return queueMicrotask(()=>{(async()=>{const m=n.cwd??"/dsh";let v=i,T,$;const N=Ua(e);if(N!==void 0){const _=await N.prepare(r,{cwd:m,filesystem:vr()});if(_.kind==="exit"){t("stdout",_.stdout),t("stderr",_.stderr),p(_.exitCode);return}v=_.argv,T=_.filesystem,$=_.missingExecutable}const P=v[0],q=tp(v);if(!(q!==void 0||_r().has(P))){$!==void 0?(t("stdout",$.stdout),t("stderr",$.stderr),p($.exitCode)):y(ja(e));return}s.process=qh({script:q,argv:v,cwd:m,env:ep(n.env),stdin:c.stdin?.contents()??"",onOutput:t,onExit:p,...T===void 0?{}:{fs:T}}),s.signal!==void 0&&(s.signal==="SIGKILL"?s.process.destroy():s.process.interrupt())})().catch(m=>{y(m instanceof Error?m:new Error(String(m)))})}),c}function qa(e,r=[]){const n=tt.Buffer.alloc(0),i=Ua(e);if(i!==void 0){const s=i.runSync(r);if(s.kind==="asynchronous"){const d=new Error(`${Sr}.spawnSync cannot run ${e} in the worker host: commands run asynchronously`);return{pid:-1,status:null,signal:null,stdout:n,stderr:n,output:[null,n,n],error:d}}const c=tt.Buffer.from(s.stdout),t=tt.Buffer.from(s.stderr);return{pid:-1,status:s.exitCode,signal:null,stdout:c,stderr:t,output:[null,c,t]}}const o=_r().has(e)?new Error(`${Sr}.spawnSync cannot run ${e} in the worker host: commands run asynchronously`):ja(e);return{pid:-1,status:null,signal:null,stdout:n,stderr:n,output:[null,n,n],error:o}}function Ga(e,r){return typeof e=="function"?{options:{},callback:e}:{options:e??{},callback:r}}function za(e,r,n){const i=Ga(r,n);return Ka(["bash","-c",e],i.options,i.callback)}function Va(e,r,n,i){const o=Array.isArray(r)?[e,...r]:[e],s=Ga(Array.isArray(r)?n:r,typeof n=="function"?n:i);return Ka(o,s.options,s.callback)}function Ka(e,r,n){const i=Ei(e[0],e.slice(1),{...r,stdio:"pipe"});let o="",s="";return i.stdout?.on("data",c=>{o+=String(c)}),i.stderr?.on("data",c=>{s+=String(c)}),i.on("error",c=>{n?.(c instanceof Error?c:new Error(String(c)),o,s)}),i.on("close",c=>{n?.((typeof c=="number"?c:1)===0?null:new Error(`Command failed: ${e.join(" ")}`),o,s)}),i}const Xa=Ce(Sr,"execSync"),Ya=Ce(Sr,"execFileSync"),Qa=Ce(Sr,"fork");var rp={spawn:Ei,spawnSync:qa,exec:za,execFile:Va,execFileSync:Ya,execSync:Xa,fork:Qa},np=We({Socket:()=>Za,__esModule:()=>!0,connect:()=>tl,createServer:()=>el,default:()=>op,isIP:()=>Ja,isIPv4:()=>Ai,isIPv6:()=>xi});const ip=/^(\d{1,3}\.){3}\d{1,3}$/,sp=/^[0-9a-f:]+$/i;var Za=class{write(){throw new Error("web-preview: node:net Socket.write is not available in the worker host")}end(){throw new Error("web-preview: node:net Socket.end is not available in the worker host")}destroy(){}};function Ai(e){return ip.test(e)&&e.split(".").every(r=>Number(r)<=255)}function xi(e){return e.includes(":")&&sp.test(e)}function Ja(e){return Ai(e)?4:xi(e)?6:0}function el(){throw new Error("web-preview: node:net.createServer is not available in the worker host")}function tl(){throw new Error("web-preview: node:net.connect is not available in the worker host")}var op={Socket:Za,isIP:Ja,isIPv4:Ai,isIPv6:xi,createServer:el,connect:tl},ap=We({DatabaseSync:()=>rl,StatementSync:()=>nl,__esModule:()=>!0,backup:()=>il,default:()=>lp});const $i="node:sqlite",rl=Ce($i,"DatabaseSync"),nl=Ce($i,"StatementSync");function il(){throw us($i,"backup")}var lp={DatabaseSync:rl,StatementSync:nl,backup:il},cp=We({Script:()=>sl,__esModule:()=>!0,createContext:()=>ol,default:()=>up,isContext:()=>ul,runInContext:()=>al,runInNewContext:()=>ll,runInThisContext:()=>cl});const nr="node:vm",sl=Ce(nr,"Script"),ol=Ce(nr,"createContext"),al=Ce(nr,"runInContext"),ll=Ce(nr,"runInNewContext"),cl=Ce(nr,"runInThisContext"),ul=Ce(nr,"isContext");var up={Script:sl,createContext:ol,runInContext:al,runInNewContext:ll,runInThisContext:cl,isContext:ul},fp=We({MessageChannel:()=>dl,MessagePort:()=>hl,Worker:()=>fl,__esModule:()=>!0,default:()=>dp,isMainThread:()=>!0,markAsUntransferable:()=>pl,parentPort:()=>null,receiveMessageOnPort:()=>yl,threadId:()=>0,workerData:()=>{}});const Er="node:worker_threads",fl=Ce(Er,"Worker"),dl=Ce(Er,"MessageChannel"),hl=Ce(Er,"MessagePort"),pl=Ce(Er,"markAsUntransferable"),yl=Ce(Er,"receiveMessageOnPort");var dp={Worker:fl,isMainThread:!0,threadId:0,parentPort:null,workerData:void 0,MessageChannel:dl,MessagePort:hl,markAsUntransferable:pl,receiveMessageOnPort:yl},hp=We({__esModule:()=>!0,default:()=>pp,tryLockExclusive:()=>gl});function gl(e){return Promise.resolve()}var pp={tryLockExclusive:gl},yp=We({__esModule:()=>!0,array:()=>vl,default:()=>wp,opaque:()=>_l,pointer:()=>bl,struct:()=>ml,types:()=>Sl});const $t="koffi",wl={void:0,bool:1,char:1,uchar:1,int8:1,uint8:1,short:2,ushort:2,int16:2,uint16:2,int:4,uint:4,int32:4,uint32:4,float:4,float32:4,long:8,ulong:8,longlong:8,ulonglong:8,int64:8,uint64:8,double:8,float64:8,str:8,str16:8},ir=(e,r,n=Math.min(r,8)||1)=>({__dshKoffiType:e,size:r,alignment:n}),sr=e=>{if(typeof e=="string"){const n=wl[e];if(n===void 0)throw new Error(`web-preview: koffi type "${e}" is unknown to the stub`);return ir(e,n)}const r=e;if(r?.__dshKoffiType===void 0)throw new Error(`web-preview: koffi type ${JSON.stringify(e)} is not a stub descriptor`);return r},gp=e=>typeof e=="string"?e:e?.__dshKoffiType??"anonymous";function bl(e){return ir(`pointer(${gp(e)})`,8)}function ml(e,r){const n=(typeof e=="string"?r:e)??{};let i=0,o=1;for(const c of Object.values(n)){const t=sr(c);o=Math.max(o,t.alignment),i=Math.ceil(i/t.alignment)*t.alignment+t.size}const s=Math.ceil(i/o)*o;return ir(`struct(${typeof e=="string"?e:"anonymous"})`,s,o)}function vl(e,r){const n=sr(e);return ir(`array(${n.__dshKoffiType}, ${String(r)})`,n.size*r,n.alignment)}function _l(e){return ir(`opaque(${e??"anonymous"})`,0,1)}const Sl=new Proxy({},{get:(e,r)=>sr(String(r)),has:e=>typeof e=="string"&&e in wl}),wp={pointer:bl,struct:ml,array:vl,opaque:_l,types:Sl,alias:(e,r)=>{const n=sr(r);return ir(`alias(${e})`,n.size,n.alignment)},sizeof:e=>sr(e).size,alignof:e=>sr(e).alignment,load:Ce($t,"load"),alloc:Ce($t,"alloc"),free:Ce($t,"free"),decode:Ce($t,"decode"),encode:Ce($t,"encode"),address:Ce($t,"address"),register:Ce($t,"register"),unregister:Ce($t,"unregister"),call:Ce($t,"call")};var bp=We({__esModule:()=>!0,default:()=>mp,open:()=>xl,spawn:()=>Al});const El="node-pty",Al=Ce(El,"spawn"),xl=Ce(El,"open");var mp={spawn:Al,open:xl},$l=We({__esModule:()=>!0,anthropicMessagesApi:()=>Nl,builtinProviders:()=>Cl,createModels:()=>Tl,createProvider:()=>Rl,default:()=>vp,getBuiltinModels:()=>Ol,getBuiltinProviders:()=>Ml,getSupportedThinkingLevels:()=>Il,isContextOverflow:()=>kl,openAICompletionsApi:()=>Dl,openAIResponsesApi:()=>Pl});const qt="@earendil-works/pi-ai",Rl=Ce(qt,"createProvider"),Tl=Ce(qt,"createModels"),Il=Ce(qt,"getSupportedThinkingLevels"),kl=Ce(qt,"isContextOverflow"),Ll=["amazon-bedrock","ant-ling","anthropic","azure-openai-responses","baseten","cerebras","cloudflare-ai-gateway","cloudflare-workers-ai","deepseek","fireworks","github-copilot","google","google-vertex","groq","huggingface","kimi-coding","minimax","minimax-cn","mistral","moonshotai","moonshotai-cn","nvidia","openai","openai-codex","opencode","opencode-go","openrouter","qwen-token-plan","qwen-token-plan-cn","qwen-token-plan-individual","together","vercel-ai-gateway","xai","xiaomi","xiaomi-token-plan-ams","xiaomi-token-plan-cn","xiaomi-token-plan-sgp","zai","zai-coding-cn"];function Cl(){return Ll.map(e=>({id:e,name:e,auth:{apiKey:{type:"api-key"}},models:[]}))}function Ml(){return[...Ll]}function Ol(){return[]}const Nl=Ce(qt,"anthropicMessagesApi"),Dl=Ce(qt,"openAICompletionsApi"),Pl=Ce(qt,"openAIResponsesApi");var vp={createProvider:Rl,createModels:Tl,getSupportedThinkingLevels:Il,isContextOverflow:kl,builtinProviders:Cl,getBuiltinModels:Ol,getBuiltinProviders:Ml,anthropicMessagesApi:Nl,openAICompletionsApi:Dl,openAIResponsesApi:Pl},_p=We({__esModule:()=>!0,default:()=>Sp,rgPath:()=>Bl});const Bl="/dsh/bin/rg";var Sp={rgPath:Bl},Ep=We({__esModule:()=>!0,default:()=>Ap});const Ap=Ce("sharp","default");var xp=We({Server:()=>$p,WebSocket:()=>Fl,WebSocketServer:()=>Ul,__esModule:()=>!0,default:()=>Fl});const Ri="ws";var Fl=class{static CONNECTING=0;static OPEN=1;static CLOSING=2;static CLOSED=3;constructor(){throw new Error(`web-preview: ${Ri} client sockets are not available in the worker host`)}},Ul=class{clients=new Set;handleUpgrade=Ce(Ri,"WebSocketServer.handleUpgrade");emit=Ce(Ri,"WebSocketServer.emit");on(){return this}close(e){e?.()}};const $p=Ul,Rp=["@earendil-works/pi-ai","@vscode/ripgrep","@deepseek-ai/node-addon-system/flock","koffi","node-pty","sharp","ws"],Tp={async_hooks:()=>Pu,buffer:()=>Nu,child_process:()=>Qh,crypto:()=>gf,"dns/promises":()=>_f,events:()=>Ef,fs:()=>Zf,"fs/promises":()=>td,http:()=>Ad,module:()=>Td,net:()=>np,os:()=>kd,path:()=>Zs,"path/posix":()=>Zs,perf_hooks:()=>Cd,sqlite:()=>ap,stream:()=>Lf,"timers/promises":()=>Nd,tty:()=>Pd,url:()=>Fd,util:()=>Wd,"util/types":()=>jd,vm:()=>cp,worker_threads:()=>fp,zlib:()=>Xd},Wl={"@deepseek-ai/node-addon-system/flock":()=>hp,koffi:()=>yp,sharp:()=>Ep,"node-pty":()=>bp,ws:()=>xp,"@vscode/ripgrep":()=>_p,"@earendil-works/pi-ai":()=>$l},Ip={"@earendil-works/pi-ai/":()=>$l},Hl=[...Rp].sort().join(","),jl=Object.keys(Wl).sort().join(",");if(Hl!==jl)throw new Error(`web-preview: replaced-external lists diverge — declared [${Hl}] vs wired [${jl}]`);function kp(){const e={...Wl};for(const[r,n]of Object.entries(Tp))e[r]=n,e[`node:${r}`]=n;return e}const ql=e=>{const r={ref:()=>r,unref:()=>r,hasRef:()=>!0,[Symbol.toPrimitive]:()=>e};return r},Lp=e=>{if(typeof e=="number")return e;if(typeof e=="object"&&e!==null&&Symbol.toPrimitive in e)return Number(e)},Gl=e=>(r,n,...i)=>ql(e(zl(r),n,...i)),zl=e=>typeof e=="function"?Fr(e):e,Ti=e=>r=>{e(Lp(r))};function Cp(){const e=globalThis,r=globalThis.setTimeout.bind(globalThis),n=globalThis.setInterval.bind(globalThis),i=globalThis.clearTimeout.bind(globalThis),o=globalThis.clearInterval.bind(globalThis);e.setTimeout=Gl(r),e.setInterval=Gl(n),e.clearTimeout=Ti(i),e.clearInterval=Ti(o),e.setImmediate=(s,...c)=>ql(r(zl(s),0,...c)),e.clearImmediate=Ti(i)}function Mp(){typeof globalThis.crypto.randomUUID!="function"&&Object.defineProperty(globalThis.crypto,"randomUUID",{value:Ls,configurable:!0,writable:!0})}function Op(e){return typeof e=="object"&&e!==null&&e.t==="shell-start"}Wu(),Cp(),Mp();let Ar,Vl=!1;const Ii=[];self.addEventListener("message",e=>{const r=e.data;if(Ar===void 0&&Op(r)){Vl=!0,Qi({cwd:r.cwd,env:r.env}),Hh(r,self);return}if(Ar===void 0&&r!==null&&typeof r=="object"&&r.t==="init"){if(typeof r.image!="string")throw new Error("webworker: init frame needs a string image url");if(!Array.isArray(r.overlays)||r.overlays.some(o=>typeof o!="string"))throw new Error("webworker: init frame needs an array of string overlay urls");const i=Tu({staticModules:kp(),staticModulePrefixes:Ip,requestListener:vo,alsCausality:hs,image:r.image,overlays:r.overlays});Ar=i;for(const o of Ii)Cn(()=>{i.handleMessage(o)});Ii.length=0,i.start().catch(()=>{});return}if(Ar===void 0){if(Vl)return;Ii.push(e.data);return}const n=Ar;Cn(()=>{n.handleMessage(e.data)})})})();
|
|
109
|
+
//# sourceMappingURL=worker-C8-_ANaz.js.map
|