23 lines
49 KiB
JavaScript
23 lines
49 KiB
JavaScript
|
(module=>{
|
||
|
"use strict";var Re=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Je=(e,t)=>{for(var n in t)Re(e,n,{get:t[n],enumerable:!0})},Ge=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Ve(t))!Ye.call(e,u)&&u!==n&&Re(e,u,{get:()=>t[u],enumerable:!(i=_e(t,u))||i.enumerable});return e};var Qe=e=>Ge(Re({},"__esModule",{value:!0}),e);var ne=(e,t,n)=>new Promise((i,u)=>{var l=c=>{try{s(n.next(c))}catch(h){u(h)}},g=c=>{try{s(n.throw(c))}catch(h){u(h)}},s=c=>c.done?i(c.value):Promise.resolve(c.value).then(l,g);s((n=n.apply(e,t)).next())});var xe={};Je(xe,{analyzeMetafile:()=>gt,analyzeMetafileSync:()=>bt,build:()=>ft,buildSync:()=>mt,context:()=>ct,default:()=>Rt,formatMessages:()=>pt,formatMessagesSync:()=>ht,initialize:()=>vt,stop:()=>wt,transform:()=>dt,transformSync:()=>yt,version:()=>ut});module.exports=Qe(xe);function Se(e){let t=i=>{if(i===null)n.write8(0);else if(typeof i=="boolean")n.write8(1),n.write8(+i);else if(typeof i=="number")n.write8(2),n.write32(i|0);else if(typeof i=="string")n.write8(3),n.write(Z(i));else if(i instanceof Uint8Array)n.write8(4),n.write(i);else if(i instanceof Array){n.write8(5),n.write32(i.length);for(let u of i)t(u)}else{let u=Object.keys(i);n.write8(6),n.write32(u.length);for(let l of u)n.write(Z(l)),t(i[l])}},n=new pe;return n.write32(0),n.write32(e.id<<1|+!e.isRequest),t(e.value),Ee(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function $e(e){let t=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return ie(n.read());case 4:return n.read();case 5:{let g=n.read32(),s=[];for(let c=0;c<g;c++)s.push(t());return s}case 6:{let g=n.read32(),s={};for(let c=0;c<g;c++)s[ie(n.read())]=t();return s}default:throw new Error("Invalid packet")}},n=new pe(e),i=n.read32(),u=(i&1)===0;i>>>=1;let l=t();if(n.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:u,value:l}}var pe=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 n=new Uint8Array((this.len+t)*2);n.set(this.buf),this.buf=n}return this.len+=t,this.len-t}write8(t){let n=this._write(1);this.buf[n]=t}write32(t){let n=this._write(4);Ee(this.buf,t,n)}write(t){let n=this._write(4+t.length);Ee(this.buf,t.length,n),this.buf.set(t,n+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 ke(this.buf,this._read(4))}read(){let t=this.read32(),n=new Uint8Array(t),i=this._read(n.length);return n.set(this.buf.subarray(i,i+t)),n}},Z,ie,Oe;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;Z=n=>e.encode(n),ie=n=>t.decode(n),Oe='new TextEncoder().encode("")'}else if(typeof Buffer!="undefined")Z=e=>Buffer.from(e),ie=e=>{let{buffer:t,byteOffset:n,byteLength:i}=e;return Buffer.from(t,n,i).toString()},Oe='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Oe} instanceof Uint8Array" is incorrectly false
|
||
|
|
||
|
This indicates that your JavaScript environment is broken. You cannot use
|
||
|
esbuild in this environment because esbuild relies on this invariant. This
|
||
|
is not a problem with esbuild. You need to fix your environment instead.
|
||
|
`);function ke(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ee(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var J=JSON.stringify,Me="warning",Ce="silent";function Ae(e){if(Y(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var ye=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",y=e=>typeof e=="string"?null:"a string",he=e=>e instanceof RegExp?null:"a RegExp object",se=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Pe=e=>typeof e=="function"?null:"a function",W=e=>Array.isArray(e)?null:"an array",ee=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Xe=e=>typeof e=="object"&&e!==null?null:"an array or an object",Ze=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Fe=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",De=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",et=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",tt=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Be=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",nt=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let u=e[n];if(t[n+""]=!0,u===void 0)return;let l=i(u);if(l!==null)throw new Error(`${J(n)} must be ${l}`);return u}function K(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${J(i)}`)}function Ue(e){let t=Object.create(null),n=r(e,t,"wasmURL",nt),i=r(e,t,"wasmModule",Ze),u=r(e,t,"worker",I);return K(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:u}}function je(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let i=e[n];if(typeof i=="string"||i===!1)t[n]=i;else throw new Error(`Expected ${J(n)} in mangle cache to map to either a string or false`)}}return t}function be(e,t,n,i,u){let l=r(t,n,"color",I),g=r(t,n,"logLevel",y),s=r(t,n,"logLimit",se);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${g||u}`),e.push(`--log-limit=${s||0}`)}function Y(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+J(n):""} to be a string, got ${typeof e} instead`);return e}function Le(e,t,n){let i=r(t,n,"legalComments",y),u=r(t,n,"sourceRoot",y),l=r(t,n,"sourcesContent",I),g=r(t,n,"target",tt),s=r(t,n,"format",y),c=r(t,n,"globalName",y),h=r(t,n,"mangleProps",he),w=r(t,n,"reserveProps",he),M=r(t,n,"mangleQuoted",I),L=r(t,n,"minify",I),B=r(t,n,"minifySyntax",I),q=r(t,n,"minifyWhitespace",I),G=r(t,n,"minifyIdentifiers",I),U=r(t,n,"lineLimit",se),z=r(t,n,"drop",W),_=r(t,n,"dropLabels",W),v=r(t,n,"charset",y),m=r(t,n,"treeShaking",I),d=r(t,n,"ignoreAnnotations",I),o=r(t,n,"jsx",y),x=r(t,n,"jsxFactory",y),E=r(t,n,"jsxFragment",y),C=r(t,n,"jsxImportSource",y),P=r(t,n,"jsxDev",I),a=r(t,n,"jsxSideEffects",I),f=r(t,n,"define",ee),b=r(t,n,"logOverride",ee),S=r(t,n,"supported",ee),F=r(t,n,"pure",W),k=r(t,n,"keepNames",I),O=r(t,n,"platform",y),A=r(t,n,"tsconfigRaw",et);if(i&&e.push(`--legal-comments=${i}`),u!==void 0&&e.push(`--source-root=${u}`),l!==void 0&&e.push(`--sources-content=${l}`),g&&(Array.isArray(g)?e.push(`--target=${Array.from(g).map(Ae).join(",")}`):e.push(`--target=${Ae(g)}`)),s&&e.push(`--format=${s}`),c&&e.push(`--global-name=${c}`),O&&e.push(`--platform=${O}`),A&&e.push(`--tsconfig-raw=${typeof A=="string"?A:JSON.stringify(A)}`),L&&e.push("--minify"),B&&e.push("--minify-syntax"),q&&e.push("--minify-whitespace"),G&&e.push("--minify-identifiers"),U&&e.push(`--line-limit=${U}`),v&&e.push(`--charset=${v}`),m!==void 0&&e.push(`--tree-shaking=${m}`),d&&e.push("--ignore-annotations"),z)for(let R of z)e.push(`--drop:${Y(R,"drop")}`);if(_&&e.push(`--drop-labels=${Array.from(_).map(R=>Y(R,"dropLabels")).join(",")}`),h&&e.push(`--mangle-props=${h.source}`),w&&e.push(`--reserve-props=${w.source}`),M!==void 0&&e.push(`--mangle-quoted=${M}`),o&&e.push(`--jsx=${o}`),x&&e.push(`--jsx-factory=${x}`),E&&e.push(`--jsx-fragment=${E}`),C&&e.push(`--jsx-import-source=${C}`),P&&e.push("--jsx-dev"),a&&e.push("--jsx-side
|
||
|
`);l.splice(1,1);let g=Ie(t,l,n);if(g)return i={text:e.message,location:g},i}catch(l){}}}function le(e,t,n,i,u){let l="Internal error",g=null;try{l=(e&&e.message||e)+""}catch(s){}try{g=Ie(t,(e.stack+"").split(`
|
||
|
`),"")}catch(s){}return{id:"",pluginName:u,text:l,location:g,notes:i?[i]:[],detail:n?n.store(e):-1}}function Ie(e,t,n){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let u=1;u<t.length;u++){let l=t[u];if(l.startsWith(i))for(l=l.slice(i.length);;){let g=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(g){l=g[1];continue}if(g=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),g){l=g[1];continue}if(g=/^(\S+):(\d+):(\d+)$/.exec(l),g){let s;try{s=e.readFileSync(g[1],"utf8")}catch(M){break}let c=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+g[2]-1]||"",h=+g[3]-1,w=c.slice(h,h+n.length)===n?n.length:0;return{file:g[1],namespace:"file",line:+g[2],column:Z(c.slice(0,h)).length,length:Z(c.slice(h,h+w)).length,lineText:c+`
|
||
|
`+t.slice(1).join(`
|
||
|
`),suggestion:""}}break}}return null}function ce(e,t,n){let i=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((l,g)=>{if(g===i)return`
|
||
|
...`;if(!l.location)return`
|
||
|
error: ${l.text}`;let{file:s,line:c,column:h}=l.location,w=l.pluginName?`[plugin: ${l.pluginName}] `:"";return`
|
||
|
${s}:${c}:${h}: ERROR: ${w}${l.text}`}).join("");let u=new Error(e);for(let[l,g]of[["errors",t],["warnings",n]])Object.defineProperty(u,l,{configurable:!0,enumerable:!0,get:()=>g,set:s=>Object.defineProperty(u,l,{configurable:!0,enumerable:!0,value:s})});return u}function ue(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Te(e,t,n){if(e==null)return null;let i={},u=r(e,i,"file",y),l=r(e,i,"namespace",y),g=r(e,i,"line",se),s=r(e,i,"column",se),c=r(e,i,"length",se),h=r(e,i,"lineText",y),w=r(e,i,"suggestion",y);if(K(e,i,t),h){let M=h.slice(0,(s&&s>0?s:0)+(c&&c>0?c:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(M)&&!/\n/.test(h)&&(h=M)}return{file:u||"",namespace:l||"",line:g||0,column:s||0,length:c||0,lineText:h||"",suggestion:w||""}}function re(e,t,n,i,u){let l=[],g=0;for(let s of e){let c={},h=r(s,c,"id",y),w=r(s,c,"pluginName",y),M=r(s,c,"text",y),L=r(s,c,"location",Fe),B=r(s,c,"notes",W),q=r(s,c,"detail",ye),G=`in element ${g} of "${t}"`;K(s,c,G);let U=[];if(B)for(let z of B){let _={},v=r(z,_,"text",y),m=r(z,_,"location",Fe);K(z,_,G),U.push({text:v||"",location:Te(m,G,u)})}l.push({id:h||"",pluginName:w||i,text:M||"",location:Te(L,G,u),notes:U,detail:n?n.store(q):-1}),g++}return l}function me(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${J(t)} must be an array of strings`);n.push(i)}return n}function ot({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let u=this.contents;return(i===null||u!==t)&&(t=u,i=ie(u)),i}}}var ut="0.19.11",ft=e=>de().build(e),ct=e=>de().context(e),dt=(e,t)=>de().transform(e,t),pt=(e,t)=>de().formatMessages(e,t),gt=(e,t)=>de().analyzeMetafile(e,t),mt=()=>{throw new Error('The "buildSync" API only works in node')},yt=()=>{throw new Error('The "transformSync" API only works in node')},ht=()=>{throw new Error('The "formatMessagesSync" API only works in node')},bt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},wt=()=>{we&&we()},oe,we,ve,de=()=>{if(ve)return ve;throw oe?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},vt=e=>{e=Ue(e||{});let t=e.wasmURL,n=e.wasmModule,i=e.worker!==!1;if(!t&&!n)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(oe)throw new Error('Cannot call "initialize" more than once');return oe=xt(t||"",n,i),oe.catch(()=>{oe=void 0}),oe},xt=(e,t,n)=>ne(void 0,null,function*(){let i;if(n){let h=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nvar y=(r,f,m)=>new Promise((c,n)=>{var s=u=>{try{l(m.next(u))}catch(h){n(h)}},i=u=>{try{l(m.throw(u))}catch(h){n(h)}},l=u=>u.done?c(u.value):Promise.resolve(u.value).then(s,i);l((m=m.apply(r,f)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=m.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substring(0,i)),c=c.substring(i+1)),s.length},write(n,s,i,l,u,h){if(i!==0||l!==s.length||u!==null){h(r());return}const g=this.writeSync(n,s);h(null,g)},chmod(n,s,i){i(r())},chown(n,s,i,l){l(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,l){l(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,l){l(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,l){l(r())},read(n,s,i,l,u,h){h(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,l){l(r())}}}if(globalThis.process||(globalThis.pr
|
||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a BSD-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
var y=(r,f,m)=>new Promise((c,n)=>{var s=u=>{try{l(m.next(u))}catch(h){n(h)}},i=u=>{try{l(m.throw(u))}catch(h){n(h)}},l=u=>u.done?c(u.value):Promise.resolve(u.value).then(s,i);l((m=m.apply(r,f)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=m.decode(s);const i=c.lastIndexOf(`
|
||
|
`);return i!=-1&&(console.log(c.substring(0,i)),c=c.substring(i+1)),s.length},write(n,s,i,l,u,h){if(i!==0||l!==s.length||u!==null){h(r());return}const g=this.writeSync(n,s);h(null,g)},chmod(n,s,i){i(r())},chown(n,s,i,l){l(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,l){l(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,l){l(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,l){l(r())},read(n,s,i,l,u,h){h(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,l){l(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),m=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=t=>{t!==0&&console.warn("exit code:",t)},this._exitPromise=new Promise(t=>{this._resolveExitPromise=t}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},n=t=>{const e=this.mem.getUint32(t+0,!0),o=this.mem.getInt32(t+4,!0);return e+o*4294967296},s=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const o=this.mem.getUint32(t,!0);return this._values[o]},i=(t,e)=>{if(typeof e=="number"&&e!==0){if(isNaN(e)){this.mem.setUint32(t+4,2146959360,!0),this.mem.setUint32(t,0,!0);return}this.mem.setFloat64(t,e,!0);return}if(e===void 0){this.mem.setFloat64(t,0,!0);return}let a=this._ids.get(e);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=e,this._goRefCounts[a]=0,this._ids.set(e,a)),this._goRefCounts[a]++;let d=0;switch(typeof e){case"object":e!==null&&(d=1);break;case"string":d=2;break;case"symbol":d=3;break;case"function":d=4;break}this.mem.setUint32(t+4,2146959360|d,!0),this.mem.setUint32(t,a,!0)},l=t=>{const e=n(t+0),o=n(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,o)},u=t=>{const e=n(t+0),o=n(t+8),a=new Array(o);for(let d=0;d<o;d++)a[d]=s(e+d*8);return a},h=t=>{const e=n(t+0),o=n(t+8);return m.decode(new DataView(this._inst.exports.mem.buffer,e,o))},g=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(e)},"runtime.wasmWrite":t=>{t>>>=0;const e=n(t+8),o=n(t+16),a=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,c(t+8,(g+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();c(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;const e=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(e,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(e);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(t+8)+1)),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(l(t+8))},"syscal
|
||
|
`);g.length>1&&console.log(g.slice(0,-1).join(`
|
||
|
`)),c=g[g.length-1]}else throw new Error("Bad write");return h.length};let n=[],s,i=0;onmessage=({data:u})=>(u.length>0&&(n.push(u),s&&s()),l),m.read=(u,h,g,t,e,o)=>{if(u!==0||g!==0||t!==h.length||e!==null)throw new Error("Bad read");if(n.length===0){s=()=>m.read(u,h,g,t,e,o);return}let a=n[0],d=Math.max(0,Math.min(t,a.length-i));h.set(a.subarray(i,i+d),g),i+=d,i===a.length&&(n.shift(),i=0),o(null,d)};let l=new globalThis.Go;return l.argv=["","--service=0.19.11"],tryToInstantiateModule(r,l).then(u=>{postMessage(null),l.run(u)},u=>{postMessage(u)}),l};function tryToInstantiateModule(r,f){return y(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const m=yield fetch(r);if(!m.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(m.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(m,f.importObject)).instance;const c=yield m.arrayBuffer();return(yield WebAssembly.instantiate(c,f.importObject)).instance})}return r=>onmessage(r);})(M=>i.onmessage({data:M})),w;i={onmessage:null,postMessage:M=>setTimeout(()=>w=h({data:M})),terminate(){if(w)for(let M of w._scheduledTimeouts.values())clearTimeout(M)}}}let u,l,g=new Promise((h,w)=>{u=h,l=w});i.onmessage=({data:h})=>{i.onmessage=({data:w})=>s(w),h?l(h):u()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:s,service:c}=qe({writeToStdin(h){i.postMessage(h)},isSync:!1,hasFS:!1,esbuild:xe});yield g,we=()=>{i.terminate(),oe=void 0,we=void 0,ve=void 0},ve={build:h=>new Promise((w,M)=>c.buildOrContext({callName:"build",refs:null,options:h,isTTY:!1,defaultWD:"/",callback:(L,B)=>L?M(L):w(B)})),context:h=>new Promise((w,M)=>c.buildOrContext({callName:"context",refs:null,options:h,isTTY:!1,defaultWD:"/",callback:(L,B)=>L?M(L):w(B)})),transform:(h,w)=>new Promise((M,L)=>c.transform({callName:"transform",refs:null,input:h,options:w||{},isTTY:!1,fs:{readFile(B,q){q(new Error("Internal error"),null)},writeFile(B,q){q(null)}},callback:(B,q)=>B?L(B):M(q)})),formatMessages:(h,w)=>new Promise((M,L)=>c.formatMessages({callName:"formatMessages",refs:null,messages:h,options:w,callback:(B,q)=>B?L(B):M(q)})),analyzeMetafile:(h,w)=>new Promise((M,L)=>c.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof h=="string"?h:JSON.stringify(h),options:w,callback:(B,q)=>B?L(B):M(q)}))}}),Rt=xe;
|
||
|
})(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
|