-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaisei-dev.js
228 lines (223 loc) · 98 KB
/
taisei-dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
var createTaisei = (() => {
var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
return (
function(moduleArg = {}) {
var moduleRtn;
var h=moduleArg,aa,ba,ca=new Promise((a,b)=>{aa=a;ba=b});h.totalDependencies=0;h.monitorRunDependencies=function(a){h.totalDependencies=Math.max(h.totalDependencies,a);h.setStatus(a?"Preparing\u2026 ("+(h.totalDependencies-a)+"/"+h.totalDependencies+")":"All downloads complete.")};h.initFilesystem=function(){k.$i("/persistent");k.Ui(l,{},"/persistent")};var da=h.preinitializedWebGLContext;da.getSupportedExtensions().forEach(function(a){da.getExtension(a)});
function ea(a,b){k.Mj(a,function(c){h.ccall("vfs_sync_callback",null,["boolean","string","number"],[a,c,b],{async:!0})})}"undefined"===typeof fa&&(fa=h.dynCall=function(a,b,c){return ha.get(b).apply(this,c)});var ia=Object.assign({},h),ja=[],ka="./this.program",la="",ma;"undefined"!=typeof document&&document.currentScript&&(la=document.currentScript.src);_scriptName&&(la=_scriptName);la.startsWith("blob:")?la="":la=la.substr(0,la.replace(/[?#].*/,"").lastIndexOf("/")+1);
ma=a=>fetch(a,{credentials:"same-origin"}).then(b=>b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url)));var pa=h.print||console.log.bind(console),qa=h.printErr||console.error.bind(console);Object.assign(h,ia);ia=null;h.arguments&&(ja=h.arguments);h.thisProgram&&(ka=h.thisProgram);var ra=h.wasmBinary,ua,va=!1,wa,m,u,xa,ya,za,Aa,w,x,z;
function Ba(){var a=ua.buffer;h.HEAP_DATA_VIEW=z=new DataView(a);h.HEAP8=m=new Int8Array(a);h.HEAP16=xa=new Int16Array(a);h.HEAPU8=u=new Uint8Array(a);h.HEAPU16=ya=new Uint16Array(a);h.HEAP32=za=new Int32Array(a);h.HEAPU32=Aa=new Uint32Array(a);h.HEAPF32=w=new Float32Array(a);h.HEAPF64=new Float64Array(a);h.HEAP64=x=new BigInt64Array(a);h.HEAPU64=new BigUint64Array(a)}var Ca=[],Da=[],Ea=[],Ga=[];function Ha(){var a=h.preRun.shift();Ca.unshift(a)}var Ia=0,Ja=null,Ka=null;
function La(){Ia++;h.monitorRunDependencies?.(Ia)}function Ma(){Ia--;h.monitorRunDependencies?.(Ia);if(0==Ia&&(null!==Ja&&(clearInterval(Ja),Ja=null),Ka)){var a=Ka;Ka=null;a()}}function Na(a){h.onAbort?.(a);a="Aborted("+a+")";qa(a);va=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ba(a);throw a;}var Oa=a=>a.startsWith("data:application/octet-stream;base64,"),Pa;
function Qa(a){if(a==Pa&&ra)return new Uint8Array(ra);throw"both async and sync fetching of the wasm failed";}function Ra(a){return ra?Promise.resolve().then(()=>Qa(a)):ma(a).then(b=>new Uint8Array(b),()=>Qa(a))}function Sa(a,b,c){return Ra(a).then(d=>WebAssembly.instantiate(d,b)).then(c,d=>{qa(`failed to asynchronously prepare wasm: ${d}`);Na(d)})}
function Ta(a,b){var c=Pa;return ra||"function"!=typeof WebAssembly.instantiateStreaming||Oa(c)||"function"!=typeof fetch?Sa(c,a,b):fetch(c,{credentials:"same-origin"}).then(d=>WebAssembly.instantiateStreaming(d,a).then(b,function(e){qa(`wasm streaming compile failed: ${e}`);qa("falling back to ArrayBuffer instantiation");return Sa(c,a,b)}))}
var Wa={1151176:(a,b)=>{ea(a,b)},1151196:()=>"undefined"!==typeof AudioContext||"undefined"!==typeof webkitAudioContext?!0:!1,1151343:()=>"undefined"!==typeof navigator.mediaDevices&&"undefined"!==typeof navigator.mediaDevices.getUserMedia||"undefined"!==typeof navigator.webkitGetUserMedia?!0:!1,1151577:a=>{"undefined"===typeof h.SDL2&&(h.SDL2={});var b=h.SDL2;a?b.capture={}:b.audio={};b.Yi||("undefined"!==typeof AudioContext?b.Yi=new AudioContext:"undefined"!==typeof webkitAudioContext&&(b.Yi=new webkitAudioContext),
b.Yi&&Ua(b.Yi));return void 0===b.Yi?-1:0},1152070:()=>h.SDL2.Yi.sampleRate,1152138:(a,b,c,d)=>{function e(){}function f(n){void 0!==g.capture.Tj&&(clearTimeout(g.capture.Tj),g.capture.Tj=void 0);g.capture.ck=g.Yi.createMediaStreamSource(n);g.capture.dj=g.Yi.createScriptProcessor(b,a,1);g.capture.dj.onaudioprocess=function(p){void 0!==g&&void 0!==g.capture&&(p.outputBuffer.getChannelData(0).fill(0),g.capture.jk=p.inputBuffer,fa("vi",c,[d]))};g.capture.ck.connect(g.capture.dj);g.capture.dj.connect(g.Yi.destination);
g.capture.stream=n}var g=h.SDL2;g.capture.fk=g.Yi.createBuffer(a,b,g.Yi.sampleRate);g.capture.fk.getChannelData(0).fill(0);g.capture.Tj=setTimeout(function(){g.capture.jk=g.capture.fk;fa("vi",c,[d])},b/g.Yi.sampleRate*1E3);void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(f).catch(e):void 0!==navigator.webkitGetUserMedia&&navigator.webkitGetUserMedia({audio:!0,video:!1},f,e)},1153790:(a,b,c,d)=>{var e=h.SDL2;
e.audio.dj=e.Yi.createScriptProcessor(b,0,a);e.audio.dj.onaudioprocess=function(f){void 0!==e&&void 0!==e.audio&&(e.audio.Pk=f.outputBuffer,fa("vi",c,[d]))};e.audio.dj.connect(e.Yi.destination)},1154200:(a,b)=>{for(var c=h.SDL2,d=c.capture.jk.numberOfChannels,e=0;e<d;++e){var f=c.capture.jk.getChannelData(e);if(f.length!=b)throw"Web Audio capture buffer length mismatch! Destination size: "+f.length+" samples vs expected "+b+" samples!";if(1==d)for(var g=0;g<b;++g)Va(a+4*g,f[g]);else for(g=0;g<b;++g)Va(a+
4*(g*d+e),f[g])}},1154805:(a,b)=>{for(var c=h.SDL2,d=c.audio.Pk.numberOfChannels,e=0;e<d;++e){var f=c.audio.Pk.getChannelData(e);if(f.length!=b)throw"Web Audio output buffer length mismatch! Destination size: "+f.length+" samples vs expected "+b+" samples!";for(var g=0;g<b;++g)f[g]=z.getFloat32(4*(a+(g*d+e<<2)>>2),!0)}},1155285:a=>{var b=h.SDL2;if(a){void 0!==b.capture.Tj&&clearTimeout(b.capture.Tj);if(void 0!==b.capture.stream){a=b.capture.stream.getAudioTracks();for(var c=0;c<a.length;c++)b.capture.stream.removeTrack(a[c]);
b.capture.stream=void 0}void 0!==b.capture.dj&&(b.capture.dj.onaudioprocess=function(){},b.capture.dj.disconnect(),b.capture.dj=void 0);void 0!==b.capture.ck&&(b.capture.ck.disconnect(),b.capture.ck=void 0);void 0!==b.capture.fk&&(b.capture.fk=void 0);b.capture=void 0}else void 0!=b.audio.dj&&(b.audio.dj.disconnect(),b.audio.dj=void 0),b.audio=void 0;void 0!==b.Yi&&void 0===b.audio&&void 0===b.capture&&(b.Yi.close(),b.Yi=void 0)},1156457:()=>window.innerWidth,1156487:()=>window.innerHeight,1156518:(a,
b,c)=>{h.SDL2||(h.SDL2={});var d=h.SDL2;d.rl!==h.canvas&&(d.mj=h.createContext(h.canvas,!1,!0),d.rl=h.canvas);if(d.w!==a||d.h!==b||d.Kl!==d.mj)d.image=d.mj.createImageData(a,b),d.w=a,d.h=b,d.Kl=d.mj;a=d.image.data;b=c>>2;var e=0;if("undefined"!==typeof CanvasPixelArray&&a instanceof CanvasPixelArray)for(c=a.length;e<c;){var f=z.getInt32(4*b,!0);a[e]=f&255;a[e+1]=f>>8&255;a[e+2]=f>>16&255;a[e+3]=255;b++;e+=4}else if(d.vl!==a&&(d.ul=new Int32Array(a.buffer),d.wl=new Uint8Array(a.buffer),d.vl=a),a=d.ul,
c=a.length,a.set(za.subarray(b,b+c)),a=d.wl,b=3,e=b+4*c,0==c%8)for(;b<e;)a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0;else for(;b<e;)a[b]=255,b=b+4|0;d.mj.putImageData(d.image,0,0)},1157987:(a,b,c,d,e)=>{var f=document.createElement("canvas");f.width=a;f.height=b;var g=f.getContext("2d");a=g.createImageData(a,b);b=a.data;e>>=2;var n=0,p;if("undefined"!==typeof CanvasPixelArray&&b instanceof CanvasPixelArray)for(p=
b.length;n<p;){var q=z.getInt32(4*e,!0);b[n]=q&255;b[n+1]=q>>8&255;b[n+2]=q>>16&255;b[n+3]=q>>24&255;e++;n+=4}else b=new Int32Array(b.buffer),p=b.length,b.set(za.subarray(e,e+p));g.putImageData(a,0,0);c=0===c&&0===d?"url("+f.toDataURL()+"), auto":"url("+f.toDataURL()+") "+c+" "+d+", auto";d=A(c.length+1);B(c,u,d,c.length+1);return d},1158976:a=>{h.canvas&&(h.canvas.style.cursor=a?C(u,a):"")},1159059:()=>{h.canvas&&(h.canvas.style.cursor="none")},1159128:()=>{h.onFirstFrame()}};
function Xa(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}var Ya=(a,b,c)=>{a.addEventListener(b,c,{once:!0})},Ua=a=>{var b;b||=[document,document.getElementById("canvas")];["keydown","mousedown","touchstart"].forEach(c=>{b.forEach(d=>{d&&Ya(d,c,()=>{"suspended"===a.state&&a.resume()})})})},Za=a=>{for(;0<a.length;)a.shift()(h)},$a=h.noExitRuntime||!0;
function Va(a,b){var c="float";c.endsWith("*")&&(c="*");switch(c){case "i1":m[a]=b;break;case "i8":m[a]=b;break;case "i16":z.setInt16(2*(a>>1),b,!0);break;case "i32":z.setInt32(4*(a>>2),b,!0);break;case "i64":x[a>>3]=BigInt(b);break;case "float":z.setFloat32(4*(a>>2),b,!0);break;case "double":z.setFloat64(8*(a>>3),b,!0);break;case "*":z.setUint32(4*(a>>2),b,!0);break;default:Na(`invalid type for setValue: ${c}`)}}function ab(){var a=z.getInt32(4*(+bb>>2),!0);bb+=4;return a}
var cb=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},D=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=cb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},eb=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.substr(0,b.length-1);return a+b},fb=a=>{if("/"===
a)return"/";a=D(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)},hb=(a,b)=>D(a+"/"+b),ib=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return a=>crypto.getRandomValues(a);Na("initRandomDevice")},jb=a=>(jb=ib())(a),kb=(...a)=>{for(var b="",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:k.lk();if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");if(!c)return"";b=c+"/"+b;c="/"===c.charAt(0)}b=cb(b.split("/").filter(e=>
!!e),!c).join("/");return(c?"/":"")+b||"."},lb=(a,b)=>{function c(g){for(var n=0;n<g.length&&""===g[n];n++);for(var p=g.length-1;0<=p&&""===g[p];p--);return n>p?[]:g.slice(n,p-n+1)}a=kb(a).substr(1);b=kb(b).substr(1);a=c(a.split("/"));b=c(b.split("/"));for(var d=Math.min(a.length,b.length),e=d,f=0;f<d;f++)if(a[f]!==b[f]){e=f;break}d=[];for(f=e;f<a.length;f++)d.push("..");d=d.concat(b.slice(e));return d.join("/")},mb="undefined"!=typeof TextDecoder?new TextDecoder:void 0,C=(a,b,c)=>{var d=b+c;for(c=
b;a[c]&&!(c>=d);)++c;if(16<c-b&&a.buffer&&mb)return mb.decode(a.subarray(b,c));for(d="";b<c;){var e=a[b++];if(e&128){var f=a[b++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|f);else{var g=a[b++]&63;e=224==(e&240)?(e&15)<<12|f<<6|g:(e&7)<<18|f<<12|g<<6|a[b++]&63;65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},nb=[],ob=a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=
d&&57343>=d?(b+=4,++c):b+=3}return b},B=(a,b,c,d)=>{if(!(0<d))return 0;var e=c;d=c+d-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var n=a.charCodeAt(++f);g=65536+((g&1023)<<10)|n&1023}if(127>=g){if(c>=d)break;b[c++]=g}else{if(2047>=g){if(c+1>=d)break;b[c++]=192|g>>6}else{if(65535>=g){if(c+2>=d)break;b[c++]=224|g>>12}else{if(c+3>=d)break;b[c++]=240|g>>18;b[c++]=128|g>>12&63}b[c++]=128|g>>6&63}b[c++]=128|g&63}}b[c]=0;return c-e},pb=[];
function qb(a,b){pb[a]={input:[],bj:[],uj:b};rb(a,sb)}
var sb={open(a){var b=pb[a.node.Sj];if(!b)throw new k.Qi(43);a.Vi=b;a.seekable=!1},close(a){a.Vi.uj.Yj(a.Vi)},Yj(a){a.Vi.uj.Yj(a.Vi)},read(a,b,c,d){if(!a.Vi||!a.Vi.uj.Tk)throw new k.Qi(60);for(var e=0,f=0;f<d;f++){try{var g=a.Vi.uj.Tk(a.Vi)}catch(n){throw new k.Qi(29);}if(void 0===g&&0===e)throw new k.Qi(6);if(null===g||void 0===g)break;e++;b[c+f]=g}e&&(a.node.timestamp=Date.now());return e},write(a,b,c,d){if(!a.Vi||!a.Vi.uj.Ak)throw new k.Qi(60);try{for(var e=0;e<d;e++)a.Vi.uj.Ak(a.Vi,b[c+e])}catch(f){throw new k.Qi(29);
}d&&(a.node.timestamp=Date.now());return e}},tb={Tk(){a:{if(!nb.length){var a=null;"undefined"!=typeof window&&"function"==typeof window.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){var b=null;break a}b=Array(ob(a)+1);a=B(a,b,0,b.length);b.length=a;nb=b}b=nb.shift()}return b},Ak(a,b){null===b||10===b?(pa(C(a.bj,0)),a.bj=[]):0!=b&&a.bj.push(b)},Yj(a){a.bj&&0<a.bj.length&&(pa(C(a.bj,0)),a.bj=[])},Ml(){return{km:25856,mm:5,jm:191,lm:35387,im:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,
22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Nl(){return 0},Ol(){return[24,80]}},ub={Ak(a,b){null===b||10===b?(qa(C(a.bj,0)),a.bj=[]):0!=b&&a.bj.push(b)},Yj(a){a.bj&&0<a.bj.length&&(qa(C(a.bj,0)),a.bj=[])}},wb=a=>{a=65536*Math.ceil(a/65536);var b=vb(65536,a);b?(u.fill(0,b,b+a),a=b):a=0;return a};function xb(a,b){var c=a.Ti?a.Ti.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.Ti,a.Ti=new Uint8Array(b),0<a.Wi&&a.Ti.set(c.subarray(0,a.Wi),0))}
var E={rj:null,Ui(){return E.createNode(null,"/",16895,0)},createNode(a,b,c,d){var e;(e=24576===(c&61440))||(e=4096===(c&61440));if(e)throw new k.Qi(63);E.rj||(E.rj={dir:{node:{pj:E.Ri.pj,aj:E.Ri.aj,Gj:E.Ri.Gj,jj:E.Ri.jj,Lj:E.Ri.Lj,lj:E.Ri.lj,vj:E.Ri.vj,Aj:E.Ri.Aj,sj:E.Ri.sj},stream:{ej:E.Si.ej}},file:{node:{pj:E.Ri.pj,aj:E.Ri.aj},stream:{ej:E.Si.ej,read:E.Si.read,write:E.Si.write,Dj:E.Si.Dj,Ij:E.Si.Ij,Nj:E.Si.Nj}},link:{node:{pj:E.Ri.pj,aj:E.Ri.aj,Kj:E.Ri.Kj},stream:{}},Mk:{node:{pj:E.Ri.pj,aj:E.Ri.aj},
stream:k.ol}});c=k.createNode(a,b,c,d);F(c.mode)?(c.Ri=E.rj.dir.node,c.Si=E.rj.dir.stream,c.Ti={}):k.isFile(c.mode)?(c.Ri=E.rj.file.node,c.Si=E.rj.file.stream,c.Wi=0,c.Ti=null):40960===(c.mode&61440)?(c.Ri=E.rj.link.node,c.Si=E.rj.link.stream):8192===(c.mode&61440)&&(c.Ri=E.rj.Mk.node,c.Si=E.rj.Mk.stream);c.timestamp=Date.now();a&&(a.Ti[b]=c,a.timestamp=c.timestamp);return c},Ri:{pj(a){var b={};b.yl=8192===(a.mode&61440)?a.id:1;b.Ll=a.id;b.mode=a.mode;b.Tl=1;b.uid=0;b.Hl=0;b.Sj=a.Sj;F(a.mode)?b.size=
4096:k.isFile(a.mode)?b.size=a.Wi:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.ll=new Date(a.timestamp);b.ek=new Date(a.timestamp);b.ql=new Date(a.timestamp);b.ml=4096;b.nl=Math.ceil(b.size/b.ml);return b},aj(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);if(void 0!==b.size&&(b=b.size,a.Wi!=b))if(0==b)a.Ti=null,a.Wi=0;else{var c=a.Ti;a.Ti=new Uint8Array(b);c&&a.Ti.set(c.subarray(0,Math.min(b,a.Wi)));a.Wi=b}},Gj(){throw k.rk[44];},jj(a,b,c,d){return E.createNode(a,
b,c,d)},Lj(a,b,c){if(F(a.mode)){try{var d=yb(b,c)}catch(f){}if(d)for(var e in d.Ti)throw new k.Qi(55);}delete a.parent.Ti[a.name];a.parent.timestamp=Date.now();a.name=c;b.Ti[c]=a;b.timestamp=a.parent.timestamp},lj(a,b){delete a.Ti[b];a.timestamp=Date.now()},vj(a,b){var c=yb(a,b),d;for(d in c.Ti)throw new k.Qi(55);delete a.Ti[b];a.timestamp=Date.now()},Aj(a){var b=[".",".."],c;for(c of Object.keys(a.Ti))b.push(c);return b},sj(a,b,c){a=E.createNode(a,b,41471,0);a.link=c;return a},Kj(a){if(40960!==(a.mode&
61440))throw new k.Qi(28);return a.link}},Si:{read(a,b,c,d,e){var f=a.node.Ti;if(e>=a.node.Wi)return 0;a=Math.min(a.node.Wi-e,d);if(8<a&&f.subarray)b.set(f.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=f[e+d];return a},write(a,b,c,d,e,f){b.buffer===m.buffer&&(f=!1);if(!d)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.Ti||a.Ti.subarray)){if(f)return a.Ti=b.subarray(c,c+d),a.Wi=d;if(0===a.Wi&&0===e)return a.Ti=b.slice(c,c+d),a.Wi=d;if(e+d<=a.Wi)return a.Ti.set(b.subarray(c,c+d),e),d}xb(a,
e+d);if(a.Ti.subarray&&b.subarray)a.Ti.set(b.subarray(c,c+d),e);else for(f=0;f<d;f++)a.Ti[e+f]=b[c+f];a.Wi=Math.max(a.Wi,e+d);return d},ej(a,b,c){1===c?b+=a.position:2===c&&k.isFile(a.node.mode)&&(b+=a.node.Wi);if(0>b)throw new k.Qi(28);return b},Dj(a,b,c){xb(a.node,b+c);a.node.Wi=Math.max(a.node.Wi,b+c)},Ij(a,b,c,d,e){if(!k.isFile(a.node.mode))throw new k.Qi(43);a=a.node.Ti;if(e&2||!a||a.buffer!==m.buffer){d=!0;e=wb(b);if(!e)throw new k.Qi(48);if(a){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,
c+b):a=Array.prototype.slice.call(a,c,c+b);m.set(a,e)}}else d=!1,e=a.byteOffset;return{bl:e,wj:d}},Nj(a,b,c,d){E.Si.write(a,b,0,d,c,!1);return 0}}},zb=(a,b,c)=>{var d=`al ${a}`;ma(a).then(e=>{b(new Uint8Array(e));d&&Ma(d)},()=>{if(c)c();else throw`Loading data file "${a}" failed.`;});d&&La(d)},Ab=h.preloadPlugins||[],Db=(a,b,c,d)=>{"undefined"!=typeof Bb&&Cb();var e=!1;Ab.forEach(f=>{!e&&f.canHandle(b)&&(f.handle(a,b,c,d),e=!0)});return e},Eb=(a,b,c,d,e,f,g,n,p,q)=>{function r(J){function oa(Fa){q?.();
n||k.ik(a,b,Fa,d,e,p);f?.();Ma(v)}Db(J,t,oa,()=>{g?.();Ma(v)})||oa(J)}var t=b?kb(D(a+"/"+b)):a,v=`cp ${t}`;La(v);"string"==typeof c?zb(c,r,g):r(c)},Fb=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},l={Xj:{},indexedDB:()=>{if("undefined"!=typeof indexedDB)return indexedDB;var a=null;"object"==typeof window&&(a=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB);return a},fl:21,Bj:"FILE_DATA",Oj:a=>{function b(){"again"===a.Fj?c():a.Fj=0}function c(){a.Fj="idb";l.Mj(a,
!1,b)}a.Fj?"idb"===a.Fj&&(a.Fj="again"):a.Fj=setTimeout(c,0)},Ui:a=>{var b=E.Ui(a);if(a?.Ul?.gm){b.Fj=0;var c=b.Ri;b.Ri=Object.assign({},b.Ri);b.Ri.jj=(d,e,f,g)=>{var n=c.jj(d,e,f,g);n.Ri=b.Ri;n.Jl=b.Ui;n.yk=n.Si;n.Si=Object.assign({},n.Si);n.Si.write=(p,q,r,t,v,J)=>{p.node.Xk=!0;return n.yk.write(p,q,r,t,v,J)};n.Si.close=p=>{var q=p.node;q.Xk&&(l.Oj(q.Jl),q.Xk=!1);if(q.yk.close)return q.yk.close(p)};return n};b.Ri.$i=(...d)=>(l.Oj(b.Ui),c.$i(...d));b.Ri.vj=(...d)=>(l.Oj(b.Ui),c.vj(...d));b.Ri.sj=
(...d)=>(l.Oj(b.Ui),c.sj(...d));b.Ri.lj=(...d)=>(l.Oj(b.Ui),c.lj(...d));b.Ri.Lj=(...d)=>(l.Oj(b.Ui),c.Lj(...d))}return b},Mj:(a,b,c)=>{l.El(a,(d,e)=>{if(d)return c(d);l.Fl(a,(f,g)=>{if(f)return c(f);l.Xl(b?g:e,b?e:g,c)})})},Wl:()=>{Object.values(l.Xj).forEach(a=>a.close());l.Xj={}},Cl:(a,b)=>{var c=l.Xj[a];if(c)return b(null,c);try{var d=l.indexedDB().open(a,l.fl)}catch(e){return b(e)}if(!d)return b("Unable to connect to IndexedDB");d.onupgradeneeded=e=>{var f=e.target.result;e=e.target.transaction;
var g;f.objectStoreNames.contains(l.Bj)?g=e.objectStore(l.Bj):g=f.createObjectStore(l.Bj);g.indexNames.contains("timestamp")||g.createIndex("timestamp","timestamp",{unique:!1})};d.onsuccess=()=>{c=d.result;l.Xj[a]=c;b(null,c)};d.onerror=e=>{b(e.target.error);e.preventDefault()}},El:(a,b)=>{function c(n){return"."!==n&&".."!==n}function d(n){return p=>D(n+"/"+p)}var e={};for(a=k.Aj(a.Qj).filter(c).map(d(a.Qj));a.length;){var f=a.pop();try{var g=k.stat(f)}catch(n){return b(n)}F(g.mode)&&a.push(...k.Aj(f).filter(c).map(d(f)));
e[f]={timestamp:g.ek}}return b(null,{type:"local",entries:e})},Fl:(a,b)=>{var c={};l.Cl(a.Qj,(d,e)=>{if(d)return b(d);try{var f=e.transaction([l.Bj],"readonly");f.onerror=g=>{b(g.target.error);g.preventDefault()};f.objectStore(l.Bj).index("timestamp").openKeyCursor().onsuccess=g=>{g=g.target.result;if(!g)return b(null,{type:"remote",db:e,entries:c});c[g.primaryKey]={timestamp:g.key};g.continue()}}catch(g){return b(g)}})},Ql:(a,b)=>{try{var c=G(a).node;var d=k.stat(a)}catch(f){return b(f)}if(F(d.mode))return b(null,
{timestamp:d.ek,mode:d.mode});if(k.isFile(d.mode)){a=c;var e=c.Ti?c.Ti.subarray?c.Ti.subarray(0,c.Wi):new Uint8Array(c.Ti):new Uint8Array(0);a.Ti=e;return b(null,{timestamp:d.ek,mode:d.mode,contents:c.Ti})}return b(Error("node type not supported"))},bm:(a,b,c)=>{try{if(F(b.mode))for(var d=b.mode,e=a.split("/"),f="",g=0;g<e.length;++g){if(e[g]){f+="/"+e[g];try{k.$i(f,d)}catch(v){if(20!=v.Xi)throw v;}}}else if(k.isFile(b.mode)){f=b.contents;d={Kk:!0};d.flags=d.flags||577;g=k.open(a,d.flags,d.mode);
if("string"==typeof f){var n=new Uint8Array(ob(f)+1),p=B(f,n,0,n.length);k.write(g,n,0,p,void 0,d.Kk)}else if(ArrayBuffer.isView(f))k.write(g,f,0,f.byteLength,void 0,d.Kk);else throw Error("Unsupported data type");k.close(g)}else return c(Error("node type not supported"));Gb(a,b.mode);var q=b.timestamp,r=b.timestamp,t=G(a,{oj:!0}).node;t.Ri.aj(t,{timestamp:Math.max(q,r)})}catch(v){return c(v)}c(null)},Zl:(a,b)=>{try{var c=k.stat(a);F(c.mode)?k.vj(a):k.isFile(c.mode)&&k.lj(a)}catch(d){return b(d)}b(null)},
Rl:(a,b,c)=>{a=a.get(b);a.onsuccess=d=>c(null,d.target.result);a.onerror=d=>{c(d.target.error);d.preventDefault()}},cm:(a,b,c,d)=>{try{var e=a.put(c,b)}catch(f){d(f);return}e.onsuccess=()=>d();e.onerror=f=>{d(f.target.error);f.preventDefault()}},$l:(a,b,c)=>{a=a.delete(b);a.onsuccess=()=>c();a.onerror=d=>{c(d.target.error);d.preventDefault()}},Xl:(a,b,c)=>{function d(r){if(r&&!n)return n=!0,c(r)}var e=0,f=[];Object.keys(a.entries).forEach(r=>{var t=a.entries[r],v=b.entries[r];v&&t.timestamp.getTime()==
v.timestamp.getTime()||(f.push(r),e++)});var g=[];Object.keys(b.entries).forEach(r=>{a.entries[r]||(g.push(r),e++)});if(!e)return c(null);var n=!1,p=("remote"===a.type?a.db:b.db).transaction([l.Bj],"readwrite"),q=p.objectStore(l.Bj);p.onerror=p.onabort=r=>{d(r.target.error);r.preventDefault()};p.oncomplete=()=>{n||c(null)};f.sort().forEach(r=>{"local"===b.type?l.Rl(q,r,(t,v)=>{if(t)return d(t);l.bm(r,v,d)}):l.Ql(r,(t,v)=>{if(t)return d(t);l.cm(q,r,v,d)})});g.sort().reverse().forEach(r=>{"local"===
b.type?l.Zl(r,d):l.$l(q,r,d)})}};function rb(a,b){k.Rk[a]={Si:b}}function F(a){return 16384===(a&61440)}function yb(a,b){var c=F(a.mode)?(c=Hb(a,"x"))?c:a.Ri.Gj?0:2:54;if(c)throw new k.Qi(c);for(c=k.qj[Jb(a.id,b)];c;c=c.Jj){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return k.Gj(a,b)}
function G(a,b={}){a=kb(a);if(!a)return{path:"",node:null};b=Object.assign({nk:!0,Bk:0},b);if(8<b.Bk)throw new k.Qi(32);a=a.split("/").filter(g=>!!g);for(var c=k.root,d="/",e=0;e<a.length;e++){var f=e===a.length-1;if(f&&b.parent)break;c=yb(c,a[e]);d=D(d+"/"+a[e]);c.kj&&(!f||f&&b.nk)&&(c=c.kj.root);if(!f||b.oj)for(f=0;40960===(c.mode&61440);)if(c=k.Kj(d),d=kb(eb(d),c),c=G(d,{Bk:b.Bk+1}).node,40<f++)throw new k.Qi(32);}return{path:d,node:c}}
function Gb(a,b,c){a="string"==typeof a?G(a,{oj:!c}).node:a;if(!a.Ri.aj)throw new k.Qi(63);a.Ri.aj(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})}function Kb(a){for(var b;;){if(k.Yk(a))return a=a.Ui.Qj,b?"/"!==a[a.length-1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}}function Jb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%k.qj.length}function Lb(a){var b=Jb(a.parent.id,a.name);a.Jj=k.qj[b];k.qj[b]=a}
function Mb(a){var b=Jb(a.parent.id,a.name);if(k.qj[b]===a)k.qj[b]=a.Jj;else for(b=k.qj[b];b;){if(b.Jj===a){b.Jj=a.Jj;break}b=b.Jj}}function Nb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}function Hb(a,b){if(k.Uk)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function Ob(a,b){try{return yb(a,b),20}catch(c){}return Hb(a,"wx")}
function Pb(a,b,c){try{var d=yb(a,b)}catch(e){return e.Xi}if(a=Hb(a,"wx"))return a;if(c){if(!F(d.mode))return 54;if(k.Yk(d)||Kb(d)===k.lk())return 10}else if(F(d.mode))return 31;return 0}function H(a){a=k.Gl(a);if(!a)throw new k.Qi(8);return a}function Qb(a,b=-1){a=Object.assign(new k.hl,a);if(-1==b)a:{for(b=0;b<=k.il;b++)if(!k.streams[b])break a;throw new k.Qi(33);}a.fd=b;return k.streams[b]=a}function Rb(a,b=-1){a=Qb(a,b);a.Si?.sm?.(a);return a}
function Sb(a){var b=[];for(a=[a];a.length;){var c=a.pop();b.push(c);a.push(...c.Rj)}return b}function Tb(a,b,c){"undefined"==typeof c&&(c=b,b=438);return k.jj(a,b|8192,c)}function Ub(a,b){a="string"==typeof a?G(a,{oj:!b}).node:a;if(!a.Ri.aj)throw new k.Qi(63);a.Ri.aj(a,{timestamp:Date.now()})}function Vb(a,b,c,d){a="string"==typeof a?a:Kb(a);b=D(a+"/"+b);return k.create(b,Fb(c,d))}
function Wb(a){if(!(a.Wk||a.Pl||a.link||a.Ti)){if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{a.Ti=(void 0)(a.url),a.Wi=a.Ti.length}catch(b){throw new k.Qi(29);}}}
var k={root:null,Rj:[],Rk:{},streams:[],Sl:1,qj:null,Qk:"/",tk:!1,Uk:!0,Qi:class{constructor(a){this.name="ErrnoError";this.Xi=a}},rk:{},Al:null,gk:0,cl:{},hl:class{constructor(){this.cj={};this.node=null}get object(){return this.node}set object(a){this.node=a}get flags(){return this.cj.flags}set flags(a){this.cj.flags=a}get position(){return this.cj.position}set position(a){this.cj.position=a}},gl:class{constructor(a,b,c,d){a||=this;this.parent=a;this.Ui=a.Ui;this.kj=null;this.id=k.Sl++;this.name=
b;this.mode=c;this.Ri={};this.Si={};this.Sj=d}get read(){return 365===(this.mode&365)}set read(a){a?this.mode|=365:this.mode&=-366}get write(){return 146===(this.mode&146)}set write(a){a?this.mode|=146:this.mode&=-147}get Pl(){return F(this.mode)}get Wk(){return 8192===(this.mode&61440)}},createNode(a,b,c,d){a=new k.gl(a,b,c,d);Lb(a);return a},Yk(a){return a===a.parent},isFile(a){return 32768===(a&61440)},Bm(a){return 49152===(a&49152)},il:4096,Gl:a=>k.streams[a],ol:{open(a){a.Si=k.Dl(a.node.Sj).Si;
a.Si.open?.(a)},ej(){throw new k.Qi(70);}},wk:a=>a>>8,Fm:a=>a&255,Hj:(a,b)=>a<<8|b,Dl:a=>k.Rk[a],Mj(a,b){function c(g){k.gk--;return b(g)}function d(g){if(g){if(!d.zl)return d.zl=!0,c(g)}else++f>=e.length&&c(null)}"function"==typeof a&&(b=a,a=!1);k.gk++;1<k.gk&&qa(`warning: ${k.gk} FS.syncfs operations in flight at once, probably just doing extra work`);var e=Sb(k.root.Ui),f=0;e.forEach(g=>{if(!g.type.Mj)return d(null);g.type.Mj(g,a,d)})},Ui(a,b,c){var d="/"===c;if(d&&k.root)throw new k.Qi(10);if(!d&&
c){var e=G(c,{nk:!1});c=e.path;e=e.node;if(e.kj)throw new k.Qi(10);if(!F(e.mode))throw new k.Qi(54);}b={type:a,Ul:b,Qj:c,Rj:[]};a=a.Ui(b);a.Ui=b;b.root=a;d?k.root=a:e&&(e.kj=b,e.Ui&&e.Ui.Rj.push(b));return a},Km(a){a=G(a,{nk:!1});if(!a.node.kj)throw new k.Qi(28);a=a.node;var b=a.kj,c=Sb(b);Object.keys(k.qj).forEach(d=>{for(d=k.qj[d];d;){var e=d.Jj;c.includes(d.Ui)&&Mb(d);d=e}});a.kj=null;a.Ui.Rj.splice(a.Ui.Rj.indexOf(b),1)},Gj(a,b){return a.Ri.Gj(a,b)},jj(a,b,c){var d=G(a,{parent:!0}).node;a=fb(a);
if(!a||"."===a||".."===a)throw new k.Qi(28);var e=Ob(d,a);if(e)throw new k.Qi(e);if(!d.Ri.jj)throw new k.Qi(63);return d.Ri.jj(d,a,b,c)},create(a,b){return k.jj(a,(void 0!==b?b:438)&4095|32768,0)},$i(a,b){return k.jj(a,(void 0!==b?b:511)&1023|16384,0)},sj(a,b){if(!kb(a))throw new k.Qi(44);var c=G(b,{parent:!0}).node;if(!c)throw new k.Qi(44);b=fb(b);var d=Ob(c,b);if(d)throw new k.Qi(d);if(!c.Ri.sj)throw new k.Qi(63);return c.Ri.sj(c,b,a)},Lj(a,b){var c=eb(a),d=eb(b),e=fb(a),f=fb(b);var g=G(a,{parent:!0});
var n=g.node;g=G(b,{parent:!0});g=g.node;if(!n||!g)throw new k.Qi(44);if(n.Ui!==g.Ui)throw new k.Qi(75);var p=yb(n,e);a=lb(a,d);if("."!==a.charAt(0))throw new k.Qi(28);a=lb(b,c);if("."!==a.charAt(0))throw new k.Qi(55);try{var q=yb(g,f)}catch(r){}if(p!==q){b=F(p.mode);if(e=Pb(n,e,b))throw new k.Qi(e);if(e=q?Pb(g,f,b):Ob(g,f))throw new k.Qi(e);if(!n.Ri.Lj)throw new k.Qi(63);if(p.kj||q&&q.kj)throw new k.Qi(10);if(g!==n&&(e=Hb(n,"w")))throw new k.Qi(e);Mb(p);try{n.Ri.Lj(p,g,f),p.parent=g}catch(r){throw r;
}finally{Lb(p)}}},vj(a){var b=G(a,{parent:!0}).node;a=fb(a);var c=yb(b,a),d=Pb(b,a,!0);if(d)throw new k.Qi(d);if(!b.Ri.vj)throw new k.Qi(63);if(c.kj)throw new k.Qi(10);b.Ri.vj(b,a);Mb(c)},Aj(a){a=G(a,{oj:!0}).node;if(!a.Ri.Aj)throw new k.Qi(54);return a.Ri.Aj(a)},lj(a){var b=G(a,{parent:!0}).node;if(!b)throw new k.Qi(44);a=fb(a);var c=yb(b,a),d=Pb(b,a,!1);if(d)throw new k.Qi(d);if(!b.Ri.lj)throw new k.Qi(63);if(c.kj)throw new k.Qi(10);b.Ri.lj(b,a);Mb(c)},Kj(a){a=G(a).node;if(!a)throw new k.Qi(44);
if(!a.Ri.Kj)throw new k.Qi(28);return kb(Kb(a.parent),a.Ri.Kj(a))},stat(a,b){a=G(a,{oj:!b}).node;if(!a)throw new k.Qi(44);if(!a.Ri.pj)throw new k.Qi(63);return a.Ri.pj(a)},Zk(a){return k.stat(a,!0)},Cm(a,b){Gb(a,b,!0)},wm(a,b){a=H(a);Gb(a.node,b)},Dm(a){Ub(a,!0)},xm(a){a=H(a);Ub(a.node)},truncate(a,b){if(0>b)throw new k.Qi(28);a="string"==typeof a?G(a,{oj:!0}).node:a;if(!a.Ri.aj)throw new k.Qi(63);if(F(a.mode))throw new k.Qi(31);if(!k.isFile(a.mode))throw new k.Qi(28);var c=Hb(a,"w");if(c)throw new k.Qi(c);
a.Ri.aj(a,{size:b,timestamp:Date.now()})},zm(a,b){a=H(a);if(0===(a.flags&2097155))throw new k.Qi(28);k.truncate(a.node,b)},open(a,b,c){if(""===a)throw new k.Qi(44);if("string"==typeof b){var d={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof d)throw Error(`Unknown file open mode: ${b}`);b=d}c=b&64?("undefined"==typeof c?438:c)&4095|32768:0;if("object"==typeof a)var e=a;else{a=D(a);try{e=G(a,{oj:!(b&131072)}).node}catch(f){}}d=!1;if(b&64)if(e){if(b&128)throw new k.Qi(20);}else e=
k.jj(a,c,0),d=!0;if(!e)throw new k.Qi(44);8192===(e.mode&61440)&&(b&=-513);if(b&65536&&!F(e.mode))throw new k.Qi(54);if(!d&&(c=e?40960===(e.mode&61440)?32:F(e.mode)&&("r"!==Nb(b)||b&512)?31:Hb(e,Nb(b)):44))throw new k.Qi(c);b&512&&!d&&k.truncate(e,0);b&=-131713;e=Qb({node:e,path:Kb(e),flags:b,seekable:!0,position:0,Si:e.Si,dm:[],error:!1});e.Si.open&&e.Si.open(e);!h.logReadFiles||b&1||a in k.cl||(k.cl[a]=1);return e},close(a){if(null===a.fd)throw new k.Qi(8);a.Ej&&(a.Ej=null);try{a.Si.close&&a.Si.close(a)}catch(b){throw b;
}finally{k.streams[a.fd]=null}a.fd=null},ej(a,b,c){if(null===a.fd)throw new k.Qi(8);if(!a.seekable||!a.Si.ej)throw new k.Qi(70);if(0!=c&&1!=c&&2!=c)throw new k.Qi(28);a.position=a.Si.ej(a,b,c);a.dm=[];return a.position},read(a,b,c,d,e){if(0>d||0>e)throw new k.Qi(28);if(null===a.fd)throw new k.Qi(8);if(1===(a.flags&2097155))throw new k.Qi(8);if(F(a.node.mode))throw new k.Qi(31);if(!a.Si.read)throw new k.Qi(28);var f="undefined"!=typeof e;if(!f)e=a.position;else if(!a.seekable)throw new k.Qi(70);b=
a.Si.read(a,b,c,d,e);f||(a.position+=b);return b},write(a,b,c,d,e,f){if(0>d||0>e)throw new k.Qi(28);if(null===a.fd)throw new k.Qi(8);if(0===(a.flags&2097155))throw new k.Qi(8);if(F(a.node.mode))throw new k.Qi(31);if(!a.Si.write)throw new k.Qi(28);a.seekable&&a.flags&1024&&k.ej(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new k.Qi(70);b=a.Si.write(a,b,c,d,e,f);g||(a.position+=b);return b},Dj(a,b,c){if(null===a.fd)throw new k.Qi(8);if(0>b||0>=c)throw new k.Qi(28);
if(0===(a.flags&2097155))throw new k.Qi(8);if(!k.isFile(a.node.mode)&&!F(a.node.mode))throw new k.Qi(43);if(!a.Si.Dj)throw new k.Qi(138);a.Si.Dj(a,b,c)},Ij(a,b,c,d,e){if(0!==(d&2)&&0===(e&2)&&2!==(a.flags&2097155))throw new k.Qi(2);if(1===(a.flags&2097155))throw new k.Qi(2);if(!a.Si.Ij)throw new k.Qi(43);if(!b)throw new k.Qi(28);return a.Si.Ij(a,b,c,d,e)},Nj(a,b,c,d,e){return a.Si.Nj?a.Si.Nj(a,b,c,d,e):0},uk(a,b,c){if(!a.Si.uk)throw new k.Qi(59);return a.Si.uk(a,b,c)},Im(a,b={}){b.flags=b.flags||
0;b.encoding=b.encoding||"binary";if("utf8"!==b.encoding&&"binary"!==b.encoding)throw Error(`Invalid encoding type "${b.encoding}"`);var c,d=k.open(a,b.flags);a=k.stat(a).size;var e=new Uint8Array(a);k.read(d,e,0,a,0);"utf8"===b.encoding?c=C(e,0):"binary"===b.encoding&&(c=e);k.close(d);return c},lk:()=>k.Qk,nm(a){a=G(a,{oj:!0});if(null===a.node)throw new k.Qi(44);if(!F(a.node.mode))throw new k.Qi(54);var b=Hb(a.node,"x");if(b)throw new k.Qi(b);k.Qk=a.path},Wl(){k.tk=!1;for(var a=0;a<k.streams.length;a++){var b=
k.streams[a];b&&k.close(b)}},ym(a,b){try{var c=G(a,{oj:!b});a=c.path}catch(f){}var d=!1,e=null;try{c=G(a,{parent:!0}),fb(a),c=G(a,{oj:!b}),d=!0,e=c.node}catch(f){}return d?e:null},Ok(a,b){a="string"==typeof a?a:Kb(a);for(b=b.split("/").reverse();b.length;){var c=b.pop();if(c){var d=D(a+"/"+c);try{k.$i(d)}catch(e){}a=d}}return d},ik(a,b,c,d,e,f){var g=b;a&&(a="string"==typeof a?a:Kb(a),g=b?D(a+"/"+b):a);a=Fb(d,e);g=k.create(g,a);if(c){if("string"==typeof c){b=Array(c.length);d=0;for(e=c.length;d<e;++d)b[d]=
c.charCodeAt(d);c=b}Gb(g,a|146);b=k.open(g,577);k.write(b,c,0,c.length,0,f);k.close(b);Gb(g,a)}},tj(a,b,c,d){a=hb("string"==typeof a?a:Kb(a),b);b=Fb(!!c,!!d);var e;(e=k.tj).wk??(e.wk=64);e=k.Hj(k.tj.wk++,0);rb(e,{open(f){f.seekable=!1},close(){d?.buffer?.length&&d(10)},read(f,g,n,p){for(var q=0,r=0;r<p;r++){try{var t=c()}catch(v){throw new k.Qi(29);}if(void 0===t&&0===q)throw new k.Qi(6);if(null===t||void 0===t)break;q++;g[n+r]=t}q&&(f.node.timestamp=Date.now());return q},write(f,g,n,p){for(var q=
0;q<p;q++)try{d(g[n+q])}catch(r){throw new k.Qi(29);}p&&(f.node.timestamp=Date.now());return q}});return Tb(a,b,e)},Nk(a,b,c,d,e){function f(p,q,r,t,v){p=p.node.Ti;if(v>=p.length)return 0;t=Math.min(p.length-v,t);if(p.slice)for(var J=0;J<t;J++)q[r+J]=p[v+J];else for(J=0;J<t;J++)q[r+J]=p.get(v+J);return t}if("undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";c={Wk:!1,url:c};var g=Vb(a,b,d,e);
c.Ti?g.Ti=c.Ti:c.url&&(g.Ti=null,g.url=c.url);Object.defineProperties(g,{Wi:{get:function(){return this.Ti.length}}});var n={};Object.keys(g.Si).forEach(p=>{var q=g.Si[p];n[p]=(...r)=>{Wb(g);return q(...r)}});n.read=(p,q,r,t,v)=>{Wb(g);return f(p,q,r,t,v)};n.Ij=(p,q,r)=>{Wb(g);var t=wb(q);if(!t)throw new k.Qi(48);f(p,m,t,q,r);return{bl:t,wj:!0}};g.Si=n;return g}},Xb=(a,b)=>a?C(u,a,b):"";
function Yb(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?k.lk():H(a).path;if(0==b.length){if(!c)throw new k.Qi(44);return a}return D(a+"/"+b)}
function Zb(a,b,c){a=a(b);z.setInt32(4*(c>>2),a.yl,!0);z.setInt32(4*(c+4>>2),a.mode,!0);z.setUint32(4*(c+8>>2),a.Tl,!0);z.setInt32(4*(c+12>>2),a.uid,!0);z.setInt32(4*(c+16>>2),a.Hl,!0);z.setInt32(4*(c+20>>2),a.Sj,!0);x[c+24>>3]=BigInt(a.size);z.setInt32(4*(c+32>>2),4096,!0);z.setInt32(4*(c+36>>2),a.nl,!0);b=a.ll.getTime();var d=a.ek.getTime(),e=a.ql.getTime();x[c+40>>3]=BigInt(Math.floor(b/1E3));z.setUint32(4*(c+48>>2),b%1E3*1E6,!0);x[c+56>>3]=BigInt(Math.floor(d/1E3));z.setUint32(4*(c+64>>2),d%1E3*
1E6,!0);x[c+72>>3]=BigInt(Math.floor(e/1E3));z.setUint32(4*(c+80>>2),e%1E3*1E6,!0);x[c+88>>3]=BigInt(a.Ll);return 0}
var bb=void 0,$b=[0,31,60,91,121,152,182,213,244,274,305,335],ac=[0,31,59,90,120,151,181,212,243,273,304,334],bc=a=>{if(a instanceof Xa||"unwind"==a)return wa;throw a;},cc=0,dc=a=>{wa=a;$a||0<cc||(h.onExit?.(a),va=!0);throw new Xa(a);},ec=a=>{wa=a;dc(a)},fc=()=>{if(!($a||0<cc))try{var a=wa;wa=a;dc(a)}catch(b){bc(b)}},gc=a=>{if(!va)try{a(),fc()}catch(b){bc(b)}},hc=(a,b)=>setTimeout(()=>{gc(a)},b),ic=!1,jc=!1,kc=[];
function Cb(){function a(){jc=document.pointerLockElement===h.canvas||document.mozPointerLockElement===h.canvas||document.webkitPointerLockElement===h.canvas||document.msPointerLockElement===h.canvas}if(!lc){lc=!0;Ab.push({canHandle:function(c){return!h.noImageDecoding&&/\.(jpg|jpeg|png|bmp|webp)$/i.test(c)},handle:function(c,d,e,f){var g=new Blob([c],{type:mc(d)});g.size!==c.length&&(g=new Blob([(new Uint8Array(c)).buffer],{type:mc(d)}));var n=URL.createObjectURL(g),p=new Image;p.onload=()=>{var q=
document.createElement("canvas");q.width=p.width;q.height=p.height;q.getContext("2d").drawImage(p,0,0);URL.revokeObjectURL(n);e?.(c)};p.onerror=()=>{qa(`Image ${n} could not be decoded`);f?.()};p.src=n}});Ab.push({canHandle:function(c){return!h.noAudioDecoding&&c.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(c,d,e){function f(){g||(g=!0,e?.(c))}var g=!1,n=URL.createObjectURL(new Blob([c],{type:mc(d)})),p=new Audio;p.addEventListener("canplaythrough",()=>f(p),!1);p.onerror=function(){if(!g){qa(`warning: browser could not fully decode audio ${d}, trying slower base64 approach`);
for(var q="",r=0,t=0,v=0;v<c.length;v++)for(r=r<<8|c[v],t+=8;6<=t;){var J=r>>t-6&63;t-=6;q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[J]}2==t?(q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(r&3)<<4],q+="=="):4==t&&(q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(r&15)<<2],q+="=");p.src="data:audio/x-"+d.substr(-3)+";base64,"+q;f(p)}};p.src=n;hc(()=>{f(p)},1E4)}});var b=h.canvas;b&&(b.requestPointerLock=b.requestPointerLock||b.mozRequestPointerLock||
b.webkitRequestPointerLock||b.msRequestPointerLock||(()=>{}),b.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),b.exitPointerLock=b.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",a,!1),document.addEventListener("mozpointerlockchange",a,!1),document.addEventListener("webkitpointerlockchange",a,!1),document.addEventListener("mspointerlockchange",a,!1),h.elementPointerLock&&b.addEventListener("click",
c=>{!jc&&h.canvas.requestPointerLock&&(h.canvas.requestPointerLock(),c.preventDefault())},!1))}}var nc=!1,oc=void 0,pc=void 0;function qc(){if(!ic)return!1;(document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]);return!0}
function mc(a){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[a.substr(a.lastIndexOf(".")+1)]}var rc=[];function sc(){var a=h.canvas;rc.forEach(b=>b(a.width,a.height))}
function tc(a,b,c){b&&c?(a.em=b,a.Il=c):(b=a.em,c=a.Il);var d=b,e=c;h.forcedAspectRatio&&0<h.forcedAspectRatio&&(d/e<h.forcedAspectRatio?d=Math.round(e*h.forcedAspectRatio):e=Math.round(d/h.forcedAspectRatio));if((document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===a.parentNode&&"undefined"!=typeof screen){var f=Math.min(screen.width/d,screen.height/e);d=Math.round(d*f);e=Math.round(e*
f)}pc?(a.width!=d&&(a.width=d),a.height!=e&&(a.height=e),"undefined"!=typeof a.style&&(a.style.removeProperty("width"),a.style.removeProperty("height"))):(a.width!=b&&(a.width=b),a.height!=c&&(a.height=c),"undefined"!=typeof a.style&&(d!=b||e!=c?(a.style.setProperty("width",d+"px","important"),a.style.setProperty("height",e+"px","important")):(a.style.removeProperty("width"),a.style.removeProperty("height"))))}
var Bb={},lc,I=12288,uc=!1,vc=0,wc=0,xc=0,L={alpha:!1,depth:!1,stencil:!1,antialias:!1},yc={},zc,M,Ac=1,Bc=[],N=[],Cc=[],Dc=[],Ec=[],O=[],Fc=[],Gc=[],P=[],Hc=[],Ic=[],Jc=[],Kc={},Lc={},Mc=4,Nc=0,Oc=a=>{for(var b=Ac++,c=a.length;c<b;c++)a[c]=null;return b},Pc=(a,b,c,d)=>{for(var e=0;e<a;e++){var f=M[c](),g=f&&Oc(d);f&&(f.name=g,d[g]=f);z.setInt32(4*(b+4*e>>2),g,!0)}},Rc=(a,b)=>{if(h.preinitializedWebGLContext){var c=h.preinitializedWebGLContext;b.xk=Number(c.getParameter(c.VERSION).match(/^WebGL (\d+).\d+/)[1])}else a.cj||
(a.cj=a.getContext,a.getContext=function(d,e){e=a.cj(d,e);return"webgl"==d==e instanceof WebGLRenderingContext?e:null}),c=a.getContext("webgl2",b);return c?Qc(c,b):0},Qc=(a,b)=>{var c=Oc(Gc);b={handle:c,attributes:b,version:b.xk,Cj:a};a.canvas&&(a.canvas.Pj=b);Gc[c]=b;return c},Tc=a=>{Sc=Gc[a];h.mj=M=Sc?.Cj},Uc={},Sc,Vc=a=>{var b=ob(a)+1,c=A(b);c&&B(a,u,c,b);return c},md=(a,b,c,d,e)=>{function f(){return g<Wc?(fc(),!1):!0}Xc=a;Yc=d;var g=Wc;Zc=!1;$c=function(){if(!va)if(0<ad.length){var n=ad.shift();
n.Am(n.fm);if(bd){var p=bd,q=0==p%1?p-1:Math.floor(p);bd=n.pm?q:(8*p+(q+.5))/9}h.setStatus&&(n=h.statusMessage||"Please wait...",p=bd??0,q=cd.tm??0,p?p<q?h.setStatus("{message} ({expected - remaining}/{expected})"):h.setStatus(n):h.setStatus(""));f()&&setTimeout($c,0)}else if(f())if(dd=dd+1|0,1==ed&&1<fd&&0!=dd%fd)gd();else{0==ed&&(hd=performance.now());a:if(!va){for(n of jd)if(!1===n())break a;gc(a);for(p of kd)p()}f()&&gd()}};e||(b&&0<b?ld(0,1E3/b):ld(1,1),gd());if(c)throw"unwind";},Zc=!1,gd=null,
Wc=0,Xc=null,Yc=0,ed=0,fd=0,dd=0,ad=[],jd=[],kd=[];function nd(){gd=null;Wc++}function od(){Wc++;var a=ed,b=fd,c=Xc;Xc=null;md(c,0,!1,Yc,!0);ld(a,b);gd()}var pd=0;function qd(a){if("function"==typeof requestAnimationFrame)requestAnimationFrame(a);else{var b=Date.now();if(0===pd)pd=b+1E3/60;else for(;b+2>=pd;)pd+=1E3/60;setTimeout(a,Math.max(pd-b,0))}}
var cd={},$c,bd,hd,rd,ld=(a,b)=>{ed=a;fd=b;if(Xc)if(Zc||=!0,0==a)gd=function(){setTimeout($c,Math.max(0,hd+b-performance.now())|0)};else if(1==a)gd=function(){qd($c)};else if(2==a){if("undefined"==typeof rd)if("undefined"==typeof setImmediate){var c=[];addEventListener("message",d=>{if("setimmediate"===d.data||"setimmediate"===d.data.target)d.stopPropagation(),c.shift()()},!0);rd=d=>{c.push(d);postMessage("setimmediate","*")}}else rd=setImmediate;gd=function(){rd($c)}}},sd=[],td=(a,b)=>{sd.length=
0;for(var c;c=u[a++];){var d=105!=c;d&=112!=c;b+=d&&b%8?4:0;sd.push(112==c?z.getUint32(4*(b>>2),!0):106==c?x[b>>3]:105==c?z.getInt32(4*(b>>2),!0):z.getFloat64(8*(b>>3),!0));b+=d?8:4}return sd};function ud(a){var b=Q.hj[a];b.target.removeEventListener(b.Zi,b.Sk,b.fj);Q.hj.splice(a,1)}function vd(a,b,c){function d(f,g){if(f.length!=g.length)return!1;for(var n in f)if(f[n]!=g[n])return!1;return!0}for(var e of Q.xj)if(e.Dk==a&&d(e.Jk,c))return;Q.xj.push({Dk:a,al:b,Jk:c});Q.xj.sort((f,g)=>f.al<g.al)}
function wd(a){Q.xj=Q.xj.filter(b=>b.Dk!=a)}function xd(){return navigator.userActivation?navigator.userActivation.isActive:Q.sk&&Q.sl.Vj}function yd(){if(xd()){var a=Q.xj;Q.xj=[];for(var b of a)b.Dk(...b.Jk)}}function zd(a){if(!a.target)return-4;if(a.gj)a.Sk=function(c){++Q.sk;Q.sl=a;yd();a.ij(c);yd();--Q.sk},a.target.addEventListener(a.Zi,a.Sk,a.fj),Q.hj.push(a);else for(var b=0;b<Q.hj.length;++b)Q.hj[b].target==a.target&&Q.hj[b].Zi==a.Zi&&ud(b--);return 0}
function Ad(a){return a?a==window?"#window":a==screen?"#screen":a?.nodeName||"":""}
var Q={hm:0,qk:0,vk:0,dk:0,Ik:0,Fk:0,mk:0,rm:0,Hm:0,qm:0,pk:0,zk:0,Hk:0,Ek:0,Jm(){for(;Q.hj.length;)ud(Q.hj.length-1);Q.xj=[]},sk:0,xj:[],hj:[],Yl:(a,b)=>{for(var c=0;c<Q.hj.length;++c)Q.hj[c].target!=a||b&&b!=Q.hj[c].Zi||ud(c--)},fullscreenEnabled(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},Bd={},Cd=[0,document,window],R=a=>{a=2<a?a?C(u,a):"":a;return Cd[a]||document.querySelector(a)},Ed=a=>{var b=ob(a)+1,c=Dd(b);B(a,u,c,b);return c},Fd=a=>{var b=S(),c=Dd(8),d=c+4;a=Ed(a.id);
if(a=R(a))z.setInt32(4*(c>>2),a.width,!0),z.setInt32(4*(d>>2),a.height,!0);c=[z.getInt32(4*(c>>2),!0),z.getInt32(4*(d>>2),!0)];T(b);return c},Gd=(a,b,c)=>{a=R(a);if(!a)return-4;a.width=b;a.height=c;return 0},Hd=(a,b,c)=>{if(a.om){var d=S();a=Ed(a.id);Gd(a,b,c);T(d)}else a.width=b,a.height=c},Id=a=>{function b(){document.fullscreenElement||document.webkitFullscreenElement||(document.removeEventListener("fullscreenchange",b),document.removeEventListener("webkitfullscreenchange",b),Hd(a,d,e),a.style.width=
f,a.style.height=g,a.style.backgroundColor=n,p||(document.body.style.backgroundColor="white"),document.body.style.backgroundColor=p,a.style.paddingLeft=q,a.style.paddingRight=r,a.style.paddingTop=t,a.style.paddingBottom=v,a.style.marginLeft=J,a.style.marginRight=oa,a.style.marginTop=Fa,a.style.marginBottom=sa,document.body.style.margin=db,document.documentElement.style.overflow=Ib,document.body.scroll=y,a.style.zj=ta,a.Pj&&a.Pj.Cj.viewport(0,0,d,e),Bd.Wj&&U(Bd.Wj,37,0,Bd.Lk))}var c=Fd(a),d=c[0],e=
c[1],f=a.style.width,g=a.style.height,n=a.style.backgroundColor,p=document.body.style.backgroundColor,q=a.style.paddingLeft,r=a.style.paddingRight,t=a.style.paddingTop,v=a.style.paddingBottom,J=a.style.marginLeft,oa=a.style.marginRight,Fa=a.style.marginTop,sa=a.style.marginBottom,db=document.body.style.margin,Ib=document.documentElement.style.overflow,y=document.body.scroll,ta=a.style.zj;document.addEventListener("fullscreenchange",b);document.addEventListener("webkitfullscreenchange",b)},Jd=(a,b,
c)=>{a.style.paddingLeft=a.style.paddingRight=c+"px";a.style.paddingTop=a.style.paddingBottom=b+"px"},Kd=a=>0>Cd.indexOf(a)?a.getBoundingClientRect():{left:0,top:0},Ld=(a,b)=>{if(0!=b.Ck||0!=b.hk){Id(a);var c=b.am?innerWidth:screen.width,d=b.am?innerHeight:screen.height,e=Kd(a),f=e.width;e=e.height;var g=Fd(a),n=g[0];g=g[1];3==b.Ck?(Jd(a,(d-e)/2,(c-f)/2),c=f,d=e):2==b.Ck&&(c*g<n*d?(f=g*c/n,Jd(a,(d-f)/2,0),d=f):(f=n*d/g,Jd(a,0,(c-f)/2),c=f));var p;(p=a.style).backgroundColor||(p.backgroundColor="black");
let q;(q=document.body.style).backgroundColor||(q.backgroundColor="black");a.style.width=c+"px";a.style.height=d+"px";1==b.Bl&&(a.style.zj="optimizeSpeed",a.style.zj="-moz-crisp-edges",a.style.zj="-o-crisp-edges",a.style.zj="-webkit-optimize-contrast",a.style.zj="optimize-contrast",a.style.zj="crisp-edges",a.style.zj="pixelated");p=2==b.hk?devicePixelRatio:1;0!=b.hk&&(c=c*p|0,d=d*p|0,Hd(a,c,d),a.Pj&&a.Pj.Cj.viewport(0,0,c,d))}if(a.requestFullscreen)a.requestFullscreen();else if(a.webkitRequestFullscreen)a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
else return Q.fullscreenEnabled()?-3:-1;Bd=b;b.Wj&&U(b.Wj,37,0,b.Lk);return 0},Md=a=>{if(a.requestPointerLock)a.requestPointerLock();else return document.body.requestPointerLock?-3:-1;return 0},Nd=a=>{try{a()}catch(b){Na(b)}};
function Od(){var a=V,b={};for(let [c,d]of Object.entries(a))b[c]="function"==typeof d?(...e)=>{Pd.push(c);try{return d(...e)}finally{if(!va&&(Pd.pop(),W&&1===X&&0===Pd.length&&(X=0,Nd(Qd),"undefined"!=typeof Rd&&!Sd&&Td))){Sd=!0;do{e=Td;Td=0;var f=z.getUint32(4*(e>>2),!0),g=z.getUint32(4*(e+4>>2),!0);Ud(f,g);T(z.getUint32(4*(e+8>>2),!0));f=z.getUint32(4*(e+12>>2),!0);0!==f?(W=null,z.setUint32(4*(e+12>>2),0,!0),dynCall_vi(f,z.getUint32(4*(e+16>>2),!0))):(W=e+=20,X=2,Vd(e),Wd(e))}while(Td);Sd=!1}}}:
d;return b}var X=0,W=null,Xd=0,Pd=[],Yd={},Zd={},$d=0,ae=null,be=[];function ce(){return new Promise((a,b)=>{ae={resolve:a,reject:b}})}function de(){var a=A(4108),b=a+12;z.setUint32(4*(a>>2),b,!0);z.setUint32(4*(a+4>>2),b+4096,!0);ee(a);return a}function ee(a){var b=Pd[0],c=Yd[b];void 0===c&&(c=$d++,Yd[b]=c,Zd[c]=b);z.setInt32(4*(a+8>>2),c,!0)}function Wd(a){a=z.getInt32(4*(a+8>>2),!0);return(0,V[Zd[a]])()}
function fe(a){if(!va){if(0===X){var b=!1,c=!1;a((d=0)=>{if(!va&&(Xd=d,b=!0,c)){X=2;Nd(()=>Vd(W));"undefined"!=typeof cd&&Xc&&od();d=!1;try{var e=Wd(W)}catch(n){e=n,d=!0}var f=!1;if(!W){var g=ae;g&&(ae=null,(d?g.reject:g.resolve)(e),f=!0)}if(d&&!f)throw e;}});c=!0;b||(X=1,W=de(),"undefined"!=typeof cd&&Xc&&nd(),Nd(()=>ge(W)))}else 2===X?(X=0,Nd(he),ie(W),W=null,be.forEach(gc)):Na(`invalid state: ${X}`);return Xd}}
var Td=0,Sd=!1,Rd={},je=(a,b)=>{z.setFloat64(8*(a>>3),b.timestamp,!0);for(var c=0;c<b.axes.length;++c)z.setFloat64(8*(a+8*c+16>>3),b.axes[c],!0);for(c=0;c<b.buttons.length;++c)"object"==typeof b.buttons[c]?z.setFloat64(8*(a+8*c+528>>3),b.buttons[c].value,!0):z.setFloat64(8*(a+8*c+528>>3),b.buttons[c],!0);for(c=0;c<b.buttons.length;++c)m[a+c+1040]="object"==typeof b.buttons[c]?b.buttons[c].pressed:1==b.buttons[c];m[a+1104]=b.connected;z.setInt32(4*(a+1108>>2),b.index,!0);z.setInt32(4*(a+8>>2),b.axes.length,
!0);z.setInt32(4*(a+12>>2),b.buttons.length,!0);B(b.id,u,a+1112,64);B(b.mapping,u,a+1176,64)},ke=a=>M.activeTexture(a),le=(a,b)=>{M.attachShader(N[a],O[b])},me=(a,b,c)=>{M.bindAttribLocation(N[a],b,c?C(u,c):"")},ne=(a,b)=>{35051==a?M.kk=b:35052==a&&(M.nj=b);M.bindBuffer(a,Bc[b])},oe=(a,b)=>{M.bindFramebuffer(a,Cc[b])},pe=(a,b)=>{M.bindTexture(a,Ec[b])},qe=a=>{M.bindVertexArray(Fc[a])},re=(a,b)=>M.blendEquationSeparate(a,b),se=(a,b,c,d)=>M.blendFuncSeparate(a,b,c,d),te=(a,b,c,d,e,f,g,n,p,q)=>M.blitFramebuffer(a,
b,c,d,e,f,g,n,p,q),ue=(a,b,c,d)=>{c&&b?M.bufferData(a,u,d,c,b):M.bufferData(a,b,d)},ve=(a,b,c,d)=>{c&&M.bufferSubData(a,b,u,d,c)},we=a=>M.clear(a),xe=(a,b,c,d)=>M.clearColor(a,b,c,d),ye=a=>M.clearDepth(a),ze=a=>{M.compileShader(O[a])},Ae=(a,b,c,d,e,f,g,n,p)=>{M.nj||!n?M.compressedTexSubImage2D(a,b,c,d,e,f,g,n,p):M.compressedTexSubImage2D(a,b,c,d,e,f,g,u,p,n)},Be=()=>{var a=Oc(N),b=M.createProgram();b.name=a;b.bk=b.$j=b.ak=0;b.Gk=1;N[a]=b;return a},Ce=a=>{var b=Oc(O);O[b]=M.createShader(a);return b},
De=a=>M.cullFace(a),Ee=(a,b)=>{for(var c=0;c<a;c++){var d=z.getInt32(4*(b+4*c>>2),!0),e=Bc[d];e&&(M.deleteBuffer(e),e.name=0,Bc[d]=null,d==M.kk&&(M.kk=0),d==M.nj&&(M.nj=0))}},Fe=(a,b)=>{for(var c=0;c<a;++c){var d=z.getInt32(4*(b+4*c>>2),!0),e=Cc[d];e&&(M.deleteFramebuffer(e),e.name=0,Cc[d]=null)}},Ge=a=>{if(a){var b=N[a];b&&(M.deleteProgram(b),b.name=0,N[a]=null)}},He=a=>{if(a){var b=O[a];b&&(M.deleteShader(b),O[a]=null)}},Ie=(a,b)=>{for(var c=0;c<a;c++){var d=z.getInt32(4*(b+4*c>>2),!0),e=Ec[d];
e&&(M.deleteTexture(e),e.name=0,Ec[d]=null)}},Je=(a,b)=>{for(var c=0;c<a;c++){var d=z.getInt32(4*(b+4*c>>2),!0);M.deleteVertexArray(Fc[d]);Fc[d]=null}},Ke=a=>M.depthFunc(a),Le=a=>{M.depthMask(!!a)},Me=a=>M.disable(a),Ne=a=>{M.disableVertexAttribArray(a)},Oe=(a,b,c)=>{M.drawArrays(a,b,c)},Pe=(a,b,c,d)=>{M.drawArraysInstanced(a,b,c,d)},Qe=[],Re=(a,b)=>{for(var c=Qe[a],d=0;d<a;d++)c[d]=z.getInt32(4*(b+4*d>>2),!0);M.drawBuffers(c)},Se=(a,b,c,d)=>{M.drawElements(a,b,c,d)},Te=(a,b,c,d,e)=>{M.drawElementsInstanced(a,
b,c,d,e)},Ue=a=>M.enable(a),Ve=a=>{M.enableVertexAttribArray(a)},We=(a,b,c,d,e)=>{M.framebufferTexture2D(a,b,c,Ec[d],e)},Xe=a=>M.frontFace(a),Ye=(a,b)=>{Pc(a,b,"createBuffer",Bc)},Ze=(a,b)=>{Pc(a,b,"createFramebuffer",Cc)},$e=(a,b)=>{Pc(a,b,"createTexture",Ec)},af=(a,b)=>{Pc(a,b,"createVertexArray",Fc)},bf=a=>M.generateMipmap(a),cf=(a,b,c,d,e,f,g,n)=>{b=N[b];if(a=M[a](b,c))d=n&&B(a.name,u,n,d),e&&z.setInt32(4*(e>>2),d,!0),f&&z.setInt32(4*(f>>2),a.size,!0),g&&z.setInt32(4*(g>>2),a.type,!0)},df=(a,
b,c,d,e,f,g)=>{cf("getActiveUniform",a,b,c,d,e,f,g)},ef=(a,b)=>{z.setUint32(4*(a>>2),b,!0);var c=z.getUint32(4*(a>>2),!0);z.setUint32(4*(a+4>>2),(b-c)/4294967296,!0)},ff=()=>{var a="EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_clip_control EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_polygon_offset_clamp EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw WEBGL_polygon_mode".split(" ");
return(M.getSupportedExtensions()||[]).filter(b=>a.includes(b))};function gf(){var a=ff();return a=a.concat(a.map(b=>"GL_"+b))}
var hf=(a,b,c)=>{if(b){var d=void 0;switch(a){case 36346:d=1;break;case 36344:return;case 34814:case 36345:d=0;break;case 34466:var e=M.getParameter(34467);d=e?e.length:0;break;case 33309:d=gf().length;break;case 33307:case 33308:d=33307==a?3:0}if(void 0===d)switch(e=M.getParameter(a),typeof e){case "number":d=e;break;case "boolean":d=e?1:0;break;case "string":return;case "object":if(null===e)switch(a){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:d=
0;break;default:return}else{if(e instanceof Float32Array||e instanceof Uint32Array||e instanceof Int32Array||e instanceof Array){for(a=0;a<e.length;++a)switch(c){case 0:z.setInt32(4*(b+4*a>>2),e[a],!0);break;case 2:z.setFloat32(4*(b+4*a>>2),e[a],!0);break;case 4:m[b+a]=e[a]?1:0}return}d=e.name|0}}switch(c){case 1:ef(b,d);break;case 0:z.setInt32(4*(b>>2),d,!0);break;case 2:z.setFloat32(4*(b>>2),d,!0);break;case 4:m[b]=d?1:0}}},jf=(a,b,c,d)=>{b=M.getIndexedParameter(a,b);switch(typeof b){case "boolean":a=
b?1:0;break;case "number":a=b;break;case "object":if(null===b)switch(a){case 35983:case 35368:a=0;break;default:return}else if(b instanceof WebGLBuffer)a=b.name|0;else return;break;default:return}switch(d){case 1:ef(c,a);break;case 0:z.setInt32(4*(c>>2),a,!0);break;case 2:z.setFloat32(4*(c>>2),a,!0);break;case 4:m[c]=a?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+d;}},kf=(a,b)=>hf(a,b,0),lf=(a,b,c,d)=>{a=M.getProgramInfoLog(N[a]);b=0<b&&d?B(a,u,d,b):0;c&&z.setInt32(4*
(c>>2),b,!0)},mf=(a,b,c)=>{if(c&&!(a>=Ac))if(a=N[a],35716==b)z.setInt32(4*(c>>2),M.getProgramInfoLog(a).length+1,!0);else if(35719==b){if(!a.bk){var d=M.getProgramParameter(a,35718);for(b=0;b<d;++b)a.bk=Math.max(a.bk,M.getActiveUniform(a,b).name.length+1)}z.setInt32(4*(c>>2),a.bk,!0)}else if(35722==b){if(!a.$j)for(d=M.getProgramParameter(a,35721),b=0;b<d;++b)a.$j=Math.max(a.$j,M.getActiveAttrib(a,b).name.length+1);z.setInt32(4*(c>>2),a.$j,!0)}else if(35381==b){if(!a.ak)for(d=M.getProgramParameter(a,
35382),b=0;b<d;++b)a.ak=Math.max(a.ak,M.getActiveUniformBlockName(a,b).length+1);z.setInt32(4*(c>>2),a.ak,!0)}else z.setInt32(4*(c>>2),M.getProgramParameter(a,b),!0)},nf=(a,b,c)=>{if(c){a=P[a];b=2>Sc.version?M.yj.getQueryObjectEXT(a,b):M.getQueryParameter(a,b);var d;"boolean"==typeof b?d=b?1:0:d=b;ef(c,d)}},of=(a,b,c)=>{if(c){a=M.yj.getQueryObjectEXT(P[a],b);var d;"boolean"==typeof a?d=a?1:0:d=a;z.setInt32(4*(c>>2),d,!0)}},pf=(a,b,c,d)=>{a=M.getShaderInfoLog(O[a]);b=0<b&&d?B(a,u,d,b):0;c&&z.setInt32(4*
(c>>2),b,!0)},qf=(a,b,c)=>{c&&(35716==b?(a=M.getShaderInfoLog(O[a]),z.setInt32(4*(c>>2),a?a.length+1:0,!0)):35720==b?(a=M.getShaderSource(O[a]),z.setInt32(4*(c>>2),a?a.length+1:0,!0)):z.setInt32(4*(c>>2),M.getShaderParameter(O[a],b),!0))},rf=a=>{var b=Kc[a];if(!b){switch(a){case 7939:b=Vc(gf().join(" "));break;case 7936:case 7937:case 37445:case 37446:b=(b=M.getParameter(a))?Vc(b):0;break;case 7938:b=Vc(`OpenGL ES 3.0 (${M.getParameter(7938)})`);break;case 35724:b=M.getParameter(35724);var c=b.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);
null!==c&&(3==c[1].length&&(c[1]+="0"),b=`OpenGL ES GLSL ES ${c[1]} (${b})`);b=Vc(b)}Kc[a]=b}return b},sf=(a,b)=>{if(2>Sc.version)return 0;var c=Lc[a];if(c)return 0>b||b>=c.length?0:c[b];switch(a){case 7939:return c=gf().map(Vc),c=Lc[a]=c,0>b||b>=c.length?0:c[b];default:return 0}},tf=a=>"]"==a.slice(-1)&&a.lastIndexOf("["),uf=a=>{var b=a.Uj,c=a.el,d;if(!b){a.Uj=b={};a.dl={};var e=M.getProgramParameter(a,35718);for(d=0;d<e;++d){var f=M.getActiveUniform(a,d);var g=f.name;f=f.size;var n=tf(g);n=0<n?
g.slice(0,n):g;var p=a.Gk;a.Gk+=f;c[n]=[f,p];for(g=0;g<f;++g)b[p]=g,a.dl[p++]=n}}},vf=(a,b)=>{b=b?C(u,b):"";if(a=N[a]){uf(a);var c=a.Uj,d=0,e=b,f=tf(b);0<f&&(d=parseInt(b.slice(f+1))>>>0,e=b.slice(0,f));if((e=a.el[e])&&d<e[0]&&(d+=e[1],c[d]=c[d]||M.getUniformLocation(a,b)))return d}return-1},Y=a=>{var b=M.tl,c=b.Uj[a];"number"==typeof c&&(b.Uj[a]=c=M.getUniformLocation(b,b.dl[a]+(0<c?`[${c}]`:"")));return c},wf=(a,b,c,d)=>{if(c)if(a=N[a],uf(a),a=M.getUniform(a,Y(b)),"number"==typeof a||"boolean"==
typeof a)switch(d){case 0:z.setInt32(4*(c>>2),a,!0);break;case 2:z.setFloat32(4*(c>>2),a,!0)}else for(b=0;b<a.length;b++)switch(d){case 0:z.setInt32(4*(c+4*b>>2),a[b],!0);break;case 2:z.setFloat32(4*(c+4*b>>2),a[b],!0)}},xf=(a,b,c)=>{wf(a,b,c,2)},yf=(a,b,c)=>{wf(a,b,c,0)},zf=(a,b,c,d)=>{if(c)if(a=M.getVertexAttrib(a,b),34975==b)z.setInt32(4*(c>>2),a&&a.name,!0);else if("number"==typeof a||"boolean"==typeof a)switch(d){case 0:z.setInt32(4*(c>>2),a,!0);break;case 2:z.setFloat32(4*(c>>2),a,!0);break;
case 5:d=Math.fround(a),z.setInt32(4*(c>>2),d,!0)}else for(b=0;b<a.length;b++)switch(d){case 0:z.setInt32(4*(c+4*b>>2),a[b],!0);break;case 2:z.setFloat32(4*(c+4*b>>2),a[b],!0);break;case 5:var e=Math.fround(a[b]);z.setInt32(4*(c+4*b>>2),e,!0)}},Af=(a,b,c)=>{zf(a,b,c,0)},Bf=a=>(a=Fc[a])?M.isVertexArray(a):0,Cf=a=>{a=N[a];M.linkProgram(a);a.Uj=0;a.el={}},Df=(a,b)=>{3317==a?Mc=b:3314==a&&(Nc=b);M.pixelStorei(a,b)},Ef=a=>M.readBuffer(a),Ff=a=>{a-=5120;return 0==a?m:1==a?u:2==a?xa:4==a?za:6==a?w:5==a||
28922==a||28520==a||30779==a||30782==a?Aa:ya},Gf=(a,b,c,d,e)=>{a=Ff(a);b=d*((Nc||c)*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[b-6402]||1)*a.BYTES_PER_ELEMENT+Mc-1&-Mc);return a.subarray(e>>>31-Math.clz32(a.BYTES_PER_ELEMENT),e+b>>>31-Math.clz32(a.BYTES_PER_ELEMENT))},Hf=(a,b,c,d,e,f,g)=>{if(M.kk)M.readPixels(a,b,c,d,e,f,g);else{var n=Ff(f);g>>>=31-Math.clz32(n.BYTES_PER_ELEMENT);M.readPixels(a,b,c,d,e,f,n,g)}},If=(a,b,c,d)=>M.scissor(a,b,c,d),Jf=(a,b,c,d)=>{for(var e="",f=0;f<
b;++f){var g=d?z.getUint32(4*(d+4*f>>2),!0):void 0;e+=Xb(z.getUint32(4*(c+4*f>>2),!0),g)}M.shaderSource(O[a],e)},Kf=(a,b,c,d,e,f,g,n,p)=>{if(M.nj)M.texImage2D(a,b,c,d,e,f,g,n,p);else if(p){var q=Ff(n);p>>>=31-Math.clz32(q.BYTES_PER_ELEMENT);M.texImage2D(a,b,c,d,e,f,g,n,q,p)}else q=p?Gf(n,g,d,e,p):null,M.texImage2D(a,b,c,d,e,f,g,n,q)},Lf=(a,b,c)=>M.texParameteri(a,b,c),Mf=(a,b,c,d,e)=>M.texStorage2D(a,b,c,d,e),Nf=(a,b,c,d,e,f,g,n,p)=>{if(M.nj)M.texSubImage2D(a,b,c,d,e,f,g,n,p);else if(p){var q=Ff(n);
M.texSubImage2D(a,b,c,d,e,f,g,n,q,p>>>31-Math.clz32(q.BYTES_PER_ELEMENT))}else p=p?Gf(n,g,e,f,p):null,M.texSubImage2D(a,b,c,d,e,f,g,n,p)},Of=(a,b,c)=>{b&&M.uniform1fv(Y(a),w,c>>2,b)},Pf=(a,b,c)=>{b&&M.uniform1iv(Y(a),za,c>>2,b)},Qf=(a,b,c)=>{b&&M.uniform2fv(Y(a),w,c>>2,2*b)},Rf=(a,b,c)=>{b&&M.uniform2iv(Y(a),za,c>>2,2*b)},Sf=(a,b,c)=>{b&&M.uniform3fv(Y(a),w,c>>2,3*b)},Tf=(a,b,c)=>{b&&M.uniform3iv(Y(a),za,c>>2,3*b)},Uf=(a,b,c)=>{b&&M.uniform4fv(Y(a),w,c>>2,4*b)},Vf=(a,b,c)=>{b&&M.uniform4iv(Y(a),za,
c>>2,4*b)},Wf=(a,b,c,d)=>{b&&M.uniformMatrix3fv(Y(a),!!c,w,d>>2,9*b)},Xf=(a,b,c,d)=>{b&&M.uniformMatrix4fv(Y(a),!!c,w,d>>2,16*b)},Yf=a=>{a=N[a];M.useProgram(a);M.tl=a},Zf=(a,b)=>{M.vertexAttribDivisor(a,b)},$f=(a,b,c,d,e)=>{M.vertexAttribIPointer(a,b,c,d,e)},ag=(a,b,c,d,e,f)=>{M.vertexAttribPointer(a,b,c,!!d,e,f)},bg=(a,b,c,d)=>M.viewport(a,b,c,d),cg=(a,b)=>{if(!Q.fullscreenEnabled())return-1;a=R(a);return a?a.requestFullscreen||a.webkitRequestFullscreen?xd()?Ld(a,b):b.xl?(vd(Ld,1,[a,b]),1):-2:-3:
-4},dg=()=>{try{if(navigator.getGamepads)return(Q.Zj=navigator.getGamepads())?0:-1}catch(a){navigator.getGamepads=null}return-1},eg=(a,b)=>{var c={target:R(2),Zi:"beforeunload",gj:b,ij:(d=event)=>{var e=U(b,28,0,a);e&&=e?C(u,e):"";if(e)return d.preventDefault(),d.returnValue=e},fj:!0};return zd(c)},fg=(a,b,c,d,e,f)=>{Q.mk||(Q.mk=A(256));a={target:R(a),Zi:f,gj:d,ij:(g=event)=>{var n=g.target.id?g.target.id:"",p=Q.mk;B(Ad(g.target),u,p+0,128);B(n,u,p+128,128);U(d,e,p,b)&&g.preventDefault()},fj:c};return zd(a)},
gg=(a,b,c,d,e)=>{Q.pk||(Q.pk=A(276));return zd({target:a,Zi:e,gj:d,ij:(f=event)=>{var g=Q.pk,n=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement,p=!!n;m[g]=p;m[g+1]=Q.fullscreenEnabled();var q=p?n:Q.Vl,r=q?.id||"";B(Ad(q),u,g+2,128);B(r,u,g+130,128);z.setInt32(4*(g+260>>2),q?q.clientWidth:0,!0);z.setInt32(4*(g+264>>2),q?q.clientHeight:0,!0);z.setInt32(4*(g+268>>2),screen.width,!0);z.setInt32(4*(g+272>>2),screen.height,!0);p&&
(Q.Vl=n);U(d,19,g,b)&&f.preventDefault()},fj:c})},hg=(a,b,c,d,e)=>{Q.qk||(Q.qk=A(1240));b={target:R(2),Vj:!0,Zi:e,gj:c,ij:(f=event)=>{var g=Q.qk;je(g,f.gamepad);U(c,d,g,a)&&f.preventDefault()},fj:b};return zd(b)},ig=(a,b,c,d,e,f)=>{Q.vk||(Q.vk=A(160));a={target:R(a),Zi:f,gj:d,ij:g=>{var n=Q.vk;z.setFloat64(8*(n>>3),g.timeStamp,!0);var p=n>>2;z.setInt32(4*(p+2),g.location,!0);m[n+12]=g.ctrlKey;m[n+13]=g.shiftKey;m[n+14]=g.altKey;m[n+15]=g.metaKey;m[n+16]=g.repeat;z.setInt32(4*(p+5),g.charCode,!0);
z.setInt32(4*(p+6),g.keyCode,!0);z.setInt32(4*(p+7),g.which,!0);B(g.key||"",u,n+32,32);B(g.code||"",u,n+64,32);B(g.char||"",u,n+96,32);B(g.locale||"",u,n+128,32);U(d,e,n,b)&&g.preventDefault()},fj:c};return zd(a)},jg=(a,b,c)=>{z.setFloat64(8*(a>>3),b.timeStamp,!0);var d=a>>2;z.setInt32(4*(d+2),b.screenX,!0);z.setInt32(4*(d+3),b.screenY,!0);z.setInt32(4*(d+4),b.clientX,!0);z.setInt32(4*(d+5),b.clientY,!0);m[a+24]=b.ctrlKey;m[a+25]=b.shiftKey;m[a+26]=b.altKey;m[a+27]=b.metaKey;z.setInt16(2*(2*d+14),
b.button,!0);z.setInt16(2*(2*d+15),b.buttons,!0);z.setInt32(4*(d+8),b.movementX,!0);z.setInt32(4*(d+9),b.movementY,!0);a=Kd(c);z.setInt32(4*(d+10),b.clientX-(a.left|0),!0);z.setInt32(4*(d+11),b.clientY-(a.top|0),!0)},kg=(a,b,c,d,e,f)=>{Q.dk||(Q.dk=A(64));a=R(a);return zd({target:a,Vj:"mousemove"!=f&&"mouseenter"!=f&&"mouseleave"!=f,Zi:f,gj:d,ij:(g=event)=>{jg(Q.dk,g,a);U(d,e,Q.dk,b)&&g.preventDefault()},fj:c})},lg=(a,b,c,d,e)=>{Q.zk||(Q.zk=A(257));return zd({target:a,Zi:e,gj:d,ij:(f=event)=>{var g=
Q.zk,n=document.pointerLockElement||document.cj||document.kl||document.jl;m[g]=!!n;var p=n?.id||"";B(Ad(n),u,g+1,128);B(p,u,g+129,128);U(d,20,g,b)&&f.preventDefault()},fj:c})},mg=(a,b,c,d)=>{Q.Fk||(Q.Fk=A(36));a=R(a);return zd({target:a,Zi:"resize",gj:d,ij:(e=event)=>{if(e.target==a){var f=document.body;if(f){var g=Q.Fk;z.setInt32(4*(g>>2),0,!0);z.setInt32(4*(g+4>>2),f.clientWidth,!0);z.setInt32(4*(g+8>>2),f.clientHeight,!0);z.setInt32(4*(g+12>>2),innerWidth,!0);z.setInt32(4*(g+16>>2),innerHeight,
!0);z.setInt32(4*(g+20>>2),outerWidth,!0);z.setInt32(4*(g+24>>2),outerHeight,!0);z.setInt32(4*(g+28>>2),pageXOffset|0,!0);z.setInt32(4*(g+32>>2),pageYOffset|0,!0);U(d,10,g,b)&&e.preventDefault()}}},fj:c})},ng=(a,b,c,d,e,f)=>{Q.Ek||(Q.Ek=A(1552));a=R(a);return zd({target:a,Vj:"touchstart"==f||"touchend"==f,Zi:f,gj:d,ij:g=>{var n={},p=g.touches;for(var q of p)q.Vk=q.$k=0,n[q.identifier]=q;for(var r of g.changedTouches)r.Vk=1,n[r.identifier]=r;for(var t of g.targetTouches)n[t.identifier].$k=1;p=Q.Ek;
z.setFloat64(8*(p>>3),g.timeStamp,!0);m[p+12]=g.ctrlKey;m[p+13]=g.shiftKey;m[p+14]=g.altKey;m[p+15]=g.metaKey;q=p+16;r=Kd(a);t=0;for(let v of Object.values(n))if(n=q>>2,z.setInt32(4*n,v.identifier,!0),z.setInt32(4*(n+1),v.screenX,!0),z.setInt32(4*(n+2),v.screenY,!0),z.setInt32(4*(n+3),v.clientX,!0),z.setInt32(4*(n+4),v.clientY,!0),z.setInt32(4*(n+5),v.pageX,!0),z.setInt32(4*(n+6),v.pageY,!0),m[q+28]=v.Vk,m[q+29]=v.$k,z.setInt32(4*(n+8),v.clientX-(r.left|0),!0),z.setInt32(4*(n+9),v.clientY-(r.top|
0),!0),q+=48,31<++t)break;z.setInt32(4*(p+8>>2),t,!0);U(d,e,p,b)&&g.preventDefault()},fj:c})},og=(a,b,c)=>{var d=Cd[1];Q.Hk||(Q.Hk=A(8));return zd({target:d,Zi:"visibilitychange",gj:c,ij:(e=event)=>{var f=Q.Hk,g=["hidden","visible","prerender","unloaded"].indexOf(document.visibilityState);m[f]=document.hidden;z.setInt32(4*(f+4>>2),g,!0);U(c,21,f,a)&&e.preventDefault()},fj:b})},pg=(a,b,c,d)=>{Q.Ik||(Q.Ik=A(96));return zd({target:a,Vj:!0,Zi:"wheel",gj:d,ij:(e=event)=>{var f=Q.Ik;jg(f,e,a);z.setFloat64(8*
(f+64>>3),e.deltaX,!0);z.setFloat64(8*(f+72>>3),e.deltaY,!0);z.setFloat64(8*(f+80>>3),e.deltaZ,!0);z.setInt32(4*(f+88>>2),e.deltaMode,!0);U(d,9,f,b)&&e.preventDefault()},fj:c})};class qg{constructor(){this.wj=[void 0];this.cj=[]}get(a){return this.wj[a]}has(a){return void 0!==this.wj[a]}Dj(a){var b=this.cj.pop()||this.wj.length;this.wj[b]=a;return b}}var rg;
function sg(a,b,c,d,e){function f(){var K=0,na=0;y.response&&db&&0===z.getUint32(4*(a+12>>2),!0)&&(na=y.response.byteLength);0<na&&(K=A(na),u.set(new Uint8Array(y.response),K));z.setUint32(4*(a+12>>2),K,!0);ef(a+16,na);ef(a+24,0);(K=y.response?y.response.byteLength:0)&&ef(a+32,K);z.setInt16(2*(a+40>>1),y.readyState,!0);z.setInt16(2*(a+42>>1),y.status,!0);y.statusText&&B(y.statusText,u,a+44,64)}var g=z.getUint32(4*(a+8>>2),!0);if(g){var n=g?C(u,g):"",p=a+108,q=Xb(p+0);q||="GET";var r=z.getUint32(4*
(p+56>>2),!0),t=z.getUint32(4*(p+68>>2),!0),v=z.getUint32(4*(p+72>>2),!0);g=z.getUint32(4*(p+76>>2),!0);var J=z.getUint32(4*(p+80>>2),!0),oa=z.getUint32(4*(p+84>>2),!0),Fa=z.getUint32(4*(p+88>>2),!0),sa=z.getUint32(4*(p+52>>2),!0),db=!!(sa&1),Ib=!!(sa&2);sa=!!(sa&64);t=t?t?C(u,t):"":void 0;v=v?v?C(u,v):"":void 0;var y=new XMLHttpRequest;y.withCredentials=!!u[p+60];y.open(q,n,!sa,t,v);sa||(y.timeout=r);y.cj=n;y.responseType="arraybuffer";J&&(n=J?C(u,J):"",y.overrideMimeType(n));if(g)for(;;){p=z.getUint32(4*
(g>>2),!0);if(!p)break;n=z.getUint32(4*(g+4>>2),!0);if(!n)break;g+=8;p=p?C(u,p):"";n=n?C(u,n):"";y.setRequestHeader(p,n)}var ta=rg.Dj(y);z.setUint32(4*(a>>2),ta,!0);g=oa&&Fa?u.slice(oa,oa+Fa):null;y.onload=K=>{rg.has(ta)&&(f(),200<=y.status&&300>y.status?b?.(a,y,K):c?.(a,y,K))};y.onerror=K=>{rg.has(ta)&&(f(),c?.(a,y,K))};y.ontimeout=K=>{rg.has(ta)&&c?.(a,y,K)};y.onprogress=K=>{if(rg.has(ta)){var na=db&&Ib&&y.response?y.response.byteLength:0,gb=0;0<na&&db&&Ib&&(gb=A(na),u.set(new Uint8Array(y.response),
gb));z.setUint32(4*(a+12>>2),gb,!0);ef(a+16,na);ef(a+24,K.loaded-na);ef(a+32,K.total);z.setInt16(2*(a+40>>1),y.readyState,!0);3<=y.readyState&&0===y.status&&0<K.loaded&&(y.status=200);z.setInt16(2*(a+42>>1),y.status,!0);y.statusText&&B(y.statusText,u,a+44,64);d?.(a,y,K);gb&&ie(gb)}};y.onreadystatechange=K=>{rg.has(ta)&&(z.setInt16(2*(a+40>>1),y.readyState,!0),2<=y.readyState&&z.setInt16(2*(a+42>>1),y.status,!0),e?.(a,y,K))};try{y.send(g)}catch(K){c?.(a,y,K)}}else c(a,0,"no url specified!")}
var tg={},vg=()=>{if(!ug){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ka||"./this.program"},b;for(b in tg)void 0===tg[b]?delete a[b]:a[b]=tg[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);ug=c}return ug},ug,ha,fa=(a,b,c=[])=>{a=a.replace(/p/g,"i");return(0,h["dynCall_"+a])(b,...c)},wg=k.Ok,xg=k.Nk,yg=k.tj;k.pl=Eb;
[44].forEach(a=>{k.rk[a]=new k.Qi(a);k.rk[a].stack="<generic error, no stack>"});k.qj=Array(4096);k.Ui(E,{},"/");k.$i("/tmp");k.$i("/home");k.$i("/home/web_user");(function(){k.$i("/dev");rb(k.Hj(1,3),{read:()=>0,write:(d,e,f,g)=>g});Tb("/dev/null",k.Hj(1,3));qb(k.Hj(5,0),tb);qb(k.Hj(6,0),ub);Tb("/dev/tty",k.Hj(5,0));Tb("/dev/tty1",k.Hj(6,0));var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(b=jb(a).byteLength);return a[--b]};k.tj("/dev","random",c);k.tj("/dev","urandom",c);k.$i("/dev/shm");k.$i("/dev/shm/tmp")})();
(function(){k.$i("/proc");var a=k.$i("/proc/self");k.$i("/proc/self/fd");k.Ui({Ui(){var b=k.createNode(a,"fd",16895,73);b.Ri={Gj(c,d){var e=H(+d);c={parent:null,Ui:{Qj:"fake"},Ri:{Kj:()=>e.path}};return c.parent=c}};return b}},{},"/proc/self/fd")})();k.Al={MEMFS:E,IDBFS:l};h.FS_createPath=k.Ok;h.FS_createDataFile=k.ik;h.FS_createPreloadedFile=k.pl;h.FS_unlink=k.lj;h.FS_createLazyFile=k.Nk;h.FS_createDevice=k.tj;
h.requestFullscreen=function(a,b){function c(){ic=!1;var f=d.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===f?(d.exitFullscreen=qc,oc&&d.requestPointerLock(),ic=!0,pc?("undefined"!=typeof SDL&&(f=z.getUint32(4*(SDL.screen>>2),!0),z.setInt32(4*(SDL.screen>>2),f|8388608,!0)),tc(h.canvas),sc()):tc(d)):(f.parentNode.insertBefore(d,f),f.parentNode.removeChild(f),pc?("undefined"!=
typeof SDL&&(f=z.getUint32(4*(SDL.screen>>2),!0),z.setInt32(4*(SDL.screen>>2),f&-8388609,!0)),tc(h.canvas),sc()):tc(d));h.onFullScreen?.(ic);h.onFullscreen?.(ic)}oc=a;pc=b;"undefined"==typeof oc&&(oc=!0);"undefined"==typeof pc&&(pc=!1);var d=h.canvas;nc||(nc=!0,document.addEventListener("fullscreenchange",c,!1),document.addEventListener("mozfullscreenchange",c,!1),document.addEventListener("webkitfullscreenchange",c,!1),document.addEventListener("MSFullscreenChange",c,!1));var e=document.createElement("div");
d.parentNode.insertBefore(e,d);e.appendChild(d);e.requestFullscreen=e.requestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen||(e.webkitRequestFullscreen?()=>e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(e.webkitRequestFullScreen?()=>e.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null);e.requestFullscreen()};h.setCanvasSize=function(a,b,c){tc(h.canvas,a,b);c||sc()};
h.getUserMedia=function(a){let b;(b=window).getUserMedia||(b.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia);window.getUserMedia(a)};h.createContext=function(a,b,c,d){if(b&&h.mj&&a==h.canvas)return h.mj;var e;if(b){var f={antialias:!1,alpha:!1,xk:2};if(d)for(var g in d)f[g]=d[g];if("undefined"!=typeof Uc&&(e=Rc(a,f)))var n=Gc[e].Cj}else n=a.getContext("2d");if(!n)return null;c&&(h.mj=n,b&&Tc(e),kc.forEach(p=>p()),Cb());return n};h.requestAnimationFrame=qd;h.pauseMainLoop=nd;
h.resumeMainLoop=od;h.preMainLoop&&jd.push(h.preMainLoop);h.postMainLoop&&kd.push(h.postMainLoop);for(var zg=0;32>zg;++zg)Qe.push(Array(zg));rg=new qg;
var Lg={H:function(a,b,c){bb=c;try{var d=H(a);switch(b){case 0:var e=ab();if(0>e)break;for(;k.streams[e];)e++;return Rb(d,e).fd;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=ab(),d.flags|=e,0;case 12:return e=ab(),z.setInt16(2*(e+0>>1),2,!0),0;case 13:case 14:return 0}return-28}catch(f){if("undefined"==typeof k||"ErrnoError"!==f.name)throw f;return-f.Xi}},ge:function(a,b){try{var c=H(a);return Zb(k.stat,c.path,b)}catch(d){if("undefined"==typeof k||"ErrnoError"!==d.name)throw d;return-d.Xi}},
qd:function(a,b,c){try{var d=H(a);d.Ej||(d.Ej=k.Aj(d.path));a=0;for(var e=k.ej(d,0,1),f=Math.floor(e/280);f<d.Ej.length&&a+280<=c;){var g=d.Ej[f];if("."===g){var n=d.node.id;var p=4}else if(".."===g)n=G(d.path,{parent:!0}).node.id,p=4;else{var q=yb(d.node,g);n=q.id;p=8192===(q.mode&61440)?2:F(q.mode)?4:40960===(q.mode&61440)?10:8}x[b+a>>3]=BigInt(n);x[b+a+8>>3]=BigInt(280*(f+1));z.setInt16(2*(b+a+16>>1),280,!0);m[b+a+18]=p;B(g,u,b+a+19,256);a+=280;f+=1}k.ej(d,280*f,0);return a}catch(r){if("undefined"==
typeof k||"ErrnoError"!==r.name)throw r;return-r.Xi}},rg:function(a,b,c){bb=c;try{var d=H(a);switch(b){case 21509:return d.Vi?0:-59;case 21505:if(!d.Vi)return-59;if(d.Vi.uj.Ml){a=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var e=ab();z.setInt32(4*(e>>2),25856,!0);z.setInt32(4*(e+4>>2),5,!0);z.setInt32(4*(e+8>>2),191,!0);z.setInt32(4*(e+12>>2),35387,!0);for(var f=0;32>f;f++)m[e+f+17]=a[f]||0}return 0;case 21510:case 21511:case 21512:return d.Vi?0:-59;case 21506:case 21507:case 21508:if(!d.Vi)return-59;
if(d.Vi.uj.Nl)for(e=ab(),z.getInt32(4*(e>>2),!0),z.getInt32(4*(e+4>>2),!0),z.getInt32(4*(e+8>>2),!0),z.getInt32(4*(e+12>>2),!0),a=[],f=0;32>f;f++)a.push(m[e+f+17]);return 0;case 21519:if(!d.Vi)return-59;e=ab();z.setInt32(4*(e>>2),0,!0);return 0;case 21520:return d.Vi?-28:-59;case 21531:return e=ab(),k.uk(d,b,e);case 21523:if(!d.Vi)return-59;d.Vi.uj.Ol&&(f=[24,80],e=ab(),z.setInt16(2*(e>>1),f[0],!0),z.setInt16(2*(e+2>>1),f[1],!0));return 0;case 21524:return d.Vi?0:-59;case 21515:return d.Vi?0:-59;
default:return-28}}catch(g){if("undefined"==typeof k||"ErrnoError"!==g.name)throw g;return-g.Xi}},Bd:function(a,b){try{return a=a?C(u,a):"",Zb(k.Zk,a,b)}catch(c){if("undefined"==typeof k||"ErrnoError"!==c.name)throw c;return-c.Xi}},fd:function(a,b,c){try{return b=b?C(u,b):"",b=Yb(a,b),b=D(b),"/"===b[b.length-1]&&(b=b.substr(0,b.length-1)),k.$i(b,c,0),0}catch(d){if("undefined"==typeof k||"ErrnoError"!==d.name)throw d;return-d.Xi}},Md:function(a,b,c,d){try{b=b?C(u,b):"";var e=d&256;b=Yb(a,b,d&4096);
return Zb(e?k.Zk:k.stat,b,c)}catch(f){if("undefined"==typeof k||"ErrnoError"!==f.name)throw f;return-f.Xi}},wa:function(a,b,c,d){bb=d;try{b=b?C(u,b):"";b=Yb(a,b);var e=d?ab():0;return k.open(b,c,e).fd}catch(f){if("undefined"==typeof k||"ErrnoError"!==f.name)throw f;return-f.Xi}},Xd:function(a,b){try{return a=a?C(u,a):"",Zb(k.stat,a,b)}catch(c){if("undefined"==typeof k||"ErrnoError"!==c.name)throw c;return-c.Xi}},Kc:function(a,b,c){try{return b=b?C(u,b):"",b=Yb(a,b),0===c?k.lj(b):512===c?k.vj(b):Na("Invalid flags passed to unlinkat"),
0}catch(d){if("undefined"==typeof k||"ErrnoError"!==d.name)throw d;return-d.Xi}},Wg:()=>{Na("")},Db:function(a){if(rg.has(a)){var b=rg.get(a),c=rg;c.wj[a]=void 0;c.cj.push(a);0<b.readyState&&4>b.readyState&&b.abort()}},Cf:()=>1,Cb:()=>{throw Infinity;},re:function(a,b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);z.setInt32(4*(b>>2),a.getSeconds(),!0);z.setInt32(4*(b+4>>2),a.getMinutes(),!0);z.setInt32(4*(b+8>>2),a.getHours(),!0);z.setInt32(4*(b+12>>2),a.getDate(),!0);
z.setInt32(4*(b+16>>2),a.getMonth(),!0);z.setInt32(4*(b+20>>2),a.getFullYear()-1900,!0);z.setInt32(4*(b+24>>2),a.getDay(),!0);var c=a.getFullYear();z.setInt32(4*(b+28>>2),(0!==c%4||0===c%100&&0!==c%400?ac:$b)[a.getMonth()]+a.getDate()-1|0,!0);z.setInt32(4*(b+36>>2),-(60*a.getTimezoneOffset()),!0);c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();z.setInt32(4*(b+32>>2),(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0,!0)},Bf:function(a,b,
c,d,e,f,g){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{if(isNaN(e))return 61;var n=H(d),p=k.Ij(n,a,e,b,c),q=p.bl;z.setInt32(4*(f>>2),p.wj,!0);z.setUint32(4*(g>>2),q,!0);return 0}catch(r){if("undefined"==typeof k||"ErrnoError"!==r.name)throw r;return-r.Xi}},Nf:function(a,b,c,d,e,f){f=-9007199254740992>f||9007199254740992<f?NaN:Number(f);try{var g=H(e);if(c&2){c=f;if(!k.isFile(g.node.mode))throw new k.Qi(43);d&2||k.Nj(g,u.slice(a,a+b),c,b,d)}}catch(n){if("undefined"==typeof k||"ErrnoError"!==
n.name)throw n;return-n.Xi}},Ce:(a,b,c,d)=>{var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();z.setUint32(4*(a>>2),60*Math.max(f,e),!0);z.setInt32(4*(b>>2),Number(f!=e),!0);b=g=>{var n=Math.abs(g);return`UTC${0<=g?"-":"+"}${String(Math.floor(n/60)).padStart(2,"0")}${String(n%60).padStart(2,"0")}`};a=b(f);b=b(e);e<f?(B(a,u,c,17),B(b,u,d,17)):(B(a,u,d,17),B(b,u,c,17))},Uc:a=>{if(12448==a)return I=12288,1;I=12300;return 0},ed:(a,b,c,d,e)=>
{if(62E3!=a)I=12296,c=0;else{if(b)for(;;){a=z.getInt32(4*(b>>2),!0);if(12321==a)a=z.getInt32(4*(b+4>>2),!0),L.alpha=0<a;else if(12325==a)a=z.getInt32(4*(b+4>>2),!0),L.depth=0<a;else if(12326==a)a=z.getInt32(4*(b+4>>2),!0),L.stencil=0<a;else if(12337==a)a=z.getInt32(4*(b+4>>2),!0),L.antialias=0<a;else if(12338==a)a=z.getInt32(4*(b+4>>2),!0),L.antialias=1==a;else if(12544==a)a=z.getInt32(4*(b+4>>2),!0),L.Em=12547!=a;else if(12344==a)break;b+=8}c&&d||e?(e&&z.setInt32(4*(e>>2),1,!0),c&&0<d&&z.setUint32(4*
(c>>2),62002,!0),I=12288,c=1):(I=12300,c=0)}return c},cd:(a,b,c,d)=>{if(62E3!=a)return I=12296,0;for(a=1;;){b=z.getInt32(4*(d>>2),!0);if(12440==b)a=z.getInt32(4*(d+4>>2),!0);else if(12344==b)break;else return I=12292,0;d+=8}if(2>a||3<a)return I=12293,0;L.xk=a-1;L.Gm=0;zc=Rc(h.canvas,L);if(0!=zc)return I=12288,Tc(zc),kc.forEach(e=>e()),Tc(null),62004;I=12297;return 0},ad:(a,b)=>{if(62E3!=a)return I=12296,0;if(62002!=b)return I=12293,0;I=12288;return 62006},bd:(a,b)=>{if(62E3!=a)return I=12296,0;if(62004!=
b)return I=12294,0;a=zc;Sc===Gc[a]&&(Sc=null);"object"==typeof Q&&Q.Yl(Gc[a].Cj.canvas);Gc[a]&&Gc[a].Cj.canvas&&(Gc[a].Cj.canvas.Pj=void 0);Gc[a]=null;I=12288;vc==b&&(vc=0);return 1},$c:(a,b)=>{if(62E3!=a)return I=12296,0;if(62006!=b)return I=12301,1;wc==b&&(wc=0);xc==b&&(xc=0);I=12288;return 1},dd:(a,b,c,d)=>{if(62E3!=a)return I=12296,0;if(62002!=b)return I=12293,0;if(!d)return I=12300,0;I=12288;switch(c){case 12320:return z.setInt32(4*(d>>2),L.alpha?32:24,!0),1;case 12321:return z.setInt32(4*(d>>
2),L.alpha?8:0,!0),1;case 12322:return z.setInt32(4*(d>>2),8,!0),1;case 12323:return z.setInt32(4*(d>>2),8,!0),1;case 12324:return z.setInt32(4*(d>>2),8,!0),1;case 12325:return z.setInt32(4*(d>>2),L.depth?24:0,!0),1;case 12326:return z.setInt32(4*(d>>2),L.stencil?8:0,!0),1;case 12327:return z.setInt32(4*(d>>2),12344,!0),1;case 12328:return z.setInt32(4*(d>>2),62002,!0),1;case 12329:return z.setInt32(4*(d>>2),0,!0),1;case 12330:return z.setInt32(4*(d>>2),4096,!0),1;case 12331:return z.setInt32(4*(d>>
2),16777216,!0),1;case 12332:return z.setInt32(4*(d>>2),4096,!0),1;case 12333:return z.setInt32(4*(d>>2),0,!0),1;case 12334:return z.setInt32(4*(d>>2),0,!0),1;case 12335:return z.setInt32(4*(d>>2),12344,!0),1;case 12337:return z.setInt32(4*(d>>2),L.antialias?4:0,!0),1;case 12338:return z.setInt32(4*(d>>2),L.antialias?1:0,!0),1;case 12339:return z.setInt32(4*(d>>2),4,!0),1;case 12340:return z.setInt32(4*(d>>2),12344,!0),1;case 12341:case 12342:case 12343:return z.setInt32(4*(d>>2),-1,!0),1;case 12345:case 12346:return z.setInt32(4*
(d>>2),0,!0),1;case 12347:return z.setInt32(4*(d>>2),0,!0),1;case 12348:return z.setInt32(4*(d>>2),1,!0),1;case 12349:case 12350:return z.setInt32(4*(d>>2),0,!0),1;case 12351:return z.setInt32(4*(d>>2),12430,!0),1;case 12352:return z.setInt32(4*(d>>2),4,!0),1;case 12354:return z.setInt32(4*(d>>2),0,!0),1;default:return I=12292,0}},id:a=>{I=12288;return 0!=a&&1!=a?0:62E3},Sc:()=>I,hd:(a,b,c)=>{if(62E3!=a)return I=12296,0;b&&z.setInt32(4*(b>>2),1,!0);c&&z.setInt32(4*(c>>2),4,!0);uc=!0;I=12288;return 1},
_c:(a,b,c,d)=>{if(62E3!=a)return I=12296,0;if(0!=d&&62004!=d)return I=12294,0;if(0!=c&&62006!=c||0!=b&&62006!=b)return I=12301,0;Tc(d?zc:null);vc=d;xc=b;wc=c;I=12288;return 1},Tc:(a,b)=>{if(62E3!=a)return I=12296,0;I=12288;if(yc[b])return yc[b];switch(b){case 12371:a=Vc("Emscripten");break;case 12372:a=Vc("1.4 Emscripten EGL");break;case 12373:a=Vc("");break;case 12429:a=Vc("OpenGL_ES");break;default:return I=12300,0}return yc[b]=a},Zc:()=>{if(uc)if(h.mj)if(h.mj.isContextLost())I=12302;else return I=
12288,1;else I=12290;else I=12289;return 0},Yc:(a,b)=>{if(62E3!=a)return I=12296,0;0==b?ld(0,0):ld(1,b);I=12288;return 1},gd:a=>{if(62E3!=a)return I=12296,0;xc=wc=vc=0;uc=!1;I=12288;return 1},Vc:()=>{I=12288;return 1},Xc:()=>{I=12288;return 1},B:(a,b,c)=>{b=td(b,c);return Wa[a](...b)},d:(a,b,c)=>{b=td(b,c);return Wa[a](...b)},$b:(a,b,c)=>{b=td(b,c);return Wa[a](...b)},ta:()=>{nd();Xc=null},I:()=>Date.now(),Mc:()=>{if(!Q.fullscreenEnabled())return-1;wd(Ld);var a=Cd[1];if(a.exitFullscreen)a.fullscreenElement&&
a.exitFullscreen();else if(a.webkitExitFullscreen)a.webkitFullscreenElement&&a.webkitExitFullscreen();else return-1;return 0},Qc:()=>{wd(Md);if(document.exitPointerLock)document.exitPointerLock();else return-1;return 0},Yf:(a,b)=>{if(!va)if(0===X){X=1;var c=a+20;ee(c);W=c;ge(c);c=S();z.setUint32(4*(a+8>>2),c,!0);Td=b}else X=0,he(),W=null},r:()=>devicePixelRatio,j:(a,b,c)=>{a=R(a);if(!a)return-4;a=Kd(a);z.setFloat64(8*(b>>3),a.width,!0);z.setFloat64(8*(c>>3),a.height,!0);return 0},Z:(a,b)=>{if(0>a||
a>=Q.Zj.length)return-5;if(!Q.Zj[a])return-7;je(b,Q.Zj[a]);return 0},qf:()=>2147483648,F:()=>performance.now(),Pc:()=>Q.Zj.length,Rc:(a,b)=>{z.setInt32(4*(a>>2),screen.width,!0);z.setInt32(4*(b>>2),screen.height,!0)},ib:ke,hb:le,df:(a,b)=>{M.beginQuery(a,P[b])},zb:(a,b)=>{M.yj.beginQueryEXT(a,P[b])},Me:a=>M.beginTransformFeedback(a),gb:me,fb:ne,Je:(a,b,c)=>{M.bindBufferBase(a,b,Bc[c])},Ke:(a,b,c,d,e)=>{M.bindBufferRange(a,b,Bc[c],d,e)},eb:oe,db:(a,b)=>{M.bindRenderbuffer(a,Dc[b])},Nd:(a,b)=>{M.bindSampler(a,
Hc[b])},cb:pe,Ed:(a,b)=>{M.bindTransformFeedback(a,Ic[b])},Re:qe,rb:qe,bb:(a,b,c,d)=>M.blendColor(a,b,c,d),$a:a=>M.blendEquation(a),_a:re,Za:(a,b)=>M.blendFunc(a,b),Ya:se,Ue:te,Xa:ue,Wa:ve,Va:a=>M.checkFramebufferStatus(a),Ua:we,ke:(a,b,c,d)=>M.clearBufferfi(a,b,c,d),le:(a,b,c)=>{M.clearBufferfv(a,b,w,c>>2)},ne:(a,b,c)=>{M.clearBufferiv(a,b,za,c>>2)},me:(a,b,c)=>{M.clearBufferuiv(a,b,Aa,c>>2)},Ta:xe,Sa:ye,Ra:a=>M.clearStencil(a),Wd:(a,b,c)=>{c=Number(c);return M.clientWaitSync(Jc[a],b,c)},vf:(a,b)=>
{M.um.clipControlEXT(a,b)},Qa:(a,b,c,d)=>{M.colorMask(!!a,!!b,!!c,!!d)},Pa:ze,Oa:(a,b,c,d,e,f,g,n)=>{M.nj||!g?M.compressedTexImage2D(a,b,c,d,e,f,g,n):M.compressedTexImage2D(a,b,c,d,e,f,u,n,g)},jf:(a,b,c,d,e,f,g,n,p)=>{M.nj?M.compressedTexImage3D(a,b,c,d,e,f,g,n,p):M.compressedTexImage3D(a,b,c,d,e,f,g,u,p,n)},Na:Ae,hf:(a,b,c,d,e,f,g,n,p,q,r)=>{M.nj?M.compressedTexSubImage3D(a,b,c,d,e,f,g,n,p,q,r):M.compressedTexSubImage3D(a,b,c,d,e,f,g,n,p,u,r,q)},ie:(a,b,c,d,e)=>M.copyBufferSubData(a,b,c,d,e),Ma:(a,
b,c,d,e,f,g,n)=>M.copyTexImage2D(a,b,c,d,e,f,g,n),La:(a,b,c,d,e,f,g,n)=>M.copyTexSubImage2D(a,b,c,d,e,f,g,n),kf:(a,b,c,d,e,f,g,n,p)=>M.copyTexSubImage3D(a,b,c,d,e,f,g,n,p),Ka:Be,Ja:Ce,Ia:De,Ha:Ee,Ga:Fe,Fa:Ge,ff:(a,b)=>{for(var c=0;c<a;c++){var d=z.getInt32(4*(b+4*c>>2),!0),e=P[d];e&&(M.deleteQuery(e),P[d]=null)}},Ib:(a,b)=>{for(var c=0;c<a;c++){var d=z.getInt32(4*(b+4*c>>2),!0),e=P[d];e&&(M.yj.deleteQueryEXT(e),P[d]=null)}},Ea:(a,b)=>{for(var c=0;c<a;c++){var d=z.getInt32(4*(b+4*c>>2),!0),e=Dc[d];
e&&(M.deleteRenderbuffer(e),e.name=0,Dc[d]=null)}},Pd:(a,b)=>{for(var c=0;c<a;c++){var d=z.getInt32(4*(b+4*c>>2),!0),e=Hc[d];e&&(M.deleteSampler(e),e.name=0,Hc[d]=null)}},Da:He,Yd:a=>{if(a){var b=Jc[a];b&&(M.deleteSync(b),b.name=0,Jc[a]=null)}},Ca:Ie,Dd:(a,b)=>{for(var c=0;c<a;c++){var d=z.getInt32(4*(b+4*c>>2),!0),e=Ic[d];e&&(M.deleteTransformFeedback(e),e.name=0,Ic[d]=null)}},Qe:Je,qb:Je,Ba:Ke,Aa:Le,za:(a,b)=>M.depthRange(a,b),ya:(a,b)=>{M.detachShader(N[a],O[b])},zh:Me,yh:Ne,xh:Oe,ae:Pe,mb:Pe,
ld:Pe,sf:Pe,md:Pe,$e:Re,pf:Re,nb:Re,wh:Se,$d:Te,kb:Te,jd:Te,kd:Te,rf:Te,nf:(a,b,c,d,e,f)=>{M.drawElements(a,d,e,f)},vh:Ue,uh:Ve,cf:a=>M.endQuery(a),yb:a=>{M.yj.endQueryEXT(a)},Le:()=>M.endTransformFeedback(),_d:(a,b)=>(a=M.fenceSync(a,b))?(b=Oc(Jc),a.name=b,Jc[b]=a,b):0,th:()=>M.finish(),sh:()=>M.flush(),rh:(a,b,c,d)=>{M.framebufferRenderbuffer(a,b,c,Dc[d])},qh:We,Se:(a,b,c,d,e)=>{M.framebufferTextureLayer(a,b,Ec[c],d,e)},ph:Xe,oh:Ye,mh:Ze,gf:(a,b)=>{Pc(a,b,"createQuery",P)},Sb:(a,b)=>{for(var c=
0;c<a;c++){var d=M.yj.createQueryEXT();if(!d){for(;c<a;)d=4*(b+4*c++>>2),z.setInt32(d,0,!0);break}var e=Oc(P);d.name=e;P[e]=d;z.setInt32(4*(b+4*c>>2),e,!0)}},lh:(a,b)=>{Pc(a,b,"createRenderbuffer",Dc)},Qd:(a,b)=>{Pc(a,b,"createSampler",Hc)},kh:$e,Cd:(a,b)=>{Pc(a,b,"createTransformFeedback",Ic)},Pe:af,pb:af,nh:bf,jh:(a,b,c,d,e,f,g)=>{cf("getActiveAttrib",a,b,c,d,e,f,g)},ih:df,ce:(a,b,c,d,e)=>{a=N[a];if(a=M.getActiveUniformBlockName(a,b))e&&0<c?(c=B(a,u,e,c),d&&z.setInt32(4*(d>>2),c,!0)):d&&z.setInt32(4*
(d>>2),0,!0)},de:(a,b,c,d)=>{a=N[a];if(35393==c)z.setInt32(4*(d>>2),M.getActiveUniformBlockName(a,b).length+1,!0);else if(a=M.getActiveUniformBlockParameter(a,b,c),null!==a)if(35395==c)for(c=0;c<a.length;c++)z.setInt32(4*(d+4*c>>2),a[c],!0);else z.setInt32(4*(d>>2),a,!0)},fe:(a,b,c,d,e)=>{a=N[a];for(var f=[],g=0;g<b;g++)f.push(z.getInt32(4*(c+4*g>>2),!0));if(a=M.getActiveUniforms(a,f,d))for(b=a.length,g=0;g<b;g++)z.setInt32(4*(e+4*g>>2),a[g],!0)},hh:(a,b,c,d)=>{a=M.getAttachedShaders(N[a]);var e=
a.length;e>b&&(e=b);z.setInt32(4*(c>>2),e,!0);for(b=0;b<e;++b)z.setInt32(4*(d+4*b>>2),O.indexOf(a[b]),!0)},gh:(a,b)=>M.getAttribLocation(N[a],b?C(u,b):""),eh:(a,b)=>hf(a,b,4),Rd:(a,b,c)=>{ef(c,M.getBufferParameter(a,b))},dh:(a,b,c)=>{c&&z.setInt32(4*(c>>2),M.getBufferParameter(a,b),!0)},ch:()=>M.getError(),bh:(a,b)=>hf(a,b,2),xe:(a,b)=>M.getFragDataLocation(N[a],b?C(u,b):""),ah:(a,b,c,d)=>{a=M.getFramebufferAttachmentParameter(a,b,c);if(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)a=
a.name|0;z.setInt32(4*(d>>2),a,!0)},Sd:(a,b,c)=>jf(a,b,c,1),Ud:(a,b)=>{hf(a,b,1)},Ne:(a,b,c)=>jf(a,b,c,0),$g:kf,pd:(a,b,c,d,e)=>{a=M.getInternalformatParameter(a,b,c);if(null!==a)for(b=0;b<a.length&&b<d;++b)z.setInt32(4*(e+4*b>>2),a[b],!0)},xd:()=>{},Zg:lf,_g:mf,tb:nf,vb:of,sb:nf,af:(a,b,c)=>{a=M.getQueryParameter(P[a],b);var d;"boolean"==typeof a?d=a?1:0:d=a;z.setInt32(4*(c>>2),d,!0)},ub:of,bf:(a,b,c)=>{z.setInt32(4*(c>>2),M.getQuery(a,b),!0)},wb:(a,b,c)=>{c&&(a=M.yj.getQueryEXT(a,b),z.setInt32(4*
(c>>2),a,!0))},Yg:(a,b,c)=>{c&&z.setInt32(4*(c>>2),M.getRenderbufferParameter(a,b),!0)},Gd:(a,b,c)=>{z.setFloat32(4*(c>>2),M.getSamplerParameter(Hc[a],b),!0)},Hd:(a,b,c)=>{z.setInt32(4*(c>>2),M.getSamplerParameter(Hc[a],b),!0)},Vg:pf,Ug:(a,b,c,d)=>{a=M.getShaderPrecisionFormat(a,b);z.setInt32(4*(c>>2),a.rangeMin,!0);z.setInt32(4*(c+4>>2),a.rangeMax,!0);z.setInt32(4*(d>>2),a.precision,!0)},Tg:(a,b,c,d)=>{if(a=M.getShaderSource(O[a]))b=0<b&&d?B(a,u,d,b):0,c&&z.setInt32(4*(c>>2),b,!0)},Xg:qf,Sg:rf,je:sf,
Td:(a,b,c,d,e)=>{a=M.getSyncParameter(Jc[a],b);null!==a&&(z.setInt32(4*(e>>2),a,!0),d&&z.setInt32(4*(d>>2),1,!0))},Rg:(a,b,c)=>{c&&z.setFloat32(4*(c>>2),M.getTexParameter(a,b),!0)},Qg:(a,b,c)=>{c&&z.setInt32(4*(c>>2),M.getTexParameter(a,b),!0)},He:(a,b,c,d,e,f,g)=>{a=N[a];if(a=M.getTransformFeedbackVarying(a,b))g&&0<c?(c=B(a.name,u,g,c),d&&z.setInt32(4*(d>>2),c,!0)):d&&z.setInt32(4*(d>>2),0,!0),e&&z.setInt32(4*(e>>2),a.size,!0),f&&z.setInt32(4*(f>>2),a.type,!0)},ee:(a,b)=>M.getUniformBlockIndex(N[a],
b?C(u,b):""),he:(a,b,c,d)=>{a=N[a];for(var e=[],f=0;f<b;f++)e.push(Xb(z.getInt32(4*(c+4*f>>2),!0)));if(a=M.getUniformIndices(a,e))for(b=a.length,f=0;f<b;f++)z.setInt32(4*(d+4*f>>2),a[f],!0)},Ng:vf,Pg:xf,Og:yf,ye:(a,b,c)=>wf(a,b,c,0),Fe:Af,Ee:Af,Kg:(a,b,c)=>{c&&z.setInt32(4*(c>>2),M.getVertexAttribOffset(a,b),!0)},Mg:(a,b,c)=>{zf(a,b,c,2)},Lg:(a,b,c)=>{zf(a,b,c,5)},Jg:(a,b)=>M.hint(a,b),ud:(a,b,c)=>{for(var d=Qe[b],e=0;e<b;e++)d[e]=z.getInt32(4*(c+4*e>>2),!0);M.invalidateFramebuffer(a,d)},td:(a,b,
c,d,e,f,g)=>{for(var n=Qe[b],p=0;p<b;p++)n[p]=z.getInt32(4*(c+4*p>>2),!0);M.invalidateSubFramebuffer(a,n,d,e,f,g)},Ig:a=>(a=Bc[a])?M.isBuffer(a):0,Hg:a=>M.isEnabled(a),Gg:a=>(a=Cc[a])?M.isFramebuffer(a):0,Fg:a=>(a=N[a])?M.isProgram(a):0,ef:a=>(a=P[a])?M.isQuery(a):0,Bb:a=>(a=P[a])?M.yj.isQueryEXT(a):0,Eg:a=>(a=Dc[a])?M.isRenderbuffer(a):0,Od:a=>(a=Hc[a])?M.isSampler(a):0,Dg:a=>(a=O[a])?M.isShader(a):0,Zd:a=>M.isSync(Jc[a]),Cg:a=>(a=Ec[a])?M.isTexture(a):0,Ad:a=>M.isTransformFeedback(Ic[a]),Oe:Bf,
ob:Bf,Bg:a=>M.lineWidth(a),Ag:Cf,zd:()=>M.pauseTransformFeedback(),zg:Df,uf:(a,b)=>{M.Lm.polygonModeWEBGL(a,b)},yg:(a,b)=>M.polygonOffset(a,b),wf:(a,b,c)=>{M.vm.polygonOffsetClampEXT(a,b,c)},wd:()=>{},vd:()=>{},xb:(a,b)=>{M.yj.queryCounterEXT(P[a],b)},of:Ef,xg:Hf,wg:()=>{},vg:(a,b,c,d)=>M.renderbufferStorage(a,b,c,d),Te:(a,b,c,d,e)=>M.renderbufferStorageMultisample(a,b,c,d,e),yd:()=>M.resumeTransformFeedback(),ug:(a,b)=>{M.sampleCoverage(a,!!b)},Jd:(a,b,c)=>{M.samplerParameterf(Hc[a],b,c)},Id:(a,
b,c)=>{c=z.getFloat32(4*(c>>2),!0);M.samplerParameterf(Hc[a],b,c)},Ld:(a,b,c)=>{M.samplerParameteri(Hc[a],b,c)},Kd:(a,b,c)=>{c=z.getInt32(4*(c>>2),!0);M.samplerParameteri(Hc[a],b,c)},tg:If,sg:()=>{},qg:Jf,pg:(a,b,c)=>M.stencilFunc(a,b,c),og:(a,b,c,d)=>M.stencilFuncSeparate(a,b,c,d),ng:a=>M.stencilMask(a),mg:(a,b)=>M.stencilMaskSeparate(a,b),lg:(a,b,c)=>M.stencilOp(a,b,c),kg:(a,b,c,d)=>M.stencilOpSeparate(a,b,c,d),jg:Kf,mf:(a,b,c,d,e,f,g,n,p,q)=>{if(M.nj)M.texImage3D(a,b,c,d,e,f,g,n,p,q);else if(q){var r=
Ff(p);M.texImage3D(a,b,c,d,e,f,g,n,p,r,q>>>31-Math.clz32(r.BYTES_PER_ELEMENT))}else M.texImage3D(a,b,c,d,e,f,g,n,p,null)},ig:(a,b,c)=>M.texParameterf(a,b,c),hg:(a,b,c)=>{c=z.getFloat32(4*(c>>2),!0);M.texParameterf(a,b,c)},gg:Lf,fg:(a,b,c)=>{c=z.getInt32(4*(c>>2),!0);M.texParameteri(a,b,c)},sd:Mf,rd:(a,b,c,d,e,f)=>M.texStorage3D(a,b,c,d,e,f),eg:Nf,lf:(a,b,c,d,e,f,g,n,p,q,r)=>{if(M.nj)M.texSubImage3D(a,b,c,d,e,f,g,n,p,q,r);else if(r){var t=Ff(q);M.texSubImage3D(a,b,c,d,e,f,g,n,p,q,t,r>>>31-Math.clz32(t.BYTES_PER_ELEMENT))}else M.texSubImage3D(a,
b,c,d,e,f,g,n,p,q,null)},Ie:(a,b,c,d)=>{a=N[a];for(var e=[],f=0;f<b;f++)e.push(Xb(z.getInt32(4*(c+4*f>>2),!0)));M.transformFeedbackVaryings(a,e,d)},dg:(a,b)=>{M.uniform1f(Y(a),b)},cg:Of,bg:(a,b)=>{M.uniform1i(Y(a),b)},ag:Pf,we:(a,b)=>{M.uniform1ui(Y(a),b)},se:(a,b,c)=>{b&&M.uniform1uiv(Y(a),Aa,c>>2,b)},$f:(a,b,c)=>{M.uniform2f(Y(a),b,c)},_f:Qf,Zf:(a,b,c)=>{M.uniform2i(Y(a),b,c)},Xf:Rf,ve:(a,b,c)=>{M.uniform2ui(Y(a),b,c)},qe:(a,b,c)=>{b&&M.uniform2uiv(Y(a),Aa,c>>2,2*b)},Wf:(a,b,c,d)=>{M.uniform3f(Y(a),
b,c,d)},Vf:Sf,Uf:(a,b,c,d)=>{M.uniform3i(Y(a),b,c,d)},Tf,ue:(a,b,c,d)=>{M.uniform3ui(Y(a),b,c,d)},pe:(a,b,c)=>{b&&M.uniform3uiv(Y(a),Aa,c>>2,3*b)},Sf:(a,b,c,d,e)=>{M.uniform4f(Y(a),b,c,d,e)},Rf:Uf,Qf:(a,b,c,d,e)=>{M.uniform4i(Y(a),b,c,d,e)},Pf:Vf,te:(a,b,c,d,e)=>{M.uniform4ui(Y(a),b,c,d,e)},oe:(a,b,c)=>{b&&M.uniform4uiv(Y(a),Aa,c>>2,4*b)},be:(a,b,c)=>{a=N[a];M.uniformBlockBinding(a,b,c)},Of:(a,b,c,d)=>{b&&M.uniformMatrix2fv(Y(a),!!c,w,d>>2,4*b)},_e:(a,b,c,d)=>{b&&M.uniformMatrix2x3fv(Y(a),!!c,w,d>>
2,6*b)},Ye:(a,b,c,d)=>{b&&M.uniformMatrix2x4fv(Y(a),!!c,w,d>>2,8*b)},Mf:Wf,Ze:(a,b,c,d)=>{b&&M.uniformMatrix3x2fv(Y(a),!!c,w,d>>2,6*b)},We:(a,b,c,d)=>{b&&M.uniformMatrix3x4fv(Y(a),!!c,w,d>>2,12*b)},Lf:Xf,Xe:(a,b,c,d)=>{b&&M.uniformMatrix4x2fv(Y(a),!!c,w,d>>2,8*b)},Ve:(a,b,c,d)=>{b&&M.uniformMatrix4x3fv(Y(a),!!c,w,d>>2,12*b)},Kf:Yf,Jf:a=>{M.validateProgram(N[a])},If:(a,b)=>M.vertexAttrib1f(a,b),Hf:(a,b)=>{M.vertexAttrib1f(a,z.getFloat32(4*(b>>2),!0))},Gf:(a,b,c)=>M.vertexAttrib2f(a,b,c),Ff:(a,b)=>
{M.vertexAttrib2f(a,z.getFloat32(4*(b>>2),!0),z.getFloat32(4*(b+4>>2),!0))},Ef:(a,b,c,d)=>M.vertexAttrib3f(a,b,c,d),Df:(a,b)=>{M.vertexAttrib3f(a,z.getFloat32(4*(b>>2),!0),z.getFloat32(4*(b+4>>2),!0),z.getFloat32(4*(b+8>>2),!0))},Af:(a,b,c,d,e)=>M.vertexAttrib4f(a,b,c,d,e),zf:(a,b)=>{M.vertexAttrib4f(a,z.getFloat32(4*(b>>2),!0),z.getFloat32(4*(b+4>>2),!0),z.getFloat32(4*(b+8>>2),!0),z.getFloat32(4*(b+12>>2),!0))},Fd:Zf,jb:Zf,nd:Zf,tf:Zf,od:Zf,De:(a,b,c,d,e)=>M.vertexAttribI4i(a,b,c,d,e),Ae:(a,b)=>
{M.vertexAttribI4i(a,z.getInt32(4*(b>>2),!0),z.getInt32(4*(b+4>>2),!0),z.getInt32(4*(b+8>>2),!0),z.getInt32(4*(b+12>>2),!0))},Be:(a,b,c,d,e)=>M.vertexAttribI4ui(a,b,c,d,e),ze:(a,b)=>{M.vertexAttribI4ui(a,z.getUint32(4*(b>>2),!0),z.getUint32(4*(b+4>>2),!0),z.getUint32(4*(b+8>>2),!0),z.getUint32(4*(b+12>>2),!0))},Ge:$f,yf:ag,xf:bg,Vd:(a,b,c)=>{c=Number(c);M.waitSync(Jc[a],b,c)},C:()=>1,Fb:()=>!0,Nc:(a,b,c)=>{b={Ck:z.getInt32(4*(c>>2),!0),hk:z.getInt32(4*(c+4>>2),!0),Bl:z.getInt32(4*(c+8>>2),!0),xl:b,
Wj:z.getInt32(4*(c+12>>2),!0),Lk:z.getInt32(4*(c+16>>2),!0)};return cg(a,b)},ua:(a,b)=>{a=R(a);return a?a.requestPointerLock?xd()?Md(a):b?(vd(Md,2,[a]),1):-2:-1:-4},Bh:a=>{var b=u.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/65536))-ua.buffer.byteLength+65535)/65536;try{ua.grow(d);Ba();var e=1;break a}catch(f){}e=void 0}if(e)return!0}return!1},ja:dg,_:(a,b,c)=>"undefined"==typeof onbeforeunload?
-1:1!==c?-5:eg(a,b),la:(a,b,c,d)=>fg(a,b,c,d,12,"blur"),q:Gd,E:(a,b,c)=>{a=R(a);if(!a)return-4;a.style.width=b+"px";a.style.height=c+"px";return 0},ma:(a,b,c,d)=>fg(a,b,c,d,13,"focus"),ba:(a,b,c,d)=>{if(!Q.fullscreenEnabled())return-1;a=R(a);if(!a)return-4;gg(a,b,c,d,"webkitfullscreenchange");return gg(a,b,c,d,"fullscreenchange")},T:(a,b,c)=>dg()?-1:hg(a,b,c,26,"gamepadconnected"),S:(a,b,c)=>dg()?-1:hg(a,b,c,27,"gamepaddisconnected"),ea:(a,b,c,d)=>ig(a,b,c,d,2,"keydown"),ca:(a,b,c,d)=>ig(a,b,c,d,
1,"keypress"),da:(a,b,c,d)=>ig(a,b,c,d,3,"keyup"),L:(a,b,c)=>{md(()=>dynCall_v(a),b,c)},ra:(a,b,c,d)=>kg(a,b,c,d,5,"mousedown"),pa:(a,b,c,d)=>kg(a,b,c,d,33,"mouseenter"),oa:(a,b,c,d)=>kg(a,b,c,d,34,"mouseleave"),sa:(a,b,c,d)=>kg(a,b,c,d,8,"mousemove"),qa:(a,b,c,d)=>kg(a,b,c,d,6,"mouseup"),fa:(a,b,c,d)=>{if(!document||!document.body||!(document.body.requestPointerLock||document.body.cj||document.body.kl||document.body.jl))return-1;a=R(a);if(!a)return-4;lg(a,b,c,d,"mozpointerlockchange");lg(a,b,c,d,
"webkitpointerlockchange");lg(a,b,c,d,"mspointerlockchange");return lg(a,b,c,d,"pointerlockchange")},aa:(a,b,c,d)=>mg(a,b,c,d),ga:(a,b,c,d)=>ng(a,b,c,d,25,"touchcancel"),ia:(a,b,c,d)=>ng(a,b,c,d,23,"touchend"),ha:(a,b,c,d)=>ng(a,b,c,d,24,"touchmove"),ka:(a,b,c,d)=>ng(a,b,c,d,22,"touchstart"),$:(a,b,c)=>og(a,b,c),na:(a,b,c,d)=>(a=R(a))?"undefined"!=typeof a.onwheel?pg(a,b,c,d):-1:-4,Oc:a=>document.title=a?C(u,a):"",t:a=>fe(b=>hc(b,a)),Eb:function(a,b,c,d,e){function f(v){t?v():gc(v)}var g=a+108,n=
z.getUint32(4*(g+36>>2),!0),p=z.getUint32(4*(g+40>>2),!0),q=z.getUint32(4*(g+44>>2),!0),r=z.getUint32(4*(g+48>>2),!0),t=!!(z.getUint32(4*(g+52>>2),!0)&64);sg(a,v=>{f(()=>{n?dynCall_vi(n,v):b?.(v)})},v=>{f(()=>{p?dynCall_vi(p,v):c?.(v)})},v=>{f(()=>{q?dynCall_vi(q,v):d?.(v)})},v=>{f(()=>{r?dynCall_vi(r,v):e?.(v)})});return a},ab:(a,b)=>{var c=0;vg().forEach((d,e)=>{var f=b+c;z.setUint32(4*(a+4*e>>2),f,!0);e=f;for(f=0;f<d.length;++f)m[e++]=d.charCodeAt(f);m[e]=0;c+=d.length+1});return 0},lb:(a,b)=>
{var c=vg();z.setUint32(4*(a>>2),c.length,!0);var d=0;c.forEach(e=>d+=e.length+1);z.setUint32(4*(b>>2),d,!0);return 0},m:ec,s:function(a){try{var b=H(a);k.close(b);return 0}catch(c){if("undefined"==typeof k||"ErrnoError"!==c.name)throw c;return c.Xi}},Ah:function(a,b){try{var c=H(a);m[b]=c.Vi?2:F(c.mode)?3:40960===(c.mode&61440)?7:4;z.setInt16(2*(b+2>>1),0,!0);x[b+8>>3]=BigInt(0);x[b+16>>3]=BigInt(0);return 0}catch(d){if("undefined"==typeof k||"ErrnoError"!==d.name)throw d;return d.Xi}},va:function(a,
b,c,d){try{a:{var e=H(a);a=b;for(var f,g=b=0;g<c;g++){var n=z.getUint32(4*(a>>2),!0),p=z.getUint32(4*(a+4>>2),!0);a+=8;var q=k.read(e,m,n,p,f);if(0>q){var r=-1;break a}b+=q;if(q<p)break;"undefined"!=typeof f&&(f+=q)}r=b}z.setUint32(4*(d>>2),r,!0);return 0}catch(t){if("undefined"==typeof k||"ErrnoError"!==t.name)throw t;return t.Xi}},fh:function(a,b,c,d){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var e=H(a);k.ej(e,b,c);x[d>>3]=BigInt(e.position);e.Ej&&0===b&&
0===c&&(e.Ej=null);return 0}catch(f){if("undefined"==typeof k||"ErrnoError"!==f.name)throw f;return f.Xi}},Wc:function(a){try{var b=H(a);return fe(c=>{var d=b.node.Ui;d.type.Mj?d.type.Mj(d,!1,e=>{e?c(29):c(0)}):c(0)})}catch(c){if("undefined"==typeof k||"ErrnoError"!==c.name)throw c;return c.Xi}},xa:function(a,b,c,d){try{a:{var e=H(a);a=b;for(var f,g=b=0;g<c;g++){var n=z.getUint32(4*(a>>2),!0),p=z.getUint32(4*(a+4>>2),!0);a+=8;var q=k.write(e,m,n,p,f);if(0>q){var r=-1;break a}b+=q;if(q<p)break;"undefined"!=
typeof f&&(f+=q)}r=b}z.setUint32(4*(d>>2),r,!0);return 0}catch(t){if("undefined"==typeof k||"ErrnoError"!==t.name)throw t;return t.Xi}},Ob:ke,tc:le,sc:me,D:ne,y:oe,N:pe,Gc:qe,wc:re,vc:se,yc:te,z:ue,P:ve,zc:we,Xb:xe,Wb:ye,Tb:ze,X:Ae,uc:Be,Vb:Ce,Fc:De,U:Ee,Bc:Fe,Q:Ge,A:He,V:Ie,cc:Je,Ec:Ke,Pb:Le,p:Me,Yb:Ne,Mb:Oe,Nb:Pe,Ac:Re,Kb:Se,Lb:Te,o:Ue,bc:Ve,Cc:We,Jb:Xe,Y:Ye,Dc:Ze,Jc:$e,dc:af,Hc:bf,fc:df,k:kf,gc:lf,x:mf,Rb:pf,O:qf,i:rf,G:sf,ec:vf,l:xf,w:yf,rc:Cf,M:Df,R:Ef,Qb:Hf,Lc:If,Ub:Jf,e:Kf,g:Lf,Ic:Mf,W:Nf,
qc:Of,mc:Pf,pc:Qf,lc:Rf,oc:Sf,kc:Tf,nc:Uf,jc:Vf,ic:Wf,hc:Xf,xc:Yf,Zb:Zf,_b:$f,ac:ag,Hb:bg,J:Ag,f:Bg,v:Cg,u:Dg,K:Eg,h:Fg,a:Gg,b:Hg,c:Ig,n:Jg,Ab:Kg,Gb:function(a,b){h.setStatus(a>=b?"":"Prefetching resources\u2026 ("+a+"/"+b+")",!0)}},V=function(){function a(c){V=c.exports;V=Od();ua=V.Ch;Ba();ha=V.Oh;Da.unshift(V.Dh);Ma("wasm-instantiate");return V}var b={a:Lg};La("wasm-instantiate");if(h.instantiateWasm)try{return h.instantiateWasm(b,a)}catch(c){qa(`Module.instantiateWasm callback failed with error: ${c}`),
ba(c)}Pa??=Oa("taisei-dev.wasm")?"taisei-dev.wasm":h.locateFile?h.locateFile("taisei-dev.wasm",la):la+"taisei-dev.wasm";Ta(b,function(c){a(c.instance)}).catch(ba);return{}}();h._vfs_sync_callback=(a,b,c)=>(h._vfs_sync_callback=V.Eh)(a,b,c);
var Mg=h._main=(a,b)=>(Mg=h._main=V.Fh)(a,b),vb=(a,b)=>(vb=V.Gh)(a,b),A=a=>(A=V.Hh)(a),ie=a=>(ie=V.Ih)(a),Z=(a,b)=>(Z=V.Jh)(a,b),Ud=(a,b)=>(Ud=V.Kh)(a,b),T=a=>(T=V.Lh)(a),Dd=a=>(Dd=V.Mh)(a),S=()=>(S=V.Nh)(),U=h.dynCall_iiii=(a,b,c,d)=>(U=h.dynCall_iiii=V.Ph)(a,b,c,d);h.dynCall_iidiiii=(a,b,c,d,e,f,g)=>(h.dynCall_iidiiii=V.Qh)(a,b,c,d,e,f,g);var dynCall_vii=h.dynCall_vii=(a,b,c)=>(dynCall_vii=h.dynCall_vii=V.Rh)(a,b,c),Ng=h.dynCall_ii=(a,b)=>(Ng=h.dynCall_ii=V.Sh)(a,b);
h.dynCall_jiji=(a,b,c,d)=>(h.dynCall_jiji=V.Th)(a,b,c,d);var dynCall_vi=h.dynCall_vi=(a,b)=>(dynCall_vi=h.dynCall_vi=V.Uh)(a,b),Og=h.dynCall_viii=(a,b,c,d)=>(Og=h.dynCall_viii=V.Vh)(a,b,c,d),Pg=h.dynCall_viiii=(a,b,c,d,e)=>(Pg=h.dynCall_viiii=V.Wh)(a,b,c,d,e);h.dynCall_viiiii=(a,b,c,d,e,f)=>(h.dynCall_viiiii=V.Xh)(a,b,c,d,e,f);h.dynCall_vffff=(a,b,c,d,e)=>(h.dynCall_vffff=V.Yh)(a,b,c,d,e);h.dynCall_vf=(a,b)=>(h.dynCall_vf=V.Zh)(a,b);
h.dynCall_viiiiiiii=(a,b,c,d,e,f,g,n,p)=>(h.dynCall_viiiiiiii=V._h)(a,b,c,d,e,f,g,n,p);var Qg=h.dynCall_viiiiiiiii=(a,b,c,d,e,f,g,n,p,q)=>(Qg=h.dynCall_viiiiiiiii=V.$h)(a,b,c,d,e,f,g,n,p,q),Rg=h.dynCall_i=a=>(Rg=h.dynCall_i=V.ai)(a);h.dynCall_vff=(a,b,c)=>(h.dynCall_vff=V.bi)(a,b,c);var dynCall_v=h.dynCall_v=a=>(dynCall_v=h.dynCall_v=V.ci)(a);h.dynCall_viiiiiii=(a,b,c,d,e,f,g,n)=>(h.dynCall_viiiiiii=V.di)(a,b,c,d,e,f,g,n);
var dynCall_iii=h.dynCall_iii=(a,b,c)=>(dynCall_iii=h.dynCall_iii=V.ei)(a,b,c);h.dynCall_vfi=(a,b,c)=>(h.dynCall_vfi=V.fi)(a,b,c);h.dynCall_viif=(a,b,c,d)=>(h.dynCall_viif=V.gi)(a,b,c,d);h.dynCall_vif=(a,b,c)=>(h.dynCall_vif=V.hi)(a,b,c);h.dynCall_viff=(a,b,c,d)=>(h.dynCall_viff=V.ii)(a,b,c,d);h.dynCall_vifff=(a,b,c,d,e)=>(h.dynCall_vifff=V.ji)(a,b,c,d,e);h.dynCall_viffff=(a,b,c,d,e,f)=>(h.dynCall_viffff=V.ki)(a,b,c,d,e,f);
var Sg=h.dynCall_viiiiii=(a,b,c,d,e,f,g)=>(Sg=h.dynCall_viiiiii=V.li)(a,b,c,d,e,f,g);h.dynCall_vfff=(a,b,c,d)=>(h.dynCall_vfff=V.mi)(a,b,c,d);h.dynCall_viiiiiiiiii=(a,b,c,d,e,f,g,n,p,q,r)=>(h.dynCall_viiiiiiiiii=V.ni)(a,b,c,d,e,f,g,n,p,q,r);h.dynCall_viiiiiiiiiii=(a,b,c,d,e,f,g,n,p,q,r,t)=>(h.dynCall_viiiiiiiiiii=V.oi)(a,b,c,d,e,f,g,n,p,q,r,t);h.dynCall_viifi=(a,b,c,d,e)=>(h.dynCall_viifi=V.pi)(a,b,c,d,e);var Tg=h.dynCall_iiiii=(a,b,c,d,e)=>(Tg=h.dynCall_iiiii=V.qi)(a,b,c,d,e);
h.dynCall_ji=(a,b)=>(h.dynCall_ji=V.ri)(a,b);h.dynCall_iiiiiiiiiiii=(a,b,c,d,e,f,g,n,p,q,r,t)=>(h.dynCall_iiiiiiiiiiii=V.si)(a,b,c,d,e,f,g,n,p,q,r,t);h.dynCall_iiiiii=(a,b,c,d,e,f)=>(h.dynCall_iiiiii=V.ti)(a,b,c,d,e,f);h.dynCall_iiiiiii=(a,b,c,d,e,f,g)=>(h.dynCall_iiiiiii=V.ui)(a,b,c,d,e,f,g);h.dynCall_vd=(a,b)=>(h.dynCall_vd=V.vi)(a,b);h.dynCall_iiji=(a,b,c,d)=>(h.dynCall_iiji=V.wi)(a,b,c,d);h.dynCall_viidi=(a,b,c,d,e)=>(h.dynCall_viidi=V.xi)(a,b,c,d,e);
h.dynCall_ff=(a,b)=>(h.dynCall_ff=V.yi)(a,b);h.dynCall_iiif=(a,b,c,d)=>(h.dynCall_iiif=V.zi)(a,b,c,d);h.dynCall_iiiiiiiii=(a,b,c,d,e,f,g,n,p)=>(h.dynCall_iiiiiiiii=V.Ai)(a,b,c,d,e,f,g,n,p);h.dynCall_iiiiiiiiiii=(a,b,c,d,e,f,g,n,p,q,r)=>(h.dynCall_iiiiiiiiiii=V.Bi)(a,b,c,d,e,f,g,n,p,q,r);h.dynCall_viiif=(a,b,c,d,e)=>(h.dynCall_viiif=V.Ci)(a,b,c,d,e);h.dynCall_iiiiiiii=(a,b,c,d,e,f,g,n)=>(h.dynCall_iiiiiiii=V.Di)(a,b,c,d,e,f,g,n);
h.dynCall_iiiiiiiiii=(a,b,c,d,e,f,g,n,p,q)=>(h.dynCall_iiiiiiiiii=V.Ei)(a,b,c,d,e,f,g,n,p,q);h.dynCall_iiidd=(a,b,c,d,e)=>(h.dynCall_iiidd=V.Fi)(a,b,c,d,e);h.dynCall_id=(a,b)=>(h.dynCall_id=V.Gi)(a,b);h.dynCall_dd=(a,b)=>(h.dynCall_dd=V.Hi)(a,b);h.dynCall_d=a=>(h.dynCall_d=V.Ii)(a);h.dynCall_iid=(a,b,c)=>(h.dynCall_iid=V.Ji)(a,b,c);h.dynCall_di=(a,b)=>(h.dynCall_di=V.Ki)(a,b);h.dynCall_dii=(a,b,c)=>(h.dynCall_dii=V.Li)(a,b,c);
var ge=a=>(ge=V.Mi)(a),Qd=()=>(Qd=V.Ni)(),Vd=a=>(Vd=V.Oi)(a),he=()=>(he=V.Pi)();function Cg(a,b,c){var d=S();try{return dynCall_iii(a,b,c)}catch(e){T(d);if(e!==e+0)throw e;Z(1,0)}}function Eg(a,b,c,d,e){var f=S();try{return Tg(a,b,c,d,e)}catch(g){T(f);if(g!==g+0)throw g;Z(1,0)}}function Dg(a,b,c,d){var e=S();try{return U(a,b,c,d)}catch(f){T(e);if(f!==f+0)throw f;Z(1,0)}}function Ag(a){var b=S();try{return Rg(a)}catch(c){T(b);if(c!==c+0)throw c;Z(1,0)}}
function Hg(a,b,c,d){var e=S();try{Og(a,b,c,d)}catch(f){T(e);if(f!==f+0)throw f;Z(1,0)}}function Bg(a,b){var c=S();try{return Ng(a,b)}catch(d){T(c);if(d!==d+0)throw d;Z(1,0)}}function Jg(a,b,c,d,e,f,g){var n=S();try{Sg(a,b,c,d,e,f,g)}catch(p){T(n);if(p!==p+0)throw p;Z(1,0)}}function Gg(a,b,c){var d=S();try{dynCall_vii(a,b,c)}catch(e){T(d);if(e!==e+0)throw e;Z(1,0)}}function Fg(a,b){var c=S();try{dynCall_vi(a,b)}catch(d){T(c);if(d!==d+0)throw d;Z(1,0)}}
function Ig(a,b,c,d,e){var f=S();try{Pg(a,b,c,d,e)}catch(g){T(f);if(g!==g+0)throw g;Z(1,0)}}function Kg(a,b,c,d,e,f,g,n,p,q){var r=S();try{Qg(a,b,c,d,e,f,g,n,p,q)}catch(t){T(r);if(t!==t+0)throw t;Z(1,0)}}h.addRunDependency=La;h.removeRunDependency=Ma;h.callMain=Ug;h.ENV=tg;
h.ccall=(a,b,c,d,e)=>{function f(t){--cc;0!==p&&T(p);return"string"===b?t?C(u,t):"":"boolean"===b?!!t:t}var g={string:t=>{var v=0;null!==t&&void 0!==t&&0!==t&&(v=Ed(t));return v},array:t=>{var v=Dd(t.length);m.set(t,v);return v}};a=h["_"+a];var n=[],p=0;if(d)for(var q=0;q<d.length;q++){var r=g[c[q]];r?(0===p&&(p=S()),n[q]=r(d[q])):n[q]=d[q]}c=W;d=a(...n);e=e?.async;cc+=1;if(W!=c)return ce().then(f);d=f(d);return e?Promise.resolve(d):d};h.FS_createPreloadedFile=Eb;h.FS_unlink=a=>k.lj(a);
h.FS_createPath=wg;h.FS_createDevice=yg;h.FS=k;h.FS_createDataFile=(a,b,c,d,e,f)=>{k.ik(a,b,c,d,e,f)};h.FS_createLazyFile=xg;var Vg;Ka=function Wg(){Vg||Xg();Vg||(Ka=Wg)};function Ug(a=[]){var b=Mg;a.unshift(ka);var c=a.length,d=Dd(4*(c+1)),e=d;a.forEach(g=>{g=Ed(g);z.setUint32(4*(e>>2),g,!0);e+=4});z.setUint32(4*(e>>2),0,!0);try{var f=b(c,d);ec(f,!0);return f}catch(g){return bc(g)}}
function Xg(){var a=ja;function b(){if(!Vg&&(Vg=!0,h.calledRun=!0,!va)){if(!h.noFSInit&&!k.tk){var c,d;k.tk=!0;e??=h.stdin;c??=h.stdout;d??=h.stderr;e?k.tj("/dev","stdin",e):k.sj("/dev/tty","/dev/stdin");c?k.tj("/dev","stdout",null,c):k.sj("/dev/tty","/dev/stdout");d?k.tj("/dev","stderr",null,d):k.sj("/dev/tty1","/dev/stderr");k.open("/dev/stdin",0);k.open("/dev/stdout",1);k.open("/dev/stderr",1)}k.Uk=!1;Za(Da);Za(Ea);aa(h);h.onRuntimeInitialized?.();Yg&&Ug(a);if(h.postRun)for("function"==typeof h.postRun&&
(h.postRun=[h.postRun]);h.postRun.length;){var e=h.postRun.shift();Ga.unshift(e)}Za(Ga)}}if(!(0<Ia)){if(h.preRun)for("function"==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)Ha();Za(Ca);0<Ia||(h.setStatus?(h.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>h.setStatus(""),1);b()},1)):b())}}if(h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);0<h.preInit.length;)h.preInit.pop()();var Yg=!1;h.noInitialRun&&(Yg=!1);Xg();tg.TAISEI_NOASYNC="1";tg.TAISEI_NOUNLOAD="1";
tg.TAISEI_PREFER_SDL_VIDEODRIVERS="emscripten";tg.TAISEI_RENDERER="gles30";moduleRtn=ca;
return moduleRtn;
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = createTaisei;
else if (typeof define === 'function' && define['amd'])
define([], () => createTaisei);