esbuild-wasm-strapkit 0.24.0-build.1 → 0.24.2-build.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of esbuild-wasm-strapkit might be problematic. Click here for more details.
- package/README.md +3 -3
- package/esbuild.wasm +0 -0
- package/esm/browser.js +5 -5
- package/esm/browser.min.js +3 -3
- package/lib/browser.js +5 -5
- package/lib/browser.min.js +3 -3
- package/lib/main.js +7 -7
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# esbuild-wasm-strapkit
|
|
2
2
|
|
|
3
|
-
[esbuild-wasm](https://www.npmjs.com/package/esbuild-wasm) **0.24.
|
|
3
|
+
[esbuild-wasm](https://www.npmjs.com/package/esbuild-wasm) **0.24.2**, unchanged,
|
|
4
4
|
compiled with a Go toolchain patched to target 64-bit wasm memory (memory64), so
|
|
5
5
|
the esbuild service isn't capped at a 4GB heap on large projects. The API is
|
|
6
6
|
esbuild-wasm's; use it as a drop-in alias:
|
|
7
7
|
|
|
8
|
-
npm install esbuild-wasm@npm:esbuild-wasm-strapkit@esbuild-0.24.
|
|
8
|
+
npm install esbuild-wasm@npm:esbuild-wasm-strapkit@esbuild-0.24.2
|
|
9
9
|
|
|
10
10
|
The runtime needs wasm memory64: Chrome 133+, Firefox 134+, Node 24+ (or a Node
|
|
11
11
|
22 that enables it by default).
|
|
12
12
|
|
|
13
13
|
The `-build.N` suffix only changes when this build is refreshed; the
|
|
14
|
-
`esbuild-0.24.
|
|
14
|
+
`esbuild-0.24.2` tag always points at the newest build.
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
package/esbuild.wasm
CHANGED
|
Binary file
|
package/esm/browser.js
CHANGED
|
@@ -638,8 +638,8 @@ function createChannel(streamIn) {
|
|
|
638
638
|
if (isFirstPacket) {
|
|
639
639
|
isFirstPacket = false;
|
|
640
640
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
641
|
-
if (binaryVersion !== "0.24.
|
|
642
|
-
throw new Error(`Cannot start service: Host version "${"0.24.
|
|
641
|
+
if (binaryVersion !== "0.24.2") {
|
|
642
|
+
throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`);
|
|
643
643
|
}
|
|
644
644
|
return;
|
|
645
645
|
}
|
|
@@ -1573,7 +1573,7 @@ function convertOutputFiles({ path, contents, hash }) {
|
|
|
1573
1573
|
}
|
|
1574
1574
|
|
|
1575
1575
|
// lib/npm/browser.ts
|
|
1576
|
-
var version = "0.24.
|
|
1576
|
+
var version = "0.24.2";
|
|
1577
1577
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
1578
1578
|
var context = (options) => ensureServiceIsRunning().context(options);
|
|
1579
1579
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
|
@@ -1621,7 +1621,7 @@ var startRunningService = async (wasmURL, wasmModule, useWorker) => {
|
|
|
1621
1621
|
let rejectAllWith;
|
|
1622
1622
|
const rejectAllPromise = new Promise((resolve) => rejectAllWith = resolve);
|
|
1623
1623
|
if (useWorker) {
|
|
1624
|
-
let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n // unused\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substring(0, nl));\n outputBuf = outputBuf.substring(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const setInt32 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n _gotest: {\n add: (a, b) => a + b\n },\n gojs: {\n // Go\'s SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n // This changes the SP, thus we have to update the SP used by the imported function.\n // func wasmExit(code int32)\n "runtime.wasmExit": (sp) => {\n sp = Number(sp);\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n "runtime.wasmWrite": (sp) => {\n sp = Number(sp);\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n // func resetMemoryDataView()\n "runtime.resetMemoryDataView": (sp) => {\n sp = Number(sp);\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n // func nanotime1() int64\n "runtime.nanotime1": (sp) => {\n sp = Number(sp);\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n // func walltime() (sec int64, nsec int32)\n "runtime.walltime": (sp) => {\n sp = Number(sp);\n const msec = (/* @__PURE__ */ new Date()).getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n // func scheduleTimeoutEvent(delay int64) int32\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp = Number(sp);\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n },\n getInt64(sp + 8)\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n // func clearTimeoutEvent(id int32)\n "runtime.clearTimeoutEvent": (sp) => {\n sp = Number(sp);\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n // func getRandomData(r []byte)\n "runtime.getRandomData": (sp) => {\n sp = Number(sp);\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n // func finalizeRef(v ref)\n "syscall/js.finalizeRef": (sp) => {\n sp = Number(sp);\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n // func stringVal(value string) ref\n "syscall/js.stringVal": (sp) => {\n sp = Number(sp);\n storeValue(sp + 24, loadString(sp + 8));\n },\n // func valueGet(v ref, p string) ref\n "syscall/js.valueGet": (sp) => {\n sp = Number(sp);\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 32, result);\n },\n // func valueSet(v ref, p string, x ref)\n "syscall/js.valueSet": (sp) => {\n sp = Number(sp);\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n // func valueDelete(v ref, p string)\n "syscall/js.valueDelete": (sp) => {\n sp = Number(sp);\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n // func valueIndex(v ref, i int) ref\n "syscall/js.valueIndex": (sp) => {\n sp = Number(sp);\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n // valueSetIndex(v ref, i int, x ref)\n "syscall/js.valueSetIndex": (sp) => {\n sp = Number(sp);\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n // func valueCall(v ref, m string, args []ref) (ref, bool)\n "syscall/js.valueCall": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n // func valueInvoke(v ref, args []ref) (ref, bool)\n "syscall/js.valueInvoke": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueNew(v ref, args []ref) (ref, bool)\n "syscall/js.valueNew": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueLength(v ref) int\n "syscall/js.valueLength": (sp) => {\n sp = Number(sp);\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n // valuePrepareString(v ref) (ref, int)\n "syscall/js.valuePrepareString": (sp) => {\n sp = Number(sp);\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n // valueLoadString(v ref, b []byte)\n "syscall/js.valueLoadString": (sp) => {\n sp = Number(sp);\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n // func valueInstanceOf(v ref, t ref) bool\n "syscall/js.valueInstanceOf": (sp) => {\n sp = Number(sp);\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n // func copyBytesToGo(dst []byte, src ref) (int, bool)\n "syscall/js.copyBytesToGo": (sp) => {\n sp = Number(sp);\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n // func copyBytesToJS(dst ref, src []byte) (int, bool)\n "syscall/js.copyBytesToJS": (sp) => {\n sp = Number(sp);\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n async run(instance) {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n // JS values that Go currently has references to, indexed by reference id\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n // mapping from JS values to reference ids\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n await this._exitPromise;\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1) console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin) resumeStdin();\n }\n return go;\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.24.0"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\n return go;\n };\n async function tryToInstantiateModule(wasm, go) {\n if (wasm instanceof WebAssembly.Module) {\n return WebAssembly.instantiate(wasm, go.importObject);\n }\n const res = await fetch(wasm);\n if (!res.ok) throw new Error(`Failed to download ${JSON.stringify(wasm)}`);\n if ("instantiateStreaming" in WebAssembly && /^application\\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) {\n const result2 = await WebAssembly.instantiateStreaming(res, go.importObject);\n return result2.instance;\n }\n const bytes = await res.arrayBuffer();\n const result = await WebAssembly.instantiate(bytes, go.importObject);\n return result.instance;\n }\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
|
|
1624
|
+
let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n // unused\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substring(0, nl));\n outputBuf = outputBuf.substring(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const setInt32 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n _gotest: {\n add: (a, b) => a + b\n },\n gojs: {\n // Go\'s SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n // This changes the SP, thus we have to update the SP used by the imported function.\n // func wasmExit(code int32)\n "runtime.wasmExit": (sp) => {\n sp = Number(sp);\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n "runtime.wasmWrite": (sp) => {\n sp = Number(sp);\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n // func resetMemoryDataView()\n "runtime.resetMemoryDataView": (sp) => {\n sp = Number(sp);\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n // func nanotime1() int64\n "runtime.nanotime1": (sp) => {\n sp = Number(sp);\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n // func walltime() (sec int64, nsec int32)\n "runtime.walltime": (sp) => {\n sp = Number(sp);\n const msec = (/* @__PURE__ */ new Date()).getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n // func scheduleTimeoutEvent(delay int64) int32\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp = Number(sp);\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n },\n getInt64(sp + 8)\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n // func clearTimeoutEvent(id int32)\n "runtime.clearTimeoutEvent": (sp) => {\n sp = Number(sp);\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n // func getRandomData(r []byte)\n "runtime.getRandomData": (sp) => {\n sp = Number(sp);\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n // func finalizeRef(v ref)\n "syscall/js.finalizeRef": (sp) => {\n sp = Number(sp);\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n // func stringVal(value string) ref\n "syscall/js.stringVal": (sp) => {\n sp = Number(sp);\n storeValue(sp + 24, loadString(sp + 8));\n },\n // func valueGet(v ref, p string) ref\n "syscall/js.valueGet": (sp) => {\n sp = Number(sp);\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 32, result);\n },\n // func valueSet(v ref, p string, x ref)\n "syscall/js.valueSet": (sp) => {\n sp = Number(sp);\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n // func valueDelete(v ref, p string)\n "syscall/js.valueDelete": (sp) => {\n sp = Number(sp);\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n // func valueIndex(v ref, i int) ref\n "syscall/js.valueIndex": (sp) => {\n sp = Number(sp);\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n // valueSetIndex(v ref, i int, x ref)\n "syscall/js.valueSetIndex": (sp) => {\n sp = Number(sp);\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n // func valueCall(v ref, m string, args []ref) (ref, bool)\n "syscall/js.valueCall": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n // func valueInvoke(v ref, args []ref) (ref, bool)\n "syscall/js.valueInvoke": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueNew(v ref, args []ref) (ref, bool)\n "syscall/js.valueNew": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueLength(v ref) int\n "syscall/js.valueLength": (sp) => {\n sp = Number(sp);\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n // valuePrepareString(v ref) (ref, int)\n "syscall/js.valuePrepareString": (sp) => {\n sp = Number(sp);\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n // valueLoadString(v ref, b []byte)\n "syscall/js.valueLoadString": (sp) => {\n sp = Number(sp);\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n // func valueInstanceOf(v ref, t ref) bool\n "syscall/js.valueInstanceOf": (sp) => {\n sp = Number(sp);\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n // func copyBytesToGo(dst []byte, src ref) (int, bool)\n "syscall/js.copyBytesToGo": (sp) => {\n sp = Number(sp);\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n // func copyBytesToJS(dst ref, src []byte) (int, bool)\n "syscall/js.copyBytesToJS": (sp) => {\n sp = Number(sp);\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n async run(instance) {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n // JS values that Go currently has references to, indexed by reference id\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n // mapping from JS values to reference ids\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n await this._exitPromise;\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1) console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin) resumeStdin();\n }\n return go;\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.24.2"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\n return go;\n };\n async function tryToInstantiateModule(wasm, go) {\n if (wasm instanceof WebAssembly.Module) {\n return WebAssembly.instantiate(wasm, go.importObject);\n }\n const res = await fetch(wasm);\n if (!res.ok) throw new Error(`Failed to download ${JSON.stringify(wasm)}`);\n if ("instantiateStreaming" in WebAssembly && /^application\\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) {\n const result2 = await WebAssembly.instantiateStreaming(res, go.importObject);\n return result2.instance;\n }\n const bytes = await res.arrayBuffer();\n const result = await WebAssembly.instantiate(bytes, go.importObject);\n return result.instance;\n }\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
|
|
1625
1625
|
worker = new Worker(URL.createObjectURL(blob));
|
|
1626
1626
|
} else {
|
|
1627
1627
|
let onmessage = ((postMessage) => {
|
|
@@ -2239,7 +2239,7 @@ var startRunningService = async (wasmURL, wasmModule, useWorker) => {
|
|
|
2239
2239
|
callback(null, count);
|
|
2240
2240
|
};
|
|
2241
2241
|
let go = new globalThis.Go();
|
|
2242
|
-
go.argv = ["", `--service=${"0.24.
|
|
2242
|
+
go.argv = ["", `--service=${"0.24.2"}`];
|
|
2243
2243
|
tryToInstantiateModule(wasm, go).then(
|
|
2244
2244
|
(instance) => {
|
|
2245
2245
|
postMessage(null);
|
package/esm/browser.min.js
CHANGED
|
@@ -3,18 +3,18 @@ var ze=Object.defineProperty;var Ke=(e,t)=>{for(var n in t)ze(e,n,{get:t[n],enum
|
|
|
3
3
|
This indicates that your JavaScript environment is broken. You cannot use
|
|
4
4
|
esbuild in this environment because esbuild relies on this invariant. This
|
|
5
5
|
is not a problem with esbuild. You need to fix your environment instead.
|
|
6
|
-
`);function Ee(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function xe(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var V=JSON.stringify,ke="warning",$e="silent";function Me(e){if(G(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var me=()=>null,W=e=>typeof e=="boolean"?null:"a boolean",y=e=>typeof e=="string"?null:"a string",ye=e=>e instanceof RegExp?null:"a RegExp object",le=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Pe=e=>typeof e=="function"?null:"a function",K=e=>Array.isArray(e)?null:"an array",ee=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Ve=e=>typeof e=="object"&&e!==null?null:"an array or an object",Ye=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ce=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Fe=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Je=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ge=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Te=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",Qe=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let u=e[n];if(t[n+""]=!0,u===void 0)return;let l=i(u);if(l!==null)throw new Error(`${V(n)} must be ${l}`);return u}function Y(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${V(i)}`)}function De(e){let t=Object.create(null),n=r(e,t,"wasmURL",Qe),i=r(e,t,"wasmModule",Ye),u=r(e,t,"worker",W);return Y(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:u}}function Be(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let i=e[n];if(typeof i=="string"||i===!1)t[n]=i;else throw new Error(`Expected ${V(n)} in mangle cache to map to either a string or false`)}}return t}function he(e,t,n,i,u){let l=r(t,n,"color",W),g=r(t,n,"logLevel",y),s=r(t,n,"logLimit",le);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${g||u}`),e.push(`--log-limit=${s||0}`)}function G(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+V(n):""} to be a string, got ${typeof e} instead`);return e}function Ue(e,t,n){let i=r(t,n,"legalComments",y),u=r(t,n,"sourceRoot",y),l=r(t,n,"sourcesContent",W),g=r(t,n,"target",Ge),s=r(t,n,"format",y),m=r(t,n,"globalName",y),U=r(t,n,"mangleProps",ye),P=r(t,n,"reserveProps",ye),b=r(t,n,"mangleQuoted",W),j=r(t,n,"minify",W),T=r(t,n,"minifySyntax",W),L=r(t,n,"minifyWhitespace",W),q=r(t,n,"minifyIdentifiers",W),S=r(t,n,"lineLimit",le),_=r(t,n,"drop",K),J=r(t,n,"dropLabels",K),w=r(t,n,"charset",y),p=r(t,n,"treeShaking",W),f=r(t,n,"ignoreAnnotations",W),o=r(t,n,"jsx",y),v=r(t,n,"jsxFactory",y),O=r(t,n,"jsxFragment",y),M=r(t,n,"jsxImportSource",y),E=r(t,n,"jsxDev",W),a=r(t,n,"jsxSideEffects",W),c=r(t,n,"define",ee),h=r(t,n,"logOverride",ee),C=r(t,n,"supported",ee),F=r(t,n,"pure",K),$=r(t,n,"keepNames",W),x=r(t,n,"platform",y),A=r(t,n,"tsconfigRaw",Je);if(i&&e.push(`--legal-comments=${i}`),u!==void 0&&e.push(`--source-root=${u}`),l!==void 0&&e.push(`--sources-content=${l}`),g&&(Array.isArray(g)?e.push(`--target=${Array.from(g).map(Me).join(",")}`):e.push(`--target=${Me(g)}`)),s&&e.push(`--format=${s}`),m&&e.push(`--global-name=${m}`),x&&e.push(`--platform=${x}`),A&&e.push(`--tsconfig-raw=${typeof A=="string"?A:JSON.stringify(A)}`),j&&e.push("--minify"),T&&e.push("--minify-syntax"),L&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),S&&e.push(`--line-limit=${S}`),w&&e.push(`--charset=${w}`),p!==void 0&&e.push(`--tree-shaking=${p}`),f&&e.push("--ignore-annotations"),_)for(let R of _)e.push(`--drop:${G(R,"drop")}`);if(J&&e.push(`--drop-labels=${Array.from(J).map(R=>G(R,"dropLabels")).join(",")}`),U&&e.push(`--mangle-props=${U.source}`),P&&e.push(`--reserve-props=${P.source}`),b!==void 0&&e.push(`--mangle-quoted=${b}`),o&&e.push(`--jsx=${o}`),v&&e.push(`--jsx-factory=${v}`),O&&e.push(`--jsx-fragment=${O}`),M&&e.push(`--jsx-import-source=${M}`),E&&e.push("--jsx-dev"),a&&e.push("--jsx-side-effects"),c)for(let R in c){if(R.indexOf("=")>=0)throw new Error(`Invalid define: ${R}`);e.push(`--define:${R}=${G(c[R],"define",R)}`)}if(h)for(let R in h){if(R.indexOf("=")>=0)throw new Error(`Invalid log override: ${R}`);e.push(`--log-override:${R}=${G(h[R],"log override",R)}`)}if(C)for(let R in C){if(R.indexOf("=")>=0)throw new Error(`Invalid supported: ${R}`);let k=C[R];if(typeof k!="boolean")throw new Error(`Expected value for supported ${V(R)} to be a boolean, got ${typeof k} instead`);e.push(`--supported:${R}=${k}`)}if(F)for(let R of F)e.push(`--pure:${G(R,"pure")}`);$&&e.push("--keep-names")}function He(e,t,n,i,u){var oe;let l=[],g=[],s=Object.create(null),m=null,U=null;he(l,t,s,n,i),Ue(l,t,s);let P=r(t,s,"sourcemap",Fe),b=r(t,s,"bundle",W),j=r(t,s,"splitting",W),T=r(t,s,"preserveSymlinks",W),L=r(t,s,"metafile",W),q=r(t,s,"outfile",y),S=r(t,s,"outdir",y),_=r(t,s,"outbase",y),J=r(t,s,"tsconfig",y),w=r(t,s,"resolveExtensions",K),p=r(t,s,"nodePaths",K),f=r(t,s,"mainFields",K),o=r(t,s,"conditions",K),v=r(t,s,"external",K),O=r(t,s,"packages",y),M=r(t,s,"alias",ee),E=r(t,s,"loader",ee),a=r(t,s,"outExtension",ee),c=r(t,s,"publicPath",y),h=r(t,s,"entryNames",y),C=r(t,s,"chunkNames",y),F=r(t,s,"assetNames",y),$=r(t,s,"inject",K),x=r(t,s,"banner",ee),A=r(t,s,"footer",ee),R=r(t,s,"entryPoints",Ve),k=r(t,s,"absWorkingDir",y),D=r(t,s,"stdin",ee),N=(oe=r(t,s,"write",W))!=null?oe:u,B=r(t,s,"allowOverwrite",W),H=r(t,s,"mangleCache",ee);if(s.plugins=!0,Y(t,s,`in ${e}() call`),P&&l.push(`--sourcemap${P===!0?"":`=${P}`}`),b&&l.push("--bundle"),B&&l.push("--allow-overwrite"),j&&l.push("--splitting"),T&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),q&&l.push(`--outfile=${q}`),S&&l.push(`--outdir=${S}`),_&&l.push(`--outbase=${_}`),J&&l.push(`--tsconfig=${J}`),O&&l.push(`--packages=${O}`),w){let d=[];for(let I of w){if(G(I,"resolve extension"),I.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${I}`);d.push(I)}l.push(`--resolve-extensions=${d.join(",")}`)}if(c&&l.push(`--public-path=${c}`),h&&l.push(`--entry-names=${h}`),C&&l.push(`--chunk-names=${C}`),F&&l.push(`--asset-names=${F}`),f){let d=[];for(let I of f){if(G(I,"main field"),I.indexOf(",")>=0)throw new Error(`Invalid main field: ${I}`);d.push(I)}l.push(`--main-fields=${d.join(",")}`)}if(o){let d=[];for(let I of o){if(G(I,"condition"),I.indexOf(",")>=0)throw new Error(`Invalid condition: ${I}`);d.push(I)}l.push(`--conditions=${d.join(",")}`)}if(v)for(let d of v)l.push(`--external:${G(d,"external")}`);if(M)for(let d in M){if(d.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${d}`);l.push(`--alias:${d}=${G(M[d],"alias",d)}`)}if(x)for(let d in x){if(d.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${d}`);l.push(`--banner:${d}=${G(x[d],"banner",d)}`)}if(A)for(let d in A){if(d.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${d}`);l.push(`--footer:${d}=${G(A[d],"footer",d)}`)}if($)for(let d of $)l.push(`--inject:${G(d,"inject")}`);if(E)for(let d in E){if(d.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${d}`);l.push(`--loader:${d}=${G(E[d],"loader",d)}`)}if(a)for(let d in a){if(d.indexOf("=")>=0)throw new Error(`Invalid out extension: ${d}`);l.push(`--out-extension:${d}=${G(a[d],"out extension",d)}`)}if(R)if(Array.isArray(R))for(let d=0,I=R.length;d<I;d++){let X=R[d];if(typeof X=="object"&&X!==null){let te=Object.create(null),Q=r(X,te,"in",y),ue=r(X,te,"out",y);if(Y(X,te,"in entry point at index "+d),Q===void 0)throw new Error('Missing property "in" for entry point at index '+d);if(ue===void 0)throw new Error('Missing property "out" for entry point at index '+d);g.push([ue,Q])}else g.push(["",G(X,"entry point at index "+d)])}else for(let d in R)g.push([d,G(R[d],"entry point",d)]);if(D){let d=Object.create(null),I=r(D,d,"contents",Te),X=r(D,d,"resolveDir",y),te=r(D,d,"sourcefile",y),Q=r(D,d,"loader",y);Y(D,d,'in "stdin" object'),te&&l.push(`--sourcefile=${te}`),Q&&l.push(`--loader=${Q}`),X&&(U=X),typeof I=="string"?m=Z(I):I instanceof Uint8Array&&(m=I)}let z=[];if(p)for(let d of p)d+="",z.push(d);return{entries:g,flags:l,write:N,stdinContents:m,stdinResolveDir:U,absWorkingDir:k,nodePaths:z,mangleCache:Be(H)}}function Xe(e,t,n,i){let u=[],l=Object.create(null);he(u,t,l,n,i),Ue(u,t,l);let g=r(t,l,"sourcemap",Fe),s=r(t,l,"sourcefile",y),m=r(t,l,"loader",y),U=r(t,l,"banner",y),P=r(t,l,"footer",y),b=r(t,l,"mangleCache",ee);return Y(t,l,`in ${e}() call`),g&&u.push(`--sourcemap=${g===!0?"external":g}`),s&&u.push(`--sourcefile=${s}`),m&&u.push(`--loader=${m}`),U&&u.push(`--banner=${U}`),P&&u.push(`--footer=${P}`),{flags:u,mangleCache:Be(b)}}function je(e){let t={},n={didClose:!1,reason:""},i={},u=0,l=0,g=new Uint8Array(16*1024),s=0,m=w=>{let p=s+w.length;if(p>g.length){let o=new Uint8Array(p*2);o.set(g),g=o}g.set(w,s),s+=w.length;let f=0;for(;f+4<=s;){let o=Ee(g,f);if(f+4+o>s)break;f+=4,L(g.subarray(f,f+o)),f+=o}f>0&&(g.copyWithin(0,f,s),s-=f)},U=w=>{n.didClose=!0,w&&(n.reason=": "+(w.message||w));let p="The service was stopped"+n.reason;for(let f in i)i[f](p,null);i={}},P=(w,p,f)=>{if(n.didClose)return f("The service is no longer running"+n.reason,null);let o=u++;i[o]=(v,O)=>{try{f(v,O)}finally{w&&w.unref()}},w&&w.ref(),e.writeToStdin(Oe({id:o,isRequest:!0,value:p}))},b=(w,p)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);e.writeToStdin(Oe({id:w,isRequest:!1,value:p}))},j=async(w,p)=>{try{if(p.command==="ping"){b(w,{});return}if(typeof p.key=="number"){let f=t[p.key];if(!f)return;let o=f[p.command];if(o){await o(w,p);return}}throw new Error("Invalid command: "+p.command)}catch(f){let o=[ie(f,e,null,void 0,"")];try{b(w,{errors:o})}catch(v){}}},T=!0,L=w=>{if(T){T=!1;let f=String.fromCharCode(...w);if(f!=="0.24.0")throw new Error(`Cannot start service: Host version "0.24.0" does not match binary version ${V(f)}`);return}let p=Se(w);if(p.isRequest)j(p.id,p.value);else{let f=i[p.id];delete i[p.id],p.value.error?f(p.value.error,{}):f(null,p.value)}};return{readFromStdout:m,afterClose:U,service:{buildOrContext:({callName:w,refs:p,options:f,isTTY:o,defaultWD:v,callback:O})=>{let M=0,E=l++,a={},c={ref(){++M===1&&p&&p.ref()},unref(){--M===0&&(delete t[E],p&&p.unref())}};t[E]=a,c.ref(),Ze(w,E,P,b,c,e,a,f,o,v,(h,C)=>{try{O(h,C)}finally{c.unref()}})},transform:({callName:w,refs:p,input:f,options:o,isTTY:v,fs:O,callback:M})=>{let E=Le(),a=c=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:h,mangleCache:C}=Xe(w,o,v,$e),F={command:"transform",flags:h,inputFS:c!==null,input:c!==null?Z(c):typeof f=="string"?Z(f):f};C&&(F.mangleCache=C),P(p,F,($,x)=>{if($)return M(new Error($),null);let A=ae(x.errors,E),R=ae(x.warnings,E),k=1,D=()=>{if(--k===0){let N={warnings:R,code:x.code,map:x.map,mangleCache:void 0,legalComments:void 0};"legalComments"in x&&(N.legalComments=x==null?void 0:x.legalComments),x.mangleCache&&(N.mangleCache=x==null?void 0:x.mangleCache),M(null,N)}};if(A.length>0)return M(ce("Transform failed",A,R),null);x.codeFS&&(k++,O.readFile(x.code,(N,B)=>{N!==null?M(N,null):(x.code=B,D())})),x.mapFS&&(k++,O.readFile(x.map,(N,B)=>{N!==null?M(N,null):(x.map=B,D())})),D()})}catch(h){let C=[];try{he(C,o,{},v,$e)}catch($){}let F=ie(h,e,E,void 0,"");P(p,{command:"error",flags:C,error:F},()=>{F.detail=E.load(F.detail),M(ce("Transform failed",[F],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let c=a;a=()=>O.writeFile(f,c)}a(null)},formatMessages:({callName:w,refs:p,messages:f,options:o,callback:v})=>{if(!o)throw new Error(`Missing second argument in ${w}() call`);let O={},M=r(o,O,"kind",y),E=r(o,O,"color",W),a=r(o,O,"terminalWidth",le);if(Y(o,O,`in ${w}() call`),M===void 0)throw new Error(`Missing "kind" in ${w}() call`);if(M!=="error"&&M!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${w}() call`);let c={command:"format-msgs",messages:ne(f,"messages",null,"",a),isWarning:M==="warning"};E!==void 0&&(c.color=E),a!==void 0&&(c.terminalWidth=a),P(p,c,(h,C)=>{if(h)return v(new Error(h),null);v(null,C.messages)})},analyzeMetafile:({callName:w,refs:p,metafile:f,options:o,callback:v})=>{o===void 0&&(o={});let O={},M=r(o,O,"color",W),E=r(o,O,"verbose",W);Y(o,O,`in ${w}() call`);let a={command:"analyze-metafile",metafile:f};M!==void 0&&(a.color=M),E!==void 0&&(a.verbose=E),P(p,a,(c,h)=>{if(c)return v(new Error(c),null);v(null,h.result)})}}}}function Ze(e,t,n,i,u,l,g,s,m,U,P){let b=Le(),j=e==="context",T=(S,_)=>{let J=[];try{he(J,s,{},m,ke)}catch(p){}let w=ie(S,l,b,void 0,_);n(u,{command:"error",flags:J,error:w},()=>{w.detail=b.load(w.detail),P(ce(j?"Context failed":"Build failed",[w],[]),null)})},L;if(typeof s=="object"){let S=s.plugins;if(S!==void 0){if(!Array.isArray(S))return T(new Error('"plugins" must be an array'),"");L=S}}if(L&&L.length>0){if(l.isSync)return T(new Error("Cannot use plugins in synchronous API calls"),"");et(t,n,i,u,l,g,s,L,b).then(S=>{if(!S.ok)return T(S.error,S.pluginName);try{q(S.requestPlugins,S.runOnEndCallbacks,S.scheduleOnDisposeCallbacks)}catch(_){T(_,"")}},S=>T(S,""));return}try{q(null,(S,_)=>_([],[]),()=>{})}catch(S){T(S,"")}function q(S,_,J){let w=l.hasFS,{entries:p,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M,nodePaths:E,mangleCache:a}=He(e,s,m,ke,w);if(o&&!l.hasFS)throw new Error('The "write" option is unavailable in this environment');let c={command:"build",key:t,entries:p,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M||U,nodePaths:E,context:j};S&&(c.plugins=S),a&&(c.mangleCache=a);let h=($,x)=>{let A={errors:ae($.errors,b),warnings:ae($.warnings,b),outputFiles:void 0,metafile:void 0,mangleCache:void 0},R=A.errors.slice(),k=A.warnings.slice();$.outputFiles&&(A.outputFiles=$.outputFiles.map(nt)),$.metafile&&(A.metafile=JSON.parse($.metafile)),$.mangleCache&&(A.mangleCache=$.mangleCache),$.writeToStdout!==void 0&&console.log(re($.writeToStdout).replace(/\n$/,"")),_(A,(D,N)=>{if(R.length>0||D.length>0){let B=ce("Build failed",R.concat(D),k.concat(N));return x(B,null,D,N)}x(null,A,D,N)})},C,F;j&&(g["on-end"]=($,x)=>new Promise(A=>{h(x,(R,k,D,N)=>{let B={errors:D,warnings:N};F&&F(R,k),C=void 0,F=void 0,i($,B),A()})})),n(u,c,($,x)=>{if($)return P(new Error($),null);if(!j)return h(x,(k,D)=>(J(),P(k,D)));if(x.errors.length>0)return P(ce("Context failed",x.errors,x.warnings),null);let A=!1,R={rebuild:()=>(C||(C=new Promise((k,D)=>{let N;F=(H,z)=>{N||(N=()=>H?D(H):k(z))};let B=()=>{n(u,{command:"rebuild",key:t},(z,oe)=>{z?D(new Error(z)):N?N():B()})};B()})),C),watch:(k={})=>new Promise((D,N)=>{if(!l.hasFS)throw new Error('Cannot use the "watch" API in this environment');Y(k,{},"in watch() call"),n(u,{command:"watch",key:t},z=>{z?N(new Error(z)):D(void 0)})}),serve:(k={})=>new Promise((D,N)=>{if(!l.hasFS)throw new Error('Cannot use the "serve" API in this environment');let B={},H=r(k,B,"port",le),z=r(k,B,"host",y),oe=r(k,B,"servedir",y),d=r(k,B,"keyfile",y),I=r(k,B,"certfile",y),X=r(k,B,"fallback",y),te=r(k,B,"onRequest",Pe);Y(k,B,"in serve() call");let Q={command:"serve",key:t,onRequest:!!te};H!==void 0&&(Q.port=H),z!==void 0&&(Q.host=z),oe!==void 0&&(Q.servedir=oe),d!==void 0&&(Q.keyfile=d),I!==void 0&&(Q.certfile=I),X!==void 0&&(Q.fallback=X),n(u,Q,(ue,Ne)=>{if(ue)return N(new Error(ue));te&&(g["serve-request"]=(Ie,We)=>{te(We.args),i(Ie,{})}),D(Ne)})}),cancel:()=>new Promise(k=>{if(A)return k();n(u,{command:"cancel",key:t},()=>{k()})}),dispose:()=>new Promise(k=>{if(A)return k();A=!0,n(u,{command:"dispose",key:t},()=>{k(),J(),u.unref()})})};u.ref(),P(null,R)})}}var et=async(e,t,n,i,u,l,g,s,m)=>{let U=[],P=[],b={},j={},T=[],L=0,q=0,S=[],_=!1;s=[...s];for(let p of s){let f={};if(typeof p!="object")throw new Error(`Plugin at index ${q} must be an object`);let o=r(p,f,"name",y);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${q} is missing a name`);try{let v=r(p,f,"setup",Pe);if(typeof v!="function")throw new Error("Plugin is missing a setup function");Y(p,f,`on plugin ${V(o)}`);let O={name:o,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};q++;let E=v({initialOptions:g,resolve:(a,c={})=>{if(!_)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof a!="string")throw new Error("The path to resolve must be a string");let h=Object.create(null),C=r(c,h,"pluginName",y),F=r(c,h,"importer",y),$=r(c,h,"namespace",y),x=r(c,h,"resolveDir",y),A=r(c,h,"kind",y),R=r(c,h,"pluginData",me),k=r(c,h,"with",ee);return Y(c,h,"in resolve() call"),new Promise((D,N)=>{let B={command:"resolve",path:a,key:e,pluginName:o};if(C!=null&&(B.pluginName=C),F!=null&&(B.importer=F),$!=null&&(B.namespace=$),x!=null&&(B.resolveDir=x),A!=null)B.kind=A;else throw new Error('Must specify "kind" when calling "resolve"');R!=null&&(B.pluginData=m.store(R)),k!=null&&(B.with=tt(k,"with")),t(i,B,(H,z)=>{H!==null?N(new Error(H)):D({errors:ae(z.errors,m),warnings:ae(z.warnings,m),path:z.path,external:z.external,sideEffects:z.sideEffects,namespace:z.namespace,suffix:z.suffix,pluginData:m.load(z.pluginData)})})})},onStart(a){let c='This error came from the "onStart" callback registered here:',h=pe(new Error(c),u,"onStart");U.push({name:o,callback:a,note:h}),O.onStart=!0},onEnd(a){let c='This error came from the "onEnd" callback registered here:',h=pe(new Error(c),u,"onEnd");P.push({name:o,callback:a,note:h}),O.onEnd=!0},onResolve(a,c){let h='This error came from the "onResolve" callback registered here:',C=pe(new Error(h),u,"onResolve"),F={},$=r(a,F,"filter",ye),x=r(a,F,"namespace",y);if(Y(a,F,`in onResolve() call for plugin ${V(o)}`),$==null)throw new Error("onResolve() call is missing a filter");let A=L++;b[A]={name:o,callback:c,note:C},O.onResolve.push({id:A,filter:$.source,namespace:x||""})},onLoad(a,c){let h='This error came from the "onLoad" callback registered here:',C=pe(new Error(h),u,"onLoad"),F={},$=r(a,F,"filter",ye),x=r(a,F,"namespace",y);if(Y(a,F,`in onLoad() call for plugin ${V(o)}`),$==null)throw new Error("onLoad() call is missing a filter");let A=L++;j[A]={name:o,callback:c,note:C},O.onLoad.push({id:A,filter:$.source,namespace:x||""})},onDispose(a){T.push(a)},esbuild:u.esbuild});E&&await E,S.push(O)}catch(v){return{ok:!1,error:v,pluginName:o}}}l["on-start"]=async(p,f)=>{m.clear();let o={errors:[],warnings:[]};await Promise.all(U.map(async({name:v,callback:O,note:M})=>{try{let E=await O();if(E!=null){if(typeof E!="object")throw new Error(`Expected onStart() callback in plugin ${V(v)} to return an object`);let a={},c=r(E,a,"errors",K),h=r(E,a,"warnings",K);Y(E,a,`from onStart() callback in plugin ${V(v)}`),c!=null&&o.errors.push(...ne(c,"errors",m,v,void 0)),h!=null&&o.warnings.push(...ne(h,"warnings",m,v,void 0))}}catch(E){o.errors.push(ie(E,u,m,M&&M(),v))}})),n(p,o)},l["on-resolve"]=async(p,f)=>{let o={},v="",O,M;for(let E of f.ids)try{({name:v,callback:O,note:M}=b[E]);let a=await O({path:f.path,importer:f.importer,namespace:f.namespace,resolveDir:f.resolveDir,kind:f.kind,pluginData:m.load(f.pluginData),with:f.with});if(a!=null){if(typeof a!="object")throw new Error(`Expected onResolve() callback in plugin ${V(v)} to return an object`);let c={},h=r(a,c,"pluginName",y),C=r(a,c,"path",y),F=r(a,c,"namespace",y),$=r(a,c,"suffix",y),x=r(a,c,"external",W),A=r(a,c,"sideEffects",W),R=r(a,c,"pluginData",me),k=r(a,c,"errors",K),D=r(a,c,"warnings",K),N=r(a,c,"watchFiles",K),B=r(a,c,"watchDirs",K);Y(a,c,`from onResolve() callback in plugin ${V(v)}`),o.id=E,h!=null&&(o.pluginName=h),C!=null&&(o.path=C),F!=null&&(o.namespace=F),$!=null&&(o.suffix=$),x!=null&&(o.external=x),A!=null&&(o.sideEffects=A),R!=null&&(o.pluginData=m.store(R)),k!=null&&(o.errors=ne(k,"errors",m,v,void 0)),D!=null&&(o.warnings=ne(D,"warnings",m,v,void 0)),N!=null&&(o.watchFiles=ge(N,"watchFiles")),B!=null&&(o.watchDirs=ge(B,"watchDirs"));break}}catch(a){o={id:E,errors:[ie(a,u,m,M&&M(),v)]};break}n(p,o)},l["on-load"]=async(p,f)=>{let o={},v="",O,M;for(let E of f.ids)try{({name:v,callback:O,note:M}=j[E]);let a=await O({path:f.path,namespace:f.namespace,suffix:f.suffix,pluginData:m.load(f.pluginData),with:f.with});if(a!=null){if(typeof a!="object")throw new Error(`Expected onLoad() callback in plugin ${V(v)} to return an object`);let c={},h=r(a,c,"pluginName",y),C=r(a,c,"contents",Te),F=r(a,c,"resolveDir",y),$=r(a,c,"pluginData",me),x=r(a,c,"loader",y),A=r(a,c,"errors",K),R=r(a,c,"warnings",K),k=r(a,c,"watchFiles",K),D=r(a,c,"watchDirs",K);Y(a,c,`from onLoad() callback in plugin ${V(v)}`),o.id=E,h!=null&&(o.pluginName=h),C instanceof Uint8Array?o.contents=C:C!=null&&(o.contents=Z(C)),F!=null&&(o.resolveDir=F),$!=null&&(o.pluginData=m.store($)),x!=null&&(o.loader=x),A!=null&&(o.errors=ne(A,"errors",m,v,void 0)),R!=null&&(o.warnings=ne(R,"warnings",m,v,void 0)),k!=null&&(o.watchFiles=ge(k,"watchFiles")),D!=null&&(o.watchDirs=ge(D,"watchDirs"));break}}catch(a){o={id:E,errors:[ie(a,u,m,M&&M(),v)]};break}n(p,o)};let J=(p,f)=>f([],[]);P.length>0&&(J=(p,f)=>{(async()=>{let o=[],v=[];for(let{name:O,callback:M,note:E}of P){let a,c;try{let h=await M(p);if(h!=null){if(typeof h!="object")throw new Error(`Expected onEnd() callback in plugin ${V(O)} to return an object`);let C={},F=r(h,C,"errors",K),$=r(h,C,"warnings",K);Y(h,C,`from onEnd() callback in plugin ${V(O)}`),F!=null&&(a=ne(F,"errors",m,O,void 0)),$!=null&&(c=ne($,"warnings",m,O,void 0))}}catch(h){a=[ie(h,u,m,E&&E(),O)]}if(a){o.push(...a);try{p.errors.push(...a)}catch(h){}}if(c){v.push(...c);try{p.warnings.push(...c)}catch(h){}}}f(o,v)})()});let w=()=>{for(let p of T)setTimeout(()=>p(),0)};return _=!0,{ok:!0,requestPlugins:S,runOnEndCallbacks:J,scheduleOnDisposeCallbacks:w}};function Le(){let e=new Map,t=0;return{clear(){e.clear()},load(n){return e.get(n)},store(n){if(n===void 0)return-1;let i=t++;return e.set(i,n),i}}}function pe(e,t,n){let i,u=!1;return()=>{if(u)return i;u=!0;try{let l=(e.stack+"").split(`
|
|
6
|
+
`);function Ee(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function xe(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var V=JSON.stringify,ke="warning",$e="silent";function Me(e){if(G(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var me=()=>null,W=e=>typeof e=="boolean"?null:"a boolean",y=e=>typeof e=="string"?null:"a string",ye=e=>e instanceof RegExp?null:"a RegExp object",le=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Pe=e=>typeof e=="function"?null:"a function",K=e=>Array.isArray(e)?null:"an array",ee=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Ve=e=>typeof e=="object"&&e!==null?null:"an array or an object",Ye=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ce=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Fe=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Je=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ge=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Te=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",Qe=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let u=e[n];if(t[n+""]=!0,u===void 0)return;let l=i(u);if(l!==null)throw new Error(`${V(n)} must be ${l}`);return u}function Y(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${V(i)}`)}function De(e){let t=Object.create(null),n=r(e,t,"wasmURL",Qe),i=r(e,t,"wasmModule",Ye),u=r(e,t,"worker",W);return Y(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:u}}function Be(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let i=e[n];if(typeof i=="string"||i===!1)t[n]=i;else throw new Error(`Expected ${V(n)} in mangle cache to map to either a string or false`)}}return t}function he(e,t,n,i,u){let l=r(t,n,"color",W),g=r(t,n,"logLevel",y),s=r(t,n,"logLimit",le);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${g||u}`),e.push(`--log-limit=${s||0}`)}function G(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+V(n):""} to be a string, got ${typeof e} instead`);return e}function Ue(e,t,n){let i=r(t,n,"legalComments",y),u=r(t,n,"sourceRoot",y),l=r(t,n,"sourcesContent",W),g=r(t,n,"target",Ge),s=r(t,n,"format",y),m=r(t,n,"globalName",y),U=r(t,n,"mangleProps",ye),P=r(t,n,"reserveProps",ye),b=r(t,n,"mangleQuoted",W),j=r(t,n,"minify",W),T=r(t,n,"minifySyntax",W),L=r(t,n,"minifyWhitespace",W),q=r(t,n,"minifyIdentifiers",W),S=r(t,n,"lineLimit",le),_=r(t,n,"drop",K),J=r(t,n,"dropLabels",K),w=r(t,n,"charset",y),p=r(t,n,"treeShaking",W),f=r(t,n,"ignoreAnnotations",W),o=r(t,n,"jsx",y),v=r(t,n,"jsxFactory",y),O=r(t,n,"jsxFragment",y),M=r(t,n,"jsxImportSource",y),E=r(t,n,"jsxDev",W),a=r(t,n,"jsxSideEffects",W),c=r(t,n,"define",ee),h=r(t,n,"logOverride",ee),C=r(t,n,"supported",ee),F=r(t,n,"pure",K),$=r(t,n,"keepNames",W),x=r(t,n,"platform",y),A=r(t,n,"tsconfigRaw",Je);if(i&&e.push(`--legal-comments=${i}`),u!==void 0&&e.push(`--source-root=${u}`),l!==void 0&&e.push(`--sources-content=${l}`),g&&(Array.isArray(g)?e.push(`--target=${Array.from(g).map(Me).join(",")}`):e.push(`--target=${Me(g)}`)),s&&e.push(`--format=${s}`),m&&e.push(`--global-name=${m}`),x&&e.push(`--platform=${x}`),A&&e.push(`--tsconfig-raw=${typeof A=="string"?A:JSON.stringify(A)}`),j&&e.push("--minify"),T&&e.push("--minify-syntax"),L&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),S&&e.push(`--line-limit=${S}`),w&&e.push(`--charset=${w}`),p!==void 0&&e.push(`--tree-shaking=${p}`),f&&e.push("--ignore-annotations"),_)for(let R of _)e.push(`--drop:${G(R,"drop")}`);if(J&&e.push(`--drop-labels=${Array.from(J).map(R=>G(R,"dropLabels")).join(",")}`),U&&e.push(`--mangle-props=${U.source}`),P&&e.push(`--reserve-props=${P.source}`),b!==void 0&&e.push(`--mangle-quoted=${b}`),o&&e.push(`--jsx=${o}`),v&&e.push(`--jsx-factory=${v}`),O&&e.push(`--jsx-fragment=${O}`),M&&e.push(`--jsx-import-source=${M}`),E&&e.push("--jsx-dev"),a&&e.push("--jsx-side-effects"),c)for(let R in c){if(R.indexOf("=")>=0)throw new Error(`Invalid define: ${R}`);e.push(`--define:${R}=${G(c[R],"define",R)}`)}if(h)for(let R in h){if(R.indexOf("=")>=0)throw new Error(`Invalid log override: ${R}`);e.push(`--log-override:${R}=${G(h[R],"log override",R)}`)}if(C)for(let R in C){if(R.indexOf("=")>=0)throw new Error(`Invalid supported: ${R}`);let k=C[R];if(typeof k!="boolean")throw new Error(`Expected value for supported ${V(R)} to be a boolean, got ${typeof k} instead`);e.push(`--supported:${R}=${k}`)}if(F)for(let R of F)e.push(`--pure:${G(R,"pure")}`);$&&e.push("--keep-names")}function He(e,t,n,i,u){var oe;let l=[],g=[],s=Object.create(null),m=null,U=null;he(l,t,s,n,i),Ue(l,t,s);let P=r(t,s,"sourcemap",Fe),b=r(t,s,"bundle",W),j=r(t,s,"splitting",W),T=r(t,s,"preserveSymlinks",W),L=r(t,s,"metafile",W),q=r(t,s,"outfile",y),S=r(t,s,"outdir",y),_=r(t,s,"outbase",y),J=r(t,s,"tsconfig",y),w=r(t,s,"resolveExtensions",K),p=r(t,s,"nodePaths",K),f=r(t,s,"mainFields",K),o=r(t,s,"conditions",K),v=r(t,s,"external",K),O=r(t,s,"packages",y),M=r(t,s,"alias",ee),E=r(t,s,"loader",ee),a=r(t,s,"outExtension",ee),c=r(t,s,"publicPath",y),h=r(t,s,"entryNames",y),C=r(t,s,"chunkNames",y),F=r(t,s,"assetNames",y),$=r(t,s,"inject",K),x=r(t,s,"banner",ee),A=r(t,s,"footer",ee),R=r(t,s,"entryPoints",Ve),k=r(t,s,"absWorkingDir",y),D=r(t,s,"stdin",ee),N=(oe=r(t,s,"write",W))!=null?oe:u,B=r(t,s,"allowOverwrite",W),H=r(t,s,"mangleCache",ee);if(s.plugins=!0,Y(t,s,`in ${e}() call`),P&&l.push(`--sourcemap${P===!0?"":`=${P}`}`),b&&l.push("--bundle"),B&&l.push("--allow-overwrite"),j&&l.push("--splitting"),T&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),q&&l.push(`--outfile=${q}`),S&&l.push(`--outdir=${S}`),_&&l.push(`--outbase=${_}`),J&&l.push(`--tsconfig=${J}`),O&&l.push(`--packages=${O}`),w){let d=[];for(let I of w){if(G(I,"resolve extension"),I.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${I}`);d.push(I)}l.push(`--resolve-extensions=${d.join(",")}`)}if(c&&l.push(`--public-path=${c}`),h&&l.push(`--entry-names=${h}`),C&&l.push(`--chunk-names=${C}`),F&&l.push(`--asset-names=${F}`),f){let d=[];for(let I of f){if(G(I,"main field"),I.indexOf(",")>=0)throw new Error(`Invalid main field: ${I}`);d.push(I)}l.push(`--main-fields=${d.join(",")}`)}if(o){let d=[];for(let I of o){if(G(I,"condition"),I.indexOf(",")>=0)throw new Error(`Invalid condition: ${I}`);d.push(I)}l.push(`--conditions=${d.join(",")}`)}if(v)for(let d of v)l.push(`--external:${G(d,"external")}`);if(M)for(let d in M){if(d.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${d}`);l.push(`--alias:${d}=${G(M[d],"alias",d)}`)}if(x)for(let d in x){if(d.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${d}`);l.push(`--banner:${d}=${G(x[d],"banner",d)}`)}if(A)for(let d in A){if(d.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${d}`);l.push(`--footer:${d}=${G(A[d],"footer",d)}`)}if($)for(let d of $)l.push(`--inject:${G(d,"inject")}`);if(E)for(let d in E){if(d.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${d}`);l.push(`--loader:${d}=${G(E[d],"loader",d)}`)}if(a)for(let d in a){if(d.indexOf("=")>=0)throw new Error(`Invalid out extension: ${d}`);l.push(`--out-extension:${d}=${G(a[d],"out extension",d)}`)}if(R)if(Array.isArray(R))for(let d=0,I=R.length;d<I;d++){let X=R[d];if(typeof X=="object"&&X!==null){let te=Object.create(null),Q=r(X,te,"in",y),ue=r(X,te,"out",y);if(Y(X,te,"in entry point at index "+d),Q===void 0)throw new Error('Missing property "in" for entry point at index '+d);if(ue===void 0)throw new Error('Missing property "out" for entry point at index '+d);g.push([ue,Q])}else g.push(["",G(X,"entry point at index "+d)])}else for(let d in R)g.push([d,G(R[d],"entry point",d)]);if(D){let d=Object.create(null),I=r(D,d,"contents",Te),X=r(D,d,"resolveDir",y),te=r(D,d,"sourcefile",y),Q=r(D,d,"loader",y);Y(D,d,'in "stdin" object'),te&&l.push(`--sourcefile=${te}`),Q&&l.push(`--loader=${Q}`),X&&(U=X),typeof I=="string"?m=Z(I):I instanceof Uint8Array&&(m=I)}let z=[];if(p)for(let d of p)d+="",z.push(d);return{entries:g,flags:l,write:N,stdinContents:m,stdinResolveDir:U,absWorkingDir:k,nodePaths:z,mangleCache:Be(H)}}function Xe(e,t,n,i){let u=[],l=Object.create(null);he(u,t,l,n,i),Ue(u,t,l);let g=r(t,l,"sourcemap",Fe),s=r(t,l,"sourcefile",y),m=r(t,l,"loader",y),U=r(t,l,"banner",y),P=r(t,l,"footer",y),b=r(t,l,"mangleCache",ee);return Y(t,l,`in ${e}() call`),g&&u.push(`--sourcemap=${g===!0?"external":g}`),s&&u.push(`--sourcefile=${s}`),m&&u.push(`--loader=${m}`),U&&u.push(`--banner=${U}`),P&&u.push(`--footer=${P}`),{flags:u,mangleCache:Be(b)}}function je(e){let t={},n={didClose:!1,reason:""},i={},u=0,l=0,g=new Uint8Array(16*1024),s=0,m=w=>{let p=s+w.length;if(p>g.length){let o=new Uint8Array(p*2);o.set(g),g=o}g.set(w,s),s+=w.length;let f=0;for(;f+4<=s;){let o=Ee(g,f);if(f+4+o>s)break;f+=4,L(g.subarray(f,f+o)),f+=o}f>0&&(g.copyWithin(0,f,s),s-=f)},U=w=>{n.didClose=!0,w&&(n.reason=": "+(w.message||w));let p="The service was stopped"+n.reason;for(let f in i)i[f](p,null);i={}},P=(w,p,f)=>{if(n.didClose)return f("The service is no longer running"+n.reason,null);let o=u++;i[o]=(v,O)=>{try{f(v,O)}finally{w&&w.unref()}},w&&w.ref(),e.writeToStdin(Oe({id:o,isRequest:!0,value:p}))},b=(w,p)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);e.writeToStdin(Oe({id:w,isRequest:!1,value:p}))},j=async(w,p)=>{try{if(p.command==="ping"){b(w,{});return}if(typeof p.key=="number"){let f=t[p.key];if(!f)return;let o=f[p.command];if(o){await o(w,p);return}}throw new Error("Invalid command: "+p.command)}catch(f){let o=[ie(f,e,null,void 0,"")];try{b(w,{errors:o})}catch(v){}}},T=!0,L=w=>{if(T){T=!1;let f=String.fromCharCode(...w);if(f!=="0.24.2")throw new Error(`Cannot start service: Host version "0.24.2" does not match binary version ${V(f)}`);return}let p=Se(w);if(p.isRequest)j(p.id,p.value);else{let f=i[p.id];delete i[p.id],p.value.error?f(p.value.error,{}):f(null,p.value)}};return{readFromStdout:m,afterClose:U,service:{buildOrContext:({callName:w,refs:p,options:f,isTTY:o,defaultWD:v,callback:O})=>{let M=0,E=l++,a={},c={ref(){++M===1&&p&&p.ref()},unref(){--M===0&&(delete t[E],p&&p.unref())}};t[E]=a,c.ref(),Ze(w,E,P,b,c,e,a,f,o,v,(h,C)=>{try{O(h,C)}finally{c.unref()}})},transform:({callName:w,refs:p,input:f,options:o,isTTY:v,fs:O,callback:M})=>{let E=Le(),a=c=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:h,mangleCache:C}=Xe(w,o,v,$e),F={command:"transform",flags:h,inputFS:c!==null,input:c!==null?Z(c):typeof f=="string"?Z(f):f};C&&(F.mangleCache=C),P(p,F,($,x)=>{if($)return M(new Error($),null);let A=ae(x.errors,E),R=ae(x.warnings,E),k=1,D=()=>{if(--k===0){let N={warnings:R,code:x.code,map:x.map,mangleCache:void 0,legalComments:void 0};"legalComments"in x&&(N.legalComments=x==null?void 0:x.legalComments),x.mangleCache&&(N.mangleCache=x==null?void 0:x.mangleCache),M(null,N)}};if(A.length>0)return M(ce("Transform failed",A,R),null);x.codeFS&&(k++,O.readFile(x.code,(N,B)=>{N!==null?M(N,null):(x.code=B,D())})),x.mapFS&&(k++,O.readFile(x.map,(N,B)=>{N!==null?M(N,null):(x.map=B,D())})),D()})}catch(h){let C=[];try{he(C,o,{},v,$e)}catch($){}let F=ie(h,e,E,void 0,"");P(p,{command:"error",flags:C,error:F},()=>{F.detail=E.load(F.detail),M(ce("Transform failed",[F],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let c=a;a=()=>O.writeFile(f,c)}a(null)},formatMessages:({callName:w,refs:p,messages:f,options:o,callback:v})=>{if(!o)throw new Error(`Missing second argument in ${w}() call`);let O={},M=r(o,O,"kind",y),E=r(o,O,"color",W),a=r(o,O,"terminalWidth",le);if(Y(o,O,`in ${w}() call`),M===void 0)throw new Error(`Missing "kind" in ${w}() call`);if(M!=="error"&&M!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${w}() call`);let c={command:"format-msgs",messages:ne(f,"messages",null,"",a),isWarning:M==="warning"};E!==void 0&&(c.color=E),a!==void 0&&(c.terminalWidth=a),P(p,c,(h,C)=>{if(h)return v(new Error(h),null);v(null,C.messages)})},analyzeMetafile:({callName:w,refs:p,metafile:f,options:o,callback:v})=>{o===void 0&&(o={});let O={},M=r(o,O,"color",W),E=r(o,O,"verbose",W);Y(o,O,`in ${w}() call`);let a={command:"analyze-metafile",metafile:f};M!==void 0&&(a.color=M),E!==void 0&&(a.verbose=E),P(p,a,(c,h)=>{if(c)return v(new Error(c),null);v(null,h.result)})}}}}function Ze(e,t,n,i,u,l,g,s,m,U,P){let b=Le(),j=e==="context",T=(S,_)=>{let J=[];try{he(J,s,{},m,ke)}catch(p){}let w=ie(S,l,b,void 0,_);n(u,{command:"error",flags:J,error:w},()=>{w.detail=b.load(w.detail),P(ce(j?"Context failed":"Build failed",[w],[]),null)})},L;if(typeof s=="object"){let S=s.plugins;if(S!==void 0){if(!Array.isArray(S))return T(new Error('"plugins" must be an array'),"");L=S}}if(L&&L.length>0){if(l.isSync)return T(new Error("Cannot use plugins in synchronous API calls"),"");et(t,n,i,u,l,g,s,L,b).then(S=>{if(!S.ok)return T(S.error,S.pluginName);try{q(S.requestPlugins,S.runOnEndCallbacks,S.scheduleOnDisposeCallbacks)}catch(_){T(_,"")}},S=>T(S,""));return}try{q(null,(S,_)=>_([],[]),()=>{})}catch(S){T(S,"")}function q(S,_,J){let w=l.hasFS,{entries:p,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M,nodePaths:E,mangleCache:a}=He(e,s,m,ke,w);if(o&&!l.hasFS)throw new Error('The "write" option is unavailable in this environment');let c={command:"build",key:t,entries:p,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M||U,nodePaths:E,context:j};S&&(c.plugins=S),a&&(c.mangleCache=a);let h=($,x)=>{let A={errors:ae($.errors,b),warnings:ae($.warnings,b),outputFiles:void 0,metafile:void 0,mangleCache:void 0},R=A.errors.slice(),k=A.warnings.slice();$.outputFiles&&(A.outputFiles=$.outputFiles.map(nt)),$.metafile&&(A.metafile=JSON.parse($.metafile)),$.mangleCache&&(A.mangleCache=$.mangleCache),$.writeToStdout!==void 0&&console.log(re($.writeToStdout).replace(/\n$/,"")),_(A,(D,N)=>{if(R.length>0||D.length>0){let B=ce("Build failed",R.concat(D),k.concat(N));return x(B,null,D,N)}x(null,A,D,N)})},C,F;j&&(g["on-end"]=($,x)=>new Promise(A=>{h(x,(R,k,D,N)=>{let B={errors:D,warnings:N};F&&F(R,k),C=void 0,F=void 0,i($,B),A()})})),n(u,c,($,x)=>{if($)return P(new Error($),null);if(!j)return h(x,(k,D)=>(J(),P(k,D)));if(x.errors.length>0)return P(ce("Context failed",x.errors,x.warnings),null);let A=!1,R={rebuild:()=>(C||(C=new Promise((k,D)=>{let N;F=(H,z)=>{N||(N=()=>H?D(H):k(z))};let B=()=>{n(u,{command:"rebuild",key:t},(z,oe)=>{z?D(new Error(z)):N?N():B()})};B()})),C),watch:(k={})=>new Promise((D,N)=>{if(!l.hasFS)throw new Error('Cannot use the "watch" API in this environment');Y(k,{},"in watch() call"),n(u,{command:"watch",key:t},z=>{z?N(new Error(z)):D(void 0)})}),serve:(k={})=>new Promise((D,N)=>{if(!l.hasFS)throw new Error('Cannot use the "serve" API in this environment');let B={},H=r(k,B,"port",le),z=r(k,B,"host",y),oe=r(k,B,"servedir",y),d=r(k,B,"keyfile",y),I=r(k,B,"certfile",y),X=r(k,B,"fallback",y),te=r(k,B,"onRequest",Pe);Y(k,B,"in serve() call");let Q={command:"serve",key:t,onRequest:!!te};H!==void 0&&(Q.port=H),z!==void 0&&(Q.host=z),oe!==void 0&&(Q.servedir=oe),d!==void 0&&(Q.keyfile=d),I!==void 0&&(Q.certfile=I),X!==void 0&&(Q.fallback=X),n(u,Q,(ue,Ne)=>{if(ue)return N(new Error(ue));te&&(g["serve-request"]=(Ie,We)=>{te(We.args),i(Ie,{})}),D(Ne)})}),cancel:()=>new Promise(k=>{if(A)return k();n(u,{command:"cancel",key:t},()=>{k()})}),dispose:()=>new Promise(k=>{if(A)return k();A=!0,n(u,{command:"dispose",key:t},()=>{k(),J(),u.unref()})})};u.ref(),P(null,R)})}}var et=async(e,t,n,i,u,l,g,s,m)=>{let U=[],P=[],b={},j={},T=[],L=0,q=0,S=[],_=!1;s=[...s];for(let p of s){let f={};if(typeof p!="object")throw new Error(`Plugin at index ${q} must be an object`);let o=r(p,f,"name",y);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${q} is missing a name`);try{let v=r(p,f,"setup",Pe);if(typeof v!="function")throw new Error("Plugin is missing a setup function");Y(p,f,`on plugin ${V(o)}`);let O={name:o,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};q++;let E=v({initialOptions:g,resolve:(a,c={})=>{if(!_)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof a!="string")throw new Error("The path to resolve must be a string");let h=Object.create(null),C=r(c,h,"pluginName",y),F=r(c,h,"importer",y),$=r(c,h,"namespace",y),x=r(c,h,"resolveDir",y),A=r(c,h,"kind",y),R=r(c,h,"pluginData",me),k=r(c,h,"with",ee);return Y(c,h,"in resolve() call"),new Promise((D,N)=>{let B={command:"resolve",path:a,key:e,pluginName:o};if(C!=null&&(B.pluginName=C),F!=null&&(B.importer=F),$!=null&&(B.namespace=$),x!=null&&(B.resolveDir=x),A!=null)B.kind=A;else throw new Error('Must specify "kind" when calling "resolve"');R!=null&&(B.pluginData=m.store(R)),k!=null&&(B.with=tt(k,"with")),t(i,B,(H,z)=>{H!==null?N(new Error(H)):D({errors:ae(z.errors,m),warnings:ae(z.warnings,m),path:z.path,external:z.external,sideEffects:z.sideEffects,namespace:z.namespace,suffix:z.suffix,pluginData:m.load(z.pluginData)})})})},onStart(a){let c='This error came from the "onStart" callback registered here:',h=pe(new Error(c),u,"onStart");U.push({name:o,callback:a,note:h}),O.onStart=!0},onEnd(a){let c='This error came from the "onEnd" callback registered here:',h=pe(new Error(c),u,"onEnd");P.push({name:o,callback:a,note:h}),O.onEnd=!0},onResolve(a,c){let h='This error came from the "onResolve" callback registered here:',C=pe(new Error(h),u,"onResolve"),F={},$=r(a,F,"filter",ye),x=r(a,F,"namespace",y);if(Y(a,F,`in onResolve() call for plugin ${V(o)}`),$==null)throw new Error("onResolve() call is missing a filter");let A=L++;b[A]={name:o,callback:c,note:C},O.onResolve.push({id:A,filter:$.source,namespace:x||""})},onLoad(a,c){let h='This error came from the "onLoad" callback registered here:',C=pe(new Error(h),u,"onLoad"),F={},$=r(a,F,"filter",ye),x=r(a,F,"namespace",y);if(Y(a,F,`in onLoad() call for plugin ${V(o)}`),$==null)throw new Error("onLoad() call is missing a filter");let A=L++;j[A]={name:o,callback:c,note:C},O.onLoad.push({id:A,filter:$.source,namespace:x||""})},onDispose(a){T.push(a)},esbuild:u.esbuild});E&&await E,S.push(O)}catch(v){return{ok:!1,error:v,pluginName:o}}}l["on-start"]=async(p,f)=>{m.clear();let o={errors:[],warnings:[]};await Promise.all(U.map(async({name:v,callback:O,note:M})=>{try{let E=await O();if(E!=null){if(typeof E!="object")throw new Error(`Expected onStart() callback in plugin ${V(v)} to return an object`);let a={},c=r(E,a,"errors",K),h=r(E,a,"warnings",K);Y(E,a,`from onStart() callback in plugin ${V(v)}`),c!=null&&o.errors.push(...ne(c,"errors",m,v,void 0)),h!=null&&o.warnings.push(...ne(h,"warnings",m,v,void 0))}}catch(E){o.errors.push(ie(E,u,m,M&&M(),v))}})),n(p,o)},l["on-resolve"]=async(p,f)=>{let o={},v="",O,M;for(let E of f.ids)try{({name:v,callback:O,note:M}=b[E]);let a=await O({path:f.path,importer:f.importer,namespace:f.namespace,resolveDir:f.resolveDir,kind:f.kind,pluginData:m.load(f.pluginData),with:f.with});if(a!=null){if(typeof a!="object")throw new Error(`Expected onResolve() callback in plugin ${V(v)} to return an object`);let c={},h=r(a,c,"pluginName",y),C=r(a,c,"path",y),F=r(a,c,"namespace",y),$=r(a,c,"suffix",y),x=r(a,c,"external",W),A=r(a,c,"sideEffects",W),R=r(a,c,"pluginData",me),k=r(a,c,"errors",K),D=r(a,c,"warnings",K),N=r(a,c,"watchFiles",K),B=r(a,c,"watchDirs",K);Y(a,c,`from onResolve() callback in plugin ${V(v)}`),o.id=E,h!=null&&(o.pluginName=h),C!=null&&(o.path=C),F!=null&&(o.namespace=F),$!=null&&(o.suffix=$),x!=null&&(o.external=x),A!=null&&(o.sideEffects=A),R!=null&&(o.pluginData=m.store(R)),k!=null&&(o.errors=ne(k,"errors",m,v,void 0)),D!=null&&(o.warnings=ne(D,"warnings",m,v,void 0)),N!=null&&(o.watchFiles=ge(N,"watchFiles")),B!=null&&(o.watchDirs=ge(B,"watchDirs"));break}}catch(a){o={id:E,errors:[ie(a,u,m,M&&M(),v)]};break}n(p,o)},l["on-load"]=async(p,f)=>{let o={},v="",O,M;for(let E of f.ids)try{({name:v,callback:O,note:M}=j[E]);let a=await O({path:f.path,namespace:f.namespace,suffix:f.suffix,pluginData:m.load(f.pluginData),with:f.with});if(a!=null){if(typeof a!="object")throw new Error(`Expected onLoad() callback in plugin ${V(v)} to return an object`);let c={},h=r(a,c,"pluginName",y),C=r(a,c,"contents",Te),F=r(a,c,"resolveDir",y),$=r(a,c,"pluginData",me),x=r(a,c,"loader",y),A=r(a,c,"errors",K),R=r(a,c,"warnings",K),k=r(a,c,"watchFiles",K),D=r(a,c,"watchDirs",K);Y(a,c,`from onLoad() callback in plugin ${V(v)}`),o.id=E,h!=null&&(o.pluginName=h),C instanceof Uint8Array?o.contents=C:C!=null&&(o.contents=Z(C)),F!=null&&(o.resolveDir=F),$!=null&&(o.pluginData=m.store($)),x!=null&&(o.loader=x),A!=null&&(o.errors=ne(A,"errors",m,v,void 0)),R!=null&&(o.warnings=ne(R,"warnings",m,v,void 0)),k!=null&&(o.watchFiles=ge(k,"watchFiles")),D!=null&&(o.watchDirs=ge(D,"watchDirs"));break}}catch(a){o={id:E,errors:[ie(a,u,m,M&&M(),v)]};break}n(p,o)};let J=(p,f)=>f([],[]);P.length>0&&(J=(p,f)=>{(async()=>{let o=[],v=[];for(let{name:O,callback:M,note:E}of P){let a,c;try{let h=await M(p);if(h!=null){if(typeof h!="object")throw new Error(`Expected onEnd() callback in plugin ${V(O)} to return an object`);let C={},F=r(h,C,"errors",K),$=r(h,C,"warnings",K);Y(h,C,`from onEnd() callback in plugin ${V(O)}`),F!=null&&(a=ne(F,"errors",m,O,void 0)),$!=null&&(c=ne($,"warnings",m,O,void 0))}}catch(h){a=[ie(h,u,m,E&&E(),O)]}if(a){o.push(...a);try{p.errors.push(...a)}catch(h){}}if(c){v.push(...c);try{p.warnings.push(...c)}catch(h){}}}f(o,v)})()});let w=()=>{for(let p of T)setTimeout(()=>p(),0)};return _=!0,{ok:!0,requestPlugins:S,runOnEndCallbacks:J,scheduleOnDisposeCallbacks:w}};function Le(){let e=new Map,t=0;return{clear(){e.clear()},load(n){return e.get(n)},store(n){if(n===void 0)return-1;let i=t++;return e.set(i,n),i}}}function pe(e,t,n){let i,u=!1;return()=>{if(u)return i;u=!0;try{let l=(e.stack+"").split(`
|
|
7
7
|
`);l.splice(1,1);let g=qe(t,l,n);if(g)return i={text:e.message,location:g},i}catch(l){}}}function ie(e,t,n,i,u){let l="Internal error",g=null;try{l=(e&&e.message||e)+""}catch(s){}try{g=qe(t,(e.stack+"").split(`
|
|
8
8
|
`),"")}catch(s){}return{id:"",pluginName:u,text:l,location:g,notes:i?[i]:[],detail:n?n.store(e):-1}}function qe(e,t,n){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let u=1;u<t.length;u++){let l=t[u];if(l.startsWith(i))for(l=l.slice(i.length);;){let g=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(g){l=g[1];continue}if(g=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),g){l=g[1];continue}if(g=/^(\S+):(\d+):(\d+)$/.exec(l),g){let s;try{s=e.readFileSync(g[1],"utf8")}catch(b){break}let m=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+g[2]-1]||"",U=+g[3]-1,P=m.slice(U,U+n.length)===n?n.length:0;return{file:g[1],namespace:"file",line:+g[2],column:Z(m.slice(0,U)).length,length:Z(m.slice(U,U+P)).length,lineText:m+`
|
|
9
9
|
`+t.slice(1).join(`
|
|
10
10
|
`),suggestion:""}}break}}return null}function ce(e,t,n){let i=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((l,g)=>{if(g===i)return`
|
|
11
11
|
...`;if(!l.location)return`
|
|
12
12
|
error: ${l.text}`;let{file:s,line:m,column:U}=l.location,P=l.pluginName?`[plugin: ${l.pluginName}] `:"";return`
|
|
13
|
-
${s}:${m}:${U}: ERROR: ${P}${l.text}`}).join("");let u=new Error(e);for(let[l,g]of[["errors",t],["warnings",n]])Object.defineProperty(u,l,{configurable:!0,enumerable:!0,get:()=>g,set:s=>Object.defineProperty(u,l,{configurable:!0,enumerable:!0,value:s})});return u}function ae(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Ae(e,t,n){if(e==null)return null;let i={},u=r(e,i,"file",y),l=r(e,i,"namespace",y),g=r(e,i,"line",le),s=r(e,i,"column",le),m=r(e,i,"length",le),U=r(e,i,"lineText",y),P=r(e,i,"suggestion",y);if(Y(e,i,t),U){let b=U.slice(0,(s&&s>0?s:0)+(m&&m>0?m:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(b)&&!/\n/.test(U)&&(U=b)}return{file:u||"",namespace:l||"",line:g||0,column:s||0,length:m||0,lineText:U||"",suggestion:P||""}}function ne(e,t,n,i,u){let l=[],g=0;for(let s of e){let m={},U=r(s,m,"id",y),P=r(s,m,"pluginName",y),b=r(s,m,"text",y),j=r(s,m,"location",Ce),T=r(s,m,"notes",K),L=r(s,m,"detail",me),q=`in element ${g} of "${t}"`;Y(s,m,q);let S=[];if(T)for(let _ of T){let J={},w=r(_,J,"text",y),p=r(_,J,"location",Ce);Y(_,J,q),S.push({text:w||"",location:Ae(p,q,u)})}l.push({id:U||"",pluginName:P||i,text:b||"",location:Ae(j,q,u),notes:S,detail:n?n.store(L):-1}),g++}return l}function ge(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${V(t)} must be an array of strings`);n.push(i)}return n}function tt(e,t){let n=Object.create(null);for(let i in e){let u=e[i];if(typeof u!="string")throw new Error(`key ${V(i)} in object ${V(t)} must be a string`);n[i]=u}return n}function nt({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let u=this.contents;return(i===null||u!==t)&&(t=u,i=re(u)),i}}}var it="0.24.0",lt=e=>fe().build(e),st=e=>fe().context(e),ot=(e,t)=>fe().transform(e,t),at=(e,t)=>fe().formatMessages(e,t),ut=(e,t)=>fe().analyzeMetafile(e,t),ct=()=>{throw new Error('The "buildSync" API only works in node')},ft=()=>{throw new Error('The "transformSync" API only works in node')},dt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},pt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},gt=()=>(be&&be(),Promise.resolve()),se,be,we,fe=()=>{if(we)return we;throw se?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},mt=e=>{e=De(e||{});let t=e.wasmURL,n=e.wasmModule,i=e.worker!==!1;if(!t&&!n)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(se)throw new Error('Cannot call "initialize" more than once');return se=yt(t||"",n,i),se.catch(()=>{se=void 0}),se},yt=async(e,t,n)=>{let i,u,l=new Promise(b=>u=b);if(n){let b=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nlet onmessage,globalThis={};for(let i=self;i;i=Object.getPrototypeOf(i))for(let f of Object.getOwnPropertyNames(i))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const i=()=>{const u=new Error("not implemented");return u.code="ENOSYS",u};if(!globalThis.fs){let u="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(r,s){u+=y.decode(s);const n=u.lastIndexOf(`\n`);return n!=-1&&(console.log(u.substring(0,n)),u=u.substring(n+1)),s.length},write(r,s,n,o,c,m){if(n!==0||o!==s.length||c!==null){m(i());return}const h=this.writeSync(r,s);m(null,h)},chmod(r,s,n){n(i())},chown(r,s,n,o){o(i())},close(r,s){s(i())},fchmod(r,s,n){n(i())},fchown(r,s,n,o){o(i())},fstat(r,s){s(i())},fsync(r,s){s(null)},ftruncate(r,s,n){n(i())},lchown(r,s,n,o){o(i())},link(r,s,n){n(i())},lstat(r,s){s(i())},mkdir(r,s,n){n(i())},open(r,s,n,o){o(i())},read(r,s,n,o,c,m){m(i())},readdir(r,s){s(i())},readlink(r,s){s(i())},rename(r,s,n){n(i())},rmdir(r,s){s(i())},stat(r,s){s(i())},symlink(r,s,n){n(i())},truncate(r,s,n){n(i())},unlink(r,s){s(i())},utimes(r,s,n,o){o(i())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw i()},pid:-1,ppid:-1,umask(){throw i()},cwd(){throw i()},chdir(){throw i()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),y=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const u=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},r=(e,t)=>{this.mem.setUint32(e+0,t,!0)},s=e=>{const t=this.mem.getUint32(e+0,!0),l=this.mem.getInt32(e+4,!0);return t+l*4294967296},n=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const l=this.mem.getUint32(e,!0);return this._values[l]},o=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let g=0;switch(typeof t){case"object":t!==null&&(g=1);break;case"string":g=2;break;case"symbol":g=3;break;case"function":g=4;break}this.mem.setUint32(e+4,2146959360|g,!0),this.mem.setUint32(e,a,!0)},c=e=>{const t=s(e+0),l=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,l)},m=e=>{const t=s(e+0),l=s(e+8),a=new Array(l);for(let g=0;g<l;g++)a[g]=n(t+g*8);return a},h=e=>{const t=s(e+0),l=s(e+8);return y.decode(new DataView(this._inst.exports.mem.buffer,t,l))},d=Date.now()-performance.now();this.importObject={_gotest:{add:(e,t)=>e+t},gojs:{"runtime.wasmExit":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e=Number(e);const t=s(e+8),l=s(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":e=>{e=Number(e),this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e=Number(e),u(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e=Number(e);const t=new Date().getTime();u(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e=Number(e);const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8))),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e=Number(e),crypto.getRandomValues(c(e+8))},"syscall/js.finalizeRef":e=>{e=Number(e);const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const l=this._values[t];this._values[t]=null,this._ids.delete(l),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e=Number(e),o(e+24,h(e+8))},"syscall/js.valueGet":e=>{e=Number(e);const t=Reflect.get(n(e+8),h(e+16));e=Number(this._inst.exports.getsp()),o(e+32,t)},"syscall/js.valueSet":e=>{e=Number(e),Reflect.set(n(e+8),h(e+16),n(e+32))},"syscall/js.valueDelete":e=>{e=Number(e),Reflect.deleteProperty(n(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e=Number(e),o(e+24,Reflect.get(n(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e=Number(e),Reflect.set(n(e+8),s(e+16),n(e+24))},"syscall/js.valueCall":e=>{e=Number(e);try{const t=n(e+8),l=Reflect.get(t,h(e+16)),a=m(e+32),g=Reflect.apply(l,t,a);e=Number(this._inst.exports.getsp()),o(e+56,g),this.mem.setUint8(e+64,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.apply(t,void 0,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.construct(t,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e=Number(e),u(e+16,parseInt(n(e+8).length))},"syscall/js.valuePrepareString":e=>{e=Number(e);const t=f.encode(String(n(e+8)));o(e+16,t),u(e+24,t.length)},"syscall/js.valueLoadString":e=>{e=Number(e);const t=n(e+8);c(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e=Number(e),this.mem.setUint8(e+24,n(e+8)instanceof n(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e=Number(e);const t=c(e+8),l=n(e+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),u(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e=Number(e);const t=n(e+8),l=c(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),u(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(u){if(!(u instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=u,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let r=4096;const s=d=>{const e=r,t=f.encode(d+"\\0");return new Uint8Array(this.mem.buffer,r,t.length).set(t),r+=t.length,r%8!==0&&(r+=8-r%8),e},n=this.argv.length,o=[];this.argv.forEach(d=>{o.push(s(d))}),o.push(0),Object.keys(this.env).sort().forEach(d=>{o.push(s(`${d}=${this.env[d]}`))}),o.push(0);const m=r;if(o.forEach(d=>{this.mem.setUint32(r,d,!0),this.mem.setUint32(r+4,0,!0),r+=8}),r>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,m),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(u){const r=this;return function(){const s={id:u,this:this,args:arguments};return r._pendingEvent=s,r._resume(),s.result}}}})(),onmessage=({data:i})=>{let f=new TextDecoder,y=globalThis.fs,u="";y.writeSync=(c,m)=>{if(c===1)postMessage(m);else if(c===2){u+=f.decode(m);let h=u.split(`\n`);h.length>1&&console.log(h.slice(0,-1).join(`\n`)),u=h[h.length-1]}else throw new Error("Bad write");return m.length};let r=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(r.push(c),s&&s()),o),y.read=(c,m,h,d,e,t)=>{if(c!==0||h!==0||d!==m.length||e!==null)throw new Error("Bad read");if(r.length===0){s=()=>y.read(c,m,h,d,e,t);return}let l=r[0],a=Math.max(0,Math.min(d,l.length-n));m.set(l.subarray(n,n+a),h),n+=a,n===l.length&&(r.shift(),n=0),t(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.0"],tryToInstantiateModule(i,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};async function tryToInstantiateModule(i,f){if(i instanceof WebAssembly.Module)return WebAssembly.instantiate(i,f.importObject);const y=await fetch(i);if(!y.ok)throw new Error(`Failed to download ${JSON.stringify(i)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(y.headers.get("Content-Type")||""))return(await WebAssembly.instantiateStreaming(y,f.importObject)).instance;const u=await y.arrayBuffer();return(await WebAssembly.instantiate(u,f.importObject)).instance}return i=>onmessage(i);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(b))}else{let b=(postMessage=>{
|
|
13
|
+
${s}:${m}:${U}: ERROR: ${P}${l.text}`}).join("");let u=new Error(e);for(let[l,g]of[["errors",t],["warnings",n]])Object.defineProperty(u,l,{configurable:!0,enumerable:!0,get:()=>g,set:s=>Object.defineProperty(u,l,{configurable:!0,enumerable:!0,value:s})});return u}function ae(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Ae(e,t,n){if(e==null)return null;let i={},u=r(e,i,"file",y),l=r(e,i,"namespace",y),g=r(e,i,"line",le),s=r(e,i,"column",le),m=r(e,i,"length",le),U=r(e,i,"lineText",y),P=r(e,i,"suggestion",y);if(Y(e,i,t),U){let b=U.slice(0,(s&&s>0?s:0)+(m&&m>0?m:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(b)&&!/\n/.test(U)&&(U=b)}return{file:u||"",namespace:l||"",line:g||0,column:s||0,length:m||0,lineText:U||"",suggestion:P||""}}function ne(e,t,n,i,u){let l=[],g=0;for(let s of e){let m={},U=r(s,m,"id",y),P=r(s,m,"pluginName",y),b=r(s,m,"text",y),j=r(s,m,"location",Ce),T=r(s,m,"notes",K),L=r(s,m,"detail",me),q=`in element ${g} of "${t}"`;Y(s,m,q);let S=[];if(T)for(let _ of T){let J={},w=r(_,J,"text",y),p=r(_,J,"location",Ce);Y(_,J,q),S.push({text:w||"",location:Ae(p,q,u)})}l.push({id:U||"",pluginName:P||i,text:b||"",location:Ae(j,q,u),notes:S,detail:n?n.store(L):-1}),g++}return l}function ge(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${V(t)} must be an array of strings`);n.push(i)}return n}function tt(e,t){let n=Object.create(null);for(let i in e){let u=e[i];if(typeof u!="string")throw new Error(`key ${V(i)} in object ${V(t)} must be a string`);n[i]=u}return n}function nt({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let u=this.contents;return(i===null||u!==t)&&(t=u,i=re(u)),i}}}var it="0.24.2",lt=e=>fe().build(e),st=e=>fe().context(e),ot=(e,t)=>fe().transform(e,t),at=(e,t)=>fe().formatMessages(e,t),ut=(e,t)=>fe().analyzeMetafile(e,t),ct=()=>{throw new Error('The "buildSync" API only works in node')},ft=()=>{throw new Error('The "transformSync" API only works in node')},dt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},pt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},gt=()=>(be&&be(),Promise.resolve()),se,be,we,fe=()=>{if(we)return we;throw se?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},mt=e=>{e=De(e||{});let t=e.wasmURL,n=e.wasmModule,i=e.worker!==!1;if(!t&&!n)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(se)throw new Error('Cannot call "initialize" more than once');return se=yt(t||"",n,i),se.catch(()=>{se=void 0}),se},yt=async(e,t,n)=>{let i,u,l=new Promise(b=>u=b);if(n){let b=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nlet onmessage,globalThis={};for(let i=self;i;i=Object.getPrototypeOf(i))for(let f of Object.getOwnPropertyNames(i))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const i=()=>{const u=new Error("not implemented");return u.code="ENOSYS",u};if(!globalThis.fs){let u="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(r,s){u+=y.decode(s);const n=u.lastIndexOf(`\n`);return n!=-1&&(console.log(u.substring(0,n)),u=u.substring(n+1)),s.length},write(r,s,n,o,c,m){if(n!==0||o!==s.length||c!==null){m(i());return}const h=this.writeSync(r,s);m(null,h)},chmod(r,s,n){n(i())},chown(r,s,n,o){o(i())},close(r,s){s(i())},fchmod(r,s,n){n(i())},fchown(r,s,n,o){o(i())},fstat(r,s){s(i())},fsync(r,s){s(null)},ftruncate(r,s,n){n(i())},lchown(r,s,n,o){o(i())},link(r,s,n){n(i())},lstat(r,s){s(i())},mkdir(r,s,n){n(i())},open(r,s,n,o){o(i())},read(r,s,n,o,c,m){m(i())},readdir(r,s){s(i())},readlink(r,s){s(i())},rename(r,s,n){n(i())},rmdir(r,s){s(i())},stat(r,s){s(i())},symlink(r,s,n){n(i())},truncate(r,s,n){n(i())},unlink(r,s){s(i())},utimes(r,s,n,o){o(i())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw i()},pid:-1,ppid:-1,umask(){throw i()},cwd(){throw i()},chdir(){throw i()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),y=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const u=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},r=(e,t)=>{this.mem.setUint32(e+0,t,!0)},s=e=>{const t=this.mem.getUint32(e+0,!0),l=this.mem.getInt32(e+4,!0);return t+l*4294967296},n=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const l=this.mem.getUint32(e,!0);return this._values[l]},o=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let g=0;switch(typeof t){case"object":t!==null&&(g=1);break;case"string":g=2;break;case"symbol":g=3;break;case"function":g=4;break}this.mem.setUint32(e+4,2146959360|g,!0),this.mem.setUint32(e,a,!0)},c=e=>{const t=s(e+0),l=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,l)},m=e=>{const t=s(e+0),l=s(e+8),a=new Array(l);for(let g=0;g<l;g++)a[g]=n(t+g*8);return a},h=e=>{const t=s(e+0),l=s(e+8);return y.decode(new DataView(this._inst.exports.mem.buffer,t,l))},d=Date.now()-performance.now();this.importObject={_gotest:{add:(e,t)=>e+t},gojs:{"runtime.wasmExit":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e=Number(e);const t=s(e+8),l=s(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":e=>{e=Number(e),this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e=Number(e),u(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e=Number(e);const t=new Date().getTime();u(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e=Number(e);const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8))),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e=Number(e),crypto.getRandomValues(c(e+8))},"syscall/js.finalizeRef":e=>{e=Number(e);const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const l=this._values[t];this._values[t]=null,this._ids.delete(l),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e=Number(e),o(e+24,h(e+8))},"syscall/js.valueGet":e=>{e=Number(e);const t=Reflect.get(n(e+8),h(e+16));e=Number(this._inst.exports.getsp()),o(e+32,t)},"syscall/js.valueSet":e=>{e=Number(e),Reflect.set(n(e+8),h(e+16),n(e+32))},"syscall/js.valueDelete":e=>{e=Number(e),Reflect.deleteProperty(n(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e=Number(e),o(e+24,Reflect.get(n(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e=Number(e),Reflect.set(n(e+8),s(e+16),n(e+24))},"syscall/js.valueCall":e=>{e=Number(e);try{const t=n(e+8),l=Reflect.get(t,h(e+16)),a=m(e+32),g=Reflect.apply(l,t,a);e=Number(this._inst.exports.getsp()),o(e+56,g),this.mem.setUint8(e+64,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.apply(t,void 0,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.construct(t,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e=Number(e),u(e+16,parseInt(n(e+8).length))},"syscall/js.valuePrepareString":e=>{e=Number(e);const t=f.encode(String(n(e+8)));o(e+16,t),u(e+24,t.length)},"syscall/js.valueLoadString":e=>{e=Number(e);const t=n(e+8);c(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e=Number(e),this.mem.setUint8(e+24,n(e+8)instanceof n(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e=Number(e);const t=c(e+8),l=n(e+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),u(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e=Number(e);const t=n(e+8),l=c(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),u(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(u){if(!(u instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=u,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let r=4096;const s=d=>{const e=r,t=f.encode(d+"\\0");return new Uint8Array(this.mem.buffer,r,t.length).set(t),r+=t.length,r%8!==0&&(r+=8-r%8),e},n=this.argv.length,o=[];this.argv.forEach(d=>{o.push(s(d))}),o.push(0),Object.keys(this.env).sort().forEach(d=>{o.push(s(`${d}=${this.env[d]}`))}),o.push(0);const m=r;if(o.forEach(d=>{this.mem.setUint32(r,d,!0),this.mem.setUint32(r+4,0,!0),r+=8}),r>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,m),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(u){const r=this;return function(){const s={id:u,this:this,args:arguments};return r._pendingEvent=s,r._resume(),s.result}}}})(),onmessage=({data:i})=>{let f=new TextDecoder,y=globalThis.fs,u="";y.writeSync=(c,m)=>{if(c===1)postMessage(m);else if(c===2){u+=f.decode(m);let h=u.split(`\n`);h.length>1&&console.log(h.slice(0,-1).join(`\n`)),u=h[h.length-1]}else throw new Error("Bad write");return m.length};let r=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(r.push(c),s&&s()),o),y.read=(c,m,h,d,e,t)=>{if(c!==0||h!==0||d!==m.length||e!==null)throw new Error("Bad read");if(r.length===0){s=()=>y.read(c,m,h,d,e,t);return}let l=r[0],a=Math.max(0,Math.min(d,l.length-n));m.set(l.subarray(n,n+a),h),n+=a,n===l.length&&(r.shift(),n=0),t(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.2"],tryToInstantiateModule(i,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};async function tryToInstantiateModule(i,f){if(i instanceof WebAssembly.Module)return WebAssembly.instantiate(i,f.importObject);const y=await fetch(i);if(!y.ok)throw new Error(`Failed to download ${JSON.stringify(i)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(y.headers.get("Content-Type")||""))return(await WebAssembly.instantiateStreaming(y,f.importObject)).instance;const u=await y.arrayBuffer();return(await WebAssembly.instantiate(u,f.importObject)).instance}return i=>onmessage(i);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(b))}else{let b=(postMessage=>{
|
|
14
14
|
// Copyright 2018 The Go Authors. All rights reserved.
|
|
15
15
|
// Use of this source code is governed by a BSD-style
|
|
16
16
|
// license that can be found in the LICENSE file.
|
|
17
17
|
let onmessage,globalThis={};for(let i=self;i;i=Object.getPrototypeOf(i))for(let f of Object.getOwnPropertyNames(i))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const i=()=>{const u=new Error("not implemented");return u.code="ENOSYS",u};if(!globalThis.fs){let u="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(r,s){u+=y.decode(s);const n=u.lastIndexOf(`
|
|
18
18
|
`);return n!=-1&&(console.log(u.substring(0,n)),u=u.substring(n+1)),s.length},write(r,s,n,o,c,m){if(n!==0||o!==s.length||c!==null){m(i());return}const h=this.writeSync(r,s);m(null,h)},chmod(r,s,n){n(i())},chown(r,s,n,o){o(i())},close(r,s){s(i())},fchmod(r,s,n){n(i())},fchown(r,s,n,o){o(i())},fstat(r,s){s(i())},fsync(r,s){s(null)},ftruncate(r,s,n){n(i())},lchown(r,s,n,o){o(i())},link(r,s,n){n(i())},lstat(r,s){s(i())},mkdir(r,s,n){n(i())},open(r,s,n,o){o(i())},read(r,s,n,o,c,m){m(i())},readdir(r,s){s(i())},readlink(r,s){s(i())},rename(r,s,n){n(i())},rmdir(r,s){s(i())},stat(r,s){s(i())},symlink(r,s,n){n(i())},truncate(r,s,n){n(i())},unlink(r,s){s(i())},utimes(r,s,n,o){o(i())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw i()},pid:-1,ppid:-1,umask(){throw i()},cwd(){throw i()},chdir(){throw i()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),y=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const u=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},r=(e,t)=>{this.mem.setUint32(e+0,t,!0)},s=e=>{const t=this.mem.getUint32(e+0,!0),l=this.mem.getInt32(e+4,!0);return t+l*4294967296},n=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const l=this.mem.getUint32(e,!0);return this._values[l]},o=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let g=0;switch(typeof t){case"object":t!==null&&(g=1);break;case"string":g=2;break;case"symbol":g=3;break;case"function":g=4;break}this.mem.setUint32(e+4,2146959360|g,!0),this.mem.setUint32(e,a,!0)},c=e=>{const t=s(e+0),l=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,l)},m=e=>{const t=s(e+0),l=s(e+8),a=new Array(l);for(let g=0;g<l;g++)a[g]=n(t+g*8);return a},h=e=>{const t=s(e+0),l=s(e+8);return y.decode(new DataView(this._inst.exports.mem.buffer,t,l))},d=Date.now()-performance.now();this.importObject={_gotest:{add:(e,t)=>e+t},gojs:{"runtime.wasmExit":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e=Number(e);const t=s(e+8),l=s(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":e=>{e=Number(e),this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e=Number(e),u(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e=Number(e);const t=new Date().getTime();u(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e=Number(e);const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8))),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e=Number(e),crypto.getRandomValues(c(e+8))},"syscall/js.finalizeRef":e=>{e=Number(e);const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const l=this._values[t];this._values[t]=null,this._ids.delete(l),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e=Number(e),o(e+24,h(e+8))},"syscall/js.valueGet":e=>{e=Number(e);const t=Reflect.get(n(e+8),h(e+16));e=Number(this._inst.exports.getsp()),o(e+32,t)},"syscall/js.valueSet":e=>{e=Number(e),Reflect.set(n(e+8),h(e+16),n(e+32))},"syscall/js.valueDelete":e=>{e=Number(e),Reflect.deleteProperty(n(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e=Number(e),o(e+24,Reflect.get(n(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e=Number(e),Reflect.set(n(e+8),s(e+16),n(e+24))},"syscall/js.valueCall":e=>{e=Number(e);try{const t=n(e+8),l=Reflect.get(t,h(e+16)),a=m(e+32),g=Reflect.apply(l,t,a);e=Number(this._inst.exports.getsp()),o(e+56,g),this.mem.setUint8(e+64,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.apply(t,void 0,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.construct(t,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e=Number(e),u(e+16,parseInt(n(e+8).length))},"syscall/js.valuePrepareString":e=>{e=Number(e);const t=f.encode(String(n(e+8)));o(e+16,t),u(e+24,t.length)},"syscall/js.valueLoadString":e=>{e=Number(e);const t=n(e+8);c(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e=Number(e),this.mem.setUint8(e+24,n(e+8)instanceof n(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e=Number(e);const t=c(e+8),l=n(e+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),u(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e=Number(e);const t=n(e+8),l=c(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),u(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(u){if(!(u instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=u,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let r=4096;const s=d=>{const e=r,t=f.encode(d+"\0");return new Uint8Array(this.mem.buffer,r,t.length).set(t),r+=t.length,r%8!==0&&(r+=8-r%8),e},n=this.argv.length,o=[];this.argv.forEach(d=>{o.push(s(d))}),o.push(0),Object.keys(this.env).sort().forEach(d=>{o.push(s(`${d}=${this.env[d]}`))}),o.push(0);const m=r;if(o.forEach(d=>{this.mem.setUint32(r,d,!0),this.mem.setUint32(r+4,0,!0),r+=8}),r>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,m),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(u){const r=this;return function(){const s={id:u,this:this,args:arguments};return r._pendingEvent=s,r._resume(),s.result}}}})(),onmessage=({data:i})=>{let f=new TextDecoder,y=globalThis.fs,u="";y.writeSync=(c,m)=>{if(c===1)postMessage(m);else if(c===2){u+=f.decode(m);let h=u.split(`
|
|
19
19
|
`);h.length>1&&console.log(h.slice(0,-1).join(`
|
|
20
|
-
`)),u=h[h.length-1]}else throw new Error("Bad write");return m.length};let r=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(r.push(c),s&&s()),o),y.read=(c,m,h,d,e,t)=>{if(c!==0||h!==0||d!==m.length||e!==null)throw new Error("Bad read");if(r.length===0){s=()=>y.read(c,m,h,d,e,t);return}let l=r[0],a=Math.max(0,Math.min(d,l.length-n));m.set(l.subarray(n,n+a),h),n+=a,n===l.length&&(r.shift(),n=0),t(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.
|
|
20
|
+
`)),u=h[h.length-1]}else throw new Error("Bad write");return m.length};let r=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(r.push(c),s&&s()),o),y.read=(c,m,h,d,e,t)=>{if(c!==0||h!==0||d!==m.length||e!==null)throw new Error("Bad read");if(r.length===0){s=()=>y.read(c,m,h,d,e,t);return}let l=r[0],a=Math.max(0,Math.min(d,l.length-n));m.set(l.subarray(n,n+a),h),n+=a,n===l.length&&(r.shift(),n=0),t(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.2"],tryToInstantiateModule(i,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};async function tryToInstantiateModule(i,f){if(i instanceof WebAssembly.Module)return WebAssembly.instantiate(i,f.importObject);const y=await fetch(i);if(!y.ok)throw new Error(`Failed to download ${JSON.stringify(i)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(y.headers.get("Content-Type")||""))return(await WebAssembly.instantiateStreaming(y,f.importObject)).instance;const u=await y.arrayBuffer();return(await WebAssembly.instantiate(u,f.importObject)).instance}return i=>onmessage(i);})(T=>i.onmessage({data:T})),j;i={onmessage:null,postMessage:T=>setTimeout(()=>{try{j=b({data:T})}catch(L){u(L)}}),terminate(){if(j)for(let T of j._scheduledTimeouts.values())clearTimeout(T)}}}let g,s,m=new Promise((b,j)=>{g=b,s=j});i.onmessage=({data:b})=>{i.onmessage=({data:j})=>U(j),b?s(b):g()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:U,service:P}=je({writeToStdin(b){i.postMessage(b)},isSync:!1,hasFS:!1,esbuild:ve});await m,be=()=>{i.terminate(),se=void 0,be=void 0,we=void 0},we={build:b=>new Promise((j,T)=>{l.then(T),P.buildOrContext({callName:"build",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,q)=>L?T(L):j(q)})}),context:b=>new Promise((j,T)=>{l.then(T),P.buildOrContext({callName:"context",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,q)=>L?T(L):j(q)})}),transform:(b,j)=>new Promise((T,L)=>{l.then(L),P.transform({callName:"transform",refs:null,input:b,options:j||{},isTTY:!1,fs:{readFile(q,S){S(new Error("Internal error"),null)},writeFile(q,S){S(null)}},callback:(q,S)=>q?L(q):T(S)})}),formatMessages:(b,j)=>new Promise((T,L)=>{l.then(L),P.formatMessages({callName:"formatMessages",refs:null,messages:b,options:j,callback:(q,S)=>q?L(q):T(S)})}),analyzeMetafile:(b,j)=>new Promise((T,L)=>{l.then(L),P.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof b=="string"?b:JSON.stringify(b),options:j,callback:(q,S)=>q?L(q):T(S)})})}},ht=ve;export{ut as analyzeMetafile,pt as analyzeMetafileSync,lt as build,ct as buildSync,st as context,ht as default,at as formatMessages,dt as formatMessagesSync,mt as initialize,gt as stop,ot as transform,ft as transformSync,it as version};
|
package/lib/browser.js
CHANGED
|
@@ -673,8 +673,8 @@ function createChannel(streamIn) {
|
|
|
673
673
|
if (isFirstPacket) {
|
|
674
674
|
isFirstPacket = false;
|
|
675
675
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
676
|
-
if (binaryVersion !== "0.24.
|
|
677
|
-
throw new Error(`Cannot start service: Host version "${"0.24.
|
|
676
|
+
if (binaryVersion !== "0.24.2") {
|
|
677
|
+
throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`);
|
|
678
678
|
}
|
|
679
679
|
return;
|
|
680
680
|
}
|
|
@@ -1608,7 +1608,7 @@ function convertOutputFiles({ path, contents, hash }) {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
|
|
1610
1610
|
// lib/npm/browser.ts
|
|
1611
|
-
var version = "0.24.
|
|
1611
|
+
var version = "0.24.2";
|
|
1612
1612
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
1613
1613
|
var context = (options) => ensureServiceIsRunning().context(options);
|
|
1614
1614
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
|
@@ -1656,7 +1656,7 @@ var startRunningService = (wasmURL, wasmModule, useWorker) => __async(void 0, nu
|
|
|
1656
1656
|
let rejectAllWith;
|
|
1657
1657
|
const rejectAllPromise = new Promise((resolve) => rejectAllWith = resolve);
|
|
1658
1658
|
if (useWorker) {
|
|
1659
|
-
let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n var __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n };\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n // unused\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substring(0, nl));\n outputBuf = outputBuf.substring(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const setInt32 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n _gotest: {\n add: (a, b) => a + b\n },\n gojs: {\n // Go\'s SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n // This changes the SP, thus we have to update the SP used by the imported function.\n // func wasmExit(code int32)\n "runtime.wasmExit": (sp) => {\n sp = Number(sp);\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n "runtime.wasmWrite": (sp) => {\n sp = Number(sp);\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n // func resetMemoryDataView()\n "runtime.resetMemoryDataView": (sp) => {\n sp = Number(sp);\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n // func nanotime1() int64\n "runtime.nanotime1": (sp) => {\n sp = Number(sp);\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n // func walltime() (sec int64, nsec int32)\n "runtime.walltime": (sp) => {\n sp = Number(sp);\n const msec = (/* @__PURE__ */ new Date()).getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n // func scheduleTimeoutEvent(delay int64) int32\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp = Number(sp);\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n },\n getInt64(sp + 8)\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n // func clearTimeoutEvent(id int32)\n "runtime.clearTimeoutEvent": (sp) => {\n sp = Number(sp);\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n // func getRandomData(r []byte)\n "runtime.getRandomData": (sp) => {\n sp = Number(sp);\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n // func finalizeRef(v ref)\n "syscall/js.finalizeRef": (sp) => {\n sp = Number(sp);\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n // func stringVal(value string) ref\n "syscall/js.stringVal": (sp) => {\n sp = Number(sp);\n storeValue(sp + 24, loadString(sp + 8));\n },\n // func valueGet(v ref, p string) ref\n "syscall/js.valueGet": (sp) => {\n sp = Number(sp);\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 32, result);\n },\n // func valueSet(v ref, p string, x ref)\n "syscall/js.valueSet": (sp) => {\n sp = Number(sp);\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n // func valueDelete(v ref, p string)\n "syscall/js.valueDelete": (sp) => {\n sp = Number(sp);\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n // func valueIndex(v ref, i int) ref\n "syscall/js.valueIndex": (sp) => {\n sp = Number(sp);\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n // valueSetIndex(v ref, i int, x ref)\n "syscall/js.valueSetIndex": (sp) => {\n sp = Number(sp);\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n // func valueCall(v ref, m string, args []ref) (ref, bool)\n "syscall/js.valueCall": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n // func valueInvoke(v ref, args []ref) (ref, bool)\n "syscall/js.valueInvoke": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueNew(v ref, args []ref) (ref, bool)\n "syscall/js.valueNew": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueLength(v ref) int\n "syscall/js.valueLength": (sp) => {\n sp = Number(sp);\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n // valuePrepareString(v ref) (ref, int)\n "syscall/js.valuePrepareString": (sp) => {\n sp = Number(sp);\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n // valueLoadString(v ref, b []byte)\n "syscall/js.valueLoadString": (sp) => {\n sp = Number(sp);\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n // func valueInstanceOf(v ref, t ref) bool\n "syscall/js.valueInstanceOf": (sp) => {\n sp = Number(sp);\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n // func copyBytesToGo(dst []byte, src ref) (int, bool)\n "syscall/js.copyBytesToGo": (sp) => {\n sp = Number(sp);\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n // func copyBytesToJS(dst ref, src []byte) (int, bool)\n "syscall/js.copyBytesToJS": (sp) => {\n sp = Number(sp);\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n run(instance) {\n return __async(this, null, function* () {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n // JS values that Go currently has references to, indexed by reference id\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n // mapping from JS values to reference ids\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n yield this._exitPromise;\n });\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1) console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin) resumeStdin();\n }\n return go;\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.24.0"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\n return go;\n };\n function tryToInstantiateModule(wasm, go) {\n return __async(this, null, function* () {\n if (wasm instanceof WebAssembly.Module) {\n return WebAssembly.instantiate(wasm, go.importObject);\n }\n const res = yield fetch(wasm);\n if (!res.ok) throw new Error(`Failed to download ${JSON.stringify(wasm)}`);\n if ("instantiateStreaming" in WebAssembly && /^application\\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) {\n const result2 = yield WebAssembly.instantiateStreaming(res, go.importObject);\n return result2.instance;\n }\n const bytes = yield res.arrayBuffer();\n const result = yield WebAssembly.instantiate(bytes, go.importObject);\n return result.instance;\n });\n }\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
|
|
1659
|
+
let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n var __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n };\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n // unused\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substring(0, nl));\n outputBuf = outputBuf.substring(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const setInt32 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n _gotest: {\n add: (a, b) => a + b\n },\n gojs: {\n // Go\'s SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n // This changes the SP, thus we have to update the SP used by the imported function.\n // func wasmExit(code int32)\n "runtime.wasmExit": (sp) => {\n sp = Number(sp);\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n "runtime.wasmWrite": (sp) => {\n sp = Number(sp);\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n // func resetMemoryDataView()\n "runtime.resetMemoryDataView": (sp) => {\n sp = Number(sp);\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n // func nanotime1() int64\n "runtime.nanotime1": (sp) => {\n sp = Number(sp);\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n // func walltime() (sec int64, nsec int32)\n "runtime.walltime": (sp) => {\n sp = Number(sp);\n const msec = (/* @__PURE__ */ new Date()).getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n // func scheduleTimeoutEvent(delay int64) int32\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp = Number(sp);\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n },\n getInt64(sp + 8)\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n // func clearTimeoutEvent(id int32)\n "runtime.clearTimeoutEvent": (sp) => {\n sp = Number(sp);\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n // func getRandomData(r []byte)\n "runtime.getRandomData": (sp) => {\n sp = Number(sp);\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n // func finalizeRef(v ref)\n "syscall/js.finalizeRef": (sp) => {\n sp = Number(sp);\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n // func stringVal(value string) ref\n "syscall/js.stringVal": (sp) => {\n sp = Number(sp);\n storeValue(sp + 24, loadString(sp + 8));\n },\n // func valueGet(v ref, p string) ref\n "syscall/js.valueGet": (sp) => {\n sp = Number(sp);\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 32, result);\n },\n // func valueSet(v ref, p string, x ref)\n "syscall/js.valueSet": (sp) => {\n sp = Number(sp);\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n // func valueDelete(v ref, p string)\n "syscall/js.valueDelete": (sp) => {\n sp = Number(sp);\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n // func valueIndex(v ref, i int) ref\n "syscall/js.valueIndex": (sp) => {\n sp = Number(sp);\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n // valueSetIndex(v ref, i int, x ref)\n "syscall/js.valueSetIndex": (sp) => {\n sp = Number(sp);\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n // func valueCall(v ref, m string, args []ref) (ref, bool)\n "syscall/js.valueCall": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n // func valueInvoke(v ref, args []ref) (ref, bool)\n "syscall/js.valueInvoke": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueNew(v ref, args []ref) (ref, bool)\n "syscall/js.valueNew": (sp) => {\n sp = Number(sp);\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = Number(this._inst.exports.getsp());\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n // func valueLength(v ref) int\n "syscall/js.valueLength": (sp) => {\n sp = Number(sp);\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n // valuePrepareString(v ref) (ref, int)\n "syscall/js.valuePrepareString": (sp) => {\n sp = Number(sp);\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n // valueLoadString(v ref, b []byte)\n "syscall/js.valueLoadString": (sp) => {\n sp = Number(sp);\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n // func valueInstanceOf(v ref, t ref) bool\n "syscall/js.valueInstanceOf": (sp) => {\n sp = Number(sp);\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n // func copyBytesToGo(dst []byte, src ref) (int, bool)\n "syscall/js.copyBytesToGo": (sp) => {\n sp = Number(sp);\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n // func copyBytesToJS(dst ref, src []byte) (int, bool)\n "syscall/js.copyBytesToJS": (sp) => {\n sp = Number(sp);\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n run(instance) {\n return __async(this, null, function* () {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n // JS values that Go currently has references to, indexed by reference id\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n // mapping from JS values to reference ids\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n yield this._exitPromise;\n });\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1) console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin) resumeStdin();\n }\n return go;\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.24.2"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\n return go;\n };\n function tryToInstantiateModule(wasm, go) {\n return __async(this, null, function* () {\n if (wasm instanceof WebAssembly.Module) {\n return WebAssembly.instantiate(wasm, go.importObject);\n }\n const res = yield fetch(wasm);\n if (!res.ok) throw new Error(`Failed to download ${JSON.stringify(wasm)}`);\n if ("instantiateStreaming" in WebAssembly && /^application\\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) {\n const result2 = yield WebAssembly.instantiateStreaming(res, go.importObject);\n return result2.instance;\n }\n const bytes = yield res.arrayBuffer();\n const result = yield WebAssembly.instantiate(bytes, go.importObject);\n return result.instance;\n });\n }\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
|
|
1660
1660
|
worker = new Worker(URL.createObjectURL(blob));
|
|
1661
1661
|
} else {
|
|
1662
1662
|
let onmessage = ((postMessage) => {
|
|
@@ -2296,7 +2296,7 @@ var startRunningService = (wasmURL, wasmModule, useWorker) => __async(void 0, nu
|
|
|
2296
2296
|
callback(null, count);
|
|
2297
2297
|
};
|
|
2298
2298
|
let go = new globalThis.Go();
|
|
2299
|
-
go.argv = ["", `--service=${"0.24.
|
|
2299
|
+
go.argv = ["", `--service=${"0.24.2"}`];
|
|
2300
2300
|
tryToInstantiateModule(wasm, go).then(
|
|
2301
2301
|
(instance) => {
|
|
2302
2302
|
postMessage(null);
|
package/lib/browser.min.js
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
This indicates that your JavaScript environment is broken. You cannot use
|
|
5
5
|
esbuild in this environment because esbuild relies on this invariant. This
|
|
6
6
|
is not a problem with esbuild. You need to fix your environment instead.
|
|
7
|
-
`);function ke(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ee(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var V=JSON.stringify,Me="warning",Ce="silent";function Ae(e){if(G(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var ye=()=>null,W=e=>typeof e=="boolean"?null:"a boolean",y=e=>typeof e=="string"?null:"a string",he=e=>e instanceof RegExp?null:"a RegExp object",se=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Te=e=>typeof e=="function"?null:"a function",K=e=>Array.isArray(e)?null:"an array",ee=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Xe=e=>typeof e=="object"&&e!==null?null:"an array or an object",Ze=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Pe=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",De=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",et=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",tt=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Be=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",nt=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let a=e[n];if(t[n+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`${V(n)} must be ${l}`);return a}function Y(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${V(i)}`)}function Ue(e){let t=Object.create(null),n=r(e,t,"wasmURL",nt),i=r(e,t,"wasmModule",Ze),a=r(e,t,"worker",W);return Y(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:a}}function je(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let i=e[n];if(typeof i=="string"||i===!1)t[n]=i;else throw new Error(`Expected ${V(n)} in mangle cache to map to either a string or false`)}}return t}function be(e,t,n,i,a){let l=r(t,n,"color",W),p=r(t,n,"logLevel",y),s=r(t,n,"logLimit",se);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${p||a}`),e.push(`--log-limit=${s||0}`)}function G(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+V(n):""} to be a string, got ${typeof e} instead`);return e}function Le(e,t,n){let i=r(t,n,"legalComments",y),a=r(t,n,"sourceRoot",y),l=r(t,n,"sourcesContent",W),p=r(t,n,"target",tt),s=r(t,n,"format",y),d=r(t,n,"globalName",y),F=r(t,n,"mangleProps",he),A=r(t,n,"reserveProps",he),b=r(t,n,"mangleQuoted",W),j=r(t,n,"minify",W),T=r(t,n,"minifySyntax",W),L=r(t,n,"minifyWhitespace",W),q=r(t,n,"minifyIdentifiers",W),E=r(t,n,"lineLimit",se),_=r(t,n,"drop",K),J=r(t,n,"dropLabels",K),w=r(t,n,"charset",y),m=r(t,n,"treeShaking",W),f=r(t,n,"ignoreAnnotations",W),o=r(t,n,"jsx",y),v=r(t,n,"jsxFactory",y),O=r(t,n,"jsxFragment",y),M=r(t,n,"jsxImportSource",y),D=r(t,n,"jsxDev",W),u=r(t,n,"jsxSideEffects",W),c=r(t,n,"define",ee),h=r(t,n,"logOverride",ee),S=r(t,n,"supported",ee),P=r(t,n,"pure",K),$=r(t,n,"keepNames",W),x=r(t,n,"platform",y),C=r(t,n,"tsconfigRaw",et);if(i&&e.push(`--legal-comments=${i}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),p&&(Array.isArray(p)?e.push(`--target=${Array.from(p).map(Ae).join(",")}`):e.push(`--target=${Ae(p)}`)),s&&e.push(`--format=${s}`),d&&e.push(`--global-name=${d}`),x&&e.push(`--platform=${x}`),C&&e.push(`--tsconfig-raw=${typeof C=="string"?C:JSON.stringify(C)}`),j&&e.push("--minify"),T&&e.push("--minify-syntax"),L&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),E&&e.push(`--line-limit=${E}`),w&&e.push(`--charset=${w}`),m!==void 0&&e.push(`--tree-shaking=${m}`),f&&e.push("--ignore-annotations"),_)for(let R of _)e.push(`--drop:${G(R,"drop")}`);if(J&&e.push(`--drop-labels=${Array.from(J).map(R=>G(R,"dropLabels")).join(",")}`),F&&e.push(`--mangle-props=${F.source}`),A&&e.push(`--reserve-props=${A.source}`),b!==void 0&&e.push(`--mangle-quoted=${b}`),o&&e.push(`--jsx=${o}`),v&&e.push(`--jsx-factory=${v}`),O&&e.push(`--jsx-fragment=${O}`),M&&e.push(`--jsx-import-source=${M}`),D&&e.push("--jsx-dev"),u&&e.push("--jsx-side-effects"),c)for(let R in c){if(R.indexOf("=")>=0)throw new Error(`Invalid define: ${R}`);e.push(`--define:${R}=${G(c[R],"define",R)}`)}if(h)for(let R in h){if(R.indexOf("=")>=0)throw new Error(`Invalid log override: ${R}`);e.push(`--log-override:${R}=${G(h[R],"log override",R)}`)}if(S)for(let R in S){if(R.indexOf("=")>=0)throw new Error(`Invalid supported: ${R}`);let k=S[R];if(typeof k!="boolean")throw new Error(`Expected value for supported ${V(R)} to be a boolean, got ${typeof k} instead`);e.push(`--supported:${R}=${k}`)}if(P)for(let R of P)e.push(`--pure:${G(R,"pure")}`);$&&e.push("--keep-names")}function rt(e,t,n,i,a){var ae;let l=[],p=[],s=Object.create(null),d=null,F=null;be(l,t,s,n,i),Le(l,t,s);let A=r(t,s,"sourcemap",De),b=r(t,s,"bundle",W),j=r(t,s,"splitting",W),T=r(t,s,"preserveSymlinks",W),L=r(t,s,"metafile",W),q=r(t,s,"outfile",y),E=r(t,s,"outdir",y),_=r(t,s,"outbase",y),J=r(t,s,"tsconfig",y),w=r(t,s,"resolveExtensions",K),m=r(t,s,"nodePaths",K),f=r(t,s,"mainFields",K),o=r(t,s,"conditions",K),v=r(t,s,"external",K),O=r(t,s,"packages",y),M=r(t,s,"alias",ee),D=r(t,s,"loader",ee),u=r(t,s,"outExtension",ee),c=r(t,s,"publicPath",y),h=r(t,s,"entryNames",y),S=r(t,s,"chunkNames",y),P=r(t,s,"assetNames",y),$=r(t,s,"inject",K),x=r(t,s,"banner",ee),C=r(t,s,"footer",ee),R=r(t,s,"entryPoints",Xe),k=r(t,s,"absWorkingDir",y),B=r(t,s,"stdin",ee),N=(ae=r(t,s,"write",W))!=null?ae:a,U=r(t,s,"allowOverwrite",W),H=r(t,s,"mangleCache",ee);if(s.plugins=!0,Y(t,s,`in ${e}() call`),A&&l.push(`--sourcemap${A===!0?"":`=${A}`}`),b&&l.push("--bundle"),U&&l.push("--allow-overwrite"),j&&l.push("--splitting"),T&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),q&&l.push(`--outfile=${q}`),E&&l.push(`--outdir=${E}`),_&&l.push(`--outbase=${_}`),J&&l.push(`--tsconfig=${J}`),O&&l.push(`--packages=${O}`),w){let g=[];for(let I of w){if(G(I,"resolve extension"),I.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${I}`);g.push(I)}l.push(`--resolve-extensions=${g.join(",")}`)}if(c&&l.push(`--public-path=${c}`),h&&l.push(`--entry-names=${h}`),S&&l.push(`--chunk-names=${S}`),P&&l.push(`--asset-names=${P}`),f){let g=[];for(let I of f){if(G(I,"main field"),I.indexOf(",")>=0)throw new Error(`Invalid main field: ${I}`);g.push(I)}l.push(`--main-fields=${g.join(",")}`)}if(o){let g=[];for(let I of o){if(G(I,"condition"),I.indexOf(",")>=0)throw new Error(`Invalid condition: ${I}`);g.push(I)}l.push(`--conditions=${g.join(",")}`)}if(v)for(let g of v)l.push(`--external:${G(g,"external")}`);if(M)for(let g in M){if(g.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${g}`);l.push(`--alias:${g}=${G(M[g],"alias",g)}`)}if(x)for(let g in x){if(g.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${g}`);l.push(`--banner:${g}=${G(x[g],"banner",g)}`)}if(C)for(let g in C){if(g.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${g}`);l.push(`--footer:${g}=${G(C[g],"footer",g)}`)}if($)for(let g of $)l.push(`--inject:${G(g,"inject")}`);if(D)for(let g in D){if(g.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${g}`);l.push(`--loader:${g}=${G(D[g],"loader",g)}`)}if(u)for(let g in u){if(g.indexOf("=")>=0)throw new Error(`Invalid out extension: ${g}`);l.push(`--out-extension:${g}=${G(u[g],"out extension",g)}`)}if(R)if(Array.isArray(R))for(let g=0,I=R.length;g<I;g++){let X=R[g];if(typeof X=="object"&&X!==null){let te=Object.create(null),Q=r(X,te,"in",y),ce=r(X,te,"out",y);if(Y(X,te,"in entry point at index "+g),Q===void 0)throw new Error('Missing property "in" for entry point at index '+g);if(ce===void 0)throw new Error('Missing property "out" for entry point at index '+g);p.push([ce,Q])}else p.push(["",G(X,"entry point at index "+g)])}else for(let g in R)p.push([g,G(R[g],"entry point",g)]);if(B){let g=Object.create(null),I=r(B,g,"contents",Be),X=r(B,g,"resolveDir",y),te=r(B,g,"sourcefile",y),Q=r(B,g,"loader",y);Y(B,g,'in "stdin" object'),te&&l.push(`--sourcefile=${te}`),Q&&l.push(`--loader=${Q}`),X&&(F=X),typeof I=="string"?d=Z(I):I instanceof Uint8Array&&(d=I)}let z=[];if(m)for(let g of m)g+="",z.push(g);return{entries:p,flags:l,write:N,stdinContents:d,stdinResolveDir:F,absWorkingDir:k,nodePaths:z,mangleCache:je(H)}}function it(e,t,n,i){let a=[],l=Object.create(null);be(a,t,l,n,i),Le(a,t,l);let p=r(t,l,"sourcemap",De),s=r(t,l,"sourcefile",y),d=r(t,l,"loader",y),F=r(t,l,"banner",y),A=r(t,l,"footer",y),b=r(t,l,"mangleCache",ee);return Y(t,l,`in ${e}() call`),p&&a.push(`--sourcemap=${p===!0?"external":p}`),s&&a.push(`--sourcefile=${s}`),d&&a.push(`--loader=${d}`),F&&a.push(`--banner=${F}`),A&&a.push(`--footer=${A}`),{flags:a,mangleCache:je(b)}}function qe(e){let t={},n={didClose:!1,reason:""},i={},a=0,l=0,p=new Uint8Array(16*1024),s=0,d=w=>{let m=s+w.length;if(m>p.length){let o=new Uint8Array(m*2);o.set(p),p=o}p.set(w,s),s+=w.length;let f=0;for(;f+4<=s;){let o=ke(p,f);if(f+4+o>s)break;f+=4,L(p.subarray(f,f+o)),f+=o}f>0&&(p.copyWithin(0,f,s),s-=f)},F=w=>{n.didClose=!0,w&&(n.reason=": "+(w.message||w));let m="The service was stopped"+n.reason;for(let f in i)i[f](m,null);i={}},A=(w,m,f)=>{if(n.didClose)return f("The service is no longer running"+n.reason,null);let o=a++;i[o]=(v,O)=>{try{f(v,O)}finally{w&&w.unref()}},w&&w.ref(),e.writeToStdin(Se({id:o,isRequest:!0,value:m}))},b=(w,m)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);e.writeToStdin(Se({id:w,isRequest:!1,value:m}))},j=(w,m)=>ne(this,null,function*(){try{if(m.command==="ping"){b(w,{});return}if(typeof m.key=="number"){let f=t[m.key];if(!f)return;let o=f[m.command];if(o){yield o(w,m);return}}throw new Error("Invalid command: "+m.command)}catch(f){let o=[le(f,e,null,void 0,"")];try{b(w,{errors:o})}catch(v){}}}),T=!0,L=w=>{if(T){T=!1;let f=String.fromCharCode(...w);if(f!=="0.24.0")throw new Error(`Cannot start service: Host version "0.24.0" does not match binary version ${V(f)}`);return}let m=$e(w);if(m.isRequest)j(m.id,m.value);else{let f=i[m.id];delete i[m.id],m.value.error?f(m.value.error,{}):f(null,m.value)}};return{readFromStdout:d,afterClose:F,service:{buildOrContext:({callName:w,refs:m,options:f,isTTY:o,defaultWD:v,callback:O})=>{let M=0,D=l++,u={},c={ref(){++M===1&&m&&m.ref()},unref(){--M===0&&(delete t[D],m&&m.unref())}};t[D]=u,c.ref(),lt(w,D,A,b,c,e,u,f,o,v,(h,S)=>{try{O(h,S)}finally{c.unref()}})},transform:({callName:w,refs:m,input:f,options:o,isTTY:v,fs:O,callback:M})=>{let D=Ne(),u=c=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:h,mangleCache:S}=it(w,o,v,Ce),P={command:"transform",flags:h,inputFS:c!==null,input:c!==null?Z(c):typeof f=="string"?Z(f):f};S&&(P.mangleCache=S),A(m,P,($,x)=>{if($)return M(new Error($),null);let C=ue(x.errors,D),R=ue(x.warnings,D),k=1,B=()=>{if(--k===0){let N={warnings:R,code:x.code,map:x.map,mangleCache:void 0,legalComments:void 0};"legalComments"in x&&(N.legalComments=x==null?void 0:x.legalComments),x.mangleCache&&(N.mangleCache=x==null?void 0:x.mangleCache),M(null,N)}};if(C.length>0)return M(fe("Transform failed",C,R),null);x.codeFS&&(k++,O.readFile(x.code,(N,U)=>{N!==null?M(N,null):(x.code=U,B())})),x.mapFS&&(k++,O.readFile(x.map,(N,U)=>{N!==null?M(N,null):(x.map=U,B())})),B()})}catch(h){let S=[];try{be(S,o,{},v,Ce)}catch($){}let P=le(h,e,D,void 0,"");A(m,{command:"error",flags:S,error:P},()=>{P.detail=D.load(P.detail),M(fe("Transform failed",[P],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let c=u;u=()=>O.writeFile(f,c)}u(null)},formatMessages:({callName:w,refs:m,messages:f,options:o,callback:v})=>{if(!o)throw new Error(`Missing second argument in ${w}() call`);let O={},M=r(o,O,"kind",y),D=r(o,O,"color",W),u=r(o,O,"terminalWidth",se);if(Y(o,O,`in ${w}() call`),M===void 0)throw new Error(`Missing "kind" in ${w}() call`);if(M!=="error"&&M!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${w}() call`);let c={command:"format-msgs",messages:re(f,"messages",null,"",u),isWarning:M==="warning"};D!==void 0&&(c.color=D),u!==void 0&&(c.terminalWidth=u),A(m,c,(h,S)=>{if(h)return v(new Error(h),null);v(null,S.messages)})},analyzeMetafile:({callName:w,refs:m,metafile:f,options:o,callback:v})=>{o===void 0&&(o={});let O={},M=r(o,O,"color",W),D=r(o,O,"verbose",W);Y(o,O,`in ${w}() call`);let u={command:"analyze-metafile",metafile:f};M!==void 0&&(u.color=M),D!==void 0&&(u.verbose=D),A(m,u,(c,h)=>{if(c)return v(new Error(c),null);v(null,h.result)})}}}}function lt(e,t,n,i,a,l,p,s,d,F,A){let b=Ne(),j=e==="context",T=(E,_)=>{let J=[];try{be(J,s,{},d,Me)}catch(m){}let w=le(E,l,b,void 0,_);n(a,{command:"error",flags:J,error:w},()=>{w.detail=b.load(w.detail),A(fe(j?"Context failed":"Build failed",[w],[]),null)})},L;if(typeof s=="object"){let E=s.plugins;if(E!==void 0){if(!Array.isArray(E))return T(new Error('"plugins" must be an array'),"");L=E}}if(L&&L.length>0){if(l.isSync)return T(new Error("Cannot use plugins in synchronous API calls"),"");st(t,n,i,a,l,p,s,L,b).then(E=>{if(!E.ok)return T(E.error,E.pluginName);try{q(E.requestPlugins,E.runOnEndCallbacks,E.scheduleOnDisposeCallbacks)}catch(_){T(_,"")}},E=>T(E,""));return}try{q(null,(E,_)=>_([],[]),()=>{})}catch(E){T(E,"")}function q(E,_,J){let w=l.hasFS,{entries:m,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M,nodePaths:D,mangleCache:u}=rt(e,s,d,Me,w);if(o&&!l.hasFS)throw new Error('The "write" option is unavailable in this environment');let c={command:"build",key:t,entries:m,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M||F,nodePaths:D,context:j};E&&(c.plugins=E),u&&(c.mangleCache=u);let h=($,x)=>{let C={errors:ue($.errors,b),warnings:ue($.warnings,b),outputFiles:void 0,metafile:void 0,mangleCache:void 0},R=C.errors.slice(),k=C.warnings.slice();$.outputFiles&&(C.outputFiles=$.outputFiles.map(at)),$.metafile&&(C.metafile=JSON.parse($.metafile)),$.mangleCache&&(C.mangleCache=$.mangleCache),$.writeToStdout!==void 0&&console.log(ie($.writeToStdout).replace(/\n$/,"")),_(C,(B,N)=>{if(R.length>0||B.length>0){let U=fe("Build failed",R.concat(B),k.concat(N));return x(U,null,B,N)}x(null,C,B,N)})},S,P;j&&(p["on-end"]=($,x)=>new Promise(C=>{h(x,(R,k,B,N)=>{let U={errors:B,warnings:N};P&&P(R,k),S=void 0,P=void 0,i($,U),C()})})),n(a,c,($,x)=>{if($)return A(new Error($),null);if(!j)return h(x,(k,B)=>(J(),A(k,B)));if(x.errors.length>0)return A(fe("Context failed",x.errors,x.warnings),null);let C=!1,R={rebuild:()=>(S||(S=new Promise((k,B)=>{let N;P=(H,z)=>{N||(N=()=>H?B(H):k(z))};let U=()=>{n(a,{command:"rebuild",key:t},(z,ae)=>{z?B(new Error(z)):N?N():U()})};U()})),S),watch:(k={})=>new Promise((B,N)=>{if(!l.hasFS)throw new Error('Cannot use the "watch" API in this environment');Y(k,{},"in watch() call"),n(a,{command:"watch",key:t},z=>{z?N(new Error(z)):B(void 0)})}),serve:(k={})=>new Promise((B,N)=>{if(!l.hasFS)throw new Error('Cannot use the "serve" API in this environment');let U={},H=r(k,U,"port",se),z=r(k,U,"host",y),ae=r(k,U,"servedir",y),g=r(k,U,"keyfile",y),I=r(k,U,"certfile",y),X=r(k,U,"fallback",y),te=r(k,U,"onRequest",Te);Y(k,U,"in serve() call");let Q={command:"serve",key:t,onRequest:!!te};H!==void 0&&(Q.port=H),z!==void 0&&(Q.host=z),ae!==void 0&&(Q.servedir=ae),g!==void 0&&(Q.keyfile=g),I!==void 0&&(Q.certfile=I),X!==void 0&&(Q.fallback=X),n(a,Q,(ce,We)=>{if(ce)return N(new Error(ce));te&&(p["serve-request"]=(ze,Ke)=>{te(Ke.args),i(ze,{})}),B(We)})}),cancel:()=>new Promise(k=>{if(C)return k();n(a,{command:"cancel",key:t},()=>{k()})}),dispose:()=>new Promise(k=>{if(C)return k();C=!0,n(a,{command:"dispose",key:t},()=>{k(),J(),a.unref()})})};a.ref(),A(null,R)})}}var st=(e,t,n,i,a,l,p,s,d)=>ne(void 0,null,function*(){let F=[],A=[],b={},j={},T=[],L=0,q=0,E=[],_=!1;s=[...s];for(let m of s){let f={};if(typeof m!="object")throw new Error(`Plugin at index ${q} must be an object`);let o=r(m,f,"name",y);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${q} is missing a name`);try{let v=r(m,f,"setup",Te);if(typeof v!="function")throw new Error("Plugin is missing a setup function");Y(m,f,`on plugin ${V(o)}`);let O={name:o,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};q++;let D=v({initialOptions:p,resolve:(u,c={})=>{if(!_)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof u!="string")throw new Error("The path to resolve must be a string");let h=Object.create(null),S=r(c,h,"pluginName",y),P=r(c,h,"importer",y),$=r(c,h,"namespace",y),x=r(c,h,"resolveDir",y),C=r(c,h,"kind",y),R=r(c,h,"pluginData",ye),k=r(c,h,"with",ee);return Y(c,h,"in resolve() call"),new Promise((B,N)=>{let U={command:"resolve",path:u,key:e,pluginName:o};if(S!=null&&(U.pluginName=S),P!=null&&(U.importer=P),$!=null&&(U.namespace=$),x!=null&&(U.resolveDir=x),C!=null)U.kind=C;else throw new Error('Must specify "kind" when calling "resolve"');R!=null&&(U.pluginData=d.store(R)),k!=null&&(U.with=ot(k,"with")),t(i,U,(H,z)=>{H!==null?N(new Error(H)):B({errors:ue(z.errors,d),warnings:ue(z.warnings,d),path:z.path,external:z.external,sideEffects:z.sideEffects,namespace:z.namespace,suffix:z.suffix,pluginData:d.load(z.pluginData)})})})},onStart(u){let c='This error came from the "onStart" callback registered here:',h=ge(new Error(c),a,"onStart");F.push({name:o,callback:u,note:h}),O.onStart=!0},onEnd(u){let c='This error came from the "onEnd" callback registered here:',h=ge(new Error(c),a,"onEnd");A.push({name:o,callback:u,note:h}),O.onEnd=!0},onResolve(u,c){let h='This error came from the "onResolve" callback registered here:',S=ge(new Error(h),a,"onResolve"),P={},$=r(u,P,"filter",he),x=r(u,P,"namespace",y);if(Y(u,P,`in onResolve() call for plugin ${V(o)}`),$==null)throw new Error("onResolve() call is missing a filter");let C=L++;b[C]={name:o,callback:c,note:S},O.onResolve.push({id:C,filter:$.source,namespace:x||""})},onLoad(u,c){let h='This error came from the "onLoad" callback registered here:',S=ge(new Error(h),a,"onLoad"),P={},$=r(u,P,"filter",he),x=r(u,P,"namespace",y);if(Y(u,P,`in onLoad() call for plugin ${V(o)}`),$==null)throw new Error("onLoad() call is missing a filter");let C=L++;j[C]={name:o,callback:c,note:S},O.onLoad.push({id:C,filter:$.source,namespace:x||""})},onDispose(u){T.push(u)},esbuild:a.esbuild});D&&(yield D),E.push(O)}catch(v){return{ok:!1,error:v,pluginName:o}}}l["on-start"]=(m,f)=>ne(void 0,null,function*(){d.clear();let o={errors:[],warnings:[]};yield Promise.all(F.map(D=>ne(void 0,[D],function*({name:v,callback:O,note:M}){try{let u=yield O();if(u!=null){if(typeof u!="object")throw new Error(`Expected onStart() callback in plugin ${V(v)} to return an object`);let c={},h=r(u,c,"errors",K),S=r(u,c,"warnings",K);Y(u,c,`from onStart() callback in plugin ${V(v)}`),h!=null&&o.errors.push(...re(h,"errors",d,v,void 0)),S!=null&&o.warnings.push(...re(S,"warnings",d,v,void 0))}}catch(u){o.errors.push(le(u,a,d,M&&M(),v))}}))),n(m,o)}),l["on-resolve"]=(m,f)=>ne(void 0,null,function*(){let o={},v="",O,M;for(let D of f.ids)try{({name:v,callback:O,note:M}=b[D]);let u=yield O({path:f.path,importer:f.importer,namespace:f.namespace,resolveDir:f.resolveDir,kind:f.kind,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onResolve() callback in plugin ${V(v)} to return an object`);let c={},h=r(u,c,"pluginName",y),S=r(u,c,"path",y),P=r(u,c,"namespace",y),$=r(u,c,"suffix",y),x=r(u,c,"external",W),C=r(u,c,"sideEffects",W),R=r(u,c,"pluginData",ye),k=r(u,c,"errors",K),B=r(u,c,"warnings",K),N=r(u,c,"watchFiles",K),U=r(u,c,"watchDirs",K);Y(u,c,`from onResolve() callback in plugin ${V(v)}`),o.id=D,h!=null&&(o.pluginName=h),S!=null&&(o.path=S),P!=null&&(o.namespace=P),$!=null&&(o.suffix=$),x!=null&&(o.external=x),C!=null&&(o.sideEffects=C),R!=null&&(o.pluginData=d.store(R)),k!=null&&(o.errors=re(k,"errors",d,v,void 0)),B!=null&&(o.warnings=re(B,"warnings",d,v,void 0)),N!=null&&(o.watchFiles=me(N,"watchFiles")),U!=null&&(o.watchDirs=me(U,"watchDirs"));break}}catch(u){o={id:D,errors:[le(u,a,d,M&&M(),v)]};break}n(m,o)}),l["on-load"]=(m,f)=>ne(void 0,null,function*(){let o={},v="",O,M;for(let D of f.ids)try{({name:v,callback:O,note:M}=j[D]);let u=yield O({path:f.path,namespace:f.namespace,suffix:f.suffix,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onLoad() callback in plugin ${V(v)} to return an object`);let c={},h=r(u,c,"pluginName",y),S=r(u,c,"contents",Be),P=r(u,c,"resolveDir",y),$=r(u,c,"pluginData",ye),x=r(u,c,"loader",y),C=r(u,c,"errors",K),R=r(u,c,"warnings",K),k=r(u,c,"watchFiles",K),B=r(u,c,"watchDirs",K);Y(u,c,`from onLoad() callback in plugin ${V(v)}`),o.id=D,h!=null&&(o.pluginName=h),S instanceof Uint8Array?o.contents=S:S!=null&&(o.contents=Z(S)),P!=null&&(o.resolveDir=P),$!=null&&(o.pluginData=d.store($)),x!=null&&(o.loader=x),C!=null&&(o.errors=re(C,"errors",d,v,void 0)),R!=null&&(o.warnings=re(R,"warnings",d,v,void 0)),k!=null&&(o.watchFiles=me(k,"watchFiles")),B!=null&&(o.watchDirs=me(B,"watchDirs"));break}}catch(u){o={id:D,errors:[le(u,a,d,M&&M(),v)]};break}n(m,o)});let J=(m,f)=>f([],[]);A.length>0&&(J=(m,f)=>{ne(void 0,null,function*(){let o=[],v=[];for(let{name:O,callback:M,note:D}of A){let u,c;try{let h=yield M(m);if(h!=null){if(typeof h!="object")throw new Error(`Expected onEnd() callback in plugin ${V(O)} to return an object`);let S={},P=r(h,S,"errors",K),$=r(h,S,"warnings",K);Y(h,S,`from onEnd() callback in plugin ${V(O)}`),P!=null&&(u=re(P,"errors",d,O,void 0)),$!=null&&(c=re($,"warnings",d,O,void 0))}}catch(h){u=[le(h,a,d,D&&D(),O)]}if(u){o.push(...u);try{m.errors.push(...u)}catch(h){}}if(c){v.push(...c);try{m.warnings.push(...c)}catch(h){}}}f(o,v)})});let w=()=>{for(let m of T)setTimeout(()=>m(),0)};return _=!0,{ok:!0,requestPlugins:E,runOnEndCallbacks:J,scheduleOnDisposeCallbacks:w}});function Ne(){let e=new Map,t=0;return{clear(){e.clear()},load(n){return e.get(n)},store(n){if(n===void 0)return-1;let i=t++;return e.set(i,n),i}}}function ge(e,t,n){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(e.stack+"").split(`
|
|
7
|
+
`);function ke(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ee(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var V=JSON.stringify,Me="warning",Ce="silent";function Ae(e){if(G(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var ye=()=>null,W=e=>typeof e=="boolean"?null:"a boolean",y=e=>typeof e=="string"?null:"a string",he=e=>e instanceof RegExp?null:"a RegExp object",se=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Te=e=>typeof e=="function"?null:"a function",K=e=>Array.isArray(e)?null:"an array",ee=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Xe=e=>typeof e=="object"&&e!==null?null:"an array or an object",Ze=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Pe=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",De=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",et=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",tt=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Be=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",nt=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let a=e[n];if(t[n+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`${V(n)} must be ${l}`);return a}function Y(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${V(i)}`)}function Ue(e){let t=Object.create(null),n=r(e,t,"wasmURL",nt),i=r(e,t,"wasmModule",Ze),a=r(e,t,"worker",W);return Y(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:a}}function je(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let i=e[n];if(typeof i=="string"||i===!1)t[n]=i;else throw new Error(`Expected ${V(n)} in mangle cache to map to either a string or false`)}}return t}function be(e,t,n,i,a){let l=r(t,n,"color",W),p=r(t,n,"logLevel",y),s=r(t,n,"logLimit",se);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${p||a}`),e.push(`--log-limit=${s||0}`)}function G(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+V(n):""} to be a string, got ${typeof e} instead`);return e}function Le(e,t,n){let i=r(t,n,"legalComments",y),a=r(t,n,"sourceRoot",y),l=r(t,n,"sourcesContent",W),p=r(t,n,"target",tt),s=r(t,n,"format",y),d=r(t,n,"globalName",y),F=r(t,n,"mangleProps",he),A=r(t,n,"reserveProps",he),b=r(t,n,"mangleQuoted",W),j=r(t,n,"minify",W),T=r(t,n,"minifySyntax",W),L=r(t,n,"minifyWhitespace",W),q=r(t,n,"minifyIdentifiers",W),E=r(t,n,"lineLimit",se),_=r(t,n,"drop",K),J=r(t,n,"dropLabels",K),w=r(t,n,"charset",y),m=r(t,n,"treeShaking",W),f=r(t,n,"ignoreAnnotations",W),o=r(t,n,"jsx",y),v=r(t,n,"jsxFactory",y),O=r(t,n,"jsxFragment",y),M=r(t,n,"jsxImportSource",y),D=r(t,n,"jsxDev",W),u=r(t,n,"jsxSideEffects",W),c=r(t,n,"define",ee),h=r(t,n,"logOverride",ee),S=r(t,n,"supported",ee),P=r(t,n,"pure",K),$=r(t,n,"keepNames",W),x=r(t,n,"platform",y),C=r(t,n,"tsconfigRaw",et);if(i&&e.push(`--legal-comments=${i}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),p&&(Array.isArray(p)?e.push(`--target=${Array.from(p).map(Ae).join(",")}`):e.push(`--target=${Ae(p)}`)),s&&e.push(`--format=${s}`),d&&e.push(`--global-name=${d}`),x&&e.push(`--platform=${x}`),C&&e.push(`--tsconfig-raw=${typeof C=="string"?C:JSON.stringify(C)}`),j&&e.push("--minify"),T&&e.push("--minify-syntax"),L&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),E&&e.push(`--line-limit=${E}`),w&&e.push(`--charset=${w}`),m!==void 0&&e.push(`--tree-shaking=${m}`),f&&e.push("--ignore-annotations"),_)for(let R of _)e.push(`--drop:${G(R,"drop")}`);if(J&&e.push(`--drop-labels=${Array.from(J).map(R=>G(R,"dropLabels")).join(",")}`),F&&e.push(`--mangle-props=${F.source}`),A&&e.push(`--reserve-props=${A.source}`),b!==void 0&&e.push(`--mangle-quoted=${b}`),o&&e.push(`--jsx=${o}`),v&&e.push(`--jsx-factory=${v}`),O&&e.push(`--jsx-fragment=${O}`),M&&e.push(`--jsx-import-source=${M}`),D&&e.push("--jsx-dev"),u&&e.push("--jsx-side-effects"),c)for(let R in c){if(R.indexOf("=")>=0)throw new Error(`Invalid define: ${R}`);e.push(`--define:${R}=${G(c[R],"define",R)}`)}if(h)for(let R in h){if(R.indexOf("=")>=0)throw new Error(`Invalid log override: ${R}`);e.push(`--log-override:${R}=${G(h[R],"log override",R)}`)}if(S)for(let R in S){if(R.indexOf("=")>=0)throw new Error(`Invalid supported: ${R}`);let k=S[R];if(typeof k!="boolean")throw new Error(`Expected value for supported ${V(R)} to be a boolean, got ${typeof k} instead`);e.push(`--supported:${R}=${k}`)}if(P)for(let R of P)e.push(`--pure:${G(R,"pure")}`);$&&e.push("--keep-names")}function rt(e,t,n,i,a){var ae;let l=[],p=[],s=Object.create(null),d=null,F=null;be(l,t,s,n,i),Le(l,t,s);let A=r(t,s,"sourcemap",De),b=r(t,s,"bundle",W),j=r(t,s,"splitting",W),T=r(t,s,"preserveSymlinks",W),L=r(t,s,"metafile",W),q=r(t,s,"outfile",y),E=r(t,s,"outdir",y),_=r(t,s,"outbase",y),J=r(t,s,"tsconfig",y),w=r(t,s,"resolveExtensions",K),m=r(t,s,"nodePaths",K),f=r(t,s,"mainFields",K),o=r(t,s,"conditions",K),v=r(t,s,"external",K),O=r(t,s,"packages",y),M=r(t,s,"alias",ee),D=r(t,s,"loader",ee),u=r(t,s,"outExtension",ee),c=r(t,s,"publicPath",y),h=r(t,s,"entryNames",y),S=r(t,s,"chunkNames",y),P=r(t,s,"assetNames",y),$=r(t,s,"inject",K),x=r(t,s,"banner",ee),C=r(t,s,"footer",ee),R=r(t,s,"entryPoints",Xe),k=r(t,s,"absWorkingDir",y),B=r(t,s,"stdin",ee),N=(ae=r(t,s,"write",W))!=null?ae:a,U=r(t,s,"allowOverwrite",W),H=r(t,s,"mangleCache",ee);if(s.plugins=!0,Y(t,s,`in ${e}() call`),A&&l.push(`--sourcemap${A===!0?"":`=${A}`}`),b&&l.push("--bundle"),U&&l.push("--allow-overwrite"),j&&l.push("--splitting"),T&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),q&&l.push(`--outfile=${q}`),E&&l.push(`--outdir=${E}`),_&&l.push(`--outbase=${_}`),J&&l.push(`--tsconfig=${J}`),O&&l.push(`--packages=${O}`),w){let g=[];for(let I of w){if(G(I,"resolve extension"),I.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${I}`);g.push(I)}l.push(`--resolve-extensions=${g.join(",")}`)}if(c&&l.push(`--public-path=${c}`),h&&l.push(`--entry-names=${h}`),S&&l.push(`--chunk-names=${S}`),P&&l.push(`--asset-names=${P}`),f){let g=[];for(let I of f){if(G(I,"main field"),I.indexOf(",")>=0)throw new Error(`Invalid main field: ${I}`);g.push(I)}l.push(`--main-fields=${g.join(",")}`)}if(o){let g=[];for(let I of o){if(G(I,"condition"),I.indexOf(",")>=0)throw new Error(`Invalid condition: ${I}`);g.push(I)}l.push(`--conditions=${g.join(",")}`)}if(v)for(let g of v)l.push(`--external:${G(g,"external")}`);if(M)for(let g in M){if(g.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${g}`);l.push(`--alias:${g}=${G(M[g],"alias",g)}`)}if(x)for(let g in x){if(g.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${g}`);l.push(`--banner:${g}=${G(x[g],"banner",g)}`)}if(C)for(let g in C){if(g.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${g}`);l.push(`--footer:${g}=${G(C[g],"footer",g)}`)}if($)for(let g of $)l.push(`--inject:${G(g,"inject")}`);if(D)for(let g in D){if(g.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${g}`);l.push(`--loader:${g}=${G(D[g],"loader",g)}`)}if(u)for(let g in u){if(g.indexOf("=")>=0)throw new Error(`Invalid out extension: ${g}`);l.push(`--out-extension:${g}=${G(u[g],"out extension",g)}`)}if(R)if(Array.isArray(R))for(let g=0,I=R.length;g<I;g++){let X=R[g];if(typeof X=="object"&&X!==null){let te=Object.create(null),Q=r(X,te,"in",y),ce=r(X,te,"out",y);if(Y(X,te,"in entry point at index "+g),Q===void 0)throw new Error('Missing property "in" for entry point at index '+g);if(ce===void 0)throw new Error('Missing property "out" for entry point at index '+g);p.push([ce,Q])}else p.push(["",G(X,"entry point at index "+g)])}else for(let g in R)p.push([g,G(R[g],"entry point",g)]);if(B){let g=Object.create(null),I=r(B,g,"contents",Be),X=r(B,g,"resolveDir",y),te=r(B,g,"sourcefile",y),Q=r(B,g,"loader",y);Y(B,g,'in "stdin" object'),te&&l.push(`--sourcefile=${te}`),Q&&l.push(`--loader=${Q}`),X&&(F=X),typeof I=="string"?d=Z(I):I instanceof Uint8Array&&(d=I)}let z=[];if(m)for(let g of m)g+="",z.push(g);return{entries:p,flags:l,write:N,stdinContents:d,stdinResolveDir:F,absWorkingDir:k,nodePaths:z,mangleCache:je(H)}}function it(e,t,n,i){let a=[],l=Object.create(null);be(a,t,l,n,i),Le(a,t,l);let p=r(t,l,"sourcemap",De),s=r(t,l,"sourcefile",y),d=r(t,l,"loader",y),F=r(t,l,"banner",y),A=r(t,l,"footer",y),b=r(t,l,"mangleCache",ee);return Y(t,l,`in ${e}() call`),p&&a.push(`--sourcemap=${p===!0?"external":p}`),s&&a.push(`--sourcefile=${s}`),d&&a.push(`--loader=${d}`),F&&a.push(`--banner=${F}`),A&&a.push(`--footer=${A}`),{flags:a,mangleCache:je(b)}}function qe(e){let t={},n={didClose:!1,reason:""},i={},a=0,l=0,p=new Uint8Array(16*1024),s=0,d=w=>{let m=s+w.length;if(m>p.length){let o=new Uint8Array(m*2);o.set(p),p=o}p.set(w,s),s+=w.length;let f=0;for(;f+4<=s;){let o=ke(p,f);if(f+4+o>s)break;f+=4,L(p.subarray(f,f+o)),f+=o}f>0&&(p.copyWithin(0,f,s),s-=f)},F=w=>{n.didClose=!0,w&&(n.reason=": "+(w.message||w));let m="The service was stopped"+n.reason;for(let f in i)i[f](m,null);i={}},A=(w,m,f)=>{if(n.didClose)return f("The service is no longer running"+n.reason,null);let o=a++;i[o]=(v,O)=>{try{f(v,O)}finally{w&&w.unref()}},w&&w.ref(),e.writeToStdin(Se({id:o,isRequest:!0,value:m}))},b=(w,m)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);e.writeToStdin(Se({id:w,isRequest:!1,value:m}))},j=(w,m)=>ne(this,null,function*(){try{if(m.command==="ping"){b(w,{});return}if(typeof m.key=="number"){let f=t[m.key];if(!f)return;let o=f[m.command];if(o){yield o(w,m);return}}throw new Error("Invalid command: "+m.command)}catch(f){let o=[le(f,e,null,void 0,"")];try{b(w,{errors:o})}catch(v){}}}),T=!0,L=w=>{if(T){T=!1;let f=String.fromCharCode(...w);if(f!=="0.24.2")throw new Error(`Cannot start service: Host version "0.24.2" does not match binary version ${V(f)}`);return}let m=$e(w);if(m.isRequest)j(m.id,m.value);else{let f=i[m.id];delete i[m.id],m.value.error?f(m.value.error,{}):f(null,m.value)}};return{readFromStdout:d,afterClose:F,service:{buildOrContext:({callName:w,refs:m,options:f,isTTY:o,defaultWD:v,callback:O})=>{let M=0,D=l++,u={},c={ref(){++M===1&&m&&m.ref()},unref(){--M===0&&(delete t[D],m&&m.unref())}};t[D]=u,c.ref(),lt(w,D,A,b,c,e,u,f,o,v,(h,S)=>{try{O(h,S)}finally{c.unref()}})},transform:({callName:w,refs:m,input:f,options:o,isTTY:v,fs:O,callback:M})=>{let D=Ne(),u=c=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:h,mangleCache:S}=it(w,o,v,Ce),P={command:"transform",flags:h,inputFS:c!==null,input:c!==null?Z(c):typeof f=="string"?Z(f):f};S&&(P.mangleCache=S),A(m,P,($,x)=>{if($)return M(new Error($),null);let C=ue(x.errors,D),R=ue(x.warnings,D),k=1,B=()=>{if(--k===0){let N={warnings:R,code:x.code,map:x.map,mangleCache:void 0,legalComments:void 0};"legalComments"in x&&(N.legalComments=x==null?void 0:x.legalComments),x.mangleCache&&(N.mangleCache=x==null?void 0:x.mangleCache),M(null,N)}};if(C.length>0)return M(fe("Transform failed",C,R),null);x.codeFS&&(k++,O.readFile(x.code,(N,U)=>{N!==null?M(N,null):(x.code=U,B())})),x.mapFS&&(k++,O.readFile(x.map,(N,U)=>{N!==null?M(N,null):(x.map=U,B())})),B()})}catch(h){let S=[];try{be(S,o,{},v,Ce)}catch($){}let P=le(h,e,D,void 0,"");A(m,{command:"error",flags:S,error:P},()=>{P.detail=D.load(P.detail),M(fe("Transform failed",[P],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let c=u;u=()=>O.writeFile(f,c)}u(null)},formatMessages:({callName:w,refs:m,messages:f,options:o,callback:v})=>{if(!o)throw new Error(`Missing second argument in ${w}() call`);let O={},M=r(o,O,"kind",y),D=r(o,O,"color",W),u=r(o,O,"terminalWidth",se);if(Y(o,O,`in ${w}() call`),M===void 0)throw new Error(`Missing "kind" in ${w}() call`);if(M!=="error"&&M!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${w}() call`);let c={command:"format-msgs",messages:re(f,"messages",null,"",u),isWarning:M==="warning"};D!==void 0&&(c.color=D),u!==void 0&&(c.terminalWidth=u),A(m,c,(h,S)=>{if(h)return v(new Error(h),null);v(null,S.messages)})},analyzeMetafile:({callName:w,refs:m,metafile:f,options:o,callback:v})=>{o===void 0&&(o={});let O={},M=r(o,O,"color",W),D=r(o,O,"verbose",W);Y(o,O,`in ${w}() call`);let u={command:"analyze-metafile",metafile:f};M!==void 0&&(u.color=M),D!==void 0&&(u.verbose=D),A(m,u,(c,h)=>{if(c)return v(new Error(c),null);v(null,h.result)})}}}}function lt(e,t,n,i,a,l,p,s,d,F,A){let b=Ne(),j=e==="context",T=(E,_)=>{let J=[];try{be(J,s,{},d,Me)}catch(m){}let w=le(E,l,b,void 0,_);n(a,{command:"error",flags:J,error:w},()=>{w.detail=b.load(w.detail),A(fe(j?"Context failed":"Build failed",[w],[]),null)})},L;if(typeof s=="object"){let E=s.plugins;if(E!==void 0){if(!Array.isArray(E))return T(new Error('"plugins" must be an array'),"");L=E}}if(L&&L.length>0){if(l.isSync)return T(new Error("Cannot use plugins in synchronous API calls"),"");st(t,n,i,a,l,p,s,L,b).then(E=>{if(!E.ok)return T(E.error,E.pluginName);try{q(E.requestPlugins,E.runOnEndCallbacks,E.scheduleOnDisposeCallbacks)}catch(_){T(_,"")}},E=>T(E,""));return}try{q(null,(E,_)=>_([],[]),()=>{})}catch(E){T(E,"")}function q(E,_,J){let w=l.hasFS,{entries:m,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M,nodePaths:D,mangleCache:u}=rt(e,s,d,Me,w);if(o&&!l.hasFS)throw new Error('The "write" option is unavailable in this environment');let c={command:"build",key:t,entries:m,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M||F,nodePaths:D,context:j};E&&(c.plugins=E),u&&(c.mangleCache=u);let h=($,x)=>{let C={errors:ue($.errors,b),warnings:ue($.warnings,b),outputFiles:void 0,metafile:void 0,mangleCache:void 0},R=C.errors.slice(),k=C.warnings.slice();$.outputFiles&&(C.outputFiles=$.outputFiles.map(at)),$.metafile&&(C.metafile=JSON.parse($.metafile)),$.mangleCache&&(C.mangleCache=$.mangleCache),$.writeToStdout!==void 0&&console.log(ie($.writeToStdout).replace(/\n$/,"")),_(C,(B,N)=>{if(R.length>0||B.length>0){let U=fe("Build failed",R.concat(B),k.concat(N));return x(U,null,B,N)}x(null,C,B,N)})},S,P;j&&(p["on-end"]=($,x)=>new Promise(C=>{h(x,(R,k,B,N)=>{let U={errors:B,warnings:N};P&&P(R,k),S=void 0,P=void 0,i($,U),C()})})),n(a,c,($,x)=>{if($)return A(new Error($),null);if(!j)return h(x,(k,B)=>(J(),A(k,B)));if(x.errors.length>0)return A(fe("Context failed",x.errors,x.warnings),null);let C=!1,R={rebuild:()=>(S||(S=new Promise((k,B)=>{let N;P=(H,z)=>{N||(N=()=>H?B(H):k(z))};let U=()=>{n(a,{command:"rebuild",key:t},(z,ae)=>{z?B(new Error(z)):N?N():U()})};U()})),S),watch:(k={})=>new Promise((B,N)=>{if(!l.hasFS)throw new Error('Cannot use the "watch" API in this environment');Y(k,{},"in watch() call"),n(a,{command:"watch",key:t},z=>{z?N(new Error(z)):B(void 0)})}),serve:(k={})=>new Promise((B,N)=>{if(!l.hasFS)throw new Error('Cannot use the "serve" API in this environment');let U={},H=r(k,U,"port",se),z=r(k,U,"host",y),ae=r(k,U,"servedir",y),g=r(k,U,"keyfile",y),I=r(k,U,"certfile",y),X=r(k,U,"fallback",y),te=r(k,U,"onRequest",Te);Y(k,U,"in serve() call");let Q={command:"serve",key:t,onRequest:!!te};H!==void 0&&(Q.port=H),z!==void 0&&(Q.host=z),ae!==void 0&&(Q.servedir=ae),g!==void 0&&(Q.keyfile=g),I!==void 0&&(Q.certfile=I),X!==void 0&&(Q.fallback=X),n(a,Q,(ce,We)=>{if(ce)return N(new Error(ce));te&&(p["serve-request"]=(ze,Ke)=>{te(Ke.args),i(ze,{})}),B(We)})}),cancel:()=>new Promise(k=>{if(C)return k();n(a,{command:"cancel",key:t},()=>{k()})}),dispose:()=>new Promise(k=>{if(C)return k();C=!0,n(a,{command:"dispose",key:t},()=>{k(),J(),a.unref()})})};a.ref(),A(null,R)})}}var st=(e,t,n,i,a,l,p,s,d)=>ne(void 0,null,function*(){let F=[],A=[],b={},j={},T=[],L=0,q=0,E=[],_=!1;s=[...s];for(let m of s){let f={};if(typeof m!="object")throw new Error(`Plugin at index ${q} must be an object`);let o=r(m,f,"name",y);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${q} is missing a name`);try{let v=r(m,f,"setup",Te);if(typeof v!="function")throw new Error("Plugin is missing a setup function");Y(m,f,`on plugin ${V(o)}`);let O={name:o,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};q++;let D=v({initialOptions:p,resolve:(u,c={})=>{if(!_)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof u!="string")throw new Error("The path to resolve must be a string");let h=Object.create(null),S=r(c,h,"pluginName",y),P=r(c,h,"importer",y),$=r(c,h,"namespace",y),x=r(c,h,"resolveDir",y),C=r(c,h,"kind",y),R=r(c,h,"pluginData",ye),k=r(c,h,"with",ee);return Y(c,h,"in resolve() call"),new Promise((B,N)=>{let U={command:"resolve",path:u,key:e,pluginName:o};if(S!=null&&(U.pluginName=S),P!=null&&(U.importer=P),$!=null&&(U.namespace=$),x!=null&&(U.resolveDir=x),C!=null)U.kind=C;else throw new Error('Must specify "kind" when calling "resolve"');R!=null&&(U.pluginData=d.store(R)),k!=null&&(U.with=ot(k,"with")),t(i,U,(H,z)=>{H!==null?N(new Error(H)):B({errors:ue(z.errors,d),warnings:ue(z.warnings,d),path:z.path,external:z.external,sideEffects:z.sideEffects,namespace:z.namespace,suffix:z.suffix,pluginData:d.load(z.pluginData)})})})},onStart(u){let c='This error came from the "onStart" callback registered here:',h=ge(new Error(c),a,"onStart");F.push({name:o,callback:u,note:h}),O.onStart=!0},onEnd(u){let c='This error came from the "onEnd" callback registered here:',h=ge(new Error(c),a,"onEnd");A.push({name:o,callback:u,note:h}),O.onEnd=!0},onResolve(u,c){let h='This error came from the "onResolve" callback registered here:',S=ge(new Error(h),a,"onResolve"),P={},$=r(u,P,"filter",he),x=r(u,P,"namespace",y);if(Y(u,P,`in onResolve() call for plugin ${V(o)}`),$==null)throw new Error("onResolve() call is missing a filter");let C=L++;b[C]={name:o,callback:c,note:S},O.onResolve.push({id:C,filter:$.source,namespace:x||""})},onLoad(u,c){let h='This error came from the "onLoad" callback registered here:',S=ge(new Error(h),a,"onLoad"),P={},$=r(u,P,"filter",he),x=r(u,P,"namespace",y);if(Y(u,P,`in onLoad() call for plugin ${V(o)}`),$==null)throw new Error("onLoad() call is missing a filter");let C=L++;j[C]={name:o,callback:c,note:S},O.onLoad.push({id:C,filter:$.source,namespace:x||""})},onDispose(u){T.push(u)},esbuild:a.esbuild});D&&(yield D),E.push(O)}catch(v){return{ok:!1,error:v,pluginName:o}}}l["on-start"]=(m,f)=>ne(void 0,null,function*(){d.clear();let o={errors:[],warnings:[]};yield Promise.all(F.map(D=>ne(void 0,[D],function*({name:v,callback:O,note:M}){try{let u=yield O();if(u!=null){if(typeof u!="object")throw new Error(`Expected onStart() callback in plugin ${V(v)} to return an object`);let c={},h=r(u,c,"errors",K),S=r(u,c,"warnings",K);Y(u,c,`from onStart() callback in plugin ${V(v)}`),h!=null&&o.errors.push(...re(h,"errors",d,v,void 0)),S!=null&&o.warnings.push(...re(S,"warnings",d,v,void 0))}}catch(u){o.errors.push(le(u,a,d,M&&M(),v))}}))),n(m,o)}),l["on-resolve"]=(m,f)=>ne(void 0,null,function*(){let o={},v="",O,M;for(let D of f.ids)try{({name:v,callback:O,note:M}=b[D]);let u=yield O({path:f.path,importer:f.importer,namespace:f.namespace,resolveDir:f.resolveDir,kind:f.kind,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onResolve() callback in plugin ${V(v)} to return an object`);let c={},h=r(u,c,"pluginName",y),S=r(u,c,"path",y),P=r(u,c,"namespace",y),$=r(u,c,"suffix",y),x=r(u,c,"external",W),C=r(u,c,"sideEffects",W),R=r(u,c,"pluginData",ye),k=r(u,c,"errors",K),B=r(u,c,"warnings",K),N=r(u,c,"watchFiles",K),U=r(u,c,"watchDirs",K);Y(u,c,`from onResolve() callback in plugin ${V(v)}`),o.id=D,h!=null&&(o.pluginName=h),S!=null&&(o.path=S),P!=null&&(o.namespace=P),$!=null&&(o.suffix=$),x!=null&&(o.external=x),C!=null&&(o.sideEffects=C),R!=null&&(o.pluginData=d.store(R)),k!=null&&(o.errors=re(k,"errors",d,v,void 0)),B!=null&&(o.warnings=re(B,"warnings",d,v,void 0)),N!=null&&(o.watchFiles=me(N,"watchFiles")),U!=null&&(o.watchDirs=me(U,"watchDirs"));break}}catch(u){o={id:D,errors:[le(u,a,d,M&&M(),v)]};break}n(m,o)}),l["on-load"]=(m,f)=>ne(void 0,null,function*(){let o={},v="",O,M;for(let D of f.ids)try{({name:v,callback:O,note:M}=j[D]);let u=yield O({path:f.path,namespace:f.namespace,suffix:f.suffix,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onLoad() callback in plugin ${V(v)} to return an object`);let c={},h=r(u,c,"pluginName",y),S=r(u,c,"contents",Be),P=r(u,c,"resolveDir",y),$=r(u,c,"pluginData",ye),x=r(u,c,"loader",y),C=r(u,c,"errors",K),R=r(u,c,"warnings",K),k=r(u,c,"watchFiles",K),B=r(u,c,"watchDirs",K);Y(u,c,`from onLoad() callback in plugin ${V(v)}`),o.id=D,h!=null&&(o.pluginName=h),S instanceof Uint8Array?o.contents=S:S!=null&&(o.contents=Z(S)),P!=null&&(o.resolveDir=P),$!=null&&(o.pluginData=d.store($)),x!=null&&(o.loader=x),C!=null&&(o.errors=re(C,"errors",d,v,void 0)),R!=null&&(o.warnings=re(R,"warnings",d,v,void 0)),k!=null&&(o.watchFiles=me(k,"watchFiles")),B!=null&&(o.watchDirs=me(B,"watchDirs"));break}}catch(u){o={id:D,errors:[le(u,a,d,M&&M(),v)]};break}n(m,o)});let J=(m,f)=>f([],[]);A.length>0&&(J=(m,f)=>{ne(void 0,null,function*(){let o=[],v=[];for(let{name:O,callback:M,note:D}of A){let u,c;try{let h=yield M(m);if(h!=null){if(typeof h!="object")throw new Error(`Expected onEnd() callback in plugin ${V(O)} to return an object`);let S={},P=r(h,S,"errors",K),$=r(h,S,"warnings",K);Y(h,S,`from onEnd() callback in plugin ${V(O)}`),P!=null&&(u=re(P,"errors",d,O,void 0)),$!=null&&(c=re($,"warnings",d,O,void 0))}}catch(h){u=[le(h,a,d,D&&D(),O)]}if(u){o.push(...u);try{m.errors.push(...u)}catch(h){}}if(c){v.push(...c);try{m.warnings.push(...c)}catch(h){}}}f(o,v)})});let w=()=>{for(let m of T)setTimeout(()=>m(),0)};return _=!0,{ok:!0,requestPlugins:E,runOnEndCallbacks:J,scheduleOnDisposeCallbacks:w}});function Ne(){let e=new Map,t=0;return{clear(){e.clear()},load(n){return e.get(n)},store(n){if(n===void 0)return-1;let i=t++;return e.set(i,n),i}}}function ge(e,t,n){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(e.stack+"").split(`
|
|
8
8
|
`);l.splice(1,1);let p=Ie(t,l,n);if(p)return i={text:e.message,location:p},i}catch(l){}}}function le(e,t,n,i,a){let l="Internal error",p=null;try{l=(e&&e.message||e)+""}catch(s){}try{p=Ie(t,(e.stack+"").split(`
|
|
9
9
|
`),"")}catch(s){}return{id:"",pluginName:a,text:l,location:p,notes:i?[i]:[],detail:n?n.store(e):-1}}function Ie(e,t,n){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let a=1;a<t.length;a++){let l=t[a];if(l.startsWith(i))for(l=l.slice(i.length);;){let p=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(p){l=p[1];continue}if(p=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),p){l=p[1];continue}if(p=/^(\S+):(\d+):(\d+)$/.exec(l),p){let s;try{s=e.readFileSync(p[1],"utf8")}catch(b){break}let d=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+p[2]-1]||"",F=+p[3]-1,A=d.slice(F,F+n.length)===n?n.length:0;return{file:p[1],namespace:"file",line:+p[2],column:Z(d.slice(0,F)).length,length:Z(d.slice(F,F+A)).length,lineText:d+`
|
|
10
10
|
`+t.slice(1).join(`
|
|
11
11
|
`),suggestion:""}}break}}return null}function fe(e,t,n){let i=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((l,p)=>{if(p===i)return`
|
|
12
12
|
...`;if(!l.location)return`
|
|
13
13
|
error: ${l.text}`;let{file:s,line:d,column:F}=l.location,A=l.pluginName?`[plugin: ${l.pluginName}] `:"";return`
|
|
14
|
-
${s}:${d}:${F}: ERROR: ${A}${l.text}`}).join("");let a=new Error(e);for(let[l,p]of[["errors",t],["warnings",n]])Object.defineProperty(a,l,{configurable:!0,enumerable:!0,get:()=>p,set:s=>Object.defineProperty(a,l,{configurable:!0,enumerable:!0,value:s})});return a}function ue(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Fe(e,t,n){if(e==null)return null;let i={},a=r(e,i,"file",y),l=r(e,i,"namespace",y),p=r(e,i,"line",se),s=r(e,i,"column",se),d=r(e,i,"length",se),F=r(e,i,"lineText",y),A=r(e,i,"suggestion",y);if(Y(e,i,t),F){let b=F.slice(0,(s&&s>0?s:0)+(d&&d>0?d:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(b)&&!/\n/.test(F)&&(F=b)}return{file:a||"",namespace:l||"",line:p||0,column:s||0,length:d||0,lineText:F||"",suggestion:A||""}}function re(e,t,n,i,a){let l=[],p=0;for(let s of e){let d={},F=r(s,d,"id",y),A=r(s,d,"pluginName",y),b=r(s,d,"text",y),j=r(s,d,"location",Pe),T=r(s,d,"notes",K),L=r(s,d,"detail",ye),q=`in element ${p} of "${t}"`;Y(s,d,q);let E=[];if(T)for(let _ of T){let J={},w=r(_,J,"text",y),m=r(_,J,"location",Pe);Y(_,J,q),E.push({text:w||"",location:Fe(m,q,a)})}l.push({id:F||"",pluginName:A||i,text:b||"",location:Fe(j,q,a),notes:E,detail:n?n.store(L):-1}),p++}return l}function me(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${V(t)} must be an array of strings`);n.push(i)}return n}function ot(e,t){let n=Object.create(null);for(let i in e){let a=e[i];if(typeof a!="string")throw new Error(`key ${V(i)} in object ${V(t)} must be a string`);n[i]=a}return n}function at({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let a=this.contents;return(i===null||a!==t)&&(t=a,i=ie(a)),i}}}var ct="0.24.0",ft=e=>de().build(e),dt=e=>de().context(e),pt=(e,t)=>de().transform(e,t),gt=(e,t)=>de().formatMessages(e,t),mt=(e,t)=>de().analyzeMetafile(e,t),yt=()=>{throw new Error('The "buildSync" API only works in node')},ht=()=>{throw new Error('The "transformSync" API only works in node')},bt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},wt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},vt=()=>(we&&we(),Promise.resolve()),oe,we,ve,de=()=>{if(ve)return ve;throw oe?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},Rt=e=>{e=Ue(e||{});let t=e.wasmURL,n=e.wasmModule,i=e.worker!==!1;if(!t&&!n)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(oe)throw new Error('Cannot call "initialize" more than once');return oe=xt(t||"",n,i),oe.catch(()=>{oe=void 0}),oe},xt=(e,t,n)=>ne(void 0,null,function*(){let i,a,l=new Promise(b=>a=b);if(n){let b=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nvar b=(i,f,d)=>new Promise((c,r)=>{var s=u=>{try{o(d.next(u))}catch(m){r(m)}},n=u=>{try{o(d.throw(u))}catch(m){r(m)}},o=u=>u.done?c(u.value):Promise.resolve(u.value).then(s,n);o((d=d.apply(i,f)).next())});let onmessage,globalThis={};for(let i=self;i;i=Object.getPrototypeOf(i))for(let f of Object.getOwnPropertyNames(i))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const i=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(r,s){c+=d.decode(s);const n=c.lastIndexOf(`\n`);return n!=-1&&(console.log(c.substring(0,n)),c=c.substring(n+1)),s.length},write(r,s,n,o,u,m){if(n!==0||o!==s.length||u!==null){m(i());return}const h=this.writeSync(r,s);m(null,h)},chmod(r,s,n){n(i())},chown(r,s,n,o){o(i())},close(r,s){s(i())},fchmod(r,s,n){n(i())},fchown(r,s,n,o){o(i())},fstat(r,s){s(i())},fsync(r,s){s(null)},ftruncate(r,s,n){n(i())},lchown(r,s,n,o){o(i())},link(r,s,n){n(i())},lstat(r,s){s(i())},mkdir(r,s,n){n(i())},open(r,s,n,o){o(i())},read(r,s,n,o,u,m){m(i())},readdir(r,s){s(i())},readlink(r,s){s(i())},rename(r,s,n){n(i())},rmdir(r,s){s(i())},stat(r,s){s(i())},symlink(r,s,n){n(i())},truncate(r,s,n){n(i())},unlink(r,s){s(i())},utimes(r,s,n,o){o(i())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw i()},pid:-1,ppid:-1,umask(){throw i()},cwd(){throw i()},chdir(){throw i()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),d=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},r=(e,t)=>{this.mem.setUint32(e+0,t,!0)},s=e=>{const t=this.mem.getUint32(e+0,!0),l=this.mem.getInt32(e+4,!0);return t+l*4294967296},n=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const l=this.mem.getUint32(e,!0);return this._values[l]},o=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let y=0;switch(typeof t){case"object":t!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(e+4,2146959360|y,!0),this.mem.setUint32(e,a,!0)},u=e=>{const t=s(e+0),l=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,l)},m=e=>{const t=s(e+0),l=s(e+8),a=new Array(l);for(let y=0;y<l;y++)a[y]=n(t+y*8);return a},h=e=>{const t=s(e+0),l=s(e+8);return d.decode(new DataView(this._inst.exports.mem.buffer,t,l))},g=Date.now()-performance.now();this.importObject={_gotest:{add:(e,t)=>e+t},gojs:{"runtime.wasmExit":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e=Number(e);const t=s(e+8),l=s(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":e=>{e=Number(e),this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e=Number(e),c(e+8,(g+performance.now())*1e6)},"runtime.walltime":e=>{e=Number(e);const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e=Number(e);const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8))),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e=Number(e),crypto.getRandomValues(u(e+8))},"syscall/js.finalizeRef":e=>{e=Number(e);const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const l=this._values[t];this._values[t]=null,this._ids.delete(l),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e=Number(e),o(e+24,h(e+8))},"syscall/js.valueGet":e=>{e=Number(e);const t=Reflect.get(n(e+8),h(e+16));e=Number(this._inst.exports.getsp()),o(e+32,t)},"syscall/js.valueSet":e=>{e=Number(e),Reflect.set(n(e+8),h(e+16),n(e+32))},"syscall/js.valueDelete":e=>{e=Number(e),Reflect.deleteProperty(n(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e=Number(e),o(e+24,Reflect.get(n(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e=Number(e),Reflect.set(n(e+8),s(e+16),n(e+24))},"syscall/js.valueCall":e=>{e=Number(e);try{const t=n(e+8),l=Reflect.get(t,h(e+16)),a=m(e+32),y=Reflect.apply(l,t,a);e=Number(this._inst.exports.getsp()),o(e+56,y),this.mem.setUint8(e+64,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.apply(t,void 0,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.construct(t,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e=Number(e),c(e+16,parseInt(n(e+8).length))},"syscall/js.valuePrepareString":e=>{e=Number(e);const t=f.encode(String(n(e+8)));o(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e=Number(e);const t=n(e+8);u(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e=Number(e),this.mem.setUint8(e+24,n(e+8)instanceof n(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e=Number(e);const t=u(e+8),l=n(e+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e=Number(e);const t=n(e+8),l=u(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(c){return b(this,null,function*(){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let r=4096;const s=g=>{const e=r,t=f.encode(g+"\\0");return new Uint8Array(this.mem.buffer,r,t.length).set(t),r+=t.length,r%8!==0&&(r+=8-r%8),e},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const m=r;if(o.forEach(g=>{this.mem.setUint32(r,g,!0),this.mem.setUint32(r+4,0,!0),r+=8}),r>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,m),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const r=this;return function(){const s={id:c,this:this,args:arguments};return r._pendingEvent=s,r._resume(),s.result}}}})(),onmessage=({data:i})=>{let f=new TextDecoder,d=globalThis.fs,c="";d.writeSync=(u,m)=>{if(u===1)postMessage(m);else if(u===2){c+=f.decode(m);let h=c.split(`\n`);h.length>1&&console.log(h.slice(0,-1).join(`\n`)),c=h[h.length-1]}else throw new Error("Bad write");return m.length};let r=[],s,n=0;onmessage=({data:u})=>(u.length>0&&(r.push(u),s&&s()),o),d.read=(u,m,h,g,e,t)=>{if(u!==0||h!==0||g!==m.length||e!==null)throw new Error("Bad read");if(r.length===0){s=()=>d.read(u,m,h,g,e,t);return}let l=r[0],a=Math.max(0,Math.min(g,l.length-n));m.set(l.subarray(n,n+a),h),n+=a,n===l.length&&(r.shift(),n=0),t(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.0"],tryToInstantiateModule(i,o).then(u=>{postMessage(null),o.run(u)},u=>{postMessage(u)}),o};function tryToInstantiateModule(i,f){return b(this,null,function*(){if(i instanceof WebAssembly.Module)return WebAssembly.instantiate(i,f.importObject);const d=yield fetch(i);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(i)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const c=yield d.arrayBuffer();return(yield WebAssembly.instantiate(c,f.importObject)).instance})}return i=>onmessage(i);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(b))}else{let b=(postMessage=>{
|
|
14
|
+
${s}:${d}:${F}: ERROR: ${A}${l.text}`}).join("");let a=new Error(e);for(let[l,p]of[["errors",t],["warnings",n]])Object.defineProperty(a,l,{configurable:!0,enumerable:!0,get:()=>p,set:s=>Object.defineProperty(a,l,{configurable:!0,enumerable:!0,value:s})});return a}function ue(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Fe(e,t,n){if(e==null)return null;let i={},a=r(e,i,"file",y),l=r(e,i,"namespace",y),p=r(e,i,"line",se),s=r(e,i,"column",se),d=r(e,i,"length",se),F=r(e,i,"lineText",y),A=r(e,i,"suggestion",y);if(Y(e,i,t),F){let b=F.slice(0,(s&&s>0?s:0)+(d&&d>0?d:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(b)&&!/\n/.test(F)&&(F=b)}return{file:a||"",namespace:l||"",line:p||0,column:s||0,length:d||0,lineText:F||"",suggestion:A||""}}function re(e,t,n,i,a){let l=[],p=0;for(let s of e){let d={},F=r(s,d,"id",y),A=r(s,d,"pluginName",y),b=r(s,d,"text",y),j=r(s,d,"location",Pe),T=r(s,d,"notes",K),L=r(s,d,"detail",ye),q=`in element ${p} of "${t}"`;Y(s,d,q);let E=[];if(T)for(let _ of T){let J={},w=r(_,J,"text",y),m=r(_,J,"location",Pe);Y(_,J,q),E.push({text:w||"",location:Fe(m,q,a)})}l.push({id:F||"",pluginName:A||i,text:b||"",location:Fe(j,q,a),notes:E,detail:n?n.store(L):-1}),p++}return l}function me(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${V(t)} must be an array of strings`);n.push(i)}return n}function ot(e,t){let n=Object.create(null);for(let i in e){let a=e[i];if(typeof a!="string")throw new Error(`key ${V(i)} in object ${V(t)} must be a string`);n[i]=a}return n}function at({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let a=this.contents;return(i===null||a!==t)&&(t=a,i=ie(a)),i}}}var ct="0.24.2",ft=e=>de().build(e),dt=e=>de().context(e),pt=(e,t)=>de().transform(e,t),gt=(e,t)=>de().formatMessages(e,t),mt=(e,t)=>de().analyzeMetafile(e,t),yt=()=>{throw new Error('The "buildSync" API only works in node')},ht=()=>{throw new Error('The "transformSync" API only works in node')},bt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},wt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},vt=()=>(we&&we(),Promise.resolve()),oe,we,ve,de=()=>{if(ve)return ve;throw oe?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},Rt=e=>{e=Ue(e||{});let t=e.wasmURL,n=e.wasmModule,i=e.worker!==!1;if(!t&&!n)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(oe)throw new Error('Cannot call "initialize" more than once');return oe=xt(t||"",n,i),oe.catch(()=>{oe=void 0}),oe},xt=(e,t,n)=>ne(void 0,null,function*(){let i,a,l=new Promise(b=>a=b);if(n){let b=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nvar b=(i,f,d)=>new Promise((c,r)=>{var s=u=>{try{o(d.next(u))}catch(m){r(m)}},n=u=>{try{o(d.throw(u))}catch(m){r(m)}},o=u=>u.done?c(u.value):Promise.resolve(u.value).then(s,n);o((d=d.apply(i,f)).next())});let onmessage,globalThis={};for(let i=self;i;i=Object.getPrototypeOf(i))for(let f of Object.getOwnPropertyNames(i))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const i=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(r,s){c+=d.decode(s);const n=c.lastIndexOf(`\n`);return n!=-1&&(console.log(c.substring(0,n)),c=c.substring(n+1)),s.length},write(r,s,n,o,u,m){if(n!==0||o!==s.length||u!==null){m(i());return}const h=this.writeSync(r,s);m(null,h)},chmod(r,s,n){n(i())},chown(r,s,n,o){o(i())},close(r,s){s(i())},fchmod(r,s,n){n(i())},fchown(r,s,n,o){o(i())},fstat(r,s){s(i())},fsync(r,s){s(null)},ftruncate(r,s,n){n(i())},lchown(r,s,n,o){o(i())},link(r,s,n){n(i())},lstat(r,s){s(i())},mkdir(r,s,n){n(i())},open(r,s,n,o){o(i())},read(r,s,n,o,u,m){m(i())},readdir(r,s){s(i())},readlink(r,s){s(i())},rename(r,s,n){n(i())},rmdir(r,s){s(i())},stat(r,s){s(i())},symlink(r,s,n){n(i())},truncate(r,s,n){n(i())},unlink(r,s){s(i())},utimes(r,s,n,o){o(i())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw i()},pid:-1,ppid:-1,umask(){throw i()},cwd(){throw i()},chdir(){throw i()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),d=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},r=(e,t)=>{this.mem.setUint32(e+0,t,!0)},s=e=>{const t=this.mem.getUint32(e+0,!0),l=this.mem.getInt32(e+4,!0);return t+l*4294967296},n=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const l=this.mem.getUint32(e,!0);return this._values[l]},o=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let y=0;switch(typeof t){case"object":t!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(e+4,2146959360|y,!0),this.mem.setUint32(e,a,!0)},u=e=>{const t=s(e+0),l=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,l)},m=e=>{const t=s(e+0),l=s(e+8),a=new Array(l);for(let y=0;y<l;y++)a[y]=n(t+y*8);return a},h=e=>{const t=s(e+0),l=s(e+8);return d.decode(new DataView(this._inst.exports.mem.buffer,t,l))},g=Date.now()-performance.now();this.importObject={_gotest:{add:(e,t)=>e+t},gojs:{"runtime.wasmExit":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e=Number(e);const t=s(e+8),l=s(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":e=>{e=Number(e),this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e=Number(e),c(e+8,(g+performance.now())*1e6)},"runtime.walltime":e=>{e=Number(e);const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e=Number(e);const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8))),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e=Number(e),crypto.getRandomValues(u(e+8))},"syscall/js.finalizeRef":e=>{e=Number(e);const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const l=this._values[t];this._values[t]=null,this._ids.delete(l),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e=Number(e),o(e+24,h(e+8))},"syscall/js.valueGet":e=>{e=Number(e);const t=Reflect.get(n(e+8),h(e+16));e=Number(this._inst.exports.getsp()),o(e+32,t)},"syscall/js.valueSet":e=>{e=Number(e),Reflect.set(n(e+8),h(e+16),n(e+32))},"syscall/js.valueDelete":e=>{e=Number(e),Reflect.deleteProperty(n(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e=Number(e),o(e+24,Reflect.get(n(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e=Number(e),Reflect.set(n(e+8),s(e+16),n(e+24))},"syscall/js.valueCall":e=>{e=Number(e);try{const t=n(e+8),l=Reflect.get(t,h(e+16)),a=m(e+32),y=Reflect.apply(l,t,a);e=Number(this._inst.exports.getsp()),o(e+56,y),this.mem.setUint8(e+64,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.apply(t,void 0,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.construct(t,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e=Number(e),c(e+16,parseInt(n(e+8).length))},"syscall/js.valuePrepareString":e=>{e=Number(e);const t=f.encode(String(n(e+8)));o(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e=Number(e);const t=n(e+8);u(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e=Number(e),this.mem.setUint8(e+24,n(e+8)instanceof n(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e=Number(e);const t=u(e+8),l=n(e+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e=Number(e);const t=n(e+8),l=u(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(c){return b(this,null,function*(){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let r=4096;const s=g=>{const e=r,t=f.encode(g+"\\0");return new Uint8Array(this.mem.buffer,r,t.length).set(t),r+=t.length,r%8!==0&&(r+=8-r%8),e},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const m=r;if(o.forEach(g=>{this.mem.setUint32(r,g,!0),this.mem.setUint32(r+4,0,!0),r+=8}),r>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,m),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const r=this;return function(){const s={id:c,this:this,args:arguments};return r._pendingEvent=s,r._resume(),s.result}}}})(),onmessage=({data:i})=>{let f=new TextDecoder,d=globalThis.fs,c="";d.writeSync=(u,m)=>{if(u===1)postMessage(m);else if(u===2){c+=f.decode(m);let h=c.split(`\n`);h.length>1&&console.log(h.slice(0,-1).join(`\n`)),c=h[h.length-1]}else throw new Error("Bad write");return m.length};let r=[],s,n=0;onmessage=({data:u})=>(u.length>0&&(r.push(u),s&&s()),o),d.read=(u,m,h,g,e,t)=>{if(u!==0||h!==0||g!==m.length||e!==null)throw new Error("Bad read");if(r.length===0){s=()=>d.read(u,m,h,g,e,t);return}let l=r[0],a=Math.max(0,Math.min(g,l.length-n));m.set(l.subarray(n,n+a),h),n+=a,n===l.length&&(r.shift(),n=0),t(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.2"],tryToInstantiateModule(i,o).then(u=>{postMessage(null),o.run(u)},u=>{postMessage(u)}),o};function tryToInstantiateModule(i,f){return b(this,null,function*(){if(i instanceof WebAssembly.Module)return WebAssembly.instantiate(i,f.importObject);const d=yield fetch(i);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(i)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const c=yield d.arrayBuffer();return(yield WebAssembly.instantiate(c,f.importObject)).instance})}return i=>onmessage(i);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(b))}else{let b=(postMessage=>{
|
|
15
15
|
// Copyright 2018 The Go Authors. All rights reserved.
|
|
16
16
|
// Use of this source code is governed by a BSD-style
|
|
17
17
|
// license that can be found in the LICENSE file.
|
|
18
18
|
var b=(i,f,d)=>new Promise((c,r)=>{var s=u=>{try{o(d.next(u))}catch(m){r(m)}},n=u=>{try{o(d.throw(u))}catch(m){r(m)}},o=u=>u.done?c(u.value):Promise.resolve(u.value).then(s,n);o((d=d.apply(i,f)).next())});let onmessage,globalThis={};for(let i=self;i;i=Object.getPrototypeOf(i))for(let f of Object.getOwnPropertyNames(i))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const i=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(r,s){c+=d.decode(s);const n=c.lastIndexOf(`
|
|
19
19
|
`);return n!=-1&&(console.log(c.substring(0,n)),c=c.substring(n+1)),s.length},write(r,s,n,o,u,m){if(n!==0||o!==s.length||u!==null){m(i());return}const h=this.writeSync(r,s);m(null,h)},chmod(r,s,n){n(i())},chown(r,s,n,o){o(i())},close(r,s){s(i())},fchmod(r,s,n){n(i())},fchown(r,s,n,o){o(i())},fstat(r,s){s(i())},fsync(r,s){s(null)},ftruncate(r,s,n){n(i())},lchown(r,s,n,o){o(i())},link(r,s,n){n(i())},lstat(r,s){s(i())},mkdir(r,s,n){n(i())},open(r,s,n,o){o(i())},read(r,s,n,o,u,m){m(i())},readdir(r,s){s(i())},readlink(r,s){s(i())},rename(r,s,n){n(i())},rmdir(r,s){s(i())},stat(r,s){s(i())},symlink(r,s,n){n(i())},truncate(r,s,n){n(i())},unlink(r,s){s(i())},utimes(r,s,n,o){o(i())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw i()},pid:-1,ppid:-1,umask(){throw i()},cwd(){throw i()},chdir(){throw i()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),d=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},r=(e,t)=>{this.mem.setUint32(e+0,t,!0)},s=e=>{const t=this.mem.getUint32(e+0,!0),l=this.mem.getInt32(e+4,!0);return t+l*4294967296},n=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const l=this.mem.getUint32(e,!0);return this._values[l]},o=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let y=0;switch(typeof t){case"object":t!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(e+4,2146959360|y,!0),this.mem.setUint32(e,a,!0)},u=e=>{const t=s(e+0),l=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,l)},m=e=>{const t=s(e+0),l=s(e+8),a=new Array(l);for(let y=0;y<l;y++)a[y]=n(t+y*8);return a},h=e=>{const t=s(e+0),l=s(e+8);return d.decode(new DataView(this._inst.exports.mem.buffer,t,l))},g=Date.now()-performance.now();this.importObject={_gotest:{add:(e,t)=>e+t},gojs:{"runtime.wasmExit":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e=Number(e);const t=s(e+8),l=s(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":e=>{e=Number(e),this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e=Number(e),c(e+8,(g+performance.now())*1e6)},"runtime.walltime":e=>{e=Number(e);const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e=Number(e);const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8))),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e=Number(e);const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e=Number(e),crypto.getRandomValues(u(e+8))},"syscall/js.finalizeRef":e=>{e=Number(e);const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const l=this._values[t];this._values[t]=null,this._ids.delete(l),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e=Number(e),o(e+24,h(e+8))},"syscall/js.valueGet":e=>{e=Number(e);const t=Reflect.get(n(e+8),h(e+16));e=Number(this._inst.exports.getsp()),o(e+32,t)},"syscall/js.valueSet":e=>{e=Number(e),Reflect.set(n(e+8),h(e+16),n(e+32))},"syscall/js.valueDelete":e=>{e=Number(e),Reflect.deleteProperty(n(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e=Number(e),o(e+24,Reflect.get(n(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e=Number(e),Reflect.set(n(e+8),s(e+16),n(e+24))},"syscall/js.valueCall":e=>{e=Number(e);try{const t=n(e+8),l=Reflect.get(t,h(e+16)),a=m(e+32),y=Reflect.apply(l,t,a);e=Number(this._inst.exports.getsp()),o(e+56,y),this.mem.setUint8(e+64,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.apply(t,void 0,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e=Number(e);try{const t=n(e+8),l=m(e+16),a=Reflect.construct(t,l);e=Number(this._inst.exports.getsp()),o(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=Number(this._inst.exports.getsp()),o(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e=Number(e),c(e+16,parseInt(n(e+8).length))},"syscall/js.valuePrepareString":e=>{e=Number(e);const t=f.encode(String(n(e+8)));o(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e=Number(e);const t=n(e+8);u(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e=Number(e),this.mem.setUint8(e+24,n(e+8)instanceof n(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e=Number(e);const t=u(e+8),l=n(e+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e=Number(e);const t=n(e+8),l=u(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=l.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(c){return b(this,null,function*(){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let r=4096;const s=g=>{const e=r,t=f.encode(g+"\0");return new Uint8Array(this.mem.buffer,r,t.length).set(t),r+=t.length,r%8!==0&&(r+=8-r%8),e},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const m=r;if(o.forEach(g=>{this.mem.setUint32(r,g,!0),this.mem.setUint32(r+4,0,!0),r+=8}),r>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,m),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const r=this;return function(){const s={id:c,this:this,args:arguments};return r._pendingEvent=s,r._resume(),s.result}}}})(),onmessage=({data:i})=>{let f=new TextDecoder,d=globalThis.fs,c="";d.writeSync=(u,m)=>{if(u===1)postMessage(m);else if(u===2){c+=f.decode(m);let h=c.split(`
|
|
20
20
|
`);h.length>1&&console.log(h.slice(0,-1).join(`
|
|
21
|
-
`)),c=h[h.length-1]}else throw new Error("Bad write");return m.length};let r=[],s,n=0;onmessage=({data:u})=>(u.length>0&&(r.push(u),s&&s()),o),d.read=(u,m,h,g,e,t)=>{if(u!==0||h!==0||g!==m.length||e!==null)throw new Error("Bad read");if(r.length===0){s=()=>d.read(u,m,h,g,e,t);return}let l=r[0],a=Math.max(0,Math.min(g,l.length-n));m.set(l.subarray(n,n+a),h),n+=a,n===l.length&&(r.shift(),n=0),t(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.
|
|
21
|
+
`)),c=h[h.length-1]}else throw new Error("Bad write");return m.length};let r=[],s,n=0;onmessage=({data:u})=>(u.length>0&&(r.push(u),s&&s()),o),d.read=(u,m,h,g,e,t)=>{if(u!==0||h!==0||g!==m.length||e!==null)throw new Error("Bad read");if(r.length===0){s=()=>d.read(u,m,h,g,e,t);return}let l=r[0],a=Math.max(0,Math.min(g,l.length-n));m.set(l.subarray(n,n+a),h),n+=a,n===l.length&&(r.shift(),n=0),t(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.24.2"],tryToInstantiateModule(i,o).then(u=>{postMessage(null),o.run(u)},u=>{postMessage(u)}),o};function tryToInstantiateModule(i,f){return b(this,null,function*(){if(i instanceof WebAssembly.Module)return WebAssembly.instantiate(i,f.importObject);const d=yield fetch(i);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(i)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const c=yield d.arrayBuffer();return(yield WebAssembly.instantiate(c,f.importObject)).instance})}return i=>onmessage(i);})(T=>i.onmessage({data:T})),j;i={onmessage:null,postMessage:T=>setTimeout(()=>{try{j=b({data:T})}catch(L){a(L)}}),terminate(){if(j)for(let T of j._scheduledTimeouts.values())clearTimeout(T)}}}let p,s,d=new Promise((b,j)=>{p=b,s=j});i.onmessage=({data:b})=>{i.onmessage=({data:j})=>F(j),b?s(b):p()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:F,service:A}=qe({writeToStdin(b){i.postMessage(b)},isSync:!1,hasFS:!1,esbuild:Re});yield d,we=()=>{i.terminate(),oe=void 0,we=void 0,ve=void 0},ve={build:b=>new Promise((j,T)=>{l.then(T),A.buildOrContext({callName:"build",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,q)=>L?T(L):j(q)})}),context:b=>new Promise((j,T)=>{l.then(T),A.buildOrContext({callName:"context",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,q)=>L?T(L):j(q)})}),transform:(b,j)=>new Promise((T,L)=>{l.then(L),A.transform({callName:"transform",refs:null,input:b,options:j||{},isTTY:!1,fs:{readFile(q,E){E(new Error("Internal error"),null)},writeFile(q,E){E(null)}},callback:(q,E)=>q?L(q):T(E)})}),formatMessages:(b,j)=>new Promise((T,L)=>{l.then(L),A.formatMessages({callName:"formatMessages",refs:null,messages:b,options:j,callback:(q,E)=>q?L(q):T(E)})}),analyzeMetafile:(b,j)=>new Promise((T,L)=>{l.then(L),A.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof b=="string"?b:JSON.stringify(b),options:j,callback:(q,E)=>q?L(q):T(E)})})}}),Ot=Re;
|
|
22
22
|
})(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
|
package/lib/main.js
CHANGED
|
@@ -652,8 +652,8 @@ function createChannel(streamIn) {
|
|
|
652
652
|
if (isFirstPacket) {
|
|
653
653
|
isFirstPacket = false;
|
|
654
654
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
655
|
-
if (binaryVersion !== "0.24.
|
|
656
|
-
throw new Error(`Cannot start service: Host version "${"0.24.
|
|
655
|
+
if (binaryVersion !== "0.24.2") {
|
|
656
|
+
throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`);
|
|
657
657
|
}
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
@@ -1614,7 +1614,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
}
|
|
1616
1616
|
var _a;
|
|
1617
|
-
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.24.
|
|
1617
|
+
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.24.2";
|
|
1618
1618
|
var esbuildCommandAndArgs = () => {
|
|
1619
1619
|
if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
|
1620
1620
|
throw new Error(
|
|
@@ -1681,7 +1681,7 @@ var fsAsync = {
|
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
1683
|
};
|
|
1684
|
-
var version = "0.24.
|
|
1684
|
+
var version = "0.24.2";
|
|
1685
1685
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
1686
1686
|
var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
|
|
1687
1687
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
|
@@ -1784,7 +1784,7 @@ var stopService;
|
|
|
1784
1784
|
var ensureServiceIsRunning = () => {
|
|
1785
1785
|
if (longLivedService) return longLivedService;
|
|
1786
1786
|
let [command, args] = esbuildCommandAndArgs();
|
|
1787
|
-
let child = child_process.spawn(command, args.concat(`--service=${"0.24.
|
|
1787
|
+
let child = child_process.spawn(command, args.concat(`--service=${"0.24.2"}`, "--ping"), {
|
|
1788
1788
|
windowsHide: true,
|
|
1789
1789
|
stdio: ["pipe", "pipe", "inherit"],
|
|
1790
1790
|
cwd: defaultWD
|
|
@@ -1888,7 +1888,7 @@ var runServiceSync = (callback) => {
|
|
|
1888
1888
|
esbuild: node_exports
|
|
1889
1889
|
});
|
|
1890
1890
|
callback(service);
|
|
1891
|
-
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.24.
|
|
1891
|
+
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.24.2"}`), {
|
|
1892
1892
|
cwd: defaultWD,
|
|
1893
1893
|
windowsHide: true,
|
|
1894
1894
|
input: stdin,
|
|
@@ -1908,7 +1908,7 @@ var workerThreadService = null;
|
|
|
1908
1908
|
var startWorkerThreadService = (worker_threads2) => {
|
|
1909
1909
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
|
1910
1910
|
let worker = new worker_threads2.Worker(__filename, {
|
|
1911
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.24.
|
|
1911
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.24.2" },
|
|
1912
1912
|
transferList: [workerPort],
|
|
1913
1913
|
// From node's documentation: https://nodejs.org/api/worker_threads.html
|
|
1914
1914
|
//
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esbuild-wasm-strapkit",
|
|
3
|
-
"version": "0.24.
|
|
4
|
-
"esbuildVersion": "0.24.
|
|
5
|
-
"description": "esbuild-wasm 0.24.
|
|
3
|
+
"version": "0.24.2-build.1",
|
|
4
|
+
"esbuildVersion": "0.24.2",
|
|
5
|
+
"description": "esbuild-wasm 0.24.2 built on 64-bit wasm memory (no 4GB heap cap). Install the dist-tag for your esbuild version, e.g. esbuild-wasm-strapkit@esbuild-0.24.2.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=18"
|