@darkrymit/crunes-cli 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{benchmark-2TVN6HDF.js → benchmark-HBIZCVFR.js} +3 -3
- package/dist/chunks/{chunk-THGPCLJD.js → chunk-2N6X32LY.js} +5 -3
- package/dist/chunks/{chunk-TXCUSUZ6.js → chunk-32GEHGUV.js} +2500 -2347
- package/dist/chunks/{chunk-CBWT3DFR.js → chunk-5L2GJWCD.js} +4 -0
- package/dist/chunks/{chunk-ATI5HNNC.js → chunk-C3FADOZT.js} +2 -2
- package/dist/chunks/{chunk-3VFNNPQI.js → chunk-PICTIOYJ.js} +3 -3
- package/dist/chunks/{chunk-QAP63JIK.js → chunk-WUNDVEEL.js} +5 -5
- package/dist/chunks/chunk-XPEVUBUK.js +40 -0
- package/dist/chunks/{chunk-KP4EW2DS.js → chunk-ZFIRPZPE.js} +153 -15
- package/dist/chunks/{doctor-SXKAEYUF.js → doctor-HLQE7TVE.js} +1 -1
- package/dist/chunks/{install-FSJAC3CL.js → install-2K5BNXDO.js} +1 -1
- package/dist/chunks/{intro-PN7LT6ZG.js → intro-L5WBDL2P.js} +1 -1
- package/dist/chunks/{kill-Z7ZDY5MB.js → kill-IX7HNMVP.js} +12 -4
- package/dist/chunks/{list-45SHVKXO.js → list-BJTV6SPK.js} +1 -1
- package/dist/chunks/{repl-PSADU3MJ.js → repl-GNA342PP.js} +4 -4
- package/dist/chunks/{resolver-YEUZSOS4.js → resolver-II54EHPA.js} +2 -2
- package/dist/chunks/{run-CYGL3HTA.js → run-PXTN5GYH.js} +3 -3
- package/dist/chunks/{rune-OQX5EYSQ.js → rune-7YEZJTHK.js} +5 -4
- package/dist/chunks/{runner-VUSHR2OR.js → runner-OKVKI7FP.js} +3 -2
- package/dist/chunks/{uninstall-MSCIWDWV.js → uninstall-X75QTERD.js} +1 -1
- package/dist/chunks/{update-IHCYA3JW.js → update-HHIDPHGX.js} +1 -1
- package/dist/chunks/{utils-DJ3BXOQC.js → utils-K7DAKWGS.js} +1 -1
- package/dist/chunks/{version-SBE7LQ5C.js → version-RZVOIMQG.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/test/index.js +135 -3
- package/package.json +1 -1
|
@@ -2,14 +2,18 @@ import {
|
|
|
2
2
|
readSchemaCache,
|
|
3
3
|
writeSchemaCache
|
|
4
4
|
} from "./chunk-HYPUZ5DT.js";
|
|
5
|
+
import {
|
|
6
|
+
killWindowsShellJob
|
|
7
|
+
} from "./chunk-XPEVUBUK.js";
|
|
5
8
|
import {
|
|
6
9
|
createJob,
|
|
7
10
|
getJob,
|
|
11
|
+
jobPgidPath,
|
|
8
12
|
jobStderrPath,
|
|
9
13
|
jobStdinPath,
|
|
10
14
|
jobStdoutPath,
|
|
11
15
|
updateJobPid
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5L2GJWCD.js";
|
|
13
17
|
import {
|
|
14
18
|
checkShellCommand
|
|
15
19
|
} from "./chunk-BAIIJ4OC.js";
|
|
@@ -68259,6 +68263,105 @@ function sliceLines(content, from, to) {
|
|
|
68259
68263
|
if (sliced.length === 0) return "";
|
|
68260
68264
|
return sliced.join("\n") + (hadTrailing ? "\n" : "");
|
|
68261
68265
|
}
|
|
68266
|
+
var RANGE_CHUNK_BYTES = 64 * 1024;
|
|
68267
|
+
async function readTailBytes(handle, size, count) {
|
|
68268
|
+
const chunks = [];
|
|
68269
|
+
let pos = size;
|
|
68270
|
+
let seen = 0;
|
|
68271
|
+
while (pos > 0) {
|
|
68272
|
+
const length = Math.min(RANGE_CHUNK_BYTES, pos);
|
|
68273
|
+
pos -= length;
|
|
68274
|
+
const chunk = Buffer.alloc(length);
|
|
68275
|
+
const { bytesRead } = await handle.read(chunk, 0, length, pos);
|
|
68276
|
+
if (bytesRead !== length) return null;
|
|
68277
|
+
let at = pos + length === size && chunk[length - 1] === 10 ? length - 1 : length;
|
|
68278
|
+
while (at > 0 && (at = chunk.lastIndexOf(10, at - 1)) !== -1) {
|
|
68279
|
+
if (++seen === count) {
|
|
68280
|
+
chunks.unshift(chunk.subarray(at + 1));
|
|
68281
|
+
return { bytes: Buffer.concat(chunks), whole: false };
|
|
68282
|
+
}
|
|
68283
|
+
}
|
|
68284
|
+
chunks.unshift(chunk);
|
|
68285
|
+
}
|
|
68286
|
+
return { bytes: Buffer.concat(chunks), whole: true };
|
|
68287
|
+
}
|
|
68288
|
+
async function readHeadBytes(handle, size, count) {
|
|
68289
|
+
const chunks = [];
|
|
68290
|
+
let pos = 0;
|
|
68291
|
+
let seen = 0;
|
|
68292
|
+
while (pos < size) {
|
|
68293
|
+
const length = Math.min(RANGE_CHUNK_BYTES, size - pos);
|
|
68294
|
+
const chunk = Buffer.alloc(length);
|
|
68295
|
+
const { bytesRead } = await handle.read(chunk, 0, length, pos);
|
|
68296
|
+
if (bytesRead !== length) return null;
|
|
68297
|
+
pos += length;
|
|
68298
|
+
let at = -1;
|
|
68299
|
+
while ((at = chunk.indexOf(10, at + 1)) !== -1) {
|
|
68300
|
+
if (++seen === count) {
|
|
68301
|
+
chunks.push(chunk.subarray(0, at));
|
|
68302
|
+
return { bytes: Buffer.concat(chunks), whole: false };
|
|
68303
|
+
}
|
|
68304
|
+
}
|
|
68305
|
+
chunks.push(chunk);
|
|
68306
|
+
}
|
|
68307
|
+
return { bytes: Buffer.concat(chunks), whole: true };
|
|
68308
|
+
}
|
|
68309
|
+
async function readEdgeLines(abs, from, to) {
|
|
68310
|
+
const isTail = Number.isInteger(from) && from < 0 && to == null;
|
|
68311
|
+
const isHead = Number.isInteger(to) && to >= 1 && (from == null || Number.isInteger(from) && from >= 1);
|
|
68312
|
+
if (!isTail && !isHead) return void 0;
|
|
68313
|
+
const handle = await fsPromises.open(abs, "r");
|
|
68314
|
+
try {
|
|
68315
|
+
const stat6 = await handle.stat();
|
|
68316
|
+
if (!stat6.isFile() || stat6.size === 0) return void 0;
|
|
68317
|
+
const part = isTail ? await readTailBytes(handle, stat6.size, -from) : await readHeadBytes(handle, stat6.size, to);
|
|
68318
|
+
if (!part) return void 0;
|
|
68319
|
+
if (part.whole) return sliceLines(stripBom(part.bytes.toString("utf8")), from, to);
|
|
68320
|
+
if (isTail) return part.bytes.toString("utf8");
|
|
68321
|
+
const last = Buffer.alloc(1);
|
|
68322
|
+
await handle.read(last, 0, 1, stat6.size - 1);
|
|
68323
|
+
const lines = stripBom(part.bytes.toString("utf8")).split("\n").slice(from == null ? 0 : from - 1);
|
|
68324
|
+
if (lines.length === 0) return "";
|
|
68325
|
+
return lines.join("\n") + (last[0] === 10 ? "\n" : "");
|
|
68326
|
+
} finally {
|
|
68327
|
+
await handle.close();
|
|
68328
|
+
}
|
|
68329
|
+
}
|
|
68330
|
+
var LINE_BATCH_BYTES = 256 * 1024;
|
|
68331
|
+
async function* readLineBatches(abs, needles) {
|
|
68332
|
+
let batch = [];
|
|
68333
|
+
let batchBytes = 0;
|
|
68334
|
+
let pending = [];
|
|
68335
|
+
let isFirst = true;
|
|
68336
|
+
const take = (line) => {
|
|
68337
|
+
if (isFirst) {
|
|
68338
|
+
isFirst = false;
|
|
68339
|
+
if (line[0] === 239 && line[1] === 187 && line[2] === 191) line = line.subarray(3);
|
|
68340
|
+
}
|
|
68341
|
+
if (line.at(-1) === 13) line = line.subarray(0, -1);
|
|
68342
|
+
if (needles && !needles.some((n) => line.includes(n))) return;
|
|
68343
|
+
batch.push(line.toString("utf8"));
|
|
68344
|
+
batchBytes += line.length + 1;
|
|
68345
|
+
};
|
|
68346
|
+
for await (const chunk of createReadStream(abs, { highWaterMark: 1024 * 1024 })) {
|
|
68347
|
+
let start = 0;
|
|
68348
|
+
let nl;
|
|
68349
|
+
while ((nl = chunk.indexOf(10, start)) !== -1) {
|
|
68350
|
+
const piece = chunk.subarray(start, nl);
|
|
68351
|
+
take(pending.length ? Buffer.concat([...pending, piece]) : piece);
|
|
68352
|
+
pending = [];
|
|
68353
|
+
start = nl + 1;
|
|
68354
|
+
if (batchBytes >= LINE_BATCH_BYTES) {
|
|
68355
|
+
yield batch;
|
|
68356
|
+
batch = [];
|
|
68357
|
+
batchBytes = 0;
|
|
68358
|
+
}
|
|
68359
|
+
}
|
|
68360
|
+
if (start < chunk.length) pending.push(chunk.subarray(start));
|
|
68361
|
+
}
|
|
68362
|
+
if (pending.length) take(Buffer.concat(pending));
|
|
68363
|
+
if (batch.length) yield batch;
|
|
68364
|
+
}
|
|
68262
68365
|
function createFsUtils(dir, checkPermission, pluginDir = null, pluginId = null, storeDir = null) {
|
|
68263
68366
|
const ctx = () => ({ dir, pluginDir, pluginId, storeDir });
|
|
68264
68367
|
return {
|
|
@@ -68266,6 +68369,8 @@ function createFsUtils(dir, checkPermission, pluginDir = null, pluginId = null,
|
|
|
68266
68369
|
const abs = resolvePath(relPath, ctx());
|
|
68267
68370
|
if (checkPermission) checkPermission("fs.read", relPath);
|
|
68268
68371
|
try {
|
|
68372
|
+
const edge = await readEdgeLines(abs, from, to);
|
|
68373
|
+
if (edge !== void 0) return edge;
|
|
68269
68374
|
const content = stripBom(await fsPromises.readFile(abs, "utf8"));
|
|
68270
68375
|
return sliceLines(content, from, to);
|
|
68271
68376
|
} catch (err) {
|
|
@@ -68407,6 +68512,12 @@ function createFsUtils(dir, checkPermission, pluginDir = null, pluginId = null,
|
|
|
68407
68512
|
if (checkPermission) checkPermission("fs.read", relPath);
|
|
68408
68513
|
return createReadStream(abs);
|
|
68409
68514
|
},
|
|
68515
|
+
readLinesIter(relPath, { contains } = {}) {
|
|
68516
|
+
if (contains != null && !Array.isArray(contains)) throw new TypeError("fs.readLinesStream: contains must be an array of strings");
|
|
68517
|
+
const abs = resolvePath(relPath, ctx());
|
|
68518
|
+
if (checkPermission) checkPermission("fs.read", relPath);
|
|
68519
|
+
return readLineBatches(abs, contains?.map((s) => Buffer.from(s, "utf8")) ?? null);
|
|
68520
|
+
},
|
|
68410
68521
|
async appendStreamRef(relPath) {
|
|
68411
68522
|
const abs = resolvePath(relPath, ctx());
|
|
68412
68523
|
if (checkPermission) checkPermission("fs.write", relPath);
|
|
@@ -68834,7 +68945,7 @@ function createShellUtils(dir, checkPermission) {
|
|
|
68834
68945
|
checkShellCommand(cmd, resolveShell(opts.shell).kind, checkPermission);
|
|
68835
68946
|
return new ShellSession(cmd, { dir, ...opts, activeSessions });
|
|
68836
68947
|
}
|
|
68837
|
-
async function createShellJob(cmd, opts, { createJob: createJob2, updateJobPid: updateJobPid2, jobStdoutPath: jobStdoutPath2, jobStderrPath: jobStderrPath2, jobStdinPath: jobStdinPath2, spawnedBy, projectDir: jobProjectDir }) {
|
|
68948
|
+
async function createShellJob(cmd, opts, { createJob: createJob2, updateJobPid: updateJobPid2, jobStdoutPath: jobStdoutPath2, jobStderrPath: jobStderrPath2, jobStdinPath: jobStdinPath2, jobPgidPath: jobPgidPath2, spawnedBy, projectDir: jobProjectDir }) {
|
|
68838
68949
|
const repl = opts?.repl ?? false;
|
|
68839
68950
|
checkShellCommand(cmd, resolveShell(opts?.shell).kind, checkPermission);
|
|
68840
68951
|
const { id } = await createJob2(null, {
|
|
@@ -68850,12 +68961,15 @@ function createShellUtils(dir, checkPermission) {
|
|
|
68850
68961
|
if (repl) {
|
|
68851
68962
|
const stdinLog = jobStdinPath2(jobProjectDir, id);
|
|
68852
68963
|
fs.writeFileSync(stdinLog, "");
|
|
68964
|
+
const jobShell = resolveShell(opts?.shell);
|
|
68965
|
+
const recordGroup = process.platform === "win32" && jobShell.kind !== "cmd";
|
|
68853
68966
|
const wrapperEnv = {
|
|
68854
68967
|
...childEnv,
|
|
68855
|
-
CRUNES_SHELL_CMD: cmd,
|
|
68968
|
+
CRUNES_SHELL_CMD: recordGroup ? `cat /proc/$$/pgid > "$CRUNES_JOB_PGID"; ${cmd}` : cmd,
|
|
68856
68969
|
CRUNES_SHELL_CWD: jobProjectDir,
|
|
68857
68970
|
CRUNES_STDIN_LOG: stdinLog,
|
|
68858
|
-
CRUNES_SHELL_PATH:
|
|
68971
|
+
CRUNES_SHELL_PATH: jobShell.path,
|
|
68972
|
+
...recordGroup ? { CRUNES_JOB_PGID: jobPgidPath2(jobProjectDir, id) } : {}
|
|
68859
68973
|
};
|
|
68860
68974
|
const wrapper = `
|
|
68861
68975
|
const {spawn}=require('child_process'),{openSync,closeSync,statSync,readSync}=require('fs')
|
|
@@ -73291,7 +73405,7 @@ __export(embedded_exports, {
|
|
|
73291
73405
|
init_require_shim();
|
|
73292
73406
|
var md = "export function h1(text) { return `# ${text}\\n`; }\nexport function h2(text) { return `## ${text}\\n`; }\nexport function h3(text) { return `### ${text}\\n`; }\nexport function p(text) { return `${text}\\n`; }\nexport function bold(text) { return `**${text}**`; }\nexport function italic(text) { return `_${text}_`; }\nexport function code(text) { return `\\`${text}\\``; }\n\nexport function codeBlock(text, lang = '') {\n return `\\`\\`\\`${lang}\\n${text}\\n\\`\\`\\`\\n`;\n}\n\nexport function ul(items) {\n return items.map(i => `- ${i}`).join('\\n') + '\\n';\n}\n\nexport function ol(items) {\n return items.map((i, n) => `${n + 1}. ${i}`).join('\\n') + '\\n';\n}\n\nexport function link(text, url) {\n return `[${text}](${url})`;\n}\n\nexport function table(headers, rows) {\n const sep = headers.map(() => '---');\n const lines = [\n `| ${headers.join(' | ')} |`,\n `| ${sep.join(' | ')} |`,\n ...rows.map(r => `| ${r.join(' | ')} |`),\n ];\n return lines.join('\\n') + '\\n';\n}\n\nexport function blockquote(text) {\n return text.split('\\n').map(line => `> ${line}`).join('\\n') + '\\n';\n}\n";
|
|
73293
73407
|
var tree = "export function node(name, description, children = []) {\n return { name, description, children };\n}\n\n/**\n * Formats a tree node to a string.\n * options.style: 'tree' (default, ASCII art) | 'list' (nested markdown list)\n * options.bullet: '-' (default) | '*' | '+' \u2014 only used for 'list' style\n */\nexport function format(root, options = {}) {\n const { style = 'tree', bullet = '-' } = options;\n if (style === 'list') return formatList(root, bullet, 0);\n return formatTree(root);\n}\n\nfunction formatTree(root) {\n if (!root) return '';\n const lines = [`${root.name.padEnd(12)}${root.description}`];\n appendTreeChildren(root.children ?? [], '', lines);\n return lines.join('\\n');\n}\n\nfunction appendTreeChildren(children, prefix, lines) {\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const isLast = i === children.length - 1;\n const connector = isLast ? '\u2514\u2500\u2500 ' : '\u251C\u2500\u2500 ';\n const childPrefix = prefix + (isLast ? ' ' : '\u2502 ');\n lines.push(`${prefix}${connector}${child.name.padEnd(12)}${child.description}`);\n appendTreeChildren(child.children ?? [], childPrefix, lines);\n }\n}\n\nfunction formatList(node, bullet, depth) {\n const indent = ' '.repeat(depth);\n const lines = [`${indent}${bullet} **${node.name}** \u2014 ${node.description}`];\n for (const child of (node.children ?? [])) {\n lines.push(formatList(child, bullet, depth + 1));\n }\n return lines.join('\\n');\n}\n";
|
|
73294
|
-
var utils = 'var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to2, from, except, desc) => {\n if (from && typeof from === "object" || typeof from === "function") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to2, key) && key !== except)\n __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to2;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. "__esModule" has not been set), then set\n // "default" to the CommonJS "module.exports" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,\n mod\n));\n\n// node_modules/fast-text-encoding/text.min.js\nvar require_text_min = __commonJS({\n "node_modules/fast-text-encoding/text.min.js"(exports) {\n (function(scope) {\n "use strict";\n function B2(r2, e2) {\n var f2;\n return r2 instanceof Buffer ? f2 = r2 : f2 = Buffer.from(r2.buffer, r2.byteOffset, r2.byteLength), f2.toString(e2);\n }\n var w2 = function(r2) {\n return Buffer.from(r2);\n };\n function h2(r2) {\n for (var e2 = 0, f2 = Math.min(256 * 256, r2.length + 1), n2 = new Uint16Array(f2), i2 = [], o2 = 0; ; ) {\n var t2 = e2 < r2.length;\n if (!t2 || o2 >= f2 - 1) {\n var s2 = n2.subarray(0, o2), m2 = s2;\n if (i2.push(String.fromCharCode.apply(null, m2)), !t2) return i2.join("");\n r2 = r2.subarray(e2), e2 = 0, o2 = 0;\n }\n var a2 = r2[e2++];\n if ((a2 & 128) === 0) n2[o2++] = a2;\n else if ((a2 & 224) === 192) {\n var d2 = r2[e2++] & 63;\n n2[o2++] = (a2 & 31) << 6 | d2;\n } else if ((a2 & 240) === 224) {\n var d2 = r2[e2++] & 63, l2 = r2[e2++] & 63;\n n2[o2++] = (a2 & 31) << 12 | d2 << 6 | l2;\n } else if ((a2 & 248) === 240) {\n var d2 = r2[e2++] & 63, l2 = r2[e2++] & 63, R2 = r2[e2++] & 63, c2 = (a2 & 7) << 18 | d2 << 12 | l2 << 6 | R2;\n c2 > 65535 && (c2 -= 65536, n2[o2++] = c2 >>> 10 & 1023 | 55296, c2 = 56320 | c2 & 1023), n2[o2++] = c2;\n }\n }\n }\n function F2(r2) {\n for (var e2 = 0, f2 = r2.length, n2 = 0, i2 = Math.max(32, f2 + (f2 >>> 1) + 7), o2 = new Uint8Array(i2 >>> 3 << 3); e2 < f2; ) {\n var t2 = r2.charCodeAt(e2++);\n if (t2 >= 55296 && t2 <= 56319) {\n if (e2 < f2) {\n var s2 = r2.charCodeAt(e2);\n (s2 & 64512) === 56320 && (++e2, t2 = ((t2 & 1023) << 10) + (s2 & 1023) + 65536);\n }\n if (t2 >= 55296 && t2 <= 56319) continue;\n }\n if (n2 + 4 > o2.length) {\n i2 += 8, i2 *= 1 + e2 / r2.length * 2, i2 = i2 >>> 3 << 3;\n var m2 = new Uint8Array(i2);\n m2.set(o2), o2 = m2;\n }\n if ((t2 & 4294967168) === 0) {\n o2[n2++] = t2;\n continue;\n } else if ((t2 & 4294965248) === 0) o2[n2++] = t2 >>> 6 & 31 | 192;\n else if ((t2 & 4294901760) === 0) o2[n2++] = t2 >>> 12 & 15 | 224, o2[n2++] = t2 >>> 6 & 63 | 128;\n else if ((t2 & 4292870144) === 0) o2[n2++] = t2 >>> 18 & 7 | 240, o2[n2++] = t2 >>> 12 & 63 | 128, o2[n2++] = t2 >>> 6 & 63 | 128;\n else continue;\n o2[n2++] = t2 & 63 | 128;\n }\n return o2.slice ? o2.slice(0, n2) : o2.subarray(0, n2);\n }\n var u2 = "Failed to ", p2 = function(r2, e2, f2) {\n if (r2) throw new Error("".concat(u2).concat(e2, ": the \'").concat(f2, "\' option is unsupported."));\n };\n var x2 = typeof Buffer == "function" && Buffer.from;\n var A2 = x2 ? w2 : F2;\n function v2() {\n this.encoding = "utf-8";\n }\n v2.prototype.encode = function(r2, e2) {\n return p2(e2 && e2.stream, "encode", "stream"), A2(r2);\n };\n function U2(r2) {\n var e2;\n try {\n var f2 = new Blob([r2], { type: "text/plain;charset=UTF-8" });\n e2 = URL.createObjectURL(f2);\n var n2 = new XMLHttpRequest();\n return n2.open("GET", e2, false), n2.send(), n2.responseText;\n } finally {\n e2 && URL.revokeObjectURL(e2);\n }\n }\n var O2 = !x2 && typeof Blob == "function" && typeof URL == "function" && typeof URL.createObjectURL == "function", S2 = ["utf-8", "utf8", "unicode-1-1-utf-8"], T2 = h2;\n x2 ? T2 = B2 : O2 && (T2 = function(r2) {\n try {\n return U2(r2);\n } catch (e2) {\n return h2(r2);\n }\n });\n var y2 = "construct \'TextDecoder\'", E2 = "".concat(u2, " ").concat(y2, ": the ");\n function g2(r2, e2) {\n p2(e2 && e2.fatal, y2, "fatal"), r2 = r2 || "utf-8";\n var f2;\n if (x2 ? f2 = Buffer.isEncoding(r2) : f2 = S2.indexOf(r2.toLowerCase()) !== -1, !f2) throw new RangeError("".concat(E2, " encoding label provided (\'").concat(r2, "\') is invalid."));\n this.encoding = r2, this.fatal = false, this.ignoreBOM = false;\n }\n g2.prototype.decode = function(r2, e2) {\n p2(e2 && e2.stream, "decode", "stream");\n var f2;\n return r2 instanceof Uint8Array ? f2 = r2 : r2.buffer instanceof ArrayBuffer ? f2 = new Uint8Array(r2.buffer) : f2 = new Uint8Array(r2), T2(f2, this.encoding);\n };\n scope.TextEncoder = scope.TextEncoder || v2;\n scope.TextDecoder = scope.TextDecoder || g2;\n })(typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : exports);\n }\n});\n\n// node_modules/base64-js/index.js\nvar require_base64_js = __commonJS({\n "node_modules/base64-js/index.js"(exports) {\n "use strict";\n exports.byteLength = byteLength;\n exports.toByteArray = toByteArray;\n exports.fromByteArray = fromByteArray;\n var lookup = [];\n var revLookup = [];\n var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;\n var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n for (i2 = 0, len = code.length; i2 < len; ++i2) {\n lookup[i2] = code[i2];\n revLookup[code.charCodeAt(i2)] = i2;\n }\n var i2;\n var len;\n revLookup["-".charCodeAt(0)] = 62;\n revLookup["_".charCodeAt(0)] = 63;\n function getLens(b64) {\n var len2 = b64.length;\n if (len2 % 4 > 0) {\n throw new Error("Invalid string. Length must be a multiple of 4");\n }\n var validLen = b64.indexOf("=");\n if (validLen === -1) validLen = len2;\n var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;\n return [validLen, placeHoldersLen];\n }\n function byteLength(b64) {\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n function _byteLength(b64, validLen, placeHoldersLen) {\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n function toByteArray(b64) {\n var tmp;\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));\n var curByte = 0;\n var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;\n var i3;\n for (i3 = 0; i3 < len2; i3 += 4) {\n tmp = revLookup[b64.charCodeAt(i3)] << 18 | revLookup[b64.charCodeAt(i3 + 1)] << 12 | revLookup[b64.charCodeAt(i3 + 2)] << 6 | revLookup[b64.charCodeAt(i3 + 3)];\n arr[curByte++] = tmp >> 16 & 255;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n if (placeHoldersLen === 2) {\n tmp = revLookup[b64.charCodeAt(i3)] << 2 | revLookup[b64.charCodeAt(i3 + 1)] >> 4;\n arr[curByte++] = tmp & 255;\n }\n if (placeHoldersLen === 1) {\n tmp = revLookup[b64.charCodeAt(i3)] << 10 | revLookup[b64.charCodeAt(i3 + 1)] << 4 | revLookup[b64.charCodeAt(i3 + 2)] >> 2;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n return arr;\n }\n function tripletToBase64(num) {\n return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];\n }\n function encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n for (var i3 = start; i3 < end; i3 += 3) {\n tmp = (uint8[i3] << 16 & 16711680) + (uint8[i3 + 1] << 8 & 65280) + (uint8[i3 + 2] & 255);\n output.push(tripletToBase64(tmp));\n }\n return output.join("");\n }\n function fromByteArray(uint8) {\n var tmp;\n var len2 = uint8.length;\n var extraBytes = len2 % 3;\n var parts = [];\n var maxChunkLength = 16383;\n for (var i3 = 0, len22 = len2 - extraBytes; i3 < len22; i3 += maxChunkLength) {\n parts.push(encodeChunk(uint8, i3, i3 + maxChunkLength > len22 ? len22 : i3 + maxChunkLength));\n }\n if (extraBytes === 1) {\n tmp = uint8[len2 - 1];\n parts.push(\n lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="\n );\n } else if (extraBytes === 2) {\n tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];\n parts.push(\n lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="\n );\n }\n return parts.join("");\n }\n }\n});\n\n// node_modules/ieee754/index.js\nvar require_ieee754 = __commonJS({\n "node_modules/ieee754/index.js"(exports) {\n exports.read = function(buffer, offset, isLE, mLen, nBytes) {\n var e2, m2;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i2 = isLE ? nBytes - 1 : 0;\n var d2 = isLE ? -1 : 1;\n var s2 = buffer[offset + i2];\n i2 += d2;\n e2 = s2 & (1 << -nBits) - 1;\n s2 >>= -nBits;\n nBits += eLen;\n for (; nBits > 0; e2 = e2 * 256 + buffer[offset + i2], i2 += d2, nBits -= 8) {\n }\n m2 = e2 & (1 << -nBits) - 1;\n e2 >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m2 = m2 * 256 + buffer[offset + i2], i2 += d2, nBits -= 8) {\n }\n if (e2 === 0) {\n e2 = 1 - eBias;\n } else if (e2 === eMax) {\n return m2 ? NaN : (s2 ? -1 : 1) * Infinity;\n } else {\n m2 = m2 + Math.pow(2, mLen);\n e2 = e2 - eBias;\n }\n return (s2 ? -1 : 1) * m2 * Math.pow(2, e2 - mLen);\n };\n exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {\n var e2, m2, c2;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt2 = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n var i2 = isLE ? 0 : nBytes - 1;\n var d2 = isLE ? 1 : -1;\n var s2 = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n value = Math.abs(value);\n if (isNaN(value) || value === Infinity) {\n m2 = isNaN(value) ? 1 : 0;\n e2 = eMax;\n } else {\n e2 = Math.floor(Math.log(value) / Math.LN2);\n if (value * (c2 = Math.pow(2, -e2)) < 1) {\n e2--;\n c2 *= 2;\n }\n if (e2 + eBias >= 1) {\n value += rt2 / c2;\n } else {\n value += rt2 * Math.pow(2, 1 - eBias);\n }\n if (value * c2 >= 2) {\n e2++;\n c2 /= 2;\n }\n if (e2 + eBias >= eMax) {\n m2 = 0;\n e2 = eMax;\n } else if (e2 + eBias >= 1) {\n m2 = (value * c2 - 1) * Math.pow(2, mLen);\n e2 = e2 + eBias;\n } else {\n m2 = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e2 = 0;\n }\n }\n for (; mLen >= 8; buffer[offset + i2] = m2 & 255, i2 += d2, m2 /= 256, mLen -= 8) {\n }\n e2 = e2 << mLen | m2;\n eLen += mLen;\n for (; eLen > 0; buffer[offset + i2] = e2 & 255, i2 += d2, e2 /= 256, eLen -= 8) {\n }\n buffer[offset + i2 - d2] |= s2 * 128;\n };\n }\n});\n\n// node_modules/buffer/index.js\nvar require_buffer = __commonJS({\n "node_modules/buffer/index.js"(exports) {\n "use strict";\n var base64 = require_base64_js();\n var ieee754 = require_ieee754();\n var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;\n exports.Buffer = Buffer3;\n exports.SlowBuffer = SlowBuffer;\n exports.INSPECT_MAX_BYTES = 50;\n var K_MAX_LENGTH = 2147483647;\n exports.kMaxLength = K_MAX_LENGTH;\n Buffer3.TYPED_ARRAY_SUPPORT = typedArraySupport();\n if (!Buffer3.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {\n console.error(\n "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."\n );\n }\n function typedArraySupport() {\n try {\n const arr = new Uint8Array(1);\n const proto = { foo: function() {\n return 42;\n } };\n Object.setPrototypeOf(proto, Uint8Array.prototype);\n Object.setPrototypeOf(arr, proto);\n return arr.foo() === 42;\n } catch (e2) {\n return false;\n }\n }\n Object.defineProperty(Buffer3.prototype, "parent", {\n enumerable: true,\n get: function() {\n if (!Buffer3.isBuffer(this)) return void 0;\n return this.buffer;\n }\n });\n Object.defineProperty(Buffer3.prototype, "offset", {\n enumerable: true,\n get: function() {\n if (!Buffer3.isBuffer(this)) return void 0;\n return this.byteOffset;\n }\n });\n function createBuffer(length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError(\'The value "\' + length + \'" is invalid for option "size"\');\n }\n const buf = new Uint8Array(length);\n Object.setPrototypeOf(buf, Buffer3.prototype);\n return buf;\n }\n function Buffer3(arg, encodingOrOffset, length) {\n if (typeof arg === "number") {\n if (typeof encodingOrOffset === "string") {\n throw new TypeError(\n \'The "string" argument must be of type string. Received type number\'\n );\n }\n return allocUnsafe(arg);\n }\n return from(arg, encodingOrOffset, length);\n }\n Buffer3.poolSize = 8192;\n function from(value, encodingOrOffset, length) {\n if (typeof value === "string") {\n return fromString(value, encodingOrOffset);\n }\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value);\n }\n if (value == null) {\n throw new TypeError(\n "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value\n );\n }\n if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n if (typeof value === "number") {\n throw new TypeError(\n \'The "value" argument must not be of type number. Received type number\'\n );\n }\n const valueOf = value.valueOf && value.valueOf();\n if (valueOf != null && valueOf !== value) {\n return Buffer3.from(valueOf, encodingOrOffset, length);\n }\n const b2 = fromObject(value);\n if (b2) return b2;\n if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {\n return Buffer3.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);\n }\n throw new TypeError(\n "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value\n );\n }\n Buffer3.from = function(value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length);\n };\n Object.setPrototypeOf(Buffer3.prototype, Uint8Array.prototype);\n Object.setPrototypeOf(Buffer3, Uint8Array);\n function assertSize(size) {\n if (typeof size !== "number") {\n throw new TypeError(\'"size" argument must be of type number\');\n } else if (size < 0) {\n throw new RangeError(\'The value "\' + size + \'" is invalid for option "size"\');\n }\n }\n function alloc(size, fill, encoding) {\n assertSize(size);\n if (size <= 0) {\n return createBuffer(size);\n }\n if (fill !== void 0) {\n return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);\n }\n return createBuffer(size);\n }\n Buffer3.alloc = function(size, fill, encoding) {\n return alloc(size, fill, encoding);\n };\n function allocUnsafe(size) {\n assertSize(size);\n return createBuffer(size < 0 ? 0 : checked(size) | 0);\n }\n Buffer3.allocUnsafe = function(size) {\n return allocUnsafe(size);\n };\n Buffer3.allocUnsafeSlow = function(size) {\n return allocUnsafe(size);\n };\n function fromString(string, encoding) {\n if (typeof encoding !== "string" || encoding === "") {\n encoding = "utf8";\n }\n if (!Buffer3.isEncoding(encoding)) {\n throw new TypeError("Unknown encoding: " + encoding);\n }\n const length = byteLength(string, encoding) | 0;\n let buf = createBuffer(length);\n const actual = buf.write(string, encoding);\n if (actual !== length) {\n buf = buf.slice(0, actual);\n }\n return buf;\n }\n function fromArrayLike(array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0;\n const buf = createBuffer(length);\n for (let i2 = 0; i2 < length; i2 += 1) {\n buf[i2] = array[i2] & 255;\n }\n return buf;\n }\n function fromArrayView(arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView);\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);\n }\n return fromArrayLike(arrayView);\n }\n function fromArrayBuffer(array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError(\'"offset" is outside of buffer bounds\');\n }\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError(\'"length" is outside of buffer bounds\');\n }\n let buf;\n if (byteOffset === void 0 && length === void 0) {\n buf = new Uint8Array(array);\n } else if (length === void 0) {\n buf = new Uint8Array(array, byteOffset);\n } else {\n buf = new Uint8Array(array, byteOffset, length);\n }\n Object.setPrototypeOf(buf, Buffer3.prototype);\n return buf;\n }\n function fromObject(obj) {\n if (Buffer3.isBuffer(obj)) {\n const len = checked(obj.length) | 0;\n const buf = createBuffer(len);\n if (buf.length === 0) {\n return buf;\n }\n obj.copy(buf, 0, 0, len);\n return buf;\n }\n if (obj.length !== void 0) {\n if (typeof obj.length !== "number" || numberIsNaN(obj.length)) {\n return createBuffer(0);\n }\n return fromArrayLike(obj);\n }\n if (obj.type === "Buffer" && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data);\n }\n }\n function checked(length) {\n if (length >= K_MAX_LENGTH) {\n throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");\n }\n return length | 0;\n }\n function SlowBuffer(length) {\n if (+length != length) {\n length = 0;\n }\n return Buffer3.alloc(+length);\n }\n Buffer3.isBuffer = function isBuffer(b2) {\n return b2 != null && b2._isBuffer === true && b2 !== Buffer3.prototype;\n };\n Buffer3.compare = function compare(a2, b2) {\n if (isInstance(a2, Uint8Array)) a2 = Buffer3.from(a2, a2.offset, a2.byteLength);\n if (isInstance(b2, Uint8Array)) b2 = Buffer3.from(b2, b2.offset, b2.byteLength);\n if (!Buffer3.isBuffer(a2) || !Buffer3.isBuffer(b2)) {\n throw new TypeError(\n \'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\'\n );\n }\n if (a2 === b2) return 0;\n let x2 = a2.length;\n let y2 = b2.length;\n for (let i2 = 0, len = Math.min(x2, y2); i2 < len; ++i2) {\n if (a2[i2] !== b2[i2]) {\n x2 = a2[i2];\n y2 = b2[i2];\n break;\n }\n }\n if (x2 < y2) return -1;\n if (y2 < x2) return 1;\n return 0;\n };\n Buffer3.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case "hex":\n case "utf8":\n case "utf-8":\n case "ascii":\n case "latin1":\n case "binary":\n case "base64":\n case "ucs2":\n case "ucs-2":\n case "utf16le":\n case "utf-16le":\n return true;\n default:\n return false;\n }\n };\n Buffer3.concat = function concat(list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError(\'"list" argument must be an Array of Buffers\');\n }\n if (list.length === 0) {\n return Buffer3.alloc(0);\n }\n let i2;\n if (length === void 0) {\n length = 0;\n for (i2 = 0; i2 < list.length; ++i2) {\n length += list[i2].length;\n }\n }\n const buffer = Buffer3.allocUnsafe(length);\n let pos = 0;\n for (i2 = 0; i2 < list.length; ++i2) {\n let buf = list[i2];\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer3.isBuffer(buf)) buf = Buffer3.from(buf);\n buf.copy(buffer, pos);\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n );\n }\n } else if (!Buffer3.isBuffer(buf)) {\n throw new TypeError(\'"list" argument must be an Array of Buffers\');\n } else {\n buf.copy(buffer, pos);\n }\n pos += buf.length;\n }\n return buffer;\n };\n function byteLength(string, encoding) {\n if (Buffer3.isBuffer(string)) {\n return string.length;\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength;\n }\n if (typeof string !== "string") {\n throw new TypeError(\n \'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \' + typeof string\n );\n }\n const len = string.length;\n const mustMatch = arguments.length > 2 && arguments[2] === true;\n if (!mustMatch && len === 0) return 0;\n let loweredCase = false;\n for (; ; ) {\n switch (encoding) {\n case "ascii":\n case "latin1":\n case "binary":\n return len;\n case "utf8":\n case "utf-8":\n return utf8ToBytes(string).length;\n case "ucs2":\n case "ucs-2":\n case "utf16le":\n case "utf-16le":\n return len * 2;\n case "hex":\n return len >>> 1;\n case "base64":\n return base64ToBytes(string).length;\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length;\n }\n encoding = ("" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n }\n Buffer3.byteLength = byteLength;\n function slowToString(encoding, start, end) {\n let loweredCase = false;\n if (start === void 0 || start < 0) {\n start = 0;\n }\n if (start > this.length) {\n return "";\n }\n if (end === void 0 || end > this.length) {\n end = this.length;\n }\n if (end <= 0) {\n return "";\n }\n end >>>= 0;\n start >>>= 0;\n if (end <= start) {\n return "";\n }\n if (!encoding) encoding = "utf8";\n while (true) {\n switch (encoding) {\n case "hex":\n return hexSlice(this, start, end);\n case "utf8":\n case "utf-8":\n return utf8Slice(this, start, end);\n case "ascii":\n return asciiSlice(this, start, end);\n case "latin1":\n case "binary":\n return latin1Slice(this, start, end);\n case "base64":\n return base64Slice(this, start, end);\n case "ucs2":\n case "ucs-2":\n case "utf16le":\n case "utf-16le":\n return utf16leSlice(this, start, end);\n default:\n if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);\n encoding = (encoding + "").toLowerCase();\n loweredCase = true;\n }\n }\n }\n Buffer3.prototype._isBuffer = true;\n function swap(b2, n2, m2) {\n const i2 = b2[n2];\n b2[n2] = b2[m2];\n b2[m2] = i2;\n }\n Buffer3.prototype.swap16 = function swap16() {\n const len = this.length;\n if (len % 2 !== 0) {\n throw new RangeError("Buffer size must be a multiple of 16-bits");\n }\n for (let i2 = 0; i2 < len; i2 += 2) {\n swap(this, i2, i2 + 1);\n }\n return this;\n };\n Buffer3.prototype.swap32 = function swap32() {\n const len = this.length;\n if (len % 4 !== 0) {\n throw new RangeError("Buffer size must be a multiple of 32-bits");\n }\n for (let i2 = 0; i2 < len; i2 += 4) {\n swap(this, i2, i2 + 3);\n swap(this, i2 + 1, i2 + 2);\n }\n return this;\n };\n Buffer3.prototype.swap64 = function swap64() {\n const len = this.length;\n if (len % 8 !== 0) {\n throw new RangeError("Buffer size must be a multiple of 64-bits");\n }\n for (let i2 = 0; i2 < len; i2 += 8) {\n swap(this, i2, i2 + 7);\n swap(this, i2 + 1, i2 + 6);\n swap(this, i2 + 2, i2 + 5);\n swap(this, i2 + 3, i2 + 4);\n }\n return this;\n };\n Buffer3.prototype.toString = function toString() {\n const length = this.length;\n if (length === 0) return "";\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n };\n Buffer3.prototype.toLocaleString = Buffer3.prototype.toString;\n Buffer3.prototype.equals = function equals(b2) {\n if (!Buffer3.isBuffer(b2)) throw new TypeError("Argument must be a Buffer");\n if (this === b2) return true;\n return Buffer3.compare(this, b2) === 0;\n };\n Buffer3.prototype.inspect = function inspect() {\n let str = "";\n const max = exports.INSPECT_MAX_BYTES;\n str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();\n if (this.length > max) str += " ... ";\n return "<Buffer " + str + ">";\n };\n if (customInspectSymbol) {\n Buffer3.prototype[customInspectSymbol] = Buffer3.prototype.inspect;\n }\n Buffer3.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer3.from(target, target.offset, target.byteLength);\n }\n if (!Buffer3.isBuffer(target)) {\n throw new TypeError(\n \'The "target" argument must be one of type Buffer or Uint8Array. Received type \' + typeof target\n );\n }\n if (start === void 0) {\n start = 0;\n }\n if (end === void 0) {\n end = target ? target.length : 0;\n }\n if (thisStart === void 0) {\n thisStart = 0;\n }\n if (thisEnd === void 0) {\n thisEnd = this.length;\n }\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError("out of range index");\n }\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n if (thisStart >= thisEnd) {\n return -1;\n }\n if (start >= end) {\n return 1;\n }\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n let x2 = thisEnd - thisStart;\n let y2 = end - start;\n const len = Math.min(x2, y2);\n const thisCopy = this.slice(thisStart, thisEnd);\n const targetCopy = target.slice(start, end);\n for (let i2 = 0; i2 < len; ++i2) {\n if (thisCopy[i2] !== targetCopy[i2]) {\n x2 = thisCopy[i2];\n y2 = targetCopy[i2];\n break;\n }\n }\n if (x2 < y2) return -1;\n if (y2 < x2) return 1;\n return 0;\n };\n function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n if (buffer.length === 0) return -1;\n if (typeof byteOffset === "string") {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 2147483647) {\n byteOffset = 2147483647;\n } else if (byteOffset < -2147483648) {\n byteOffset = -2147483648;\n }\n byteOffset = +byteOffset;\n if (numberIsNaN(byteOffset)) {\n byteOffset = dir ? 0 : buffer.length - 1;\n }\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n if (byteOffset >= buffer.length) {\n if (dir) return -1;\n else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;\n else return -1;\n }\n if (typeof val === "string") {\n val = Buffer3.from(val, encoding);\n }\n if (Buffer3.isBuffer(val)) {\n if (val.length === 0) {\n return -1;\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === "number") {\n val = val & 255;\n if (typeof Uint8Array.prototype.indexOf === "function") {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n throw new TypeError("val must be string, number or Buffer");\n }\n function arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n let indexSize = 1;\n let arrLength = arr.length;\n let valLength = val.length;\n if (encoding !== void 0) {\n encoding = String(encoding).toLowerCase();\n if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n function read(buf, i3) {\n if (indexSize === 1) {\n return buf[i3];\n } else {\n return buf.readUInt16BE(i3 * indexSize);\n }\n }\n let i2;\n if (dir) {\n let foundIndex = -1;\n for (i2 = byteOffset; i2 < arrLength; i2++) {\n if (read(arr, i2) === read(val, foundIndex === -1 ? 0 : i2 - foundIndex)) {\n if (foundIndex === -1) foundIndex = i2;\n if (i2 - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i2 -= i2 - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n for (i2 = byteOffset; i2 >= 0; i2--) {\n let found = true;\n for (let j2 = 0; j2 < valLength; j2++) {\n if (read(arr, i2 + j2) !== read(val, j2)) {\n found = false;\n break;\n }\n }\n if (found) return i2;\n }\n }\n return -1;\n }\n Buffer3.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n };\n Buffer3.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n };\n Buffer3.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n };\n function hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n const remaining = buf.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n if (length > remaining) {\n length = remaining;\n }\n }\n const strLen = string.length;\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n let i2;\n for (i2 = 0; i2 < length; ++i2) {\n const parsed = parseInt(string.substr(i2 * 2, 2), 16);\n if (numberIsNaN(parsed)) return i2;\n buf[offset + i2] = parsed;\n }\n return i2;\n }\n function utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n }\n function asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n }\n function base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n }\n function ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n }\n Buffer3.prototype.write = function write(string, offset, length, encoding) {\n if (offset === void 0) {\n encoding = "utf8";\n length = this.length;\n offset = 0;\n } else if (length === void 0 && typeof offset === "string") {\n encoding = offset;\n length = this.length;\n offset = 0;\n } else if (isFinite(offset)) {\n offset = offset >>> 0;\n if (isFinite(length)) {\n length = length >>> 0;\n if (encoding === void 0) encoding = "utf8";\n } else {\n encoding = length;\n length = void 0;\n }\n } else {\n throw new Error(\n "Buffer.write(string, encoding, offset[, length]) is no longer supported"\n );\n }\n const remaining = this.length - offset;\n if (length === void 0 || length > remaining) length = remaining;\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError("Attempt to write outside buffer bounds");\n }\n if (!encoding) encoding = "utf8";\n let loweredCase = false;\n for (; ; ) {\n switch (encoding) {\n case "hex":\n return hexWrite(this, string, offset, length);\n case "utf8":\n case "utf-8":\n return utf8Write(this, string, offset, length);\n case "ascii":\n case "latin1":\n case "binary":\n return asciiWrite(this, string, offset, length);\n case "base64":\n return base64Write(this, string, offset, length);\n case "ucs2":\n case "ucs-2":\n case "utf16le":\n case "utf-16le":\n return ucs2Write(this, string, offset, length);\n default:\n if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);\n encoding = ("" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n };\n Buffer3.prototype.toJSON = function toJSON() {\n return {\n type: "Buffer",\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n };\n function base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n }\n function utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n const res = [];\n let i2 = start;\n while (i2 < end) {\n const firstByte = buf[i2];\n let codePoint = null;\n let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;\n if (i2 + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint;\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 128) {\n codePoint = firstByte;\n }\n break;\n case 2:\n secondByte = buf[i2 + 1];\n if ((secondByte & 192) === 128) {\n tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;\n if (tempCodePoint > 127) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 3:\n secondByte = buf[i2 + 1];\n thirdByte = buf[i2 + 2];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;\n if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 4:\n secondByte = buf[i2 + 1];\n thirdByte = buf[i2 + 2];\n fourthByte = buf[i2 + 3];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;\n if (tempCodePoint > 65535 && tempCodePoint < 1114112) {\n codePoint = tempCodePoint;\n }\n }\n }\n }\n if (codePoint === null) {\n codePoint = 65533;\n bytesPerSequence = 1;\n } else if (codePoint > 65535) {\n codePoint -= 65536;\n res.push(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n res.push(codePoint);\n i2 += bytesPerSequence;\n }\n return decodeCodePointsArray(res);\n }\n var MAX_ARGUMENTS_LENGTH = 4096;\n function decodeCodePointsArray(codePoints) {\n const len = codePoints.length;\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints);\n }\n let res = "";\n let i2 = 0;\n while (i2 < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i2, i2 += MAX_ARGUMENTS_LENGTH)\n );\n }\n return res;\n }\n function asciiSlice(buf, start, end) {\n let ret = "";\n end = Math.min(buf.length, end);\n for (let i2 = start; i2 < end; ++i2) {\n ret += String.fromCharCode(buf[i2] & 127);\n }\n return ret;\n }\n function latin1Slice(buf, start, end) {\n let ret = "";\n end = Math.min(buf.length, end);\n for (let i2 = start; i2 < end; ++i2) {\n ret += String.fromCharCode(buf[i2]);\n }\n return ret;\n }\n function hexSlice(buf, start, end) {\n const len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n let out = "";\n for (let i2 = start; i2 < end; ++i2) {\n out += hexSliceLookupTable[buf[i2]];\n }\n return out;\n }\n function utf16leSlice(buf, start, end) {\n const bytes = buf.slice(start, end);\n let res = "";\n for (let i2 = 0; i2 < bytes.length - 1; i2 += 2) {\n res += String.fromCharCode(bytes[i2] + bytes[i2 + 1] * 256);\n }\n return res;\n }\n Buffer3.prototype.slice = function slice(start, end) {\n const len = this.length;\n start = ~~start;\n end = end === void 0 ? len : ~~end;\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n if (end < start) end = start;\n const newBuf = this.subarray(start, end);\n Object.setPrototypeOf(newBuf, Buffer3.prototype);\n return newBuf;\n };\n function checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");\n if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");\n }\n Buffer3.prototype.readUintLE = Buffer3.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) checkOffset(offset, byteLength2, this.length);\n let val = this[offset];\n let mul = 1;\n let i2 = 0;\n while (++i2 < byteLength2 && (mul *= 256)) {\n val += this[offset + i2] * mul;\n }\n return val;\n };\n Buffer3.prototype.readUintBE = Buffer3.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) {\n checkOffset(offset, byteLength2, this.length);\n }\n let val = this[offset + --byteLength2];\n let mul = 1;\n while (byteLength2 > 0 && (mul *= 256)) {\n val += this[offset + --byteLength2] * mul;\n }\n return val;\n };\n Buffer3.prototype.readUint8 = Buffer3.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n };\n Buffer3.prototype.readUint16LE = Buffer3.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n };\n Buffer3.prototype.readUint16BE = Buffer3.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n };\n Buffer3.prototype.readUint32LE = Buffer3.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;\n };\n Buffer3.prototype.readUint32BE = Buffer3.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n };\n Buffer3.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, "offset");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const lo2 = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;\n const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;\n return BigInt(lo2) + (BigInt(hi) << BigInt(32));\n });\n Buffer3.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, "offset");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n const lo2 = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;\n return (BigInt(hi) << BigInt(32)) + BigInt(lo2);\n });\n Buffer3.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) checkOffset(offset, byteLength2, this.length);\n let val = this[offset];\n let mul = 1;\n let i2 = 0;\n while (++i2 < byteLength2 && (mul *= 256)) {\n val += this[offset + i2] * mul;\n }\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength2);\n return val;\n };\n Buffer3.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) checkOffset(offset, byteLength2, this.length);\n let i2 = byteLength2;\n let mul = 1;\n let val = this[offset + --i2];\n while (i2 > 0 && (mul *= 256)) {\n val += this[offset + --i2] * mul;\n }\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength2);\n return val;\n };\n Buffer3.prototype.readInt8 = function readInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 128)) return this[offset];\n return (255 - this[offset] + 1) * -1;\n };\n Buffer3.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset] | this[offset + 1] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n Buffer3.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset + 1] | this[offset] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n Buffer3.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n };\n Buffer3.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n };\n Buffer3.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, "offset");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);\n return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);\n });\n Buffer3.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, "offset");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);\n });\n Buffer3.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n };\n Buffer3.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n };\n Buffer3.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n };\n Buffer3.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n };\n function checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer3.isBuffer(buf)) throw new TypeError(\'"buffer" argument must be a Buffer instance\');\n if (value > max || value < min) throw new RangeError(\'"value" argument is out of bounds\');\n if (offset + ext > buf.length) throw new RangeError("Index out of range");\n }\n Buffer3.prototype.writeUintLE = Buffer3.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength2) - 1;\n checkInt(this, value, offset, byteLength2, maxBytes, 0);\n }\n let mul = 1;\n let i2 = 0;\n this[offset] = value & 255;\n while (++i2 < byteLength2 && (mul *= 256)) {\n this[offset + i2] = value / mul & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeUintBE = Buffer3.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength2) - 1;\n checkInt(this, value, offset, byteLength2, maxBytes, 0);\n }\n let i2 = byteLength2 - 1;\n let mul = 1;\n this[offset + i2] = value & 255;\n while (--i2 >= 0 && (mul *= 256)) {\n this[offset + i2] = value / mul & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeUint8 = Buffer3.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 255, 0);\n this[offset] = value & 255;\n return offset + 1;\n };\n Buffer3.prototype.writeUint16LE = Buffer3.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n Buffer3.prototype.writeUint16BE = Buffer3.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n Buffer3.prototype.writeUint32LE = Buffer3.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 255;\n return offset + 4;\n };\n Buffer3.prototype.writeUint32BE = Buffer3.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n function wrtBigUInt64LE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo2 = Number(value & BigInt(4294967295));\n buf[offset++] = lo2;\n lo2 = lo2 >> 8;\n buf[offset++] = lo2;\n lo2 = lo2 >> 8;\n buf[offset++] = lo2;\n lo2 = lo2 >> 8;\n buf[offset++] = lo2;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n return offset;\n }\n function wrtBigUInt64BE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo2 = Number(value & BigInt(4294967295));\n buf[offset + 7] = lo2;\n lo2 = lo2 >> 8;\n buf[offset + 6] = lo2;\n lo2 = lo2 >> 8;\n buf[offset + 5] = lo2;\n lo2 = lo2 >> 8;\n buf[offset + 4] = lo2;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset + 3] = hi;\n hi = hi >> 8;\n buf[offset + 2] = hi;\n hi = hi >> 8;\n buf[offset + 1] = hi;\n hi = hi >> 8;\n buf[offset] = hi;\n return offset + 8;\n }\n Buffer3.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));\n });\n Buffer3.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));\n });\n Buffer3.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength2 - 1);\n checkInt(this, value, offset, byteLength2, limit - 1, -limit);\n }\n let i2 = 0;\n let mul = 1;\n let sub = 0;\n this[offset] = value & 255;\n while (++i2 < byteLength2 && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i2 - 1] !== 0) {\n sub = 1;\n }\n this[offset + i2] = (value / mul >> 0) - sub & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength2 - 1);\n checkInt(this, value, offset, byteLength2, limit - 1, -limit);\n }\n let i2 = byteLength2 - 1;\n let mul = 1;\n let sub = 0;\n this[offset + i2] = value & 255;\n while (--i2 >= 0 && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i2 + 1] !== 0) {\n sub = 1;\n }\n this[offset + i2] = (value / mul >> 0) - sub & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 127, -128);\n if (value < 0) value = 255 + value + 1;\n this[offset] = value & 255;\n return offset + 1;\n };\n Buffer3.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n Buffer3.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n Buffer3.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n return offset + 4;\n };\n Buffer3.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n if (value < 0) value = 4294967295 + value + 1;\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n Buffer3.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));\n });\n Buffer3.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));\n });\n function checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError("Index out of range");\n if (offset < 0) throw new RangeError("Index out of range");\n }\n function writeFloat(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22);\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n }\n Buffer3.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n };\n Buffer3.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n };\n function writeDouble(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292);\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n }\n Buffer3.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n };\n Buffer3.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n };\n Buffer3.prototype.copy = function copy(target, targetStart, start, end) {\n if (!Buffer3.isBuffer(target)) throw new TypeError("argument should be a Buffer");\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start;\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0;\n if (targetStart < 0) {\n throw new RangeError("targetStart out of bounds");\n }\n if (start < 0 || start >= this.length) throw new RangeError("Index out of range");\n if (end < 0) throw new RangeError("sourceEnd out of bounds");\n if (end > this.length) end = this.length;\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n const len = end - start;\n if (this === target && typeof Uint8Array.prototype.copyWithin === "function") {\n this.copyWithin(targetStart, start, end);\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n );\n }\n return len;\n };\n Buffer3.prototype.fill = function fill(val, start, end, encoding) {\n if (typeof val === "string") {\n if (typeof start === "string") {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === "string") {\n encoding = end;\n end = this.length;\n }\n if (encoding !== void 0 && typeof encoding !== "string") {\n throw new TypeError("encoding must be a string");\n }\n if (typeof encoding === "string" && !Buffer3.isEncoding(encoding)) {\n throw new TypeError("Unknown encoding: " + encoding);\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0);\n if (encoding === "utf8" && code < 128 || encoding === "latin1") {\n val = code;\n }\n }\n } else if (typeof val === "number") {\n val = val & 255;\n } else if (typeof val === "boolean") {\n val = Number(val);\n }\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError("Out of range index");\n }\n if (end <= start) {\n return this;\n }\n start = start >>> 0;\n end = end === void 0 ? this.length : end >>> 0;\n if (!val) val = 0;\n let i2;\n if (typeof val === "number") {\n for (i2 = start; i2 < end; ++i2) {\n this[i2] = val;\n }\n } else {\n const bytes = Buffer3.isBuffer(val) ? val : Buffer3.from(val, encoding);\n const len = bytes.length;\n if (len === 0) {\n throw new TypeError(\'The value "\' + val + \'" is invalid for argument "value"\');\n }\n for (i2 = 0; i2 < end - start; ++i2) {\n this[i2 + start] = bytes[i2 % len];\n }\n }\n return this;\n };\n var errors = {};\n function E2(sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor() {\n super();\n Object.defineProperty(this, "message", {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n });\n this.name = `${this.name} [${sym}]`;\n this.stack;\n delete this.name;\n }\n get code() {\n return sym;\n }\n set code(value) {\n Object.defineProperty(this, "code", {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n });\n }\n toString() {\n return `${this.name} [${sym}]: ${this.message}`;\n }\n };\n }\n E2(\n "ERR_BUFFER_OUT_OF_BOUNDS",\n function(name) {\n if (name) {\n return `${name} is outside of buffer bounds`;\n }\n return "Attempt to access memory outside buffer bounds";\n },\n RangeError\n );\n E2(\n "ERR_INVALID_ARG_TYPE",\n function(name, actual) {\n return `The "${name}" argument must be of type number. Received type ${typeof actual}`;\n },\n TypeError\n );\n E2(\n "ERR_OUT_OF_RANGE",\n function(str, range, input) {\n let msg = `The value of "${str}" is out of range.`;\n let received = input;\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input));\n } else if (typeof input === "bigint") {\n received = String(input);\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received);\n }\n received += "n";\n }\n msg += ` It must be ${range}. Received ${received}`;\n return msg;\n },\n RangeError\n );\n function addNumericalSeparator(val) {\n let res = "";\n let i2 = val.length;\n const start = val[0] === "-" ? 1 : 0;\n for (; i2 >= start + 4; i2 -= 3) {\n res = `_${val.slice(i2 - 3, i2)}${res}`;\n }\n return `${val.slice(0, i2)}${res}`;\n }\n function checkBounds(buf, offset, byteLength2) {\n validateNumber(offset, "offset");\n if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) {\n boundsError(offset, buf.length - (byteLength2 + 1));\n }\n }\n function checkIntBI(value, min, max, buf, offset, byteLength2) {\n if (value > max || value < min) {\n const n2 = typeof min === "bigint" ? "n" : "";\n let range;\n if (byteLength2 > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n2} and < 2${n2} ** ${(byteLength2 + 1) * 8}${n2}`;\n } else {\n range = `>= -(2${n2} ** ${(byteLength2 + 1) * 8 - 1}${n2}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n2}`;\n }\n } else {\n range = `>= ${min}${n2} and <= ${max}${n2}`;\n }\n throw new errors.ERR_OUT_OF_RANGE("value", range, value);\n }\n checkBounds(buf, offset, byteLength2);\n }\n function validateNumber(value, name) {\n if (typeof value !== "number") {\n throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);\n }\n }\n function boundsError(value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type);\n throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value);\n }\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();\n }\n throw new errors.ERR_OUT_OF_RANGE(\n type || "offset",\n `>= ${type ? 1 : 0} and <= ${length}`,\n value\n );\n }\n var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;\n function base64clean(str) {\n str = str.split("=")[0];\n str = str.trim().replace(INVALID_BASE64_RE, "");\n if (str.length < 2) return "";\n while (str.length % 4 !== 0) {\n str = str + "=";\n }\n return str;\n }\n function utf8ToBytes(string, units) {\n units = units || Infinity;\n let codePoint;\n const length = string.length;\n let leadSurrogate = null;\n const bytes = [];\n for (let i2 = 0; i2 < length; ++i2) {\n codePoint = string.charCodeAt(i2);\n if (codePoint > 55295 && codePoint < 57344) {\n if (!leadSurrogate) {\n if (codePoint > 56319) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n } else if (i2 + 1 === length) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n }\n leadSurrogate = codePoint;\n continue;\n }\n if (codePoint < 56320) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n leadSurrogate = codePoint;\n continue;\n }\n codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;\n } else if (leadSurrogate) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n }\n leadSurrogate = null;\n if (codePoint < 128) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 2048) {\n if ((units -= 2) < 0) break;\n bytes.push(\n codePoint >> 6 | 192,\n codePoint & 63 | 128\n );\n } else if (codePoint < 65536) {\n if ((units -= 3) < 0) break;\n bytes.push(\n codePoint >> 12 | 224,\n codePoint >> 6 & 63 | 128,\n codePoint & 63 | 128\n );\n } else if (codePoint < 1114112) {\n if ((units -= 4) < 0) break;\n bytes.push(\n codePoint >> 18 | 240,\n codePoint >> 12 & 63 | 128,\n codePoint >> 6 & 63 | 128,\n codePoint & 63 | 128\n );\n } else {\n throw new Error("Invalid code point");\n }\n }\n return bytes;\n }\n function asciiToBytes(str) {\n const byteArray = [];\n for (let i2 = 0; i2 < str.length; ++i2) {\n byteArray.push(str.charCodeAt(i2) & 255);\n }\n return byteArray;\n }\n function utf16leToBytes(str, units) {\n let c2, hi, lo2;\n const byteArray = [];\n for (let i2 = 0; i2 < str.length; ++i2) {\n if ((units -= 2) < 0) break;\n c2 = str.charCodeAt(i2);\n hi = c2 >> 8;\n lo2 = c2 % 256;\n byteArray.push(lo2);\n byteArray.push(hi);\n }\n return byteArray;\n }\n function base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n }\n function blitBuffer(src, dst, offset, length) {\n let i2;\n for (i2 = 0; i2 < length; ++i2) {\n if (i2 + offset >= dst.length || i2 >= src.length) break;\n dst[i2 + offset] = src[i2];\n }\n return i2;\n }\n function isInstance(obj, type) {\n return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;\n }\n function numberIsNaN(obj) {\n return obj !== obj;\n }\n var hexSliceLookupTable = (function() {\n const alphabet = "0123456789abcdef";\n const table = new Array(256);\n for (let i2 = 0; i2 < 16; ++i2) {\n const i16 = i2 * 16;\n for (let j2 = 0; j2 < 16; ++j2) {\n table[i16 + j2] = alphabet[i2] + alphabet[j2];\n }\n }\n return table;\n })();\n function defineBigIntMethod(fn) {\n return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;\n }\n function BufferBigIntNotDefined() {\n throw new Error("BigInt not supported");\n }\n }\n});\n\n// src/rune/isolation/utils-bootstrap.js\nimport * as md from "crunes:md";\nimport * as tree from "crunes:tree";\n\n// src/docs/help-render.js\nvar PAD = 24;\nfunction row(label, description, indent = " ") {\n const padded = label.length >= PAD ? label + " " : label.padEnd(PAD);\n return `${indent}${padded} ${description ?? ""}`.trimEnd();\n}\nfunction positionalSpecs(node) {\n return (node?.positionals ?? []).map((p2) => p2.spec).join(" ");\n}\nfunction flattenCommands(commands, prefix = "") {\n const rows = [];\n for (const cmd of commands ?? []) {\n const path = prefix ? `${prefix} ${cmd.name}` : cmd.name;\n const specs = positionalSpecs(cmd);\n rows.push({\n path,\n label: specs ? `${path} ${specs}` : path,\n description: cmd.description ?? "",\n node: cmd\n });\n rows.push(...flattenCommands(cmd.commands ?? [], path));\n }\n return rows;\n}\nfunction selectNode(schema, segments) {\n let node = schema;\n const matched = [];\n for (const seg of segments ?? []) {\n const children = node?.commands ?? [];\n const next = children.find((c2) => c2.name === seg);\n if (!next) {\n return {\n node: null,\n matchedPath: matched.join(" "),\n failedAt: seg,\n candidates: children.map((c2) => c2.name)\n };\n }\n node = next;\n matched.push(seg);\n }\n return {\n node,\n matchedPath: matched.join(" "),\n failedAt: null,\n candidates: (node?.commands ?? []).map((c2) => c2.name)\n };\n}\nfunction toSegments(path) {\n if (Array.isArray(path)) return path.filter(Boolean).map(String);\n return String(path ?? "").trim().split(/\\s+/).filter(Boolean);\n}\nfunction verb(lifecycle) {\n return lifecycle === "repl" ? "repl" : "run";\n}\nvar choicesNote = (choices) => choices ? ` [choices: ${choices.map((c2) => JSON.stringify(c2)).join(", ")}]` : "";\nvar typeNote = (type) => type ? ` [${type}]` : "";\nfunction optionRows(options, indent = " ") {\n return (options ?? []).map((opt) => {\n const def = opt.def !== void 0 ? ` [default: ${JSON.stringify(opt.def)}]` : "";\n const required = opt.required ? " [required]" : "";\n return row(opt.flags, `${opt.description ?? ""}${typeNote(opt.type)}${def}${required}${choicesNote(opt.choices)}`, indent);\n });\n}\nfunction positionalRow(p2, indent) {\n return row(p2.spec ?? "", `${p2.description ?? ""}${typeNote(p2.type)}${choicesNote(p2.choices)}`, indent);\n}\nfunction exampleLines(examples, indent = " ") {\n const lines = [];\n for (const ex of examples ?? []) {\n lines.push(`${indent}${ex.usage}`);\n if (ex.description) lines.push(`${indent} ${ex.description}`);\n }\n return lines;\n}\nfunction formatCommandPage(node, meta) {\n const key = meta?.key ?? "rune";\n const path = meta?.path ?? "";\n const specs = positionalSpecs(node);\n const children = node?.commands ?? [];\n const usage = [`Usage: crunes ${verb(meta?.lifecycle)} ${key}`];\n if (path) usage.push(path);\n if (specs) usage.push(specs);\n else if (children.length > 0) usage.push("<command>");\n usage.push("[options]");\n const lines = [usage.join(" ")];\n if (node?.description) {\n lines.push("");\n lines.push(` ${node.description}`);\n }\n const positionals = node?.positionals ?? [];\n if (positionals.length > 0) {\n lines.push("");\n lines.push("Positionals:");\n for (const p2 of positionals) lines.push(positionalRow(p2));\n }\n const options = node?.options ?? [];\n if (options.length > 0) {\n lines.push("");\n lines.push("Options:");\n lines.push(...optionRows(options));\n }\n if (children.length > 0) {\n lines.push("");\n lines.push("Commands:");\n for (const child of children) {\n const childPath = path ? `${path} ${child.name}` : child.name;\n const childSpecs = positionalSpecs(child);\n lines.push(row(childSpecs ? `${childPath} ${childSpecs}` : childPath, child.description));\n }\n }\n const examples = node?.examples ?? [];\n if (examples.length > 0) {\n lines.push("");\n lines.push("Examples:");\n lines.push(...exampleLines(examples));\n }\n return lines.join("\\n");\n}\nfunction formatRuneIndex(schema, meta) {\n const key = meta?.key ?? "rune";\n const label = meta?.description ?? meta?.name ?? null;\n const commands = schema?.commands ?? [];\n const specs = positionalSpecs(schema);\n const lines = [`Rune: ${key}${label ? ` \\u2014 ${label}` : ""}`];\n if (meta?.relativePath) lines.push(`File (project-relative): ${meta.relativePath}`);\n if (meta?.runs) lines.push(`Runs: ${meta.runs}`);\n if (meta?.passThrough) lines.push("No argument schema \\u2014 arguments are passed to it unchanged. Add an args block to document and parse them.");\n const usage = [`Usage: crunes ${verb(meta?.lifecycle)} ${key}`];\n if (specs) usage.push(specs);\n else if (commands.length > 0) usage.push("<command>");\n usage.push("[options]");\n lines.push("");\n lines.push(usage.join(" "));\n const positionals = schema?.positionals ?? [];\n if (positionals.length > 0) {\n lines.push("");\n lines.push("Positionals:");\n for (const p2 of positionals) lines.push(positionalRow(p2));\n }\n const options = schema?.options ?? [];\n if (options.length > 0) {\n lines.push("");\n lines.push("Options:");\n lines.push(...optionRows(options));\n }\n if (commands.length > 0) {\n lines.push("");\n lines.push("Commands:");\n for (const r2 of flattenCommands(commands)) lines.push(row(r2.label, r2.description));\n }\n const rootExamples = schema?.examples ?? [];\n if (commands.length === 0 && rootExamples.length > 0) {\n lines.push("");\n lines.push("Examples:");\n lines.push(...exampleLines(rootExamples));\n }\n const replCommands = meta?.repl?.commands ?? [];\n if (replCommands.length > 0) {\n lines.push("");\n lines.push("REPL commands:");\n for (const c2 of replCommands) lines.push(row(`/${c2.name}`, c2.description));\n }\n if (meta?.includeBatch === true) {\n lines.push("");\n lines.push("Batch:");\n if (!meta.batch) {\n lines.push(" (no batch block declared \\u2014 this rune cannot appear in a -b batch)");\n } else {\n const allow = meta.batch.allow ?? [];\n const deny = meta.batch.deny ?? [];\n lines.push(` allow: ${allow.length ? allow.join(", ") : "(none)"}`);\n if (deny.length) lines.push(` deny: ${deny.join(", ")}`);\n }\n }\n if (commands.length > 0) {\n lines.push("");\n lines.push(`Drill down: crunes docs rune ${key} <command>`);\n }\n return lines.join("\\n");\n}\n\n// src/rune/isolation/utils-bootstrap.js\nvar import_fast_text_encoding = __toESM(require_text_min(), 1);\n\n// node_modules/web-streams-polyfill/dist/ponyfill.mjs\nfunction e() {\n}\nfunction t(e2) {\n return "object" == typeof e2 && null !== e2 || "function" == typeof e2;\n}\nvar r = e;\nfunction o(e2, t2) {\n try {\n Object.defineProperty(e2, "name", { value: t2, configurable: true });\n } catch (e3) {\n }\n}\nvar n = Promise;\nvar i = Promise.resolve.bind(n);\nvar a = Promise.prototype.then;\nvar s = Promise.reject.bind(n);\nvar l = i;\nfunction u(e2) {\n return new n(e2);\n}\nfunction c(e2) {\n return u((t2) => t2(e2));\n}\nfunction d(e2) {\n return s(e2);\n}\nfunction f(e2, t2, r2) {\n return a.call(e2, t2, r2);\n}\nfunction h(e2, t2, o2) {\n f(f(e2, t2, o2), void 0, r);\n}\nfunction b(e2, t2) {\n h(e2, t2);\n}\nfunction _(e2, t2) {\n h(e2, void 0, t2);\n}\nfunction m(e2, t2, r2) {\n return f(e2, t2, r2);\n}\nfunction p(e2) {\n f(e2, void 0, r);\n}\nvar y = (e2) => {\n if ("function" == typeof queueMicrotask) y = queueMicrotask;\n else {\n const e3 = c(void 0);\n y = (t2) => f(e3, t2);\n }\n return y(e2);\n};\nfunction S(e2, t2, r2) {\n if ("function" != typeof e2) throw new TypeError("Argument is not a function");\n return Function.prototype.apply.call(e2, t2, r2);\n}\nfunction g(e2, t2, r2) {\n try {\n return c(S(e2, t2, r2));\n } catch (e3) {\n return d(e3);\n }\n}\nvar v = class {\n constructor() {\n this._cursor = 0, this._size = 0, this._front = { _elements: [], _next: void 0 }, this._back = this._front, this._cursor = 0, this._size = 0;\n }\n get length() {\n return this._size;\n }\n push(e2) {\n const t2 = this._back;\n let r2 = t2;\n 16383 === t2._elements.length && (r2 = { _elements: [], _next: void 0 }), t2._elements.push(e2), r2 !== t2 && (this._back = r2, t2._next = r2), ++this._size;\n }\n shift() {\n const e2 = this._front;\n let t2 = e2;\n const r2 = this._cursor;\n let o2 = r2 + 1;\n const n2 = e2._elements, i2 = n2[r2];\n return 16384 === o2 && (t2 = e2._next, o2 = 0), --this._size, this._cursor = o2, e2 !== t2 && (this._front = t2), n2[r2] = void 0, i2;\n }\n forEach(e2) {\n let t2 = this._cursor, r2 = this._front, o2 = r2._elements;\n for (; !(t2 === o2.length && void 0 === r2._next || t2 === o2.length && (r2 = r2._next, o2 = r2._elements, t2 = 0, 0 === o2.length)); ) e2(o2[t2]), ++t2;\n }\n peek() {\n const e2 = this._front, t2 = this._cursor;\n return e2._elements[t2];\n }\n};\nvar w = /* @__PURE__ */ Symbol("[[AbortSteps]]");\nvar R = /* @__PURE__ */ Symbol("[[ErrorSteps]]");\nvar T = /* @__PURE__ */ Symbol("[[CancelSteps]]");\nvar P = /* @__PURE__ */ Symbol("[[PullSteps]]");\nvar C = /* @__PURE__ */ Symbol("[[CanPullSyncSteps]]");\nvar q = /* @__PURE__ */ Symbol("[[ReleaseSteps]]");\nfunction E(e2, t2) {\n e2._ownerReadableStream = t2, t2._reader = e2, "readable" === t2._state ? j(e2) : "closed" === t2._state ? (function(e3) {\n j(e3), z(e3);\n })(e2) : k(e2, t2._storedError);\n}\nfunction W(e2, t2) {\n return Mr(e2._ownerReadableStream, t2);\n}\nfunction O(e2) {\n const t2 = e2._ownerReadableStream;\n "readable" === t2._state ? A(e2, new TypeError("Reader was released and can no longer be used to monitor the stream\'s closedness")) : (function(e3, t3) {\n k(e3, t3);\n })(e2, new TypeError("Reader was released and can no longer be used to monitor the stream\'s closedness")), t2._readableStreamController[q](), t2._reader = void 0, e2._ownerReadableStream = void 0;\n}\nfunction B(e2) {\n return new TypeError("Cannot " + e2 + " a stream using a released reader");\n}\nfunction j(e2) {\n e2._closedPromise = u((t2, r2) => {\n e2._closedPromise_resolve = t2, e2._closedPromise_reject = r2;\n });\n}\nfunction k(e2, t2) {\n j(e2), A(e2, t2);\n}\nfunction A(e2, t2) {\n void 0 !== e2._closedPromise_reject && (p(e2._closedPromise), e2._closedPromise_reject(t2), e2._closedPromise_resolve = void 0, e2._closedPromise_reject = void 0);\n}\nfunction z(e2) {\n void 0 !== e2._closedPromise_resolve && (e2._closedPromise_resolve(void 0), e2._closedPromise_resolve = void 0, e2._closedPromise_reject = void 0);\n}\nvar D = Number.isFinite || function(e2) {\n return "number" == typeof e2 && isFinite(e2);\n};\nvar F = Math.trunc || function(e2) {\n return e2 < 0 ? Math.ceil(e2) : Math.floor(e2);\n};\nfunction L(e2, t2) {\n if (void 0 !== e2 && ("object" != typeof (r2 = e2) && "function" != typeof r2)) throw new TypeError(`${t2} is not an object.`);\n var r2;\n}\nfunction I(e2, t2) {\n if ("function" != typeof e2) throw new TypeError(`${t2} is not a function.`);\n}\nfunction $(e2, t2) {\n if (!/* @__PURE__ */ (function(e3) {\n return "object" == typeof e3 && null !== e3 || "function" == typeof e3;\n })(e2)) throw new TypeError(`${t2} is not an object.`);\n}\nfunction M(e2, t2, r2) {\n if (void 0 === e2) throw new TypeError(`Parameter ${t2} is required in \'${r2}\'.`);\n}\nfunction Y(e2, t2, r2) {\n if (void 0 === e2) throw new TypeError(`${t2} is required in \'${r2}\'.`);\n}\nfunction x(e2) {\n return Number(e2);\n}\nfunction Q(e2) {\n return 0 === e2 ? 0 : e2;\n}\nfunction N(e2, t2) {\n const r2 = Number.MAX_SAFE_INTEGER;\n let o2 = Number(e2);\n if (o2 = Q(o2), !D(o2)) throw new TypeError(`${t2} is not a finite number`);\n if (o2 = (function(e3) {\n return Q(F(e3));\n })(o2), o2 < 0 || o2 > r2) throw new TypeError(`${t2} is outside the accepted range of 0 to ${r2}, inclusive`);\n return D(o2) && 0 !== o2 ? o2 : 0;\n}\nfunction H(e2, t2) {\n if (!Ir(e2)) throw new TypeError(`${t2} is not a ReadableStream.`);\n}\nfunction V(e2) {\n return new ReadableStreamDefaultReader(e2);\n}\nfunction U(e2, t2) {\n e2._reader._readRequests.push(t2);\n}\nfunction G(e2, t2, r2) {\n const o2 = e2._reader._readRequests.shift();\n r2 ? o2._closeSteps() : o2._chunkSteps(t2);\n}\nfunction X(e2) {\n return e2._reader._readRequests.length;\n}\nfunction J(e2) {\n const t2 = e2._reader;\n return void 0 !== t2 && !!ee(t2);\n}\nvar ReadableStreamDefaultReader = class {\n constructor(e2) {\n if (M(e2, 1, "ReadableStreamDefaultReader"), H(e2, "First parameter"), $r(e2)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");\n E(this, e2), this._readRequests = new v();\n }\n get closed() {\n return ee(this) ? this._closedPromise : d(ne("closed"));\n }\n cancel(e2 = void 0) {\n return ee(this) ? void 0 === this._ownerReadableStream ? d(B("cancel")) : W(this, e2) : d(ne("cancel"));\n }\n read() {\n if (!ee(this)) return d(ne("read"));\n if (void 0 === this._ownerReadableStream) return d(B("read from"));\n const e2 = re(this) ? new Z() : new K();\n return te(this, e2), e2._promise;\n }\n releaseLock() {\n if (!ee(this)) throw ne("releaseLock");\n void 0 !== this._ownerReadableStream && (function(e2) {\n O(e2);\n const t2 = new TypeError("Reader was released");\n oe(e2, t2);\n })(this);\n }\n};\nObject.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), o(ReadableStreamDefaultReader.prototype.cancel, "cancel"), o(ReadableStreamDefaultReader.prototype.read, "read"), o(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true });\nvar K = class {\n constructor() {\n this._promise = u((e2, t2) => {\n this._resolvePromise = e2, this._rejectPromise = t2;\n });\n }\n _chunkSteps(e2) {\n this._resolvePromise({ value: e2, done: false });\n }\n _closeSteps() {\n this._resolvePromise({ value: void 0, done: true });\n }\n _errorSteps(e2) {\n this._rejectPromise(e2);\n }\n};\nvar Z = class {\n constructor() {\n this._promise = void 0;\n }\n _chunkSteps(e2) {\n this._promise = l({ value: e2, done: false });\n }\n _closeSteps() {\n this._promise = l({ value: void 0, done: true });\n }\n _errorSteps(e2) {\n this._promise = d(e2);\n }\n};\nfunction ee(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_readRequests") && e2 instanceof ReadableStreamDefaultReader);\n}\nfunction te(e2, t2) {\n const r2 = e2._ownerReadableStream;\n r2._disturbed = true, "closed" === r2._state ? t2._closeSteps() : "errored" === r2._state ? t2._errorSteps(r2._storedError) : r2._readableStreamController[P](t2);\n}\nfunction re(e2) {\n const t2 = e2._ownerReadableStream;\n return "closed" === t2._state || ("errored" === t2._state || t2._readableStreamController[C]());\n}\nfunction oe(e2, t2) {\n const r2 = e2._readRequests;\n e2._readRequests = new v(), r2.forEach((e3) => {\n e3._errorSteps(t2);\n });\n}\nfunction ne(e2) {\n return new TypeError(`ReadableStreamDefaultReader.prototype.${e2} can only be used on a ReadableStreamDefaultReader`);\n}\nvar ie;\nvar ae;\nvar se;\nfunction le(e2) {\n return e2.slice();\n}\nfunction ue(e2, t2, r2, o2, n2) {\n new Uint8Array(e2).set(new Uint8Array(r2, o2, n2), t2);\n}\nvar ce = (e2) => (ce = "function" == typeof e2.transfer ? (e3) => e3.transfer() : "function" == typeof structuredClone ? (e3) => structuredClone(e3, { transfer: [e3] }) : (e3) => e3, ce(e2));\nvar de = (e2) => (de = "boolean" == typeof e2.detached ? (e3) => e3.detached : (e3) => 0 === e3.byteLength, de(e2));\nfunction fe(e2, t2, r2) {\n if (e2.slice) return e2.slice(t2, r2);\n const o2 = r2 - t2, n2 = new ArrayBuffer(o2);\n return ue(n2, 0, e2, t2, o2), n2;\n}\nfunction he(e2, t2) {\n const r2 = e2[t2];\n if (null != r2) {\n if ("function" != typeof r2) throw new TypeError(`${String(t2)} is not a function`);\n return r2;\n }\n}\nfunction be(e2) {\n try {\n const t2 = e2.done, r2 = e2.value;\n return f(l(r2), (e3) => ({ done: t2, value: e3 }));\n } catch (e3) {\n return d(e3);\n }\n}\nvar _e = null !== (se = null !== (ie = Symbol.asyncIterator) && void 0 !== ie ? ie : null === (ae = Symbol.for) || void 0 === ae ? void 0 : ae.call(Symbol, "Symbol.asyncIterator")) && void 0 !== se ? se : "@@asyncIterator";\nfunction me(e2, r2 = "sync", o2) {\n if (void 0 === o2) if ("async" === r2) {\n if (void 0 === (o2 = he(e2, _e))) {\n return (function(e3) {\n const r3 = { next() {\n let t2;\n try {\n t2 = pe(e3);\n } catch (e4) {\n return d(e4);\n }\n return be(t2);\n }, return(r4) {\n let o3;\n try {\n const t2 = he(e3.iterator, "return");\n if (void 0 === t2) return c({ done: true, value: r4 });\n o3 = S(t2, e3.iterator, [r4]);\n } catch (e4) {\n return d(e4);\n }\n return t(o3) ? be(o3) : d(new TypeError("The iterator.return() method must return an object"));\n } };\n return { iterator: r3, nextMethod: r3.next, done: false };\n })(me(e2, "sync", he(e2, Symbol.iterator)));\n }\n } else o2 = he(e2, Symbol.iterator);\n if (void 0 === o2) throw new TypeError("The object is not iterable");\n const n2 = S(o2, e2, []);\n if (!t(n2)) throw new TypeError("The iterator method must return an object");\n return { iterator: n2, nextMethod: n2.next, done: false };\n}\nfunction pe(e2) {\n const r2 = S(e2.nextMethod, e2.iterator, []);\n if (!t(r2)) throw new TypeError("The iterator.next() method must return an object");\n return r2;\n}\nvar ye = class {\n constructor(e2, t2) {\n this._ongoingPromise = void 0, this._isFinished = false, this._reader = e2, this._preventCancel = t2;\n }\n next() {\n const e2 = () => this._nextSteps();\n return this._ongoingPromise = this._ongoingPromise ? m(this._ongoingPromise, e2, e2) : e2(), this._ongoingPromise;\n }\n return(e2) {\n const t2 = () => this._returnSteps(e2);\n return this._ongoingPromise = this._ongoingPromise ? m(this._ongoingPromise, t2, t2) : t2(), this._ongoingPromise;\n }\n _nextSteps() {\n if (this._isFinished) return Promise.resolve({ value: void 0, done: true });\n const e2 = this._reader, t2 = new Se(this);\n return te(e2, t2), t2._promise;\n }\n _returnSteps(e2) {\n if (this._isFinished) return Promise.resolve({ value: e2, done: true });\n this._isFinished = true;\n const t2 = this._reader;\n if (!this._preventCancel) {\n const r2 = W(t2, e2);\n return O(t2), m(r2, () => ({ value: e2, done: true }));\n }\n return O(t2), c({ value: e2, done: true });\n }\n};\nvar Se = class {\n constructor(e2) {\n this._iterator = e2, this._promise = u((e3, t2) => {\n this._resolvePromise = e3, this._rejectPromise = t2;\n });\n }\n _chunkSteps(e2) {\n this._iterator._ongoingPromise = void 0, y(() => this._resolvePromise({ value: e2, done: false }));\n }\n _closeSteps() {\n const e2 = this._iterator;\n e2._ongoingPromise = void 0, e2._isFinished = true, O(e2._reader), this._resolvePromise({ value: void 0, done: true });\n }\n _errorSteps(e2) {\n const t2 = this._iterator;\n t2._ongoingPromise = void 0, t2._isFinished = true, O(t2._reader), this._rejectPromise(e2);\n }\n};\nvar ge = { next() {\n return ve(this) ? this._asyncIteratorImpl.next() : d(we("next"));\n}, return(e2) {\n return ve(this) ? this._asyncIteratorImpl.return(e2) : d(we("return"));\n}, [_e]() {\n return this;\n} };\nfunction ve(e2) {\n if (!t(e2)) return false;\n if (!Object.prototype.hasOwnProperty.call(e2, "_asyncIteratorImpl")) return false;\n try {\n return e2._asyncIteratorImpl instanceof ye;\n } catch (e3) {\n return false;\n }\n}\nfunction we(e2) {\n return new TypeError(`ReadableStreamAsyncIterator.${e2} can only be used on a ReadableSteamAsyncIterator`);\n}\nObject.defineProperty(ge, _e, { enumerable: false });\nvar Re = Number.isNaN || function(e2) {\n return e2 != e2;\n};\nfunction Te(e2) {\n const t2 = fe(e2.buffer, e2.byteOffset, e2.byteOffset + e2.byteLength);\n return new Uint8Array(t2);\n}\nfunction Pe(e2) {\n const t2 = e2._queue.shift();\n return e2._queueTotalSize -= t2.size, e2._queueTotalSize < 0 && (e2._queueTotalSize = 0), t2.value;\n}\nfunction Ce(e2, t2, r2) {\n if ("number" != typeof (o2 = r2) || Re(o2) || o2 < 0 || r2 === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number.");\n var o2;\n e2._queue.push({ value: t2, size: r2 }), e2._queueTotalSize += r2;\n}\nfunction qe(e2) {\n e2._queue = new v(), e2._queueTotalSize = 0;\n}\nfunction Ee(e2) {\n return e2 === DataView;\n}\nfunction We(e2) {\n return Ee(e2) ? 1 : e2.BYTES_PER_ELEMENT;\n}\nvar ReadableStreamBYOBRequest = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get view() {\n if (!Be(this)) throw ot("view");\n return this._view;\n }\n respond(e2) {\n if (!Be(this)) throw ot("respond");\n if (M(e2, 1, "respond"), e2 = N(e2, "First parameter"), void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");\n if (de(this._view.buffer)) throw new TypeError("The BYOB request\'s buffer has been detached and so cannot be used as a response");\n et(this._associatedReadableByteStreamController, e2);\n }\n respondWithNewView(e2) {\n if (!Be(this)) throw ot("respondWithNewView");\n if (M(e2, 1, "respondWithNewView"), !ArrayBuffer.isView(e2)) throw new TypeError("You can only respond with array buffer views");\n if (void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");\n if (de(e2.buffer)) throw new TypeError("The given view\'s buffer has been detached and so cannot be used as a response");\n tt(this._associatedReadableByteStreamController, e2);\n }\n};\nObject.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), o(ReadableStreamBYOBRequest.prototype.respond, "respond"), o(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true });\nvar ReadableByteStreamController = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get byobRequest() {\n if (!Oe(this)) throw nt("byobRequest");\n return Ke(this);\n }\n get desiredSize() {\n if (!Oe(this)) throw nt("desiredSize");\n return Ze(this);\n }\n close() {\n if (!Oe(this)) throw nt("close");\n if (this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");\n const e2 = this._controlledReadableByteStream._state;\n if ("readable" !== e2) throw new TypeError(`The stream (in ${e2} state) is not in the readable state and cannot be closed`);\n Ue(this);\n }\n enqueue(e2) {\n if (!Oe(this)) throw nt("enqueue");\n if (M(e2, 1, "enqueue"), !ArrayBuffer.isView(e2)) throw new TypeError("chunk must be an array buffer view");\n if (0 === e2.byteLength) throw new TypeError("chunk must have non-zero byteLength");\n if (0 === e2.buffer.byteLength) throw new TypeError("chunk\'s buffer must have non-zero byteLength");\n if (this._closeRequested) throw new TypeError("stream is closed or draining");\n const t2 = this._controlledReadableByteStream._state;\n if ("readable" !== t2) throw new TypeError(`The stream (in ${t2} state) is not in the readable state and cannot be enqueued to`);\n Ge(this, e2);\n }\n error(e2 = void 0) {\n if (!Oe(this)) throw nt("error");\n Xe(this, e2);\n }\n [T](e2) {\n ke(this), qe(this);\n const t2 = this._cancelAlgorithm(e2);\n return Ve(this), t2;\n }\n [P](e2) {\n const t2 = this._controlledReadableByteStream;\n if (this._queueTotalSize > 0) return void Je(this, e2);\n const r2 = this._autoAllocateChunkSize;\n if (void 0 !== r2) {\n let t3;\n try {\n t3 = new ArrayBuffer(r2);\n } catch (t4) {\n return void e2._errorSteps(t4);\n }\n const o2 = { buffer: t3, bufferByteLength: r2, byteOffset: 0, byteLength: r2, bytesFilled: 0, minimumFill: 1, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" };\n this._pendingPullIntos.push(o2);\n }\n U(t2, e2), je(this);\n }\n [C]() {\n return this._queueTotalSize > 0;\n }\n [q]() {\n if (this._pendingPullIntos.length > 0) {\n const e2 = this._pendingPullIntos.peek();\n e2.readerType = "none", this._pendingPullIntos = new v(), this._pendingPullIntos.push(e2);\n }\n }\n};\nfunction Oe(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_controlledReadableByteStream") && e2 instanceof ReadableByteStreamController);\n}\nfunction Be(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_associatedReadableByteStreamController") && e2 instanceof ReadableStreamBYOBRequest);\n}\nfunction je(e2) {\n const t2 = (function(e3) {\n const t3 = e3._controlledReadableByteStream;\n if ("readable" !== t3._state) return false;\n if (e3._closeRequested) return false;\n if (!e3._started) return false;\n if (J(t3) && X(t3) > 0) return true;\n if (ut(t3) && lt(t3) > 0) return true;\n const r2 = Ze(e3);\n if (r2 > 0) return true;\n return false;\n })(e2);\n if (!t2) return;\n if (e2._pulling) return void (e2._pullAgain = true);\n e2._pulling = true;\n h(e2._pullAlgorithm(), () => (e2._pulling = false, e2._pullAgain && (e2._pullAgain = false, je(e2)), null), (t3) => (Xe(e2, t3), null));\n}\nfunction ke(e2) {\n xe(e2), e2._pendingPullIntos = new v();\n}\nfunction Ae(e2, t2) {\n let r2 = false;\n "closed" === e2._state && (r2 = true);\n const o2 = De(t2);\n "default" === t2.readerType ? G(e2, o2, r2) : (function(e3, t3, r3) {\n const o3 = e3._reader, n2 = o3._readIntoRequests.shift();\n r3 ? n2._closeSteps(t3) : n2._chunkSteps(t3);\n })(e2, o2, r2);\n}\nfunction ze(e2, t2) {\n for (let r2 = 0; r2 < t2.length; ++r2) Ae(e2, t2[r2]);\n}\nfunction De(e2) {\n const t2 = e2.bytesFilled, r2 = e2.elementSize;\n return new e2.viewConstructor(e2.buffer, e2.byteOffset, t2 / r2);\n}\nfunction Fe(e2, t2, r2, o2) {\n e2._queue.push({ buffer: t2, byteOffset: r2, byteLength: o2 }), e2._queueTotalSize += o2;\n}\nfunction Le(e2, t2, r2, o2) {\n let n2;\n try {\n n2 = fe(t2, r2, r2 + o2);\n } catch (t3) {\n throw Xe(e2, t3), t3;\n }\n Fe(e2, n2, 0, o2);\n}\nfunction Ie(e2, t2) {\n t2.bytesFilled > 0 && Le(e2, t2.buffer, t2.byteOffset, t2.bytesFilled), He(e2);\n}\nfunction $e(e2, t2) {\n const r2 = Math.min(e2._queueTotalSize, t2.byteLength - t2.bytesFilled), o2 = t2.bytesFilled + r2;\n let n2 = r2, i2 = false;\n const a2 = o2 - o2 % t2.elementSize;\n a2 >= t2.minimumFill && (n2 = a2 - t2.bytesFilled, i2 = true);\n const s2 = e2._queue;\n for (; n2 > 0; ) {\n const r3 = s2.peek(), o3 = Math.min(n2, r3.byteLength), i3 = t2.byteOffset + t2.bytesFilled;\n ue(t2.buffer, i3, r3.buffer, r3.byteOffset, o3), r3.byteLength === o3 ? s2.shift() : (r3.byteOffset += o3, r3.byteLength -= o3), e2._queueTotalSize -= o3, Me(e2, o3, t2), n2 -= o3;\n }\n return i2;\n}\nfunction Me(e2, t2, r2) {\n r2.bytesFilled += t2;\n}\nfunction Ye(e2) {\n 0 === e2._queueTotalSize && e2._closeRequested ? (Ve(e2), Yr(e2._controlledReadableByteStream)) : je(e2);\n}\nfunction xe(e2) {\n null !== e2._byobRequest && (e2._byobRequest._associatedReadableByteStreamController = void 0, e2._byobRequest._view = null, e2._byobRequest = null);\n}\nfunction Qe(e2) {\n const t2 = [];\n for (; e2._pendingPullIntos.length > 0 && 0 !== e2._queueTotalSize; ) {\n const r2 = e2._pendingPullIntos.peek();\n $e(e2, r2) && (He(e2), t2.push(r2));\n }\n return t2;\n}\nfunction Ne(e2, t2) {\n const r2 = e2._pendingPullIntos.peek();\n xe(e2);\n "closed" === e2._controlledReadableByteStream._state ? (function(e3, t3) {\n "none" === t3.readerType && He(e3);\n const r3 = e3._controlledReadableByteStream;\n if (ut(r3)) {\n const t4 = [];\n for (; t4.length < lt(r3); ) t4.push(He(e3));\n ze(r3, t4);\n }\n })(e2, r2) : (function(e3, t3, r3) {\n if (Me(0, t3, r3), "none" === r3.readerType) {\n Ie(e3, r3);\n const t4 = Qe(e3);\n return void ze(e3._controlledReadableByteStream, t4);\n }\n if (r3.bytesFilled < r3.minimumFill) return;\n He(e3);\n const o2 = r3.bytesFilled % r3.elementSize;\n if (o2 > 0) {\n const t4 = r3.byteOffset + r3.bytesFilled;\n Le(e3, r3.buffer, t4 - o2, o2);\n }\n r3.bytesFilled -= o2;\n const n2 = Qe(e3);\n Ae(e3._controlledReadableByteStream, r3), ze(e3._controlledReadableByteStream, n2);\n })(e2, t2, r2), je(e2);\n}\nfunction He(e2) {\n return e2._pendingPullIntos.shift();\n}\nfunction Ve(e2) {\n e2._pullAlgorithm = void 0, e2._cancelAlgorithm = void 0;\n}\nfunction Ue(e2) {\n const t2 = e2._controlledReadableByteStream;\n if (!e2._closeRequested && "readable" === t2._state) if (e2._queueTotalSize > 0) e2._closeRequested = true;\n else {\n if (e2._pendingPullIntos.length > 0) {\n const t3 = e2._pendingPullIntos.peek();\n if (t3.bytesFilled % t3.elementSize !== 0) {\n const t4 = new TypeError("Insufficient bytes to fill elements in the given buffer");\n throw Xe(e2, t4), t4;\n }\n }\n Ve(e2), Yr(t2);\n }\n}\nfunction Ge(e2, t2) {\n const r2 = e2._controlledReadableByteStream;\n if (e2._closeRequested || "readable" !== r2._state) return;\n const { buffer: o2, byteOffset: n2, byteLength: i2 } = t2;\n if (de(o2)) throw new TypeError("chunk\'s buffer is detached and so cannot be enqueued");\n const a2 = ce(o2);\n if (e2._pendingPullIntos.length > 0) {\n const t3 = e2._pendingPullIntos.peek();\n if (de(t3.buffer)) throw new TypeError("The BYOB request\'s buffer has been detached and so cannot be filled with an enqueued chunk");\n xe(e2), t3.buffer = ce(t3.buffer), "none" === t3.readerType && Ie(e2, t3);\n }\n if (J(r2)) if ((function(e3) {\n const t3 = e3._controlledReadableByteStream._reader;\n for (; t3._readRequests.length > 0; ) {\n if (0 === e3._queueTotalSize) return;\n Je(e3, t3._readRequests.shift());\n }\n })(e2), 0 === X(r2)) Fe(e2, a2, n2, i2);\n else {\n e2._pendingPullIntos.length > 0 && He(e2);\n G(r2, new Uint8Array(a2, n2, i2), false);\n }\n else if (ut(r2)) {\n Fe(e2, a2, n2, i2);\n ze(r2, Qe(e2));\n } else Fe(e2, a2, n2, i2);\n je(e2);\n}\nfunction Xe(e2, t2) {\n const r2 = e2._controlledReadableByteStream;\n "readable" === r2._state && (ke(e2), qe(e2), Ve(e2), xr(r2, t2));\n}\nfunction Je(e2, t2) {\n const r2 = e2._queue.shift();\n e2._queueTotalSize -= r2.byteLength, Ye(e2);\n const o2 = new Uint8Array(r2.buffer, r2.byteOffset, r2.byteLength);\n t2._chunkSteps(o2);\n}\nfunction Ke(e2) {\n if (null === e2._byobRequest && e2._pendingPullIntos.length > 0) {\n const t2 = e2._pendingPullIntos.peek(), r2 = new Uint8Array(t2.buffer, t2.byteOffset + t2.bytesFilled, t2.byteLength - t2.bytesFilled), o2 = Object.create(ReadableStreamBYOBRequest.prototype);\n !(function(e3, t3, r3) {\n e3._associatedReadableByteStreamController = t3, e3._view = r3;\n })(o2, e2, r2), e2._byobRequest = o2;\n }\n return e2._byobRequest;\n}\nfunction Ze(e2) {\n const t2 = e2._controlledReadableByteStream._state;\n return "errored" === t2 ? null : "closed" === t2 ? 0 : e2._strategyHWM - e2._queueTotalSize;\n}\nfunction et(e2, t2) {\n const r2 = e2._pendingPullIntos.peek();\n if ("closed" === e2._controlledReadableByteStream._state) {\n if (0 !== t2) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");\n } else {\n if (0 === t2) throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");\n if (r2.bytesFilled + t2 > r2.byteLength) throw new RangeError("bytesWritten out of range");\n }\n r2.buffer = ce(r2.buffer), Ne(e2, t2);\n}\nfunction tt(e2, t2) {\n const r2 = e2._pendingPullIntos.peek();\n if ("closed" === e2._controlledReadableByteStream._state) {\n if (0 !== t2.byteLength) throw new TypeError("The view\'s length must be 0 when calling respondWithNewView() on a closed stream");\n } else if (0 === t2.byteLength) throw new TypeError("The view\'s length must be greater than 0 when calling respondWithNewView() on a readable stream");\n if (r2.byteOffset + r2.bytesFilled !== t2.byteOffset) throw new RangeError("The region specified by view does not match byobRequest");\n if (r2.bufferByteLength !== t2.buffer.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest");\n if (r2.bytesFilled + t2.byteLength > r2.byteLength) throw new RangeError("The region specified by view is larger than byobRequest");\n const o2 = t2.byteLength;\n r2.buffer = ce(t2.buffer), Ne(e2, o2);\n}\nfunction rt(e2, t2, r2, o2, n2, i2, a2) {\n t2._controlledReadableByteStream = e2, t2._pullAgain = false, t2._pulling = false, t2._byobRequest = null, t2._queue = t2._queueTotalSize = void 0, qe(t2), t2._closeRequested = false, t2._started = false, t2._strategyHWM = i2, t2._pullAlgorithm = o2, t2._cancelAlgorithm = n2, t2._autoAllocateChunkSize = a2, t2._pendingPullIntos = new v(), e2._readableStreamController = t2;\n h(c(r2()), () => (t2._started = true, je(t2), null), (e3) => (Xe(t2, e3), null));\n}\nfunction ot(e2) {\n return new TypeError(`ReadableStreamBYOBRequest.prototype.${e2} can only be used on a ReadableStreamBYOBRequest`);\n}\nfunction nt(e2) {\n return new TypeError(`ReadableByteStreamController.prototype.${e2} can only be used on a ReadableByteStreamController`);\n}\nfunction it(e2, t2) {\n if ("byob" !== (e2 = `${e2}`)) throw new TypeError(`${t2} \'${e2}\' is not a valid enumeration value for ReadableStreamReaderMode`);\n return e2;\n}\nfunction at(e2) {\n return new ReadableStreamBYOBReader(e2);\n}\nfunction st(e2, t2) {\n e2._reader._readIntoRequests.push(t2);\n}\nfunction lt(e2) {\n return e2._reader._readIntoRequests.length;\n}\nfunction ut(e2) {\n const t2 = e2._reader;\n return void 0 !== t2 && !!ft(t2);\n}\nObject.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), o(ReadableByteStreamController.prototype.close, "close"), o(ReadableByteStreamController.prototype.enqueue, "enqueue"), o(ReadableByteStreamController.prototype.error, "error"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, { value: "ReadableByteStreamController", configurable: true });\nvar ReadableStreamBYOBReader = class {\n constructor(e2) {\n if (M(e2, 1, "ReadableStreamBYOBReader"), H(e2, "First parameter"), $r(e2)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");\n if (!Oe(e2._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");\n E(this, e2), this._readIntoRequests = new v();\n }\n get closed() {\n return ft(this) ? this._closedPromise : d(_t("closed"));\n }\n cancel(e2 = void 0) {\n return ft(this) ? void 0 === this._ownerReadableStream ? d(B("cancel")) : W(this, e2) : d(_t("cancel"));\n }\n read(e2, t2 = {}) {\n if (!ft(this)) return d(_t("read"));\n if (!ArrayBuffer.isView(e2)) return d(new TypeError("view must be an array buffer view"));\n if (0 === e2.byteLength) return d(new TypeError("view must have non-zero byteLength"));\n if (0 === e2.buffer.byteLength) return d(new TypeError("view\'s buffer must have non-zero byteLength"));\n if (de(e2.buffer)) return d(new TypeError("view\'s buffer has been detached"));\n let r2;\n try {\n r2 = (function(e3, t3) {\n var r3;\n return L(e3, t3), { min: N(null !== (r3 = null == e3 ? void 0 : e3.min) && void 0 !== r3 ? r3 : 1, `${t3} has member \'min\' that`) };\n })(t2, "options");\n } catch (e3) {\n return d(e3);\n }\n const o2 = r2.min;\n if (0 === o2) return d(new TypeError("options.min must be greater than 0"));\n if ((function(e3) {\n return Ee(e3.constructor);\n })(e2)) {\n if (o2 > e2.byteLength) return d(new RangeError("options.min must be less than or equal to view\'s byteLength"));\n } else if (o2 > e2.length) return d(new RangeError("options.min must be less than or equal to view\'s length"));\n if (void 0 === this._ownerReadableStream) return d(B("read from"));\n const n2 = (function(e3, t3, r3) {\n const o3 = e3._ownerReadableStream;\n return "errored" === o3._state || (function(e4, t4, r4) {\n const o4 = e4._controlledReadableByteStream, n3 = We(t4.constructor), { byteLength: i2 } = t4, a2 = r4 * n3;\n return !(e4._pendingPullIntos.length > 0) && ("closed" === o4._state || e4._queueTotalSize >= a2);\n })(o3._readableStreamController, t3, r3);\n })(this, e2, o2) ? new dt() : new ct();\n return ht(this, e2, o2, n2), n2._promise;\n }\n releaseLock() {\n if (!ft(this)) throw _t("releaseLock");\n void 0 !== this._ownerReadableStream && (function(e2) {\n O(e2);\n const t2 = new TypeError("Reader was released");\n bt(e2, t2);\n })(this);\n }\n};\nObject.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), o(ReadableStreamBYOBReader.prototype.cancel, "cancel"), o(ReadableStreamBYOBReader.prototype.read, "read"), o(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true });\nvar ct = class {\n constructor() {\n this._promise = u((e2, t2) => {\n this._resolvePromise = e2, this._rejectPromise = t2;\n });\n }\n _chunkSteps(e2) {\n this._resolvePromise({ value: e2, done: false });\n }\n _closeSteps(e2) {\n this._resolvePromise({ value: e2, done: true });\n }\n _errorSteps(e2) {\n this._rejectPromise(e2);\n }\n};\nvar dt = class {\n constructor() {\n this._promise = void 0;\n }\n _chunkSteps(e2) {\n this._promise = l({ value: e2, done: false });\n }\n _closeSteps(e2) {\n this._promise = l({ value: e2, done: true });\n }\n _errorSteps(e2) {\n this._promise = d(e2);\n }\n};\nfunction ft(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_readIntoRequests") && e2 instanceof ReadableStreamBYOBReader);\n}\nfunction ht(e2, t2, r2, o2) {\n const n2 = e2._ownerReadableStream;\n n2._disturbed = true, "errored" === n2._state ? o2._errorSteps(n2._storedError) : (function(e3, t3, r3, o3) {\n const n3 = e3._controlledReadableByteStream, i2 = t3.constructor, a2 = We(i2), { byteOffset: s2, byteLength: l2 } = t3, u2 = r3 * a2;\n let c2;\n try {\n c2 = ce(t3.buffer);\n } catch (e4) {\n return void o3._errorSteps(e4);\n }\n const d2 = { buffer: c2, bufferByteLength: c2.byteLength, byteOffset: s2, byteLength: l2, bytesFilled: 0, minimumFill: u2, elementSize: a2, viewConstructor: i2, readerType: "byob" };\n if (e3._pendingPullIntos.length > 0) return e3._pendingPullIntos.push(d2), void st(n3, o3);\n if ("closed" === n3._state) {\n const e4 = new i2(d2.buffer, d2.byteOffset, 0);\n return void o3._closeSteps(e4);\n }\n if (e3._queueTotalSize > 0) {\n if ($e(e3, d2)) {\n const t4 = De(d2);\n return Ye(e3), void o3._chunkSteps(t4);\n }\n if (e3._closeRequested) {\n const t4 = new TypeError("Insufficient bytes to fill elements in the given buffer");\n return Xe(e3, t4), void o3._errorSteps(t4);\n }\n }\n e3._pendingPullIntos.push(d2), st(n3, o3), je(e3);\n })(n2._readableStreamController, t2, r2, o2);\n}\nfunction bt(e2, t2) {\n const r2 = e2._readIntoRequests;\n e2._readIntoRequests = new v(), r2.forEach((e3) => {\n e3._errorSteps(t2);\n });\n}\nfunction _t(e2) {\n return new TypeError(`ReadableStreamBYOBReader.prototype.${e2} can only be used on a ReadableStreamBYOBReader`);\n}\nfunction mt(e2, t2) {\n const { highWaterMark: r2 } = e2;\n if (void 0 === r2) return t2;\n if (Re(r2) || r2 < 0) throw new RangeError("Invalid highWaterMark");\n return r2;\n}\nfunction pt(e2) {\n const { size: t2 } = e2;\n return t2 || (() => 1);\n}\nfunction yt(e2, t2) {\n L(e2, t2);\n const r2 = null == e2 ? void 0 : e2.highWaterMark, o2 = null == e2 ? void 0 : e2.size;\n return { highWaterMark: void 0 === r2 ? void 0 : x(r2), size: void 0 === o2 ? void 0 : St(o2, `${t2} has member \'size\' that`) };\n}\nfunction St(e2, t2) {\n return I(e2, t2), (t3) => x(e2(t3));\n}\nfunction gt(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nfunction vt(e2, t2, r2) {\n return I(e2, r2), () => g(e2, t2, []);\n}\nfunction wt(e2, t2, r2) {\n return I(e2, r2), (r3) => S(e2, t2, [r3]);\n}\nfunction Rt(e2, t2, r2) {\n return I(e2, r2), (r3, o2) => g(e2, t2, [r3, o2]);\n}\nfunction Tt(e2, t2) {\n if (!qt(e2)) throw new TypeError(`${t2} is not a WritableStream.`);\n}\nvar WritableStream = class {\n constructor(e2 = {}, t2 = {}) {\n void 0 === e2 ? e2 = null : $(e2, "First parameter");\n const r2 = yt(t2, "Second parameter"), o2 = (function(e3, t3) {\n L(e3, t3);\n const r3 = null == e3 ? void 0 : e3.abort, o3 = null == e3 ? void 0 : e3.close, n3 = null == e3 ? void 0 : e3.start, i2 = null == e3 ? void 0 : e3.type, a2 = null == e3 ? void 0 : e3.write;\n return { abort: void 0 === r3 ? void 0 : gt(r3, e3, `${t3} has member \'abort\' that`), close: void 0 === o3 ? void 0 : vt(o3, e3, `${t3} has member \'close\' that`), start: void 0 === n3 ? void 0 : wt(n3, e3, `${t3} has member \'start\' that`), write: void 0 === a2 ? void 0 : Rt(a2, e3, `${t3} has member \'write\' that`), type: i2 };\n })(e2, "First parameter");\n Ct(this);\n if (void 0 !== o2.type) throw new RangeError("Invalid type is specified");\n const n2 = pt(r2);\n !(function(e3, t3, r3, o3) {\n const n3 = Object.create(WritableStreamDefaultController.prototype);\n let i2, a2, s2, l2;\n i2 = void 0 !== t3.start ? () => t3.start(n3) : () => {\n };\n a2 = void 0 !== t3.write ? (e4) => t3.write(e4, n3) : () => c(void 0);\n s2 = void 0 !== t3.close ? () => t3.close() : () => c(void 0);\n l2 = void 0 !== t3.abort ? (e4) => t3.abort(e4) : () => c(void 0);\n Nt(e3, n3, i2, a2, s2, l2, r3, o3);\n })(this, o2, mt(r2, 1), n2);\n }\n get locked() {\n if (!qt(this)) throw Kt("locked");\n return Et(this);\n }\n abort(e2 = void 0) {\n return qt(this) ? Et(this) ? d(new TypeError("Cannot abort a stream that already has a writer")) : Wt(this, e2) : d(Kt("abort"));\n }\n close() {\n return qt(this) ? Et(this) ? d(new TypeError("Cannot close a stream that already has a writer")) : At(this) ? d(new TypeError("Cannot close an already-closing stream")) : Ot(this) : d(Kt("close"));\n }\n getWriter() {\n if (!qt(this)) throw Kt("getWriter");\n return Pt(this);\n }\n};\nfunction Pt(e2) {\n return new WritableStreamDefaultWriter(e2);\n}\nfunction Ct(e2) {\n e2._state = "writable", e2._storedError = void 0, e2._writer = void 0, e2._writableStreamController = void 0, e2._writeRequests = new v(), e2._inFlightWriteRequest = void 0, e2._closeRequest = void 0, e2._inFlightCloseRequest = void 0, e2._pendingAbortRequest = void 0, e2._backpressure = false;\n}\nfunction qt(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_writableStreamController") && e2 instanceof WritableStream);\n}\nfunction Et(e2) {\n return void 0 !== e2._writer;\n}\nfunction Wt(e2, t2) {\n var r2;\n if ("closed" === e2._state || "errored" === e2._state) return c(void 0);\n e2._writableStreamController._abortReason = t2, null === (r2 = e2._writableStreamController._abortController) || void 0 === r2 || r2.abort(t2);\n const o2 = e2._state;\n if ("closed" === o2 || "errored" === o2) return c(void 0);\n if (void 0 !== e2._pendingAbortRequest) return e2._pendingAbortRequest._promise;\n let n2 = false;\n "erroring" === o2 && (n2 = true, t2 = void 0);\n const i2 = u((r3, o3) => {\n e2._pendingAbortRequest = { _promise: void 0, _resolve: r3, _reject: o3, _reason: t2, _wasAlreadyErroring: n2 };\n });\n return e2._pendingAbortRequest._promise = i2, n2 || jt(e2, t2), i2;\n}\nfunction Ot(e2) {\n const t2 = e2._state;\n if ("closed" === t2 || "errored" === t2) return d(new TypeError(`The stream (in ${t2} state) is not in the writable state and cannot be closed`));\n const r2 = u((t3, r3) => {\n const o3 = { _resolve: t3, _reject: r3 };\n e2._closeRequest = o3;\n }), o2 = e2._writer;\n var n2;\n return void 0 !== o2 && e2._backpressure && "writable" === t2 && cr(o2), Ce(n2 = e2._writableStreamController, xt, 0), Ut(n2), r2;\n}\nfunction Bt(e2, t2) {\n "writable" !== e2._state ? kt(e2) : jt(e2, t2);\n}\nfunction jt(e2, t2) {\n const r2 = e2._writableStreamController;\n e2._state = "erroring", e2._storedError = t2;\n const o2 = e2._writer;\n void 0 !== o2 && $t(o2, t2), !(function(e3) {\n if (void 0 === e3._inFlightWriteRequest && void 0 === e3._inFlightCloseRequest) return false;\n return true;\n })(e2) && r2._started && kt(e2);\n}\nfunction kt(e2) {\n e2._state = "errored", e2._writableStreamController[R]();\n const t2 = e2._storedError;\n if (e2._writeRequests.forEach((e3) => {\n e3._reject(t2);\n }), e2._writeRequests = new v(), void 0 === e2._pendingAbortRequest) return void zt(e2);\n const r2 = e2._pendingAbortRequest;\n if (e2._pendingAbortRequest = void 0, r2._wasAlreadyErroring) return r2._reject(t2), void zt(e2);\n h(e2._writableStreamController[w](r2._reason), () => (r2._resolve(), zt(e2), null), (t3) => (r2._reject(t3), zt(e2), null));\n}\nfunction At(e2) {\n return void 0 !== e2._closeRequest || void 0 !== e2._inFlightCloseRequest;\n}\nfunction zt(e2) {\n void 0 !== e2._closeRequest && (e2._closeRequest._reject(e2._storedError), e2._closeRequest = void 0);\n const t2 = e2._writer;\n void 0 !== t2 && nr(t2, e2._storedError);\n}\nfunction Dt(e2, t2) {\n const r2 = e2._writer;\n void 0 !== r2 && t2 !== e2._backpressure && (t2 ? (function(e3) {\n ar(e3);\n })(r2) : cr(r2)), e2._backpressure = t2;\n}\nObject.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), o(WritableStream.prototype.abort, "abort"), o(WritableStream.prototype.close, "close"), o(WritableStream.prototype.getWriter, "getWriter"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, { value: "WritableStream", configurable: true });\nvar WritableStreamDefaultWriter = class {\n constructor(e2) {\n if (M(e2, 1, "WritableStreamDefaultWriter"), Tt(e2, "First parameter"), Et(e2)) throw new TypeError("This stream has already been locked for exclusive writing by another writer");\n this._ownerWritableStream = e2, e2._writer = this;\n const t2 = e2._state;\n if ("writable" === t2) !At(e2) && e2._backpressure ? ar(this) : lr(this), rr(this);\n else if ("erroring" === t2) sr(this, e2._storedError), rr(this);\n else if ("closed" === t2) lr(this), rr(r2 = this), ir(r2);\n else {\n const t3 = e2._storedError;\n sr(this, t3), or(this, t3);\n }\n var r2;\n }\n get closed() {\n return Ft(this) ? this._closedPromise : d(er("closed"));\n }\n get desiredSize() {\n if (!Ft(this)) throw er("desiredSize");\n if (void 0 === this._ownerWritableStream) throw tr("desiredSize");\n return (function(e2) {\n const t2 = e2._ownerWritableStream, r2 = t2._state;\n if ("errored" === r2 || "erroring" === r2) return null;\n if ("closed" === r2) return 0;\n return Vt(t2._writableStreamController);\n })(this);\n }\n get ready() {\n return Ft(this) ? this._readyPromise : d(er("ready"));\n }\n abort(e2 = void 0) {\n return Ft(this) ? void 0 === this._ownerWritableStream ? d(tr("abort")) : (function(e3, t2) {\n return Wt(e3._ownerWritableStream, t2);\n })(this, e2) : d(er("abort"));\n }\n close() {\n if (!Ft(this)) return d(er("close"));\n const e2 = this._ownerWritableStream;\n return void 0 === e2 ? d(tr("close")) : At(e2) ? d(new TypeError("Cannot close an already-closing stream")) : Lt(this);\n }\n releaseLock() {\n if (!Ft(this)) throw er("releaseLock");\n void 0 !== this._ownerWritableStream && Mt(this);\n }\n write(e2 = void 0) {\n return Ft(this) ? void 0 === this._ownerWritableStream ? d(tr("write to")) : Yt(this, e2) : d(er("write"));\n }\n};\nfunction Ft(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_ownerWritableStream") && e2 instanceof WritableStreamDefaultWriter);\n}\nfunction Lt(e2) {\n return Ot(e2._ownerWritableStream);\n}\nfunction It(e2, t2) {\n "pending" === e2._closedPromiseState ? nr(e2, t2) : (function(e3, t3) {\n or(e3, t3);\n })(e2, t2);\n}\nfunction $t(e2, t2) {\n "pending" === e2._readyPromiseState ? ur(e2, t2) : (function(e3, t3) {\n sr(e3, t3);\n })(e2, t2);\n}\nfunction Mt(e2) {\n const t2 = e2._ownerWritableStream, r2 = new TypeError("Writer was released and can no longer be used to monitor the stream\'s closedness");\n $t(e2, r2), It(e2, r2), t2._writer = void 0, e2._ownerWritableStream = void 0;\n}\nfunction Yt(e2, t2) {\n const r2 = e2._ownerWritableStream, o2 = r2._writableStreamController, n2 = (function(e3, t3) {\n if (void 0 === e3._strategySizeAlgorithm) return 1;\n try {\n return e3._strategySizeAlgorithm(t3);\n } catch (t4) {\n return Gt(e3, t4), 1;\n }\n })(o2, t2);\n if (r2 !== e2._ownerWritableStream) return d(tr("write to"));\n const i2 = r2._state;\n if ("errored" === i2) return d(r2._storedError);\n if (At(r2) || "closed" === i2) return d(new TypeError("The stream is closing or closed and cannot be written to"));\n if ("erroring" === i2) return d(r2._storedError);\n const a2 = (function(e3) {\n return u((t3, r3) => {\n const o3 = { _resolve: t3, _reject: r3 };\n e3._writeRequests.push(o3);\n });\n })(r2);\n return (function(e3, t3, r3) {\n try {\n Ce(e3, t3, r3);\n } catch (t4) {\n return void Gt(e3, t4);\n }\n const o3 = e3._controlledWritableStream;\n if (!At(o3) && "writable" === o3._state) {\n Dt(o3, Xt(e3));\n }\n Ut(e3);\n })(o2, t2, n2), a2;\n}\nObject.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), o(WritableStreamDefaultWriter.prototype.abort, "abort"), o(WritableStreamDefaultWriter.prototype.close, "close"), o(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"), o(WritableStreamDefaultWriter.prototype.write, "write"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true });\nvar xt = {};\nvar WritableStreamDefaultController = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get abortReason() {\n if (!Qt(this)) throw Zt("abortReason");\n return this._abortReason;\n }\n get signal() {\n if (!Qt(this)) throw Zt("signal");\n if (void 0 === this._abortController) throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");\n return this._abortController.signal;\n }\n error(e2 = void 0) {\n if (!Qt(this)) throw Zt("error");\n "writable" === this._controlledWritableStream._state && Jt(this, e2);\n }\n [w](e2) {\n const t2 = this._abortAlgorithm(e2);\n return Ht(this), t2;\n }\n [R]() {\n qe(this);\n }\n};\nfunction Qt(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_controlledWritableStream") && e2 instanceof WritableStreamDefaultController);\n}\nfunction Nt(e2, t2, r2, o2, n2, i2, a2, s2) {\n t2._controlledWritableStream = e2, e2._writableStreamController = t2, t2._queue = void 0, t2._queueTotalSize = void 0, qe(t2), t2._abortReason = void 0, t2._abortController = (function() {\n if ("function" == typeof AbortController) return new AbortController();\n })(), t2._started = false, t2._strategySizeAlgorithm = s2, t2._strategyHWM = a2, t2._writeAlgorithm = o2, t2._closeAlgorithm = n2, t2._abortAlgorithm = i2;\n const l2 = Xt(t2);\n Dt(e2, l2);\n h(c(r2()), () => (t2._started = true, Ut(t2), null), (r3) => (t2._started = true, Bt(e2, r3), null));\n}\nfunction Ht(e2) {\n e2._writeAlgorithm = void 0, e2._closeAlgorithm = void 0, e2._abortAlgorithm = void 0, e2._strategySizeAlgorithm = void 0;\n}\nfunction Vt(e2) {\n return e2._strategyHWM - e2._queueTotalSize;\n}\nfunction Ut(e2) {\n const t2 = e2._controlledWritableStream;\n if (!e2._started) return;\n if (void 0 !== t2._inFlightWriteRequest) return;\n if ("erroring" === t2._state) return void kt(t2);\n if (0 === e2._queue.length) return;\n const r2 = e2._queue.peek().value;\n r2 === xt ? (function(e3) {\n const t3 = e3._controlledWritableStream;\n (function(e4) {\n e4._inFlightCloseRequest = e4._closeRequest, e4._closeRequest = void 0;\n })(t3), Pe(e3);\n const r3 = e3._closeAlgorithm();\n Ht(e3), h(r3, () => ((function(e4) {\n e4._inFlightCloseRequest._resolve(void 0), e4._inFlightCloseRequest = void 0, "erroring" === e4._state && (e4._storedError = void 0, void 0 !== e4._pendingAbortRequest && (e4._pendingAbortRequest._resolve(), e4._pendingAbortRequest = void 0)), e4._state = "closed";\n const t4 = e4._writer;\n void 0 !== t4 && ir(t4);\n })(t3), null), (e4) => ((function(e5, t4) {\n e5._inFlightCloseRequest._reject(t4), e5._inFlightCloseRequest = void 0, void 0 !== e5._pendingAbortRequest && (e5._pendingAbortRequest._reject(t4), e5._pendingAbortRequest = void 0), Bt(e5, t4);\n })(t3, e4), null));\n })(e2) : (function(e3, t3) {\n const r3 = e3._controlledWritableStream;\n !(function(e4) {\n e4._inFlightWriteRequest = e4._writeRequests.shift();\n })(r3);\n const o2 = e3._writeAlgorithm(t3);\n h(o2, () => {\n !(function(e4) {\n e4._inFlightWriteRequest._resolve(void 0), e4._inFlightWriteRequest = void 0;\n })(r3);\n const t4 = r3._state;\n if (Pe(e3), !At(r3) && "writable" === t4) {\n const t5 = Xt(e3);\n Dt(r3, t5);\n }\n return Ut(e3), null;\n }, (t4) => ("writable" === r3._state && Ht(e3), (function(e4, t5) {\n e4._inFlightWriteRequest._reject(t5), e4._inFlightWriteRequest = void 0, Bt(e4, t5);\n })(r3, t4), null));\n })(e2, r2);\n}\nfunction Gt(e2, t2) {\n "writable" === e2._controlledWritableStream._state && Jt(e2, t2);\n}\nfunction Xt(e2) {\n return Vt(e2) <= 0;\n}\nfunction Jt(e2, t2) {\n const r2 = e2._controlledWritableStream;\n Ht(e2), jt(r2, t2);\n}\nfunction Kt(e2) {\n return new TypeError(`WritableStream.prototype.${e2} can only be used on a WritableStream`);\n}\nfunction Zt(e2) {\n return new TypeError(`WritableStreamDefaultController.prototype.${e2} can only be used on a WritableStreamDefaultController`);\n}\nfunction er(e2) {\n return new TypeError(`WritableStreamDefaultWriter.prototype.${e2} can only be used on a WritableStreamDefaultWriter`);\n}\nfunction tr(e2) {\n return new TypeError("Cannot " + e2 + " a stream using a released writer");\n}\nfunction rr(e2) {\n e2._closedPromise = u((t2, r2) => {\n e2._closedPromise_resolve = t2, e2._closedPromise_reject = r2, e2._closedPromiseState = "pending";\n });\n}\nfunction or(e2, t2) {\n rr(e2), nr(e2, t2);\n}\nfunction nr(e2, t2) {\n void 0 !== e2._closedPromise_reject && (p(e2._closedPromise), e2._closedPromise_reject(t2), e2._closedPromise_resolve = void 0, e2._closedPromise_reject = void 0, e2._closedPromiseState = "rejected");\n}\nfunction ir(e2) {\n void 0 !== e2._closedPromise_resolve && (e2._closedPromise_resolve(void 0), e2._closedPromise_resolve = void 0, e2._closedPromise_reject = void 0, e2._closedPromiseState = "resolved");\n}\nfunction ar(e2) {\n e2._readyPromise = u((t2, r2) => {\n e2._readyPromise_resolve = t2, e2._readyPromise_reject = r2;\n }), e2._readyPromiseState = "pending";\n}\nfunction sr(e2, t2) {\n ar(e2), ur(e2, t2);\n}\nfunction lr(e2) {\n ar(e2), cr(e2);\n}\nfunction ur(e2, t2) {\n void 0 !== e2._readyPromise_reject && (p(e2._readyPromise), e2._readyPromise_reject(t2), e2._readyPromise_resolve = void 0, e2._readyPromise_reject = void 0, e2._readyPromiseState = "rejected");\n}\nfunction cr(e2) {\n void 0 !== e2._readyPromise_resolve && (e2._readyPromise_resolve(void 0), e2._readyPromise_resolve = void 0, e2._readyPromise_reject = void 0, e2._readyPromiseState = "fulfilled");\n}\nObject.defineProperties(WritableStreamDefaultController.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultController", configurable: true });\nvar dr = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof global ? global : void 0;\nvar fr = (function() {\n const e2 = null == dr ? void 0 : dr.DOMException;\n return (function(e3) {\n if ("function" != typeof e3 && "object" != typeof e3) return false;\n if ("DOMException" !== e3.name) return false;\n try {\n return new e3(), true;\n } catch (e4) {\n return false;\n }\n })(e2) ? e2 : void 0;\n})() || (function() {\n const e2 = function(e3, t2) {\n this.message = e3 || "", this.name = t2 || "Error", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);\n };\n return o(e2, "DOMException"), e2.prototype = Object.create(Error.prototype), Object.defineProperty(e2.prototype, "constructor", { value: e2, writable: true, configurable: true }), e2;\n})();\nfunction hr(e2, t2, r2, o2, n2, i2) {\n const a2 = V(e2), s2 = Pt(t2);\n e2._disturbed = true;\n const l2 = new br(s2), _2 = new mr(l2);\n return u((m2, y2) => {\n let S2;\n if (void 0 !== i2) {\n if (S2 = () => {\n const r3 = void 0 !== i2.reason ? i2.reason : new fr("Aborted", "AbortError"), a3 = [];\n o2 || a3.push(() => "writable" === t2._state ? Wt(t2, r3) : c(void 0)), n2 || a3.push(() => "readable" === e2._state ? Mr(e2, r3) : c(void 0)), T2(() => Promise.all(a3.map((e3) => e3())), true, r3);\n }, i2.aborted) return void S2();\n i2.addEventListener("abort", S2);\n }\n function g2() {\n for (; !l2._shuttingDown && !t2._backpressure && "writable" === t2._state && !At(t2) && "readable" === e2._state && re(a2); ) te(a2, _2);\n if (l2._shuttingDown) return c(true);\n if (t2._backpressure) return f(s2._readyPromise, g2);\n const r3 = new _r(l2);\n return te(a2, r3), r3._promise;\n }\n var v2, w2, R2;\n if (pr(e2, a2._closedPromise, (e3) => (o2 ? P2(true, e3) : T2(() => Wt(t2, e3), true, e3), null)), pr(t2, s2._closedPromise, (t3) => (n2 ? P2(true, t3) : T2(() => Mr(e2, t3), true, t3), null)), v2 = e2, w2 = a2._closedPromise, R2 = () => (r2 ? P2() : T2(() => (function(e3) {\n const t3 = e3._ownerWritableStream, r3 = t3._state;\n return At(t3) || "closed" === r3 ? c(void 0) : "errored" === r3 ? d(t3._storedError) : Lt(e3);\n })(s2)), null), "closed" === v2._state ? R2() : b(w2, R2), At(t2) || "closed" === t2._state) {\n const t3 = new TypeError("the destination writable stream closed before all data could be piped to it");\n n2 ? P2(true, t3) : T2(() => Mr(e2, t3), true, t3);\n }\n function T2(e3, r3, o3) {\n function n3() {\n return h(e3(), () => C2(r3, o3), (e4) => C2(true, e4)), null;\n }\n l2._shuttingDown || (l2._shuttingDown = true, "writable" !== t2._state || At(t2) ? n3() : b(l2._waitForWritesToFinish(), n3));\n }\n function P2(e3, r3) {\n l2._shuttingDown || (l2._shuttingDown = true, "writable" !== t2._state || At(t2) ? C2(e3, r3) : b(l2._waitForWritesToFinish(), () => C2(e3, r3)));\n }\n function C2(e3, t3) {\n return Mt(s2), O(a2), void 0 !== i2 && i2.removeEventListener("abort", S2), e3 ? y2(t3) : m2(void 0), null;\n }\n p(u((e3, t3) => {\n !(function r3(o3) {\n o3 ? e3() : f(g2(), r3, t3);\n })(false);\n }));\n });\n}\nvar br = class {\n constructor(e2) {\n this._writer = e2, this._shuttingDown = false, this._currentWrite = c(void 0);\n }\n _waitForWritesToFinish() {\n const e2 = this._currentWrite;\n return f(this._currentWrite, () => e2 !== this._currentWrite ? this._waitForWritesToFinish() : void 0);\n }\n};\nvar _r = class {\n constructor(e2) {\n this._state = e2, this._promise = u((e3, t2) => {\n this._resolvePromise = e3, this._rejectPromise = t2;\n });\n }\n _chunkSteps(t2) {\n this._state._currentWrite = f(Yt(this._state._writer, t2), void 0, e), this._resolvePromise(false);\n }\n _closeSteps() {\n this._resolvePromise(true);\n }\n _errorSteps(e2) {\n this._rejectPromise(e2);\n }\n};\nvar mr = class {\n constructor(e2) {\n this._state = e2;\n }\n _chunkSteps(t2) {\n this._state._currentWrite = f(Yt(this._state._writer, t2), void 0, e);\n }\n _closeSteps() {\n }\n _errorSteps(e2) {\n }\n};\nfunction pr(e2, t2, r2) {\n "errored" === e2._state ? r2(e2._storedError) : _(t2, r2);\n}\nvar ReadableStreamDefaultController = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get desiredSize() {\n if (!yr(this)) throw Er("desiredSize");\n return Pr(this);\n }\n close() {\n if (!yr(this)) throw Er("close");\n if (!Cr(this)) throw new TypeError("The stream is not in a state that permits close");\n wr(this);\n }\n enqueue(e2 = void 0) {\n if (!yr(this)) throw Er("enqueue");\n if (!Cr(this)) throw new TypeError("The stream is not in a state that permits enqueue");\n return Rr(this, e2);\n }\n error(e2 = void 0) {\n if (!yr(this)) throw Er("error");\n Tr(this, e2);\n }\n [T](e2) {\n qe(this);\n const t2 = this._cancelAlgorithm(e2);\n return vr(this), t2;\n }\n [P](e2) {\n const t2 = this._controlledReadableStream;\n if (this._queue.length > 0) {\n const r2 = Pe(this);\n this._closeRequested && 0 === this._queue.length ? (vr(this), Yr(t2)) : Sr(this), e2._chunkSteps(r2);\n } else U(t2, e2), Sr(this);\n }\n [C]() {\n return this._queue.length > 0;\n }\n [q]() {\n }\n};\nfunction yr(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_controlledReadableStream") && e2 instanceof ReadableStreamDefaultController);\n}\nfunction Sr(e2) {\n if (!gr(e2)) return;\n if (e2._pulling) return void (e2._pullAgain = true);\n e2._pulling = true;\n h(e2._pullAlgorithm(), () => (e2._pulling = false, e2._pullAgain && (e2._pullAgain = false, Sr(e2)), null), (t2) => (Tr(e2, t2), null));\n}\nfunction gr(e2) {\n const t2 = e2._controlledReadableStream;\n if (!Cr(e2)) return false;\n if (!e2._started) return false;\n if ($r(t2) && X(t2) > 0) return true;\n return Pr(e2) > 0;\n}\nfunction vr(e2) {\n e2._pullAlgorithm = void 0, e2._cancelAlgorithm = void 0, e2._strategySizeAlgorithm = void 0;\n}\nfunction wr(e2) {\n if (!Cr(e2)) return;\n const t2 = e2._controlledReadableStream;\n e2._closeRequested = true, 0 === e2._queue.length && (vr(e2), Yr(t2));\n}\nfunction Rr(e2, t2) {\n if (!Cr(e2)) return;\n const r2 = e2._controlledReadableStream;\n if ($r(r2) && X(r2) > 0) G(r2, t2, false);\n else {\n let r3;\n try {\n r3 = e2._strategySizeAlgorithm(t2);\n } catch (t3) {\n throw Tr(e2, t3), t3;\n }\n try {\n Ce(e2, t2, r3);\n } catch (t3) {\n throw Tr(e2, t3), t3;\n }\n }\n Sr(e2);\n}\nfunction Tr(e2, t2) {\n const r2 = e2._controlledReadableStream;\n "readable" === r2._state && (qe(e2), vr(e2), xr(r2, t2));\n}\nfunction Pr(e2) {\n const t2 = e2._controlledReadableStream._state;\n return "errored" === t2 ? null : "closed" === t2 ? 0 : e2._strategyHWM - e2._queueTotalSize;\n}\nfunction Cr(e2) {\n const t2 = e2._controlledReadableStream._state;\n return !e2._closeRequested && "readable" === t2;\n}\nfunction qr(e2, t2, r2, o2, n2, i2, a2) {\n t2._controlledReadableStream = e2, t2._queue = void 0, t2._queueTotalSize = void 0, qe(t2), t2._started = false, t2._closeRequested = false, t2._pullAgain = false, t2._pulling = false, t2._strategySizeAlgorithm = a2, t2._strategyHWM = i2, t2._pullAlgorithm = o2, t2._cancelAlgorithm = n2, e2._readableStreamController = t2;\n h(c(r2()), () => (t2._started = true, Sr(t2), null), (e3) => (Tr(t2, e3), null));\n}\nfunction Er(e2) {\n return new TypeError(`ReadableStreamDefaultController.prototype.${e2} can only be used on a ReadableStreamDefaultController`);\n}\nfunction Wr(e2, t2) {\n return Oe(e2._readableStreamController) ? (function(e3) {\n let t3, r2, o2, n2, i2, a2 = V(e3), s2 = false, l2 = false, d2 = false, f2 = false, h2 = false;\n const b2 = u((e4) => {\n i2 = e4;\n });\n function m2(e4) {\n _(e4._closedPromise, (t4) => (e4 !== a2 || (Xe(o2._readableStreamController, t4), Xe(n2._readableStreamController, t4), f2 && h2 || i2(void 0)), null));\n }\n function p2() {\n ft(a2) && (O(a2), a2 = V(e3), m2(a2));\n te(a2, { _chunkSteps: (t4) => {\n y(() => {\n l2 = false, d2 = false;\n const r3 = t4;\n let a3 = t4;\n if (!f2 && !h2) try {\n a3 = Te(t4);\n } catch (t5) {\n return Xe(o2._readableStreamController, t5), Xe(n2._readableStreamController, t5), void i2(Mr(e3, t5));\n }\n f2 || Ge(o2._readableStreamController, r3), h2 || Ge(n2._readableStreamController, a3), s2 = false, l2 ? g2() : d2 && v2();\n });\n }, _closeSteps: () => {\n s2 = false, f2 || Ue(o2._readableStreamController), h2 || Ue(n2._readableStreamController), o2._readableStreamController._pendingPullIntos.length > 0 && et(o2._readableStreamController, 0), n2._readableStreamController._pendingPullIntos.length > 0 && et(n2._readableStreamController, 0), f2 && h2 || i2(void 0);\n }, _errorSteps: () => {\n s2 = false;\n } });\n }\n function S2(t4, r3) {\n ee(a2) && (O(a2), a2 = at(e3), m2(a2));\n const u2 = r3 ? n2 : o2, c2 = r3 ? o2 : n2;\n ht(a2, t4, 1, { _chunkSteps: (t5) => {\n y(() => {\n l2 = false, d2 = false;\n const o3 = r3 ? h2 : f2;\n if (r3 ? f2 : h2) o3 || tt(u2._readableStreamController, t5);\n else {\n let r4;\n try {\n r4 = Te(t5);\n } catch (t6) {\n return Xe(u2._readableStreamController, t6), Xe(c2._readableStreamController, t6), void i2(Mr(e3, t6));\n }\n o3 || tt(u2._readableStreamController, t5), Ge(c2._readableStreamController, r4);\n }\n s2 = false, l2 ? g2() : d2 && v2();\n });\n }, _closeSteps: (e4) => {\n s2 = false;\n const t5 = r3 ? h2 : f2, o3 = r3 ? f2 : h2;\n t5 || Ue(u2._readableStreamController), o3 || Ue(c2._readableStreamController), void 0 !== e4 && (t5 || tt(u2._readableStreamController, e4), !o3 && c2._readableStreamController._pendingPullIntos.length > 0 && et(c2._readableStreamController, 0)), t5 && o3 || i2(void 0);\n }, _errorSteps: () => {\n s2 = false;\n } });\n }\n function g2() {\n if (s2) return l2 = true, c(void 0);\n s2 = true;\n const e4 = Ke(o2._readableStreamController);\n return null === e4 ? p2() : S2(e4._view, false), c(void 0);\n }\n function v2() {\n if (s2) return d2 = true, c(void 0);\n s2 = true;\n const e4 = Ke(n2._readableStreamController);\n return null === e4 ? p2() : S2(e4._view, true), c(void 0);\n }\n function w2(o3) {\n if (f2 = true, t3 = o3, h2) {\n const o4 = le([t3, r2]), n3 = Mr(e3, o4);\n i2(n3);\n }\n return b2;\n }\n function R2(o3) {\n if (h2 = true, r2 = o3, f2) {\n const o4 = le([t3, r2]), n3 = Mr(e3, o4);\n i2(n3);\n }\n return b2;\n }\n function T2() {\n }\n return o2 = Fr(T2, g2, w2), n2 = Fr(T2, v2, R2), m2(a2), [o2, n2];\n })(e2) : (function(e3) {\n const t3 = V(e3);\n let r2, o2, n2, i2, a2, s2 = false, l2 = false, d2 = false, f2 = false;\n const h2 = u((e4) => {\n a2 = e4;\n });\n function b2() {\n if (s2) return l2 = true, c(void 0);\n s2 = true;\n return te(t3, { _chunkSteps: (e4) => {\n y(() => {\n l2 = false;\n const t4 = e4, r3 = e4;\n d2 || Rr(n2._readableStreamController, t4), f2 || Rr(i2._readableStreamController, r3), s2 = false, l2 && b2();\n });\n }, _closeSteps: () => {\n s2 = false, d2 || wr(n2._readableStreamController), f2 || wr(i2._readableStreamController), d2 && f2 || a2(void 0);\n }, _errorSteps: () => {\n s2 = false;\n } }), c(void 0);\n }\n function m2(t4) {\n if (d2 = true, r2 = t4, f2) {\n const t5 = le([r2, o2]), n3 = Mr(e3, t5);\n a2(n3);\n }\n return h2;\n }\n function p2(t4) {\n if (f2 = true, o2 = t4, d2) {\n const t5 = le([r2, o2]), n3 = Mr(e3, t5);\n a2(n3);\n }\n return h2;\n }\n function S2() {\n }\n return n2 = Dr(S2, b2, m2), i2 = Dr(S2, b2, p2), _(t3._closedPromise, (e4) => (Tr(n2._readableStreamController, e4), Tr(i2._readableStreamController, e4), d2 && f2 || a2(void 0), null)), [n2, i2];\n })(e2);\n}\nfunction Or(r2) {\n return t(o2 = r2) && void 0 !== o2.getReader ? (function(r3) {\n let o3;\n function n2() {\n let e2;\n try {\n e2 = r3.read();\n } catch (e3) {\n return d(e3);\n }\n return m(e2, (e3) => {\n if (!t(e3)) throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");\n if (e3.done) wr(o3._readableStreamController);\n else {\n const t2 = e3.value;\n Rr(o3._readableStreamController, t2);\n }\n });\n }\n function i2(e2) {\n try {\n return c(r3.cancel(e2));\n } catch (e3) {\n return d(e3);\n }\n }\n return o3 = Dr(e, n2, i2, 0), o3;\n })(r2.getReader()) : (function(r3) {\n let o3;\n const n2 = me(r3, "async");\n function i2() {\n let e2;\n try {\n e2 = pe(n2);\n } catch (e3) {\n return d(e3);\n }\n return m(c(e2), (e3) => {\n if (!t(e3)) throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");\n if (e3.done) wr(o3._readableStreamController);\n else {\n const t2 = e3.value;\n Rr(o3._readableStreamController, t2);\n }\n });\n }\n function a2(e2) {\n const r4 = n2.iterator;\n let o4;\n try {\n o4 = he(r4, "return");\n } catch (e3) {\n return d(e3);\n }\n if (void 0 === o4) return c(void 0);\n return m(g(o4, r4, [e2]), (e3) => {\n if (!t(e3)) throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object");\n });\n }\n return o3 = Dr(e, i2, a2, 0), o3;\n })(r2);\n var o2;\n}\nfunction Br(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nfunction jr(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nfunction kr(e2, t2, r2) {\n return I(e2, r2), (r3) => S(e2, t2, [r3]);\n}\nfunction Ar(e2, t2) {\n if ("bytes" !== (e2 = `${e2}`)) throw new TypeError(`${t2} \'${e2}\' is not a valid enumeration value for ReadableStreamType`);\n return e2;\n}\nfunction zr(e2, t2) {\n L(e2, t2);\n const r2 = null == e2 ? void 0 : e2.preventAbort, o2 = null == e2 ? void 0 : e2.preventCancel, n2 = null == e2 ? void 0 : e2.preventClose, i2 = null == e2 ? void 0 : e2.signal;\n return void 0 !== i2 && (function(e3, t3) {\n if (!(function(e4) {\n if ("object" != typeof e4 || null === e4) return false;\n try {\n return "boolean" == typeof e4.aborted;\n } catch (e5) {\n return false;\n }\n })(e3)) throw new TypeError(`${t3} is not an AbortSignal.`);\n })(i2, `${t2} has member \'signal\' that`), { preventAbort: Boolean(r2), preventCancel: Boolean(o2), preventClose: Boolean(n2), signal: i2 };\n}\nObject.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), o(ReadableStreamDefaultController.prototype.close, "close"), o(ReadableStreamDefaultController.prototype.enqueue, "enqueue"), o(ReadableStreamDefaultController.prototype.error, "error"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultController", configurable: true });\nvar ReadableStream = class {\n constructor(e2 = {}, t2 = {}) {\n void 0 === e2 ? e2 = null : $(e2, "First parameter");\n const r2 = yt(t2, "Second parameter"), o2 = (function(e3, t3) {\n L(e3, t3);\n const r3 = e3, o3 = null == r3 ? void 0 : r3.autoAllocateChunkSize, n2 = null == r3 ? void 0 : r3.cancel, i2 = null == r3 ? void 0 : r3.pull, a2 = null == r3 ? void 0 : r3.start, s2 = null == r3 ? void 0 : r3.type;\n return { autoAllocateChunkSize: void 0 === o3 ? void 0 : N(o3, `${t3} has member \'autoAllocateChunkSize\' that`), cancel: void 0 === n2 ? void 0 : Br(n2, r3, `${t3} has member \'cancel\' that`), pull: void 0 === i2 ? void 0 : jr(i2, r3, `${t3} has member \'pull\' that`), start: void 0 === a2 ? void 0 : kr(a2, r3, `${t3} has member \'start\' that`), type: void 0 === s2 ? void 0 : Ar(s2, `${t3} has member \'type\' that`) };\n })(e2, "First parameter");\n if (Lr(this), "bytes" === o2.type) {\n if (void 0 !== r2.size) throw new RangeError("The strategy for a byte stream cannot have a size function");\n !(function(e3, t3, r3) {\n const o3 = Object.create(ReadableByteStreamController.prototype);\n let n2, i2, a2;\n n2 = void 0 !== t3.start ? () => t3.start(o3) : () => {\n }, i2 = void 0 !== t3.pull ? () => t3.pull(o3) : () => c(void 0), a2 = void 0 !== t3.cancel ? (e4) => t3.cancel(e4) : () => c(void 0);\n const s2 = t3.autoAllocateChunkSize;\n if (0 === s2) throw new TypeError("autoAllocateChunkSize must be greater than 0");\n rt(e3, o3, n2, i2, a2, r3, s2);\n })(this, o2, mt(r2, 0));\n } else {\n const e3 = pt(r2);\n !(function(e4, t3, r3, o3) {\n const n2 = Object.create(ReadableStreamDefaultController.prototype);\n let i2, a2, s2;\n i2 = void 0 !== t3.start ? () => t3.start(n2) : () => {\n }, a2 = void 0 !== t3.pull ? () => t3.pull(n2) : () => c(void 0), s2 = void 0 !== t3.cancel ? (e5) => t3.cancel(e5) : () => c(void 0), qr(e4, n2, i2, a2, s2, r3, o3);\n })(this, o2, mt(r2, 1), e3);\n }\n }\n get locked() {\n if (!Ir(this)) throw Qr("locked");\n return $r(this);\n }\n cancel(e2 = void 0) {\n return Ir(this) ? $r(this) ? d(new TypeError("Cannot cancel a stream that already has a reader")) : Mr(this, e2) : d(Qr("cancel"));\n }\n getReader(e2 = void 0) {\n if (!Ir(this)) throw Qr("getReader");\n return void 0 === (function(e3, t2) {\n L(e3, t2);\n const r2 = null == e3 ? void 0 : e3.mode;\n return { mode: void 0 === r2 ? void 0 : it(r2, `${t2} has member \'mode\' that`) };\n })(e2, "First parameter").mode ? V(this) : at(this);\n }\n pipeThrough(e2, t2 = {}) {\n if (!Ir(this)) throw Qr("pipeThrough");\n M(e2, 1, "pipeThrough");\n const r2 = (function(e3, t3) {\n L(e3, t3);\n const r3 = null == e3 ? void 0 : e3.readable;\n Y(r3, "readable", "ReadableWritablePair"), H(r3, `${t3} has member \'readable\' that`);\n const o3 = null == e3 ? void 0 : e3.writable;\n return Y(o3, "writable", "ReadableWritablePair"), Tt(o3, `${t3} has member \'writable\' that`), { readable: r3, writable: o3 };\n })(e2, "First parameter"), o2 = zr(t2, "Second parameter");\n if ($r(this)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");\n if (Et(r2.writable)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");\n return p(hr(this, r2.writable, o2.preventClose, o2.preventAbort, o2.preventCancel, o2.signal)), r2.readable;\n }\n pipeTo(e2, t2 = {}) {\n if (!Ir(this)) return d(Qr("pipeTo"));\n if (void 0 === e2) return d("Parameter 1 is required in \'pipeTo\'.");\n if (!qt(e2)) return d(new TypeError("ReadableStream.prototype.pipeTo\'s first argument must be a WritableStream"));\n let r2;\n try {\n r2 = zr(t2, "Second parameter");\n } catch (e3) {\n return d(e3);\n }\n return $r(this) ? d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : Et(e2) ? d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : hr(this, e2, r2.preventClose, r2.preventAbort, r2.preventCancel, r2.signal);\n }\n tee() {\n if (!Ir(this)) throw Qr("tee");\n return le(Wr(this));\n }\n values(e2 = void 0) {\n if (!Ir(this)) throw Qr("values");\n return (function(e3, t2) {\n const r2 = V(e3), o2 = new ye(r2, t2), n2 = Object.create(ge);\n return n2._asyncIteratorImpl = o2, n2;\n })(this, (function(e3, t2) {\n L(e3, t2);\n const r2 = null == e3 ? void 0 : e3.preventCancel;\n return { preventCancel: Boolean(r2) };\n })(e2, "First parameter").preventCancel);\n }\n [_e](e2) {\n return this.values(e2);\n }\n static from(e2) {\n return Or(e2);\n }\n};\nfunction Dr(e2, t2, r2, o2 = 1, n2 = () => 1) {\n const i2 = Object.create(ReadableStream.prototype);\n Lr(i2);\n return qr(i2, Object.create(ReadableStreamDefaultController.prototype), e2, t2, r2, o2, n2), i2;\n}\nfunction Fr(e2, t2, r2) {\n const o2 = Object.create(ReadableStream.prototype);\n Lr(o2);\n return rt(o2, Object.create(ReadableByteStreamController.prototype), e2, t2, r2, 0, void 0), o2;\n}\nfunction Lr(e2) {\n e2._state = "readable", e2._reader = void 0, e2._storedError = void 0, e2._disturbed = false;\n}\nfunction Ir(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_readableStreamController") && e2 instanceof ReadableStream);\n}\nfunction $r(e2) {\n return void 0 !== e2._reader;\n}\nfunction Mr(t2, r2) {\n if (t2._disturbed = true, "closed" === t2._state) return c(void 0);\n if ("errored" === t2._state) return d(t2._storedError);\n Yr(t2);\n const o2 = t2._reader;\n if (void 0 !== o2 && ft(o2)) {\n const e2 = o2._readIntoRequests;\n o2._readIntoRequests = new v(), e2.forEach((e3) => {\n e3._closeSteps(void 0);\n });\n }\n return m(t2._readableStreamController[T](r2), e);\n}\nfunction Yr(e2) {\n e2._state = "closed";\n const t2 = e2._reader;\n if (void 0 !== t2 && (z(t2), ee(t2))) {\n const e3 = t2._readRequests;\n t2._readRequests = new v(), e3.forEach((e4) => {\n e4._closeSteps();\n });\n }\n}\nfunction xr(e2, t2) {\n e2._state = "errored", e2._storedError = t2;\n const r2 = e2._reader;\n void 0 !== r2 && (A(r2, t2), ee(r2) ? oe(r2, t2) : bt(r2, t2));\n}\nfunction Qr(e2) {\n return new TypeError(`ReadableStream.prototype.${e2} can only be used on a ReadableStream`);\n}\nfunction Nr(e2, t2) {\n L(e2, t2);\n const r2 = null == e2 ? void 0 : e2.highWaterMark;\n return Y(r2, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: x(r2) };\n}\nObject.defineProperties(ReadableStream, { from: { enumerable: true } }), Object.defineProperties(ReadableStream.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), o(ReadableStream.from, "from"), o(ReadableStream.prototype.cancel, "cancel"), o(ReadableStream.prototype.getReader, "getReader"), o(ReadableStream.prototype.pipeThrough, "pipeThrough"), o(ReadableStream.prototype.pipeTo, "pipeTo"), o(ReadableStream.prototype.tee, "tee"), o(ReadableStream.prototype.values, "values"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStream.prototype, Symbol.toStringTag, { value: "ReadableStream", configurable: true }), Object.defineProperty(ReadableStream.prototype, _e, { value: ReadableStream.prototype.values, writable: true, configurable: true });\nvar Hr = (e2) => e2.byteLength;\no(Hr, "size");\nvar ByteLengthQueuingStrategy = class {\n constructor(e2) {\n M(e2, 1, "ByteLengthQueuingStrategy"), e2 = Nr(e2, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = e2.highWaterMark;\n }\n get highWaterMark() {\n if (!Ur(this)) throw Vr("highWaterMark");\n return this._byteLengthQueuingStrategyHighWaterMark;\n }\n get size() {\n if (!Ur(this)) throw Vr("size");\n return Hr;\n }\n};\nfunction Vr(e2) {\n return new TypeError(`ByteLengthQueuingStrategy.prototype.${e2} can only be used on a ByteLengthQueuingStrategy`);\n}\nfunction Ur(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_byteLengthQueuingStrategyHighWaterMark") && e2 instanceof ByteLengthQueuingStrategy);\n}\nObject.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true });\nvar Gr = () => 1;\no(Gr, "size");\nvar CountQueuingStrategy = class {\n constructor(e2) {\n M(e2, 1, "CountQueuingStrategy"), e2 = Nr(e2, "First parameter"), this._countQueuingStrategyHighWaterMark = e2.highWaterMark;\n }\n get highWaterMark() {\n if (!Jr(this)) throw Xr("highWaterMark");\n return this._countQueuingStrategyHighWaterMark;\n }\n get size() {\n if (!Jr(this)) throw Xr("size");\n return Gr;\n }\n};\nfunction Xr(e2) {\n return new TypeError(`CountQueuingStrategy.prototype.${e2} can only be used on a CountQueuingStrategy`);\n}\nfunction Jr(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_countQueuingStrategyHighWaterMark") && e2 instanceof CountQueuingStrategy);\n}\nfunction Kr(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nfunction Zr(e2, t2, r2) {\n return I(e2, r2), (r3) => S(e2, t2, [r3]);\n}\nfunction eo(e2, t2, r2) {\n return I(e2, r2), (r3, o2) => g(e2, t2, [r3, o2]);\n}\nfunction to(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nObject.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, { value: "CountQueuingStrategy", configurable: true });\nvar TransformStream = class {\n constructor(e2 = {}, t2 = {}, r2 = {}) {\n void 0 === e2 && (e2 = null);\n const o2 = yt(t2, "Second parameter"), n2 = yt(r2, "Third parameter"), i2 = (function(e3, t3) {\n L(e3, t3);\n const r3 = null == e3 ? void 0 : e3.cancel, o3 = null == e3 ? void 0 : e3.flush, n3 = null == e3 ? void 0 : e3.readableType, i3 = null == e3 ? void 0 : e3.start, a3 = null == e3 ? void 0 : e3.transform, s3 = null == e3 ? void 0 : e3.writableType;\n return { cancel: void 0 === r3 ? void 0 : to(r3, e3, `${t3} has member \'cancel\' that`), flush: void 0 === o3 ? void 0 : Kr(o3, e3, `${t3} has member \'flush\' that`), readableType: n3, start: void 0 === i3 ? void 0 : Zr(i3, e3, `${t3} has member \'start\' that`), transform: void 0 === a3 ? void 0 : eo(a3, e3, `${t3} has member \'transform\' that`), writableType: s3 };\n })(e2, "First parameter");\n if (void 0 !== i2.readableType) throw new RangeError("Invalid readableType specified");\n if (void 0 !== i2.writableType) throw new RangeError("Invalid writableType specified");\n const a2 = mt(n2, 0), s2 = pt(n2), l2 = mt(o2, 1), f2 = pt(o2);\n let b2;\n !(function(e3, t3, r3, o3, n3, i3) {\n function a3() {\n return t3;\n }\n function s3(t4) {\n return (function(e4, t5) {\n const r4 = e4._transformStreamController;\n if (e4._backpressure) {\n return m(e4._backpressureChangePromise, () => {\n const o4 = e4._writable;\n if ("erroring" === o4._state) throw o4._storedError;\n return co(r4, t5);\n });\n }\n return co(r4, t5);\n })(e3, t4);\n }\n function l3(t4) {\n return (function(e4, t5) {\n const r4 = e4._transformStreamController;\n if (void 0 !== r4._finishPromise) return r4._finishPromise;\n const o4 = e4._readable;\n r4._finishPromise = u((e5, t6) => {\n r4._finishPromise_resolve = e5, r4._finishPromise_reject = t6;\n });\n const n4 = r4._cancelAlgorithm(t5);\n return lo(r4), h(n4, () => ("errored" === o4._state ? bo(r4, o4._storedError) : (Tr(o4._readableStreamController, t5), ho(r4)), null), (e5) => (Tr(o4._readableStreamController, e5), bo(r4, e5), null)), r4._finishPromise;\n })(e3, t4);\n }\n function c2() {\n return (function(e4) {\n const t4 = e4._transformStreamController;\n if (void 0 !== t4._finishPromise) return t4._finishPromise;\n const r4 = e4._readable;\n t4._finishPromise = u((e5, r5) => {\n t4._finishPromise_resolve = e5, t4._finishPromise_reject = r5;\n });\n const o4 = t4._flushAlgorithm();\n return lo(t4), h(o4, () => ("errored" === r4._state ? bo(t4, r4._storedError) : (wr(r4._readableStreamController), ho(t4)), null), (e5) => (Tr(r4._readableStreamController, e5), bo(t4, e5), null)), t4._finishPromise;\n })(e3);\n }\n function d2() {\n return (function(e4) {\n return ao(e4, false), e4._backpressureChangePromise;\n })(e3);\n }\n function f3(t4) {\n return (function(e4, t5) {\n const r4 = e4._transformStreamController;\n if (void 0 !== r4._finishPromise) return r4._finishPromise;\n const o4 = e4._writable;\n r4._finishPromise = u((e5, t6) => {\n r4._finishPromise_resolve = e5, r4._finishPromise_reject = t6;\n });\n const n4 = r4._cancelAlgorithm(t5);\n return lo(r4), h(n4, () => ("errored" === o4._state ? bo(r4, o4._storedError) : (Gt(o4._writableStreamController, t5), io(e4), ho(r4)), null), (t6) => (Gt(o4._writableStreamController, t6), io(e4), bo(r4, t6), null)), r4._finishPromise;\n })(e3, t4);\n }\n e3._writable = (function(e4, t4, r4, o4, n4 = 1, i4 = () => 1) {\n const a4 = Object.create(WritableStream.prototype);\n return Ct(a4), Nt(a4, Object.create(WritableStreamDefaultController.prototype), e4, t4, r4, o4, n4, i4), a4;\n })(a3, s3, c2, l3, r3, o3), e3._readable = Dr(a3, d2, f3, n3, i3), e3._backpressure = void 0, e3._backpressureChangePromise = void 0, e3._backpressureChangePromise_resolve = void 0, ao(e3, true), e3._transformStreamController = void 0;\n })(this, u((e3) => {\n b2 = e3;\n }), l2, f2, a2, s2), (function(e3, t3) {\n const r3 = Object.create(TransformStreamDefaultController.prototype);\n let o3, n3, i3;\n o3 = void 0 !== t3.transform ? (e4) => t3.transform(e4, r3) : (e4) => {\n try {\n return uo(r3, e4), c(void 0);\n } catch (e5) {\n return d(e5);\n }\n };\n n3 = void 0 !== t3.flush ? () => t3.flush(r3) : () => c(void 0);\n i3 = void 0 !== t3.cancel ? (e4) => t3.cancel(e4) : () => c(void 0);\n !(function(e4, t4, r4, o4, n4) {\n t4._controlledTransformStream = e4, e4._transformStreamController = t4, t4._transformAlgorithm = r4, t4._flushAlgorithm = o4, t4._cancelAlgorithm = n4, t4._finishPromise = void 0, t4._finishPromise_resolve = void 0, t4._finishPromise_reject = void 0;\n })(e3, r3, o3, n3, i3);\n })(this, i2), void 0 !== i2.start ? b2(i2.start(this._transformStreamController)) : b2(void 0);\n }\n get readable() {\n if (!ro(this)) throw _o("readable");\n return this._readable;\n }\n get writable() {\n if (!ro(this)) throw _o("writable");\n return this._writable;\n }\n};\nfunction ro(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_transformStreamController") && e2 instanceof TransformStream);\n}\nfunction oo(e2, t2) {\n Tr(e2._readable._readableStreamController, t2), no(e2, t2);\n}\nfunction no(e2, t2) {\n lo(e2._transformStreamController), Gt(e2._writable._writableStreamController, t2), io(e2);\n}\nfunction io(e2) {\n e2._backpressure && ao(e2, false);\n}\nfunction ao(e2, t2) {\n void 0 !== e2._backpressureChangePromise && e2._backpressureChangePromise_resolve(), e2._backpressureChangePromise = u((t3) => {\n e2._backpressureChangePromise_resolve = t3;\n }), e2._backpressure = t2;\n}\nObject.defineProperties(TransformStream.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, { value: "TransformStream", configurable: true });\nvar TransformStreamDefaultController = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get desiredSize() {\n if (!so(this)) throw fo("desiredSize");\n return Pr(this._controlledTransformStream._readable._readableStreamController);\n }\n enqueue(e2 = void 0) {\n if (!so(this)) throw fo("enqueue");\n uo(this, e2);\n }\n error(e2 = void 0) {\n if (!so(this)) throw fo("error");\n var t2;\n t2 = e2, oo(this._controlledTransformStream, t2);\n }\n terminate() {\n if (!so(this)) throw fo("terminate");\n !(function(e2) {\n const t2 = e2._controlledTransformStream;\n wr(t2._readable._readableStreamController);\n const r2 = new TypeError("TransformStream terminated");\n no(t2, r2);\n })(this);\n }\n};\nfunction so(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_controlledTransformStream") && e2 instanceof TransformStreamDefaultController);\n}\nfunction lo(e2) {\n e2._transformAlgorithm = void 0, e2._flushAlgorithm = void 0, e2._cancelAlgorithm = void 0;\n}\nfunction uo(e2, t2) {\n const r2 = e2._controlledTransformStream, o2 = r2._readable._readableStreamController;\n if (!Cr(o2)) throw new TypeError("Readable side is not in a state that permits enqueue");\n try {\n Rr(o2, t2);\n } catch (e3) {\n throw no(r2, e3), r2._readable._storedError;\n }\n const n2 = (function(e3) {\n return !gr(e3);\n })(o2);\n n2 !== r2._backpressure && ao(r2, true);\n}\nfunction co(e2, t2) {\n return m(e2._transformAlgorithm(t2), void 0, (t3) => {\n throw oo(e2._controlledTransformStream, t3), t3;\n });\n}\nfunction fo(e2) {\n return new TypeError(`TransformStreamDefaultController.prototype.${e2} can only be used on a TransformStreamDefaultController`);\n}\nfunction ho(e2) {\n void 0 !== e2._finishPromise_resolve && (e2._finishPromise_resolve(), e2._finishPromise_resolve = void 0, e2._finishPromise_reject = void 0);\n}\nfunction bo(e2, t2) {\n void 0 !== e2._finishPromise_reject && (p(e2._finishPromise), e2._finishPromise_reject(t2), e2._finishPromise_resolve = void 0, e2._finishPromise_reject = void 0);\n}\nfunction _o(e2) {\n return new TypeError(`TransformStream.prototype.${e2} can only be used on a TransformStream`);\n}\nObject.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), o(TransformStreamDefaultController.prototype.enqueue, "enqueue"), o(TransformStreamDefaultController.prototype.error, "error"), o(TransformStreamDefaultController.prototype.terminate, "terminate"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, { value: "TransformStreamDefaultController", configurable: true });\n\n// src/rune/isolation/utils-bootstrap.js\nvar import_buffer = __toESM(require_buffer(), 1);\nvar __vars = JSON.parse($__vars);\nvar __os = Object.freeze(JSON.parse($__os));\nvar __stdinIsTTY = Boolean($__stdin_is_tty);\nglobalThis.ReadableStream = ReadableStream;\nglobalThis.WritableStream = WritableStream;\nglobalThis.TransformStream = TransformStream;\nglobalThis.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;\nglobalThis.CountQueuingStrategy = CountQueuingStrategy;\nvar EventTarget = class {\n constructor() {\n this._listeners = {};\n }\n addEventListener(type, fn) {\n (this._listeners[type] ??= []).push(fn);\n }\n removeEventListener(type, fn) {\n this._listeners[type] = (this._listeners[type] ?? []).filter((f2) => f2 !== fn);\n }\n dispatchEvent(event) {\n for (const fn of this._listeners[event.type] ?? []) fn.call(this, event);\n return true;\n }\n};\nvar Event = class {\n constructor(type, init = {}) {\n this.type = type;\n this.bubbles = !!init.bubbles;\n this.cancelable = !!init.cancelable;\n this.defaultPrevented = false;\n }\n preventDefault() {\n if (this.cancelable) this.defaultPrevented = true;\n }\n};\nvar CustomEvent = class extends Event {\n constructor(type, init = {}) {\n super(type, init);\n this.detail = init.detail ?? null;\n }\n};\nglobalThis.EventTarget = EventTarget;\nglobalThis.Event = Event;\nglobalThis.CustomEvent = CustomEvent;\nvar AbortSignal = class extends EventTarget {\n constructor() {\n super();\n this.aborted = false;\n this.reason = void 0;\n }\n _abort(reason) {\n if (this.aborted) return;\n this.aborted = true;\n this.reason = reason ?? new Error("AbortError");\n this.dispatchEvent(new Event("abort"));\n }\n throwIfAborted() {\n if (this.aborted) throw this.reason;\n }\n};\nvar AbortController2 = class {\n constructor() {\n this.signal = new AbortSignal();\n }\n abort(reason) {\n this.signal._abort(reason);\n }\n};\nAbortSignal.abort = (reason) => {\n const s2 = new AbortSignal();\n s2._abort(reason);\n return s2;\n};\nAbortSignal.timeout = (ms) => {\n const ctrl = new AbortController2();\n setTimeout(() => ctrl.abort(), ms);\n return ctrl.signal;\n};\nglobalThis.TextEncoder = import_fast_text_encoding.TextEncoder;\nglobalThis.TextDecoder = import_fast_text_encoding.TextDecoder;\nglobalThis.AbortController = AbortController2;\nglobalThis.AbortSignal = AbortSignal;\nvar Blob2 = class _Blob {\n constructor(parts = [], { type = "" } = {}) {\n this.type = type;\n const chunks = [];\n for (const part of parts) {\n if (typeof part === "string") {\n chunks.push(new import_fast_text_encoding.TextEncoder().encode(part));\n } else if (part instanceof Uint8Array) {\n chunks.push(part);\n } else if (part instanceof _Blob) {\n chunks.push(part._bytes);\n } else if (part instanceof ArrayBuffer) {\n chunks.push(new Uint8Array(part));\n } else {\n chunks.push(new import_fast_text_encoding.TextEncoder().encode(String(part)));\n }\n }\n let totalLen = 0;\n for (const c2 of chunks) totalLen += c2.length;\n const combined = new Uint8Array(totalLen);\n let offset = 0;\n for (const c2 of chunks) {\n combined.set(c2, offset);\n offset += c2.length;\n }\n this._bytes = combined;\n }\n get size() {\n return this._bytes.length;\n }\n async text() {\n return new import_fast_text_encoding.TextDecoder().decode(this._bytes);\n }\n async arrayBuffer() {\n return this._bytes.buffer.slice(this._bytes.byteOffset, this._bytes.byteOffset + this._bytes.byteLength);\n }\n slice(start = 0, end = this._bytes.length, contentType = "") {\n return new _Blob([this._bytes.slice(start, end)], { type: contentType });\n }\n};\nglobalThis.Blob = Blob2;\nvar Headers = class _Headers {\n constructor(init) {\n this._map = /* @__PURE__ */ new Map();\n if (init instanceof _Headers) {\n for (const [k2, v2] of init._map) this._map.set(k2, v2);\n } else if (Array.isArray(init)) {\n for (const [k2, v2] of init) this._map.set(k2.toLowerCase(), v2);\n } else if (init && typeof init === "object") {\n for (const [k2, v2] of Object.entries(init)) this._map.set(k2.toLowerCase(), String(v2));\n }\n }\n get(name) {\n return this._map.get(name.toLowerCase()) ?? null;\n }\n set(name, value) {\n this._map.set(name.toLowerCase(), String(value));\n }\n has(name) {\n return this._map.has(name.toLowerCase());\n }\n append(name, value) {\n const key = name.toLowerCase();\n const existing = this._map.get(key);\n this._map.set(key, existing != null ? `${existing}, ${value}` : String(value));\n }\n delete(name) {\n this._map.delete(name.toLowerCase());\n }\n entries() {\n return this._map.entries();\n }\n keys() {\n return this._map.keys();\n }\n values() {\n return this._map.values();\n }\n forEach(fn) {\n this._map.forEach((v2, k2) => fn(v2, k2));\n }\n [Symbol.iterator]() {\n return this._map.entries();\n }\n};\nglobalThis.Headers = Headers;\nvar FormData = class {\n constructor() {\n this._entries = [];\n }\n append(name, value, filename) {\n this._entries.push({ name, value, filename });\n }\n get(name) {\n const entry = this._entries.find((e2) => e2.name === name);\n return entry ? entry.value : null;\n }\n getAll(name) {\n return this._entries.filter((e2) => e2.name === name).map((e2) => e2.value);\n }\n has(name) {\n return this._entries.some((e2) => e2.name === name);\n }\n set(name, value, filename) {\n const idx = this._entries.findIndex((e2) => e2.name === name);\n if (idx !== -1) {\n this._entries.splice(idx, 1, { name, value, filename });\n } else {\n this._entries.push({ name, value, filename });\n }\n }\n delete(name) {\n this._entries = this._entries.filter((e2) => e2.name !== name);\n }\n entries() {\n return this._entries.map((e2) => [e2.name, e2.value])[Symbol.iterator]();\n }\n _toWire() {\n const boundary = "----CrunesFormBoundary" + Math.random().toString(36).slice(2);\n const parts = this._entries.map((e2) => ({\n name: e2.name,\n filename: e2.filename ?? null,\n value: e2.value instanceof Blob2 ? { type: "Buffer", data: Array.from(e2.value._bytes), contentType: e2.value.type || "application/octet-stream" } : e2.value instanceof Uint8Array ? { type: "Buffer", data: Array.from(e2.value), contentType: "application/octet-stream" } : e2.value\n }));\n return { type: "FormData", boundary, parts };\n }\n};\nglobalThis.FormData = FormData;\nvar URLSearchParams = class {\n constructor(init) {\n this._params = [];\n if (typeof init === "string") {\n const s2 = init.startsWith("?") ? init.slice(1) : init;\n for (const pair of s2.split("&")) {\n if (!pair) continue;\n const eq = pair.indexOf("=");\n if (eq === -1) {\n this._params.push([decodeURIComponent(pair), ""]);\n } else {\n this._params.push([decodeURIComponent(pair.slice(0, eq)), decodeURIComponent(pair.slice(eq + 1))]);\n }\n }\n } else if (Array.isArray(init)) {\n for (const [k2, v2] of init) this._params.push([String(k2), String(v2)]);\n } else if (init && typeof init === "object") {\n for (const [k2, v2] of Object.entries(init)) this._params.push([k2, String(v2)]);\n }\n }\n append(name, value) {\n this._params.push([name, String(value)]);\n }\n delete(name) {\n this._params = this._params.filter(([k2]) => k2 !== name);\n }\n get(name) {\n return (this._params.find(([k2]) => k2 === name) ?? [null, null])[1];\n }\n getAll(name) {\n return this._params.filter(([k2]) => k2 === name).map(([, v2]) => v2);\n }\n has(name) {\n return this._params.some(([k2]) => k2 === name);\n }\n set(name, value) {\n const idx = this._params.findIndex(([k2]) => k2 === name);\n if (idx !== -1) {\n this._params = this._params.filter(([k2]) => k2 !== name);\n this._params.splice(idx, 0, [name, String(value)]);\n } else {\n this._params.push([name, String(value)]);\n }\n }\n toString() {\n return this._params.map(([k2, v2]) => `${encodeURIComponent(k2)}=${encodeURIComponent(v2)}`).join("&");\n }\n entries() {\n return this._params[Symbol.iterator]();\n }\n keys() {\n return this._params.map(([k2]) => k2)[Symbol.iterator]();\n }\n values() {\n return this._params.map(([, v2]) => v2)[Symbol.iterator]();\n }\n [Symbol.iterator]() {\n return this._params[Symbol.iterator]();\n }\n};\nglobalThis.URLSearchParams = URLSearchParams;\nvar URL2 = class _URL {\n constructor(input, base) {\n const str = String(input);\n let full = str;\n if (base !== void 0) {\n const b2 = base instanceof _URL ? base.href : String(base);\n if (/^https?:\\/\\//i.test(str)) {\n full = str;\n } else if (str.startsWith("//")) {\n full = b2.match(/^https?:/i)?.[0] + str;\n } else if (str.startsWith("/")) {\n full = b2.replace(/^(https?:\\/\\/[^/]+).*/i, "$1") + str;\n } else {\n full = b2.replace(/[^/]*$/, "") + str;\n }\n }\n const m2 = full.match(/^([a-z][a-z0-9+\\-.]*):\\/\\/([^/?#]*)([^?#]*)(\\?[^#]*)?(#.*)?$/i);\n if (!m2) throw new TypeError(`Invalid URL: ${str}`);\n this._protocol = m2[1].toLowerCase() + ":";\n const host = m2[2] || "";\n const ci = host.indexOf(":");\n this._hostname = ci === -1 ? host : host.slice(0, ci);\n this._port = ci === -1 ? "" : host.slice(ci + 1);\n this._pathname = m2[3] || "/";\n this._search = m2[4] || "";\n this._hash = m2[5] || "";\n this._searchParams = new URLSearchParams(this._search);\n }\n get protocol() {\n return this._protocol;\n }\n get hostname() {\n return this._hostname;\n }\n get port() {\n return this._port;\n }\n get host() {\n return this._port ? `${this._hostname}:${this._port}` : this._hostname;\n }\n get pathname() {\n return this._pathname;\n }\n get search() {\n return this._searchParams.toString() ? "?" + this._searchParams.toString() : "";\n }\n get searchParams() {\n return this._searchParams;\n }\n get hash() {\n return this._hash;\n }\n get origin() {\n return `${this._protocol}//${this.host}`;\n }\n get href() {\n return `${this._protocol}//${this.host}${this._pathname}${this.search}${this._hash}`;\n }\n toString() {\n return this.href;\n }\n toJSON() {\n return this.href;\n }\n};\nglobalThis.URL = URL2;\nvar TextEncoderStream = class {\n constructor() {\n const encoder = new import_fast_text_encoding.TextEncoder();\n const transform = new TransformStream({\n transform(chunk, controller) {\n controller.enqueue(encoder.encode(chunk));\n }\n });\n this.readable = transform.readable;\n this.writable = transform.writable;\n }\n};\nvar TextDecoderStream = class {\n constructor(label = "utf-8", options = {}) {\n const decoder = new import_fast_text_encoding.TextDecoder(label, options);\n const transform = new TransformStream({\n transform(chunk, controller) {\n controller.enqueue(decoder.decode(chunk));\n },\n flush(controller) {\n const remaining = decoder.decode(new Uint8Array(0));\n if (remaining) controller.enqueue(remaining);\n }\n });\n this.readable = transform.readable;\n this.writable = transform.writable;\n }\n};\nglobalThis.TextEncoderStream = TextEncoderStream;\nglobalThis.TextDecoderStream = TextDecoderStream;\nglobalThis.structuredClone = (val) => JSON.parse(JSON.stringify(val));\nglobalThis.queueMicrotask = (fn) => Promise.resolve().then(fn);\nglobalThis.btoa = (str) => import_buffer.Buffer.from(str, "binary").toString("base64");\nglobalThis.atob = (b64) => import_buffer.Buffer.from(b64, "base64").toString("binary");\nglobalThis.performance = { now: () => $__performance_now.applySync(void 0, []) };\nglobalThis.Buffer = import_buffer.Buffer;\nvar Request = class _Request {\n constructor(input, init = {}) {\n if (input instanceof _Request) {\n this.url = input.url;\n this.method = input.method;\n this.headers = new Headers(input.headers);\n this._body = input._body;\n this._bodyUsed = false;\n } else {\n this.url = String(input);\n this.method = (init.method ?? "GET").toUpperCase();\n this.headers = new Headers(init.headers);\n this._body = init.body ?? null;\n this._bodyUsed = false;\n }\n if (init.method) this.method = init.method.toUpperCase();\n if (init.headers) {\n for (const [k2, v2] of new Headers(init.headers)) this.headers.set(k2, v2);\n }\n if (init.body !== void 0) {\n this._body = init.body;\n this._bodyUsed = false;\n }\n }\n get body() {\n if (this._body instanceof ReadableStream) return this._body;\n if (this._body == null) return null;\n const bytes = this._body instanceof Blob2 ? this._body._bytes : this._body instanceof Uint8Array ? this._body : new import_fast_text_encoding.TextEncoder().encode(String(this._body));\n return new ReadableStream({ start(c2) {\n c2.enqueue(bytes);\n c2.close();\n } });\n }\n get bodyUsed() {\n return this._bodyUsed;\n }\n _consume() {\n if (this._body != null && this._bodyUsed) throw new TypeError("body already used");\n if (this._body != null) this._bodyUsed = true;\n }\n async text() {\n this._consume();\n if (this._body == null) return "";\n if (this._body instanceof Blob2) return this._body.text();\n if (this._body instanceof Uint8Array) return new import_fast_text_encoding.TextDecoder().decode(this._body);\n return String(this._body);\n }\n async json() {\n return JSON.parse(await this.text());\n }\n async blob() {\n this._consume();\n if (this._body == null) return new Blob2([], { type: "" });\n if (this._body instanceof Blob2) return this._body;\n if (this._body instanceof Uint8Array) return new Blob2([this._body]);\n return new Blob2([new import_fast_text_encoding.TextEncoder().encode(String(this._body))]);\n }\n};\nglobalThis.Request = Request;\nvar Response = class {\n constructor(body = null, init = {}) {\n this.status = init.status ?? 200;\n this.statusText = init.statusText ?? "";\n this.headers = new Headers(init.headers);\n this.ok = this.status >= 200 && this.status < 300;\n this._body = body ?? null;\n this._bodyUsed = false;\n }\n get bodyUsed() {\n return this._bodyUsed;\n }\n get body() {\n if (this._body == null) return null;\n if (this._body instanceof ReadableStream) return this._body;\n const bytes = this._body instanceof Blob2 ? this._body._bytes : this._body instanceof Uint8Array ? this._body : new import_fast_text_encoding.TextEncoder().encode(String(this._body));\n return new ReadableStream({ start(c2) {\n c2.enqueue(bytes);\n c2.close();\n } });\n }\n _consume() {\n if (this._bodyUsed) throw new TypeError("body already used");\n this._bodyUsed = true;\n }\n async text() {\n this._consume();\n if (this._body == null) return "";\n if (this._body instanceof Blob2) return this._body.text();\n if (this._body instanceof Uint8Array) return new import_fast_text_encoding.TextDecoder().decode(this._body);\n if (this._body instanceof ReadableStream) {\n const reader = this._body.getReader();\n const chunks = [];\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n const total = new Uint8Array(chunks.reduce((n2, c2) => n2 + c2.byteLength, 0));\n let offset = 0;\n for (const c2 of chunks) {\n total.set(c2, offset);\n offset += c2.byteLength;\n }\n return new import_fast_text_encoding.TextDecoder().decode(total);\n }\n return String(this._body);\n }\n async json() {\n return JSON.parse(await this.text());\n }\n async blob() {\n this._consume();\n if (this._body == null) return new Blob2([], { type: "" });\n if (this._body instanceof Blob2) return this._body;\n if (this._body instanceof Uint8Array) return new Blob2([this._body]);\n return new Blob2([new import_fast_text_encoding.TextEncoder().encode(String(this._body))]);\n }\n};\nglobalThis.Response = Response;\nfunction _makeResponse(meta, responseHeaders, bytesPromise, bodyStream, consumeGuard) {\n return {\n get ok() {\n return meta.ok;\n },\n get status() {\n return meta.status;\n },\n get statusText() {\n return meta.statusText;\n },\n get headers() {\n return responseHeaders;\n },\n get bodyUsed() {\n return false;\n },\n async text() {\n consumeGuard();\n const bytes = await bytesPromise;\n return new import_fast_text_encoding.TextDecoder().decode(bytes);\n },\n async json() {\n consumeGuard();\n const bytes = await bytesPromise;\n return JSON.parse(new import_fast_text_encoding.TextDecoder().decode(bytes));\n },\n async blob() {\n consumeGuard();\n const bytes = await bytesPromise;\n const contentType = responseHeaders.get("content-type") ?? "";\n return new Blob2([bytes], { type: contentType });\n },\n get body() {\n consumeGuard();\n return bodyStream;\n }\n };\n}\nfunction _makeShellSession(cmd, o2, binaryMode) {\n const id = $__utils_shell_spawn_open.applySync(void 0, [cmd, o2], { arguments: { copy: true } });\n const createHybridReadable = (streamType, binary) => {\n let controller;\n const listeners = [];\n const stream = new ReadableStream({\n start(c2) {\n controller = c2;\n }\n });\n stream.on = (event, callback) => {\n listeners.push({ event, callback });\n };\n const handleData = (ab) => {\n const chunk = binary ? new Uint8Array(ab) : new import_fast_text_encoding.TextDecoder().decode(ab);\n if (controller) {\n try {\n controller.enqueue(chunk);\n } catch (e2) {\n }\n }\n for (const l2 of listeners) {\n if (l2.event === "data") l2.callback(chunk);\n }\n };\n const handleEnd = () => {\n if (controller) {\n try {\n controller.close();\n } catch (e2) {\n }\n }\n for (const l2 of listeners) {\n if (l2.event === "end") l2.callback();\n }\n };\n $__utils_shell_spawn_on.applySync(void 0, [id, streamType, "data", handleData], { arguments: { reference: true } });\n $__utils_shell_spawn_on.applySync(void 0, [id, streamType, "end", handleEnd], { arguments: { reference: true } });\n return stream;\n };\n const stdoutStream = createHybridReadable("stdout", binaryMode);\n const stderrStream = createHybridReadable("stderr", false);\n const stdinStream = new WritableStream({\n async write(chunk) {\n let rawChunk = chunk;\n if (rawChunk instanceof Uint8Array) rawChunk = rawChunk.buffer;\n await $__utils_shell_spawn_write.apply(void 0, [id, rawChunk], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n await $__utils_shell_spawn_end.apply(void 0, [id], { result: { promise: true } });\n }\n });\n stdinStream.write = (text) => {\n let rawChunk = text;\n if (rawChunk instanceof Uint8Array) rawChunk = rawChunk.buffer;\n $__utils_shell_spawn_write.applySync(void 0, [id, rawChunk], { arguments: { copy: true } });\n };\n stdinStream.end = () => {\n $__utils_shell_spawn_end.applySync(void 0, [id]);\n };\n const session = {\n stdin: stdinStream,\n stdout: stdoutStream,\n stderr: stderrStream,\n on(event, callback) {\n $__utils_shell_spawn_on.applySync(void 0, [id, "session", event, callback], { arguments: { reference: true } });\n },\n open: () => $__utils_shell_spawn_start.applySync(void 0, [id]),\n kill: (signal) => $__utils_shell_spawn_kill.applySync(void 0, [id, signal ?? null])\n };\n if (o2 && o2.signal) {\n o2.signal.addEventListener("abort", () => session.kill("SIGTERM"));\n }\n return session;\n}\nglobalThis.crypto = {\n randomUUID: () => $__webcrypto_random_uuid.applySync(void 0, []),\n getRandomValues(array) {\n const buf = $__webcrypto_get_random_values.applySync(void 0, [array.buffer], { arguments: { copy: true }, result: { copy: true } });\n array.set(new array.constructor(buf));\n return array;\n },\n subtle: {\n digest: (alg, data) => {\n const buf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_digest.apply(void 0, [alg, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n sign: (alg, key, data) => {\n const buf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_sign.apply(void 0, [alg, key, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n verify: (alg, key, sig, data) => {\n const sigBuf = sig instanceof ArrayBuffer ? sig : sig.buffer;\n const dataBuf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_verify.apply(void 0, [alg, key, sigBuf, dataBuf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n encrypt: (alg, key, data) => {\n const buf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_encrypt.apply(void 0, [alg, key, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n decrypt: (alg, key, data) => {\n const buf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_decrypt.apply(void 0, [alg, key, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n generateKey: (alg, extractable, usages) => $__webcrypto_subtle_generate_key.apply(void 0, [alg, extractable, usages], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n importKey: (format, keyData, alg, extractable, usages) => {\n const data = keyData instanceof ArrayBuffer ? keyData : ArrayBuffer.isView(keyData) ? keyData.buffer : keyData;\n return $__webcrypto_subtle_import_key.apply(void 0, [format, data, alg, extractable, usages], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n exportKey: (format, key) => $__webcrypto_subtle_export_key.apply(void 0, [format, key], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n deriveKey: (alg, baseKey, derivedAlg, extractable, usages) => $__webcrypto_subtle_derive_key.apply(void 0, [alg, baseKey, derivedAlg, extractable, usages], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n deriveBits: (alg, baseKey, length) => $__webcrypto_subtle_derive_bits.apply(void 0, [alg, baseKey, length], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n wrapKey: (format, key, wrappingKey, wrapAlg) => $__webcrypto_subtle_wrap_key.apply(void 0, [format, key, wrappingKey, wrapAlg], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n unwrapKey: (format, wrappedData, unwrappingKey, unwrapAlg, unwrappedAlg, extractable, usages) => {\n const buf = wrappedData instanceof ArrayBuffer ? wrappedData : wrappedData.buffer;\n return $__webcrypto_subtle_unwrap_key.apply(void 0, [format, buf, unwrappingKey, unwrapAlg, unwrappedAlg, extractable, usages], { arguments: { copy: true }, result: { promise: true, copy: true } });\n }\n }\n};\nglobalThis.utils = {\n fs: {\n cwd: () => $__projectDir,\n resolve: (p2) => $__utils_fs_resolve.apply(void 0, [p2], { result: { promise: true, copy: true } }),\n read: (p2, o2) => $__utils_fs_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n exists: (p2) => $__utils_fs_exists.apply(void 0, [p2], { result: { promise: true } }),\n glob: (p2, o2) => $__utils_fs_glob.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, c2) => $__utils_fs_write.apply(void 0, [p2, c2], { arguments: { copy: true }, result: { promise: true } }),\n copy: (src, dest) => $__utils_fs_copy.apply(void 0, [src, dest], { result: { promise: true } }),\n remove: (path, opts) => $__utils_fs_remove.apply(void 0, [path, opts], { arguments: { copy: true }, result: { promise: true } }),\n move: (src, dest) => $__utils_fs_move.apply(void 0, [src, dest], { result: { promise: true } }),\n stat: (path) => $__utils_fs_stat.apply(void 0, [path], { result: { promise: true, copy: true } }),\n mkdir: (path) => $__utils_fs_mkdir.apply(void 0, [path], { result: { promise: true } }),\n readBytes: async (path, opts) => {\n const ab = await $__utils_fs_read_bytes.apply(void 0, [path, opts], { arguments: { copy: true }, result: { promise: true, copy: true } });\n return ab ? new Uint8Array(ab) : null;\n },\n readBytesStream: (path) => {\n let streamId = null;\n return new ReadableStream({\n async start() {\n streamId = await $__utils_fs_readStream.apply(void 0, [path], { result: { promise: true } });\n },\n async pull(controller) {\n const ab = await $__utils_fs_readStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (ab === null) controller.close();\n else controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n readStream: (path) => {\n return globalThis.utils.fs.readBytesStream(path).pipeThrough(new TextDecoderStream());\n },\n writeBytesStream: (path) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_fs_writeStream.apply(void 0, [path], { result: { promise: true } });\n },\n async write(chunk) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("writeBytesStream requires Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(void 0, [streamId, chunk.buffer, chunk.byteOffset, chunk.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n },\n async abort() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n }\n });\n },\n writeStream: (path) => {\n const wsBytes = globalThis.utils.fs.writeBytesStream(path);\n const writer = wsBytes.getWriter();\n const encoder = new import_fast_text_encoding.TextEncoder();\n return new WritableStream({\n async write(chunk) {\n await writer.write(encoder.encode(chunk));\n },\n async close() {\n await writer.close();\n },\n async abort(reason) {\n await writer.abort(reason);\n }\n });\n },\n writeBytes: (path, content) => {\n if (!(content instanceof Uint8Array)) throw new TypeError("writeBytes requires a Uint8Array");\n return $__utils_fs_write_bytes.apply(void 0, [path, content.buffer, content.byteOffset, content.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n append: (p2, c2) => $__utils_fs_append.apply(void 0, [p2, c2], { arguments: { copy: true }, result: { promise: true } }),\n appendBytes: async (p2, content) => {\n if (!(content instanceof Uint8Array)) throw new TypeError("appendBytes requires a Uint8Array");\n return $__utils_fs_append_bytes.apply(void 0, [p2, content.buffer, content.byteOffset, content.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n appendBytesStream: (path) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_fs_appendStream.apply(void 0, [path], { result: { promise: true } });\n },\n async write(chunk) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("appendBytesStream requires Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(void 0, [streamId, chunk.buffer, chunk.byteOffset, chunk.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n },\n async abort() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n }\n });\n },\n chmod: (p2, mode) => $__utils_fs_chmod.apply(void 0, [p2, mode], { arguments: { copy: true }, result: { promise: true } }),\n prepend: (p2, c2) => $__utils_fs_prepend.apply(void 0, [p2, c2], { arguments: { copy: true }, result: { promise: true } }),\n watch: (pattern, callback, opts) => {\n const id = $__utils_fs_watch.applySync(void 0, [pattern, callback, opts ?? {}], { arguments: { reference: true } });\n return {\n stop: () => $__utils_fs_watch_stop.applySync(void 0, [id])\n };\n },\n replace: async (p2, regex, replacement) => {\n const content = await globalThis.utils.fs.read(p2);\n const newContent = content.replace(regex, replacement);\n await globalThis.utils.fs.write(p2, newContent);\n }\n },\n shell: {\n exec: async (cmd, o2) => {\n let stdinStreamId = null;\n let opts = { ...o2 };\n const hasStdinStream = o2 && o2.stdin && typeof o2.stdin.getReader === "function";\n if (hasStdinStream) {\n stdinStreamId = "shell_stdin_" + Math.random().toString(36).slice(2);\n delete opts.stdin;\n } else if (o2 && o2.stdin instanceof Uint8Array) {\n opts.stdin = { type: "Buffer", data: Array.from(o2.stdin) };\n } else if (o2 && o2.stdin && typeof o2.stdin === "object" && o2.stdin.buffer) {\n opts.stdin = { type: "Buffer", data: Array.from(new Uint8Array(o2.stdin.buffer)) };\n }\n const promise = $__utils_shell_exec.apply(\n void 0,\n [cmd, opts, stdinStreamId],\n { arguments: { copy: true }, result: { promise: true, copy: true } }\n );\n if (hasStdinStream) {\n const reader = o2.stdin.getReader();\n const pump = async () => {\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n let chunk = value;\n if (typeof chunk === "string") {\n chunk = new import_fast_text_encoding.TextEncoder().encode(chunk);\n }\n if (!(chunk instanceof Uint8Array)) {\n throw new TypeError("stdin stream must yield string or Uint8Array chunks");\n }\n await $__utils_fs_writeStream_write.apply(\n void 0,\n [stdinStreamId, chunk.buffer, chunk.byteOffset, chunk.byteLength],\n { arguments: { copy: true }, result: { promise: true } }\n );\n }\n } finally {\n await $__utils_fs_writeStream_close.apply(\n void 0,\n [stdinStreamId],\n { result: { promise: true } }\n );\n }\n };\n pump();\n }\n return await promise;\n },\n execBinary: async (cmd, o2) => {\n let stdinStreamId = null;\n let opts = { ...o2, binary: true };\n const hasStdinStream = o2 && o2.stdin && typeof o2.stdin.getReader === "function";\n if (hasStdinStream) {\n stdinStreamId = "shell_stdin_" + Math.random().toString(36).slice(2);\n delete opts.stdin;\n } else if (o2 && o2.stdin instanceof Uint8Array) {\n opts.stdin = { type: "Buffer", data: Array.from(o2.stdin) };\n } else if (o2 && o2.stdin && typeof o2.stdin === "object" && o2.stdin.buffer) {\n opts.stdin = { type: "Buffer", data: Array.from(new Uint8Array(o2.stdin.buffer)) };\n }\n const promise = $__utils_shell_exec.apply(\n void 0,\n [cmd, opts, stdinStreamId],\n { arguments: { copy: true }, result: { promise: true, copy: true } }\n );\n if (hasStdinStream) {\n const reader = o2.stdin.getReader();\n const pump = async () => {\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n let chunk = value;\n if (typeof chunk === "string") chunk = new import_fast_text_encoding.TextEncoder().encode(chunk);\n if (!(chunk instanceof Uint8Array)) throw new TypeError("stdin stream must yield string or Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(\n void 0,\n [stdinStreamId, chunk.buffer, chunk.byteOffset, chunk.byteLength],\n { arguments: { copy: true }, result: { promise: true } }\n );\n }\n } finally {\n await $__utils_fs_writeStream_close.apply(void 0, [stdinStreamId], { result: { promise: true } });\n }\n };\n pump();\n }\n const res = await promise;\n if (res && res.stdout instanceof ArrayBuffer) {\n return { ...res, stdout: new Uint8Array(res.stdout) };\n }\n return res;\n },\n spawn: (cmd, o2) => _makeShellSession(cmd, o2, false),\n spawnBinary: (cmd, o2) => _makeShellSession(cmd, o2, true),\n job: {\n start: (cmd, opts) => $__utils_shell_job_start.apply(void 0, [cmd, opts], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n kill: (id, signal) => $__utils_shell_job_kill.apply(void 0, [id, signal ?? null], { arguments: { copy: true }, result: { promise: true } }),\n exists: (id) => $__utils_shell_job_exists.apply(void 0, [id], { result: { promise: true, copy: true } }),\n stdout: (id) => $__utils_shell_job_stdout.apply(void 0, [id], { result: { promise: true, copy: true } }),\n stderr: (id) => $__utils_shell_job_stderr.apply(void 0, [id], { result: { promise: true, copy: true } }),\n write: (id, text) => $__utils_shell_job_write.apply(void 0, [id, text], { arguments: { copy: true }, result: { promise: true } }),\n writeEof: (id) => $__utils_shell_job_write_eof.apply(void 0, [id], { arguments: { copy: true }, result: { promise: true } })\n }\n },\n section: {\n create: (name, data, o2) => $__utils_section_create.applySync(void 0, [name, data, o2], { arguments: { copy: true }, result: { copy: true } }),\n emit: (sectionOrArray) => $__utils_section_emit.applySync(void 0, [sectionOrArray], { arguments: { copy: true } }),\n match: (sectionName, patterns) => $__utils_section_match.applySync(void 0, [sectionName, patterns], { arguments: { copy: true }, result: { copy: true } }),\n selected: () => $__utils_section_selected.applySync(void 0, [], { result: { copy: true } })\n },\n rune: {\n exec: (key, args, opts) => $__utils_rune_exec.apply(void 0, [key, args, opts], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n spawn: (key, args, opts) => {\n const id = $__utils_rune_spawn_open.applySync(void 0, [key, args, opts], { arguments: { copy: true } });\n const createHybridReadable = (streamType) => {\n let controller;\n const listeners = [];\n const stream = new ReadableStream({ start(c2) {\n controller = c2;\n } });\n stream.on = (event, callback) => {\n listeners.push({ event, callback });\n };\n const handleData = (ab) => {\n const chunk = new import_fast_text_encoding.TextDecoder().decode(ab);\n try {\n if (controller) controller.enqueue(chunk);\n } catch {\n }\n for (const l2 of listeners) {\n if (l2.event === "data") l2.callback(chunk);\n }\n };\n const handleEnd = () => {\n try {\n if (controller) controller.close();\n } catch {\n }\n for (const l2 of listeners) {\n if (l2.event === "end") l2.callback();\n }\n };\n $__utils_rune_spawn_on.applySync(void 0, [id, streamType, "data", handleData], { arguments: { reference: true } });\n $__utils_rune_spawn_on.applySync(void 0, [id, streamType, "end", handleEnd], { arguments: { reference: true } });\n return stream;\n };\n const stdoutStream = createHybridReadable("stdout");\n const stderrStream = createHybridReadable("stderr");\n return {\n stdout: stdoutStream,\n stderr: stderrStream,\n on(event, callback) {\n $__utils_rune_spawn_on.applySync(void 0, [id, "session", event, callback], { arguments: { reference: true } });\n },\n open: () => $__utils_rune_spawn_start.applySync(void 0, [id]),\n kill: (signal) => $__utils_rune_spawn_kill.applySync(void 0, [id, signal ?? null]),\n write: (text) => $__utils_rune_spawn_write.applySync(void 0, [id, text], { arguments: { copy: true } }),\n writeCommand: (nameOrText, args2) => $__utils_rune_spawn_write_command.applySync(void 0, [id, nameOrText, args2 ?? null], { arguments: { copy: true } }),\n writeEof: () => $__utils_rune_spawn_write_eof.applySync(void 0, [id]),\n writeInterrupt: () => $__utils_rune_spawn_write_interrupt.applySync(void 0, [id]),\n stdin: {\n write: (chunk) => $__utils_rune_spawn_stdin_write.applySync(void 0, [id, chunk], { arguments: { copy: true } })\n }\n };\n },\n job: {\n start: (key, args, opts) => $__utils_rune_job_start.apply(void 0, [key, args, opts], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n kill: (id, signal) => $__utils_rune_job_kill.apply(void 0, [id, signal ?? null], { arguments: { copy: true }, result: { promise: true } }),\n exists: (id) => $__utils_rune_job_exists.apply(void 0, [id], { result: { promise: true, copy: true } }),\n stdout: (id) => $__utils_rune_job_stdout.apply(void 0, [id], { result: { promise: true, copy: true } }),\n stderr: (id) => $__utils_rune_job_stderr.apply(void 0, [id], { result: { promise: true, copy: true } }),\n sections: (id) => $__utils_rune_job_sections.apply(void 0, [id], { result: { promise: true, copy: true } }),\n write: (id, text) => $__utils_rune_job_write.apply(void 0, [id, text], { arguments: { copy: true }, result: { promise: true } }),\n writeCommand: (id, nameOrText, args) => $__utils_rune_job_write_command.apply(void 0, [id, nameOrText, args ?? null], { arguments: { copy: true }, result: { promise: true } }),\n writeEof: (id) => $__utils_rune_job_write_eof.apply(void 0, [id], { arguments: { copy: true }, result: { promise: true } })\n }\n },\n json: {\n read: (p2, o2) => $__utils_json_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readPath: (p2, q2, f2, o2) => $__utils_json_readPath.apply(void 0, [p2, q2, f2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readPathAll: (p2, q2, f2, o2) => $__utils_json_readPathAll.apply(void 0, [p2, q2, f2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, d2, o2) => $__utils_json_write.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n writePath: (p2, q2, v2, o2) => $__utils_json_writePath.apply(void 0, [p2, q2, v2, o2], { arguments: { copy: true }, result: { promise: true } }),\n parse: (t2, o2) => $__utils_json_parse.applySync(void 0, [t2, o2], { arguments: { copy: true }, result: { copy: true } }),\n stringify: (d2, o2) => $__utils_json_stringify.applySync(void 0, [d2, o2], { arguments: { copy: true }, result: { copy: true } }),\n modify: async (filepath, callback, opts = {}) => {\n const { initial, spaces = 2, format } = opts;\n const missing = !await globalThis.utils.fs.exists(filepath);\n if (missing && initial === void 0) {\n await globalThis.utils.json.read(filepath, { format });\n }\n const data = missing ? JSON.parse(JSON.stringify(initial)) : await globalThis.utils.json.read(filepath, { format });\n const result = await callback(data, { exists: !missing });\n await globalThis.utils.json.write(filepath, result !== void 0 ? result : data, { spaces, format });\n }\n },\n yaml: {\n parse: (t2) => $__utils_yaml_parse.applySync(void 0, [t2], { arguments: { copy: true }, result: { copy: true } }),\n stringify: (d2, o2) => $__utils_yaml_stringify.applySync(void 0, [d2, o2], { arguments: { copy: true }, result: { copy: true } }),\n read: (p2, o2) => $__utils_yaml_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, d2, o2) => $__utils_yaml_write.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n readPath: (p2, q2, f2) => $__utils_yaml_readPath.apply(void 0, [p2, q2, f2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readPathAll: (p2, q2, f2) => $__utils_yaml_readPathAll.apply(void 0, [p2, q2, f2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n writePath: (p2, q2, v2, o2) => $__utils_yaml_writePath.apply(void 0, [p2, q2, v2, o2], { arguments: { copy: true }, result: { promise: true } }),\n modify: async (filepath, callback, opts = {}) => {\n const { initial, indent = 2 } = opts;\n const missing = !await globalThis.utils.fs.exists(filepath);\n if (missing && initial === void 0) {\n await globalThis.utils.yaml.read(filepath);\n }\n const data = missing ? JSON.parse(JSON.stringify(initial)) : await globalThis.utils.yaml.read(filepath);\n const result = await callback(data, { exists: !missing });\n await globalThis.utils.yaml.write(filepath, result !== void 0 ? result : data, { indent });\n }\n },\n xml: {\n parse: (t2) => $__utils_xml_parse.applySync(void 0, [t2], { arguments: { copy: true }, result: { copy: true } }),\n stringify: (d2, o2) => $__utils_xml_stringify.applySync(void 0, [d2, o2], { arguments: { copy: true }, result: { copy: true } }),\n read: (p2, o2) => $__utils_xml_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, d2, o2) => $__utils_xml_write.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n readPath: (p2, q2, f2) => $__utils_xml_readPath.apply(void 0, [p2, q2, f2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readPathAll: (p2, q2, f2) => $__utils_xml_readPathAll.apply(void 0, [p2, q2, f2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n writePath: (p2, q2, v2, o2) => $__utils_xml_writePath.apply(void 0, [p2, q2, v2, o2], { arguments: { copy: true }, result: { promise: true } }),\n modify: async (filepath, callback, opts = {}) => {\n const { initial, indent = 2 } = opts;\n const missing = !await globalThis.utils.fs.exists(filepath);\n if (missing && initial === void 0) {\n await globalThis.utils.xml.read(filepath);\n }\n const data = missing ? JSON.parse(JSON.stringify(initial)) : await globalThis.utils.xml.read(filepath);\n const result = await callback(data, { exists: !missing });\n await globalThis.utils.xml.write(filepath, result !== void 0 ? result : data, { indent });\n }\n },\n csv: {\n read: (p2, o2) => $__utils_csv_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readObjects: (p2, o2) => $__utils_csv_read_objects.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, d2, o2) => $__utils_csv_write.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n writeObjects: (p2, d2, o2) => $__utils_csv_write_objects.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n headers: (p2, o2) => $__utils_csv_headers.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n count: (p2, o2) => $__utils_csv_count.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } }),\n append: (p2, r2, o2) => $__utils_csv_append.apply(void 0, [p2, r2, o2], { arguments: { copy: true }, result: { promise: true } }),\n appendObjects: (p2, d2, o2) => $__utils_csv_append_objects.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n parse: (c2, o2) => $__utils_csv_parse.applySync(void 0, [c2, o2], { arguments: { copy: true }, result: { copy: true } }),\n parseObjects: (c2, o2) => $__utils_csv_parse_objects.applySync(void 0, [c2, o2], { arguments: { copy: true }, result: { copy: true } }),\n stringify: (r2, o2) => $__utils_csv_stringify.applySync(void 0, [r2, o2], { arguments: { copy: true }, result: { copy: true } }),\n stringifyObjects: (d2, o2) => $__utils_csv_stringify_objects.applySync(void 0, [d2, o2], { arguments: { copy: true }, result: { copy: true } }),\n readStream: (p2, o2) => {\n let streamId = null;\n return new ReadableStream({\n async start() {\n streamId = await $__utils_csv_readStream.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } });\n },\n async pull(controller) {\n const row2 = await $__utils_csv_readStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (row2 === null) controller.close();\n else controller.enqueue(row2);\n }\n });\n },\n readObjectsStream: (p2, o2) => {\n let streamId = null;\n let columnsResolve, aliasesResolve;\n const columnsPromise = new Promise((res) => {\n columnsResolve = res;\n });\n const aliasesPromise = new Promise((res) => {\n aliasesResolve = res;\n });\n const rows = new ReadableStream({\n async start() {\n streamId = await $__utils_csv_readObjectsStream.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } });\n const meta = await $__utils_csv_readObjectsStream_meta.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n columnsResolve(meta.columns);\n aliasesResolve(meta.aliases);\n },\n async pull(controller) {\n const row2 = await $__utils_csv_readObjectsStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (row2 === null) controller.close();\n else controller.enqueue(row2);\n }\n });\n return { columns: columnsPromise, aliases: aliasesPromise, rows };\n },\n writeStream: (p2, o2) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_csv_writeStream.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } });\n },\n async write(row2) {\n await $__utils_csv_writeStream_write.apply(void 0, [streamId, row2], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) await $__utils_csv_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n },\n async abort() {\n if (streamId !== null) await $__utils_csv_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n });\n },\n writeObjectsStream: (p2, o2) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_csv_writeObjectsStream.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } });\n },\n async write(record) {\n await $__utils_csv_writeObjectsStream_write.apply(void 0, [streamId, record], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) await $__utils_csv_writeObjectsStream_close.apply(void 0, [streamId], { result: { promise: true } });\n },\n async abort() {\n if (streamId !== null) await $__utils_csv_writeObjectsStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n });\n }\n },\n http: {\n fetch: async (input, init = {}) => {\n let url, method, reqHeaders, reqBody;\n if (input instanceof Request) {\n url = input.url;\n method = init.method ?? input.method;\n reqHeaders = new Headers(input.headers);\n reqBody = input._body;\n if (input._body != null) {\n if (input._bodyUsed) throw new TypeError("body already used");\n input._bodyUsed = true;\n }\n } else {\n url = String(input);\n method = init.method ?? "GET";\n reqHeaders = new Headers(init.headers);\n reqBody = init.body ?? null;\n }\n if (init.headers) {\n for (const [k2, v2] of new Headers(init.headers)) reqHeaders.set(k2, v2);\n }\n if (init.body !== void 0) reqBody = init.body;\n let serializedBody = reqBody;\n let isStream = false;\n if (reqBody instanceof FormData) {\n serializedBody = reqBody._toWire();\n } else if (reqBody instanceof URLSearchParams) {\n serializedBody = reqBody.toString();\n if (!reqHeaders.has("content-type")) {\n reqHeaders.set("content-type", "application/x-www-form-urlencoded");\n }\n } else if (reqBody instanceof Blob2) {\n serializedBody = { type: "Buffer", data: Array.from(reqBody._bytes) };\n if (!reqHeaders.has("content-type") && reqBody.type) {\n reqHeaders.set("content-type", reqBody.type);\n }\n } else if (reqBody instanceof Uint8Array) {\n serializedBody = { type: "Buffer", data: Array.from(reqBody) };\n } else if (reqBody instanceof ReadableStream) {\n isStream = true;\n }\n const opts = { method, headers: Object.fromEntries(reqHeaders.entries()) };\n let _bodyUsed = false;\n function consumeGuard() {\n if (_bodyUsed) throw new TypeError("body already used");\n _bodyUsed = true;\n }\n if (isStream) {\n const reader = reqBody.getReader();\n const streamResponseHeaders = new Headers();\n let streamStreamController = null;\n const streamChunks = [];\n let streamResolveMeta, streamRejectMeta;\n const streamMetaPromise = new Promise((res, rej) => {\n streamResolveMeta = res;\n streamRejectMeta = rej;\n });\n const streamBytesPromise = new Promise((resolve, reject) => {\n let metaReceived = false;\n const onChunk = async (chunk, chunkMeta) => {\n if (!metaReceived) {\n metaReceived = true;\n for (const [k2, v2] of chunkMeta.headers) streamResponseHeaders.set(k2, v2);\n streamResolveMeta(chunkMeta);\n return;\n }\n if (chunk != null) {\n const bytes = new Uint8Array(chunk);\n streamChunks.push(bytes);\n if (streamStreamController) streamStreamController.enqueue(bytes);\n }\n };\n const onEnd = async () => {\n if (streamStreamController) streamStreamController.close();\n const total = streamChunks.reduce((n2, c2) => n2 + c2.byteLength, 0);\n const merged = new Uint8Array(total);\n let offset = 0;\n for (const c2 of streamChunks) {\n merged.set(c2, offset);\n offset += c2.byteLength;\n }\n resolve(merged);\n };\n const onError = async (msg) => {\n if (streamStreamController) streamStreamController.error(new Error(msg));\n streamRejectMeta(new Error(msg));\n reject(new Error(msg));\n };\n $__utils_http_body_reader.apply(\n void 0,\n [url, { ...opts }, async () => {\n const { done, value } = await reader.read();\n if (done) return null;\n return value.buffer;\n }, onChunk, onEnd, onError],\n { arguments: { reference: true }, result: { promise: true } }\n );\n });\n const streamMeta = await streamMetaPromise;\n const streamBodyStream = new ReadableStream({\n start(c2) {\n streamStreamController = c2;\n }\n });\n return _makeResponse(streamMeta, streamResponseHeaders, streamBytesPromise, streamBodyStream, consumeGuard);\n }\n const responseHeaders = new Headers();\n let streamController = null;\n const chunks = [];\n let resolveMeta, rejectMeta;\n const metaPromise = new Promise((res, rej) => {\n resolveMeta = res;\n rejectMeta = rej;\n });\n const bytesPromise = new Promise((resolve, reject) => {\n let metaReceived = false;\n const onChunk = async (chunk, chunkMeta) => {\n if (!metaReceived) {\n metaReceived = true;\n for (const [k2, v2] of chunkMeta.headers) responseHeaders.set(k2, v2);\n resolveMeta(chunkMeta);\n return;\n }\n if (chunk != null) {\n const bytes = new Uint8Array(chunk);\n chunks.push(bytes);\n if (streamController) streamController.enqueue(bytes);\n }\n };\n const onEnd = async () => {\n if (streamController) streamController.close();\n const total = chunks.reduce((n2, c2) => n2 + c2.byteLength, 0);\n const merged = new Uint8Array(total);\n let offset = 0;\n for (const c2 of chunks) {\n merged.set(c2, offset);\n offset += c2.byteLength;\n }\n resolve(merged);\n };\n const onError = async (msg) => {\n if (streamController) streamController.error(new Error(msg));\n rejectMeta(new Error(msg));\n reject(new Error(msg));\n };\n const signal = init.signal ?? null;\n const fetchArgs = [url, { ...opts, body: serializedBody }, onChunk, onEnd, onError];\n if (signal) {\n fetchArgs.push((abortCb) => {\n signal.addEventListener("abort", () => abortCb.applyIgnored(void 0, []));\n });\n }\n $__utils_http_fetch.apply(\n void 0,\n fetchArgs,\n { arguments: { reference: true }, result: { promise: true } }\n );\n });\n const meta = await metaPromise;\n const bodyStream = new ReadableStream({\n start(c2) {\n streamController = c2;\n }\n });\n return _makeResponse(meta, responseHeaders, bytesPromise, bodyStream, consumeGuard);\n },\n server(port, opts = {}) {\n const id = $__utils_http_server_create.applySync(void 0, [port, opts], { arguments: { copy: true } });\n let resolvedPort = port;\n return {\n _httpServerId: id,\n get port() {\n return resolvedPort;\n },\n on(event, handler) {\n if (event !== "request") throw new Error(`Unknown http.server event: ${event}`);\n $__utils_http_server_set_handler.applySync(void 0, [id, async (meta) => {\n const reqHeaders = new Headers(meta.headers);\n const bodyStream = meta.body ? new ReadableStream({ start(c2) {\n c2.enqueue(new Uint8Array(meta.body));\n c2.close();\n } }) : null;\n const abortCtrl = new AbortController2();\n const closedPromise = $__utils_http_server_request_closed.apply(void 0, [id, meta.reqId], { result: { promise: true } });\n closedPromise.then(() => abortCtrl.abort());\n const req = Object.assign(/* @__PURE__ */ Object.create(null), {\n method: meta.method,\n url: meta.url,\n pathname: meta.pathname,\n searchParams: new URLSearchParams(meta.searchParams),\n headers: reqHeaders,\n body: bodyStream,\n bodyUsed: false,\n signal: abortCtrl.signal,\n closed() {\n return closedPromise;\n },\n on(event2, fn) {\n if (event2 !== "close") throw new Error(`Unknown IncomingRequest event: ${event2}`);\n closedPromise.then(fn);\n },\n async text() {\n if (!meta.body) return "";\n return new import_fast_text_encoding.TextDecoder().decode(new Uint8Array(meta.body));\n },\n async json() {\n return JSON.parse(await this.text());\n },\n async blob() {\n if (!meta.body) return new Blob2([], { type: "" });\n return new Blob2([new Uint8Array(meta.body)], { type: meta.headers["content-type"] ?? "" });\n }\n });\n const response = await handler(req);\n const resHeaders = {};\n if (response.headers) response.headers.forEach((v2, k2) => {\n resHeaders[k2] = v2;\n });\n let bodyData = null;\n if (response._body != null) {\n if (response._body instanceof ReadableStream) {\n const reader = response._body.getReader();\n const chunks = [];\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n const total = new Uint8Array(chunks.reduce((n2, c2) => n2 + c2.byteLength, 0));\n let offset = 0;\n for (const c2 of chunks) {\n total.set(c2, offset);\n offset += c2.byteLength;\n }\n bodyData = total.buffer.slice(total.byteOffset, total.byteOffset + total.byteLength);\n } else if (response._body instanceof Uint8Array) {\n bodyData = response._body.buffer.slice(response._body.byteOffset, response._body.byteOffset + response._body.byteLength);\n } else if (response._body instanceof Blob2) {\n const ab = await response._body.arrayBuffer();\n bodyData = ab;\n } else {\n bodyData = new import_fast_text_encoding.TextEncoder().encode(String(response._body)).buffer;\n }\n }\n return {\n status: response.status,\n statusText: response.statusText,\n headers: resHeaders,\n body: bodyData\n };\n }], { arguments: { reference: true } });\n },\n async open() {\n resolvedPort = await $__utils_http_server_open.apply(void 0, [id], { result: { promise: true, copy: true } });\n },\n async close() {\n await $__utils_http_server_close.apply(void 0, [id], { result: { promise: true } });\n },\n async closed() {\n await $__utils_http_server_closed.apply(void 0, [id], { result: { promise: true } });\n }\n };\n }\n },\n env: {\n read: (key, fallback) => $__utils_env_read.apply(void 0, [key, fallback], { arguments: { copy: true }, result: { promise: true, copy: true } }).then((r2) => r2 !== null ? r2 : fallback),\n has: (key) => $__utils_env_has.apply(void 0, [key], { result: { promise: true } })\n },\n vars: {\n read: (key, fallback = void 0) => Object.hasOwn(__vars, key) ? __vars[key] : fallback,\n has: (key) => Object.hasOwn(__vars, key)\n },\n os: __os,\n stdin: {\n get isTTY() {\n return __stdinIsTTY;\n },\n readBytes: async (opts) => {\n const ab = await $__utils_stdin_read_bytes.apply(void 0, [opts], { arguments: { copy: true }, result: { promise: true, copy: true } });\n return ab ? new Uint8Array(ab) : null;\n },\n read: async (opts) => {\n const bytes = await globalThis.utils.stdin.readBytes(opts);\n return bytes ? new import_fast_text_encoding.TextDecoder().decode(bytes) : null;\n }\n },\n archive: {\n zip: (s2, d2) => $__utils_archive_zip.apply(void 0, [s2, d2], { result: { promise: true } }),\n unzip: (s2, d2) => $__utils_archive_unzip.apply(void 0, [s2, d2], { result: { promise: true } }),\n tar: (s2, d2, o2) => $__utils_archive_tar.apply(void 0, [s2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n untar: (s2, d2, o2) => $__utils_archive_untar.apply(void 0, [s2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n zipStream: (source) => {\n let streamId = null;\n return new ReadableStream({\n async start() {\n streamId = await $__utils_archive_zipStream.apply(void 0, [source], { result: { promise: true } });\n },\n async pull(controller) {\n const ab = await $__utils_fs_readStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (ab === null) controller.close();\n else controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n tarStream: (source, opts) => {\n let streamId = null;\n return new ReadableStream({\n async start() {\n streamId = await $__utils_archive_tarStream.apply(void 0, [source, opts], { arguments: { copy: true }, result: { promise: true } });\n },\n async pull(controller) {\n const ab = await $__utils_fs_readStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (ab === null) controller.close();\n else controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n unzipStream: (dest) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_archive_unzipStream.apply(void 0, [dest], { result: { promise: true } });\n },\n async write(chunk) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("unzipStream requires Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(void 0, [streamId, chunk.buffer, chunk.byteOffset, chunk.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n },\n async abort() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n }\n });\n },\n untarStream: (dest, opts) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_archive_untarStream.apply(void 0, [dest, opts], { arguments: { copy: true }, result: { promise: true } });\n },\n async write(chunk) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("untarStream requires Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(void 0, [streamId, chunk.buffer, chunk.byteOffset, chunk.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n },\n async abort() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n }\n });\n }\n },\n cache: {\n open: async (location, name) => {\n const id = await $__utils_cache_open.apply(void 0, [location, name ?? null], { result: { promise: true } });\n return {\n set: (k2, v2, ttl) => $__utils_cache_set.apply(void 0, [id, k2, v2, ttl ?? null], { arguments: { copy: true }, result: { promise: true } }),\n get: (k2) => $__utils_cache_get.apply(void 0, [id, k2], { result: { promise: true, copy: true } }),\n has: (k2) => $__utils_cache_has.apply(void 0, [id, k2], { result: { promise: true } }),\n delete: (k2) => $__utils_cache_delete.apply(void 0, [id, k2], { result: { promise: true } }),\n clear: () => $__utils_cache_clear.apply(void 0, [id], { result: { promise: true } })\n };\n }\n },\n sqlite: {\n open: async (location, name) => {\n const id = await $__utils_sqlite_open.apply(void 0, [location, name ?? null], { result: { promise: true } });\n const db2 = {\n query: (sql, params = []) => $__utils_sqlite_query.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n get: (sql, params = []) => $__utils_sqlite_get.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n exec: (sql, params = []) => $__utils_sqlite_exec.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n run: (sql) => $__utils_sqlite_run.apply(void 0, [id, sql], { arguments: { copy: true }, result: { promise: true } }),\n transaction: async (fn) => {\n await db2.exec("BEGIN");\n try {\n await fn();\n await db2.exec("COMMIT");\n } catch (e2) {\n await db2.exec("ROLLBACK");\n throw e2;\n }\n },\n close: () => $__utils_sqlite_close.apply(void 0, [id], { result: { promise: true } })\n };\n return db2;\n }\n },\n db: {\n connect: async (connectionString) => {\n const id = await $__utils_db_connect.apply(void 0, [connectionString], { arguments: { copy: true }, result: { promise: true, copy: true } });\n const client = {\n query: (sql, params = []) => $__utils_db_query.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n get: (sql, params = []) => $__utils_db_get.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n exec: (sql, params = []) => $__utils_db_exec.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n transaction: async (callback) => {\n if (typeof callback !== "function") {\n throw new TypeError("transaction callback must be a function");\n }\n await client.exec("BEGIN");\n try {\n const result = await callback(client);\n await client.exec("COMMIT");\n return result;\n } catch (err) {\n await client.exec("ROLLBACK");\n throw err;\n }\n },\n close: () => $__utils_db_close.apply(void 0, [id], { arguments: { copy: true }, result: { promise: true, copy: true } })\n };\n return client;\n }\n },\n crypt: {\n hash: (algorithm, data) => {\n return $__utils_crypt_hash.apply(void 0, [algorithm, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hashAsHex: (algorithm, data) => {\n return $__utils_crypt_hash_hex.apply(void 0, [algorithm, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hashAsBase64: (algorithm, data) => {\n return $__utils_crypt_hash_base64.apply(void 0, [algorithm, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n uuid: () => $__utils_crypt_uuid.applySync(void 0, []),\n randomHex: (size) => $__utils_crypt_random_hex.applySync(void 0, [size]),\n randomBase64: (size) => $__utils_crypt_random_base64.applySync(void 0, [size]),\n randomBytes: (size) => {\n return $__utils_crypt_random_bytes.applySync(void 0, [size], { result: { copy: true } });\n },\n hmac: (algorithm, key, data) => {\n return $__utils_crypt_hmac.apply(void 0, [algorithm, key, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hmacAsHex: (algorithm, key, data) => {\n return $__utils_crypt_hmac_hex.apply(void 0, [algorithm, key, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hmacAsBase64: (algorithm, key, data) => {\n return $__utils_crypt_hmac_base64.apply(void 0, [algorithm, key, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n encrypt: (algorithm, key, iv, data) => {\n return $__utils_crypt_encrypt.apply(void 0, [algorithm, key, iv, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n decrypt: (algorithm, key, iv, ciphertext) => {\n return $__utils_crypt_decrypt.apply(void 0, [algorithm, key, iv, ciphertext], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hashStream: (algorithm) => {\n let id = null;\n return new TransformStream({\n async start() {\n id = await $__utils_crypt_hash_init.apply(void 0, [algorithm], { result: { promise: true } });\n },\n async transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("hashStream requires Uint8Array chunks");\n const buf = chunk.slice().buffer;\n await $__utils_crypt_hash_update.apply(void 0, [id, buf], { arguments: { copy: true }, result: { promise: true } });\n },\n async flush(controller) {\n const ab = await $__utils_crypt_hash_digest.apply(void 0, [id], { result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n encryptStream: (algorithm, key, iv) => {\n let id = null;\n if (!(key instanceof Uint8Array) || !(iv instanceof Uint8Array)) {\n throw new TypeError("encryptStream requires Uint8Array for key and iv");\n }\n return new TransformStream({\n async start() {\n id = await $__utils_crypt_cipher_init.apply(void 0, [algorithm, key.buffer, iv.buffer, true], { arguments: { copy: true }, result: { promise: true } });\n },\n async transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("encryptStream requires Uint8Array chunks");\n const buf = chunk.slice().buffer;\n const ab = await $__utils_crypt_cipher_update.apply(void 0, [id, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n },\n async flush(controller) {\n const ab = await $__utils_crypt_cipher_final.apply(void 0, [id], { result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n decryptStream: (algorithm, key, iv) => {\n let id = null;\n if (!(key instanceof Uint8Array) || !(iv instanceof Uint8Array)) {\n throw new TypeError("decryptStream requires Uint8Array for key and iv");\n }\n return new TransformStream({\n async start() {\n id = await $__utils_crypt_cipher_init.apply(void 0, [algorithm, key.buffer, iv.buffer, false], { arguments: { copy: true }, result: { promise: true } });\n },\n async transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("decryptStream requires Uint8Array chunks");\n const buf = chunk.slice().buffer;\n const ab = await $__utils_crypt_cipher_update.apply(void 0, [id, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n },\n async flush(controller) {\n const ab = await $__utils_crypt_cipher_final.apply(void 0, [id], { result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n }\n });\n }\n },\n codec: {\n toHex: (data) => {\n const bytes = typeof data === "string" ? new import_fast_text_encoding.TextEncoder().encode(data) : data;\n let hex = "";\n for (let i2 = 0; i2 < bytes.length; i2++) {\n hex += bytes[i2].toString(16).padStart(2, "0");\n }\n return hex;\n },\n fromHex: (hex) => {\n const len = hex.length / 2;\n const bytes = new Uint8Array(len);\n for (let i2 = 0; i2 < len; i2++) {\n bytes[i2] = parseInt(hex.substring(i2 * 2, i2 * 2 + 2), 16);\n }\n return bytes;\n },\n toBase64: (data) => {\n const bytes = typeof data === "string" ? new import_fast_text_encoding.TextEncoder().encode(data) : data;\n const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n let result = "";\n const len = bytes.length;\n for (let i2 = 0; i2 < len; i2 += 3) {\n const b1 = bytes[i2];\n const b2 = i2 + 1 < len ? bytes[i2 + 1] : NaN;\n const b3 = i2 + 2 < len ? bytes[i2 + 2] : NaN;\n const enc1 = b1 >> 2;\n const enc2 = (b1 & 3) << 4 | (isNaN(b2) ? 0 : b2 >> 4);\n const enc3 = isNaN(b2) ? 64 : (b2 & 15) << 2 | (isNaN(b3) ? 0 : b3 >> 6);\n const enc4 = isNaN(b3) ? 64 : b3 & 63;\n result += chars[enc1] + chars[enc2] + (enc3 === 64 ? "=" : chars[enc3]) + (enc4 === 64 ? "=" : chars[enc4]);\n }\n return result;\n },\n fromBase64: (base64) => {\n const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n const lookup = new Uint8Array(256);\n for (let i2 = 0; i2 < chars.length; i2++) lookup[chars.charCodeAt(i2)] = i2;\n const clean = base64.replace(/=/g, "");\n const len = clean.length;\n const bytes = new Uint8Array(Math.floor(len * 0.75));\n let p2 = 0;\n for (let i2 = 0; i2 < len; i2 += 4) {\n const w1 = lookup[clean.charCodeAt(i2)];\n const w2 = i2 + 1 < len ? lookup[clean.charCodeAt(i2 + 1)] : 0;\n const w3 = i2 + 2 < len ? lookup[clean.charCodeAt(i2 + 2)] : 0;\n const w4 = i2 + 3 < len ? lookup[clean.charCodeAt(i2 + 3)] : 0;\n bytes[p2++] = w1 << 2 | w2 >> 4;\n if (p2 < bytes.length) bytes[p2++] = (w2 & 15) << 4 | w3 >> 2;\n if (p2 < bytes.length) bytes[p2++] = (w3 & 3) << 6 | w4;\n }\n return bytes;\n },\n fromUtf8: (utf8) => new import_fast_text_encoding.TextEncoder().encode(utf8),\n toUtf8: (data) => new import_fast_text_encoding.TextDecoder().decode(data),\n hexEncoderStream: () => {\n return new TransformStream({\n transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("hexEncoderStream requires Uint8Array chunks");\n let hex = "";\n for (let i2 = 0; i2 < chunk.length; i2++) {\n hex += chunk[i2].toString(16).padStart(2, "0");\n }\n controller.enqueue(hex);\n }\n });\n },\n hexDecoderStream: () => {\n let buffered = "";\n return new TransformStream({\n transform(chunk, controller) {\n const total = buffered + chunk;\n const len = Math.floor(total.length / 2) * 2;\n const hex = total.slice(0, len);\n buffered = total.slice(len);\n if (hex.length > 0) {\n const bytes = new Uint8Array(hex.length / 2);\n for (let i2 = 0; i2 < bytes.length; i2++) {\n bytes[i2] = parseInt(hex.substring(i2 * 2, i2 * 2 + 2), 16);\n }\n controller.enqueue(bytes);\n }\n },\n flush(controller) {\n if (buffered.length > 0) {\n throw new Error(`hexDecoderStream: trailing single hex character \'${buffered}\'`);\n }\n }\n });\n },\n base64EncoderStream: () => {\n let bufferedBytes = new Uint8Array(0);\n const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n const encode = (bytes) => {\n let result = "";\n const len = bytes.length;\n for (let i2 = 0; i2 < len; i2 += 3) {\n const b1 = bytes[i2];\n const b2 = i2 + 1 < len ? bytes[i2 + 1] : NaN;\n const b3 = i2 + 2 < len ? bytes[i2 + 2] : NaN;\n const enc1 = b1 >> 2;\n const enc2 = (b1 & 3) << 4 | (isNaN(b2) ? 0 : b2 >> 4);\n const enc3 = isNaN(b2) ? 64 : (b2 & 15) << 2 | (isNaN(b3) ? 0 : b3 >> 6);\n const enc4 = isNaN(b3) ? 64 : b3 & 63;\n result += chars[enc1] + chars[enc2] + (enc3 === 64 ? "=" : chars[enc3]) + (enc4 === 64 ? "=" : chars[enc4]);\n }\n return result;\n };\n return new TransformStream({\n transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("base64EncoderStream requires Uint8Array chunks");\n const total = new Uint8Array(bufferedBytes.length + chunk.length);\n total.set(bufferedBytes);\n total.set(chunk, bufferedBytes.length);\n const encodeLen = Math.floor(total.length / 3) * 3;\n const toEncode = total.subarray(0, encodeLen);\n bufferedBytes = total.subarray(encodeLen);\n if (toEncode.length > 0) {\n controller.enqueue(encode(toEncode));\n }\n },\n flush(controller) {\n if (bufferedBytes.length > 0) {\n controller.enqueue(encode(bufferedBytes));\n }\n }\n });\n },\n base64DecoderStream: () => {\n let bufferedChars = "";\n const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n const lookup = new Uint8Array(256);\n for (let i2 = 0; i2 < chars.length; i2++) lookup[chars.charCodeAt(i2)] = i2;\n const decode = (base64) => {\n const clean = base64.replace(/=/g, "");\n const len = clean.length;\n const bytes = new Uint8Array(Math.floor(len * 0.75));\n let p2 = 0;\n for (let i2 = 0; i2 < len; i2 += 4) {\n const w1 = lookup[clean.charCodeAt(i2)];\n const w2 = i2 + 1 < len ? lookup[clean.charCodeAt(i2 + 1)] : 0;\n const w3 = i2 + 2 < len ? lookup[clean.charCodeAt(i2 + 2)] : 0;\n const w4 = i2 + 3 < len ? lookup[clean.charCodeAt(i2 + 3)] : 0;\n bytes[p2++] = w1 << 2 | w2 >> 4;\n if (p2 < bytes.length) bytes[p2++] = (w2 & 15) << 4 | w3 >> 2;\n if (p2 < bytes.length) bytes[p2++] = (w3 & 3) << 6 | w4;\n }\n return bytes;\n };\n return new TransformStream({\n transform(chunk, controller) {\n const total = bufferedChars + chunk.replace(/\\s/g, "");\n const decodeLen = Math.floor(total.length / 4) * 4;\n const toDecode = total.slice(0, decodeLen);\n bufferedChars = total.slice(decodeLen);\n if (toDecode.length > 0) {\n controller.enqueue(decode(toDecode));\n }\n },\n flush(controller) {\n if (bufferedChars.length > 0) {\n controller.enqueue(decode(bufferedChars.padEnd(4, "=")));\n }\n }\n });\n }\n },\n ws: {\n client(url, opts) {\n const id = $__utils_ws_client.applySync(\n void 0,\n [url, opts],\n { arguments: { copy: true } }\n );\n return {\n on(event, handler) {\n const isolateHandler = event === "error" ? async (errJson) => {\n let d2;\n try {\n d2 = JSON.parse(errJson);\n } catch {\n d2 = { message: errJson };\n }\n const errorObj = new Error(d2.message);\n errorObj.name = "WebSocketError";\n if (d2.code) errorObj.code = d2.code;\n if (d2.stack) errorObj.stack = d2.stack;\n handler(errorObj);\n } : event === "binary" ? async (arrayBuffer) => {\n handler(new Uint8Array(arrayBuffer));\n } : handler;\n $__utils_ws_on.applySync(void 0, [id, event, isolateHandler], {\n arguments: { reference: true }\n });\n },\n open: () => $__utils_ws_open.apply(void 0, [id], { result: { promise: true } }),\n sendText: (msg) => $__utils_ws_send_text.apply(void 0, [id, msg], { result: { promise: true } }),\n sendBinary: (data) => {\n if (data instanceof Uint8Array) {\n return $__utils_ws_send_binary.apply(void 0, [id, data.buffer, data.byteOffset, data.byteLength], {\n arguments: { copy: true },\n result: { promise: true }\n });\n } else if (data instanceof ArrayBuffer) {\n return $__utils_ws_send_binary.apply(void 0, [id, data, 0, data.byteLength], {\n arguments: { copy: true },\n result: { promise: true }\n });\n } else {\n throw new TypeError("sendBinary requires an ArrayBuffer or Uint8Array");\n }\n },\n close: () => $__utils_ws_close.apply(void 0, [id], { result: { promise: true, copy: true } }),\n closed: () => $__utils_ws_closed.apply(void 0, [id], { result: { promise: true, copy: true } })\n };\n },\n server(portOrServer, opts = {}) {\n const isHttpSession = typeof portOrServer === "object" && portOrServer !== null && "_httpServerId" in portOrServer;\n const portOrId = isHttpSession ? portOrServer._httpServerId : portOrServer;\n let resolvedPort = isHttpSession ? portOrServer.port : portOrServer;\n const id = $__utils_ws_server_create.applySync(void 0, [portOrId, opts, isHttpSession], { arguments: { copy: true } });\n function makePathParams(json2) {\n const obj = JSON.parse(json2 ?? "{}");\n return {\n get(key) {\n return Object.prototype.hasOwnProperty.call(obj, key) ? obj[key] : null;\n },\n has(key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n },\n keys() {\n return Object.keys(obj);\n }\n };\n }\n function makeConnHandle(connId, url, pathname, search, headersJson, pathParamsJson) {\n const searchParams = new URLSearchParams(search);\n const headers = new Headers(JSON.parse(headersJson));\n const pathParams = makePathParams(pathParamsJson);\n const connAbort = new AbortController2();\n const connHandle = {\n get id() {\n return connId;\n },\n get url() {\n return url;\n },\n get pathname() {\n return pathname;\n },\n get searchParams() {\n return searchParams;\n },\n get headers() {\n return headers;\n },\n get pathParams() {\n return pathParams;\n },\n get signal() {\n return connAbort.signal;\n },\n on(event, handler) {\n const isolateHandler = event === "error" ? async (errJson) => {\n let d2;\n try {\n d2 = JSON.parse(errJson);\n } catch {\n d2 = { message: errJson };\n }\n const e2 = new Error(d2.message);\n e2.name = "WebSocketError";\n if (d2.code) e2.code = d2.code;\n handler(e2);\n } : event === "binary" ? async (ab) => {\n handler(new Uint8Array(ab));\n } : handler;\n $__utils_ws_server_conn_on.applySync(void 0, [connId, event, isolateHandler], { arguments: { reference: true } });\n },\n sendText: (msg) => $__utils_ws_server_conn_send_text.apply(void 0, [connId, msg], { result: { promise: true } }),\n sendBinary: (data) => {\n if (data instanceof Uint8Array) {\n return $__utils_ws_server_conn_send_binary.apply(void 0, [connId, data.buffer, data.byteOffset, data.byteLength], { arguments: { copy: true }, result: { promise: true } });\n } else if (data instanceof ArrayBuffer) {\n return $__utils_ws_server_conn_send_binary.apply(void 0, [connId, data, 0, data.byteLength], { arguments: { copy: true }, result: { promise: true } });\n }\n throw new TypeError("sendBinary requires ArrayBuffer or Uint8Array");\n },\n close: (code, reason) => $__utils_ws_server_conn_close.apply(void 0, [connId, code ?? 1e3, reason ?? ""], { result: { promise: true, copy: true } }),\n closed: () => $__utils_ws_server_conn_closed.apply(void 0, [connId], { result: { promise: true, copy: true } })\n };\n connHandle.closed().then(() => connAbort.abort());\n return connHandle;\n }\n return {\n _wsServerId: id,\n get port() {\n return resolvedPort;\n },\n on(event, handler) {\n if (event === "connection") {\n $__utils_ws_server_set_connection_handler.applySync(void 0, [id, async (connId, url, pathname, search, headersJson, pathParamsJson) => {\n handler(makeConnHandle(connId, url, pathname, search, headersJson, pathParamsJson));\n }], { arguments: { reference: true } });\n } else if (event === "error") {\n $__utils_ws_server_set_error_handler.applySync(void 0, [id, async (errJson) => {\n let d2;\n try {\n d2 = JSON.parse(errJson);\n } catch {\n d2 = { message: errJson };\n }\n const e2 = new Error(d2.message);\n e2.name = "WebSocketError";\n if (d2.code) e2.code = d2.code;\n handler(e2);\n }], { arguments: { reference: true } });\n } else {\n throw new Error(`Unknown ws.server event: ${event}`);\n }\n },\n async open() {\n resolvedPort = await $__utils_ws_server_open.apply(void 0, [id], { result: { promise: true, copy: true } });\n },\n async close() {\n await $__utils_ws_server_close.apply(void 0, [id], { result: { promise: true } });\n },\n async closed() {\n await $__utils_ws_server_closed.apply(void 0, [id], { result: { promise: true } });\n }\n };\n }\n },\n time: {\n after: (ms) => $__utils_time_after_ref.apply(void 0, [ms], { result: { promise: true } })\n },\n notify: {\n send: (title, message, opts) => $__utils_notify_send.apply(void 0, [title, message, opts], { arguments: { copy: true }, result: { promise: true, copy: true } })\n },\n md,\n tree\n};\nvar { fs, shell, section, rune, json, yaml, xml, csv, http, env, vars, os, stdin, archive, cache, sqlite, db, crypt, codec, ws, time, notify } = globalThis.utils;\nvar timers = /* @__PURE__ */ new Map();\nvar nextTimerId = 1;\nglobalThis.setTimeout = function(callback, delay = 0, ...args) {\n if (typeof callback !== "function") throw new TypeError("callback must be a function");\n const id = nextTimerId++;\n let active = true;\n timers.set(id, {\n clear() {\n active = false;\n timers.delete(id);\n }\n });\n $__utils_time_after.apply(void 0, [delay], { result: { promise: true } }).then(() => {\n if (active) {\n timers.delete(id);\n callback(...args);\n }\n });\n return id;\n};\nglobalThis.clearTimeout = function(id) {\n const timer = timers.get(id);\n if (timer) timer.clear();\n};\nglobalThis.setInterval = function(callback, delay = 0, ...args) {\n if (typeof callback !== "function") throw new TypeError("callback must be a function");\n const id = nextTimerId++;\n let active = true;\n const run = () => {\n $__utils_time_after_ref.apply(void 0, [delay], { result: { promise: true } }).then(() => {\n if (active) {\n callback(...args);\n run();\n }\n });\n };\n timers.set(id, {\n clear() {\n active = false;\n timers.delete(id);\n }\n });\n run();\n return id;\n};\nglobalThis.clearInterval = function(id) {\n const timer = timers.get(id);\n if (timer) timer.clear();\n};\nglobalThis.fetch = (input, init) => globalThis.utils.http.fetch(input, init);\nvar __runeKey = typeof $__rune_key !== "undefined" ? $__rune_key : null;\nvar __runeLifecycle = typeof $__rune_lifecycle !== "undefined" ? $__rune_lifecycle : "run";\nvar __runeArgsSchema = typeof $__rune_args_schema !== "undefined" ? JSON.parse($__rune_args_schema) : null;\nvar __runeCommandsSchema = typeof $__rune_commands_schema !== "undefined" ? JSON.parse($__rune_commands_schema) : null;\nfunction __renderRuneHelp(path) {\n if (!__runeArgsSchema) return "";\n const segments = toSegments(path);\n if (segments.length === 0) {\n return formatRuneIndex(__runeArgsSchema, {\n key: __runeKey ?? "rune",\n lifecycle: __runeLifecycle,\n repl: __runeCommandsSchema ? { commands: __runeCommandsSchema.commands ?? [] } : null,\n // Effective permissions are computed host-side and are not available\n // inside the isolate, so the batch block is omitted rather than guessed.\n includeBatch: false\n });\n }\n const sel = selectNode(__runeArgsSchema, segments);\n if (!sel.node) {\n throw new Error(\n `rune.helpText: "${sel.failedAt}" is not a command of "${__runeKey ?? "rune"}"${sel.matchedPath ? ` at path "${sel.matchedPath}"` : ""}. Available: ${sel.candidates.length ? sel.candidates.join(", ") : "(none)"}`\n );\n }\n return formatCommandPage(sel.node, { key: __runeKey ?? "rune", lifecycle: __runeLifecycle, path: sel.matchedPath });\n}\nglobalThis.utils.rune.key = () => __runeKey;\nglobalThis.utils.rune.helpText = (path) => __renderRuneHelp(path);\nglobalThis.utils.rune.helpSection = (path) => globalThis.utils.section.create("help", { type: "markdown", content: __renderRuneHelp(path) });\nglobalThis.utils.rune.argsSchema = () => __runeArgsSchema;\nglobalThis.utils.rune.commandsSchema = () => __runeCommandsSchema?.commands ?? null;\nexport {\n archive,\n cache,\n codec,\n crypt,\n csv,\n db,\n env,\n fs,\n http,\n json,\n md,\n notify,\n os,\n rune,\n section,\n shell,\n sqlite,\n stdin,\n time,\n tree,\n vars,\n ws,\n xml,\n yaml\n};\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n *)\n\nweb-streams-polyfill/dist/ponyfill.mjs:\n (**\n * @license\n * web-streams-polyfill v4.3.0\n * Copyright 2026 Mattias Buelens, Diwank Singh Tomer and other contributors.\n * This code is released under the MIT license.\n * SPDX-License-Identifier: MIT\n *)\n*/\n';
|
|
73408
|
+
var utils = 'var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to2, from, except, desc) => {\n if (from && typeof from === "object" || typeof from === "function") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to2, key) && key !== except)\n __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to2;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. "__esModule" has not been set), then set\n // "default" to the CommonJS "module.exports" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,\n mod\n));\n\n// node_modules/fast-text-encoding/text.min.js\nvar require_text_min = __commonJS({\n "node_modules/fast-text-encoding/text.min.js"(exports) {\n (function(scope) {\n "use strict";\n function B2(r2, e2) {\n var f2;\n return r2 instanceof Buffer ? f2 = r2 : f2 = Buffer.from(r2.buffer, r2.byteOffset, r2.byteLength), f2.toString(e2);\n }\n var w2 = function(r2) {\n return Buffer.from(r2);\n };\n function h2(r2) {\n for (var e2 = 0, f2 = Math.min(256 * 256, r2.length + 1), n2 = new Uint16Array(f2), i2 = [], o2 = 0; ; ) {\n var t2 = e2 < r2.length;\n if (!t2 || o2 >= f2 - 1) {\n var s2 = n2.subarray(0, o2), m2 = s2;\n if (i2.push(String.fromCharCode.apply(null, m2)), !t2) return i2.join("");\n r2 = r2.subarray(e2), e2 = 0, o2 = 0;\n }\n var a2 = r2[e2++];\n if ((a2 & 128) === 0) n2[o2++] = a2;\n else if ((a2 & 224) === 192) {\n var d2 = r2[e2++] & 63;\n n2[o2++] = (a2 & 31) << 6 | d2;\n } else if ((a2 & 240) === 224) {\n var d2 = r2[e2++] & 63, l2 = r2[e2++] & 63;\n n2[o2++] = (a2 & 31) << 12 | d2 << 6 | l2;\n } else if ((a2 & 248) === 240) {\n var d2 = r2[e2++] & 63, l2 = r2[e2++] & 63, R2 = r2[e2++] & 63, c2 = (a2 & 7) << 18 | d2 << 12 | l2 << 6 | R2;\n c2 > 65535 && (c2 -= 65536, n2[o2++] = c2 >>> 10 & 1023 | 55296, c2 = 56320 | c2 & 1023), n2[o2++] = c2;\n }\n }\n }\n function F2(r2) {\n for (var e2 = 0, f2 = r2.length, n2 = 0, i2 = Math.max(32, f2 + (f2 >>> 1) + 7), o2 = new Uint8Array(i2 >>> 3 << 3); e2 < f2; ) {\n var t2 = r2.charCodeAt(e2++);\n if (t2 >= 55296 && t2 <= 56319) {\n if (e2 < f2) {\n var s2 = r2.charCodeAt(e2);\n (s2 & 64512) === 56320 && (++e2, t2 = ((t2 & 1023) << 10) + (s2 & 1023) + 65536);\n }\n if (t2 >= 55296 && t2 <= 56319) continue;\n }\n if (n2 + 4 > o2.length) {\n i2 += 8, i2 *= 1 + e2 / r2.length * 2, i2 = i2 >>> 3 << 3;\n var m2 = new Uint8Array(i2);\n m2.set(o2), o2 = m2;\n }\n if ((t2 & 4294967168) === 0) {\n o2[n2++] = t2;\n continue;\n } else if ((t2 & 4294965248) === 0) o2[n2++] = t2 >>> 6 & 31 | 192;\n else if ((t2 & 4294901760) === 0) o2[n2++] = t2 >>> 12 & 15 | 224, o2[n2++] = t2 >>> 6 & 63 | 128;\n else if ((t2 & 4292870144) === 0) o2[n2++] = t2 >>> 18 & 7 | 240, o2[n2++] = t2 >>> 12 & 63 | 128, o2[n2++] = t2 >>> 6 & 63 | 128;\n else continue;\n o2[n2++] = t2 & 63 | 128;\n }\n return o2.slice ? o2.slice(0, n2) : o2.subarray(0, n2);\n }\n var u2 = "Failed to ", p2 = function(r2, e2, f2) {\n if (r2) throw new Error("".concat(u2).concat(e2, ": the \'").concat(f2, "\' option is unsupported."));\n };\n var x2 = typeof Buffer == "function" && Buffer.from;\n var A2 = x2 ? w2 : F2;\n function v2() {\n this.encoding = "utf-8";\n }\n v2.prototype.encode = function(r2, e2) {\n return p2(e2 && e2.stream, "encode", "stream"), A2(r2);\n };\n function U2(r2) {\n var e2;\n try {\n var f2 = new Blob([r2], { type: "text/plain;charset=UTF-8" });\n e2 = URL.createObjectURL(f2);\n var n2 = new XMLHttpRequest();\n return n2.open("GET", e2, false), n2.send(), n2.responseText;\n } finally {\n e2 && URL.revokeObjectURL(e2);\n }\n }\n var O2 = !x2 && typeof Blob == "function" && typeof URL == "function" && typeof URL.createObjectURL == "function", S2 = ["utf-8", "utf8", "unicode-1-1-utf-8"], T2 = h2;\n x2 ? T2 = B2 : O2 && (T2 = function(r2) {\n try {\n return U2(r2);\n } catch (e2) {\n return h2(r2);\n }\n });\n var y2 = "construct \'TextDecoder\'", E2 = "".concat(u2, " ").concat(y2, ": the ");\n function g2(r2, e2) {\n p2(e2 && e2.fatal, y2, "fatal"), r2 = r2 || "utf-8";\n var f2;\n if (x2 ? f2 = Buffer.isEncoding(r2) : f2 = S2.indexOf(r2.toLowerCase()) !== -1, !f2) throw new RangeError("".concat(E2, " encoding label provided (\'").concat(r2, "\') is invalid."));\n this.encoding = r2, this.fatal = false, this.ignoreBOM = false;\n }\n g2.prototype.decode = function(r2, e2) {\n p2(e2 && e2.stream, "decode", "stream");\n var f2;\n return r2 instanceof Uint8Array ? f2 = r2 : r2.buffer instanceof ArrayBuffer ? f2 = new Uint8Array(r2.buffer) : f2 = new Uint8Array(r2), T2(f2, this.encoding);\n };\n scope.TextEncoder = scope.TextEncoder || v2;\n scope.TextDecoder = scope.TextDecoder || g2;\n })(typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : exports);\n }\n});\n\n// node_modules/base64-js/index.js\nvar require_base64_js = __commonJS({\n "node_modules/base64-js/index.js"(exports) {\n "use strict";\n exports.byteLength = byteLength;\n exports.toByteArray = toByteArray;\n exports.fromByteArray = fromByteArray;\n var lookup = [];\n var revLookup = [];\n var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;\n var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n for (i2 = 0, len = code.length; i2 < len; ++i2) {\n lookup[i2] = code[i2];\n revLookup[code.charCodeAt(i2)] = i2;\n }\n var i2;\n var len;\n revLookup["-".charCodeAt(0)] = 62;\n revLookup["_".charCodeAt(0)] = 63;\n function getLens(b64) {\n var len2 = b64.length;\n if (len2 % 4 > 0) {\n throw new Error("Invalid string. Length must be a multiple of 4");\n }\n var validLen = b64.indexOf("=");\n if (validLen === -1) validLen = len2;\n var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;\n return [validLen, placeHoldersLen];\n }\n function byteLength(b64) {\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n function _byteLength(b64, validLen, placeHoldersLen) {\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n function toByteArray(b64) {\n var tmp;\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));\n var curByte = 0;\n var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;\n var i3;\n for (i3 = 0; i3 < len2; i3 += 4) {\n tmp = revLookup[b64.charCodeAt(i3)] << 18 | revLookup[b64.charCodeAt(i3 + 1)] << 12 | revLookup[b64.charCodeAt(i3 + 2)] << 6 | revLookup[b64.charCodeAt(i3 + 3)];\n arr[curByte++] = tmp >> 16 & 255;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n if (placeHoldersLen === 2) {\n tmp = revLookup[b64.charCodeAt(i3)] << 2 | revLookup[b64.charCodeAt(i3 + 1)] >> 4;\n arr[curByte++] = tmp & 255;\n }\n if (placeHoldersLen === 1) {\n tmp = revLookup[b64.charCodeAt(i3)] << 10 | revLookup[b64.charCodeAt(i3 + 1)] << 4 | revLookup[b64.charCodeAt(i3 + 2)] >> 2;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n return arr;\n }\n function tripletToBase64(num) {\n return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];\n }\n function encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n for (var i3 = start; i3 < end; i3 += 3) {\n tmp = (uint8[i3] << 16 & 16711680) + (uint8[i3 + 1] << 8 & 65280) + (uint8[i3 + 2] & 255);\n output.push(tripletToBase64(tmp));\n }\n return output.join("");\n }\n function fromByteArray(uint8) {\n var tmp;\n var len2 = uint8.length;\n var extraBytes = len2 % 3;\n var parts = [];\n var maxChunkLength = 16383;\n for (var i3 = 0, len22 = len2 - extraBytes; i3 < len22; i3 += maxChunkLength) {\n parts.push(encodeChunk(uint8, i3, i3 + maxChunkLength > len22 ? len22 : i3 + maxChunkLength));\n }\n if (extraBytes === 1) {\n tmp = uint8[len2 - 1];\n parts.push(\n lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="\n );\n } else if (extraBytes === 2) {\n tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];\n parts.push(\n lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="\n );\n }\n return parts.join("");\n }\n }\n});\n\n// node_modules/ieee754/index.js\nvar require_ieee754 = __commonJS({\n "node_modules/ieee754/index.js"(exports) {\n exports.read = function(buffer, offset, isLE, mLen, nBytes) {\n var e2, m2;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i2 = isLE ? nBytes - 1 : 0;\n var d2 = isLE ? -1 : 1;\n var s2 = buffer[offset + i2];\n i2 += d2;\n e2 = s2 & (1 << -nBits) - 1;\n s2 >>= -nBits;\n nBits += eLen;\n for (; nBits > 0; e2 = e2 * 256 + buffer[offset + i2], i2 += d2, nBits -= 8) {\n }\n m2 = e2 & (1 << -nBits) - 1;\n e2 >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m2 = m2 * 256 + buffer[offset + i2], i2 += d2, nBits -= 8) {\n }\n if (e2 === 0) {\n e2 = 1 - eBias;\n } else if (e2 === eMax) {\n return m2 ? NaN : (s2 ? -1 : 1) * Infinity;\n } else {\n m2 = m2 + Math.pow(2, mLen);\n e2 = e2 - eBias;\n }\n return (s2 ? -1 : 1) * m2 * Math.pow(2, e2 - mLen);\n };\n exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {\n var e2, m2, c2;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt2 = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n var i2 = isLE ? 0 : nBytes - 1;\n var d2 = isLE ? 1 : -1;\n var s2 = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n value = Math.abs(value);\n if (isNaN(value) || value === Infinity) {\n m2 = isNaN(value) ? 1 : 0;\n e2 = eMax;\n } else {\n e2 = Math.floor(Math.log(value) / Math.LN2);\n if (value * (c2 = Math.pow(2, -e2)) < 1) {\n e2--;\n c2 *= 2;\n }\n if (e2 + eBias >= 1) {\n value += rt2 / c2;\n } else {\n value += rt2 * Math.pow(2, 1 - eBias);\n }\n if (value * c2 >= 2) {\n e2++;\n c2 /= 2;\n }\n if (e2 + eBias >= eMax) {\n m2 = 0;\n e2 = eMax;\n } else if (e2 + eBias >= 1) {\n m2 = (value * c2 - 1) * Math.pow(2, mLen);\n e2 = e2 + eBias;\n } else {\n m2 = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e2 = 0;\n }\n }\n for (; mLen >= 8; buffer[offset + i2] = m2 & 255, i2 += d2, m2 /= 256, mLen -= 8) {\n }\n e2 = e2 << mLen | m2;\n eLen += mLen;\n for (; eLen > 0; buffer[offset + i2] = e2 & 255, i2 += d2, e2 /= 256, eLen -= 8) {\n }\n buffer[offset + i2 - d2] |= s2 * 128;\n };\n }\n});\n\n// node_modules/buffer/index.js\nvar require_buffer = __commonJS({\n "node_modules/buffer/index.js"(exports) {\n "use strict";\n var base64 = require_base64_js();\n var ieee754 = require_ieee754();\n var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;\n exports.Buffer = Buffer3;\n exports.SlowBuffer = SlowBuffer;\n exports.INSPECT_MAX_BYTES = 50;\n var K_MAX_LENGTH = 2147483647;\n exports.kMaxLength = K_MAX_LENGTH;\n Buffer3.TYPED_ARRAY_SUPPORT = typedArraySupport();\n if (!Buffer3.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {\n console.error(\n "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."\n );\n }\n function typedArraySupport() {\n try {\n const arr = new Uint8Array(1);\n const proto = { foo: function() {\n return 42;\n } };\n Object.setPrototypeOf(proto, Uint8Array.prototype);\n Object.setPrototypeOf(arr, proto);\n return arr.foo() === 42;\n } catch (e2) {\n return false;\n }\n }\n Object.defineProperty(Buffer3.prototype, "parent", {\n enumerable: true,\n get: function() {\n if (!Buffer3.isBuffer(this)) return void 0;\n return this.buffer;\n }\n });\n Object.defineProperty(Buffer3.prototype, "offset", {\n enumerable: true,\n get: function() {\n if (!Buffer3.isBuffer(this)) return void 0;\n return this.byteOffset;\n }\n });\n function createBuffer(length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError(\'The value "\' + length + \'" is invalid for option "size"\');\n }\n const buf = new Uint8Array(length);\n Object.setPrototypeOf(buf, Buffer3.prototype);\n return buf;\n }\n function Buffer3(arg, encodingOrOffset, length) {\n if (typeof arg === "number") {\n if (typeof encodingOrOffset === "string") {\n throw new TypeError(\n \'The "string" argument must be of type string. Received type number\'\n );\n }\n return allocUnsafe(arg);\n }\n return from(arg, encodingOrOffset, length);\n }\n Buffer3.poolSize = 8192;\n function from(value, encodingOrOffset, length) {\n if (typeof value === "string") {\n return fromString(value, encodingOrOffset);\n }\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value);\n }\n if (value == null) {\n throw new TypeError(\n "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value\n );\n }\n if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n if (typeof value === "number") {\n throw new TypeError(\n \'The "value" argument must not be of type number. Received type number\'\n );\n }\n const valueOf = value.valueOf && value.valueOf();\n if (valueOf != null && valueOf !== value) {\n return Buffer3.from(valueOf, encodingOrOffset, length);\n }\n const b2 = fromObject(value);\n if (b2) return b2;\n if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {\n return Buffer3.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);\n }\n throw new TypeError(\n "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value\n );\n }\n Buffer3.from = function(value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length);\n };\n Object.setPrototypeOf(Buffer3.prototype, Uint8Array.prototype);\n Object.setPrototypeOf(Buffer3, Uint8Array);\n function assertSize(size) {\n if (typeof size !== "number") {\n throw new TypeError(\'"size" argument must be of type number\');\n } else if (size < 0) {\n throw new RangeError(\'The value "\' + size + \'" is invalid for option "size"\');\n }\n }\n function alloc(size, fill, encoding) {\n assertSize(size);\n if (size <= 0) {\n return createBuffer(size);\n }\n if (fill !== void 0) {\n return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);\n }\n return createBuffer(size);\n }\n Buffer3.alloc = function(size, fill, encoding) {\n return alloc(size, fill, encoding);\n };\n function allocUnsafe(size) {\n assertSize(size);\n return createBuffer(size < 0 ? 0 : checked(size) | 0);\n }\n Buffer3.allocUnsafe = function(size) {\n return allocUnsafe(size);\n };\n Buffer3.allocUnsafeSlow = function(size) {\n return allocUnsafe(size);\n };\n function fromString(string, encoding) {\n if (typeof encoding !== "string" || encoding === "") {\n encoding = "utf8";\n }\n if (!Buffer3.isEncoding(encoding)) {\n throw new TypeError("Unknown encoding: " + encoding);\n }\n const length = byteLength(string, encoding) | 0;\n let buf = createBuffer(length);\n const actual = buf.write(string, encoding);\n if (actual !== length) {\n buf = buf.slice(0, actual);\n }\n return buf;\n }\n function fromArrayLike(array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0;\n const buf = createBuffer(length);\n for (let i2 = 0; i2 < length; i2 += 1) {\n buf[i2] = array[i2] & 255;\n }\n return buf;\n }\n function fromArrayView(arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView);\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);\n }\n return fromArrayLike(arrayView);\n }\n function fromArrayBuffer(array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError(\'"offset" is outside of buffer bounds\');\n }\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError(\'"length" is outside of buffer bounds\');\n }\n let buf;\n if (byteOffset === void 0 && length === void 0) {\n buf = new Uint8Array(array);\n } else if (length === void 0) {\n buf = new Uint8Array(array, byteOffset);\n } else {\n buf = new Uint8Array(array, byteOffset, length);\n }\n Object.setPrototypeOf(buf, Buffer3.prototype);\n return buf;\n }\n function fromObject(obj) {\n if (Buffer3.isBuffer(obj)) {\n const len = checked(obj.length) | 0;\n const buf = createBuffer(len);\n if (buf.length === 0) {\n return buf;\n }\n obj.copy(buf, 0, 0, len);\n return buf;\n }\n if (obj.length !== void 0) {\n if (typeof obj.length !== "number" || numberIsNaN(obj.length)) {\n return createBuffer(0);\n }\n return fromArrayLike(obj);\n }\n if (obj.type === "Buffer" && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data);\n }\n }\n function checked(length) {\n if (length >= K_MAX_LENGTH) {\n throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");\n }\n return length | 0;\n }\n function SlowBuffer(length) {\n if (+length != length) {\n length = 0;\n }\n return Buffer3.alloc(+length);\n }\n Buffer3.isBuffer = function isBuffer(b2) {\n return b2 != null && b2._isBuffer === true && b2 !== Buffer3.prototype;\n };\n Buffer3.compare = function compare(a2, b2) {\n if (isInstance(a2, Uint8Array)) a2 = Buffer3.from(a2, a2.offset, a2.byteLength);\n if (isInstance(b2, Uint8Array)) b2 = Buffer3.from(b2, b2.offset, b2.byteLength);\n if (!Buffer3.isBuffer(a2) || !Buffer3.isBuffer(b2)) {\n throw new TypeError(\n \'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\'\n );\n }\n if (a2 === b2) return 0;\n let x2 = a2.length;\n let y2 = b2.length;\n for (let i2 = 0, len = Math.min(x2, y2); i2 < len; ++i2) {\n if (a2[i2] !== b2[i2]) {\n x2 = a2[i2];\n y2 = b2[i2];\n break;\n }\n }\n if (x2 < y2) return -1;\n if (y2 < x2) return 1;\n return 0;\n };\n Buffer3.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case "hex":\n case "utf8":\n case "utf-8":\n case "ascii":\n case "latin1":\n case "binary":\n case "base64":\n case "ucs2":\n case "ucs-2":\n case "utf16le":\n case "utf-16le":\n return true;\n default:\n return false;\n }\n };\n Buffer3.concat = function concat(list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError(\'"list" argument must be an Array of Buffers\');\n }\n if (list.length === 0) {\n return Buffer3.alloc(0);\n }\n let i2;\n if (length === void 0) {\n length = 0;\n for (i2 = 0; i2 < list.length; ++i2) {\n length += list[i2].length;\n }\n }\n const buffer = Buffer3.allocUnsafe(length);\n let pos = 0;\n for (i2 = 0; i2 < list.length; ++i2) {\n let buf = list[i2];\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer3.isBuffer(buf)) buf = Buffer3.from(buf);\n buf.copy(buffer, pos);\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n );\n }\n } else if (!Buffer3.isBuffer(buf)) {\n throw new TypeError(\'"list" argument must be an Array of Buffers\');\n } else {\n buf.copy(buffer, pos);\n }\n pos += buf.length;\n }\n return buffer;\n };\n function byteLength(string, encoding) {\n if (Buffer3.isBuffer(string)) {\n return string.length;\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength;\n }\n if (typeof string !== "string") {\n throw new TypeError(\n \'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \' + typeof string\n );\n }\n const len = string.length;\n const mustMatch = arguments.length > 2 && arguments[2] === true;\n if (!mustMatch && len === 0) return 0;\n let loweredCase = false;\n for (; ; ) {\n switch (encoding) {\n case "ascii":\n case "latin1":\n case "binary":\n return len;\n case "utf8":\n case "utf-8":\n return utf8ToBytes(string).length;\n case "ucs2":\n case "ucs-2":\n case "utf16le":\n case "utf-16le":\n return len * 2;\n case "hex":\n return len >>> 1;\n case "base64":\n return base64ToBytes(string).length;\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length;\n }\n encoding = ("" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n }\n Buffer3.byteLength = byteLength;\n function slowToString(encoding, start, end) {\n let loweredCase = false;\n if (start === void 0 || start < 0) {\n start = 0;\n }\n if (start > this.length) {\n return "";\n }\n if (end === void 0 || end > this.length) {\n end = this.length;\n }\n if (end <= 0) {\n return "";\n }\n end >>>= 0;\n start >>>= 0;\n if (end <= start) {\n return "";\n }\n if (!encoding) encoding = "utf8";\n while (true) {\n switch (encoding) {\n case "hex":\n return hexSlice(this, start, end);\n case "utf8":\n case "utf-8":\n return utf8Slice(this, start, end);\n case "ascii":\n return asciiSlice(this, start, end);\n case "latin1":\n case "binary":\n return latin1Slice(this, start, end);\n case "base64":\n return base64Slice(this, start, end);\n case "ucs2":\n case "ucs-2":\n case "utf16le":\n case "utf-16le":\n return utf16leSlice(this, start, end);\n default:\n if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);\n encoding = (encoding + "").toLowerCase();\n loweredCase = true;\n }\n }\n }\n Buffer3.prototype._isBuffer = true;\n function swap(b2, n2, m2) {\n const i2 = b2[n2];\n b2[n2] = b2[m2];\n b2[m2] = i2;\n }\n Buffer3.prototype.swap16 = function swap16() {\n const len = this.length;\n if (len % 2 !== 0) {\n throw new RangeError("Buffer size must be a multiple of 16-bits");\n }\n for (let i2 = 0; i2 < len; i2 += 2) {\n swap(this, i2, i2 + 1);\n }\n return this;\n };\n Buffer3.prototype.swap32 = function swap32() {\n const len = this.length;\n if (len % 4 !== 0) {\n throw new RangeError("Buffer size must be a multiple of 32-bits");\n }\n for (let i2 = 0; i2 < len; i2 += 4) {\n swap(this, i2, i2 + 3);\n swap(this, i2 + 1, i2 + 2);\n }\n return this;\n };\n Buffer3.prototype.swap64 = function swap64() {\n const len = this.length;\n if (len % 8 !== 0) {\n throw new RangeError("Buffer size must be a multiple of 64-bits");\n }\n for (let i2 = 0; i2 < len; i2 += 8) {\n swap(this, i2, i2 + 7);\n swap(this, i2 + 1, i2 + 6);\n swap(this, i2 + 2, i2 + 5);\n swap(this, i2 + 3, i2 + 4);\n }\n return this;\n };\n Buffer3.prototype.toString = function toString() {\n const length = this.length;\n if (length === 0) return "";\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n };\n Buffer3.prototype.toLocaleString = Buffer3.prototype.toString;\n Buffer3.prototype.equals = function equals(b2) {\n if (!Buffer3.isBuffer(b2)) throw new TypeError("Argument must be a Buffer");\n if (this === b2) return true;\n return Buffer3.compare(this, b2) === 0;\n };\n Buffer3.prototype.inspect = function inspect() {\n let str = "";\n const max = exports.INSPECT_MAX_BYTES;\n str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();\n if (this.length > max) str += " ... ";\n return "<Buffer " + str + ">";\n };\n if (customInspectSymbol) {\n Buffer3.prototype[customInspectSymbol] = Buffer3.prototype.inspect;\n }\n Buffer3.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer3.from(target, target.offset, target.byteLength);\n }\n if (!Buffer3.isBuffer(target)) {\n throw new TypeError(\n \'The "target" argument must be one of type Buffer or Uint8Array. Received type \' + typeof target\n );\n }\n if (start === void 0) {\n start = 0;\n }\n if (end === void 0) {\n end = target ? target.length : 0;\n }\n if (thisStart === void 0) {\n thisStart = 0;\n }\n if (thisEnd === void 0) {\n thisEnd = this.length;\n }\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError("out of range index");\n }\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n if (thisStart >= thisEnd) {\n return -1;\n }\n if (start >= end) {\n return 1;\n }\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n let x2 = thisEnd - thisStart;\n let y2 = end - start;\n const len = Math.min(x2, y2);\n const thisCopy = this.slice(thisStart, thisEnd);\n const targetCopy = target.slice(start, end);\n for (let i2 = 0; i2 < len; ++i2) {\n if (thisCopy[i2] !== targetCopy[i2]) {\n x2 = thisCopy[i2];\n y2 = targetCopy[i2];\n break;\n }\n }\n if (x2 < y2) return -1;\n if (y2 < x2) return 1;\n return 0;\n };\n function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n if (buffer.length === 0) return -1;\n if (typeof byteOffset === "string") {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 2147483647) {\n byteOffset = 2147483647;\n } else if (byteOffset < -2147483648) {\n byteOffset = -2147483648;\n }\n byteOffset = +byteOffset;\n if (numberIsNaN(byteOffset)) {\n byteOffset = dir ? 0 : buffer.length - 1;\n }\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n if (byteOffset >= buffer.length) {\n if (dir) return -1;\n else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;\n else return -1;\n }\n if (typeof val === "string") {\n val = Buffer3.from(val, encoding);\n }\n if (Buffer3.isBuffer(val)) {\n if (val.length === 0) {\n return -1;\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === "number") {\n val = val & 255;\n if (typeof Uint8Array.prototype.indexOf === "function") {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n throw new TypeError("val must be string, number or Buffer");\n }\n function arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n let indexSize = 1;\n let arrLength = arr.length;\n let valLength = val.length;\n if (encoding !== void 0) {\n encoding = String(encoding).toLowerCase();\n if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n function read(buf, i3) {\n if (indexSize === 1) {\n return buf[i3];\n } else {\n return buf.readUInt16BE(i3 * indexSize);\n }\n }\n let i2;\n if (dir) {\n let foundIndex = -1;\n for (i2 = byteOffset; i2 < arrLength; i2++) {\n if (read(arr, i2) === read(val, foundIndex === -1 ? 0 : i2 - foundIndex)) {\n if (foundIndex === -1) foundIndex = i2;\n if (i2 - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i2 -= i2 - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n for (i2 = byteOffset; i2 >= 0; i2--) {\n let found = true;\n for (let j2 = 0; j2 < valLength; j2++) {\n if (read(arr, i2 + j2) !== read(val, j2)) {\n found = false;\n break;\n }\n }\n if (found) return i2;\n }\n }\n return -1;\n }\n Buffer3.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n };\n Buffer3.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n };\n Buffer3.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n };\n function hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n const remaining = buf.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n if (length > remaining) {\n length = remaining;\n }\n }\n const strLen = string.length;\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n let i2;\n for (i2 = 0; i2 < length; ++i2) {\n const parsed = parseInt(string.substr(i2 * 2, 2), 16);\n if (numberIsNaN(parsed)) return i2;\n buf[offset + i2] = parsed;\n }\n return i2;\n }\n function utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n }\n function asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n }\n function base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n }\n function ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n }\n Buffer3.prototype.write = function write(string, offset, length, encoding) {\n if (offset === void 0) {\n encoding = "utf8";\n length = this.length;\n offset = 0;\n } else if (length === void 0 && typeof offset === "string") {\n encoding = offset;\n length = this.length;\n offset = 0;\n } else if (isFinite(offset)) {\n offset = offset >>> 0;\n if (isFinite(length)) {\n length = length >>> 0;\n if (encoding === void 0) encoding = "utf8";\n } else {\n encoding = length;\n length = void 0;\n }\n } else {\n throw new Error(\n "Buffer.write(string, encoding, offset[, length]) is no longer supported"\n );\n }\n const remaining = this.length - offset;\n if (length === void 0 || length > remaining) length = remaining;\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError("Attempt to write outside buffer bounds");\n }\n if (!encoding) encoding = "utf8";\n let loweredCase = false;\n for (; ; ) {\n switch (encoding) {\n case "hex":\n return hexWrite(this, string, offset, length);\n case "utf8":\n case "utf-8":\n return utf8Write(this, string, offset, length);\n case "ascii":\n case "latin1":\n case "binary":\n return asciiWrite(this, string, offset, length);\n case "base64":\n return base64Write(this, string, offset, length);\n case "ucs2":\n case "ucs-2":\n case "utf16le":\n case "utf-16le":\n return ucs2Write(this, string, offset, length);\n default:\n if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);\n encoding = ("" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n };\n Buffer3.prototype.toJSON = function toJSON() {\n return {\n type: "Buffer",\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n };\n function base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n }\n function utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n const res = [];\n let i2 = start;\n while (i2 < end) {\n const firstByte = buf[i2];\n let codePoint = null;\n let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;\n if (i2 + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint;\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 128) {\n codePoint = firstByte;\n }\n break;\n case 2:\n secondByte = buf[i2 + 1];\n if ((secondByte & 192) === 128) {\n tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;\n if (tempCodePoint > 127) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 3:\n secondByte = buf[i2 + 1];\n thirdByte = buf[i2 + 2];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;\n if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 4:\n secondByte = buf[i2 + 1];\n thirdByte = buf[i2 + 2];\n fourthByte = buf[i2 + 3];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;\n if (tempCodePoint > 65535 && tempCodePoint < 1114112) {\n codePoint = tempCodePoint;\n }\n }\n }\n }\n if (codePoint === null) {\n codePoint = 65533;\n bytesPerSequence = 1;\n } else if (codePoint > 65535) {\n codePoint -= 65536;\n res.push(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n res.push(codePoint);\n i2 += bytesPerSequence;\n }\n return decodeCodePointsArray(res);\n }\n var MAX_ARGUMENTS_LENGTH = 4096;\n function decodeCodePointsArray(codePoints) {\n const len = codePoints.length;\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints);\n }\n let res = "";\n let i2 = 0;\n while (i2 < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i2, i2 += MAX_ARGUMENTS_LENGTH)\n );\n }\n return res;\n }\n function asciiSlice(buf, start, end) {\n let ret = "";\n end = Math.min(buf.length, end);\n for (let i2 = start; i2 < end; ++i2) {\n ret += String.fromCharCode(buf[i2] & 127);\n }\n return ret;\n }\n function latin1Slice(buf, start, end) {\n let ret = "";\n end = Math.min(buf.length, end);\n for (let i2 = start; i2 < end; ++i2) {\n ret += String.fromCharCode(buf[i2]);\n }\n return ret;\n }\n function hexSlice(buf, start, end) {\n const len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n let out = "";\n for (let i2 = start; i2 < end; ++i2) {\n out += hexSliceLookupTable[buf[i2]];\n }\n return out;\n }\n function utf16leSlice(buf, start, end) {\n const bytes = buf.slice(start, end);\n let res = "";\n for (let i2 = 0; i2 < bytes.length - 1; i2 += 2) {\n res += String.fromCharCode(bytes[i2] + bytes[i2 + 1] * 256);\n }\n return res;\n }\n Buffer3.prototype.slice = function slice(start, end) {\n const len = this.length;\n start = ~~start;\n end = end === void 0 ? len : ~~end;\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n if (end < start) end = start;\n const newBuf = this.subarray(start, end);\n Object.setPrototypeOf(newBuf, Buffer3.prototype);\n return newBuf;\n };\n function checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");\n if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");\n }\n Buffer3.prototype.readUintLE = Buffer3.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) checkOffset(offset, byteLength2, this.length);\n let val = this[offset];\n let mul = 1;\n let i2 = 0;\n while (++i2 < byteLength2 && (mul *= 256)) {\n val += this[offset + i2] * mul;\n }\n return val;\n };\n Buffer3.prototype.readUintBE = Buffer3.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) {\n checkOffset(offset, byteLength2, this.length);\n }\n let val = this[offset + --byteLength2];\n let mul = 1;\n while (byteLength2 > 0 && (mul *= 256)) {\n val += this[offset + --byteLength2] * mul;\n }\n return val;\n };\n Buffer3.prototype.readUint8 = Buffer3.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n };\n Buffer3.prototype.readUint16LE = Buffer3.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n };\n Buffer3.prototype.readUint16BE = Buffer3.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n };\n Buffer3.prototype.readUint32LE = Buffer3.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;\n };\n Buffer3.prototype.readUint32BE = Buffer3.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n };\n Buffer3.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, "offset");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const lo2 = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;\n const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;\n return BigInt(lo2) + (BigInt(hi) << BigInt(32));\n });\n Buffer3.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, "offset");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n const lo2 = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;\n return (BigInt(hi) << BigInt(32)) + BigInt(lo2);\n });\n Buffer3.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) checkOffset(offset, byteLength2, this.length);\n let val = this[offset];\n let mul = 1;\n let i2 = 0;\n while (++i2 < byteLength2 && (mul *= 256)) {\n val += this[offset + i2] * mul;\n }\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength2);\n return val;\n };\n Buffer3.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) checkOffset(offset, byteLength2, this.length);\n let i2 = byteLength2;\n let mul = 1;\n let val = this[offset + --i2];\n while (i2 > 0 && (mul *= 256)) {\n val += this[offset + --i2] * mul;\n }\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength2);\n return val;\n };\n Buffer3.prototype.readInt8 = function readInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 128)) return this[offset];\n return (255 - this[offset] + 1) * -1;\n };\n Buffer3.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset] | this[offset + 1] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n Buffer3.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset + 1] | this[offset] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n Buffer3.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n };\n Buffer3.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n };\n Buffer3.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, "offset");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);\n return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);\n });\n Buffer3.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, "offset");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);\n });\n Buffer3.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n };\n Buffer3.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n };\n Buffer3.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n };\n Buffer3.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n };\n function checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer3.isBuffer(buf)) throw new TypeError(\'"buffer" argument must be a Buffer instance\');\n if (value > max || value < min) throw new RangeError(\'"value" argument is out of bounds\');\n if (offset + ext > buf.length) throw new RangeError("Index out of range");\n }\n Buffer3.prototype.writeUintLE = Buffer3.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength2) - 1;\n checkInt(this, value, offset, byteLength2, maxBytes, 0);\n }\n let mul = 1;\n let i2 = 0;\n this[offset] = value & 255;\n while (++i2 < byteLength2 && (mul *= 256)) {\n this[offset + i2] = value / mul & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeUintBE = Buffer3.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength2) - 1;\n checkInt(this, value, offset, byteLength2, maxBytes, 0);\n }\n let i2 = byteLength2 - 1;\n let mul = 1;\n this[offset + i2] = value & 255;\n while (--i2 >= 0 && (mul *= 256)) {\n this[offset + i2] = value / mul & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeUint8 = Buffer3.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 255, 0);\n this[offset] = value & 255;\n return offset + 1;\n };\n Buffer3.prototype.writeUint16LE = Buffer3.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n Buffer3.prototype.writeUint16BE = Buffer3.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n Buffer3.prototype.writeUint32LE = Buffer3.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 255;\n return offset + 4;\n };\n Buffer3.prototype.writeUint32BE = Buffer3.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n function wrtBigUInt64LE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo2 = Number(value & BigInt(4294967295));\n buf[offset++] = lo2;\n lo2 = lo2 >> 8;\n buf[offset++] = lo2;\n lo2 = lo2 >> 8;\n buf[offset++] = lo2;\n lo2 = lo2 >> 8;\n buf[offset++] = lo2;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n return offset;\n }\n function wrtBigUInt64BE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo2 = Number(value & BigInt(4294967295));\n buf[offset + 7] = lo2;\n lo2 = lo2 >> 8;\n buf[offset + 6] = lo2;\n lo2 = lo2 >> 8;\n buf[offset + 5] = lo2;\n lo2 = lo2 >> 8;\n buf[offset + 4] = lo2;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset + 3] = hi;\n hi = hi >> 8;\n buf[offset + 2] = hi;\n hi = hi >> 8;\n buf[offset + 1] = hi;\n hi = hi >> 8;\n buf[offset] = hi;\n return offset + 8;\n }\n Buffer3.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));\n });\n Buffer3.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));\n });\n Buffer3.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength2 - 1);\n checkInt(this, value, offset, byteLength2, limit - 1, -limit);\n }\n let i2 = 0;\n let mul = 1;\n let sub = 0;\n this[offset] = value & 255;\n while (++i2 < byteLength2 && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i2 - 1] !== 0) {\n sub = 1;\n }\n this[offset + i2] = (value / mul >> 0) - sub & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength2 - 1);\n checkInt(this, value, offset, byteLength2, limit - 1, -limit);\n }\n let i2 = byteLength2 - 1;\n let mul = 1;\n let sub = 0;\n this[offset + i2] = value & 255;\n while (--i2 >= 0 && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i2 + 1] !== 0) {\n sub = 1;\n }\n this[offset + i2] = (value / mul >> 0) - sub & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 127, -128);\n if (value < 0) value = 255 + value + 1;\n this[offset] = value & 255;\n return offset + 1;\n };\n Buffer3.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n Buffer3.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n Buffer3.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n return offset + 4;\n };\n Buffer3.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n if (value < 0) value = 4294967295 + value + 1;\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n Buffer3.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));\n });\n Buffer3.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));\n });\n function checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError("Index out of range");\n if (offset < 0) throw new RangeError("Index out of range");\n }\n function writeFloat(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22);\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n }\n Buffer3.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n };\n Buffer3.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n };\n function writeDouble(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292);\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n }\n Buffer3.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n };\n Buffer3.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n };\n Buffer3.prototype.copy = function copy(target, targetStart, start, end) {\n if (!Buffer3.isBuffer(target)) throw new TypeError("argument should be a Buffer");\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start;\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0;\n if (targetStart < 0) {\n throw new RangeError("targetStart out of bounds");\n }\n if (start < 0 || start >= this.length) throw new RangeError("Index out of range");\n if (end < 0) throw new RangeError("sourceEnd out of bounds");\n if (end > this.length) end = this.length;\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n const len = end - start;\n if (this === target && typeof Uint8Array.prototype.copyWithin === "function") {\n this.copyWithin(targetStart, start, end);\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n );\n }\n return len;\n };\n Buffer3.prototype.fill = function fill(val, start, end, encoding) {\n if (typeof val === "string") {\n if (typeof start === "string") {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === "string") {\n encoding = end;\n end = this.length;\n }\n if (encoding !== void 0 && typeof encoding !== "string") {\n throw new TypeError("encoding must be a string");\n }\n if (typeof encoding === "string" && !Buffer3.isEncoding(encoding)) {\n throw new TypeError("Unknown encoding: " + encoding);\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0);\n if (encoding === "utf8" && code < 128 || encoding === "latin1") {\n val = code;\n }\n }\n } else if (typeof val === "number") {\n val = val & 255;\n } else if (typeof val === "boolean") {\n val = Number(val);\n }\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError("Out of range index");\n }\n if (end <= start) {\n return this;\n }\n start = start >>> 0;\n end = end === void 0 ? this.length : end >>> 0;\n if (!val) val = 0;\n let i2;\n if (typeof val === "number") {\n for (i2 = start; i2 < end; ++i2) {\n this[i2] = val;\n }\n } else {\n const bytes = Buffer3.isBuffer(val) ? val : Buffer3.from(val, encoding);\n const len = bytes.length;\n if (len === 0) {\n throw new TypeError(\'The value "\' + val + \'" is invalid for argument "value"\');\n }\n for (i2 = 0; i2 < end - start; ++i2) {\n this[i2 + start] = bytes[i2 % len];\n }\n }\n return this;\n };\n var errors = {};\n function E2(sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor() {\n super();\n Object.defineProperty(this, "message", {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n });\n this.name = `${this.name} [${sym}]`;\n this.stack;\n delete this.name;\n }\n get code() {\n return sym;\n }\n set code(value) {\n Object.defineProperty(this, "code", {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n });\n }\n toString() {\n return `${this.name} [${sym}]: ${this.message}`;\n }\n };\n }\n E2(\n "ERR_BUFFER_OUT_OF_BOUNDS",\n function(name) {\n if (name) {\n return `${name} is outside of buffer bounds`;\n }\n return "Attempt to access memory outside buffer bounds";\n },\n RangeError\n );\n E2(\n "ERR_INVALID_ARG_TYPE",\n function(name, actual) {\n return `The "${name}" argument must be of type number. Received type ${typeof actual}`;\n },\n TypeError\n );\n E2(\n "ERR_OUT_OF_RANGE",\n function(str, range, input) {\n let msg = `The value of "${str}" is out of range.`;\n let received = input;\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input));\n } else if (typeof input === "bigint") {\n received = String(input);\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received);\n }\n received += "n";\n }\n msg += ` It must be ${range}. Received ${received}`;\n return msg;\n },\n RangeError\n );\n function addNumericalSeparator(val) {\n let res = "";\n let i2 = val.length;\n const start = val[0] === "-" ? 1 : 0;\n for (; i2 >= start + 4; i2 -= 3) {\n res = `_${val.slice(i2 - 3, i2)}${res}`;\n }\n return `${val.slice(0, i2)}${res}`;\n }\n function checkBounds(buf, offset, byteLength2) {\n validateNumber(offset, "offset");\n if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) {\n boundsError(offset, buf.length - (byteLength2 + 1));\n }\n }\n function checkIntBI(value, min, max, buf, offset, byteLength2) {\n if (value > max || value < min) {\n const n2 = typeof min === "bigint" ? "n" : "";\n let range;\n if (byteLength2 > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n2} and < 2${n2} ** ${(byteLength2 + 1) * 8}${n2}`;\n } else {\n range = `>= -(2${n2} ** ${(byteLength2 + 1) * 8 - 1}${n2}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n2}`;\n }\n } else {\n range = `>= ${min}${n2} and <= ${max}${n2}`;\n }\n throw new errors.ERR_OUT_OF_RANGE("value", range, value);\n }\n checkBounds(buf, offset, byteLength2);\n }\n function validateNumber(value, name) {\n if (typeof value !== "number") {\n throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);\n }\n }\n function boundsError(value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type);\n throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value);\n }\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();\n }\n throw new errors.ERR_OUT_OF_RANGE(\n type || "offset",\n `>= ${type ? 1 : 0} and <= ${length}`,\n value\n );\n }\n var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;\n function base64clean(str) {\n str = str.split("=")[0];\n str = str.trim().replace(INVALID_BASE64_RE, "");\n if (str.length < 2) return "";\n while (str.length % 4 !== 0) {\n str = str + "=";\n }\n return str;\n }\n function utf8ToBytes(string, units) {\n units = units || Infinity;\n let codePoint;\n const length = string.length;\n let leadSurrogate = null;\n const bytes = [];\n for (let i2 = 0; i2 < length; ++i2) {\n codePoint = string.charCodeAt(i2);\n if (codePoint > 55295 && codePoint < 57344) {\n if (!leadSurrogate) {\n if (codePoint > 56319) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n } else if (i2 + 1 === length) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n }\n leadSurrogate = codePoint;\n continue;\n }\n if (codePoint < 56320) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n leadSurrogate = codePoint;\n continue;\n }\n codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;\n } else if (leadSurrogate) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n }\n leadSurrogate = null;\n if (codePoint < 128) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 2048) {\n if ((units -= 2) < 0) break;\n bytes.push(\n codePoint >> 6 | 192,\n codePoint & 63 | 128\n );\n } else if (codePoint < 65536) {\n if ((units -= 3) < 0) break;\n bytes.push(\n codePoint >> 12 | 224,\n codePoint >> 6 & 63 | 128,\n codePoint & 63 | 128\n );\n } else if (codePoint < 1114112) {\n if ((units -= 4) < 0) break;\n bytes.push(\n codePoint >> 18 | 240,\n codePoint >> 12 & 63 | 128,\n codePoint >> 6 & 63 | 128,\n codePoint & 63 | 128\n );\n } else {\n throw new Error("Invalid code point");\n }\n }\n return bytes;\n }\n function asciiToBytes(str) {\n const byteArray = [];\n for (let i2 = 0; i2 < str.length; ++i2) {\n byteArray.push(str.charCodeAt(i2) & 255);\n }\n return byteArray;\n }\n function utf16leToBytes(str, units) {\n let c2, hi, lo2;\n const byteArray = [];\n for (let i2 = 0; i2 < str.length; ++i2) {\n if ((units -= 2) < 0) break;\n c2 = str.charCodeAt(i2);\n hi = c2 >> 8;\n lo2 = c2 % 256;\n byteArray.push(lo2);\n byteArray.push(hi);\n }\n return byteArray;\n }\n function base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n }\n function blitBuffer(src, dst, offset, length) {\n let i2;\n for (i2 = 0; i2 < length; ++i2) {\n if (i2 + offset >= dst.length || i2 >= src.length) break;\n dst[i2 + offset] = src[i2];\n }\n return i2;\n }\n function isInstance(obj, type) {\n return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;\n }\n function numberIsNaN(obj) {\n return obj !== obj;\n }\n var hexSliceLookupTable = (function() {\n const alphabet = "0123456789abcdef";\n const table = new Array(256);\n for (let i2 = 0; i2 < 16; ++i2) {\n const i16 = i2 * 16;\n for (let j2 = 0; j2 < 16; ++j2) {\n table[i16 + j2] = alphabet[i2] + alphabet[j2];\n }\n }\n return table;\n })();\n function defineBigIntMethod(fn) {\n return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;\n }\n function BufferBigIntNotDefined() {\n throw new Error("BigInt not supported");\n }\n }\n});\n\n// src/rune/isolation/utils-bootstrap.js\nimport * as md from "crunes:md";\nimport * as tree from "crunes:tree";\n\n// src/docs/help-render.js\nvar PAD = 24;\nfunction row(label, description, indent = " ") {\n const padded = label.length >= PAD ? label + " " : label.padEnd(PAD);\n return `${indent}${padded} ${description ?? ""}`.trimEnd();\n}\nfunction positionalSpecs(node) {\n return (node?.positionals ?? []).map((p2) => p2.spec).join(" ");\n}\nfunction flattenCommands(commands, prefix = "") {\n const rows = [];\n for (const cmd of commands ?? []) {\n const path = prefix ? `${prefix} ${cmd.name}` : cmd.name;\n const specs = positionalSpecs(cmd);\n rows.push({\n path,\n label: specs ? `${path} ${specs}` : path,\n description: cmd.description ?? "",\n node: cmd\n });\n rows.push(...flattenCommands(cmd.commands ?? [], path));\n }\n return rows;\n}\nfunction selectNode(schema, segments) {\n let node = schema;\n const matched = [];\n for (const seg of segments ?? []) {\n const children = node?.commands ?? [];\n const next = children.find((c2) => c2.name === seg);\n if (!next) {\n return {\n node: null,\n matchedPath: matched.join(" "),\n failedAt: seg,\n candidates: children.map((c2) => c2.name)\n };\n }\n node = next;\n matched.push(seg);\n }\n return {\n node,\n matchedPath: matched.join(" "),\n failedAt: null,\n candidates: (node?.commands ?? []).map((c2) => c2.name)\n };\n}\nfunction toSegments(path) {\n if (Array.isArray(path)) return path.filter(Boolean).map(String);\n return String(path ?? "").trim().split(/\\s+/).filter(Boolean);\n}\nfunction verb(lifecycle) {\n return lifecycle === "repl" ? "repl" : "run";\n}\nvar choicesNote = (choices) => choices ? ` [choices: ${choices.map((c2) => JSON.stringify(c2)).join(", ")}]` : "";\nvar typeNote = (type) => type ? ` [${type}]` : "";\nfunction optionRows(options, indent = " ") {\n return (options ?? []).map((opt) => {\n const def = opt.def !== void 0 ? ` [default: ${JSON.stringify(opt.def)}]` : "";\n const required = opt.required ? " [required]" : "";\n return row(opt.flags, `${opt.description ?? ""}${typeNote(opt.type)}${def}${required}${choicesNote(opt.choices)}`, indent);\n });\n}\nfunction positionalRow(p2, indent) {\n return row(p2.spec ?? "", `${p2.description ?? ""}${typeNote(p2.type)}${choicesNote(p2.choices)}`, indent);\n}\nfunction exampleLines(examples, indent = " ") {\n const lines = [];\n for (const ex of examples ?? []) {\n lines.push(`${indent}${ex.usage}`);\n if (ex.description) lines.push(`${indent} ${ex.description}`);\n }\n return lines;\n}\nfunction formatCommandPage(node, meta) {\n const key = meta?.key ?? "rune";\n const path = meta?.path ?? "";\n const specs = positionalSpecs(node);\n const children = node?.commands ?? [];\n const usage = [`Usage: crunes ${verb(meta?.lifecycle)} ${key}`];\n if (path) usage.push(path);\n if (specs) usage.push(specs);\n else if (children.length > 0) usage.push("<command>");\n usage.push("[options]");\n const lines = [usage.join(" ")];\n if (node?.description) {\n lines.push("");\n lines.push(` ${node.description}`);\n }\n const positionals = node?.positionals ?? [];\n if (positionals.length > 0) {\n lines.push("");\n lines.push("Positionals:");\n for (const p2 of positionals) lines.push(positionalRow(p2));\n }\n const options = node?.options ?? [];\n if (options.length > 0) {\n lines.push("");\n lines.push("Options:");\n lines.push(...optionRows(options));\n }\n if (children.length > 0) {\n lines.push("");\n lines.push("Commands:");\n for (const child of children) {\n const childPath = path ? `${path} ${child.name}` : child.name;\n const childSpecs = positionalSpecs(child);\n lines.push(row(childSpecs ? `${childPath} ${childSpecs}` : childPath, child.description));\n }\n }\n const examples = node?.examples ?? [];\n if (examples.length > 0) {\n lines.push("");\n lines.push("Examples:");\n lines.push(...exampleLines(examples));\n }\n return lines.join("\\n");\n}\nfunction formatRuneIndex(schema, meta) {\n const key = meta?.key ?? "rune";\n const label = meta?.description ?? meta?.name ?? null;\n const commands = schema?.commands ?? [];\n const specs = positionalSpecs(schema);\n const lines = [`Rune: ${key}${label ? ` \\u2014 ${label}` : ""}`];\n if (meta?.relativePath) lines.push(`File (project-relative): ${meta.relativePath}`);\n if (meta?.runs) lines.push(`Runs: ${meta.runs}`);\n if (meta?.passThrough) lines.push("No argument schema \\u2014 arguments are passed to it unchanged. Add an args block to document and parse them.");\n const usage = [`Usage: crunes ${verb(meta?.lifecycle)} ${key}`];\n if (specs) usage.push(specs);\n else if (commands.length > 0) usage.push("<command>");\n usage.push("[options]");\n lines.push("");\n lines.push(usage.join(" "));\n const positionals = schema?.positionals ?? [];\n if (positionals.length > 0) {\n lines.push("");\n lines.push("Positionals:");\n for (const p2 of positionals) lines.push(positionalRow(p2));\n }\n const options = schema?.options ?? [];\n if (options.length > 0) {\n lines.push("");\n lines.push("Options:");\n lines.push(...optionRows(options));\n }\n if (commands.length > 0) {\n lines.push("");\n lines.push("Commands:");\n for (const r2 of flattenCommands(commands)) lines.push(row(r2.label, r2.description));\n }\n const rootExamples = schema?.examples ?? [];\n if (commands.length === 0 && rootExamples.length > 0) {\n lines.push("");\n lines.push("Examples:");\n lines.push(...exampleLines(rootExamples));\n }\n const replCommands = meta?.repl?.commands ?? [];\n if (replCommands.length > 0) {\n lines.push("");\n lines.push("REPL commands:");\n for (const c2 of replCommands) lines.push(row(`/${c2.name}`, c2.description));\n }\n if (meta?.includeBatch === true) {\n lines.push("");\n lines.push("Batch:");\n if (!meta.batch) {\n lines.push(" (no batch block declared \\u2014 this rune cannot appear in a -b batch)");\n } else {\n const allow = meta.batch.allow ?? [];\n const deny = meta.batch.deny ?? [];\n lines.push(` allow: ${allow.length ? allow.join(", ") : "(none)"}`);\n if (deny.length) lines.push(` deny: ${deny.join(", ")}`);\n }\n }\n if (commands.length > 0) {\n lines.push("");\n lines.push(`Drill down: crunes docs rune ${key} <command>`);\n }\n return lines.join("\\n");\n}\n\n// src/rune/isolation/utils-bootstrap.js\nvar import_fast_text_encoding = __toESM(require_text_min(), 1);\n\n// node_modules/web-streams-polyfill/dist/ponyfill.mjs\nfunction e() {\n}\nfunction t(e2) {\n return "object" == typeof e2 && null !== e2 || "function" == typeof e2;\n}\nvar r = e;\nfunction o(e2, t2) {\n try {\n Object.defineProperty(e2, "name", { value: t2, configurable: true });\n } catch (e3) {\n }\n}\nvar n = Promise;\nvar i = Promise.resolve.bind(n);\nvar a = Promise.prototype.then;\nvar s = Promise.reject.bind(n);\nvar l = i;\nfunction u(e2) {\n return new n(e2);\n}\nfunction c(e2) {\n return u((t2) => t2(e2));\n}\nfunction d(e2) {\n return s(e2);\n}\nfunction f(e2, t2, r2) {\n return a.call(e2, t2, r2);\n}\nfunction h(e2, t2, o2) {\n f(f(e2, t2, o2), void 0, r);\n}\nfunction b(e2, t2) {\n h(e2, t2);\n}\nfunction _(e2, t2) {\n h(e2, void 0, t2);\n}\nfunction m(e2, t2, r2) {\n return f(e2, t2, r2);\n}\nfunction p(e2) {\n f(e2, void 0, r);\n}\nvar y = (e2) => {\n if ("function" == typeof queueMicrotask) y = queueMicrotask;\n else {\n const e3 = c(void 0);\n y = (t2) => f(e3, t2);\n }\n return y(e2);\n};\nfunction S(e2, t2, r2) {\n if ("function" != typeof e2) throw new TypeError("Argument is not a function");\n return Function.prototype.apply.call(e2, t2, r2);\n}\nfunction g(e2, t2, r2) {\n try {\n return c(S(e2, t2, r2));\n } catch (e3) {\n return d(e3);\n }\n}\nvar v = class {\n constructor() {\n this._cursor = 0, this._size = 0, this._front = { _elements: [], _next: void 0 }, this._back = this._front, this._cursor = 0, this._size = 0;\n }\n get length() {\n return this._size;\n }\n push(e2) {\n const t2 = this._back;\n let r2 = t2;\n 16383 === t2._elements.length && (r2 = { _elements: [], _next: void 0 }), t2._elements.push(e2), r2 !== t2 && (this._back = r2, t2._next = r2), ++this._size;\n }\n shift() {\n const e2 = this._front;\n let t2 = e2;\n const r2 = this._cursor;\n let o2 = r2 + 1;\n const n2 = e2._elements, i2 = n2[r2];\n return 16384 === o2 && (t2 = e2._next, o2 = 0), --this._size, this._cursor = o2, e2 !== t2 && (this._front = t2), n2[r2] = void 0, i2;\n }\n forEach(e2) {\n let t2 = this._cursor, r2 = this._front, o2 = r2._elements;\n for (; !(t2 === o2.length && void 0 === r2._next || t2 === o2.length && (r2 = r2._next, o2 = r2._elements, t2 = 0, 0 === o2.length)); ) e2(o2[t2]), ++t2;\n }\n peek() {\n const e2 = this._front, t2 = this._cursor;\n return e2._elements[t2];\n }\n};\nvar w = /* @__PURE__ */ Symbol("[[AbortSteps]]");\nvar R = /* @__PURE__ */ Symbol("[[ErrorSteps]]");\nvar T = /* @__PURE__ */ Symbol("[[CancelSteps]]");\nvar P = /* @__PURE__ */ Symbol("[[PullSteps]]");\nvar C = /* @__PURE__ */ Symbol("[[CanPullSyncSteps]]");\nvar q = /* @__PURE__ */ Symbol("[[ReleaseSteps]]");\nfunction E(e2, t2) {\n e2._ownerReadableStream = t2, t2._reader = e2, "readable" === t2._state ? j(e2) : "closed" === t2._state ? (function(e3) {\n j(e3), z(e3);\n })(e2) : k(e2, t2._storedError);\n}\nfunction W(e2, t2) {\n return Mr(e2._ownerReadableStream, t2);\n}\nfunction O(e2) {\n const t2 = e2._ownerReadableStream;\n "readable" === t2._state ? A(e2, new TypeError("Reader was released and can no longer be used to monitor the stream\'s closedness")) : (function(e3, t3) {\n k(e3, t3);\n })(e2, new TypeError("Reader was released and can no longer be used to monitor the stream\'s closedness")), t2._readableStreamController[q](), t2._reader = void 0, e2._ownerReadableStream = void 0;\n}\nfunction B(e2) {\n return new TypeError("Cannot " + e2 + " a stream using a released reader");\n}\nfunction j(e2) {\n e2._closedPromise = u((t2, r2) => {\n e2._closedPromise_resolve = t2, e2._closedPromise_reject = r2;\n });\n}\nfunction k(e2, t2) {\n j(e2), A(e2, t2);\n}\nfunction A(e2, t2) {\n void 0 !== e2._closedPromise_reject && (p(e2._closedPromise), e2._closedPromise_reject(t2), e2._closedPromise_resolve = void 0, e2._closedPromise_reject = void 0);\n}\nfunction z(e2) {\n void 0 !== e2._closedPromise_resolve && (e2._closedPromise_resolve(void 0), e2._closedPromise_resolve = void 0, e2._closedPromise_reject = void 0);\n}\nvar D = Number.isFinite || function(e2) {\n return "number" == typeof e2 && isFinite(e2);\n};\nvar F = Math.trunc || function(e2) {\n return e2 < 0 ? Math.ceil(e2) : Math.floor(e2);\n};\nfunction L(e2, t2) {\n if (void 0 !== e2 && ("object" != typeof (r2 = e2) && "function" != typeof r2)) throw new TypeError(`${t2} is not an object.`);\n var r2;\n}\nfunction I(e2, t2) {\n if ("function" != typeof e2) throw new TypeError(`${t2} is not a function.`);\n}\nfunction $(e2, t2) {\n if (!/* @__PURE__ */ (function(e3) {\n return "object" == typeof e3 && null !== e3 || "function" == typeof e3;\n })(e2)) throw new TypeError(`${t2} is not an object.`);\n}\nfunction M(e2, t2, r2) {\n if (void 0 === e2) throw new TypeError(`Parameter ${t2} is required in \'${r2}\'.`);\n}\nfunction Y(e2, t2, r2) {\n if (void 0 === e2) throw new TypeError(`${t2} is required in \'${r2}\'.`);\n}\nfunction x(e2) {\n return Number(e2);\n}\nfunction Q(e2) {\n return 0 === e2 ? 0 : e2;\n}\nfunction N(e2, t2) {\n const r2 = Number.MAX_SAFE_INTEGER;\n let o2 = Number(e2);\n if (o2 = Q(o2), !D(o2)) throw new TypeError(`${t2} is not a finite number`);\n if (o2 = (function(e3) {\n return Q(F(e3));\n })(o2), o2 < 0 || o2 > r2) throw new TypeError(`${t2} is outside the accepted range of 0 to ${r2}, inclusive`);\n return D(o2) && 0 !== o2 ? o2 : 0;\n}\nfunction H(e2, t2) {\n if (!Ir(e2)) throw new TypeError(`${t2} is not a ReadableStream.`);\n}\nfunction V(e2) {\n return new ReadableStreamDefaultReader(e2);\n}\nfunction U(e2, t2) {\n e2._reader._readRequests.push(t2);\n}\nfunction G(e2, t2, r2) {\n const o2 = e2._reader._readRequests.shift();\n r2 ? o2._closeSteps() : o2._chunkSteps(t2);\n}\nfunction X(e2) {\n return e2._reader._readRequests.length;\n}\nfunction J(e2) {\n const t2 = e2._reader;\n return void 0 !== t2 && !!ee(t2);\n}\nvar ReadableStreamDefaultReader = class {\n constructor(e2) {\n if (M(e2, 1, "ReadableStreamDefaultReader"), H(e2, "First parameter"), $r(e2)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");\n E(this, e2), this._readRequests = new v();\n }\n get closed() {\n return ee(this) ? this._closedPromise : d(ne("closed"));\n }\n cancel(e2 = void 0) {\n return ee(this) ? void 0 === this._ownerReadableStream ? d(B("cancel")) : W(this, e2) : d(ne("cancel"));\n }\n read() {\n if (!ee(this)) return d(ne("read"));\n if (void 0 === this._ownerReadableStream) return d(B("read from"));\n const e2 = re(this) ? new Z() : new K();\n return te(this, e2), e2._promise;\n }\n releaseLock() {\n if (!ee(this)) throw ne("releaseLock");\n void 0 !== this._ownerReadableStream && (function(e2) {\n O(e2);\n const t2 = new TypeError("Reader was released");\n oe(e2, t2);\n })(this);\n }\n};\nObject.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), o(ReadableStreamDefaultReader.prototype.cancel, "cancel"), o(ReadableStreamDefaultReader.prototype.read, "read"), o(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true });\nvar K = class {\n constructor() {\n this._promise = u((e2, t2) => {\n this._resolvePromise = e2, this._rejectPromise = t2;\n });\n }\n _chunkSteps(e2) {\n this._resolvePromise({ value: e2, done: false });\n }\n _closeSteps() {\n this._resolvePromise({ value: void 0, done: true });\n }\n _errorSteps(e2) {\n this._rejectPromise(e2);\n }\n};\nvar Z = class {\n constructor() {\n this._promise = void 0;\n }\n _chunkSteps(e2) {\n this._promise = l({ value: e2, done: false });\n }\n _closeSteps() {\n this._promise = l({ value: void 0, done: true });\n }\n _errorSteps(e2) {\n this._promise = d(e2);\n }\n};\nfunction ee(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_readRequests") && e2 instanceof ReadableStreamDefaultReader);\n}\nfunction te(e2, t2) {\n const r2 = e2._ownerReadableStream;\n r2._disturbed = true, "closed" === r2._state ? t2._closeSteps() : "errored" === r2._state ? t2._errorSteps(r2._storedError) : r2._readableStreamController[P](t2);\n}\nfunction re(e2) {\n const t2 = e2._ownerReadableStream;\n return "closed" === t2._state || ("errored" === t2._state || t2._readableStreamController[C]());\n}\nfunction oe(e2, t2) {\n const r2 = e2._readRequests;\n e2._readRequests = new v(), r2.forEach((e3) => {\n e3._errorSteps(t2);\n });\n}\nfunction ne(e2) {\n return new TypeError(`ReadableStreamDefaultReader.prototype.${e2} can only be used on a ReadableStreamDefaultReader`);\n}\nvar ie;\nvar ae;\nvar se;\nfunction le(e2) {\n return e2.slice();\n}\nfunction ue(e2, t2, r2, o2, n2) {\n new Uint8Array(e2).set(new Uint8Array(r2, o2, n2), t2);\n}\nvar ce = (e2) => (ce = "function" == typeof e2.transfer ? (e3) => e3.transfer() : "function" == typeof structuredClone ? (e3) => structuredClone(e3, { transfer: [e3] }) : (e3) => e3, ce(e2));\nvar de = (e2) => (de = "boolean" == typeof e2.detached ? (e3) => e3.detached : (e3) => 0 === e3.byteLength, de(e2));\nfunction fe(e2, t2, r2) {\n if (e2.slice) return e2.slice(t2, r2);\n const o2 = r2 - t2, n2 = new ArrayBuffer(o2);\n return ue(n2, 0, e2, t2, o2), n2;\n}\nfunction he(e2, t2) {\n const r2 = e2[t2];\n if (null != r2) {\n if ("function" != typeof r2) throw new TypeError(`${String(t2)} is not a function`);\n return r2;\n }\n}\nfunction be(e2) {\n try {\n const t2 = e2.done, r2 = e2.value;\n return f(l(r2), (e3) => ({ done: t2, value: e3 }));\n } catch (e3) {\n return d(e3);\n }\n}\nvar _e = null !== (se = null !== (ie = Symbol.asyncIterator) && void 0 !== ie ? ie : null === (ae = Symbol.for) || void 0 === ae ? void 0 : ae.call(Symbol, "Symbol.asyncIterator")) && void 0 !== se ? se : "@@asyncIterator";\nfunction me(e2, r2 = "sync", o2) {\n if (void 0 === o2) if ("async" === r2) {\n if (void 0 === (o2 = he(e2, _e))) {\n return (function(e3) {\n const r3 = { next() {\n let t2;\n try {\n t2 = pe(e3);\n } catch (e4) {\n return d(e4);\n }\n return be(t2);\n }, return(r4) {\n let o3;\n try {\n const t2 = he(e3.iterator, "return");\n if (void 0 === t2) return c({ done: true, value: r4 });\n o3 = S(t2, e3.iterator, [r4]);\n } catch (e4) {\n return d(e4);\n }\n return t(o3) ? be(o3) : d(new TypeError("The iterator.return() method must return an object"));\n } };\n return { iterator: r3, nextMethod: r3.next, done: false };\n })(me(e2, "sync", he(e2, Symbol.iterator)));\n }\n } else o2 = he(e2, Symbol.iterator);\n if (void 0 === o2) throw new TypeError("The object is not iterable");\n const n2 = S(o2, e2, []);\n if (!t(n2)) throw new TypeError("The iterator method must return an object");\n return { iterator: n2, nextMethod: n2.next, done: false };\n}\nfunction pe(e2) {\n const r2 = S(e2.nextMethod, e2.iterator, []);\n if (!t(r2)) throw new TypeError("The iterator.next() method must return an object");\n return r2;\n}\nvar ye = class {\n constructor(e2, t2) {\n this._ongoingPromise = void 0, this._isFinished = false, this._reader = e2, this._preventCancel = t2;\n }\n next() {\n const e2 = () => this._nextSteps();\n return this._ongoingPromise = this._ongoingPromise ? m(this._ongoingPromise, e2, e2) : e2(), this._ongoingPromise;\n }\n return(e2) {\n const t2 = () => this._returnSteps(e2);\n return this._ongoingPromise = this._ongoingPromise ? m(this._ongoingPromise, t2, t2) : t2(), this._ongoingPromise;\n }\n _nextSteps() {\n if (this._isFinished) return Promise.resolve({ value: void 0, done: true });\n const e2 = this._reader, t2 = new Se(this);\n return te(e2, t2), t2._promise;\n }\n _returnSteps(e2) {\n if (this._isFinished) return Promise.resolve({ value: e2, done: true });\n this._isFinished = true;\n const t2 = this._reader;\n if (!this._preventCancel) {\n const r2 = W(t2, e2);\n return O(t2), m(r2, () => ({ value: e2, done: true }));\n }\n return O(t2), c({ value: e2, done: true });\n }\n};\nvar Se = class {\n constructor(e2) {\n this._iterator = e2, this._promise = u((e3, t2) => {\n this._resolvePromise = e3, this._rejectPromise = t2;\n });\n }\n _chunkSteps(e2) {\n this._iterator._ongoingPromise = void 0, y(() => this._resolvePromise({ value: e2, done: false }));\n }\n _closeSteps() {\n const e2 = this._iterator;\n e2._ongoingPromise = void 0, e2._isFinished = true, O(e2._reader), this._resolvePromise({ value: void 0, done: true });\n }\n _errorSteps(e2) {\n const t2 = this._iterator;\n t2._ongoingPromise = void 0, t2._isFinished = true, O(t2._reader), this._rejectPromise(e2);\n }\n};\nvar ge = { next() {\n return ve(this) ? this._asyncIteratorImpl.next() : d(we("next"));\n}, return(e2) {\n return ve(this) ? this._asyncIteratorImpl.return(e2) : d(we("return"));\n}, [_e]() {\n return this;\n} };\nfunction ve(e2) {\n if (!t(e2)) return false;\n if (!Object.prototype.hasOwnProperty.call(e2, "_asyncIteratorImpl")) return false;\n try {\n return e2._asyncIteratorImpl instanceof ye;\n } catch (e3) {\n return false;\n }\n}\nfunction we(e2) {\n return new TypeError(`ReadableStreamAsyncIterator.${e2} can only be used on a ReadableSteamAsyncIterator`);\n}\nObject.defineProperty(ge, _e, { enumerable: false });\nvar Re = Number.isNaN || function(e2) {\n return e2 != e2;\n};\nfunction Te(e2) {\n const t2 = fe(e2.buffer, e2.byteOffset, e2.byteOffset + e2.byteLength);\n return new Uint8Array(t2);\n}\nfunction Pe(e2) {\n const t2 = e2._queue.shift();\n return e2._queueTotalSize -= t2.size, e2._queueTotalSize < 0 && (e2._queueTotalSize = 0), t2.value;\n}\nfunction Ce(e2, t2, r2) {\n if ("number" != typeof (o2 = r2) || Re(o2) || o2 < 0 || r2 === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number.");\n var o2;\n e2._queue.push({ value: t2, size: r2 }), e2._queueTotalSize += r2;\n}\nfunction qe(e2) {\n e2._queue = new v(), e2._queueTotalSize = 0;\n}\nfunction Ee(e2) {\n return e2 === DataView;\n}\nfunction We(e2) {\n return Ee(e2) ? 1 : e2.BYTES_PER_ELEMENT;\n}\nvar ReadableStreamBYOBRequest = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get view() {\n if (!Be(this)) throw ot("view");\n return this._view;\n }\n respond(e2) {\n if (!Be(this)) throw ot("respond");\n if (M(e2, 1, "respond"), e2 = N(e2, "First parameter"), void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");\n if (de(this._view.buffer)) throw new TypeError("The BYOB request\'s buffer has been detached and so cannot be used as a response");\n et(this._associatedReadableByteStreamController, e2);\n }\n respondWithNewView(e2) {\n if (!Be(this)) throw ot("respondWithNewView");\n if (M(e2, 1, "respondWithNewView"), !ArrayBuffer.isView(e2)) throw new TypeError("You can only respond with array buffer views");\n if (void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");\n if (de(e2.buffer)) throw new TypeError("The given view\'s buffer has been detached and so cannot be used as a response");\n tt(this._associatedReadableByteStreamController, e2);\n }\n};\nObject.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), o(ReadableStreamBYOBRequest.prototype.respond, "respond"), o(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true });\nvar ReadableByteStreamController = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get byobRequest() {\n if (!Oe(this)) throw nt("byobRequest");\n return Ke(this);\n }\n get desiredSize() {\n if (!Oe(this)) throw nt("desiredSize");\n return Ze(this);\n }\n close() {\n if (!Oe(this)) throw nt("close");\n if (this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");\n const e2 = this._controlledReadableByteStream._state;\n if ("readable" !== e2) throw new TypeError(`The stream (in ${e2} state) is not in the readable state and cannot be closed`);\n Ue(this);\n }\n enqueue(e2) {\n if (!Oe(this)) throw nt("enqueue");\n if (M(e2, 1, "enqueue"), !ArrayBuffer.isView(e2)) throw new TypeError("chunk must be an array buffer view");\n if (0 === e2.byteLength) throw new TypeError("chunk must have non-zero byteLength");\n if (0 === e2.buffer.byteLength) throw new TypeError("chunk\'s buffer must have non-zero byteLength");\n if (this._closeRequested) throw new TypeError("stream is closed or draining");\n const t2 = this._controlledReadableByteStream._state;\n if ("readable" !== t2) throw new TypeError(`The stream (in ${t2} state) is not in the readable state and cannot be enqueued to`);\n Ge(this, e2);\n }\n error(e2 = void 0) {\n if (!Oe(this)) throw nt("error");\n Xe(this, e2);\n }\n [T](e2) {\n ke(this), qe(this);\n const t2 = this._cancelAlgorithm(e2);\n return Ve(this), t2;\n }\n [P](e2) {\n const t2 = this._controlledReadableByteStream;\n if (this._queueTotalSize > 0) return void Je(this, e2);\n const r2 = this._autoAllocateChunkSize;\n if (void 0 !== r2) {\n let t3;\n try {\n t3 = new ArrayBuffer(r2);\n } catch (t4) {\n return void e2._errorSteps(t4);\n }\n const o2 = { buffer: t3, bufferByteLength: r2, byteOffset: 0, byteLength: r2, bytesFilled: 0, minimumFill: 1, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" };\n this._pendingPullIntos.push(o2);\n }\n U(t2, e2), je(this);\n }\n [C]() {\n return this._queueTotalSize > 0;\n }\n [q]() {\n if (this._pendingPullIntos.length > 0) {\n const e2 = this._pendingPullIntos.peek();\n e2.readerType = "none", this._pendingPullIntos = new v(), this._pendingPullIntos.push(e2);\n }\n }\n};\nfunction Oe(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_controlledReadableByteStream") && e2 instanceof ReadableByteStreamController);\n}\nfunction Be(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_associatedReadableByteStreamController") && e2 instanceof ReadableStreamBYOBRequest);\n}\nfunction je(e2) {\n const t2 = (function(e3) {\n const t3 = e3._controlledReadableByteStream;\n if ("readable" !== t3._state) return false;\n if (e3._closeRequested) return false;\n if (!e3._started) return false;\n if (J(t3) && X(t3) > 0) return true;\n if (ut(t3) && lt(t3) > 0) return true;\n const r2 = Ze(e3);\n if (r2 > 0) return true;\n return false;\n })(e2);\n if (!t2) return;\n if (e2._pulling) return void (e2._pullAgain = true);\n e2._pulling = true;\n h(e2._pullAlgorithm(), () => (e2._pulling = false, e2._pullAgain && (e2._pullAgain = false, je(e2)), null), (t3) => (Xe(e2, t3), null));\n}\nfunction ke(e2) {\n xe(e2), e2._pendingPullIntos = new v();\n}\nfunction Ae(e2, t2) {\n let r2 = false;\n "closed" === e2._state && (r2 = true);\n const o2 = De(t2);\n "default" === t2.readerType ? G(e2, o2, r2) : (function(e3, t3, r3) {\n const o3 = e3._reader, n2 = o3._readIntoRequests.shift();\n r3 ? n2._closeSteps(t3) : n2._chunkSteps(t3);\n })(e2, o2, r2);\n}\nfunction ze(e2, t2) {\n for (let r2 = 0; r2 < t2.length; ++r2) Ae(e2, t2[r2]);\n}\nfunction De(e2) {\n const t2 = e2.bytesFilled, r2 = e2.elementSize;\n return new e2.viewConstructor(e2.buffer, e2.byteOffset, t2 / r2);\n}\nfunction Fe(e2, t2, r2, o2) {\n e2._queue.push({ buffer: t2, byteOffset: r2, byteLength: o2 }), e2._queueTotalSize += o2;\n}\nfunction Le(e2, t2, r2, o2) {\n let n2;\n try {\n n2 = fe(t2, r2, r2 + o2);\n } catch (t3) {\n throw Xe(e2, t3), t3;\n }\n Fe(e2, n2, 0, o2);\n}\nfunction Ie(e2, t2) {\n t2.bytesFilled > 0 && Le(e2, t2.buffer, t2.byteOffset, t2.bytesFilled), He(e2);\n}\nfunction $e(e2, t2) {\n const r2 = Math.min(e2._queueTotalSize, t2.byteLength - t2.bytesFilled), o2 = t2.bytesFilled + r2;\n let n2 = r2, i2 = false;\n const a2 = o2 - o2 % t2.elementSize;\n a2 >= t2.minimumFill && (n2 = a2 - t2.bytesFilled, i2 = true);\n const s2 = e2._queue;\n for (; n2 > 0; ) {\n const r3 = s2.peek(), o3 = Math.min(n2, r3.byteLength), i3 = t2.byteOffset + t2.bytesFilled;\n ue(t2.buffer, i3, r3.buffer, r3.byteOffset, o3), r3.byteLength === o3 ? s2.shift() : (r3.byteOffset += o3, r3.byteLength -= o3), e2._queueTotalSize -= o3, Me(e2, o3, t2), n2 -= o3;\n }\n return i2;\n}\nfunction Me(e2, t2, r2) {\n r2.bytesFilled += t2;\n}\nfunction Ye(e2) {\n 0 === e2._queueTotalSize && e2._closeRequested ? (Ve(e2), Yr(e2._controlledReadableByteStream)) : je(e2);\n}\nfunction xe(e2) {\n null !== e2._byobRequest && (e2._byobRequest._associatedReadableByteStreamController = void 0, e2._byobRequest._view = null, e2._byobRequest = null);\n}\nfunction Qe(e2) {\n const t2 = [];\n for (; e2._pendingPullIntos.length > 0 && 0 !== e2._queueTotalSize; ) {\n const r2 = e2._pendingPullIntos.peek();\n $e(e2, r2) && (He(e2), t2.push(r2));\n }\n return t2;\n}\nfunction Ne(e2, t2) {\n const r2 = e2._pendingPullIntos.peek();\n xe(e2);\n "closed" === e2._controlledReadableByteStream._state ? (function(e3, t3) {\n "none" === t3.readerType && He(e3);\n const r3 = e3._controlledReadableByteStream;\n if (ut(r3)) {\n const t4 = [];\n for (; t4.length < lt(r3); ) t4.push(He(e3));\n ze(r3, t4);\n }\n })(e2, r2) : (function(e3, t3, r3) {\n if (Me(0, t3, r3), "none" === r3.readerType) {\n Ie(e3, r3);\n const t4 = Qe(e3);\n return void ze(e3._controlledReadableByteStream, t4);\n }\n if (r3.bytesFilled < r3.minimumFill) return;\n He(e3);\n const o2 = r3.bytesFilled % r3.elementSize;\n if (o2 > 0) {\n const t4 = r3.byteOffset + r3.bytesFilled;\n Le(e3, r3.buffer, t4 - o2, o2);\n }\n r3.bytesFilled -= o2;\n const n2 = Qe(e3);\n Ae(e3._controlledReadableByteStream, r3), ze(e3._controlledReadableByteStream, n2);\n })(e2, t2, r2), je(e2);\n}\nfunction He(e2) {\n return e2._pendingPullIntos.shift();\n}\nfunction Ve(e2) {\n e2._pullAlgorithm = void 0, e2._cancelAlgorithm = void 0;\n}\nfunction Ue(e2) {\n const t2 = e2._controlledReadableByteStream;\n if (!e2._closeRequested && "readable" === t2._state) if (e2._queueTotalSize > 0) e2._closeRequested = true;\n else {\n if (e2._pendingPullIntos.length > 0) {\n const t3 = e2._pendingPullIntos.peek();\n if (t3.bytesFilled % t3.elementSize !== 0) {\n const t4 = new TypeError("Insufficient bytes to fill elements in the given buffer");\n throw Xe(e2, t4), t4;\n }\n }\n Ve(e2), Yr(t2);\n }\n}\nfunction Ge(e2, t2) {\n const r2 = e2._controlledReadableByteStream;\n if (e2._closeRequested || "readable" !== r2._state) return;\n const { buffer: o2, byteOffset: n2, byteLength: i2 } = t2;\n if (de(o2)) throw new TypeError("chunk\'s buffer is detached and so cannot be enqueued");\n const a2 = ce(o2);\n if (e2._pendingPullIntos.length > 0) {\n const t3 = e2._pendingPullIntos.peek();\n if (de(t3.buffer)) throw new TypeError("The BYOB request\'s buffer has been detached and so cannot be filled with an enqueued chunk");\n xe(e2), t3.buffer = ce(t3.buffer), "none" === t3.readerType && Ie(e2, t3);\n }\n if (J(r2)) if ((function(e3) {\n const t3 = e3._controlledReadableByteStream._reader;\n for (; t3._readRequests.length > 0; ) {\n if (0 === e3._queueTotalSize) return;\n Je(e3, t3._readRequests.shift());\n }\n })(e2), 0 === X(r2)) Fe(e2, a2, n2, i2);\n else {\n e2._pendingPullIntos.length > 0 && He(e2);\n G(r2, new Uint8Array(a2, n2, i2), false);\n }\n else if (ut(r2)) {\n Fe(e2, a2, n2, i2);\n ze(r2, Qe(e2));\n } else Fe(e2, a2, n2, i2);\n je(e2);\n}\nfunction Xe(e2, t2) {\n const r2 = e2._controlledReadableByteStream;\n "readable" === r2._state && (ke(e2), qe(e2), Ve(e2), xr(r2, t2));\n}\nfunction Je(e2, t2) {\n const r2 = e2._queue.shift();\n e2._queueTotalSize -= r2.byteLength, Ye(e2);\n const o2 = new Uint8Array(r2.buffer, r2.byteOffset, r2.byteLength);\n t2._chunkSteps(o2);\n}\nfunction Ke(e2) {\n if (null === e2._byobRequest && e2._pendingPullIntos.length > 0) {\n const t2 = e2._pendingPullIntos.peek(), r2 = new Uint8Array(t2.buffer, t2.byteOffset + t2.bytesFilled, t2.byteLength - t2.bytesFilled), o2 = Object.create(ReadableStreamBYOBRequest.prototype);\n !(function(e3, t3, r3) {\n e3._associatedReadableByteStreamController = t3, e3._view = r3;\n })(o2, e2, r2), e2._byobRequest = o2;\n }\n return e2._byobRequest;\n}\nfunction Ze(e2) {\n const t2 = e2._controlledReadableByteStream._state;\n return "errored" === t2 ? null : "closed" === t2 ? 0 : e2._strategyHWM - e2._queueTotalSize;\n}\nfunction et(e2, t2) {\n const r2 = e2._pendingPullIntos.peek();\n if ("closed" === e2._controlledReadableByteStream._state) {\n if (0 !== t2) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");\n } else {\n if (0 === t2) throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");\n if (r2.bytesFilled + t2 > r2.byteLength) throw new RangeError("bytesWritten out of range");\n }\n r2.buffer = ce(r2.buffer), Ne(e2, t2);\n}\nfunction tt(e2, t2) {\n const r2 = e2._pendingPullIntos.peek();\n if ("closed" === e2._controlledReadableByteStream._state) {\n if (0 !== t2.byteLength) throw new TypeError("The view\'s length must be 0 when calling respondWithNewView() on a closed stream");\n } else if (0 === t2.byteLength) throw new TypeError("The view\'s length must be greater than 0 when calling respondWithNewView() on a readable stream");\n if (r2.byteOffset + r2.bytesFilled !== t2.byteOffset) throw new RangeError("The region specified by view does not match byobRequest");\n if (r2.bufferByteLength !== t2.buffer.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest");\n if (r2.bytesFilled + t2.byteLength > r2.byteLength) throw new RangeError("The region specified by view is larger than byobRequest");\n const o2 = t2.byteLength;\n r2.buffer = ce(t2.buffer), Ne(e2, o2);\n}\nfunction rt(e2, t2, r2, o2, n2, i2, a2) {\n t2._controlledReadableByteStream = e2, t2._pullAgain = false, t2._pulling = false, t2._byobRequest = null, t2._queue = t2._queueTotalSize = void 0, qe(t2), t2._closeRequested = false, t2._started = false, t2._strategyHWM = i2, t2._pullAlgorithm = o2, t2._cancelAlgorithm = n2, t2._autoAllocateChunkSize = a2, t2._pendingPullIntos = new v(), e2._readableStreamController = t2;\n h(c(r2()), () => (t2._started = true, je(t2), null), (e3) => (Xe(t2, e3), null));\n}\nfunction ot(e2) {\n return new TypeError(`ReadableStreamBYOBRequest.prototype.${e2} can only be used on a ReadableStreamBYOBRequest`);\n}\nfunction nt(e2) {\n return new TypeError(`ReadableByteStreamController.prototype.${e2} can only be used on a ReadableByteStreamController`);\n}\nfunction it(e2, t2) {\n if ("byob" !== (e2 = `${e2}`)) throw new TypeError(`${t2} \'${e2}\' is not a valid enumeration value for ReadableStreamReaderMode`);\n return e2;\n}\nfunction at(e2) {\n return new ReadableStreamBYOBReader(e2);\n}\nfunction st(e2, t2) {\n e2._reader._readIntoRequests.push(t2);\n}\nfunction lt(e2) {\n return e2._reader._readIntoRequests.length;\n}\nfunction ut(e2) {\n const t2 = e2._reader;\n return void 0 !== t2 && !!ft(t2);\n}\nObject.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), o(ReadableByteStreamController.prototype.close, "close"), o(ReadableByteStreamController.prototype.enqueue, "enqueue"), o(ReadableByteStreamController.prototype.error, "error"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, { value: "ReadableByteStreamController", configurable: true });\nvar ReadableStreamBYOBReader = class {\n constructor(e2) {\n if (M(e2, 1, "ReadableStreamBYOBReader"), H(e2, "First parameter"), $r(e2)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");\n if (!Oe(e2._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");\n E(this, e2), this._readIntoRequests = new v();\n }\n get closed() {\n return ft(this) ? this._closedPromise : d(_t("closed"));\n }\n cancel(e2 = void 0) {\n return ft(this) ? void 0 === this._ownerReadableStream ? d(B("cancel")) : W(this, e2) : d(_t("cancel"));\n }\n read(e2, t2 = {}) {\n if (!ft(this)) return d(_t("read"));\n if (!ArrayBuffer.isView(e2)) return d(new TypeError("view must be an array buffer view"));\n if (0 === e2.byteLength) return d(new TypeError("view must have non-zero byteLength"));\n if (0 === e2.buffer.byteLength) return d(new TypeError("view\'s buffer must have non-zero byteLength"));\n if (de(e2.buffer)) return d(new TypeError("view\'s buffer has been detached"));\n let r2;\n try {\n r2 = (function(e3, t3) {\n var r3;\n return L(e3, t3), { min: N(null !== (r3 = null == e3 ? void 0 : e3.min) && void 0 !== r3 ? r3 : 1, `${t3} has member \'min\' that`) };\n })(t2, "options");\n } catch (e3) {\n return d(e3);\n }\n const o2 = r2.min;\n if (0 === o2) return d(new TypeError("options.min must be greater than 0"));\n if ((function(e3) {\n return Ee(e3.constructor);\n })(e2)) {\n if (o2 > e2.byteLength) return d(new RangeError("options.min must be less than or equal to view\'s byteLength"));\n } else if (o2 > e2.length) return d(new RangeError("options.min must be less than or equal to view\'s length"));\n if (void 0 === this._ownerReadableStream) return d(B("read from"));\n const n2 = (function(e3, t3, r3) {\n const o3 = e3._ownerReadableStream;\n return "errored" === o3._state || (function(e4, t4, r4) {\n const o4 = e4._controlledReadableByteStream, n3 = We(t4.constructor), { byteLength: i2 } = t4, a2 = r4 * n3;\n return !(e4._pendingPullIntos.length > 0) && ("closed" === o4._state || e4._queueTotalSize >= a2);\n })(o3._readableStreamController, t3, r3);\n })(this, e2, o2) ? new dt() : new ct();\n return ht(this, e2, o2, n2), n2._promise;\n }\n releaseLock() {\n if (!ft(this)) throw _t("releaseLock");\n void 0 !== this._ownerReadableStream && (function(e2) {\n O(e2);\n const t2 = new TypeError("Reader was released");\n bt(e2, t2);\n })(this);\n }\n};\nObject.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), o(ReadableStreamBYOBReader.prototype.cancel, "cancel"), o(ReadableStreamBYOBReader.prototype.read, "read"), o(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true });\nvar ct = class {\n constructor() {\n this._promise = u((e2, t2) => {\n this._resolvePromise = e2, this._rejectPromise = t2;\n });\n }\n _chunkSteps(e2) {\n this._resolvePromise({ value: e2, done: false });\n }\n _closeSteps(e2) {\n this._resolvePromise({ value: e2, done: true });\n }\n _errorSteps(e2) {\n this._rejectPromise(e2);\n }\n};\nvar dt = class {\n constructor() {\n this._promise = void 0;\n }\n _chunkSteps(e2) {\n this._promise = l({ value: e2, done: false });\n }\n _closeSteps(e2) {\n this._promise = l({ value: e2, done: true });\n }\n _errorSteps(e2) {\n this._promise = d(e2);\n }\n};\nfunction ft(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_readIntoRequests") && e2 instanceof ReadableStreamBYOBReader);\n}\nfunction ht(e2, t2, r2, o2) {\n const n2 = e2._ownerReadableStream;\n n2._disturbed = true, "errored" === n2._state ? o2._errorSteps(n2._storedError) : (function(e3, t3, r3, o3) {\n const n3 = e3._controlledReadableByteStream, i2 = t3.constructor, a2 = We(i2), { byteOffset: s2, byteLength: l2 } = t3, u2 = r3 * a2;\n let c2;\n try {\n c2 = ce(t3.buffer);\n } catch (e4) {\n return void o3._errorSteps(e4);\n }\n const d2 = { buffer: c2, bufferByteLength: c2.byteLength, byteOffset: s2, byteLength: l2, bytesFilled: 0, minimumFill: u2, elementSize: a2, viewConstructor: i2, readerType: "byob" };\n if (e3._pendingPullIntos.length > 0) return e3._pendingPullIntos.push(d2), void st(n3, o3);\n if ("closed" === n3._state) {\n const e4 = new i2(d2.buffer, d2.byteOffset, 0);\n return void o3._closeSteps(e4);\n }\n if (e3._queueTotalSize > 0) {\n if ($e(e3, d2)) {\n const t4 = De(d2);\n return Ye(e3), void o3._chunkSteps(t4);\n }\n if (e3._closeRequested) {\n const t4 = new TypeError("Insufficient bytes to fill elements in the given buffer");\n return Xe(e3, t4), void o3._errorSteps(t4);\n }\n }\n e3._pendingPullIntos.push(d2), st(n3, o3), je(e3);\n })(n2._readableStreamController, t2, r2, o2);\n}\nfunction bt(e2, t2) {\n const r2 = e2._readIntoRequests;\n e2._readIntoRequests = new v(), r2.forEach((e3) => {\n e3._errorSteps(t2);\n });\n}\nfunction _t(e2) {\n return new TypeError(`ReadableStreamBYOBReader.prototype.${e2} can only be used on a ReadableStreamBYOBReader`);\n}\nfunction mt(e2, t2) {\n const { highWaterMark: r2 } = e2;\n if (void 0 === r2) return t2;\n if (Re(r2) || r2 < 0) throw new RangeError("Invalid highWaterMark");\n return r2;\n}\nfunction pt(e2) {\n const { size: t2 } = e2;\n return t2 || (() => 1);\n}\nfunction yt(e2, t2) {\n L(e2, t2);\n const r2 = null == e2 ? void 0 : e2.highWaterMark, o2 = null == e2 ? void 0 : e2.size;\n return { highWaterMark: void 0 === r2 ? void 0 : x(r2), size: void 0 === o2 ? void 0 : St(o2, `${t2} has member \'size\' that`) };\n}\nfunction St(e2, t2) {\n return I(e2, t2), (t3) => x(e2(t3));\n}\nfunction gt(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nfunction vt(e2, t2, r2) {\n return I(e2, r2), () => g(e2, t2, []);\n}\nfunction wt(e2, t2, r2) {\n return I(e2, r2), (r3) => S(e2, t2, [r3]);\n}\nfunction Rt(e2, t2, r2) {\n return I(e2, r2), (r3, o2) => g(e2, t2, [r3, o2]);\n}\nfunction Tt(e2, t2) {\n if (!qt(e2)) throw new TypeError(`${t2} is not a WritableStream.`);\n}\nvar WritableStream = class {\n constructor(e2 = {}, t2 = {}) {\n void 0 === e2 ? e2 = null : $(e2, "First parameter");\n const r2 = yt(t2, "Second parameter"), o2 = (function(e3, t3) {\n L(e3, t3);\n const r3 = null == e3 ? void 0 : e3.abort, o3 = null == e3 ? void 0 : e3.close, n3 = null == e3 ? void 0 : e3.start, i2 = null == e3 ? void 0 : e3.type, a2 = null == e3 ? void 0 : e3.write;\n return { abort: void 0 === r3 ? void 0 : gt(r3, e3, `${t3} has member \'abort\' that`), close: void 0 === o3 ? void 0 : vt(o3, e3, `${t3} has member \'close\' that`), start: void 0 === n3 ? void 0 : wt(n3, e3, `${t3} has member \'start\' that`), write: void 0 === a2 ? void 0 : Rt(a2, e3, `${t3} has member \'write\' that`), type: i2 };\n })(e2, "First parameter");\n Ct(this);\n if (void 0 !== o2.type) throw new RangeError("Invalid type is specified");\n const n2 = pt(r2);\n !(function(e3, t3, r3, o3) {\n const n3 = Object.create(WritableStreamDefaultController.prototype);\n let i2, a2, s2, l2;\n i2 = void 0 !== t3.start ? () => t3.start(n3) : () => {\n };\n a2 = void 0 !== t3.write ? (e4) => t3.write(e4, n3) : () => c(void 0);\n s2 = void 0 !== t3.close ? () => t3.close() : () => c(void 0);\n l2 = void 0 !== t3.abort ? (e4) => t3.abort(e4) : () => c(void 0);\n Nt(e3, n3, i2, a2, s2, l2, r3, o3);\n })(this, o2, mt(r2, 1), n2);\n }\n get locked() {\n if (!qt(this)) throw Kt("locked");\n return Et(this);\n }\n abort(e2 = void 0) {\n return qt(this) ? Et(this) ? d(new TypeError("Cannot abort a stream that already has a writer")) : Wt(this, e2) : d(Kt("abort"));\n }\n close() {\n return qt(this) ? Et(this) ? d(new TypeError("Cannot close a stream that already has a writer")) : At(this) ? d(new TypeError("Cannot close an already-closing stream")) : Ot(this) : d(Kt("close"));\n }\n getWriter() {\n if (!qt(this)) throw Kt("getWriter");\n return Pt(this);\n }\n};\nfunction Pt(e2) {\n return new WritableStreamDefaultWriter(e2);\n}\nfunction Ct(e2) {\n e2._state = "writable", e2._storedError = void 0, e2._writer = void 0, e2._writableStreamController = void 0, e2._writeRequests = new v(), e2._inFlightWriteRequest = void 0, e2._closeRequest = void 0, e2._inFlightCloseRequest = void 0, e2._pendingAbortRequest = void 0, e2._backpressure = false;\n}\nfunction qt(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_writableStreamController") && e2 instanceof WritableStream);\n}\nfunction Et(e2) {\n return void 0 !== e2._writer;\n}\nfunction Wt(e2, t2) {\n var r2;\n if ("closed" === e2._state || "errored" === e2._state) return c(void 0);\n e2._writableStreamController._abortReason = t2, null === (r2 = e2._writableStreamController._abortController) || void 0 === r2 || r2.abort(t2);\n const o2 = e2._state;\n if ("closed" === o2 || "errored" === o2) return c(void 0);\n if (void 0 !== e2._pendingAbortRequest) return e2._pendingAbortRequest._promise;\n let n2 = false;\n "erroring" === o2 && (n2 = true, t2 = void 0);\n const i2 = u((r3, o3) => {\n e2._pendingAbortRequest = { _promise: void 0, _resolve: r3, _reject: o3, _reason: t2, _wasAlreadyErroring: n2 };\n });\n return e2._pendingAbortRequest._promise = i2, n2 || jt(e2, t2), i2;\n}\nfunction Ot(e2) {\n const t2 = e2._state;\n if ("closed" === t2 || "errored" === t2) return d(new TypeError(`The stream (in ${t2} state) is not in the writable state and cannot be closed`));\n const r2 = u((t3, r3) => {\n const o3 = { _resolve: t3, _reject: r3 };\n e2._closeRequest = o3;\n }), o2 = e2._writer;\n var n2;\n return void 0 !== o2 && e2._backpressure && "writable" === t2 && cr(o2), Ce(n2 = e2._writableStreamController, xt, 0), Ut(n2), r2;\n}\nfunction Bt(e2, t2) {\n "writable" !== e2._state ? kt(e2) : jt(e2, t2);\n}\nfunction jt(e2, t2) {\n const r2 = e2._writableStreamController;\n e2._state = "erroring", e2._storedError = t2;\n const o2 = e2._writer;\n void 0 !== o2 && $t(o2, t2), !(function(e3) {\n if (void 0 === e3._inFlightWriteRequest && void 0 === e3._inFlightCloseRequest) return false;\n return true;\n })(e2) && r2._started && kt(e2);\n}\nfunction kt(e2) {\n e2._state = "errored", e2._writableStreamController[R]();\n const t2 = e2._storedError;\n if (e2._writeRequests.forEach((e3) => {\n e3._reject(t2);\n }), e2._writeRequests = new v(), void 0 === e2._pendingAbortRequest) return void zt(e2);\n const r2 = e2._pendingAbortRequest;\n if (e2._pendingAbortRequest = void 0, r2._wasAlreadyErroring) return r2._reject(t2), void zt(e2);\n h(e2._writableStreamController[w](r2._reason), () => (r2._resolve(), zt(e2), null), (t3) => (r2._reject(t3), zt(e2), null));\n}\nfunction At(e2) {\n return void 0 !== e2._closeRequest || void 0 !== e2._inFlightCloseRequest;\n}\nfunction zt(e2) {\n void 0 !== e2._closeRequest && (e2._closeRequest._reject(e2._storedError), e2._closeRequest = void 0);\n const t2 = e2._writer;\n void 0 !== t2 && nr(t2, e2._storedError);\n}\nfunction Dt(e2, t2) {\n const r2 = e2._writer;\n void 0 !== r2 && t2 !== e2._backpressure && (t2 ? (function(e3) {\n ar(e3);\n })(r2) : cr(r2)), e2._backpressure = t2;\n}\nObject.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), o(WritableStream.prototype.abort, "abort"), o(WritableStream.prototype.close, "close"), o(WritableStream.prototype.getWriter, "getWriter"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, { value: "WritableStream", configurable: true });\nvar WritableStreamDefaultWriter = class {\n constructor(e2) {\n if (M(e2, 1, "WritableStreamDefaultWriter"), Tt(e2, "First parameter"), Et(e2)) throw new TypeError("This stream has already been locked for exclusive writing by another writer");\n this._ownerWritableStream = e2, e2._writer = this;\n const t2 = e2._state;\n if ("writable" === t2) !At(e2) && e2._backpressure ? ar(this) : lr(this), rr(this);\n else if ("erroring" === t2) sr(this, e2._storedError), rr(this);\n else if ("closed" === t2) lr(this), rr(r2 = this), ir(r2);\n else {\n const t3 = e2._storedError;\n sr(this, t3), or(this, t3);\n }\n var r2;\n }\n get closed() {\n return Ft(this) ? this._closedPromise : d(er("closed"));\n }\n get desiredSize() {\n if (!Ft(this)) throw er("desiredSize");\n if (void 0 === this._ownerWritableStream) throw tr("desiredSize");\n return (function(e2) {\n const t2 = e2._ownerWritableStream, r2 = t2._state;\n if ("errored" === r2 || "erroring" === r2) return null;\n if ("closed" === r2) return 0;\n return Vt(t2._writableStreamController);\n })(this);\n }\n get ready() {\n return Ft(this) ? this._readyPromise : d(er("ready"));\n }\n abort(e2 = void 0) {\n return Ft(this) ? void 0 === this._ownerWritableStream ? d(tr("abort")) : (function(e3, t2) {\n return Wt(e3._ownerWritableStream, t2);\n })(this, e2) : d(er("abort"));\n }\n close() {\n if (!Ft(this)) return d(er("close"));\n const e2 = this._ownerWritableStream;\n return void 0 === e2 ? d(tr("close")) : At(e2) ? d(new TypeError("Cannot close an already-closing stream")) : Lt(this);\n }\n releaseLock() {\n if (!Ft(this)) throw er("releaseLock");\n void 0 !== this._ownerWritableStream && Mt(this);\n }\n write(e2 = void 0) {\n return Ft(this) ? void 0 === this._ownerWritableStream ? d(tr("write to")) : Yt(this, e2) : d(er("write"));\n }\n};\nfunction Ft(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_ownerWritableStream") && e2 instanceof WritableStreamDefaultWriter);\n}\nfunction Lt(e2) {\n return Ot(e2._ownerWritableStream);\n}\nfunction It(e2, t2) {\n "pending" === e2._closedPromiseState ? nr(e2, t2) : (function(e3, t3) {\n or(e3, t3);\n })(e2, t2);\n}\nfunction $t(e2, t2) {\n "pending" === e2._readyPromiseState ? ur(e2, t2) : (function(e3, t3) {\n sr(e3, t3);\n })(e2, t2);\n}\nfunction Mt(e2) {\n const t2 = e2._ownerWritableStream, r2 = new TypeError("Writer was released and can no longer be used to monitor the stream\'s closedness");\n $t(e2, r2), It(e2, r2), t2._writer = void 0, e2._ownerWritableStream = void 0;\n}\nfunction Yt(e2, t2) {\n const r2 = e2._ownerWritableStream, o2 = r2._writableStreamController, n2 = (function(e3, t3) {\n if (void 0 === e3._strategySizeAlgorithm) return 1;\n try {\n return e3._strategySizeAlgorithm(t3);\n } catch (t4) {\n return Gt(e3, t4), 1;\n }\n })(o2, t2);\n if (r2 !== e2._ownerWritableStream) return d(tr("write to"));\n const i2 = r2._state;\n if ("errored" === i2) return d(r2._storedError);\n if (At(r2) || "closed" === i2) return d(new TypeError("The stream is closing or closed and cannot be written to"));\n if ("erroring" === i2) return d(r2._storedError);\n const a2 = (function(e3) {\n return u((t3, r3) => {\n const o3 = { _resolve: t3, _reject: r3 };\n e3._writeRequests.push(o3);\n });\n })(r2);\n return (function(e3, t3, r3) {\n try {\n Ce(e3, t3, r3);\n } catch (t4) {\n return void Gt(e3, t4);\n }\n const o3 = e3._controlledWritableStream;\n if (!At(o3) && "writable" === o3._state) {\n Dt(o3, Xt(e3));\n }\n Ut(e3);\n })(o2, t2, n2), a2;\n}\nObject.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), o(WritableStreamDefaultWriter.prototype.abort, "abort"), o(WritableStreamDefaultWriter.prototype.close, "close"), o(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"), o(WritableStreamDefaultWriter.prototype.write, "write"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true });\nvar xt = {};\nvar WritableStreamDefaultController = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get abortReason() {\n if (!Qt(this)) throw Zt("abortReason");\n return this._abortReason;\n }\n get signal() {\n if (!Qt(this)) throw Zt("signal");\n if (void 0 === this._abortController) throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");\n return this._abortController.signal;\n }\n error(e2 = void 0) {\n if (!Qt(this)) throw Zt("error");\n "writable" === this._controlledWritableStream._state && Jt(this, e2);\n }\n [w](e2) {\n const t2 = this._abortAlgorithm(e2);\n return Ht(this), t2;\n }\n [R]() {\n qe(this);\n }\n};\nfunction Qt(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_controlledWritableStream") && e2 instanceof WritableStreamDefaultController);\n}\nfunction Nt(e2, t2, r2, o2, n2, i2, a2, s2) {\n t2._controlledWritableStream = e2, e2._writableStreamController = t2, t2._queue = void 0, t2._queueTotalSize = void 0, qe(t2), t2._abortReason = void 0, t2._abortController = (function() {\n if ("function" == typeof AbortController) return new AbortController();\n })(), t2._started = false, t2._strategySizeAlgorithm = s2, t2._strategyHWM = a2, t2._writeAlgorithm = o2, t2._closeAlgorithm = n2, t2._abortAlgorithm = i2;\n const l2 = Xt(t2);\n Dt(e2, l2);\n h(c(r2()), () => (t2._started = true, Ut(t2), null), (r3) => (t2._started = true, Bt(e2, r3), null));\n}\nfunction Ht(e2) {\n e2._writeAlgorithm = void 0, e2._closeAlgorithm = void 0, e2._abortAlgorithm = void 0, e2._strategySizeAlgorithm = void 0;\n}\nfunction Vt(e2) {\n return e2._strategyHWM - e2._queueTotalSize;\n}\nfunction Ut(e2) {\n const t2 = e2._controlledWritableStream;\n if (!e2._started) return;\n if (void 0 !== t2._inFlightWriteRequest) return;\n if ("erroring" === t2._state) return void kt(t2);\n if (0 === e2._queue.length) return;\n const r2 = e2._queue.peek().value;\n r2 === xt ? (function(e3) {\n const t3 = e3._controlledWritableStream;\n (function(e4) {\n e4._inFlightCloseRequest = e4._closeRequest, e4._closeRequest = void 0;\n })(t3), Pe(e3);\n const r3 = e3._closeAlgorithm();\n Ht(e3), h(r3, () => ((function(e4) {\n e4._inFlightCloseRequest._resolve(void 0), e4._inFlightCloseRequest = void 0, "erroring" === e4._state && (e4._storedError = void 0, void 0 !== e4._pendingAbortRequest && (e4._pendingAbortRequest._resolve(), e4._pendingAbortRequest = void 0)), e4._state = "closed";\n const t4 = e4._writer;\n void 0 !== t4 && ir(t4);\n })(t3), null), (e4) => ((function(e5, t4) {\n e5._inFlightCloseRequest._reject(t4), e5._inFlightCloseRequest = void 0, void 0 !== e5._pendingAbortRequest && (e5._pendingAbortRequest._reject(t4), e5._pendingAbortRequest = void 0), Bt(e5, t4);\n })(t3, e4), null));\n })(e2) : (function(e3, t3) {\n const r3 = e3._controlledWritableStream;\n !(function(e4) {\n e4._inFlightWriteRequest = e4._writeRequests.shift();\n })(r3);\n const o2 = e3._writeAlgorithm(t3);\n h(o2, () => {\n !(function(e4) {\n e4._inFlightWriteRequest._resolve(void 0), e4._inFlightWriteRequest = void 0;\n })(r3);\n const t4 = r3._state;\n if (Pe(e3), !At(r3) && "writable" === t4) {\n const t5 = Xt(e3);\n Dt(r3, t5);\n }\n return Ut(e3), null;\n }, (t4) => ("writable" === r3._state && Ht(e3), (function(e4, t5) {\n e4._inFlightWriteRequest._reject(t5), e4._inFlightWriteRequest = void 0, Bt(e4, t5);\n })(r3, t4), null));\n })(e2, r2);\n}\nfunction Gt(e2, t2) {\n "writable" === e2._controlledWritableStream._state && Jt(e2, t2);\n}\nfunction Xt(e2) {\n return Vt(e2) <= 0;\n}\nfunction Jt(e2, t2) {\n const r2 = e2._controlledWritableStream;\n Ht(e2), jt(r2, t2);\n}\nfunction Kt(e2) {\n return new TypeError(`WritableStream.prototype.${e2} can only be used on a WritableStream`);\n}\nfunction Zt(e2) {\n return new TypeError(`WritableStreamDefaultController.prototype.${e2} can only be used on a WritableStreamDefaultController`);\n}\nfunction er(e2) {\n return new TypeError(`WritableStreamDefaultWriter.prototype.${e2} can only be used on a WritableStreamDefaultWriter`);\n}\nfunction tr(e2) {\n return new TypeError("Cannot " + e2 + " a stream using a released writer");\n}\nfunction rr(e2) {\n e2._closedPromise = u((t2, r2) => {\n e2._closedPromise_resolve = t2, e2._closedPromise_reject = r2, e2._closedPromiseState = "pending";\n });\n}\nfunction or(e2, t2) {\n rr(e2), nr(e2, t2);\n}\nfunction nr(e2, t2) {\n void 0 !== e2._closedPromise_reject && (p(e2._closedPromise), e2._closedPromise_reject(t2), e2._closedPromise_resolve = void 0, e2._closedPromise_reject = void 0, e2._closedPromiseState = "rejected");\n}\nfunction ir(e2) {\n void 0 !== e2._closedPromise_resolve && (e2._closedPromise_resolve(void 0), e2._closedPromise_resolve = void 0, e2._closedPromise_reject = void 0, e2._closedPromiseState = "resolved");\n}\nfunction ar(e2) {\n e2._readyPromise = u((t2, r2) => {\n e2._readyPromise_resolve = t2, e2._readyPromise_reject = r2;\n }), e2._readyPromiseState = "pending";\n}\nfunction sr(e2, t2) {\n ar(e2), ur(e2, t2);\n}\nfunction lr(e2) {\n ar(e2), cr(e2);\n}\nfunction ur(e2, t2) {\n void 0 !== e2._readyPromise_reject && (p(e2._readyPromise), e2._readyPromise_reject(t2), e2._readyPromise_resolve = void 0, e2._readyPromise_reject = void 0, e2._readyPromiseState = "rejected");\n}\nfunction cr(e2) {\n void 0 !== e2._readyPromise_resolve && (e2._readyPromise_resolve(void 0), e2._readyPromise_resolve = void 0, e2._readyPromise_reject = void 0, e2._readyPromiseState = "fulfilled");\n}\nObject.defineProperties(WritableStreamDefaultController.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultController", configurable: true });\nvar dr = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof global ? global : void 0;\nvar fr = (function() {\n const e2 = null == dr ? void 0 : dr.DOMException;\n return (function(e3) {\n if ("function" != typeof e3 && "object" != typeof e3) return false;\n if ("DOMException" !== e3.name) return false;\n try {\n return new e3(), true;\n } catch (e4) {\n return false;\n }\n })(e2) ? e2 : void 0;\n})() || (function() {\n const e2 = function(e3, t2) {\n this.message = e3 || "", this.name = t2 || "Error", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);\n };\n return o(e2, "DOMException"), e2.prototype = Object.create(Error.prototype), Object.defineProperty(e2.prototype, "constructor", { value: e2, writable: true, configurable: true }), e2;\n})();\nfunction hr(e2, t2, r2, o2, n2, i2) {\n const a2 = V(e2), s2 = Pt(t2);\n e2._disturbed = true;\n const l2 = new br(s2), _2 = new mr(l2);\n return u((m2, y2) => {\n let S2;\n if (void 0 !== i2) {\n if (S2 = () => {\n const r3 = void 0 !== i2.reason ? i2.reason : new fr("Aborted", "AbortError"), a3 = [];\n o2 || a3.push(() => "writable" === t2._state ? Wt(t2, r3) : c(void 0)), n2 || a3.push(() => "readable" === e2._state ? Mr(e2, r3) : c(void 0)), T2(() => Promise.all(a3.map((e3) => e3())), true, r3);\n }, i2.aborted) return void S2();\n i2.addEventListener("abort", S2);\n }\n function g2() {\n for (; !l2._shuttingDown && !t2._backpressure && "writable" === t2._state && !At(t2) && "readable" === e2._state && re(a2); ) te(a2, _2);\n if (l2._shuttingDown) return c(true);\n if (t2._backpressure) return f(s2._readyPromise, g2);\n const r3 = new _r(l2);\n return te(a2, r3), r3._promise;\n }\n var v2, w2, R2;\n if (pr(e2, a2._closedPromise, (e3) => (o2 ? P2(true, e3) : T2(() => Wt(t2, e3), true, e3), null)), pr(t2, s2._closedPromise, (t3) => (n2 ? P2(true, t3) : T2(() => Mr(e2, t3), true, t3), null)), v2 = e2, w2 = a2._closedPromise, R2 = () => (r2 ? P2() : T2(() => (function(e3) {\n const t3 = e3._ownerWritableStream, r3 = t3._state;\n return At(t3) || "closed" === r3 ? c(void 0) : "errored" === r3 ? d(t3._storedError) : Lt(e3);\n })(s2)), null), "closed" === v2._state ? R2() : b(w2, R2), At(t2) || "closed" === t2._state) {\n const t3 = new TypeError("the destination writable stream closed before all data could be piped to it");\n n2 ? P2(true, t3) : T2(() => Mr(e2, t3), true, t3);\n }\n function T2(e3, r3, o3) {\n function n3() {\n return h(e3(), () => C2(r3, o3), (e4) => C2(true, e4)), null;\n }\n l2._shuttingDown || (l2._shuttingDown = true, "writable" !== t2._state || At(t2) ? n3() : b(l2._waitForWritesToFinish(), n3));\n }\n function P2(e3, r3) {\n l2._shuttingDown || (l2._shuttingDown = true, "writable" !== t2._state || At(t2) ? C2(e3, r3) : b(l2._waitForWritesToFinish(), () => C2(e3, r3)));\n }\n function C2(e3, t3) {\n return Mt(s2), O(a2), void 0 !== i2 && i2.removeEventListener("abort", S2), e3 ? y2(t3) : m2(void 0), null;\n }\n p(u((e3, t3) => {\n !(function r3(o3) {\n o3 ? e3() : f(g2(), r3, t3);\n })(false);\n }));\n });\n}\nvar br = class {\n constructor(e2) {\n this._writer = e2, this._shuttingDown = false, this._currentWrite = c(void 0);\n }\n _waitForWritesToFinish() {\n const e2 = this._currentWrite;\n return f(this._currentWrite, () => e2 !== this._currentWrite ? this._waitForWritesToFinish() : void 0);\n }\n};\nvar _r = class {\n constructor(e2) {\n this._state = e2, this._promise = u((e3, t2) => {\n this._resolvePromise = e3, this._rejectPromise = t2;\n });\n }\n _chunkSteps(t2) {\n this._state._currentWrite = f(Yt(this._state._writer, t2), void 0, e), this._resolvePromise(false);\n }\n _closeSteps() {\n this._resolvePromise(true);\n }\n _errorSteps(e2) {\n this._rejectPromise(e2);\n }\n};\nvar mr = class {\n constructor(e2) {\n this._state = e2;\n }\n _chunkSteps(t2) {\n this._state._currentWrite = f(Yt(this._state._writer, t2), void 0, e);\n }\n _closeSteps() {\n }\n _errorSteps(e2) {\n }\n};\nfunction pr(e2, t2, r2) {\n "errored" === e2._state ? r2(e2._storedError) : _(t2, r2);\n}\nvar ReadableStreamDefaultController = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get desiredSize() {\n if (!yr(this)) throw Er("desiredSize");\n return Pr(this);\n }\n close() {\n if (!yr(this)) throw Er("close");\n if (!Cr(this)) throw new TypeError("The stream is not in a state that permits close");\n wr(this);\n }\n enqueue(e2 = void 0) {\n if (!yr(this)) throw Er("enqueue");\n if (!Cr(this)) throw new TypeError("The stream is not in a state that permits enqueue");\n return Rr(this, e2);\n }\n error(e2 = void 0) {\n if (!yr(this)) throw Er("error");\n Tr(this, e2);\n }\n [T](e2) {\n qe(this);\n const t2 = this._cancelAlgorithm(e2);\n return vr(this), t2;\n }\n [P](e2) {\n const t2 = this._controlledReadableStream;\n if (this._queue.length > 0) {\n const r2 = Pe(this);\n this._closeRequested && 0 === this._queue.length ? (vr(this), Yr(t2)) : Sr(this), e2._chunkSteps(r2);\n } else U(t2, e2), Sr(this);\n }\n [C]() {\n return this._queue.length > 0;\n }\n [q]() {\n }\n};\nfunction yr(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_controlledReadableStream") && e2 instanceof ReadableStreamDefaultController);\n}\nfunction Sr(e2) {\n if (!gr(e2)) return;\n if (e2._pulling) return void (e2._pullAgain = true);\n e2._pulling = true;\n h(e2._pullAlgorithm(), () => (e2._pulling = false, e2._pullAgain && (e2._pullAgain = false, Sr(e2)), null), (t2) => (Tr(e2, t2), null));\n}\nfunction gr(e2) {\n const t2 = e2._controlledReadableStream;\n if (!Cr(e2)) return false;\n if (!e2._started) return false;\n if ($r(t2) && X(t2) > 0) return true;\n return Pr(e2) > 0;\n}\nfunction vr(e2) {\n e2._pullAlgorithm = void 0, e2._cancelAlgorithm = void 0, e2._strategySizeAlgorithm = void 0;\n}\nfunction wr(e2) {\n if (!Cr(e2)) return;\n const t2 = e2._controlledReadableStream;\n e2._closeRequested = true, 0 === e2._queue.length && (vr(e2), Yr(t2));\n}\nfunction Rr(e2, t2) {\n if (!Cr(e2)) return;\n const r2 = e2._controlledReadableStream;\n if ($r(r2) && X(r2) > 0) G(r2, t2, false);\n else {\n let r3;\n try {\n r3 = e2._strategySizeAlgorithm(t2);\n } catch (t3) {\n throw Tr(e2, t3), t3;\n }\n try {\n Ce(e2, t2, r3);\n } catch (t3) {\n throw Tr(e2, t3), t3;\n }\n }\n Sr(e2);\n}\nfunction Tr(e2, t2) {\n const r2 = e2._controlledReadableStream;\n "readable" === r2._state && (qe(e2), vr(e2), xr(r2, t2));\n}\nfunction Pr(e2) {\n const t2 = e2._controlledReadableStream._state;\n return "errored" === t2 ? null : "closed" === t2 ? 0 : e2._strategyHWM - e2._queueTotalSize;\n}\nfunction Cr(e2) {\n const t2 = e2._controlledReadableStream._state;\n return !e2._closeRequested && "readable" === t2;\n}\nfunction qr(e2, t2, r2, o2, n2, i2, a2) {\n t2._controlledReadableStream = e2, t2._queue = void 0, t2._queueTotalSize = void 0, qe(t2), t2._started = false, t2._closeRequested = false, t2._pullAgain = false, t2._pulling = false, t2._strategySizeAlgorithm = a2, t2._strategyHWM = i2, t2._pullAlgorithm = o2, t2._cancelAlgorithm = n2, e2._readableStreamController = t2;\n h(c(r2()), () => (t2._started = true, Sr(t2), null), (e3) => (Tr(t2, e3), null));\n}\nfunction Er(e2) {\n return new TypeError(`ReadableStreamDefaultController.prototype.${e2} can only be used on a ReadableStreamDefaultController`);\n}\nfunction Wr(e2, t2) {\n return Oe(e2._readableStreamController) ? (function(e3) {\n let t3, r2, o2, n2, i2, a2 = V(e3), s2 = false, l2 = false, d2 = false, f2 = false, h2 = false;\n const b2 = u((e4) => {\n i2 = e4;\n });\n function m2(e4) {\n _(e4._closedPromise, (t4) => (e4 !== a2 || (Xe(o2._readableStreamController, t4), Xe(n2._readableStreamController, t4), f2 && h2 || i2(void 0)), null));\n }\n function p2() {\n ft(a2) && (O(a2), a2 = V(e3), m2(a2));\n te(a2, { _chunkSteps: (t4) => {\n y(() => {\n l2 = false, d2 = false;\n const r3 = t4;\n let a3 = t4;\n if (!f2 && !h2) try {\n a3 = Te(t4);\n } catch (t5) {\n return Xe(o2._readableStreamController, t5), Xe(n2._readableStreamController, t5), void i2(Mr(e3, t5));\n }\n f2 || Ge(o2._readableStreamController, r3), h2 || Ge(n2._readableStreamController, a3), s2 = false, l2 ? g2() : d2 && v2();\n });\n }, _closeSteps: () => {\n s2 = false, f2 || Ue(o2._readableStreamController), h2 || Ue(n2._readableStreamController), o2._readableStreamController._pendingPullIntos.length > 0 && et(o2._readableStreamController, 0), n2._readableStreamController._pendingPullIntos.length > 0 && et(n2._readableStreamController, 0), f2 && h2 || i2(void 0);\n }, _errorSteps: () => {\n s2 = false;\n } });\n }\n function S2(t4, r3) {\n ee(a2) && (O(a2), a2 = at(e3), m2(a2));\n const u2 = r3 ? n2 : o2, c2 = r3 ? o2 : n2;\n ht(a2, t4, 1, { _chunkSteps: (t5) => {\n y(() => {\n l2 = false, d2 = false;\n const o3 = r3 ? h2 : f2;\n if (r3 ? f2 : h2) o3 || tt(u2._readableStreamController, t5);\n else {\n let r4;\n try {\n r4 = Te(t5);\n } catch (t6) {\n return Xe(u2._readableStreamController, t6), Xe(c2._readableStreamController, t6), void i2(Mr(e3, t6));\n }\n o3 || tt(u2._readableStreamController, t5), Ge(c2._readableStreamController, r4);\n }\n s2 = false, l2 ? g2() : d2 && v2();\n });\n }, _closeSteps: (e4) => {\n s2 = false;\n const t5 = r3 ? h2 : f2, o3 = r3 ? f2 : h2;\n t5 || Ue(u2._readableStreamController), o3 || Ue(c2._readableStreamController), void 0 !== e4 && (t5 || tt(u2._readableStreamController, e4), !o3 && c2._readableStreamController._pendingPullIntos.length > 0 && et(c2._readableStreamController, 0)), t5 && o3 || i2(void 0);\n }, _errorSteps: () => {\n s2 = false;\n } });\n }\n function g2() {\n if (s2) return l2 = true, c(void 0);\n s2 = true;\n const e4 = Ke(o2._readableStreamController);\n return null === e4 ? p2() : S2(e4._view, false), c(void 0);\n }\n function v2() {\n if (s2) return d2 = true, c(void 0);\n s2 = true;\n const e4 = Ke(n2._readableStreamController);\n return null === e4 ? p2() : S2(e4._view, true), c(void 0);\n }\n function w2(o3) {\n if (f2 = true, t3 = o3, h2) {\n const o4 = le([t3, r2]), n3 = Mr(e3, o4);\n i2(n3);\n }\n return b2;\n }\n function R2(o3) {\n if (h2 = true, r2 = o3, f2) {\n const o4 = le([t3, r2]), n3 = Mr(e3, o4);\n i2(n3);\n }\n return b2;\n }\n function T2() {\n }\n return o2 = Fr(T2, g2, w2), n2 = Fr(T2, v2, R2), m2(a2), [o2, n2];\n })(e2) : (function(e3) {\n const t3 = V(e3);\n let r2, o2, n2, i2, a2, s2 = false, l2 = false, d2 = false, f2 = false;\n const h2 = u((e4) => {\n a2 = e4;\n });\n function b2() {\n if (s2) return l2 = true, c(void 0);\n s2 = true;\n return te(t3, { _chunkSteps: (e4) => {\n y(() => {\n l2 = false;\n const t4 = e4, r3 = e4;\n d2 || Rr(n2._readableStreamController, t4), f2 || Rr(i2._readableStreamController, r3), s2 = false, l2 && b2();\n });\n }, _closeSteps: () => {\n s2 = false, d2 || wr(n2._readableStreamController), f2 || wr(i2._readableStreamController), d2 && f2 || a2(void 0);\n }, _errorSteps: () => {\n s2 = false;\n } }), c(void 0);\n }\n function m2(t4) {\n if (d2 = true, r2 = t4, f2) {\n const t5 = le([r2, o2]), n3 = Mr(e3, t5);\n a2(n3);\n }\n return h2;\n }\n function p2(t4) {\n if (f2 = true, o2 = t4, d2) {\n const t5 = le([r2, o2]), n3 = Mr(e3, t5);\n a2(n3);\n }\n return h2;\n }\n function S2() {\n }\n return n2 = Dr(S2, b2, m2), i2 = Dr(S2, b2, p2), _(t3._closedPromise, (e4) => (Tr(n2._readableStreamController, e4), Tr(i2._readableStreamController, e4), d2 && f2 || a2(void 0), null)), [n2, i2];\n })(e2);\n}\nfunction Or(r2) {\n return t(o2 = r2) && void 0 !== o2.getReader ? (function(r3) {\n let o3;\n function n2() {\n let e2;\n try {\n e2 = r3.read();\n } catch (e3) {\n return d(e3);\n }\n return m(e2, (e3) => {\n if (!t(e3)) throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");\n if (e3.done) wr(o3._readableStreamController);\n else {\n const t2 = e3.value;\n Rr(o3._readableStreamController, t2);\n }\n });\n }\n function i2(e2) {\n try {\n return c(r3.cancel(e2));\n } catch (e3) {\n return d(e3);\n }\n }\n return o3 = Dr(e, n2, i2, 0), o3;\n })(r2.getReader()) : (function(r3) {\n let o3;\n const n2 = me(r3, "async");\n function i2() {\n let e2;\n try {\n e2 = pe(n2);\n } catch (e3) {\n return d(e3);\n }\n return m(c(e2), (e3) => {\n if (!t(e3)) throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");\n if (e3.done) wr(o3._readableStreamController);\n else {\n const t2 = e3.value;\n Rr(o3._readableStreamController, t2);\n }\n });\n }\n function a2(e2) {\n const r4 = n2.iterator;\n let o4;\n try {\n o4 = he(r4, "return");\n } catch (e3) {\n return d(e3);\n }\n if (void 0 === o4) return c(void 0);\n return m(g(o4, r4, [e2]), (e3) => {\n if (!t(e3)) throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object");\n });\n }\n return o3 = Dr(e, i2, a2, 0), o3;\n })(r2);\n var o2;\n}\nfunction Br(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nfunction jr(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nfunction kr(e2, t2, r2) {\n return I(e2, r2), (r3) => S(e2, t2, [r3]);\n}\nfunction Ar(e2, t2) {\n if ("bytes" !== (e2 = `${e2}`)) throw new TypeError(`${t2} \'${e2}\' is not a valid enumeration value for ReadableStreamType`);\n return e2;\n}\nfunction zr(e2, t2) {\n L(e2, t2);\n const r2 = null == e2 ? void 0 : e2.preventAbort, o2 = null == e2 ? void 0 : e2.preventCancel, n2 = null == e2 ? void 0 : e2.preventClose, i2 = null == e2 ? void 0 : e2.signal;\n return void 0 !== i2 && (function(e3, t3) {\n if (!(function(e4) {\n if ("object" != typeof e4 || null === e4) return false;\n try {\n return "boolean" == typeof e4.aborted;\n } catch (e5) {\n return false;\n }\n })(e3)) throw new TypeError(`${t3} is not an AbortSignal.`);\n })(i2, `${t2} has member \'signal\' that`), { preventAbort: Boolean(r2), preventCancel: Boolean(o2), preventClose: Boolean(n2), signal: i2 };\n}\nObject.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), o(ReadableStreamDefaultController.prototype.close, "close"), o(ReadableStreamDefaultController.prototype.enqueue, "enqueue"), o(ReadableStreamDefaultController.prototype.error, "error"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultController", configurable: true });\nvar ReadableStream = class {\n constructor(e2 = {}, t2 = {}) {\n void 0 === e2 ? e2 = null : $(e2, "First parameter");\n const r2 = yt(t2, "Second parameter"), o2 = (function(e3, t3) {\n L(e3, t3);\n const r3 = e3, o3 = null == r3 ? void 0 : r3.autoAllocateChunkSize, n2 = null == r3 ? void 0 : r3.cancel, i2 = null == r3 ? void 0 : r3.pull, a2 = null == r3 ? void 0 : r3.start, s2 = null == r3 ? void 0 : r3.type;\n return { autoAllocateChunkSize: void 0 === o3 ? void 0 : N(o3, `${t3} has member \'autoAllocateChunkSize\' that`), cancel: void 0 === n2 ? void 0 : Br(n2, r3, `${t3} has member \'cancel\' that`), pull: void 0 === i2 ? void 0 : jr(i2, r3, `${t3} has member \'pull\' that`), start: void 0 === a2 ? void 0 : kr(a2, r3, `${t3} has member \'start\' that`), type: void 0 === s2 ? void 0 : Ar(s2, `${t3} has member \'type\' that`) };\n })(e2, "First parameter");\n if (Lr(this), "bytes" === o2.type) {\n if (void 0 !== r2.size) throw new RangeError("The strategy for a byte stream cannot have a size function");\n !(function(e3, t3, r3) {\n const o3 = Object.create(ReadableByteStreamController.prototype);\n let n2, i2, a2;\n n2 = void 0 !== t3.start ? () => t3.start(o3) : () => {\n }, i2 = void 0 !== t3.pull ? () => t3.pull(o3) : () => c(void 0), a2 = void 0 !== t3.cancel ? (e4) => t3.cancel(e4) : () => c(void 0);\n const s2 = t3.autoAllocateChunkSize;\n if (0 === s2) throw new TypeError("autoAllocateChunkSize must be greater than 0");\n rt(e3, o3, n2, i2, a2, r3, s2);\n })(this, o2, mt(r2, 0));\n } else {\n const e3 = pt(r2);\n !(function(e4, t3, r3, o3) {\n const n2 = Object.create(ReadableStreamDefaultController.prototype);\n let i2, a2, s2;\n i2 = void 0 !== t3.start ? () => t3.start(n2) : () => {\n }, a2 = void 0 !== t3.pull ? () => t3.pull(n2) : () => c(void 0), s2 = void 0 !== t3.cancel ? (e5) => t3.cancel(e5) : () => c(void 0), qr(e4, n2, i2, a2, s2, r3, o3);\n })(this, o2, mt(r2, 1), e3);\n }\n }\n get locked() {\n if (!Ir(this)) throw Qr("locked");\n return $r(this);\n }\n cancel(e2 = void 0) {\n return Ir(this) ? $r(this) ? d(new TypeError("Cannot cancel a stream that already has a reader")) : Mr(this, e2) : d(Qr("cancel"));\n }\n getReader(e2 = void 0) {\n if (!Ir(this)) throw Qr("getReader");\n return void 0 === (function(e3, t2) {\n L(e3, t2);\n const r2 = null == e3 ? void 0 : e3.mode;\n return { mode: void 0 === r2 ? void 0 : it(r2, `${t2} has member \'mode\' that`) };\n })(e2, "First parameter").mode ? V(this) : at(this);\n }\n pipeThrough(e2, t2 = {}) {\n if (!Ir(this)) throw Qr("pipeThrough");\n M(e2, 1, "pipeThrough");\n const r2 = (function(e3, t3) {\n L(e3, t3);\n const r3 = null == e3 ? void 0 : e3.readable;\n Y(r3, "readable", "ReadableWritablePair"), H(r3, `${t3} has member \'readable\' that`);\n const o3 = null == e3 ? void 0 : e3.writable;\n return Y(o3, "writable", "ReadableWritablePair"), Tt(o3, `${t3} has member \'writable\' that`), { readable: r3, writable: o3 };\n })(e2, "First parameter"), o2 = zr(t2, "Second parameter");\n if ($r(this)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");\n if (Et(r2.writable)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");\n return p(hr(this, r2.writable, o2.preventClose, o2.preventAbort, o2.preventCancel, o2.signal)), r2.readable;\n }\n pipeTo(e2, t2 = {}) {\n if (!Ir(this)) return d(Qr("pipeTo"));\n if (void 0 === e2) return d("Parameter 1 is required in \'pipeTo\'.");\n if (!qt(e2)) return d(new TypeError("ReadableStream.prototype.pipeTo\'s first argument must be a WritableStream"));\n let r2;\n try {\n r2 = zr(t2, "Second parameter");\n } catch (e3) {\n return d(e3);\n }\n return $r(this) ? d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : Et(e2) ? d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : hr(this, e2, r2.preventClose, r2.preventAbort, r2.preventCancel, r2.signal);\n }\n tee() {\n if (!Ir(this)) throw Qr("tee");\n return le(Wr(this));\n }\n values(e2 = void 0) {\n if (!Ir(this)) throw Qr("values");\n return (function(e3, t2) {\n const r2 = V(e3), o2 = new ye(r2, t2), n2 = Object.create(ge);\n return n2._asyncIteratorImpl = o2, n2;\n })(this, (function(e3, t2) {\n L(e3, t2);\n const r2 = null == e3 ? void 0 : e3.preventCancel;\n return { preventCancel: Boolean(r2) };\n })(e2, "First parameter").preventCancel);\n }\n [_e](e2) {\n return this.values(e2);\n }\n static from(e2) {\n return Or(e2);\n }\n};\nfunction Dr(e2, t2, r2, o2 = 1, n2 = () => 1) {\n const i2 = Object.create(ReadableStream.prototype);\n Lr(i2);\n return qr(i2, Object.create(ReadableStreamDefaultController.prototype), e2, t2, r2, o2, n2), i2;\n}\nfunction Fr(e2, t2, r2) {\n const o2 = Object.create(ReadableStream.prototype);\n Lr(o2);\n return rt(o2, Object.create(ReadableByteStreamController.prototype), e2, t2, r2, 0, void 0), o2;\n}\nfunction Lr(e2) {\n e2._state = "readable", e2._reader = void 0, e2._storedError = void 0, e2._disturbed = false;\n}\nfunction Ir(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_readableStreamController") && e2 instanceof ReadableStream);\n}\nfunction $r(e2) {\n return void 0 !== e2._reader;\n}\nfunction Mr(t2, r2) {\n if (t2._disturbed = true, "closed" === t2._state) return c(void 0);\n if ("errored" === t2._state) return d(t2._storedError);\n Yr(t2);\n const o2 = t2._reader;\n if (void 0 !== o2 && ft(o2)) {\n const e2 = o2._readIntoRequests;\n o2._readIntoRequests = new v(), e2.forEach((e3) => {\n e3._closeSteps(void 0);\n });\n }\n return m(t2._readableStreamController[T](r2), e);\n}\nfunction Yr(e2) {\n e2._state = "closed";\n const t2 = e2._reader;\n if (void 0 !== t2 && (z(t2), ee(t2))) {\n const e3 = t2._readRequests;\n t2._readRequests = new v(), e3.forEach((e4) => {\n e4._closeSteps();\n });\n }\n}\nfunction xr(e2, t2) {\n e2._state = "errored", e2._storedError = t2;\n const r2 = e2._reader;\n void 0 !== r2 && (A(r2, t2), ee(r2) ? oe(r2, t2) : bt(r2, t2));\n}\nfunction Qr(e2) {\n return new TypeError(`ReadableStream.prototype.${e2} can only be used on a ReadableStream`);\n}\nfunction Nr(e2, t2) {\n L(e2, t2);\n const r2 = null == e2 ? void 0 : e2.highWaterMark;\n return Y(r2, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: x(r2) };\n}\nObject.defineProperties(ReadableStream, { from: { enumerable: true } }), Object.defineProperties(ReadableStream.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), o(ReadableStream.from, "from"), o(ReadableStream.prototype.cancel, "cancel"), o(ReadableStream.prototype.getReader, "getReader"), o(ReadableStream.prototype.pipeThrough, "pipeThrough"), o(ReadableStream.prototype.pipeTo, "pipeTo"), o(ReadableStream.prototype.tee, "tee"), o(ReadableStream.prototype.values, "values"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ReadableStream.prototype, Symbol.toStringTag, { value: "ReadableStream", configurable: true }), Object.defineProperty(ReadableStream.prototype, _e, { value: ReadableStream.prototype.values, writable: true, configurable: true });\nvar Hr = (e2) => e2.byteLength;\no(Hr, "size");\nvar ByteLengthQueuingStrategy = class {\n constructor(e2) {\n M(e2, 1, "ByteLengthQueuingStrategy"), e2 = Nr(e2, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = e2.highWaterMark;\n }\n get highWaterMark() {\n if (!Ur(this)) throw Vr("highWaterMark");\n return this._byteLengthQueuingStrategyHighWaterMark;\n }\n get size() {\n if (!Ur(this)) throw Vr("size");\n return Hr;\n }\n};\nfunction Vr(e2) {\n return new TypeError(`ByteLengthQueuingStrategy.prototype.${e2} can only be used on a ByteLengthQueuingStrategy`);\n}\nfunction Ur(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_byteLengthQueuingStrategyHighWaterMark") && e2 instanceof ByteLengthQueuingStrategy);\n}\nObject.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true });\nvar Gr = () => 1;\no(Gr, "size");\nvar CountQueuingStrategy = class {\n constructor(e2) {\n M(e2, 1, "CountQueuingStrategy"), e2 = Nr(e2, "First parameter"), this._countQueuingStrategyHighWaterMark = e2.highWaterMark;\n }\n get highWaterMark() {\n if (!Jr(this)) throw Xr("highWaterMark");\n return this._countQueuingStrategyHighWaterMark;\n }\n get size() {\n if (!Jr(this)) throw Xr("size");\n return Gr;\n }\n};\nfunction Xr(e2) {\n return new TypeError(`CountQueuingStrategy.prototype.${e2} can only be used on a CountQueuingStrategy`);\n}\nfunction Jr(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_countQueuingStrategyHighWaterMark") && e2 instanceof CountQueuingStrategy);\n}\nfunction Kr(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nfunction Zr(e2, t2, r2) {\n return I(e2, r2), (r3) => S(e2, t2, [r3]);\n}\nfunction eo(e2, t2, r2) {\n return I(e2, r2), (r3, o2) => g(e2, t2, [r3, o2]);\n}\nfunction to(e2, t2, r2) {\n return I(e2, r2), (r3) => g(e2, t2, [r3]);\n}\nObject.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, { value: "CountQueuingStrategy", configurable: true });\nvar TransformStream = class {\n constructor(e2 = {}, t2 = {}, r2 = {}) {\n void 0 === e2 && (e2 = null);\n const o2 = yt(t2, "Second parameter"), n2 = yt(r2, "Third parameter"), i2 = (function(e3, t3) {\n L(e3, t3);\n const r3 = null == e3 ? void 0 : e3.cancel, o3 = null == e3 ? void 0 : e3.flush, n3 = null == e3 ? void 0 : e3.readableType, i3 = null == e3 ? void 0 : e3.start, a3 = null == e3 ? void 0 : e3.transform, s3 = null == e3 ? void 0 : e3.writableType;\n return { cancel: void 0 === r3 ? void 0 : to(r3, e3, `${t3} has member \'cancel\' that`), flush: void 0 === o3 ? void 0 : Kr(o3, e3, `${t3} has member \'flush\' that`), readableType: n3, start: void 0 === i3 ? void 0 : Zr(i3, e3, `${t3} has member \'start\' that`), transform: void 0 === a3 ? void 0 : eo(a3, e3, `${t3} has member \'transform\' that`), writableType: s3 };\n })(e2, "First parameter");\n if (void 0 !== i2.readableType) throw new RangeError("Invalid readableType specified");\n if (void 0 !== i2.writableType) throw new RangeError("Invalid writableType specified");\n const a2 = mt(n2, 0), s2 = pt(n2), l2 = mt(o2, 1), f2 = pt(o2);\n let b2;\n !(function(e3, t3, r3, o3, n3, i3) {\n function a3() {\n return t3;\n }\n function s3(t4) {\n return (function(e4, t5) {\n const r4 = e4._transformStreamController;\n if (e4._backpressure) {\n return m(e4._backpressureChangePromise, () => {\n const o4 = e4._writable;\n if ("erroring" === o4._state) throw o4._storedError;\n return co(r4, t5);\n });\n }\n return co(r4, t5);\n })(e3, t4);\n }\n function l3(t4) {\n return (function(e4, t5) {\n const r4 = e4._transformStreamController;\n if (void 0 !== r4._finishPromise) return r4._finishPromise;\n const o4 = e4._readable;\n r4._finishPromise = u((e5, t6) => {\n r4._finishPromise_resolve = e5, r4._finishPromise_reject = t6;\n });\n const n4 = r4._cancelAlgorithm(t5);\n return lo(r4), h(n4, () => ("errored" === o4._state ? bo(r4, o4._storedError) : (Tr(o4._readableStreamController, t5), ho(r4)), null), (e5) => (Tr(o4._readableStreamController, e5), bo(r4, e5), null)), r4._finishPromise;\n })(e3, t4);\n }\n function c2() {\n return (function(e4) {\n const t4 = e4._transformStreamController;\n if (void 0 !== t4._finishPromise) return t4._finishPromise;\n const r4 = e4._readable;\n t4._finishPromise = u((e5, r5) => {\n t4._finishPromise_resolve = e5, t4._finishPromise_reject = r5;\n });\n const o4 = t4._flushAlgorithm();\n return lo(t4), h(o4, () => ("errored" === r4._state ? bo(t4, r4._storedError) : (wr(r4._readableStreamController), ho(t4)), null), (e5) => (Tr(r4._readableStreamController, e5), bo(t4, e5), null)), t4._finishPromise;\n })(e3);\n }\n function d2() {\n return (function(e4) {\n return ao(e4, false), e4._backpressureChangePromise;\n })(e3);\n }\n function f3(t4) {\n return (function(e4, t5) {\n const r4 = e4._transformStreamController;\n if (void 0 !== r4._finishPromise) return r4._finishPromise;\n const o4 = e4._writable;\n r4._finishPromise = u((e5, t6) => {\n r4._finishPromise_resolve = e5, r4._finishPromise_reject = t6;\n });\n const n4 = r4._cancelAlgorithm(t5);\n return lo(r4), h(n4, () => ("errored" === o4._state ? bo(r4, o4._storedError) : (Gt(o4._writableStreamController, t5), io(e4), ho(r4)), null), (t6) => (Gt(o4._writableStreamController, t6), io(e4), bo(r4, t6), null)), r4._finishPromise;\n })(e3, t4);\n }\n e3._writable = (function(e4, t4, r4, o4, n4 = 1, i4 = () => 1) {\n const a4 = Object.create(WritableStream.prototype);\n return Ct(a4), Nt(a4, Object.create(WritableStreamDefaultController.prototype), e4, t4, r4, o4, n4, i4), a4;\n })(a3, s3, c2, l3, r3, o3), e3._readable = Dr(a3, d2, f3, n3, i3), e3._backpressure = void 0, e3._backpressureChangePromise = void 0, e3._backpressureChangePromise_resolve = void 0, ao(e3, true), e3._transformStreamController = void 0;\n })(this, u((e3) => {\n b2 = e3;\n }), l2, f2, a2, s2), (function(e3, t3) {\n const r3 = Object.create(TransformStreamDefaultController.prototype);\n let o3, n3, i3;\n o3 = void 0 !== t3.transform ? (e4) => t3.transform(e4, r3) : (e4) => {\n try {\n return uo(r3, e4), c(void 0);\n } catch (e5) {\n return d(e5);\n }\n };\n n3 = void 0 !== t3.flush ? () => t3.flush(r3) : () => c(void 0);\n i3 = void 0 !== t3.cancel ? (e4) => t3.cancel(e4) : () => c(void 0);\n !(function(e4, t4, r4, o4, n4) {\n t4._controlledTransformStream = e4, e4._transformStreamController = t4, t4._transformAlgorithm = r4, t4._flushAlgorithm = o4, t4._cancelAlgorithm = n4, t4._finishPromise = void 0, t4._finishPromise_resolve = void 0, t4._finishPromise_reject = void 0;\n })(e3, r3, o3, n3, i3);\n })(this, i2), void 0 !== i2.start ? b2(i2.start(this._transformStreamController)) : b2(void 0);\n }\n get readable() {\n if (!ro(this)) throw _o("readable");\n return this._readable;\n }\n get writable() {\n if (!ro(this)) throw _o("writable");\n return this._writable;\n }\n};\nfunction ro(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_transformStreamController") && e2 instanceof TransformStream);\n}\nfunction oo(e2, t2) {\n Tr(e2._readable._readableStreamController, t2), no(e2, t2);\n}\nfunction no(e2, t2) {\n lo(e2._transformStreamController), Gt(e2._writable._writableStreamController, t2), io(e2);\n}\nfunction io(e2) {\n e2._backpressure && ao(e2, false);\n}\nfunction ao(e2, t2) {\n void 0 !== e2._backpressureChangePromise && e2._backpressureChangePromise_resolve(), e2._backpressureChangePromise = u((t3) => {\n e2._backpressureChangePromise_resolve = t3;\n }), e2._backpressure = t2;\n}\nObject.defineProperties(TransformStream.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, { value: "TransformStream", configurable: true });\nvar TransformStreamDefaultController = class {\n constructor() {\n throw new TypeError("Illegal constructor");\n }\n get desiredSize() {\n if (!so(this)) throw fo("desiredSize");\n return Pr(this._controlledTransformStream._readable._readableStreamController);\n }\n enqueue(e2 = void 0) {\n if (!so(this)) throw fo("enqueue");\n uo(this, e2);\n }\n error(e2 = void 0) {\n if (!so(this)) throw fo("error");\n var t2;\n t2 = e2, oo(this._controlledTransformStream, t2);\n }\n terminate() {\n if (!so(this)) throw fo("terminate");\n !(function(e2) {\n const t2 = e2._controlledTransformStream;\n wr(t2._readable._readableStreamController);\n const r2 = new TypeError("TransformStream terminated");\n no(t2, r2);\n })(this);\n }\n};\nfunction so(e2) {\n return !!t(e2) && (!!Object.prototype.hasOwnProperty.call(e2, "_controlledTransformStream") && e2 instanceof TransformStreamDefaultController);\n}\nfunction lo(e2) {\n e2._transformAlgorithm = void 0, e2._flushAlgorithm = void 0, e2._cancelAlgorithm = void 0;\n}\nfunction uo(e2, t2) {\n const r2 = e2._controlledTransformStream, o2 = r2._readable._readableStreamController;\n if (!Cr(o2)) throw new TypeError("Readable side is not in a state that permits enqueue");\n try {\n Rr(o2, t2);\n } catch (e3) {\n throw no(r2, e3), r2._readable._storedError;\n }\n const n2 = (function(e3) {\n return !gr(e3);\n })(o2);\n n2 !== r2._backpressure && ao(r2, true);\n}\nfunction co(e2, t2) {\n return m(e2._transformAlgorithm(t2), void 0, (t3) => {\n throw oo(e2._controlledTransformStream, t3), t3;\n });\n}\nfunction fo(e2) {\n return new TypeError(`TransformStreamDefaultController.prototype.${e2} can only be used on a TransformStreamDefaultController`);\n}\nfunction ho(e2) {\n void 0 !== e2._finishPromise_resolve && (e2._finishPromise_resolve(), e2._finishPromise_resolve = void 0, e2._finishPromise_reject = void 0);\n}\nfunction bo(e2, t2) {\n void 0 !== e2._finishPromise_reject && (p(e2._finishPromise), e2._finishPromise_reject(t2), e2._finishPromise_resolve = void 0, e2._finishPromise_reject = void 0);\n}\nfunction _o(e2) {\n return new TypeError(`TransformStream.prototype.${e2} can only be used on a TransformStream`);\n}\nObject.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), o(TransformStreamDefaultController.prototype.enqueue, "enqueue"), o(TransformStreamDefaultController.prototype.error, "error"), o(TransformStreamDefaultController.prototype.terminate, "terminate"), "symbol" == typeof Symbol.toStringTag && Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, { value: "TransformStreamDefaultController", configurable: true });\n\n// src/rune/isolation/utils-bootstrap.js\nvar import_buffer = __toESM(require_buffer(), 1);\nvar __vars = JSON.parse($__vars);\nvar __os = Object.freeze(JSON.parse($__os));\nvar __stdinIsTTY = Boolean($__stdin_is_tty);\nglobalThis.ReadableStream = ReadableStream;\nglobalThis.WritableStream = WritableStream;\nglobalThis.TransformStream = TransformStream;\nglobalThis.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;\nglobalThis.CountQueuingStrategy = CountQueuingStrategy;\nvar EventTarget = class {\n constructor() {\n this._listeners = {};\n }\n addEventListener(type, fn) {\n (this._listeners[type] ??= []).push(fn);\n }\n removeEventListener(type, fn) {\n this._listeners[type] = (this._listeners[type] ?? []).filter((f2) => f2 !== fn);\n }\n dispatchEvent(event) {\n for (const fn of this._listeners[event.type] ?? []) fn.call(this, event);\n return true;\n }\n};\nvar Event = class {\n constructor(type, init = {}) {\n this.type = type;\n this.bubbles = !!init.bubbles;\n this.cancelable = !!init.cancelable;\n this.defaultPrevented = false;\n }\n preventDefault() {\n if (this.cancelable) this.defaultPrevented = true;\n }\n};\nvar CustomEvent = class extends Event {\n constructor(type, init = {}) {\n super(type, init);\n this.detail = init.detail ?? null;\n }\n};\nglobalThis.EventTarget = EventTarget;\nglobalThis.Event = Event;\nglobalThis.CustomEvent = CustomEvent;\nvar AbortSignal = class extends EventTarget {\n constructor() {\n super();\n this.aborted = false;\n this.reason = void 0;\n }\n _abort(reason) {\n if (this.aborted) return;\n this.aborted = true;\n this.reason = reason ?? new Error("AbortError");\n this.dispatchEvent(new Event("abort"));\n }\n throwIfAborted() {\n if (this.aborted) throw this.reason;\n }\n};\nvar AbortController2 = class {\n constructor() {\n this.signal = new AbortSignal();\n }\n abort(reason) {\n this.signal._abort(reason);\n }\n};\nAbortSignal.abort = (reason) => {\n const s2 = new AbortSignal();\n s2._abort(reason);\n return s2;\n};\nAbortSignal.timeout = (ms) => {\n const ctrl = new AbortController2();\n setTimeout(() => ctrl.abort(), ms);\n return ctrl.signal;\n};\nglobalThis.TextEncoder = import_fast_text_encoding.TextEncoder;\nglobalThis.TextDecoder = import_fast_text_encoding.TextDecoder;\nglobalThis.AbortController = AbortController2;\nglobalThis.AbortSignal = AbortSignal;\nvar Blob2 = class _Blob {\n constructor(parts = [], { type = "" } = {}) {\n this.type = type;\n const chunks = [];\n for (const part of parts) {\n if (typeof part === "string") {\n chunks.push(new import_fast_text_encoding.TextEncoder().encode(part));\n } else if (part instanceof Uint8Array) {\n chunks.push(part);\n } else if (part instanceof _Blob) {\n chunks.push(part._bytes);\n } else if (part instanceof ArrayBuffer) {\n chunks.push(new Uint8Array(part));\n } else {\n chunks.push(new import_fast_text_encoding.TextEncoder().encode(String(part)));\n }\n }\n let totalLen = 0;\n for (const c2 of chunks) totalLen += c2.length;\n const combined = new Uint8Array(totalLen);\n let offset = 0;\n for (const c2 of chunks) {\n combined.set(c2, offset);\n offset += c2.length;\n }\n this._bytes = combined;\n }\n get size() {\n return this._bytes.length;\n }\n async text() {\n return new import_fast_text_encoding.TextDecoder().decode(this._bytes);\n }\n async arrayBuffer() {\n return this._bytes.buffer.slice(this._bytes.byteOffset, this._bytes.byteOffset + this._bytes.byteLength);\n }\n slice(start = 0, end = this._bytes.length, contentType = "") {\n return new _Blob([this._bytes.slice(start, end)], { type: contentType });\n }\n};\nglobalThis.Blob = Blob2;\nvar Headers = class _Headers {\n constructor(init) {\n this._map = /* @__PURE__ */ new Map();\n if (init instanceof _Headers) {\n for (const [k2, v2] of init._map) this._map.set(k2, v2);\n } else if (Array.isArray(init)) {\n for (const [k2, v2] of init) this._map.set(k2.toLowerCase(), v2);\n } else if (init && typeof init === "object") {\n for (const [k2, v2] of Object.entries(init)) this._map.set(k2.toLowerCase(), String(v2));\n }\n }\n get(name) {\n return this._map.get(name.toLowerCase()) ?? null;\n }\n set(name, value) {\n this._map.set(name.toLowerCase(), String(value));\n }\n has(name) {\n return this._map.has(name.toLowerCase());\n }\n append(name, value) {\n const key = name.toLowerCase();\n const existing = this._map.get(key);\n this._map.set(key, existing != null ? `${existing}, ${value}` : String(value));\n }\n delete(name) {\n this._map.delete(name.toLowerCase());\n }\n entries() {\n return this._map.entries();\n }\n keys() {\n return this._map.keys();\n }\n values() {\n return this._map.values();\n }\n forEach(fn) {\n this._map.forEach((v2, k2) => fn(v2, k2));\n }\n [Symbol.iterator]() {\n return this._map.entries();\n }\n};\nglobalThis.Headers = Headers;\nvar FormData = class {\n constructor() {\n this._entries = [];\n }\n append(name, value, filename) {\n this._entries.push({ name, value, filename });\n }\n get(name) {\n const entry = this._entries.find((e2) => e2.name === name);\n return entry ? entry.value : null;\n }\n getAll(name) {\n return this._entries.filter((e2) => e2.name === name).map((e2) => e2.value);\n }\n has(name) {\n return this._entries.some((e2) => e2.name === name);\n }\n set(name, value, filename) {\n const idx = this._entries.findIndex((e2) => e2.name === name);\n if (idx !== -1) {\n this._entries.splice(idx, 1, { name, value, filename });\n } else {\n this._entries.push({ name, value, filename });\n }\n }\n delete(name) {\n this._entries = this._entries.filter((e2) => e2.name !== name);\n }\n entries() {\n return this._entries.map((e2) => [e2.name, e2.value])[Symbol.iterator]();\n }\n _toWire() {\n const boundary = "----CrunesFormBoundary" + Math.random().toString(36).slice(2);\n const parts = this._entries.map((e2) => ({\n name: e2.name,\n filename: e2.filename ?? null,\n value: e2.value instanceof Blob2 ? { type: "Buffer", data: Array.from(e2.value._bytes), contentType: e2.value.type || "application/octet-stream" } : e2.value instanceof Uint8Array ? { type: "Buffer", data: Array.from(e2.value), contentType: "application/octet-stream" } : e2.value\n }));\n return { type: "FormData", boundary, parts };\n }\n};\nglobalThis.FormData = FormData;\nvar URLSearchParams = class {\n constructor(init) {\n this._params = [];\n if (typeof init === "string") {\n const s2 = init.startsWith("?") ? init.slice(1) : init;\n for (const pair of s2.split("&")) {\n if (!pair) continue;\n const eq = pair.indexOf("=");\n if (eq === -1) {\n this._params.push([decodeURIComponent(pair), ""]);\n } else {\n this._params.push([decodeURIComponent(pair.slice(0, eq)), decodeURIComponent(pair.slice(eq + 1))]);\n }\n }\n } else if (Array.isArray(init)) {\n for (const [k2, v2] of init) this._params.push([String(k2), String(v2)]);\n } else if (init && typeof init === "object") {\n for (const [k2, v2] of Object.entries(init)) this._params.push([k2, String(v2)]);\n }\n }\n append(name, value) {\n this._params.push([name, String(value)]);\n }\n delete(name) {\n this._params = this._params.filter(([k2]) => k2 !== name);\n }\n get(name) {\n return (this._params.find(([k2]) => k2 === name) ?? [null, null])[1];\n }\n getAll(name) {\n return this._params.filter(([k2]) => k2 === name).map(([, v2]) => v2);\n }\n has(name) {\n return this._params.some(([k2]) => k2 === name);\n }\n set(name, value) {\n const idx = this._params.findIndex(([k2]) => k2 === name);\n if (idx !== -1) {\n this._params = this._params.filter(([k2]) => k2 !== name);\n this._params.splice(idx, 0, [name, String(value)]);\n } else {\n this._params.push([name, String(value)]);\n }\n }\n toString() {\n return this._params.map(([k2, v2]) => `${encodeURIComponent(k2)}=${encodeURIComponent(v2)}`).join("&");\n }\n entries() {\n return this._params[Symbol.iterator]();\n }\n keys() {\n return this._params.map(([k2]) => k2)[Symbol.iterator]();\n }\n values() {\n return this._params.map(([, v2]) => v2)[Symbol.iterator]();\n }\n [Symbol.iterator]() {\n return this._params[Symbol.iterator]();\n }\n};\nglobalThis.URLSearchParams = URLSearchParams;\nvar URL2 = class _URL {\n constructor(input, base) {\n const str = String(input);\n let full = str;\n if (base !== void 0) {\n const b2 = base instanceof _URL ? base.href : String(base);\n if (/^https?:\\/\\//i.test(str)) {\n full = str;\n } else if (str.startsWith("//")) {\n full = b2.match(/^https?:/i)?.[0] + str;\n } else if (str.startsWith("/")) {\n full = b2.replace(/^(https?:\\/\\/[^/]+).*/i, "$1") + str;\n } else {\n full = b2.replace(/[^/]*$/, "") + str;\n }\n }\n const m2 = full.match(/^([a-z][a-z0-9+\\-.]*):\\/\\/([^/?#]*)([^?#]*)(\\?[^#]*)?(#.*)?$/i);\n if (!m2) throw new TypeError(`Invalid URL: ${str}`);\n this._protocol = m2[1].toLowerCase() + ":";\n const host = m2[2] || "";\n const ci = host.indexOf(":");\n this._hostname = ci === -1 ? host : host.slice(0, ci);\n this._port = ci === -1 ? "" : host.slice(ci + 1);\n this._pathname = m2[3] || "/";\n this._search = m2[4] || "";\n this._hash = m2[5] || "";\n this._searchParams = new URLSearchParams(this._search);\n }\n get protocol() {\n return this._protocol;\n }\n get hostname() {\n return this._hostname;\n }\n get port() {\n return this._port;\n }\n get host() {\n return this._port ? `${this._hostname}:${this._port}` : this._hostname;\n }\n get pathname() {\n return this._pathname;\n }\n get search() {\n return this._searchParams.toString() ? "?" + this._searchParams.toString() : "";\n }\n get searchParams() {\n return this._searchParams;\n }\n get hash() {\n return this._hash;\n }\n get origin() {\n return `${this._protocol}//${this.host}`;\n }\n get href() {\n return `${this._protocol}//${this.host}${this._pathname}${this.search}${this._hash}`;\n }\n toString() {\n return this.href;\n }\n toJSON() {\n return this.href;\n }\n};\nglobalThis.URL = URL2;\nvar TextEncoderStream = class {\n constructor() {\n const encoder = new import_fast_text_encoding.TextEncoder();\n const transform = new TransformStream({\n transform(chunk, controller) {\n controller.enqueue(encoder.encode(chunk));\n }\n });\n this.readable = transform.readable;\n this.writable = transform.writable;\n }\n};\nvar TextDecoderStream = class {\n constructor(label = "utf-8", options = {}) {\n const decoder = new import_fast_text_encoding.TextDecoder(label, options);\n const transform = new TransformStream({\n transform(chunk, controller) {\n controller.enqueue(decoder.decode(chunk));\n },\n flush(controller) {\n const remaining = decoder.decode(new Uint8Array(0));\n if (remaining) controller.enqueue(remaining);\n }\n });\n this.readable = transform.readable;\n this.writable = transform.writable;\n }\n};\nglobalThis.TextEncoderStream = TextEncoderStream;\nglobalThis.TextDecoderStream = TextDecoderStream;\nglobalThis.structuredClone = (val) => JSON.parse(JSON.stringify(val));\nglobalThis.queueMicrotask = (fn) => Promise.resolve().then(fn);\nglobalThis.btoa = (str) => import_buffer.Buffer.from(str, "binary").toString("base64");\nglobalThis.atob = (b64) => import_buffer.Buffer.from(b64, "base64").toString("binary");\nglobalThis.performance = { now: () => $__performance_now.applySync(void 0, []) };\nglobalThis.Buffer = import_buffer.Buffer;\nvar Request = class _Request {\n constructor(input, init = {}) {\n if (input instanceof _Request) {\n this.url = input.url;\n this.method = input.method;\n this.headers = new Headers(input.headers);\n this._body = input._body;\n this._bodyUsed = false;\n } else {\n this.url = String(input);\n this.method = (init.method ?? "GET").toUpperCase();\n this.headers = new Headers(init.headers);\n this._body = init.body ?? null;\n this._bodyUsed = false;\n }\n if (init.method) this.method = init.method.toUpperCase();\n if (init.headers) {\n for (const [k2, v2] of new Headers(init.headers)) this.headers.set(k2, v2);\n }\n if (init.body !== void 0) {\n this._body = init.body;\n this._bodyUsed = false;\n }\n }\n get body() {\n if (this._body instanceof ReadableStream) return this._body;\n if (this._body == null) return null;\n const bytes = this._body instanceof Blob2 ? this._body._bytes : this._body instanceof Uint8Array ? this._body : new import_fast_text_encoding.TextEncoder().encode(String(this._body));\n return new ReadableStream({ start(c2) {\n c2.enqueue(bytes);\n c2.close();\n } });\n }\n get bodyUsed() {\n return this._bodyUsed;\n }\n _consume() {\n if (this._body != null && this._bodyUsed) throw new TypeError("body already used");\n if (this._body != null) this._bodyUsed = true;\n }\n async text() {\n this._consume();\n if (this._body == null) return "";\n if (this._body instanceof Blob2) return this._body.text();\n if (this._body instanceof Uint8Array) return new import_fast_text_encoding.TextDecoder().decode(this._body);\n return String(this._body);\n }\n async json() {\n return JSON.parse(await this.text());\n }\n async blob() {\n this._consume();\n if (this._body == null) return new Blob2([], { type: "" });\n if (this._body instanceof Blob2) return this._body;\n if (this._body instanceof Uint8Array) return new Blob2([this._body]);\n return new Blob2([new import_fast_text_encoding.TextEncoder().encode(String(this._body))]);\n }\n};\nglobalThis.Request = Request;\nvar Response = class {\n constructor(body = null, init = {}) {\n this.status = init.status ?? 200;\n this.statusText = init.statusText ?? "";\n this.headers = new Headers(init.headers);\n this.ok = this.status >= 200 && this.status < 300;\n this._body = body ?? null;\n this._bodyUsed = false;\n }\n get bodyUsed() {\n return this._bodyUsed;\n }\n get body() {\n if (this._body == null) return null;\n if (this._body instanceof ReadableStream) return this._body;\n const bytes = this._body instanceof Blob2 ? this._body._bytes : this._body instanceof Uint8Array ? this._body : new import_fast_text_encoding.TextEncoder().encode(String(this._body));\n return new ReadableStream({ start(c2) {\n c2.enqueue(bytes);\n c2.close();\n } });\n }\n _consume() {\n if (this._bodyUsed) throw new TypeError("body already used");\n this._bodyUsed = true;\n }\n async text() {\n this._consume();\n if (this._body == null) return "";\n if (this._body instanceof Blob2) return this._body.text();\n if (this._body instanceof Uint8Array) return new import_fast_text_encoding.TextDecoder().decode(this._body);\n if (this._body instanceof ReadableStream) {\n const reader = this._body.getReader();\n const chunks = [];\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n const total = new Uint8Array(chunks.reduce((n2, c2) => n2 + c2.byteLength, 0));\n let offset = 0;\n for (const c2 of chunks) {\n total.set(c2, offset);\n offset += c2.byteLength;\n }\n return new import_fast_text_encoding.TextDecoder().decode(total);\n }\n return String(this._body);\n }\n async json() {\n return JSON.parse(await this.text());\n }\n async blob() {\n this._consume();\n if (this._body == null) return new Blob2([], { type: "" });\n if (this._body instanceof Blob2) return this._body;\n if (this._body instanceof Uint8Array) return new Blob2([this._body]);\n return new Blob2([new import_fast_text_encoding.TextEncoder().encode(String(this._body))]);\n }\n};\nglobalThis.Response = Response;\nfunction _makeResponse(meta, responseHeaders, bytesPromise, bodyStream, consumeGuard) {\n return {\n get ok() {\n return meta.ok;\n },\n get status() {\n return meta.status;\n },\n get statusText() {\n return meta.statusText;\n },\n get headers() {\n return responseHeaders;\n },\n get bodyUsed() {\n return false;\n },\n async text() {\n consumeGuard();\n const bytes = await bytesPromise;\n return new import_fast_text_encoding.TextDecoder().decode(bytes);\n },\n async json() {\n consumeGuard();\n const bytes = await bytesPromise;\n return JSON.parse(new import_fast_text_encoding.TextDecoder().decode(bytes));\n },\n async blob() {\n consumeGuard();\n const bytes = await bytesPromise;\n const contentType = responseHeaders.get("content-type") ?? "";\n return new Blob2([bytes], { type: contentType });\n },\n get body() {\n consumeGuard();\n return bodyStream;\n }\n };\n}\nfunction _makeShellSession(cmd, o2, binaryMode) {\n const id = $__utils_shell_spawn_open.applySync(void 0, [cmd, o2], { arguments: { copy: true } });\n const createHybridReadable = (streamType, binary) => {\n let controller;\n const listeners = [];\n const stream = new ReadableStream({\n start(c2) {\n controller = c2;\n }\n });\n stream.on = (event, callback) => {\n listeners.push({ event, callback });\n };\n const handleData = (ab) => {\n const chunk = binary ? new Uint8Array(ab) : new import_fast_text_encoding.TextDecoder().decode(ab);\n if (controller) {\n try {\n controller.enqueue(chunk);\n } catch (e2) {\n }\n }\n for (const l2 of listeners) {\n if (l2.event === "data") l2.callback(chunk);\n }\n };\n const handleEnd = () => {\n if (controller) {\n try {\n controller.close();\n } catch (e2) {\n }\n }\n for (const l2 of listeners) {\n if (l2.event === "end") l2.callback();\n }\n };\n $__utils_shell_spawn_on.applySync(void 0, [id, streamType, "data", handleData], { arguments: { reference: true } });\n $__utils_shell_spawn_on.applySync(void 0, [id, streamType, "end", handleEnd], { arguments: { reference: true } });\n return stream;\n };\n const stdoutStream = createHybridReadable("stdout", binaryMode);\n const stderrStream = createHybridReadable("stderr", false);\n const stdinStream = new WritableStream({\n async write(chunk) {\n let rawChunk = chunk;\n if (rawChunk instanceof Uint8Array) rawChunk = rawChunk.buffer;\n await $__utils_shell_spawn_write.apply(void 0, [id, rawChunk], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n await $__utils_shell_spawn_end.apply(void 0, [id], { result: { promise: true } });\n }\n });\n stdinStream.write = (text) => {\n let rawChunk = text;\n if (rawChunk instanceof Uint8Array) rawChunk = rawChunk.buffer;\n $__utils_shell_spawn_write.applySync(void 0, [id, rawChunk], { arguments: { copy: true } });\n };\n stdinStream.end = () => {\n $__utils_shell_spawn_end.applySync(void 0, [id]);\n };\n const session = {\n stdin: stdinStream,\n stdout: stdoutStream,\n stderr: stderrStream,\n on(event, callback) {\n $__utils_shell_spawn_on.applySync(void 0, [id, "session", event, callback], { arguments: { reference: true } });\n },\n open: () => $__utils_shell_spawn_start.applySync(void 0, [id]),\n kill: (signal) => $__utils_shell_spawn_kill.applySync(void 0, [id, signal ?? null])\n };\n if (o2 && o2.signal) {\n o2.signal.addEventListener("abort", () => session.kill("SIGTERM"));\n }\n return session;\n}\nglobalThis.crypto = {\n randomUUID: () => $__webcrypto_random_uuid.applySync(void 0, []),\n getRandomValues(array) {\n const buf = $__webcrypto_get_random_values.applySync(void 0, [array.buffer], { arguments: { copy: true }, result: { copy: true } });\n array.set(new array.constructor(buf));\n return array;\n },\n subtle: {\n digest: (alg, data) => {\n const buf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_digest.apply(void 0, [alg, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n sign: (alg, key, data) => {\n const buf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_sign.apply(void 0, [alg, key, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n verify: (alg, key, sig, data) => {\n const sigBuf = sig instanceof ArrayBuffer ? sig : sig.buffer;\n const dataBuf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_verify.apply(void 0, [alg, key, sigBuf, dataBuf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n encrypt: (alg, key, data) => {\n const buf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_encrypt.apply(void 0, [alg, key, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n decrypt: (alg, key, data) => {\n const buf = data instanceof ArrayBuffer ? data : data.buffer;\n return $__webcrypto_subtle_decrypt.apply(void 0, [alg, key, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n generateKey: (alg, extractable, usages) => $__webcrypto_subtle_generate_key.apply(void 0, [alg, extractable, usages], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n importKey: (format, keyData, alg, extractable, usages) => {\n const data = keyData instanceof ArrayBuffer ? keyData : ArrayBuffer.isView(keyData) ? keyData.buffer : keyData;\n return $__webcrypto_subtle_import_key.apply(void 0, [format, data, alg, extractable, usages], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n exportKey: (format, key) => $__webcrypto_subtle_export_key.apply(void 0, [format, key], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n deriveKey: (alg, baseKey, derivedAlg, extractable, usages) => $__webcrypto_subtle_derive_key.apply(void 0, [alg, baseKey, derivedAlg, extractable, usages], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n deriveBits: (alg, baseKey, length) => $__webcrypto_subtle_derive_bits.apply(void 0, [alg, baseKey, length], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n wrapKey: (format, key, wrappingKey, wrapAlg) => $__webcrypto_subtle_wrap_key.apply(void 0, [format, key, wrappingKey, wrapAlg], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n unwrapKey: (format, wrappedData, unwrappingKey, unwrapAlg, unwrappedAlg, extractable, usages) => {\n const buf = wrappedData instanceof ArrayBuffer ? wrappedData : wrappedData.buffer;\n return $__webcrypto_subtle_unwrap_key.apply(void 0, [format, buf, unwrappingKey, unwrapAlg, unwrappedAlg, extractable, usages], { arguments: { copy: true }, result: { promise: true, copy: true } });\n }\n }\n};\nglobalThis.utils = {\n fs: {\n cwd: () => $__projectDir,\n resolve: (p2) => $__utils_fs_resolve.apply(void 0, [p2], { result: { promise: true, copy: true } }),\n read: (p2, o2) => $__utils_fs_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n exists: (p2) => $__utils_fs_exists.apply(void 0, [p2], { result: { promise: true } }),\n glob: (p2, o2) => $__utils_fs_glob.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, c2) => $__utils_fs_write.apply(void 0, [p2, c2], { arguments: { copy: true }, result: { promise: true } }),\n copy: (src, dest) => $__utils_fs_copy.apply(void 0, [src, dest], { result: { promise: true } }),\n remove: (path, opts) => $__utils_fs_remove.apply(void 0, [path, opts], { arguments: { copy: true }, result: { promise: true } }),\n move: (src, dest) => $__utils_fs_move.apply(void 0, [src, dest], { result: { promise: true } }),\n stat: (path) => $__utils_fs_stat.apply(void 0, [path], { result: { promise: true, copy: true } }),\n mkdir: (path) => $__utils_fs_mkdir.apply(void 0, [path], { result: { promise: true } }),\n readBytes: async (path, opts) => {\n const ab = await $__utils_fs_read_bytes.apply(void 0, [path, opts], { arguments: { copy: true }, result: { promise: true, copy: true } });\n return ab ? new Uint8Array(ab) : null;\n },\n readBytesStream: (path) => {\n let streamId = null;\n return new ReadableStream({\n async start() {\n streamId = await $__utils_fs_readStream.apply(void 0, [path], { result: { promise: true } });\n },\n async pull(controller) {\n const ab = await $__utils_fs_readStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (ab === null) controller.close();\n else controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n readStream: (path) => {\n return globalThis.utils.fs.readBytesStream(path).pipeThrough(new TextDecoderStream());\n },\n readLinesStream: (path, opts) => {\n let streamId = null;\n return new ReadableStream({\n async start() {\n streamId = await $__utils_fs_readLines.apply(void 0, [path, opts], { arguments: { copy: true }, result: { promise: true } });\n },\n async pull(controller) {\n const lines = await $__utils_fs_readLines_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (lines === null) controller.close();\n else for (const line of lines) controller.enqueue(line);\n },\n async cancel() {\n if (streamId !== null) await $__utils_fs_readLines_cancel.apply(void 0, [streamId], { result: { promise: true } });\n }\n });\n },\n writeBytesStream: (path) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_fs_writeStream.apply(void 0, [path], { result: { promise: true } });\n },\n async write(chunk) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("writeBytesStream requires Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(void 0, [streamId, chunk.buffer, chunk.byteOffset, chunk.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n },\n async abort() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n }\n });\n },\n writeStream: (path) => {\n const wsBytes = globalThis.utils.fs.writeBytesStream(path);\n const writer = wsBytes.getWriter();\n const encoder = new import_fast_text_encoding.TextEncoder();\n return new WritableStream({\n async write(chunk) {\n await writer.write(encoder.encode(chunk));\n },\n async close() {\n await writer.close();\n },\n async abort(reason) {\n await writer.abort(reason);\n }\n });\n },\n writeBytes: (path, content) => {\n if (!(content instanceof Uint8Array)) throw new TypeError("writeBytes requires a Uint8Array");\n return $__utils_fs_write_bytes.apply(void 0, [path, content.buffer, content.byteOffset, content.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n append: (p2, c2) => $__utils_fs_append.apply(void 0, [p2, c2], { arguments: { copy: true }, result: { promise: true } }),\n appendBytes: async (p2, content) => {\n if (!(content instanceof Uint8Array)) throw new TypeError("appendBytes requires a Uint8Array");\n return $__utils_fs_append_bytes.apply(void 0, [p2, content.buffer, content.byteOffset, content.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n appendBytesStream: (path) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_fs_appendStream.apply(void 0, [path], { result: { promise: true } });\n },\n async write(chunk) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("appendBytesStream requires Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(void 0, [streamId, chunk.buffer, chunk.byteOffset, chunk.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n },\n async abort() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n }\n });\n },\n chmod: (p2, mode) => $__utils_fs_chmod.apply(void 0, [p2, mode], { arguments: { copy: true }, result: { promise: true } }),\n prepend: (p2, c2) => $__utils_fs_prepend.apply(void 0, [p2, c2], { arguments: { copy: true }, result: { promise: true } }),\n watch: (pattern, callback, opts) => {\n const id = $__utils_fs_watch.applySync(void 0, [pattern, callback, opts ?? {}], { arguments: { reference: true } });\n return {\n stop: () => $__utils_fs_watch_stop.applySync(void 0, [id])\n };\n },\n replace: async (p2, regex, replacement) => {\n const content = await globalThis.utils.fs.read(p2);\n const newContent = content.replace(regex, replacement);\n await globalThis.utils.fs.write(p2, newContent);\n }\n },\n shell: {\n exec: async (cmd, o2) => {\n let stdinStreamId = null;\n let opts = { ...o2 };\n const hasStdinStream = o2 && o2.stdin && typeof o2.stdin.getReader === "function";\n if (hasStdinStream) {\n stdinStreamId = "shell_stdin_" + Math.random().toString(36).slice(2);\n delete opts.stdin;\n } else if (o2 && o2.stdin instanceof Uint8Array) {\n opts.stdin = { type: "Buffer", data: Array.from(o2.stdin) };\n } else if (o2 && o2.stdin && typeof o2.stdin === "object" && o2.stdin.buffer) {\n opts.stdin = { type: "Buffer", data: Array.from(new Uint8Array(o2.stdin.buffer)) };\n }\n const promise = $__utils_shell_exec.apply(\n void 0,\n [cmd, opts, stdinStreamId],\n { arguments: { copy: true }, result: { promise: true, copy: true } }\n );\n if (hasStdinStream) {\n const reader = o2.stdin.getReader();\n const pump = async () => {\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n let chunk = value;\n if (typeof chunk === "string") {\n chunk = new import_fast_text_encoding.TextEncoder().encode(chunk);\n }\n if (!(chunk instanceof Uint8Array)) {\n throw new TypeError("stdin stream must yield string or Uint8Array chunks");\n }\n await $__utils_fs_writeStream_write.apply(\n void 0,\n [stdinStreamId, chunk.buffer, chunk.byteOffset, chunk.byteLength],\n { arguments: { copy: true }, result: { promise: true } }\n );\n }\n } finally {\n await $__utils_fs_writeStream_close.apply(\n void 0,\n [stdinStreamId],\n { result: { promise: true } }\n );\n }\n };\n pump();\n }\n return await promise;\n },\n execBinary: async (cmd, o2) => {\n let stdinStreamId = null;\n let opts = { ...o2, binary: true };\n const hasStdinStream = o2 && o2.stdin && typeof o2.stdin.getReader === "function";\n if (hasStdinStream) {\n stdinStreamId = "shell_stdin_" + Math.random().toString(36).slice(2);\n delete opts.stdin;\n } else if (o2 && o2.stdin instanceof Uint8Array) {\n opts.stdin = { type: "Buffer", data: Array.from(o2.stdin) };\n } else if (o2 && o2.stdin && typeof o2.stdin === "object" && o2.stdin.buffer) {\n opts.stdin = { type: "Buffer", data: Array.from(new Uint8Array(o2.stdin.buffer)) };\n }\n const promise = $__utils_shell_exec.apply(\n void 0,\n [cmd, opts, stdinStreamId],\n { arguments: { copy: true }, result: { promise: true, copy: true } }\n );\n if (hasStdinStream) {\n const reader = o2.stdin.getReader();\n const pump = async () => {\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n let chunk = value;\n if (typeof chunk === "string") chunk = new import_fast_text_encoding.TextEncoder().encode(chunk);\n if (!(chunk instanceof Uint8Array)) throw new TypeError("stdin stream must yield string or Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(\n void 0,\n [stdinStreamId, chunk.buffer, chunk.byteOffset, chunk.byteLength],\n { arguments: { copy: true }, result: { promise: true } }\n );\n }\n } finally {\n await $__utils_fs_writeStream_close.apply(void 0, [stdinStreamId], { result: { promise: true } });\n }\n };\n pump();\n }\n const res = await promise;\n if (res && res.stdout instanceof ArrayBuffer) {\n return { ...res, stdout: new Uint8Array(res.stdout) };\n }\n return res;\n },\n spawn: (cmd, o2) => _makeShellSession(cmd, o2, false),\n spawnBinary: (cmd, o2) => _makeShellSession(cmd, o2, true),\n job: {\n start: (cmd, opts) => $__utils_shell_job_start.apply(void 0, [cmd, opts], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n kill: (id, signal) => $__utils_shell_job_kill.apply(void 0, [id, signal ?? null], { arguments: { copy: true }, result: { promise: true } }),\n exists: (id) => $__utils_shell_job_exists.apply(void 0, [id], { result: { promise: true, copy: true } }),\n stdout: (id) => $__utils_shell_job_stdout.apply(void 0, [id], { result: { promise: true, copy: true } }),\n stderr: (id) => $__utils_shell_job_stderr.apply(void 0, [id], { result: { promise: true, copy: true } }),\n write: (id, text) => $__utils_shell_job_write.apply(void 0, [id, text], { arguments: { copy: true }, result: { promise: true } }),\n writeEof: (id) => $__utils_shell_job_write_eof.apply(void 0, [id], { arguments: { copy: true }, result: { promise: true } })\n }\n },\n section: {\n create: (name, data, o2) => $__utils_section_create.applySync(void 0, [name, data, o2], { arguments: { copy: true }, result: { copy: true } }),\n emit: (sectionOrArray) => $__utils_section_emit.applySync(void 0, [sectionOrArray], { arguments: { copy: true } }),\n match: (sectionName, patterns) => $__utils_section_match.applySync(void 0, [sectionName, patterns], { arguments: { copy: true }, result: { copy: true } }),\n selected: () => $__utils_section_selected.applySync(void 0, [], { result: { copy: true } })\n },\n rune: {\n exec: (key, args, opts) => $__utils_rune_exec.apply(void 0, [key, args, opts], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n spawn: (key, args, opts) => {\n const id = $__utils_rune_spawn_open.applySync(void 0, [key, args, opts], { arguments: { copy: true } });\n const createHybridReadable = (streamType) => {\n let controller;\n const listeners = [];\n const stream = new ReadableStream({ start(c2) {\n controller = c2;\n } });\n stream.on = (event, callback) => {\n listeners.push({ event, callback });\n };\n const handleData = (ab) => {\n const chunk = new import_fast_text_encoding.TextDecoder().decode(ab);\n try {\n if (controller) controller.enqueue(chunk);\n } catch {\n }\n for (const l2 of listeners) {\n if (l2.event === "data") l2.callback(chunk);\n }\n };\n const handleEnd = () => {\n try {\n if (controller) controller.close();\n } catch {\n }\n for (const l2 of listeners) {\n if (l2.event === "end") l2.callback();\n }\n };\n $__utils_rune_spawn_on.applySync(void 0, [id, streamType, "data", handleData], { arguments: { reference: true } });\n $__utils_rune_spawn_on.applySync(void 0, [id, streamType, "end", handleEnd], { arguments: { reference: true } });\n return stream;\n };\n const stdoutStream = createHybridReadable("stdout");\n const stderrStream = createHybridReadable("stderr");\n return {\n stdout: stdoutStream,\n stderr: stderrStream,\n on(event, callback) {\n $__utils_rune_spawn_on.applySync(void 0, [id, "session", event, callback], { arguments: { reference: true } });\n },\n open: () => $__utils_rune_spawn_start.applySync(void 0, [id]),\n kill: (signal) => $__utils_rune_spawn_kill.applySync(void 0, [id, signal ?? null]),\n write: (text) => $__utils_rune_spawn_write.applySync(void 0, [id, text], { arguments: { copy: true } }),\n writeCommand: (nameOrText, args2) => $__utils_rune_spawn_write_command.applySync(void 0, [id, nameOrText, args2 ?? null], { arguments: { copy: true } }),\n writeEof: () => $__utils_rune_spawn_write_eof.applySync(void 0, [id]),\n writeInterrupt: () => $__utils_rune_spawn_write_interrupt.applySync(void 0, [id]),\n stdin: {\n write: (chunk) => $__utils_rune_spawn_stdin_write.applySync(void 0, [id, chunk], { arguments: { copy: true } })\n }\n };\n },\n job: {\n start: (key, args, opts) => $__utils_rune_job_start.apply(void 0, [key, args, opts], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n kill: (id, signal) => $__utils_rune_job_kill.apply(void 0, [id, signal ?? null], { arguments: { copy: true }, result: { promise: true } }),\n exists: (id) => $__utils_rune_job_exists.apply(void 0, [id], { result: { promise: true, copy: true } }),\n stdout: (id) => $__utils_rune_job_stdout.apply(void 0, [id], { result: { promise: true, copy: true } }),\n stderr: (id) => $__utils_rune_job_stderr.apply(void 0, [id], { result: { promise: true, copy: true } }),\n sections: (id) => $__utils_rune_job_sections.apply(void 0, [id], { result: { promise: true, copy: true } }),\n write: (id, text) => $__utils_rune_job_write.apply(void 0, [id, text], { arguments: { copy: true }, result: { promise: true } }),\n writeCommand: (id, nameOrText, args) => $__utils_rune_job_write_command.apply(void 0, [id, nameOrText, args ?? null], { arguments: { copy: true }, result: { promise: true } }),\n writeEof: (id) => $__utils_rune_job_write_eof.apply(void 0, [id], { arguments: { copy: true }, result: { promise: true } })\n }\n },\n json: {\n read: (p2, o2) => $__utils_json_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readPath: (p2, q2, f2, o2) => $__utils_json_readPath.apply(void 0, [p2, q2, f2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readPathAll: (p2, q2, f2, o2) => $__utils_json_readPathAll.apply(void 0, [p2, q2, f2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, d2, o2) => $__utils_json_write.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n writePath: (p2, q2, v2, o2) => $__utils_json_writePath.apply(void 0, [p2, q2, v2, o2], { arguments: { copy: true }, result: { promise: true } }),\n parse: (t2, o2) => $__utils_json_parse.applySync(void 0, [t2, o2], { arguments: { copy: true }, result: { copy: true } }),\n stringify: (d2, o2) => $__utils_json_stringify.applySync(void 0, [d2, o2], { arguments: { copy: true }, result: { copy: true } }),\n modify: async (filepath, callback, opts = {}) => {\n const { initial, spaces = 2, format } = opts;\n const missing = !await globalThis.utils.fs.exists(filepath);\n if (missing && initial === void 0) {\n await globalThis.utils.json.read(filepath, { format });\n }\n const data = missing ? JSON.parse(JSON.stringify(initial)) : await globalThis.utils.json.read(filepath, { format });\n const result = await callback(data, { exists: !missing });\n await globalThis.utils.json.write(filepath, result !== void 0 ? result : data, { spaces, format });\n }\n },\n yaml: {\n parse: (t2) => $__utils_yaml_parse.applySync(void 0, [t2], { arguments: { copy: true }, result: { copy: true } }),\n stringify: (d2, o2) => $__utils_yaml_stringify.applySync(void 0, [d2, o2], { arguments: { copy: true }, result: { copy: true } }),\n read: (p2, o2) => $__utils_yaml_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, d2, o2) => $__utils_yaml_write.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n readPath: (p2, q2, f2) => $__utils_yaml_readPath.apply(void 0, [p2, q2, f2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readPathAll: (p2, q2, f2) => $__utils_yaml_readPathAll.apply(void 0, [p2, q2, f2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n writePath: (p2, q2, v2, o2) => $__utils_yaml_writePath.apply(void 0, [p2, q2, v2, o2], { arguments: { copy: true }, result: { promise: true } }),\n modify: async (filepath, callback, opts = {}) => {\n const { initial, indent = 2 } = opts;\n const missing = !await globalThis.utils.fs.exists(filepath);\n if (missing && initial === void 0) {\n await globalThis.utils.yaml.read(filepath);\n }\n const data = missing ? JSON.parse(JSON.stringify(initial)) : await globalThis.utils.yaml.read(filepath);\n const result = await callback(data, { exists: !missing });\n await globalThis.utils.yaml.write(filepath, result !== void 0 ? result : data, { indent });\n }\n },\n xml: {\n parse: (t2) => $__utils_xml_parse.applySync(void 0, [t2], { arguments: { copy: true }, result: { copy: true } }),\n stringify: (d2, o2) => $__utils_xml_stringify.applySync(void 0, [d2, o2], { arguments: { copy: true }, result: { copy: true } }),\n read: (p2, o2) => $__utils_xml_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, d2, o2) => $__utils_xml_write.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n readPath: (p2, q2, f2) => $__utils_xml_readPath.apply(void 0, [p2, q2, f2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readPathAll: (p2, q2, f2) => $__utils_xml_readPathAll.apply(void 0, [p2, q2, f2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n writePath: (p2, q2, v2, o2) => $__utils_xml_writePath.apply(void 0, [p2, q2, v2, o2], { arguments: { copy: true }, result: { promise: true } }),\n modify: async (filepath, callback, opts = {}) => {\n const { initial, indent = 2 } = opts;\n const missing = !await globalThis.utils.fs.exists(filepath);\n if (missing && initial === void 0) {\n await globalThis.utils.xml.read(filepath);\n }\n const data = missing ? JSON.parse(JSON.stringify(initial)) : await globalThis.utils.xml.read(filepath);\n const result = await callback(data, { exists: !missing });\n await globalThis.utils.xml.write(filepath, result !== void 0 ? result : data, { indent });\n }\n },\n csv: {\n read: (p2, o2) => $__utils_csv_read.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n readObjects: (p2, o2) => $__utils_csv_read_objects.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n write: (p2, d2, o2) => $__utils_csv_write.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n writeObjects: (p2, d2, o2) => $__utils_csv_write_objects.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n headers: (p2, o2) => $__utils_csv_headers.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n count: (p2, o2) => $__utils_csv_count.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } }),\n append: (p2, r2, o2) => $__utils_csv_append.apply(void 0, [p2, r2, o2], { arguments: { copy: true }, result: { promise: true } }),\n appendObjects: (p2, d2, o2) => $__utils_csv_append_objects.apply(void 0, [p2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n parse: (c2, o2) => $__utils_csv_parse.applySync(void 0, [c2, o2], { arguments: { copy: true }, result: { copy: true } }),\n parseObjects: (c2, o2) => $__utils_csv_parse_objects.applySync(void 0, [c2, o2], { arguments: { copy: true }, result: { copy: true } }),\n stringify: (r2, o2) => $__utils_csv_stringify.applySync(void 0, [r2, o2], { arguments: { copy: true }, result: { copy: true } }),\n stringifyObjects: (d2, o2) => $__utils_csv_stringify_objects.applySync(void 0, [d2, o2], { arguments: { copy: true }, result: { copy: true } }),\n readStream: (p2, o2) => {\n let streamId = null;\n return new ReadableStream({\n async start() {\n streamId = await $__utils_csv_readStream.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } });\n },\n async pull(controller) {\n const row2 = await $__utils_csv_readStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (row2 === null) controller.close();\n else controller.enqueue(row2);\n }\n });\n },\n readObjectsStream: (p2, o2) => {\n let streamId = null;\n let columnsResolve, aliasesResolve;\n const columnsPromise = new Promise((res) => {\n columnsResolve = res;\n });\n const aliasesPromise = new Promise((res) => {\n aliasesResolve = res;\n });\n const rows = new ReadableStream({\n async start() {\n streamId = await $__utils_csv_readObjectsStream.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } });\n const meta = await $__utils_csv_readObjectsStream_meta.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n columnsResolve(meta.columns);\n aliasesResolve(meta.aliases);\n },\n async pull(controller) {\n const row2 = await $__utils_csv_readObjectsStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (row2 === null) controller.close();\n else controller.enqueue(row2);\n }\n });\n return { columns: columnsPromise, aliases: aliasesPromise, rows };\n },\n writeStream: (p2, o2) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_csv_writeStream.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } });\n },\n async write(row2) {\n await $__utils_csv_writeStream_write.apply(void 0, [streamId, row2], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) await $__utils_csv_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n },\n async abort() {\n if (streamId !== null) await $__utils_csv_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n });\n },\n writeObjectsStream: (p2, o2) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_csv_writeObjectsStream.apply(void 0, [p2, o2], { arguments: { copy: true }, result: { promise: true } });\n },\n async write(record) {\n await $__utils_csv_writeObjectsStream_write.apply(void 0, [streamId, record], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) await $__utils_csv_writeObjectsStream_close.apply(void 0, [streamId], { result: { promise: true } });\n },\n async abort() {\n if (streamId !== null) await $__utils_csv_writeObjectsStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n });\n }\n },\n http: {\n fetch: async (input, init = {}) => {\n let url, method, reqHeaders, reqBody;\n if (input instanceof Request) {\n url = input.url;\n method = init.method ?? input.method;\n reqHeaders = new Headers(input.headers);\n reqBody = input._body;\n if (input._body != null) {\n if (input._bodyUsed) throw new TypeError("body already used");\n input._bodyUsed = true;\n }\n } else {\n url = String(input);\n method = init.method ?? "GET";\n reqHeaders = new Headers(init.headers);\n reqBody = init.body ?? null;\n }\n if (init.headers) {\n for (const [k2, v2] of new Headers(init.headers)) reqHeaders.set(k2, v2);\n }\n if (init.body !== void 0) reqBody = init.body;\n let serializedBody = reqBody;\n let isStream = false;\n if (reqBody instanceof FormData) {\n serializedBody = reqBody._toWire();\n } else if (reqBody instanceof URLSearchParams) {\n serializedBody = reqBody.toString();\n if (!reqHeaders.has("content-type")) {\n reqHeaders.set("content-type", "application/x-www-form-urlencoded");\n }\n } else if (reqBody instanceof Blob2) {\n serializedBody = { type: "Buffer", data: Array.from(reqBody._bytes) };\n if (!reqHeaders.has("content-type") && reqBody.type) {\n reqHeaders.set("content-type", reqBody.type);\n }\n } else if (reqBody instanceof Uint8Array) {\n serializedBody = { type: "Buffer", data: Array.from(reqBody) };\n } else if (reqBody instanceof ReadableStream) {\n isStream = true;\n }\n const opts = { method, headers: Object.fromEntries(reqHeaders.entries()) };\n let _bodyUsed = false;\n function consumeGuard() {\n if (_bodyUsed) throw new TypeError("body already used");\n _bodyUsed = true;\n }\n if (isStream) {\n const reader = reqBody.getReader();\n const streamResponseHeaders = new Headers();\n let streamStreamController = null;\n const streamChunks = [];\n let streamResolveMeta, streamRejectMeta;\n const streamMetaPromise = new Promise((res, rej) => {\n streamResolveMeta = res;\n streamRejectMeta = rej;\n });\n const streamBytesPromise = new Promise((resolve, reject) => {\n let metaReceived = false;\n const onChunk = async (chunk, chunkMeta) => {\n if (!metaReceived) {\n metaReceived = true;\n for (const [k2, v2] of chunkMeta.headers) streamResponseHeaders.set(k2, v2);\n streamResolveMeta(chunkMeta);\n return;\n }\n if (chunk != null) {\n const bytes = new Uint8Array(chunk);\n streamChunks.push(bytes);\n if (streamStreamController) streamStreamController.enqueue(bytes);\n }\n };\n const onEnd = async () => {\n if (streamStreamController) streamStreamController.close();\n const total = streamChunks.reduce((n2, c2) => n2 + c2.byteLength, 0);\n const merged = new Uint8Array(total);\n let offset = 0;\n for (const c2 of streamChunks) {\n merged.set(c2, offset);\n offset += c2.byteLength;\n }\n resolve(merged);\n };\n const onError = async (msg) => {\n if (streamStreamController) streamStreamController.error(new Error(msg));\n streamRejectMeta(new Error(msg));\n reject(new Error(msg));\n };\n $__utils_http_body_reader.apply(\n void 0,\n [url, { ...opts }, async () => {\n const { done, value } = await reader.read();\n if (done) return null;\n return value.buffer;\n }, onChunk, onEnd, onError],\n { arguments: { reference: true }, result: { promise: true } }\n );\n });\n const streamMeta = await streamMetaPromise;\n const streamBodyStream = new ReadableStream({\n start(c2) {\n streamStreamController = c2;\n }\n });\n return _makeResponse(streamMeta, streamResponseHeaders, streamBytesPromise, streamBodyStream, consumeGuard);\n }\n const responseHeaders = new Headers();\n let streamController = null;\n const chunks = [];\n let resolveMeta, rejectMeta;\n const metaPromise = new Promise((res, rej) => {\n resolveMeta = res;\n rejectMeta = rej;\n });\n const bytesPromise = new Promise((resolve, reject) => {\n let metaReceived = false;\n const onChunk = async (chunk, chunkMeta) => {\n if (!metaReceived) {\n metaReceived = true;\n for (const [k2, v2] of chunkMeta.headers) responseHeaders.set(k2, v2);\n resolveMeta(chunkMeta);\n return;\n }\n if (chunk != null) {\n const bytes = new Uint8Array(chunk);\n chunks.push(bytes);\n if (streamController) streamController.enqueue(bytes);\n }\n };\n const onEnd = async () => {\n if (streamController) streamController.close();\n const total = chunks.reduce((n2, c2) => n2 + c2.byteLength, 0);\n const merged = new Uint8Array(total);\n let offset = 0;\n for (const c2 of chunks) {\n merged.set(c2, offset);\n offset += c2.byteLength;\n }\n resolve(merged);\n };\n const onError = async (msg) => {\n if (streamController) streamController.error(new Error(msg));\n rejectMeta(new Error(msg));\n reject(new Error(msg));\n };\n const signal = init.signal ?? null;\n const fetchArgs = [url, { ...opts, body: serializedBody }, onChunk, onEnd, onError];\n if (signal) {\n fetchArgs.push((abortCb) => {\n signal.addEventListener("abort", () => abortCb.applyIgnored(void 0, []));\n });\n }\n $__utils_http_fetch.apply(\n void 0,\n fetchArgs,\n { arguments: { reference: true }, result: { promise: true } }\n );\n });\n const meta = await metaPromise;\n const bodyStream = new ReadableStream({\n start(c2) {\n streamController = c2;\n }\n });\n return _makeResponse(meta, responseHeaders, bytesPromise, bodyStream, consumeGuard);\n },\n server(port, opts = {}) {\n const id = $__utils_http_server_create.applySync(void 0, [port, opts], { arguments: { copy: true } });\n let resolvedPort = port;\n return {\n _httpServerId: id,\n get port() {\n return resolvedPort;\n },\n on(event, handler) {\n if (event !== "request") throw new Error(`Unknown http.server event: ${event}`);\n $__utils_http_server_set_handler.applySync(void 0, [id, async (meta) => {\n const reqHeaders = new Headers(meta.headers);\n const bodyStream = meta.body ? new ReadableStream({ start(c2) {\n c2.enqueue(new Uint8Array(meta.body));\n c2.close();\n } }) : null;\n const abortCtrl = new AbortController2();\n const closedPromise = $__utils_http_server_request_closed.apply(void 0, [id, meta.reqId], { result: { promise: true } });\n closedPromise.then(() => abortCtrl.abort());\n const req = Object.assign(/* @__PURE__ */ Object.create(null), {\n method: meta.method,\n url: meta.url,\n pathname: meta.pathname,\n searchParams: new URLSearchParams(meta.searchParams),\n headers: reqHeaders,\n body: bodyStream,\n bodyUsed: false,\n signal: abortCtrl.signal,\n closed() {\n return closedPromise;\n },\n on(event2, fn) {\n if (event2 !== "close") throw new Error(`Unknown IncomingRequest event: ${event2}`);\n closedPromise.then(fn);\n },\n async text() {\n if (!meta.body) return "";\n return new import_fast_text_encoding.TextDecoder().decode(new Uint8Array(meta.body));\n },\n async json() {\n return JSON.parse(await this.text());\n },\n async blob() {\n if (!meta.body) return new Blob2([], { type: "" });\n return new Blob2([new Uint8Array(meta.body)], { type: meta.headers["content-type"] ?? "" });\n }\n });\n const response = await handler(req);\n const resHeaders = {};\n if (response.headers) response.headers.forEach((v2, k2) => {\n resHeaders[k2] = v2;\n });\n let bodyData = null;\n if (response._body != null) {\n if (response._body instanceof ReadableStream) {\n const reader = response._body.getReader();\n const chunks = [];\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n const total = new Uint8Array(chunks.reduce((n2, c2) => n2 + c2.byteLength, 0));\n let offset = 0;\n for (const c2 of chunks) {\n total.set(c2, offset);\n offset += c2.byteLength;\n }\n bodyData = total.buffer.slice(total.byteOffset, total.byteOffset + total.byteLength);\n } else if (response._body instanceof Uint8Array) {\n bodyData = response._body.buffer.slice(response._body.byteOffset, response._body.byteOffset + response._body.byteLength);\n } else if (response._body instanceof Blob2) {\n const ab = await response._body.arrayBuffer();\n bodyData = ab;\n } else {\n bodyData = new import_fast_text_encoding.TextEncoder().encode(String(response._body)).buffer;\n }\n }\n return {\n status: response.status,\n statusText: response.statusText,\n headers: resHeaders,\n body: bodyData\n };\n }], { arguments: { reference: true } });\n },\n async open() {\n resolvedPort = await $__utils_http_server_open.apply(void 0, [id], { result: { promise: true, copy: true } });\n },\n async close() {\n await $__utils_http_server_close.apply(void 0, [id], { result: { promise: true } });\n },\n async closed() {\n await $__utils_http_server_closed.apply(void 0, [id], { result: { promise: true } });\n }\n };\n }\n },\n env: {\n read: (key, fallback) => $__utils_env_read.apply(void 0, [key, fallback], { arguments: { copy: true }, result: { promise: true, copy: true } }).then((r2) => r2 !== null ? r2 : fallback),\n has: (key) => $__utils_env_has.apply(void 0, [key], { result: { promise: true } })\n },\n vars: {\n read: (key, fallback = void 0) => Object.hasOwn(__vars, key) ? __vars[key] : fallback,\n has: (key) => Object.hasOwn(__vars, key)\n },\n os: __os,\n stdin: {\n get isTTY() {\n return __stdinIsTTY;\n },\n readBytes: async (opts) => {\n const ab = await $__utils_stdin_read_bytes.apply(void 0, [opts], { arguments: { copy: true }, result: { promise: true, copy: true } });\n return ab ? new Uint8Array(ab) : null;\n },\n read: async (opts) => {\n const bytes = await globalThis.utils.stdin.readBytes(opts);\n return bytes ? new import_fast_text_encoding.TextDecoder().decode(bytes) : null;\n }\n },\n archive: {\n zip: (s2, d2) => $__utils_archive_zip.apply(void 0, [s2, d2], { result: { promise: true } }),\n unzip: (s2, d2) => $__utils_archive_unzip.apply(void 0, [s2, d2], { result: { promise: true } }),\n tar: (s2, d2, o2) => $__utils_archive_tar.apply(void 0, [s2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n untar: (s2, d2, o2) => $__utils_archive_untar.apply(void 0, [s2, d2, o2], { arguments: { copy: true }, result: { promise: true } }),\n zipStream: (source) => {\n let streamId = null;\n return new ReadableStream({\n async start() {\n streamId = await $__utils_archive_zipStream.apply(void 0, [source], { result: { promise: true } });\n },\n async pull(controller) {\n const ab = await $__utils_fs_readStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (ab === null) controller.close();\n else controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n tarStream: (source, opts) => {\n let streamId = null;\n return new ReadableStream({\n async start() {\n streamId = await $__utils_archive_tarStream.apply(void 0, [source, opts], { arguments: { copy: true }, result: { promise: true } });\n },\n async pull(controller) {\n const ab = await $__utils_fs_readStream_next.apply(void 0, [streamId], { result: { promise: true, copy: true } });\n if (ab === null) controller.close();\n else controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n unzipStream: (dest) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_archive_unzipStream.apply(void 0, [dest], { result: { promise: true } });\n },\n async write(chunk) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("unzipStream requires Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(void 0, [streamId, chunk.buffer, chunk.byteOffset, chunk.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n },\n async abort() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n }\n });\n },\n untarStream: (dest, opts) => {\n let streamId = null;\n return new WritableStream({\n async start() {\n streamId = await $__utils_archive_untarStream.apply(void 0, [dest, opts], { arguments: { copy: true }, result: { promise: true } });\n },\n async write(chunk) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("untarStream requires Uint8Array chunks");\n await $__utils_fs_writeStream_write.apply(void 0, [streamId, chunk.buffer, chunk.byteOffset, chunk.byteLength], { arguments: { copy: true }, result: { promise: true } });\n },\n async close() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n },\n async abort() {\n if (streamId !== null) {\n await $__utils_fs_writeStream_close.apply(void 0, [streamId], { result: { promise: true } });\n }\n }\n });\n }\n },\n cache: {\n open: async (location, name) => {\n const id = await $__utils_cache_open.apply(void 0, [location, name ?? null], { result: { promise: true } });\n return {\n set: (k2, v2, ttl) => $__utils_cache_set.apply(void 0, [id, k2, v2, ttl ?? null], { arguments: { copy: true }, result: { promise: true } }),\n get: (k2) => $__utils_cache_get.apply(void 0, [id, k2], { result: { promise: true, copy: true } }),\n has: (k2) => $__utils_cache_has.apply(void 0, [id, k2], { result: { promise: true } }),\n delete: (k2) => $__utils_cache_delete.apply(void 0, [id, k2], { result: { promise: true } }),\n clear: () => $__utils_cache_clear.apply(void 0, [id], { result: { promise: true } })\n };\n }\n },\n sqlite: {\n open: async (location, name) => {\n const id = await $__utils_sqlite_open.apply(void 0, [location, name ?? null], { result: { promise: true } });\n const db2 = {\n query: (sql, params = []) => $__utils_sqlite_query.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n get: (sql, params = []) => $__utils_sqlite_get.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n exec: (sql, params = []) => $__utils_sqlite_exec.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n run: (sql) => $__utils_sqlite_run.apply(void 0, [id, sql], { arguments: { copy: true }, result: { promise: true } }),\n transaction: async (fn) => {\n await db2.exec("BEGIN");\n try {\n await fn();\n await db2.exec("COMMIT");\n } catch (e2) {\n await db2.exec("ROLLBACK");\n throw e2;\n }\n },\n close: () => $__utils_sqlite_close.apply(void 0, [id], { result: { promise: true } })\n };\n return db2;\n }\n },\n db: {\n connect: async (connectionString) => {\n const id = await $__utils_db_connect.apply(void 0, [connectionString], { arguments: { copy: true }, result: { promise: true, copy: true } });\n const client = {\n query: (sql, params = []) => $__utils_db_query.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n get: (sql, params = []) => $__utils_db_get.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n exec: (sql, params = []) => $__utils_db_exec.apply(void 0, [id, sql, params], { arguments: { copy: true }, result: { promise: true, copy: true } }),\n transaction: async (callback) => {\n if (typeof callback !== "function") {\n throw new TypeError("transaction callback must be a function");\n }\n await client.exec("BEGIN");\n try {\n const result = await callback(client);\n await client.exec("COMMIT");\n return result;\n } catch (err) {\n await client.exec("ROLLBACK");\n throw err;\n }\n },\n close: () => $__utils_db_close.apply(void 0, [id], { arguments: { copy: true }, result: { promise: true, copy: true } })\n };\n return client;\n }\n },\n crypt: {\n hash: (algorithm, data) => {\n return $__utils_crypt_hash.apply(void 0, [algorithm, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hashAsHex: (algorithm, data) => {\n return $__utils_crypt_hash_hex.apply(void 0, [algorithm, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hashAsBase64: (algorithm, data) => {\n return $__utils_crypt_hash_base64.apply(void 0, [algorithm, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n uuid: () => $__utils_crypt_uuid.applySync(void 0, []),\n randomHex: (size) => $__utils_crypt_random_hex.applySync(void 0, [size]),\n randomBase64: (size) => $__utils_crypt_random_base64.applySync(void 0, [size]),\n randomBytes: (size) => {\n return $__utils_crypt_random_bytes.applySync(void 0, [size], { result: { copy: true } });\n },\n hmac: (algorithm, key, data) => {\n return $__utils_crypt_hmac.apply(void 0, [algorithm, key, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hmacAsHex: (algorithm, key, data) => {\n return $__utils_crypt_hmac_hex.apply(void 0, [algorithm, key, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hmacAsBase64: (algorithm, key, data) => {\n return $__utils_crypt_hmac_base64.apply(void 0, [algorithm, key, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n encrypt: (algorithm, key, iv, data) => {\n return $__utils_crypt_encrypt.apply(void 0, [algorithm, key, iv, data], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n decrypt: (algorithm, key, iv, ciphertext) => {\n return $__utils_crypt_decrypt.apply(void 0, [algorithm, key, iv, ciphertext], { arguments: { copy: true }, result: { promise: true, copy: true } });\n },\n hashStream: (algorithm) => {\n let id = null;\n return new TransformStream({\n async start() {\n id = await $__utils_crypt_hash_init.apply(void 0, [algorithm], { result: { promise: true } });\n },\n async transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("hashStream requires Uint8Array chunks");\n const buf = chunk.slice().buffer;\n await $__utils_crypt_hash_update.apply(void 0, [id, buf], { arguments: { copy: true }, result: { promise: true } });\n },\n async flush(controller) {\n const ab = await $__utils_crypt_hash_digest.apply(void 0, [id], { result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n encryptStream: (algorithm, key, iv) => {\n let id = null;\n if (!(key instanceof Uint8Array) || !(iv instanceof Uint8Array)) {\n throw new TypeError("encryptStream requires Uint8Array for key and iv");\n }\n return new TransformStream({\n async start() {\n id = await $__utils_crypt_cipher_init.apply(void 0, [algorithm, key.buffer, iv.buffer, true], { arguments: { copy: true }, result: { promise: true } });\n },\n async transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("encryptStream requires Uint8Array chunks");\n const buf = chunk.slice().buffer;\n const ab = await $__utils_crypt_cipher_update.apply(void 0, [id, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n },\n async flush(controller) {\n const ab = await $__utils_crypt_cipher_final.apply(void 0, [id], { result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n }\n });\n },\n decryptStream: (algorithm, key, iv) => {\n let id = null;\n if (!(key instanceof Uint8Array) || !(iv instanceof Uint8Array)) {\n throw new TypeError("decryptStream requires Uint8Array for key and iv");\n }\n return new TransformStream({\n async start() {\n id = await $__utils_crypt_cipher_init.apply(void 0, [algorithm, key.buffer, iv.buffer, false], { arguments: { copy: true }, result: { promise: true } });\n },\n async transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("decryptStream requires Uint8Array chunks");\n const buf = chunk.slice().buffer;\n const ab = await $__utils_crypt_cipher_update.apply(void 0, [id, buf], { arguments: { copy: true }, result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n },\n async flush(controller) {\n const ab = await $__utils_crypt_cipher_final.apply(void 0, [id], { result: { promise: true, copy: true } });\n if (ab) controller.enqueue(new Uint8Array(ab));\n }\n });\n }\n },\n codec: {\n toHex: (data) => {\n const bytes = typeof data === "string" ? new import_fast_text_encoding.TextEncoder().encode(data) : data;\n let hex = "";\n for (let i2 = 0; i2 < bytes.length; i2++) {\n hex += bytes[i2].toString(16).padStart(2, "0");\n }\n return hex;\n },\n fromHex: (hex) => {\n const len = hex.length / 2;\n const bytes = new Uint8Array(len);\n for (let i2 = 0; i2 < len; i2++) {\n bytes[i2] = parseInt(hex.substring(i2 * 2, i2 * 2 + 2), 16);\n }\n return bytes;\n },\n toBase64: (data) => {\n const bytes = typeof data === "string" ? new import_fast_text_encoding.TextEncoder().encode(data) : data;\n const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n let result = "";\n const len = bytes.length;\n for (let i2 = 0; i2 < len; i2 += 3) {\n const b1 = bytes[i2];\n const b2 = i2 + 1 < len ? bytes[i2 + 1] : NaN;\n const b3 = i2 + 2 < len ? bytes[i2 + 2] : NaN;\n const enc1 = b1 >> 2;\n const enc2 = (b1 & 3) << 4 | (isNaN(b2) ? 0 : b2 >> 4);\n const enc3 = isNaN(b2) ? 64 : (b2 & 15) << 2 | (isNaN(b3) ? 0 : b3 >> 6);\n const enc4 = isNaN(b3) ? 64 : b3 & 63;\n result += chars[enc1] + chars[enc2] + (enc3 === 64 ? "=" : chars[enc3]) + (enc4 === 64 ? "=" : chars[enc4]);\n }\n return result;\n },\n fromBase64: (base64) => {\n const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n const lookup = new Uint8Array(256);\n for (let i2 = 0; i2 < chars.length; i2++) lookup[chars.charCodeAt(i2)] = i2;\n const clean = base64.replace(/=/g, "");\n const len = clean.length;\n const bytes = new Uint8Array(Math.floor(len * 0.75));\n let p2 = 0;\n for (let i2 = 0; i2 < len; i2 += 4) {\n const w1 = lookup[clean.charCodeAt(i2)];\n const w2 = i2 + 1 < len ? lookup[clean.charCodeAt(i2 + 1)] : 0;\n const w3 = i2 + 2 < len ? lookup[clean.charCodeAt(i2 + 2)] : 0;\n const w4 = i2 + 3 < len ? lookup[clean.charCodeAt(i2 + 3)] : 0;\n bytes[p2++] = w1 << 2 | w2 >> 4;\n if (p2 < bytes.length) bytes[p2++] = (w2 & 15) << 4 | w3 >> 2;\n if (p2 < bytes.length) bytes[p2++] = (w3 & 3) << 6 | w4;\n }\n return bytes;\n },\n fromUtf8: (utf8) => new import_fast_text_encoding.TextEncoder().encode(utf8),\n toUtf8: (data) => new import_fast_text_encoding.TextDecoder().decode(data),\n hexEncoderStream: () => {\n return new TransformStream({\n transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("hexEncoderStream requires Uint8Array chunks");\n let hex = "";\n for (let i2 = 0; i2 < chunk.length; i2++) {\n hex += chunk[i2].toString(16).padStart(2, "0");\n }\n controller.enqueue(hex);\n }\n });\n },\n hexDecoderStream: () => {\n let buffered = "";\n return new TransformStream({\n transform(chunk, controller) {\n const total = buffered + chunk;\n const len = Math.floor(total.length / 2) * 2;\n const hex = total.slice(0, len);\n buffered = total.slice(len);\n if (hex.length > 0) {\n const bytes = new Uint8Array(hex.length / 2);\n for (let i2 = 0; i2 < bytes.length; i2++) {\n bytes[i2] = parseInt(hex.substring(i2 * 2, i2 * 2 + 2), 16);\n }\n controller.enqueue(bytes);\n }\n },\n flush(controller) {\n if (buffered.length > 0) {\n throw new Error(`hexDecoderStream: trailing single hex character \'${buffered}\'`);\n }\n }\n });\n },\n base64EncoderStream: () => {\n let bufferedBytes = new Uint8Array(0);\n const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n const encode = (bytes) => {\n let result = "";\n const len = bytes.length;\n for (let i2 = 0; i2 < len; i2 += 3) {\n const b1 = bytes[i2];\n const b2 = i2 + 1 < len ? bytes[i2 + 1] : NaN;\n const b3 = i2 + 2 < len ? bytes[i2 + 2] : NaN;\n const enc1 = b1 >> 2;\n const enc2 = (b1 & 3) << 4 | (isNaN(b2) ? 0 : b2 >> 4);\n const enc3 = isNaN(b2) ? 64 : (b2 & 15) << 2 | (isNaN(b3) ? 0 : b3 >> 6);\n const enc4 = isNaN(b3) ? 64 : b3 & 63;\n result += chars[enc1] + chars[enc2] + (enc3 === 64 ? "=" : chars[enc3]) + (enc4 === 64 ? "=" : chars[enc4]);\n }\n return result;\n };\n return new TransformStream({\n transform(chunk, controller) {\n if (!(chunk instanceof Uint8Array)) throw new TypeError("base64EncoderStream requires Uint8Array chunks");\n const total = new Uint8Array(bufferedBytes.length + chunk.length);\n total.set(bufferedBytes);\n total.set(chunk, bufferedBytes.length);\n const encodeLen = Math.floor(total.length / 3) * 3;\n const toEncode = total.subarray(0, encodeLen);\n bufferedBytes = total.subarray(encodeLen);\n if (toEncode.length > 0) {\n controller.enqueue(encode(toEncode));\n }\n },\n flush(controller) {\n if (bufferedBytes.length > 0) {\n controller.enqueue(encode(bufferedBytes));\n }\n }\n });\n },\n base64DecoderStream: () => {\n let bufferedChars = "";\n const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n const lookup = new Uint8Array(256);\n for (let i2 = 0; i2 < chars.length; i2++) lookup[chars.charCodeAt(i2)] = i2;\n const decode = (base64) => {\n const clean = base64.replace(/=/g, "");\n const len = clean.length;\n const bytes = new Uint8Array(Math.floor(len * 0.75));\n let p2 = 0;\n for (let i2 = 0; i2 < len; i2 += 4) {\n const w1 = lookup[clean.charCodeAt(i2)];\n const w2 = i2 + 1 < len ? lookup[clean.charCodeAt(i2 + 1)] : 0;\n const w3 = i2 + 2 < len ? lookup[clean.charCodeAt(i2 + 2)] : 0;\n const w4 = i2 + 3 < len ? lookup[clean.charCodeAt(i2 + 3)] : 0;\n bytes[p2++] = w1 << 2 | w2 >> 4;\n if (p2 < bytes.length) bytes[p2++] = (w2 & 15) << 4 | w3 >> 2;\n if (p2 < bytes.length) bytes[p2++] = (w3 & 3) << 6 | w4;\n }\n return bytes;\n };\n return new TransformStream({\n transform(chunk, controller) {\n const total = bufferedChars + chunk.replace(/\\s/g, "");\n const decodeLen = Math.floor(total.length / 4) * 4;\n const toDecode = total.slice(0, decodeLen);\n bufferedChars = total.slice(decodeLen);\n if (toDecode.length > 0) {\n controller.enqueue(decode(toDecode));\n }\n },\n flush(controller) {\n if (bufferedChars.length > 0) {\n controller.enqueue(decode(bufferedChars.padEnd(4, "=")));\n }\n }\n });\n }\n },\n ws: {\n client(url, opts) {\n const id = $__utils_ws_client.applySync(\n void 0,\n [url, opts],\n { arguments: { copy: true } }\n );\n return {\n on(event, handler) {\n const isolateHandler = event === "error" ? async (errJson) => {\n let d2;\n try {\n d2 = JSON.parse(errJson);\n } catch {\n d2 = { message: errJson };\n }\n const errorObj = new Error(d2.message);\n errorObj.name = "WebSocketError";\n if (d2.code) errorObj.code = d2.code;\n if (d2.stack) errorObj.stack = d2.stack;\n handler(errorObj);\n } : event === "binary" ? async (arrayBuffer) => {\n handler(new Uint8Array(arrayBuffer));\n } : handler;\n $__utils_ws_on.applySync(void 0, [id, event, isolateHandler], {\n arguments: { reference: true }\n });\n },\n open: () => $__utils_ws_open.apply(void 0, [id], { result: { promise: true } }),\n sendText: (msg) => $__utils_ws_send_text.apply(void 0, [id, msg], { result: { promise: true } }),\n sendBinary: (data) => {\n if (data instanceof Uint8Array) {\n return $__utils_ws_send_binary.apply(void 0, [id, data.buffer, data.byteOffset, data.byteLength], {\n arguments: { copy: true },\n result: { promise: true }\n });\n } else if (data instanceof ArrayBuffer) {\n return $__utils_ws_send_binary.apply(void 0, [id, data, 0, data.byteLength], {\n arguments: { copy: true },\n result: { promise: true }\n });\n } else {\n throw new TypeError("sendBinary requires an ArrayBuffer or Uint8Array");\n }\n },\n close: () => $__utils_ws_close.apply(void 0, [id], { result: { promise: true, copy: true } }),\n closed: () => $__utils_ws_closed.apply(void 0, [id], { result: { promise: true, copy: true } })\n };\n },\n server(portOrServer, opts = {}) {\n const isHttpSession = typeof portOrServer === "object" && portOrServer !== null && "_httpServerId" in portOrServer;\n const portOrId = isHttpSession ? portOrServer._httpServerId : portOrServer;\n let resolvedPort = isHttpSession ? portOrServer.port : portOrServer;\n const id = $__utils_ws_server_create.applySync(void 0, [portOrId, opts, isHttpSession], { arguments: { copy: true } });\n function makePathParams(json2) {\n const obj = JSON.parse(json2 ?? "{}");\n return {\n get(key) {\n return Object.prototype.hasOwnProperty.call(obj, key) ? obj[key] : null;\n },\n has(key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n },\n keys() {\n return Object.keys(obj);\n }\n };\n }\n function makeConnHandle(connId, url, pathname, search, headersJson, pathParamsJson) {\n const searchParams = new URLSearchParams(search);\n const headers = new Headers(JSON.parse(headersJson));\n const pathParams = makePathParams(pathParamsJson);\n const connAbort = new AbortController2();\n const connHandle = {\n get id() {\n return connId;\n },\n get url() {\n return url;\n },\n get pathname() {\n return pathname;\n },\n get searchParams() {\n return searchParams;\n },\n get headers() {\n return headers;\n },\n get pathParams() {\n return pathParams;\n },\n get signal() {\n return connAbort.signal;\n },\n on(event, handler) {\n const isolateHandler = event === "error" ? async (errJson) => {\n let d2;\n try {\n d2 = JSON.parse(errJson);\n } catch {\n d2 = { message: errJson };\n }\n const e2 = new Error(d2.message);\n e2.name = "WebSocketError";\n if (d2.code) e2.code = d2.code;\n handler(e2);\n } : event === "binary" ? async (ab) => {\n handler(new Uint8Array(ab));\n } : handler;\n $__utils_ws_server_conn_on.applySync(void 0, [connId, event, isolateHandler], { arguments: { reference: true } });\n },\n sendText: (msg) => $__utils_ws_server_conn_send_text.apply(void 0, [connId, msg], { result: { promise: true } }),\n sendBinary: (data) => {\n if (data instanceof Uint8Array) {\n return $__utils_ws_server_conn_send_binary.apply(void 0, [connId, data.buffer, data.byteOffset, data.byteLength], { arguments: { copy: true }, result: { promise: true } });\n } else if (data instanceof ArrayBuffer) {\n return $__utils_ws_server_conn_send_binary.apply(void 0, [connId, data, 0, data.byteLength], { arguments: { copy: true }, result: { promise: true } });\n }\n throw new TypeError("sendBinary requires ArrayBuffer or Uint8Array");\n },\n close: (code, reason) => $__utils_ws_server_conn_close.apply(void 0, [connId, code ?? 1e3, reason ?? ""], { result: { promise: true, copy: true } }),\n closed: () => $__utils_ws_server_conn_closed.apply(void 0, [connId], { result: { promise: true, copy: true } })\n };\n connHandle.closed().then(() => connAbort.abort());\n return connHandle;\n }\n return {\n _wsServerId: id,\n get port() {\n return resolvedPort;\n },\n on(event, handler) {\n if (event === "connection") {\n $__utils_ws_server_set_connection_handler.applySync(void 0, [id, async (connId, url, pathname, search, headersJson, pathParamsJson) => {\n handler(makeConnHandle(connId, url, pathname, search, headersJson, pathParamsJson));\n }], { arguments: { reference: true } });\n } else if (event === "error") {\n $__utils_ws_server_set_error_handler.applySync(void 0, [id, async (errJson) => {\n let d2;\n try {\n d2 = JSON.parse(errJson);\n } catch {\n d2 = { message: errJson };\n }\n const e2 = new Error(d2.message);\n e2.name = "WebSocketError";\n if (d2.code) e2.code = d2.code;\n handler(e2);\n }], { arguments: { reference: true } });\n } else {\n throw new Error(`Unknown ws.server event: ${event}`);\n }\n },\n async open() {\n resolvedPort = await $__utils_ws_server_open.apply(void 0, [id], { result: { promise: true, copy: true } });\n },\n async close() {\n await $__utils_ws_server_close.apply(void 0, [id], { result: { promise: true } });\n },\n async closed() {\n await $__utils_ws_server_closed.apply(void 0, [id], { result: { promise: true } });\n }\n };\n }\n },\n time: {\n after: (ms) => $__utils_time_after_ref.apply(void 0, [ms], { result: { promise: true } })\n },\n notify: {\n send: (title, message, opts) => $__utils_notify_send.apply(void 0, [title, message, opts], { arguments: { copy: true }, result: { promise: true, copy: true } })\n },\n md,\n tree\n};\nvar { fs, shell, section, rune, json, yaml, xml, csv, http, env, vars, os, stdin, archive, cache, sqlite, db, crypt, codec, ws, time, notify } = globalThis.utils;\nvar timers = /* @__PURE__ */ new Map();\nvar nextTimerId = 1;\nglobalThis.setTimeout = function(callback, delay = 0, ...args) {\n if (typeof callback !== "function") throw new TypeError("callback must be a function");\n const id = nextTimerId++;\n let active = true;\n timers.set(id, {\n clear() {\n active = false;\n timers.delete(id);\n }\n });\n $__utils_time_after.apply(void 0, [delay], { result: { promise: true } }).then(() => {\n if (active) {\n timers.delete(id);\n callback(...args);\n }\n });\n return id;\n};\nglobalThis.clearTimeout = function(id) {\n const timer = timers.get(id);\n if (timer) timer.clear();\n};\nglobalThis.setInterval = function(callback, delay = 0, ...args) {\n if (typeof callback !== "function") throw new TypeError("callback must be a function");\n const id = nextTimerId++;\n let active = true;\n const run = () => {\n $__utils_time_after_ref.apply(void 0, [delay], { result: { promise: true } }).then(() => {\n if (active) {\n callback(...args);\n run();\n }\n });\n };\n timers.set(id, {\n clear() {\n active = false;\n timers.delete(id);\n }\n });\n run();\n return id;\n};\nglobalThis.clearInterval = function(id) {\n const timer = timers.get(id);\n if (timer) timer.clear();\n};\nglobalThis.fetch = (input, init) => globalThis.utils.http.fetch(input, init);\nvar __runeKey = typeof $__rune_key !== "undefined" ? $__rune_key : null;\nvar __runeLifecycle = typeof $__rune_lifecycle !== "undefined" ? $__rune_lifecycle : "run";\nvar __runeArgsSchema = typeof $__rune_args_schema !== "undefined" ? JSON.parse($__rune_args_schema) : null;\nvar __runeCommandsSchema = typeof $__rune_commands_schema !== "undefined" ? JSON.parse($__rune_commands_schema) : null;\nfunction __renderRuneHelp(path) {\n if (!__runeArgsSchema) return "";\n const segments = toSegments(path);\n if (segments.length === 0) {\n return formatRuneIndex(__runeArgsSchema, {\n key: __runeKey ?? "rune",\n lifecycle: __runeLifecycle,\n repl: __runeCommandsSchema ? { commands: __runeCommandsSchema.commands ?? [] } : null,\n // Effective permissions are computed host-side and are not available\n // inside the isolate, so the batch block is omitted rather than guessed.\n includeBatch: false\n });\n }\n const sel = selectNode(__runeArgsSchema, segments);\n if (!sel.node) {\n throw new Error(\n `rune.helpText: "${sel.failedAt}" is not a command of "${__runeKey ?? "rune"}"${sel.matchedPath ? ` at path "${sel.matchedPath}"` : ""}. Available: ${sel.candidates.length ? sel.candidates.join(", ") : "(none)"}`\n );\n }\n return formatCommandPage(sel.node, { key: __runeKey ?? "rune", lifecycle: __runeLifecycle, path: sel.matchedPath });\n}\nglobalThis.utils.rune.key = () => __runeKey;\nglobalThis.utils.rune.helpText = (path) => __renderRuneHelp(path);\nglobalThis.utils.rune.helpSection = (path) => globalThis.utils.section.create("help", { type: "markdown", content: __renderRuneHelp(path) });\nglobalThis.utils.rune.argsSchema = () => __runeArgsSchema;\nglobalThis.utils.rune.commandsSchema = () => __runeCommandsSchema?.commands ?? null;\nexport {\n archive,\n cache,\n codec,\n crypt,\n csv,\n db,\n env,\n fs,\n http,\n json,\n md,\n notify,\n os,\n rune,\n section,\n shell,\n sqlite,\n stdin,\n time,\n tree,\n vars,\n ws,\n xml,\n yaml\n};\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n *)\n\nweb-streams-polyfill/dist/ponyfill.mjs:\n (**\n * @license\n * web-streams-polyfill v4.3.0\n * Copyright 2026 Mattias Buelens, Diwank Singh Tomer and other contributors.\n * This code is released under the MIT license.\n * SPDX-License-Identifier: MIT\n *)\n*/\n';
|
|
73295
73409
|
var console2 = "// Console shim for the isolate. $__utils_console_emit is an ivm.Reference global\n// set by the host before this module is evaluated.\nglobalThis.console = {\n log: (...a) => $__utils_console_emit.applyIgnored(undefined, ['log', ...a.map(String)]),\n warn: (...a) => $__utils_console_emit.applyIgnored(undefined, ['warn', ...a.map(String)]),\n error: (...a) => $__utils_console_emit.applyIgnored(undefined, ['error', ...a.map(String)]),\n}\n\nglobalThis.logger = {\n info: (msg, meta) => $__utils_logger_emit.applySync(undefined, ['info', msg, meta ?? null], { arguments: { copy: true } }),\n warn: (msg, meta) => $__utils_logger_emit.applySync(undefined, ['warn', msg, meta ?? null], { arguments: { copy: true } }),\n error: (msg, meta) => $__utils_logger_emit.applySync(undefined, ['error', msg, meta ?? null], { arguments: { copy: true } }),\n debug: (msg, meta) => $__utils_logger_emit.applySync(undefined, ['debug', msg, meta ?? null], { arguments: { copy: true } }),\n}\n";
|
|
73296
73410
|
|
|
73297
73411
|
// src/rune/api/rune.js
|
|
@@ -73467,7 +73581,7 @@ function resolveRuneExecCwd(projectDir, cwdOpt, checkPermission) {
|
|
|
73467
73581
|
if (checkPermission) checkPermission("fs.read", cwdOpt);
|
|
73468
73582
|
return resolved;
|
|
73469
73583
|
}
|
|
73470
|
-
async function injectUtils(isolate, context, utils2, _runeCallback, vars, projectDir, checkPermission, sections, onEvent, runeContext) {
|
|
73584
|
+
async function injectUtils(isolate, context, utils2, _runeCallback, vars, projectDir, checkPermission, sections, onEvent, runeContext, memoryMb) {
|
|
73471
73585
|
const currentRuneKey = runeContext?.key ?? null;
|
|
73472
73586
|
const jail = context.global;
|
|
73473
73587
|
const asyncRef = (fn) => new ivm2.Reference((...args) => {
|
|
@@ -73477,7 +73591,12 @@ async function injectUtils(isolate, context, utils2, _runeCallback, vars, projec
|
|
|
73477
73591
|
return p2;
|
|
73478
73592
|
});
|
|
73479
73593
|
await jail.set("$__utils_fs_read", new ivm2.Reference(async (relPath, opts) => {
|
|
73480
|
-
|
|
73594
|
+
const content = await utils2.fs.read(relPath, opts);
|
|
73595
|
+
const limit = memoryMb * 1024 * 1024;
|
|
73596
|
+
if (content && content.length * 2 > limit && (content.length > limit || /[^\u0000-\u00ff]/.test(content))) {
|
|
73597
|
+
throw new Error(`fs.read: "${relPath}" does not fit in the ${memoryMb} MB sandbox. Read it with fs.readLinesStream() instead.`);
|
|
73598
|
+
}
|
|
73599
|
+
return content;
|
|
73481
73600
|
}));
|
|
73482
73601
|
await jail.set("$__utils_fs_resolve", new ivm2.Reference(async (relPath) => {
|
|
73483
73602
|
return utils2.fs.resolve(relPath);
|
|
@@ -73570,6 +73689,27 @@ async function injectUtils(isolate, context, utils2, _runeCallback, vars, projec
|
|
|
73570
73689
|
copy.set(value);
|
|
73571
73690
|
return copy.buffer;
|
|
73572
73691
|
}));
|
|
73692
|
+
await jail.set("$__utils_fs_readLines", asyncRef(async (relPath, opts) => {
|
|
73693
|
+
const iter = utils2.fs.readLinesIter(relPath, opts);
|
|
73694
|
+
const id = nextStreamId++;
|
|
73695
|
+
streams.set(id, iter);
|
|
73696
|
+
return id;
|
|
73697
|
+
}));
|
|
73698
|
+
await jail.set("$__utils_fs_readLines_next", asyncRef(async (id) => {
|
|
73699
|
+
const iter = streams.get(id);
|
|
73700
|
+
if (!iter) throw new Error(`Invalid line stream ID: ${id}`);
|
|
73701
|
+
const { value, done } = await iter.next();
|
|
73702
|
+
if (done) {
|
|
73703
|
+
streams.delete(id);
|
|
73704
|
+
return null;
|
|
73705
|
+
}
|
|
73706
|
+
return value;
|
|
73707
|
+
}));
|
|
73708
|
+
await jail.set("$__utils_fs_readLines_cancel", asyncRef(async (id) => {
|
|
73709
|
+
const iter = streams.get(id);
|
|
73710
|
+
streams.delete(id);
|
|
73711
|
+
await iter?.return();
|
|
73712
|
+
}));
|
|
73573
73713
|
await jail.set("$__utils_fs_writeStream", new ivm2.Reference(async (relPath) => {
|
|
73574
73714
|
const ref = await utils2.fs.writeStreamRef(relPath);
|
|
73575
73715
|
const id = nextStreamId++;
|
|
@@ -73708,6 +73848,7 @@ async function injectUtils(isolate, context, utils2, _runeCallback, vars, projec
|
|
|
73708
73848
|
jobStdoutPath,
|
|
73709
73849
|
jobStderrPath,
|
|
73710
73850
|
jobStdinPath,
|
|
73851
|
+
jobPgidPath,
|
|
73711
73852
|
spawnedBy: currentRuneKey,
|
|
73712
73853
|
projectDir
|
|
73713
73854
|
});
|
|
@@ -73733,10 +73874,7 @@ async function injectUtils(isolate, context, utils2, _runeCallback, vars, projec
|
|
|
73733
73874
|
const record = await getJob(projectDir, id);
|
|
73734
73875
|
if (!record) return;
|
|
73735
73876
|
if (process.platform === "win32") {
|
|
73736
|
-
|
|
73737
|
-
spawnProcess("taskkill", ["/F", "/T", "/PID", String(record.pid)], { stdio: "ignore" });
|
|
73738
|
-
} catch {
|
|
73739
|
-
}
|
|
73877
|
+
await killWindowsShellJob(projectDir, record);
|
|
73740
73878
|
} else {
|
|
73741
73879
|
try {
|
|
73742
73880
|
process.kill(-record.pid, sig);
|
|
@@ -74815,7 +74953,7 @@ async function runRuneInIsolate(runeFile, effective, args, projectDir, {
|
|
|
74815
74953
|
} catch {
|
|
74816
74954
|
}
|
|
74817
74955
|
}
|
|
74818
|
-
const utilsMod = await injectUtils(isolate, context, utils2, runeCallback, vars, projectDir, checkPermission, sections, wrappedOnEvent, runeContext);
|
|
74956
|
+
const utilsMod = await injectUtils(isolate, context, utils2, runeCallback, vars, projectDir, checkPermission, sections, wrappedOnEvent, runeContext, isolateMemoryMb);
|
|
74819
74957
|
await injectConsole(isolate, context, wrappedOnEvent);
|
|
74820
74958
|
if (pluginDir != null) {
|
|
74821
74959
|
await context.global.set("CRUNES_PLUGIN_ROOT", pluginDir);
|
|
@@ -74974,7 +75112,7 @@ async function getArgsSchema(runeFile, effective, projectDir, {
|
|
|
74974
75112
|
const msg = DENY_BUILTINS.get(spec) ?? `Sandbox escape blocked. Cannot require '${spec}' on host.`;
|
|
74975
75113
|
throw new Error(`PermissionError: ${msg}`);
|
|
74976
75114
|
}));
|
|
74977
|
-
const utilsMod = await injectUtils(isolate, context, utils2, null, vars, projectDir, checkPermission, null, null, null);
|
|
75115
|
+
const utilsMod = await injectUtils(isolate, context, utils2, null, vars, projectDir, checkPermission, null, null, null, isolateMemoryMb);
|
|
74978
75116
|
await injectConsole(isolate, context, null);
|
|
74979
75117
|
if (pluginDir != null) await context.global.set("CRUNES_PLUGIN_ROOT", pluginDir);
|
|
74980
75118
|
const runeSrc = await fs6.readFile(runeFile, "utf8");
|
|
@@ -75087,7 +75225,7 @@ async function getReplSchema(runeFile, effective, args, projectDir, {
|
|
|
75087
75225
|
const msg = DENY_BUILTINS.get(spec) ?? `Sandbox escape blocked. Cannot require '${spec}' on host.`;
|
|
75088
75226
|
throw new Error(`PermissionError: ${msg}`);
|
|
75089
75227
|
}));
|
|
75090
|
-
const utilsMod = await injectUtils(isolate, context, utils2, null, vars, projectDir, checkPermission, null, null, null);
|
|
75228
|
+
const utilsMod = await injectUtils(isolate, context, utils2, null, vars, projectDir, checkPermission, null, null, null, isolateMemoryMb);
|
|
75091
75229
|
await injectConsole(isolate, context, null);
|
|
75092
75230
|
if (pluginDir != null) await context.global.set("CRUNES_PLUGIN_ROOT", pluginDir);
|
|
75093
75231
|
const runeSrc = await fs6.readFile(runeFile, "utf8");
|
|
@@ -75260,7 +75398,7 @@ async function runRuneInRepl(runeFile, effective, args, projectDir, {
|
|
|
75260
75398
|
runeContext.commandsSchema = commandsSchema2 ?? null;
|
|
75261
75399
|
} catch {
|
|
75262
75400
|
}
|
|
75263
|
-
const utilsMod = await injectUtils(isolate, context, utils2, null, vars, projectDir, checkPermission, null, wrappedOnEvent, runeContext);
|
|
75401
|
+
const utilsMod = await injectUtils(isolate, context, utils2, null, vars, projectDir, checkPermission, null, wrappedOnEvent, runeContext, isolateMemoryMb);
|
|
75264
75402
|
await injectConsole(isolate, context, wrappedOnEvent);
|
|
75265
75403
|
if (pluginDir != null) await context.global.set("CRUNES_PLUGIN_ROOT", pluginDir);
|
|
75266
75404
|
const runeSrc = await fs6.readFile(runeFile, "utf8");
|