isomorfeus-asset-manager 0.14.23 → 0.14.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/asset_manager/version.rb +1 -1
- data/node_modules/.package-lock.json +3 -3
- data/node_modules/esbuild-wasm/LICENSE.md +21 -0
- data/node_modules/esbuild-wasm/esbuild.wasm +0 -0
- data/node_modules/esbuild-wasm/esm/browser.d.ts +18 -8
- data/node_modules/esbuild-wasm/esm/browser.js +95 -55
- data/node_modules/esbuild-wasm/esm/browser.min.js +8 -8
- data/node_modules/esbuild-wasm/lib/browser.d.ts +18 -8
- data/node_modules/esbuild-wasm/lib/browser.js +96 -55
- data/node_modules/esbuild-wasm/lib/browser.min.js +8 -8
- data/node_modules/esbuild-wasm/lib/main.d.ts +18 -8
- data/node_modules/esbuild-wasm/lib/main.js +143 -105
- data/node_modules/esbuild-wasm/package.json +1 -1
- data/package.json +1 -1
- metadata +7 -6
@@ -1,17 +1,17 @@
|
|
1
|
-
(module=>{
|
2
|
-
var Ee=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?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ne=(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},Fe=(e,t)=>lt(e,st(t));var ut=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},ft=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of ot(t))!Ke.call(e,u)&&u!==r&&Ee(e,u,{get:()=>t[u],enumerable:!(s=it(t,u))||s.enumerable});return e};var ct=e=>ft(Ee({},"__esModule",{value:!0}),e);var fe=(e,t,r)=>new Promise((s,u)=>{var i=m=>{try{l(r.next(m))}catch(O){u(O)}},c=m=>{try{l(r.throw(m))}catch(O){u(O)}},l=m=>m.done?s(m.value):Promise.resolve(m.value).then(i,c);l((r=r.apply(e,t)).next())});var Te={};ut(Te,{analyzeMetafile:()=>$t,analyzeMetafileSync:()=>Bt,build:()=>xt,buildSync:()=>Ct,default:()=>Nt,formatMessages:()=>Mt,formatMessagesSync:()=>At,initialize:()=>Tt,serve:()=>Et,transform:()=>kt,transformSync:()=>Pt,version:()=>St});module.exports=ct(Te);function Le(e){let t=s=>{if(s===null)r.write8(0);else if(typeof s=="boolean")r.write8(1),r.write8(+s);else if(typeof s=="number")r.write8(2),r.write32(s|0);else if(typeof s=="string")r.write8(3),r.write(ce(s));else if(s instanceof Uint8Array)r.write8(4),r.write(s);else if(s instanceof Array){r.write8(5),r.write32(s.length);for(let u of s)t(u)}else{let u=Object.keys(s);r.write8(6),r.write32(u.length);for(let i of u)r.write(ce(i)),t(s[i])}},r=new ke;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),je(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function _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(),l=[];for(let m=0;m<c;m++)l.push(t());return l}case 6:{let c=r.read32(),l={};for(let m=0;m<c;m++)l[he(r.read())]=t();return l}default:throw new Error("Invalid packet")}},r=new ke(e),s=r.read32(),u=(s&1)===0;s>>>=1;let i=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:u,value:i}}var ke=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let r=new Uint8Array((this.len+t)*2);r.set(this.buf),this.buf=r}return this.len+=t,this.len-t}write8(t){let r=this._write(1);this.buf[r]=t}write32(t){let r=this._write(4);je(this.buf,t,r)}write(t){let r=this._write(4+t.length);je(this.buf,t.length,r),this.buf.set(t,r+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return Ue(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},ce,he;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;ce=r=>e.encode(r),he=r=>t.decode(r)}else if(typeof Buffer!="undefined")ce=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},he=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function Ue(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function je(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function Ve(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Ce=()=>null,q=e=>typeof e=="boolean"?null:"a boolean",pt=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",y=e=>typeof e=="string"?null:"a string",Pe=e=>e instanceof RegExp?null:"a RegExp object",Oe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",We=e=>typeof e=="function"?null:"a function",_=e=>Array.isArray(e)?null:"an array",pe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",gt=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",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",He=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,s){let u=e[r];if(t[r+""]=!0,u===void 0)return;let i=s(u);if(i!==null)throw new Error(`"${r}" must be ${i}`);return u}function J(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function Ge(e){let t=Object.create(null),r=n(e,t,"wasmURL",y),s=n(e,t,"wasmModule",gt),u=n(e,t,"worker",q);return J(e,t,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:u}}function Xe(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let s=e[r];if(typeof s=="string"||s===!1)t[r]=s;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Ae(e,t,r,s,u){let i=n(t,r,"color",q),c=n(t,r,"logLevel",y),l=n(t,r,"logLimit",Oe);i!==void 0?e.push(`--color=${i}`):s&&e.push("--color=true"),e.push(`--log-level=${c||u}`),e.push(`--log-limit=${l||0}`)}function Ze(e,t,r){let s=n(t,r,"legalComments",y),u=n(t,r,"sourceRoot",y),i=n(t,r,"sourcesContent",q),c=n(t,r,"target",ht),l=n(t,r,"format",y),m=n(t,r,"globalName",y),O=n(t,r,"mangleProps",Pe),N=n(t,r,"reserveProps",Pe),M=n(t,r,"mangleQuoted",q),P=n(t,r,"minify",q),W=n(t,r,"minifySyntax",q),oe=n(t,r,"minifyWhitespace",q),re=n(t,r,"minifyIdentifiers",q),ne=n(t,r,"drop",_),le=n(t,r,"charset",y),ie=n(t,r,"treeShaking",q),ge=n(t,r,"ignoreAnnotations",q),ae=n(t,r,"jsx",y),me=n(t,r,"jsxFactory",y),ue=n(t,r,"jsxFragment",y),ye=n(t,r,"define",pe),we=n(t,r,"pure",_),xe=n(t,r,"keepNames",q);if(s&&e.push(`--legal-comments=${s}`),u!==void 0&&e.push(`--source-root=${u}`),i!==void 0&&e.push(`--sources-content=${i}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(Ve).join(",")}`):e.push(`--target=${Ve(c)}`)),l&&e.push(`--format=${l}`),m&&e.push(`--global-name=${m}`),P&&e.push("--minify"),W&&e.push("--minify-syntax"),oe&&e.push("--minify-whitespace"),re&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),ge&&e.push("--ignore-annotations"),ne)for(let d of ne)e.push(`--drop:${d}`);if(O&&e.push(`--mangle-props=${O.source}`),N&&e.push(`--reserve-props=${N.source}`),M!==void 0&&e.push(`--mangle-quoted=${M}`),ae&&e.push(`--jsx=${ae}`),me&&e.push(`--jsx-factory=${me}`),ue&&e.push(`--jsx-fragment=${ue}`),ye)for(let d in ye){if(d.indexOf("=")>=0)throw new Error(`Invalid define: ${d}`);e.push(`--define:${d}=${ye[d]}`)}if(we)for(let d of we)e.push(`--pure:${d}`);xe&&e.push("--keep-names")}function wt(e,t,r,s,u){var w;let i=[],c=[],l=Object.create(null),m=null,O=null,N=null;Ae(i,t,l,r,s),Ze(i,t,l);let M=n(t,l,"sourcemap",He),P=n(t,l,"bundle",q),W=n(t,l,"watch",pt),oe=n(t,l,"splitting",q),re=n(t,l,"preserveSymlinks",q),ne=n(t,l,"metafile",q),le=n(t,l,"outfile",y),ie=n(t,l,"outdir",y),ge=n(t,l,"outbase",y),ae=n(t,l,"platform",y),me=n(t,l,"tsconfig",y),ue=n(t,l,"resolveExtensions",_),ye=n(t,l,"nodePaths",_),we=n(t,l,"mainFields",_),xe=n(t,l,"conditions",_),d=n(t,l,"external",_),f=n(t,l,"loader",pe),o=n(t,l,"outExtension",pe),p=n(t,l,"publicPath",y),F=n(t,l,"entryNames",y),B=n(t,l,"chunkNames",y),$=n(t,l,"assetNames",y),x=n(t,l,"inject",_),A=n(t,l,"banner",pe),C=n(t,l,"footer",pe),R=n(t,l,"entryPoints",mt),L=n(t,l,"absWorkingDir",y),S=n(t,l,"stdin",pe),T=(w=n(t,l,"write",q))!=null?w:u,U=n(t,l,"allowOverwrite",q),ee=n(t,l,"incremental",q)===!0,E=n(t,l,"mangleCache",pe);if(l.plugins=!0,J(t,l,`in ${e}() call`),M&&i.push(`--sourcemap${M===!0?"":`=${M}`}`),P&&i.push("--bundle"),U&&i.push("--allow-overwrite"),W)if(i.push("--watch"),typeof W=="boolean")N={};else{let a=Object.create(null),v=n(W,a,"onRebuild",We);J(W,a,`on "watch" in ${e}() call`),N={onRebuild:v}}if(oe&&i.push("--splitting"),re&&i.push("--preserve-symlinks"),ne&&i.push("--metafile"),le&&i.push(`--outfile=${le}`),ie&&i.push(`--outdir=${ie}`),ge&&i.push(`--outbase=${ge}`),ae&&i.push(`--platform=${ae}`),me&&i.push(`--tsconfig=${me}`),ue){let a=[];for(let v of ue){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);a.push(v)}i.push(`--resolve-extensions=${a.join(",")}`)}if(p&&i.push(`--public-path=${p}`),F&&i.push(`--entry-names=${F}`),B&&i.push(`--chunk-names=${B}`),$&&i.push(`--asset-names=${$}`),we){let a=[];for(let v of we){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);a.push(v)}i.push(`--main-fields=${a.join(",")}`)}if(xe){let a=[];for(let v of xe){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);a.push(v)}i.push(`--conditions=${a.join(",")}`)}if(d)for(let a of d)i.push(`--external:${a}`);if(A)for(let a in A){if(a.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${a}`);i.push(`--banner:${a}=${A[a]}`)}if(C)for(let a in C){if(a.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${a}`);i.push(`--footer:${a}=${C[a]}`)}if(x)for(let a of x)i.push(`--inject:${a}`);if(f)for(let a in f){if(a.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${a}`);i.push(`--loader:${a}=${f[a]}`)}if(o)for(let a in o){if(a.indexOf("=")>=0)throw new Error(`Invalid out extension: ${a}`);i.push(`--out-extension:${a}=${o[a]}`)}if(R)if(Array.isArray(R))for(let a of R)c.push(["",a+""]);else for(let[a,v]of Object.entries(R))c.push([a+"",v+""]);if(S){let a=Object.create(null),v=n(S,a,"contents",y),Y=n(S,a,"resolveDir",y),h=n(S,a,"sourcefile",y),g=n(S,a,"loader",y);J(S,a,'in "stdin" object'),h&&i.push(`--sourcefile=${h}`),g&&i.push(`--loader=${g}`),Y&&(O=Y+""),m=v?v+"":""}let b=[];if(ye)for(let a of ye)a+="",b.push(a);return{entries:c,flags:i,write:T,stdinContents:m,stdinResolveDir:O,absWorkingDir:L,incremental:ee,nodePaths:b,watch:N,mangleCache:Xe(E)}}function vt(e,t,r,s){let u=[],i=Object.create(null);Ae(u,t,i,r,s),Ze(u,t,i);let c=n(t,i,"sourcemap",He),l=n(t,i,"tsconfigRaw",yt),m=n(t,i,"sourcefile",y),O=n(t,i,"loader",y),N=n(t,i,"banner",y),M=n(t,i,"footer",y),P=n(t,i,"mangleCache",pe);return J(t,i,`in ${e}() call`),c&&u.push(`--sourcemap=${c===!0?"external":c}`),l&&u.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),m&&u.push(`--sourcefile=${m}`),O&&u.push(`--loader=${O}`),N&&u.push(`--banner=${N}`),M&&u.push(`--footer=${M}`),{flags:u,mangleCache:Xe(P)}}function et(e){let t=new Map,r=new Map,s=new Map,u=new Map,i=null,c=0,l=0,m=new Uint8Array(16*1024),O=0,N=d=>{let f=O+d.length;if(f>m.length){let p=new Uint8Array(f*2);p.set(m),m=p}m.set(d,O),O+=d.length;let o=0;for(;o+4<=O;){let p=Ue(m,o);if(o+4+p>O)break;o+=4,ne(m.subarray(o,o+p)),o+=p}o>0&&(m.copyWithin(0,o,O),O-=o)},M=d=>{i={reason:d?": "+(d.message||d):""};let f="The service was stopped"+i.reason;for(let o of t.values())o(f,null);t.clear();for(let o of u.values())o.onWait(f);u.clear();for(let o of s.values())try{o(new Error(f),null)}catch(p){console.error(p)}s.clear()},P=(d,f,o)=>{if(i)return o("The service is no longer running"+i.reason,null);let p=c++;t.set(p,(F,B)=>{try{o(F,B)}finally{d&&d.unref()}}),d&&d.ref(),e.writeToStdin(Le({id:p,isRequest:!0,value:f}))},W=(d,f)=>{if(i)throw new Error("The service is no longer running"+i.reason);e.writeToStdin(Le({id:d,isRequest:!1,value:f}))},oe=(d,f)=>fe(this,null,function*(){try{switch(f.command){case"ping":{W(d,{});break}case"on-start":{let o=r.get(f.key);o?W(d,yield o(f)):W(d,{});break}case"on-resolve":{let o=r.get(f.key);o?W(d,yield o(f)):W(d,{});break}case"on-load":{let o=r.get(f.key);o?W(d,yield o(f)):W(d,{});break}case"serve-request":{let o=u.get(f.key);o&&o.onRequest&&o.onRequest(f.args),W(d,{});break}case"serve-wait":{let o=u.get(f.key);o&&o.onWait(f.error),W(d,{});break}case"watch-rebuild":{let o=s.get(f.key);try{o&&o(null,f.args)}catch(p){console.error(p)}W(d,{});break}default:throw new Error("Invalid command: "+f.command)}}catch(o){W(d,{errors:[ve(o,e,null,void 0,"")]})}}),re=!0,ne=d=>{if(re){re=!1;let o=String.fromCharCode(...d);if(o!=="0.14.39")throw new Error(`Cannot start service: Host version "0.14.39" does not match binary version ${JSON.stringify(o)}`);return}let f=_e(d);if(f.isRequest)oe(f.id,f.value);else{let o=t.get(f.id);t.delete(f.id),f.value.error?o(f.value.error,{}):o(null,f.value)}},le=(d,f,o,p,F)=>fe(this,null,function*(){let B=[],$=[],x={},A={},C=0,R=0,L=[],S=!1;f=[...f];for(let E of f){let b={};if(typeof E!="object")throw new Error(`Plugin at index ${R} must be an object`);let w=n(E,b,"name",y);if(typeof w!="string"||w==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let a=n(E,b,"setup",We);if(typeof a!="function")throw new Error("Plugin is missing a setup function");J(E,b,`on plugin ${JSON.stringify(w)}`);let v={name:w,onResolve:[],onLoad:[]};R++;let h=a({initialOptions:d,resolve:(g,D={})=>{if(!S)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 k=Object.create(null),Q=n(D,k,"pluginName",y),I=n(D,k,"importer",y),K=n(D,k,"namespace",y),X=n(D,k,"resolveDir",y),H=n(D,k,"kind",y),j=n(D,k,"pluginData",Ce);return J(D,k,"in resolve() call"),new Promise((V,G)=>{let z={command:"resolve",path:g,key:o,pluginName:w};Q!=null&&(z.pluginName=Q),I!=null&&(z.importer=I),K!=null&&(z.namespace=K),X!=null&&(z.resolveDir=X),H!=null&&(z.kind=H),j!=null&&(z.pluginData=p.store(j)),P(F,z,(se,Z)=>{se!==null?G(new Error(se)):V({errors:de(Z.errors,p),warnings:de(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 D='This error came from the "onStart" callback registered here:',k=Me(new Error(D),e,"onStart");B.push({name:w,callback:g,note:k})},onEnd(g){let D='This error came from the "onEnd" callback registered here:',k=Me(new Error(D),e,"onEnd");$.push({name:w,callback:g,note:k})},onResolve(g,D){let k='This error came from the "onResolve" callback registered here:',Q=Me(new Error(k),e,"onResolve"),I={},K=n(g,I,"filter",Pe),X=n(g,I,"namespace",y);if(J(g,I,`in onResolve() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onResolve() call is missing a filter");let H=C++;x[H]={name:w,callback:D,note:Q},v.onResolve.push({id:H,filter:K.source,namespace:X||""})},onLoad(g,D){let k='This error came from the "onLoad" callback registered here:',Q=Me(new Error(k),e,"onLoad"),I={},K=n(g,I,"filter",Pe),X=n(g,I,"namespace",y);if(J(g,I,`in onLoad() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onLoad() call is missing a filter");let H=C++;A[H]={name:w,callback:D,note:Q},v.onLoad.push({id:H,filter:K.source,namespace:X||""})},esbuild:e.esbuild});h&&(yield h),L.push(v)}catch(a){return{ok:!1,error:a,pluginName:w}}}let T=E=>fe(this,null,function*(){switch(E.command){case"on-start":{let b={errors:[],warnings:[]};return yield Promise.all(B.map(Y=>fe(this,[Y],function*({name:w,callback:a,note:v}){try{let h=yield a();if(h!=null){if(typeof h!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},D=n(h,g,"errors",_),k=n(h,g,"warnings",_);J(h,g,`from onStart() callback in plugin ${JSON.stringify(w)}`),D!=null&&b.errors.push(...be(D,"errors",p,w)),k!=null&&b.warnings.push(...be(k,"warnings",p,w))}}catch(h){b.errors.push(ve(h,e,p,v&&v(),w))}}))),b}case"on-resolve":{let b={},w="",a,v;for(let Y of E.ids)try{({name:w,callback:a,note:v}=x[Y]);let h=yield a({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:p.load(E.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={},D=n(h,g,"pluginName",y),k=n(h,g,"path",y),Q=n(h,g,"namespace",y),I=n(h,g,"suffix",y),K=n(h,g,"external",q),X=n(h,g,"sideEffects",q),H=n(h,g,"pluginData",Ce),j=n(h,g,"errors",_),V=n(h,g,"warnings",_),G=n(h,g,"watchFiles",_),z=n(h,g,"watchDirs",_);J(h,g,`from onResolve() callback in plugin ${JSON.stringify(w)}`),b.id=Y,D!=null&&(b.pluginName=D),k!=null&&(b.path=k),Q!=null&&(b.namespace=Q),I!=null&&(b.suffix=I),K!=null&&(b.external=K),X!=null&&(b.sideEffects=X),H!=null&&(b.pluginData=p.store(H)),j!=null&&(b.errors=be(j,"errors",p,w)),V!=null&&(b.warnings=be(V,"warnings",p,w)),G!=null&&(b.watchFiles=$e(G,"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="",a,v;for(let Y of E.ids)try{({name:w,callback:a,note:v}=A[Y]);let h=yield a({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:p.load(E.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={},D=n(h,g,"pluginName",y),k=n(h,g,"contents",bt),Q=n(h,g,"resolveDir",y),I=n(h,g,"pluginData",Ce),K=n(h,g,"loader",y),X=n(h,g,"errors",_),H=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,D!=null&&(b.pluginName=D),k instanceof Uint8Array?b.contents=k:k!=null&&(b.contents=ce(k)),Q!=null&&(b.resolveDir=Q),I!=null&&(b.pluginData=p.store(I)),K!=null&&(b.loader=K),X!=null&&(b.errors=be(X,"errors",p,w)),H!=null&&(b.warnings=be(H,"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: "+E.command)}}),U=(E,b,w)=>w();$.length>0&&(U=(E,b,w)=>{(()=>fe(this,null,function*(){for(let{name:a,callback:v,note:Y}of $)try{yield v(E)}catch(h){E.errors.push(yield new Promise(g=>b(h,a,Y&&Y(),g)))}}))().then(w)}),S=!0;let ee=0;return{ok:!0,requestPlugins:L,runOnEndCallbacks:U,pluginRefs:{ref(){++ee===1&&r.set(o,T)},unref(){--ee===0&&r.delete(o)}}}}),ie=(d,f,o,p)=>{let F={},B=n(f,F,"port",Oe),$=n(f,F,"host",y),x=n(f,F,"servedir",y),A=n(f,F,"onRequest",We),C,R=new Promise((L,S)=>{C=T=>{u.delete(p),T!==null?S(new Error(T)):L()}});return o.serve={},J(f,F,"in serve() call"),B!==void 0&&(o.serve.port=B),$!==void 0&&(o.serve.host=$),x!==void 0&&(o.serve.servedir=x),u.set(p,{onRequest:A,onWait:C}),{wait:R,stop(){P(d,{command:"serve-stop",key:p},()=>{})}}},ge="warning",ae="silent",me=d=>{let f=l++,o=Ye(),p,{refs:F,options:B,isTTY:$,callback:x}=d;if(typeof B=="object"){let R=B.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');p=R}}let A=(R,L,S,T)=>{let U=[];try{Ae(U,B,{},$,ge)}catch(E){}let ee=ve(R,e,o,S,L);P(F,{command:"error",flags:U,error:ee},()=>{ee.detail=o.load(ee.detail),T(ee)})},C=(R,L)=>{A(R,L,void 0,S=>{x(Re("Build failed",[S],[]),null)})};if(p&&p.length>0){if(e.isSync)return C(new Error("Cannot use plugins in synchronous API calls"),"");le(B,p,f,o,F).then(R=>{if(!R.ok)C(R.error,R.pluginName);else try{ue(Fe(Ne({},d),{key:f,details:o,logPluginError:A,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(L){C(L,"")}},R=>C(R,""))}else try{ue(Fe(Ne({},d),{key:f,details:o,logPluginError:A,requestPlugins:null,runOnEndCallbacks:(R,L,S)=>S(),pluginRefs:null}))}catch(R){C(R,"")}},ue=({callName:d,refs:f,serveOptions:o,options:p,isTTY:F,defaultWD:B,callback:$,key:x,details:A,logPluginError:C,requestPlugins:R,runOnEndCallbacks:L,pluginRefs:S})=>{let T={ref(){S&&S.ref(),f&&f.ref()},unref(){S&&S.unref(),f&&f.unref()}},U=!e.isBrowser,{entries:ee,flags:E,write:b,stdinContents:w,stdinResolveDir:a,absWorkingDir:v,incremental:Y,nodePaths:h,watch:g,mangleCache:D}=wt(d,p,F,ge,U),k={command:"build",key:x,entries:ee,flags:E,write:b,stdinContents:w,stdinResolveDir:a,absWorkingDir:v||B,incremental:Y,nodePaths:h};R&&(k.plugins=R),D&&(k.mangleCache=D);let Q=o&&ie(T,o,k,x),I,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$/,""))},H=(j,V)=>{let G={errors:de(j.errors,A),warnings:de(j.warnings,A)};X(j,G),L(G,C,()=>{if(G.errors.length>0)return V(Re("Build failed",G.errors,G.warnings),null);if(j.rebuild){if(!I){let z=!1;I=()=>new Promise((se,Z)=>{if(z||i)throw new Error("Cannot rebuild");P(T,{command:"rebuild",key:x},(te,rt)=>{if(te)return V(Re("Build failed",[{pluginName:"",text:te,location:null,notes:[],detail:void 0}],[]),null);H(rt,(De,nt)=>{De?Z(De):se(nt)})})}),T.ref(),I.dispose=()=>{z||(z=!0,P(T,{command:"rebuild-dispose",key:x},()=>{}),T.unref())}}G.rebuild=I}if(j.watch){if(!K){let z=!1;T.ref(),K=()=>{z||(z=!0,s.delete(x),P(T,{command:"watch-stop",key:x},()=>{}),T.unref())},g&&s.set(x,(se,Z)=>{if(se){g.onRebuild&&g.onRebuild(se,null);return}let te={errors:de(Z.errors,A),warnings:de(Z.warnings,A)};X(Z,te),L(te,C,()=>{if(te.errors.length>0){g.onRebuild&&g.onRebuild(Re("Build failed",te.errors,te.warnings),null);return}Z.rebuildID!==void 0&&(te.rebuild=I),te.stop=K,g.onRebuild&&g.onRebuild(null,te)})})}G.stop=K}V(null,G)})};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');P(T,k,(j,V)=>{if(j)return $(new Error(j),null);if(Q){let G=V,z=!1;T.ref();let se={port:G.port,host:G.host,wait:Q.wait,stop(){z||(z=!0,Q.stop(),T.unref())}};return T.ref(),Q.wait.then(T.unref,T.unref),$(null,se)}return H(V,$)})};return{readFromStdout:N,afterClose:M,service:{buildOrServe:me,transform:({callName:d,refs:f,input:o,options:p,isTTY:F,fs:B,callback:$})=>{let x=Ye(),A=C=>{try{if(typeof o!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:L}=vt(d,p,F,ae),S={command:"transform",flags:R,inputFS:C!==null,input:C!==null?C:o};L&&(S.mangleCache=L),P(f,S,(T,U)=>{if(T)return $(new Error(T),null);let ee=de(U.errors,x),E=de(U.warnings,x),b=1,w=()=>{if(--b===0){let a={warnings:E,code:U.code,map:U.map};U.mangleCache&&(a.mangleCache=U==null?void 0:U.mangleCache),$(null,a)}};if(ee.length>0)return $(Re("Transform failed",ee,E),null);U.codeFS&&(b++,B.readFile(U.code,(a,v)=>{a!==null?$(a,null):(U.code=v,w())})),U.mapFS&&(b++,B.readFile(U.map,(a,v)=>{a!==null?$(a,null):(U.map=v,w())})),w()})}catch(R){let L=[];try{Ae(L,p,{},F,ae)}catch(T){}let S=ve(R,e,x,void 0,"");P(f,{command:"error",flags:L,error:S},()=>{S.detail=x.load(S.detail),$(Re("Transform failed",[S],[]),null)})}};if(typeof o=="string"&&o.length>1024*1024){let C=A;A=()=>B.writeFile(o,C)}A(null)},formatMessages:({callName:d,refs:f,messages:o,options:p,callback:F})=>{let B=be(o,"messages",null,"");if(!p)throw new Error(`Missing second argument in ${d}() call`);let $={},x=n(p,$,"kind",y),A=n(p,$,"color",q),C=n(p,$,"terminalWidth",Oe);if(J(p,$,`in ${d}() call`),x===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(x!=="error"&&x!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let R={command:"format-msgs",messages:B,isWarning:x==="warning"};A!==void 0&&(R.color=A),C!==void 0&&(R.terminalWidth=C),P(f,R,(L,S)=>{if(L)return F(new Error(L),null);F(null,S.messages)})},analyzeMetafile:({callName:d,refs:f,metafile:o,options:p,callback:F})=>{p===void 0&&(p={});let B={},$=n(p,B,"color",q),x=n(p,B,"verbose",q);J(p,B,`in ${d}() call`);let A={command:"analyze-metafile",metafile:o};$!==void 0&&(A.color=$),x!==void 0&&(A.verbose=x),P(f,A,(C,R)=>{if(C)return F(new Error(C),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 s=t++;return e.set(s,r),s}}}function Me(e,t,r){let s,u=!1;return()=>{if(u)return s;u=!0;try{let i=(e.stack+"").split(`
|
3
|
-
`);i.splice(1,1);let c=
|
4
|
-
`),"")}catch(l){}return{pluginName:u,text:i,location:c,notes:
|
1
|
+
"use strict";(module=>{
|
2
|
+
var Ee=Object.defineProperty,it=Object.defineProperties,st=Object.getOwnPropertyDescriptor,ot=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable;var ze=(e,t,r)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fe=(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))ut.call(t,r)&&ze(e,r,t[r]);return e},Ne=(e,t)=>it(e,ot(t));var ft=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},ct=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of at(t))!Ke.call(e,u)&&u!==r&&Ee(e,u,{get:()=>t[u],enumerable:!(o=st(t,u))||o.enumerable});return e};var dt=e=>ct(Ee({},"__esModule",{value:!0}),e);var pe=(e,t,r)=>new Promise((o,u)=>{var i=g=>{try{l(r.next(g))}catch(R){u(R)}},c=g=>{try{l(r.throw(g))}catch(R){u(R)}},l=g=>g.done?o(g.value):Promise.resolve(g.value).then(i,c);l((r=r.apply(e,t)).next())});var De={};ft(De,{analyzeMetafile:()=>Mt,analyzeMetafileSync:()=>Tt,build:()=>St,buildSync:()=>At,default:()=>Ft,formatMessages:()=>$t,formatMessagesSync:()=>Pt,initialize:()=>Dt,serve:()=>Et,transform:()=>kt,transformSync:()=>Ct,version:()=>xt});module.exports=dt(De);function je(e){let t=o=>{if(o===null)r.write8(0);else if(typeof o=="boolean")r.write8(1),r.write8(+o);else if(typeof o=="number")r.write8(2),r.write32(o|0);else if(typeof o=="string")r.write8(3),r.write(ne(o));else if(o instanceof Uint8Array)r.write8(4),r.write(o);else if(o instanceof Array){r.write8(5),r.write32(o.length);for(let u of o)t(u)}else{let u=Object.keys(o);r.write8(6),r.write32(u.length);for(let i of u)r.write(ne(i)),t(o[i])}},r=new ke;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Ue(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(),l=[];for(let g=0;g<c;g++)l.push(t());return l}case 6:{let c=r.read32(),l={};for(let g=0;g<c;g++)l[he(r.read())]=t();return l}default:throw new Error("Invalid packet")}},r=new ke(e),o=r.read32(),u=(o&1)===0;o>>>=1;let i=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:o,isRequest:u,value:i}}var ke=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);Ue(this.buf,t,r)}write(t){let r=this._write(4+t.length);Ue(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),o=this._read(r.length);return r.set(this.buf.subarray(o,o+t)),r}},ne,he;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;ne=r=>e.encode(r),he=r=>t.decode(r)}else if(typeof Buffer!="undefined")ne=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},he=e=>{let{buffer:t,byteOffset:r,byteLength:o}=e;return Buffer.from(t,r,o).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 Ue(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 Ae=()=>null,W=e=>typeof e=="boolean"?null:"a boolean",gt=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",m=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",We=e=>typeof e=="function"?null:"a function",_=e=>Array.isArray(e)?null:"an array",se=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",mt=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",yt=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",He=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",ht=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",bt=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Ge=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,o){let u=e[r];if(t[r+""]=!0,u===void 0)return;let i=o(u);if(i!==null)throw new Error(`"${r}" must be ${i}`);return u}function J(e,t,r){for(let o in e)if(!(o in t))throw new Error(`Invalid option ${r}: "${o}"`)}function Xe(e){let t=Object.create(null),r=n(e,t,"wasmURL",m),o=n(e,t,"wasmModule",mt),u=n(e,t,"worker",W);return J(e,t,"in initialize() call"),{wasmURL:r,wasmModule:o,worker:u}}function Ze(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let o=e[r];if(typeof o=="string"||o===!1)t[r]=o;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,o,u){let i=n(t,r,"color",W),c=n(t,r,"logLevel",m),l=n(t,r,"logLimit",Oe);i!==void 0?e.push(`--color=${i}`):o&&e.push("--color=true"),e.push(`--log-level=${c||u}`),e.push(`--log-limit=${l||0}`)}function et(e,t,r){let o=n(t,r,"legalComments",m),u=n(t,r,"sourceRoot",m),i=n(t,r,"sourcesContent",W),c=n(t,r,"target",bt),l=n(t,r,"format",m),g=n(t,r,"globalName",m),R=n(t,r,"mangleProps",Ce),N=n(t,r,"reserveProps",Ce),C=n(t,r,"mangleQuoted",W),$=n(t,r,"minify",W),I=n(t,r,"minifySyntax",W),le=n(t,r,"minifyWhitespace",W),oe=n(t,r,"minifyIdentifiers",W),ie=n(t,r,"drop",_),te=n(t,r,"charset",m),ae=n(t,r,"treeShaking",W),ue=n(t,r,"ignoreAnnotations",W),ce=n(t,r,"jsx",m),me=n(t,r,"jsxFactory",m),de=n(t,r,"jsxFragment",m),we=n(t,r,"jsxImportSource",m),Se=n(t,r,"jsxDev",W),ye=n(t,r,"define",se),p=n(t,r,"logOverride",se),f=n(t,r,"supported",se),a=n(t,r,"pure",_),d=n(t,r,"keepNames",W),P=n(t,r,"platform",m);if(o&&e.push(`--legal-comments=${o}`),u!==void 0&&e.push(`--source-root=${u}`),i!==void 0&&e.push(`--sources-content=${i}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(Ve).join(",")}`):e.push(`--target=${Ve(c)}`)),l&&e.push(`--format=${l}`),g&&e.push(`--global-name=${g}`),P&&e.push(`--platform=${P}`),$&&e.push("--minify"),I&&e.push("--minify-syntax"),le&&e.push("--minify-whitespace"),oe&&e.push("--minify-identifiers"),te&&e.push(`--charset=${te}`),ae!==void 0&&e.push(`--tree-shaking=${ae}`),ue&&e.push("--ignore-annotations"),ie)for(let v of ie)e.push(`--drop:${v}`);if(R&&e.push(`--mangle-props=${R.source}`),N&&e.push(`--reserve-props=${N.source}`),C!==void 0&&e.push(`--mangle-quoted=${C}`),ce&&e.push(`--jsx=${ce}`),me&&e.push(`--jsx-factory=${me}`),de&&e.push(`--jsx-fragment=${de}`),we&&e.push(`--jsx-import-source=${we}`),Se&&e.push("--jsx-dev"),ye)for(let v in ye){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);e.push(`--define:${v}=${ye[v]}`)}if(p)for(let v in p){if(v.indexOf("=")>=0)throw new Error(`Invalid log override: ${v}`);e.push(`--log-override:${v}=${p[v]}`)}if(f)for(let v in f){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);e.push(`--supported:${v}=${f[v]}`)}if(a)for(let v of a)e.push(`--pure:${v}`);d&&e.push("--keep-names")}function wt(e,t,r,o,u){var w;let i=[],c=[],l=Object.create(null),g=null,R=null,N=null;Pe(i,t,l,r,o),et(i,t,l);let C=n(t,l,"sourcemap",He),$=n(t,l,"bundle",W),I=n(t,l,"watch",gt),le=n(t,l,"splitting",W),oe=n(t,l,"preserveSymlinks",W),ie=n(t,l,"metafile",W),te=n(t,l,"outfile",m),ae=n(t,l,"outdir",m),ue=n(t,l,"outbase",m),ce=n(t,l,"tsconfig",m),me=n(t,l,"resolveExtensions",_),de=n(t,l,"nodePaths",_),we=n(t,l,"mainFields",_),Se=n(t,l,"conditions",_),ye=n(t,l,"external",_),p=n(t,l,"loader",se),f=n(t,l,"outExtension",se),a=n(t,l,"publicPath",m),d=n(t,l,"entryNames",m),P=n(t,l,"chunkNames",m),v=n(t,l,"assetNames",m),M=n(t,l,"inject",_),x=n(t,l,"banner",se),T=n(t,l,"footer",se),E=n(t,l,"entryPoints",yt),O=n(t,l,"absWorkingDir",m),A=n(t,l,"stdin",se),D=(w=n(t,l,"write",W))!=null?w:u,B=n(t,l,"allowOverwrite",W),L=n(t,l,"incremental",W)===!0,ee=n(t,l,"mangleCache",se);if(l.plugins=!0,J(t,l,`in ${e}() call`),C&&i.push(`--sourcemap${C===!0?"":`=${C}`}`),$&&i.push("--bundle"),B&&i.push("--allow-overwrite"),I)if(i.push("--watch"),typeof I=="boolean")N={};else{let s=Object.create(null),h=n(I,s,"onRebuild",We);J(I,s,`on "watch" in ${e}() call`),N={onRebuild:h}}if(le&&i.push("--splitting"),oe&&i.push("--preserve-symlinks"),ie&&i.push("--metafile"),te&&i.push(`--outfile=${te}`),ae&&i.push(`--outdir=${ae}`),ue&&i.push(`--outbase=${ue}`),ce&&i.push(`--tsconfig=${ce}`),me){let s=[];for(let h of me){if(h+="",h.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${h}`);s.push(h)}i.push(`--resolve-extensions=${s.join(",")}`)}if(a&&i.push(`--public-path=${a}`),d&&i.push(`--entry-names=${d}`),P&&i.push(`--chunk-names=${P}`),v&&i.push(`--asset-names=${v}`),we){let s=[];for(let h of we){if(h+="",h.indexOf(",")>=0)throw new Error(`Invalid main field: ${h}`);s.push(h)}i.push(`--main-fields=${s.join(",")}`)}if(Se){let s=[];for(let h of Se){if(h+="",h.indexOf(",")>=0)throw new Error(`Invalid condition: ${h}`);s.push(h)}i.push(`--conditions=${s.join(",")}`)}if(ye)for(let s of ye)i.push(`--external:${s}`);if(x)for(let s in x){if(s.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${s}`);i.push(`--banner:${s}=${x[s]}`)}if(T)for(let s in T){if(s.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${s}`);i.push(`--footer:${s}=${T[s]}`)}if(M)for(let s of M)i.push(`--inject:${s}`);if(p)for(let s in p){if(s.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${s}`);i.push(`--loader:${s}=${p[s]}`)}if(f)for(let s in f){if(s.indexOf("=")>=0)throw new Error(`Invalid out extension: ${s}`);i.push(`--out-extension:${s}=${f[s]}`)}if(E)if(Array.isArray(E))for(let s of E)c.push(["",s+""]);else for(let[s,h]of Object.entries(E))c.push([s+"",h+""]);if(A){let s=Object.create(null),h=n(A,s,"contents",Ge),j=n(A,s,"resolveDir",m),Y=n(A,s,"sourcefile",m),b=n(A,s,"loader",m);J(A,s,'in "stdin" object'),Y&&i.push(`--sourcefile=${Y}`),b&&i.push(`--loader=${b}`),j&&(R=j+""),typeof h=="string"?g=ne(h):h instanceof Uint8Array&&(g=h)}let S=[];if(de)for(let s of de)s+="",S.push(s);return{entries:c,flags:i,write:D,stdinContents:g,stdinResolveDir:R,absWorkingDir:O,incremental:L,nodePaths:S,watch:N,mangleCache:Ze(ee)}}function vt(e,t,r,o){let u=[],i=Object.create(null);Pe(u,t,i,r,o),et(u,t,i);let c=n(t,i,"sourcemap",He),l=n(t,i,"tsconfigRaw",ht),g=n(t,i,"sourcefile",m),R=n(t,i,"loader",m),N=n(t,i,"banner",m),C=n(t,i,"footer",m),$=n(t,i,"mangleCache",se);return J(t,i,`in ${e}() call`),c&&u.push(`--sourcemap=${c===!0?"external":c}`),l&&u.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),g&&u.push(`--sourcefile=${g}`),R&&u.push(`--loader=${R}`),N&&u.push(`--banner=${N}`),C&&u.push(`--footer=${C}`),{flags:u,mangleCache:Ze($)}}function tt(e){let t=new Map,r=new Map,o=new Map,u=new Map,i=null,c=0,l=0,g=new Uint8Array(16*1024),R=0,N=p=>{let f=R+p.length;if(f>g.length){let d=new Uint8Array(f*2);d.set(g),g=d}g.set(p,R),R+=p.length;let a=0;for(;a+4<=R;){let d=Le(g,a);if(a+4+d>R)break;a+=4,ie(g.subarray(a,a+d)),a+=d}a>0&&(g.copyWithin(0,a,R),R-=a)},C=p=>{i={reason:p?": "+(p.message||p):""};let f="The service was stopped"+i.reason;for(let a of t.values())a(f,null);t.clear();for(let a of u.values())a.onWait(f);u.clear();for(let a of o.values())try{a(new Error(f),null)}catch(d){console.error(d)}o.clear()},$=(p,f,a)=>{if(i)return a("The service is no longer running"+i.reason,null);let d=c++;t.set(d,(P,v)=>{try{a(P,v)}finally{p&&p.unref()}}),p&&p.ref(),e.writeToStdin(je({id:d,isRequest:!0,value:f}))},I=(p,f)=>{if(i)throw new Error("The service is no longer running"+i.reason);e.writeToStdin(je({id:p,isRequest:!1,value:f}))},le=(p,f)=>pe(this,null,function*(){try{switch(f.command){case"ping":{I(p,{});break}case"on-start":{let a=r.get(f.key);a?I(p,yield a(f)):I(p,{});break}case"on-resolve":{let a=r.get(f.key);a?I(p,yield a(f)):I(p,{});break}case"on-load":{let a=r.get(f.key);a?I(p,yield a(f)):I(p,{});break}case"serve-request":{let a=u.get(f.key);a&&a.onRequest&&a.onRequest(f.args),I(p,{});break}case"serve-wait":{let a=u.get(f.key);a&&a.onWait(f.error),I(p,{});break}case"watch-rebuild":{let a=o.get(f.key);try{a&&a(null,f.args)}catch(d){console.error(d)}I(p,{});break}default:throw new Error("Invalid command: "+f.command)}}catch(a){I(p,{errors:[ve(a,e,null,void 0,"")]})}}),oe=!0,ie=p=>{if(oe){oe=!1;let a=String.fromCharCode(...p);if(a!=="0.14.53")throw new Error(`Cannot start service: Host version "0.14.53" does not match binary version ${JSON.stringify(a)}`);return}let f=_e(p);if(f.isRequest)le(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)}},te=(p,f,a,d,P)=>pe(this,null,function*(){let v=[],M=[],x={},T={},E=0,O=0,A=[],D=!1;f=[...f];for(let S of f){let w={};if(typeof S!="object")throw new Error(`Plugin at index ${O} must be an object`);let s=n(S,w,"name",m);if(typeof s!="string"||s==="")throw new Error(`Plugin at index ${O} is missing a name`);try{let h=n(S,w,"setup",We);if(typeof h!="function")throw new Error("Plugin is missing a setup function");J(S,w,`on plugin ${JSON.stringify(s)}`);let j={name:s,onResolve:[],onLoad:[]};O++;let b=h({initialOptions:p,resolve:(y,F={})=>{if(!D)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof y!="string")throw new Error("The path to resolve must be a string");let k=Object.create(null),Q=n(F,k,"pluginName",m),q=n(F,k,"importer",m),K=n(F,k,"namespace",m),X=n(F,k,"resolveDir",m),H=n(F,k,"kind",m),U=n(F,k,"pluginData",Ae);return J(F,k,"in resolve() call"),new Promise((V,G)=>{let z={command:"resolve",path:y,key:a,pluginName:s};Q!=null&&(z.pluginName=Q),q!=null&&(z.importer=q),K!=null&&(z.namespace=K),X!=null&&(z.resolveDir=X),H!=null&&(z.kind=H),U!=null&&(z.pluginData=d.store(U)),$(P,z,(fe,Z)=>{fe!==null?G(new Error(fe)):V({errors:ge(Z.errors,d),warnings:ge(Z.warnings,d),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:d.load(Z.pluginData)})})})},onStart(y){let F='This error came from the "onStart" callback registered here:',k=$e(new Error(F),e,"onStart");v.push({name:s,callback:y,note:k})},onEnd(y){let F='This error came from the "onEnd" callback registered here:',k=$e(new Error(F),e,"onEnd");M.push({name:s,callback:y,note:k})},onResolve(y,F){let k='This error came from the "onResolve" callback registered here:',Q=$e(new Error(k),e,"onResolve"),q={},K=n(y,q,"filter",Ce),X=n(y,q,"namespace",m);if(J(y,q,`in onResolve() call for plugin ${JSON.stringify(s)}`),K==null)throw new Error("onResolve() call is missing a filter");let H=E++;x[H]={name:s,callback:F,note:Q},j.onResolve.push({id:H,filter:K.source,namespace:X||""})},onLoad(y,F){let k='This error came from the "onLoad" callback registered here:',Q=$e(new Error(k),e,"onLoad"),q={},K=n(y,q,"filter",Ce),X=n(y,q,"namespace",m);if(J(y,q,`in onLoad() call for plugin ${JSON.stringify(s)}`),K==null)throw new Error("onLoad() call is missing a filter");let H=E++;T[H]={name:s,callback:F,note:Q},j.onLoad.push({id:H,filter:K.source,namespace:X||""})},esbuild:e.esbuild});b&&(yield b),A.push(j)}catch(h){return{ok:!1,error:h,pluginName:s}}}let B=S=>pe(this,null,function*(){switch(S.command){case"on-start":{let w={errors:[],warnings:[]};return yield Promise.all(v.map(Y=>pe(this,[Y],function*({name:s,callback:h,note:j}){try{let b=yield h();if(b!=null){if(typeof b!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(s)} to return an object`);let y={},F=n(b,y,"errors",_),k=n(b,y,"warnings",_);J(b,y,`from onStart() callback in plugin ${JSON.stringify(s)}`),F!=null&&w.errors.push(...be(F,"errors",d,s)),k!=null&&w.warnings.push(...be(k,"warnings",d,s))}}catch(b){w.errors.push(ve(b,e,d,j&&j(),s))}}))),w}case"on-resolve":{let w={},s="",h,j;for(let Y of S.ids)try{({name:s,callback:h,note:j}=x[Y]);let b=yield h({path:S.path,importer:S.importer,namespace:S.namespace,resolveDir:S.resolveDir,kind:S.kind,pluginData:d.load(S.pluginData)});if(b!=null){if(typeof b!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(s)} to return an object`);let y={},F=n(b,y,"pluginName",m),k=n(b,y,"path",m),Q=n(b,y,"namespace",m),q=n(b,y,"suffix",m),K=n(b,y,"external",W),X=n(b,y,"sideEffects",W),H=n(b,y,"pluginData",Ae),U=n(b,y,"errors",_),V=n(b,y,"warnings",_),G=n(b,y,"watchFiles",_),z=n(b,y,"watchDirs",_);J(b,y,`from onResolve() callback in plugin ${JSON.stringify(s)}`),w.id=Y,F!=null&&(w.pluginName=F),k!=null&&(w.path=k),Q!=null&&(w.namespace=Q),q!=null&&(w.suffix=q),K!=null&&(w.external=K),X!=null&&(w.sideEffects=X),H!=null&&(w.pluginData=d.store(H)),U!=null&&(w.errors=be(U,"errors",d,s)),V!=null&&(w.warnings=be(V,"warnings",d,s)),G!=null&&(w.watchFiles=Me(G,"watchFiles")),z!=null&&(w.watchDirs=Me(z,"watchDirs"));break}}catch(b){return{id:Y,errors:[ve(b,e,d,j&&j(),s)]}}return w}case"on-load":{let w={},s="",h,j;for(let Y of S.ids)try{({name:s,callback:h,note:j}=T[Y]);let b=yield h({path:S.path,namespace:S.namespace,suffix:S.suffix,pluginData:d.load(S.pluginData)});if(b!=null){if(typeof b!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(s)} to return an object`);let y={},F=n(b,y,"pluginName",m),k=n(b,y,"contents",Ge),Q=n(b,y,"resolveDir",m),q=n(b,y,"pluginData",Ae),K=n(b,y,"loader",m),X=n(b,y,"errors",_),H=n(b,y,"warnings",_),U=n(b,y,"watchFiles",_),V=n(b,y,"watchDirs",_);J(b,y,`from onLoad() callback in plugin ${JSON.stringify(s)}`),w.id=Y,F!=null&&(w.pluginName=F),k instanceof Uint8Array?w.contents=k:k!=null&&(w.contents=ne(k)),Q!=null&&(w.resolveDir=Q),q!=null&&(w.pluginData=d.store(q)),K!=null&&(w.loader=K),X!=null&&(w.errors=be(X,"errors",d,s)),H!=null&&(w.warnings=be(H,"warnings",d,s)),U!=null&&(w.watchFiles=Me(U,"watchFiles")),V!=null&&(w.watchDirs=Me(V,"watchDirs"));break}}catch(b){return{id:Y,errors:[ve(b,e,d,j&&j(),s)]}}return w}default:throw new Error("Invalid command: "+S.command)}}),L=(S,w,s)=>s();M.length>0&&(L=(S,w,s)=>{(()=>pe(this,null,function*(){for(let{name:h,callback:j,note:Y}of M)try{yield j(S)}catch(b){S.errors.push(yield new Promise(y=>w(b,h,Y&&Y(),y)))}}))().then(s)}),D=!0;let ee=0;return{ok:!0,requestPlugins:A,runOnEndCallbacks:L,pluginRefs:{ref(){++ee===1&&r.set(a,B)},unref(){--ee===0&&r.delete(a)}}}}),ae=(p,f,a,d)=>{let P={},v=n(f,P,"port",Oe),M=n(f,P,"host",m),x=n(f,P,"servedir",m),T=n(f,P,"onRequest",We),E,O=new Promise((A,D)=>{E=B=>{u.delete(d),B!==null?D(new Error(B)):A()}});return a.serve={},J(f,P,"in serve() call"),v!==void 0&&(a.serve.port=v),M!==void 0&&(a.serve.host=M),x!==void 0&&(a.serve.servedir=x),u.set(d,{onRequest:T,onWait:E}),{wait:O,stop(){$(p,{command:"serve-stop",key:d},()=>{})}}},ue="warning",ce="silent",me=p=>{let f=l++,a=Ye(),d,{refs:P,options:v,isTTY:M,callback:x}=p;if(typeof v=="object"){let O=v.plugins;if(O!==void 0){if(!Array.isArray(O))throw new Error('"plugins" must be an array');d=O}}let T=(O,A,D,B)=>{let L=[];try{Pe(L,v,{},M,ue)}catch(S){}let ee=ve(O,e,a,D,A);$(P,{command:"error",flags:L,error:ee},()=>{ee.detail=a.load(ee.detail),B(ee)})},E=(O,A)=>{T(O,A,void 0,D=>{x(Re("Build failed",[D],[]),null)})};if(d&&d.length>0){if(e.isSync)return E(new Error("Cannot use plugins in synchronous API calls"),"");te(v,d,f,a,P).then(O=>{if(!O.ok)E(O.error,O.pluginName);else try{de(Ne(Fe({},p),{key:f,details:a,logPluginError:T,requestPlugins:O.requestPlugins,runOnEndCallbacks:O.runOnEndCallbacks,pluginRefs:O.pluginRefs}))}catch(A){E(A,"")}},O=>E(O,""))}else try{de(Ne(Fe({},p),{key:f,details:a,logPluginError:T,requestPlugins:null,runOnEndCallbacks:(O,A,D)=>D(),pluginRefs:null}))}catch(O){E(O,"")}},de=({callName:p,refs:f,serveOptions:a,options:d,isTTY:P,defaultWD:v,callback:M,key:x,details:T,logPluginError:E,requestPlugins:O,runOnEndCallbacks:A,pluginRefs:D})=>{let B={ref(){D&&D.ref(),f&&f.ref()},unref(){D&&D.unref(),f&&f.unref()}},L=!e.isWriteUnavailable,{entries:ee,flags:S,write:w,stdinContents:s,stdinResolveDir:h,absWorkingDir:j,incremental:Y,nodePaths:b,watch:y,mangleCache:F}=wt(p,d,P,ue,L),k={command:"build",key:x,entries:ee,flags:S,write:w,stdinContents:s,stdinResolveDir:h,absWorkingDir:j||v,incremental:Y,nodePaths:b};O&&(k.plugins=O),F&&(k.mangleCache=F);let Q=a&&ae(B,a,k,x),q,K,X=(U,V)=>{U.outputFiles&&(V.outputFiles=U.outputFiles.map(Rt)),U.metafile&&(V.metafile=JSON.parse(U.metafile)),U.mangleCache&&(V.mangleCache=U.mangleCache),U.writeToStdout!==void 0&&console.log(he(U.writeToStdout).replace(/\n$/,""))},H=(U,V)=>{let G={errors:ge(U.errors,T),warnings:ge(U.warnings,T)};X(U,G),A(G,E,()=>{if(G.errors.length>0)return V(Re("Build failed",G.errors,G.warnings),null);if(U.rebuild){if(!q){let z=!1;q=()=>new Promise((fe,Z)=>{if(z||i)throw new Error("Cannot rebuild");$(B,{command:"rebuild",key:x},(re,nt)=>{if(re)return V(Re("Build failed",[{id:"",pluginName:"",text:re,location:null,notes:[],detail:void 0}],[]),null);H(nt,(Be,lt)=>{Be?Z(Be):fe(lt)})})}),B.ref(),q.dispose=()=>{z||(z=!0,$(B,{command:"rebuild-dispose",key:x},()=>{}),B.unref())}}G.rebuild=q}if(U.watch){if(!K){let z=!1;B.ref(),K=()=>{z||(z=!0,o.delete(x),$(B,{command:"watch-stop",key:x},()=>{}),B.unref())},y&&o.set(x,(fe,Z)=>{if(fe){y.onRebuild&&y.onRebuild(fe,null);return}let re={errors:ge(Z.errors,T),warnings:ge(Z.warnings,T)};X(Z,re),A(re,E,()=>{if(re.errors.length>0){y.onRebuild&&y.onRebuild(Re("Build failed",re.errors,re.warnings),null);return}Z.rebuildID!==void 0&&(re.rebuild=q),re.stop=K,y.onRebuild&&y.onRebuild(null,re)})})}G.stop=K}V(null,G)})};if(w&&e.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(Y&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(y&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');$(B,k,(U,V)=>{if(U)return M(new Error(U),null);if(Q){let G=V,z=!1;B.ref();let fe={port:G.port,host:G.host,wait:Q.wait,stop(){z||(z=!0,Q.stop(),B.unref())}};return B.ref(),Q.wait.then(B.unref,B.unref),M(null,fe)}return H(V,M)})};return{readFromStdout:N,afterClose:C,service:{buildOrServe:me,transform:({callName:p,refs:f,input:a,options:d,isTTY:P,fs:v,callback:M})=>{let x=Ye(),T=E=>{try{if(typeof a!="string"&&!(a instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:O,mangleCache:A}=vt(p,d,P,ce),D={command:"transform",flags:O,inputFS:E!==null,input:E!==null?ne(E):typeof a=="string"?ne(a):a};A&&(D.mangleCache=A),$(f,D,(B,L)=>{if(B)return M(new Error(B),null);let ee=ge(L.errors,x),S=ge(L.warnings,x),w=1,s=()=>{if(--w===0){let h={warnings:S,code:L.code,map:L.map};L.mangleCache&&(h.mangleCache=L==null?void 0:L.mangleCache),M(null,h)}};if(ee.length>0)return M(Re("Transform failed",ee,S),null);L.codeFS&&(w++,v.readFile(L.code,(h,j)=>{h!==null?M(h,null):(L.code=j,s())})),L.mapFS&&(w++,v.readFile(L.map,(h,j)=>{h!==null?M(h,null):(L.map=j,s())})),s()})}catch(O){let A=[];try{Pe(A,d,{},P,ce)}catch(B){}let D=ve(O,e,x,void 0,"");$(f,{command:"error",flags:A,error:D},()=>{D.detail=x.load(D.detail),M(Re("Transform failed",[D],[]),null)})}};if((typeof a=="string"||a instanceof Uint8Array)&&a.length>1024*1024){let E=T;T=()=>v.writeFile(a,E)}T(null)},formatMessages:({callName:p,refs:f,messages:a,options:d,callback:P})=>{let v=be(a,"messages",null,"");if(!d)throw new Error(`Missing second argument in ${p}() call`);let M={},x=n(d,M,"kind",m),T=n(d,M,"color",W),E=n(d,M,"terminalWidth",Oe);if(J(d,M,`in ${p}() call`),x===void 0)throw new Error(`Missing "kind" in ${p}() call`);if(x!=="error"&&x!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${p}() call`);let O={command:"format-msgs",messages:v,isWarning:x==="warning"};T!==void 0&&(O.color=T),E!==void 0&&(O.terminalWidth=E),$(f,O,(A,D)=>{if(A)return P(new Error(A),null);P(null,D.messages)})},analyzeMetafile:({callName:p,refs:f,metafile:a,options:d,callback:P})=>{d===void 0&&(d={});let v={},M=n(d,v,"color",W),x=n(d,v,"verbose",W);J(d,v,`in ${p}() call`);let T={command:"analyze-metafile",metafile:a};M!==void 0&&(T.color=M),x!==void 0&&(T.verbose=x),$(f,T,(E,O)=>{if(E)return P(new Error(E),null);P(null,O.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 o=t++;return e.set(o,r),o}}}function $e(e,t,r){let o,u=!1;return()=>{if(u)return o;u=!0;try{let i=(e.stack+"").split(`
|
3
|
+
`);i.splice(1,1);let c=rt(t,i,r);if(c)return o={text:e.message,location:c},o}catch(i){}}}function ve(e,t,r,o,u){let i="Internal error",c=null;try{i=(e&&e.message||e)+""}catch(l){}try{c=rt(t,(e.stack+"").split(`
|
4
|
+
`),"")}catch(l){}return{id:"",pluginName:u,text:i,location:c,notes:o?[o]:[],detail:r?r.store(e):-1}}function rt(e,t,r){let o=" at ";if(e.readFileSync&&!t[0].startsWith(o)&&t[1].startsWith(o))for(let u=1;u<t.length;u++){let i=t[u];if(!!i.startsWith(o))for(i=i.slice(o.length);;){let c=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(c){i=c[1];continue}if(c=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),c){i=c[1];continue}if(c=/^(\S+):(\d+):(\d+)$/.exec(i),c){let l;try{l=e.readFileSync(c[1],"utf8")}catch(C){break}let g=l.split(/\r\n|\r|\n|\u2028|\u2029/)[+c[2]-1]||"",R=+c[3]-1,N=g.slice(R,R+r.length)===r?r.length:0;return{file:c[1],namespace:"file",line:+c[2],column:ne(g.slice(0,R)).length,length:ne(g.slice(R,R+N)).length,lineText:g+`
|
5
5
|
`+t.slice(1).join(`
|
6
|
-
`),suggestion:""}}break}}return null}function Re(e,t,r){let
|
6
|
+
`),suggestion:""}}break}}return null}function Re(e,t,r){let o=5,u=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,o+1).map((c,l)=>{if(l===o)return`
|
7
7
|
...`;if(!c.location)return`
|
8
|
-
error: ${c.text}`;let{file:
|
9
|
-
${m}:${O}:${N}: ERROR: ${M}${c.text}`}).join(""),i=new Error(`${e}${u}`);return i.errors=t,i.warnings=r,i}function de(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Qe(e,t){if(e==null)return null;let r={},s=n(e,r,"file",y),u=n(e,r,"namespace",y),i=n(e,r,"line",Oe),c=n(e,r,"column",Oe),l=n(e,r,"length",Oe),m=n(e,r,"lineText",y),O=n(e,r,"suggestion",y);return J(e,r,t),{file:s||"",namespace:u||"",line:i||0,column:c||0,length:l||0,lineText:m||"",suggestion:O||""}}function be(e,t,r,s){let u=[],i=0;for(let c of e){let l={},m=n(c,l,"pluginName",y),O=n(c,l,"text",y),N=n(c,l,"location",Je),M=n(c,l,"notes",_),P=n(c,l,"detail",Ce),W=`in element ${i} of "${t}"`;J(c,l,W);let oe=[];if(M)for(let re of M){let ne={},le=n(re,ne,"text",y),ie=n(re,ne,"location",Je);J(re,ne,W),oe.push({text:le||"",location:Qe(ie,W)})}u.push({pluginName:m||s,text:O||"",location:Qe(N,W),notes:oe,detail:r?r.store(P):-1}),i++}return u}function $e(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function 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.39",xt=e=>Be().build(e),Et=()=>{throw new Error('The "serve" API only works in node')},kt=(e,t)=>Be().transform(e,t),Mt=(e,t)=>Be().formatMessages(e,t),$t=(e,t)=>Be().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')},At=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Bt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Se,qe,Be=()=>{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')},Tt=e=>{e=Ge(e||{});let t=e.wasmURL,r=e.wasmModule,s=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(Se)throw new Error('Cannot call "initialize" more than once');return Se=Dt(t||"",r,s),Se.catch(()=>{Se=void 0}),Se},Dt=(e,t,r)=>fe(void 0,null,function*(){let s;if(t)s=t;else{let l=yield fetch(e);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);s=yield l.arrayBuffer()}let u;if(r){let l=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,g,f)=>new Promise((h,n)=>{var s=c=>{try{l(f.next(c))}catch(u){n(u)}},i=c=>{try{l(f.throw(c))}catch(u){n(u)}},l=c=>c.done?h(c.value):Promise.resolve(c.value).then(s,i);l((f=f.apply(r,g)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let g of Object.getOwnPropertyNames(r))g in globalThis||Object.defineProperty(globalThis,g,{get:()=>self[g]});return(()=>{const r=()=>{const h=new Error("not implemented");return h.code="ENOSYS",h};if(!globalThis.fs){let h="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){h+=f.decode(s);const i=h.lastIndexOf(`\n`);return i!=-1&&(console.log(h.substr(0,i)),h=h.substr(i+1)),s.length},write(n,s,i,l,c,u){if(i!==0||l!==s.length||c!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},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,c,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,l){l(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const g=new TextEncoder("utf-8"),f=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const h=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let 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,a,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},c=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=s(t+m*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return f.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,h(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();h(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),a=c(e+32),m=Reflect.apply(o,t,a);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=c(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=c(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,h(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),h(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(h){return y(this,null,function*(){if(!(h instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=h,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=g.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(h){const n=this;return function(){const s={id:h,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let g=new TextDecoder,f=globalThis.fs,h="";f.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){h+=g.decode(u);let d=h.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),h=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:c})=>{c.length>0&&(n.push(c),s&&s())},f.read=(c,u,d,e,t,o)=>{if(c!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>f.read(c,u,d,e,t,o);return}let a=n[0],m=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+m),d),i+=m,i===a.length&&(n.shift(),i=0),o(null,m)};let l=new globalThis.Go;l.argv=["","--service=0.14.39"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,l.importObject).then(c=>l.run(c)):WebAssembly.instantiate(r,l.importObject).then(({instance:c})=>l.run(c))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});u=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
|
8
|
+
error: ${c.text}`;let{file:g,line:R,column:N}=c.location,C=c.pluginName?`[plugin: ${c.pluginName}] `:"";return`
|
9
|
+
${g}:${R}:${N}: ERROR: ${C}${c.text}`}).join(""),i=new Error(`${e}${u}`);return i.errors=t,i.warnings=r,i}function ge(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Qe(e,t){if(e==null)return null;let r={},o=n(e,r,"file",m),u=n(e,r,"namespace",m),i=n(e,r,"line",Oe),c=n(e,r,"column",Oe),l=n(e,r,"length",Oe),g=n(e,r,"lineText",m),R=n(e,r,"suggestion",m);return J(e,r,t),{file:o||"",namespace:u||"",line:i||0,column:c||0,length:l||0,lineText:g||"",suggestion:R||""}}function be(e,t,r,o){let u=[],i=0;for(let c of e){let l={},g=n(c,l,"id",m),R=n(c,l,"pluginName",m),N=n(c,l,"text",m),C=n(c,l,"location",Je),$=n(c,l,"notes",_),I=n(c,l,"detail",Ae),le=`in element ${i} of "${t}"`;J(c,l,le);let oe=[];if($)for(let ie of $){let te={},ae=n(ie,te,"text",m),ue=n(ie,te,"location",Je);J(ie,te,le),oe.push({text:ae||"",location:Qe(ue,le)})}u.push({id:g||"",pluginName:R||o,text:N||"",location:Qe(C,le),notes:oe,detail:r?r.store(I):-1}),i++}return u}function Me(e,t){let r=[];for(let o of e){if(typeof o!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(o)}return r}function Rt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){let o=this.contents;return(r===null||o!==t)&&(t=o,r=he(o)),r}}}var xt="0.14.53",St=e=>Te().build(e),Et=()=>{throw new Error('The "serve" API only works in node')},kt=(e,t)=>Te().transform(e,t),$t=(e,t)=>Te().formatMessages(e,t),Mt=(e,t)=>Te().analyzeMetafile(e,t),At=()=>{throw new Error('The "buildSync" API only works in node')},Ct=()=>{throw new Error('The "transformSync" API only works in node')},Pt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Tt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},xe,qe,Te=()=>{if(qe)return qe;throw xe?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=Xe(e||{});let t=e.wasmURL,r=e.wasmModule,o=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(xe)throw new Error('Cannot call "initialize" more than once');return xe=Bt(t||"",r,o),xe.catch(()=>{xe=void 0}),xe},Bt=(e,t,r)=>pe(void 0,null,function*(){let o;if(t)o=t;else{let l=yield fetch(e);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);o=yield l.arrayBuffer()}let u;if(r){let l=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,g,f)=>new Promise((h,n)=>{var s=c=>{try{l(f.next(c))}catch(u){n(u)}},i=c=>{try{l(f.throw(c))}catch(u){n(u)}},l=c=>c.done?h(c.value):Promise.resolve(c.value).then(s,i);l((f=f.apply(r,g)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let g of Object.getOwnPropertyNames(r))g in globalThis||Object.defineProperty(globalThis,g,{get:()=>self[g]});return(()=>{const r=()=>{const h=new Error("not implemented");return h.code="ENOSYS",h};if(!globalThis.fs){let h="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){h+=f.decode(s);const i=h.lastIndexOf(`\n`);return i!=-1&&(console.log(h.substr(0,i)),h=h.substr(i+1)),s.length},write(n,s,i,l,c,u){if(i!==0||l!==s.length||c!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},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,c,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,l){l(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const g=new TextEncoder("utf-8"),f=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const h=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let 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,a,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},c=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=s(t+m*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return f.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,h(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();h(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),a=c(e+32),m=Reflect.apply(o,t,a);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=c(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=c(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,h(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),h(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(h){return y(this,null,function*(){if(!(h instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=h,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=g.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(h){const n=this;return function(){const s={id:h,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let g=new TextDecoder,f=globalThis.fs,h="";f.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){h+=g.decode(u);let d=h.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),h=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:c})=>{c.length>0&&(n.push(c),s&&s())},f.read=(c,u,d,e,t,o)=>{if(c!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>f.read(c,u,d,e,t,o);return}let a=n[0],m=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+m),d),i+=m,i===a.length&&(n.shift(),i=0),o(null,m)};let l=new globalThis.Go;l.argv=["","--service=0.14.53"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,l.importObject).then(c=>l.run(c)):WebAssembly.instantiate(r,l.importObject).then(({instance:c})=>l.run(c))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});u=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
|
10
10
|
// Copyright 2018 The Go Authors. All rights reserved.
|
11
11
|
// Use of this source code is governed by a BSD-style
|
12
12
|
// license that can be found in the LICENSE file.
|
13
13
|
var y=(r,g,f)=>new Promise((h,n)=>{var s=c=>{try{l(f.next(c))}catch(u){n(u)}},i=c=>{try{l(f.throw(c))}catch(u){n(u)}},l=c=>c.done?h(c.value):Promise.resolve(c.value).then(s,i);l((f=f.apply(r,g)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let g of Object.getOwnPropertyNames(r))g in globalThis||Object.defineProperty(globalThis,g,{get:()=>self[g]});return(()=>{const r=()=>{const h=new Error("not implemented");return h.code="ENOSYS",h};if(!globalThis.fs){let h="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){h+=f.decode(s);const i=h.lastIndexOf(`
|
14
14
|
`);return i!=-1&&(console.log(h.substr(0,i)),h=h.substr(i+1)),s.length},write(n,s,i,l,c,u){if(i!==0||l!==s.length||c!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},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,c,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,l){l(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const g=new TextEncoder("utf-8"),f=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const h=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let 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,a,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},c=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=s(t+m*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return f.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,h(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();h(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),a=c(e+32),m=Reflect.apply(o,t,a);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=c(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=c(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,h(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),h(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(h){return y(this,null,function*(){if(!(h instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=h,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=g.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(h){const n=this;return function(){const s={id:h,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let g=new TextDecoder,f=globalThis.fs,h="";f.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){h+=g.decode(u);let d=h.split(`
|
15
15
|
`);d.length>1&&console.log(d.slice(0,-1).join(`
|
16
|
-
`)),h=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:c})=>{c.length>0&&(n.push(c),s&&s())},f.read=(c,u,d,e,t,o)=>{if(c!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>f.read(c,u,d,e,t,o);return}let a=n[0],m=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+m),d),i+=m,i===a.length&&(n.shift(),i=0),o(null,m)};let l=new globalThis.Go;l.argv=["","--service=0.14.
|
16
|
+
`)),h=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:c})=>{c.length>0&&(n.push(c),s&&s())},f.read=(c,u,d,e,t,o)=>{if(c!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>f.read(c,u,d,e,t,o);return}let a=n[0],m=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+m),d),i+=m,i===a.length&&(n.shift(),i=0),o(null,m)};let l=new globalThis.Go;l.argv=["","--service=0.14.53"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,l.importObject).then(c=>l.run(c)):WebAssembly.instantiate(r,l.importObject).then(({instance:c})=>l.run(c))},r=>onmessage(r);})(g=>u.onmessage({data:g}));u={onmessage:null,postMessage:g=>setTimeout(()=>l({data:g})),terminate(){}}}u.postMessage(o),u.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:c}=tt({writeToStdin(l){u.postMessage(l)},isSync:!1,isWriteUnavailable:!0,esbuild:De});qe={build:l=>new Promise((g,R)=>c.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(N,C)=>N?R(N):g(C)})),transform:(l,g)=>new Promise((R,N)=>c.transform({callName:"transform",refs:null,input:l,options:g||{},isTTY:!1,fs:{readFile(C,$){$(new Error("Internal error"),null)},writeFile(C,$){$(null)}},callback:(C,$)=>C?N(C):R($)})),formatMessages:(l,g)=>new Promise((R,N)=>c.formatMessages({callName:"formatMessages",refs:null,messages:l,options:g,callback:(C,$)=>C?N(C):R($)})),analyzeMetafile:(l,g)=>new Promise((R,N)=>c.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:g,callback:(C,$)=>C?N(C):R($)}))}}),Ft=De;
|
17
17
|
})(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export type Platform = 'browser' | 'node' | 'neutral';
|
2
2
|
export type Format = 'iife' | 'cjs' | 'esm';
|
3
|
-
export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'default';
|
3
|
+
export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'copy' | 'default';
|
4
4
|
export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
|
5
5
|
export type Charset = 'ascii' | 'utf8';
|
6
6
|
export type Drop = 'console' | 'debugger';
|
@@ -17,10 +17,14 @@ interface CommonOptions {
|
|
17
17
|
|
18
18
|
/** Documentation: https://esbuild.github.io/api/#format */
|
19
19
|
format?: Format;
|
20
|
-
/** Documentation: https://esbuild.github.io/api/#
|
20
|
+
/** Documentation: https://esbuild.github.io/api/#global-name */
|
21
21
|
globalName?: string;
|
22
22
|
/** Documentation: https://esbuild.github.io/api/#target */
|
23
23
|
target?: string | string[];
|
24
|
+
/** Documentation: https://esbuild.github.io/api/#supported */
|
25
|
+
supported?: Record<string, boolean>;
|
26
|
+
/** Documentation: https://esbuild.github.io/api/#platform */
|
27
|
+
platform?: Platform;
|
24
28
|
|
25
29
|
/** Documentation: https://esbuild.github.io/api/#mangle-props */
|
26
30
|
mangleProps?: RegExp;
|
@@ -48,11 +52,15 @@ interface CommonOptions {
|
|
48
52
|
ignoreAnnotations?: boolean;
|
49
53
|
|
50
54
|
/** Documentation: https://esbuild.github.io/api/#jsx */
|
51
|
-
jsx?: 'transform' | 'preserve';
|
55
|
+
jsx?: 'transform' | 'preserve' | 'automatic';
|
52
56
|
/** Documentation: https://esbuild.github.io/api/#jsx-factory */
|
53
57
|
jsxFactory?: string;
|
54
58
|
/** Documentation: https://esbuild.github.io/api/#jsx-fragment */
|
55
59
|
jsxFragment?: string;
|
60
|
+
/** Documentation: https://esbuild.github.io/api/#jsx-import-source */
|
61
|
+
jsxImportSource?: string;
|
62
|
+
/** Documentation: https://esbuild.github.io/api/#jsx-development */
|
63
|
+
jsxDev?: boolean;
|
56
64
|
|
57
65
|
/** Documentation: https://esbuild.github.io/api/#define */
|
58
66
|
define?: { [key: string]: string };
|
@@ -67,6 +75,8 @@ interface CommonOptions {
|
|
67
75
|
logLevel?: LogLevel;
|
68
76
|
/** Documentation: https://esbuild.github.io/api/#log-limit */
|
69
77
|
logLimit?: number;
|
78
|
+
/** Documentation: https://esbuild.github.io/api/#log-override */
|
79
|
+
logOverride?: Record<string, LogLevel>;
|
70
80
|
}
|
71
81
|
|
72
82
|
export interface BuildOptions extends CommonOptions {
|
@@ -84,15 +94,13 @@ export interface BuildOptions extends CommonOptions {
|
|
84
94
|
outdir?: string;
|
85
95
|
/** Documentation: https://esbuild.github.io/api/#outbase */
|
86
96
|
outbase?: string;
|
87
|
-
/** Documentation: https://esbuild.github.io/api/#platform */
|
88
|
-
platform?: Platform;
|
89
97
|
/** Documentation: https://esbuild.github.io/api/#external */
|
90
98
|
external?: string[];
|
91
99
|
/** Documentation: https://esbuild.github.io/api/#loader */
|
92
100
|
loader?: { [ext: string]: Loader };
|
93
101
|
/** Documentation: https://esbuild.github.io/api/#resolve-extensions */
|
94
102
|
resolveExtensions?: string[];
|
95
|
-
/** Documentation: https://esbuild.github.io/api/#
|
103
|
+
/** Documentation: https://esbuild.github.io/api/#main-fields */
|
96
104
|
mainFields?: string[];
|
97
105
|
/** Documentation: https://esbuild.github.io/api/#conditions */
|
98
106
|
conditions?: string[];
|
@@ -139,13 +147,14 @@ export interface WatchMode {
|
|
139
147
|
}
|
140
148
|
|
141
149
|
export interface StdinOptions {
|
142
|
-
contents: string;
|
150
|
+
contents: string | Uint8Array;
|
143
151
|
resolveDir?: string;
|
144
152
|
sourcefile?: string;
|
145
153
|
loader?: Loader;
|
146
154
|
}
|
147
155
|
|
148
156
|
export interface Message {
|
157
|
+
id: string;
|
149
158
|
pluginName: string;
|
150
159
|
text: string;
|
151
160
|
location: Location | null;
|
@@ -400,6 +409,7 @@ export interface OnLoadResult {
|
|
400
409
|
}
|
401
410
|
|
402
411
|
export interface PartialMessage {
|
412
|
+
id?: string;
|
403
413
|
pluginName?: string;
|
404
414
|
text?: string;
|
405
415
|
location?: Partial<Location> | null;
|
@@ -489,7 +499,7 @@ export declare function serve(serveOptions: ServeOptions, buildOptions: BuildOpt
|
|
489
499
|
*
|
490
500
|
* Documentation: https://esbuild.github.io/api/#transform-api
|
491
501
|
*/
|
492
|
-
export declare function transform(input: string, options?: TransformOptions): Promise<TransformResult>;
|
502
|
+
export declare function transform(input: string | Uint8Array, options?: TransformOptions): Promise<TransformResult>;
|
493
503
|
|
494
504
|
/**
|
495
505
|
* Converts log messages to formatted message strings suitable for printing in
|