isomorfeus-asset-manager 0.16.0 → 0.16.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.
- checksums.yaml +4 -4
- data/lib/isomorfeus/asset_manager/version.rb +1 -1
- data/node_modules/.package-lock.json +3 -3
- data/node_modules/esbuild-wasm/esbuild.wasm +0 -0
- data/node_modules/esbuild-wasm/esm/browser.js +5 -5
- data/node_modules/esbuild-wasm/esm/browser.min.js +3 -3
- data/node_modules/esbuild-wasm/lib/browser.js +5 -5
- data/node_modules/esbuild-wasm/lib/browser.min.js +3 -3
- data/node_modules/esbuild-wasm/lib/main.js +7 -7
- data/node_modules/esbuild-wasm/package.json +1 -1
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4337a781d2f019e0d42084d7d9fc9a2eb06dc4a617739c72a04865007c0ea20
|
4
|
+
data.tar.gz: 6d6d1985ec536dc59dad847ab5c3357cb2f440f0bd3658d7eb13a0c253a0ae73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38656c3e97791cc192efd8ab91f9ffef7d6c65e60b62ad80da79327933bfbea66e0ca3b46a89d17e4d6db5132818b2c24f0db86e9db3982a4d3c8d8a33cfe8ba
|
7
|
+
data.tar.gz: 902b2896a302ca4d236080362030a7b5b389385d7a3d1d3d0353023bb1ddc1edd21a6b5f9f6a3cfb3351bfe3d8b7db9e41d90d4c36c3ea93a35549783ab76f8b
|
@@ -4,9 +4,9 @@
|
|
4
4
|
"requires": true,
|
5
5
|
"packages": {
|
6
6
|
"node_modules/esbuild-wasm": {
|
7
|
-
"version": "0.16.
|
8
|
-
"resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.16.
|
9
|
-
"integrity": "sha512-
|
7
|
+
"version": "0.16.3",
|
8
|
+
"resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.16.3.tgz",
|
9
|
+
"integrity": "sha512-rLDIM64R9Pc3hKAxQbFSsXdBIkquZN0w29od5/sSaQs2F8gnnRupu02XN6y/+d/odDuquwy6Dy3J+Prr8IhUaQ==",
|
10
10
|
"bin": {
|
11
11
|
"esbuild": "bin/esbuild"
|
12
12
|
},
|
Binary file
|
@@ -712,8 +712,8 @@ function createChannel(streamIn) {
|
|
712
712
|
if (isFirstPacket) {
|
713
713
|
isFirstPacket = false;
|
714
714
|
let binaryVersion = String.fromCharCode(...bytes);
|
715
|
-
if (binaryVersion !== "0.16.
|
716
|
-
throw new Error(`Cannot start service: Host version "${"0.16.
|
715
|
+
if (binaryVersion !== "0.16.3") {
|
716
|
+
throw new Error(`Cannot start service: Host version "${"0.16.3"}" does not match binary version ${quote(binaryVersion)}`);
|
717
717
|
}
|
718
718
|
return;
|
719
719
|
}
|
@@ -1665,7 +1665,7 @@ function convertOutputFiles({ path, contents }) {
|
|
1665
1665
|
}
|
1666
1666
|
|
1667
1667
|
// lib/npm/browser.ts
|
1668
|
-
var version = "0.16.
|
1668
|
+
var version = "0.16.3";
|
1669
1669
|
var build = (options) => ensureServiceIsRunning().build(options);
|
1670
1670
|
var serve = () => {
|
1671
1671
|
throw new Error(`The "serve" API only works in node`);
|
@@ -1712,7 +1712,7 @@ var initialize = (options) => {
|
|
1712
1712
|
var startRunningService = async (wasmURL, wasmModule, useWorker) => {
|
1713
1713
|
let worker;
|
1714
1714
|
if (useWorker) {
|
1715
|
-
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 writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(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 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 go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\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 "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\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 "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\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) + 1\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\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 "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\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 = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\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 = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\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 "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\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 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 [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)\n 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)\n resumeStdin();\n }\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.16.1"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\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)\n 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" });
|
1715
|
+
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 writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(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 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 go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\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 "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\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 "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\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) + 1\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\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 "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\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 = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\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 = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\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 "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\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 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 [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)\n 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)\n resumeStdin();\n }\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.16.3"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\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)\n 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" });
|
1716
1716
|
worker = new Worker(URL.createObjectURL(blob));
|
1717
1717
|
} else {
|
1718
1718
|
let onmessage = ((postMessage) => {
|
@@ -2294,7 +2294,7 @@ var startRunningService = async (wasmURL, wasmModule, useWorker) => {
|
|
2294
2294
|
callback(null, count);
|
2295
2295
|
};
|
2296
2296
|
let go = new globalThis.Go();
|
2297
|
-
go.argv = ["", `--service=${"0.16.
|
2297
|
+
go.argv = ["", `--service=${"0.16.3"}`];
|
2298
2298
|
tryToInstantiateModule(wasm, go).then(
|
2299
2299
|
(instance) => {
|
2300
2300
|
postMessage(null);
|
@@ -3,18 +3,18 @@ var Ie=Object.defineProperty;var We=(e,t)=>{for(var r in t)Ie(e,r,{get:t[r],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 ve(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function be(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var J=JSON.stringify,ke="warning",Me="silent";function Ae(e){if(V(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var de=()=>null,F=e=>typeof e=="boolean"?null:"a boolean",ze=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",h=e=>typeof e=="string"?null:"a string",pe=e=>e instanceof RegExp?null:"a RegExp object",ie=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Re=e=>typeof e=="function"?null:"a function",W=e=>Array.isArray(e)?null:"an array",Z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Ke=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",_e=e=>typeof e=="object"&&e!==null?null:"an array or an object",Ce=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Pe=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Ve=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ye=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",Je=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function n(e,t,r,o){let a=e[r];if(t[r+""]=!0,a===void 0)return;let l=o(a);if(l!==null)throw new Error(`${J(r)} must be ${l}`);return a}function z(e,t,r){for(let o in e)if(!(o in t))throw new Error(`Invalid option ${r}: ${J(o)}`)}function Be(e){let t=Object.create(null),r=n(e,t,"wasmURL",Je),o=n(e,t,"wasmModule",Ke),a=n(e,t,"worker",F);return z(e,t,"in initialize() call"),{wasmURL:r,wasmModule:o,worker:a}}function Ue(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let o=e[r];if(typeof o=="string"||o===!1)t[r]=o;else throw new Error(`Expected ${J(r)} in mangle cache to map to either a string or false`)}}return t}function ge(e,t,r,o,a){let l=n(t,r,"color",F),f=n(t,r,"logLevel",h),s=n(t,r,"logLimit",ie);l!==void 0?e.push(`--color=${l}`):o&&e.push("--color=true"),e.push(`--log-level=${f||a}`),e.push(`--log-limit=${s||0}`)}function V(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+J(r):""} to be a string, got ${typeof e} instead`);return e}function Fe(e,t,r){let o=n(t,r,"legalComments",h),a=n(t,r,"sourceRoot",h),l=n(t,r,"sourcesContent",F),f=n(t,r,"target",Ye),s=n(t,r,"format",h),m=n(t,r,"globalName",h),b=n(t,r,"mangleProps",pe),R=n(t,r,"reserveProps",pe),D=n(t,r,"mangleQuoted",F),B=n(t,r,"minify",F),$=n(t,r,"minifySyntax",F),T=n(t,r,"minifyWhitespace",F),q=n(t,r,"minifyIdentifiers",F),L=n(t,r,"drop",W),Y=n(t,r,"charset",h),x=n(t,r,"treeShaking",F),d=n(t,r,"ignoreAnnotations",F),i=n(t,r,"jsx",h),u=n(t,r,"jsxFactory",h),y=n(t,r,"jsxFragment",h),E=n(t,r,"jsxImportSource",h),S=n(t,r,"jsxDev",F),c=n(t,r,"jsxSideEffects",F),p=n(t,r,"define",Z),w=n(t,r,"logOverride",Z),k=n(t,r,"supported",Z),O=n(t,r,"pure",W),P=n(t,r,"keepNames",F),M=n(t,r,"platform",h);if(o&&e.push(`--legal-comments=${o}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),f&&(Array.isArray(f)?e.push(`--target=${Array.from(f).map(Ae).join(",")}`):e.push(`--target=${Ae(f)}`)),s&&e.push(`--format=${s}`),m&&e.push(`--global-name=${m}`),M&&e.push(`--platform=${M}`),B&&e.push("--minify"),$&&e.push("--minify-syntax"),T&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),Y&&e.push(`--charset=${Y}`),x!==void 0&&e.push(`--tree-shaking=${x}`),d&&e.push("--ignore-annotations"),L)for(let v of L)e.push(`--drop:${V(v,"drop")}`);if(b&&e.push(`--mangle-props=${b.source}`),R&&e.push(`--reserve-props=${R.source}`),D!==void 0&&e.push(`--mangle-quoted=${D}`),i&&e.push(`--jsx=${i}`),u&&e.push(`--jsx-factory=${u}`),y&&e.push(`--jsx-fragment=${y}`),E&&e.push(`--jsx-import-source=${E}`),S&&e.push("--jsx-dev"),c&&e.push("--jsx-side-effects"),p)for(let v in p){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);e.push(`--define:${v}=${V(p[v],"define",v)}`)}if(w)for(let v in w){if(v.indexOf("=")>=0)throw new Error(`Invalid log override: ${v}`);e.push(`--log-override:${v}=${V(w[v],"log override",v)}`)}if(k)for(let v in k){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);let A=k[v];if(typeof A!="boolean")throw new Error(`Expected value for supported ${J(v)} to be a boolean, got ${typeof A} instead`);e.push(`--supported:${v}=${A}`)}if(O)for(let v of O)e.push(`--pure:${V(v,"pure")}`);P&&e.push("--keep-names")}function Qe(e,t,r,o,a){var Q;let l=[],f=[],s=Object.create(null),m=null,b=null,R=null;ge(l,t,s,r,o),Fe(l,t,s);let D=n(t,s,"sourcemap",Pe),B=n(t,s,"bundle",F),$=n(t,s,"watch",ze),T=n(t,s,"splitting",F),q=n(t,s,"preserveSymlinks",F),L=n(t,s,"metafile",F),Y=n(t,s,"outfile",h),x=n(t,s,"outdir",h),d=n(t,s,"outbase",h),i=n(t,s,"tsconfig",h),u=n(t,s,"resolveExtensions",W),y=n(t,s,"nodePaths",W),E=n(t,s,"mainFields",W),S=n(t,s,"conditions",W),c=n(t,s,"external",W),p=n(t,s,"alias",Z),w=n(t,s,"loader",Z),k=n(t,s,"outExtension",Z),O=n(t,s,"publicPath",h),P=n(t,s,"entryNames",h),M=n(t,s,"chunkNames",h),v=n(t,s,"assetNames",h),A=n(t,s,"inject",W),I=n(t,s,"banner",Z),K=n(t,s,"footer",Z),j=n(t,s,"entryPoints",_e),U=n(t,s,"absWorkingDir",h),C=n(t,s,"stdin",Z),_=(Q=n(t,s,"write",F))!=null?Q:a,G=n(t,s,"allowOverwrite",F),te=n(t,s,"incremental",F)===!0,ae=n(t,s,"mangleCache",Z);if(s.plugins=!0,z(t,s,`in ${e}() call`),D&&l.push(`--sourcemap${D===!0?"":`=${D}`}`),B&&l.push("--bundle"),G&&l.push("--allow-overwrite"),$)if(l.push("--watch"),typeof $=="boolean")R={};else{let g=Object.create(null),N=n($,g,"onRebuild",Re);z($,g,`on "watch" in ${e}() call`),R={onRebuild:N}}if(T&&l.push("--splitting"),q&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),Y&&l.push(`--outfile=${Y}`),x&&l.push(`--outdir=${x}`),d&&l.push(`--outbase=${d}`),i&&l.push(`--tsconfig=${i}`),u){let g=[];for(let N of u){if(V(N,"resolve extension"),N.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${N}`);g.push(N)}l.push(`--resolve-extensions=${g.join(",")}`)}if(O&&l.push(`--public-path=${O}`),P&&l.push(`--entry-names=${P}`),M&&l.push(`--chunk-names=${M}`),v&&l.push(`--asset-names=${v}`),E){let g=[];for(let N of E){if(V(N,"main field"),N.indexOf(",")>=0)throw new Error(`Invalid main field: ${N}`);g.push(N)}l.push(`--main-fields=${g.join(",")}`)}if(S){let g=[];for(let N of S){if(V(N,"condition"),N.indexOf(",")>=0)throw new Error(`Invalid condition: ${N}`);g.push(N)}l.push(`--conditions=${g.join(",")}`)}if(c)for(let g of c)l.push(`--external:${V(g,"external")}`);if(p)for(let g in p){if(g.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${g}`);l.push(`--alias:${g}=${V(p[g],"alias",g)}`)}if(I)for(let g in I){if(g.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${g}`);l.push(`--banner:${g}=${V(I[g],"banner",g)}`)}if(K)for(let g in K){if(g.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${g}`);l.push(`--footer:${g}=${V(K[g],"footer",g)}`)}if(A)for(let g of A)l.push(`--inject:${V(g,"inject")}`);if(w)for(let g in w){if(g.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${g}`);l.push(`--loader:${g}=${V(w[g],"loader",g)}`)}if(k)for(let g in k){if(g.indexOf("=")>=0)throw new Error(`Invalid out extension: ${g}`);l.push(`--out-extension:${g}=${V(k[g],"out extension",g)}`)}if(j)if(Array.isArray(j))for(let g of j)f.push(["",V(g,"entry point")]);else for(let g in j)f.push([g,V(j[g],"entry point",g)]);if(C){let g=Object.create(null),N=n(C,g,"contents",Te),Oe=n(C,g,"resolveDir",h),Se=n(C,g,"sourcefile",h),Ee=n(C,g,"loader",h);z(C,g,'in "stdin" object'),Se&&l.push(`--sourcefile=${Se}`),Ee&&l.push(`--loader=${Ee}`),Oe&&(b=Oe),typeof N=="string"?m=H(N):N instanceof Uint8Array&&(m=N)}let X=[];if(y)for(let g of y)g+="",X.push(g);return{entries:f,flags:l,write:_,stdinContents:m,stdinResolveDir:b,absWorkingDir:U,incremental:te,nodePaths:X,watch:R,mangleCache:Ue(ae)}}function He(e,t,r,o){let a=[],l=Object.create(null);ge(a,t,l,r,o),Fe(a,t,l);let f=n(t,l,"sourcemap",Pe),s=n(t,l,"tsconfigRaw",Ve),m=n(t,l,"sourcefile",h),b=n(t,l,"loader",h),R=n(t,l,"banner",h),D=n(t,l,"footer",h),B=n(t,l,"mangleCache",Z);return z(t,l,`in ${e}() call`),f&&a.push(`--sourcemap=${f===!0?"external":f}`),s&&a.push(`--tsconfig-raw=${typeof s=="string"?s:JSON.stringify(s)}`),m&&a.push(`--sourcefile=${m}`),b&&a.push(`--loader=${b}`),R&&a.push(`--banner=${R}`),D&&a.push(`--footer=${D}`),{flags:a,mangleCache:Ue(B)}}function je(e){let t={},r={didClose:!1,reason:""},o={},a=0,l=0,f=new Uint8Array(16*1024),s=0,m=d=>{let i=s+d.length;if(i>f.length){let y=new Uint8Array(i*2);y.set(f),f=y}f.set(d,s),s+=d.length;let u=0;for(;u+4<=s;){let y=ve(f,u);if(u+4+y>s)break;u+=4,T(f.subarray(u,u+y)),u+=y}u>0&&(f.copyWithin(0,u,s),s-=u)},b=d=>{r.didClose=!0,d&&(r.reason=": "+(d.message||d));let i="The service was stopped"+r.reason;for(let u in o)o[u](i,null);o={}},R=(d,i,u)=>{if(r.didClose)return u("The service is no longer running"+r.reason,null);let y=a++;o[y]=(E,S)=>{try{u(E,S)}finally{d&&d.unref()}},d&&d.ref(),e.writeToStdin(we({id:y,isRequest:!0,value:i}))},D=(d,i)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(we({id:d,isRequest:!1,value:i}))},B=async(d,i)=>{try{if(i.command==="ping"){D(d,{});return}if(typeof i.key=="number"){let u=t[i.key];if(u){let y=u[i.command];if(y){await y(d,i);return}}}throw new Error("Invalid command: "+i.command)}catch(u){D(d,{errors:[oe(u,e,null,void 0,"")]})}},$=!0,T=d=>{if($){$=!1;let u=String.fromCharCode(...d);if(u!=="0.16.1")throw new Error(`Cannot start service: Host version "0.16.1" does not match binary version ${J(u)}`);return}let i=$e(d);if(i.isRequest)B(i.id,i.value);else{let u=o[i.id];delete o[i.id],i.value.error?u(i.value.error,{}):u(null,i.value)}};return{readFromStdout:m,afterClose:b,service:{buildOrServe:({callName:d,refs:i,serveOptions:u,options:y,isTTY:E,defaultWD:S,callback:c})=>{let p=0,w=l++,k={},O={ref(){++p===1&&i&&i.ref()},unref(){--p===0&&(delete t[w],i&&i.unref())}};t[w]=k,O.ref(),Ge(d,w,R,D,O,e,k,y,u,E,S,r,(P,M)=>{try{c(P,M)}finally{O.unref()}})},transform:({callName:d,refs:i,input:u,options:y,isTTY:E,fs:S,callback:c})=>{let p=Ne(),w=k=>{try{if(typeof u!="string"&&!(u instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:O,mangleCache:P}=He(d,y,E,Me),M={command:"transform",flags:O,inputFS:k!==null,input:k!==null?H(k):typeof u=="string"?H(u):u};P&&(M.mangleCache=P),R(i,M,(v,A)=>{if(v)return c(new Error(v),null);let I=ee(A.errors,p),K=ee(A.warnings,p),j=1,U=()=>{if(--j===0){let C={warnings:K,code:A.code,map:A.map};A.mangleCache&&(C.mangleCache=A==null?void 0:A.mangleCache),c(null,C)}};if(I.length>0)return c(le("Transform failed",I,K),null);A.codeFS&&(j++,S.readFile(A.code,(C,_)=>{C!==null?c(C,null):(A.code=_,U())})),A.mapFS&&(j++,S.readFile(A.map,(C,_)=>{C!==null?c(C,null):(A.map=_,U())})),U()})}catch(O){let P=[];try{ge(P,y,{},E,Me)}catch(v){}let M=oe(O,e,p,void 0,"");R(i,{command:"error",flags:P,error:M},()=>{M.detail=p.load(M.detail),c(le("Transform failed",[M],[]),null)})}};if((typeof u=="string"||u instanceof Uint8Array)&&u.length>1024*1024){let k=w;w=()=>S.writeFile(u,k)}w(null)},formatMessages:({callName:d,refs:i,messages:u,options:y,callback:E})=>{let S=ne(u,"messages",null,"");if(!y)throw new Error(`Missing second argument in ${d}() call`);let c={},p=n(y,c,"kind",h),w=n(y,c,"color",F),k=n(y,c,"terminalWidth",ie);if(z(y,c,`in ${d}() call`),p===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(p!=="error"&&p!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let O={command:"format-msgs",messages:S,isWarning:p==="warning"};w!==void 0&&(O.color=w),k!==void 0&&(O.terminalWidth=k),R(i,O,(P,M)=>{if(P)return E(new Error(P),null);E(null,M.messages)})},analyzeMetafile:({callName:d,refs:i,metafile:u,options:y,callback:E})=>{y===void 0&&(y={});let S={},c=n(y,S,"color",F),p=n(y,S,"verbose",F);z(y,S,`in ${d}() call`);let w={command:"analyze-metafile",metafile:u};c!==void 0&&(w.color=c),p!==void 0&&(w.verbose=p),R(i,w,(k,O)=>{if(k)return E(new Error(k),null);E(null,O.result)})}}}}function Ge(e,t,r,o,a,l,f,s,m,b,R,D,B){let $=Ne(),T=(x,d,i,u)=>{let y=[];try{ge(y,s,{},b,ke)}catch(S){}let E=oe(x,l,$,i,d);r(a,{command:"error",flags:y,error:E},()=>{E.detail=$.load(E.detail),u(E)})},q=(x,d)=>{T(x,d,void 0,i=>{B(le("Build failed",[i],[]),null)})},L;if(typeof s=="object"){let x=s.plugins;if(x!==void 0){if(!Array.isArray(x))throw new Error('"plugins" must be an array');L=x}}if(L&&L.length>0){if(l.isSync){q(new Error("Cannot use plugins in synchronous API calls"),"");return}Ze(t,r,o,a,l,f,s,L,$).then(x=>{if(!x.ok){q(x.error,x.pluginName);return}try{Y(x.requestPlugins,x.runOnEndCallbacks)}catch(d){q(d,"")}},x=>q(x,""));return}try{Y(null,(x,d,i)=>i())}catch(x){q(x,"")}function Y(x,d){let i=!l.isWriteUnavailable,{entries:u,flags:y,write:E,stdinContents:S,stdinResolveDir:c,absWorkingDir:p,incremental:w,nodePaths:k,watch:O,mangleCache:P}=Qe(e,s,b,ke,i),M={command:"build",key:t,entries:u,flags:y,write:E,stdinContents:S,stdinResolveDir:c,absWorkingDir:p||R,incremental:w,nodePaths:k};x&&(M.plugins=x),P&&(M.mangleCache=P);let v=m&&Xe(t,r,o,a,f,m,M),A,I,K=(U,C)=>{U.outputFiles&&(C.outputFiles=U.outputFiles.map(et)),U.metafile&&(C.metafile=JSON.parse(U.metafile)),U.mangleCache&&(C.mangleCache=U.mangleCache),U.writeToStdout!==void 0&&console.log(re(U.writeToStdout).replace(/\n$/,""))},j=(U,C)=>{let _={errors:ee(U.errors,$),warnings:ee(U.warnings,$)};K(U,_),d(_,T,()=>{if(_.errors.length>0)return C(le("Build failed",_.errors,_.warnings),null);if(U.rebuild){if(!A){let G=!1;A=()=>new Promise((te,ae)=>{if(G||D.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:t},(X,Q)=>{if(X)return C(le("Build failed",[{id:"",pluginName:"",text:X,location:null,notes:[],detail:void 0}],[]),null);j(Q,(g,N)=>{g?ae(g):te(N)})})}),a.ref(),A.dispose=()=>{G||(G=!0,r(a,{command:"rebuild-dispose",key:t},()=>{}),a.unref())}}_.rebuild=A}if(U.watch){if(!I){let G=!1;a.ref(),I=()=>{G||(G=!0,delete f["watch-rebuild"],r(a,{command:"watch-stop",key:t},()=>{}),a.unref())},O&&(f["watch-rebuild"]=(te,ae)=>{try{let X=ae.args,Q={errors:ee(X.errors,$),warnings:ee(X.warnings,$)};K(X,Q),d(Q,T,()=>{if(Q.errors.length>0){O.onRebuild&&O.onRebuild(le("Build failed",Q.errors,Q.warnings),null);return}Q.stop=I,O.onRebuild&&O.onRebuild(null,Q)})}catch(X){console.error(X)}o(te,{})})}_.stop=I}C(null,_)})};if(E&&l.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(w&&l.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(O&&l.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,M,(U,C)=>{if(U)return B(new Error(U),null);if(v){let _=C,G=!1;a.ref();let te={port:_.port,host:_.host,wait:v.wait,stop(){G||(G=!0,v.stop(),a.unref())}};return a.ref(),v.wait.then(a.unref,a.unref),B(null,te)}return j(C,B)})}}var Xe=(e,t,r,o,a,l,f)=>{let s={},m=n(l,s,"port",ie),b=n(l,s,"host",h),R=n(l,s,"servedir",h),D=n(l,s,"onRequest",Re),B=new Promise(($,T)=>{a["serve-wait"]=(q,L)=>{L.error!==null?T(new Error(L.error)):$(),r(q,{})}});return f.serve={},z(l,s,"in serve() call"),m!==void 0&&(f.serve.port=m),b!==void 0&&(f.serve.host=b),R!==void 0&&(f.serve.servedir=R),a["serve-request"]=($,T)=>{D&&D(T.args),r($,{})},{wait:B,stop(){t(o,{command:"serve-stop",key:e},()=>{})}}},Ze=async(e,t,r,o,a,l,f,s,m)=>{let b=[],R=[],D={},B={},$=0,T=0,q=[],L=!1;s=[...s];for(let x of s){let d={};if(typeof x!="object")throw new Error(`Plugin at index ${T} must be an object`);let i=n(x,d,"name",h);if(typeof i!="string"||i==="")throw new Error(`Plugin at index ${T} is missing a name`);try{let u=n(x,d,"setup",Re);if(typeof u!="function")throw new Error("Plugin is missing a setup function");z(x,d,`on plugin ${J(i)}`);let y={name:i,onResolve:[],onLoad:[]};T++;let S=u({initialOptions:f,resolve:(c,p={})=>{if(!L)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof c!="string")throw new Error("The path to resolve must be a string");let w=Object.create(null),k=n(p,w,"pluginName",h),O=n(p,w,"importer",h),P=n(p,w,"namespace",h),M=n(p,w,"resolveDir",h),v=n(p,w,"kind",h),A=n(p,w,"pluginData",de);return z(p,w,"in resolve() call"),new Promise((I,K)=>{let j={command:"resolve",path:c,key:e,pluginName:i};if(k!=null&&(j.pluginName=k),O!=null&&(j.importer=O),P!=null&&(j.namespace=P),M!=null&&(j.resolveDir=M),v!=null)j.kind=v;else throw new Error('Must specify "kind" when calling "resolve"');A!=null&&(j.pluginData=m.store(A)),t(o,j,(U,C)=>{U!==null?K(new Error(U)):I({errors:ee(C.errors,m),warnings:ee(C.warnings,m),path:C.path,external:C.external,sideEffects:C.sideEffects,namespace:C.namespace,suffix:C.suffix,pluginData:m.load(C.pluginData)})})})},onStart(c){let p='This error came from the "onStart" callback registered here:',w=fe(new Error(p),a,"onStart");b.push({name:i,callback:c,note:w})},onEnd(c){let p='This error came from the "onEnd" callback registered here:',w=fe(new Error(p),a,"onEnd");R.push({name:i,callback:c,note:w})},onResolve(c,p){let w='This error came from the "onResolve" callback registered here:',k=fe(new Error(w),a,"onResolve"),O={},P=n(c,O,"filter",pe),M=n(c,O,"namespace",h);if(z(c,O,`in onResolve() call for plugin ${J(i)}`),P==null)throw new Error("onResolve() call is missing a filter");let v=$++;D[v]={name:i,callback:p,note:k},y.onResolve.push({id:v,filter:P.source,namespace:M||""})},onLoad(c,p){let w='This error came from the "onLoad" callback registered here:',k=fe(new Error(w),a,"onLoad"),O={},P=n(c,O,"filter",pe),M=n(c,O,"namespace",h);if(z(c,O,`in onLoad() call for plugin ${J(i)}`),P==null)throw new Error("onLoad() call is missing a filter");let v=$++;B[v]={name:i,callback:p,note:k},y.onLoad.push({id:v,filter:P.source,namespace:M||""})},esbuild:a.esbuild});S&&await S,q.push(y)}catch(u){return{ok:!1,error:u,pluginName:i}}}l["on-start"]=async(x,d)=>{let i={errors:[],warnings:[]};await Promise.all(b.map(async({name:u,callback:y,note:E})=>{try{let S=await y();if(S!=null){if(typeof S!="object")throw new Error(`Expected onStart() callback in plugin ${J(u)} to return an object`);let c={},p=n(S,c,"errors",W),w=n(S,c,"warnings",W);z(S,c,`from onStart() callback in plugin ${J(u)}`),p!=null&&i.errors.push(...ne(p,"errors",m,u)),w!=null&&i.warnings.push(...ne(w,"warnings",m,u))}}catch(S){i.errors.push(oe(S,a,m,E&&E(),u))}})),r(x,i)},l["on-resolve"]=async(x,d)=>{let i={},u="",y,E;for(let S of d.ids)try{({name:u,callback:y,note:E}=D[S]);let c=await y({path:d.path,importer:d.importer,namespace:d.namespace,resolveDir:d.resolveDir,kind:d.kind,pluginData:m.load(d.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onResolve() callback in plugin ${J(u)} to return an object`);let p={},w=n(c,p,"pluginName",h),k=n(c,p,"path",h),O=n(c,p,"namespace",h),P=n(c,p,"suffix",h),M=n(c,p,"external",F),v=n(c,p,"sideEffects",F),A=n(c,p,"pluginData",de),I=n(c,p,"errors",W),K=n(c,p,"warnings",W),j=n(c,p,"watchFiles",W),U=n(c,p,"watchDirs",W);z(c,p,`from onResolve() callback in plugin ${J(u)}`),i.id=S,w!=null&&(i.pluginName=w),k!=null&&(i.path=k),O!=null&&(i.namespace=O),P!=null&&(i.suffix=P),M!=null&&(i.external=M),v!=null&&(i.sideEffects=v),A!=null&&(i.pluginData=m.store(A)),I!=null&&(i.errors=ne(I,"errors",m,u)),K!=null&&(i.warnings=ne(K,"warnings",m,u)),j!=null&&(i.watchFiles=ce(j,"watchFiles")),U!=null&&(i.watchDirs=ce(U,"watchDirs"));break}}catch(c){i={id:S,errors:[oe(c,a,m,E&&E(),u)]};break}r(x,i)},l["on-load"]=async(x,d)=>{let i={},u="",y,E;for(let S of d.ids)try{({name:u,callback:y,note:E}=B[S]);let c=await y({path:d.path,namespace:d.namespace,suffix:d.suffix,pluginData:m.load(d.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onLoad() callback in plugin ${J(u)} to return an object`);let p={},w=n(c,p,"pluginName",h),k=n(c,p,"contents",Te),O=n(c,p,"resolveDir",h),P=n(c,p,"pluginData",de),M=n(c,p,"loader",h),v=n(c,p,"errors",W),A=n(c,p,"warnings",W),I=n(c,p,"watchFiles",W),K=n(c,p,"watchDirs",W);z(c,p,`from onLoad() callback in plugin ${J(u)}`),i.id=S,w!=null&&(i.pluginName=w),k instanceof Uint8Array?i.contents=k:k!=null&&(i.contents=H(k)),O!=null&&(i.resolveDir=O),P!=null&&(i.pluginData=m.store(P)),M!=null&&(i.loader=M),v!=null&&(i.errors=ne(v,"errors",m,u)),A!=null&&(i.warnings=ne(A,"warnings",m,u)),I!=null&&(i.watchFiles=ce(I,"watchFiles")),K!=null&&(i.watchDirs=ce(K,"watchDirs"));break}}catch(c){i={id:S,errors:[oe(c,a,m,E&&E(),u)]};break}r(x,i)};let Y=(x,d,i)=>i();return R.length>0&&(Y=(x,d,i)=>{(async()=>{for(let{name:u,callback:y,note:E}of R)try{await y(x)}catch(S){x.errors.push(await new Promise(c=>d(S,u,E&&E(),c)))}})().then(i)}),L=!0,{ok:!0,requestPlugins:q,runOnEndCallbacks:Y}};function Ne(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let o=t++;return e.set(o,r),o}}}function fe(e,t,r){let o,a=!1;return()=>{if(a)return o;a=!0;try{let l=(e.stack+"").split(`
|
6
|
+
`);function ve(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function be(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var J=JSON.stringify,ke="warning",Me="silent";function Ae(e){if(V(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var de=()=>null,F=e=>typeof e=="boolean"?null:"a boolean",ze=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",h=e=>typeof e=="string"?null:"a string",pe=e=>e instanceof RegExp?null:"a RegExp object",ie=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Re=e=>typeof e=="function"?null:"a function",W=e=>Array.isArray(e)?null:"an array",Z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Ke=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",_e=e=>typeof e=="object"&&e!==null?null:"an array or an object",Ce=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Pe=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Ve=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ye=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",Je=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function n(e,t,r,o){let a=e[r];if(t[r+""]=!0,a===void 0)return;let l=o(a);if(l!==null)throw new Error(`${J(r)} must be ${l}`);return a}function z(e,t,r){for(let o in e)if(!(o in t))throw new Error(`Invalid option ${r}: ${J(o)}`)}function Be(e){let t=Object.create(null),r=n(e,t,"wasmURL",Je),o=n(e,t,"wasmModule",Ke),a=n(e,t,"worker",F);return z(e,t,"in initialize() call"),{wasmURL:r,wasmModule:o,worker:a}}function Ue(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let o=e[r];if(typeof o=="string"||o===!1)t[r]=o;else throw new Error(`Expected ${J(r)} in mangle cache to map to either a string or false`)}}return t}function ge(e,t,r,o,a){let l=n(t,r,"color",F),f=n(t,r,"logLevel",h),s=n(t,r,"logLimit",ie);l!==void 0?e.push(`--color=${l}`):o&&e.push("--color=true"),e.push(`--log-level=${f||a}`),e.push(`--log-limit=${s||0}`)}function V(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+J(r):""} to be a string, got ${typeof e} instead`);return e}function Fe(e,t,r){let o=n(t,r,"legalComments",h),a=n(t,r,"sourceRoot",h),l=n(t,r,"sourcesContent",F),f=n(t,r,"target",Ye),s=n(t,r,"format",h),m=n(t,r,"globalName",h),b=n(t,r,"mangleProps",pe),R=n(t,r,"reserveProps",pe),D=n(t,r,"mangleQuoted",F),B=n(t,r,"minify",F),$=n(t,r,"minifySyntax",F),T=n(t,r,"minifyWhitespace",F),q=n(t,r,"minifyIdentifiers",F),L=n(t,r,"drop",W),Y=n(t,r,"charset",h),x=n(t,r,"treeShaking",F),d=n(t,r,"ignoreAnnotations",F),i=n(t,r,"jsx",h),u=n(t,r,"jsxFactory",h),y=n(t,r,"jsxFragment",h),E=n(t,r,"jsxImportSource",h),S=n(t,r,"jsxDev",F),c=n(t,r,"jsxSideEffects",F),p=n(t,r,"define",Z),w=n(t,r,"logOverride",Z),k=n(t,r,"supported",Z),O=n(t,r,"pure",W),P=n(t,r,"keepNames",F),M=n(t,r,"platform",h);if(o&&e.push(`--legal-comments=${o}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),f&&(Array.isArray(f)?e.push(`--target=${Array.from(f).map(Ae).join(",")}`):e.push(`--target=${Ae(f)}`)),s&&e.push(`--format=${s}`),m&&e.push(`--global-name=${m}`),M&&e.push(`--platform=${M}`),B&&e.push("--minify"),$&&e.push("--minify-syntax"),T&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),Y&&e.push(`--charset=${Y}`),x!==void 0&&e.push(`--tree-shaking=${x}`),d&&e.push("--ignore-annotations"),L)for(let v of L)e.push(`--drop:${V(v,"drop")}`);if(b&&e.push(`--mangle-props=${b.source}`),R&&e.push(`--reserve-props=${R.source}`),D!==void 0&&e.push(`--mangle-quoted=${D}`),i&&e.push(`--jsx=${i}`),u&&e.push(`--jsx-factory=${u}`),y&&e.push(`--jsx-fragment=${y}`),E&&e.push(`--jsx-import-source=${E}`),S&&e.push("--jsx-dev"),c&&e.push("--jsx-side-effects"),p)for(let v in p){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);e.push(`--define:${v}=${V(p[v],"define",v)}`)}if(w)for(let v in w){if(v.indexOf("=")>=0)throw new Error(`Invalid log override: ${v}`);e.push(`--log-override:${v}=${V(w[v],"log override",v)}`)}if(k)for(let v in k){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);let A=k[v];if(typeof A!="boolean")throw new Error(`Expected value for supported ${J(v)} to be a boolean, got ${typeof A} instead`);e.push(`--supported:${v}=${A}`)}if(O)for(let v of O)e.push(`--pure:${V(v,"pure")}`);P&&e.push("--keep-names")}function Qe(e,t,r,o,a){var Q;let l=[],f=[],s=Object.create(null),m=null,b=null,R=null;ge(l,t,s,r,o),Fe(l,t,s);let D=n(t,s,"sourcemap",Pe),B=n(t,s,"bundle",F),$=n(t,s,"watch",ze),T=n(t,s,"splitting",F),q=n(t,s,"preserveSymlinks",F),L=n(t,s,"metafile",F),Y=n(t,s,"outfile",h),x=n(t,s,"outdir",h),d=n(t,s,"outbase",h),i=n(t,s,"tsconfig",h),u=n(t,s,"resolveExtensions",W),y=n(t,s,"nodePaths",W),E=n(t,s,"mainFields",W),S=n(t,s,"conditions",W),c=n(t,s,"external",W),p=n(t,s,"alias",Z),w=n(t,s,"loader",Z),k=n(t,s,"outExtension",Z),O=n(t,s,"publicPath",h),P=n(t,s,"entryNames",h),M=n(t,s,"chunkNames",h),v=n(t,s,"assetNames",h),A=n(t,s,"inject",W),I=n(t,s,"banner",Z),K=n(t,s,"footer",Z),j=n(t,s,"entryPoints",_e),U=n(t,s,"absWorkingDir",h),C=n(t,s,"stdin",Z),_=(Q=n(t,s,"write",F))!=null?Q:a,G=n(t,s,"allowOverwrite",F),te=n(t,s,"incremental",F)===!0,ae=n(t,s,"mangleCache",Z);if(s.plugins=!0,z(t,s,`in ${e}() call`),D&&l.push(`--sourcemap${D===!0?"":`=${D}`}`),B&&l.push("--bundle"),G&&l.push("--allow-overwrite"),$)if(l.push("--watch"),typeof $=="boolean")R={};else{let g=Object.create(null),N=n($,g,"onRebuild",Re);z($,g,`on "watch" in ${e}() call`),R={onRebuild:N}}if(T&&l.push("--splitting"),q&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),Y&&l.push(`--outfile=${Y}`),x&&l.push(`--outdir=${x}`),d&&l.push(`--outbase=${d}`),i&&l.push(`--tsconfig=${i}`),u){let g=[];for(let N of u){if(V(N,"resolve extension"),N.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${N}`);g.push(N)}l.push(`--resolve-extensions=${g.join(",")}`)}if(O&&l.push(`--public-path=${O}`),P&&l.push(`--entry-names=${P}`),M&&l.push(`--chunk-names=${M}`),v&&l.push(`--asset-names=${v}`),E){let g=[];for(let N of E){if(V(N,"main field"),N.indexOf(",")>=0)throw new Error(`Invalid main field: ${N}`);g.push(N)}l.push(`--main-fields=${g.join(",")}`)}if(S){let g=[];for(let N of S){if(V(N,"condition"),N.indexOf(",")>=0)throw new Error(`Invalid condition: ${N}`);g.push(N)}l.push(`--conditions=${g.join(",")}`)}if(c)for(let g of c)l.push(`--external:${V(g,"external")}`);if(p)for(let g in p){if(g.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${g}`);l.push(`--alias:${g}=${V(p[g],"alias",g)}`)}if(I)for(let g in I){if(g.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${g}`);l.push(`--banner:${g}=${V(I[g],"banner",g)}`)}if(K)for(let g in K){if(g.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${g}`);l.push(`--footer:${g}=${V(K[g],"footer",g)}`)}if(A)for(let g of A)l.push(`--inject:${V(g,"inject")}`);if(w)for(let g in w){if(g.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${g}`);l.push(`--loader:${g}=${V(w[g],"loader",g)}`)}if(k)for(let g in k){if(g.indexOf("=")>=0)throw new Error(`Invalid out extension: ${g}`);l.push(`--out-extension:${g}=${V(k[g],"out extension",g)}`)}if(j)if(Array.isArray(j))for(let g of j)f.push(["",V(g,"entry point")]);else for(let g in j)f.push([g,V(j[g],"entry point",g)]);if(C){let g=Object.create(null),N=n(C,g,"contents",Te),Oe=n(C,g,"resolveDir",h),Se=n(C,g,"sourcefile",h),Ee=n(C,g,"loader",h);z(C,g,'in "stdin" object'),Se&&l.push(`--sourcefile=${Se}`),Ee&&l.push(`--loader=${Ee}`),Oe&&(b=Oe),typeof N=="string"?m=H(N):N instanceof Uint8Array&&(m=N)}let X=[];if(y)for(let g of y)g+="",X.push(g);return{entries:f,flags:l,write:_,stdinContents:m,stdinResolveDir:b,absWorkingDir:U,incremental:te,nodePaths:X,watch:R,mangleCache:Ue(ae)}}function He(e,t,r,o){let a=[],l=Object.create(null);ge(a,t,l,r,o),Fe(a,t,l);let f=n(t,l,"sourcemap",Pe),s=n(t,l,"tsconfigRaw",Ve),m=n(t,l,"sourcefile",h),b=n(t,l,"loader",h),R=n(t,l,"banner",h),D=n(t,l,"footer",h),B=n(t,l,"mangleCache",Z);return z(t,l,`in ${e}() call`),f&&a.push(`--sourcemap=${f===!0?"external":f}`),s&&a.push(`--tsconfig-raw=${typeof s=="string"?s:JSON.stringify(s)}`),m&&a.push(`--sourcefile=${m}`),b&&a.push(`--loader=${b}`),R&&a.push(`--banner=${R}`),D&&a.push(`--footer=${D}`),{flags:a,mangleCache:Ue(B)}}function je(e){let t={},r={didClose:!1,reason:""},o={},a=0,l=0,f=new Uint8Array(16*1024),s=0,m=d=>{let i=s+d.length;if(i>f.length){let y=new Uint8Array(i*2);y.set(f),f=y}f.set(d,s),s+=d.length;let u=0;for(;u+4<=s;){let y=ve(f,u);if(u+4+y>s)break;u+=4,T(f.subarray(u,u+y)),u+=y}u>0&&(f.copyWithin(0,u,s),s-=u)},b=d=>{r.didClose=!0,d&&(r.reason=": "+(d.message||d));let i="The service was stopped"+r.reason;for(let u in o)o[u](i,null);o={}},R=(d,i,u)=>{if(r.didClose)return u("The service is no longer running"+r.reason,null);let y=a++;o[y]=(E,S)=>{try{u(E,S)}finally{d&&d.unref()}},d&&d.ref(),e.writeToStdin(we({id:y,isRequest:!0,value:i}))},D=(d,i)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(we({id:d,isRequest:!1,value:i}))},B=async(d,i)=>{try{if(i.command==="ping"){D(d,{});return}if(typeof i.key=="number"){let u=t[i.key];if(u){let y=u[i.command];if(y){await y(d,i);return}}}throw new Error("Invalid command: "+i.command)}catch(u){D(d,{errors:[oe(u,e,null,void 0,"")]})}},$=!0,T=d=>{if($){$=!1;let u=String.fromCharCode(...d);if(u!=="0.16.3")throw new Error(`Cannot start service: Host version "0.16.3" does not match binary version ${J(u)}`);return}let i=$e(d);if(i.isRequest)B(i.id,i.value);else{let u=o[i.id];delete o[i.id],i.value.error?u(i.value.error,{}):u(null,i.value)}};return{readFromStdout:m,afterClose:b,service:{buildOrServe:({callName:d,refs:i,serveOptions:u,options:y,isTTY:E,defaultWD:S,callback:c})=>{let p=0,w=l++,k={},O={ref(){++p===1&&i&&i.ref()},unref(){--p===0&&(delete t[w],i&&i.unref())}};t[w]=k,O.ref(),Ge(d,w,R,D,O,e,k,y,u,E,S,r,(P,M)=>{try{c(P,M)}finally{O.unref()}})},transform:({callName:d,refs:i,input:u,options:y,isTTY:E,fs:S,callback:c})=>{let p=Ne(),w=k=>{try{if(typeof u!="string"&&!(u instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:O,mangleCache:P}=He(d,y,E,Me),M={command:"transform",flags:O,inputFS:k!==null,input:k!==null?H(k):typeof u=="string"?H(u):u};P&&(M.mangleCache=P),R(i,M,(v,A)=>{if(v)return c(new Error(v),null);let I=ee(A.errors,p),K=ee(A.warnings,p),j=1,U=()=>{if(--j===0){let C={warnings:K,code:A.code,map:A.map};A.mangleCache&&(C.mangleCache=A==null?void 0:A.mangleCache),c(null,C)}};if(I.length>0)return c(le("Transform failed",I,K),null);A.codeFS&&(j++,S.readFile(A.code,(C,_)=>{C!==null?c(C,null):(A.code=_,U())})),A.mapFS&&(j++,S.readFile(A.map,(C,_)=>{C!==null?c(C,null):(A.map=_,U())})),U()})}catch(O){let P=[];try{ge(P,y,{},E,Me)}catch(v){}let M=oe(O,e,p,void 0,"");R(i,{command:"error",flags:P,error:M},()=>{M.detail=p.load(M.detail),c(le("Transform failed",[M],[]),null)})}};if((typeof u=="string"||u instanceof Uint8Array)&&u.length>1024*1024){let k=w;w=()=>S.writeFile(u,k)}w(null)},formatMessages:({callName:d,refs:i,messages:u,options:y,callback:E})=>{let S=ne(u,"messages",null,"");if(!y)throw new Error(`Missing second argument in ${d}() call`);let c={},p=n(y,c,"kind",h),w=n(y,c,"color",F),k=n(y,c,"terminalWidth",ie);if(z(y,c,`in ${d}() call`),p===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(p!=="error"&&p!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let O={command:"format-msgs",messages:S,isWarning:p==="warning"};w!==void 0&&(O.color=w),k!==void 0&&(O.terminalWidth=k),R(i,O,(P,M)=>{if(P)return E(new Error(P),null);E(null,M.messages)})},analyzeMetafile:({callName:d,refs:i,metafile:u,options:y,callback:E})=>{y===void 0&&(y={});let S={},c=n(y,S,"color",F),p=n(y,S,"verbose",F);z(y,S,`in ${d}() call`);let w={command:"analyze-metafile",metafile:u};c!==void 0&&(w.color=c),p!==void 0&&(w.verbose=p),R(i,w,(k,O)=>{if(k)return E(new Error(k),null);E(null,O.result)})}}}}function Ge(e,t,r,o,a,l,f,s,m,b,R,D,B){let $=Ne(),T=(x,d,i,u)=>{let y=[];try{ge(y,s,{},b,ke)}catch(S){}let E=oe(x,l,$,i,d);r(a,{command:"error",flags:y,error:E},()=>{E.detail=$.load(E.detail),u(E)})},q=(x,d)=>{T(x,d,void 0,i=>{B(le("Build failed",[i],[]),null)})},L;if(typeof s=="object"){let x=s.plugins;if(x!==void 0){if(!Array.isArray(x))throw new Error('"plugins" must be an array');L=x}}if(L&&L.length>0){if(l.isSync){q(new Error("Cannot use plugins in synchronous API calls"),"");return}Ze(t,r,o,a,l,f,s,L,$).then(x=>{if(!x.ok){q(x.error,x.pluginName);return}try{Y(x.requestPlugins,x.runOnEndCallbacks)}catch(d){q(d,"")}},x=>q(x,""));return}try{Y(null,(x,d,i)=>i())}catch(x){q(x,"")}function Y(x,d){let i=!l.isWriteUnavailable,{entries:u,flags:y,write:E,stdinContents:S,stdinResolveDir:c,absWorkingDir:p,incremental:w,nodePaths:k,watch:O,mangleCache:P}=Qe(e,s,b,ke,i),M={command:"build",key:t,entries:u,flags:y,write:E,stdinContents:S,stdinResolveDir:c,absWorkingDir:p||R,incremental:w,nodePaths:k};x&&(M.plugins=x),P&&(M.mangleCache=P);let v=m&&Xe(t,r,o,a,f,m,M),A,I,K=(U,C)=>{U.outputFiles&&(C.outputFiles=U.outputFiles.map(et)),U.metafile&&(C.metafile=JSON.parse(U.metafile)),U.mangleCache&&(C.mangleCache=U.mangleCache),U.writeToStdout!==void 0&&console.log(re(U.writeToStdout).replace(/\n$/,""))},j=(U,C)=>{let _={errors:ee(U.errors,$),warnings:ee(U.warnings,$)};K(U,_),d(_,T,()=>{if(_.errors.length>0)return C(le("Build failed",_.errors,_.warnings),null);if(U.rebuild){if(!A){let G=!1;A=()=>new Promise((te,ae)=>{if(G||D.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:t},(X,Q)=>{if(X)return C(le("Build failed",[{id:"",pluginName:"",text:X,location:null,notes:[],detail:void 0}],[]),null);j(Q,(g,N)=>{g?ae(g):te(N)})})}),a.ref(),A.dispose=()=>{G||(G=!0,r(a,{command:"rebuild-dispose",key:t},()=>{}),a.unref())}}_.rebuild=A}if(U.watch){if(!I){let G=!1;a.ref(),I=()=>{G||(G=!0,delete f["watch-rebuild"],r(a,{command:"watch-stop",key:t},()=>{}),a.unref())},O&&(f["watch-rebuild"]=(te,ae)=>{try{let X=ae.args,Q={errors:ee(X.errors,$),warnings:ee(X.warnings,$)};K(X,Q),d(Q,T,()=>{if(Q.errors.length>0){O.onRebuild&&O.onRebuild(le("Build failed",Q.errors,Q.warnings),null);return}Q.stop=I,O.onRebuild&&O.onRebuild(null,Q)})}catch(X){console.error(X)}o(te,{})})}_.stop=I}C(null,_)})};if(E&&l.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(w&&l.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(O&&l.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,M,(U,C)=>{if(U)return B(new Error(U),null);if(v){let _=C,G=!1;a.ref();let te={port:_.port,host:_.host,wait:v.wait,stop(){G||(G=!0,v.stop(),a.unref())}};return a.ref(),v.wait.then(a.unref,a.unref),B(null,te)}return j(C,B)})}}var Xe=(e,t,r,o,a,l,f)=>{let s={},m=n(l,s,"port",ie),b=n(l,s,"host",h),R=n(l,s,"servedir",h),D=n(l,s,"onRequest",Re),B=new Promise(($,T)=>{a["serve-wait"]=(q,L)=>{L.error!==null?T(new Error(L.error)):$(),r(q,{})}});return f.serve={},z(l,s,"in serve() call"),m!==void 0&&(f.serve.port=m),b!==void 0&&(f.serve.host=b),R!==void 0&&(f.serve.servedir=R),a["serve-request"]=($,T)=>{D&&D(T.args),r($,{})},{wait:B,stop(){t(o,{command:"serve-stop",key:e},()=>{})}}},Ze=async(e,t,r,o,a,l,f,s,m)=>{let b=[],R=[],D={},B={},$=0,T=0,q=[],L=!1;s=[...s];for(let x of s){let d={};if(typeof x!="object")throw new Error(`Plugin at index ${T} must be an object`);let i=n(x,d,"name",h);if(typeof i!="string"||i==="")throw new Error(`Plugin at index ${T} is missing a name`);try{let u=n(x,d,"setup",Re);if(typeof u!="function")throw new Error("Plugin is missing a setup function");z(x,d,`on plugin ${J(i)}`);let y={name:i,onResolve:[],onLoad:[]};T++;let S=u({initialOptions:f,resolve:(c,p={})=>{if(!L)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof c!="string")throw new Error("The path to resolve must be a string");let w=Object.create(null),k=n(p,w,"pluginName",h),O=n(p,w,"importer",h),P=n(p,w,"namespace",h),M=n(p,w,"resolveDir",h),v=n(p,w,"kind",h),A=n(p,w,"pluginData",de);return z(p,w,"in resolve() call"),new Promise((I,K)=>{let j={command:"resolve",path:c,key:e,pluginName:i};if(k!=null&&(j.pluginName=k),O!=null&&(j.importer=O),P!=null&&(j.namespace=P),M!=null&&(j.resolveDir=M),v!=null)j.kind=v;else throw new Error('Must specify "kind" when calling "resolve"');A!=null&&(j.pluginData=m.store(A)),t(o,j,(U,C)=>{U!==null?K(new Error(U)):I({errors:ee(C.errors,m),warnings:ee(C.warnings,m),path:C.path,external:C.external,sideEffects:C.sideEffects,namespace:C.namespace,suffix:C.suffix,pluginData:m.load(C.pluginData)})})})},onStart(c){let p='This error came from the "onStart" callback registered here:',w=fe(new Error(p),a,"onStart");b.push({name:i,callback:c,note:w})},onEnd(c){let p='This error came from the "onEnd" callback registered here:',w=fe(new Error(p),a,"onEnd");R.push({name:i,callback:c,note:w})},onResolve(c,p){let w='This error came from the "onResolve" callback registered here:',k=fe(new Error(w),a,"onResolve"),O={},P=n(c,O,"filter",pe),M=n(c,O,"namespace",h);if(z(c,O,`in onResolve() call for plugin ${J(i)}`),P==null)throw new Error("onResolve() call is missing a filter");let v=$++;D[v]={name:i,callback:p,note:k},y.onResolve.push({id:v,filter:P.source,namespace:M||""})},onLoad(c,p){let w='This error came from the "onLoad" callback registered here:',k=fe(new Error(w),a,"onLoad"),O={},P=n(c,O,"filter",pe),M=n(c,O,"namespace",h);if(z(c,O,`in onLoad() call for plugin ${J(i)}`),P==null)throw new Error("onLoad() call is missing a filter");let v=$++;B[v]={name:i,callback:p,note:k},y.onLoad.push({id:v,filter:P.source,namespace:M||""})},esbuild:a.esbuild});S&&await S,q.push(y)}catch(u){return{ok:!1,error:u,pluginName:i}}}l["on-start"]=async(x,d)=>{let i={errors:[],warnings:[]};await Promise.all(b.map(async({name:u,callback:y,note:E})=>{try{let S=await y();if(S!=null){if(typeof S!="object")throw new Error(`Expected onStart() callback in plugin ${J(u)} to return an object`);let c={},p=n(S,c,"errors",W),w=n(S,c,"warnings",W);z(S,c,`from onStart() callback in plugin ${J(u)}`),p!=null&&i.errors.push(...ne(p,"errors",m,u)),w!=null&&i.warnings.push(...ne(w,"warnings",m,u))}}catch(S){i.errors.push(oe(S,a,m,E&&E(),u))}})),r(x,i)},l["on-resolve"]=async(x,d)=>{let i={},u="",y,E;for(let S of d.ids)try{({name:u,callback:y,note:E}=D[S]);let c=await y({path:d.path,importer:d.importer,namespace:d.namespace,resolveDir:d.resolveDir,kind:d.kind,pluginData:m.load(d.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onResolve() callback in plugin ${J(u)} to return an object`);let p={},w=n(c,p,"pluginName",h),k=n(c,p,"path",h),O=n(c,p,"namespace",h),P=n(c,p,"suffix",h),M=n(c,p,"external",F),v=n(c,p,"sideEffects",F),A=n(c,p,"pluginData",de),I=n(c,p,"errors",W),K=n(c,p,"warnings",W),j=n(c,p,"watchFiles",W),U=n(c,p,"watchDirs",W);z(c,p,`from onResolve() callback in plugin ${J(u)}`),i.id=S,w!=null&&(i.pluginName=w),k!=null&&(i.path=k),O!=null&&(i.namespace=O),P!=null&&(i.suffix=P),M!=null&&(i.external=M),v!=null&&(i.sideEffects=v),A!=null&&(i.pluginData=m.store(A)),I!=null&&(i.errors=ne(I,"errors",m,u)),K!=null&&(i.warnings=ne(K,"warnings",m,u)),j!=null&&(i.watchFiles=ce(j,"watchFiles")),U!=null&&(i.watchDirs=ce(U,"watchDirs"));break}}catch(c){i={id:S,errors:[oe(c,a,m,E&&E(),u)]};break}r(x,i)},l["on-load"]=async(x,d)=>{let i={},u="",y,E;for(let S of d.ids)try{({name:u,callback:y,note:E}=B[S]);let c=await y({path:d.path,namespace:d.namespace,suffix:d.suffix,pluginData:m.load(d.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onLoad() callback in plugin ${J(u)} to return an object`);let p={},w=n(c,p,"pluginName",h),k=n(c,p,"contents",Te),O=n(c,p,"resolveDir",h),P=n(c,p,"pluginData",de),M=n(c,p,"loader",h),v=n(c,p,"errors",W),A=n(c,p,"warnings",W),I=n(c,p,"watchFiles",W),K=n(c,p,"watchDirs",W);z(c,p,`from onLoad() callback in plugin ${J(u)}`),i.id=S,w!=null&&(i.pluginName=w),k instanceof Uint8Array?i.contents=k:k!=null&&(i.contents=H(k)),O!=null&&(i.resolveDir=O),P!=null&&(i.pluginData=m.store(P)),M!=null&&(i.loader=M),v!=null&&(i.errors=ne(v,"errors",m,u)),A!=null&&(i.warnings=ne(A,"warnings",m,u)),I!=null&&(i.watchFiles=ce(I,"watchFiles")),K!=null&&(i.watchDirs=ce(K,"watchDirs"));break}}catch(c){i={id:S,errors:[oe(c,a,m,E&&E(),u)]};break}r(x,i)};let Y=(x,d,i)=>i();return R.length>0&&(Y=(x,d,i)=>{(async()=>{for(let{name:u,callback:y,note:E}of R)try{await y(x)}catch(S){x.errors.push(await new Promise(c=>d(S,u,E&&E(),c)))}})().then(i)}),L=!0,{ok:!0,requestPlugins:q,runOnEndCallbacks:Y}};function Ne(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let o=t++;return e.set(o,r),o}}}function fe(e,t,r){let o,a=!1;return()=>{if(a)return o;a=!0;try{let l=(e.stack+"").split(`
|
7
7
|
`);l.splice(1,1);let f=Le(t,l,r);if(f)return o={text:e.message,location:f},o}catch(l){}}}function oe(e,t,r,o,a){let l="Internal error",f=null;try{l=(e&&e.message||e)+""}catch(s){}try{f=Le(t,(e.stack+"").split(`
|
8
8
|
`),"")}catch(s){}return{id:"",pluginName:a,text:l,location:f,notes:o?[o]:[],detail:r?r.store(e):-1}}function Le(e,t,r){let o=" at ";if(e.readFileSync&&!t[0].startsWith(o)&&t[1].startsWith(o))for(let a=1;a<t.length;a++){let l=t[a];if(!!l.startsWith(o))for(l=l.slice(o.length);;){let f=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(f){l=f[1];continue}if(f=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),f){l=f[1];continue}if(f=/^(\S+):(\d+):(\d+)$/.exec(l),f){let s;try{s=e.readFileSync(f[1],"utf8")}catch(D){break}let m=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+f[2]-1]||"",b=+f[3]-1,R=m.slice(b,b+r.length)===r?r.length:0;return{file:f[1],namespace:"file",line:+f[2],column:H(m.slice(0,b)).length,length:H(m.slice(b,b+R)).length,lineText:m+`
|
9
9
|
`+t.slice(1).join(`
|
10
10
|
`),suggestion:""}}break}}return null}function le(e,t,r){let o=5,a=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,o+1).map((f,s)=>{if(s===o)return`
|
11
11
|
...`;if(!f.location)return`
|
12
12
|
error: ${f.text}`;let{file:m,line:b,column:R}=f.location,D=f.pluginName?`[plugin: ${f.pluginName}] `:"";return`
|
13
|
-
${m}:${b}:${R}: ERROR: ${D}${f.text}`}).join(""),l=new Error(`${e}${a}`);return l.errors=t,l.warnings=r,l}function ee(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function De(e,t){if(e==null)return null;let r={},o=n(e,r,"file",h),a=n(e,r,"namespace",h),l=n(e,r,"line",ie),f=n(e,r,"column",ie),s=n(e,r,"length",ie),m=n(e,r,"lineText",h),b=n(e,r,"suggestion",h);return z(e,r,t),{file:o||"",namespace:a||"",line:l||0,column:f||0,length:s||0,lineText:m||"",suggestion:b||""}}function ne(e,t,r,o){let a=[],l=0;for(let f of e){let s={},m=n(f,s,"id",h),b=n(f,s,"pluginName",h),R=n(f,s,"text",h),D=n(f,s,"location",Ce),B=n(f,s,"notes",W),$=n(f,s,"detail",de),T=`in element ${l} of "${t}"`;z(f,s,T);let q=[];if(B)for(let L of B){let Y={},x=n(L,Y,"text",h),d=n(L,Y,"location",Ce);z(L,Y,T),q.push({text:x||"",location:De(d,T)})}a.push({id:m||"",pluginName:b||o,text:R||"",location:De(D,T),notes:q,detail:r?r.store($):-1}),l++}return a}function ce(e,t){let r=[];for(let o of e){if(typeof o!="string")throw new Error(`${J(t)} must be an array of strings`);r.push(o)}return r}function et({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){let o=this.contents;return(r===null||o!==t)&&(t=o,r=re(o)),r}}}var rt="0.16.1",nt=e=>me().build(e),lt=()=>{throw new Error('The "serve" API only works in node')},it=(e,t)=>me().transform(e,t),ot=(e,t)=>me().formatMessages(e,t),st=(e,t)=>me().analyzeMetafile(e,t),at=()=>{throw new Error('The "buildSync" API only works in node')},ut=()=>{throw new Error('The "transformSync" API only works in node')},ft=()=>{throw new Error('The "formatMessagesSync" API only works in node')},ct=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},se,xe,me=()=>{if(xe)return xe;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')},dt=e=>{e=Be(e||{});let t=e.wasmURL,r=e.wasmModule,o=e.worker!==!1;if(!t&&!r)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=pt(t||"",r,o),se.catch(()=>{se=void 0}),se},pt=async(e,t,r)=>{let o;if(r){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 r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{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(n,s){c+=g.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!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"),g=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)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(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 l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;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>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;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()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){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 n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),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(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.16.1"],tryToInstantiateModule(r,a).then(h=>{postMessage(null),a.run(h)},h=>{postMessage(h)})};async function tryToInstantiateModule(r,f){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const g=await fetch(r);if(!g.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(g.headers.get("Content-Type")||""))return(await WebAssembly.instantiateStreaming(g,f.importObject)).instance;const c=await g.arrayBuffer();return(await WebAssembly.instantiate(c,f.importObject)).instance}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});o=new Worker(URL.createObjectURL(b))}else{let b=(postMessage=>{
|
13
|
+
${m}:${b}:${R}: ERROR: ${D}${f.text}`}).join(""),l=new Error(`${e}${a}`);return l.errors=t,l.warnings=r,l}function ee(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function De(e,t){if(e==null)return null;let r={},o=n(e,r,"file",h),a=n(e,r,"namespace",h),l=n(e,r,"line",ie),f=n(e,r,"column",ie),s=n(e,r,"length",ie),m=n(e,r,"lineText",h),b=n(e,r,"suggestion",h);return z(e,r,t),{file:o||"",namespace:a||"",line:l||0,column:f||0,length:s||0,lineText:m||"",suggestion:b||""}}function ne(e,t,r,o){let a=[],l=0;for(let f of e){let s={},m=n(f,s,"id",h),b=n(f,s,"pluginName",h),R=n(f,s,"text",h),D=n(f,s,"location",Ce),B=n(f,s,"notes",W),$=n(f,s,"detail",de),T=`in element ${l} of "${t}"`;z(f,s,T);let q=[];if(B)for(let L of B){let Y={},x=n(L,Y,"text",h),d=n(L,Y,"location",Ce);z(L,Y,T),q.push({text:x||"",location:De(d,T)})}a.push({id:m||"",pluginName:b||o,text:R||"",location:De(D,T),notes:q,detail:r?r.store($):-1}),l++}return a}function ce(e,t){let r=[];for(let o of e){if(typeof o!="string")throw new Error(`${J(t)} must be an array of strings`);r.push(o)}return r}function et({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){let o=this.contents;return(r===null||o!==t)&&(t=o,r=re(o)),r}}}var rt="0.16.3",nt=e=>me().build(e),lt=()=>{throw new Error('The "serve" API only works in node')},it=(e,t)=>me().transform(e,t),ot=(e,t)=>me().formatMessages(e,t),st=(e,t)=>me().analyzeMetafile(e,t),at=()=>{throw new Error('The "buildSync" API only works in node')},ut=()=>{throw new Error('The "transformSync" API only works in node')},ft=()=>{throw new Error('The "formatMessagesSync" API only works in node')},ct=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},se,xe,me=()=>{if(xe)return xe;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')},dt=e=>{e=Be(e||{});let t=e.wasmURL,r=e.wasmModule,o=e.worker!==!1;if(!t&&!r)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=pt(t||"",r,o),se.catch(()=>{se=void 0}),se},pt=async(e,t,r)=>{let o;if(r){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 r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{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(n,s){c+=g.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!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"),g=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)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(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 l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;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>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;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()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){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 n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),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(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.16.3"],tryToInstantiateModule(r,a).then(h=>{postMessage(null),a.run(h)},h=>{postMessage(h)})};async function tryToInstantiateModule(r,f){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const g=await fetch(r);if(!g.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(g.headers.get("Content-Type")||""))return(await WebAssembly.instantiateStreaming(g,f.importObject)).instance;const c=await g.arrayBuffer();return(await WebAssembly.instantiate(c,f.importObject)).instance}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});o=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 r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{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(n,s){c+=g.decode(s);const i=c.lastIndexOf(`
|
18
18
|
`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!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"),g=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)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(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 l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;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>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;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()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){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 n=4096;const s=e=>{const t=n,o=f.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),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(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`
|
19
19
|
`);d.length>1&&console.log(d.slice(0,-1).join(`
|
20
|
-
`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.16.
|
20
|
+
`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.16.3"],tryToInstantiateModule(r,a).then(h=>{postMessage(null),a.run(h)},h=>{postMessage(h)})};async function tryToInstantiateModule(r,f){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const g=await fetch(r);if(!g.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(g.headers.get("Content-Type")||""))return(await WebAssembly.instantiateStreaming(g,f.importObject)).instance;const c=await g.arrayBuffer();return(await WebAssembly.instantiate(c,f.importObject)).instance}return r=>onmessage(r);})(R=>o.onmessage({data:R}));o={onmessage:null,postMessage:R=>setTimeout(()=>b({data:R})),terminate(){}}}let a,l,f=new Promise((b,R)=>{a=b,l=R});o.onmessage=({data:b})=>{o.onmessage=({data:R})=>s(R),b?l(b):a()},o.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:s,service:m}=je({writeToStdin(b){o.postMessage(b)},isSync:!1,isWriteUnavailable:!0,esbuild:ye});await f,xe={build:b=>new Promise((R,D)=>m.buildOrServe({callName:"build",refs:null,serveOptions:null,options:b,isTTY:!1,defaultWD:"/",callback:(B,$)=>B?D(B):R($)})),transform:(b,R)=>new Promise((D,B)=>m.transform({callName:"transform",refs:null,input:b,options:R||{},isTTY:!1,fs:{readFile($,T){T(new Error("Internal error"),null)},writeFile($,T){T(null)}},callback:($,T)=>$?B($):D(T)})),formatMessages:(b,R)=>new Promise((D,B)=>m.formatMessages({callName:"formatMessages",refs:null,messages:b,options:R,callback:($,T)=>$?B($):D(T)})),analyzeMetafile:(b,R)=>new Promise((D,B)=>m.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof b=="string"?b:JSON.stringify(b),options:R,callback:($,T)=>$?B($):D(T)}))}},gt=ye;export{st as analyzeMetafile,ct as analyzeMetafileSync,nt as build,at as buildSync,gt as default,ot as formatMessages,ft as formatMessagesSync,dt as initialize,lt as serve,it as transform,ut as transformSync,rt as version};
|
@@ -747,8 +747,8 @@ function createChannel(streamIn) {
|
|
747
747
|
if (isFirstPacket) {
|
748
748
|
isFirstPacket = false;
|
749
749
|
let binaryVersion = String.fromCharCode(...bytes);
|
750
|
-
if (binaryVersion !== "0.16.
|
751
|
-
throw new Error(`Cannot start service: Host version "${"0.16.
|
750
|
+
if (binaryVersion !== "0.16.3") {
|
751
|
+
throw new Error(`Cannot start service: Host version "${"0.16.3"}" does not match binary version ${quote(binaryVersion)}`);
|
752
752
|
}
|
753
753
|
return;
|
754
754
|
}
|
@@ -1700,7 +1700,7 @@ function convertOutputFiles({ path, contents }) {
|
|
1700
1700
|
}
|
1701
1701
|
|
1702
1702
|
// lib/npm/browser.ts
|
1703
|
-
var version = "0.16.
|
1703
|
+
var version = "0.16.3";
|
1704
1704
|
var build = (options) => ensureServiceIsRunning().build(options);
|
1705
1705
|
var serve = () => {
|
1706
1706
|
throw new Error(`The "serve" API only works in node`);
|
@@ -1747,7 +1747,7 @@ var initialize = (options) => {
|
|
1747
1747
|
var startRunningService = (wasmURL, wasmModule, useWorker) => __async(void 0, null, function* () {
|
1748
1748
|
let worker;
|
1749
1749
|
if (useWorker) {
|
1750
|
-
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 writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(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 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 go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\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 "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\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 "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\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) + 1\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\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 "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\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 = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\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 = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\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 "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\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 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 [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)\n 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)\n resumeStdin();\n }\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.16.1"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\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)\n 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" });
|
1750
|
+
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 writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(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 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 go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\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 "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\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 "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\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) + 1\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\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 "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\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 = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\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 = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\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 "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\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 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 [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)\n 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)\n resumeStdin();\n }\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.16.3"}`];\n tryToInstantiateModule(wasm, go).then(\n (instance) => {\n postMessage(null);\n go.run(instance);\n },\n (error) => {\n postMessage(error);\n }\n );\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)\n 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" });
|
1751
1751
|
worker = new Worker(URL.createObjectURL(blob));
|
1752
1752
|
} else {
|
1753
1753
|
let onmessage = ((postMessage) => {
|
@@ -2351,7 +2351,7 @@ var startRunningService = (wasmURL, wasmModule, useWorker) => __async(void 0, nu
|
|
2351
2351
|
callback(null, count);
|
2352
2352
|
};
|
2353
2353
|
let go = new globalThis.Go();
|
2354
|
-
go.argv = ["", `--service=${"0.16.
|
2354
|
+
go.argv = ["", `--service=${"0.16.3"}`];
|
2355
2355
|
tryToInstantiateModule(wasm, go).then(
|
2356
2356
|
(instance) => {
|
2357
2357
|
postMessage(null);
|
@@ -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 xe(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function ve(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var J=JSON.stringify,Ae="warning",Ce="silent";function De(e){if(V(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var pe=()=>null,F=e=>typeof e=="boolean"?null:"a boolean",Qe=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",b=e=>typeof e=="string"?null:"a string",ge=e=>e instanceof RegExp?null:"a RegExp object",oe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Oe=e=>typeof e=="function"?null:"a function",W=e=>Array.isArray(e)?null:"an array",Z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",He=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ge=e=>typeof e=="object"&&e!==null?null:"an array or an object",Pe=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Be=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Xe=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ze=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Ue=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",et=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function n(e,t,r,i){let a=e[r];if(t[r+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`${J(r)} must be ${l}`);return a}function z(e,t,r){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${r}: ${J(i)}`)}function Fe(e){let t=Object.create(null),r=n(e,t,"wasmURL",et),i=n(e,t,"wasmModule",He),a=n(e,t,"worker",F);return z(e,t,"in initialize() call"),{wasmURL:r,wasmModule:i,worker:a}}function je(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let i=e[r];if(typeof i=="string"||i===!1)t[r]=i;else throw new Error(`Expected ${J(r)} in mangle cache to map to either a string or false`)}}return t}function me(e,t,r,i,a){let l=n(t,r,"color",F),c=n(t,r,"logLevel",b),s=n(t,r,"logLimit",oe);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${c||a}`),e.push(`--log-limit=${s||0}`)}function V(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+J(r):""} to be a string, got ${typeof e} instead`);return e}function Ne(e,t,r){let i=n(t,r,"legalComments",b),a=n(t,r,"sourceRoot",b),l=n(t,r,"sourcesContent",F),c=n(t,r,"target",Ze),s=n(t,r,"format",b),g=n(t,r,"globalName",b),y=n(t,r,"mangleProps",ge),R=n(t,r,"reserveProps",ge),C=n(t,r,"mangleQuoted",F),B=n(t,r,"minify",F),$=n(t,r,"minifySyntax",F),T=n(t,r,"minifyWhitespace",F),q=n(t,r,"minifyIdentifiers",F),L=n(t,r,"drop",W),Y=n(t,r,"charset",b),x=n(t,r,"treeShaking",F),d=n(t,r,"ignoreAnnotations",F),o=n(t,r,"jsx",b),f=n(t,r,"jsxFactory",b),h=n(t,r,"jsxFragment",b),E=n(t,r,"jsxImportSource",b),D=n(t,r,"jsxDev",F),u=n(t,r,"jsxSideEffects",F),p=n(t,r,"define",Z),w=n(t,r,"logOverride",Z),S=n(t,r,"supported",Z),O=n(t,r,"pure",W),P=n(t,r,"keepNames",F),k=n(t,r,"platform",b);if(i&&e.push(`--legal-comments=${i}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(De).join(",")}`):e.push(`--target=${De(c)}`)),s&&e.push(`--format=${s}`),g&&e.push(`--global-name=${g}`),k&&e.push(`--platform=${k}`),B&&e.push("--minify"),$&&e.push("--minify-syntax"),T&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),Y&&e.push(`--charset=${Y}`),x!==void 0&&e.push(`--tree-shaking=${x}`),d&&e.push("--ignore-annotations"),L)for(let v of L)e.push(`--drop:${V(v,"drop")}`);if(y&&e.push(`--mangle-props=${y.source}`),R&&e.push(`--reserve-props=${R.source}`),C!==void 0&&e.push(`--mangle-quoted=${C}`),o&&e.push(`--jsx=${o}`),f&&e.push(`--jsx-factory=${f}`),h&&e.push(`--jsx-fragment=${h}`),E&&e.push(`--jsx-import-source=${E}`),D&&e.push("--jsx-dev"),u&&e.push("--jsx-side-effects"),p)for(let v in p){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);e.push(`--define:${v}=${V(p[v],"define",v)}`)}if(w)for(let v in w){if(v.indexOf("=")>=0)throw new Error(`Invalid log override: ${v}`);e.push(`--log-override:${v}=${V(w[v],"log override",v)}`)}if(S)for(let v in S){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);let M=S[v];if(typeof M!="boolean")throw new Error(`Expected value for supported ${J(v)} to be a boolean, got ${typeof M} instead`);e.push(`--supported:${v}=${M}`)}if(O)for(let v of O)e.push(`--pure:${V(v,"pure")}`);P&&e.push("--keep-names")}function tt(e,t,r,i,a){var Q;let l=[],c=[],s=Object.create(null),g=null,y=null,R=null;me(l,t,s,r,i),Ne(l,t,s);let C=n(t,s,"sourcemap",Be),B=n(t,s,"bundle",F),$=n(t,s,"watch",Qe),T=n(t,s,"splitting",F),q=n(t,s,"preserveSymlinks",F),L=n(t,s,"metafile",F),Y=n(t,s,"outfile",b),x=n(t,s,"outdir",b),d=n(t,s,"outbase",b),o=n(t,s,"tsconfig",b),f=n(t,s,"resolveExtensions",W),h=n(t,s,"nodePaths",W),E=n(t,s,"mainFields",W),D=n(t,s,"conditions",W),u=n(t,s,"external",W),p=n(t,s,"alias",Z),w=n(t,s,"loader",Z),S=n(t,s,"outExtension",Z),O=n(t,s,"publicPath",b),P=n(t,s,"entryNames",b),k=n(t,s,"chunkNames",b),v=n(t,s,"assetNames",b),M=n(t,s,"inject",W),I=n(t,s,"banner",Z),K=n(t,s,"footer",Z),j=n(t,s,"entryPoints",Ge),U=n(t,s,"absWorkingDir",b),A=n(t,s,"stdin",Z),_=(Q=n(t,s,"write",F))!=null?Q:a,G=n(t,s,"allowOverwrite",F),re=n(t,s,"incremental",F)===!0,ue=n(t,s,"mangleCache",Z);if(s.plugins=!0,z(t,s,`in ${e}() call`),C&&l.push(`--sourcemap${C===!0?"":`=${C}`}`),B&&l.push("--bundle"),G&&l.push("--allow-overwrite"),$)if(l.push("--watch"),typeof $=="boolean")R={};else{let m=Object.create(null),N=n($,m,"onRebuild",Oe);z($,m,`on "watch" in ${e}() call`),R={onRebuild:N}}if(T&&l.push("--splitting"),q&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),Y&&l.push(`--outfile=${Y}`),x&&l.push(`--outdir=${x}`),d&&l.push(`--outbase=${d}`),o&&l.push(`--tsconfig=${o}`),f){let m=[];for(let N of f){if(V(N,"resolve extension"),N.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${N}`);m.push(N)}l.push(`--resolve-extensions=${m.join(",")}`)}if(O&&l.push(`--public-path=${O}`),P&&l.push(`--entry-names=${P}`),k&&l.push(`--chunk-names=${k}`),v&&l.push(`--asset-names=${v}`),E){let m=[];for(let N of E){if(V(N,"main field"),N.indexOf(",")>=0)throw new Error(`Invalid main field: ${N}`);m.push(N)}l.push(`--main-fields=${m.join(",")}`)}if(D){let m=[];for(let N of D){if(V(N,"condition"),N.indexOf(",")>=0)throw new Error(`Invalid condition: ${N}`);m.push(N)}l.push(`--conditions=${m.join(",")}`)}if(u)for(let m of u)l.push(`--external:${V(m,"external")}`);if(p)for(let m in p){if(m.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${m}`);l.push(`--alias:${m}=${V(p[m],"alias",m)}`)}if(I)for(let m in I){if(m.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${m}`);l.push(`--banner:${m}=${V(I[m],"banner",m)}`)}if(K)for(let m in K){if(m.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${m}`);l.push(`--footer:${m}=${V(K[m],"footer",m)}`)}if(M)for(let m of M)l.push(`--inject:${V(m,"inject")}`);if(w)for(let m in w){if(m.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${m}`);l.push(`--loader:${m}=${V(w[m],"loader",m)}`)}if(S)for(let m in S){if(m.indexOf("=")>=0)throw new Error(`Invalid out extension: ${m}`);l.push(`--out-extension:${m}=${V(S[m],"out extension",m)}`)}if(j)if(Array.isArray(j))for(let m of j)c.push(["",V(m,"entry point")]);else for(let m in j)c.push([m,V(j[m],"entry point",m)]);if(A){let m=Object.create(null),N=n(A,m,"contents",Ue),Ee=n(A,m,"resolveDir",b),$e=n(A,m,"sourcefile",b),ke=n(A,m,"loader",b);z(A,m,'in "stdin" object'),$e&&l.push(`--sourcefile=${$e}`),ke&&l.push(`--loader=${ke}`),Ee&&(y=Ee),typeof N=="string"?g=H(N):N instanceof Uint8Array&&(g=N)}let X=[];if(h)for(let m of h)m+="",X.push(m);return{entries:c,flags:l,write:_,stdinContents:g,stdinResolveDir:y,absWorkingDir:U,incremental:re,nodePaths:X,watch:R,mangleCache:je(ue)}}function rt(e,t,r,i){let a=[],l=Object.create(null);me(a,t,l,r,i),Ne(a,t,l);let c=n(t,l,"sourcemap",Be),s=n(t,l,"tsconfigRaw",Xe),g=n(t,l,"sourcefile",b),y=n(t,l,"loader",b),R=n(t,l,"banner",b),C=n(t,l,"footer",b),B=n(t,l,"mangleCache",Z);return z(t,l,`in ${e}() call`),c&&a.push(`--sourcemap=${c===!0?"external":c}`),s&&a.push(`--tsconfig-raw=${typeof s=="string"?s:JSON.stringify(s)}`),g&&a.push(`--sourcefile=${g}`),y&&a.push(`--loader=${y}`),R&&a.push(`--banner=${R}`),C&&a.push(`--footer=${C}`),{flags:a,mangleCache:je(B)}}function Le(e){let t={},r={didClose:!1,reason:""},i={},a=0,l=0,c=new Uint8Array(16*1024),s=0,g=d=>{let o=s+d.length;if(o>c.length){let h=new Uint8Array(o*2);h.set(c),c=h}c.set(d,s),s+=d.length;let f=0;for(;f+4<=s;){let h=xe(c,f);if(f+4+h>s)break;f+=4,T(c.subarray(f,f+h)),f+=h}f>0&&(c.copyWithin(0,f,s),s-=f)},y=d=>{r.didClose=!0,d&&(r.reason=": "+(d.message||d));let o="The service was stopped"+r.reason;for(let f in i)i[f](o,null);i={}},R=(d,o,f)=>{if(r.didClose)return f("The service is no longer running"+r.reason,null);let h=a++;i[h]=(E,D)=>{try{f(E,D)}finally{d&&d.unref()}},d&&d.ref(),e.writeToStdin(Re({id:h,isRequest:!0,value:o}))},C=(d,o)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(Re({id:d,isRequest:!1,value:o}))},B=(d,o)=>ee(this,null,function*(){try{if(o.command==="ping"){C(d,{});return}if(typeof o.key=="number"){let f=t[o.key];if(f){let h=f[o.command];if(h){yield h(d,o);return}}}throw new Error("Invalid command: "+o.command)}catch(f){C(d,{errors:[se(f,e,null,void 0,"")]})}}),$=!0,T=d=>{if($){$=!1;let f=String.fromCharCode(...d);if(f!=="0.16.1")throw new Error(`Cannot start service: Host version "0.16.1" does not match binary version ${J(f)}`);return}let o=Me(d);if(o.isRequest)B(o.id,o.value);else{let f=i[o.id];delete i[o.id],o.value.error?f(o.value.error,{}):f(null,o.value)}};return{readFromStdout:g,afterClose:y,service:{buildOrServe:({callName:d,refs:o,serveOptions:f,options:h,isTTY:E,defaultWD:D,callback:u})=>{let p=0,w=l++,S={},O={ref(){++p===1&&o&&o.ref()},unref(){--p===0&&(delete t[w],o&&o.unref())}};t[w]=S,O.ref(),nt(d,w,R,C,O,e,S,h,f,E,D,r,(P,k)=>{try{u(P,k)}finally{O.unref()}})},transform:({callName:d,refs:o,input:f,options:h,isTTY:E,fs:D,callback:u})=>{let p=Ie(),w=S=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:O,mangleCache:P}=rt(d,h,E,Ce),k={command:"transform",flags:O,inputFS:S!==null,input:S!==null?H(S):typeof f=="string"?H(f):f};P&&(k.mangleCache=P),R(o,k,(v,M)=>{if(v)return u(new Error(v),null);let I=te(M.errors,p),K=te(M.warnings,p),j=1,U=()=>{if(--j===0){let A={warnings:K,code:M.code,map:M.map};M.mangleCache&&(A.mangleCache=M==null?void 0:M.mangleCache),u(null,A)}};if(I.length>0)return u(ie("Transform failed",I,K),null);M.codeFS&&(j++,D.readFile(M.code,(A,_)=>{A!==null?u(A,null):(M.code=_,U())})),M.mapFS&&(j++,D.readFile(M.map,(A,_)=>{A!==null?u(A,null):(M.map=_,U())})),U()})}catch(O){let P=[];try{me(P,h,{},E,Ce)}catch(v){}let k=se(O,e,p,void 0,"");R(o,{command:"error",flags:P,error:k},()=>{k.detail=p.load(k.detail),u(ie("Transform failed",[k],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let S=w;w=()=>D.writeFile(f,S)}w(null)},formatMessages:({callName:d,refs:o,messages:f,options:h,callback:E})=>{let D=le(f,"messages",null,"");if(!h)throw new Error(`Missing second argument in ${d}() call`);let u={},p=n(h,u,"kind",b),w=n(h,u,"color",F),S=n(h,u,"terminalWidth",oe);if(z(h,u,`in ${d}() call`),p===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(p!=="error"&&p!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let O={command:"format-msgs",messages:D,isWarning:p==="warning"};w!==void 0&&(O.color=w),S!==void 0&&(O.terminalWidth=S),R(o,O,(P,k)=>{if(P)return E(new Error(P),null);E(null,k.messages)})},analyzeMetafile:({callName:d,refs:o,metafile:f,options:h,callback:E})=>{h===void 0&&(h={});let D={},u=n(h,D,"color",F),p=n(h,D,"verbose",F);z(h,D,`in ${d}() call`);let w={command:"analyze-metafile",metafile:f};u!==void 0&&(w.color=u),p!==void 0&&(w.verbose=p),R(o,w,(S,O)=>{if(S)return E(new Error(S),null);E(null,O.result)})}}}}function nt(e,t,r,i,a,l,c,s,g,y,R,C,B){let $=Ie(),T=(x,d,o,f)=>{let h=[];try{me(h,s,{},y,Ae)}catch(D){}let E=se(x,l,$,o,d);r(a,{command:"error",flags:h,error:E},()=>{E.detail=$.load(E.detail),f(E)})},q=(x,d)=>{T(x,d,void 0,o=>{B(ie("Build failed",[o],[]),null)})},L;if(typeof s=="object"){let x=s.plugins;if(x!==void 0){if(!Array.isArray(x))throw new Error('"plugins" must be an array');L=x}}if(L&&L.length>0){if(l.isSync){q(new Error("Cannot use plugins in synchronous API calls"),"");return}it(t,r,i,a,l,c,s,L,$).then(x=>{if(!x.ok){q(x.error,x.pluginName);return}try{Y(x.requestPlugins,x.runOnEndCallbacks)}catch(d){q(d,"")}},x=>q(x,""));return}try{Y(null,(x,d,o)=>o())}catch(x){q(x,"")}function Y(x,d){let o=!l.isWriteUnavailable,{entries:f,flags:h,write:E,stdinContents:D,stdinResolveDir:u,absWorkingDir:p,incremental:w,nodePaths:S,watch:O,mangleCache:P}=tt(e,s,y,Ae,o),k={command:"build",key:t,entries:f,flags:h,write:E,stdinContents:D,stdinResolveDir:u,absWorkingDir:p||R,incremental:w,nodePaths:S};x&&(k.plugins=x),P&&(k.mangleCache=P);let v=g&<(t,r,i,a,c,g,k),M,I,K=(U,A)=>{U.outputFiles&&(A.outputFiles=U.outputFiles.map(ot)),U.metafile&&(A.metafile=JSON.parse(U.metafile)),U.mangleCache&&(A.mangleCache=U.mangleCache),U.writeToStdout!==void 0&&console.log(ne(U.writeToStdout).replace(/\n$/,""))},j=(U,A)=>{let _={errors:te(U.errors,$),warnings:te(U.warnings,$)};K(U,_),d(_,T,()=>{if(_.errors.length>0)return A(ie("Build failed",_.errors,_.warnings),null);if(U.rebuild){if(!M){let G=!1;M=()=>new Promise((re,ue)=>{if(G||C.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:t},(X,Q)=>{if(X)return A(ie("Build failed",[{id:"",pluginName:"",text:X,location:null,notes:[],detail:void 0}],[]),null);j(Q,(m,N)=>{m?ue(m):re(N)})})}),a.ref(),M.dispose=()=>{G||(G=!0,r(a,{command:"rebuild-dispose",key:t},()=>{}),a.unref())}}_.rebuild=M}if(U.watch){if(!I){let G=!1;a.ref(),I=()=>{G||(G=!0,delete c["watch-rebuild"],r(a,{command:"watch-stop",key:t},()=>{}),a.unref())},O&&(c["watch-rebuild"]=(re,ue)=>{try{let X=ue.args,Q={errors:te(X.errors,$),warnings:te(X.warnings,$)};K(X,Q),d(Q,T,()=>{if(Q.errors.length>0){O.onRebuild&&O.onRebuild(ie("Build failed",Q.errors,Q.warnings),null);return}Q.stop=I,O.onRebuild&&O.onRebuild(null,Q)})}catch(X){console.error(X)}i(re,{})})}_.stop=I}A(null,_)})};if(E&&l.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(w&&l.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(O&&l.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,k,(U,A)=>{if(U)return B(new Error(U),null);if(v){let _=A,G=!1;a.ref();let re={port:_.port,host:_.host,wait:v.wait,stop(){G||(G=!0,v.stop(),a.unref())}};return a.ref(),v.wait.then(a.unref,a.unref),B(null,re)}return j(A,B)})}}var lt=(e,t,r,i,a,l,c)=>{let s={},g=n(l,s,"port",oe),y=n(l,s,"host",b),R=n(l,s,"servedir",b),C=n(l,s,"onRequest",Oe),B=new Promise(($,T)=>{a["serve-wait"]=(q,L)=>{L.error!==null?T(new Error(L.error)):$(),r(q,{})}});return c.serve={},z(l,s,"in serve() call"),g!==void 0&&(c.serve.port=g),y!==void 0&&(c.serve.host=y),R!==void 0&&(c.serve.servedir=R),a["serve-request"]=($,T)=>{C&&C(T.args),r($,{})},{wait:B,stop(){t(i,{command:"serve-stop",key:e},()=>{})}}},it=(e,t,r,i,a,l,c,s,g)=>ee(void 0,null,function*(){let y=[],R=[],C={},B={},$=0,T=0,q=[],L=!1;s=[...s];for(let x of s){let d={};if(typeof x!="object")throw new Error(`Plugin at index ${T} must be an object`);let o=n(x,d,"name",b);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${T} is missing a name`);try{let f=n(x,d,"setup",Oe);if(typeof f!="function")throw new Error("Plugin is missing a setup function");z(x,d,`on plugin ${J(o)}`);let h={name:o,onResolve:[],onLoad:[]};T++;let D=f({initialOptions:c,resolve:(u,p={})=>{if(!L)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 w=Object.create(null),S=n(p,w,"pluginName",b),O=n(p,w,"importer",b),P=n(p,w,"namespace",b),k=n(p,w,"resolveDir",b),v=n(p,w,"kind",b),M=n(p,w,"pluginData",pe);return z(p,w,"in resolve() call"),new Promise((I,K)=>{let j={command:"resolve",path:u,key:e,pluginName:o};if(S!=null&&(j.pluginName=S),O!=null&&(j.importer=O),P!=null&&(j.namespace=P),k!=null&&(j.resolveDir=k),v!=null)j.kind=v;else throw new Error('Must specify "kind" when calling "resolve"');M!=null&&(j.pluginData=g.store(M)),t(i,j,(U,A)=>{U!==null?K(new Error(U)):I({errors:te(A.errors,g),warnings:te(A.warnings,g),path:A.path,external:A.external,sideEffects:A.sideEffects,namespace:A.namespace,suffix:A.suffix,pluginData:g.load(A.pluginData)})})})},onStart(u){let p='This error came from the "onStart" callback registered here:',w=ce(new Error(p),a,"onStart");y.push({name:o,callback:u,note:w})},onEnd(u){let p='This error came from the "onEnd" callback registered here:',w=ce(new Error(p),a,"onEnd");R.push({name:o,callback:u,note:w})},onResolve(u,p){let w='This error came from the "onResolve" callback registered here:',S=ce(new Error(w),a,"onResolve"),O={},P=n(u,O,"filter",ge),k=n(u,O,"namespace",b);if(z(u,O,`in onResolve() call for plugin ${J(o)}`),P==null)throw new Error("onResolve() call is missing a filter");let v=$++;C[v]={name:o,callback:p,note:S},h.onResolve.push({id:v,filter:P.source,namespace:k||""})},onLoad(u,p){let w='This error came from the "onLoad" callback registered here:',S=ce(new Error(w),a,"onLoad"),O={},P=n(u,O,"filter",ge),k=n(u,O,"namespace",b);if(z(u,O,`in onLoad() call for plugin ${J(o)}`),P==null)throw new Error("onLoad() call is missing a filter");let v=$++;B[v]={name:o,callback:p,note:S},h.onLoad.push({id:v,filter:P.source,namespace:k||""})},esbuild:a.esbuild});D&&(yield D),q.push(h)}catch(f){return{ok:!1,error:f,pluginName:o}}}l["on-start"]=(x,d)=>ee(void 0,null,function*(){let o={errors:[],warnings:[]};yield Promise.all(y.map(D=>ee(void 0,[D],function*({name:f,callback:h,note:E}){try{let u=yield h();if(u!=null){if(typeof u!="object")throw new Error(`Expected onStart() callback in plugin ${J(f)} to return an object`);let p={},w=n(u,p,"errors",W),S=n(u,p,"warnings",W);z(u,p,`from onStart() callback in plugin ${J(f)}`),w!=null&&o.errors.push(...le(w,"errors",g,f)),S!=null&&o.warnings.push(...le(S,"warnings",g,f))}}catch(u){o.errors.push(se(u,a,g,E&&E(),f))}}))),r(x,o)}),l["on-resolve"]=(x,d)=>ee(void 0,null,function*(){let o={},f="",h,E;for(let D of d.ids)try{({name:f,callback:h,note:E}=C[D]);let u=yield h({path:d.path,importer:d.importer,namespace:d.namespace,resolveDir:d.resolveDir,kind:d.kind,pluginData:g.load(d.pluginData)});if(u!=null){if(typeof u!="object")throw new Error(`Expected onResolve() callback in plugin ${J(f)} to return an object`);let p={},w=n(u,p,"pluginName",b),S=n(u,p,"path",b),O=n(u,p,"namespace",b),P=n(u,p,"suffix",b),k=n(u,p,"external",F),v=n(u,p,"sideEffects",F),M=n(u,p,"pluginData",pe),I=n(u,p,"errors",W),K=n(u,p,"warnings",W),j=n(u,p,"watchFiles",W),U=n(u,p,"watchDirs",W);z(u,p,`from onResolve() callback in plugin ${J(f)}`),o.id=D,w!=null&&(o.pluginName=w),S!=null&&(o.path=S),O!=null&&(o.namespace=O),P!=null&&(o.suffix=P),k!=null&&(o.external=k),v!=null&&(o.sideEffects=v),M!=null&&(o.pluginData=g.store(M)),I!=null&&(o.errors=le(I,"errors",g,f)),K!=null&&(o.warnings=le(K,"warnings",g,f)),j!=null&&(o.watchFiles=de(j,"watchFiles")),U!=null&&(o.watchDirs=de(U,"watchDirs"));break}}catch(u){o={id:D,errors:[se(u,a,g,E&&E(),f)]};break}r(x,o)}),l["on-load"]=(x,d)=>ee(void 0,null,function*(){let o={},f="",h,E;for(let D of d.ids)try{({name:f,callback:h,note:E}=B[D]);let u=yield h({path:d.path,namespace:d.namespace,suffix:d.suffix,pluginData:g.load(d.pluginData)});if(u!=null){if(typeof u!="object")throw new Error(`Expected onLoad() callback in plugin ${J(f)} to return an object`);let p={},w=n(u,p,"pluginName",b),S=n(u,p,"contents",Ue),O=n(u,p,"resolveDir",b),P=n(u,p,"pluginData",pe),k=n(u,p,"loader",b),v=n(u,p,"errors",W),M=n(u,p,"warnings",W),I=n(u,p,"watchFiles",W),K=n(u,p,"watchDirs",W);z(u,p,`from onLoad() callback in plugin ${J(f)}`),o.id=D,w!=null&&(o.pluginName=w),S instanceof Uint8Array?o.contents=S:S!=null&&(o.contents=H(S)),O!=null&&(o.resolveDir=O),P!=null&&(o.pluginData=g.store(P)),k!=null&&(o.loader=k),v!=null&&(o.errors=le(v,"errors",g,f)),M!=null&&(o.warnings=le(M,"warnings",g,f)),I!=null&&(o.watchFiles=de(I,"watchFiles")),K!=null&&(o.watchDirs=de(K,"watchDirs"));break}}catch(u){o={id:D,errors:[se(u,a,g,E&&E(),f)]};break}r(x,o)});let Y=(x,d,o)=>o();return R.length>0&&(Y=(x,d,o)=>{(()=>ee(void 0,null,function*(){for(let{name:f,callback:h,note:E}of R)try{yield h(x)}catch(D){x.errors.push(yield new Promise(u=>d(D,f,E&&E(),u)))}}))().then(o)}),L=!0,{ok:!0,requestPlugins:q,runOnEndCallbacks:Y}});function Ie(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let i=t++;return e.set(i,r),i}}}function ce(e,t,r){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(e.stack+"").split(`
|
7
|
+
`);function xe(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function ve(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var J=JSON.stringify,Ae="warning",Ce="silent";function De(e){if(V(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var pe=()=>null,F=e=>typeof e=="boolean"?null:"a boolean",Qe=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",b=e=>typeof e=="string"?null:"a string",ge=e=>e instanceof RegExp?null:"a RegExp object",oe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Oe=e=>typeof e=="function"?null:"a function",W=e=>Array.isArray(e)?null:"an array",Z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",He=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ge=e=>typeof e=="object"&&e!==null?null:"an array or an object",Pe=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Be=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Xe=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ze=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Ue=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",et=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function n(e,t,r,i){let a=e[r];if(t[r+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`${J(r)} must be ${l}`);return a}function z(e,t,r){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${r}: ${J(i)}`)}function Fe(e){let t=Object.create(null),r=n(e,t,"wasmURL",et),i=n(e,t,"wasmModule",He),a=n(e,t,"worker",F);return z(e,t,"in initialize() call"),{wasmURL:r,wasmModule:i,worker:a}}function je(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let i=e[r];if(typeof i=="string"||i===!1)t[r]=i;else throw new Error(`Expected ${J(r)} in mangle cache to map to either a string or false`)}}return t}function me(e,t,r,i,a){let l=n(t,r,"color",F),c=n(t,r,"logLevel",b),s=n(t,r,"logLimit",oe);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${c||a}`),e.push(`--log-limit=${s||0}`)}function V(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+J(r):""} to be a string, got ${typeof e} instead`);return e}function Ne(e,t,r){let i=n(t,r,"legalComments",b),a=n(t,r,"sourceRoot",b),l=n(t,r,"sourcesContent",F),c=n(t,r,"target",Ze),s=n(t,r,"format",b),g=n(t,r,"globalName",b),y=n(t,r,"mangleProps",ge),R=n(t,r,"reserveProps",ge),C=n(t,r,"mangleQuoted",F),B=n(t,r,"minify",F),$=n(t,r,"minifySyntax",F),T=n(t,r,"minifyWhitespace",F),q=n(t,r,"minifyIdentifiers",F),L=n(t,r,"drop",W),Y=n(t,r,"charset",b),x=n(t,r,"treeShaking",F),d=n(t,r,"ignoreAnnotations",F),o=n(t,r,"jsx",b),f=n(t,r,"jsxFactory",b),h=n(t,r,"jsxFragment",b),E=n(t,r,"jsxImportSource",b),D=n(t,r,"jsxDev",F),u=n(t,r,"jsxSideEffects",F),p=n(t,r,"define",Z),w=n(t,r,"logOverride",Z),S=n(t,r,"supported",Z),O=n(t,r,"pure",W),P=n(t,r,"keepNames",F),k=n(t,r,"platform",b);if(i&&e.push(`--legal-comments=${i}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(De).join(",")}`):e.push(`--target=${De(c)}`)),s&&e.push(`--format=${s}`),g&&e.push(`--global-name=${g}`),k&&e.push(`--platform=${k}`),B&&e.push("--minify"),$&&e.push("--minify-syntax"),T&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),Y&&e.push(`--charset=${Y}`),x!==void 0&&e.push(`--tree-shaking=${x}`),d&&e.push("--ignore-annotations"),L)for(let v of L)e.push(`--drop:${V(v,"drop")}`);if(y&&e.push(`--mangle-props=${y.source}`),R&&e.push(`--reserve-props=${R.source}`),C!==void 0&&e.push(`--mangle-quoted=${C}`),o&&e.push(`--jsx=${o}`),f&&e.push(`--jsx-factory=${f}`),h&&e.push(`--jsx-fragment=${h}`),E&&e.push(`--jsx-import-source=${E}`),D&&e.push("--jsx-dev"),u&&e.push("--jsx-side-effects"),p)for(let v in p){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);e.push(`--define:${v}=${V(p[v],"define",v)}`)}if(w)for(let v in w){if(v.indexOf("=")>=0)throw new Error(`Invalid log override: ${v}`);e.push(`--log-override:${v}=${V(w[v],"log override",v)}`)}if(S)for(let v in S){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);let M=S[v];if(typeof M!="boolean")throw new Error(`Expected value for supported ${J(v)} to be a boolean, got ${typeof M} instead`);e.push(`--supported:${v}=${M}`)}if(O)for(let v of O)e.push(`--pure:${V(v,"pure")}`);P&&e.push("--keep-names")}function tt(e,t,r,i,a){var Q;let l=[],c=[],s=Object.create(null),g=null,y=null,R=null;me(l,t,s,r,i),Ne(l,t,s);let C=n(t,s,"sourcemap",Be),B=n(t,s,"bundle",F),$=n(t,s,"watch",Qe),T=n(t,s,"splitting",F),q=n(t,s,"preserveSymlinks",F),L=n(t,s,"metafile",F),Y=n(t,s,"outfile",b),x=n(t,s,"outdir",b),d=n(t,s,"outbase",b),o=n(t,s,"tsconfig",b),f=n(t,s,"resolveExtensions",W),h=n(t,s,"nodePaths",W),E=n(t,s,"mainFields",W),D=n(t,s,"conditions",W),u=n(t,s,"external",W),p=n(t,s,"alias",Z),w=n(t,s,"loader",Z),S=n(t,s,"outExtension",Z),O=n(t,s,"publicPath",b),P=n(t,s,"entryNames",b),k=n(t,s,"chunkNames",b),v=n(t,s,"assetNames",b),M=n(t,s,"inject",W),I=n(t,s,"banner",Z),K=n(t,s,"footer",Z),j=n(t,s,"entryPoints",Ge),U=n(t,s,"absWorkingDir",b),A=n(t,s,"stdin",Z),_=(Q=n(t,s,"write",F))!=null?Q:a,G=n(t,s,"allowOverwrite",F),re=n(t,s,"incremental",F)===!0,ue=n(t,s,"mangleCache",Z);if(s.plugins=!0,z(t,s,`in ${e}() call`),C&&l.push(`--sourcemap${C===!0?"":`=${C}`}`),B&&l.push("--bundle"),G&&l.push("--allow-overwrite"),$)if(l.push("--watch"),typeof $=="boolean")R={};else{let m=Object.create(null),N=n($,m,"onRebuild",Oe);z($,m,`on "watch" in ${e}() call`),R={onRebuild:N}}if(T&&l.push("--splitting"),q&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),Y&&l.push(`--outfile=${Y}`),x&&l.push(`--outdir=${x}`),d&&l.push(`--outbase=${d}`),o&&l.push(`--tsconfig=${o}`),f){let m=[];for(let N of f){if(V(N,"resolve extension"),N.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${N}`);m.push(N)}l.push(`--resolve-extensions=${m.join(",")}`)}if(O&&l.push(`--public-path=${O}`),P&&l.push(`--entry-names=${P}`),k&&l.push(`--chunk-names=${k}`),v&&l.push(`--asset-names=${v}`),E){let m=[];for(let N of E){if(V(N,"main field"),N.indexOf(",")>=0)throw new Error(`Invalid main field: ${N}`);m.push(N)}l.push(`--main-fields=${m.join(",")}`)}if(D){let m=[];for(let N of D){if(V(N,"condition"),N.indexOf(",")>=0)throw new Error(`Invalid condition: ${N}`);m.push(N)}l.push(`--conditions=${m.join(",")}`)}if(u)for(let m of u)l.push(`--external:${V(m,"external")}`);if(p)for(let m in p){if(m.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${m}`);l.push(`--alias:${m}=${V(p[m],"alias",m)}`)}if(I)for(let m in I){if(m.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${m}`);l.push(`--banner:${m}=${V(I[m],"banner",m)}`)}if(K)for(let m in K){if(m.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${m}`);l.push(`--footer:${m}=${V(K[m],"footer",m)}`)}if(M)for(let m of M)l.push(`--inject:${V(m,"inject")}`);if(w)for(let m in w){if(m.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${m}`);l.push(`--loader:${m}=${V(w[m],"loader",m)}`)}if(S)for(let m in S){if(m.indexOf("=")>=0)throw new Error(`Invalid out extension: ${m}`);l.push(`--out-extension:${m}=${V(S[m],"out extension",m)}`)}if(j)if(Array.isArray(j))for(let m of j)c.push(["",V(m,"entry point")]);else for(let m in j)c.push([m,V(j[m],"entry point",m)]);if(A){let m=Object.create(null),N=n(A,m,"contents",Ue),Ee=n(A,m,"resolveDir",b),$e=n(A,m,"sourcefile",b),ke=n(A,m,"loader",b);z(A,m,'in "stdin" object'),$e&&l.push(`--sourcefile=${$e}`),ke&&l.push(`--loader=${ke}`),Ee&&(y=Ee),typeof N=="string"?g=H(N):N instanceof Uint8Array&&(g=N)}let X=[];if(h)for(let m of h)m+="",X.push(m);return{entries:c,flags:l,write:_,stdinContents:g,stdinResolveDir:y,absWorkingDir:U,incremental:re,nodePaths:X,watch:R,mangleCache:je(ue)}}function rt(e,t,r,i){let a=[],l=Object.create(null);me(a,t,l,r,i),Ne(a,t,l);let c=n(t,l,"sourcemap",Be),s=n(t,l,"tsconfigRaw",Xe),g=n(t,l,"sourcefile",b),y=n(t,l,"loader",b),R=n(t,l,"banner",b),C=n(t,l,"footer",b),B=n(t,l,"mangleCache",Z);return z(t,l,`in ${e}() call`),c&&a.push(`--sourcemap=${c===!0?"external":c}`),s&&a.push(`--tsconfig-raw=${typeof s=="string"?s:JSON.stringify(s)}`),g&&a.push(`--sourcefile=${g}`),y&&a.push(`--loader=${y}`),R&&a.push(`--banner=${R}`),C&&a.push(`--footer=${C}`),{flags:a,mangleCache:je(B)}}function Le(e){let t={},r={didClose:!1,reason:""},i={},a=0,l=0,c=new Uint8Array(16*1024),s=0,g=d=>{let o=s+d.length;if(o>c.length){let h=new Uint8Array(o*2);h.set(c),c=h}c.set(d,s),s+=d.length;let f=0;for(;f+4<=s;){let h=xe(c,f);if(f+4+h>s)break;f+=4,T(c.subarray(f,f+h)),f+=h}f>0&&(c.copyWithin(0,f,s),s-=f)},y=d=>{r.didClose=!0,d&&(r.reason=": "+(d.message||d));let o="The service was stopped"+r.reason;for(let f in i)i[f](o,null);i={}},R=(d,o,f)=>{if(r.didClose)return f("The service is no longer running"+r.reason,null);let h=a++;i[h]=(E,D)=>{try{f(E,D)}finally{d&&d.unref()}},d&&d.ref(),e.writeToStdin(Re({id:h,isRequest:!0,value:o}))},C=(d,o)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(Re({id:d,isRequest:!1,value:o}))},B=(d,o)=>ee(this,null,function*(){try{if(o.command==="ping"){C(d,{});return}if(typeof o.key=="number"){let f=t[o.key];if(f){let h=f[o.command];if(h){yield h(d,o);return}}}throw new Error("Invalid command: "+o.command)}catch(f){C(d,{errors:[se(f,e,null,void 0,"")]})}}),$=!0,T=d=>{if($){$=!1;let f=String.fromCharCode(...d);if(f!=="0.16.3")throw new Error(`Cannot start service: Host version "0.16.3" does not match binary version ${J(f)}`);return}let o=Me(d);if(o.isRequest)B(o.id,o.value);else{let f=i[o.id];delete i[o.id],o.value.error?f(o.value.error,{}):f(null,o.value)}};return{readFromStdout:g,afterClose:y,service:{buildOrServe:({callName:d,refs:o,serveOptions:f,options:h,isTTY:E,defaultWD:D,callback:u})=>{let p=0,w=l++,S={},O={ref(){++p===1&&o&&o.ref()},unref(){--p===0&&(delete t[w],o&&o.unref())}};t[w]=S,O.ref(),nt(d,w,R,C,O,e,S,h,f,E,D,r,(P,k)=>{try{u(P,k)}finally{O.unref()}})},transform:({callName:d,refs:o,input:f,options:h,isTTY:E,fs:D,callback:u})=>{let p=Ie(),w=S=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:O,mangleCache:P}=rt(d,h,E,Ce),k={command:"transform",flags:O,inputFS:S!==null,input:S!==null?H(S):typeof f=="string"?H(f):f};P&&(k.mangleCache=P),R(o,k,(v,M)=>{if(v)return u(new Error(v),null);let I=te(M.errors,p),K=te(M.warnings,p),j=1,U=()=>{if(--j===0){let A={warnings:K,code:M.code,map:M.map};M.mangleCache&&(A.mangleCache=M==null?void 0:M.mangleCache),u(null,A)}};if(I.length>0)return u(ie("Transform failed",I,K),null);M.codeFS&&(j++,D.readFile(M.code,(A,_)=>{A!==null?u(A,null):(M.code=_,U())})),M.mapFS&&(j++,D.readFile(M.map,(A,_)=>{A!==null?u(A,null):(M.map=_,U())})),U()})}catch(O){let P=[];try{me(P,h,{},E,Ce)}catch(v){}let k=se(O,e,p,void 0,"");R(o,{command:"error",flags:P,error:k},()=>{k.detail=p.load(k.detail),u(ie("Transform failed",[k],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let S=w;w=()=>D.writeFile(f,S)}w(null)},formatMessages:({callName:d,refs:o,messages:f,options:h,callback:E})=>{let D=le(f,"messages",null,"");if(!h)throw new Error(`Missing second argument in ${d}() call`);let u={},p=n(h,u,"kind",b),w=n(h,u,"color",F),S=n(h,u,"terminalWidth",oe);if(z(h,u,`in ${d}() call`),p===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(p!=="error"&&p!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let O={command:"format-msgs",messages:D,isWarning:p==="warning"};w!==void 0&&(O.color=w),S!==void 0&&(O.terminalWidth=S),R(o,O,(P,k)=>{if(P)return E(new Error(P),null);E(null,k.messages)})},analyzeMetafile:({callName:d,refs:o,metafile:f,options:h,callback:E})=>{h===void 0&&(h={});let D={},u=n(h,D,"color",F),p=n(h,D,"verbose",F);z(h,D,`in ${d}() call`);let w={command:"analyze-metafile",metafile:f};u!==void 0&&(w.color=u),p!==void 0&&(w.verbose=p),R(o,w,(S,O)=>{if(S)return E(new Error(S),null);E(null,O.result)})}}}}function nt(e,t,r,i,a,l,c,s,g,y,R,C,B){let $=Ie(),T=(x,d,o,f)=>{let h=[];try{me(h,s,{},y,Ae)}catch(D){}let E=se(x,l,$,o,d);r(a,{command:"error",flags:h,error:E},()=>{E.detail=$.load(E.detail),f(E)})},q=(x,d)=>{T(x,d,void 0,o=>{B(ie("Build failed",[o],[]),null)})},L;if(typeof s=="object"){let x=s.plugins;if(x!==void 0){if(!Array.isArray(x))throw new Error('"plugins" must be an array');L=x}}if(L&&L.length>0){if(l.isSync){q(new Error("Cannot use plugins in synchronous API calls"),"");return}it(t,r,i,a,l,c,s,L,$).then(x=>{if(!x.ok){q(x.error,x.pluginName);return}try{Y(x.requestPlugins,x.runOnEndCallbacks)}catch(d){q(d,"")}},x=>q(x,""));return}try{Y(null,(x,d,o)=>o())}catch(x){q(x,"")}function Y(x,d){let o=!l.isWriteUnavailable,{entries:f,flags:h,write:E,stdinContents:D,stdinResolveDir:u,absWorkingDir:p,incremental:w,nodePaths:S,watch:O,mangleCache:P}=tt(e,s,y,Ae,o),k={command:"build",key:t,entries:f,flags:h,write:E,stdinContents:D,stdinResolveDir:u,absWorkingDir:p||R,incremental:w,nodePaths:S};x&&(k.plugins=x),P&&(k.mangleCache=P);let v=g&<(t,r,i,a,c,g,k),M,I,K=(U,A)=>{U.outputFiles&&(A.outputFiles=U.outputFiles.map(ot)),U.metafile&&(A.metafile=JSON.parse(U.metafile)),U.mangleCache&&(A.mangleCache=U.mangleCache),U.writeToStdout!==void 0&&console.log(ne(U.writeToStdout).replace(/\n$/,""))},j=(U,A)=>{let _={errors:te(U.errors,$),warnings:te(U.warnings,$)};K(U,_),d(_,T,()=>{if(_.errors.length>0)return A(ie("Build failed",_.errors,_.warnings),null);if(U.rebuild){if(!M){let G=!1;M=()=>new Promise((re,ue)=>{if(G||C.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:t},(X,Q)=>{if(X)return A(ie("Build failed",[{id:"",pluginName:"",text:X,location:null,notes:[],detail:void 0}],[]),null);j(Q,(m,N)=>{m?ue(m):re(N)})})}),a.ref(),M.dispose=()=>{G||(G=!0,r(a,{command:"rebuild-dispose",key:t},()=>{}),a.unref())}}_.rebuild=M}if(U.watch){if(!I){let G=!1;a.ref(),I=()=>{G||(G=!0,delete c["watch-rebuild"],r(a,{command:"watch-stop",key:t},()=>{}),a.unref())},O&&(c["watch-rebuild"]=(re,ue)=>{try{let X=ue.args,Q={errors:te(X.errors,$),warnings:te(X.warnings,$)};K(X,Q),d(Q,T,()=>{if(Q.errors.length>0){O.onRebuild&&O.onRebuild(ie("Build failed",Q.errors,Q.warnings),null);return}Q.stop=I,O.onRebuild&&O.onRebuild(null,Q)})}catch(X){console.error(X)}i(re,{})})}_.stop=I}A(null,_)})};if(E&&l.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(w&&l.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(O&&l.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,k,(U,A)=>{if(U)return B(new Error(U),null);if(v){let _=A,G=!1;a.ref();let re={port:_.port,host:_.host,wait:v.wait,stop(){G||(G=!0,v.stop(),a.unref())}};return a.ref(),v.wait.then(a.unref,a.unref),B(null,re)}return j(A,B)})}}var lt=(e,t,r,i,a,l,c)=>{let s={},g=n(l,s,"port",oe),y=n(l,s,"host",b),R=n(l,s,"servedir",b),C=n(l,s,"onRequest",Oe),B=new Promise(($,T)=>{a["serve-wait"]=(q,L)=>{L.error!==null?T(new Error(L.error)):$(),r(q,{})}});return c.serve={},z(l,s,"in serve() call"),g!==void 0&&(c.serve.port=g),y!==void 0&&(c.serve.host=y),R!==void 0&&(c.serve.servedir=R),a["serve-request"]=($,T)=>{C&&C(T.args),r($,{})},{wait:B,stop(){t(i,{command:"serve-stop",key:e},()=>{})}}},it=(e,t,r,i,a,l,c,s,g)=>ee(void 0,null,function*(){let y=[],R=[],C={},B={},$=0,T=0,q=[],L=!1;s=[...s];for(let x of s){let d={};if(typeof x!="object")throw new Error(`Plugin at index ${T} must be an object`);let o=n(x,d,"name",b);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${T} is missing a name`);try{let f=n(x,d,"setup",Oe);if(typeof f!="function")throw new Error("Plugin is missing a setup function");z(x,d,`on plugin ${J(o)}`);let h={name:o,onResolve:[],onLoad:[]};T++;let D=f({initialOptions:c,resolve:(u,p={})=>{if(!L)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 w=Object.create(null),S=n(p,w,"pluginName",b),O=n(p,w,"importer",b),P=n(p,w,"namespace",b),k=n(p,w,"resolveDir",b),v=n(p,w,"kind",b),M=n(p,w,"pluginData",pe);return z(p,w,"in resolve() call"),new Promise((I,K)=>{let j={command:"resolve",path:u,key:e,pluginName:o};if(S!=null&&(j.pluginName=S),O!=null&&(j.importer=O),P!=null&&(j.namespace=P),k!=null&&(j.resolveDir=k),v!=null)j.kind=v;else throw new Error('Must specify "kind" when calling "resolve"');M!=null&&(j.pluginData=g.store(M)),t(i,j,(U,A)=>{U!==null?K(new Error(U)):I({errors:te(A.errors,g),warnings:te(A.warnings,g),path:A.path,external:A.external,sideEffects:A.sideEffects,namespace:A.namespace,suffix:A.suffix,pluginData:g.load(A.pluginData)})})})},onStart(u){let p='This error came from the "onStart" callback registered here:',w=ce(new Error(p),a,"onStart");y.push({name:o,callback:u,note:w})},onEnd(u){let p='This error came from the "onEnd" callback registered here:',w=ce(new Error(p),a,"onEnd");R.push({name:o,callback:u,note:w})},onResolve(u,p){let w='This error came from the "onResolve" callback registered here:',S=ce(new Error(w),a,"onResolve"),O={},P=n(u,O,"filter",ge),k=n(u,O,"namespace",b);if(z(u,O,`in onResolve() call for plugin ${J(o)}`),P==null)throw new Error("onResolve() call is missing a filter");let v=$++;C[v]={name:o,callback:p,note:S},h.onResolve.push({id:v,filter:P.source,namespace:k||""})},onLoad(u,p){let w='This error came from the "onLoad" callback registered here:',S=ce(new Error(w),a,"onLoad"),O={},P=n(u,O,"filter",ge),k=n(u,O,"namespace",b);if(z(u,O,`in onLoad() call for plugin ${J(o)}`),P==null)throw new Error("onLoad() call is missing a filter");let v=$++;B[v]={name:o,callback:p,note:S},h.onLoad.push({id:v,filter:P.source,namespace:k||""})},esbuild:a.esbuild});D&&(yield D),q.push(h)}catch(f){return{ok:!1,error:f,pluginName:o}}}l["on-start"]=(x,d)=>ee(void 0,null,function*(){let o={errors:[],warnings:[]};yield Promise.all(y.map(D=>ee(void 0,[D],function*({name:f,callback:h,note:E}){try{let u=yield h();if(u!=null){if(typeof u!="object")throw new Error(`Expected onStart() callback in plugin ${J(f)} to return an object`);let p={},w=n(u,p,"errors",W),S=n(u,p,"warnings",W);z(u,p,`from onStart() callback in plugin ${J(f)}`),w!=null&&o.errors.push(...le(w,"errors",g,f)),S!=null&&o.warnings.push(...le(S,"warnings",g,f))}}catch(u){o.errors.push(se(u,a,g,E&&E(),f))}}))),r(x,o)}),l["on-resolve"]=(x,d)=>ee(void 0,null,function*(){let o={},f="",h,E;for(let D of d.ids)try{({name:f,callback:h,note:E}=C[D]);let u=yield h({path:d.path,importer:d.importer,namespace:d.namespace,resolveDir:d.resolveDir,kind:d.kind,pluginData:g.load(d.pluginData)});if(u!=null){if(typeof u!="object")throw new Error(`Expected onResolve() callback in plugin ${J(f)} to return an object`);let p={},w=n(u,p,"pluginName",b),S=n(u,p,"path",b),O=n(u,p,"namespace",b),P=n(u,p,"suffix",b),k=n(u,p,"external",F),v=n(u,p,"sideEffects",F),M=n(u,p,"pluginData",pe),I=n(u,p,"errors",W),K=n(u,p,"warnings",W),j=n(u,p,"watchFiles",W),U=n(u,p,"watchDirs",W);z(u,p,`from onResolve() callback in plugin ${J(f)}`),o.id=D,w!=null&&(o.pluginName=w),S!=null&&(o.path=S),O!=null&&(o.namespace=O),P!=null&&(o.suffix=P),k!=null&&(o.external=k),v!=null&&(o.sideEffects=v),M!=null&&(o.pluginData=g.store(M)),I!=null&&(o.errors=le(I,"errors",g,f)),K!=null&&(o.warnings=le(K,"warnings",g,f)),j!=null&&(o.watchFiles=de(j,"watchFiles")),U!=null&&(o.watchDirs=de(U,"watchDirs"));break}}catch(u){o={id:D,errors:[se(u,a,g,E&&E(),f)]};break}r(x,o)}),l["on-load"]=(x,d)=>ee(void 0,null,function*(){let o={},f="",h,E;for(let D of d.ids)try{({name:f,callback:h,note:E}=B[D]);let u=yield h({path:d.path,namespace:d.namespace,suffix:d.suffix,pluginData:g.load(d.pluginData)});if(u!=null){if(typeof u!="object")throw new Error(`Expected onLoad() callback in plugin ${J(f)} to return an object`);let p={},w=n(u,p,"pluginName",b),S=n(u,p,"contents",Ue),O=n(u,p,"resolveDir",b),P=n(u,p,"pluginData",pe),k=n(u,p,"loader",b),v=n(u,p,"errors",W),M=n(u,p,"warnings",W),I=n(u,p,"watchFiles",W),K=n(u,p,"watchDirs",W);z(u,p,`from onLoad() callback in plugin ${J(f)}`),o.id=D,w!=null&&(o.pluginName=w),S instanceof Uint8Array?o.contents=S:S!=null&&(o.contents=H(S)),O!=null&&(o.resolveDir=O),P!=null&&(o.pluginData=g.store(P)),k!=null&&(o.loader=k),v!=null&&(o.errors=le(v,"errors",g,f)),M!=null&&(o.warnings=le(M,"warnings",g,f)),I!=null&&(o.watchFiles=de(I,"watchFiles")),K!=null&&(o.watchDirs=de(K,"watchDirs"));break}}catch(u){o={id:D,errors:[se(u,a,g,E&&E(),f)]};break}r(x,o)});let Y=(x,d,o)=>o();return R.length>0&&(Y=(x,d,o)=>{(()=>ee(void 0,null,function*(){for(let{name:f,callback:h,note:E}of R)try{yield h(x)}catch(D){x.errors.push(yield new Promise(u=>d(D,f,E&&E(),u)))}}))().then(o)}),L=!0,{ok:!0,requestPlugins:q,runOnEndCallbacks:Y}});function Ie(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let i=t++;return e.set(i,r),i}}}function ce(e,t,r){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(e.stack+"").split(`
|
8
8
|
`);l.splice(1,1);let c=We(t,l,r);if(c)return i={text:e.message,location:c},i}catch(l){}}}function se(e,t,r,i,a){let l="Internal error",c=null;try{l=(e&&e.message||e)+""}catch(s){}try{c=We(t,(e.stack+"").split(`
|
9
9
|
`),"")}catch(s){}return{id:"",pluginName:a,text:l,location:c,notes:i?[i]:[],detail:r?r.store(e):-1}}function We(e,t,r){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 c=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(c){l=c[1];continue}if(c=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),c){l=c[1];continue}if(c=/^(\S+):(\d+):(\d+)$/.exec(l),c){let s;try{s=e.readFileSync(c[1],"utf8")}catch(C){break}let g=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+c[2]-1]||"",y=+c[3]-1,R=g.slice(y,y+r.length)===r?r.length:0;return{file:c[1],namespace:"file",line:+c[2],column:H(g.slice(0,y)).length,length:H(g.slice(y,y+R)).length,lineText:g+`
|
10
10
|
`+t.slice(1).join(`
|
11
11
|
`),suggestion:""}}break}}return null}function ie(e,t,r){let i=5,a=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((c,s)=>{if(s===i)return`
|
12
12
|
...`;if(!c.location)return`
|
13
13
|
error: ${c.text}`;let{file:g,line:y,column:R}=c.location,C=c.pluginName?`[plugin: ${c.pluginName}] `:"";return`
|
14
|
-
${g}:${y}:${R}: ERROR: ${C}${c.text}`}).join(""),l=new Error(`${e}${a}`);return l.errors=t,l.warnings=r,l}function te(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Te(e,t){if(e==null)return null;let r={},i=n(e,r,"file",b),a=n(e,r,"namespace",b),l=n(e,r,"line",oe),c=n(e,r,"column",oe),s=n(e,r,"length",oe),g=n(e,r,"lineText",b),y=n(e,r,"suggestion",b);return z(e,r,t),{file:i||"",namespace:a||"",line:l||0,column:c||0,length:s||0,lineText:g||"",suggestion:y||""}}function le(e,t,r,i){let a=[],l=0;for(let c of e){let s={},g=n(c,s,"id",b),y=n(c,s,"pluginName",b),R=n(c,s,"text",b),C=n(c,s,"location",Pe),B=n(c,s,"notes",W),$=n(c,s,"detail",pe),T=`in element ${l} of "${t}"`;z(c,s,T);let q=[];if(B)for(let L of B){let Y={},x=n(L,Y,"text",b),d=n(L,Y,"location",Pe);z(L,Y,T),q.push({text:x||"",location:Te(d,T)})}a.push({id:g||"",pluginName:y||i,text:R||"",location:Te(C,T),notes:q,detail:r?r.store($):-1}),l++}return a}function de(e,t){let r=[];for(let i of e){if(typeof i!="string")throw new Error(`${J(t)} must be an array of strings`);r.push(i)}return r}function ot({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){let i=this.contents;return(r===null||i!==t)&&(t=i,r=ne(i)),r}}}var at="0.16.1",ut=e=>ye().build(e),ft=()=>{throw new Error('The "serve" API only works in node')},ct=(e,t)=>ye().transform(e,t),dt=(e,t)=>ye().formatMessages(e,t),pt=(e,t)=>ye().analyzeMetafile(e,t),gt=()=>{throw new Error('The "buildSync" API only works in node')},mt=()=>{throw new Error('The "transformSync" API only works in node')},yt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},ht=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},ae,Se,ye=()=>{if(Se)return Se;throw ae?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')},bt=e=>{e=Fe(e||{});let t=e.wasmURL,r=e.wasmModule,i=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(ae)throw new Error('Cannot call "initialize" more than once');return ae=wt(t||"",r,i),ae.catch(()=>{ae=void 0}),ae},wt=(e,t,r)=>ee(void 0,null,function*(){let i;if(r){let y=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 y=(r,f,m)=>new Promise((c,n)=>{var s=h=>{try{l(m.next(h))}catch(u){n(u)}},i=h=>{try{l(m.throw(h))}catch(u){n(u)}},l=h=>h.done?c(h.value):Promise.resolve(h.value).then(s,i);l((m=m.apply(r,f)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{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(n,s){c+=m.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,l,h,u){if(i!==0||l!==s.length||h!==null){u(r());return}const g=this.writeSync(n,s);u(null,g)},chmod(n,s,i){i(r())},chown(n,s,i,l){l(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,l){l(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,l){l(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,l){l(r())},read(n,s,i,l,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,l){l(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!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"),m=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)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(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 d=0;switch(typeof t){case"object":t!==null&&(d=1);break;case"string":d=2;break;case"symbol":d=3;break;case"function":d=4;break}this.mem.setUint32(e+4,2146959360|d,!0),this.mem.setUint32(e,a,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let d=0;d<o;d++)a[d]=s(t+d*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return m.decode(new DataView(this._inst.exports.mem.buffer,t,o))},g=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;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>>>=0;const t=n(e+8),o=n(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(g+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;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()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),a=h(e+32),d=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,i(e+56,d),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.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 y(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 n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const g=4096+8192;if(n>=g)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),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 n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,m=globalThis.fs,c="";m.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let g=c.split(`\n`);g.length>1&&console.log(g.slice(0,-1).join(`\n`)),c=g[g.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},m.read=(h,u,g,e,t,o)=>{if(h!==0||g!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>m.read(h,u,g,e,t,o);return}let a=n[0],d=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+d),g),i+=d,i===a.length&&(n.shift(),i=0),o(null,d)};let l=new globalThis.Go;l.argv=["","--service=0.16.1"],tryToInstantiateModule(r,l).then(h=>{postMessage(null),l.run(h)},h=>{postMessage(h)})};function tryToInstantiateModule(r,f){return y(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const m=yield fetch(r);if(!m.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(m.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(m,f.importObject)).instance;const c=yield m.arrayBuffer();return(yield WebAssembly.instantiate(c,f.importObject)).instance})}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(y))}else{let y=(postMessage=>{
|
14
|
+
${g}:${y}:${R}: ERROR: ${C}${c.text}`}).join(""),l=new Error(`${e}${a}`);return l.errors=t,l.warnings=r,l}function te(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Te(e,t){if(e==null)return null;let r={},i=n(e,r,"file",b),a=n(e,r,"namespace",b),l=n(e,r,"line",oe),c=n(e,r,"column",oe),s=n(e,r,"length",oe),g=n(e,r,"lineText",b),y=n(e,r,"suggestion",b);return z(e,r,t),{file:i||"",namespace:a||"",line:l||0,column:c||0,length:s||0,lineText:g||"",suggestion:y||""}}function le(e,t,r,i){let a=[],l=0;for(let c of e){let s={},g=n(c,s,"id",b),y=n(c,s,"pluginName",b),R=n(c,s,"text",b),C=n(c,s,"location",Pe),B=n(c,s,"notes",W),$=n(c,s,"detail",pe),T=`in element ${l} of "${t}"`;z(c,s,T);let q=[];if(B)for(let L of B){let Y={},x=n(L,Y,"text",b),d=n(L,Y,"location",Pe);z(L,Y,T),q.push({text:x||"",location:Te(d,T)})}a.push({id:g||"",pluginName:y||i,text:R||"",location:Te(C,T),notes:q,detail:r?r.store($):-1}),l++}return a}function de(e,t){let r=[];for(let i of e){if(typeof i!="string")throw new Error(`${J(t)} must be an array of strings`);r.push(i)}return r}function ot({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){let i=this.contents;return(r===null||i!==t)&&(t=i,r=ne(i)),r}}}var at="0.16.3",ut=e=>ye().build(e),ft=()=>{throw new Error('The "serve" API only works in node')},ct=(e,t)=>ye().transform(e,t),dt=(e,t)=>ye().formatMessages(e,t),pt=(e,t)=>ye().analyzeMetafile(e,t),gt=()=>{throw new Error('The "buildSync" API only works in node')},mt=()=>{throw new Error('The "transformSync" API only works in node')},yt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},ht=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},ae,Se,ye=()=>{if(Se)return Se;throw ae?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')},bt=e=>{e=Fe(e||{});let t=e.wasmURL,r=e.wasmModule,i=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(ae)throw new Error('Cannot call "initialize" more than once');return ae=wt(t||"",r,i),ae.catch(()=>{ae=void 0}),ae},wt=(e,t,r)=>ee(void 0,null,function*(){let i;if(r){let y=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 y=(r,f,m)=>new Promise((c,n)=>{var s=h=>{try{l(m.next(h))}catch(u){n(u)}},i=h=>{try{l(m.throw(h))}catch(u){n(u)}},l=h=>h.done?c(h.value):Promise.resolve(h.value).then(s,i);l((m=m.apply(r,f)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{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(n,s){c+=m.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,l,h,u){if(i!==0||l!==s.length||h!==null){u(r());return}const g=this.writeSync(n,s);u(null,g)},chmod(n,s,i){i(r())},chown(n,s,i,l){l(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,l){l(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,l){l(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,l){l(r())},read(n,s,i,l,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,l){l(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!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"),m=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)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(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 d=0;switch(typeof t){case"object":t!==null&&(d=1);break;case"string":d=2;break;case"symbol":d=3;break;case"function":d=4;break}this.mem.setUint32(e+4,2146959360|d,!0),this.mem.setUint32(e,a,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let d=0;d<o;d++)a[d]=s(t+d*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return m.decode(new DataView(this._inst.exports.mem.buffer,t,o))},g=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;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>>>=0;const t=n(e+8),o=n(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(g+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;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()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),a=h(e+32),d=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,i(e+56,d),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.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 y(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 n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const g=4096+8192;if(n>=g)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),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 n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,m=globalThis.fs,c="";m.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let g=c.split(`\n`);g.length>1&&console.log(g.slice(0,-1).join(`\n`)),c=g[g.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},m.read=(h,u,g,e,t,o)=>{if(h!==0||g!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>m.read(h,u,g,e,t,o);return}let a=n[0],d=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+d),g),i+=d,i===a.length&&(n.shift(),i=0),o(null,d)};let l=new globalThis.Go;l.argv=["","--service=0.16.3"],tryToInstantiateModule(r,l).then(h=>{postMessage(null),l.run(h)},h=>{postMessage(h)})};function tryToInstantiateModule(r,f){return y(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const m=yield fetch(r);if(!m.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(m.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(m,f.importObject)).instance;const c=yield m.arrayBuffer();return(yield WebAssembly.instantiate(c,f.importObject)).instance})}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(y))}else{let y=(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 y=(r,f,m)=>new Promise((c,n)=>{var s=h=>{try{l(m.next(h))}catch(u){n(u)}},i=h=>{try{l(m.throw(h))}catch(u){n(u)}},l=h=>h.done?c(h.value):Promise.resolve(h.value).then(s,i);l((m=m.apply(r,f)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{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(n,s){c+=m.decode(s);const i=c.lastIndexOf(`
|
19
19
|
`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,l,h,u){if(i!==0||l!==s.length||h!==null){u(r());return}const g=this.writeSync(n,s);u(null,g)},chmod(n,s,i){i(r())},chown(n,s,i,l){l(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,l){l(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,l){l(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,l){l(r())},read(n,s,i,l,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,l){l(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!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"),m=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)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(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 d=0;switch(typeof t){case"object":t!==null&&(d=1);break;case"string":d=2;break;case"symbol":d=3;break;case"function":d=4;break}this.mem.setUint32(e+4,2146959360|d,!0),this.mem.setUint32(e,a,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let d=0;d<o;d++)a[d]=s(t+d*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return m.decode(new DataView(this._inst.exports.mem.buffer,t,o))},g=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;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>>>=0;const t=n(e+8),o=n(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(g+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;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()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),a=h(e+32),d=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,i(e+56,d),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.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 y(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 n=4096;const s=e=>{const t=n,o=f.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const g=4096+8192;if(n>=g)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),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 n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,m=globalThis.fs,c="";m.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let g=c.split(`
|
20
20
|
`);g.length>1&&console.log(g.slice(0,-1).join(`
|
21
|
-
`)),c=g[g.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},m.read=(h,u,g,e,t,o)=>{if(h!==0||g!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>m.read(h,u,g,e,t,o);return}let a=n[0],d=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+d),g),i+=d,i===a.length&&(n.shift(),i=0),o(null,d)};let l=new globalThis.Go;l.argv=["","--service=0.16.
|
21
|
+
`)),c=g[g.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},m.read=(h,u,g,e,t,o)=>{if(h!==0||g!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>m.read(h,u,g,e,t,o);return}let a=n[0],d=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+d),g),i+=d,i===a.length&&(n.shift(),i=0),o(null,d)};let l=new globalThis.Go;l.argv=["","--service=0.16.3"],tryToInstantiateModule(r,l).then(h=>{postMessage(null),l.run(h)},h=>{postMessage(h)})};function tryToInstantiateModule(r,f){return y(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const m=yield fetch(r);if(!m.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(m.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(m,f.importObject)).instance;const c=yield m.arrayBuffer();return(yield WebAssembly.instantiate(c,f.importObject)).instance})}return r=>onmessage(r);})(R=>i.onmessage({data:R}));i={onmessage:null,postMessage:R=>setTimeout(()=>y({data:R})),terminate(){}}}let a,l,c=new Promise((y,R)=>{a=y,l=R});i.onmessage=({data:y})=>{i.onmessage=({data:R})=>s(R),y?l(y):a()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:s,service:g}=Le({writeToStdin(y){i.postMessage(y)},isSync:!1,isWriteUnavailable:!0,esbuild:he});yield c,Se={build:y=>new Promise((R,C)=>g.buildOrServe({callName:"build",refs:null,serveOptions:null,options:y,isTTY:!1,defaultWD:"/",callback:(B,$)=>B?C(B):R($)})),transform:(y,R)=>new Promise((C,B)=>g.transform({callName:"transform",refs:null,input:y,options:R||{},isTTY:!1,fs:{readFile($,T){T(new Error("Internal error"),null)},writeFile($,T){T(null)}},callback:($,T)=>$?B($):C(T)})),formatMessages:(y,R)=>new Promise((C,B)=>g.formatMessages({callName:"formatMessages",refs:null,messages:y,options:R,callback:($,T)=>$?B($):C(T)})),analyzeMetafile:(y,R)=>new Promise((C,B)=>g.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof y=="string"?y:JSON.stringify(y),options:R,callback:($,T)=>$?B($):C(T)}))}}),vt=he;
|
22
22
|
})(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
|
@@ -726,8 +726,8 @@ function createChannel(streamIn) {
|
|
726
726
|
if (isFirstPacket) {
|
727
727
|
isFirstPacket = false;
|
728
728
|
let binaryVersion = String.fromCharCode(...bytes);
|
729
|
-
if (binaryVersion !== "0.16.
|
730
|
-
throw new Error(`Cannot start service: Host version "${"0.16.
|
729
|
+
if (binaryVersion !== "0.16.3") {
|
730
|
+
throw new Error(`Cannot start service: Host version "${"0.16.3"}" does not match binary version ${quote(binaryVersion)}`);
|
731
731
|
}
|
732
732
|
return;
|
733
733
|
}
|
@@ -1703,7 +1703,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
|
1703
1703
|
}
|
1704
1704
|
}
|
1705
1705
|
var _a;
|
1706
|
-
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.
|
1706
|
+
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.3";
|
1707
1707
|
var esbuildCommandAndArgs = () => {
|
1708
1708
|
if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
1709
1709
|
throw new Error(
|
@@ -1770,7 +1770,7 @@ var fsAsync = {
|
|
1770
1770
|
}
|
1771
1771
|
}
|
1772
1772
|
};
|
1773
|
-
var version = "0.16.
|
1773
|
+
var version = "0.16.3";
|
1774
1774
|
var build = (options) => ensureServiceIsRunning().build(options);
|
1775
1775
|
var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
|
1776
1776
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
@@ -1881,7 +1881,7 @@ var ensureServiceIsRunning = () => {
|
|
1881
1881
|
if (longLivedService)
|
1882
1882
|
return longLivedService;
|
1883
1883
|
let [command, args] = esbuildCommandAndArgs();
|
1884
|
-
let child = child_process.spawn(command, args.concat(`--service=${"0.16.
|
1884
|
+
let child = child_process.spawn(command, args.concat(`--service=${"0.16.3"}`, "--ping"), {
|
1885
1885
|
windowsHide: true,
|
1886
1886
|
stdio: ["pipe", "pipe", "inherit"],
|
1887
1887
|
cwd: defaultWD
|
@@ -1995,7 +1995,7 @@ var runServiceSync = (callback) => {
|
|
1995
1995
|
esbuild: node_exports
|
1996
1996
|
});
|
1997
1997
|
callback(service);
|
1998
|
-
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.
|
1998
|
+
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.3"}`), {
|
1999
1999
|
cwd: defaultWD,
|
2000
2000
|
windowsHide: true,
|
2001
2001
|
input: stdin,
|
@@ -2011,7 +2011,7 @@ var workerThreadService = null;
|
|
2011
2011
|
var startWorkerThreadService = (worker_threads2) => {
|
2012
2012
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
2013
2013
|
let worker = new worker_threads2.Worker(__filename, {
|
2014
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.16.
|
2014
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.16.3" },
|
2015
2015
|
transferList: [workerPort],
|
2016
2016
|
execArgv: []
|
2017
2017
|
});
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-asset-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: brotli
|