isomorfeus-asset-manager 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- 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.d.ts +18 -0
- data/node_modules/esbuild-wasm/esm/browser.js +41 -13
- data/node_modules/esbuild-wasm/esm/browser.min.js +7 -7
- data/node_modules/esbuild-wasm/exit0.js +1 -1
- data/node_modules/esbuild-wasm/lib/browser.d.ts +18 -0
- data/node_modules/esbuild-wasm/lib/browser.js +19 -13
- data/node_modules/esbuild-wasm/lib/browser.min.js +2 -2
- data/node_modules/esbuild-wasm/lib/main.d.ts +18 -0
- data/node_modules/esbuild-wasm/lib/main.js +22 -15
- data/node_modules/esbuild-wasm/package.json +1 -1
- data/node_modules/esbuild-wasm/wasm_exec.js +2 -2
- data/package.json +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5376428a5ba412305a5c095639da74ac35e3abb51429ceff8dbc2cf1b3be2ef1
|
4
|
+
data.tar.gz: 1c2ba2e0de399ec1b60adcb5272548891e20e4dd5cd08101cf5bee5d1276614a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fa08f38a90d57f6d3c8e9bdcfc6afbb77dc1931c6395ba45684e9c54c66dd7db1d716b2def1ec8881952476d0057439ca9f36798693b6ad4e142042dd001f67
|
7
|
+
data.tar.gz: a7f564c845a82ee1d0315db30f8a28f308bdd0ad4153fb5df41bbd8c4eed510763f89d2ac05b74ff3011a418284fb846c48b57451ab071e30c7462e4412370ca
|
@@ -4,9 +4,9 @@
|
|
4
4
|
"requires": true,
|
5
5
|
"packages": {
|
6
6
|
"node_modules/esbuild-wasm": {
|
7
|
-
"version": "0.14.
|
8
|
-
"resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.
|
9
|
-
"integrity": "sha512-
|
7
|
+
"version": "0.14.3",
|
8
|
+
"resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.3.tgz",
|
9
|
+
"integrity": "sha512-TVfjQWqFhvEDcP/lB4r6PL/LU1zUXVV5b9s3SWTmXdmJi2NeeCazltvA36/cRbrfx+2xKgafqTpAlqB002FuLA==",
|
10
10
|
"bin": {
|
11
11
|
"esbuild": "bin/esbuild"
|
12
12
|
},
|
Binary file
|
@@ -232,6 +232,7 @@ export interface TransformOptions extends CommonOptions {
|
|
232
232
|
jsxFragmentFactory?: string,
|
233
233
|
useDefineForClassFields?: boolean,
|
234
234
|
importsNotUsedAsValues?: 'remove' | 'preserve' | 'error',
|
235
|
+
preserveValueImports?: boolean,
|
235
236
|
},
|
236
237
|
};
|
237
238
|
|
@@ -267,6 +268,21 @@ export interface PluginBuild {
|
|
267
268
|
(OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void;
|
268
269
|
onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) =>
|
269
270
|
(OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void;
|
271
|
+
|
272
|
+
// This is a full copy of the esbuild library in case you need it
|
273
|
+
esbuild: {
|
274
|
+
serve: typeof serve,
|
275
|
+
build: typeof build,
|
276
|
+
buildSync: typeof buildSync,
|
277
|
+
transform: typeof transform,
|
278
|
+
transformSync: typeof transformSync,
|
279
|
+
formatMessages: typeof formatMessages,
|
280
|
+
formatMessagesSync: typeof formatMessagesSync,
|
281
|
+
analyzeMetafile: typeof analyzeMetafile,
|
282
|
+
analyzeMetafileSync: typeof analyzeMetafileSync,
|
283
|
+
initialize: typeof initialize,
|
284
|
+
version: typeof version,
|
285
|
+
};
|
270
286
|
}
|
271
287
|
|
272
288
|
export interface OnStartResult {
|
@@ -311,6 +327,7 @@ export interface OnResolveResult {
|
|
311
327
|
external?: boolean;
|
312
328
|
sideEffects?: boolean;
|
313
329
|
namespace?: string;
|
330
|
+
suffix?: string;
|
314
331
|
pluginData?: any;
|
315
332
|
|
316
333
|
watchFiles?: string[];
|
@@ -325,6 +342,7 @@ export interface OnLoadOptions {
|
|
325
342
|
export interface OnLoadArgs {
|
326
343
|
path: string;
|
327
344
|
namespace: string;
|
345
|
+
suffix: string;
|
328
346
|
pluginData: any;
|
329
347
|
}
|
330
348
|
|
@@ -17,6 +17,28 @@ var __spreadValues = (a, b) => {
|
|
17
17
|
return a;
|
18
18
|
};
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
20
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
21
|
+
var __export = (target, all) => {
|
22
|
+
__markAsModule(target);
|
23
|
+
for (var name in all)
|
24
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
25
|
+
};
|
26
|
+
|
27
|
+
// lib/npm/browser.ts
|
28
|
+
var browser_exports = {};
|
29
|
+
__export(browser_exports, {
|
30
|
+
analyzeMetafile: () => analyzeMetafile,
|
31
|
+
analyzeMetafileSync: () => analyzeMetafileSync,
|
32
|
+
build: () => build,
|
33
|
+
buildSync: () => buildSync,
|
34
|
+
formatMessages: () => formatMessages,
|
35
|
+
formatMessagesSync: () => formatMessagesSync,
|
36
|
+
initialize: () => initialize,
|
37
|
+
serve: () => serve,
|
38
|
+
transform: () => transform,
|
39
|
+
transformSync: () => transformSync,
|
40
|
+
version: () => version
|
41
|
+
});
|
20
42
|
|
21
43
|
// lib/shared/stdio_protocol.ts
|
22
44
|
function encodePacket(packet) {
|
@@ -673,8 +695,8 @@ function createChannel(streamIn) {
|
|
673
695
|
if (isFirstPacket) {
|
674
696
|
isFirstPacket = false;
|
675
697
|
let binaryVersion = String.fromCharCode(...bytes);
|
676
|
-
if (binaryVersion !== "0.14.
|
677
|
-
throw new Error(`Cannot start service: Host version "${"0.14.
|
698
|
+
if (binaryVersion !== "0.14.3") {
|
699
|
+
throw new Error(`Cannot start service: Host version "${"0.14.3"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
|
678
700
|
}
|
679
701
|
return;
|
680
702
|
}
|
@@ -720,17 +742,17 @@ function createChannel(streamIn) {
|
|
720
742
|
let promise = setup({
|
721
743
|
initialOptions,
|
722
744
|
onStart(callback2) {
|
723
|
-
let registeredText = `This error came from the "onStart" callback registered here
|
745
|
+
let registeredText = `This error came from the "onStart" callback registered here:`;
|
724
746
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
|
725
747
|
onStartCallbacks.push({ name, callback: callback2, note: registeredNote });
|
726
748
|
},
|
727
749
|
onEnd(callback2) {
|
728
|
-
let registeredText = `This error came from the "onEnd" callback registered here
|
750
|
+
let registeredText = `This error came from the "onEnd" callback registered here:`;
|
729
751
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd");
|
730
752
|
onEndCallbacks.push({ name, callback: callback2, note: registeredNote });
|
731
753
|
},
|
732
754
|
onResolve(options, callback2) {
|
733
|
-
let registeredText = `This error came from the "onResolve" callback registered here
|
755
|
+
let registeredText = `This error came from the "onResolve" callback registered here:`;
|
734
756
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve");
|
735
757
|
let keys2 = {};
|
736
758
|
let filter = getFlag(options, keys2, "filter", mustBeRegExp);
|
@@ -743,7 +765,7 @@ function createChannel(streamIn) {
|
|
743
765
|
plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" });
|
744
766
|
},
|
745
767
|
onLoad(options, callback2) {
|
746
|
-
let registeredText = `This error came from the "onLoad" callback registered here
|
768
|
+
let registeredText = `This error came from the "onLoad" callback registered here:`;
|
747
769
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad");
|
748
770
|
let keys2 = {};
|
749
771
|
let filter = getFlag(options, keys2, "filter", mustBeRegExp);
|
@@ -754,7 +776,8 @@ function createChannel(streamIn) {
|
|
754
776
|
let id = nextCallbackID++;
|
755
777
|
onLoadCallbacks[id] = { name, callback: callback2, note: registeredNote };
|
756
778
|
plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" });
|
757
|
-
}
|
779
|
+
},
|
780
|
+
esbuild: streamIn.esbuild
|
758
781
|
});
|
759
782
|
if (promise)
|
760
783
|
await promise;
|
@@ -808,6 +831,7 @@ function createChannel(streamIn) {
|
|
808
831
|
let pluginName = getFlag(result, keys, "pluginName", mustBeString);
|
809
832
|
let path = getFlag(result, keys, "path", mustBeString);
|
810
833
|
let namespace = getFlag(result, keys, "namespace", mustBeString);
|
834
|
+
let suffix = getFlag(result, keys, "suffix", mustBeString);
|
811
835
|
let external = getFlag(result, keys, "external", mustBeBoolean);
|
812
836
|
let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean);
|
813
837
|
let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
|
@@ -823,6 +847,8 @@ function createChannel(streamIn) {
|
|
823
847
|
response.path = path;
|
824
848
|
if (namespace != null)
|
825
849
|
response.namespace = namespace;
|
850
|
+
if (suffix != null)
|
851
|
+
response.suffix = suffix;
|
826
852
|
if (external != null)
|
827
853
|
response.external = external;
|
828
854
|
if (sideEffects != null)
|
@@ -853,6 +879,7 @@ function createChannel(streamIn) {
|
|
853
879
|
let result = await callback2({
|
854
880
|
path: request.path,
|
855
881
|
namespace: request.namespace,
|
882
|
+
suffix: request.suffix,
|
856
883
|
pluginData: stash.load(request.pluginData)
|
857
884
|
});
|
858
885
|
if (result != null) {
|
@@ -1452,7 +1479,7 @@ error: ${e.text}`;
|
|
1452
1479
|
let { file, line, column } = e.location;
|
1453
1480
|
let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : "";
|
1454
1481
|
return `
|
1455
|
-
${file}:${line}:${column}:
|
1482
|
+
${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
1456
1483
|
}).join("");
|
1457
1484
|
let error = new Error(`${text}${summary}`);
|
1458
1485
|
error.errors = errors;
|
@@ -1546,7 +1573,7 @@ function convertOutputFiles({ path, contents }) {
|
|
1546
1573
|
}
|
1547
1574
|
|
1548
1575
|
// lib/npm/browser.ts
|
1549
|
-
var version = "0.14.
|
1576
|
+
var version = "0.14.3";
|
1550
1577
|
var build = (options) => ensureServiceIsRunning().build(options);
|
1551
1578
|
var serve = () => {
|
1552
1579
|
throw new Error(`The "serve" API only works in node`);
|
@@ -2191,9 +2218,9 @@ var startRunningService = async (wasmURL, useWorker) => {
|
|
2191
2218
|
|
2192
2219
|
// The linker guarantees global data starts from at least wasmMinDataAddr.
|
2193
2220
|
// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.
|
2194
|
-
const wasmMinDataAddr = 4096 +
|
2221
|
+
const wasmMinDataAddr = 4096 + 8192;
|
2195
2222
|
if (offset >= wasmMinDataAddr) {
|
2196
|
-
throw new Error("command line
|
2223
|
+
throw new Error("total length of command line and environment variables exceeds limit");
|
2197
2224
|
}
|
2198
2225
|
|
2199
2226
|
this._inst.exports.run(argc, argv);
|
@@ -2303,7 +2330,7 @@ onmessage = ({ data: wasm }) => {
|
|
2303
2330
|
callback(null, count);
|
2304
2331
|
};
|
2305
2332
|
let go = new global.Go();
|
2306
|
-
go.argv = ["", \`--service=\${"0.14.
|
2333
|
+
go.argv = ["", \`--service=\${"0.14.3"}\`];
|
2307
2334
|
WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));
|
2308
2335
|
};}`;
|
2309
2336
|
let worker;
|
@@ -2327,7 +2354,8 @@ onmessage = ({ data: wasm }) => {
|
|
2327
2354
|
worker.postMessage(bytes);
|
2328
2355
|
},
|
2329
2356
|
isSync: false,
|
2330
|
-
isBrowser: true
|
2357
|
+
isBrowser: true,
|
2358
|
+
esbuild: browser_exports
|
2331
2359
|
});
|
2332
2360
|
longLivedService = {
|
2333
2361
|
build: (options) => new Promise((resolve, reject) => service.buildOrServe({
|
@@ -1,8 +1,8 @@
|
|
1
|
-
var Ze=Object.defineProperty,et=Object.defineProperties;var tt=Object.getOwnPropertyDescriptors;var Ce=Object.getOwnPropertySymbols;var rt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable;var Le=(e,t,r)=>t in e?Ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pe=(e,t)=>{for(var r in t||(t={}))rt.call(t,r)&&Le(e,r,t[r]);if(Ce)for(var r of Ce(t))nt.call(t,r)&&Le(e,r,t[r]);return e},Me=(e,t)=>et(e,tt(t));function Be(e){let t=s=>{if(s===null)r.write8(0);else if(typeof s=="boolean")r.write8(1),r.write8(+s);else if(typeof s=="number")r.write8(2),r.write32(s|0);else if(typeof s=="string")r.write8(3),r.write(ae(s));else if(s instanceof Uint8Array)r.write8(4),r.write(s);else if(s instanceof Array){r.write8(5),r.write32(s.length);for(let p of s)t(p)}else{let p=Object.keys(s);r.write8(6),r.write32(p.length);for(let l of p)r.write(ae(l)),t(s[l])}},r=new Te;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Fe(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Ue(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ce(r.read());case 4:return r.read();case 5:{let c=r.read32(),i=[];for(let w=0;w<c;w++)i.push(t());return i}case 6:{let c=r.read32(),i={};for(let w=0;w<c;w++)i[ce(r.read())]=t();return i}default:throw new Error("Invalid packet")}},r=new Te(e),s=r.read32(),p=(s&1)==0;s>>>=1;let l=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:p,value:l}}var Te=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let r=new Uint8Array((this.len+t)*2);r.set(this.buf),this.buf=r}return this.len+=t,this.len-t}write8(t){let r=this._write(1);this.buf[r]=t}write32(t){let r=this._write(4);Fe(this.buf,t,r)}write(t){let r=this._write(4+t.length);Fe(this.buf,t.length,r),this.buf.set(t,r+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return Ae(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},ae,ce;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;ae=r=>e.encode(r),ce=r=>t.decode(r)}else if(typeof Buffer!="undefined")ae=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},ce=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function Ae(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Fe(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function qe(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Ne=()=>null,C=e=>typeof e=="boolean"?null:"a boolean",lt=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",y=e=>typeof e=="string"?null:"a string",We=e=>e instanceof RegExp?null:"a RegExp object",ge=e=>typeof e=="number"&&e===(e|0)?null:"an integer",je=e=>typeof e=="function"?null:"a function",z=e=>Array.isArray(e)?null:"an array",me=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",it=e=>typeof e=="object"&&e!==null?null:"an array or an object",ze=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ke=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",st=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",ot=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",at=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,s){let p=e[r];if(t[r+""]=!0,p===void 0)return;let l=s(p);if(l!==null)throw new Error(`"${r}" must be ${l}`);return p}function _(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function _e(e){let t=Object.create(null),r=n(e,t,"wasmURL",y),s=n(e,t,"worker",C);return _(e,t,"in startService() call"),{wasmURL:r,worker:s}}function Re(e,t,r,s,p){let l=n(t,r,"color",C),c=n(t,r,"logLevel",y),i=n(t,r,"logLimit",ge);l!==void 0?e.push(`--color=${l}`):s&&e.push("--color=true"),e.push(`--log-level=${c||p}`),e.push(`--log-limit=${i||0}`)}function Ve(e,t,r){let s=n(t,r,"legalComments",y),p=n(t,r,"sourceRoot",y),l=n(t,r,"sourcesContent",C),c=n(t,r,"target",ot),i=n(t,r,"format",y),w=n(t,r,"globalName",y),O=n(t,r,"minify",C),x=n(t,r,"minifySyntax",C),N=n(t,r,"minifyWhitespace",C),L=n(t,r,"minifyIdentifiers",C),k=n(t,r,"charset",y),q=n(t,r,"treeShaking",C),ee=n(t,r,"ignoreAnnotations",C),G=n(t,r,"jsx",y),te=n(t,r,"jsxFactory",y),re=n(t,r,"jsxFragment",y),le=n(t,r,"define",me),ie=n(t,r,"pure",z),ue=n(t,r,"keepNames",C);if(s&&e.push(`--legal-comments=${s}`),p!==void 0&&e.push(`--source-root=${p}`),l!==void 0&&e.push(`--sources-content=${l}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(qe).join(",")}`):e.push(`--target=${qe(c)}`)),i&&e.push(`--format=${i}`),w&&e.push(`--global-name=${w}`),O&&e.push("--minify"),x&&e.push("--minify-syntax"),N&&e.push("--minify-whitespace"),L&&e.push("--minify-identifiers"),k&&e.push(`--charset=${k}`),q!==void 0&&e.push(`--tree-shaking=${q}`),ee&&e.push("--ignore-annotations"),G&&e.push(`--jsx=${G}`),te&&e.push(`--jsx-factory=${te}`),re&&e.push(`--jsx-fragment=${re}`),le)for(let Q in le){if(Q.indexOf("=")>=0)throw new Error(`Invalid define: ${Q}`);e.push(`--define:${Q}=${le[Q]}`)}if(ie)for(let Q of ie)e.push(`--pure:${Q}`);ue&&e.push("--keep-names")}function ut(e,t,r,s,p){var b;let l=[],c=[],i=Object.create(null),w=null,O=null,x=null;Re(l,t,i,r,s),Ve(l,t,i);let N=n(t,i,"sourcemap",Ke),L=n(t,i,"bundle",C),k=n(t,i,"watch",lt),q=n(t,i,"splitting",C),ee=n(t,i,"preserveSymlinks",C),G=n(t,i,"metafile",C),te=n(t,i,"outfile",y),re=n(t,i,"outdir",y),le=n(t,i,"outbase",y),ie=n(t,i,"platform",y),ue=n(t,i,"tsconfig",y),Q=n(t,i,"resolveExtensions",z),ve=n(t,i,"nodePaths",z),ke=n(t,i,"mainFields",z),Ee=n(t,i,"conditions",z),$e=n(t,i,"external",z),d=n(t,i,"loader",me),u=n(t,i,"outExtension",me),o=n(t,i,"publicPath",y),f=n(t,i,"entryNames",y),I=n(t,i,"chunkNames",y),B=n(t,i,"assetNames",y),M=n(t,i,"inject",z),j=n(t,i,"banner",me),D=n(t,i,"footer",me),E=n(t,i,"entryPoints",it),R=n(t,i,"absWorkingDir",y),T=n(t,i,"stdin",me),A=(b=n(t,i,"write",C))!=null?b:p,S=n(t,i,"allowOverwrite",C),$=n(t,i,"incremental",C)===!0;if(i.plugins=!0,_(t,i,`in ${e}() call`),N&&l.push(`--sourcemap${N===!0?"":`=${N}`}`),L&&l.push("--bundle"),S&&l.push("--allow-overwrite"),k)if(l.push("--watch"),typeof k=="boolean")x={};else{let a=Object.create(null),h=n(k,a,"onRebuild",je);_(k,a,`on "watch" in ${e}() call`),x={onRebuild:h}}if(q&&l.push("--splitting"),ee&&l.push("--preserve-symlinks"),G&&l.push("--metafile"),te&&l.push(`--outfile=${te}`),re&&l.push(`--outdir=${re}`),le&&l.push(`--outbase=${le}`),ie&&l.push(`--platform=${ie}`),ue&&l.push(`--tsconfig=${ue}`),Q){let a=[];for(let h of Q){if(h+="",h.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${h}`);a.push(h)}l.push(`--resolve-extensions=${a.join(",")}`)}if(o&&l.push(`--public-path=${o}`),f&&l.push(`--entry-names=${f}`),I&&l.push(`--chunk-names=${I}`),B&&l.push(`--asset-names=${B}`),ke){let a=[];for(let h of ke){if(h+="",h.indexOf(",")>=0)throw new Error(`Invalid main field: ${h}`);a.push(h)}l.push(`--main-fields=${a.join(",")}`)}if(Ee){let a=[];for(let h of Ee){if(h+="",h.indexOf(",")>=0)throw new Error(`Invalid condition: ${h}`);a.push(h)}l.push(`--conditions=${a.join(",")}`)}if($e)for(let a of $e)l.push(`--external:${a}`);if(j)for(let a in j){if(a.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${a}`);l.push(`--banner:${a}=${j[a]}`)}if(D)for(let a in D){if(a.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${a}`);l.push(`--footer:${a}=${D[a]}`)}if(M)for(let a of M)l.push(`--inject:${a}`);if(d)for(let a in d){if(a.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${a}`);l.push(`--loader:${a}=${d[a]}`)}if(u)for(let a in u){if(a.indexOf("=")>=0)throw new Error(`Invalid out extension: ${a}`);l.push(`--out-extension:${a}=${u[a]}`)}if(E)if(Array.isArray(E))for(let a of E)c.push(["",a+""]);else for(let[a,h]of Object.entries(E))c.push([a+"",h+""]);if(T){let a=Object.create(null),h=n(T,a,"contents",y),P=n(T,a,"resolveDir",y),g=n(T,a,"sourcefile",y),v=n(T,a,"loader",y);_(T,a,'in "stdin" object'),g&&l.push(`--sourcefile=${g}`),v&&l.push(`--loader=${v}`),P&&(O=P+""),w=h?h+"":""}let m=[];if(ve)for(let a of ve)a+="",m.push(a);return{entries:c,flags:l,write:A,stdinContents:w,stdinResolveDir:O,absWorkingDir:R,incremental:$,nodePaths:m,watch:x}}function ct(e,t,r,s){let p=[],l=Object.create(null);Re(p,t,l,r,s),Ve(p,t,l);let c=n(t,l,"sourcemap",Ke),i=n(t,l,"tsconfigRaw",st),w=n(t,l,"sourcefile",y),O=n(t,l,"loader",y),x=n(t,l,"banner",y),N=n(t,l,"footer",y);return _(t,l,`in ${e}() call`),c&&p.push(`--sourcemap=${c===!0?"external":c}`),i&&p.push(`--tsconfig-raw=${typeof i=="string"?i:JSON.stringify(i)}`),w&&p.push(`--sourcefile=${w}`),O&&p.push(`--loader=${O}`),x&&p.push(`--banner=${x}`),N&&p.push(`--footer=${N}`),p}function Je(e){let t=new Map,r=new Map,s=new Map,p=new Map,l=0,c=!1,i=0,w=0,O=new Uint8Array(16*1024),x=0,N=d=>{let u=x+d.length;if(u>O.length){let f=new Uint8Array(u*2);f.set(O),O=f}O.set(d,x),x+=d.length;let o=0;for(;o+4<=x;){let f=Ae(O,o);if(o+4+f>x)break;o+=4,te(O.subarray(o,o+f)),o+=f}o>0&&(O.copyWithin(0,o,x),x-=o)},L=()=>{c=!0;for(let d of t.values())d("The service was stopped",null);t.clear();for(let d of p.values())d.onWait("The service was stopped");p.clear();for(let d of s.values())try{d(new Error("The service was stopped"),null)}catch(u){console.error(u)}s.clear()},k=(d,u,o)=>{if(c)return o("The service is no longer running",null);let f=i++;t.set(f,(I,B)=>{try{o(I,B)}finally{d&&d.unref()}}),d&&d.ref(),e.writeToStdin(Be({id:f,isRequest:!0,value:u}))},q=(d,u)=>{if(c)throw new Error("The service is no longer running");e.writeToStdin(Be({id:d,isRequest:!1,value:u}))},ee=async(d,u)=>{try{switch(u.command){case"ping":{q(d,{});break}case"start":{let o=r.get(u.key);o?q(d,await o(u)):q(d,{});break}case"resolve":{let o=r.get(u.key);o?q(d,await o(u)):q(d,{});break}case"load":{let o=r.get(u.key);o?q(d,await o(u)):q(d,{});break}case"serve-request":{let o=p.get(u.serveID);o&&o.onRequest&&o.onRequest(u.args),q(d,{});break}case"serve-wait":{let o=p.get(u.serveID);o&&o.onWait(u.error),q(d,{});break}case"watch-rebuild":{let o=s.get(u.watchID);try{o&&o(null,u.args)}catch(f){console.error(f)}q(d,{});break}default:throw new Error("Invalid command: "+u.command)}}catch(o){q(d,{errors:[ye(o,e,null,void 0,"")]})}},G=!0,te=d=>{if(G){G=!1;let o=String.fromCharCode(...d);if(o!=="0.14.0")throw new Error(`Cannot start service: Host version "0.14.0" does not match binary version ${JSON.stringify(o)}`);return}let u=Ue(d);if(u.isRequest)ee(u.id,u.value);else{let o=t.get(u.id);t.delete(u.id),u.value.error?o(u.value.error,{}):o(null,u.value)}},re=async(d,u,o,f)=>{let I=[],B=[],M={},j={},D=0,E=0,R=[];u=[...u];for(let $ of u){let m={};if(typeof $!="object")throw new Error(`Plugin at index ${E} must be an object`);let b=n($,m,"name",y);if(typeof b!="string"||b==="")throw new Error(`Plugin at index ${E} is missing a name`);try{let a=n($,m,"setup",je);if(typeof a!="function")throw new Error("Plugin is missing a setup function");_($,m,`on plugin ${JSON.stringify(b)}`);let h={name:b,onResolve:[],onLoad:[]};E++;let P=a({initialOptions:d,onStart(g){let v='This error came from the "onStart" callback registered here',W=Oe(new Error(v),e,"onStart");I.push({name:b,callback:g,note:W})},onEnd(g){let v='This error came from the "onEnd" callback registered here',W=Oe(new Error(v),e,"onEnd");B.push({name:b,callback:g,note:W})},onResolve(g,v){let W='This error came from the "onResolve" callback registered here',U=Oe(new Error(W),e,"onResolve"),K={},V=n(g,K,"filter",We),Y=n(g,K,"namespace",y);if(_(g,K,`in onResolve() call for plugin ${JSON.stringify(b)}`),V==null)throw new Error("onResolve() call is missing a filter");let J=D++;M[J]={name:b,callback:v,note:U},h.onResolve.push({id:J,filter:V.source,namespace:Y||""})},onLoad(g,v){let W='This error came from the "onLoad" callback registered here',U=Oe(new Error(W),e,"onLoad"),K={},V=n(g,K,"filter",We),Y=n(g,K,"namespace",y);if(_(g,K,`in onLoad() call for plugin ${JSON.stringify(b)}`),V==null)throw new Error("onLoad() call is missing a filter");let J=D++;j[J]={name:b,callback:v,note:U},h.onLoad.push({id:J,filter:V.source,namespace:Y||""})}});P&&await P,R.push(h)}catch(a){return{ok:!1,error:a,pluginName:b}}}let T=async $=>{switch($.command){case"start":{let m={errors:[],warnings:[]};return await Promise.all(I.map(async({name:b,callback:a,note:h})=>{try{let P=await a();if(P!=null){if(typeof P!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(b)} to return an object`);let g={},v=n(P,g,"errors",z),W=n(P,g,"warnings",z);_(P,g,`from onStart() callback in plugin ${JSON.stringify(b)}`),v!=null&&m.errors.push(...fe(v,"errors",f,b)),W!=null&&m.warnings.push(...fe(W,"warnings",f,b))}}catch(P){m.errors.push(ye(P,e,f,h&&h(),b))}})),m}case"resolve":{let m={},b="",a,h;for(let P of $.ids)try{({name:b,callback:a,note:h}=M[P]);let g=await a({path:$.path,importer:$.importer,namespace:$.namespace,resolveDir:$.resolveDir,kind:$.kind,pluginData:f.load($.pluginData)});if(g!=null){if(typeof g!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(b)} to return an object`);let v={},W=n(g,v,"pluginName",y),U=n(g,v,"path",y),K=n(g,v,"namespace",y),V=n(g,v,"external",C),Y=n(g,v,"sideEffects",C),J=n(g,v,"pluginData",Ne),se=n(g,v,"errors",z),oe=n(g,v,"warnings",z),F=n(g,v,"watchFiles",z),H=n(g,v,"watchDirs",z);_(g,v,`from onResolve() callback in plugin ${JSON.stringify(b)}`),m.id=P,W!=null&&(m.pluginName=W),U!=null&&(m.path=U),K!=null&&(m.namespace=K),V!=null&&(m.external=V),Y!=null&&(m.sideEffects=Y),J!=null&&(m.pluginData=f.store(J)),se!=null&&(m.errors=fe(se,"errors",f,b)),oe!=null&&(m.warnings=fe(oe,"warnings",f,b)),F!=null&&(m.watchFiles=Se(F,"watchFiles")),H!=null&&(m.watchDirs=Se(H,"watchDirs"));break}}catch(g){return{id:P,errors:[ye(g,e,f,h&&h(),b)]}}return m}case"load":{let m={},b="",a,h;for(let P of $.ids)try{({name:b,callback:a,note:h}=j[P]);let g=await a({path:$.path,namespace:$.namespace,pluginData:f.load($.pluginData)});if(g!=null){if(typeof g!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(b)} to return an object`);let v={},W=n(g,v,"pluginName",y),U=n(g,v,"contents",at),K=n(g,v,"resolveDir",y),V=n(g,v,"pluginData",Ne),Y=n(g,v,"loader",y),J=n(g,v,"errors",z),se=n(g,v,"warnings",z),oe=n(g,v,"watchFiles",z),F=n(g,v,"watchDirs",z);_(g,v,`from onLoad() callback in plugin ${JSON.stringify(b)}`),m.id=P,W!=null&&(m.pluginName=W),U instanceof Uint8Array?m.contents=U:U!=null&&(m.contents=ae(U)),K!=null&&(m.resolveDir=K),V!=null&&(m.pluginData=f.store(V)),Y!=null&&(m.loader=Y),J!=null&&(m.errors=fe(J,"errors",f,b)),se!=null&&(m.warnings=fe(se,"warnings",f,b)),oe!=null&&(m.watchFiles=Se(oe,"watchFiles")),F!=null&&(m.watchDirs=Se(F,"watchDirs"));break}}catch(g){return{id:P,errors:[ye(g,e,f,h&&h(),b)]}}return m}default:throw new Error("Invalid command: "+$.command)}},A=($,m,b)=>b();B.length>0&&(A=($,m,b)=>{(async()=>{for(let{name:a,callback:h,note:P}of B)try{await h($)}catch(g){$.errors.push(await new Promise(v=>m(g,a,P&&P(),v)))}})().then(b)});let S=0;return{ok:!0,requestPlugins:R,runOnEndCallbacks:A,pluginRefs:{ref(){++S==1&&r.set(o,T)},unref(){--S==0&&r.delete(o)}}}},le=(d,u,o)=>{let f={},I=n(u,f,"port",ge),B=n(u,f,"host",y),M=n(u,f,"servedir",y),j=n(u,f,"onRequest",je),D=l++,E,R=new Promise((T,A)=>{E=S=>{p.delete(D),S!==null?A(new Error(S)):T()}});return o.serve={serveID:D},_(u,f,"in serve() call"),I!==void 0&&(o.serve.port=I),B!==void 0&&(o.serve.host=B),M!==void 0&&(o.serve.servedir=M),p.set(D,{onRequest:j,onWait:E}),{wait:R,stop(){k(d,{command:"serve-stop",serveID:D},()=>{})}}},ie="warning",ue="silent",Q=d=>{let u=w++,o=Ye(),f,{refs:I,options:B,isTTY:M,callback:j}=d;if(typeof B=="object"){let R=B.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');f=R}}let D=(R,T,A,S)=>{let $=[];try{Re($,B,{},M,ie)}catch(b){}let m=ye(R,e,o,A,T);k(I,{command:"error",flags:$,error:m},()=>{m.detail=o.load(m.detail),S(m)})},E=(R,T)=>{D(R,T,void 0,A=>{j(he("Build failed",[A],[]),null)})};if(f&&f.length>0){if(e.isSync)return E(new Error("Cannot use plugins in synchronous API calls"),"");re(B,f,u,o).then(R=>{if(!R.ok)E(R.error,R.pluginName);else try{ve(Me(Pe({},d),{key:u,details:o,logPluginError:D,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(T){E(T,"")}},R=>E(R,""))}else try{ve(Me(Pe({},d),{key:u,details:o,logPluginError:D,requestPlugins:null,runOnEndCallbacks:(R,T,A)=>A(),pluginRefs:null}))}catch(R){E(R,"")}},ve=({callName:d,refs:u,serveOptions:o,options:f,isTTY:I,defaultWD:B,callback:M,key:j,details:D,logPluginError:E,requestPlugins:R,runOnEndCallbacks:T,pluginRefs:A})=>{let S={ref(){A&&A.ref(),u&&u.ref()},unref(){A&&A.unref(),u&&u.unref()}},$=!e.isBrowser,{entries:m,flags:b,write:a,stdinContents:h,stdinResolveDir:P,absWorkingDir:g,incremental:v,nodePaths:W,watch:U}=ut(d,f,I,ie,$),K={command:"build",key:j,entries:m,flags:b,write:a,stdinContents:h,stdinResolveDir:P,absWorkingDir:g||B,incremental:v,nodePaths:W};R&&(K.plugins=R);let V=o&&le(S,o,K),Y,J,se=(F,H)=>{F.outputFiles&&(H.outputFiles=F.outputFiles.map(ft)),F.metafile&&(H.metafile=JSON.parse(F.metafile)),F.writeToStdout!==void 0&&console.log(ce(F.writeToStdout).replace(/\n$/,""))},oe=(F,H)=>{let X={errors:be(F.errors,D),warnings:be(F.warnings,D)};se(F,X),T(X,E,()=>{if(X.errors.length>0)return H(he("Build failed",X.errors,X.warnings),null);if(F.rebuildID!==void 0){if(!Y){let ne=!1;Y=()=>new Promise((de,pe)=>{if(ne||c)throw new Error("Cannot rebuild");k(S,{command:"rebuild",rebuildID:F.rebuildID},(Z,Qe)=>{if(Z)return H(he("Build failed",[{pluginName:"",text:Z,location:null,notes:[],detail:void 0}],[]),null);oe(Qe,(De,Xe)=>{De?pe(De):de(Xe)})})}),S.ref(),Y.dispose=()=>{ne||(ne=!0,k(S,{command:"rebuild-dispose",rebuildID:F.rebuildID},()=>{}),S.unref())}}X.rebuild=Y}if(F.watchID!==void 0){if(!J){let ne=!1;S.ref(),J=()=>{ne||(ne=!0,s.delete(F.watchID),k(S,{command:"watch-stop",watchID:F.watchID},()=>{}),S.unref())},U&&s.set(F.watchID,(de,pe)=>{if(de){U.onRebuild&&U.onRebuild(de,null);return}let Z={errors:be(pe.errors,D),warnings:be(pe.warnings,D)};se(pe,Z),T(Z,E,()=>{if(Z.errors.length>0){U.onRebuild&&U.onRebuild(he("Build failed",Z.errors,Z.warnings),null);return}pe.rebuildID!==void 0&&(Z.rebuild=Y),Z.stop=J,U.onRebuild&&U.onRebuild(null,Z)})})}X.stop=J}H(null,X)})};if(a&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(v&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(U&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');k(S,K,(F,H)=>{if(F)return M(new Error(F),null);if(V){let X=H,ne=!1;S.ref();let de={port:X.port,host:X.host,wait:V.wait,stop(){ne||(ne=!0,V.stop(),S.unref())}};return S.ref(),V.wait.then(S.unref,S.unref),M(null,de)}return oe(H,M)})};return{readFromStdout:N,afterClose:L,service:{buildOrServe:Q,transform:({callName:d,refs:u,input:o,options:f,isTTY:I,fs:B,callback:M})=>{let j=Ye(),D=E=>{try{if(typeof o!="string")throw new Error('The input to "transform" must be a string');let R=ct(d,f,I,ue);k(u,{command:"transform",flags:R,inputFS:E!==null,input:E!==null?E:o},(A,S)=>{if(A)return M(new Error(A),null);let $=be(S.errors,j),m=be(S.warnings,j),b=1,a=()=>--b==0&&M(null,{warnings:m,code:S.code,map:S.map});if($.length>0)return M(he("Transform failed",$,m),null);S.codeFS&&(b++,B.readFile(S.code,(h,P)=>{h!==null?M(h,null):(S.code=P,a())})),S.mapFS&&(b++,B.readFile(S.map,(h,P)=>{h!==null?M(h,null):(S.map=P,a())})),a()})}catch(R){let T=[];try{Re(T,f,{},I,ue)}catch(S){}let A=ye(R,e,j,void 0,"");k(u,{command:"error",flags:T,error:A},()=>{A.detail=j.load(A.detail),M(he("Transform failed",[A],[]),null)})}};if(typeof o=="string"&&o.length>1024*1024){let E=D;D=()=>B.writeFile(o,E)}D(null)},formatMessages:({callName:d,refs:u,messages:o,options:f,callback:I})=>{let B=fe(o,"messages",null,"");if(!f)throw new Error(`Missing second argument in ${d}() call`);let M={},j=n(f,M,"kind",y),D=n(f,M,"color",C),E=n(f,M,"terminalWidth",ge);if(_(f,M,`in ${d}() call`),j===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(j!=="error"&&j!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let R={command:"format-msgs",messages:B,isWarning:j==="warning"};D!==void 0&&(R.color=D),E!==void 0&&(R.terminalWidth=E),k(u,R,(T,A)=>{if(T)return I(new Error(T),null);I(null,A.messages)})},analyzeMetafile:({callName:d,refs:u,metafile:o,options:f,callback:I})=>{f===void 0&&(f={});let B={},M=n(f,B,"color",C),j=n(f,B,"verbose",C);_(f,B,`in ${d}() call`);let D={command:"analyze-metafile",metafile:o};M!==void 0&&(D.color=M),j!==void 0&&(D.verbose=j),k(u,D,(E,R)=>{if(E)return I(new Error(E),null);I(null,R.result)})}}}}function Ye(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let s=t++;return e.set(s,r),s}}}function Oe(e,t,r){let s,p=!1;return()=>{if(p)return s;p=!0;try{let l=(e.stack+"").split(`
|
2
|
-
`);l.splice(1,1);let
|
3
|
-
`),"")}catch(i){}return{pluginName:
|
1
|
+
var Pe=Object.defineProperty,tt=Object.defineProperties;var rt=Object.getOwnPropertyDescriptors;var Ue=Object.getOwnPropertySymbols;var nt=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable;var qe=(e,t,r)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Me=(e,t)=>{for(var r in t||(t={}))nt.call(t,r)&&qe(e,r,t[r]);if(Ue)for(var r of Ue(t))lt.call(t,r)&&qe(e,r,t[r]);return e},Be=(e,t)=>tt(e,rt(t)),it=e=>Pe(e,"__esModule",{value:!0});var st=(e,t)=>{it(e);for(var r in t)Pe(e,r,{get:t[r],enumerable:!0})};var Le={};st(Le,{analyzeMetafile:()=>Ot,analyzeMetafileSync:()=>Et,build:()=>bt,buildSync:()=>St,formatMessages:()=>Rt,formatMessagesSync:()=>kt,initialize:()=>$t,serve:()=>wt,transform:()=>vt,transformSync:()=>xt,version:()=>ht});function Te(e){let t=s=>{if(s===null)r.write8(0);else if(typeof s=="boolean")r.write8(1),r.write8(+s);else if(typeof s=="number")r.write8(2),r.write32(s|0);else if(typeof s=="string")r.write8(3),r.write(ae(s));else if(s instanceof Uint8Array)r.write8(4),r.write(s);else if(s instanceof Array){r.write8(5),r.write32(s.length);for(let g of s)t(g)}else{let g=Object.keys(s);r.write8(6),r.write32(g.length);for(let l of g)r.write(ae(l)),t(s[l])}},r=new Ae;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Ne(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function We(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return fe(r.read());case 4:return r.read();case 5:{let f=r.read32(),i=[];for(let w=0;w<f;w++)i.push(t());return i}case 6:{let f=r.read32(),i={};for(let w=0;w<f;w++)i[fe(r.read())]=t();return i}default:throw new Error("Invalid packet")}},r=new Ae(e),s=r.read32(),g=(s&1)==0;s>>>=1;let l=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:g,value:l}}var Ae=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let r=new Uint8Array((this.len+t)*2);r.set(this.buf),this.buf=r}return this.len+=t,this.len-t}write8(t){let r=this._write(1);this.buf[r]=t}write32(t){let r=this._write(4);Ne(this.buf,t,r)}write(t){let r=this._write(4+t.length);Ne(this.buf,t.length,r),this.buf.set(t,r+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return Fe(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},ae,fe;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;ae=r=>e.encode(r),fe=r=>t.decode(r)}else if(typeof Buffer!="undefined")ae=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},fe=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function Fe(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ne(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function ze(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var je=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",at=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",y=e=>typeof e=="string"?null:"a string",Ke=e=>e instanceof RegExp?null:"a RegExp object",ge=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Ce=e=>typeof e=="function"?null:"a function",z=e=>Array.isArray(e)?null:"an array",me=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",ut=e=>typeof e=="object"&&e!==null?null:"an array or an object",_e=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ve=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",ft=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",ct=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",dt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,s){let g=e[r];if(t[r+""]=!0,g===void 0)return;let l=s(g);if(l!==null)throw new Error(`"${r}" must be ${l}`);return g}function _(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function Je(e){let t=Object.create(null),r=n(e,t,"wasmURL",y),s=n(e,t,"worker",I);return _(e,t,"in startService() call"),{wasmURL:r,worker:s}}function Re(e,t,r,s,g){let l=n(t,r,"color",I),f=n(t,r,"logLevel",y),i=n(t,r,"logLimit",ge);l!==void 0?e.push(`--color=${l}`):s&&e.push("--color=true"),e.push(`--log-level=${f||g}`),e.push(`--log-limit=${i||0}`)}function Ye(e,t,r){let s=n(t,r,"legalComments",y),g=n(t,r,"sourceRoot",y),l=n(t,r,"sourcesContent",I),f=n(t,r,"target",ct),i=n(t,r,"format",y),w=n(t,r,"globalName",y),O=n(t,r,"minify",I),x=n(t,r,"minifySyntax",I),N=n(t,r,"minifyWhitespace",I),L=n(t,r,"minifyIdentifiers",I),k=n(t,r,"charset",y),q=n(t,r,"treeShaking",I),ee=n(t,r,"ignoreAnnotations",I),Q=n(t,r,"jsx",y),te=n(t,r,"jsxFactory",y),re=n(t,r,"jsxFragment",y),le=n(t,r,"define",me),ie=n(t,r,"pure",z),ue=n(t,r,"keepNames",I);if(s&&e.push(`--legal-comments=${s}`),g!==void 0&&e.push(`--source-root=${g}`),l!==void 0&&e.push(`--sources-content=${l}`),f&&(Array.isArray(f)?e.push(`--target=${Array.from(f).map(ze).join(",")}`):e.push(`--target=${ze(f)}`)),i&&e.push(`--format=${i}`),w&&e.push(`--global-name=${w}`),O&&e.push("--minify"),x&&e.push("--minify-syntax"),N&&e.push("--minify-whitespace"),L&&e.push("--minify-identifiers"),k&&e.push(`--charset=${k}`),q!==void 0&&e.push(`--tree-shaking=${q}`),ee&&e.push("--ignore-annotations"),Q&&e.push(`--jsx=${Q}`),te&&e.push(`--jsx-factory=${te}`),re&&e.push(`--jsx-fragment=${re}`),le)for(let X in le){if(X.indexOf("=")>=0)throw new Error(`Invalid define: ${X}`);e.push(`--define:${X}=${le[X]}`)}if(ie)for(let X of ie)e.push(`--pure:${X}`);ue&&e.push("--keep-names")}function pt(e,t,r,s,g){var b;let l=[],f=[],i=Object.create(null),w=null,O=null,x=null;Re(l,t,i,r,s),Ye(l,t,i);let N=n(t,i,"sourcemap",Ve),L=n(t,i,"bundle",I),k=n(t,i,"watch",at),q=n(t,i,"splitting",I),ee=n(t,i,"preserveSymlinks",I),Q=n(t,i,"metafile",I),te=n(t,i,"outfile",y),re=n(t,i,"outdir",y),le=n(t,i,"outbase",y),ie=n(t,i,"platform",y),ue=n(t,i,"tsconfig",y),X=n(t,i,"resolveExtensions",z),ve=n(t,i,"nodePaths",z),ke=n(t,i,"mainFields",z),Ee=n(t,i,"conditions",z),$e=n(t,i,"external",z),d=n(t,i,"loader",me),u=n(t,i,"outExtension",me),o=n(t,i,"publicPath",y),c=n(t,i,"entryNames",y),C=n(t,i,"chunkNames",y),B=n(t,i,"assetNames",y),M=n(t,i,"inject",z),j=n(t,i,"banner",me),D=n(t,i,"footer",me),$=n(t,i,"entryPoints",ut),R=n(t,i,"absWorkingDir",y),T=n(t,i,"stdin",me),A=(b=n(t,i,"write",I))!=null?b:g,S=n(t,i,"allowOverwrite",I),E=n(t,i,"incremental",I)===!0;if(i.plugins=!0,_(t,i,`in ${e}() call`),N&&l.push(`--sourcemap${N===!0?"":`=${N}`}`),L&&l.push("--bundle"),S&&l.push("--allow-overwrite"),k)if(l.push("--watch"),typeof k=="boolean")x={};else{let a=Object.create(null),h=n(k,a,"onRebuild",Ce);_(k,a,`on "watch" in ${e}() call`),x={onRebuild:h}}if(q&&l.push("--splitting"),ee&&l.push("--preserve-symlinks"),Q&&l.push("--metafile"),te&&l.push(`--outfile=${te}`),re&&l.push(`--outdir=${re}`),le&&l.push(`--outbase=${le}`),ie&&l.push(`--platform=${ie}`),ue&&l.push(`--tsconfig=${ue}`),X){let a=[];for(let h of X){if(h+="",h.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${h}`);a.push(h)}l.push(`--resolve-extensions=${a.join(",")}`)}if(o&&l.push(`--public-path=${o}`),c&&l.push(`--entry-names=${c}`),C&&l.push(`--chunk-names=${C}`),B&&l.push(`--asset-names=${B}`),ke){let a=[];for(let h of ke){if(h+="",h.indexOf(",")>=0)throw new Error(`Invalid main field: ${h}`);a.push(h)}l.push(`--main-fields=${a.join(",")}`)}if(Ee){let a=[];for(let h of Ee){if(h+="",h.indexOf(",")>=0)throw new Error(`Invalid condition: ${h}`);a.push(h)}l.push(`--conditions=${a.join(",")}`)}if($e)for(let a of $e)l.push(`--external:${a}`);if(j)for(let a in j){if(a.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${a}`);l.push(`--banner:${a}=${j[a]}`)}if(D)for(let a in D){if(a.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${a}`);l.push(`--footer:${a}=${D[a]}`)}if(M)for(let a of M)l.push(`--inject:${a}`);if(d)for(let a in d){if(a.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${a}`);l.push(`--loader:${a}=${d[a]}`)}if(u)for(let a in u){if(a.indexOf("=")>=0)throw new Error(`Invalid out extension: ${a}`);l.push(`--out-extension:${a}=${u[a]}`)}if($)if(Array.isArray($))for(let a of $)f.push(["",a+""]);else for(let[a,h]of Object.entries($))f.push([a+"",h+""]);if(T){let a=Object.create(null),h=n(T,a,"contents",y),P=n(T,a,"resolveDir",y),p=n(T,a,"sourcefile",y),v=n(T,a,"loader",y);_(T,a,'in "stdin" object'),p&&l.push(`--sourcefile=${p}`),v&&l.push(`--loader=${v}`),P&&(O=P+""),w=h?h+"":""}let m=[];if(ve)for(let a of ve)a+="",m.push(a);return{entries:f,flags:l,write:A,stdinContents:w,stdinResolveDir:O,absWorkingDir:R,incremental:E,nodePaths:m,watch:x}}function gt(e,t,r,s){let g=[],l=Object.create(null);Re(g,t,l,r,s),Ye(g,t,l);let f=n(t,l,"sourcemap",Ve),i=n(t,l,"tsconfigRaw",ft),w=n(t,l,"sourcefile",y),O=n(t,l,"loader",y),x=n(t,l,"banner",y),N=n(t,l,"footer",y);return _(t,l,`in ${e}() call`),f&&g.push(`--sourcemap=${f===!0?"external":f}`),i&&g.push(`--tsconfig-raw=${typeof i=="string"?i:JSON.stringify(i)}`),w&&g.push(`--sourcefile=${w}`),O&&g.push(`--loader=${O}`),x&&g.push(`--banner=${x}`),N&&g.push(`--footer=${N}`),g}function He(e){let t=new Map,r=new Map,s=new Map,g=new Map,l=0,f=!1,i=0,w=0,O=new Uint8Array(16*1024),x=0,N=d=>{let u=x+d.length;if(u>O.length){let c=new Uint8Array(u*2);c.set(O),O=c}O.set(d,x),x+=d.length;let o=0;for(;o+4<=x;){let c=Fe(O,o);if(o+4+c>x)break;o+=4,te(O.subarray(o,o+c)),o+=c}o>0&&(O.copyWithin(0,o,x),x-=o)},L=()=>{f=!0;for(let d of t.values())d("The service was stopped",null);t.clear();for(let d of g.values())d.onWait("The service was stopped");g.clear();for(let d of s.values())try{d(new Error("The service was stopped"),null)}catch(u){console.error(u)}s.clear()},k=(d,u,o)=>{if(f)return o("The service is no longer running",null);let c=i++;t.set(c,(C,B)=>{try{o(C,B)}finally{d&&d.unref()}}),d&&d.ref(),e.writeToStdin(Te({id:c,isRequest:!0,value:u}))},q=(d,u)=>{if(f)throw new Error("The service is no longer running");e.writeToStdin(Te({id:d,isRequest:!1,value:u}))},ee=async(d,u)=>{try{switch(u.command){case"ping":{q(d,{});break}case"start":{let o=r.get(u.key);o?q(d,await o(u)):q(d,{});break}case"resolve":{let o=r.get(u.key);o?q(d,await o(u)):q(d,{});break}case"load":{let o=r.get(u.key);o?q(d,await o(u)):q(d,{});break}case"serve-request":{let o=g.get(u.serveID);o&&o.onRequest&&o.onRequest(u.args),q(d,{});break}case"serve-wait":{let o=g.get(u.serveID);o&&o.onWait(u.error),q(d,{});break}case"watch-rebuild":{let o=s.get(u.watchID);try{o&&o(null,u.args)}catch(c){console.error(c)}q(d,{});break}default:throw new Error("Invalid command: "+u.command)}}catch(o){q(d,{errors:[ye(o,e,null,void 0,"")]})}},Q=!0,te=d=>{if(Q){Q=!1;let o=String.fromCharCode(...d);if(o!=="0.14.3")throw new Error(`Cannot start service: Host version "0.14.3" does not match binary version ${JSON.stringify(o)}`);return}let u=We(d);if(u.isRequest)ee(u.id,u.value);else{let o=t.get(u.id);t.delete(u.id),u.value.error?o(u.value.error,{}):o(null,u.value)}},re=async(d,u,o,c)=>{let C=[],B=[],M={},j={},D=0,$=0,R=[];u=[...u];for(let E of u){let m={};if(typeof E!="object")throw new Error(`Plugin at index ${$} must be an object`);let b=n(E,m,"name",y);if(typeof b!="string"||b==="")throw new Error(`Plugin at index ${$} is missing a name`);try{let a=n(E,m,"setup",Ce);if(typeof a!="function")throw new Error("Plugin is missing a setup function");_(E,m,`on plugin ${JSON.stringify(b)}`);let h={name:b,onResolve:[],onLoad:[]};$++;let P=a({initialOptions:d,onStart(p){let v='This error came from the "onStart" callback registered here:',W=Oe(new Error(v),e,"onStart");C.push({name:b,callback:p,note:W})},onEnd(p){let v='This error came from the "onEnd" callback registered here:',W=Oe(new Error(v),e,"onEnd");B.push({name:b,callback:p,note:W})},onResolve(p,v){let W='This error came from the "onResolve" callback registered here:',U=Oe(new Error(W),e,"onResolve"),K={},V=n(p,K,"filter",Ke),Y=n(p,K,"namespace",y);if(_(p,K,`in onResolve() call for plugin ${JSON.stringify(b)}`),V==null)throw new Error("onResolve() call is missing a filter");let J=D++;M[J]={name:b,callback:v,note:U},h.onResolve.push({id:J,filter:V.source,namespace:Y||""})},onLoad(p,v){let W='This error came from the "onLoad" callback registered here:',U=Oe(new Error(W),e,"onLoad"),K={},V=n(p,K,"filter",Ke),Y=n(p,K,"namespace",y);if(_(p,K,`in onLoad() call for plugin ${JSON.stringify(b)}`),V==null)throw new Error("onLoad() call is missing a filter");let J=D++;j[J]={name:b,callback:v,note:U},h.onLoad.push({id:J,filter:V.source,namespace:Y||""})},esbuild:e.esbuild});P&&await P,R.push(h)}catch(a){return{ok:!1,error:a,pluginName:b}}}let T=async E=>{switch(E.command){case"start":{let m={errors:[],warnings:[]};return await Promise.all(C.map(async({name:b,callback:a,note:h})=>{try{let P=await a();if(P!=null){if(typeof P!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(b)} to return an object`);let p={},v=n(P,p,"errors",z),W=n(P,p,"warnings",z);_(P,p,`from onStart() callback in plugin ${JSON.stringify(b)}`),v!=null&&m.errors.push(...ce(v,"errors",c,b)),W!=null&&m.warnings.push(...ce(W,"warnings",c,b))}}catch(P){m.errors.push(ye(P,e,c,h&&h(),b))}})),m}case"resolve":{let m={},b="",a,h;for(let P of E.ids)try{({name:b,callback:a,note:h}=M[P]);let p=await a({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:c.load(E.pluginData)});if(p!=null){if(typeof p!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(b)} to return an object`);let v={},W=n(p,v,"pluginName",y),U=n(p,v,"path",y),K=n(p,v,"namespace",y),V=n(p,v,"suffix",y),Y=n(p,v,"external",I),J=n(p,v,"sideEffects",I),se=n(p,v,"pluginData",je),oe=n(p,v,"errors",z),F=n(p,v,"warnings",z),G=n(p,v,"watchFiles",z),H=n(p,v,"watchDirs",z);_(p,v,`from onResolve() callback in plugin ${JSON.stringify(b)}`),m.id=P,W!=null&&(m.pluginName=W),U!=null&&(m.path=U),K!=null&&(m.namespace=K),V!=null&&(m.suffix=V),Y!=null&&(m.external=Y),J!=null&&(m.sideEffects=J),se!=null&&(m.pluginData=c.store(se)),oe!=null&&(m.errors=ce(oe,"errors",c,b)),F!=null&&(m.warnings=ce(F,"warnings",c,b)),G!=null&&(m.watchFiles=Se(G,"watchFiles")),H!=null&&(m.watchDirs=Se(H,"watchDirs"));break}}catch(p){return{id:P,errors:[ye(p,e,c,h&&h(),b)]}}return m}case"load":{let m={},b="",a,h;for(let P of E.ids)try{({name:b,callback:a,note:h}=j[P]);let p=await a({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:c.load(E.pluginData)});if(p!=null){if(typeof p!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(b)} to return an object`);let v={},W=n(p,v,"pluginName",y),U=n(p,v,"contents",dt),K=n(p,v,"resolveDir",y),V=n(p,v,"pluginData",je),Y=n(p,v,"loader",y),J=n(p,v,"errors",z),se=n(p,v,"warnings",z),oe=n(p,v,"watchFiles",z),F=n(p,v,"watchDirs",z);_(p,v,`from onLoad() callback in plugin ${JSON.stringify(b)}`),m.id=P,W!=null&&(m.pluginName=W),U instanceof Uint8Array?m.contents=U:U!=null&&(m.contents=ae(U)),K!=null&&(m.resolveDir=K),V!=null&&(m.pluginData=c.store(V)),Y!=null&&(m.loader=Y),J!=null&&(m.errors=ce(J,"errors",c,b)),se!=null&&(m.warnings=ce(se,"warnings",c,b)),oe!=null&&(m.watchFiles=Se(oe,"watchFiles")),F!=null&&(m.watchDirs=Se(F,"watchDirs"));break}}catch(p){return{id:P,errors:[ye(p,e,c,h&&h(),b)]}}return m}default:throw new Error("Invalid command: "+E.command)}},A=(E,m,b)=>b();B.length>0&&(A=(E,m,b)=>{(async()=>{for(let{name:a,callback:h,note:P}of B)try{await h(E)}catch(p){E.errors.push(await new Promise(v=>m(p,a,P&&P(),v)))}})().then(b)});let S=0;return{ok:!0,requestPlugins:R,runOnEndCallbacks:A,pluginRefs:{ref(){++S==1&&r.set(o,T)},unref(){--S==0&&r.delete(o)}}}},le=(d,u,o)=>{let c={},C=n(u,c,"port",ge),B=n(u,c,"host",y),M=n(u,c,"servedir",y),j=n(u,c,"onRequest",Ce),D=l++,$,R=new Promise((T,A)=>{$=S=>{g.delete(D),S!==null?A(new Error(S)):T()}});return o.serve={serveID:D},_(u,c,"in serve() call"),C!==void 0&&(o.serve.port=C),B!==void 0&&(o.serve.host=B),M!==void 0&&(o.serve.servedir=M),g.set(D,{onRequest:j,onWait:$}),{wait:R,stop(){k(d,{command:"serve-stop",serveID:D},()=>{})}}},ie="warning",ue="silent",X=d=>{let u=w++,o=Ge(),c,{refs:C,options:B,isTTY:M,callback:j}=d;if(typeof B=="object"){let R=B.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');c=R}}let D=(R,T,A,S)=>{let E=[];try{Re(E,B,{},M,ie)}catch(b){}let m=ye(R,e,o,A,T);k(C,{command:"error",flags:E,error:m},()=>{m.detail=o.load(m.detail),S(m)})},$=(R,T)=>{D(R,T,void 0,A=>{j(he("Build failed",[A],[]),null)})};if(c&&c.length>0){if(e.isSync)return $(new Error("Cannot use plugins in synchronous API calls"),"");re(B,c,u,o).then(R=>{if(!R.ok)$(R.error,R.pluginName);else try{ve(Be(Me({},d),{key:u,details:o,logPluginError:D,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(T){$(T,"")}},R=>$(R,""))}else try{ve(Be(Me({},d),{key:u,details:o,logPluginError:D,requestPlugins:null,runOnEndCallbacks:(R,T,A)=>A(),pluginRefs:null}))}catch(R){$(R,"")}},ve=({callName:d,refs:u,serveOptions:o,options:c,isTTY:C,defaultWD:B,callback:M,key:j,details:D,logPluginError:$,requestPlugins:R,runOnEndCallbacks:T,pluginRefs:A})=>{let S={ref(){A&&A.ref(),u&&u.ref()},unref(){A&&A.unref(),u&&u.unref()}},E=!e.isBrowser,{entries:m,flags:b,write:a,stdinContents:h,stdinResolveDir:P,absWorkingDir:p,incremental:v,nodePaths:W,watch:U}=pt(d,c,C,ie,E),K={command:"build",key:j,entries:m,flags:b,write:a,stdinContents:h,stdinResolveDir:P,absWorkingDir:p||B,incremental:v,nodePaths:W};R&&(K.plugins=R);let V=o&&le(S,o,K),Y,J,se=(F,G)=>{F.outputFiles&&(G.outputFiles=F.outputFiles.map(mt)),F.metafile&&(G.metafile=JSON.parse(F.metafile)),F.writeToStdout!==void 0&&console.log(fe(F.writeToStdout).replace(/\n$/,""))},oe=(F,G)=>{let H={errors:be(F.errors,D),warnings:be(F.warnings,D)};se(F,H),T(H,$,()=>{if(H.errors.length>0)return G(he("Build failed",H.errors,H.warnings),null);if(F.rebuildID!==void 0){if(!Y){let ne=!1;Y=()=>new Promise((de,pe)=>{if(ne||f)throw new Error("Cannot rebuild");k(S,{command:"rebuild",rebuildID:F.rebuildID},(Z,Ze)=>{if(Z)return G(he("Build failed",[{pluginName:"",text:Z,location:null,notes:[],detail:void 0}],[]),null);oe(Ze,(De,et)=>{De?pe(De):de(et)})})}),S.ref(),Y.dispose=()=>{ne||(ne=!0,k(S,{command:"rebuild-dispose",rebuildID:F.rebuildID},()=>{}),S.unref())}}H.rebuild=Y}if(F.watchID!==void 0){if(!J){let ne=!1;S.ref(),J=()=>{ne||(ne=!0,s.delete(F.watchID),k(S,{command:"watch-stop",watchID:F.watchID},()=>{}),S.unref())},U&&s.set(F.watchID,(de,pe)=>{if(de){U.onRebuild&&U.onRebuild(de,null);return}let Z={errors:be(pe.errors,D),warnings:be(pe.warnings,D)};se(pe,Z),T(Z,$,()=>{if(Z.errors.length>0){U.onRebuild&&U.onRebuild(he("Build failed",Z.errors,Z.warnings),null);return}pe.rebuildID!==void 0&&(Z.rebuild=Y),Z.stop=J,U.onRebuild&&U.onRebuild(null,Z)})})}H.stop=J}G(null,H)})};if(a&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(v&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(U&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');k(S,K,(F,G)=>{if(F)return M(new Error(F),null);if(V){let H=G,ne=!1;S.ref();let de={port:H.port,host:H.host,wait:V.wait,stop(){ne||(ne=!0,V.stop(),S.unref())}};return S.ref(),V.wait.then(S.unref,S.unref),M(null,de)}return oe(G,M)})};return{readFromStdout:N,afterClose:L,service:{buildOrServe:X,transform:({callName:d,refs:u,input:o,options:c,isTTY:C,fs:B,callback:M})=>{let j=Ge(),D=$=>{try{if(typeof o!="string")throw new Error('The input to "transform" must be a string');let R=gt(d,c,C,ue);k(u,{command:"transform",flags:R,inputFS:$!==null,input:$!==null?$:o},(A,S)=>{if(A)return M(new Error(A),null);let E=be(S.errors,j),m=be(S.warnings,j),b=1,a=()=>--b==0&&M(null,{warnings:m,code:S.code,map:S.map});if(E.length>0)return M(he("Transform failed",E,m),null);S.codeFS&&(b++,B.readFile(S.code,(h,P)=>{h!==null?M(h,null):(S.code=P,a())})),S.mapFS&&(b++,B.readFile(S.map,(h,P)=>{h!==null?M(h,null):(S.map=P,a())})),a()})}catch(R){let T=[];try{Re(T,c,{},C,ue)}catch(S){}let A=ye(R,e,j,void 0,"");k(u,{command:"error",flags:T,error:A},()=>{A.detail=j.load(A.detail),M(he("Transform failed",[A],[]),null)})}};if(typeof o=="string"&&o.length>1024*1024){let $=D;D=()=>B.writeFile(o,$)}D(null)},formatMessages:({callName:d,refs:u,messages:o,options:c,callback:C})=>{let B=ce(o,"messages",null,"");if(!c)throw new Error(`Missing second argument in ${d}() call`);let M={},j=n(c,M,"kind",y),D=n(c,M,"color",I),$=n(c,M,"terminalWidth",ge);if(_(c,M,`in ${d}() call`),j===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(j!=="error"&&j!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let R={command:"format-msgs",messages:B,isWarning:j==="warning"};D!==void 0&&(R.color=D),$!==void 0&&(R.terminalWidth=$),k(u,R,(T,A)=>{if(T)return C(new Error(T),null);C(null,A.messages)})},analyzeMetafile:({callName:d,refs:u,metafile:o,options:c,callback:C})=>{c===void 0&&(c={});let B={},M=n(c,B,"color",I),j=n(c,B,"verbose",I);_(c,B,`in ${d}() call`);let D={command:"analyze-metafile",metafile:o};M!==void 0&&(D.color=M),j!==void 0&&(D.verbose=j),k(u,D,($,R)=>{if($)return C(new Error($),null);C(null,R.result)})}}}}function Ge(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let s=t++;return e.set(s,r),s}}}function Oe(e,t,r){let s,g=!1;return()=>{if(g)return s;g=!0;try{let l=(e.stack+"").split(`
|
2
|
+
`);l.splice(1,1);let f=Qe(t,l,r);if(f)return s={text:e.message,location:f},s}catch(l){}}}function ye(e,t,r,s,g){let l="Internal error",f=null;try{l=(e&&e.message||e)+""}catch(i){}try{f=Qe(t,(e.stack+"").split(`
|
3
|
+
`),"")}catch(i){}return{pluginName:g,text:l,location:f,notes:s?[s]:[],detail:r?r.store(e):-1}}function Qe(e,t,r){let s=" at ";if(e.readFileSync&&!t[0].startsWith(s)&&t[1].startsWith(s))for(let g=1;g<t.length;g++){let l=t[g];if(!!l.startsWith(s))for(l=l.slice(s.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 i;try{i=e.readFileSync(f[1],"utf8")}catch(N){break}let w=i.split(/\r\n|\r|\n|\u2028|\u2029/)[+f[2]-1]||"",O=+f[3]-1,x=w.slice(O,O+r.length)===r?r.length:0;return{file:f[1],namespace:"file",line:+f[2],column:ae(w.slice(0,O)).length,length:ae(w.slice(O,O+x)).length,lineText:w+`
|
4
4
|
`+t.slice(1).join(`
|
5
|
-
`),suggestion:""}}break}}return null}function he(e,t,r){let s=5,
|
6
|
-
...`;if(!
|
7
|
-
error: ${
|
8
|
-
${w}:${O}:${x}: error: ${N}${c.text}`}).join(""),l=new Error(`${e}${p}`);return l.errors=t,l.warnings=r,l}function be(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Ge(e,t){if(e==null)return null;let r={},s=n(e,r,"file",y),p=n(e,r,"namespace",y),l=n(e,r,"line",ge),c=n(e,r,"column",ge),i=n(e,r,"length",ge),w=n(e,r,"lineText",y),O=n(e,r,"suggestion",y);return _(e,r,t),{file:s||"",namespace:p||"",line:l||0,column:c||0,length:i||0,lineText:w||"",suggestion:O||""}}function fe(e,t,r,s){let p=[],l=0;for(let c of e){let i={},w=n(c,i,"pluginName",y),O=n(c,i,"text",y),x=n(c,i,"location",ze),N=n(c,i,"notes",z),L=n(c,i,"detail",Ne),k=`in element ${l} of "${t}"`;_(c,i,k);let q=[];if(N)for(let ee of N){let G={},te=n(ee,G,"text",y),re=n(ee,G,"location",ze);_(ee,G,k),q.push({text:te||"",location:Ge(re,k)})}p.push({pluginName:w||s,text:O||"",location:Ge(x,k),notes:q,detail:r?r.store(L):-1}),l++}return p}function Se(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function ft({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=ce(t)),r}}}var bt="0.14.0",wt=e=>xe().build(e),vt=()=>{throw new Error('The "serve" API only works in node')},Rt=(e,t)=>xe().transform(e,t),Ot=(e,t)=>xe().formatMessages(e,t),St=(e,t)=>xe().analyzeMetafile(e,t),xt=()=>{throw new Error('The "buildSync" API only works in node')},kt=()=>{throw new Error('The "transformSync" API only works in node')},Et=()=>{throw new Error('The "formatMessagesSync" API only works in node')},$t=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},we,Ie,xe=()=>{if(Ie)return Ie;throw we?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=_e(e||{});let t=e.wasmURL,r=e.worker!==!1;if(!t)throw new Error('Must provide the "wasmURL" option');if(t+="",we)throw new Error('Cannot call "initialize" more than once');return we=dt(t,r),we.catch(()=>{we=void 0}),we},dt=async(e,t)=>{let r=await fetch(e);if(!r.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);let s=await r.arrayBuffer(),p='{let global={};for(let o=self;o;o=Object.getPrototypeOf(o))for(let k of Object.getOwnPropertyNames(o))if(!(k in global))Object.defineProperty(global,k,{get:()=>self[k]});\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(()=>{if(typeof global=="undefined")if(typeof window!="undefined")window.global=window;else if(typeof self!="undefined")self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(!global.require&&typeof require!="undefined"&&(global.require=require),!global.fs&&global.require){const r=require("fs");typeof r=="object"&&r!==null&&Object.keys(r).length!==0&&(global.fs=Object.assign({},r,{write(n,s,i,l,d,u){if(i===0&&l===s.length&&d===null){if(n===process.stdout.fd){try{process.stdout.write(s,h=>h?u(h,0,null):u(null,l,s))}catch(h){u(h,0,null)}return}if(n===process.stderr.fd){try{process.stderr.write(s,h=>h?u(h,0,null):u(null,l,s))}catch(h){u(h,0,null)}return}}r.write(n,s,i,l,d,u)}}))}const a=()=>{const r=new Error("not implemented");return r.code="ENOSYS",r};if(!global.fs){let r="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){r+=g.decode(s);const i=r.lastIndexOf(`\n`);return i!=-1&&(console.log(r.substr(0,i)),r=r.substr(i+1)),s.length},write(n,s,i,l,d,u){if(i!==0||l!==s.length||d!==null){u(a());return}const h=this.writeSync(n,s);u(null,h)},chmod(n,s,i){i(a())},chown(n,s,i,l){l(a())},close(n,s){s(a())},fchmod(n,s,i){i(a())},fchown(n,s,i,l){l(a())},fstat(n,s){s(a())},fsync(n,s){s(null)},ftruncate(n,s,i){i(a())},lchown(n,s,i,l){l(a())},link(n,s,i){i(a())},lstat(n,s){s(a())},mkdir(n,s,i){i(a())},open(n,s,i,l){l(a())},read(n,s,i,l,d,u){u(a())},readdir(n,s){s(a())},readlink(n,s){s(a())},rename(n,s,i){i(a())},rmdir(n,s){s(a())},stat(n,s){s(a())},symlink(n,s,i){i(a())},truncate(n,s,i){i(a())},unlink(n,s){s(a())},utimes(n,s,i,l){l(a())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw a()},pid:-1,ppid:-1,umask(){throw a()},cwd(){throw a()},chdir(){throw a()}}),!global.crypto&&global.require){const r=require("crypto");global.crypto={getRandomValues(n){r.randomFillSync(n)}}}if(!global.crypto)throw new Error("global.crypto is not available, polyfill required (getRandomValues only)");if(global.performance||(global.performance={now(){const[r,n]=process.hrtime();return r*1e3+n/1e6}}),!global.TextEncoder&&global.require&&(global.TextEncoder=require("util").TextEncoder),!global.TextEncoder)throw new Error("global.TextEncoder is not available, polyfill required");if(!global.TextDecoder&&global.require&&(global.TextDecoder=require("util").TextDecoder),!global.TextDecoder)throw new Error("global.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");if(global.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 r=(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)=>{const o=2146959360;if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,o,!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 c=this._ids.get(t);c===void 0&&(c=this._idPool.pop(),c===void 0&&(c=this._values.length),this._values[c]=t,this._goRefCounts[c]=0,this._ids.set(t,c)),this._goRefCounts[c]++;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,o|m,!0),this.mem.setUint32(e,c,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},d=e=>{const t=n(e+0),o=n(e+8),c=new Array(o);for(let m=0;m<o;m++)c[m]=s(t+m*8);return c},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},h=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),c=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,c))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,r(e+8,(h+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();r(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)),c=d(e+32),m=Reflect.apply(o,t,c);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=d(e+16),c=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,c),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=d(e+16),c=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,c),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,r(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),r(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 c=o.subarray(0,t.length);t.set(c),r(e+40,c.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 c=o.subarray(0,t.length);t.set(c),r(e+40,c.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(r){if(!(r instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=r,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,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 h=4096+4096;if(n>=h)throw new Error("command line too long");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(r){const n=this;return function(){const s={id:r,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}},typeof module!="undefined"&&global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const r=new Go;r.argv=process.argv.slice(2),r.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),r.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),r.importObject).then(n=>(process.on("exit",s=>{s===0&&!r.exited&&(r._pendingEvent={id:0},r._resume())}),r.run(n.instance))).catch(n=>{console.error(n),process.exit(1)})}})();\nonmessage=({data:c})=>{let y=new TextDecoder,s=global.fs,a="";s.writeSync=(e,t)=>{if(e===1)postMessage(t);else if(e===2){a+=y.decode(t);let n=a.split(`\n`);n.length>1&&console.log(n.slice(0,-1).join(`\n`)),a=n[n.length-1]}else throw new Error("Bad write");return t.length};let l=[],i,r=0;onmessage=({data:e})=>{e.length>0&&(l.push(e),i&&i())},s.read=(e,t,n,d,h,m)=>{if(e!==0||n!==0||d!==t.length||h!==null)throw new Error("Bad read");if(l.length===0){i=()=>s.read(e,t,n,d,h,m);return}let g=l[0],u=Math.max(0,Math.min(d,g.length-r));t.set(g.subarray(r,r+u),n),r+=u,r===g.length&&(l.shift(),r=0),m(null,u)};let o=new global.Go;o.argv=["","--service=0.14.0"],WebAssembly.instantiate(c,o.importObject).then(({instance:e})=>o.run(e))};}',l;if(t){let w=new Blob([p],{type:"text/javascript"});l=new Worker(URL.createObjectURL(w))}else{let O=new Function("postMessage",p+"var onmessage; return m => onmessage(m)")(x=>l.onmessage({data:x}));l={onmessage:null,postMessage:x=>O({data:x}),terminate(){}}}l.postMessage(s),l.onmessage=({data:w})=>c(w);let{readFromStdout:c,service:i}=Je({writeToStdin(w){l.postMessage(w)},isSync:!1,isBrowser:!0});Ie={build:w=>new Promise((O,x)=>i.buildOrServe({callName:"build",refs:null,serveOptions:null,options:w,isTTY:!1,defaultWD:"/",callback:(N,L)=>N?x(N):O(L)})),transform:(w,O)=>new Promise((x,N)=>i.transform({callName:"transform",refs:null,input:w,options:O||{},isTTY:!1,fs:{readFile(L,k){k(new Error("Internal error"),null)},writeFile(L,k){k(null)}},callback:(L,k)=>L?N(L):x(k)})),formatMessages:(w,O)=>new Promise((x,N)=>i.formatMessages({callName:"formatMessages",refs:null,messages:w,options:O,callback:(L,k)=>L?N(L):x(k)})),analyzeMetafile:(w,O)=>new Promise((x,N)=>i.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof w=="string"?w:JSON.stringify(w),options:O,callback:(L,k)=>L?N(L):x(k)}))}};export{St as analyzeMetafile,$t as analyzeMetafileSync,wt as build,xt as buildSync,Ot as formatMessages,Et as formatMessagesSync,Dt as initialize,vt as serve,Rt as transform,kt as transformSync,bt as version};
|
5
|
+
`),suggestion:""}}break}}return null}function he(e,t,r){let s=5,g=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,s+1).map((f,i)=>{if(i===s)return`
|
6
|
+
...`;if(!f.location)return`
|
7
|
+
error: ${f.text}`;let{file:w,line:O,column:x}=f.location,N=f.pluginName?`[plugin: ${f.pluginName}] `:"";return`
|
8
|
+
${w}:${O}:${x}: ERROR: ${N}${f.text}`}).join(""),l=new Error(`${e}${g}`);return l.errors=t,l.warnings=r,l}function be(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Xe(e,t){if(e==null)return null;let r={},s=n(e,r,"file",y),g=n(e,r,"namespace",y),l=n(e,r,"line",ge),f=n(e,r,"column",ge),i=n(e,r,"length",ge),w=n(e,r,"lineText",y),O=n(e,r,"suggestion",y);return _(e,r,t),{file:s||"",namespace:g||"",line:l||0,column:f||0,length:i||0,lineText:w||"",suggestion:O||""}}function ce(e,t,r,s){let g=[],l=0;for(let f of e){let i={},w=n(f,i,"pluginName",y),O=n(f,i,"text",y),x=n(f,i,"location",_e),N=n(f,i,"notes",z),L=n(f,i,"detail",je),k=`in element ${l} of "${t}"`;_(f,i,k);let q=[];if(N)for(let ee of N){let Q={},te=n(ee,Q,"text",y),re=n(ee,Q,"location",_e);_(ee,Q,k),q.push({text:te||"",location:Xe(re,k)})}g.push({pluginName:w||s,text:O||"",location:Xe(x,k),notes:q,detail:r?r.store(L):-1}),l++}return g}function Se(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function mt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=fe(t)),r}}}var ht="0.14.3",bt=e=>xe().build(e),wt=()=>{throw new Error('The "serve" API only works in node')},vt=(e,t)=>xe().transform(e,t),Rt=(e,t)=>xe().formatMessages(e,t),Ot=(e,t)=>xe().analyzeMetafile(e,t),St=()=>{throw new Error('The "buildSync" API only works in node')},xt=()=>{throw new Error('The "transformSync" API only works in node')},kt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Et=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},we,Ie,xe=()=>{if(Ie)return Ie;throw we?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')},$t=e=>{e=Je(e||{});let t=e.wasmURL,r=e.worker!==!1;if(!t)throw new Error('Must provide the "wasmURL" option');if(t+="",we)throw new Error('Cannot call "initialize" more than once');return we=Dt(t,r),we.catch(()=>{we=void 0}),we},Dt=async(e,t)=>{let r=await fetch(e);if(!r.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);let s=await r.arrayBuffer(),g='{let global={};for(let o=self;o;o=Object.getPrototypeOf(o))for(let k of Object.getOwnPropertyNames(o))if(!(k in global))Object.defineProperty(global,k,{get:()=>self[k]});\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(()=>{if(typeof global=="undefined")if(typeof window!="undefined")window.global=window;else if(typeof self!="undefined")self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(!global.require&&typeof require!="undefined"&&(global.require=require),!global.fs&&global.require){const r=require("fs");typeof r=="object"&&r!==null&&Object.keys(r).length!==0&&(global.fs=Object.assign({},r,{write(n,s,i,l,d,u){if(i===0&&l===s.length&&d===null){if(n===process.stdout.fd){try{process.stdout.write(s,h=>h?u(h,0,null):u(null,l,s))}catch(h){u(h,0,null)}return}if(n===process.stderr.fd){try{process.stderr.write(s,h=>h?u(h,0,null):u(null,l,s))}catch(h){u(h,0,null)}return}}r.write(n,s,i,l,d,u)}}))}const a=()=>{const r=new Error("not implemented");return r.code="ENOSYS",r};if(!global.fs){let r="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){r+=g.decode(s);const i=r.lastIndexOf(`\n`);return i!=-1&&(console.log(r.substr(0,i)),r=r.substr(i+1)),s.length},write(n,s,i,l,d,u){if(i!==0||l!==s.length||d!==null){u(a());return}const h=this.writeSync(n,s);u(null,h)},chmod(n,s,i){i(a())},chown(n,s,i,l){l(a())},close(n,s){s(a())},fchmod(n,s,i){i(a())},fchown(n,s,i,l){l(a())},fstat(n,s){s(a())},fsync(n,s){s(null)},ftruncate(n,s,i){i(a())},lchown(n,s,i,l){l(a())},link(n,s,i){i(a())},lstat(n,s){s(a())},mkdir(n,s,i){i(a())},open(n,s,i,l){l(a())},read(n,s,i,l,d,u){u(a())},readdir(n,s){s(a())},readlink(n,s){s(a())},rename(n,s,i){i(a())},rmdir(n,s){s(a())},stat(n,s){s(a())},symlink(n,s,i){i(a())},truncate(n,s,i){i(a())},unlink(n,s){s(a())},utimes(n,s,i,l){l(a())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw a()},pid:-1,ppid:-1,umask(){throw a()},cwd(){throw a()},chdir(){throw a()}}),!global.crypto&&global.require){const r=require("crypto");global.crypto={getRandomValues(n){r.randomFillSync(n)}}}if(!global.crypto)throw new Error("global.crypto is not available, polyfill required (getRandomValues only)");if(global.performance||(global.performance={now(){const[r,n]=process.hrtime();return r*1e3+n/1e6}}),!global.TextEncoder&&global.require&&(global.TextEncoder=require("util").TextEncoder),!global.TextEncoder)throw new Error("global.TextEncoder is not available, polyfill required");if(!global.TextDecoder&&global.require&&(global.TextDecoder=require("util").TextDecoder),!global.TextDecoder)throw new Error("global.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");if(global.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 r=(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)=>{const o=2146959360;if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,o,!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 c=this._ids.get(t);c===void 0&&(c=this._idPool.pop(),c===void 0&&(c=this._values.length),this._values[c]=t,this._goRefCounts[c]=0,this._ids.set(t,c)),this._goRefCounts[c]++;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,o|m,!0),this.mem.setUint32(e,c,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},d=e=>{const t=n(e+0),o=n(e+8),c=new Array(o);for(let m=0;m<o;m++)c[m]=s(t+m*8);return c},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},h=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),c=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,c))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,r(e+8,(h+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();r(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)),c=d(e+32),m=Reflect.apply(o,t,c);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=d(e+16),c=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,c),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=d(e+16),c=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,c),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,r(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),r(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 c=o.subarray(0,t.length);t.set(c),r(e+40,c.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 c=o.subarray(0,t.length);t.set(c),r(e+40,c.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(r){if(!(r instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=r,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,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 h=4096+8192;if(n>=h)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(r){const n=this;return function(){const s={id:r,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}},typeof module!="undefined"&&global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const r=new Go;r.argv=process.argv.slice(2),r.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),r.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),r.importObject).then(n=>(process.on("exit",s=>{s===0&&!r.exited&&(r._pendingEvent={id:0},r._resume())}),r.run(n.instance))).catch(n=>{console.error(n),process.exit(1)})}})();\nonmessage=({data:c})=>{let y=new TextDecoder,s=global.fs,a="";s.writeSync=(e,t)=>{if(e===1)postMessage(t);else if(e===2){a+=y.decode(t);let n=a.split(`\n`);n.length>1&&console.log(n.slice(0,-1).join(`\n`)),a=n[n.length-1]}else throw new Error("Bad write");return t.length};let l=[],i,r=0;onmessage=({data:e})=>{e.length>0&&(l.push(e),i&&i())},s.read=(e,t,n,d,h,m)=>{if(e!==0||n!==0||d!==t.length||h!==null)throw new Error("Bad read");if(l.length===0){i=()=>s.read(e,t,n,d,h,m);return}let g=l[0],u=Math.max(0,Math.min(d,g.length-r));t.set(g.subarray(r,r+u),n),r+=u,r===g.length&&(l.shift(),r=0),m(null,u)};let o=new global.Go;o.argv=["","--service=0.14.3"],WebAssembly.instantiate(c,o.importObject).then(({instance:e})=>o.run(e))};}',l;if(t){let w=new Blob([g],{type:"text/javascript"});l=new Worker(URL.createObjectURL(w))}else{let O=new Function("postMessage",g+"var onmessage; return m => onmessage(m)")(x=>l.onmessage({data:x}));l={onmessage:null,postMessage:x=>O({data:x}),terminate(){}}}l.postMessage(s),l.onmessage=({data:w})=>f(w);let{readFromStdout:f,service:i}=He({writeToStdin(w){l.postMessage(w)},isSync:!1,isBrowser:!0,esbuild:Le});Ie={build:w=>new Promise((O,x)=>i.buildOrServe({callName:"build",refs:null,serveOptions:null,options:w,isTTY:!1,defaultWD:"/",callback:(N,L)=>N?x(N):O(L)})),transform:(w,O)=>new Promise((x,N)=>i.transform({callName:"transform",refs:null,input:w,options:O||{},isTTY:!1,fs:{readFile(L,k){k(new Error("Internal error"),null)},writeFile(L,k){k(null)}},callback:(L,k)=>L?N(L):x(k)})),formatMessages:(w,O)=>new Promise((x,N)=>i.formatMessages({callName:"formatMessages",refs:null,messages:w,options:O,callback:(L,k)=>L?N(L):x(k)})),analyzeMetafile:(w,O)=>new Promise((x,N)=>i.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof w=="string"?w:JSON.stringify(w),options:O,callback:(L,k)=>L?N(L):x(k)}))}};export{Ot as analyzeMetafile,Et as analyzeMetafileSync,bt as build,St as buildSync,Rt as formatMessages,kt as formatMessagesSync,$t as initialize,wt as serve,vt as transform,xt as transformSync,ht as version};
|
@@ -6,6 +6,6 @@
|
|
6
6
|
|
7
7
|
module.exports = {
|
8
8
|
"darwin-x64-LE.node": "7d3LaxNBHAfwmaRNQx92DwUVX0VawUMaC0ULCm20hRSLLbZCb9Nsd9subjZhHzYV1AUfUEToXyAe9ar+AT15tEf9B8QKVjx4EA+uM7uTOk3T3PT0/cCw+WV3v/uYuc7O9q/d3x2E0DQhJMNbF2+jbYQ8JhoRjvP2kRLC2Pzkwjw5aLx53a40gTHfrPl/D2vM6x9LtpeUuk3NbSOhWjLm+YHuHZq3IPMySk2V87MyL7Mvj62adtV0m+QtyrxupU61vL/AWbMcg1nOcqVJni3zZpU6RQ7HmLnKlt1S2Wz+vFtj+7tD1OkWeaJfd+KcicJ8oUl/HrJNy5bauy9j3TbU+2yepyl1uuVz2iXmrZf1is2qvnsgT5N5WaVW8/hY3tfP4jmLce701I3rkxNT9XcWNjyfrF/Kkjbk9MicYw3/O9Vy3vT0wLKN3FrJ40XN8i/kjZLLez9XuziSm54cciqG7Lb4vYkMLUzG90KYjIEuZSykZKPyXdMW72s2bBg3YXL8CXmdR+GbzzPDV3483X33PPo2szNQ74v2TpLp7YzH86g8Nr6mQdtFQj7w3Lxt6aLNrXu+WR66OsS72tKTy5yTOdkw6YvzstZCAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwzxTmpp+d+rAVRYW5aHCb/9F7hkSD7/mPzdit4san4sOvWnHj3s/iRvB9ONoR0283o8HX8fn87Fd88+VtFEVix0mZq27FvFsx332EJK0+d138FvN/u/kRfcksX9qf7NqbEtwnt/TuTUJrGtW6O7KbfO+AzF6MEkf3HuiI9iR1rac+751oWyx6QEhWbuvz3AEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADg/xFrdqcJyby43xcvbX+Wt9M0+R6BcFnWI7IWXyHo5fW4rMU641T5HkF9ffh+wpxS1WKuuWJ5vumycsUIbJPdGRZL2dcsn4h145nnBzrTLcewnBW2atpV05VLyrPlwFlidqVyO6jyvD8=",
|
9
|
-
"linux-x64-LE.node": "7VtfbBRFGJ+99trDlvYkKNeWlA1CAkiXa7HyL4WGSrsgNVhoQqJm3fa27cb7U3b3oMWgNQRjISQYn3zCx77wbGKilmAIb9Yn9cFYNMSSED0xmOJD15nd77vuTrockQc1mR/Z
|
9
|
+
"linux-x64-LE.node": "7VtfbBRFGJ+99trDlvYkKNeWlA1CAkiXa7HyL4WGSrsgNVhoQqJm3fa27cb7U3b3oMWgNQRjISQYn3zCx77wbGKilmAIb9Yn9cFYNMSSED0xmOJD15nd77vuTrockQc1mR/Z/e33ffObmZ3Z2e1wM+8eOtobkySCqCL7CbPeTPp2N/jV9nIS6ttN6ui5hTR7aatJNHbHw0wgX6aLB2yeD0lhDuq88mTwczxLwhzU1TBTAff+MKdikE0srIuBTgadvD/Ms1KYEyCvhmMG8uOZrz6vuwXpeN5Ewoxtf/yOk/kn5R0DXVR7bidhxvJepboa8vjA7h2A8qL6oSSFWQqUm4Rnpu+VQdYvs9Xe87ocXws2i/c3PBze1fbFax19o/W9p46v+3HdW7XB/sTngUz5VcN7+eG51oFK9yGv4M/RY80Kfiki/fYIfy89Nq7gH/TybyBNT/t2KwY0bTRXyGu2o1uOphHt8Il+LWNYxqhpO4Z1or8nW8gbJ/ShrOHHVo5owxO6NmLm9ax51iB5fdwsJ9RyhUwxa2in24lmTJgOyZpDw4pdUF4kfUcPH+zROpQOpXN5tLCz5P2zA/1ebDZXscg5Eu5vfA6TcF8pzj8HGcjdYT/a8wd8rgk8KwwLAX9VwF8K+IPvrcWAPx7wp6Cc2vLdCQgICAgICAgICPx/8Udj61/q+XsJ9VL8+x10mn9h1om5c+r5rxI3vLjb+RN133c3/0ypcYOXfowF7t+97bruFWbT6DUv+pKfH7U/R1u93HWd5Xs5/hmjPYvOM7SoEShqlTvfuGGKZXcDmKb/0EvfeZHR1iV1uqRe//WAen2xSpVuqt8sOWtpBp2QQcKdH/HKQT0rf6qrfwebcjw/qJ7vWsMu1ek7Tr16qUuhxsJhWu+FDD3djG+mtvQG1Yb0d8/QILsYpDraOEl1+tyiOl0sfenNLJpodLndyi0lICAgICAgICAgICAgIPDfhdRStY/9Fsl+C5NLrqtS7qY8TvkY5Q8oN/3uup9A+rWoOztApImk1FJfm7gi+b9Hr6fH3G+uK7MEDcnehtSRxroziSlyoHnvtp2bNqKeTtfJLZouGagH879Oj1nOn6KHQ49TtC7eb56HGpLvx3pW14iuExAQEBAQEBAQEBAQeCLgOsy5wLppBhu4vpzQp9Vg7gZdE4ZhHWcL2LhusxnndRBfz8UfLLkFxiVYbIlrMWdhESfO+1JgPwX2NHBdYN7IUF772e1TjIvjfLYWeB2wHA/7J6rD9ZwBXsXlt+T69T8J6V2wsR1LYB+B+EOwq/6l/sZ17DzS3Lrbvp6evfKWwaFi3inKe5SdSrqtfVfRM9vf6Ugr6Re2+m5CFHvMdixHHyJKvuAYymi+qIxbhXHDciYDrqGimc20mRniWWO6PUaUzGTensz57Fh+5LRh2WYhHzI0GrOMrM4SwtV41iGKmTfpmV4qowW4sI1hojjGBDVHaJgoxpg2Yuk5QxvLWMuWr9V0y9In/ZR4TYvQcybNhGbpl5LRHZ0oQ7ZNlOFCLmfknSfvhzoSXmMctX6fcOMF0crpo/YNIPg9G2x7x5/0WUQ9jr8Sp6+OKH8f3EOMG5/IOF7iMBYS3LjpgTEQ48Y78jT//1ac/TKMNdTj+EJu4Oof4/gkjN2yXR1mOaL+iFHIO8a9L5BnItoP7/8UxA5y7x/kVED/7Ar6t0lgT0Pg/YzcUqH/T3N6Ockx/53g+D1O350Mc7KC/iKnP5YMcyX9R5we9y8hfxuhR3zM6fF7hry6QvtdBX15j4Ac5u0V9Nc4fVoO85UK4/9TeMaruO8v7rNJROiR2RqmxoAev8+px9R/TcJ7Lcr7pECP+6PinA774QLcP+pxX8f8jke//5C/4/TljWvpx9Pf5vT43ZPTj75/xC/gQ/0W0G+J0PPvr3vgS3N+1G+L0Ad5pb8hBkD/oEL5fwM=",
|
10
10
|
"win32-x64-LE.node": "842awMDMwMDAAsT//zMw7GCAAAcGwuAGEPPJ7+Jj2MJ5VnEHo89ZxZCMzGKFgqL89KLEXIXkxLy8/BKFpFSFotI8hcw8BRf/YIXc/JRUPV5eLhWoGVdLWI9OFM2eBsOnarOmTwKzs6ZNANKhVfnTIXQ2lM4E00GZyRkg9bjcFuDKwJDSxsyQv4svASb2gUFJgZuJT5KBCephGBAAkw2MMDZQng0qBaPBAQLVw8SQwAjTBKMw+RCmgCIDQwyQzgHSGsgONGBg4MHibgEFBgYZBhKAAoqVGECvJLWiBKIM7jcUv0PkEvSKUhJLEhkYjjBCFTMhex4eBA56BRB1PFA/gNVxYKpjGAVDAnh0hqgIeHT6qHB4NL/RMD75ghUk2HxE4/B/1Qf8o+Ez3MEKRUwxWJnJC8RXgFgHWB7osCEKNQVYuaKSm4dcBullgsoGFVPkcgxWroDMuALnq1RVVaUkpYMUKkL1VkDUwcpLvVQIH1RuiiDMNgIX1EAxCYSYMUhshiKKG0xgfpNBiJkhl7uwcoyRj5GBzwnV////g2pCBgYnoH5QcQjDFkC+DRA7KELCIQQcduWZecZGuhVmJro+rnp5wOqNIS+xIDO+KDU9s7gktSgeWOOV5qTGlxmC3QgD2xRhhTJx8ZLC6FqRWRJQlJ+cWlzM4O0a5OfqY2ykl5KTQ2ECAPpDSgASD6Ng5AEA"
|
11
11
|
};
|
@@ -232,6 +232,7 @@ export interface TransformOptions extends CommonOptions {
|
|
232
232
|
jsxFragmentFactory?: string,
|
233
233
|
useDefineForClassFields?: boolean,
|
234
234
|
importsNotUsedAsValues?: 'remove' | 'preserve' | 'error',
|
235
|
+
preserveValueImports?: boolean,
|
235
236
|
},
|
236
237
|
};
|
237
238
|
|
@@ -267,6 +268,21 @@ export interface PluginBuild {
|
|
267
268
|
(OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void;
|
268
269
|
onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) =>
|
269
270
|
(OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void;
|
271
|
+
|
272
|
+
// This is a full copy of the esbuild library in case you need it
|
273
|
+
esbuild: {
|
274
|
+
serve: typeof serve,
|
275
|
+
build: typeof build,
|
276
|
+
buildSync: typeof buildSync,
|
277
|
+
transform: typeof transform,
|
278
|
+
transformSync: typeof transformSync,
|
279
|
+
formatMessages: typeof formatMessages,
|
280
|
+
formatMessagesSync: typeof formatMessagesSync,
|
281
|
+
analyzeMetafile: typeof analyzeMetafile,
|
282
|
+
analyzeMetafileSync: typeof analyzeMetafileSync,
|
283
|
+
initialize: typeof initialize,
|
284
|
+
version: typeof version,
|
285
|
+
};
|
270
286
|
}
|
271
287
|
|
272
288
|
export interface OnStartResult {
|
@@ -311,6 +327,7 @@ export interface OnResolveResult {
|
|
311
327
|
external?: boolean;
|
312
328
|
sideEffects?: boolean;
|
313
329
|
namespace?: string;
|
330
|
+
suffix?: string;
|
314
331
|
pluginData?: any;
|
315
332
|
|
316
333
|
watchFiles?: string[];
|
@@ -325,6 +342,7 @@ export interface OnLoadOptions {
|
|
325
342
|
export interface OnLoadArgs {
|
326
343
|
path: string;
|
327
344
|
namespace: string;
|
345
|
+
suffix: string;
|
328
346
|
pluginData: any;
|
329
347
|
}
|
330
348
|
|
@@ -715,8 +715,8 @@ function createChannel(streamIn) {
|
|
715
715
|
if (isFirstPacket) {
|
716
716
|
isFirstPacket = false;
|
717
717
|
let binaryVersion = String.fromCharCode(...bytes);
|
718
|
-
if (binaryVersion !== "0.14.
|
719
|
-
throw new Error(`Cannot start service: Host version "${"0.14.
|
718
|
+
if (binaryVersion !== "0.14.3") {
|
719
|
+
throw new Error(`Cannot start service: Host version "${"0.14.3"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
|
720
720
|
}
|
721
721
|
return;
|
722
722
|
}
|
@@ -762,17 +762,17 @@ function createChannel(streamIn) {
|
|
762
762
|
let promise = setup({
|
763
763
|
initialOptions,
|
764
764
|
onStart(callback2) {
|
765
|
-
let registeredText = `This error came from the "onStart" callback registered here
|
765
|
+
let registeredText = `This error came from the "onStart" callback registered here:`;
|
766
766
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
|
767
767
|
onStartCallbacks.push({ name, callback: callback2, note: registeredNote });
|
768
768
|
},
|
769
769
|
onEnd(callback2) {
|
770
|
-
let registeredText = `This error came from the "onEnd" callback registered here
|
770
|
+
let registeredText = `This error came from the "onEnd" callback registered here:`;
|
771
771
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd");
|
772
772
|
onEndCallbacks.push({ name, callback: callback2, note: registeredNote });
|
773
773
|
},
|
774
774
|
onResolve(options, callback2) {
|
775
|
-
let registeredText = `This error came from the "onResolve" callback registered here
|
775
|
+
let registeredText = `This error came from the "onResolve" callback registered here:`;
|
776
776
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve");
|
777
777
|
let keys2 = {};
|
778
778
|
let filter = getFlag(options, keys2, "filter", mustBeRegExp);
|
@@ -785,7 +785,7 @@ function createChannel(streamIn) {
|
|
785
785
|
plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" });
|
786
786
|
},
|
787
787
|
onLoad(options, callback2) {
|
788
|
-
let registeredText = `This error came from the "onLoad" callback registered here
|
788
|
+
let registeredText = `This error came from the "onLoad" callback registered here:`;
|
789
789
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad");
|
790
790
|
let keys2 = {};
|
791
791
|
let filter = getFlag(options, keys2, "filter", mustBeRegExp);
|
@@ -796,7 +796,8 @@ function createChannel(streamIn) {
|
|
796
796
|
let id = nextCallbackID++;
|
797
797
|
onLoadCallbacks[id] = { name, callback: callback2, note: registeredNote };
|
798
798
|
plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" });
|
799
|
-
}
|
799
|
+
},
|
800
|
+
esbuild: streamIn.esbuild
|
800
801
|
});
|
801
802
|
if (promise)
|
802
803
|
yield promise;
|
@@ -850,6 +851,7 @@ function createChannel(streamIn) {
|
|
850
851
|
let pluginName = getFlag(result, keys, "pluginName", mustBeString);
|
851
852
|
let path = getFlag(result, keys, "path", mustBeString);
|
852
853
|
let namespace = getFlag(result, keys, "namespace", mustBeString);
|
854
|
+
let suffix = getFlag(result, keys, "suffix", mustBeString);
|
853
855
|
let external = getFlag(result, keys, "external", mustBeBoolean);
|
854
856
|
let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean);
|
855
857
|
let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
|
@@ -865,6 +867,8 @@ function createChannel(streamIn) {
|
|
865
867
|
response.path = path;
|
866
868
|
if (namespace != null)
|
867
869
|
response.namespace = namespace;
|
870
|
+
if (suffix != null)
|
871
|
+
response.suffix = suffix;
|
868
872
|
if (external != null)
|
869
873
|
response.external = external;
|
870
874
|
if (sideEffects != null)
|
@@ -895,6 +899,7 @@ function createChannel(streamIn) {
|
|
895
899
|
let result = yield callback2({
|
896
900
|
path: request.path,
|
897
901
|
namespace: request.namespace,
|
902
|
+
suffix: request.suffix,
|
898
903
|
pluginData: stash.load(request.pluginData)
|
899
904
|
});
|
900
905
|
if (result != null) {
|
@@ -1494,7 +1499,7 @@ error: ${e.text}`;
|
|
1494
1499
|
let { file, line, column } = e.location;
|
1495
1500
|
let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : "";
|
1496
1501
|
return `
|
1497
|
-
${file}:${line}:${column}:
|
1502
|
+
${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
1498
1503
|
}).join("");
|
1499
1504
|
let error = new Error(`${text}${summary}`);
|
1500
1505
|
error.errors = errors;
|
@@ -1588,7 +1593,7 @@ function convertOutputFiles({ path, contents }) {
|
|
1588
1593
|
}
|
1589
1594
|
|
1590
1595
|
// lib/npm/browser.ts
|
1591
|
-
var version = "0.14.
|
1596
|
+
var version = "0.14.3";
|
1592
1597
|
var build = (options) => ensureServiceIsRunning().build(options);
|
1593
1598
|
var serve = () => {
|
1594
1599
|
throw new Error(`The "serve" API only works in node`);
|
@@ -2233,9 +2238,9 @@ var startRunningService = (wasmURL, useWorker) => __async(void 0, null, function
|
|
2233
2238
|
|
2234
2239
|
// The linker guarantees global data starts from at least wasmMinDataAddr.
|
2235
2240
|
// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.
|
2236
|
-
const wasmMinDataAddr = 4096 +
|
2241
|
+
const wasmMinDataAddr = 4096 + 8192;
|
2237
2242
|
if (offset >= wasmMinDataAddr) {
|
2238
|
-
throw new Error("command line
|
2243
|
+
throw new Error("total length of command line and environment variables exceeds limit");
|
2239
2244
|
}
|
2240
2245
|
|
2241
2246
|
this._inst.exports.run(argc, argv);
|
@@ -2345,7 +2350,7 @@ onmessage = ({ data: wasm }) => {
|
|
2345
2350
|
callback(null, count);
|
2346
2351
|
};
|
2347
2352
|
let go = new global.Go();
|
2348
|
-
go.argv = ["", \`--service=\${"0.14.
|
2353
|
+
go.argv = ["", \`--service=\${"0.14.3"}\`];
|
2349
2354
|
WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));
|
2350
2355
|
};}`;
|
2351
2356
|
let worker;
|
@@ -2369,7 +2374,8 @@ onmessage = ({ data: wasm }) => {
|
|
2369
2374
|
worker.postMessage(bytes);
|
2370
2375
|
},
|
2371
2376
|
isSync: false,
|
2372
|
-
isBrowser: true
|
2377
|
+
isBrowser: true,
|
2378
|
+
esbuild: exports
|
2373
2379
|
});
|
2374
2380
|
longLivedService = {
|
2375
2381
|
build: (options) => new Promise((resolve, reject) => service.buildOrServe({
|
@@ -1,10 +1,10 @@
|
|
1
1
|
(exports=>{
|
2
|
-
var Me=Object.defineProperty,tt=Object.defineProperties;var rt=Object.getOwnPropertyDescriptors;var Ue=Object.getOwnPropertySymbols;var nt=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable;var qe=(e,t,r)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Be=(e,t)=>{for(var r in t||(t={}))nt.call(t,r)&&qe(e,r,t[r]);if(Ue)for(var r of Ue(t))lt.call(t,r)&&qe(e,r,t[r]);return e},Te=(e,t)=>tt(e,rt(t)),it=e=>Me(e,"__esModule",{value:!0});var st=(e,t)=>{it(e);for(var r in t)Me(e,r,{get:t[r],enumerable:!0})};var ae=(e,t,r)=>new Promise((s,d)=>{var l=m=>{try{i(r.next(m))}catch(R){d(R)}},u=m=>{try{i(r.throw(m))}catch(R){d(R)}},i=m=>m.done?s(m.value):Promise.resolve(m.value).then(l,u);i((r=r.apply(e,t)).next())});st(exports,{analyzeMetafile:()=>vt,analyzeMetafileSync:()=>xt,build:()=>yt,buildSync:()=>Rt,formatMessages:()=>wt,formatMessagesSync:()=>St,initialize:()=>kt,serve:()=>ht,transform:()=>bt,transformSync:()=>Ot,version:()=>mt});function Ae(e){let t=s=>{if(s===null)r.write8(0);else if(typeof s=="boolean")r.write8(1),r.write8(+s);else if(typeof s=="number")r.write8(2),r.write32(s|0);else if(typeof s=="string")r.write8(3),r.write(ue(s));else if(s instanceof Uint8Array)r.write8(4),r.write(s);else if(s instanceof Array){r.write8(5),r.write32(s.length);for(let d of s)t(d)}else{let d=Object.keys(s);r.write8(6),r.write32(d.length);for(let l of d)r.write(ue(l)),t(s[l])}},r=new Fe;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),je(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function We(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return fe(r.read());case 4:return r.read();case 5:{let u=r.read32(),i=[];for(let m=0;m<u;m++)i.push(t());return i}case 6:{let u=r.read32(),i={};for(let m=0;m<u;m++)i[fe(r.read())]=t();return i}default:throw new Error("Invalid packet")}},r=new Fe(e),s=r.read32(),d=(s&1)==0;s>>>=1;let l=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:d,value:l}}var Fe=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let r=new Uint8Array((this.len+t)*2);r.set(this.buf),this.buf=r}return this.len+=t,this.len-t}write8(t){let r=this._write(1);this.buf[r]=t}write32(t){let r=this._write(4);je(this.buf,t,r)}write(t){let r=this._write(4+t.length);je(this.buf,t.length,r),this.buf.set(t,r+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return Ne(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},ue,fe;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;ue=r=>e.encode(r),fe=r=>t.decode(r)}else if(typeof Buffer!="undefined")ue=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},fe=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function Ne(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function je(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function ze(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Ie=()=>null,L=e=>typeof e=="boolean"?null:"a boolean",ot=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",h=e=>typeof e=="string"?null:"a string",Ke=e=>e instanceof RegExp?null:"a RegExp object",me=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Ce=e=>typeof e=="function"?null:"a function",z=e=>Array.isArray(e)?null:"an array",ye=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",at=e=>typeof e=="object"&&e!==null?null:"an array or an object",_e=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ve=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",ut=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",ct=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",ft=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,s){let d=e[r];if(t[r+""]=!0,d===void 0)return;let l=s(d);if(l!==null)throw new Error(`"${r}" must be ${l}`);return d}function _(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function Je(e){let t=Object.create(null),r=n(e,t,"wasmURL",h),s=n(e,t,"worker",L);return _(e,t,"in startService() call"),{wasmURL:r,worker:s}}function Oe(e,t,r,s,d){let l=n(t,r,"color",L),u=n(t,r,"logLevel",h),i=n(t,r,"logLimit",me);l!==void 0?e.push(`--color=${l}`):s&&e.push("--color=true"),e.push(`--log-level=${u||d}`),e.push(`--log-limit=${i||0}`)}function Ye(e,t,r){let s=n(t,r,"legalComments",h),d=n(t,r,"sourceRoot",h),l=n(t,r,"sourcesContent",L),u=n(t,r,"target",ct),i=n(t,r,"format",h),m=n(t,r,"globalName",h),R=n(t,r,"minify",L),x=n(t,r,"minifySyntax",L),F=n(t,r,"minifyWhitespace",L),U=n(t,r,"minifyIdentifiers",L),k=n(t,r,"charset",h),q=n(t,r,"treeShaking",L),ee=n(t,r,"ignoreAnnotations",L),G=n(t,r,"jsx",h),te=n(t,r,"jsxFactory",h),re=n(t,r,"jsxFragment",h),le=n(t,r,"define",ye),ie=n(t,r,"pure",z),ce=n(t,r,"keepNames",L);if(s&&e.push(`--legal-comments=${s}`),d!==void 0&&e.push(`--source-root=${d}`),l!==void 0&&e.push(`--sources-content=${l}`),u&&(Array.isArray(u)?e.push(`--target=${Array.from(u).map(ze).join(",")}`):e.push(`--target=${ze(u)}`)),i&&e.push(`--format=${i}`),m&&e.push(`--global-name=${m}`),R&&e.push("--minify"),x&&e.push("--minify-syntax"),F&&e.push("--minify-whitespace"),U&&e.push("--minify-identifiers"),k&&e.push(`--charset=${k}`),q!==void 0&&e.push(`--tree-shaking=${q}`),ee&&e.push("--ignore-annotations"),G&&e.push(`--jsx=${G}`),te&&e.push(`--jsx-factory=${te}`),re&&e.push(`--jsx-fragment=${re}`),le)for(let Q in le){if(Q.indexOf("=")>=0)throw new Error(`Invalid define: ${Q}`);e.push(`--define:${Q}=${le[Q]}`)}if(ie)for(let Q of ie)e.push(`--pure:${Q}`);ce&&e.push("--keep-names")}function dt(e,t,r,s,d){var w;let l=[],u=[],i=Object.create(null),m=null,R=null,x=null;Oe(l,t,i,r,s),Ye(l,t,i);let F=n(t,i,"sourcemap",Ve),U=n(t,i,"bundle",L),k=n(t,i,"watch",ot),q=n(t,i,"splitting",L),ee=n(t,i,"preserveSymlinks",L),G=n(t,i,"metafile",L),te=n(t,i,"outfile",h),re=n(t,i,"outdir",h),le=n(t,i,"outbase",h),ie=n(t,i,"platform",h),ce=n(t,i,"tsconfig",h),Q=n(t,i,"resolveExtensions",z),Re=n(t,i,"nodePaths",z),Ee=n(t,i,"mainFields",z),$e=n(t,i,"conditions",z),De=n(t,i,"external",z),g=n(t,i,"loader",ye),c=n(t,i,"outExtension",ye),o=n(t,i,"publicPath",h),p=n(t,i,"entryNames",h),j=n(t,i,"chunkNames",h),M=n(t,i,"assetNames",h),P=n(t,i,"inject",z),N=n(t,i,"banner",ye),D=n(t,i,"footer",ye),E=n(t,i,"entryPoints",at),O=n(t,i,"absWorkingDir",h),B=n(t,i,"stdin",ye),T=(w=n(t,i,"write",L))!=null?w:d,S=n(t,i,"allowOverwrite",L),$=n(t,i,"incremental",L)===!0;if(i.plugins=!0,_(t,i,`in ${e}() call`),F&&l.push(`--sourcemap${F===!0?"":`=${F}`}`),U&&l.push("--bundle"),S&&l.push("--allow-overwrite"),k)if(l.push("--watch"),typeof k=="boolean")x={};else{let a=Object.create(null),b=n(k,a,"onRebuild",Ce);_(k,a,`on "watch" in ${e}() call`),x={onRebuild:b}}if(q&&l.push("--splitting"),ee&&l.push("--preserve-symlinks"),G&&l.push("--metafile"),te&&l.push(`--outfile=${te}`),re&&l.push(`--outdir=${re}`),le&&l.push(`--outbase=${le}`),ie&&l.push(`--platform=${ie}`),ce&&l.push(`--tsconfig=${ce}`),Q){let a=[];for(let b of Q){if(b+="",b.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${b}`);a.push(b)}l.push(`--resolve-extensions=${a.join(",")}`)}if(o&&l.push(`--public-path=${o}`),p&&l.push(`--entry-names=${p}`),j&&l.push(`--chunk-names=${j}`),M&&l.push(`--asset-names=${M}`),Ee){let a=[];for(let b of Ee){if(b+="",b.indexOf(",")>=0)throw new Error(`Invalid main field: ${b}`);a.push(b)}l.push(`--main-fields=${a.join(",")}`)}if($e){let a=[];for(let b of $e){if(b+="",b.indexOf(",")>=0)throw new Error(`Invalid condition: ${b}`);a.push(b)}l.push(`--conditions=${a.join(",")}`)}if(De)for(let a of De)l.push(`--external:${a}`);if(N)for(let a in N){if(a.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${a}`);l.push(`--banner:${a}=${N[a]}`)}if(D)for(let a in D){if(a.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${a}`);l.push(`--footer:${a}=${D[a]}`)}if(P)for(let a of P)l.push(`--inject:${a}`);if(g)for(let a in g){if(a.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${a}`);l.push(`--loader:${a}=${g[a]}`)}if(c)for(let a in c){if(a.indexOf("=")>=0)throw new Error(`Invalid out extension: ${a}`);l.push(`--out-extension:${a}=${c[a]}`)}if(E)if(Array.isArray(E))for(let a of E)u.push(["",a+""]);else for(let[a,b]of Object.entries(E))u.push([a+"",b+""]);if(B){let a=Object.create(null),b=n(B,a,"contents",h),C=n(B,a,"resolveDir",h),f=n(B,a,"sourcefile",h),v=n(B,a,"loader",h);_(B,a,'in "stdin" object'),f&&l.push(`--sourcefile=${f}`),v&&l.push(`--loader=${v}`),C&&(R=C+""),m=b?b+"":""}let y=[];if(Re)for(let a of Re)a+="",y.push(a);return{entries:u,flags:l,write:T,stdinContents:m,stdinResolveDir:R,absWorkingDir:O,incremental:$,nodePaths:y,watch:x}}function pt(e,t,r,s){let d=[],l=Object.create(null);Oe(d,t,l,r,s),Ye(d,t,l);let u=n(t,l,"sourcemap",Ve),i=n(t,l,"tsconfigRaw",ut),m=n(t,l,"sourcefile",h),R=n(t,l,"loader",h),x=n(t,l,"banner",h),F=n(t,l,"footer",h);return _(t,l,`in ${e}() call`),u&&d.push(`--sourcemap=${u===!0?"external":u}`),i&&d.push(`--tsconfig-raw=${typeof i=="string"?i:JSON.stringify(i)}`),m&&d.push(`--sourcefile=${m}`),R&&d.push(`--loader=${R}`),x&&d.push(`--banner=${x}`),F&&d.push(`--footer=${F}`),d}function He(e){let t=new Map,r=new Map,s=new Map,d=new Map,l=0,u=!1,i=0,m=0,R=new Uint8Array(16*1024),x=0,F=g=>{let c=x+g.length;if(c>R.length){let p=new Uint8Array(c*2);p.set(R),R=p}R.set(g,x),x+=g.length;let o=0;for(;o+4<=x;){let p=Ne(R,o);if(o+4+p>x)break;o+=4,te(R.subarray(o,o+p)),o+=p}o>0&&(R.copyWithin(0,o,x),x-=o)},U=()=>{u=!0;for(let g of t.values())g("The service was stopped",null);t.clear();for(let g of d.values())g.onWait("The service was stopped");d.clear();for(let g of s.values())try{g(new Error("The service was stopped"),null)}catch(c){console.error(c)}s.clear()},k=(g,c,o)=>{if(u)return o("The service is no longer running",null);let p=i++;t.set(p,(j,M)=>{try{o(j,M)}finally{g&&g.unref()}}),g&&g.ref(),e.writeToStdin(Ae({id:p,isRequest:!0,value:c}))},q=(g,c)=>{if(u)throw new Error("The service is no longer running");e.writeToStdin(Ae({id:g,isRequest:!1,value:c}))},ee=(g,c)=>ae(this,null,function*(){try{switch(c.command){case"ping":{q(g,{});break}case"start":{let o=r.get(c.key);o?q(g,yield o(c)):q(g,{});break}case"resolve":{let o=r.get(c.key);o?q(g,yield o(c)):q(g,{});break}case"load":{let o=r.get(c.key);o?q(g,yield o(c)):q(g,{});break}case"serve-request":{let o=d.get(c.serveID);o&&o.onRequest&&o.onRequest(c.args),q(g,{});break}case"serve-wait":{let o=d.get(c.serveID);o&&o.onWait(c.error),q(g,{});break}case"watch-rebuild":{let o=s.get(c.watchID);try{o&&o(null,c.args)}catch(p){console.error(p)}q(g,{});break}default:throw new Error("Invalid command: "+c.command)}}catch(o){q(g,{errors:[he(o,e,null,void 0,"")]})}}),G=!0,te=g=>{if(G){G=!1;let o=String.fromCharCode(...g);if(o!=="0.14.0")throw new Error(`Cannot start service: Host version "0.14.0" does not match binary version ${JSON.stringify(o)}`);return}let c=We(g);if(c.isRequest)ee(c.id,c.value);else{let o=t.get(c.id);t.delete(c.id),c.value.error?o(c.value.error,{}):o(null,c.value)}},re=(g,c,o,p)=>ae(this,null,function*(){let j=[],M=[],P={},N={},D=0,E=0,O=[];c=[...c];for(let $ of c){let y={};if(typeof $!="object")throw new Error(`Plugin at index ${E} must be an object`);let w=n($,y,"name",h);if(typeof w!="string"||w==="")throw new Error(`Plugin at index ${E} is missing a name`);try{let a=n($,y,"setup",Ce);if(typeof a!="function")throw new Error("Plugin is missing a setup function");_($,y,`on plugin ${JSON.stringify(w)}`);let b={name:w,onResolve:[],onLoad:[]};E++;let C=a({initialOptions:g,onStart(f){let v='This error came from the "onStart" callback registered here',W=Se(new Error(v),e,"onStart");j.push({name:w,callback:f,note:W})},onEnd(f){let v='This error came from the "onEnd" callback registered here',W=Se(new Error(v),e,"onEnd");M.push({name:w,callback:f,note:W})},onResolve(f,v){let W='This error came from the "onResolve" callback registered here',I=Se(new Error(W),e,"onResolve"),K={},V=n(f,K,"filter",Ke),Y=n(f,K,"namespace",h);if(_(f,K,`in onResolve() call for plugin ${JSON.stringify(w)}`),V==null)throw new Error("onResolve() call is missing a filter");let J=D++;P[J]={name:w,callback:v,note:I},b.onResolve.push({id:J,filter:V.source,namespace:Y||""})},onLoad(f,v){let W='This error came from the "onLoad" callback registered here',I=Se(new Error(W),e,"onLoad"),K={},V=n(f,K,"filter",Ke),Y=n(f,K,"namespace",h);if(_(f,K,`in onLoad() call for plugin ${JSON.stringify(w)}`),V==null)throw new Error("onLoad() call is missing a filter");let J=D++;N[J]={name:w,callback:v,note:I},b.onLoad.push({id:J,filter:V.source,namespace:Y||""})}});C&&(yield C),O.push(b)}catch(a){return{ok:!1,error:a,pluginName:w}}}let B=$=>ae(this,null,function*(){switch($.command){case"start":{let y={errors:[],warnings:[]};return yield Promise.all(j.map(C=>ae(this,[C],function*({name:w,callback:a,note:b}){try{let f=yield a();if(f!=null){if(typeof f!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(w)} to return an object`);let v={},W=n(f,v,"errors",z),I=n(f,v,"warnings",z);_(f,v,`from onStart() callback in plugin ${JSON.stringify(w)}`),W!=null&&y.errors.push(...de(W,"errors",p,w)),I!=null&&y.warnings.push(...de(I,"warnings",p,w))}}catch(f){y.errors.push(he(f,e,p,b&&b(),w))}}))),y}case"resolve":{let y={},w="",a,b;for(let C of $.ids)try{({name:w,callback:a,note:b}=P[C]);let f=yield a({path:$.path,importer:$.importer,namespace:$.namespace,resolveDir:$.resolveDir,kind:$.kind,pluginData:p.load($.pluginData)});if(f!=null){if(typeof f!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(w)} to return an object`);let v={},W=n(f,v,"pluginName",h),I=n(f,v,"path",h),K=n(f,v,"namespace",h),V=n(f,v,"external",L),Y=n(f,v,"sideEffects",L),J=n(f,v,"pluginData",Ie),se=n(f,v,"errors",z),oe=n(f,v,"warnings",z),A=n(f,v,"watchFiles",z),H=n(f,v,"watchDirs",z);_(f,v,`from onResolve() callback in plugin ${JSON.stringify(w)}`),y.id=C,W!=null&&(y.pluginName=W),I!=null&&(y.path=I),K!=null&&(y.namespace=K),V!=null&&(y.external=V),Y!=null&&(y.sideEffects=Y),J!=null&&(y.pluginData=p.store(J)),se!=null&&(y.errors=de(se,"errors",p,w)),oe!=null&&(y.warnings=de(oe,"warnings",p,w)),A!=null&&(y.watchFiles=xe(A,"watchFiles")),H!=null&&(y.watchDirs=xe(H,"watchDirs"));break}}catch(f){return{id:C,errors:[he(f,e,p,b&&b(),w)]}}return y}case"load":{let y={},w="",a,b;for(let C of $.ids)try{({name:w,callback:a,note:b}=N[C]);let f=yield a({path:$.path,namespace:$.namespace,pluginData:p.load($.pluginData)});if(f!=null){if(typeof f!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(w)} to return an object`);let v={},W=n(f,v,"pluginName",h),I=n(f,v,"contents",ft),K=n(f,v,"resolveDir",h),V=n(f,v,"pluginData",Ie),Y=n(f,v,"loader",h),J=n(f,v,"errors",z),se=n(f,v,"warnings",z),oe=n(f,v,"watchFiles",z),A=n(f,v,"watchDirs",z);_(f,v,`from onLoad() callback in plugin ${JSON.stringify(w)}`),y.id=C,W!=null&&(y.pluginName=W),I instanceof Uint8Array?y.contents=I:I!=null&&(y.contents=ue(I)),K!=null&&(y.resolveDir=K),V!=null&&(y.pluginData=p.store(V)),Y!=null&&(y.loader=Y),J!=null&&(y.errors=de(J,"errors",p,w)),se!=null&&(y.warnings=de(se,"warnings",p,w)),oe!=null&&(y.watchFiles=xe(oe,"watchFiles")),A!=null&&(y.watchDirs=xe(A,"watchDirs"));break}}catch(f){return{id:C,errors:[he(f,e,p,b&&b(),w)]}}return y}default:throw new Error("Invalid command: "+$.command)}}),T=($,y,w)=>w();M.length>0&&(T=($,y,w)=>{(()=>ae(this,null,function*(){for(let{name:a,callback:b,note:C}of M)try{yield b($)}catch(f){$.errors.push(yield new Promise(v=>y(f,a,C&&C(),v)))}}))().then(w)});let S=0;return{ok:!0,requestPlugins:O,runOnEndCallbacks:T,pluginRefs:{ref(){++S==1&&r.set(o,B)},unref(){--S==0&&r.delete(o)}}}}),le=(g,c,o)=>{let p={},j=n(c,p,"port",me),M=n(c,p,"host",h),P=n(c,p,"servedir",h),N=n(c,p,"onRequest",Ce),D=l++,E,O=new Promise((B,T)=>{E=S=>{d.delete(D),S!==null?T(new Error(S)):B()}});return o.serve={serveID:D},_(c,p,"in serve() call"),j!==void 0&&(o.serve.port=j),M!==void 0&&(o.serve.host=M),P!==void 0&&(o.serve.servedir=P),d.set(D,{onRequest:N,onWait:E}),{wait:O,stop(){k(g,{command:"serve-stop",serveID:D},()=>{})}}},ie="warning",ce="silent",Q=g=>{let c=m++,o=Ge(),p,{refs:j,options:M,isTTY:P,callback:N}=g;if(typeof M=="object"){let O=M.plugins;if(O!==void 0){if(!Array.isArray(O))throw new Error('"plugins" must be an array');p=O}}let D=(O,B,T,S)=>{let $=[];try{Oe($,M,{},P,ie)}catch(w){}let y=he(O,e,o,T,B);k(j,{command:"error",flags:$,error:y},()=>{y.detail=o.load(y.detail),S(y)})},E=(O,B)=>{D(O,B,void 0,T=>{N(be("Build failed",[T],[]),null)})};if(p&&p.length>0){if(e.isSync)return E(new Error("Cannot use plugins in synchronous API calls"),"");re(M,p,c,o).then(O=>{if(!O.ok)E(O.error,O.pluginName);else try{Re(Te(Be({},g),{key:c,details:o,logPluginError:D,requestPlugins:O.requestPlugins,runOnEndCallbacks:O.runOnEndCallbacks,pluginRefs:O.pluginRefs}))}catch(B){E(B,"")}},O=>E(O,""))}else try{Re(Te(Be({},g),{key:c,details:o,logPluginError:D,requestPlugins:null,runOnEndCallbacks:(O,B,T)=>T(),pluginRefs:null}))}catch(O){E(O,"")}},Re=({callName:g,refs:c,serveOptions:o,options:p,isTTY:j,defaultWD:M,callback:P,key:N,details:D,logPluginError:E,requestPlugins:O,runOnEndCallbacks:B,pluginRefs:T})=>{let S={ref(){T&&T.ref(),c&&c.ref()},unref(){T&&T.unref(),c&&c.unref()}},$=!e.isBrowser,{entries:y,flags:w,write:a,stdinContents:b,stdinResolveDir:C,absWorkingDir:f,incremental:v,nodePaths:W,watch:I}=dt(g,p,j,ie,$),K={command:"build",key:N,entries:y,flags:w,write:a,stdinContents:b,stdinResolveDir:C,absWorkingDir:f||M,incremental:v,nodePaths:W};O&&(K.plugins=O);let V=o&&le(S,o,K),Y,J,se=(A,H)=>{A.outputFiles&&(H.outputFiles=A.outputFiles.map(gt)),A.metafile&&(H.metafile=JSON.parse(A.metafile)),A.writeToStdout!==void 0&&console.log(fe(A.writeToStdout).replace(/\n$/,""))},oe=(A,H)=>{let X={errors:we(A.errors,D),warnings:we(A.warnings,D)};se(A,X),B(X,E,()=>{if(X.errors.length>0)return H(be("Build failed",X.errors,X.warnings),null);if(A.rebuildID!==void 0){if(!Y){let ne=!1;Y=()=>new Promise((pe,ge)=>{if(ne||u)throw new Error("Cannot rebuild");k(S,{command:"rebuild",rebuildID:A.rebuildID},(Z,Ze)=>{if(Z)return H(be("Build failed",[{pluginName:"",text:Z,location:null,notes:[],detail:void 0}],[]),null);oe(Ze,(Pe,et)=>{Pe?ge(Pe):pe(et)})})}),S.ref(),Y.dispose=()=>{ne||(ne=!0,k(S,{command:"rebuild-dispose",rebuildID:A.rebuildID},()=>{}),S.unref())}}X.rebuild=Y}if(A.watchID!==void 0){if(!J){let ne=!1;S.ref(),J=()=>{ne||(ne=!0,s.delete(A.watchID),k(S,{command:"watch-stop",watchID:A.watchID},()=>{}),S.unref())},I&&s.set(A.watchID,(pe,ge)=>{if(pe){I.onRebuild&&I.onRebuild(pe,null);return}let Z={errors:we(ge.errors,D),warnings:we(ge.warnings,D)};se(ge,Z),B(Z,E,()=>{if(Z.errors.length>0){I.onRebuild&&I.onRebuild(be("Build failed",Z.errors,Z.warnings),null);return}ge.rebuildID!==void 0&&(Z.rebuild=Y),Z.stop=J,I.onRebuild&&I.onRebuild(null,Z)})})}X.stop=J}H(null,X)})};if(a&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(v&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(I&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');k(S,K,(A,H)=>{if(A)return P(new Error(A),null);if(V){let X=H,ne=!1;S.ref();let pe={port:X.port,host:X.host,wait:V.wait,stop(){ne||(ne=!0,V.stop(),S.unref())}};return S.ref(),V.wait.then(S.unref,S.unref),P(null,pe)}return oe(H,P)})};return{readFromStdout:F,afterClose:U,service:{buildOrServe:Q,transform:({callName:g,refs:c,input:o,options:p,isTTY:j,fs:M,callback:P})=>{let N=Ge(),D=E=>{try{if(typeof o!="string")throw new Error('The input to "transform" must be a string');let O=pt(g,p,j,ce);k(c,{command:"transform",flags:O,inputFS:E!==null,input:E!==null?E:o},(T,S)=>{if(T)return P(new Error(T),null);let $=we(S.errors,N),y=we(S.warnings,N),w=1,a=()=>--w==0&&P(null,{warnings:y,code:S.code,map:S.map});if($.length>0)return P(be("Transform failed",$,y),null);S.codeFS&&(w++,M.readFile(S.code,(b,C)=>{b!==null?P(b,null):(S.code=C,a())})),S.mapFS&&(w++,M.readFile(S.map,(b,C)=>{b!==null?P(b,null):(S.map=C,a())})),a()})}catch(O){let B=[];try{Oe(B,p,{},j,ce)}catch(S){}let T=he(O,e,N,void 0,"");k(c,{command:"error",flags:B,error:T},()=>{T.detail=N.load(T.detail),P(be("Transform failed",[T],[]),null)})}};if(typeof o=="string"&&o.length>1024*1024){let E=D;D=()=>M.writeFile(o,E)}D(null)},formatMessages:({callName:g,refs:c,messages:o,options:p,callback:j})=>{let M=de(o,"messages",null,"");if(!p)throw new Error(`Missing second argument in ${g}() call`);let P={},N=n(p,P,"kind",h),D=n(p,P,"color",L),E=n(p,P,"terminalWidth",me);if(_(p,P,`in ${g}() call`),N===void 0)throw new Error(`Missing "kind" in ${g}() call`);if(N!=="error"&&N!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${g}() call`);let O={command:"format-msgs",messages:M,isWarning:N==="warning"};D!==void 0&&(O.color=D),E!==void 0&&(O.terminalWidth=E),k(c,O,(B,T)=>{if(B)return j(new Error(B),null);j(null,T.messages)})},analyzeMetafile:({callName:g,refs:c,metafile:o,options:p,callback:j})=>{p===void 0&&(p={});let M={},P=n(p,M,"color",L),N=n(p,M,"verbose",L);_(p,M,`in ${g}() call`);let D={command:"analyze-metafile",metafile:o};P!==void 0&&(D.color=P),N!==void 0&&(D.verbose=N),k(c,D,(E,O)=>{if(E)return j(new Error(E),null);j(null,O.result)})}}}}function Ge(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let s=t++;return e.set(s,r),s}}}function Se(e,t,r){let s,d=!1;return()=>{if(d)return s;d=!0;try{let l=(e.stack+"").split(`
|
2
|
+
var Me=Object.defineProperty,tt=Object.defineProperties;var rt=Object.getOwnPropertyDescriptors;var Ue=Object.getOwnPropertySymbols;var nt=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable;var qe=(e,t,r)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Be=(e,t)=>{for(var r in t||(t={}))nt.call(t,r)&&qe(e,r,t[r]);if(Ue)for(var r of Ue(t))lt.call(t,r)&&qe(e,r,t[r]);return e},Te=(e,t)=>tt(e,rt(t)),it=e=>Me(e,"__esModule",{value:!0});var st=(e,t)=>{it(e);for(var r in t)Me(e,r,{get:t[r],enumerable:!0})};var ae=(e,t,r)=>new Promise((s,d)=>{var l=m=>{try{i(r.next(m))}catch(R){d(R)}},u=m=>{try{i(r.throw(m))}catch(R){d(R)}},i=m=>m.done?s(m.value):Promise.resolve(m.value).then(l,u);i((r=r.apply(e,t)).next())});st(exports,{analyzeMetafile:()=>Ot,analyzeMetafileSync:()=>Et,build:()=>bt,buildSync:()=>St,formatMessages:()=>Rt,formatMessagesSync:()=>kt,initialize:()=>$t,serve:()=>wt,transform:()=>vt,transformSync:()=>xt,version:()=>ht});function Ae(e){let t=s=>{if(s===null)r.write8(0);else if(typeof s=="boolean")r.write8(1),r.write8(+s);else if(typeof s=="number")r.write8(2),r.write32(s|0);else if(typeof s=="string")r.write8(3),r.write(ue(s));else if(s instanceof Uint8Array)r.write8(4),r.write(s);else if(s instanceof Array){r.write8(5),r.write32(s.length);for(let d of s)t(d)}else{let d=Object.keys(s);r.write8(6),r.write32(d.length);for(let l of d)r.write(ue(l)),t(s[l])}},r=new Fe;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),je(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function We(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ce(r.read());case 4:return r.read();case 5:{let u=r.read32(),i=[];for(let m=0;m<u;m++)i.push(t());return i}case 6:{let u=r.read32(),i={};for(let m=0;m<u;m++)i[ce(r.read())]=t();return i}default:throw new Error("Invalid packet")}},r=new Fe(e),s=r.read32(),d=(s&1)==0;s>>>=1;let l=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:d,value:l}}var Fe=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let r=new Uint8Array((this.len+t)*2);r.set(this.buf),this.buf=r}return this.len+=t,this.len-t}write8(t){let r=this._write(1);this.buf[r]=t}write32(t){let r=this._write(4);je(this.buf,t,r)}write(t){let r=this._write(4+t.length);je(this.buf,t.length,r),this.buf.set(t,r+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return Ne(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},ue,ce;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;ue=r=>e.encode(r),ce=r=>t.decode(r)}else if(typeof Buffer!="undefined")ue=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},ce=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function Ne(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function je(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function ze(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Ce=()=>null,L=e=>typeof e=="boolean"?null:"a boolean",at=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",h=e=>typeof e=="string"?null:"a string",Ke=e=>e instanceof RegExp?null:"a RegExp object",me=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Ie=e=>typeof e=="function"?null:"a function",z=e=>Array.isArray(e)?null:"an array",ye=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",ut=e=>typeof e=="object"&&e!==null?null:"an array or an object",_e=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ve=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",ft=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",ct=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",dt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,s){let d=e[r];if(t[r+""]=!0,d===void 0)return;let l=s(d);if(l!==null)throw new Error(`"${r}" must be ${l}`);return d}function _(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function Je(e){let t=Object.create(null),r=n(e,t,"wasmURL",h),s=n(e,t,"worker",L);return _(e,t,"in startService() call"),{wasmURL:r,worker:s}}function Oe(e,t,r,s,d){let l=n(t,r,"color",L),u=n(t,r,"logLevel",h),i=n(t,r,"logLimit",me);l!==void 0?e.push(`--color=${l}`):s&&e.push("--color=true"),e.push(`--log-level=${u||d}`),e.push(`--log-limit=${i||0}`)}function Ye(e,t,r){let s=n(t,r,"legalComments",h),d=n(t,r,"sourceRoot",h),l=n(t,r,"sourcesContent",L),u=n(t,r,"target",ct),i=n(t,r,"format",h),m=n(t,r,"globalName",h),R=n(t,r,"minify",L),x=n(t,r,"minifySyntax",L),F=n(t,r,"minifyWhitespace",L),U=n(t,r,"minifyIdentifiers",L),k=n(t,r,"charset",h),q=n(t,r,"treeShaking",L),ee=n(t,r,"ignoreAnnotations",L),Q=n(t,r,"jsx",h),te=n(t,r,"jsxFactory",h),re=n(t,r,"jsxFragment",h),le=n(t,r,"define",ye),ie=n(t,r,"pure",z),fe=n(t,r,"keepNames",L);if(s&&e.push(`--legal-comments=${s}`),d!==void 0&&e.push(`--source-root=${d}`),l!==void 0&&e.push(`--sources-content=${l}`),u&&(Array.isArray(u)?e.push(`--target=${Array.from(u).map(ze).join(",")}`):e.push(`--target=${ze(u)}`)),i&&e.push(`--format=${i}`),m&&e.push(`--global-name=${m}`),R&&e.push("--minify"),x&&e.push("--minify-syntax"),F&&e.push("--minify-whitespace"),U&&e.push("--minify-identifiers"),k&&e.push(`--charset=${k}`),q!==void 0&&e.push(`--tree-shaking=${q}`),ee&&e.push("--ignore-annotations"),Q&&e.push(`--jsx=${Q}`),te&&e.push(`--jsx-factory=${te}`),re&&e.push(`--jsx-fragment=${re}`),le)for(let X in le){if(X.indexOf("=")>=0)throw new Error(`Invalid define: ${X}`);e.push(`--define:${X}=${le[X]}`)}if(ie)for(let X of ie)e.push(`--pure:${X}`);fe&&e.push("--keep-names")}function pt(e,t,r,s,d){var w;let l=[],u=[],i=Object.create(null),m=null,R=null,x=null;Oe(l,t,i,r,s),Ye(l,t,i);let F=n(t,i,"sourcemap",Ve),U=n(t,i,"bundle",L),k=n(t,i,"watch",at),q=n(t,i,"splitting",L),ee=n(t,i,"preserveSymlinks",L),Q=n(t,i,"metafile",L),te=n(t,i,"outfile",h),re=n(t,i,"outdir",h),le=n(t,i,"outbase",h),ie=n(t,i,"platform",h),fe=n(t,i,"tsconfig",h),X=n(t,i,"resolveExtensions",z),Re=n(t,i,"nodePaths",z),Ee=n(t,i,"mainFields",z),$e=n(t,i,"conditions",z),De=n(t,i,"external",z),g=n(t,i,"loader",ye),f=n(t,i,"outExtension",ye),o=n(t,i,"publicPath",h),p=n(t,i,"entryNames",h),j=n(t,i,"chunkNames",h),M=n(t,i,"assetNames",h),P=n(t,i,"inject",z),N=n(t,i,"banner",ye),D=n(t,i,"footer",ye),$=n(t,i,"entryPoints",ut),O=n(t,i,"absWorkingDir",h),B=n(t,i,"stdin",ye),T=(w=n(t,i,"write",L))!=null?w:d,S=n(t,i,"allowOverwrite",L),E=n(t,i,"incremental",L)===!0;if(i.plugins=!0,_(t,i,`in ${e}() call`),F&&l.push(`--sourcemap${F===!0?"":`=${F}`}`),U&&l.push("--bundle"),S&&l.push("--allow-overwrite"),k)if(l.push("--watch"),typeof k=="boolean")x={};else{let a=Object.create(null),b=n(k,a,"onRebuild",Ie);_(k,a,`on "watch" in ${e}() call`),x={onRebuild:b}}if(q&&l.push("--splitting"),ee&&l.push("--preserve-symlinks"),Q&&l.push("--metafile"),te&&l.push(`--outfile=${te}`),re&&l.push(`--outdir=${re}`),le&&l.push(`--outbase=${le}`),ie&&l.push(`--platform=${ie}`),fe&&l.push(`--tsconfig=${fe}`),X){let a=[];for(let b of X){if(b+="",b.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${b}`);a.push(b)}l.push(`--resolve-extensions=${a.join(",")}`)}if(o&&l.push(`--public-path=${o}`),p&&l.push(`--entry-names=${p}`),j&&l.push(`--chunk-names=${j}`),M&&l.push(`--asset-names=${M}`),Ee){let a=[];for(let b of Ee){if(b+="",b.indexOf(",")>=0)throw new Error(`Invalid main field: ${b}`);a.push(b)}l.push(`--main-fields=${a.join(",")}`)}if($e){let a=[];for(let b of $e){if(b+="",b.indexOf(",")>=0)throw new Error(`Invalid condition: ${b}`);a.push(b)}l.push(`--conditions=${a.join(",")}`)}if(De)for(let a of De)l.push(`--external:${a}`);if(N)for(let a in N){if(a.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${a}`);l.push(`--banner:${a}=${N[a]}`)}if(D)for(let a in D){if(a.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${a}`);l.push(`--footer:${a}=${D[a]}`)}if(P)for(let a of P)l.push(`--inject:${a}`);if(g)for(let a in g){if(a.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${a}`);l.push(`--loader:${a}=${g[a]}`)}if(f)for(let a in f){if(a.indexOf("=")>=0)throw new Error(`Invalid out extension: ${a}`);l.push(`--out-extension:${a}=${f[a]}`)}if($)if(Array.isArray($))for(let a of $)u.push(["",a+""]);else for(let[a,b]of Object.entries($))u.push([a+"",b+""]);if(B){let a=Object.create(null),b=n(B,a,"contents",h),I=n(B,a,"resolveDir",h),c=n(B,a,"sourcefile",h),v=n(B,a,"loader",h);_(B,a,'in "stdin" object'),c&&l.push(`--sourcefile=${c}`),v&&l.push(`--loader=${v}`),I&&(R=I+""),m=b?b+"":""}let y=[];if(Re)for(let a of Re)a+="",y.push(a);return{entries:u,flags:l,write:T,stdinContents:m,stdinResolveDir:R,absWorkingDir:O,incremental:E,nodePaths:y,watch:x}}function gt(e,t,r,s){let d=[],l=Object.create(null);Oe(d,t,l,r,s),Ye(d,t,l);let u=n(t,l,"sourcemap",Ve),i=n(t,l,"tsconfigRaw",ft),m=n(t,l,"sourcefile",h),R=n(t,l,"loader",h),x=n(t,l,"banner",h),F=n(t,l,"footer",h);return _(t,l,`in ${e}() call`),u&&d.push(`--sourcemap=${u===!0?"external":u}`),i&&d.push(`--tsconfig-raw=${typeof i=="string"?i:JSON.stringify(i)}`),m&&d.push(`--sourcefile=${m}`),R&&d.push(`--loader=${R}`),x&&d.push(`--banner=${x}`),F&&d.push(`--footer=${F}`),d}function He(e){let t=new Map,r=new Map,s=new Map,d=new Map,l=0,u=!1,i=0,m=0,R=new Uint8Array(16*1024),x=0,F=g=>{let f=x+g.length;if(f>R.length){let p=new Uint8Array(f*2);p.set(R),R=p}R.set(g,x),x+=g.length;let o=0;for(;o+4<=x;){let p=Ne(R,o);if(o+4+p>x)break;o+=4,te(R.subarray(o,o+p)),o+=p}o>0&&(R.copyWithin(0,o,x),x-=o)},U=()=>{u=!0;for(let g of t.values())g("The service was stopped",null);t.clear();for(let g of d.values())g.onWait("The service was stopped");d.clear();for(let g of s.values())try{g(new Error("The service was stopped"),null)}catch(f){console.error(f)}s.clear()},k=(g,f,o)=>{if(u)return o("The service is no longer running",null);let p=i++;t.set(p,(j,M)=>{try{o(j,M)}finally{g&&g.unref()}}),g&&g.ref(),e.writeToStdin(Ae({id:p,isRequest:!0,value:f}))},q=(g,f)=>{if(u)throw new Error("The service is no longer running");e.writeToStdin(Ae({id:g,isRequest:!1,value:f}))},ee=(g,f)=>ae(this,null,function*(){try{switch(f.command){case"ping":{q(g,{});break}case"start":{let o=r.get(f.key);o?q(g,yield o(f)):q(g,{});break}case"resolve":{let o=r.get(f.key);o?q(g,yield o(f)):q(g,{});break}case"load":{let o=r.get(f.key);o?q(g,yield o(f)):q(g,{});break}case"serve-request":{let o=d.get(f.serveID);o&&o.onRequest&&o.onRequest(f.args),q(g,{});break}case"serve-wait":{let o=d.get(f.serveID);o&&o.onWait(f.error),q(g,{});break}case"watch-rebuild":{let o=s.get(f.watchID);try{o&&o(null,f.args)}catch(p){console.error(p)}q(g,{});break}default:throw new Error("Invalid command: "+f.command)}}catch(o){q(g,{errors:[he(o,e,null,void 0,"")]})}}),Q=!0,te=g=>{if(Q){Q=!1;let o=String.fromCharCode(...g);if(o!=="0.14.3")throw new Error(`Cannot start service: Host version "0.14.3" does not match binary version ${JSON.stringify(o)}`);return}let f=We(g);if(f.isRequest)ee(f.id,f.value);else{let o=t.get(f.id);t.delete(f.id),f.value.error?o(f.value.error,{}):o(null,f.value)}},re=(g,f,o,p)=>ae(this,null,function*(){let j=[],M=[],P={},N={},D=0,$=0,O=[];f=[...f];for(let E of f){let y={};if(typeof E!="object")throw new Error(`Plugin at index ${$} must be an object`);let w=n(E,y,"name",h);if(typeof w!="string"||w==="")throw new Error(`Plugin at index ${$} is missing a name`);try{let a=n(E,y,"setup",Ie);if(typeof a!="function")throw new Error("Plugin is missing a setup function");_(E,y,`on plugin ${JSON.stringify(w)}`);let b={name:w,onResolve:[],onLoad:[]};$++;let I=a({initialOptions:g,onStart(c){let v='This error came from the "onStart" callback registered here:',W=Se(new Error(v),e,"onStart");j.push({name:w,callback:c,note:W})},onEnd(c){let v='This error came from the "onEnd" callback registered here:',W=Se(new Error(v),e,"onEnd");M.push({name:w,callback:c,note:W})},onResolve(c,v){let W='This error came from the "onResolve" callback registered here:',C=Se(new Error(W),e,"onResolve"),K={},V=n(c,K,"filter",Ke),Y=n(c,K,"namespace",h);if(_(c,K,`in onResolve() call for plugin ${JSON.stringify(w)}`),V==null)throw new Error("onResolve() call is missing a filter");let J=D++;P[J]={name:w,callback:v,note:C},b.onResolve.push({id:J,filter:V.source,namespace:Y||""})},onLoad(c,v){let W='This error came from the "onLoad" callback registered here:',C=Se(new Error(W),e,"onLoad"),K={},V=n(c,K,"filter",Ke),Y=n(c,K,"namespace",h);if(_(c,K,`in onLoad() call for plugin ${JSON.stringify(w)}`),V==null)throw new Error("onLoad() call is missing a filter");let J=D++;N[J]={name:w,callback:v,note:C},b.onLoad.push({id:J,filter:V.source,namespace:Y||""})},esbuild:e.esbuild});I&&(yield I),O.push(b)}catch(a){return{ok:!1,error:a,pluginName:w}}}let B=E=>ae(this,null,function*(){switch(E.command){case"start":{let y={errors:[],warnings:[]};return yield Promise.all(j.map(I=>ae(this,[I],function*({name:w,callback:a,note:b}){try{let c=yield a();if(c!=null){if(typeof c!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(w)} to return an object`);let v={},W=n(c,v,"errors",z),C=n(c,v,"warnings",z);_(c,v,`from onStart() callback in plugin ${JSON.stringify(w)}`),W!=null&&y.errors.push(...de(W,"errors",p,w)),C!=null&&y.warnings.push(...de(C,"warnings",p,w))}}catch(c){y.errors.push(he(c,e,p,b&&b(),w))}}))),y}case"resolve":{let y={},w="",a,b;for(let I of E.ids)try{({name:w,callback:a,note:b}=P[I]);let c=yield a({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:p.load(E.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(w)} to return an object`);let v={},W=n(c,v,"pluginName",h),C=n(c,v,"path",h),K=n(c,v,"namespace",h),V=n(c,v,"suffix",h),Y=n(c,v,"external",L),J=n(c,v,"sideEffects",L),se=n(c,v,"pluginData",Ce),oe=n(c,v,"errors",z),A=n(c,v,"warnings",z),G=n(c,v,"watchFiles",z),H=n(c,v,"watchDirs",z);_(c,v,`from onResolve() callback in plugin ${JSON.stringify(w)}`),y.id=I,W!=null&&(y.pluginName=W),C!=null&&(y.path=C),K!=null&&(y.namespace=K),V!=null&&(y.suffix=V),Y!=null&&(y.external=Y),J!=null&&(y.sideEffects=J),se!=null&&(y.pluginData=p.store(se)),oe!=null&&(y.errors=de(oe,"errors",p,w)),A!=null&&(y.warnings=de(A,"warnings",p,w)),G!=null&&(y.watchFiles=xe(G,"watchFiles")),H!=null&&(y.watchDirs=xe(H,"watchDirs"));break}}catch(c){return{id:I,errors:[he(c,e,p,b&&b(),w)]}}return y}case"load":{let y={},w="",a,b;for(let I of E.ids)try{({name:w,callback:a,note:b}=N[I]);let c=yield a({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:p.load(E.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(w)} to return an object`);let v={},W=n(c,v,"pluginName",h),C=n(c,v,"contents",dt),K=n(c,v,"resolveDir",h),V=n(c,v,"pluginData",Ce),Y=n(c,v,"loader",h),J=n(c,v,"errors",z),se=n(c,v,"warnings",z),oe=n(c,v,"watchFiles",z),A=n(c,v,"watchDirs",z);_(c,v,`from onLoad() callback in plugin ${JSON.stringify(w)}`),y.id=I,W!=null&&(y.pluginName=W),C instanceof Uint8Array?y.contents=C:C!=null&&(y.contents=ue(C)),K!=null&&(y.resolveDir=K),V!=null&&(y.pluginData=p.store(V)),Y!=null&&(y.loader=Y),J!=null&&(y.errors=de(J,"errors",p,w)),se!=null&&(y.warnings=de(se,"warnings",p,w)),oe!=null&&(y.watchFiles=xe(oe,"watchFiles")),A!=null&&(y.watchDirs=xe(A,"watchDirs"));break}}catch(c){return{id:I,errors:[he(c,e,p,b&&b(),w)]}}return y}default:throw new Error("Invalid command: "+E.command)}}),T=(E,y,w)=>w();M.length>0&&(T=(E,y,w)=>{(()=>ae(this,null,function*(){for(let{name:a,callback:b,note:I}of M)try{yield b(E)}catch(c){E.errors.push(yield new Promise(v=>y(c,a,I&&I(),v)))}}))().then(w)});let S=0;return{ok:!0,requestPlugins:O,runOnEndCallbacks:T,pluginRefs:{ref(){++S==1&&r.set(o,B)},unref(){--S==0&&r.delete(o)}}}}),le=(g,f,o)=>{let p={},j=n(f,p,"port",me),M=n(f,p,"host",h),P=n(f,p,"servedir",h),N=n(f,p,"onRequest",Ie),D=l++,$,O=new Promise((B,T)=>{$=S=>{d.delete(D),S!==null?T(new Error(S)):B()}});return o.serve={serveID:D},_(f,p,"in serve() call"),j!==void 0&&(o.serve.port=j),M!==void 0&&(o.serve.host=M),P!==void 0&&(o.serve.servedir=P),d.set(D,{onRequest:N,onWait:$}),{wait:O,stop(){k(g,{command:"serve-stop",serveID:D},()=>{})}}},ie="warning",fe="silent",X=g=>{let f=m++,o=Ge(),p,{refs:j,options:M,isTTY:P,callback:N}=g;if(typeof M=="object"){let O=M.plugins;if(O!==void 0){if(!Array.isArray(O))throw new Error('"plugins" must be an array');p=O}}let D=(O,B,T,S)=>{let E=[];try{Oe(E,M,{},P,ie)}catch(w){}let y=he(O,e,o,T,B);k(j,{command:"error",flags:E,error:y},()=>{y.detail=o.load(y.detail),S(y)})},$=(O,B)=>{D(O,B,void 0,T=>{N(be("Build failed",[T],[]),null)})};if(p&&p.length>0){if(e.isSync)return $(new Error("Cannot use plugins in synchronous API calls"),"");re(M,p,f,o).then(O=>{if(!O.ok)$(O.error,O.pluginName);else try{Re(Te(Be({},g),{key:f,details:o,logPluginError:D,requestPlugins:O.requestPlugins,runOnEndCallbacks:O.runOnEndCallbacks,pluginRefs:O.pluginRefs}))}catch(B){$(B,"")}},O=>$(O,""))}else try{Re(Te(Be({},g),{key:f,details:o,logPluginError:D,requestPlugins:null,runOnEndCallbacks:(O,B,T)=>T(),pluginRefs:null}))}catch(O){$(O,"")}},Re=({callName:g,refs:f,serveOptions:o,options:p,isTTY:j,defaultWD:M,callback:P,key:N,details:D,logPluginError:$,requestPlugins:O,runOnEndCallbacks:B,pluginRefs:T})=>{let S={ref(){T&&T.ref(),f&&f.ref()},unref(){T&&T.unref(),f&&f.unref()}},E=!e.isBrowser,{entries:y,flags:w,write:a,stdinContents:b,stdinResolveDir:I,absWorkingDir:c,incremental:v,nodePaths:W,watch:C}=pt(g,p,j,ie,E),K={command:"build",key:N,entries:y,flags:w,write:a,stdinContents:b,stdinResolveDir:I,absWorkingDir:c||M,incremental:v,nodePaths:W};O&&(K.plugins=O);let V=o&&le(S,o,K),Y,J,se=(A,G)=>{A.outputFiles&&(G.outputFiles=A.outputFiles.map(mt)),A.metafile&&(G.metafile=JSON.parse(A.metafile)),A.writeToStdout!==void 0&&console.log(ce(A.writeToStdout).replace(/\n$/,""))},oe=(A,G)=>{let H={errors:we(A.errors,D),warnings:we(A.warnings,D)};se(A,H),B(H,$,()=>{if(H.errors.length>0)return G(be("Build failed",H.errors,H.warnings),null);if(A.rebuildID!==void 0){if(!Y){let ne=!1;Y=()=>new Promise((pe,ge)=>{if(ne||u)throw new Error("Cannot rebuild");k(S,{command:"rebuild",rebuildID:A.rebuildID},(Z,Ze)=>{if(Z)return G(be("Build failed",[{pluginName:"",text:Z,location:null,notes:[],detail:void 0}],[]),null);oe(Ze,(Pe,et)=>{Pe?ge(Pe):pe(et)})})}),S.ref(),Y.dispose=()=>{ne||(ne=!0,k(S,{command:"rebuild-dispose",rebuildID:A.rebuildID},()=>{}),S.unref())}}H.rebuild=Y}if(A.watchID!==void 0){if(!J){let ne=!1;S.ref(),J=()=>{ne||(ne=!0,s.delete(A.watchID),k(S,{command:"watch-stop",watchID:A.watchID},()=>{}),S.unref())},C&&s.set(A.watchID,(pe,ge)=>{if(pe){C.onRebuild&&C.onRebuild(pe,null);return}let Z={errors:we(ge.errors,D),warnings:we(ge.warnings,D)};se(ge,Z),B(Z,$,()=>{if(Z.errors.length>0){C.onRebuild&&C.onRebuild(be("Build failed",Z.errors,Z.warnings),null);return}ge.rebuildID!==void 0&&(Z.rebuild=Y),Z.stop=J,C.onRebuild&&C.onRebuild(null,Z)})})}H.stop=J}G(null,H)})};if(a&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(v&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(C&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');k(S,K,(A,G)=>{if(A)return P(new Error(A),null);if(V){let H=G,ne=!1;S.ref();let pe={port:H.port,host:H.host,wait:V.wait,stop(){ne||(ne=!0,V.stop(),S.unref())}};return S.ref(),V.wait.then(S.unref,S.unref),P(null,pe)}return oe(G,P)})};return{readFromStdout:F,afterClose:U,service:{buildOrServe:X,transform:({callName:g,refs:f,input:o,options:p,isTTY:j,fs:M,callback:P})=>{let N=Ge(),D=$=>{try{if(typeof o!="string")throw new Error('The input to "transform" must be a string');let O=gt(g,p,j,fe);k(f,{command:"transform",flags:O,inputFS:$!==null,input:$!==null?$:o},(T,S)=>{if(T)return P(new Error(T),null);let E=we(S.errors,N),y=we(S.warnings,N),w=1,a=()=>--w==0&&P(null,{warnings:y,code:S.code,map:S.map});if(E.length>0)return P(be("Transform failed",E,y),null);S.codeFS&&(w++,M.readFile(S.code,(b,I)=>{b!==null?P(b,null):(S.code=I,a())})),S.mapFS&&(w++,M.readFile(S.map,(b,I)=>{b!==null?P(b,null):(S.map=I,a())})),a()})}catch(O){let B=[];try{Oe(B,p,{},j,fe)}catch(S){}let T=he(O,e,N,void 0,"");k(f,{command:"error",flags:B,error:T},()=>{T.detail=N.load(T.detail),P(be("Transform failed",[T],[]),null)})}};if(typeof o=="string"&&o.length>1024*1024){let $=D;D=()=>M.writeFile(o,$)}D(null)},formatMessages:({callName:g,refs:f,messages:o,options:p,callback:j})=>{let M=de(o,"messages",null,"");if(!p)throw new Error(`Missing second argument in ${g}() call`);let P={},N=n(p,P,"kind",h),D=n(p,P,"color",L),$=n(p,P,"terminalWidth",me);if(_(p,P,`in ${g}() call`),N===void 0)throw new Error(`Missing "kind" in ${g}() call`);if(N!=="error"&&N!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${g}() call`);let O={command:"format-msgs",messages:M,isWarning:N==="warning"};D!==void 0&&(O.color=D),$!==void 0&&(O.terminalWidth=$),k(f,O,(B,T)=>{if(B)return j(new Error(B),null);j(null,T.messages)})},analyzeMetafile:({callName:g,refs:f,metafile:o,options:p,callback:j})=>{p===void 0&&(p={});let M={},P=n(p,M,"color",L),N=n(p,M,"verbose",L);_(p,M,`in ${g}() call`);let D={command:"analyze-metafile",metafile:o};P!==void 0&&(D.color=P),N!==void 0&&(D.verbose=N),k(f,D,($,O)=>{if($)return j(new Error($),null);j(null,O.result)})}}}}function Ge(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let s=t++;return e.set(s,r),s}}}function Se(e,t,r){let s,d=!1;return()=>{if(d)return s;d=!0;try{let l=(e.stack+"").split(`
|
3
3
|
`);l.splice(1,1);let u=Qe(t,l,r);if(u)return s={text:e.message,location:u},s}catch(l){}}}function he(e,t,r,s,d){let l="Internal error",u=null;try{l=(e&&e.message||e)+""}catch(i){}try{u=Qe(t,(e.stack+"").split(`
|
4
4
|
`),"")}catch(i){}return{pluginName:d,text:l,location:u,notes:s?[s]:[],detail:r?r.store(e):-1}}function Qe(e,t,r){let s=" at ";if(e.readFileSync&&!t[0].startsWith(s)&&t[1].startsWith(s))for(let d=1;d<t.length;d++){let l=t[d];if(!!l.startsWith(s))for(l=l.slice(s.length);;){let u=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(u){l=u[1];continue}if(u=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),u){l=u[1];continue}if(u=/^(\S+):(\d+):(\d+)$/.exec(l),u){let i;try{i=e.readFileSync(u[1],"utf8")}catch(F){break}let m=i.split(/\r\n|\r|\n|\u2028|\u2029/)[+u[2]-1]||"",R=+u[3]-1,x=m.slice(R,R+r.length)===r?r.length:0;return{file:u[1],namespace:"file",line:+u[2],column:ue(m.slice(0,R)).length,length:ue(m.slice(R,R+x)).length,lineText:m+`
|
5
5
|
`+t.slice(1).join(`
|
6
6
|
`),suggestion:""}}break}}return null}function be(e,t,r){let s=5,d=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,s+1).map((u,i)=>{if(i===s)return`
|
7
7
|
...`;if(!u.location)return`
|
8
8
|
error: ${u.text}`;let{file:m,line:R,column:x}=u.location,F=u.pluginName?`[plugin: ${u.pluginName}] `:"";return`
|
9
|
-
${m}:${R}:${x}: error: ${F}${u.text}`}).join(""),l=new Error(`${e}${d}`);return l.errors=t,l.warnings=r,l}function we(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Xe(e,t){if(e==null)return null;let r={},s=n(e,r,"file",h),d=n(e,r,"namespace",h),l=n(e,r,"line",me),u=n(e,r,"column",me),i=n(e,r,"length",me),m=n(e,r,"lineText",h),R=n(e,r,"suggestion",h);return _(e,r,t),{file:s||"",namespace:d||"",line:l||0,column:u||0,length:i||0,lineText:m||"",suggestion:R||""}}function de(e,t,r,s){let d=[],l=0;for(let u of e){let i={},m=n(u,i,"pluginName",h),R=n(u,i,"text",h),x=n(u,i,"location",_e),F=n(u,i,"notes",z),U=n(u,i,"detail",Ie),k=`in element ${l} of "${t}"`;_(u,i,k);let q=[];if(F)for(let ee of F){let G={},te=n(ee,G,"text",h),re=n(ee,G,"location",_e);_(ee,G,k),q.push({text:te||"",location:Xe(re,k)})}d.push({pluginName:m||s,text:R||"",location:Xe(x,k),notes:q,detail:r?r.store(U):-1}),l++}return d}function xe(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function gt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=fe(t)),r}}}var mt="0.14.0",yt=e=>ke().build(e),ht=()=>{throw new Error('The "serve" API only works in node')},bt=(e,t)=>ke().transform(e,t),wt=(e,t)=>ke().formatMessages(e,t),vt=(e,t)=>ke().analyzeMetafile(e,t),Rt=()=>{throw new Error('The "buildSync" API only works in node')},Ot=()=>{throw new Error('The "transformSync" API only works in node')},St=()=>{throw new Error('The "formatMessagesSync" API only works in node')},xt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},ve,Le,ke=()=>{if(Le)return Le;throw ve?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')},kt=e=>{e=Je(e||{});let t=e.wasmURL,r=e.worker!==!1;if(!t)throw new Error('Must provide the "wasmURL" option');if(t+="",ve)throw new Error('Cannot call "initialize" more than once');return ve=Et(t,r),ve.catch(()=>{ve=void 0}),ve},Et=(e,t)=>ae(void 0,null,function*(){let r=yield fetch(e);if(!r.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);let s=yield r.arrayBuffer(),d='{let global={};for(let o=self;o;o=Object.getPrototypeOf(o))for(let k of Object.getOwnPropertyNames(o))if(!(k in global))Object.defineProperty(global,k,{get:()=>self[k]});\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=(a,g,f)=>new Promise((r,n)=>{var s=h=>{try{l(f.next(h))}catch(u){n(u)}},i=h=>{try{l(f.throw(h))}catch(u){n(u)}},l=h=>h.done?r(h.value):Promise.resolve(h.value).then(s,i);l((f=f.apply(a,g)).next())});(()=>{if(typeof global=="undefined")if(typeof window!="undefined")window.global=window;else if(typeof self!="undefined")self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(!global.require&&typeof require!="undefined"&&(global.require=require),!global.fs&&global.require){const r=require("fs");typeof r=="object"&&r!==null&&Object.keys(r).length!==0&&(global.fs=Object.assign({},r,{write(n,s,i,l,h,u){if(i===0&&l===s.length&&h===null){if(n===process.stdout.fd){try{process.stdout.write(s,m=>m?u(m,0,null):u(null,l,s))}catch(m){u(m,0,null)}return}if(n===process.stderr.fd){try{process.stderr.write(s,m=>m?u(m,0,null):u(null,l,s))}catch(m){u(m,0,null)}return}}r.write(n,s,i,l,h,u)}}))}const a=()=>{const r=new Error("not implemented");return r.code="ENOSYS",r};if(!global.fs){let r="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){r+=f.decode(s);const i=r.lastIndexOf(`\n`);return i!=-1&&(console.log(r.substr(0,i)),r=r.substr(i+1)),s.length},write(n,s,i,l,h,u){if(i!==0||l!==s.length||h!==null){u(a());return}const m=this.writeSync(n,s);u(null,m)},chmod(n,s,i){i(a())},chown(n,s,i,l){l(a())},close(n,s){s(a())},fchmod(n,s,i){i(a())},fchown(n,s,i,l){l(a())},fstat(n,s){s(a())},fsync(n,s){s(null)},ftruncate(n,s,i){i(a())},lchown(n,s,i,l){l(a())},link(n,s,i){i(a())},lstat(n,s){s(a())},mkdir(n,s,i){i(a())},open(n,s,i,l){l(a())},read(n,s,i,l,h,u){u(a())},readdir(n,s){s(a())},readlink(n,s){s(a())},rename(n,s,i){i(a())},rmdir(n,s){s(a())},stat(n,s){s(a())},symlink(n,s,i){i(a())},truncate(n,s,i){i(a())},unlink(n,s){s(a())},utimes(n,s,i,l){l(a())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw a()},pid:-1,ppid:-1,umask(){throw a()},cwd(){throw a()},chdir(){throw a()}}),!global.crypto&&global.require){const r=require("crypto");global.crypto={getRandomValues(n){r.randomFillSync(n)}}}if(!global.crypto)throw new Error("global.crypto is not available, polyfill required (getRandomValues only)");if(global.performance||(global.performance={now(){const[r,n]=process.hrtime();return r*1e3+n/1e6}}),!global.TextEncoder&&global.require&&(global.TextEncoder=require("util").TextEncoder),!global.TextEncoder)throw new Error("global.TextEncoder is not available, polyfill required");if(!global.TextDecoder&&global.require&&(global.TextDecoder=require("util").TextDecoder),!global.TextDecoder)throw new Error("global.TextDecoder is not available, polyfill required");const g=new TextEncoder("utf-8"),f=new TextDecoder("utf-8");if(global.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 r=(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)=>{const o=2146959360;if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,o,!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 c=this._ids.get(t);c===void 0&&(c=this._idPool.pop(),c===void 0&&(c=this._values.length),this._values[c]=t,this._goRefCounts[c]=0,this._ids.set(t,c)),this._goRefCounts[c]++;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,o|d,!0),this.mem.setUint32(e,c,!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),c=new Array(o);for(let d=0;d<o;d++)c[d]=s(t+d*8);return c},u=e=>{const t=n(e+0),o=n(e+8);return f.decode(new DataView(this._inst.exports.mem.buffer,t,o))},m=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),c=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,c))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,r(e+8,(m+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();r(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)),c=h(e+32),d=Reflect.apply(o,t,c);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),c=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,c),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),c=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,c),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,r(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=g.encode(String(s(e+8)));i(e+16,t),r(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 c=o.subarray(0,t.length);t.set(c),r(e+40,c.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 c=o.subarray(0,t.length);t.set(c),r(e+40,c.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(r){return y(this,null,function*(){if(!(r instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=r,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=g.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 m=4096+4096;if(n>=m)throw new Error("command line too long");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(r){const n=this;return function(){const s={id:r,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}},typeof module!="undefined"&&global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const r=new Go;r.argv=process.argv.slice(2),r.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),r.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),r.importObject).then(n=>(process.on("exit",s=>{s===0&&!r.exited&&(r._pendingEvent={id:0},r._resume())}),r.run(n.instance))).catch(n=>{console.error(n),process.exit(1)})}})();\nonmessage=({data:c})=>{let y=new TextDecoder,s=global.fs,a="";s.writeSync=(e,t)=>{if(e===1)postMessage(t);else if(e===2){a+=y.decode(t);let n=a.split(`\n`);n.length>1&&console.log(n.slice(0,-1).join(`\n`)),a=n[n.length-1]}else throw new Error("Bad write");return t.length};let l=[],i,r=0;onmessage=({data:e})=>{e.length>0&&(l.push(e),i&&i())},s.read=(e,t,n,d,h,m)=>{if(e!==0||n!==0||d!==t.length||h!==null)throw new Error("Bad read");if(l.length===0){i=()=>s.read(e,t,n,d,h,m);return}let g=l[0],u=Math.max(0,Math.min(d,g.length-r));t.set(g.subarray(r,r+u),n),r+=u,r===g.length&&(l.shift(),r=0),m(null,u)};let o=new global.Go;o.argv=["","--service=0.14.0"],WebAssembly.instantiate(c,o.importObject).then(({instance:e})=>o.run(e))};}',l;if(t){let m=new Blob([d],{type:"text/javascript"});l=new Worker(URL.createObjectURL(m))}else{let R=new Function("postMessage",d+"var onmessage; return m => onmessage(m)")(x=>l.onmessage({data:x}));l={onmessage:null,postMessage:x=>R({data:x}),terminate(){}}}l.postMessage(s),l.onmessage=({data:m})=>u(m);let{readFromStdout:u,service:i}=He({writeToStdin(m){l.postMessage(m)},isSync:!1,isBrowser:!0});Le={build:m=>new Promise((R,x)=>i.buildOrServe({callName:"build",refs:null,serveOptions:null,options:m,isTTY:!1,defaultWD:"/",callback:(F,U)=>F?x(F):R(U)})),transform:(m,R)=>new Promise((x,F)=>i.transform({callName:"transform",refs:null,input:m,options:R||{},isTTY:!1,fs:{readFile(U,k){k(new Error("Internal error"),null)},writeFile(U,k){k(null)}},callback:(U,k)=>U?F(U):x(k)})),formatMessages:(m,R)=>new Promise((x,F)=>i.formatMessages({callName:"formatMessages",refs:null,messages:m,options:R,callback:(U,k)=>U?F(U):x(k)})),analyzeMetafile:(m,R)=>new Promise((x,F)=>i.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof m=="string"?m:JSON.stringify(m),options:R,callback:(U,k)=>U?F(U):x(k)}))}});
|
9
|
+
${m}:${R}:${x}: ERROR: ${F}${u.text}`}).join(""),l=new Error(`${e}${d}`);return l.errors=t,l.warnings=r,l}function we(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Xe(e,t){if(e==null)return null;let r={},s=n(e,r,"file",h),d=n(e,r,"namespace",h),l=n(e,r,"line",me),u=n(e,r,"column",me),i=n(e,r,"length",me),m=n(e,r,"lineText",h),R=n(e,r,"suggestion",h);return _(e,r,t),{file:s||"",namespace:d||"",line:l||0,column:u||0,length:i||0,lineText:m||"",suggestion:R||""}}function de(e,t,r,s){let d=[],l=0;for(let u of e){let i={},m=n(u,i,"pluginName",h),R=n(u,i,"text",h),x=n(u,i,"location",_e),F=n(u,i,"notes",z),U=n(u,i,"detail",Ce),k=`in element ${l} of "${t}"`;_(u,i,k);let q=[];if(F)for(let ee of F){let Q={},te=n(ee,Q,"text",h),re=n(ee,Q,"location",_e);_(ee,Q,k),q.push({text:te||"",location:Xe(re,k)})}d.push({pluginName:m||s,text:R||"",location:Xe(x,k),notes:q,detail:r?r.store(U):-1}),l++}return d}function xe(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function mt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=ce(t)),r}}}var ht="0.14.3",bt=e=>ke().build(e),wt=()=>{throw new Error('The "serve" API only works in node')},vt=(e,t)=>ke().transform(e,t),Rt=(e,t)=>ke().formatMessages(e,t),Ot=(e,t)=>ke().analyzeMetafile(e,t),St=()=>{throw new Error('The "buildSync" API only works in node')},xt=()=>{throw new Error('The "transformSync" API only works in node')},kt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Et=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},ve,Le,ke=()=>{if(Le)return Le;throw ve?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')},$t=e=>{e=Je(e||{});let t=e.wasmURL,r=e.worker!==!1;if(!t)throw new Error('Must provide the "wasmURL" option');if(t+="",ve)throw new Error('Cannot call "initialize" more than once');return ve=Dt(t,r),ve.catch(()=>{ve=void 0}),ve},Dt=(e,t)=>ae(void 0,null,function*(){let r=yield fetch(e);if(!r.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);let s=yield r.arrayBuffer(),d='{let global={};for(let o=self;o;o=Object.getPrototypeOf(o))for(let k of Object.getOwnPropertyNames(o))if(!(k in global))Object.defineProperty(global,k,{get:()=>self[k]});\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=(a,g,f)=>new Promise((r,n)=>{var s=h=>{try{l(f.next(h))}catch(u){n(u)}},i=h=>{try{l(f.throw(h))}catch(u){n(u)}},l=h=>h.done?r(h.value):Promise.resolve(h.value).then(s,i);l((f=f.apply(a,g)).next())});(()=>{if(typeof global=="undefined")if(typeof window!="undefined")window.global=window;else if(typeof self!="undefined")self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");if(!global.require&&typeof require!="undefined"&&(global.require=require),!global.fs&&global.require){const r=require("fs");typeof r=="object"&&r!==null&&Object.keys(r).length!==0&&(global.fs=Object.assign({},r,{write(n,s,i,l,h,u){if(i===0&&l===s.length&&h===null){if(n===process.stdout.fd){try{process.stdout.write(s,m=>m?u(m,0,null):u(null,l,s))}catch(m){u(m,0,null)}return}if(n===process.stderr.fd){try{process.stderr.write(s,m=>m?u(m,0,null):u(null,l,s))}catch(m){u(m,0,null)}return}}r.write(n,s,i,l,h,u)}}))}const a=()=>{const r=new Error("not implemented");return r.code="ENOSYS",r};if(!global.fs){let r="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){r+=f.decode(s);const i=r.lastIndexOf(`\n`);return i!=-1&&(console.log(r.substr(0,i)),r=r.substr(i+1)),s.length},write(n,s,i,l,h,u){if(i!==0||l!==s.length||h!==null){u(a());return}const m=this.writeSync(n,s);u(null,m)},chmod(n,s,i){i(a())},chown(n,s,i,l){l(a())},close(n,s){s(a())},fchmod(n,s,i){i(a())},fchown(n,s,i,l){l(a())},fstat(n,s){s(a())},fsync(n,s){s(null)},ftruncate(n,s,i){i(a())},lchown(n,s,i,l){l(a())},link(n,s,i){i(a())},lstat(n,s){s(a())},mkdir(n,s,i){i(a())},open(n,s,i,l){l(a())},read(n,s,i,l,h,u){u(a())},readdir(n,s){s(a())},readlink(n,s){s(a())},rename(n,s,i){i(a())},rmdir(n,s){s(a())},stat(n,s){s(a())},symlink(n,s,i){i(a())},truncate(n,s,i){i(a())},unlink(n,s){s(a())},utimes(n,s,i,l){l(a())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw a()},pid:-1,ppid:-1,umask(){throw a()},cwd(){throw a()},chdir(){throw a()}}),!global.crypto&&global.require){const r=require("crypto");global.crypto={getRandomValues(n){r.randomFillSync(n)}}}if(!global.crypto)throw new Error("global.crypto is not available, polyfill required (getRandomValues only)");if(global.performance||(global.performance={now(){const[r,n]=process.hrtime();return r*1e3+n/1e6}}),!global.TextEncoder&&global.require&&(global.TextEncoder=require("util").TextEncoder),!global.TextEncoder)throw new Error("global.TextEncoder is not available, polyfill required");if(!global.TextDecoder&&global.require&&(global.TextDecoder=require("util").TextDecoder),!global.TextDecoder)throw new Error("global.TextDecoder is not available, polyfill required");const g=new TextEncoder("utf-8"),f=new TextDecoder("utf-8");if(global.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 r=(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)=>{const o=2146959360;if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,o,!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 c=this._ids.get(t);c===void 0&&(c=this._idPool.pop(),c===void 0&&(c=this._values.length),this._values[c]=t,this._goRefCounts[c]=0,this._ids.set(t,c)),this._goRefCounts[c]++;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,o|d,!0),this.mem.setUint32(e,c,!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),c=new Array(o);for(let d=0;d<o;d++)c[d]=s(t+d*8);return c},u=e=>{const t=n(e+0),o=n(e+8);return f.decode(new DataView(this._inst.exports.mem.buffer,t,o))},m=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),c=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,c))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,r(e+8,(m+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();r(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)),c=h(e+32),d=Reflect.apply(o,t,c);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),c=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,c),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),c=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,c),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,r(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=g.encode(String(s(e+8)));i(e+16,t),r(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 c=o.subarray(0,t.length);t.set(c),r(e+40,c.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 c=o.subarray(0,t.length);t.set(c),r(e+40,c.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(r){return y(this,null,function*(){if(!(r instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=r,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,global,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[global,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=g.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 m=4096+8192;if(n>=m)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(r){const n=this;return function(){const s={id:r,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}},typeof module!="undefined"&&global.require&&global.require.main===module&&global.process&&global.process.versions&&!global.process.versions.electron){process.argv.length<3&&(console.error("usage: go_js_wasm_exec [wasm binary] [arguments]"),process.exit(1));const r=new Go;r.argv=process.argv.slice(2),r.env=Object.assign({TMPDIR:require("os").tmpdir()},process.env),r.exit=process.exit,WebAssembly.instantiate(fs.readFileSync(process.argv[2]),r.importObject).then(n=>(process.on("exit",s=>{s===0&&!r.exited&&(r._pendingEvent={id:0},r._resume())}),r.run(n.instance))).catch(n=>{console.error(n),process.exit(1)})}})();\nonmessage=({data:c})=>{let y=new TextDecoder,s=global.fs,a="";s.writeSync=(e,t)=>{if(e===1)postMessage(t);else if(e===2){a+=y.decode(t);let n=a.split(`\n`);n.length>1&&console.log(n.slice(0,-1).join(`\n`)),a=n[n.length-1]}else throw new Error("Bad write");return t.length};let l=[],i,r=0;onmessage=({data:e})=>{e.length>0&&(l.push(e),i&&i())},s.read=(e,t,n,d,h,m)=>{if(e!==0||n!==0||d!==t.length||h!==null)throw new Error("Bad read");if(l.length===0){i=()=>s.read(e,t,n,d,h,m);return}let g=l[0],u=Math.max(0,Math.min(d,g.length-r));t.set(g.subarray(r,r+u),n),r+=u,r===g.length&&(l.shift(),r=0),m(null,u)};let o=new global.Go;o.argv=["","--service=0.14.3"],WebAssembly.instantiate(c,o.importObject).then(({instance:e})=>o.run(e))};}',l;if(t){let m=new Blob([d],{type:"text/javascript"});l=new Worker(URL.createObjectURL(m))}else{let R=new Function("postMessage",d+"var onmessage; return m => onmessage(m)")(x=>l.onmessage({data:x}));l={onmessage:null,postMessage:x=>R({data:x}),terminate(){}}}l.postMessage(s),l.onmessage=({data:m})=>u(m);let{readFromStdout:u,service:i}=He({writeToStdin(m){l.postMessage(m)},isSync:!1,isBrowser:!0,esbuild:exports});Le={build:m=>new Promise((R,x)=>i.buildOrServe({callName:"build",refs:null,serveOptions:null,options:m,isTTY:!1,defaultWD:"/",callback:(F,U)=>F?x(F):R(U)})),transform:(m,R)=>new Promise((x,F)=>i.transform({callName:"transform",refs:null,input:m,options:R||{},isTTY:!1,fs:{readFile(U,k){k(new Error("Internal error"),null)},writeFile(U,k){k(null)}},callback:(U,k)=>U?F(U):x(k)})),formatMessages:(m,R)=>new Promise((x,F)=>i.formatMessages({callName:"formatMessages",refs:null,messages:m,options:R,callback:(U,k)=>U?F(U):x(k)})),analyzeMetafile:(m,R)=>new Promise((x,F)=>i.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof m=="string"?m:JSON.stringify(m),options:R,callback:(U,k)=>U?F(U):x(k)}))}});
|
10
10
|
})(typeof exports==="object"?exports:(typeof self!=="undefined"?self:this).esbuild={});
|
@@ -232,6 +232,7 @@ export interface TransformOptions extends CommonOptions {
|
|
232
232
|
jsxFragmentFactory?: string,
|
233
233
|
useDefineForClassFields?: boolean,
|
234
234
|
importsNotUsedAsValues?: 'remove' | 'preserve' | 'error',
|
235
|
+
preserveValueImports?: boolean,
|
235
236
|
},
|
236
237
|
};
|
237
238
|
|
@@ -267,6 +268,21 @@ export interface PluginBuild {
|
|
267
268
|
(OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void;
|
268
269
|
onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) =>
|
269
270
|
(OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void;
|
271
|
+
|
272
|
+
// This is a full copy of the esbuild library in case you need it
|
273
|
+
esbuild: {
|
274
|
+
serve: typeof serve,
|
275
|
+
build: typeof build,
|
276
|
+
buildSync: typeof buildSync,
|
277
|
+
transform: typeof transform,
|
278
|
+
transformSync: typeof transformSync,
|
279
|
+
formatMessages: typeof formatMessages,
|
280
|
+
formatMessagesSync: typeof formatMessagesSync,
|
281
|
+
analyzeMetafile: typeof analyzeMetafile,
|
282
|
+
analyzeMetafileSync: typeof analyzeMetafileSync,
|
283
|
+
initialize: typeof initialize,
|
284
|
+
version: typeof version,
|
285
|
+
};
|
270
286
|
}
|
271
287
|
|
272
288
|
export interface OnStartResult {
|
@@ -311,6 +327,7 @@ export interface OnResolveResult {
|
|
311
327
|
external?: boolean;
|
312
328
|
sideEffects?: boolean;
|
313
329
|
namespace?: string;
|
330
|
+
suffix?: string;
|
314
331
|
pluginData?: any;
|
315
332
|
|
316
333
|
watchFiles?: string[];
|
@@ -325,6 +342,7 @@ export interface OnLoadOptions {
|
|
325
342
|
export interface OnLoadArgs {
|
326
343
|
path: string;
|
327
344
|
namespace: string;
|
345
|
+
suffix: string;
|
328
346
|
pluginData: any;
|
329
347
|
}
|
330
348
|
|
@@ -709,8 +709,8 @@ function createChannel(streamIn) {
|
|
709
709
|
if (isFirstPacket) {
|
710
710
|
isFirstPacket = false;
|
711
711
|
let binaryVersion = String.fromCharCode(...bytes);
|
712
|
-
if (binaryVersion !== "0.14.
|
713
|
-
throw new Error(`Cannot start service: Host version "${"0.14.
|
712
|
+
if (binaryVersion !== "0.14.3") {
|
713
|
+
throw new Error(`Cannot start service: Host version "${"0.14.3"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
|
714
714
|
}
|
715
715
|
return;
|
716
716
|
}
|
@@ -756,17 +756,17 @@ function createChannel(streamIn) {
|
|
756
756
|
let promise = setup({
|
757
757
|
initialOptions,
|
758
758
|
onStart(callback2) {
|
759
|
-
let registeredText = `This error came from the "onStart" callback registered here
|
759
|
+
let registeredText = `This error came from the "onStart" callback registered here:`;
|
760
760
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
|
761
761
|
onStartCallbacks.push({ name, callback: callback2, note: registeredNote });
|
762
762
|
},
|
763
763
|
onEnd(callback2) {
|
764
|
-
let registeredText = `This error came from the "onEnd" callback registered here
|
764
|
+
let registeredText = `This error came from the "onEnd" callback registered here:`;
|
765
765
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd");
|
766
766
|
onEndCallbacks.push({ name, callback: callback2, note: registeredNote });
|
767
767
|
},
|
768
768
|
onResolve(options, callback2) {
|
769
|
-
let registeredText = `This error came from the "onResolve" callback registered here
|
769
|
+
let registeredText = `This error came from the "onResolve" callback registered here:`;
|
770
770
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve");
|
771
771
|
let keys2 = {};
|
772
772
|
let filter = getFlag(options, keys2, "filter", mustBeRegExp);
|
@@ -779,7 +779,7 @@ function createChannel(streamIn) {
|
|
779
779
|
plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" });
|
780
780
|
},
|
781
781
|
onLoad(options, callback2) {
|
782
|
-
let registeredText = `This error came from the "onLoad" callback registered here
|
782
|
+
let registeredText = `This error came from the "onLoad" callback registered here:`;
|
783
783
|
let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad");
|
784
784
|
let keys2 = {};
|
785
785
|
let filter = getFlag(options, keys2, "filter", mustBeRegExp);
|
@@ -790,7 +790,8 @@ function createChannel(streamIn) {
|
|
790
790
|
let id = nextCallbackID++;
|
791
791
|
onLoadCallbacks[id] = { name, callback: callback2, note: registeredNote };
|
792
792
|
plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" });
|
793
|
-
}
|
793
|
+
},
|
794
|
+
esbuild: streamIn.esbuild
|
794
795
|
});
|
795
796
|
if (promise)
|
796
797
|
await promise;
|
@@ -844,6 +845,7 @@ function createChannel(streamIn) {
|
|
844
845
|
let pluginName = getFlag(result, keys, "pluginName", mustBeString);
|
845
846
|
let path3 = getFlag(result, keys, "path", mustBeString);
|
846
847
|
let namespace = getFlag(result, keys, "namespace", mustBeString);
|
848
|
+
let suffix = getFlag(result, keys, "suffix", mustBeString);
|
847
849
|
let external = getFlag(result, keys, "external", mustBeBoolean);
|
848
850
|
let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean);
|
849
851
|
let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
|
@@ -859,6 +861,8 @@ function createChannel(streamIn) {
|
|
859
861
|
response.path = path3;
|
860
862
|
if (namespace != null)
|
861
863
|
response.namespace = namespace;
|
864
|
+
if (suffix != null)
|
865
|
+
response.suffix = suffix;
|
862
866
|
if (external != null)
|
863
867
|
response.external = external;
|
864
868
|
if (sideEffects != null)
|
@@ -889,6 +893,7 @@ function createChannel(streamIn) {
|
|
889
893
|
let result = await callback2({
|
890
894
|
path: request.path,
|
891
895
|
namespace: request.namespace,
|
896
|
+
suffix: request.suffix,
|
892
897
|
pluginData: stash.load(request.pluginData)
|
893
898
|
});
|
894
899
|
if (result != null) {
|
@@ -1488,7 +1493,7 @@ error: ${e.text}`;
|
|
1488
1493
|
let { file, line, column } = e.location;
|
1489
1494
|
let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : "";
|
1490
1495
|
return `
|
1491
|
-
${file}:${line}:${column}:
|
1496
|
+
${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
1492
1497
|
}).join("");
|
1493
1498
|
let error = new Error(`${text}${summary}`);
|
1494
1499
|
error.errors = errors;
|
@@ -1686,7 +1691,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
|
1686
1691
|
}
|
1687
1692
|
}
|
1688
1693
|
var _a;
|
1689
|
-
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.
|
1694
|
+
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.3";
|
1690
1695
|
var esbuildCommandAndArgs = () => {
|
1691
1696
|
if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
1692
1697
|
throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
|
@@ -1745,7 +1750,7 @@ var fsAsync = {
|
|
1745
1750
|
}
|
1746
1751
|
}
|
1747
1752
|
};
|
1748
|
-
var version = "0.14.
|
1753
|
+
var version = "0.14.3";
|
1749
1754
|
var build = (options) => ensureServiceIsRunning().build(options);
|
1750
1755
|
var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
|
1751
1756
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
@@ -1854,7 +1859,7 @@ var ensureServiceIsRunning = () => {
|
|
1854
1859
|
if (longLivedService)
|
1855
1860
|
return longLivedService;
|
1856
1861
|
let [command, args] = esbuildCommandAndArgs();
|
1857
|
-
let child = child_process.spawn(command, args.concat(`--service=${"0.14.
|
1862
|
+
let child = child_process.spawn(command, args.concat(`--service=${"0.14.3"}`, "--ping"), {
|
1858
1863
|
windowsHide: true,
|
1859
1864
|
stdio: ["pipe", "pipe", "inherit"],
|
1860
1865
|
cwd: defaultWD
|
@@ -1865,7 +1870,8 @@ var ensureServiceIsRunning = () => {
|
|
1865
1870
|
},
|
1866
1871
|
readFileSync: fs2.readFileSync,
|
1867
1872
|
isSync: false,
|
1868
|
-
isBrowser: false
|
1873
|
+
isBrowser: false,
|
1874
|
+
esbuild: exports
|
1869
1875
|
});
|
1870
1876
|
const stdin = child.stdin;
|
1871
1877
|
const stdout = child.stdout;
|
@@ -1958,10 +1964,11 @@ var runServiceSync = (callback) => {
|
|
1958
1964
|
stdin = bytes;
|
1959
1965
|
},
|
1960
1966
|
isSync: true,
|
1961
|
-
isBrowser: false
|
1967
|
+
isBrowser: false,
|
1968
|
+
esbuild: exports
|
1962
1969
|
});
|
1963
1970
|
callback(service);
|
1964
|
-
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.
|
1971
|
+
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.3"}`), {
|
1965
1972
|
cwd: defaultWD,
|
1966
1973
|
windowsHide: true,
|
1967
1974
|
input: stdin,
|
@@ -1977,7 +1984,7 @@ var workerThreadService = null;
|
|
1977
1984
|
var startWorkerThreadService = (worker_threads2) => {
|
1978
1985
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
1979
1986
|
let worker = new worker_threads2.Worker(__filename, {
|
1980
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.
|
1987
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.3" },
|
1981
1988
|
transferList: [workerPort],
|
1982
1989
|
execArgv: []
|
1983
1990
|
});
|
@@ -594,9 +594,9 @@
|
|
594
594
|
|
595
595
|
// The linker guarantees global data starts from at least wasmMinDataAddr.
|
596
596
|
// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.
|
597
|
-
const wasmMinDataAddr = 4096 +
|
597
|
+
const wasmMinDataAddr = 4096 + 8192;
|
598
598
|
if (offset >= wasmMinDataAddr) {
|
599
|
-
throw new Error("command line
|
599
|
+
throw new Error("total length of command line and environment variables exceeds limit");
|
600
600
|
}
|
601
601
|
|
602
602
|
this._inst.exports.run(argc, argv);
|
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.14.
|
4
|
+
version: 0.14.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: 2021-
|
11
|
+
date: 2021-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: isomorfeus-iodine
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.13.
|
61
|
+
version: 3.13.10
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.13.
|
68
|
+
version: 3.13.10
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: opal
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|