isomorfeus-asset-manager 0.14.9 → 0.14.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72c3557faab5046cf4a3f166cde680d0e4cd00d4829d60e036f466c6f69dcd5f
4
- data.tar.gz: 42198b62586fa62d3516ccf553b79b415dd77830cadd40631a66c9c252f9f6b0
3
+ metadata.gz: dd67d5e589186012d44384e22c24ecc58f6d91ea8d5596aed46c8d6a130b9275
4
+ data.tar.gz: 8981272264e96d66ace7e1f942c3c985bf9f99d7ef0cb4da836c2ecad5f3f87f
5
5
  SHA512:
6
- metadata.gz: b8ec3a05a2caa23313493e65b5500ec4e11203e97518531b753550e02f37c2b12117c104a4e2a4769c40696caa83064050a3b1dcf96ca92a4751b040f87ecd0c
7
- data.tar.gz: 3d78711a4350ea69d54ca3426df1886dd39c8249e7be67b396e3d253b5f3bcdd0cc39d7f1caf2fee0e499a4ff086f1e8fc730cb0ad9c7ec0b465a2d64cd8e370
6
+ metadata.gz: db8bb45d6f08592354a67591edaf1c463dc57b3aea3d6fac6b61eb00ca4ac3eda700a20934e48b4fb90d18983af81ac5f1a5faea181aaa5f59ff2c2ce986ab86
7
+ data.tar.gz: 21ba109c1c94ec3b1a13ccf647ebb6ba92a3c2b1eeb3fa266d973b05569b5b065ffb6246997ec1cf6e94374a09979f8ac643fd36791270702ca4157cd7df848d
data/README.md CHANGED
@@ -12,4 +12,4 @@ No need to install esbuild separately, everything bundled ready to go.
12
12
  However, if within the project the 'esbuild' npm package is installed in node_modules, that version will be used instead.
13
13
 
14
14
  ### Community and Support
15
- At the [Isomorfeus Framework Project](http://isomorfeus.com)
15
+ At the [Isomorfeus Framework Project](https://isomorfeus.com)
@@ -108,29 +108,39 @@ module Isomorfeus
108
108
  // Isomorfeus Asset Manager HMR code begin
109
109
  let ws_protocol = (window.location.protocol == 'https:') ? 'wss:' : 'ws:';
110
110
  let ws_url = ws_protocol + '//' + window.location.host + "#{Isomorfeus.assets_websocket_path}";
111
- let hmr_ws = new WebSocket(ws_url);
112
- hmr_ws.onmessage = function(event) {
113
- let update = JSON.parse(event.data);
114
- if (typeof update.error !== 'undefined') { console.error(update.error); return; }
115
- if (typeof update.locale !== 'undefined') {
116
- console.log('Updating locale ', update.locale);
117
- try { Opal.Isomorfeus.I18n.Init.$reload_from_server(); }
118
- catch { console.log('Coulnt update locale ', update.locale) }
119
- return;
120
- }
121
- let start_index = 'Opal.modules[\\"'.length;
122
- let end_index = update.javascript.indexOf('"', start_index);
123
- let opal_module_name = update.javascript.substr(start_index, end_index - start_index);
124
- console.log('Updating ', opal_module_name);
125
- if (typeof Opal !== 'undefined' && typeof Opal.require_table !== "undefined" && Opal.require_table['corelib/module']) {
126
- try {
127
- eval(update.javascript);
128
- if (Opal.require_table[opal_module_name]) { Opal.load.call(Opal, opal_module_name); }
129
- else { Opal.require.call(Opal, opal_module_name); }
130
- Opal.Isomorfeus.$force_render();
131
- } catch (e) { console.error(e); return; }
132
- }
111
+ let hmr_ws_fun = function() {
112
+ let hmr_ws = new WebSocket(ws_url);
113
+ hmr_ws.onopen = function(event) { console.log("Isomorfeus Asset Manager HMR socket connected"); }
114
+ hmr_ws.onmessage = function(event) {
115
+ let update = JSON.parse(event.data);
116
+ if (typeof update.error !== 'undefined') { console.error(update.error); return; }
117
+ if (typeof update.locale !== 'undefined') {
118
+ console.log('Isomorfeus Asset Manager updating locale ', update.locale);
119
+ try { Opal.Isomorfeus.I18n.Init.$reload_from_server(); }
120
+ catch { console.log('Isomorfeus Asset Manager could not update locale ', update.locale) }
121
+ return;
122
+ }
123
+ let start_index = 'Opal.modules[\\"'.length;
124
+ let end_index = update.javascript.indexOf('"', start_index);
125
+ let opal_module_name = update.javascript.substr(start_index, end_index - start_index);
126
+ console.log('Isomorfeus Asset Manager updating ', opal_module_name);
127
+ if (typeof Opal !== 'undefined' && typeof Opal.require_table !== "undefined" && Opal.require_table['corelib/module']) {
128
+ try {
129
+ eval(update.javascript);
130
+ if (Opal.require_table[opal_module_name]) { Opal.load.call(Opal, opal_module_name); }
131
+ else { Opal.require.call(Opal, opal_module_name); }
132
+ Opal.Isomorfeus.$force_render();
133
+ } catch (e) { console.error(e); return; }
134
+ }
135
+ };
136
+ hmr_ws.onclose = function(event) {
137
+ setTimeout(function() {
138
+ console.log("Isomorfeus Asset Manager reconnecting HMR socket");
139
+ hmr_ws_fun();
140
+ }, 2000);
141
+ };
133
142
  }
143
+ hmr_ws_fun()
134
144
  // Isomorfeus Asset Manager HMR code end
135
145
  JAVASCRIPT
136
146
  end
@@ -67,7 +67,7 @@ module Isomorfeus
67
67
  self.hmr_listener = nil
68
68
  self.asset_manager_hmr_channel = :isomorfeus_asset_manager_module_updates
69
69
  self.asset_manager_hmr_dirs = %w[channels components data locales operations policies]
70
- self.assets_websocket_path = '/_assets_websocket'
70
+ self.assets_websocket_path = '/_asset_manager_hmr_websocket'
71
71
  self.assets_path = '/assets'
72
72
  self.assets = {
73
73
  'web.js' => Isomorfeus::AssetManager::Asset.new(:browser),
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.14.9'
3
+ VERSION = '0.14.10'
4
4
  end
5
5
  end
@@ -4,9 +4,9 @@
4
4
  "requires": true,
5
5
  "packages": {
6
6
  "node_modules/esbuild-wasm": {
7
- "version": "0.14.20",
8
- "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.20.tgz",
9
- "integrity": "sha512-ujhUCYGYdRUIajByyynJDQr8h9c1/bWk8kdsimtp8GrDWjm13T1hWnozjJ+OgnQKtCjL8fw0w4AleEnOwIlqBA==",
7
+ "version": "0.14.21",
8
+ "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.21.tgz",
9
+ "integrity": "sha512-sPMyljBiKxXjW1wLd5dQnrUJR1PAt8ybSidXoZWJnMuB1mpdLju57LtstDWWkCgcaE+TGJJ6NqP/OtGyeDdEAA==",
10
10
  "bin": {
11
11
  "esbuild": "bin/esbuild"
12
12
  },
Binary file
@@ -723,8 +723,8 @@ function createChannel(streamIn) {
723
723
  if (isFirstPacket) {
724
724
  isFirstPacket = false;
725
725
  let binaryVersion = String.fromCharCode(...bytes);
726
- if (binaryVersion !== "0.14.20") {
727
- throw new Error(`Cannot start service: Host version "${"0.14.20"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
726
+ if (binaryVersion !== "0.14.21") {
727
+ throw new Error(`Cannot start service: Host version "${"0.14.21"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
728
728
  }
729
729
  return;
730
730
  }
@@ -1669,7 +1669,7 @@ function convertOutputFiles({ path, contents }) {
1669
1669
  }
1670
1670
 
1671
1671
  // lib/npm/browser.ts
1672
- var version = "0.14.20";
1672
+ var version = "0.14.21";
1673
1673
  var build = (options) => ensureServiceIsRunning().build(options);
1674
1674
  var serve = () => {
1675
1675
  throw new Error(`The "serve" API only works in node`);
@@ -2426,7 +2426,7 @@ onmessage = ({ data: wasm }) => {
2426
2426
  callback(null, count);
2427
2427
  };
2428
2428
  let go = new global.Go();
2429
- go.argv = ["", \`--service=\${"0.14.20"}\`];
2429
+ go.argv = ["", \`--service=\${"0.14.21"}\`];
2430
2430
  WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));
2431
2431
  };}`;
2432
2432
  let worker;
@@ -1,8 +1,8 @@
1
- var Ie=Object.defineProperty,rt=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var qe=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable;var We=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Te=(e,t)=>{for(var r in t||(t={}))lt.call(t,r)&&We(e,r,t[r]);if(qe)for(var r of qe(t))it.call(t,r)&&We(e,r,t[r]);return e},Be=(e,t)=>rt(e,nt(t));var st=(e,t)=>{for(var r in t)Ie(e,r,{get:t[r],enumerable:!0})};var Ue={};st(Ue,{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=i=>{if(i===null)r.write8(0);else if(typeof i=="boolean")r.write8(1),r.write8(+i);else if(typeof i=="number")r.write8(2),r.write32(i|0);else if(typeof i=="string")r.write8(3),r.write(de(i));else if(i instanceof Uint8Array)r.write8(4),r.write(i);else if(i instanceof Array){r.write8(5),r.write32(i.length);for(let p of i)t(p)}else{let p=Object.keys(i);r.write8(6),r.write32(p.length);for(let l of p)r.write(de(l)),t(i[l])}},r=new Ne;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),De(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function ze(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ye(r.read());case 4:return r.read();case 5:{let c=r.read32(),s=[];for(let y=0;y<c;y++)s.push(t());return s}case 6:{let c=r.read32(),s={};for(let y=0;y<c;y++)s[ye(r.read())]=t();return s}default:throw new Error("Invalid packet")}},r=new Ne(e),i=r.read32(),p=(i&1)===0;i>>>=1;let l=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:p,value:l}}var Ne=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);De(this.buf,t,r)}write(t){let r=this._write(4+t.length);De(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),i=this._read(r.length);return r.set(this.buf.subarray(i,i+t)),r}},de,ye;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;de=r=>e.encode(r),ye=r=>t.decode(r)}else if(typeof Buffer!="undefined")de=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},ye=e=>{let{buffer:t,byteOffset:r,byteLength:i}=e;return Buffer.from(t,r,i).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 De(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function Ke(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Ee=()=>null,z=e=>typeof e=="boolean"?null:"a boolean",at=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",m=e=>typeof e=="string"?null:"a string",$e=e=>e instanceof RegExp?null:"a RegExp object",Re=e=>typeof e=="number"&&e===(e|0)?null:"an integer",je=e=>typeof e=="function"?null:"a function",V=e=>Array.isArray(e)?null:"an array",ge=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",Ye=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,i){let p=e[r];if(t[r+""]=!0,p===void 0)return;let l=i(p);if(l!==null)throw new Error(`"${r}" must be ${l}`);return p}function Y(e,t,r){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${r}: "${i}"`)}function He(e){let t=Object.create(null),r=n(e,t,"wasmURL",m),i=n(e,t,"worker",z);return Y(e,t,"in startService() call"),{wasmURL:r,worker:i}}function Ge(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let i=e[r];if(typeof i=="string"||i===!1)t[r]=i;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Me(e,t,r,i,p){let l=n(t,r,"color",z),c=n(t,r,"logLevel",m),s=n(t,r,"logLimit",Re);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${c||p}`),e.push(`--log-limit=${s||0}`)}function Qe(e,t,r){let i=n(t,r,"legalComments",m),p=n(t,r,"sourceRoot",m),l=n(t,r,"sourcesContent",z),c=n(t,r,"target",ct),s=n(t,r,"format",m),y=n(t,r,"globalName",m),O=n(t,r,"mangleProps",$e),P=n(t,r,"reserveProps",$e),L=n(t,r,"minify",z),x=n(t,r,"minifySyntax",z),S=n(t,r,"minifyWhitespace",z),ae=n(t,r,"minifyIdentifiers",z),re=n(t,r,"drop",V),le=n(t,r,"charset",m),ie=n(t,r,"treeShaking",z),ue=n(t,r,"ignoreAnnotations",z),fe=n(t,r,"jsx",m),ce=n(t,r,"jsxFactory",m),me=n(t,r,"jsxFragment",m),se=n(t,r,"define",ge),be=n(t,r,"pure",V),Se=n(t,r,"keepNames",z);if(i&&e.push(`--legal-comments=${i}`),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(Ke).join(",")}`):e.push(`--target=${Ke(c)}`)),s&&e.push(`--format=${s}`),y&&e.push(`--global-name=${y}`),L&&e.push("--minify"),x&&e.push("--minify-syntax"),S&&e.push("--minify-whitespace"),ae&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),ue&&e.push("--ignore-annotations"),re)for(let te of re)e.push(`--drop:${te}`);if(O&&e.push(`--mangle-props=${O.source}`),P&&e.push(`--reserve-props=${P.source}`),fe&&e.push(`--jsx=${fe}`),ce&&e.push(`--jsx-factory=${ce}`),me&&e.push(`--jsx-fragment=${me}`),se)for(let te in se){if(te.indexOf("=")>=0)throw new Error(`Invalid define: ${te}`);e.push(`--define:${te}=${se[te]}`)}if(be)for(let te of be)e.push(`--pure:${te}`);Se&&e.push("--keep-names")}function pt(e,t,r,i,p){var b;let l=[],c=[],s=Object.create(null),y=null,O=null,P=null;Me(l,t,s,r,i),Qe(l,t,s);let L=n(t,s,"sourcemap",Ye),x=n(t,s,"bundle",z),S=n(t,s,"watch",at),ae=n(t,s,"splitting",z),re=n(t,s,"preserveSymlinks",z),le=n(t,s,"metafile",z),ie=n(t,s,"outfile",m),ue=n(t,s,"outdir",m),fe=n(t,s,"outbase",m),ce=n(t,s,"platform",m),me=n(t,s,"tsconfig",m),se=n(t,s,"resolveExtensions",V),be=n(t,s,"nodePaths",V),Se=n(t,s,"mainFields",V),te=n(t,s,"conditions",V),g=n(t,s,"external",V),u=n(t,s,"loader",ge),a=n(t,s,"outExtension",ge),f=n(t,s,"publicPath",m),F=n(t,s,"entryNames",m),D=n(t,s,"chunkNames",m),M=n(t,s,"assetNames",m),E=n(t,s,"inject",V),T=n(t,s,"banner",ge),C=n(t,s,"footer",ge),R=n(t,s,"entryPoints",ut),U=n(t,s,"absWorkingDir",m),k=n(t,s,"stdin",ge),A=(b=n(t,s,"write",z))!=null?b:p,W=n(t,s,"allowOverwrite",z),ee=n(t,s,"incremental",z)===!0,$=n(t,s,"mangleCache",ge);if(s.plugins=!0,Y(t,s,`in ${e}() call`),L&&l.push(`--sourcemap${L===!0?"":`=${L}`}`),x&&l.push("--bundle"),W&&l.push("--allow-overwrite"),S)if(l.push("--watch"),typeof S=="boolean")P={};else{let o=Object.create(null),v=n(S,o,"onRebuild",je);Y(S,o,`on "watch" in ${e}() call`),P={onRebuild:v}}if(ae&&l.push("--splitting"),re&&l.push("--preserve-symlinks"),le&&l.push("--metafile"),ie&&l.push(`--outfile=${ie}`),ue&&l.push(`--outdir=${ue}`),fe&&l.push(`--outbase=${fe}`),ce&&l.push(`--platform=${ce}`),me&&l.push(`--tsconfig=${me}`),se){let o=[];for(let v of se){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);o.push(v)}l.push(`--resolve-extensions=${o.join(",")}`)}if(f&&l.push(`--public-path=${f}`),F&&l.push(`--entry-names=${F}`),D&&l.push(`--chunk-names=${D}`),M&&l.push(`--asset-names=${M}`),Se){let o=[];for(let v of Se){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);o.push(v)}l.push(`--main-fields=${o.join(",")}`)}if(te){let o=[];for(let v of te){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);o.push(v)}l.push(`--conditions=${o.join(",")}`)}if(g)for(let o of g)l.push(`--external:${o}`);if(T)for(let o in T){if(o.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${o}`);l.push(`--banner:${o}=${T[o]}`)}if(C)for(let o in C){if(o.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${o}`);l.push(`--footer:${o}=${C[o]}`)}if(E)for(let o of E)l.push(`--inject:${o}`);if(u)for(let o in u){if(o.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${o}`);l.push(`--loader:${o}=${u[o]}`)}if(a)for(let o in a){if(o.indexOf("=")>=0)throw new Error(`Invalid out extension: ${o}`);l.push(`--out-extension:${o}=${a[o]}`)}if(R)if(Array.isArray(R))for(let o of R)c.push(["",o+""]);else for(let[o,v]of Object.entries(R))c.push([o+"",v+""]);if(k){let o=Object.create(null),v=n(k,o,"contents",m),q=n(k,o,"resolveDir",m),w=n(k,o,"sourcefile",m),d=n(k,o,"loader",m);Y(k,o,'in "stdin" object'),w&&l.push(`--sourcefile=${w}`),d&&l.push(`--loader=${d}`),q&&(O=q+""),y=v?v+"":""}let h=[];if(be)for(let o of be)o+="",h.push(o);return{entries:c,flags:l,write:A,stdinContents:y,stdinResolveDir:O,absWorkingDir:U,incremental:ee,nodePaths:h,watch:P,mangleCache:Ge($)}}function gt(e,t,r,i){let p=[],l=Object.create(null);Me(p,t,l,r,i),Qe(p,t,l);let c=n(t,l,"sourcemap",Ye),s=n(t,l,"tsconfigRaw",ft),y=n(t,l,"sourcefile",m),O=n(t,l,"loader",m),P=n(t,l,"banner",m),L=n(t,l,"footer",m),x=n(t,l,"mangleCache",ge);return Y(t,l,`in ${e}() call`),c&&p.push(`--sourcemap=${c===!0?"external":c}`),s&&p.push(`--tsconfig-raw=${typeof s=="string"?s:JSON.stringify(s)}`),y&&p.push(`--sourcefile=${y}`),O&&p.push(`--loader=${O}`),P&&p.push(`--banner=${P}`),L&&p.push(`--footer=${L}`),{flags:p,mangleCache:Ge(x)}}function Xe(e){let t=new Map,r=new Map,i=new Map,p=new Map,l=!1,c=0,s=0,y=new Uint8Array(16*1024),O=0,P=g=>{let u=O+g.length;if(u>y.length){let f=new Uint8Array(u*2);f.set(y),y=f}y.set(g,O),O+=g.length;let a=0;for(;a+4<=O;){let f=Fe(y,a);if(a+4+f>O)break;a+=4,le(y.subarray(a,a+f)),a+=f}a>0&&(y.copyWithin(0,a,O),O-=a)},L=()=>{l=!0;for(let g of t.values())g("The service was stopped",null);t.clear();for(let g of p.values())g.onWait("The service was stopped");p.clear();for(let g of i.values())try{g(new Error("The service was stopped"),null)}catch(u){console.error(u)}i.clear()},x=(g,u,a)=>{if(l)return a("The service is no longer running",null);let f=c++;t.set(f,(F,D)=>{try{a(F,D)}finally{g&&g.unref()}}),g&&g.ref(),e.writeToStdin(Ae({id:f,isRequest:!0,value:u}))},S=(g,u)=>{if(l)throw new Error("The service is no longer running");e.writeToStdin(Ae({id:g,isRequest:!1,value:u}))},ae=async(g,u)=>{try{switch(u.command){case"ping":{S(g,{});break}case"on-start":{let a=r.get(u.key);a?S(g,await a(u)):S(g,{});break}case"on-resolve":{let a=r.get(u.key);a?S(g,await a(u)):S(g,{});break}case"on-load":{let a=r.get(u.key);a?S(g,await a(u)):S(g,{});break}case"serve-request":{let a=p.get(u.key);a&&a.onRequest&&a.onRequest(u.args),S(g,{});break}case"serve-wait":{let a=p.get(u.key);a&&a.onWait(u.error),S(g,{});break}case"watch-rebuild":{let a=i.get(u.key);try{a&&a(null,u.args)}catch(f){console.error(f)}S(g,{});break}default:throw new Error("Invalid command: "+u.command)}}catch(a){S(g,{errors:[we(a,e,null,void 0,"")]})}},re=!0,le=g=>{if(re){re=!1;let a=String.fromCharCode(...g);if(a!=="0.14.20")throw new Error(`Cannot start service: Host version "0.14.20" does not match binary version ${JSON.stringify(a)}`);return}let u=ze(g);if(u.isRequest)ae(u.id,u.value);else{let a=t.get(u.id);t.delete(u.id),u.value.error?a(u.value.error,{}):a(null,u.value)}},ie=async(g,u,a,f,F)=>{let D=[],M=[],E={},T={},C=0,R=0,U=[],k=!1;u=[...u];for(let $ of u){let h={};if(typeof $!="object")throw new Error(`Plugin at index ${R} must be an object`);let b=n($,h,"name",m);if(typeof b!="string"||b==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let o=n($,h,"setup",je);if(typeof o!="function")throw new Error("Plugin is missing a setup function");Y($,h,`on plugin ${JSON.stringify(b)}`);let v={name:b,onResolve:[],onLoad:[]};R++;let w=o({initialOptions:g,resolve:(d,N={})=>{if(!k)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof d!="string")throw new Error("The path to resolve must be a string");let B=Object.create(null),H=n(N,B,"pluginName",m),I=n(N,B,"importer",m),_=n(N,B,"namespace",m),X=n(N,B,"resolveDir",m),G=n(N,B,"kind",m),j=n(N,B,"pluginData",Ee);return Y(N,B,"in resolve() call"),new Promise((J,Q)=>{let K={command:"resolve",path:d,key:a,pluginName:b};H!=null&&(K.pluginName=H),I!=null&&(K.importer=I),_!=null&&(K.namespace=_),X!=null&&(K.resolveDir=X),G!=null&&(K.kind=G),j!=null&&(K.pluginData=f.store(j)),x(F,K,(oe,Z)=>{oe!==null?Q(new Error(oe)):J({errors:pe(Z.errors,f),warnings:pe(Z.warnings,f),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:f.load(Z.pluginData)})})})},onStart(d){let N='This error came from the "onStart" callback registered here:',B=xe(new Error(N),e,"onStart");D.push({name:b,callback:d,note:B})},onEnd(d){let N='This error came from the "onEnd" callback registered here:',B=xe(new Error(N),e,"onEnd");M.push({name:b,callback:d,note:B})},onResolve(d,N){let B='This error came from the "onResolve" callback registered here:',H=xe(new Error(B),e,"onResolve"),I={},_=n(d,I,"filter",$e),X=n(d,I,"namespace",m);if(Y(d,I,`in onResolve() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onResolve() call is missing a filter");let G=C++;E[G]={name:b,callback:N,note:H},v.onResolve.push({id:G,filter:_.source,namespace:X||""})},onLoad(d,N){let B='This error came from the "onLoad" callback registered here:',H=xe(new Error(B),e,"onLoad"),I={},_=n(d,I,"filter",$e),X=n(d,I,"namespace",m);if(Y(d,I,`in onLoad() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onLoad() call is missing a filter");let G=C++;T[G]={name:b,callback:N,note:H},v.onLoad.push({id:G,filter:_.source,namespace:X||""})},esbuild:e.esbuild});w&&await w,U.push(v)}catch(o){return{ok:!1,error:o,pluginName:b}}}let A=async $=>{switch($.command){case"on-start":{let h={errors:[],warnings:[]};return await Promise.all(D.map(async({name:b,callback:o,note:v})=>{try{let q=await o();if(q!=null){if(typeof q!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(b)} to return an object`);let w={},d=n(q,w,"errors",V),N=n(q,w,"warnings",V);Y(q,w,`from onStart() callback in plugin ${JSON.stringify(b)}`),d!=null&&h.errors.push(...he(d,"errors",f,b)),N!=null&&h.warnings.push(...he(N,"warnings",f,b))}}catch(q){h.errors.push(we(q,e,f,v&&v(),b))}})),h}case"on-resolve":{let h={},b="",o,v;for(let q of $.ids)try{({name:b,callback:o,note:v}=E[q]);let w=await o({path:$.path,importer:$.importer,namespace:$.namespace,resolveDir:$.resolveDir,kind:$.kind,pluginData:f.load($.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(b)} to return an object`);let d={},N=n(w,d,"pluginName",m),B=n(w,d,"path",m),H=n(w,d,"namespace",m),I=n(w,d,"suffix",m),_=n(w,d,"external",z),X=n(w,d,"sideEffects",z),G=n(w,d,"pluginData",Ee),j=n(w,d,"errors",V),J=n(w,d,"warnings",V),Q=n(w,d,"watchFiles",V),K=n(w,d,"watchDirs",V);Y(w,d,`from onResolve() callback in plugin ${JSON.stringify(b)}`),h.id=q,N!=null&&(h.pluginName=N),B!=null&&(h.path=B),H!=null&&(h.namespace=H),I!=null&&(h.suffix=I),_!=null&&(h.external=_),X!=null&&(h.sideEffects=X),G!=null&&(h.pluginData=f.store(G)),j!=null&&(h.errors=he(j,"errors",f,b)),J!=null&&(h.warnings=he(J,"warnings",f,b)),Q!=null&&(h.watchFiles=ke(Q,"watchFiles")),K!=null&&(h.watchDirs=ke(K,"watchDirs"));break}}catch(w){return{id:q,errors:[we(w,e,f,v&&v(),b)]}}return h}case"on-load":{let h={},b="",o,v;for(let q of $.ids)try{({name:b,callback:o,note:v}=T[q]);let w=await o({path:$.path,namespace:$.namespace,suffix:$.suffix,pluginData:f.load($.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(b)} to return an object`);let d={},N=n(w,d,"pluginName",m),B=n(w,d,"contents",dt),H=n(w,d,"resolveDir",m),I=n(w,d,"pluginData",Ee),_=n(w,d,"loader",m),X=n(w,d,"errors",V),G=n(w,d,"warnings",V),j=n(w,d,"watchFiles",V),J=n(w,d,"watchDirs",V);Y(w,d,`from onLoad() callback in plugin ${JSON.stringify(b)}`),h.id=q,N!=null&&(h.pluginName=N),B instanceof Uint8Array?h.contents=B:B!=null&&(h.contents=de(B)),H!=null&&(h.resolveDir=H),I!=null&&(h.pluginData=f.store(I)),_!=null&&(h.loader=_),X!=null&&(h.errors=he(X,"errors",f,b)),G!=null&&(h.warnings=he(G,"warnings",f,b)),j!=null&&(h.watchFiles=ke(j,"watchFiles")),J!=null&&(h.watchDirs=ke(J,"watchDirs"));break}}catch(w){return{id:q,errors:[we(w,e,f,v&&v(),b)]}}return h}default:throw new Error("Invalid command: "+$.command)}},W=($,h,b)=>b();M.length>0&&(W=($,h,b)=>{(async()=>{for(let{name:o,callback:v,note:q}of M)try{await v($)}catch(w){$.errors.push(await new Promise(d=>h(w,o,q&&q(),d)))}})().then(b)}),k=!0;let ee=0;return{ok:!0,requestPlugins:U,runOnEndCallbacks:W,pluginRefs:{ref(){++ee===1&&r.set(a,A)},unref(){--ee===0&&r.delete(a)}}}},ue=(g,u,a,f)=>{let F={},D=n(u,F,"port",Re),M=n(u,F,"host",m),E=n(u,F,"servedir",m),T=n(u,F,"onRequest",je),C,R=new Promise((U,k)=>{C=A=>{p.delete(f),A!==null?k(new Error(A)):U()}});return a.serve={},Y(u,F,"in serve() call"),D!==void 0&&(a.serve.port=D),M!==void 0&&(a.serve.host=M),E!==void 0&&(a.serve.servedir=E),p.set(f,{onRequest:T,onWait:C}),{wait:R,stop(){x(g,{command:"serve-stop",key:f},()=>{})}}},fe="warning",ce="silent",me=g=>{let u=s++,a=Ve(),f,{refs:F,options:D,isTTY:M,callback:E}=g;if(typeof D=="object"){let R=D.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');f=R}}let T=(R,U,k,A)=>{let W=[];try{Me(W,D,{},M,fe)}catch($){}let ee=we(R,e,a,k,U);x(F,{command:"error",flags:W,error:ee},()=>{ee.detail=a.load(ee.detail),A(ee)})},C=(R,U)=>{T(R,U,void 0,k=>{E(ve("Build failed",[k],[]),null)})};if(f&&f.length>0){if(e.isSync)return C(new Error("Cannot use plugins in synchronous API calls"),"");ie(D,f,u,a,F).then(R=>{if(!R.ok)C(R.error,R.pluginName);else try{se(Be(Te({},g),{key:u,details:a,logPluginError:T,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(U){C(U,"")}},R=>C(R,""))}else try{se(Be(Te({},g),{key:u,details:a,logPluginError:T,requestPlugins:null,runOnEndCallbacks:(R,U,k)=>k(),pluginRefs:null}))}catch(R){C(R,"")}},se=({callName:g,refs:u,serveOptions:a,options:f,isTTY:F,defaultWD:D,callback:M,key:E,details:T,logPluginError:C,requestPlugins:R,runOnEndCallbacks:U,pluginRefs:k})=>{let A={ref(){k&&k.ref(),u&&u.ref()},unref(){k&&k.unref(),u&&u.unref()}},W=!e.isBrowser,{entries:ee,flags:$,write:h,stdinContents:b,stdinResolveDir:o,absWorkingDir:v,incremental:q,nodePaths:w,watch:d,mangleCache:N}=pt(g,f,F,fe,W),B={command:"build",key:E,entries:ee,flags:$,write:h,stdinContents:b,stdinResolveDir:o,absWorkingDir:v||D,incremental:q,nodePaths:w};R&&(B.plugins=R),N&&(B.mangleCache=N);let H=a&&ue(A,a,B,E),I,_,X=(j,J)=>{j.outputFiles&&(J.outputFiles=j.outputFiles.map(mt)),j.metafile&&(J.metafile=JSON.parse(j.metafile)),j.mangleCache&&(J.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(ye(j.writeToStdout).replace(/\n$/,""))},G=(j,J)=>{let Q={errors:pe(j.errors,T),warnings:pe(j.warnings,T)};X(j,Q),U(Q,C,()=>{if(Q.errors.length>0)return J(ve("Build failed",Q.errors,Q.warnings),null);if(j.rebuild){if(!I){let K=!1;I=()=>new Promise((oe,Z)=>{if(K||l)throw new Error("Cannot rebuild");x(A,{command:"rebuild",key:E},(ne,et)=>{if(ne)return J(ve("Build failed",[{pluginName:"",text:ne,location:null,notes:[],detail:void 0}],[]),null);G(et,(Pe,tt)=>{Pe?Z(Pe):oe(tt)})})}),A.ref(),I.dispose=()=>{K||(K=!0,x(A,{command:"rebuild-dispose",key:E},()=>{}),A.unref())}}Q.rebuild=I}if(j.watch){if(!_){let K=!1;A.ref(),_=()=>{K||(K=!0,i.delete(E),x(A,{command:"watch-stop",key:E},()=>{}),A.unref())},d&&i.set(E,(oe,Z)=>{if(oe){d.onRebuild&&d.onRebuild(oe,null);return}let ne={errors:pe(Z.errors,T),warnings:pe(Z.warnings,T)};X(Z,ne),U(ne,C,()=>{if(ne.errors.length>0){d.onRebuild&&d.onRebuild(ve("Build failed",ne.errors,ne.warnings),null);return}Z.rebuildID!==void 0&&(ne.rebuild=I),ne.stop=_,d.onRebuild&&d.onRebuild(null,ne)})})}Q.stop=_}J(null,Q)})};if(h&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(q&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(d&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');x(A,B,(j,J)=>{if(j)return M(new Error(j),null);if(H){let Q=J,K=!1;A.ref();let oe={port:Q.port,host:Q.host,wait:H.wait,stop(){K||(K=!0,H.stop(),A.unref())}};return A.ref(),H.wait.then(A.unref,A.unref),M(null,oe)}return G(J,M)})};return{readFromStdout:P,afterClose:L,service:{buildOrServe:me,transform:({callName:g,refs:u,input:a,options:f,isTTY:F,fs:D,callback:M})=>{let E=Ve(),T=C=>{try{if(typeof a!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:U}=gt(g,f,F,ce),k={command:"transform",flags:R,inputFS:C!==null,input:C!==null?C:a};U&&(k.mangleCache=U),x(u,k,(A,W)=>{if(A)return M(new Error(A),null);let ee=pe(W.errors,E),$=pe(W.warnings,E),h=1,b=()=>{if(--h===0){let o={warnings:$,code:W.code,map:W.map};W.mangleCache&&(o.mangleCache=W==null?void 0:W.mangleCache),M(null,o)}};if(ee.length>0)return M(ve("Transform failed",ee,$),null);W.codeFS&&(h++,D.readFile(W.code,(o,v)=>{o!==null?M(o,null):(W.code=v,b())})),W.mapFS&&(h++,D.readFile(W.map,(o,v)=>{o!==null?M(o,null):(W.map=v,b())})),b()})}catch(R){let U=[];try{Me(U,f,{},F,ce)}catch(A){}let k=we(R,e,E,void 0,"");x(u,{command:"error",flags:U,error:k},()=>{k.detail=E.load(k.detail),M(ve("Transform failed",[k],[]),null)})}};if(typeof a=="string"&&a.length>1024*1024){let C=T;T=()=>D.writeFile(a,C)}T(null)},formatMessages:({callName:g,refs:u,messages:a,options:f,callback:F})=>{let D=he(a,"messages",null,"");if(!f)throw new Error(`Missing second argument in ${g}() call`);let M={},E=n(f,M,"kind",m),T=n(f,M,"color",z),C=n(f,M,"terminalWidth",Re);if(Y(f,M,`in ${g}() call`),E===void 0)throw new Error(`Missing "kind" in ${g}() call`);if(E!=="error"&&E!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${g}() call`);let R={command:"format-msgs",messages:D,isWarning:E==="warning"};T!==void 0&&(R.color=T),C!==void 0&&(R.terminalWidth=C),x(u,R,(U,k)=>{if(U)return F(new Error(U),null);F(null,k.messages)})},analyzeMetafile:({callName:g,refs:u,metafile:a,options:f,callback:F})=>{f===void 0&&(f={});let D={},M=n(f,D,"color",z),E=n(f,D,"verbose",z);Y(f,D,`in ${g}() call`);let T={command:"analyze-metafile",metafile:a};M!==void 0&&(T.color=M),E!==void 0&&(T.verbose=E),x(u,T,(C,R)=>{if(C)return F(new Error(C),null);F(null,R.result)})}}}}function Ve(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let i=t++;return e.set(i,r),i}}}function xe(e,t,r){let i,p=!1;return()=>{if(p)return i;p=!0;try{let l=(e.stack+"").split(`
1
+ var Ie=Object.defineProperty,rt=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var qe=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable;var We=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Te=(e,t)=>{for(var r in t||(t={}))lt.call(t,r)&&We(e,r,t[r]);if(qe)for(var r of qe(t))it.call(t,r)&&We(e,r,t[r]);return e},Be=(e,t)=>rt(e,nt(t));var st=(e,t)=>{for(var r in t)Ie(e,r,{get:t[r],enumerable:!0})};var Ue={};st(Ue,{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=i=>{if(i===null)r.write8(0);else if(typeof i=="boolean")r.write8(1),r.write8(+i);else if(typeof i=="number")r.write8(2),r.write32(i|0);else if(typeof i=="string")r.write8(3),r.write(de(i));else if(i instanceof Uint8Array)r.write8(4),r.write(i);else if(i instanceof Array){r.write8(5),r.write32(i.length);for(let p of i)t(p)}else{let p=Object.keys(i);r.write8(6),r.write32(p.length);for(let l of p)r.write(de(l)),t(i[l])}},r=new Ne;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),De(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function ze(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ye(r.read());case 4:return r.read();case 5:{let c=r.read32(),s=[];for(let y=0;y<c;y++)s.push(t());return s}case 6:{let c=r.read32(),s={};for(let y=0;y<c;y++)s[ye(r.read())]=t();return s}default:throw new Error("Invalid packet")}},r=new Ne(e),i=r.read32(),p=(i&1)===0;i>>>=1;let l=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:p,value:l}}var Ne=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);De(this.buf,t,r)}write(t){let r=this._write(4+t.length);De(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),i=this._read(r.length);return r.set(this.buf.subarray(i,i+t)),r}},de,ye;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;de=r=>e.encode(r),ye=r=>t.decode(r)}else if(typeof Buffer!="undefined")de=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},ye=e=>{let{buffer:t,byteOffset:r,byteLength:i}=e;return Buffer.from(t,r,i).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 De(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function Ke(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Ee=()=>null,z=e=>typeof e=="boolean"?null:"a boolean",at=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",m=e=>typeof e=="string"?null:"a string",$e=e=>e instanceof RegExp?null:"a RegExp object",Re=e=>typeof e=="number"&&e===(e|0)?null:"an integer",je=e=>typeof e=="function"?null:"a function",V=e=>Array.isArray(e)?null:"an array",ge=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",Ye=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,i){let p=e[r];if(t[r+""]=!0,p===void 0)return;let l=i(p);if(l!==null)throw new Error(`"${r}" must be ${l}`);return p}function Y(e,t,r){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${r}: "${i}"`)}function He(e){let t=Object.create(null),r=n(e,t,"wasmURL",m),i=n(e,t,"worker",z);return Y(e,t,"in startService() call"),{wasmURL:r,worker:i}}function Ge(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let i=e[r];if(typeof i=="string"||i===!1)t[r]=i;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Me(e,t,r,i,p){let l=n(t,r,"color",z),c=n(t,r,"logLevel",m),s=n(t,r,"logLimit",Re);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${c||p}`),e.push(`--log-limit=${s||0}`)}function Qe(e,t,r){let i=n(t,r,"legalComments",m),p=n(t,r,"sourceRoot",m),l=n(t,r,"sourcesContent",z),c=n(t,r,"target",ct),s=n(t,r,"format",m),y=n(t,r,"globalName",m),O=n(t,r,"mangleProps",$e),P=n(t,r,"reserveProps",$e),L=n(t,r,"minify",z),x=n(t,r,"minifySyntax",z),S=n(t,r,"minifyWhitespace",z),ae=n(t,r,"minifyIdentifiers",z),re=n(t,r,"drop",V),le=n(t,r,"charset",m),ie=n(t,r,"treeShaking",z),ue=n(t,r,"ignoreAnnotations",z),fe=n(t,r,"jsx",m),ce=n(t,r,"jsxFactory",m),me=n(t,r,"jsxFragment",m),se=n(t,r,"define",ge),be=n(t,r,"pure",V),Se=n(t,r,"keepNames",z);if(i&&e.push(`--legal-comments=${i}`),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(Ke).join(",")}`):e.push(`--target=${Ke(c)}`)),s&&e.push(`--format=${s}`),y&&e.push(`--global-name=${y}`),L&&e.push("--minify"),x&&e.push("--minify-syntax"),S&&e.push("--minify-whitespace"),ae&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),ue&&e.push("--ignore-annotations"),re)for(let te of re)e.push(`--drop:${te}`);if(O&&e.push(`--mangle-props=${O.source}`),P&&e.push(`--reserve-props=${P.source}`),fe&&e.push(`--jsx=${fe}`),ce&&e.push(`--jsx-factory=${ce}`),me&&e.push(`--jsx-fragment=${me}`),se)for(let te in se){if(te.indexOf("=")>=0)throw new Error(`Invalid define: ${te}`);e.push(`--define:${te}=${se[te]}`)}if(be)for(let te of be)e.push(`--pure:${te}`);Se&&e.push("--keep-names")}function pt(e,t,r,i,p){var b;let l=[],c=[],s=Object.create(null),y=null,O=null,P=null;Me(l,t,s,r,i),Qe(l,t,s);let L=n(t,s,"sourcemap",Ye),x=n(t,s,"bundle",z),S=n(t,s,"watch",at),ae=n(t,s,"splitting",z),re=n(t,s,"preserveSymlinks",z),le=n(t,s,"metafile",z),ie=n(t,s,"outfile",m),ue=n(t,s,"outdir",m),fe=n(t,s,"outbase",m),ce=n(t,s,"platform",m),me=n(t,s,"tsconfig",m),se=n(t,s,"resolveExtensions",V),be=n(t,s,"nodePaths",V),Se=n(t,s,"mainFields",V),te=n(t,s,"conditions",V),g=n(t,s,"external",V),u=n(t,s,"loader",ge),a=n(t,s,"outExtension",ge),f=n(t,s,"publicPath",m),F=n(t,s,"entryNames",m),D=n(t,s,"chunkNames",m),M=n(t,s,"assetNames",m),E=n(t,s,"inject",V),T=n(t,s,"banner",ge),C=n(t,s,"footer",ge),R=n(t,s,"entryPoints",ut),U=n(t,s,"absWorkingDir",m),k=n(t,s,"stdin",ge),A=(b=n(t,s,"write",z))!=null?b:p,W=n(t,s,"allowOverwrite",z),ee=n(t,s,"incremental",z)===!0,$=n(t,s,"mangleCache",ge);if(s.plugins=!0,Y(t,s,`in ${e}() call`),L&&l.push(`--sourcemap${L===!0?"":`=${L}`}`),x&&l.push("--bundle"),W&&l.push("--allow-overwrite"),S)if(l.push("--watch"),typeof S=="boolean")P={};else{let o=Object.create(null),v=n(S,o,"onRebuild",je);Y(S,o,`on "watch" in ${e}() call`),P={onRebuild:v}}if(ae&&l.push("--splitting"),re&&l.push("--preserve-symlinks"),le&&l.push("--metafile"),ie&&l.push(`--outfile=${ie}`),ue&&l.push(`--outdir=${ue}`),fe&&l.push(`--outbase=${fe}`),ce&&l.push(`--platform=${ce}`),me&&l.push(`--tsconfig=${me}`),se){let o=[];for(let v of se){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);o.push(v)}l.push(`--resolve-extensions=${o.join(",")}`)}if(f&&l.push(`--public-path=${f}`),F&&l.push(`--entry-names=${F}`),D&&l.push(`--chunk-names=${D}`),M&&l.push(`--asset-names=${M}`),Se){let o=[];for(let v of Se){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);o.push(v)}l.push(`--main-fields=${o.join(",")}`)}if(te){let o=[];for(let v of te){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);o.push(v)}l.push(`--conditions=${o.join(",")}`)}if(g)for(let o of g)l.push(`--external:${o}`);if(T)for(let o in T){if(o.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${o}`);l.push(`--banner:${o}=${T[o]}`)}if(C)for(let o in C){if(o.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${o}`);l.push(`--footer:${o}=${C[o]}`)}if(E)for(let o of E)l.push(`--inject:${o}`);if(u)for(let o in u){if(o.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${o}`);l.push(`--loader:${o}=${u[o]}`)}if(a)for(let o in a){if(o.indexOf("=")>=0)throw new Error(`Invalid out extension: ${o}`);l.push(`--out-extension:${o}=${a[o]}`)}if(R)if(Array.isArray(R))for(let o of R)c.push(["",o+""]);else for(let[o,v]of Object.entries(R))c.push([o+"",v+""]);if(k){let o=Object.create(null),v=n(k,o,"contents",m),q=n(k,o,"resolveDir",m),w=n(k,o,"sourcefile",m),d=n(k,o,"loader",m);Y(k,o,'in "stdin" object'),w&&l.push(`--sourcefile=${w}`),d&&l.push(`--loader=${d}`),q&&(O=q+""),y=v?v+"":""}let h=[];if(be)for(let o of be)o+="",h.push(o);return{entries:c,flags:l,write:A,stdinContents:y,stdinResolveDir:O,absWorkingDir:U,incremental:ee,nodePaths:h,watch:P,mangleCache:Ge($)}}function gt(e,t,r,i){let p=[],l=Object.create(null);Me(p,t,l,r,i),Qe(p,t,l);let c=n(t,l,"sourcemap",Ye),s=n(t,l,"tsconfigRaw",ft),y=n(t,l,"sourcefile",m),O=n(t,l,"loader",m),P=n(t,l,"banner",m),L=n(t,l,"footer",m),x=n(t,l,"mangleCache",ge);return Y(t,l,`in ${e}() call`),c&&p.push(`--sourcemap=${c===!0?"external":c}`),s&&p.push(`--tsconfig-raw=${typeof s=="string"?s:JSON.stringify(s)}`),y&&p.push(`--sourcefile=${y}`),O&&p.push(`--loader=${O}`),P&&p.push(`--banner=${P}`),L&&p.push(`--footer=${L}`),{flags:p,mangleCache:Ge(x)}}function Xe(e){let t=new Map,r=new Map,i=new Map,p=new Map,l=!1,c=0,s=0,y=new Uint8Array(16*1024),O=0,P=g=>{let u=O+g.length;if(u>y.length){let f=new Uint8Array(u*2);f.set(y),y=f}y.set(g,O),O+=g.length;let a=0;for(;a+4<=O;){let f=Fe(y,a);if(a+4+f>O)break;a+=4,le(y.subarray(a,a+f)),a+=f}a>0&&(y.copyWithin(0,a,O),O-=a)},L=()=>{l=!0;for(let g of t.values())g("The service was stopped",null);t.clear();for(let g of p.values())g.onWait("The service was stopped");p.clear();for(let g of i.values())try{g(new Error("The service was stopped"),null)}catch(u){console.error(u)}i.clear()},x=(g,u,a)=>{if(l)return a("The service is no longer running",null);let f=c++;t.set(f,(F,D)=>{try{a(F,D)}finally{g&&g.unref()}}),g&&g.ref(),e.writeToStdin(Ae({id:f,isRequest:!0,value:u}))},S=(g,u)=>{if(l)throw new Error("The service is no longer running");e.writeToStdin(Ae({id:g,isRequest:!1,value:u}))},ae=async(g,u)=>{try{switch(u.command){case"ping":{S(g,{});break}case"on-start":{let a=r.get(u.key);a?S(g,await a(u)):S(g,{});break}case"on-resolve":{let a=r.get(u.key);a?S(g,await a(u)):S(g,{});break}case"on-load":{let a=r.get(u.key);a?S(g,await a(u)):S(g,{});break}case"serve-request":{let a=p.get(u.key);a&&a.onRequest&&a.onRequest(u.args),S(g,{});break}case"serve-wait":{let a=p.get(u.key);a&&a.onWait(u.error),S(g,{});break}case"watch-rebuild":{let a=i.get(u.key);try{a&&a(null,u.args)}catch(f){console.error(f)}S(g,{});break}default:throw new Error("Invalid command: "+u.command)}}catch(a){S(g,{errors:[we(a,e,null,void 0,"")]})}},re=!0,le=g=>{if(re){re=!1;let a=String.fromCharCode(...g);if(a!=="0.14.21")throw new Error(`Cannot start service: Host version "0.14.21" does not match binary version ${JSON.stringify(a)}`);return}let u=ze(g);if(u.isRequest)ae(u.id,u.value);else{let a=t.get(u.id);t.delete(u.id),u.value.error?a(u.value.error,{}):a(null,u.value)}},ie=async(g,u,a,f,F)=>{let D=[],M=[],E={},T={},C=0,R=0,U=[],k=!1;u=[...u];for(let $ of u){let h={};if(typeof $!="object")throw new Error(`Plugin at index ${R} must be an object`);let b=n($,h,"name",m);if(typeof b!="string"||b==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let o=n($,h,"setup",je);if(typeof o!="function")throw new Error("Plugin is missing a setup function");Y($,h,`on plugin ${JSON.stringify(b)}`);let v={name:b,onResolve:[],onLoad:[]};R++;let w=o({initialOptions:g,resolve:(d,N={})=>{if(!k)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof d!="string")throw new Error("The path to resolve must be a string");let B=Object.create(null),H=n(N,B,"pluginName",m),I=n(N,B,"importer",m),_=n(N,B,"namespace",m),X=n(N,B,"resolveDir",m),G=n(N,B,"kind",m),j=n(N,B,"pluginData",Ee);return Y(N,B,"in resolve() call"),new Promise((J,Q)=>{let K={command:"resolve",path:d,key:a,pluginName:b};H!=null&&(K.pluginName=H),I!=null&&(K.importer=I),_!=null&&(K.namespace=_),X!=null&&(K.resolveDir=X),G!=null&&(K.kind=G),j!=null&&(K.pluginData=f.store(j)),x(F,K,(oe,Z)=>{oe!==null?Q(new Error(oe)):J({errors:pe(Z.errors,f),warnings:pe(Z.warnings,f),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:f.load(Z.pluginData)})})})},onStart(d){let N='This error came from the "onStart" callback registered here:',B=xe(new Error(N),e,"onStart");D.push({name:b,callback:d,note:B})},onEnd(d){let N='This error came from the "onEnd" callback registered here:',B=xe(new Error(N),e,"onEnd");M.push({name:b,callback:d,note:B})},onResolve(d,N){let B='This error came from the "onResolve" callback registered here:',H=xe(new Error(B),e,"onResolve"),I={},_=n(d,I,"filter",$e),X=n(d,I,"namespace",m);if(Y(d,I,`in onResolve() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onResolve() call is missing a filter");let G=C++;E[G]={name:b,callback:N,note:H},v.onResolve.push({id:G,filter:_.source,namespace:X||""})},onLoad(d,N){let B='This error came from the "onLoad" callback registered here:',H=xe(new Error(B),e,"onLoad"),I={},_=n(d,I,"filter",$e),X=n(d,I,"namespace",m);if(Y(d,I,`in onLoad() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onLoad() call is missing a filter");let G=C++;T[G]={name:b,callback:N,note:H},v.onLoad.push({id:G,filter:_.source,namespace:X||""})},esbuild:e.esbuild});w&&await w,U.push(v)}catch(o){return{ok:!1,error:o,pluginName:b}}}let A=async $=>{switch($.command){case"on-start":{let h={errors:[],warnings:[]};return await Promise.all(D.map(async({name:b,callback:o,note:v})=>{try{let q=await o();if(q!=null){if(typeof q!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(b)} to return an object`);let w={},d=n(q,w,"errors",V),N=n(q,w,"warnings",V);Y(q,w,`from onStart() callback in plugin ${JSON.stringify(b)}`),d!=null&&h.errors.push(...he(d,"errors",f,b)),N!=null&&h.warnings.push(...he(N,"warnings",f,b))}}catch(q){h.errors.push(we(q,e,f,v&&v(),b))}})),h}case"on-resolve":{let h={},b="",o,v;for(let q of $.ids)try{({name:b,callback:o,note:v}=E[q]);let w=await o({path:$.path,importer:$.importer,namespace:$.namespace,resolveDir:$.resolveDir,kind:$.kind,pluginData:f.load($.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(b)} to return an object`);let d={},N=n(w,d,"pluginName",m),B=n(w,d,"path",m),H=n(w,d,"namespace",m),I=n(w,d,"suffix",m),_=n(w,d,"external",z),X=n(w,d,"sideEffects",z),G=n(w,d,"pluginData",Ee),j=n(w,d,"errors",V),J=n(w,d,"warnings",V),Q=n(w,d,"watchFiles",V),K=n(w,d,"watchDirs",V);Y(w,d,`from onResolve() callback in plugin ${JSON.stringify(b)}`),h.id=q,N!=null&&(h.pluginName=N),B!=null&&(h.path=B),H!=null&&(h.namespace=H),I!=null&&(h.suffix=I),_!=null&&(h.external=_),X!=null&&(h.sideEffects=X),G!=null&&(h.pluginData=f.store(G)),j!=null&&(h.errors=he(j,"errors",f,b)),J!=null&&(h.warnings=he(J,"warnings",f,b)),Q!=null&&(h.watchFiles=ke(Q,"watchFiles")),K!=null&&(h.watchDirs=ke(K,"watchDirs"));break}}catch(w){return{id:q,errors:[we(w,e,f,v&&v(),b)]}}return h}case"on-load":{let h={},b="",o,v;for(let q of $.ids)try{({name:b,callback:o,note:v}=T[q]);let w=await o({path:$.path,namespace:$.namespace,suffix:$.suffix,pluginData:f.load($.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(b)} to return an object`);let d={},N=n(w,d,"pluginName",m),B=n(w,d,"contents",dt),H=n(w,d,"resolveDir",m),I=n(w,d,"pluginData",Ee),_=n(w,d,"loader",m),X=n(w,d,"errors",V),G=n(w,d,"warnings",V),j=n(w,d,"watchFiles",V),J=n(w,d,"watchDirs",V);Y(w,d,`from onLoad() callback in plugin ${JSON.stringify(b)}`),h.id=q,N!=null&&(h.pluginName=N),B instanceof Uint8Array?h.contents=B:B!=null&&(h.contents=de(B)),H!=null&&(h.resolveDir=H),I!=null&&(h.pluginData=f.store(I)),_!=null&&(h.loader=_),X!=null&&(h.errors=he(X,"errors",f,b)),G!=null&&(h.warnings=he(G,"warnings",f,b)),j!=null&&(h.watchFiles=ke(j,"watchFiles")),J!=null&&(h.watchDirs=ke(J,"watchDirs"));break}}catch(w){return{id:q,errors:[we(w,e,f,v&&v(),b)]}}return h}default:throw new Error("Invalid command: "+$.command)}},W=($,h,b)=>b();M.length>0&&(W=($,h,b)=>{(async()=>{for(let{name:o,callback:v,note:q}of M)try{await v($)}catch(w){$.errors.push(await new Promise(d=>h(w,o,q&&q(),d)))}})().then(b)}),k=!0;let ee=0;return{ok:!0,requestPlugins:U,runOnEndCallbacks:W,pluginRefs:{ref(){++ee===1&&r.set(a,A)},unref(){--ee===0&&r.delete(a)}}}},ue=(g,u,a,f)=>{let F={},D=n(u,F,"port",Re),M=n(u,F,"host",m),E=n(u,F,"servedir",m),T=n(u,F,"onRequest",je),C,R=new Promise((U,k)=>{C=A=>{p.delete(f),A!==null?k(new Error(A)):U()}});return a.serve={},Y(u,F,"in serve() call"),D!==void 0&&(a.serve.port=D),M!==void 0&&(a.serve.host=M),E!==void 0&&(a.serve.servedir=E),p.set(f,{onRequest:T,onWait:C}),{wait:R,stop(){x(g,{command:"serve-stop",key:f},()=>{})}}},fe="warning",ce="silent",me=g=>{let u=s++,a=Ve(),f,{refs:F,options:D,isTTY:M,callback:E}=g;if(typeof D=="object"){let R=D.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');f=R}}let T=(R,U,k,A)=>{let W=[];try{Me(W,D,{},M,fe)}catch($){}let ee=we(R,e,a,k,U);x(F,{command:"error",flags:W,error:ee},()=>{ee.detail=a.load(ee.detail),A(ee)})},C=(R,U)=>{T(R,U,void 0,k=>{E(ve("Build failed",[k],[]),null)})};if(f&&f.length>0){if(e.isSync)return C(new Error("Cannot use plugins in synchronous API calls"),"");ie(D,f,u,a,F).then(R=>{if(!R.ok)C(R.error,R.pluginName);else try{se(Be(Te({},g),{key:u,details:a,logPluginError:T,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(U){C(U,"")}},R=>C(R,""))}else try{se(Be(Te({},g),{key:u,details:a,logPluginError:T,requestPlugins:null,runOnEndCallbacks:(R,U,k)=>k(),pluginRefs:null}))}catch(R){C(R,"")}},se=({callName:g,refs:u,serveOptions:a,options:f,isTTY:F,defaultWD:D,callback:M,key:E,details:T,logPluginError:C,requestPlugins:R,runOnEndCallbacks:U,pluginRefs:k})=>{let A={ref(){k&&k.ref(),u&&u.ref()},unref(){k&&k.unref(),u&&u.unref()}},W=!e.isBrowser,{entries:ee,flags:$,write:h,stdinContents:b,stdinResolveDir:o,absWorkingDir:v,incremental:q,nodePaths:w,watch:d,mangleCache:N}=pt(g,f,F,fe,W),B={command:"build",key:E,entries:ee,flags:$,write:h,stdinContents:b,stdinResolveDir:o,absWorkingDir:v||D,incremental:q,nodePaths:w};R&&(B.plugins=R),N&&(B.mangleCache=N);let H=a&&ue(A,a,B,E),I,_,X=(j,J)=>{j.outputFiles&&(J.outputFiles=j.outputFiles.map(mt)),j.metafile&&(J.metafile=JSON.parse(j.metafile)),j.mangleCache&&(J.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(ye(j.writeToStdout).replace(/\n$/,""))},G=(j,J)=>{let Q={errors:pe(j.errors,T),warnings:pe(j.warnings,T)};X(j,Q),U(Q,C,()=>{if(Q.errors.length>0)return J(ve("Build failed",Q.errors,Q.warnings),null);if(j.rebuild){if(!I){let K=!1;I=()=>new Promise((oe,Z)=>{if(K||l)throw new Error("Cannot rebuild");x(A,{command:"rebuild",key:E},(ne,et)=>{if(ne)return J(ve("Build failed",[{pluginName:"",text:ne,location:null,notes:[],detail:void 0}],[]),null);G(et,(Pe,tt)=>{Pe?Z(Pe):oe(tt)})})}),A.ref(),I.dispose=()=>{K||(K=!0,x(A,{command:"rebuild-dispose",key:E},()=>{}),A.unref())}}Q.rebuild=I}if(j.watch){if(!_){let K=!1;A.ref(),_=()=>{K||(K=!0,i.delete(E),x(A,{command:"watch-stop",key:E},()=>{}),A.unref())},d&&i.set(E,(oe,Z)=>{if(oe){d.onRebuild&&d.onRebuild(oe,null);return}let ne={errors:pe(Z.errors,T),warnings:pe(Z.warnings,T)};X(Z,ne),U(ne,C,()=>{if(ne.errors.length>0){d.onRebuild&&d.onRebuild(ve("Build failed",ne.errors,ne.warnings),null);return}Z.rebuildID!==void 0&&(ne.rebuild=I),ne.stop=_,d.onRebuild&&d.onRebuild(null,ne)})})}Q.stop=_}J(null,Q)})};if(h&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(q&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(d&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');x(A,B,(j,J)=>{if(j)return M(new Error(j),null);if(H){let Q=J,K=!1;A.ref();let oe={port:Q.port,host:Q.host,wait:H.wait,stop(){K||(K=!0,H.stop(),A.unref())}};return A.ref(),H.wait.then(A.unref,A.unref),M(null,oe)}return G(J,M)})};return{readFromStdout:P,afterClose:L,service:{buildOrServe:me,transform:({callName:g,refs:u,input:a,options:f,isTTY:F,fs:D,callback:M})=>{let E=Ve(),T=C=>{try{if(typeof a!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:U}=gt(g,f,F,ce),k={command:"transform",flags:R,inputFS:C!==null,input:C!==null?C:a};U&&(k.mangleCache=U),x(u,k,(A,W)=>{if(A)return M(new Error(A),null);let ee=pe(W.errors,E),$=pe(W.warnings,E),h=1,b=()=>{if(--h===0){let o={warnings:$,code:W.code,map:W.map};W.mangleCache&&(o.mangleCache=W==null?void 0:W.mangleCache),M(null,o)}};if(ee.length>0)return M(ve("Transform failed",ee,$),null);W.codeFS&&(h++,D.readFile(W.code,(o,v)=>{o!==null?M(o,null):(W.code=v,b())})),W.mapFS&&(h++,D.readFile(W.map,(o,v)=>{o!==null?M(o,null):(W.map=v,b())})),b()})}catch(R){let U=[];try{Me(U,f,{},F,ce)}catch(A){}let k=we(R,e,E,void 0,"");x(u,{command:"error",flags:U,error:k},()=>{k.detail=E.load(k.detail),M(ve("Transform failed",[k],[]),null)})}};if(typeof a=="string"&&a.length>1024*1024){let C=T;T=()=>D.writeFile(a,C)}T(null)},formatMessages:({callName:g,refs:u,messages:a,options:f,callback:F})=>{let D=he(a,"messages",null,"");if(!f)throw new Error(`Missing second argument in ${g}() call`);let M={},E=n(f,M,"kind",m),T=n(f,M,"color",z),C=n(f,M,"terminalWidth",Re);if(Y(f,M,`in ${g}() call`),E===void 0)throw new Error(`Missing "kind" in ${g}() call`);if(E!=="error"&&E!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${g}() call`);let R={command:"format-msgs",messages:D,isWarning:E==="warning"};T!==void 0&&(R.color=T),C!==void 0&&(R.terminalWidth=C),x(u,R,(U,k)=>{if(U)return F(new Error(U),null);F(null,k.messages)})},analyzeMetafile:({callName:g,refs:u,metafile:a,options:f,callback:F})=>{f===void 0&&(f={});let D={},M=n(f,D,"color",z),E=n(f,D,"verbose",z);Y(f,D,`in ${g}() call`);let T={command:"analyze-metafile",metafile:a};M!==void 0&&(T.color=M),E!==void 0&&(T.verbose=E),x(u,T,(C,R)=>{if(C)return F(new Error(C),null);F(null,R.result)})}}}}function Ve(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let i=t++;return e.set(i,r),i}}}function xe(e,t,r){let i,p=!1;return()=>{if(p)return i;p=!0;try{let l=(e.stack+"").split(`
2
2
  `);l.splice(1,1);let c=Ze(t,l,r);if(c)return i={text:e.message,location:c},i}catch(l){}}}function we(e,t,r,i,p){let l="Internal error",c=null;try{l=(e&&e.message||e)+""}catch(s){}try{c=Ze(t,(e.stack+"").split(`
3
3
  `),"")}catch(s){}return{pluginName:p,text:l,location:c,notes:i?[i]:[],detail:r?r.store(e):-1}}function Ze(e,t,r){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let p=1;p<t.length;p++){let l=t[p];if(!!l.startsWith(i))for(l=l.slice(i.length);;){let c=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(c){l=c[1];continue}if(c=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),c){l=c[1];continue}if(c=/^(\S+):(\d+):(\d+)$/.exec(l),c){let s;try{s=e.readFileSync(c[1],"utf8")}catch(L){break}let y=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+c[2]-1]||"",O=+c[3]-1,P=y.slice(O,O+r.length)===r?r.length:0;return{file:c[1],namespace:"file",line:+c[2],column:de(y.slice(0,O)).length,length:de(y.slice(O,O+P)).length,lineText:y+`
4
4
  `+t.slice(1).join(`
5
5
  `),suggestion:""}}break}}return null}function ve(e,t,r){let i=5,p=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((c,s)=>{if(s===i)return`
6
6
  ...`;if(!c.location)return`
7
7
  error: ${c.text}`;let{file:y,line:O,column:P}=c.location,L=c.pluginName?`[plugin: ${c.pluginName}] `:"";return`
8
- ${y}:${O}:${P}: ERROR: ${L}${c.text}`}).join(""),l=new Error(`${e}${p}`);return l.errors=t,l.warnings=r,l}function pe(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Je(e,t){if(e==null)return null;let r={},i=n(e,r,"file",m),p=n(e,r,"namespace",m),l=n(e,r,"line",Re),c=n(e,r,"column",Re),s=n(e,r,"length",Re),y=n(e,r,"lineText",m),O=n(e,r,"suggestion",m);return Y(e,r,t),{file:i||"",namespace:p||"",line:l||0,column:c||0,length:s||0,lineText:y||"",suggestion:O||""}}function he(e,t,r,i){let p=[],l=0;for(let c of e){let s={},y=n(c,s,"pluginName",m),O=n(c,s,"text",m),P=n(c,s,"location",_e),L=n(c,s,"notes",V),x=n(c,s,"detail",Ee),S=`in element ${l} of "${t}"`;Y(c,s,S);let ae=[];if(L)for(let re of L){let le={},ie=n(re,le,"text",m),ue=n(re,le,"location",_e);Y(re,le,S),ae.push({text:ie||"",location:Je(ue,S)})}p.push({pluginName:y||i,text:O||"",location:Je(P,S),notes:ae,detail:r?r.store(x):-1}),l++}return p}function ke(e,t){let r=[];for(let i of e){if(typeof i!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(i)}return r}function mt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=ye(t)),r}}}var ht="0.14.20",bt=e=>Ce().build(e),wt=()=>{throw new Error('The "serve" API only works in node')},vt=(e,t)=>Ce().transform(e,t),Rt=(e,t)=>Ce().formatMessages(e,t),Ot=(e,t)=>Ce().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')},Oe,Le,Ce=()=>{if(Le)return Le;throw Oe?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},$t=e=>{e=He(e||{});let t=e.wasmURL,r=e.worker!==!1;if(!t)throw new Error('Must provide the "wasmURL" option');if(t+="",Oe)throw new Error('Cannot call "initialize" more than once');return Oe=Mt(t,r),Oe.catch(()=>{Oe=void 0}),Oe},Mt=async(e,t)=>{let r=await fetch(e);if(!r.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);let i=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)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let 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,2146959360|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.20"],WebAssembly.instantiate(c,o.importObject).then(({instance:e})=>o.run(e))};}',l;if(t){let y=new Blob([p],{type:"text/javascript"});l=new Worker(URL.createObjectURL(y))}else{let O=new Function("postMessage",p+"var onmessage; return m => onmessage(m)")(P=>l.onmessage({data:P}));l={onmessage:null,postMessage:P=>O({data:P}),terminate(){}}}l.postMessage(i),l.onmessage=({data:y})=>c(y);let{readFromStdout:c,service:s}=Xe({writeToStdin(y){l.postMessage(y)},isSync:!1,isBrowser:!0,esbuild:Ue});Le={build:y=>new Promise((O,P)=>s.buildOrServe({callName:"build",refs:null,serveOptions:null,options:y,isTTY:!1,defaultWD:"/",callback:(L,x)=>L?P(L):O(x)})),transform:(y,O)=>new Promise((P,L)=>s.transform({callName:"transform",refs:null,input:y,options:O||{},isTTY:!1,fs:{readFile(x,S){S(new Error("Internal error"),null)},writeFile(x,S){S(null)}},callback:(x,S)=>x?L(x):P(S)})),formatMessages:(y,O)=>new Promise((P,L)=>s.formatMessages({callName:"formatMessages",refs:null,messages:y,options:O,callback:(x,S)=>x?L(x):P(S)})),analyzeMetafile:(y,O)=>new Promise((P,L)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof y=="string"?y:JSON.stringify(y),options:O,callback:(x,S)=>x?L(x):P(S)}))}};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};
8
+ ${y}:${O}:${P}: ERROR: ${L}${c.text}`}).join(""),l=new Error(`${e}${p}`);return l.errors=t,l.warnings=r,l}function pe(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Je(e,t){if(e==null)return null;let r={},i=n(e,r,"file",m),p=n(e,r,"namespace",m),l=n(e,r,"line",Re),c=n(e,r,"column",Re),s=n(e,r,"length",Re),y=n(e,r,"lineText",m),O=n(e,r,"suggestion",m);return Y(e,r,t),{file:i||"",namespace:p||"",line:l||0,column:c||0,length:s||0,lineText:y||"",suggestion:O||""}}function he(e,t,r,i){let p=[],l=0;for(let c of e){let s={},y=n(c,s,"pluginName",m),O=n(c,s,"text",m),P=n(c,s,"location",_e),L=n(c,s,"notes",V),x=n(c,s,"detail",Ee),S=`in element ${l} of "${t}"`;Y(c,s,S);let ae=[];if(L)for(let re of L){let le={},ie=n(re,le,"text",m),ue=n(re,le,"location",_e);Y(re,le,S),ae.push({text:ie||"",location:Je(ue,S)})}p.push({pluginName:y||i,text:O||"",location:Je(P,S),notes:ae,detail:r?r.store(x):-1}),l++}return p}function ke(e,t){let r=[];for(let i of e){if(typeof i!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(i)}return r}function mt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=ye(t)),r}}}var ht="0.14.21",bt=e=>Ce().build(e),wt=()=>{throw new Error('The "serve" API only works in node')},vt=(e,t)=>Ce().transform(e,t),Rt=(e,t)=>Ce().formatMessages(e,t),Ot=(e,t)=>Ce().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')},Oe,Le,Ce=()=>{if(Le)return Le;throw Oe?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},$t=e=>{e=He(e||{});let t=e.wasmURL,r=e.worker!==!1;if(!t)throw new Error('Must provide the "wasmURL" option');if(t+="",Oe)throw new Error('Cannot call "initialize" more than once');return Oe=Mt(t,r),Oe.catch(()=>{Oe=void 0}),Oe},Mt=async(e,t)=>{let r=await fetch(e);if(!r.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);let i=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)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let 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,2146959360|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.21"],WebAssembly.instantiate(c,o.importObject).then(({instance:e})=>o.run(e))};}',l;if(t){let y=new Blob([p],{type:"text/javascript"});l=new Worker(URL.createObjectURL(y))}else{let O=new Function("postMessage",p+"var onmessage; return m => onmessage(m)")(P=>l.onmessage({data:P}));l={onmessage:null,postMessage:P=>O({data:P}),terminate(){}}}l.postMessage(i),l.onmessage=({data:y})=>c(y);let{readFromStdout:c,service:s}=Xe({writeToStdin(y){l.postMessage(y)},isSync:!1,isBrowser:!0,esbuild:Ue});Le={build:y=>new Promise((O,P)=>s.buildOrServe({callName:"build",refs:null,serveOptions:null,options:y,isTTY:!1,defaultWD:"/",callback:(L,x)=>L?P(L):O(x)})),transform:(y,O)=>new Promise((P,L)=>s.transform({callName:"transform",refs:null,input:y,options:O||{},isTTY:!1,fs:{readFile(x,S){S(new Error("Internal error"),null)},writeFile(x,S){S(null)}},callback:(x,S)=>x?L(x):P(S)})),formatMessages:(y,O)=>new Promise((P,L)=>s.formatMessages({callName:"formatMessages",refs:null,messages:y,options:O,callback:(x,S)=>x?L(x):P(S)})),analyzeMetafile:(y,O)=>new Promise((P,L)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof y=="string"?y:JSON.stringify(y),options:O,callback:(x,S)=>x?L(x):P(S)}))}};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};
@@ -760,8 +760,8 @@ function createChannel(streamIn) {
760
760
  if (isFirstPacket) {
761
761
  isFirstPacket = false;
762
762
  let binaryVersion = String.fromCharCode(...bytes);
763
- if (binaryVersion !== "0.14.20") {
764
- throw new Error(`Cannot start service: Host version "${"0.14.20"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
763
+ if (binaryVersion !== "0.14.21") {
764
+ throw new Error(`Cannot start service: Host version "${"0.14.21"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
765
765
  }
766
766
  return;
767
767
  }
@@ -1706,7 +1706,7 @@ function convertOutputFiles({ path, contents }) {
1706
1706
  }
1707
1707
 
1708
1708
  // lib/npm/browser.ts
1709
- var version = "0.14.20";
1709
+ var version = "0.14.21";
1710
1710
  var build = (options) => ensureServiceIsRunning().build(options);
1711
1711
  var serve = () => {
1712
1712
  throw new Error(`The "serve" API only works in node`);
@@ -2463,7 +2463,7 @@ onmessage = ({ data: wasm }) => {
2463
2463
  callback(null, count);
2464
2464
  };
2465
2465
  let go = new global.Go();
2466
- go.argv = ["", \`--service=\${"0.14.20"}\`];
2466
+ go.argv = ["", \`--service=\${"0.14.21"}\`];
2467
2467
  WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));
2468
2468
  };}`;
2469
2469
  let worker;
@@ -1,10 +1,10 @@
1
1
  (module=>{
2
- var ke=Object.defineProperty,lt=Object.defineProperties,it=Object.getOwnPropertyDescriptor,st=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable;var ze=(e,t,r)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,De=(e,t)=>{for(var r in t||(t={}))Ke.call(t,r)&&ze(e,r,t[r]);if(Ie)for(var r of Ie(t))at.call(t,r)&&ze(e,r,t[r]);return e},Ae=(e,t)=>lt(e,st(t)),ut=e=>ke(e,"__esModule",{value:!0});var ft=(e,t)=>{for(var r in t)ke(e,r,{get:t[r],enumerable:!0})},ct=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of ot(t))!Ke.call(e,u)&&(r||u!=="default")&&ke(e,u,{get:()=>t[u],enumerable:!(i=it(t,u))||i.enumerable});return e};var dt=(e=>(t,r)=>e&&e.get(t)||(r=ct(ut({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var de=(e,t,r)=>new Promise((i,u)=>{var l=d=>{try{s(r.next(d))}catch(O){u(O)}},c=d=>{try{s(r.throw(d))}catch(O){u(O)}},s=d=>d.done?i(d.value):Promise.resolve(d.value).then(l,c);s((r=r.apply(e,t)).next())});var We={};ft(We,{analyzeMetafile:()=>Mt,analyzeMetafileSync:()=>Bt,build:()=>xt,buildSync:()=>Ct,formatMessages:()=>$t,formatMessagesSync:()=>Tt,initialize:()=>Dt,serve:()=>kt,transform:()=>Et,transformSync:()=>Pt,version:()=>St});function Fe(e){let t=i=>{if(i===null)r.write8(0);else if(typeof i=="boolean")r.write8(1),r.write8(+i);else if(typeof i=="number")r.write8(2),r.write32(i|0);else if(typeof i=="string")r.write8(3),r.write(pe(i));else if(i instanceof Uint8Array)r.write8(4),r.write(i);else if(i instanceof Array){r.write8(5),r.write32(i.length);for(let u of i)t(u)}else{let u=Object.keys(i);r.write8(6),r.write32(u.length);for(let l of u)r.write(pe(l)),t(i[l])}},r=new je;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 _e(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return he(r.read());case 4:return r.read();case 5:{let c=r.read32(),s=[];for(let d=0;d<c;d++)s.push(t());return s}case 6:{let c=r.read32(),s={};for(let d=0;d<c;d++)s[he(r.read())]=t();return s}default:throw new Error("Invalid packet")}},r=new je(e),i=r.read32(),u=(i&1)===0;i>>>=1;let l=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:u,value:l}}var je=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 Le(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),i=this._read(r.length);return r.set(this.buf.subarray(i,i+t)),r}},pe,he;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;pe=r=>e.encode(r),he=r=>t.decode(r)}else if(typeof Buffer!="undefined")pe=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},he=e=>{let{buffer:t,byteOffset:r,byteLength:i}=e;return Buffer.from(t,r,i).toString()};else throw new Error("No UTF-8 codec found");function Le(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 Ve(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Me=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",gt=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",y=e=>typeof e=="string"?null:"a string",Ce=e=>e instanceof RegExp?null:"a RegExp object",Oe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Ue=e=>typeof e=="function"?null:"a function",_=e=>Array.isArray(e)?null:"an array",me=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",mt=e=>typeof e=="object"&&e!==null?null:"an array or an object",Je=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ge=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",yt=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",ht=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",bt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,i){let u=e[r];if(t[r+""]=!0,u===void 0)return;let l=i(u);if(l!==null)throw new Error(`"${r}" must be ${l}`);return u}function J(e,t,r){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${r}: "${i}"`)}function Qe(e){let t=Object.create(null),r=n(e,t,"wasmURL",y),i=n(e,t,"worker",I);return J(e,t,"in startService() call"),{wasmURL:r,worker:i}}function Xe(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let i=e[r];if(typeof i=="string"||i===!1)t[r]=i;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Pe(e,t,r,i,u){let l=n(t,r,"color",I),c=n(t,r,"logLevel",y),s=n(t,r,"logLimit",Oe);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${c||u}`),e.push(`--log-limit=${s||0}`)}function Ze(e,t,r){let i=n(t,r,"legalComments",y),u=n(t,r,"sourceRoot",y),l=n(t,r,"sourcesContent",I),c=n(t,r,"target",ht),s=n(t,r,"format",y),d=n(t,r,"globalName",y),O=n(t,r,"mangleProps",Ce),T=n(t,r,"reserveProps",Ce),L=n(t,r,"minify",I),x=n(t,r,"minifySyntax",I),S=n(t,r,"minifyWhitespace",I),ae=n(t,r,"minifyIdentifiers",I),re=n(t,r,"drop",_),le=n(t,r,"charset",y),ie=n(t,r,"treeShaking",I),ue=n(t,r,"ignoreAnnotations",I),fe=n(t,r,"jsx",y),ce=n(t,r,"jsxFactory",y),ye=n(t,r,"jsxFragment",y),se=n(t,r,"define",me),we=n(t,r,"pure",_),xe=n(t,r,"keepNames",I);if(i&&e.push(`--legal-comments=${i}`),u!==void 0&&e.push(`--source-root=${u}`),l!==void 0&&e.push(`--sources-content=${l}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(Ve).join(",")}`):e.push(`--target=${Ve(c)}`)),s&&e.push(`--format=${s}`),d&&e.push(`--global-name=${d}`),L&&e.push("--minify"),x&&e.push("--minify-syntax"),S&&e.push("--minify-whitespace"),ae&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),ue&&e.push("--ignore-annotations"),re)for(let te of re)e.push(`--drop:${te}`);if(O&&e.push(`--mangle-props=${O.source}`),T&&e.push(`--reserve-props=${T.source}`),fe&&e.push(`--jsx=${fe}`),ce&&e.push(`--jsx-factory=${ce}`),ye&&e.push(`--jsx-fragment=${ye}`),se)for(let te in se){if(te.indexOf("=")>=0)throw new Error(`Invalid define: ${te}`);e.push(`--define:${te}=${se[te]}`)}if(we)for(let te of we)e.push(`--pure:${te}`);xe&&e.push("--keep-names")}function wt(e,t,r,i,u){var w;let l=[],c=[],s=Object.create(null),d=null,O=null,T=null;Pe(l,t,s,r,i),Ze(l,t,s);let L=n(t,s,"sourcemap",Ge),x=n(t,s,"bundle",I),S=n(t,s,"watch",gt),ae=n(t,s,"splitting",I),re=n(t,s,"preserveSymlinks",I),le=n(t,s,"metafile",I),ie=n(t,s,"outfile",y),ue=n(t,s,"outdir",y),fe=n(t,s,"outbase",y),ce=n(t,s,"platform",y),ye=n(t,s,"tsconfig",y),se=n(t,s,"resolveExtensions",_),we=n(t,s,"nodePaths",_),xe=n(t,s,"mainFields",_),te=n(t,s,"conditions",_),m=n(t,s,"external",_),f=n(t,s,"loader",me),a=n(t,s,"outExtension",me),p=n(t,s,"publicPath",y),F=n(t,s,"entryNames",y),D=n(t,s,"chunkNames",y),C=n(t,s,"assetNames",y),E=n(t,s,"inject",_),B=n(t,s,"banner",me),P=n(t,s,"footer",me),R=n(t,s,"entryPoints",mt),U=n(t,s,"absWorkingDir",y),k=n(t,s,"stdin",me),A=(w=n(t,s,"write",I))!=null?w:u,q=n(t,s,"allowOverwrite",I),ee=n(t,s,"incremental",I)===!0,$=n(t,s,"mangleCache",me);if(s.plugins=!0,J(t,s,`in ${e}() call`),L&&l.push(`--sourcemap${L===!0?"":`=${L}`}`),x&&l.push("--bundle"),q&&l.push("--allow-overwrite"),S)if(l.push("--watch"),typeof S=="boolean")T={};else{let o=Object.create(null),v=n(S,o,"onRebuild",Ue);J(S,o,`on "watch" in ${e}() call`),T={onRebuild:v}}if(ae&&l.push("--splitting"),re&&l.push("--preserve-symlinks"),le&&l.push("--metafile"),ie&&l.push(`--outfile=${ie}`),ue&&l.push(`--outdir=${ue}`),fe&&l.push(`--outbase=${fe}`),ce&&l.push(`--platform=${ce}`),ye&&l.push(`--tsconfig=${ye}`),se){let o=[];for(let v of se){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);o.push(v)}l.push(`--resolve-extensions=${o.join(",")}`)}if(p&&l.push(`--public-path=${p}`),F&&l.push(`--entry-names=${F}`),D&&l.push(`--chunk-names=${D}`),C&&l.push(`--asset-names=${C}`),xe){let o=[];for(let v of xe){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);o.push(v)}l.push(`--main-fields=${o.join(",")}`)}if(te){let o=[];for(let v of te){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);o.push(v)}l.push(`--conditions=${o.join(",")}`)}if(m)for(let o of m)l.push(`--external:${o}`);if(B)for(let o in B){if(o.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${o}`);l.push(`--banner:${o}=${B[o]}`)}if(P)for(let o in P){if(o.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${o}`);l.push(`--footer:${o}=${P[o]}`)}if(E)for(let o of E)l.push(`--inject:${o}`);if(f)for(let o in f){if(o.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${o}`);l.push(`--loader:${o}=${f[o]}`)}if(a)for(let o in a){if(o.indexOf("=")>=0)throw new Error(`Invalid out extension: ${o}`);l.push(`--out-extension:${o}=${a[o]}`)}if(R)if(Array.isArray(R))for(let o of R)c.push(["",o+""]);else for(let[o,v]of Object.entries(R))c.push([o+"",v+""]);if(k){let o=Object.create(null),v=n(k,o,"contents",y),Y=n(k,o,"resolveDir",y),h=n(k,o,"sourcefile",y),g=n(k,o,"loader",y);J(k,o,'in "stdin" object'),h&&l.push(`--sourcefile=${h}`),g&&l.push(`--loader=${g}`),Y&&(O=Y+""),d=v?v+"":""}let b=[];if(we)for(let o of we)o+="",b.push(o);return{entries:c,flags:l,write:A,stdinContents:d,stdinResolveDir:O,absWorkingDir:U,incremental:ee,nodePaths:b,watch:T,mangleCache:Xe($)}}function vt(e,t,r,i){let u=[],l=Object.create(null);Pe(u,t,l,r,i),Ze(u,t,l);let c=n(t,l,"sourcemap",Ge),s=n(t,l,"tsconfigRaw",yt),d=n(t,l,"sourcefile",y),O=n(t,l,"loader",y),T=n(t,l,"banner",y),L=n(t,l,"footer",y),x=n(t,l,"mangleCache",me);return J(t,l,`in ${e}() call`),c&&u.push(`--sourcemap=${c===!0?"external":c}`),s&&u.push(`--tsconfig-raw=${typeof s=="string"?s:JSON.stringify(s)}`),d&&u.push(`--sourcefile=${d}`),O&&u.push(`--loader=${O}`),T&&u.push(`--banner=${T}`),L&&u.push(`--footer=${L}`),{flags:u,mangleCache:Xe(x)}}function et(e){let t=new Map,r=new Map,i=new Map,u=new Map,l=!1,c=0,s=0,d=new Uint8Array(16*1024),O=0,T=m=>{let f=O+m.length;if(f>d.length){let p=new Uint8Array(f*2);p.set(d),d=p}d.set(m,O),O+=m.length;let a=0;for(;a+4<=O;){let p=Le(d,a);if(a+4+p>O)break;a+=4,le(d.subarray(a,a+p)),a+=p}a>0&&(d.copyWithin(0,a,O),O-=a)},L=()=>{l=!0;for(let m of t.values())m("The service was stopped",null);t.clear();for(let m of u.values())m.onWait("The service was stopped");u.clear();for(let m of i.values())try{m(new Error("The service was stopped"),null)}catch(f){console.error(f)}i.clear()},x=(m,f,a)=>{if(l)return a("The service is no longer running",null);let p=c++;t.set(p,(F,D)=>{try{a(F,D)}finally{m&&m.unref()}}),m&&m.ref(),e.writeToStdin(Fe({id:p,isRequest:!0,value:f}))},S=(m,f)=>{if(l)throw new Error("The service is no longer running");e.writeToStdin(Fe({id:m,isRequest:!1,value:f}))},ae=(m,f)=>de(this,null,function*(){try{switch(f.command){case"ping":{S(m,{});break}case"on-start":{let a=r.get(f.key);a?S(m,yield a(f)):S(m,{});break}case"on-resolve":{let a=r.get(f.key);a?S(m,yield a(f)):S(m,{});break}case"on-load":{let a=r.get(f.key);a?S(m,yield a(f)):S(m,{});break}case"serve-request":{let a=u.get(f.key);a&&a.onRequest&&a.onRequest(f.args),S(m,{});break}case"serve-wait":{let a=u.get(f.key);a&&a.onWait(f.error),S(m,{});break}case"watch-rebuild":{let a=i.get(f.key);try{a&&a(null,f.args)}catch(p){console.error(p)}S(m,{});break}default:throw new Error("Invalid command: "+f.command)}}catch(a){S(m,{errors:[ve(a,e,null,void 0,"")]})}}),re=!0,le=m=>{if(re){re=!1;let a=String.fromCharCode(...m);if(a!=="0.14.20")throw new Error(`Cannot start service: Host version "0.14.20" does not match binary version ${JSON.stringify(a)}`);return}let f=_e(m);if(f.isRequest)ae(f.id,f.value);else{let a=t.get(f.id);t.delete(f.id),f.value.error?a(f.value.error,{}):a(null,f.value)}},ie=(m,f,a,p,F)=>de(this,null,function*(){let D=[],C=[],E={},B={},P=0,R=0,U=[],k=!1;f=[...f];for(let $ of f){let b={};if(typeof $!="object")throw new Error(`Plugin at index ${R} must be an object`);let w=n($,b,"name",y);if(typeof w!="string"||w==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let o=n($,b,"setup",Ue);if(typeof o!="function")throw new Error("Plugin is missing a setup function");J($,b,`on plugin ${JSON.stringify(w)}`);let v={name:w,onResolve:[],onLoad:[]};R++;let h=o({initialOptions:m,resolve:(g,N={})=>{if(!k)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof g!="string")throw new Error("The path to resolve must be a string");let M=Object.create(null),H=n(N,M,"pluginName",y),W=n(N,M,"importer",y),K=n(N,M,"namespace",y),X=n(N,M,"resolveDir",y),G=n(N,M,"kind",y),j=n(N,M,"pluginData",Me);return J(N,M,"in resolve() call"),new Promise((V,Q)=>{let z={command:"resolve",path:g,key:a,pluginName:w};H!=null&&(z.pluginName=H),W!=null&&(z.importer=W),K!=null&&(z.namespace=K),X!=null&&(z.resolveDir=X),G!=null&&(z.kind=G),j!=null&&(z.pluginData=p.store(j)),x(F,z,(oe,Z)=>{oe!==null?Q(new Error(oe)):V({errors:ge(Z.errors,p),warnings:ge(Z.warnings,p),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:p.load(Z.pluginData)})})})},onStart(g){let N='This error came from the "onStart" callback registered here:',M=Ee(new Error(N),e,"onStart");D.push({name:w,callback:g,note:M})},onEnd(g){let N='This error came from the "onEnd" callback registered here:',M=Ee(new Error(N),e,"onEnd");C.push({name:w,callback:g,note:M})},onResolve(g,N){let M='This error came from the "onResolve" callback registered here:',H=Ee(new Error(M),e,"onResolve"),W={},K=n(g,W,"filter",Ce),X=n(g,W,"namespace",y);if(J(g,W,`in onResolve() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onResolve() call is missing a filter");let G=P++;E[G]={name:w,callback:N,note:H},v.onResolve.push({id:G,filter:K.source,namespace:X||""})},onLoad(g,N){let M='This error came from the "onLoad" callback registered here:',H=Ee(new Error(M),e,"onLoad"),W={},K=n(g,W,"filter",Ce),X=n(g,W,"namespace",y);if(J(g,W,`in onLoad() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onLoad() call is missing a filter");let G=P++;B[G]={name:w,callback:N,note:H},v.onLoad.push({id:G,filter:K.source,namespace:X||""})},esbuild:e.esbuild});h&&(yield h),U.push(v)}catch(o){return{ok:!1,error:o,pluginName:w}}}let A=$=>de(this,null,function*(){switch($.command){case"on-start":{let b={errors:[],warnings:[]};return yield Promise.all(D.map(Y=>de(this,[Y],function*({name:w,callback:o,note:v}){try{let h=yield o();if(h!=null){if(typeof h!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},N=n(h,g,"errors",_),M=n(h,g,"warnings",_);J(h,g,`from onStart() callback in plugin ${JSON.stringify(w)}`),N!=null&&b.errors.push(...be(N,"errors",p,w)),M!=null&&b.warnings.push(...be(M,"warnings",p,w))}}catch(h){b.errors.push(ve(h,e,p,v&&v(),w))}}))),b}case"on-resolve":{let b={},w="",o,v;for(let Y of $.ids)try{({name:w,callback:o,note:v}=E[Y]);let h=yield o({path:$.path,importer:$.importer,namespace:$.namespace,resolveDir:$.resolveDir,kind:$.kind,pluginData:p.load($.pluginData)});if(h!=null){if(typeof h!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},N=n(h,g,"pluginName",y),M=n(h,g,"path",y),H=n(h,g,"namespace",y),W=n(h,g,"suffix",y),K=n(h,g,"external",I),X=n(h,g,"sideEffects",I),G=n(h,g,"pluginData",Me),j=n(h,g,"errors",_),V=n(h,g,"warnings",_),Q=n(h,g,"watchFiles",_),z=n(h,g,"watchDirs",_);J(h,g,`from onResolve() callback in plugin ${JSON.stringify(w)}`),b.id=Y,N!=null&&(b.pluginName=N),M!=null&&(b.path=M),H!=null&&(b.namespace=H),W!=null&&(b.suffix=W),K!=null&&(b.external=K),X!=null&&(b.sideEffects=X),G!=null&&(b.pluginData=p.store(G)),j!=null&&(b.errors=be(j,"errors",p,w)),V!=null&&(b.warnings=be(V,"warnings",p,w)),Q!=null&&(b.watchFiles=$e(Q,"watchFiles")),z!=null&&(b.watchDirs=$e(z,"watchDirs"));break}}catch(h){return{id:Y,errors:[ve(h,e,p,v&&v(),w)]}}return b}case"on-load":{let b={},w="",o,v;for(let Y of $.ids)try{({name:w,callback:o,note:v}=B[Y]);let h=yield o({path:$.path,namespace:$.namespace,suffix:$.suffix,pluginData:p.load($.pluginData)});if(h!=null){if(typeof h!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},N=n(h,g,"pluginName",y),M=n(h,g,"contents",bt),H=n(h,g,"resolveDir",y),W=n(h,g,"pluginData",Me),K=n(h,g,"loader",y),X=n(h,g,"errors",_),G=n(h,g,"warnings",_),j=n(h,g,"watchFiles",_),V=n(h,g,"watchDirs",_);J(h,g,`from onLoad() callback in plugin ${JSON.stringify(w)}`),b.id=Y,N!=null&&(b.pluginName=N),M instanceof Uint8Array?b.contents=M:M!=null&&(b.contents=pe(M)),H!=null&&(b.resolveDir=H),W!=null&&(b.pluginData=p.store(W)),K!=null&&(b.loader=K),X!=null&&(b.errors=be(X,"errors",p,w)),G!=null&&(b.warnings=be(G,"warnings",p,w)),j!=null&&(b.watchFiles=$e(j,"watchFiles")),V!=null&&(b.watchDirs=$e(V,"watchDirs"));break}}catch(h){return{id:Y,errors:[ve(h,e,p,v&&v(),w)]}}return b}default:throw new Error("Invalid command: "+$.command)}}),q=($,b,w)=>w();C.length>0&&(q=($,b,w)=>{(()=>de(this,null,function*(){for(let{name:o,callback:v,note:Y}of C)try{yield v($)}catch(h){$.errors.push(yield new Promise(g=>b(h,o,Y&&Y(),g)))}}))().then(w)}),k=!0;let ee=0;return{ok:!0,requestPlugins:U,runOnEndCallbacks:q,pluginRefs:{ref(){++ee===1&&r.set(a,A)},unref(){--ee===0&&r.delete(a)}}}}),ue=(m,f,a,p)=>{let F={},D=n(f,F,"port",Oe),C=n(f,F,"host",y),E=n(f,F,"servedir",y),B=n(f,F,"onRequest",Ue),P,R=new Promise((U,k)=>{P=A=>{u.delete(p),A!==null?k(new Error(A)):U()}});return a.serve={},J(f,F,"in serve() call"),D!==void 0&&(a.serve.port=D),C!==void 0&&(a.serve.host=C),E!==void 0&&(a.serve.servedir=E),u.set(p,{onRequest:B,onWait:P}),{wait:R,stop(){x(m,{command:"serve-stop",key:p},()=>{})}}},fe="warning",ce="silent",ye=m=>{let f=s++,a=Ye(),p,{refs:F,options:D,isTTY:C,callback:E}=m;if(typeof D=="object"){let R=D.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');p=R}}let B=(R,U,k,A)=>{let q=[];try{Pe(q,D,{},C,fe)}catch($){}let ee=ve(R,e,a,k,U);x(F,{command:"error",flags:q,error:ee},()=>{ee.detail=a.load(ee.detail),A(ee)})},P=(R,U)=>{B(R,U,void 0,k=>{E(Re("Build failed",[k],[]),null)})};if(p&&p.length>0){if(e.isSync)return P(new Error("Cannot use plugins in synchronous API calls"),"");ie(D,p,f,a,F).then(R=>{if(!R.ok)P(R.error,R.pluginName);else try{se(Ae(De({},m),{key:f,details:a,logPluginError:B,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(U){P(U,"")}},R=>P(R,""))}else try{se(Ae(De({},m),{key:f,details:a,logPluginError:B,requestPlugins:null,runOnEndCallbacks:(R,U,k)=>k(),pluginRefs:null}))}catch(R){P(R,"")}},se=({callName:m,refs:f,serveOptions:a,options:p,isTTY:F,defaultWD:D,callback:C,key:E,details:B,logPluginError:P,requestPlugins:R,runOnEndCallbacks:U,pluginRefs:k})=>{let A={ref(){k&&k.ref(),f&&f.ref()},unref(){k&&k.unref(),f&&f.unref()}},q=!e.isBrowser,{entries:ee,flags:$,write:b,stdinContents:w,stdinResolveDir:o,absWorkingDir:v,incremental:Y,nodePaths:h,watch:g,mangleCache:N}=wt(m,p,F,fe,q),M={command:"build",key:E,entries:ee,flags:$,write:b,stdinContents:w,stdinResolveDir:o,absWorkingDir:v||D,incremental:Y,nodePaths:h};R&&(M.plugins=R),N&&(M.mangleCache=N);let H=a&&ue(A,a,M,E),W,K,X=(j,V)=>{j.outputFiles&&(V.outputFiles=j.outputFiles.map(Rt)),j.metafile&&(V.metafile=JSON.parse(j.metafile)),j.mangleCache&&(V.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(he(j.writeToStdout).replace(/\n$/,""))},G=(j,V)=>{let Q={errors:ge(j.errors,B),warnings:ge(j.warnings,B)};X(j,Q),U(Q,P,()=>{if(Q.errors.length>0)return V(Re("Build failed",Q.errors,Q.warnings),null);if(j.rebuild){if(!W){let z=!1;W=()=>new Promise((oe,Z)=>{if(z||l)throw new Error("Cannot rebuild");x(A,{command:"rebuild",key:E},(ne,rt)=>{if(ne)return V(Re("Build failed",[{pluginName:"",text:ne,location:null,notes:[],detail:void 0}],[]),null);G(rt,(Be,nt)=>{Be?Z(Be):oe(nt)})})}),A.ref(),W.dispose=()=>{z||(z=!0,x(A,{command:"rebuild-dispose",key:E},()=>{}),A.unref())}}Q.rebuild=W}if(j.watch){if(!K){let z=!1;A.ref(),K=()=>{z||(z=!0,i.delete(E),x(A,{command:"watch-stop",key:E},()=>{}),A.unref())},g&&i.set(E,(oe,Z)=>{if(oe){g.onRebuild&&g.onRebuild(oe,null);return}let ne={errors:ge(Z.errors,B),warnings:ge(Z.warnings,B)};X(Z,ne),U(ne,P,()=>{if(ne.errors.length>0){g.onRebuild&&g.onRebuild(Re("Build failed",ne.errors,ne.warnings),null);return}Z.rebuildID!==void 0&&(ne.rebuild=W),ne.stop=K,g.onRebuild&&g.onRebuild(null,ne)})})}Q.stop=K}V(null,Q)})};if(b&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(Y&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(g&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');x(A,M,(j,V)=>{if(j)return C(new Error(j),null);if(H){let Q=V,z=!1;A.ref();let oe={port:Q.port,host:Q.host,wait:H.wait,stop(){z||(z=!0,H.stop(),A.unref())}};return A.ref(),H.wait.then(A.unref,A.unref),C(null,oe)}return G(V,C)})};return{readFromStdout:T,afterClose:L,service:{buildOrServe:ye,transform:({callName:m,refs:f,input:a,options:p,isTTY:F,fs:D,callback:C})=>{let E=Ye(),B=P=>{try{if(typeof a!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:U}=vt(m,p,F,ce),k={command:"transform",flags:R,inputFS:P!==null,input:P!==null?P:a};U&&(k.mangleCache=U),x(f,k,(A,q)=>{if(A)return C(new Error(A),null);let ee=ge(q.errors,E),$=ge(q.warnings,E),b=1,w=()=>{if(--b===0){let o={warnings:$,code:q.code,map:q.map};q.mangleCache&&(o.mangleCache=q==null?void 0:q.mangleCache),C(null,o)}};if(ee.length>0)return C(Re("Transform failed",ee,$),null);q.codeFS&&(b++,D.readFile(q.code,(o,v)=>{o!==null?C(o,null):(q.code=v,w())})),q.mapFS&&(b++,D.readFile(q.map,(o,v)=>{o!==null?C(o,null):(q.map=v,w())})),w()})}catch(R){let U=[];try{Pe(U,p,{},F,ce)}catch(A){}let k=ve(R,e,E,void 0,"");x(f,{command:"error",flags:U,error:k},()=>{k.detail=E.load(k.detail),C(Re("Transform failed",[k],[]),null)})}};if(typeof a=="string"&&a.length>1024*1024){let P=B;B=()=>D.writeFile(a,P)}B(null)},formatMessages:({callName:m,refs:f,messages:a,options:p,callback:F})=>{let D=be(a,"messages",null,"");if(!p)throw new Error(`Missing second argument in ${m}() call`);let C={},E=n(p,C,"kind",y),B=n(p,C,"color",I),P=n(p,C,"terminalWidth",Oe);if(J(p,C,`in ${m}() call`),E===void 0)throw new Error(`Missing "kind" in ${m}() call`);if(E!=="error"&&E!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${m}() call`);let R={command:"format-msgs",messages:D,isWarning:E==="warning"};B!==void 0&&(R.color=B),P!==void 0&&(R.terminalWidth=P),x(f,R,(U,k)=>{if(U)return F(new Error(U),null);F(null,k.messages)})},analyzeMetafile:({callName:m,refs:f,metafile:a,options:p,callback:F})=>{p===void 0&&(p={});let D={},C=n(p,D,"color",I),E=n(p,D,"verbose",I);J(p,D,`in ${m}() call`);let B={command:"analyze-metafile",metafile:a};C!==void 0&&(B.color=C),E!==void 0&&(B.verbose=E),x(f,B,(P,R)=>{if(P)return F(new Error(P),null);F(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 i=t++;return e.set(i,r),i}}}function Ee(e,t,r){let i,u=!1;return()=>{if(u)return i;u=!0;try{let l=(e.stack+"").split(`
2
+ var ke=Object.defineProperty,lt=Object.defineProperties,it=Object.getOwnPropertyDescriptor,st=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable;var ze=(e,t,r)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,De=(e,t)=>{for(var r in t||(t={}))Ke.call(t,r)&&ze(e,r,t[r]);if(Ie)for(var r of Ie(t))at.call(t,r)&&ze(e,r,t[r]);return e},Ae=(e,t)=>lt(e,st(t)),ut=e=>ke(e,"__esModule",{value:!0});var ft=(e,t)=>{for(var r in t)ke(e,r,{get:t[r],enumerable:!0})},ct=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of ot(t))!Ke.call(e,u)&&(r||u!=="default")&&ke(e,u,{get:()=>t[u],enumerable:!(i=it(t,u))||i.enumerable});return e};var dt=(e=>(t,r)=>e&&e.get(t)||(r=ct(ut({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var de=(e,t,r)=>new Promise((i,u)=>{var l=d=>{try{s(r.next(d))}catch(O){u(O)}},c=d=>{try{s(r.throw(d))}catch(O){u(O)}},s=d=>d.done?i(d.value):Promise.resolve(d.value).then(l,c);s((r=r.apply(e,t)).next())});var We={};ft(We,{analyzeMetafile:()=>Mt,analyzeMetafileSync:()=>Bt,build:()=>xt,buildSync:()=>Ct,formatMessages:()=>$t,formatMessagesSync:()=>Tt,initialize:()=>Dt,serve:()=>kt,transform:()=>Et,transformSync:()=>Pt,version:()=>St});function Fe(e){let t=i=>{if(i===null)r.write8(0);else if(typeof i=="boolean")r.write8(1),r.write8(+i);else if(typeof i=="number")r.write8(2),r.write32(i|0);else if(typeof i=="string")r.write8(3),r.write(pe(i));else if(i instanceof Uint8Array)r.write8(4),r.write(i);else if(i instanceof Array){r.write8(5),r.write32(i.length);for(let u of i)t(u)}else{let u=Object.keys(i);r.write8(6),r.write32(u.length);for(let l of u)r.write(pe(l)),t(i[l])}},r=new je;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 _e(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return he(r.read());case 4:return r.read();case 5:{let c=r.read32(),s=[];for(let d=0;d<c;d++)s.push(t());return s}case 6:{let c=r.read32(),s={};for(let d=0;d<c;d++)s[he(r.read())]=t();return s}default:throw new Error("Invalid packet")}},r=new je(e),i=r.read32(),u=(i&1)===0;i>>>=1;let l=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:u,value:l}}var je=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 Le(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),i=this._read(r.length);return r.set(this.buf.subarray(i,i+t)),r}},pe,he;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;pe=r=>e.encode(r),he=r=>t.decode(r)}else if(typeof Buffer!="undefined")pe=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},he=e=>{let{buffer:t,byteOffset:r,byteLength:i}=e;return Buffer.from(t,r,i).toString()};else throw new Error("No UTF-8 codec found");function Le(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 Ve(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Me=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",gt=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",y=e=>typeof e=="string"?null:"a string",Ce=e=>e instanceof RegExp?null:"a RegExp object",Oe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Ue=e=>typeof e=="function"?null:"a function",_=e=>Array.isArray(e)?null:"an array",me=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",mt=e=>typeof e=="object"&&e!==null?null:"an array or an object",Je=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ge=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",yt=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",ht=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",bt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,i){let u=e[r];if(t[r+""]=!0,u===void 0)return;let l=i(u);if(l!==null)throw new Error(`"${r}" must be ${l}`);return u}function J(e,t,r){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${r}: "${i}"`)}function Qe(e){let t=Object.create(null),r=n(e,t,"wasmURL",y),i=n(e,t,"worker",I);return J(e,t,"in startService() call"),{wasmURL:r,worker:i}}function Xe(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let i=e[r];if(typeof i=="string"||i===!1)t[r]=i;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Pe(e,t,r,i,u){let l=n(t,r,"color",I),c=n(t,r,"logLevel",y),s=n(t,r,"logLimit",Oe);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${c||u}`),e.push(`--log-limit=${s||0}`)}function Ze(e,t,r){let i=n(t,r,"legalComments",y),u=n(t,r,"sourceRoot",y),l=n(t,r,"sourcesContent",I),c=n(t,r,"target",ht),s=n(t,r,"format",y),d=n(t,r,"globalName",y),O=n(t,r,"mangleProps",Ce),T=n(t,r,"reserveProps",Ce),L=n(t,r,"minify",I),x=n(t,r,"minifySyntax",I),S=n(t,r,"minifyWhitespace",I),ae=n(t,r,"minifyIdentifiers",I),re=n(t,r,"drop",_),le=n(t,r,"charset",y),ie=n(t,r,"treeShaking",I),ue=n(t,r,"ignoreAnnotations",I),fe=n(t,r,"jsx",y),ce=n(t,r,"jsxFactory",y),ye=n(t,r,"jsxFragment",y),se=n(t,r,"define",me),we=n(t,r,"pure",_),xe=n(t,r,"keepNames",I);if(i&&e.push(`--legal-comments=${i}`),u!==void 0&&e.push(`--source-root=${u}`),l!==void 0&&e.push(`--sources-content=${l}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(Ve).join(",")}`):e.push(`--target=${Ve(c)}`)),s&&e.push(`--format=${s}`),d&&e.push(`--global-name=${d}`),L&&e.push("--minify"),x&&e.push("--minify-syntax"),S&&e.push("--minify-whitespace"),ae&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),ue&&e.push("--ignore-annotations"),re)for(let te of re)e.push(`--drop:${te}`);if(O&&e.push(`--mangle-props=${O.source}`),T&&e.push(`--reserve-props=${T.source}`),fe&&e.push(`--jsx=${fe}`),ce&&e.push(`--jsx-factory=${ce}`),ye&&e.push(`--jsx-fragment=${ye}`),se)for(let te in se){if(te.indexOf("=")>=0)throw new Error(`Invalid define: ${te}`);e.push(`--define:${te}=${se[te]}`)}if(we)for(let te of we)e.push(`--pure:${te}`);xe&&e.push("--keep-names")}function wt(e,t,r,i,u){var w;let l=[],c=[],s=Object.create(null),d=null,O=null,T=null;Pe(l,t,s,r,i),Ze(l,t,s);let L=n(t,s,"sourcemap",Ge),x=n(t,s,"bundle",I),S=n(t,s,"watch",gt),ae=n(t,s,"splitting",I),re=n(t,s,"preserveSymlinks",I),le=n(t,s,"metafile",I),ie=n(t,s,"outfile",y),ue=n(t,s,"outdir",y),fe=n(t,s,"outbase",y),ce=n(t,s,"platform",y),ye=n(t,s,"tsconfig",y),se=n(t,s,"resolveExtensions",_),we=n(t,s,"nodePaths",_),xe=n(t,s,"mainFields",_),te=n(t,s,"conditions",_),m=n(t,s,"external",_),f=n(t,s,"loader",me),a=n(t,s,"outExtension",me),p=n(t,s,"publicPath",y),F=n(t,s,"entryNames",y),D=n(t,s,"chunkNames",y),C=n(t,s,"assetNames",y),E=n(t,s,"inject",_),B=n(t,s,"banner",me),P=n(t,s,"footer",me),R=n(t,s,"entryPoints",mt),U=n(t,s,"absWorkingDir",y),k=n(t,s,"stdin",me),A=(w=n(t,s,"write",I))!=null?w:u,q=n(t,s,"allowOverwrite",I),ee=n(t,s,"incremental",I)===!0,$=n(t,s,"mangleCache",me);if(s.plugins=!0,J(t,s,`in ${e}() call`),L&&l.push(`--sourcemap${L===!0?"":`=${L}`}`),x&&l.push("--bundle"),q&&l.push("--allow-overwrite"),S)if(l.push("--watch"),typeof S=="boolean")T={};else{let o=Object.create(null),v=n(S,o,"onRebuild",Ue);J(S,o,`on "watch" in ${e}() call`),T={onRebuild:v}}if(ae&&l.push("--splitting"),re&&l.push("--preserve-symlinks"),le&&l.push("--metafile"),ie&&l.push(`--outfile=${ie}`),ue&&l.push(`--outdir=${ue}`),fe&&l.push(`--outbase=${fe}`),ce&&l.push(`--platform=${ce}`),ye&&l.push(`--tsconfig=${ye}`),se){let o=[];for(let v of se){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);o.push(v)}l.push(`--resolve-extensions=${o.join(",")}`)}if(p&&l.push(`--public-path=${p}`),F&&l.push(`--entry-names=${F}`),D&&l.push(`--chunk-names=${D}`),C&&l.push(`--asset-names=${C}`),xe){let o=[];for(let v of xe){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);o.push(v)}l.push(`--main-fields=${o.join(",")}`)}if(te){let o=[];for(let v of te){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);o.push(v)}l.push(`--conditions=${o.join(",")}`)}if(m)for(let o of m)l.push(`--external:${o}`);if(B)for(let o in B){if(o.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${o}`);l.push(`--banner:${o}=${B[o]}`)}if(P)for(let o in P){if(o.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${o}`);l.push(`--footer:${o}=${P[o]}`)}if(E)for(let o of E)l.push(`--inject:${o}`);if(f)for(let o in f){if(o.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${o}`);l.push(`--loader:${o}=${f[o]}`)}if(a)for(let o in a){if(o.indexOf("=")>=0)throw new Error(`Invalid out extension: ${o}`);l.push(`--out-extension:${o}=${a[o]}`)}if(R)if(Array.isArray(R))for(let o of R)c.push(["",o+""]);else for(let[o,v]of Object.entries(R))c.push([o+"",v+""]);if(k){let o=Object.create(null),v=n(k,o,"contents",y),Y=n(k,o,"resolveDir",y),h=n(k,o,"sourcefile",y),g=n(k,o,"loader",y);J(k,o,'in "stdin" object'),h&&l.push(`--sourcefile=${h}`),g&&l.push(`--loader=${g}`),Y&&(O=Y+""),d=v?v+"":""}let b=[];if(we)for(let o of we)o+="",b.push(o);return{entries:c,flags:l,write:A,stdinContents:d,stdinResolveDir:O,absWorkingDir:U,incremental:ee,nodePaths:b,watch:T,mangleCache:Xe($)}}function vt(e,t,r,i){let u=[],l=Object.create(null);Pe(u,t,l,r,i),Ze(u,t,l);let c=n(t,l,"sourcemap",Ge),s=n(t,l,"tsconfigRaw",yt),d=n(t,l,"sourcefile",y),O=n(t,l,"loader",y),T=n(t,l,"banner",y),L=n(t,l,"footer",y),x=n(t,l,"mangleCache",me);return J(t,l,`in ${e}() call`),c&&u.push(`--sourcemap=${c===!0?"external":c}`),s&&u.push(`--tsconfig-raw=${typeof s=="string"?s:JSON.stringify(s)}`),d&&u.push(`--sourcefile=${d}`),O&&u.push(`--loader=${O}`),T&&u.push(`--banner=${T}`),L&&u.push(`--footer=${L}`),{flags:u,mangleCache:Xe(x)}}function et(e){let t=new Map,r=new Map,i=new Map,u=new Map,l=!1,c=0,s=0,d=new Uint8Array(16*1024),O=0,T=m=>{let f=O+m.length;if(f>d.length){let p=new Uint8Array(f*2);p.set(d),d=p}d.set(m,O),O+=m.length;let a=0;for(;a+4<=O;){let p=Le(d,a);if(a+4+p>O)break;a+=4,le(d.subarray(a,a+p)),a+=p}a>0&&(d.copyWithin(0,a,O),O-=a)},L=()=>{l=!0;for(let m of t.values())m("The service was stopped",null);t.clear();for(let m of u.values())m.onWait("The service was stopped");u.clear();for(let m of i.values())try{m(new Error("The service was stopped"),null)}catch(f){console.error(f)}i.clear()},x=(m,f,a)=>{if(l)return a("The service is no longer running",null);let p=c++;t.set(p,(F,D)=>{try{a(F,D)}finally{m&&m.unref()}}),m&&m.ref(),e.writeToStdin(Fe({id:p,isRequest:!0,value:f}))},S=(m,f)=>{if(l)throw new Error("The service is no longer running");e.writeToStdin(Fe({id:m,isRequest:!1,value:f}))},ae=(m,f)=>de(this,null,function*(){try{switch(f.command){case"ping":{S(m,{});break}case"on-start":{let a=r.get(f.key);a?S(m,yield a(f)):S(m,{});break}case"on-resolve":{let a=r.get(f.key);a?S(m,yield a(f)):S(m,{});break}case"on-load":{let a=r.get(f.key);a?S(m,yield a(f)):S(m,{});break}case"serve-request":{let a=u.get(f.key);a&&a.onRequest&&a.onRequest(f.args),S(m,{});break}case"serve-wait":{let a=u.get(f.key);a&&a.onWait(f.error),S(m,{});break}case"watch-rebuild":{let a=i.get(f.key);try{a&&a(null,f.args)}catch(p){console.error(p)}S(m,{});break}default:throw new Error("Invalid command: "+f.command)}}catch(a){S(m,{errors:[ve(a,e,null,void 0,"")]})}}),re=!0,le=m=>{if(re){re=!1;let a=String.fromCharCode(...m);if(a!=="0.14.21")throw new Error(`Cannot start service: Host version "0.14.21" does not match binary version ${JSON.stringify(a)}`);return}let f=_e(m);if(f.isRequest)ae(f.id,f.value);else{let a=t.get(f.id);t.delete(f.id),f.value.error?a(f.value.error,{}):a(null,f.value)}},ie=(m,f,a,p,F)=>de(this,null,function*(){let D=[],C=[],E={},B={},P=0,R=0,U=[],k=!1;f=[...f];for(let $ of f){let b={};if(typeof $!="object")throw new Error(`Plugin at index ${R} must be an object`);let w=n($,b,"name",y);if(typeof w!="string"||w==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let o=n($,b,"setup",Ue);if(typeof o!="function")throw new Error("Plugin is missing a setup function");J($,b,`on plugin ${JSON.stringify(w)}`);let v={name:w,onResolve:[],onLoad:[]};R++;let h=o({initialOptions:m,resolve:(g,N={})=>{if(!k)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof g!="string")throw new Error("The path to resolve must be a string");let M=Object.create(null),H=n(N,M,"pluginName",y),W=n(N,M,"importer",y),K=n(N,M,"namespace",y),X=n(N,M,"resolveDir",y),G=n(N,M,"kind",y),j=n(N,M,"pluginData",Me);return J(N,M,"in resolve() call"),new Promise((V,Q)=>{let z={command:"resolve",path:g,key:a,pluginName:w};H!=null&&(z.pluginName=H),W!=null&&(z.importer=W),K!=null&&(z.namespace=K),X!=null&&(z.resolveDir=X),G!=null&&(z.kind=G),j!=null&&(z.pluginData=p.store(j)),x(F,z,(oe,Z)=>{oe!==null?Q(new Error(oe)):V({errors:ge(Z.errors,p),warnings:ge(Z.warnings,p),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:p.load(Z.pluginData)})})})},onStart(g){let N='This error came from the "onStart" callback registered here:',M=Ee(new Error(N),e,"onStart");D.push({name:w,callback:g,note:M})},onEnd(g){let N='This error came from the "onEnd" callback registered here:',M=Ee(new Error(N),e,"onEnd");C.push({name:w,callback:g,note:M})},onResolve(g,N){let M='This error came from the "onResolve" callback registered here:',H=Ee(new Error(M),e,"onResolve"),W={},K=n(g,W,"filter",Ce),X=n(g,W,"namespace",y);if(J(g,W,`in onResolve() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onResolve() call is missing a filter");let G=P++;E[G]={name:w,callback:N,note:H},v.onResolve.push({id:G,filter:K.source,namespace:X||""})},onLoad(g,N){let M='This error came from the "onLoad" callback registered here:',H=Ee(new Error(M),e,"onLoad"),W={},K=n(g,W,"filter",Ce),X=n(g,W,"namespace",y);if(J(g,W,`in onLoad() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onLoad() call is missing a filter");let G=P++;B[G]={name:w,callback:N,note:H},v.onLoad.push({id:G,filter:K.source,namespace:X||""})},esbuild:e.esbuild});h&&(yield h),U.push(v)}catch(o){return{ok:!1,error:o,pluginName:w}}}let A=$=>de(this,null,function*(){switch($.command){case"on-start":{let b={errors:[],warnings:[]};return yield Promise.all(D.map(Y=>de(this,[Y],function*({name:w,callback:o,note:v}){try{let h=yield o();if(h!=null){if(typeof h!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},N=n(h,g,"errors",_),M=n(h,g,"warnings",_);J(h,g,`from onStart() callback in plugin ${JSON.stringify(w)}`),N!=null&&b.errors.push(...be(N,"errors",p,w)),M!=null&&b.warnings.push(...be(M,"warnings",p,w))}}catch(h){b.errors.push(ve(h,e,p,v&&v(),w))}}))),b}case"on-resolve":{let b={},w="",o,v;for(let Y of $.ids)try{({name:w,callback:o,note:v}=E[Y]);let h=yield o({path:$.path,importer:$.importer,namespace:$.namespace,resolveDir:$.resolveDir,kind:$.kind,pluginData:p.load($.pluginData)});if(h!=null){if(typeof h!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},N=n(h,g,"pluginName",y),M=n(h,g,"path",y),H=n(h,g,"namespace",y),W=n(h,g,"suffix",y),K=n(h,g,"external",I),X=n(h,g,"sideEffects",I),G=n(h,g,"pluginData",Me),j=n(h,g,"errors",_),V=n(h,g,"warnings",_),Q=n(h,g,"watchFiles",_),z=n(h,g,"watchDirs",_);J(h,g,`from onResolve() callback in plugin ${JSON.stringify(w)}`),b.id=Y,N!=null&&(b.pluginName=N),M!=null&&(b.path=M),H!=null&&(b.namespace=H),W!=null&&(b.suffix=W),K!=null&&(b.external=K),X!=null&&(b.sideEffects=X),G!=null&&(b.pluginData=p.store(G)),j!=null&&(b.errors=be(j,"errors",p,w)),V!=null&&(b.warnings=be(V,"warnings",p,w)),Q!=null&&(b.watchFiles=$e(Q,"watchFiles")),z!=null&&(b.watchDirs=$e(z,"watchDirs"));break}}catch(h){return{id:Y,errors:[ve(h,e,p,v&&v(),w)]}}return b}case"on-load":{let b={},w="",o,v;for(let Y of $.ids)try{({name:w,callback:o,note:v}=B[Y]);let h=yield o({path:$.path,namespace:$.namespace,suffix:$.suffix,pluginData:p.load($.pluginData)});if(h!=null){if(typeof h!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},N=n(h,g,"pluginName",y),M=n(h,g,"contents",bt),H=n(h,g,"resolveDir",y),W=n(h,g,"pluginData",Me),K=n(h,g,"loader",y),X=n(h,g,"errors",_),G=n(h,g,"warnings",_),j=n(h,g,"watchFiles",_),V=n(h,g,"watchDirs",_);J(h,g,`from onLoad() callback in plugin ${JSON.stringify(w)}`),b.id=Y,N!=null&&(b.pluginName=N),M instanceof Uint8Array?b.contents=M:M!=null&&(b.contents=pe(M)),H!=null&&(b.resolveDir=H),W!=null&&(b.pluginData=p.store(W)),K!=null&&(b.loader=K),X!=null&&(b.errors=be(X,"errors",p,w)),G!=null&&(b.warnings=be(G,"warnings",p,w)),j!=null&&(b.watchFiles=$e(j,"watchFiles")),V!=null&&(b.watchDirs=$e(V,"watchDirs"));break}}catch(h){return{id:Y,errors:[ve(h,e,p,v&&v(),w)]}}return b}default:throw new Error("Invalid command: "+$.command)}}),q=($,b,w)=>w();C.length>0&&(q=($,b,w)=>{(()=>de(this,null,function*(){for(let{name:o,callback:v,note:Y}of C)try{yield v($)}catch(h){$.errors.push(yield new Promise(g=>b(h,o,Y&&Y(),g)))}}))().then(w)}),k=!0;let ee=0;return{ok:!0,requestPlugins:U,runOnEndCallbacks:q,pluginRefs:{ref(){++ee===1&&r.set(a,A)},unref(){--ee===0&&r.delete(a)}}}}),ue=(m,f,a,p)=>{let F={},D=n(f,F,"port",Oe),C=n(f,F,"host",y),E=n(f,F,"servedir",y),B=n(f,F,"onRequest",Ue),P,R=new Promise((U,k)=>{P=A=>{u.delete(p),A!==null?k(new Error(A)):U()}});return a.serve={},J(f,F,"in serve() call"),D!==void 0&&(a.serve.port=D),C!==void 0&&(a.serve.host=C),E!==void 0&&(a.serve.servedir=E),u.set(p,{onRequest:B,onWait:P}),{wait:R,stop(){x(m,{command:"serve-stop",key:p},()=>{})}}},fe="warning",ce="silent",ye=m=>{let f=s++,a=Ye(),p,{refs:F,options:D,isTTY:C,callback:E}=m;if(typeof D=="object"){let R=D.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');p=R}}let B=(R,U,k,A)=>{let q=[];try{Pe(q,D,{},C,fe)}catch($){}let ee=ve(R,e,a,k,U);x(F,{command:"error",flags:q,error:ee},()=>{ee.detail=a.load(ee.detail),A(ee)})},P=(R,U)=>{B(R,U,void 0,k=>{E(Re("Build failed",[k],[]),null)})};if(p&&p.length>0){if(e.isSync)return P(new Error("Cannot use plugins in synchronous API calls"),"");ie(D,p,f,a,F).then(R=>{if(!R.ok)P(R.error,R.pluginName);else try{se(Ae(De({},m),{key:f,details:a,logPluginError:B,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(U){P(U,"")}},R=>P(R,""))}else try{se(Ae(De({},m),{key:f,details:a,logPluginError:B,requestPlugins:null,runOnEndCallbacks:(R,U,k)=>k(),pluginRefs:null}))}catch(R){P(R,"")}},se=({callName:m,refs:f,serveOptions:a,options:p,isTTY:F,defaultWD:D,callback:C,key:E,details:B,logPluginError:P,requestPlugins:R,runOnEndCallbacks:U,pluginRefs:k})=>{let A={ref(){k&&k.ref(),f&&f.ref()},unref(){k&&k.unref(),f&&f.unref()}},q=!e.isBrowser,{entries:ee,flags:$,write:b,stdinContents:w,stdinResolveDir:o,absWorkingDir:v,incremental:Y,nodePaths:h,watch:g,mangleCache:N}=wt(m,p,F,fe,q),M={command:"build",key:E,entries:ee,flags:$,write:b,stdinContents:w,stdinResolveDir:o,absWorkingDir:v||D,incremental:Y,nodePaths:h};R&&(M.plugins=R),N&&(M.mangleCache=N);let H=a&&ue(A,a,M,E),W,K,X=(j,V)=>{j.outputFiles&&(V.outputFiles=j.outputFiles.map(Rt)),j.metafile&&(V.metafile=JSON.parse(j.metafile)),j.mangleCache&&(V.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(he(j.writeToStdout).replace(/\n$/,""))},G=(j,V)=>{let Q={errors:ge(j.errors,B),warnings:ge(j.warnings,B)};X(j,Q),U(Q,P,()=>{if(Q.errors.length>0)return V(Re("Build failed",Q.errors,Q.warnings),null);if(j.rebuild){if(!W){let z=!1;W=()=>new Promise((oe,Z)=>{if(z||l)throw new Error("Cannot rebuild");x(A,{command:"rebuild",key:E},(ne,rt)=>{if(ne)return V(Re("Build failed",[{pluginName:"",text:ne,location:null,notes:[],detail:void 0}],[]),null);G(rt,(Be,nt)=>{Be?Z(Be):oe(nt)})})}),A.ref(),W.dispose=()=>{z||(z=!0,x(A,{command:"rebuild-dispose",key:E},()=>{}),A.unref())}}Q.rebuild=W}if(j.watch){if(!K){let z=!1;A.ref(),K=()=>{z||(z=!0,i.delete(E),x(A,{command:"watch-stop",key:E},()=>{}),A.unref())},g&&i.set(E,(oe,Z)=>{if(oe){g.onRebuild&&g.onRebuild(oe,null);return}let ne={errors:ge(Z.errors,B),warnings:ge(Z.warnings,B)};X(Z,ne),U(ne,P,()=>{if(ne.errors.length>0){g.onRebuild&&g.onRebuild(Re("Build failed",ne.errors,ne.warnings),null);return}Z.rebuildID!==void 0&&(ne.rebuild=W),ne.stop=K,g.onRebuild&&g.onRebuild(null,ne)})})}Q.stop=K}V(null,Q)})};if(b&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(Y&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(g&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');x(A,M,(j,V)=>{if(j)return C(new Error(j),null);if(H){let Q=V,z=!1;A.ref();let oe={port:Q.port,host:Q.host,wait:H.wait,stop(){z||(z=!0,H.stop(),A.unref())}};return A.ref(),H.wait.then(A.unref,A.unref),C(null,oe)}return G(V,C)})};return{readFromStdout:T,afterClose:L,service:{buildOrServe:ye,transform:({callName:m,refs:f,input:a,options:p,isTTY:F,fs:D,callback:C})=>{let E=Ye(),B=P=>{try{if(typeof a!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:U}=vt(m,p,F,ce),k={command:"transform",flags:R,inputFS:P!==null,input:P!==null?P:a};U&&(k.mangleCache=U),x(f,k,(A,q)=>{if(A)return C(new Error(A),null);let ee=ge(q.errors,E),$=ge(q.warnings,E),b=1,w=()=>{if(--b===0){let o={warnings:$,code:q.code,map:q.map};q.mangleCache&&(o.mangleCache=q==null?void 0:q.mangleCache),C(null,o)}};if(ee.length>0)return C(Re("Transform failed",ee,$),null);q.codeFS&&(b++,D.readFile(q.code,(o,v)=>{o!==null?C(o,null):(q.code=v,w())})),q.mapFS&&(b++,D.readFile(q.map,(o,v)=>{o!==null?C(o,null):(q.map=v,w())})),w()})}catch(R){let U=[];try{Pe(U,p,{},F,ce)}catch(A){}let k=ve(R,e,E,void 0,"");x(f,{command:"error",flags:U,error:k},()=>{k.detail=E.load(k.detail),C(Re("Transform failed",[k],[]),null)})}};if(typeof a=="string"&&a.length>1024*1024){let P=B;B=()=>D.writeFile(a,P)}B(null)},formatMessages:({callName:m,refs:f,messages:a,options:p,callback:F})=>{let D=be(a,"messages",null,"");if(!p)throw new Error(`Missing second argument in ${m}() call`);let C={},E=n(p,C,"kind",y),B=n(p,C,"color",I),P=n(p,C,"terminalWidth",Oe);if(J(p,C,`in ${m}() call`),E===void 0)throw new Error(`Missing "kind" in ${m}() call`);if(E!=="error"&&E!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${m}() call`);let R={command:"format-msgs",messages:D,isWarning:E==="warning"};B!==void 0&&(R.color=B),P!==void 0&&(R.terminalWidth=P),x(f,R,(U,k)=>{if(U)return F(new Error(U),null);F(null,k.messages)})},analyzeMetafile:({callName:m,refs:f,metafile:a,options:p,callback:F})=>{p===void 0&&(p={});let D={},C=n(p,D,"color",I),E=n(p,D,"verbose",I);J(p,D,`in ${m}() call`);let B={command:"analyze-metafile",metafile:a};C!==void 0&&(B.color=C),E!==void 0&&(B.verbose=E),x(f,B,(P,R)=>{if(P)return F(new Error(P),null);F(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 i=t++;return e.set(i,r),i}}}function Ee(e,t,r){let i,u=!1;return()=>{if(u)return i;u=!0;try{let l=(e.stack+"").split(`
3
3
  `);l.splice(1,1);let c=tt(t,l,r);if(c)return i={text:e.message,location:c},i}catch(l){}}}function ve(e,t,r,i,u){let l="Internal error",c=null;try{l=(e&&e.message||e)+""}catch(s){}try{c=tt(t,(e.stack+"").split(`
4
4
  `),"")}catch(s){}return{pluginName:u,text:l,location:c,notes:i?[i]:[],detail:r?r.store(e):-1}}function tt(e,t,r){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let u=1;u<t.length;u++){let l=t[u];if(!!l.startsWith(i))for(l=l.slice(i.length);;){let c=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(c){l=c[1];continue}if(c=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),c){l=c[1];continue}if(c=/^(\S+):(\d+):(\d+)$/.exec(l),c){let s;try{s=e.readFileSync(c[1],"utf8")}catch(L){break}let d=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+c[2]-1]||"",O=+c[3]-1,T=d.slice(O,O+r.length)===r?r.length:0;return{file:c[1],namespace:"file",line:+c[2],column:pe(d.slice(0,O)).length,length:pe(d.slice(O,O+T)).length,lineText:d+`
5
5
  `+t.slice(1).join(`
6
6
  `),suggestion:""}}break}}return null}function Re(e,t,r){let i=5,u=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((c,s)=>{if(s===i)return`
7
7
  ...`;if(!c.location)return`
8
8
  error: ${c.text}`;let{file:d,line:O,column:T}=c.location,L=c.pluginName?`[plugin: ${c.pluginName}] `:"";return`
9
- ${d}:${O}:${T}: ERROR: ${L}${c.text}`}).join(""),l=new Error(`${e}${u}`);return l.errors=t,l.warnings=r,l}function ge(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function He(e,t){if(e==null)return null;let r={},i=n(e,r,"file",y),u=n(e,r,"namespace",y),l=n(e,r,"line",Oe),c=n(e,r,"column",Oe),s=n(e,r,"length",Oe),d=n(e,r,"lineText",y),O=n(e,r,"suggestion",y);return J(e,r,t),{file:i||"",namespace:u||"",line:l||0,column:c||0,length:s||0,lineText:d||"",suggestion:O||""}}function be(e,t,r,i){let u=[],l=0;for(let c of e){let s={},d=n(c,s,"pluginName",y),O=n(c,s,"text",y),T=n(c,s,"location",Je),L=n(c,s,"notes",_),x=n(c,s,"detail",Me),S=`in element ${l} of "${t}"`;J(c,s,S);let ae=[];if(L)for(let re of L){let le={},ie=n(re,le,"text",y),ue=n(re,le,"location",Je);J(re,le,S),ae.push({text:ie||"",location:He(ue,S)})}u.push({pluginName:d||i,text:O||"",location:He(T,S),notes:ae,detail:r?r.store(x):-1}),l++}return u}function $e(e,t){let r=[];for(let i of e){if(typeof i!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(i)}return r}function Rt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=he(t)),r}}}var St="0.14.20",xt=e=>Te().build(e),kt=()=>{throw new Error('The "serve" API only works in node')},Et=(e,t)=>Te().transform(e,t),$t=(e,t)=>Te().formatMessages(e,t),Mt=(e,t)=>Te().analyzeMetafile(e,t),Ct=()=>{throw new Error('The "buildSync" API only works in node')},Pt=()=>{throw new Error('The "transformSync" API only works in node')},Tt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Bt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Se,qe,Te=()=>{if(qe)return qe;throw Se?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},Dt=e=>{e=Qe(e||{});let t=e.wasmURL,r=e.worker!==!1;if(!t)throw new Error('Must provide the "wasmURL" option');if(t+="",Se)throw new Error('Cannot call "initialize" more than once');return Se=At(t,r),Se.catch(()=>{Se=void 0}),Se},At=(e,t)=>de(void 0,null,function*(){let r=yield fetch(e);if(!r.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);let i=yield r.arrayBuffer(),u='{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{o(f.next(h))}catch(u){n(u)}},i=h=>{try{o(f.throw(h))}catch(u){n(u)}},o=h=>h.done?r(h.value):Promise.resolve(h.value).then(s,i);o((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,o,h,u){if(i===0&&o===s.length&&h===null){if(n===process.stdout.fd){try{process.stdout.write(s,m=>m?u(m,0,null):u(null,o,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,o,s))}catch(m){u(m,0,null)}return}}r.write(n,s,i,o,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,o,h,u){if(i!==0||o!==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,o){o(a())},close(n,s){s(a())},fchmod(n,s,i){i(a())},fchown(n,s,i,o){o(a())},fstat(n,s){s(a())},fsync(n,s){s(null)},ftruncate(n,s,i){i(a())},lchown(n,s,i,o){o(a())},link(n,s,i){i(a())},lstat(n,s){s(a())},mkdir(n,s,i){i(a())},open(n,s,i,o){o(a())},read(n,s,i,o,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,o){o(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),l=this.mem.getInt32(e+4,!0);return t+l*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const l=this.mem.getUint32(e,!0);return this._values[l]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let 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,2146959360|d,!0),this.mem.setUint32(e,c,!0)},o=e=>{const t=n(e+0),l=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,l)},h=e=>{const t=n(e+0),l=n(e+8),c=new Array(l);for(let d=0;d<l;d++)c[d]=s(t+d*8);return c},u=e=>{const t=n(e+0),l=n(e+8);return f.decode(new DataView(this._inst.exports.mem.buffer,t,l))},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),l=n(e+16),c=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,l,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(o(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 l=this._values[t];this._values[t]=null,this._ids.delete(l),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),l=Reflect.get(t,u(e+16)),c=h(e+32),d=Reflect.apply(l,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),l=h(e+16),c=Reflect.apply(t,void 0,l);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),l=h(e+16),c=Reflect.construct(t,l);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);o(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=o(e+8),l=s(e+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const c=l.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),l=o(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const c=l.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,l=g.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,l.length).set(l),n+=l.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,o=[];this.argv.forEach(e=>{o.push(s(e))}),o.push(0),Object.keys(this.env).sort().forEach(e=>{o.push(s(`${e}=${this.env[e]}`))}),o.push(0);const u=n;o.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.20"],WebAssembly.instantiate(c,o.importObject).then(({instance:e})=>o.run(e))};}',l;if(t){let d=new Blob([u],{type:"text/javascript"});l=new Worker(URL.createObjectURL(d))}else{let O=new Function("postMessage",u+"var onmessage; return m => onmessage(m)")(T=>l.onmessage({data:T}));l={onmessage:null,postMessage:T=>O({data:T}),terminate(){}}}l.postMessage(i),l.onmessage=({data:d})=>c(d);let{readFromStdout:c,service:s}=et({writeToStdin(d){l.postMessage(d)},isSync:!1,isBrowser:!0,esbuild:We});qe={build:d=>new Promise((O,T)=>s.buildOrServe({callName:"build",refs:null,serveOptions:null,options:d,isTTY:!1,defaultWD:"/",callback:(L,x)=>L?T(L):O(x)})),transform:(d,O)=>new Promise((T,L)=>s.transform({callName:"transform",refs:null,input:d,options:O||{},isTTY:!1,fs:{readFile(x,S){S(new Error("Internal error"),null)},writeFile(x,S){S(null)}},callback:(x,S)=>x?L(x):T(S)})),formatMessages:(d,O)=>new Promise((T,L)=>s.formatMessages({callName:"formatMessages",refs:null,messages:d,options:O,callback:(x,S)=>x?L(x):T(S)})),analyzeMetafile:(d,O)=>new Promise((T,L)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof d=="string"?d:JSON.stringify(d),options:O,callback:(x,S)=>x?L(x):T(S)}))}});module.exports=dt(We);
9
+ ${d}:${O}:${T}: ERROR: ${L}${c.text}`}).join(""),l=new Error(`${e}${u}`);return l.errors=t,l.warnings=r,l}function ge(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function He(e,t){if(e==null)return null;let r={},i=n(e,r,"file",y),u=n(e,r,"namespace",y),l=n(e,r,"line",Oe),c=n(e,r,"column",Oe),s=n(e,r,"length",Oe),d=n(e,r,"lineText",y),O=n(e,r,"suggestion",y);return J(e,r,t),{file:i||"",namespace:u||"",line:l||0,column:c||0,length:s||0,lineText:d||"",suggestion:O||""}}function be(e,t,r,i){let u=[],l=0;for(let c of e){let s={},d=n(c,s,"pluginName",y),O=n(c,s,"text",y),T=n(c,s,"location",Je),L=n(c,s,"notes",_),x=n(c,s,"detail",Me),S=`in element ${l} of "${t}"`;J(c,s,S);let ae=[];if(L)for(let re of L){let le={},ie=n(re,le,"text",y),ue=n(re,le,"location",Je);J(re,le,S),ae.push({text:ie||"",location:He(ue,S)})}u.push({pluginName:d||i,text:O||"",location:He(T,S),notes:ae,detail:r?r.store(x):-1}),l++}return u}function $e(e,t){let r=[];for(let i of e){if(typeof i!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(i)}return r}function Rt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=he(t)),r}}}var St="0.14.21",xt=e=>Te().build(e),kt=()=>{throw new Error('The "serve" API only works in node')},Et=(e,t)=>Te().transform(e,t),$t=(e,t)=>Te().formatMessages(e,t),Mt=(e,t)=>Te().analyzeMetafile(e,t),Ct=()=>{throw new Error('The "buildSync" API only works in node')},Pt=()=>{throw new Error('The "transformSync" API only works in node')},Tt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Bt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Se,qe,Te=()=>{if(qe)return qe;throw Se?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},Dt=e=>{e=Qe(e||{});let t=e.wasmURL,r=e.worker!==!1;if(!t)throw new Error('Must provide the "wasmURL" option');if(t+="",Se)throw new Error('Cannot call "initialize" more than once');return Se=At(t,r),Se.catch(()=>{Se=void 0}),Se},At=(e,t)=>de(void 0,null,function*(){let r=yield fetch(e);if(!r.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);let i=yield r.arrayBuffer(),u='{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{o(f.next(h))}catch(u){n(u)}},i=h=>{try{o(f.throw(h))}catch(u){n(u)}},o=h=>h.done?r(h.value):Promise.resolve(h.value).then(s,i);o((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,o,h,u){if(i===0&&o===s.length&&h===null){if(n===process.stdout.fd){try{process.stdout.write(s,m=>m?u(m,0,null):u(null,o,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,o,s))}catch(m){u(m,0,null)}return}}r.write(n,s,i,o,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,o,h,u){if(i!==0||o!==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,o){o(a())},close(n,s){s(a())},fchmod(n,s,i){i(a())},fchown(n,s,i,o){o(a())},fstat(n,s){s(a())},fsync(n,s){s(null)},ftruncate(n,s,i){i(a())},lchown(n,s,i,o){o(a())},link(n,s,i){i(a())},lstat(n,s){s(a())},mkdir(n,s,i){i(a())},open(n,s,i,o){o(a())},read(n,s,i,o,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,o){o(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),l=this.mem.getInt32(e+4,!0);return t+l*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const l=this.mem.getUint32(e,!0);return this._values[l]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let 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,2146959360|d,!0),this.mem.setUint32(e,c,!0)},o=e=>{const t=n(e+0),l=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,l)},h=e=>{const t=n(e+0),l=n(e+8),c=new Array(l);for(let d=0;d<l;d++)c[d]=s(t+d*8);return c},u=e=>{const t=n(e+0),l=n(e+8);return f.decode(new DataView(this._inst.exports.mem.buffer,t,l))},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),l=n(e+16),c=this.mem.getInt32(e+24,!0);fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,l,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(o(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 l=this._values[t];this._values[t]=null,this._ids.delete(l),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),l=Reflect.get(t,u(e+16)),c=h(e+32),d=Reflect.apply(l,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),l=h(e+16),c=Reflect.apply(t,void 0,l);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),l=h(e+16),c=Reflect.construct(t,l);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);o(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=o(e+8),l=s(e+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const c=l.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),l=o(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const c=l.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,l=g.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,l.length).set(l),n+=l.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,o=[];this.argv.forEach(e=>{o.push(s(e))}),o.push(0),Object.keys(this.env).sort().forEach(e=>{o.push(s(`${e}=${this.env[e]}`))}),o.push(0);const u=n;o.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.21"],WebAssembly.instantiate(c,o.importObject).then(({instance:e})=>o.run(e))};}',l;if(t){let d=new Blob([u],{type:"text/javascript"});l=new Worker(URL.createObjectURL(d))}else{let O=new Function("postMessage",u+"var onmessage; return m => onmessage(m)")(T=>l.onmessage({data:T}));l={onmessage:null,postMessage:T=>O({data:T}),terminate(){}}}l.postMessage(i),l.onmessage=({data:d})=>c(d);let{readFromStdout:c,service:s}=et({writeToStdin(d){l.postMessage(d)},isSync:!1,isBrowser:!0,esbuild:We});qe={build:d=>new Promise((O,T)=>s.buildOrServe({callName:"build",refs:null,serveOptions:null,options:d,isTTY:!1,defaultWD:"/",callback:(L,x)=>L?T(L):O(x)})),transform:(d,O)=>new Promise((T,L)=>s.transform({callName:"transform",refs:null,input:d,options:O||{},isTTY:!1,fs:{readFile(x,S){S(new Error("Internal error"),null)},writeFile(x,S){S(null)}},callback:(x,S)=>x?L(x):T(S)})),formatMessages:(d,O)=>new Promise((T,L)=>s.formatMessages({callName:"formatMessages",refs:null,messages:d,options:O,callback:(x,S)=>x?L(x):T(S)})),analyzeMetafile:(d,O)=>new Promise((T,L)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof d=="string"?d:JSON.stringify(d),options:O,callback:(x,S)=>x?L(x):T(S)}))}});module.exports=dt(We);
10
10
  })(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
@@ -744,8 +744,8 @@ function createChannel(streamIn) {
744
744
  if (isFirstPacket) {
745
745
  isFirstPacket = false;
746
746
  let binaryVersion = String.fromCharCode(...bytes);
747
- if (binaryVersion !== "0.14.20") {
748
- throw new Error(`Cannot start service: Host version "${"0.14.20"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
747
+ if (binaryVersion !== "0.14.21") {
748
+ throw new Error(`Cannot start service: Host version "${"0.14.21"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
749
749
  }
750
750
  return;
751
751
  }
@@ -1710,6 +1710,7 @@ var knownUnixlikePackages = {
1710
1710
  "linux ia32 LE": "esbuild-linux-32",
1711
1711
  "linux mips64el LE": "esbuild-linux-mips64le",
1712
1712
  "linux ppc64 LE": "esbuild-linux-ppc64le",
1713
+ "linux riscv64 LE": "esbuild-linux-riscv64",
1713
1714
  "linux s390x BE": "esbuild-linux-s390x",
1714
1715
  "linux x64 LE": "esbuild-linux-64",
1715
1716
  "netbsd x64 LE": "esbuild-netbsd-64",
@@ -1848,7 +1849,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1848
1849
  }
1849
1850
  }
1850
1851
  var _a;
1851
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.20";
1852
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.21";
1852
1853
  var esbuildCommandAndArgs = () => {
1853
1854
  if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1854
1855
  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.
@@ -1907,7 +1908,7 @@ var fsAsync = {
1907
1908
  }
1908
1909
  }
1909
1910
  };
1910
- var version = "0.14.20";
1911
+ var version = "0.14.21";
1911
1912
  var build = (options) => ensureServiceIsRunning().build(options);
1912
1913
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1913
1914
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2016,7 +2017,7 @@ var ensureServiceIsRunning = () => {
2016
2017
  if (longLivedService)
2017
2018
  return longLivedService;
2018
2019
  let [command, args] = esbuildCommandAndArgs();
2019
- let child = child_process.spawn(command, args.concat(`--service=${"0.14.20"}`, "--ping"), {
2020
+ let child = child_process.spawn(command, args.concat(`--service=${"0.14.21"}`, "--ping"), {
2020
2021
  windowsHide: true,
2021
2022
  stdio: ["pipe", "pipe", "inherit"],
2022
2023
  cwd: defaultWD
@@ -2125,7 +2126,7 @@ var runServiceSync = (callback) => {
2125
2126
  esbuild: node_exports
2126
2127
  });
2127
2128
  callback(service);
2128
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.20"}`), {
2129
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.21"}`), {
2129
2130
  cwd: defaultWD,
2130
2131
  windowsHide: true,
2131
2132
  input: stdin,
@@ -2141,7 +2142,7 @@ var workerThreadService = null;
2141
2142
  var startWorkerThreadService = (worker_threads2) => {
2142
2143
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2143
2144
  let worker = new worker_threads2.Worker(__filename, {
2144
- workerData: { workerPort, defaultWD, esbuildVersion: "0.14.20" },
2145
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.14.21" },
2145
2146
  transferList: [workerPort],
2146
2147
  execArgv: []
2147
2148
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild-wasm",
3
- "version": "0.14.20",
3
+ "version": "0.14.21",
4
4
  "description": "The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.",
5
5
  "repository": "https://github.com/evanw/esbuild",
6
6
  "license": "MIT",
data/package.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/isomorfeus/isomorfeus-asset-manager",
6
6
  "dependencies": {
7
- "esbuild-wasm": "0.14.20"
7
+ "esbuild-wasm": "0.14.21"
8
8
  }
9
9
  }
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.9
4
+ version: 0.14.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-08 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: isomorfeus-iodine
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.46
19
+ version: 0.7.47
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.46
26
+ version: 0.7.47
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: isomorfeus-speednode
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.4.8
33
+ version: 0.4.9
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.4.8
40
+ version: 0.4.9
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: listen
43
43
  requirement: !ruby/object:Gem::Requirement