Interactive Angular 19 demo for @sda/notification-elements-ui with 6 sections: Bell & Feed, Notification Center, Inbox, Comments & Threads, Mention Input, and Full-Featured layout. Includes mock data, dark mode toggle, and real-time event log. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
50 KiB
JavaScript
23 lines
50 KiB
JavaScript
(module=>{
|
|
"use strict";var $e=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Qe=Object.getOwnPropertyNames;var He=Object.prototype.hasOwnProperty;var Xe=(e,t)=>{for(var n in t)$e(e,n,{get:t[n],enumerable:!0})},Ze=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Qe(t))!He.call(e,a)&&a!==n&&$e(e,a,{get:()=>t[a],enumerable:!(i=Ge(t,a))||i.enumerable});return e};var et=e=>Ze($e({},"__esModule",{value:!0}),e);var te=(e,t,n)=>new Promise((i,a)=>{var l=d=>{try{s(n.next(d))}catch(P){a(P)}},g=d=>{try{s(n.throw(d))}catch(P){a(P)}},s=d=>d.done?i(d.value):Promise.resolve(d.value).then(l,g);s((n=n.apply(e,t)).next())});var ke={};Xe(ke,{analyzeMetafile:()=>wt,analyzeMetafileSync:()=>Ot,build:()=>mt,buildSync:()=>vt,context:()=>yt,default:()=>$t,formatMessages:()=>bt,formatMessagesSync:()=>xt,initialize:()=>St,stop:()=>Et,transform:()=>ht,transformSync:()=>Rt,version:()=>pt});module.exports=et(ke);function Ae(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 a of i)t(a)}else{let a=Object.keys(i);n.write8(6),n.write32(a.length);for(let l of a)n.write(Z(l)),t(i[l])}},n=new he;return n.write32(0),n.write32(e.id<<1|+!e.isRequest),t(e.value),Ce(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function Pe(e){let t=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return se(n.read());case 4:return n.read();case 5:{let g=n.read32(),s=[];for(let d=0;d<g;d++)s.push(t());return s}case 6:{let g=n.read32(),s={};for(let d=0;d<g;d++)s[se(n.read())]=t();return s}default:throw new Error("Invalid packet")}},n=new he(e),i=n.read32(),a=(i&1)===0;i>>>=1;let l=t();if(n.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:a,value:l}}var he=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);Ce(this.buf,t,n)}write(t){let n=this._write(4+t.length);Ce(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 Fe(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,se,Me;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;Z=n=>e.encode(n),se=n=>t.decode(n),Me='new TextEncoder().encode("")'}else if(typeof Buffer!="undefined")Z=e=>Buffer.from(e),se=e=>{let{buffer:t,byteOffset:n,byteLength:i}=e;return Buffer.from(t,n,i).toString()},Me='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Me} 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 Fe(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ce(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var _=JSON.stringify,Te="warning",De="silent";function pe(e,t){let n=[];for(let i of e){if(J(i,t),i.indexOf(",")>=0)throw new Error(`Invalid ${t}: ${i}`);n.push(i)}return n.join(",")}var ve=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",m=e=>typeof e=="string"?null:"a string",Re=e=>e instanceof RegExp?null:"a RegExp object",fe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",nt=e=>typeof e=="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",je=e=>typeof e=="function"?null:"a function",ie=e=>Array.isArray(e)?null:"an array",G=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"an array of strings",Y=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",rt=e=>typeof e=="object"&&e!==null?null:"an array or an object",it=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Be=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Le=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",lt=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ne=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"a string or an array of strings",qe=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",st=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let a=e[n];if(t[n+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`${_(n)} must be ${l}`);return a}function K(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${_(i)}`)}function Ie(e){let t=Object.create(null),n=r(e,t,"wasmURL",st),i=r(e,t,"wasmModule",it),a=r(e,t,"worker",I);return K(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:a}}function We(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 ${_(n)} in mangle cache to map to either a string or false`)}}return t}function Oe(e,t,n,i,a){let l=r(t,n,"color",I),g=r(t,n,"logLevel",m),s=r(t,n,"logLimit",fe);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${g||a}`),e.push(`--log-limit=${s||0}`)}function J(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+_(n):""} to be a string, got ${typeof e} instead`);return e}function ze(e,t,n){let i=r(t,n,"legalComments",m),a=r(t,n,"sourceRoot",m),l=r(t,n,"sourcesContent",I),g=r(t,n,"target",Ne),s=r(t,n,"format",m),d=r(t,n,"globalName",m),P=r(t,n,"mangleProps",Re),A=r(t,n,"reserveProps",Re),b=r(t,n,"mangleQuoted",I),j=r(t,n,"minify",I),T=r(t,n,"minifySyntax",I),L=r(t,n,"minifyWhitespace",I),N=r(t,n,"minifyIdentifiers",I),S=r(t,n,"lineLimit",fe),z=r(t,n,"drop",G),V=r(t,n,"dropLabels",G),w=r(t,n,"charset",m),p=r(t,n,"treeShaking",I),f=r(t,n,"ignoreAnnotations",I),o=r(t,n,"jsx",m),v=r(t,n,"jsxFactory",m),O=r(t,n,"jsxFragment",m),M=r(t,n,"jsxImportSource",m),D=r(t,n,"jsxDev",I),u=r(t,n,"jsxSideEffects",I),c=r(t,n,"define",Y),h=r(t,n,"logOverride",Y),k=r(t,n,"supported",Y),F=r(t,n,"pure",G),$=r(t,n,"keepNames",I),R=r(t,n,"platform",m),C=r(t,n,"tsconfigRaw",lt);if(i&&e.push(`--legal-comments=${i}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),g&&e.push(`--target=${pe(Array.isArray(g)?g:[g],"target")}`),s&&e.push(`--format=${s}`),d&&e.push(`--global-name=${d}`),R&&e.push(`--platform=${R}`),C&&e.push(`--tsconfig-raw=${typeof C=="string"?C:JSON.stringify(C)}`),j&&e.push("--minify"),T&&e.push("--minify-syntax"),L&&e.push("--minify-whitespace"),N&&e.push("--minify-identifiers"),S&&e.push(`--line-limit=${S}`),w&&e.push(`--charset=${w}`),p!==void 0&&e.push(`--tree-shaking=${p}`),f&&e.push("--ignore-annotations"),z)for(let x of z)e.push(`--drop:${J(x,"drop")}`);if(V&&e.push(`--drop-labels=${pe(V,"drop label")}`),P&&e.push(`--mangle-props=${xe(P)}`),A&&e.push(`--reserve-props=${xe(A)}`),b!==void 0&&e.push(`--mangle-quoted=${b}`),o&&e.push(`--jsx=${o}`),v&&e.push(`--jsx-factory=${v}`),O&&e.push(`--jsx-fragment=${O}`),M&&e.push(`--jsx-import-source=${M}`),D&&e.push("--jsx-dev"),u&&e.push("--jsx-side-effects"),c)for(let x in c){if(x.indexOf("=")>=0)throw new Error(`Invalid define: ${x}`);e.push(`--define:${x}=${J(c[x],"define",x)}`)}if(h)for(let x in h){if(x.indexOf("=")>=0)throw new Error(`Invalid log override: ${x}`);e.push(`--log-override:${x}=${J(h[x],"log override",x)}`)}if(k)for(let x in k){if(x.indexOf("=")>=0)throw new Error(`Invalid supported: ${x}`);let E=k[x];if(typeof E!="boolean")throw new Error(`Expected value for supported ${_(x)} to be a boolean, got ${typeof E} instead`);e.push(`--supported:${x}=${E}`)}if(F)for(let x of F)e.push(`--pure:${J(x,"pure")}`);$&&e.push("--keep-names")}function ot(e,t,n,i,a){var ue;let l=[],g=[],s=Object.create(null),d=null,P=null;Oe(l,t,s,n,i),ze(l,t,s);let A=r(t,s,"sourcemap",Le),b=r(t,s,"bundle",I),j=r(t,s,"splitting",I),T=r(t,s,"preserveSymlinks",I),L=r(t,s,"metafile",I),N=r(t,s,"outfile",m),S=r(t,s,"outdir",m),z=r(t,s,"outbase",m),V=r(t,s,"tsconfig",m),w=r(t,s,"resolveExtensions",G),p=r(t,s,"nodePaths",G),f=r(t,s,"mainFields",G),o=r(t,s,"conditions",G),v=r(t,s,"external",G),O=r(t,s,"packages",m),M=r(t,s,"alias",Y),D=r(t,s,"loader",Y),u=r(t,s,"outExtension",Y),c=r(t,s,"publicPath",m),h=r(t,s,"entryNames",m),k=r(t,s,"chunkNames",m),F=r(t,s,"assetNames",m),$=r(t,s,"inject",G),R=r(t,s,"banner",Y),C=r(t,s,"footer",Y),x=r(t,s,"entryPoints",rt),E=r(t,s,"absWorkingDir",m),B=r(t,s,"stdin",Y),q=(ue=r(t,s,"write",I))!=null?ue:a,U=r(t,s,"allowOverwrite",I),Q=r(t,s,"mangleCache",Y);if(s.plugins=!0,K(t,s,`in ${e}() call`),A&&l.push(`--sourcemap${A===!0?"":`=${A}`}`),b&&l.push("--bundle"),U&&l.push("--allow-overwrite"),j&&l.push("--splitting"),T&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),N&&l.push(`--outfile=${N}`),S&&l.push(`--outdir=${S}`),z&&l.push(`--outbase=${z}`),V&&l.push(`--tsconfig=${V}`),O&&l.push(`--packages=${O}`),w&&l.push(`--resolve-extensions=${pe(w,"resolve extension")}`),c&&l.push(`--public-path=${c}`),h&&l.push(`--entry-names=${h}`),k&&l.push(`--chunk-names=${k}`),F&&l.push(`--asset-names=${F}`),f&&l.push(`--main-fields=${pe(f,"main field")}`),o&&l.push(`--conditions=${pe(o,"condition")}`),v)for(let y of v)l.push(`--external:${J(y,"external")}`);if(M)for(let y in M){if(y.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${y}`);l.push(`--alias:${y}=${J(M[y],"alias",y)}`)}if(R)for(let y in R){if(y.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${y}`);l.push(`--banner:${y}=${J(R[y],"banner",y)}`)}if(C)for(let y in C){if(y.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${y}`);l.push(`--footer:${y}=${J(C[y],"footer",y)}`)}if($)for(let y of $)l.push(`--inject:${J(y,"inject")}`);if(D)for(let y in D){if(y.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${y}`);l.push(`--loader:${y}=${J(D[y],"loader",y)}`)}if(u)for(let y in u){if(y.indexOf("=")>=0)throw new Error(`Invalid out extension: ${y}`);l.push(`--out-extension:${y}=${J(u[y],"out extension",y)}`)}if(x)if(Array.isArray(x))for(let y=0,ne=x.length;y<ne;y++){let H=x[y];if(typeof H=="object"&&H!==null){let ee=Object.create(null),re=r(H,ee,"in",m),X=r(H,ee,"out",m);if(K(H,ee,"in entry point at index "+y),re===void 0)throw new Error('Missing property "in" for entry point at index '+y);if(X===void 0)throw new Error('Missing property "out" for entry point at index '+y);g.push([X,re])}else g.push(["",J(H,"entry point at index "+y)])}else for(let y in x)g.push([y,J(x[y],"entry point",y)]);if(B){let y=Object.create(null),ne=r(B,y,"contents",qe),H=r(B,y,"resolveDir",m),ee=r(B,y,"sourcefile",m),re=r(B,y,"loader",m);K(B,y,'in "stdin" object'),ee&&l.push(`--sourcefile=${ee}`),re&&l.push(`--loader=${re}`),H&&(P=H),typeof ne=="string"?d=Z(ne):ne instanceof Uint8Array&&(d=ne)}let W=[];if(p)for(let y of p)y+="",W.push(y);return{entries:g,flags:l,write:q,stdinContents:d,stdinResolveDir:P,absWorkingDir:E,nodePaths:W,mangleCache:We(Q)}}function at(e,t,n,i){let a=[],l=Object.create(null);Oe(a,t,l,n,i),ze(a,t,l);let g=r(t,l,"sourcemap",Le),s=r(t,l,"sourcefile",m),d=r(t,l,"loader",m),P=r(t,l,"banner",m),A=r(t,l,"footer",m),b=r(t,l,"mangleCache",Y);return K(t,l,`in ${e}() call`),g&&a.push(`--sourcemap=${g===!0?"external":g}`),s&&a.push(`--sourcefile=${s}`),d&&a.push(`--loader=${d}`),P&&a.push(`--banner=${P}`),A&&a.push(`--footer=${A}`),{flags:a,mangleCache:We(b)}}function Ke(e){let t={},n={didClose:!1,reason:""},i={},a=0,l=0,g=new Uint8Array(16*1024),s=0,d=w=>{let p=s+w.length;if(p>g.length){let o=new Uint8Array(p*2);o.set(g),g=o}g.set(w,s),s+=w.length;let f=0;for(;f+4<=s;){let o=Fe(g,f);if(f+4+o>s)break;f+=4,L(g.subarray(f,f+o)),f+=o}f>0&&(g.copyWithin(0,f,s),s-=f)},P=w=>{n.didClose=!0,w&&(n.reason=": "+(w.message||w));let p="The service was stopped"+n.reason;for(let f in i)i[f](p,null);i={}},A=(w,p,f)=>{if(n.didClose)return f("The service is no longer running"+n.reason,null);let o=a++;i[o]=(v,O)=>{try{f(v,O)}finally{w&&w.unref()}},w&&w.ref(),e.writeToStdin(Ae({id:o,isRequest:!0,value:p}))},b=(w,p)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);e.writeToStdin(Ae({id:w,isRequest:!1,value:p}))},j=(w,p)=>te(null,null,function*(){try{if(p.command==="ping"){b(w,{});return}if(typeof p.key=="number"){let f=t[p.key];if(!f)return;let o=f[p.command];if(o){yield o(w,p);return}}throw new Error("Invalid command: "+p.command)}catch(f){let o=[oe(f,e,null,void 0,"")];try{b(w,{errors:o})}catch(v){}}}),T=!0,L=w=>{if(T){T=!1;let f=String.fromCharCode(...w);if(f!=="0.25.4")throw new Error(`Cannot start service: Host version "0.25.4" does not match binary version ${_(f)}`);return}let p=Pe(w);if(p.isRequest)j(p.id,p.value);else{let f=i[p.id];delete i[p.id],p.value.error?f(p.value.error,{}):f(null,p.value)}};return{readFromStdout:d,afterClose:P,service:{buildOrContext:({callName:w,refs:p,options:f,isTTY:o,defaultWD:v,callback:O})=>{let M=0,D=l++,u={},c={ref(){++M===1&&p&&p.ref()},unref(){--M===0&&(delete t[D],p&&p.unref())}};t[D]=u,c.ref(),ut(w,D,A,b,c,e,u,f,o,v,(h,k)=>{try{O(h,k)}finally{c.unref()}})},transform:({callName:w,refs:p,input:f,options:o,isTTY:v,fs:O,callback:M})=>{let D=_e(),u=c=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:h,mangleCache:k}=at(w,o,v,De),F={command:"transform",flags:h,inputFS:c!==null,input:c!==null?Z(c):typeof f=="string"?Z(f):f};k&&(F.mangleCache=k),A(p,F,($,R)=>{if($)return M(new Error($),null);let C=de(R.errors,D),x=de(R.warnings,D),E=1,B=()=>{if(--E===0){let q={warnings:x,code:R.code,map:R.map,mangleCache:void 0,legalComments:void 0};"legalComments"in R&&(q.legalComments=R==null?void 0:R.legalComments),R.mangleCache&&(q.mangleCache=R==null?void 0:R.mangleCache),M(null,q)}};if(C.length>0)return M(me("Transform failed",C,x),null);R.codeFS&&(E++,O.readFile(R.code,(q,U)=>{q!==null?M(q,null):(R.code=U,B())})),R.mapFS&&(E++,O.readFile(R.map,(q,U)=>{q!==null?M(q,null):(R.map=U,B())})),B()})}catch(h){let k=[];try{Oe(k,o,{},v,De)}catch($){}let F=oe(h,e,D,void 0,"");A(p,{command:"error",flags:k,error:F},()=>{F.detail=D.load(F.detail),M(me("Transform failed",[F],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let c=u;u=()=>O.writeFile(f,c)}u(null)},formatMessages:({callName:w,refs:p,messages:f,options:o,callback:v})=>{if(!o)throw new Error(`Missing second argument in ${w}() call`);let O={},M=r(o,O,"kind",m),D=r(o,O,"color",I),u=r(o,O,"terminalWidth",fe);if(K(o,O,`in ${w}() call`),M===void 0)throw new Error(`Missing "kind" in ${w}() call`);if(M!=="error"&&M!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${w}() call`);let c={command:"format-msgs",messages:le(f,"messages",null,"",u),isWarning:M==="warning"};D!==void 0&&(c.color=D),u!==void 0&&(c.terminalWidth=u),A(p,c,(h,k)=>{if(h)return v(new Error(h),null);v(null,k.messages)})},analyzeMetafile:({callName:w,refs:p,metafile:f,options:o,callback:v})=>{o===void 0&&(o={});let O={},M=r(o,O,"color",I),D=r(o,O,"verbose",I);K(o,O,`in ${w}() call`);let u={command:"analyze-metafile",metafile:f};M!==void 0&&(u.color=M),D!==void 0&&(u.verbose=D),A(p,u,(c,h)=>{if(c)return v(new Error(c),null);v(null,h.result)})}}}}function ut(e,t,n,i,a,l,g,s,d,P,A){let b=_e(),j=e==="context",T=(S,z)=>{let V=[];try{Oe(V,s,{},d,Te)}catch(p){}let w=oe(S,l,b,void 0,z);n(a,{command:"error",flags:V,error:w},()=>{w.detail=b.load(w.detail),A(me(j?"Context failed":"Build failed",[w],[]),null)})},L;if(typeof s=="object"){let S=s.plugins;if(S!==void 0){if(!Array.isArray(S))return T(new Error('"plugins" must be an array'),"");L=S}}if(L&&L.length>0){if(l.isSync)return T(new Error("Cannot use plugins in synchronous API calls"),"");ct(t,n,i,a,l,g,s,L,b).then(S=>{if(!S.ok)return T(S.error,S.pluginName);try{N(S.requestPlugins,S.runOnEndCallbacks,S.scheduleOnDisposeCallbacks)}catch(z){T(z,"")}},S=>T(S,""));return}try{N(null,(S,z)=>z([],[]),()=>{})}catch(S){T(S,"")}function N(S,z,V){let w=l.hasFS,{entries:p,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M,nodePaths:D,mangleCache:u}=ot(e,s,d,Te,w);if(o&&!l.hasFS)throw new Error('The "write" option is unavailable in this environment');let c={command:"build",key:t,entries:p,flags:f,write:o,stdinContents:v,stdinResolveDir:O,absWorkingDir:M||P,nodePaths:D,context:j};S&&(c.plugins=S),u&&(c.mangleCache=u);let h=($,R)=>{let C={errors:de($.errors,b),warnings:de($.warnings,b),outputFiles:void 0,metafile:void 0,mangleCache:void 0},x=C.errors.slice(),E=C.warnings.slice();$.outputFiles&&(C.outputFiles=$.outputFiles.map(dt)),$.metafile&&(C.metafile=JSON.parse($.metafile)),$.mangleCache&&(C.mangleCache=$.mangleCache),$.writeToStdout!==void 0&&console.log(se($.writeToStdout).replace(/\n$/,"")),z(C,(B,q)=>{if(x.length>0||B.length>0){let U=me("Build failed",x.concat(B),E.concat(q));return R(U,null,B,q)}R(null,C,B,q)})},k,F;j&&(g["on-end"]=($,R)=>new Promise(C=>{h(R,(x,E,B,q)=>{let U={errors:B,warnings:q};F&&F(x,E),k=void 0,F=void 0,i($,U),C()})})),n(a,c,($,R)=>{if($)return A(new Error($),null);if(!j)return h(R,(E,B)=>(V(),A(E,B)));if(R.errors.length>0)return A(me("Context failed",R.errors,R.warnings),null);let C=!1,x={rebuild:()=>(k||(k=new Promise((E,B)=>{let q;F=(Q,W)=>{q||(q=()=>Q?B(Q):E(W))};let U=()=>{n(a,{command:"rebuild",key:t},(W,ue)=>{W?B(new Error(W)):q?q():U()})};U()})),k),watch:(E={})=>new Promise((B,q)=>{if(!l.hasFS)throw new Error('Cannot use the "watch" API in this environment');K(E,{},"in watch() call"),n(a,{command:"watch",key:t},W=>{W?q(new Error(W)):B(void 0)})}),serve:(E={})=>new Promise((B,q)=>{if(!l.hasFS)throw new Error('Cannot use the "serve" API in this environment');let U={},Q=r(E,U,"port",nt),W=r(E,U,"host",m),ue=r(E,U,"servedir",m),y=r(E,U,"keyfile",m),ne=r(E,U,"certfile",m),H=r(E,U,"fallback",m),ee=r(E,U,"cors",Y),re=r(E,U,"onRequest",je);K(E,U,"in serve() call");let X={command:"serve",key:t,onRequest:!!re};if(Q!==void 0&&(X.port=Q),W!==void 0&&(X.host=W),ue!==void 0&&(X.servedir=ue),y!==void 0&&(X.keyfile=y),ne!==void 0&&(X.certfile=ne),H!==void 0&&(X.fallback=H),ee){let ge={},ce=r(ee,ge,"origin",Ne);K(ee,ge,'on "cors" object'),Array.isArray(ce)?X.corsOrigin=ce:ce!==void 0&&(X.corsOrigin=[ce])}n(a,X,(ge,ce)=>{if(ge)return q(new Error(ge));re&&(g["serve-request"]=(Je,Ye)=>{re(Ye.args),i(Je,{})}),B(ce)})}),cancel:()=>new Promise(E=>{if(C)return E();n(a,{command:"cancel",key:t},()=>{E()})}),dispose:()=>new Promise(E=>{if(C)return E();C=!0,n(a,{command:"dispose",key:t},()=>{E(),V(),a.unref()})})};a.ref(),A(null,x)})}}var ct=(e,t,n,i,a,l,g,s,d)=>te(null,null,function*(){let P=[],A=[],b={},j={},T=[],L=0,N=0,S=[],z=!1;s=[...s];for(let p of s){let f={};if(typeof p!="object")throw new Error(`Plugin at index ${N} must be an object`);let o=r(p,f,"name",m);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${N} is missing a name`);try{let v=r(p,f,"setup",je);if(typeof v!="function")throw new Error("Plugin is missing a setup function");K(p,f,`on plugin ${_(o)}`);let O={name:o,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};N++;let D=v({initialOptions:g,resolve:(u,c={})=>{if(!z)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof u!="string")throw new Error("The path to resolve must be a string");let h=Object.create(null),k=r(c,h,"pluginName",m),F=r(c,h,"importer",m),$=r(c,h,"namespace",m),R=r(c,h,"resolveDir",m),C=r(c,h,"kind",m),x=r(c,h,"pluginData",ve),E=r(c,h,"with",Y);return K(c,h,"in resolve() call"),new Promise((B,q)=>{let U={command:"resolve",path:u,key:e,pluginName:o};if(k!=null&&(U.pluginName=k),F!=null&&(U.importer=F),$!=null&&(U.namespace=$),R!=null&&(U.resolveDir=R),C!=null)U.kind=C;else throw new Error('Must specify "kind" when calling "resolve"');x!=null&&(U.pluginData=d.store(x)),E!=null&&(U.with=ft(E,"with")),t(i,U,(Q,W)=>{Q!==null?q(new Error(Q)):B({errors:de(W.errors,d),warnings:de(W.warnings,d),path:W.path,external:W.external,sideEffects:W.sideEffects,namespace:W.namespace,suffix:W.suffix,pluginData:d.load(W.pluginData)})})})},onStart(u){let c='This error came from the "onStart" callback registered here:',h=be(new Error(c),a,"onStart");P.push({name:o,callback:u,note:h}),O.onStart=!0},onEnd(u){let c='This error came from the "onEnd" callback registered here:',h=be(new Error(c),a,"onEnd");A.push({name:o,callback:u,note:h}),O.onEnd=!0},onResolve(u,c){let h='This error came from the "onResolve" callback registered here:',k=be(new Error(h),a,"onResolve"),F={},$=r(u,F,"filter",Re),R=r(u,F,"namespace",m);if(K(u,F,`in onResolve() call for plugin ${_(o)}`),$==null)throw new Error("onResolve() call is missing a filter");let C=L++;b[C]={name:o,callback:c,note:k},O.onResolve.push({id:C,filter:xe($),namespace:R||""})},onLoad(u,c){let h='This error came from the "onLoad" callback registered here:',k=be(new Error(h),a,"onLoad"),F={},$=r(u,F,"filter",Re),R=r(u,F,"namespace",m);if(K(u,F,`in onLoad() call for plugin ${_(o)}`),$==null)throw new Error("onLoad() call is missing a filter");let C=L++;j[C]={name:o,callback:c,note:k},O.onLoad.push({id:C,filter:xe($),namespace:R||""})},onDispose(u){T.push(u)},esbuild:a.esbuild});D&&(yield D),S.push(O)}catch(v){return{ok:!1,error:v,pluginName:o}}}l["on-start"]=(p,f)=>te(null,null,function*(){d.clear();let o={errors:[],warnings:[]};yield Promise.all(P.map(D=>te(null,[D],function*({name:v,callback:O,note:M}){try{let u=yield O();if(u!=null){if(typeof u!="object")throw new Error(`Expected onStart() callback in plugin ${_(v)} to return an object`);let c={},h=r(u,c,"errors",ie),k=r(u,c,"warnings",ie);K(u,c,`from onStart() callback in plugin ${_(v)}`),h!=null&&o.errors.push(...le(h,"errors",d,v,void 0)),k!=null&&o.warnings.push(...le(k,"warnings",d,v,void 0))}}catch(u){o.errors.push(oe(u,a,d,M&&M(),v))}}))),n(p,o)}),l["on-resolve"]=(p,f)=>te(null,null,function*(){let o={},v="",O,M;for(let D of f.ids)try{({name:v,callback:O,note:M}=b[D]);let u=yield O({path:f.path,importer:f.importer,namespace:f.namespace,resolveDir:f.resolveDir,kind:f.kind,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onResolve() callback in plugin ${_(v)} to return an object`);let c={},h=r(u,c,"pluginName",m),k=r(u,c,"path",m),F=r(u,c,"namespace",m),$=r(u,c,"suffix",m),R=r(u,c,"external",I),C=r(u,c,"sideEffects",I),x=r(u,c,"pluginData",ve),E=r(u,c,"errors",ie),B=r(u,c,"warnings",ie),q=r(u,c,"watchFiles",G),U=r(u,c,"watchDirs",G);K(u,c,`from onResolve() callback in plugin ${_(v)}`),o.id=D,h!=null&&(o.pluginName=h),k!=null&&(o.path=k),F!=null&&(o.namespace=F),$!=null&&(o.suffix=$),R!=null&&(o.external=R),C!=null&&(o.sideEffects=C),x!=null&&(o.pluginData=d.store(x)),E!=null&&(o.errors=le(E,"errors",d,v,void 0)),B!=null&&(o.warnings=le(B,"warnings",d,v,void 0)),q!=null&&(o.watchFiles=we(q,"watchFiles")),U!=null&&(o.watchDirs=we(U,"watchDirs"));break}}catch(u){o={id:D,errors:[oe(u,a,d,M&&M(),v)]};break}n(p,o)}),l["on-load"]=(p,f)=>te(null,null,function*(){let o={},v="",O,M;for(let D of f.ids)try{({name:v,callback:O,note:M}=j[D]);let u=yield O({path:f.path,namespace:f.namespace,suffix:f.suffix,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onLoad() callback in plugin ${_(v)} to return an object`);let c={},h=r(u,c,"pluginName",m),k=r(u,c,"contents",qe),F=r(u,c,"resolveDir",m),$=r(u,c,"pluginData",ve),R=r(u,c,"loader",m),C=r(u,c,"errors",ie),x=r(u,c,"warnings",ie),E=r(u,c,"watchFiles",G),B=r(u,c,"watchDirs",G);K(u,c,`from onLoad() callback in plugin ${_(v)}`),o.id=D,h!=null&&(o.pluginName=h),k instanceof Uint8Array?o.contents=k:k!=null&&(o.contents=Z(k)),F!=null&&(o.resolveDir=F),$!=null&&(o.pluginData=d.store($)),R!=null&&(o.loader=R),C!=null&&(o.errors=le(C,"errors",d,v,void 0)),x!=null&&(o.warnings=le(x,"warnings",d,v,void 0)),E!=null&&(o.watchFiles=we(E,"watchFiles")),B!=null&&(o.watchDirs=we(B,"watchDirs"));break}}catch(u){o={id:D,errors:[oe(u,a,d,M&&M(),v)]};break}n(p,o)});let V=(p,f)=>f([],[]);A.length>0&&(V=(p,f)=>{te(null,null,function*(){let o=[],v=[];for(let{name:O,callback:M,note:D}of A){let u,c;try{let h=yield M(p);if(h!=null){if(typeof h!="object")throw new Error(`Expected onEnd() callback in plugin ${_(O)} to return an object`);let k={},F=r(h,k,"errors",ie),$=r(h,k,"warnings",ie);K(h,k,`from onEnd() callback in plugin ${_(O)}`),F!=null&&(u=le(F,"errors",d,O,void 0)),$!=null&&(c=le($,"warnings",d,O,void 0))}}catch(h){u=[oe(h,a,d,D&&D(),O)]}if(u){o.push(...u);try{p.errors.push(...u)}catch(h){}}if(c){v.push(...c);try{p.warnings.push(...c)}catch(h){}}}f(o,v)})});let w=()=>{for(let p of T)setTimeout(()=>p(),0)};return z=!0,{ok:!0,requestPlugins:S,runOnEndCallbacks:V,scheduleOnDisposeCallbacks:w}});function _e(){let e=new Map,t=0;return{clear(){e.clear()},load(n){return e.get(n)},store(n){if(n===void 0)return-1;let i=t++;return e.set(i,n),i}}}function be(e,t,n){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(e.stack+"").split(`
|
|
`);l.splice(1,1);let g=Ve(t,l,n);if(g)return i={text:e.message,location:g},i}catch(l){}}}function oe(e,t,n,i,a){let l="Internal error",g=null;try{l=(e&&e.message||e)+""}catch(s){}try{g=Ve(t,(e.stack+"").split(`
|
|
`),"")}catch(s){}return{id:"",pluginName:a,text:l,location:g,notes:i?[i]:[],detail:n?n.store(e):-1}}function Ve(e,t,n){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let a=1;a<t.length;a++){let l=t[a];if(l.startsWith(i))for(l=l.slice(i.length);;){let 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(b){break}let d=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+g[2]-1]||"",P=+g[3]-1,A=d.slice(P,P+n.length)===n?n.length:0;return{file:g[1],namespace:"file",line:+g[2],column:Z(d.slice(0,P)).length,length:Z(d.slice(P,P+A)).length,lineText:d+`
|
|
`+t.slice(1).join(`
|
|
`),suggestion:""}}break}}return null}function me(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:d,column:P}=l.location,A=l.pluginName?`[plugin: ${l.pluginName}] `:"";return`
|
|
${s}:${d}:${P}: ERROR: ${A}${l.text}`}).join("");let a=new Error(e);for(let[l,g]of[["errors",t],["warnings",n]])Object.defineProperty(a,l,{configurable:!0,enumerable:!0,get:()=>g,set:s=>Object.defineProperty(a,l,{configurable:!0,enumerable:!0,value:s})});return a}function de(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Ue(e,t,n){if(e==null)return null;let i={},a=r(e,i,"file",m),l=r(e,i,"namespace",m),g=r(e,i,"line",fe),s=r(e,i,"column",fe),d=r(e,i,"length",fe),P=r(e,i,"lineText",m),A=r(e,i,"suggestion",m);if(K(e,i,t),P){let b=P.slice(0,(s&&s>0?s:0)+(d&&d>0?d:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(b)&&!/\n/.test(P)&&(P=b)}return{file:a||"",namespace:l||"",line:g||0,column:s||0,length:d||0,lineText:P||"",suggestion:A||""}}function le(e,t,n,i,a){let l=[],g=0;for(let s of e){let d={},P=r(s,d,"id",m),A=r(s,d,"pluginName",m),b=r(s,d,"text",m),j=r(s,d,"location",Be),T=r(s,d,"notes",ie),L=r(s,d,"detail",ve),N=`in element ${g} of "${t}"`;K(s,d,N);let S=[];if(T)for(let z of T){let V={},w=r(z,V,"text",m),p=r(z,V,"location",Be);K(z,V,N),S.push({text:w||"",location:Ue(p,N,a)})}l.push({id:P||"",pluginName:A||i,text:b||"",location:Ue(j,N,a),notes:S,detail:n?n.store(L):-1}),g++}return l}function we(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${_(t)} must be an array of strings`);n.push(i)}return n}function ft(e,t){let n=Object.create(null);for(let i in e){let a=e[i];if(typeof a!="string")throw new Error(`key ${_(i)} in object ${_(t)} must be a string`);n[i]=a}return n}function dt({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let a=this.contents;return(i===null||a!==t)&&(t=a,i=se(a)),i}}}function xe(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}var pt="0.25.4",mt=e=>ye().build(e),yt=e=>ye().context(e),ht=(e,t)=>ye().transform(e,t),bt=(e,t)=>ye().formatMessages(e,t),wt=(e,t)=>ye().analyzeMetafile(e,t),vt=()=>{throw new Error('The "buildSync" API only works in node')},Rt=()=>{throw new Error('The "transformSync" API only works in node')},xt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Ot=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Et=()=>(Ee&&Ee(),Promise.resolve()),ae,Ee,Se,ye=()=>{if(Se)return Se;throw ae?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},St=e=>{e=Ie(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(ae)throw new Error('Cannot call "initialize" more than once');return ae=kt(t||"",n,i),ae.catch(()=>{ae=void 0}),ae},kt=(e,t,n)=>te(null,null,function*(){let i,a,l=new Promise(b=>a=b);if(n){let b=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nvar w=(r,f,d)=>new Promise((u,i)=>{var s=c=>{try{o(d.next(c))}catch(h){i(h)}},n=c=>{try{o(d.throw(c))}catch(h){i(h)}},o=c=>c.done?u(c.value):Promise.resolve(c.value).then(s,n);o((d=d.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 u=new Error("not implemented");return u.code="ENOSYS",u};if(!globalThis.fs){let u="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(i,s){u+=d.decode(s);const n=u.lastIndexOf(`\n`);return n!=-1&&(console.log(u.substring(0,n)),u=u.substring(n+1)),s.length},write(i,s,n,o,c,h){if(n!==0||o!==s.length||c!==null){h(r());return}const m=this.writeSync(i,s);h(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,c,h){h(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(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"),d=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 u=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(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 y=0;switch(typeof e){case"object":e!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(t+4,2146959360|y,!0),this.mem.setUint32(t,a,!0)},c=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},h=t=>{const e=s(t+0),l=s(t+8),a=new Array(l);for(let y=0;y<l;y++)a[y]=n(e+y*8);return a},m=t=>{const e=s(t+0),l=s(t+8);return d.decode(new DataView(this._inst.exports.mem.buffer,e,l))},g=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e},gojs:{"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=s(t+8),l=s(t+16),a=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,u(t+8,(g+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();u(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()},s(t+8))),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(c(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),a=h(t+32),y=Reflect.apply(l,e,a);t=this._inst.exports.getsp()>>>0,o(t+56,y),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,u(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),u(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);c(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=c(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),u(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=c(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),u(t+40,a.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}run(u){return w(this,null,function*(){if(!(u instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=u,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 i=4096;const s=g=>{const t=i,e=f.encode(g+"\\0");return new Uint8Array(this.mem.buffer,i,e.length).set(e),i+=e.length,i%8!==0&&(i+=8-i%8),t},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const h=i;if(o.forEach(g=>{this.mem.setUint32(i,g,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,h),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(u){const i=this;return function(){const s={id:u,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,d=globalThis.fs,u="";d.writeSync=(c,h)=>{if(c===1)postMessage(h);else if(c===2){u+=f.decode(h);let m=u.split(`\n`);m.length>1&&console.log(m.slice(0,-1).join(`\n`)),u=m[m.length-1]}else throw new Error("Bad write");return h.length};let i=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(i.push(c),s&&s()),o),d.read=(c,h,m,g,t,e)=>{if(c!==0||m!==0||g!==h.length||t!==null)throw new Error("Bad read");if(i.length===0){s=()=>d.read(c,h,m,g,t,e);return}let l=i[0],a=Math.max(0,Math.min(g,l.length-n));h.set(l.subarray(n,n+a),m),n+=a,n===l.length&&(i.shift(),n=0),e(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.25.4"],tryToInstantiateModule(r,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};function tryToInstantiateModule(r,f){return w(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const d=yield fetch(r);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const u=yield d.arrayBuffer();return(yield WebAssembly.instantiate(u,f.importObject)).instance})}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(b))}else{let b=(postMessage=>{
|
|
// 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 w=(r,f,d)=>new Promise((u,i)=>{var s=c=>{try{o(d.next(c))}catch(h){i(h)}},n=c=>{try{o(d.throw(c))}catch(h){i(h)}},o=c=>c.done?u(c.value):Promise.resolve(c.value).then(s,n);o((d=d.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 u=new Error("not implemented");return u.code="ENOSYS",u};if(!globalThis.fs){let u="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(i,s){u+=d.decode(s);const n=u.lastIndexOf(`
|
|
`);return n!=-1&&(console.log(u.substring(0,n)),u=u.substring(n+1)),s.length},write(i,s,n,o,c,h){if(n!==0||o!==s.length||c!==null){h(r());return}const m=this.writeSync(i,s);h(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,c,h){h(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(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"),d=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 u=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(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 y=0;switch(typeof e){case"object":e!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(t+4,2146959360|y,!0),this.mem.setUint32(t,a,!0)},c=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},h=t=>{const e=s(t+0),l=s(t+8),a=new Array(l);for(let y=0;y<l;y++)a[y]=n(e+y*8);return a},m=t=>{const e=s(t+0),l=s(t+8);return d.decode(new DataView(this._inst.exports.mem.buffer,e,l))},g=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e},gojs:{"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=s(t+8),l=s(t+16),a=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,a))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,u(t+8,(g+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();u(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()},s(t+8))),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(c(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),a=h(t+32),y=Reflect.apply(l,e,a);t=this._inst.exports.getsp()>>>0,o(t+56,y),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=h(t+16),a=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,a),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,u(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),u(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);c(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=c(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),u(t+40,a.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=c(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const a=l.subarray(0,e.length);e.set(a),u(t+40,a.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}run(u){return w(this,null,function*(){if(!(u instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=u,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 i=4096;const s=g=>{const t=i,e=f.encode(g+"\0");return new Uint8Array(this.mem.buffer,i,e.length).set(e),i+=e.length,i%8!==0&&(i+=8-i%8),t},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const h=i;if(o.forEach(g=>{this.mem.setUint32(i,g,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,h),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(u){const i=this;return function(){const s={id:u,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,d=globalThis.fs,u="";d.writeSync=(c,h)=>{if(c===1)postMessage(h);else if(c===2){u+=f.decode(h);let m=u.split(`
|
|
`);m.length>1&&console.log(m.slice(0,-1).join(`
|
|
`)),u=m[m.length-1]}else throw new Error("Bad write");return h.length};let i=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(i.push(c),s&&s()),o),d.read=(c,h,m,g,t,e)=>{if(c!==0||m!==0||g!==h.length||t!==null)throw new Error("Bad read");if(i.length===0){s=()=>d.read(c,h,m,g,t,e);return}let l=i[0],a=Math.max(0,Math.min(g,l.length-n));h.set(l.subarray(n,n+a),m),n+=a,n===l.length&&(i.shift(),n=0),e(null,a)};let o=new globalThis.Go;return o.argv=["","--service=0.25.4"],tryToInstantiateModule(r,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};function tryToInstantiateModule(r,f){return w(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const d=yield fetch(r);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const u=yield d.arrayBuffer();return(yield WebAssembly.instantiate(u,f.importObject)).instance})}return r=>onmessage(r);})(T=>i.onmessage({data:T})),j;i={onmessage:null,postMessage:T=>setTimeout(()=>{try{j=b({data:T})}catch(L){a(L)}}),terminate(){if(j)for(let T of j._scheduledTimeouts.values())clearTimeout(T)}}}let g,s,d=new Promise((b,j)=>{g=b,s=j});i.onmessage=({data:b})=>{i.onmessage=({data:j})=>P(j),b?s(b):g()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:P,service:A}=Ke({writeToStdin(b){i.postMessage(b)},isSync:!1,hasFS:!1,esbuild:ke});yield d,Ee=()=>{i.terminate(),ae=void 0,Ee=void 0,Se=void 0},Se={build:b=>new Promise((j,T)=>{l.then(T),A.buildOrContext({callName:"build",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,N)=>L?T(L):j(N)})}),context:b=>new Promise((j,T)=>{l.then(T),A.buildOrContext({callName:"context",refs:null,options:b,isTTY:!1,defaultWD:"/",callback:(L,N)=>L?T(L):j(N)})}),transform:(b,j)=>new Promise((T,L)=>{l.then(L),A.transform({callName:"transform",refs:null,input:b,options:j||{},isTTY:!1,fs:{readFile(N,S){S(new Error("Internal error"),null)},writeFile(N,S){S(null)}},callback:(N,S)=>N?L(N):T(S)})}),formatMessages:(b,j)=>new Promise((T,L)=>{l.then(L),A.formatMessages({callName:"formatMessages",refs:null,messages:b,options:j,callback:(N,S)=>N?L(N):T(S)})}),analyzeMetafile:(b,j)=>new Promise((T,L)=>{l.then(L),A.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof b=="string"?b:JSON.stringify(b),options:j,callback:(N,S)=>N?L(N):T(S)})})}}),$t=ke;
|
|
})(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
|