@basthon/browser-bundle 0.76.7 → 0.76.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{0.76.7 → 0.76.9}/python3/basthon.tar +0 -0
- package/lib/{0.76.7 → 0.76.9}/python3/modules/graphviz-0.0.1-py3-none-any.whl +0 -0
- package/lib/{0.76.7 → 0.76.9}/python3/modules/ipython-0.0.1-py3-none-any.whl +0 -0
- package/lib/{0.76.7 → 0.76.9}/python3/modules/p5-0.0.1-py3-none-any.whl +0 -0
- package/lib/{0.76.7 → 0.76.9}/python3/modules/proj4py-0.0.1-py3-none-any.whl +0 -0
- package/lib/{0.76.7 → 0.76.9}/python3/modules/rcviz-0.0.1-py3-none-any.whl +0 -0
- package/lib/{0.76.7 → 0.76.9}/python3/modules/requests-0.0.1-py3-none-any.whl +0 -0
- package/lib/{0.76.7 → 0.76.9}/python3/modules/turtle-0.0.1-py3-none-any.whl +0 -0
- package/lib/{0.76.7 → 0.76.9}/python3/modules/tutor-0.0.1-py3-none-any.whl +0 -0
- package/lib/{0.76.7 → 0.76.9}/python3/pyodide-lock.json +1 -1
- package/lib/{4d81e8d193751fb4316a.wasm → c621a8b7eb8496a5e6a6.wasm} +0 -0
- package/lib/kernel-base_lib_commons_js-kernel-base_lib_version_js-kernel-echo_lib_index_js.js +1 -1
- package/lib/kernel-base_lib_commons_js-kernel-base_lib_version_js-kernel-echo_lib_index_js.js.map +1 -1
- package/lib/kernel-base_lib_worker_kernel-worker_js-_e0870.js +1 -1
- package/lib/kernel-base_lib_worker_kernel-worker_js-_e0870.js.map +1 -1
- package/lib/kernel-base_lib_worker_kernel-worker_js-_e0871.js +1 -1
- package/lib/kernel-base_lib_worker_kernel-worker_js-_e0871.js.map +1 -1
- package/lib/vendors-node_modules_basthon_xcas-wasm_src_index_js.js +1 -1
- package/lib/vendors-node_modules_basthon_xcas-wasm_src_index_js.js.map +1 -1
- package/package.json +2 -2
- /package/lib/{0.76.7 → 0.76.9}/python3/modules/extern/tutor/053e308b29fa94c9768c.png +0 -0
- /package/lib/{0.76.7 → 0.76.9}/python3/modules/extern/tutor/43557192d14bec1ce5a1.png +0 -0
- /package/lib/{0.76.7 → 0.76.9}/python3/modules/extern/tutor/62dc93aaa1f4a5ab9654.png +0 -0
- /package/lib/{0.76.7 → 0.76.9}/python3/modules/extern/tutor/a3c784d737c50501dfcd.png +0 -0
- /package/lib/{0.76.7 → 0.76.9}/python3/modules/extern/tutor/a3fa2b0f6d2467fdac56.png +0 -0
- /package/lib/{0.76.7 → 0.76.9}/python3/modules/extern/tutor/bundle.js +0 -0
- /package/lib/{0.76.7 → 0.76.9}/python3/modules/extern/tutor/bundle.js.LICENSE.txt +0 -0
- /package/lib/{0.76.7 → 0.76.9}/python3/modules/extern/tutor/bundle.js.map +0 -0
- /package/lib/{0.76.7 → 0.76.9}/python3/modules/extern/tutor/f997956ae061f27f24f5.png +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["vendors-node_modules_basthon_xcas-wasm_src_index_js"],{1771:(e,t,r)=>{r.r(t),r.d(t,{default:()=>on}),e=r.hmd(e);var n={disable3d:0,tableaucm:0,debug:0,Datestart:Date.now(),ready:!1,colorinit:!1,usemathjax:!1,prettyprint:!0,histcount:0,selection:"",langue:-1,calc:1,xwaspy_shift:33,gr2d_ncanvas:0,initconfigstring:"",python_mode:0,python_indent:4,warnpy:!0};window.innerWidth??=1080;var o=void 0!==o?o:{};o.print=(...e)=>console.log(...e),o.printErr=(...e)=>console.error(...e);var i,a={};for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);var s,u,c,l,d,f=[],m="./this.program",p=function(e,t){throw t};if(s="object"==typeof window,u="function"==typeof importScripts,l="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,c=l&&!s&&!u,d=!s&&!c&&!u,o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var h,v,E,g,y,w="";if(c)w="//",h=function(e,t){var n;return(n=yr(e))||(g||(g=r(8952)),y||(y=r(9942)),e=y.normalize(e),n=g.readFileSync(e)),t?n:n.toString()},E=function(e){var t=h(e,!0);return t.buffer||(t=new Uint8Array(t)),F(t.buffer),t},process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),e.exports=o,process.on("uncaughtException",function(e){if(!(e instanceof en))throw e}),process.on("unhandledRejection",nn),p=function(e){process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"};else if(d)"undefined"!=typeof read&&(h=function(e){var t=yr(e);return t?Er(t):read(e)}),E=function(e){var t;return(t=yr(e))?t:"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(F("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?f=scriptArgs:"undefined"!=typeof arguments&&(f=arguments),"function"==typeof quit&&(p=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print);else{if(!s&&!u)throw new Error("environment detection error");u?w=self.location.href:document.currentScript&&(w=document.currentScript.src),w=0!==w.indexOf("blob:")?w.substr(0,w.lastIndexOf("/")+1):"",h=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){var r=yr(e);if(r)return Er(r);throw t}},u&&(E=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){var r=yr(e);if(r)return r;throw t}}),v=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){if(200==n.status||0==n.status&&n.response)t(n.response);else{var o=yr(e);o?t(o.buffer):r()}},n.onerror=r,n.send(null)}}var b=o.print||console.log.bind(console),_=o.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);function T(e){F(ne);var t=Q[ne>>2],r=t+e+15&-16;return r>vt()&&nn("failure to dynamicAlloc - memory growth etc. is not supported there, call malloc/sbrk directly"),Q[ne>>2]=r,t}function x(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":case"float":return 4;case"i64":case"double":return 8;default:if("*"===e[e.length-1])return 4;if("i"===e[0]){var t=parseInt(e.substr(1));return F(t%8==0,"getNativeTypeSize invalid bits "+t+", type "+e),t/8}return 0}}function A(e){A.shown||(A.shown={}),A.shown[e]||(A.shown[e]=1,_(e))}a=null,o.arguments&&(f=o.arguments),Object.getOwnPropertyDescriptor(o,"arguments")||Object.defineProperty(o,"arguments",{get:function(){nn("Module.arguments has been replaced with plain arguments_")}}),o.thisProgram&&(m=o.thisProgram),Object.getOwnPropertyDescriptor(o,"thisProgram")||Object.defineProperty(o,"thisProgram",{get:function(){nn("Module.thisProgram has been replaced with plain thisProgram")}}),o.quit&&(p=o.quit),Object.getOwnPropertyDescriptor(o,"quit")||Object.defineProperty(o,"quit",{get:function(){nn("Module.quit has been replaced with plain quit_")}}),F(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),F(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),F(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),F(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),F(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),F(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),F(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),F(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),Object.getOwnPropertyDescriptor(o,"read")||Object.defineProperty(o,"read",{get:function(){nn("Module.read has been replaced with plain read_")}}),Object.getOwnPropertyDescriptor(o,"readAsync")||Object.defineProperty(o,"readAsync",{get:function(){nn("Module.readAsync has been replaced with plain readAsync")}}),Object.getOwnPropertyDescriptor(o,"readBinary")||Object.defineProperty(o,"readBinary",{get:function(){nn("Module.readBinary has been replaced with plain readBinary")}}),Pr=Nr=Cr=function(){nn("cannot use the stack before compiled code is ready to run, and has provided stack access")};var M,S,O={"f64-rem":function(e,t){return e%t},debugger:function(){}},R=(new Array(0),0),D=function(e){R=e};function k(e,t,r,n){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":Y[e|0]=t;break;case"i16":W[e>>1]=t;break;case"i32":Q[e>>2]=t;break;case"i64":Ie=[t>>>0,(Pe=t,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[e>>2]=Ie[0],Q[e+4>>2]=Ie[1];break;case"float":Z[e>>2]=t;break;case"double":$[e>>3]=t;break;default:nn("invalid type for setValue: "+r)}}o.wasmBinary&&(M=o.wasmBinary),Object.getOwnPropertyDescriptor(o,"wasmBinary")||Object.defineProperty(o,"wasmBinary",{get:function(){nn("Module.wasmBinary has been replaced with plain wasmBinary")}}),"object"!=typeof WebAssembly&&nn("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.");var L=!1;function F(e,t){e||nn("Assertion failed: "+t)}function C(e,t,r,n,i){var a={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);j(e,t=Cr(r),r)}return t},array:function(e){var t=Cr(e.length);return z(e,t),t}};var s=function(e){var t=o["_"+e];return F(t,"Cannot call unknown function "+e+", make sure it is exported"),t}(e),u=[],c=0;if(F("array"!==t,'Return type should not be "array".'),n)for(var l=0;l<n.length;l++){var d=a[r[l]];d?(0===c&&(c=Pr()),u[l]=d(n[l])):u[l]=n[l]}var f=s.apply(null,u);return F(!(i&&i.async),"async call is only supported with Emterpretify for now, see #9029"),f=function(e){return"string"===t?B(e):"boolean"===t?Boolean(e):e}(f),0!==c&&Nr(c),f}function N(e,t,r,n){var o,i;"number"==typeof e?(o=!0,i=e):(o=!1,i=e.length);var a,s="string"==typeof t?t:null;if(a=3==r?n:[Rr,Cr,T][r](Math.max(i,s?1:t.length)),o){var u;for(n=a,F(!(3&a)),u=a+(-4&i);n<u;n+=4)Q[n>>2]=0;for(u=a+i;n<u;)Y[n++|0]=0;return a}if("i8"===s)return e.subarray||e.slice?q.set(e,a):q.set(new Uint8Array(e),a),a;for(var c,l,d,f=0;f<i;){var m=e[f];0!==(c=s||t[f])?(F(c,"Must know what type to store in allocate!"),"i64"==c&&(c="i32"),k(a+f,m,c),d!==c&&(l=x(c),d=c),f+=l):f++}return a}function P(e){return pe?Rr(e):T(e)}var I="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function U(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&I)return I.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|u:(240!=(248&a)&&A("Invalid UTF-8 leading byte 0x"+a.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"),a=(7&a)<<18|s<<12|u<<6|63&e[t++]),a<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function B(e,t){return e?U(q,e,t):""}function X(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a);if(s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;s>=2097152&&A("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function j(e,t,r){return F("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),X(e,q,t,r)}function V(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");function z(e,t){F(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),Y.set(e,t)}function G(e,t,r){for(var n=0;n<e.length;++n)F(e.charCodeAt(n)==e.charCodeAt(n)&255),Y[t++|0]=e.charCodeAt(n);r||(Y[t|0]=0)}var H,Y,q,W,K,Q,J,Z,$,ee=65536;var te=10556224,re=10556224,ne=5313312;F(!0,"stack must start aligned"),F(!0,"heap must start aligned");var oe=5242880;o.TOTAL_STACK&&F(oe===o.TOTAL_STACK,"the stack size can no longer be determined at runtime");var ie=o.TOTAL_MEMORY||268435456;function ae(){var e=J[2639055],t=J[2639054];34821223==e&&2310721022==t||nn("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+t.toString(16)+" "+e.toString(16)),1668509029!==Q[0]&&nn("Runtime error: The application has corrupted its heap memory area (address zero)!")}if(Object.getOwnPropertyDescriptor(o,"TOTAL_MEMORY")||Object.defineProperty(o,"TOTAL_MEMORY",{get:function(){nn("Module.TOTAL_MEMORY has been replaced with plain INITIAL_TOTAL_MEMORY")}}),F(ie>=oe,"TOTAL_MEMORY should be larger than TOTAL_STACK, was "+ie+"! (TOTAL_STACK="+oe+")"),F("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),(S=o.wasmMemory?o.wasmMemory:new WebAssembly.Memory({initial:ie/ee,maximum:ie/ee}))&&(H=S.buffer),F((ie=H.byteLength)%ee===0),o.HEAP8=Y=new Int8Array(H),o.HEAP16=W=new Int16Array(H),o.HEAP32=Q=new Int32Array(H),o.HEAPU8=q=new Uint8Array(H),o.HEAPU16=K=new Uint16Array(H),o.HEAPU32=J=new Uint32Array(H),o.HEAPF32=Z=new Float32Array(H),o.HEAPF64=$=new Float64Array(H),Q[ne>>2]=re,Q[0]=1668509029,W[1]=25459,115!==q[2]||99!==q[3])throw"Runtime error: expected the system to be little-endian!";function se(e,t){nn("Invalid function pointer "+e+" called with signature '"+t+"'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). Build with ASSERTIONS=2 for more info.")}function ue(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?o.dynCall_v(r):o.dynCall_vi(r,t.arg):r(void 0===t.arg?null:t.arg)}else t()}}var ce=[],le=[],de=[],fe=[],me=[],pe=!1,he=!1;function ve(e){ce.unshift(e)}function Ee(e){me.unshift(e)}F(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),F(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),F(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),F(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var ge=Math.abs,ye=Math.cos,we=Math.sin,be=Math.sqrt,_e=Math.ceil,Te=Math.floor,xe=Math.min,Ae=Math.trunc,Me=0,Se=null,Oe=null,Re={};function De(e){for(var t=e;;){if(!Re[e])return e;e=t+Math.random()}return e}function ke(e){Me++,o.monitorRunDependencies&&o.monitorRunDependencies(Me),e?(F(!Re[e]),Re[e]=1,null===Se&&"undefined"!=typeof setInterval&&(Se=setInterval(function(){if(L)return clearInterval(Se),void(Se=null);var e=!1;for(var t in Re)e||(e=!0,_("still waiting on run dependencies:")),_("dependency: "+t);e&&_("(end of list)")},1e4))):_("warning: run dependency added without ID")}function Le(e){if(Me--,o.monitorRunDependencies&&o.monitorRunDependencies(Me),e?(F(Re[e]),delete Re[e]):_("warning: run dependency removed without ID"),0==Me&&(null!==Se&&(clearInterval(Se),Se=null),Oe)){var t=Oe;Oe=null,t()}}o.preloadedImages={},o.preloadedAudios={};var Fe="data:application/wasm;base64,";function Ce(e){return String.prototype.startsWith?e.startsWith(Fe):0===e.indexOf(Fe)}var Ne,Pe,Ie,Ue=new URL(r(5075),r.b).href;function Be(){try{if(M)return new Uint8Array(M);var e=yr(Ue);if(e)return e;if(E)return E(Ue);throw"both async and sync fetching of the wasm failed"}catch(e){nn(e)}}function Xe(e){var t={env:e,global:{NaN:NaN,Infinity:1/0},"global.Math":Math,asm2wasm:O};function r(e,t){var r=e.exports;o.asm=r,Le("wasm-instantiate")}ke("wasm-instantiate");var n=o;function i(e){F(o===n,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),n=null,r(e.instance)}function a(e){return(M||!s&&!u||"function"!=typeof fetch?new Promise(function(e,t){e(Be())}):fetch(Ue,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Ue+"'";return e.arrayBuffer()}).catch(function(){return Be()})).then(function(e){return WebAssembly.instantiate(e,t)}).then(e,function(e){_("failed to asynchronously prepare wasm: "+e),nn(e)})}if(o.instantiateWasm)try{return o.instantiateWasm(t,r)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}return function(){if(M||"function"!=typeof WebAssembly.instantiateStreaming||Ce(Ue)||"function"!=typeof fetch)return a(i);fetch(Ue,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,t).then(i,function(e){_("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),a(i)})})}(),{}}Ce(Ue)||(Ne=Ue,Ue=o.locateFile?o.locateFile(Ne,w):Ne),o.asm=function(e,t,r){t.memory=S,t.table=new WebAssembly.Table({initial:10295,maximum:10295,element:"anyfunc"}),t.__memory_base=1024,t.__table_base=0;var n=Xe(t);return F(n,"binaryen setup failed (no wasm support?)"),n};var je=[function(){return Date.now()},function(){if(o.worker)return 0;var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/");return t>-1||r>-1?1:0},function(e,t,r){var n=B(e);console.log("url:"+n);var i=new XMLHttpRequest,a=r;if(i.open("GET",n,!1),i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),200===i.status){console.log("Réponse reçue: %s",i.responseText);var s=i.responseText;s.length>=a-1&&(s=s.substr(0,a-1)),o.writeStringToMemory(s,t)}else console.log("Status de la réponse: %d (%s)",i.status,i.statusText),o.writeStringToMemory("ERROR",t)},function(e){var t=B(e),r=prompt(t," ");return null==r?0:N(vr(r),"i8",0)},function(e){return n.assistant_matr_maxrows},function(e){return n.assistant_matr_maxcols},function(e){n.sheet_recompute(" ".substr(0,0)),n.open_sheet(!0)},function(e,t,r){var o=B(e);console.log(o),n.sheet_set_ij(o,t,r)},function(e){var t=B(e),r=prompt(t,"n");return null==r?-4:"next"==r||"n"==r||"sst"==r?-1:"sst_in"==r||"s"==r?-2:"cont"==r||"c"==r?-3:"kill"==r||"k"==r?-4:"break"==r||"b"==r?-5:"delete"==r||"d"==r?-6:N(vr(r),"i8",0)},function(e){if(void 0!==n&&n.warnpy){var t=B(e);alert(t)}},function(){var e=window.innerWidth;return"undefined"!=typeof svgwidth?1*svgwidth:e>=1e3?9*e/1e3:e/60},function(){return void 0!==n&&void 0!==n.disable3d&&n.disable3d?n.disable3d:o.worker?1:0},function(){return void 0!==n&&void 0!==n.add_evalf?1*n.add_evalf:1},function(){return void 0!==n&&void 0!==n.js_bigint?1*n.js_bigint:0},function(e,t,r,n){var i,a,s,u;s=n,u=(a=t)/4/(i=e);var c,l,d=new(window.AudioContext||window.webkitAudioContext),f=d.createBuffer(i,a,d.sampleRate),m=new Uint8Array(o.HEAPU8.buffer,s,a),p=new Float32Array(m.buffer,m.byteOffset,a/4);for(c=0;c<i;c++){var h=f.getChannelData(c);for(l=0;l<u;++l)h[l]=p[c*u+l]}var v=d.createBufferSource();v.buffer=f,v.connect(d.destination),v.start()},function(e){var t=B(e);console.log(t)},function(e,t){var r=B(e);r=r.substr(0,t),n.add_python_output(r),r=n.clean_for_html(r);var o=document.getElementById("consolediv");null!=o&&"block"!=o.style.display&&(o.style.display="block",n.set_config_width());var i=document.getElementById("output");null!=i&&(i.style.display="inherit",i.innerHTML+=r,i.scrollTop=99999)},function(e){var t=B(e);n.python_output+=t}];le.push({func:function(){Fr()}});function Ve(e){return e.replace(/__Z[\w\d_]+/g,function(e){var t,r=(t=e,A("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),t);return e===r?e:r+" ["+e+"]"})}function ze(){var e=function(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}();return o.extraStackTrace&&(e+="\n"+o.extraStackTrace()),Ve(e)}function Ge(e){return o.___errno_location?Q[o.___errno_location()>>2]=e:_("failed to set errno from JS"),e}F(!0);var He={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=He.normalizeArray(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=He.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return He.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return He.normalize(e.join("/"))},join2:function(e,t){return He.normalize(e+"/"+t)}},Ye={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:et.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=He.normalizeArray(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Ye.resolve(e).substr(1),t=Ye.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},qe={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){qe.ttys[e]={input:[],output:[],ops:t},et.registerDevice(e,qe.stream_ops)},stream_ops:{open:function(e){var t=qe.ttys[e.node.rdev];if(!t)throw new et.ErrnoError(19);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new et.ErrnoError(6);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new et.ErrnoError(5)}if(void 0===s&&0===i)throw new et.ErrnoError(11);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new et.ErrnoError(6);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new et.ErrnoError(5)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(c){var r=Buffer.alloc?Buffer.alloc(256):new Buffer(256),n=0,o="win32"!=process.platform,i=process.stdin.fd;if(o){var a=!1;try{i=mr.openSync("/dev/stdin","r"),a=!0}catch(e){}}try{n=mr.readSync(i,r,0,256,null)}catch(e){if(-1==e.toString().indexOf("EOF"))throw e;n=0}a&&mr.closeSync(i),t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=vr(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(b(U(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(b(U(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(_(U(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(U(e.output,0)),e.output=[])}}},We={ops_table:null,mount:function(e){return We.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(et.isBlkdev(r)||et.isFIFO(r))throw new et.ErrnoError(1);We.ops_table||(We.ops_table={dir:{node:{getattr:We.node_ops.getattr,setattr:We.node_ops.setattr,lookup:We.node_ops.lookup,mknod:We.node_ops.mknod,rename:We.node_ops.rename,unlink:We.node_ops.unlink,rmdir:We.node_ops.rmdir,readdir:We.node_ops.readdir,symlink:We.node_ops.symlink},stream:{llseek:We.stream_ops.llseek}},file:{node:{getattr:We.node_ops.getattr,setattr:We.node_ops.setattr},stream:{llseek:We.stream_ops.llseek,read:We.stream_ops.read,write:We.stream_ops.write,allocate:We.stream_ops.allocate,mmap:We.stream_ops.mmap,msync:We.stream_ops.msync}},link:{node:{getattr:We.node_ops.getattr,setattr:We.node_ops.setattr,readlink:We.node_ops.readlink},stream:{}},chrdev:{node:{getattr:We.node_ops.getattr,setattr:We.node_ops.setattr},stream:et.chrdev_stream_ops}});var o=et.createNode(e,t,r,n);return et.isDir(o.mode)?(o.node_ops=We.ops_table.dir.node,o.stream_ops=We.ops_table.dir.stream,o.contents={}):et.isFile(o.mode)?(o.node_ops=We.ops_table.file.node,o.stream_ops=We.ops_table.file.stream,o.usedBytes=0,o.contents=null):et.isLink(o.mode)?(o.node_ops=We.ops_table.link.node,o.stream_ops=We.ops_table.link.stream):et.isChrdev(o.mode)&&(o.node_ops=We.ops_table.chrdev.node,o.stream_ops=We.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o),o},getFileDataAsRegularArray:function(e){if(e.contents&&e.contents.subarray){for(var t=[],r=0;r<e.usedBytes;++r)t.push(e.contents[r]);return t}return e.contents},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t){if(0==t)return e.contents=null,void(e.usedBytes=0);if(!e.contents||e.contents.subarray){var r=e.contents;return e.contents=new Uint8Array(new ArrayBuffer(t)),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),void(e.usedBytes=t)}if(e.contents||(e.contents=[]),e.contents.length>t)e.contents.length=t;else for(;e.contents.length<t;)e.contents.push(0);e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=et.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,et.isDir(e.mode)?t.size=4096:et.isFile(e.mode)?t.size=e.usedBytes:et.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&We.resizeFileStorage(e,t.size)},lookup:function(e,t){throw et.genericErrors[2]},mknod:function(e,t,r,n){return We.createNode(e,t,r,n)},rename:function(e,t,r){if(et.isDir(e.mode)){var n;try{n=et.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new et.ErrnoError(39)}delete e.parent.contents[e.name],e.name=r,t.contents[r]=e,e.parent=t},unlink:function(e,t){delete e.contents[t]},rmdir:function(e,t){var r=et.lookupNode(e,t);for(var n in r.contents)throw new et.ErrnoError(39);delete e.contents[t]},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=We.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!et.isLink(e.mode))throw new et.ErrnoError(22);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(F(a>=0),a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return F(0===o,"canOwn must imply no weird position inside the file"),a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=new Uint8Array(t.subarray(r,r+n)),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(We.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&et.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new et.ErrnoError(22);return n},allocate:function(e,t,r){We.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i,a){if(!et.isFile(e.node.mode))throw new et.ErrnoError(19);var s,u,c=e.node.contents;if(2&a||c.buffer!==t&&c.buffer!==t.buffer){(o>0||o+n<e.node.usedBytes)&&(c=c.subarray?c.subarray(o,o+n):Array.prototype.slice.call(c,o,o+n)),u=!0;var l=t.buffer==Y.buffer;if(!(s=Rr(n)))throw new et.ErrnoError(12);(l?Y:t).set(c,s)}else u=!1,s=c.byteOffset;return{ptr:s,allocated:u}},msync:function(e,t,r,n,o){if(!et.isFile(e.node.mode))throw new et.ErrnoError(19);if(2&o)return 0;We.stream_ops.write(e,t,0,n,r,!1);return 0}}},Ke={dbs:{},indexedDB:function(){if("undefined"!=typeof indexedDB)return indexedDB;var e=null;return"object"==typeof window&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),F(e,"IDBFS used, but indexedDB not supported"),e},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function(e){return We.mount.apply(null,arguments)},syncfs:function(e,t,r){Ke.getLocalSet(e,function(n,o){if(n)return r(n);Ke.getRemoteSet(e,function(e,n){if(e)return r(e);var i=t?n:o,a=t?o:n;Ke.reconcile(i,a,r)})})},getDB:function(e,t){var r,n=Ke.dbs[e];if(n)return t(null,n);try{r=Ke.indexedDB().open(e,Ke.DB_VERSION)}catch(e){return t(e)}if(!r)return t("Unable to connect to IndexedDB");r.onupgradeneeded=function(e){var t,r=e.target.result,n=e.target.transaction;(t=r.objectStoreNames.contains(Ke.DB_STORE_NAME)?n.objectStore(Ke.DB_STORE_NAME):r.createObjectStore(Ke.DB_STORE_NAME)).indexNames.contains("timestamp")||t.createIndex("timestamp","timestamp",{unique:!1})},r.onsuccess=function(){n=r.result,Ke.dbs[e]=n,t(null,n)},r.onerror=function(e){t(this.error),e.preventDefault()}},getLocalSet:function(e,t){var r={};function n(e){return"."!==e&&".."!==e}function o(e){return function(t){return He.join2(e,t)}}for(var i=et.readdir(e.mountpoint).filter(n).map(o(e.mountpoint));i.length;){var a,s=i.pop();try{a=et.stat(s)}catch(e){return t(e)}et.isDir(a.mode)&&i.push.apply(i,et.readdir(s).filter(n).map(o(s))),r[s]={timestamp:a.mtime}}return t(null,{type:"local",entries:r})},getRemoteSet:function(e,t){var r={};Ke.getDB(e.mountpoint,function(e,n){if(e)return t(e);try{var o=n.transaction([Ke.DB_STORE_NAME],"readonly");o.onerror=function(e){t(this.error),e.preventDefault()},o.objectStore(Ke.DB_STORE_NAME).index("timestamp").openKeyCursor().onsuccess=function(e){var o=e.target.result;if(!o)return t(null,{type:"remote",db:n,entries:r});r[o.primaryKey]={timestamp:o.key},o.continue()}}catch(e){return t(e)}})},loadLocalEntry:function(e,t){var r,n;try{n=et.lookupPath(e).node,r=et.stat(e)}catch(e){return t(e)}return et.isDir(r.mode)?t(null,{timestamp:r.mtime,mode:r.mode}):et.isFile(r.mode)?(n.contents=We.getFileDataAsTypedArray(n),t(null,{timestamp:r.mtime,mode:r.mode,contents:n.contents})):t(new Error("node type not supported"))},storeLocalEntry:function(e,t,r){try{if(et.isDir(t.mode))et.mkdir(e,t.mode);else{if(!et.isFile(t.mode))return r(new Error("node type not supported"));et.writeFile(e,t.contents,{canOwn:!0})}et.chmod(e,t.mode),et.utime(e,t.timestamp,t.timestamp)}catch(e){return r(e)}r(null)},removeLocalEntry:function(e,t){try{et.lookupPath(e);var r=et.stat(e);et.isDir(r.mode)?et.rmdir(e):et.isFile(r.mode)&&et.unlink(e)}catch(e){return t(e)}t(null)},loadRemoteEntry:function(e,t,r){var n=e.get(t);n.onsuccess=function(e){r(null,e.target.result)},n.onerror=function(e){r(this.error),e.preventDefault()}},storeRemoteEntry:function(e,t,r,n){var o=e.put(r,t);o.onsuccess=function(){n(null)},o.onerror=function(e){n(this.error),e.preventDefault()}},removeRemoteEntry:function(e,t,r){var n=e.delete(t);n.onsuccess=function(){r(null)},n.onerror=function(e){r(this.error),e.preventDefault()}},reconcile:function(e,t,r){var n=0,o=[];Object.keys(e.entries).forEach(function(r){var i=e.entries[r],a=t.entries[r];(!a||i.timestamp>a.timestamp)&&(o.push(r),n++)});var i=[];if(Object.keys(t.entries).forEach(function(r){t.entries[r];e.entries[r]||(i.push(r),n++)}),!n)return r(null);var a=!1,s=("remote"===e.type?e.db:t.db).transaction([Ke.DB_STORE_NAME],"readwrite"),u=s.objectStore(Ke.DB_STORE_NAME);function c(e){if(e&&!a)return a=!0,r(e)}s.onerror=function(e){c(this.error),e.preventDefault()},s.oncomplete=function(e){a||r(null)},o.sort().forEach(function(e){"local"===t.type?Ke.loadRemoteEntry(u,e,function(t,r){if(t)return c(t);Ke.storeLocalEntry(e,r,c)}):Ke.loadLocalEntry(e,function(t,r){if(t)return c(t);Ke.storeRemoteEntry(u,e,r,c)})}),i.sort().reverse().forEach(function(e){"local"===t.type?Ke.removeLocalEntry(e,c):Ke.removeRemoteEntry(u,e,c)})}},Qe={isWindows:!1,staticInit:function(){Qe.isWindows=!!process.platform.match(/^win/);var e=process.binding("constants");e.fs&&(e=e.fs),Qe.flagsForNodeMap={1024:e.O_APPEND,64:e.O_CREAT,128:e.O_EXCL,0:e.O_RDONLY,2:e.O_RDWR,4096:e.O_SYNC,512:e.O_TRUNC,1:e.O_WRONLY}},bufferFrom:function(e){return Buffer.alloc?Buffer.from(e):new Buffer(e)},mount:function(e){return F(l),Qe.createNode(null,"/",Qe.getMode(e.opts.root),0)},createNode:function(e,t,r,n){if(!et.isDir(r)&&!et.isFile(r)&&!et.isLink(r))throw new et.ErrnoError(22);var o=et.createNode(e,t,r);return o.node_ops=Qe.node_ops,o.stream_ops=Qe.stream_ops,o},getMode:function(e){var t;try{t=mr.lstatSync(e),Qe.isWindows&&(t.mode=t.mode|(292&t.mode)>>2)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}return t.mode},realPath:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.mount.opts.root),t.reverse(),He.join.apply(null,t)},flagsForNode:function(e){e&=-2097153,e&=-2049,e&=-32769,e&=-524289;var t=0;for(var r in Qe.flagsForNodeMap)e&r&&(t|=Qe.flagsForNodeMap[r],e^=r);if(e)throw new et.ErrnoError(22);return t},node_ops:{getattr:function(e){var t,r=Qe.realPath(e);try{t=mr.lstatSync(r)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}return Qe.isWindows&&!t.blksize&&(t.blksize=4096),Qe.isWindows&&!t.blocks&&(t.blocks=(t.size+t.blksize-1)/t.blksize|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,blksize:t.blksize,blocks:t.blocks}},setattr:function(e,t){var r=Qe.realPath(e);try{if(void 0!==t.mode&&(mr.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.timestamp){var n=new Date(t.timestamp);mr.utimesSync(r,n,n)}void 0!==t.size&&mr.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},lookup:function(e,t){var r=He.join2(Qe.realPath(e),t),n=Qe.getMode(r);return Qe.createNode(e,t,n)},mknod:function(e,t,r,n){var o=Qe.createNode(e,t,r,n),i=Qe.realPath(o);try{et.isDir(o.mode)?mr.mkdirSync(i,o.mode):mr.writeFileSync(i,"",{mode:o.mode})}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}return o},rename:function(e,t,r){var n=Qe.realPath(e),o=He.join2(Qe.realPath(t),r);try{mr.renameSync(n,o)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},unlink:function(e,t){var r=He.join2(Qe.realPath(e),t);try{mr.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},rmdir:function(e,t){var r=He.join2(Qe.realPath(e),t);try{mr.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},readdir:function(e){var t=Qe.realPath(e);try{return mr.readdirSync(t)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},symlink:function(e,t,r){var n=He.join2(Qe.realPath(e),t);try{mr.symlinkSync(r,n)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},readlink:function(e){var t=Qe.realPath(e);try{return t=mr.readlinkSync(t),t=pr.relative(pr.resolve(e.mount.opts.root),t)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}}},stream_ops:{open:function(e){var t=Qe.realPath(e.node);try{et.isFile(e.node.mode)&&(e.nfd=mr.openSync(t,Qe.flagsForNode(e.flags)))}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},close:function(e){try{et.isFile(e.node.mode)&&e.nfd&&mr.closeSync(e.nfd)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},read:function(e,t,r,n,o){if(0===n)return 0;try{return mr.readSync(e.nfd,Qe.bufferFrom(t.buffer),r,n,o)}catch(e){throw new et.ErrnoError(-e.errno)}},write:function(e,t,r,n,o){try{return mr.writeSync(e.nfd,Qe.bufferFrom(t.buffer),r,n,o)}catch(e){throw new et.ErrnoError(-e.errno)}},llseek:function(e,t,r){var n=t;if(1===r)n+=e.position;else if(2===r&&et.isFile(e.node.mode))try{n+=mr.fstatSync(e.nfd).size}catch(e){throw new et.ErrnoError(-e.errno)}if(n<0)throw new et.ErrnoError(22);return n}}},Je={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function(e){F(u),Je.reader||(Je.reader=new FileReaderSync);var t=Je.createNode(null,"/",Je.DIR_MODE,0),r={};function n(e){for(var n=e.split("/"),o=t,i=0;i<n.length-1;i++){var a=n.slice(0,i+1).join("/");r[a]||(r[a]=Je.createNode(o,n[i],Je.DIR_MODE,0)),o=r[a]}return o}function o(e){var t=e.split("/");return t[t.length-1]}return Array.prototype.forEach.call(e.opts.files||[],function(e){Je.createNode(n(e.name),o(e.name),Je.FILE_MODE,0,e,e.lastModifiedDate)}),(e.opts.blobs||[]).forEach(function(e){Je.createNode(n(e.name),o(e.name),Je.FILE_MODE,0,e.data)}),(e.opts.packages||[]).forEach(function(e){e.metadata.files.forEach(function(t){var r=t.filename.substr(1);Je.createNode(n(r),o(r),Je.FILE_MODE,0,e.blob.slice(t.start,t.end))})}),t},createNode:function(e,t,r,n,o,i){var a=et.createNode(e,t,r);return a.mode=r,a.node_ops=Je.node_ops,a.stream_ops=Je.stream_ops,a.timestamp=(i||new Date).getTime(),F(Je.FILE_MODE!==Je.DIR_MODE),r===Je.FILE_MODE?(a.size=o.size,a.contents=o):(a.size=4096,a.contents={}),e&&(e.contents[t]=a),a},node_ops:{getattr:function(e){return{dev:1,ino:void 0,mode:e.mode,nlink:1,uid:0,gid:0,rdev:void 0,size:e.size,atime:new Date(e.timestamp),mtime:new Date(e.timestamp),ctime:new Date(e.timestamp),blksize:4096,blocks:Math.ceil(e.size/4096)}},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp)},lookup:function(e,t){throw new et.ErrnoError(2)},mknod:function(e,t,r,n){throw new et.ErrnoError(1)},rename:function(e,t,r){throw new et.ErrnoError(1)},unlink:function(e,t){throw new et.ErrnoError(1)},rmdir:function(e,t){throw new et.ErrnoError(1)},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){throw new et.ErrnoError(1)},readlink:function(e){throw new et.ErrnoError(1)}},stream_ops:{read:function(e,t,r,n,o){if(o>=e.node.size)return 0;var i=e.node.contents.slice(o,o+n),a=Je.reader.readAsArrayBuffer(i);return t.set(new Uint8Array(a),r),i.size},write:function(e,t,r,n,o){throw new et.ErrnoError(5)},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&et.isFile(e.node.mode)&&(n+=e.node.size),n<0)throw new et.ErrnoError(22);return n}}},Ze={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"},$e={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86},et={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(e){if(!(e instanceof et.ErrnoError))throw e+" : "+ze();return Ge(e.errno)},lookupPath:function(e,t){if(t=t||{},!(e=Ye.resolve(et.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===t[n]&&(t[n]=r[n]);if(t.recurse_count>8)throw new et.ErrnoError(40);for(var o=He.normalizeArray(e.split("/").filter(function(e){return!!e}),!1),i=et.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&t.parent)break;if(i=et.lookupNode(i,o[s]),a=He.join2(a,o[s]),et.isMountpoint(i)&&(!u||u&&t.follow_mount)&&(i=i.mounted.root),!u||t.follow)for(var c=0;et.isLink(i.mode);){var l=et.readlink(a);if(a=Ye.resolve(He.dirname(a),l),i=et.lookupPath(a,{recurse_count:t.recurse_count}).node,c++>40)throw new et.ErrnoError(40)}}return{path:a,node:i}},getPath:function(e){for(var t;;){if(et.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%et.nameTable.length},hashAddNode:function(e){var t=et.hashName(e.parent.id,e.name);e.name_next=et.nameTable[t],et.nameTable[t]=e},hashRemoveNode:function(e){var t=et.hashName(e.parent.id,e.name);if(et.nameTable[t]===e)et.nameTable[t]=e.name_next;else for(var r=et.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=et.mayLookup(e);if(r)throw new et.ErrnoError(r,e);for(var n=et.hashName(e.id,t),o=et.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return et.lookup(e,t)},createNode:function(e,t,r,n){if(!et.FSNode){et.FSNode=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=et.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},et.FSNode.prototype={};var o=365,i=146;Object.defineProperties(et.FSNode.prototype,{read:{get:function(){return(this.mode&o)===o},set:function(e){e?this.mode|=o:this.mode&=-366}},write:{get:function(){return(this.mode&i)===i},set:function(e){e?this.mode|=i:this.mode&=-147}},isFolder:{get:function(){return et.isDir(this.mode)}},isDevice:{get:function(){return et.isChrdev(this.mode)}}})}var a=new et.FSNode(e,t,r,n);return et.hashAddNode(a),a},destroyNode:function(e){et.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return!(49152&~e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var t=et.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return et.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:13},mayLookup:function(e){var t=et.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:13)},mayCreate:function(e,t){try{et.lookupNode(e,t);return 17}catch(e){}return et.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=et.lookupNode(e,t)}catch(e){return e.errno}var o=et.nodePermissions(e,"wx");if(o)return o;if(r){if(!et.isDir(n.mode))return 20;if(et.isRoot(n)||et.getPath(n)===et.cwd())return 16}else if(et.isDir(n.mode))return 21;return 0},mayOpen:function(e,t){return e?et.isLink(e.mode)?40:et.isDir(e.mode)&&("r"!==et.flagsToPermissionString(t)||512&t)?21:et.nodePermissions(e,et.flagsToPermissionString(t)):2},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||et.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!et.streams[r])return r;throw new et.ErrnoError(24)},getStream:function(e){return et.streams[e]},createStream:function(e,t,r){et.FSStream||(et.FSStream=function(){},et.FSStream.prototype={},Object.defineProperties(et.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}));var n=new et.FSStream;for(var o in e)n[o]=e[o];e=n;var i=et.nextfd(t,r);return e.fd=i,et.streams[i]=e,e},closeStream:function(e){et.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=et.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new et.ErrnoError(29)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){et.devices[e]={stream_ops:t}},getDevice:function(e){return et.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),et.syncFSRequests++,et.syncFSRequests>1&&console.log("warning: "+et.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=et.getMounts(et.root.mount),n=0;function o(e){return F(et.syncFSRequests>0),et.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach(function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)})},mount:function(e,t,r){var n,o="/"===r,i=!r;if(o&&et.root)throw new et.ErrnoError(16);if(!o&&!i){var a=et.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,et.isMountpoint(n))throw new et.ErrnoError(16);if(!et.isDir(n.mode))throw new et.ErrnoError(20)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?et.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(e){var t=et.lookupPath(e,{follow_mount:!1});if(!et.isMountpoint(t.node))throw new et.ErrnoError(22);var r=t.node,n=r.mounted,o=et.getMounts(n);Object.keys(et.nameTable).forEach(function(e){for(var t=et.nameTable[e];t;){var r=t.name_next;-1!==o.indexOf(t.mount)&&et.destroyNode(t),t=r}}),r.mounted=null;var i=r.mount.mounts.indexOf(n);F(-1!==i),r.mount.mounts.splice(i,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=et.lookupPath(e,{parent:!0}).node,o=He.basename(e);if(!o||"."===o||".."===o)throw new et.ErrnoError(22);var i=et.mayCreate(n,o);if(i)throw new et.ErrnoError(i);if(!n.node_ops.mknod)throw new et.ErrnoError(1);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,et.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,et.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{et.mkdir(n,t)}catch(e){if(17!=e.errno)throw e}}},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,et.mknod(e,t,r)},symlink:function(e,t){if(!Ye.resolve(e))throw new et.ErrnoError(2);var r=et.lookupPath(t,{parent:!0}).node;if(!r)throw new et.ErrnoError(2);var n=He.basename(t),o=et.mayCreate(r,n);if(o)throw new et.ErrnoError(o);if(!r.node_ops.symlink)throw new et.ErrnoError(1);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=He.dirname(e),i=He.dirname(t),a=He.basename(e),s=He.basename(t);try{r=et.lookupPath(e,{parent:!0}).node,n=et.lookupPath(t,{parent:!0}).node}catch(e){throw new et.ErrnoError(16)}if(!r||!n)throw new et.ErrnoError(2);if(r.mount!==n.mount)throw new et.ErrnoError(18);var u,c=et.lookupNode(r,a),l=Ye.relative(e,i);if("."!==l.charAt(0))throw new et.ErrnoError(22);if("."!==(l=Ye.relative(t,o)).charAt(0))throw new et.ErrnoError(39);try{u=et.lookupNode(n,s)}catch(e){}if(c!==u){var d=et.isDir(c.mode),f=et.mayDelete(r,a,d);if(f)throw new et.ErrnoError(f);if(f=u?et.mayDelete(n,s,d):et.mayCreate(n,s))throw new et.ErrnoError(f);if(!r.node_ops.rename)throw new et.ErrnoError(1);if(et.isMountpoint(c)||u&&et.isMountpoint(u))throw new et.ErrnoError(16);if(n!==r&&(f=et.nodePermissions(r,"w")))throw new et.ErrnoError(f);try{et.trackingDelegate.willMovePath&&et.trackingDelegate.willMovePath(e,t)}catch(r){console.log("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}et.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{et.hashAddNode(c)}try{et.trackingDelegate.onMovePath&&et.trackingDelegate.onMovePath(e,t)}catch(r){console.log("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}}},rmdir:function(e){var t=et.lookupPath(e,{parent:!0}).node,r=He.basename(e),n=et.lookupNode(t,r),o=et.mayDelete(t,r,!0);if(o)throw new et.ErrnoError(o);if(!t.node_ops.rmdir)throw new et.ErrnoError(1);if(et.isMountpoint(n))throw new et.ErrnoError(16);try{et.trackingDelegate.willDeletePath&&et.trackingDelegate.willDeletePath(e)}catch(t){console.log("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,r),et.destroyNode(n);try{et.trackingDelegate.onDeletePath&&et.trackingDelegate.onDeletePath(e)}catch(t){console.log("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){var t=et.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new et.ErrnoError(20);return t.node_ops.readdir(t)},unlink:function(e){var t=et.lookupPath(e,{parent:!0}).node,r=He.basename(e),n=et.lookupNode(t,r),o=et.mayDelete(t,r,!1);if(o)throw new et.ErrnoError(o);if(!t.node_ops.unlink)throw new et.ErrnoError(1);if(et.isMountpoint(n))throw new et.ErrnoError(16);try{et.trackingDelegate.willDeletePath&&et.trackingDelegate.willDeletePath(e)}catch(t){console.log("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,r),et.destroyNode(n);try{et.trackingDelegate.onDeletePath&&et.trackingDelegate.onDeletePath(e)}catch(t){console.log("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){var t=et.lookupPath(e).node;if(!t)throw new et.ErrnoError(2);if(!t.node_ops.readlink)throw new et.ErrnoError(22);return Ye.resolve(et.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var r=et.lookupPath(e,{follow:!t}).node;if(!r)throw new et.ErrnoError(2);if(!r.node_ops.getattr)throw new et.ErrnoError(1);return r.node_ops.getattr(r)},lstat:function(e){return et.stat(e,!0)},chmod:function(e,t,r){var n;"string"==typeof e?n=et.lookupPath(e,{follow:!r}).node:n=e;if(!n.node_ops.setattr)throw new et.ErrnoError(1);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){et.chmod(e,t,!0)},fchmod:function(e,t){var r=et.getStream(e);if(!r)throw new et.ErrnoError(9);et.chmod(r.node,t)},chown:function(e,t,r,n){var o;"string"==typeof e?o=et.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new et.ErrnoError(1);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){et.chown(e,t,r,!0)},fchown:function(e,t,r){var n=et.getStream(e);if(!n)throw new et.ErrnoError(9);et.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new et.ErrnoError(22);var r;"string"==typeof e?r=et.lookupPath(e,{follow:!0}).node:r=e;if(!r.node_ops.setattr)throw new et.ErrnoError(1);if(et.isDir(r.mode))throw new et.ErrnoError(21);if(!et.isFile(r.mode))throw new et.ErrnoError(22);var n=et.nodePermissions(r,"w");if(n)throw new et.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=et.getStream(e);if(!r)throw new et.ErrnoError(9);if(!(2097155&r.flags))throw new et.ErrnoError(22);et.truncate(r.node,t)},utime:function(e,t,r){var n=et.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(e,t,r,n,i){if(""===e)throw new et.ErrnoError(2);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?et.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=He.normalize(e);try{a=et.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new et.ErrnoError(17)}else a=et.mknod(e,r,0),s=!0;if(!a)throw new et.ErrnoError(2);if(et.isChrdev(a.mode)&&(t&=-513),65536&t&&!et.isDir(a.mode))throw new et.ErrnoError(20);if(!s){var u=et.mayOpen(a,t);if(u)throw new et.ErrnoError(u)}512&t&&et.truncate(a,0),t&=-641;var c=et.createStream({node:a,path:et.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&t||(et.readFiles||(et.readFiles={}),e in et.readFiles||(et.readFiles[e]=1,console.log("FS.trackingDelegate error on read file: "+e)));try{if(et.trackingDelegate.onOpenFile){var l=0;1!=(2097155&t)&&(l|=et.tracking.openFlags.READ),2097155&t&&(l|=et.tracking.openFlags.WRITE),et.trackingDelegate.onOpenFile(e,l)}}catch(t){console.log("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return c},close:function(e){if(et.isClosed(e))throw new et.ErrnoError(9);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{et.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,r){if(et.isClosed(e))throw new et.ErrnoError(9);if(!e.seekable||!e.stream_ops.llseek)throw new et.ErrnoError(29);if(0!=r&&1!=r&&2!=r)throw new et.ErrnoError(22);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:function(e,t,r,n,o){if(n<0||o<0)throw new et.ErrnoError(22);if(et.isClosed(e))throw new et.ErrnoError(9);if(1==(2097155&e.flags))throw new et.ErrnoError(9);if(et.isDir(e.node.mode))throw new et.ErrnoError(21);if(!e.stream_ops.read)throw new et.ErrnoError(22);var i=void 0!==o;if(i){if(!e.seekable)throw new et.ErrnoError(29)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:function(e,t,r,n,o,i){if(n<0||o<0)throw new et.ErrnoError(22);if(et.isClosed(e))throw new et.ErrnoError(9);if(!(2097155&e.flags))throw new et.ErrnoError(9);if(et.isDir(e.node.mode))throw new et.ErrnoError(21);if(!e.stream_ops.write)throw new et.ErrnoError(22);1024&e.flags&&et.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new et.ErrnoError(29)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);a||(e.position+=s);try{e.path&&et.trackingDelegate.onWriteToFile&&et.trackingDelegate.onWriteToFile(e.path)}catch(t){console.log("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return s},allocate:function(e,t,r){if(et.isClosed(e))throw new et.ErrnoError(9);if(t<0||r<=0)throw new et.ErrnoError(22);if(!(2097155&e.flags))throw new et.ErrnoError(9);if(!et.isFile(e.node.mode)&&!et.isDir(e.node.mode))throw new et.ErrnoError(19);if(!e.stream_ops.allocate)throw new et.ErrnoError(95);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o,i,a){if(2&i&&!(2&a)&&2!=(2097155&e.flags))throw new et.ErrnoError(13);if(1==(2097155&e.flags))throw new et.ErrnoError(13);if(!e.stream_ops.mmap)throw new et.ErrnoError(19);return e.stream_ops.mmap(e,t,r,n,o,i,a)},msync:function(e,t,r,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0},munmap:function(e){return 0},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new et.ErrnoError(25);return e.stream_ops.ioctl(e,t,r)},readFile:function(e,t){if((t=t||{}).flags=t.flags||"r",t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=et.open(e,t.flags),o=et.stat(e).size,i=new Uint8Array(o);return et.read(n,i,0,o,0),"utf8"===t.encoding?r=U(i,0):"binary"===t.encoding&&(r=i),et.close(n),r},writeFile:function(e,t,r){(r=r||{}).flags=r.flags||"w";var n=et.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(V(t)+1),i=X(t,o,0,o.length);et.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");et.write(n,t,0,t.byteLength,void 0,r.canOwn)}et.close(n)},cwd:function(){return et.currentPath},chdir:function(e){var t=et.lookupPath(e,{follow:!0});if(null===t.node)throw new et.ErrnoError(2);if(!et.isDir(t.node.mode))throw new et.ErrnoError(20);var r=et.nodePermissions(t.node,"x");if(r)throw new et.ErrnoError(r);et.currentPath=t.path},createDefaultDirectories:function(){et.mkdir("/tmp"),et.mkdir("/home"),et.mkdir("/home/web_user")},createDefaultDevices:function(){var e;if(et.mkdir("/dev"),et.registerDevice(et.makedev(1,3),{read:function(){return 0},write:function(e,t,r,n,o){return n}}),et.mkdev("/dev/null",et.makedev(1,3)),qe.register(et.makedev(5,0),qe.default_tty_ops),qe.register(et.makedev(6,0),qe.default_tty1_ops),et.mkdev("/dev/tty",et.makedev(5,0)),et.mkdev("/dev/tty1",et.makedev(6,0)),"object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);e=function(){return crypto.getRandomValues(t),t[0]}}else if(c)try{var n=r(328);e=function(){return n.randomBytes(1)[0]}}catch(e){}e||(e=function(){nn("no cryptographic support found for random_device. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}),et.createDevice("/dev","random",e),et.createDevice("/dev","urandom",e),et.mkdir("/dev/shm"),et.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){et.mkdir("/proc"),et.mkdir("/proc/self"),et.mkdir("/proc/self/fd"),et.mount({mount:function(){var e=et.createNode("/proc/self","fd",16895,73);return e.node_ops={lookup:function(e,t){var r=+t,n=et.getStream(r);if(!n)throw new et.ErrnoError(9);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){o.stdin?et.createDevice("/dev","stdin",o.stdin):et.symlink("/dev/tty","/dev/stdin"),o.stdout?et.createDevice("/dev","stdout",null,o.stdout):et.symlink("/dev/tty","/dev/stdout"),o.stderr?et.createDevice("/dev","stderr",null,o.stderr):et.symlink("/dev/tty1","/dev/stderr");var e=et.open("/dev/stdin","r"),t=et.open("/dev/stdout","w"),r=et.open("/dev/stderr","w");F(0===e.fd,"invalid handle for stdin ("+e.fd+")"),F(1===t.fd,"invalid handle for stdout ("+t.fd+")"),F(2===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:function(){et.ErrnoError||(et.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){for(var t in this.errno=e,$e)if($e[t]===e){this.code=t;break}},this.setErrno(e),this.message=Ze[e],this.stack&&Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack&&(this.stack=Ve(this.stack))},et.ErrnoError.prototype=new Error,et.ErrnoError.prototype.constructor=et.ErrnoError,[2].forEach(function(e){et.genericErrors[e]=new et.ErrnoError(e),et.genericErrors[e].stack="<generic error, no stack>"}))},staticInit:function(){et.ensureErrnoError(),et.nameTable=new Array(4096),et.mount(We,{},"/"),et.createDefaultDirectories(),et.createDefaultDevices(),et.createSpecialDirectories(),et.filesystems={MEMFS:We,IDBFS:Ke,NODEFS:Qe,WORKERFS:Je}},init:function(e,t,r){F(!et.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),et.init.initialized=!0,et.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=t||o.stdout,o.stderr=r||o.stderr,et.createStandardStreams()},quit:function(){et.init.initialized=!1;var e=o._fflush;e&&e(0);for(var t=0;t<et.streams.length;t++){var r=et.streams[t];r&&et.close(r)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},joinPath:function(e,t){var r=He.join.apply(null,e);return t&&"/"==r[0]&&(r=r.substr(1)),r},absolutePath:function(e,t){return Ye.resolve(t,e)},standardizePath:function(e){return He.normalize(e)},findObject:function(e,t){var r=et.analyzePath(e,t);return r.exists?r.object:(Ge(r.error),null)},analyzePath:function(e,t){try{e=(n=et.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=et.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=He.basename(e),n=et.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createFolder:function(e,t,r,n){var o=He.join2("string"==typeof e?e:et.getPath(e),t),i=et.getMode(r,n);return et.mkdir(o,i)},createPath:function(e,t,r,n){e="string"==typeof e?e:et.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=He.join2(e,i);try{et.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,t,r,n,o){var i=He.join2("string"==typeof e?e:et.getPath(e),t),a=et.getMode(n,o);return et.create(i,a)},createDataFile:function(e,t,r,n,o,i){var a=t?He.join2("string"==typeof e?e:et.getPath(e),t):e,s=et.getMode(n,o),u=et.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}et.chmod(u,146|s);var f=et.open(u,"w");et.write(f,r,0,r.length,0,i),et.close(f),et.chmod(u,s)}return u},createDevice:function(e,t,r,n){var o=He.join2("string"==typeof e?e:et.getPath(e),t),i=et.getMode(!!r,!!n);et.createDevice.major||(et.createDevice.major=64);var a=et.makedev(et.createDevice.major++,0);return et.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new et.ErrnoError(5)}if(void 0===u&&0===a)throw new et.ErrnoError(11);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,o,i){for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new et.ErrnoError(5)}return o&&(e.node.timestamp=Date.now()),a}}),et.mkdev(o,i,a)},createLink:function(e,t,r,n,o){var i=He.join2("string"==typeof e?e:et.getPath(e),t);return et.symlink(r,i)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;var t=!0;if("undefined"!=typeof XMLHttpRequest)throw new 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.");if(!h)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=vr(h(e.url),!0),e.usedBytes=e.contents.length}catch(e){t=!1}return t||Ge(5),t},createLazyFile:function(e,t,r,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter(function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):vr(o.responseText||"",!0)}(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]}),!i&&n||(a=n=1,n=this.getter(0).length,a=n,console.log("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=et.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var l={};return Object.keys(c.stream_ops).forEach(function(e){var t=c.stream_ops[e];l[e]=function(){if(!et.forceLoadFile(c))throw new et.ErrnoError(5);return t.apply(null,arguments)}}),l.read=function(e,t,r,n,o){if(!et.forceLoadFile(c))throw new et.ErrnoError(5);var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(F(a>=0),i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a},c.stream_ops=l,c},createPreloadedFile:function(e,t,r,n,i,a,s,u,c,l){nt.init();var d=t?Ye.resolve(He.join2(e,t)):e,f=De("cp "+d);function m(r){function m(r){l&&l(),u||et.createDataFile(e,t,r,n,i,c),a&&a(),Le(f)}var p=!1;o.preloadPlugins.forEach(function(e){p||e.canHandle(d)&&(e.handle(r,d,m,function(){s&&s(),Le(f)}),p=!0)}),p||m(r)}ke(f),"string"==typeof r?nt.asyncLoad(r,function(e){m(e)},s):m(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=et.indexedDB();try{var o=n.open(et.DB_NAME(),et.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=function(){console.log("creating db"),o.result.createObjectStore(et.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([et.DB_STORE_NAME],"readwrite"),i=n.objectStore(et.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach(function(e){var t=i.put(et.analyzePath(e).object.contents,e);t.onsuccess=function(){++a+s==u&&c()},t.onerror=function(){s++,a+s==u&&c()}}),n.onerror=r},o.onerror=r},loadFilesFromDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=et.indexedDB();try{var o=n.open(et.DB_NAME(),et.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([et.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(et.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?t():r()}e.forEach(function(e){var t=a.get(e);t.onsuccess=function(){et.analyzePath(e).exists&&et.unlink(e),et.createDataFile(He.dirname(e),He.basename(e),t.result,!0,!0,!0),++s+u==c&&l()},t.onerror=function(){u++,s+u==c&&l()}}),i.onerror=r},o.onerror=r}};function tt(e,t){if(nt.mainLoop.timingMode=e,nt.mainLoop.timingValue=t,!nt.mainLoop.func)return console.error("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."),1;if(0==e)nt.mainLoop.scheduler=function(){var e=0|Math.max(0,nt.mainLoop.tickStartTime+t-rt());setTimeout(nt.mainLoop.runner,e)},nt.mainLoop.method="timeout";else if(1==e)nt.mainLoop.scheduler=function(){nt.requestAnimationFrame(nt.mainLoop.runner)},nt.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",function(e){e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())},!0),setImmediate=function(e){r.push(e),u?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}nt.mainLoop.scheduler=function(){setImmediate(nt.mainLoop.runner)},nt.mainLoop.method="immediate"}return 0}function rt(){nn()}var nt={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){nt.mainLoop.scheduler=null,nt.mainLoop.currentlyRunningMainloop++},resume:function(){nt.mainLoop.currentlyRunningMainloop++;var e=nt.mainLoop.timingMode,t=nt.mainLoop.timingValue,r=nt.mainLoop.func;nt.mainLoop.func=null,function(e,t,r,n,i){var a;o.noExitRuntime=!0,F(!nt.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),nt.mainLoop.func=e,nt.mainLoop.arg=n,a=void 0!==n?function(){o.dynCall_vi(e,n)}:function(){o.dynCall_v(e)};var s=nt.mainLoop.currentlyRunningMainloop;if(nt.mainLoop.runner=function(){if(!L)if(nt.mainLoop.queue.length>0){var e=Date.now(),t=nt.mainLoop.queue.shift();if(t.func(t.arg),nt.mainLoop.remainingBlockers){var r=nt.mainLoop.remainingBlockers,n=r%1==0?r-1:Math.floor(r);t.counted?nt.mainLoop.remainingBlockers=n:(n+=.5,nt.mainLoop.remainingBlockers=(8*r+n)/9)}if(console.log('main loop blocker "'+t.name+'" took '+(Date.now()-e)+" ms"),nt.mainLoop.updateStatus(),s<nt.mainLoop.currentlyRunningMainloop)return;setTimeout(nt.mainLoop.runner,0)}else s<nt.mainLoop.currentlyRunningMainloop||(nt.mainLoop.currentFrameNumber=nt.mainLoop.currentFrameNumber+1|0,1==nt.mainLoop.timingMode&&nt.mainLoop.timingValue>1&&nt.mainLoop.currentFrameNumber%nt.mainLoop.timingValue!=0?nt.mainLoop.scheduler():(0==nt.mainLoop.timingMode&&(nt.mainLoop.tickStartTime=rt()),bt.newRenderingFrameStarted(),"timeout"===nt.mainLoop.method&&o.ctx&&(_("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),nt.mainLoop.method=""),nt.mainLoop.runIter(a),ae(),s<nt.mainLoop.currentlyRunningMainloop||("object"==typeof ot&&ot.audio&&ot.audio.queueNewAudioData&&ot.audio.queueNewAudioData(),nt.mainLoop.scheduler())))},i||(t&&t>0?tt(0,1e3/t):tt(1,1),nt.mainLoop.scheduler()),r)throw"SimulateInfiniteLoop"}(r,0,!1,nt.mainLoop.arg,!0),tt(e,t),nt.mainLoop.scheduler()},updateStatus:function(){if(o.setStatus){var e=o.statusMessage||"Please wait...",t=nt.mainLoop.remainingBlockers,r=nt.mainLoop.expectedBlockers;t?t<r?o.setStatus(e+" ("+(r-t)+"/"+r+")"):o.setStatus(e):o.setStatus("")}},runIter:function(e){if(!L){if(o.preMainLoop)if(!1===o.preMainLoop())return;try{e()}catch(e){if(e instanceof en)return;throw e&&"object"==typeof e&&e.stack&&_("exception thrown: "+[e,e.stack]),e}o.postMainLoop&&o.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(o.preloadPlugins||(o.preloadPlugins=[]),!nt.initted){nt.initted=!0;try{new Blob,nt.hasBlobConstructor=!0}catch(e){nt.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}nt.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:nt.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),nt.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,o.noImageDecoding||void 0!==nt.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),o.noImageDecoding=!0);var e={canHandle:function(e){return!o.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var i=null;if(nt.hasBlobConstructor)try{(i=new Blob([e],{type:nt.getMimetype(t)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:nt.getMimetype(t)}))}catch(e){A("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!i){var a=new nt.BlobBuilder;a.append(new Uint8Array(e).buffer),i=a.getBlob()}var s=nt.URLObject.createObjectURL(i);F("string"==typeof s,"createObjectURL must return a url as a string");var u=new Image;u.onload=function(){F(u.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=u.width,n.height=u.height,n.getContext("2d").drawImage(u,0,0),o.preloadedImages[t]=n,nt.URLObject.revokeObjectURL(s),r&&r(e)},u.onerror=function(e){console.log("Image "+s+" could not be decoded"),n&&n()},u.src=s}};o.preloadPlugins.push(e);var t={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var i=!1;function a(n){i||(i=!0,o.preloadedAudios[t]=n,r&&r(e))}function s(){i||(i=!0,o.preloadedAudios[t]=new Audio,n&&n())}if(!nt.hasBlobConstructor)return s();try{var u=new Blob([e],{type:nt.getMimetype(t)})}catch(e){return s()}var c=nt.URLObject.createObjectURL(u);F("string"==typeof c,"createObjectURL must return a url as a string");var l=new Audio;l.addEventListener("canplaythrough",function(){a(l)},!1),l.onerror=function(r){i||(console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),l.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),a(l))},l.src=c,nt.safeSetTimeout(function(){a(l)},1e4)}};o.preloadPlugins.push(t);var r=o.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&r.addEventListener("click",function(e){!nt.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())},!1))}function n(){nt.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},createContext:function(e,t,r,n){if(t&&o.ctx&&e==o.canvas)return o.ctx;var i,a;if(t){var s={antialias:!1,alpha:!1,majorVersion:1};if(n)for(var u in n)s[u]=n[u];void 0!==bt&&(a=bt.createContext(e,s))&&(i=bt.getContext(a).GLctx)}else i=e.getContext("2d");return i?(r&&(t||F(void 0===sr,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=i,t&&bt.makeContextCurrent(a),o.useWebGL=t,nt.moduleContextCreatedCallbacks.forEach(function(e){e()}),nt.init()),i):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t,r){nt.lockPointer=e,nt.resizeCanvas=t,nt.vrDevice=r,void 0===nt.lockPointer&&(nt.lockPointer=!0),void 0===nt.resizeCanvas&&(nt.resizeCanvas=!1),void 0===nt.vrDevice&&(nt.vrDevice=null);var n=o.canvas;function i(){nt.isFullscreen=!1;var e=n.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.exitFullscreen=nt.exitFullscreen,nt.lockPointer&&n.requestPointerLock(),nt.isFullscreen=!0,nt.resizeCanvas?nt.setFullscreenCanvasSize():nt.updateCanvasDimensions(n)):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),nt.resizeCanvas?nt.setWindowedCanvasSize():nt.updateCanvasDimensions(n)),o.onFullScreen&&o.onFullScreen(nt.isFullscreen),o.onFullscreen&&o.onFullscreen(nt.isFullscreen)}nt.fullscreenHandlersInstalled||(nt.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("MSFullscreenChange",i,!1));var a=document.createElement("div");n.parentNode.insertBefore(a,n),a.appendChild(n),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?function(){a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?a.requestFullscreen({vrDisplay:r}):a.requestFullscreen()},requestFullScreen:function(e,t,r){return _("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead."),nt.requestFullScreen=function(e,t,r){return nt.requestFullscreen(e,t,r)},nt.requestFullscreen(e,t,r)},exitFullscreen:function(){return!!nt.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===nt.nextRAF)nt.nextRAF=t+1e3/60;else for(;t+2>=nt.nextRAF;)nt.nextRAF+=1e3/60;var r=Math.max(nt.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,nt.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeCallback:function(e){return function(){if(!L)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){nt.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(nt.allowAsyncCallbacks=!0,nt.queuedAsyncCallbacks.length>0){var e=nt.queuedAsyncCallbacks;nt.queuedAsyncCallbacks=[],e.forEach(function(e){e()})}},safeRequestAnimationFrame:function(e){return nt.requestAnimationFrame(function(){L||(nt.allowAsyncCallbacks?e():nt.queuedAsyncCallbacks.push(e))})},safeSetTimeout:function(e,t){return o.noExitRuntime=!0,setTimeout(function(){L||(nt.allowAsyncCallbacks?e():nt.queuedAsyncCallbacks.push(e))},t)},safeSetInterval:function(e,t){return o.noExitRuntime=!0,setInterval(function(){L||nt.allowAsyncCallbacks&&e()},t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(nt.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?nt.mouseMovementX=nt.mouseMovementY=0:(nt.mouseMovementX=nt.getMovementX(e),nt.mouseMovementY=nt.getMovementY(e)),void 0!==ot?(nt.mouseX=ot.mouseX+nt.mouseMovementX,nt.mouseY=ot.mouseY+nt.mouseMovementY):(nt.mouseX+=nt.mouseMovementX,nt.mouseY+=nt.mouseMovementY);else{var t=o.canvas.getBoundingClientRect(),r=o.canvas.width,n=o.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(F(void 0!==i&&void 0!==a,"Unable to retrieve scroll position, mouse positions likely broken."),"touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var s=e.touch;if(void 0===s)return;var u=s.pageX-(i+t.left),c=s.pageY-(a+t.top),l={x:u*=r/t.width,y:c*=n/t.height};if("touchstart"===e.type)nt.lastTouches[s.identifier]=l,nt.touches[s.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=nt.touches[s.identifier];d||(d=l),nt.lastTouches[s.identifier]=d,nt.touches[s.identifier]=l}return}var f=e.pageX-(i+t.left),m=e.pageY-(a+t.top);f*=r/t.width,m*=n/t.height,nt.mouseMovementX=f-nt.mouseX,nt.mouseMovementY=m-nt.mouseY,nt.mouseX=f,nt.mouseY=m}},asyncLoad:function(e,t,r,n){var o=n?"":De("al "+e);v(e,function(r){F(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&Le(o)},function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()}),o&&ke(o)},resizeListeners:[],updateResizeListeners:function(){var e=o.canvas;nt.resizeListeners.forEach(function(t){t(e.width,e.height)})},setCanvasSize:function(e,t,r){var n=o.canvas;nt.updateCanvasDimensions(n,e,t),r||nt.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(void 0!==ot){var e=J[ot.screen>>2];e|=8388608,Q[ot.screen>>2]=e}nt.updateCanvasDimensions(o.canvas),nt.updateResizeListeners()},setWindowedCanvasSize:function(){if(void 0!==ot){var e=J[ot.screen>>2];e&=-8388609,Q[ot.screen>>2]=e}nt.updateCanvasDimensions(o.canvas),nt.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,i=r;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/i<o.forcedAspectRatio?n=Math.round(i*o.forcedAspectRatio):i=Math.round(n/o.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var a=Math.min(screen.width/n,screen.height/i);n=Math.round(n*a),i=Math.round(i*a)}nt.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||i!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=nt.nextWgetRequestHandle;return nt.nextWgetRequestHandle++,e}};var ot={defaults:{width:320,height:200,copyOnLock:!0,discardOnLock:!1,opaqueFrontBuffer:!0},version:null,surfaces:{},canvasPool:[],events:[],fonts:[null],audios:[null],rwops:[null],music:{audio:null,volume:1},mixerFrequency:22050,mixerFormat:32784,mixerNumChannels:2,mixerChunkSize:1024,channelMinimumNumber:0,GL:!1,glAttributes:{0:3,1:3,2:2,3:0,4:0,5:1,6:16,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:1,16:0,17:0,18:0},keyboardState:null,keyboardMap:{},canRequestFullscreen:!1,isRequestingFullscreen:!1,textInput:!1,startTime:null,initFlags:0,buttonState:0,modState:0,DOMButtons:[0,0,0],DOMEventToSDLEvent:{},TOUCH_DEFAULT_ID:0,eventHandler:null,eventHandlerContext:null,eventHandlerTemp:0,keyCodes:{16:1249,17:1248,18:1250,20:1081,33:1099,34:1102,35:1101,36:1098,37:1104,38:1106,39:1103,40:1105,44:316,45:1097,46:127,91:1251,93:1125,96:1122,97:1113,98:1114,99:1115,100:1116,101:1117,102:1118,103:1119,104:1120,105:1121,106:1109,107:1111,109:1110,110:1123,111:1108,112:1082,113:1083,114:1084,115:1085,116:1086,117:1087,118:1088,119:1089,120:1090,121:1091,122:1092,123:1093,124:1128,125:1129,126:1130,127:1131,128:1132,129:1133,130:1134,131:1135,132:1136,133:1137,134:1138,135:1139,144:1107,160:94,161:33,162:34,163:35,164:36,165:37,166:38,167:95,168:40,169:41,170:42,171:43,172:124,173:45,174:123,175:125,176:126,181:127,182:129,183:128,188:44,190:46,191:47,192:96,219:91,220:92,221:93,222:39,224:1251},scanCodes:{8:42,9:43,13:40,27:41,32:44,35:204,39:53,44:54,46:55,47:56,48:39,49:30,50:31,51:32,52:33,53:34,54:35,55:36,56:37,57:38,58:203,59:51,61:46,91:47,92:49,93:48,96:52,97:4,98:5,99:6,100:7,101:8,102:9,103:10,104:11,105:12,106:13,107:14,108:15,109:16,110:17,111:18,112:19,113:20,114:21,115:22,116:23,117:24,118:25,119:26,120:27,121:28,122:29,127:76,305:224,308:226,316:70},loadRect:function(e){return{x:Q[e+0>>2],y:Q[e+4>>2],w:Q[e+8>>2],h:Q[e+12>>2]}},updateRect:function(e,t){Q[e>>2]=t.x,Q[e+4>>2]=t.y,Q[e+8>>2]=t.w,Q[e+12>>2]=t.h},intersectionOfRects:function(e,t){var r=Math.max(e.x,t.x),n=Math.max(e.y,t.y),o=Math.min(e.x+e.w,t.x+t.w),i=Math.min(e.y+e.h,t.y+t.h);return{x:r,y:n,w:Math.max(r,o)-r,h:Math.max(n,i)-n}},checkPixelFormat:function(e){-2042224636!=Q[e>>2]&&A("Unsupported pixel format!")},loadColorToCSSRGB:function(e){var t=Q[e>>2];return"rgb("+(255&t)+","+(t>>8&255)+","+(t>>16&255)+")"},loadColorToCSSRGBA:function(e){var t=Q[e>>2];return"rgba("+(255&t)+","+(t>>8&255)+","+(t>>16&255)+","+(t>>24&255)/255+")"},translateColorToCSSRGBA:function(e){return"rgba("+(255&e)+","+(e>>8&255)+","+(e>>16&255)+","+(e>>>24)/255+")"},translateRGBAToCSSRGBA:function(e,t,r,n){return"rgba("+(255&e)+","+(255&t)+","+(255&r)+","+(255&n)/255+")"},translateRGBAToColor:function(e,t,r,n){return e|t<<8|r<<16|n<<24},makeSurface:function(e,t,r,n,i,a,s,u,c){var l,d=1&(r=r||0),f=2097152&r,m=67108864&r,p=Rr(60),h=Rr(44),v=f?1:4,E=0;d||m||(E=Rr(e*t*4)),Q[p>>2]=r,Q[p+4>>2]=h,Q[p+8>>2]=e,Q[p+12>>2]=t,Q[p+16>>2]=e*v,Q[p+20>>2]=E,Q[p+36>>2]=0,Q[p+40>>2]=0,Q[p+44>>2]=o.canvas.width,Q[p+48>>2]=o.canvas.height,Q[p+56>>2]=1,Q[h>>2]=-2042224636,Q[h+4>>2]=0,Y[h+8|0]=8*v,Y[h+9|0]=v,Q[h+12>>2]=a||255,Q[h+16>>2]=s||65280,Q[h+20>>2]=u||16711680,Q[h+24>>2]=c||4278190080,ot.GL=ot.GL||m,n?l=o.canvas:((l=ot.canvasPool.length>0?ot.canvasPool.pop():document.createElement("canvas")).width=e,l.height=t);var g={antialias:0!=ot.glAttributes[13]&&ot.glAttributes[14]>1,depth:ot.glAttributes[6]>0,stencil:ot.glAttributes[7]>0,alpha:ot.glAttributes[3]>0},y=nt.createContext(l,m,n,g);return ot.surfaces[p]={width:e,height:t,canvas:l,ctx:y,surf:p,buffer:E,pixelFormat:h,alpha:255,flags:r,locked:0,usePageCanvas:n,source:i,isFlagSet:function(e){return r&e}},p},copyIndexedColorData:function(e,t,r,n,i){if(e.colors){var a=o.canvas.width,s=o.canvas.height,u=t||0,c=r||0,l=(n||a-u)+u,d=(i||s-c)+c,f=e.buffer;e.image.data32||(e.image.data32=new Uint32Array(e.image.data.buffer));for(var m=e.image.data32,p=e.colors32,h=c;h<d;++h)for(var v=h*a,E=u;E<l;++E)m[v+E]=p[q[f+v+E|0]]}},freeSurface:function(e){var t=e+56,r=Q[t>>2];if(r>1)Q[t>>2]=r-1;else{var n=ot.surfaces[e];!n.usePageCanvas&&n.canvas&&ot.canvasPool.push(n.canvas),n.buffer&&Sr(n.buffer),Sr(n.pixelFormat),Sr(e),ot.surfaces[e]=null,e===ot.screen&&(ot.screen=null)}},blitSurface:function(e,t,r,n,i){var a,s,u,c,l=ot.surfaces[e],d=ot.surfaces[r];if(a=t?ot.loadRect(t):{x:0,y:0,w:l.width,h:l.height},s=n?ot.loadRect(n):{x:0,y:0,w:l.width,h:l.height},d.clipRect){var f=i&&0!==a.w?a.w/s.w:1,m=i&&0!==a.h?a.h/s.h:1;s=ot.intersectionOfRects(d.clipRect,s),a.w=s.w*f,a.h=s.h*m,n&&ot.updateRect(n,s)}if(i?(u=s.w,c=s.h):(u=a.w,c=a.h),0===a.w||0===a.h||0===u||0===c)return 0;var p=d.ctx.globalAlpha;return d.ctx.globalAlpha=l.alpha/255,d.ctx.drawImage(l.canvas,a.x,a.y,a.w,a.h,s.x,s.y,u,c),d.ctx.globalAlpha=p,r!=ot.screen&&(A("WARNING: copying canvas data to memory for compatibility"),function(e){var t=ot.surfaces[e];if(t.locked++,t.locked>1)return 0;if(t.buffer||(t.buffer=Rr(t.width*t.height*4),Q[e+20>>2]=t.buffer),Q[e+20>>2]=t.buffer,e==ot.screen&&o.screenIsReadOnly&&t.image)return 0;if(ot.defaults.discardOnLock){if(t.image||(t.image=t.ctx.createImageData(t.width,t.height)),!ot.defaults.opaqueFrontBuffer)return}else t.image=t.ctx.getImageData(0,0,t.width,t.height);if(e==ot.screen&&ot.defaults.opaqueFrontBuffer)for(var r=t.image.data,n=r.length,i=0;i<n/4;i++)r[4*i+3]=255;if(ot.defaults.copyOnLock&&!ot.defaults.discardOnLock){if(t.isFlagSet(2097152))throw"CopyOnLock is not supported for SDL_LockSurface with SDL_HWPALETTE flag set"+(new Error).stack;q.set(t.image.data,t.buffer)}}(r),d.locked--),0},downFingers:{},savedKeydown:null,receiveEvent:function(e){function t(){for(var e in ot.keyboardMap)ot.events.push({type:"keyup",keyCode:ot.keyboardMap[e]})}switch(e.type){case"touchstart":case"touchmove":e.preventDefault();var r=[];if("touchstart"===e.type)for(var n=0;n<e.touches.length;n++){var i=e.touches[n];1!=ot.downFingers[i.identifier]&&(ot.downFingers[i.identifier]=!0,r.push(i))}else r=e.touches;var a=r[0];if(a){var s;switch("touchstart"==e.type&&(ot.DOMButtons[0]=1),e.type){case"touchstart":s="mousedown";break;case"touchmove":s="mousemove"}var u={type:s,button:0,pageX:a.clientX,pageY:a.clientY};ot.events.push(u)}for(n=0;n<r.length;n++){i=r[n];ot.events.push({type:e.type,touch:i})}break;case"touchend":e.preventDefault();for(n=0;n<e.changedTouches.length;n++){i=e.changedTouches[n];!0===ot.downFingers[i.identifier]&&delete ot.downFingers[i.identifier]}u={type:"mouseup",button:0,pageX:e.changedTouches[0].clientX,pageY:e.changedTouches[0].clientY};ot.DOMButtons[0]=0,ot.events.push(u);for(n=0;n<e.changedTouches.length;n++){i=e.changedTouches[n];ot.events.push({type:"touchend",touch:i})}break;case"DOMMouseScroll":case"mousewheel":case"wheel":var c=-nt.getMouseWheelDelta(e),l=(c=0==c?0:c>0?Math.max(c,1):Math.min(c,-1))>0?3:4;ot.events.push({type:"mousedown",button:l,pageX:e.pageX,pageY:e.pageY}),ot.events.push({type:"mouseup",button:l,pageX:e.pageX,pageY:e.pageY}),ot.events.push({type:"wheel",deltaX:0,deltaY:c}),e.preventDefault();break;case"mousemove":if(1===ot.DOMButtons[0]&&ot.events.push({type:"touchmove",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),nt.pointerLock&&("mozMovementX"in e&&(e.movementX=e.mozMovementX,e.movementY=e.mozMovementY),0==e.movementX&&0==e.movementY))return void e.preventDefault();case"keydown":case"keyup":case"keypress":case"mousedown":case"mouseup":if("keydown"===e.type&&(ot.unicode||ot.textInput)&&8!==e.keyCode&&9!==e.keyCode||e.preventDefault(),"mousedown"==e.type)ot.DOMButtons[e.button]=1,ot.events.push({type:"touchstart",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}});else if("mouseup"==e.type){if(!ot.DOMButtons[e.button])return;ot.events.push({type:"touchend",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),ot.DOMButtons[e.button]=0}"keydown"===e.type||"mousedown"===e.type?ot.canRequestFullscreen=!0:"keyup"!==e.type&&"mouseup"!==e.type||(ot.isRequestingFullscreen&&(o.requestFullscreen(!0,!0),ot.isRequestingFullscreen=!1),ot.canRequestFullscreen=!1),"keypress"===e.type&&ot.savedKeydown?(ot.savedKeydown.keypressCharCode=e.charCode,ot.savedKeydown=null):"keydown"===e.type&&(ot.savedKeydown=e),("keypress"!==e.type||ot.textInput)&&ot.events.push(e);break;case"mouseout":for(n=0;n<3;n++)ot.DOMButtons[n]&&(ot.events.push({type:"mouseup",button:n,pageX:e.pageX,pageY:e.pageY}),ot.DOMButtons[n]=0);e.preventDefault();break;case"focus":ot.events.push(e),e.preventDefault();break;case"blur":ot.events.push(e),t(),e.preventDefault();break;case"visibilitychange":ot.events.push({type:"visibilitychange",visible:!document.hidden}),t(),e.preventDefault();break;case"unload":return void(nt.mainLoop.runner&&(ot.events.push(e),nt.mainLoop.runner()));case"resize":ot.events.push(e),e.preventDefault&&e.preventDefault()}ot.events.length>=1e4&&(_("SDL event queue full, dropping events"),ot.events=ot.events.slice(0,1e4)),ot.flushEventsToHandler()},lookupKeyCodeForEvent:function(e){var t=e.keyCode;return t>=65&&t<=90?t+=32:(t=ot.keyCodes[e.keyCode]||e.keyCode,e.location===KeyboardEvent.DOM_KEY_LOCATION_RIGHT&&t>=1248&&t<=1251&&(t+=4)),t},handleEvent:function(e){if(!e.handled)switch(e.handled=!0,e.type){case"touchstart":case"touchend":case"touchmove":nt.calculateMouseEvent(e);break;case"keydown":case"keyup":var t="keydown"===e.type,r=ot.lookupKeyCodeForEvent(e);Y[ot.keyboardState+r|0]=t,ot.modState=(Y[ot.keyboardState+1248|0]?64:0)|(Y[ot.keyboardState+1249|0]?1:0)|(Y[ot.keyboardState+1250|0]?256:0)|(Y[ot.keyboardState+1252|0]?128:0)|(Y[ot.keyboardState+1253|0]?2:0)|(Y[ot.keyboardState+1254|0]?512:0),t?ot.keyboardMap[r]=e.keyCode:delete ot.keyboardMap[r];break;case"mousedown":case"mouseup":"mousedown"==e.type?ot.buttonState|=1<<e.button:"mouseup"==e.type&&(ot.buttonState&=~(1<<e.button));case"mousemove":nt.calculateMouseEvent(e)}},flushEventsToHandler:function(){if(ot.eventHandler)for(;ot.pollEvent(ot.eventHandlerTemp);)o.dynCall_iii(ot.eventHandler,ot.eventHandlerContext,ot.eventHandlerTemp)},pollEvent:function(e){if(512&ot.initFlags&&ot.joystickEventState&&ot.queryJoysticks(),e){for(;ot.events.length>0;)if(!1!==ot.makeCEvent(ot.events.shift(),e))return 1;return 0}return ot.events.length>0},makeCEvent:function(e,t){if("number"==typeof e)return Dr(t,e,28),void Sr(e);switch(ot.handleEvent(e),e.type){case"keydown":case"keyup":var r,n="keydown"===e.type,i=ot.lookupKeyCodeForEvent(e);r=i>=1024?i-1024:ot.scanCodes[i]||i,Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Y[t+8|0]=n?1:0,Y[t+9|0]=0,Q[t+12>>2]=r,Q[t+16>>2]=i,W[t+20>>1]=ot.modState,Q[t+24>>2]=e.keypressCharCode||i;break;case"keypress":Q[t>>2]=ot.DOMEventToSDLEvent[e.type];for(var a=vr(String.fromCharCode(e.charCode)),s=0;s<a.length;++s)Y[t+(8+s)|0]=a[s];break;case"mousedown":case"mouseup":case"mousemove":if("mousemove"!=e.type){n="mousedown"===e.type;Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Q[t+8>>2]=0,Q[t+12>>2]=0,Y[t+16|0]=e.button+1,Y[t+17|0]=n?1:0,Q[t+20>>2]=nt.mouseX,Q[t+24>>2]=nt.mouseY}else Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Q[t+8>>2]=0,Q[t+12>>2]=0,Q[t+16>>2]=ot.buttonState,Q[t+20>>2]=nt.mouseX,Q[t+24>>2]=nt.mouseY,Q[t+28>>2]=nt.mouseMovementX,Q[t+32>>2]=nt.mouseMovementY;break;case"wheel":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+16>>2]=e.deltaX,Q[t+20>>2]=e.deltaY;break;case"touchstart":case"touchend":case"touchmove":var u=e.touch;if(!nt.touches[u.identifier])break;var c=o.canvas.width,l=o.canvas.height,d=nt.touches[u.identifier].x/c,f=nt.touches[u.identifier].y/l,m=d-nt.lastTouches[u.identifier].x/c,p=f-nt.lastTouches[u.identifier].y/l;if(void 0===u.deviceID&&(u.deviceID=ot.TOUCH_DEFAULT_ID),0===m&&0===p&&"touchmove"===e.type)return!1;Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=Date.now()-ot.startTime|0,Ie=[u.deviceID>>>0,(Pe=u.deviceID,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[t+8>>2]=Ie[0],Q[t+12>>2]=Ie[1],Ie=[u.identifier>>>0,(Pe=u.identifier,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[t+16>>2]=Ie[0],Q[t+20>>2]=Ie[1],Z[t+24>>2]=d,Z[t+28>>2]=f,Z[t+32>>2]=m,Z[t+36>>2]=p,void 0!==u.force?Z[t+40>>2]=u.force:Z[t+40>>2]="touchend"==e.type?0:1;break;case"unload":Q[t>>2]=ot.DOMEventToSDLEvent[e.type];break;case"resize":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=e.w,Q[t+8>>2]=e.h;break;case"joystick_button_up":case"joystick_button_down":var h="joystick_button_up"===e.type?0:1;Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Y[t+4|0]=e.index,Y[t+5|0]=e.button,Y[t+6|0]=h;break;case"joystick_axis_motion":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Y[t+4|0]=e.index,Y[t+5|0]=e.axis,Q[t+8>>2]=ot.joystickAxisValueConversion(e.value);break;case"focus":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Y[t+8|0]=12;break;case"blur":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Y[t+8|0]=13;break;case"visibilitychange":var v=e.visible?1:2;Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Y[t+8|0]=v;break;default:throw"Unhandled SDL event: "+e.type}},makeFontString:function(e,t){return"'"!=t.charAt(0)&&'"'!=t.charAt(0)&&(t='"'+t+'"'),e+"px "+t+", serif"},estimateTextWidth:function(e,t){var r=e.size,n=ot.makeFontString(r,e.name),o=ot.ttfContext;return F(o,"TTF_Init must have been called"),o.font=n,0|o.measureText(t).width},allocateChannels:function(e){if(!(ot.numChannels&&ot.numChannels>=e&&0!=e)){ot.numChannels=e,ot.channels=[];for(var t=0;t<e;t++)ot.channels[t]={audio:null,volume:1}}},setGetVolume:function(e,t){if(!e)return 0;var r=128*e.volume;if(-1!=t&&(e.volume=Math.min(Math.max(t,0),128)/128,e.audio))try{e.audio.volume=e.volume,e.audio.webAudioGainNode&&(e.audio.webAudioGainNode.gain.value=e.volume)}catch(e){_("setGetVolume failed to set audio volume: "+e)}return r},setPannerPosition:function(e,t,r,n){e&&e.audio&&e.audio.webAudioPannerNode&&e.audio.webAudioPannerNode.setPosition(t,r,n)},playWebAudio:function(e){if(e&&!e.webAudioNode&&ot.webAudioAvailable())try{var t=e.resource.webAudio;if(e.paused=!1,!t.decodedBuffer)return void 0===t.onDecodeComplete&&nn("Cannot play back audio object that was not loaded"),void t.onDecodeComplete.push(function(){e.paused||ot.playWebAudio(e)});e.webAudioNode=ot.audioContext.createBufferSource(),e.webAudioNode.buffer=t.decodedBuffer,e.webAudioNode.loop=e.loop,e.webAudioNode.onended=function(){e.onended()},e.webAudioPannerNode=ot.audioContext.createPanner(),e.webAudioPannerNode.setPosition(0,0,-.5),e.webAudioPannerNode.panningModel="equalpower",e.webAudioGainNode=ot.audioContext.createGain(),e.webAudioGainNode.gain.value=e.volume,e.webAudioNode.connect(e.webAudioPannerNode),e.webAudioPannerNode.connect(e.webAudioGainNode),e.webAudioGainNode.connect(ot.audioContext.destination),e.webAudioNode.start(0,e.currentPosition),e.startTime=ot.audioContext.currentTime-e.currentPosition}catch(e){_("playWebAudio failed: "+e)}},pauseWebAudio:function(e){if(e){if(e.webAudioNode)try{e.currentPosition=(ot.audioContext.currentTime-e.startTime)%e.resource.webAudio.decodedBuffer.duration,e.webAudioNode.onended=void 0,e.webAudioNode.stop(0),e.webAudioNode=void 0}catch(e){_("pauseWebAudio failed: "+e)}e.paused=!0}},openAudioContext:function(){ot.audioContext||("undefined"!=typeof AudioContext?ot.audioContext=new AudioContext:"undefined"!=typeof webkitAudioContext&&(ot.audioContext=new webkitAudioContext))},webAudioAvailable:function(){return!!ot.audioContext},fillWebAudioBufferFromHeap:function(e,t,r){for(var n=ot.audio.channels,o=0;o<n;++o){var i=r.getChannelData(o);if(i.length!=t)throw"Web Audio output buffer length mismatch! Destination size: "+i.length+" samples vs expected "+t+" samples!";if(32784==ot.audio.format)for(var a=0;a<t;++a)i[a]=W[e+2*(a*n+o)>>1]/32768;else if(8==ot.audio.format)for(a=0;a<t;++a){var s=Y[e+(a*n+o)|0];i[a]=(s>=0?s-128:s+128)/128}else{if(33056!=ot.audio.format)throw"Invalid SDL audio format "+ot.audio.format+"!";for(a=0;a<t;++a)i[a]=Z[e+4*(a*n+o)>>2]}}},debugSurface:function(e){console.log("dumping surface "+[e.surf,e.source,e.width,e.height]);for(var t=e.ctx.getImageData(0,0,e.width,e.height).data,r=Math.min(e.width,e.height),n=0;n<r;n++)console.log(" diagonal "+n+":"+[t[n*e.width*4+4*n+0],t[n*e.width*4+4*n+1],t[n*e.width*4+4*n+2],t[n*e.width*4+4*n+3]])},joystickEventState:1,lastJoystickState:{},joystickNamePool:{},recordJoystickState:function(e,t){for(var r=new Array(t.buttons.length),n=0;n<t.buttons.length;n++)r[n]=ot.getJoystickButtonState(t.buttons[n]);ot.lastJoystickState[e]={buttons:r,axes:t.axes.slice(0),timestamp:t.timestamp,index:t.index,id:t.id}},getJoystickButtonState:function(e){return"object"==typeof e?e.pressed:e>0},queryJoysticks:function(){for(var e in ot.lastJoystickState){var t=ot.getGamepad(e-1),r=ot.lastJoystickState[e];if(void 0===t)return;if(null===t)return;if("number"!=typeof t.timestamp||t.timestamp!==r.timestamp||!t.timestamp){var n;for(n=0;n<t.buttons.length;n++){var o=ot.getJoystickButtonState(t.buttons[n]);o!==r.buttons[n]&&ot.events.push({type:o?"joystick_button_down":"joystick_button_up",joystick:e,index:e-1,button:n})}for(n=0;n<t.axes.length;n++)t.axes[n]!==r.axes[n]&&ot.events.push({type:"joystick_axis_motion",joystick:e,index:e-1,axis:n,value:t.axes[n]});ot.recordJoystickState(e,t)}}},joystickAxisValueConversion:function(e){return e=Math.min(1,Math.max(e,-1)),Math.ceil(32767.5*(e+1)-32768)},getGamepads:function(){var e=navigator.getGamepads||navigator.webkitGamepads||navigator.mozGamepads||navigator.gamepads||navigator.webkitGetGamepads;return void 0!==e?e.apply(navigator):[]},getGamepad:function(e){var t=ot.getGamepads();return t.length>e&&e>=0?t[e]:null}};var it={};function at(e){var t,r;at.called?(r=Q[e>>2],t=Q[r>>2]):(at.called=!0,it.USER=it.LOGNAME="web_user",it.PATH="/",it.PWD="/",it.HOME="/home/web_user",it.LANG="C.UTF-8",it.LANG=("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",it._=m,t=P(1024),r=P(256),Q[r>>2]=t,Q[e>>2]=r);var n=[],o=0;for(var i in it)if("string"==typeof it[i]){var a=i+"="+it[i];n.push(a),o+=a.length}if(o>1024)throw new Error("Environment size exceeded TOTAL_ENV_SIZE!");for(var s=0;s<n.length;s++){G(a=n[s],t),Q[r+4*s>>2]=t,t+=a.length+1}Q[r+4*n.length>>2]=0}function st(e,t){var r;if(0===e)r=Date.now();else{if(1!==e||!(c||"undefined"!=typeof dateNow||"object"==typeof performance&&performance&&"function"==typeof performance.now))return Ge(22),-1;r=rt()}return Q[t>>2]=r/1e3|0,Q[t+4>>2]=r%1e3*1e3*1e3|0,0}var ut={};var ct={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:function(e,t){if("/"!==t[0]){var r;if(-100===e)r=et.cwd();else{var n=et.getStream(e);if(!n)throw new et.ErrnoError(9);r=n.path}t=He.join2(r,t)}return t},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&He.normalize(t)!==He.normalize(et.getPath(e.node)))return-20;throw e}return Q[r>>2]=n.dev,Q[r+4>>2]=0,Q[r+8>>2]=n.ino,Q[r+12>>2]=n.mode,Q[r+16>>2]=n.nlink,Q[r+20>>2]=n.uid,Q[r+24>>2]=n.gid,Q[r+28>>2]=n.rdev,Q[r+32>>2]=0,Ie=[n.size>>>0,(Pe=n.size,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[r+40>>2]=Ie[0],Q[r+44>>2]=Ie[1],Q[r+48>>2]=4096,Q[r+52>>2]=n.blocks,Q[r+56>>2]=n.atime.getTime()/1e3|0,Q[r+60>>2]=0,Q[r+64>>2]=n.mtime.getTime()/1e3|0,Q[r+68>>2]=0,Q[r+72>>2]=n.ctime.getTime()/1e3|0,Q[r+76>>2]=0,Ie=[n.ino>>>0,(Pe=n.ino,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[r+80>>2]=Ie[0],Q[r+84>>2]=Ie[1],0},doMsync:function(e,t,r,n){var o=new Uint8Array(q.subarray(e,e+r));et.msync(t,o,0,r,n)},doMkdir:function(e,t){return"/"===(e=He.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),et.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-22}return et.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-22;var n=et.readlink(e),o=Math.min(r,V(n)),i=Y[t+o];return j(n,t,r+1),Y[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-22;var r;if(!(r=et.lookupPath(e,{follow:!0}).node))return-2;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&et.nodePermissions(r,n)?-13:0},doDup:function(e,t,r){var n=et.getStream(r);return n&&et.close(n),et.open(e,t,0,r,r).fd},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=Q[t+8*i>>2],s=Q[t+(8*i+4)>>2],u=et.read(e,Y,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=Q[t+8*i>>2],s=Q[t+(8*i+4)>>2],u=et.write(e,Y,a,s,n);if(u<0)return-1;o+=u}return o},varargs:0,get:function(e){return ct.varargs+=4,Q[ct.varargs-4>>2]},getStr:function(){return B(ct.get())},getStreamFromFD:function(){var e=et.getStream(ct.get());if(!e)throw new et.ErrnoError(9);return e},get64:function(){var e=ct.get(),t=ct.get();return F(e>=0?0===t:-1===t),e},getZero:function(){F(0===ct.get())}};function lt(e,t){ct.varargs=t;try{return 0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}}var dt=42;var ft={BUCKET_BUFFER_SIZE:8192,mount:function(e){return et.createNode(null,"/",16895,0)},createPipe:function(){var e={buckets:[]};e.buckets.push({buffer:new Uint8Array(ft.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=ft.nextname(),r=ft.nextname(),n=et.createNode(ft.root,t,4096,0),o=et.createNode(ft.root,r,4096,0);n.pipe=e,o.pipe=e;var i=et.createStream({path:t,node:n,flags:et.modeStringToFlags("r"),seekable:!1,stream_ops:ft.stream_ops});n.stream=i;var a=et.createStream({path:r,node:o,flags:et.modeStringToFlags("w"),seekable:!1,stream_ops:ft.stream_ops});return o.stream=a,{readable_fd:i.fd,writable_fd:a.fd}},stream_ops:{poll:function(e){var t=e.node.pipe;if(1==(2097155&e.flags))return 260;if(t.buckets.length>0)for(var r=0;r<t.buckets.length;r++){var n=t.buckets[r];if(n.offset-n.roffset>0)return 65}return 0},ioctl:function(e,t,r){return $e.EINVAL},fsync:function(e){return $e.EINVAL},read:function(e,t,r,n,o){for(var i=e.node.pipe,a=0,s=0;s<i.buckets.length;s++){var u=i.buckets[s];a+=u.offset-u.roffset}F(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var c=t.subarray(r,r+n);if(n<=0)return 0;if(0==a)throw new et.ErrnoError($e.EAGAIN);var l=Math.min(a,n),d=l,f=0;for(s=0;s<i.buckets.length;s++){var m=i.buckets[s],p=m.offset-m.roffset;if(l<=p){var h=m.buffer.subarray(m.roffset,m.offset);l<p?(h=h.subarray(0,l),m.roffset+=l):f++,c.set(h);break}h=m.buffer.subarray(m.roffset,m.offset);c.set(h),c=c.subarray(h.byteLength),l-=h.byteLength,f++}return f&&f==i.buckets.length&&(f--,i.buckets[f].offset=0,i.buckets[f].roffset=0),i.buckets.splice(0,f),d},write:function(e,t,r,n,o){var i=e.node.pipe;F(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var a=t.subarray(r,r+n),s=a.byteLength;if(s<=0)return 0;var u=null;0==i.buckets.length?(u={buffer:new Uint8Array(ft.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(u)):u=i.buckets[i.buckets.length-1],F(u.offset<=ft.BUCKET_BUFFER_SIZE);var c=ft.BUCKET_BUFFER_SIZE-u.offset;if(c>=s)return u.buffer.set(a,u.offset),u.offset+=s,s;c>0&&(u.buffer.set(a.subarray(0,c),u.offset),u.offset+=c,a=a.subarray(c,a.byteLength));for(var l=a.byteLength/ft.BUCKET_BUFFER_SIZE|0,d=a.byteLength%ft.BUCKET_BUFFER_SIZE,f=0;f<l;f++){var m={buffer:new Uint8Array(ft.BUCKET_BUFFER_SIZE),offset:ft.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(m),m.buffer.set(a.subarray(0,ft.BUCKET_BUFFER_SIZE)),a=a.subarray(ft.BUCKET_BUFFER_SIZE,a.byteLength)}if(d>0){m={buffer:new Uint8Array(ft.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0};i.buckets.push(m),m.buffer.set(a)}return s},close:function(e){e.node.pipe.buckets=null}},nextname:function(){return ft.nextname.current||(ft.nextname.current=0),"pipe["+ft.nextname.current+++"]"}};function mt(e){!function(e,t){if(function(){var e=b,t=_,r=!1;b=_=function(e){r=!0};try{var n=o._fflush;n&&n(0),["stdout","stderr"].forEach(function(e){var t=et.analyzePath("/dev/"+e);if(t){var n=t.object.rdev,o=qe.ttys[n];o&&o.output&&o.output.length&&(r=!0)}})}catch(e){}b=e,_=t,r&&A("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}(),t&&o.noExitRuntime&&0===e)return;o.noExitRuntime?t||_("exit("+e+") called, but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)"):(L=!0,ae(),he=!0,o.onExit&&o.onExit(e));p(e,new en(e))}(e)}var pt=_e;function ht(){nn("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function vt(){return Y.length}function Et(e,t){throw Lr(e,t||1),"longjmp"}function gt(){return Ge(8),-1}var yt=ge,wt=Te;var bt={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],currArrayBuffer:0,currElementArrayBuffer:0,byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){bt.createLog2ceilLookup(bt.MAX_TEMP_BUFFER_SIZE),bt.miniTempBuffer=new Float32Array(bt.MINI_TEMP_BUFFER_SIZE);for(var e=0;e<bt.MINI_TEMP_BUFFER_SIZE;e++)bt.miniTempBufferViews[e]=bt.miniTempBuffer.subarray(0,e+1)},recordError:function(e){bt.lastError||(bt.lastError=e)},getNewId:function(e){for(var t=bt.counter++,r=e.length;r<t;r++)e[r]=null;return t},MINI_TEMP_BUFFER_SIZE:256,miniTempBuffer:null,miniTempBufferViews:[0],MAX_TEMP_BUFFER_SIZE:2097152,numTempVertexBuffersPerSize:64,log2ceilLookup:null,createLog2ceilLookup:function(e){bt.log2ceilLookup=new Uint8Array(e+1);var t=0,r=1;bt.log2ceilLookup[0]=0;for(var n=1;n<=e;++n)n>r&&(r<<=1,++t),bt.log2ceilLookup[n]=t},generateTempBuffers:function(e,t){var r=bt.log2ceilLookup[bt.MAX_TEMP_BUFFER_SIZE];t.tempVertexBufferCounters1=[],t.tempVertexBufferCounters2=[],t.tempVertexBufferCounters1.length=t.tempVertexBufferCounters2.length=r+1,t.tempVertexBuffers1=[],t.tempVertexBuffers2=[],t.tempVertexBuffers1.length=t.tempVertexBuffers2.length=r+1,t.tempIndexBuffers=[],t.tempIndexBuffers.length=r+1;for(var n=0;n<=r;++n){t.tempIndexBuffers[n]=null,t.tempVertexBufferCounters1[n]=t.tempVertexBufferCounters2[n]=0;var o=bt.numTempVertexBuffersPerSize;t.tempVertexBuffers1[n]=[],t.tempVertexBuffers2[n]=[];var i=t.tempVertexBuffers1[n],a=t.tempVertexBuffers2[n];i.length=a.length=o;for(var s=0;s<o;++s)i[s]=a[s]=null}if(e){t.tempQuadIndexBuffer=sr.createBuffer(),t.GLctx.bindBuffer(t.GLctx.ELEMENT_ARRAY_BUFFER,t.tempQuadIndexBuffer);for(var u=bt.MAX_TEMP_BUFFER_SIZE>>1,c=new Uint16Array(u),l=(n=0,0);!(c[n++]=l,n>=u||(c[n++]=l+1,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l+3,n>=u));)l+=4;t.GLctx.bufferData(t.GLctx.ELEMENT_ARRAY_BUFFER,c,t.GLctx.STATIC_DRAW),t.GLctx.bindBuffer(t.GLctx.ELEMENT_ARRAY_BUFFER,null)}},getTempVertexBuffer:function(e){var t=bt.log2ceilLookup[e],r=bt.currentContext.tempVertexBuffers1[t],n=bt.currentContext.tempVertexBufferCounters1[t];bt.currentContext.tempVertexBufferCounters1[t]=bt.currentContext.tempVertexBufferCounters1[t]+1&bt.numTempVertexBuffersPerSize-1;var o=r[n];if(o)return o;var i=sr.getParameter(sr.ARRAY_BUFFER_BINDING);return r[n]=sr.createBuffer(),sr.bindBuffer(sr.ARRAY_BUFFER,r[n]),sr.bufferData(sr.ARRAY_BUFFER,1<<t,sr.DYNAMIC_DRAW),sr.bindBuffer(sr.ARRAY_BUFFER,i),r[n]},getTempIndexBuffer:function(e){var t=bt.log2ceilLookup[e],r=bt.currentContext.tempIndexBuffers[t];if(r)return r;var n=sr.getParameter(sr.ELEMENT_ARRAY_BUFFER_BINDING);return bt.currentContext.tempIndexBuffers[t]=sr.createBuffer(),sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,bt.currentContext.tempIndexBuffers[t]),sr.bufferData(sr.ELEMENT_ARRAY_BUFFER,1<<t,sr.DYNAMIC_DRAW),sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,n),bt.currentContext.tempIndexBuffers[t]},newRenderingFrameStarted:function(){if(bt.currentContext){var e=bt.currentContext.tempVertexBuffers1;bt.currentContext.tempVertexBuffers1=bt.currentContext.tempVertexBuffers2,bt.currentContext.tempVertexBuffers2=e,e=bt.currentContext.tempVertexBufferCounters1,bt.currentContext.tempVertexBufferCounters1=bt.currentContext.tempVertexBufferCounters2,bt.currentContext.tempVertexBufferCounters2=e;for(var t=bt.log2ceilLookup[bt.MAX_TEMP_BUFFER_SIZE],r=0;r<=t;++r)bt.currentContext.tempVertexBufferCounters1[r]=0}},getSource:function(e,t,r,n){for(var o="",i=0;i<t;++i){var a=n?Q[n+4*i>>2]:-1;o+=B(Q[r+4*i>>2],a<0?void 0:a)}if(35632==sr.getShaderParameter(bt.shaders[e],35663)&&(Wt.findToken(o,"dFdx")||Wt.findToken(o,"dFdy")||Wt.findToken(o,"fwidth"))){o="#extension GL_OES_standard_derivatives : enable\n"+o;sr.getExtension("OES_standard_derivatives")}return o},createContext:function(e,t){var r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return r?bt.registerContext(r,t):0},registerContext:function(e,t){var r=Rr(8),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),bt.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&bt.initExtensions(n),r},makeContextCurrent:function(e){return bt.currentContext=bt.contexts[e],o.ctx=sr=bt.currentContext&&bt.currentContext.GLctx,!(e&&!sr)},getContext:function(e){return bt.contexts[e]},deleteContext:function(e){bt.currentContext===bt.contexts[e]&&(bt.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(bt.contexts[e].GLctx.canvas),bt.contexts[e]&&bt.contexts[e].GLctx.canvas&&(bt.contexts[e].GLctx.canvas.GLctxObject=void 0),Sr(bt.contexts[e]),bt.contexts[e]=null},acquireInstancedArraysExtension:function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,i){t.drawElementsInstancedANGLE(e,r,n,o,i)})},acquireVertexArrayObjectExtension:function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})},acquireDrawBuffersExtension:function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)})},initExtensions:function(e){if(e||(e=bt.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;e.compressionExt=t.getExtension("WEBGL_compressed_texture_s3tc"),e.anisotropicExt=t.getExtension("EXT_texture_filter_anisotropic"),e.version<2&&(bt.acquireInstancedArraysExtension(t),bt.acquireVertexArrayObjectExtension(t),bt.acquireDrawBuffersExtension(t)),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query");var r=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2"],n=t.getSupportedExtensions();n&&n.length>0&&t.getSupportedExtensions().forEach(function(e){-1!=r.indexOf(e)&&t.getExtension(e)})}},populateUniformTable:function(e){for(var t=bt.programs[e],r=bt.programInfos[e]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},n=r.uniforms,o=sr.getProgramParameter(t,35718),i=0;i<o;++i){var a=sr.getActiveUniform(t,i),s=a.name;r.maxUniformLength=Math.max(r.maxUniformLength,s.length+1),"]"==s.slice(-1)&&(s=s.slice(0,s.lastIndexOf("[")));var u=sr.getUniformLocation(t,s);if(u){var c=bt.getNewId(bt.uniforms);n[s]=[a.size,c],bt.uniforms[c]=u;for(var l=1;l<a.size;++l){var d=s+"["+l+"]";u=sr.getUniformLocation(t,d),c=bt.getNewId(bt.uniforms),bt.uniforms[c]=u}}}}};function _t(e){sr.enable(e)}function Tt(e){sr.disable(e)}function xt(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&bt.recordError(1280));case 36345:n=0;break;case 34466:var o=sr.getParameter(34467);n=o?o.length:0}if(void 0===n){var i=sr.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void bt.recordError(1280);case"object":if(null===i)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:n=0;break;default:return void bt.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var a=0;a<i.length;++a)switch(r){case 0:Q[t+4*a>>2]=i[a];break;case 2:Z[t+4*a>>2]=i[a];break;case 4:Y[t+a|0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return bt.recordError(1280),void _("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return bt.recordError(1280),void _("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+i+" of type "+typeof i+"!")}}switch(r){case 1:Ie=[n>>>0,(Pe=n,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[t>>2]=Ie[0],Q[t+4>>2]=Ie[1];break;case 0:Q[t>>2]=n;break;case 2:Z[t>>2]=n;break;case 4:Y[t|0]=n?1:0}}else bt.recordError(1281)}function At(e,t){xt(e,t,4)}function Mt(e,t){xt(e,t,0)}function St(e){var t=V(e)+1,r=Rr(t);return j(e,r,t),r}function Ot(e){if(bt.stringCache[e])return bt.stringCache[e];var t;switch(e){case 7939:for(var r=sr.getSupportedExtensions(),n=[],o=0;o<r.length;++o)n.push(r[o]),n.push("GL_"+r[o]);t=St(n.join(" "));break;case 7936:case 7937:case 37445:case 37446:var i=sr.getParameter(e);i||bt.recordError(1280),t=St(i);break;case 7938:var a=sr.getParameter(sr.VERSION);t=St(a="OpenGL ES 2.0 ("+a+")");break;case 35724:var s=sr.getParameter(sr.SHADING_LANGUAGE_VERSION),u=s.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==u&&(3==u[1].length&&(u[1]=u[1]+"0"),s="OpenGL ES GLSL ES "+u[1]+" ("+s+")"),t=St(s);break;default:return bt.recordError(1280),0}return bt.stringCache[e]=t,t}function Rt(e){var t=bt.getNewId(bt.shaders);return bt.shaders[t]=sr.createShader(e),t}function Dt(e,t){sr.attachShader(bt.programs[e],bt.shaders[t])}function kt(e,t){sr.detachShader(bt.programs[e],bt.shaders[t])}function Lt(e){sr.useProgram(bt.programs[e])}function Ft(e){if(e){var t=bt.programs[e];t?(sr.deleteProgram(t),t.name=0,bt.programs[e]=null,bt.programInfos[e]=null):bt.recordError(1281)}}function Ct(e,t,r){sr.bindAttribLocation(bt.programs[e],t,B(r))}function Nt(e){sr.linkProgram(bt.programs[e]),bt.populateUniformTable(e)}function Pt(e,t){e==sr.ARRAY_BUFFER?(bt.currArrayBuffer=t,Kt.lastArrayBuffer=t):e==sr.ELEMENT_ARRAY_BUFFER&&(bt.currElementArrayBuffer=t),sr.bindBuffer(e,bt.buffers[t])}function It(e,t){xt(e,t,2)}function Ut(e,t){sr.hint(e,t)}function Bt(e){sr.enableVertexAttribArray(e)}function Xt(e){sr.disableVertexAttribArray(e)}function jt(e,t,r,n,o,i){sr.vertexAttribPointer(e,t,r,!!n,o,i)}function Vt(e){sr.activeTexture(e)}var zt,Gt,Ht,Yt,qt,Wt={fogStart:0,fogEnd:1,fogDensity:1,fogColor:null,fogMode:2048,fogEnabled:!1,vaos:[],currentVao:null,enabledVertexAttribArrays:{},hasRunInit:!1,findToken:function(e,t){function r(e){return e>=48&&e<=57||(e>=65&&e<=90||e>=97&&e<=122)}for(var n=-1;;){if((n=e.indexOf(t,n+1))<0)break;if(!(n>0&&r(e[n-1]))&&!((n+=t.length)<e.length-1&&r(e[n+1])))return!0}return!1},init:function(){if(!Wt.hasRunInit){Wt.hasRunInit=!0,Wt.fogColor=new Float32Array(4),_("WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work.");var e={2884:1,3042:1,3024:1,2960:1,2929:1,3089:1,32823:1,32926:1,32928:1},t=_t;_t=function(r){Kt.lastRenderer&&Kt.lastRenderer.cleanup(),2912!=r?3553!=r&&r in e&&t(r):1!=Wt.fogEnabled&&(Kt.currentRenderer=null,Wt.fogEnabled=!0)};var r=Tt;Tt=function(t){Kt.lastRenderer&&Kt.lastRenderer.cleanup(),2912!=t?3553!=t&&t in e&&r(t):0!=Wt.fogEnabled&&(Kt.currentRenderer=null,Wt.fogEnabled=!1)};var n=At;At=function(e,t){var r=Wt.getAttributeFromCapability(e);if(null===r)n(e,t);else{var o=Kt.enabledClientAttributes[r];Y[t|0]=!0===o?1:0}};var o=Mt;Mt=function(e,t){switch(e){case 34018:e=sr.MAX_TEXTURE_IMAGE_UNITS;break;case 35658:var r=sr.getParameter(sr.MAX_VERTEX_UNIFORM_VECTORS);return void(Q[t>>2]=4*r);case 35657:r=sr.getParameter(sr.MAX_FRAGMENT_UNIFORM_VECTORS);return void(Q[t>>2]=4*r);case 35659:r=sr.getParameter(sr.MAX_VARYING_VECTORS);return void(Q[t>>2]=4*r);case 34929:e=sr.MAX_COMBINED_TEXTURE_IMAGE_UNITS;break;case 32890:var n=Kt.clientAttributes[Kt.VERTEX];return void(Q[t>>2]=n?n.size:0);case 32891:n=Kt.clientAttributes[Kt.VERTEX];return void(Q[t>>2]=n?n.type:0);case 32892:n=Kt.clientAttributes[Kt.VERTEX];return void(Q[t>>2]=n?n.stride:0);case 32897:n=Kt.clientAttributes[Kt.COLOR];return void(Q[t>>2]=n?n.size:0);case 32898:n=Kt.clientAttributes[Kt.COLOR];return void(Q[t>>2]=n?n.type:0);case 32899:n=Kt.clientAttributes[Kt.COLOR];return void(Q[t>>2]=n?n.stride:0);case 32904:n=Kt.clientAttributes[Kt.TEXTURE0+Kt.clientActiveTexture];return void(Q[t>>2]=n?n.size:0);case 32905:n=Kt.clientAttributes[Kt.TEXTURE0+Kt.clientActiveTexture];return void(Q[t>>2]=n?n.type:0);case 32906:n=Kt.clientAttributes[Kt.TEXTURE0+Kt.clientActiveTexture];return void(Q[t>>2]=n?n.stride:0)}o(e,t)};var i=Ot;Ot=function(e){if(bt.stringCache[e])return bt.stringCache[e];if(7939===e){var t=St(sr.getSupportedExtensions().join(" ")+" GL_EXT_texture_env_combine GL_ARB_texture_env_crossbar GL_ATI_texture_env_combine3 GL_NV_texture_env_combine4 GL_EXT_texture_env_dot3 GL_ARB_multitexture GL_ARB_vertex_buffer_object GL_EXT_framebuffer_object GL_ARB_vertex_program GL_ARB_fragment_program GL_ARB_shading_language_100 GL_ARB_shader_objects GL_ARB_vertex_shader GL_ARB_fragment_shader GL_ARB_texture_cube_map GL_EXT_draw_range_elements"+(bt.currentContext.compressionExt?" GL_ARB_texture_compression GL_EXT_texture_compression_s3tc":"")+(bt.currentContext.anisotropicExt?" GL_EXT_texture_filter_anisotropic":""));return bt.stringCache[e]=t,t}return i(e)},bt.shaderInfos={};var a=Rt;Rt=function(e){var t=a(e);return bt.shaderInfos[t]={type:e,ftransform:!1},t},bt.programShaders={};var s=Dt;Dt=function(e,t){bt.programShaders[e]||(bt.programShaders[e]=[]),bt.programShaders[e].push(t),s(e,t)};var u=kt;kt=function(e,t){var r=bt.programShaders[e];if(r){var n=r.indexOf(t);r.splice(n,1),u(e,t)}else _("WARNING: _glDetachShader received invalid program: "+e)};var c=Lt;Lt=function(e){bt.currProgram!=e&&(Kt.currentRenderer=null,bt.currProgram=e,Kt.fixedFunctionProgram=0,c(e))};var l=Ft;Ft=function(e){l(e),e==bt.currProgram&&(Kt.currentRenderer=null,bt.currProgram=0)};var d={},f=Ct;Ct=function(e,t,r){0==t&&(d[e]=!0),f(e,t,r)};var m=Nt;Nt=function(e){e in d||sr.bindAttribLocation(bt.programs[e],0,"a_position"),m(e)};var p=Pt;Pt=function(e,t){p(e,t),e==sr.ARRAY_BUFFER?Wt.currentVao&&(F(Wt.currentVao.arrayBuffer==t||0==Wt.currentVao.arrayBuffer||0==t,"TODO: support for multiple array buffers in vao"),Wt.currentVao.arrayBuffer=t):e==sr.ELEMENT_ARRAY_BUFFER&&Wt.currentVao&&(Wt.currentVao.elementArrayBuffer=t)};var h=It;It=function(e,t){2982==e?Z.set(Kt.matrix[0],t>>2):2983==e?Z.set(Kt.matrix[1],t>>2):2984==e?Z.set(Kt.matrix[2+Kt.clientActiveTexture],t>>2):2918==e?Z.set(Wt.fogColor,t>>2):2915==e?Z[t>>2]=Wt.fogStart:2916==e?Z[t>>2]=Wt.fogEnd:2914==e?Z[t>>2]=Wt.fogDensity:2917==e?Z[t>>2]=Wt.fogMode:h(e,t)};var v=Ut;Ut=function(e,t){34031!=e&&v(e,t)};var E=Bt;Bt=function(e){E(e),Wt.enabledVertexAttribArrays[e]=1,Wt.currentVao&&(Wt.currentVao.enabledVertexAttribArrays[e]=1)};var g=Xt;Xt=function(e){g(e),delete Wt.enabledVertexAttribArrays[e],Wt.currentVao&&delete Wt.currentVao.enabledVertexAttribArrays[e]};var y=jt;jt=function(e,t,r,n,o,i){y(e,t,r,n,o,i),Wt.currentVao&&(Wt.currentVao.vertexAttribPointers[e]=[e,t,r,n,o,i])}}},getAttributeFromCapability:function(e){var t=null;switch(e){case 3553:nn("GL_TEXTURE_2D is not a spec-defined capability for gl{Enable,Disable}ClientState.");case 32888:t=Kt.TEXTURE0+Kt.clientActiveTexture;break;case 32884:t=Kt.VERTEX;break;case 32885:t=Kt.NORMAL;break;case 32886:t=Kt.COLOR}return t}},Kt={MapTreeLib:null,spawnMapTreeLib:function(){function e(){var e,t,r=[];this.insert=function(e,t){return!this.contains(0|e)&&(r.push([e,t]),!0)},this.contains=function(t){for(e=0;e<r.length;++e)if(r[e][0]===t)return!0;return!1},this.get=function(e){for(t=0;t<r.length;++t)if(r[t][0]===e)return r[t][1]}}function t(){function t(){var r=new e;this.child=function(e){return r.contains(0|e)||r.insert(0|e,new t),r.get(0|e)},this.value=void 0,this.get=function(){return this.value},this.set=function(e){this.value=e}}function r(e){var t;this.reset=function(){return t=e,this},this.reset(),this.next=function(e){return t=t.child(e),this},this.get=function(){return t.get()},this.set=function(e){t.set(e)}}var n,o;this.createKeyView=function(){return new r(n)},this.clear=function(){n=new t,o=this.createKeyView()},this.clear(),this.getStaticKeyView=function(){return o.reset(),o}}return{create:function(){return new t}}},TexEnvJIT:null,spawnTexEnvJIT:function(){var e=3552,t=3553,r=32879,n=34067,o=8960,a=8705,s=34163,u=3356,c=7681,l=8448,d=5890,f=34166,m=34168,p=768,h=770,v="tej_",E="uTexUnit",g="vTexCoord",y="vPrimColor",w="uTexMatrix",b=null,T=0,x=[];function A(e){F(!1,"[TexEnvJIT] ABORT: "+e)}function M(e){A("No support: "+e)}function S(e){A("Sanity failure: "+e)}function O(o){var i=b[o].getTexType(),a=null;switch(i){case e:case t:a="texture2D";break;case r:return M("No support for 3D textures.");case n:a="textureCube";break;default:return S("Unknown texType: 0x"+i.toString(16))}var s=g+o;return null!=w&&(s="("+w+o+" * "+s+")"),a+"("+E+o+", "+s+".xy)"}function R(){return b[T]}function D(e,t,r,n,o){var i=null;switch(n){case d:i=O(e);break;case f:i=t;break;case 34167:i=y;break;case m:i=r;break;default:return M("Unsupported combiner src: 0x"+n.toString(16))}var a=null;switch(o){case p:a=i+".rgb";break;case 769:a="(vec3(1.0) - "+i+".rgb)";break;case h:a=i+".a";break;case 771:a="(1.0 - "+i+".a)";break;default:return M("Unsupported combiner op: 0x"+o.toString(16))}return a}function k(e){return e==Math.round(e)?e+".0":e}function L(){this.mode=l,this.colorCombiner=l,this.alphaCombiner=l,this.colorScale=1,this.alphaScale=1,this.envColor=[0,0,0,0],this.colorSrc=[d,m,f],this.alphaSrc=[d,m,f],this.colorOp=[p,p,h],this.alphaOp=[h,h,h],this.traverseKey={7681:0,8448:1,260:2,3042:3,8449:4,34160:5,34023:3,34165:4,5890:0,34166:1,34167:2,34168:3,768:0,769:1,770:2,771:3},this.key0=-1,this.key1=0,this.key2=0,this.computeKey0=function(){var e=this.traverseKey,t=1638400*e[this.mode];return t+=327680*e[this.colorCombiner],t+=65536*e[this.alphaCombiner],t+=16384*(this.colorScale-1),t+=4096*(this.alphaScale-1),t+=1024*e[this.colorSrc[0]],t+=256*e[this.colorSrc[1]],t+=64*e[this.colorSrc[2]],t+=16*e[this.alphaSrc[0]],t+=4*e[this.alphaSrc[1]],t+=e[this.alphaSrc[2]]},this.computeKey1=function(){var e=this.traverseKey;return i=4096*e[this.colorOp[0]],i+=1024*e[this.colorOp[1]],i+=256*e[this.colorOp[2]],i+=16*e[this.alphaOp[0]],i+=4*e[this.alphaOp[1]],i+=e[this.alphaOp[2]]},this.computeKey2=function(){return 16777216*this.envColor[0]+65536*this.envColor[1]+256*this.envColor[2]+1+this.envColor[3]},this.recomputeKey=function(){this.key0=this.computeKey0(),this.key1=this.computeKey1(),this.key2=this.computeKey2()},this.invalidateKey=function(){this.key0=-1,Kt.currentRenderer=null}}function C(){this.env=new L,this.enabled_tex1D=!1,this.enabled_tex2D=!1,this.enabled_tex3D=!1,this.enabled_texCube=!1,this.texTypesEnabled=0,this.traverseState=function(e){this.texTypesEnabled?(-1==this.env.key0&&this.env.recomputeKey(),e.next(this.texTypesEnabled|this.env.key0<<4),e.next(this.env.key1),e.next(this.env.key2)):e.next(0)}}return C.prototype.enabled=function(){return this.texTypesEnabled},C.prototype.genPassLines=function(e,t,r){if(!this.enabled())return["vec4 "+e+" = "+t+";"];for(var n,o=this.env.genPassLines(e,t,r).join("\n"),i="",a=/(texture.*?\(.*?\))/g,s=0;n=a.exec(o);){var u=n[1];if(-1!=o.slice(n.index+1).indexOf(u)){var c=v+"env"+r+"_"+"texload"+s++;i+="vec4 "+c+" = "+u+";\n"+"\n",o=o.split(u).join(c),a=/(texture.*\(.*\))/g}}return[i+o]},C.prototype.getTexType=function(){return this.enabled_texCube?n:this.enabled_tex3D?r:this.enabled_tex2D?t:this.enabled_tex1D?e:0},L.prototype.genPassLines=function(e,t,r){switch(this.mode){case c:return["vec4 "+e+" = "+O(r)+";"];case 260:var n=(a=v+"env"+r+"_")+"color",o=a+"alpha";return["vec4 "+(i=a+"tex")+" = "+O(r)+";","vec3 "+n+" = "+t+".rgb + "+i+".rgb;","float "+o+" = "+t+".a * "+i+".a;","vec4 "+e+" = vec4("+n+", "+o+");"];case l:return[(d=["vec4 "+e," = ",t," * ",O(r),";"]).join("")];case 8449:n=(a=v+"env"+r+"_")+"color",o=a+"alpha";return["vec4 "+(i=a+"tex")+" = "+O(r)+";",["vec3 "+n+" = ",t+".rgb * (1.0 - "+i+".a)"," + ",i+".rgb * "+i+".a",";"].join(""),"float "+o+" = "+t+".a;","vec4 "+e+" = vec4("+n+", "+o+");"];case 3042:var i;n=(a=v+"env"+r+"_")+"color",o=a+"alpha";return["vec4 "+(i=a+"tex")+" = "+O(r)+";",["vec3 "+n+" = ",t+".rgb * (1.0 - "+i+".rgb)"," + ",y+".rgb * "+i+".rgb",";"].join(""),"float "+o+" = "+i+".a;","vec4 "+e+" = vec4("+n+", "+o+");"];case 34160:n=(a=v+"env"+r+"_")+"color",o=a+"alpha";var a,s=this.genCombinerLines(!0,n,t,r,this.colorCombiner,this.colorSrc,this.colorOp),u=this.genCombinerLines(!1,o,t,r,this.alphaCombiner,this.alphaSrc,this.alphaOp),d=["vec4 "+e," = ","vec4(",1==this.colorScale?n:n+" * "+k(this.colorScale),", ",1==this.alphaScale?o:o+" * "+k(this.alphaScale),")",";"].join("");return[].concat(s,u,[d])}return M("Unsupported TexEnv mode: 0x"+this.mode.toString(16))},L.prototype.genCombinerLines=function(e,t,r,n,o,i,a){var s=null;switch(o){case c:s=1;break;case l:case 260:case 34023:s=2;break;case 34165:s=3;break;default:return M("Unsupported combiner: 0x"+o.toString(16))}var u=["vec4(",k(this.envColor[0]),", ",k(this.envColor[1]),", ",k(this.envColor[2]),", ",k(this.envColor[3]),")"].join(""),d=s>=1?D(n,u,r,i[0],a[0]):null,f=s>=2?D(n,u,r,i[1],a[1]):null,m=s>=3?D(n,u,r,i[2],a[2]):null,E=e?"vec3":"float",g=null;switch(o){case c:g=[[E+" "+t," = ",d,";"].join("")];break;case l:g=[[E+" "+t+" = ",d+" * "+f,";"].join("")];break;case 260:g=[[E+" "+t+" = ",d+" + "+f,";"].join("")];break;case 34023:g=[[E+" "+t+" = ",d+" - "+f,";"].join("")];break;case 34165:var y=v+"env"+n+"_"+"colorSrc2";g=[function(e){switch(e){case p:case 769:return"vec3";case h:case 771:return"float"}return M("Unsupported combiner op: 0x"+e.toString(16))}(this.colorOp[2])+" "+y+" = "+m+";",[E+" "+t," = ",d+" * "+y," + ",f+" * (1.0 - "+y+")",";"].join("")];break;default:return S("Unmatched TexEnv.colorCombiner?")}return g},{init:function(e,t){var r=0;t?r=t:e&&(r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),F(r>0),b=[];for(var n=0;n<r;n++)b.push(new C)},setGLSLVars:function(e,t,r,n){E=e,g=t,y=r,w=n},genAllPassLines:function(e,t){t=t||0,x.length=0;for(var r=[],n=y,o=0;o<b.length;o++)if(b[o].enabled()){x.push(o);var i=v+"env"+o+"_"+"result",a=b[o].genPassLines(i,n,o);r=r.concat(a,[""]),n=i}r.push(e+" = "+n+";");var s="";for(o=0;o<t;o++)s+=" ";return s+r.join("\n"+s)},getUsedTexUnitList:function(){return x},traverseState:function(e){for(var t=0;t<b.length;t++)b[t].traverseState(e)},getTexUnitType:function(e){return F(e>=0&&e<b.length),b[e].getTexType()},hook_activeTexture:function(e){T=e-33984},hook_enable:function(o){var i=R();switch(o){case e:i.enabled_tex1D||(Kt.currentRenderer=null,i.enabled_tex1D=!0,i.texTypesEnabled|=1);break;case t:i.enabled_tex2D||(Kt.currentRenderer=null,i.enabled_tex2D=!0,i.texTypesEnabled|=2);break;case r:i.enabled_tex3D||(Kt.currentRenderer=null,i.enabled_tex3D=!0,i.texTypesEnabled|=4);break;case n:i.enabled_texCube||(Kt.currentRenderer=null,i.enabled_texCube=!0,i.texTypesEnabled|=8)}},hook_disable:function(o){var i=R();switch(o){case e:i.enabled_tex1D&&(Kt.currentRenderer=null,i.enabled_tex1D=!1,i.texTypesEnabled&=-2);break;case t:i.enabled_tex2D&&(Kt.currentRenderer=null,i.enabled_tex2D=!1,i.texTypesEnabled&=-3);break;case r:i.enabled_tex3D&&(Kt.currentRenderer=null,i.enabled_tex3D=!1,i.texTypesEnabled&=-5);break;case n:i.enabled_texCube&&(Kt.currentRenderer=null,i.enabled_texCube=!1,i.texTypesEnabled&=-9)}},hook_texEnvf:function(e,t,r){if(e==o){var n=R().env;switch(t){case s:n.colorScale!=r&&(n.invalidateKey(),n.colorScale=r);break;case u:n.alphaScale!=r&&(n.invalidateKey(),n.alphaScale=r);break;default:_("WARNING: Unhandled `pname` in call to `glTexEnvf`.")}}},hook_texEnvi:function(e,t,r){if(e==o){var n=R().env;switch(t){case 8704:n.mode!=r&&(n.invalidateKey(),n.mode=r);break;case 34161:n.colorCombiner!=r&&(n.invalidateKey(),n.colorCombiner=r);break;case 34162:n.alphaCombiner!=r&&(n.invalidateKey(),n.alphaCombiner=r);break;case 34176:n.colorSrc[0]!=r&&(n.invalidateKey(),n.colorSrc[0]=r);break;case 34177:n.colorSrc[1]!=r&&(n.invalidateKey(),n.colorSrc[1]=r);break;case 34178:n.colorSrc[2]!=r&&(n.invalidateKey(),n.colorSrc[2]=r);break;case 34184:n.alphaSrc[0]!=r&&(n.invalidateKey(),n.alphaSrc[0]=r);break;case 34185:n.alphaSrc[1]!=r&&(n.invalidateKey(),n.alphaSrc[1]=r);break;case 34186:n.alphaSrc[2]!=r&&(n.invalidateKey(),n.alphaSrc[2]=r);break;case 34192:n.colorOp[0]!=r&&(n.invalidateKey(),n.colorOp[0]=r);break;case 34193:n.colorOp[1]!=r&&(n.invalidateKey(),n.colorOp[1]=r);break;case 34194:n.colorOp[2]!=r&&(n.invalidateKey(),n.colorOp[2]=r);break;case 34200:n.alphaOp[0]!=r&&(n.invalidateKey(),n.alphaOp[0]=r);break;case 34201:n.alphaOp[1]!=r&&(n.invalidateKey(),n.alphaOp[1]=r);break;case 34202:n.alphaOp[2]!=r&&(n.invalidateKey(),n.alphaOp[2]=r);break;case s:n.colorScale!=r&&(n.invalidateKey(),n.colorScale=r);break;case u:n.alphaScale!=r&&(n.invalidateKey(),n.alphaScale=r);break;default:_("WARNING: Unhandled `pname` in call to `glTexEnvi`.")}}},hook_texEnvfv:function(e,t,r){if(e==o){var n=R().env;if(t===a)for(var i=0;i<4;i++){var s=Z[r+4*i>>2];n.envColor[i]!=s&&(n.invalidateKey(),n.envColor[i]=s)}else _("WARNING: Unhandled `pname` in call to `glTexEnvfv`.")}},hook_getTexEnviv:function(e,t,r){if(e==o){var n=R().env;switch(t){case 8704:return void(Q[r>>2]=n.mode);case a:return Q[r>>2]=Math.max(Math.min(255*n.envColor[0],255,-255)),Q[r+1>>2]=Math.max(Math.min(255*n.envColor[1],255,-255)),Q[r+2>>2]=Math.max(Math.min(255*n.envColor[2],255,-255)),void(Q[r+3>>2]=Math.max(Math.min(255*n.envColor[3],255,-255)));case 34161:return void(Q[r>>2]=n.colorCombiner);case 34162:return void(Q[r>>2]=n.alphaCombiner);case 34176:return void(Q[r>>2]=n.colorSrc[0]);case 34177:return void(Q[r>>2]=n.colorSrc[1]);case 34178:return void(Q[r>>2]=n.colorSrc[2]);case 34184:return void(Q[r>>2]=n.alphaSrc[0]);case 34185:return void(Q[r>>2]=n.alphaSrc[1]);case 34186:return void(Q[r>>2]=n.alphaSrc[2]);case 34192:return void(Q[r>>2]=n.colorOp[0]);case 34193:return void(Q[r>>2]=n.colorOp[1]);case 34194:return void(Q[r>>2]=n.colorOp[2]);case 34200:return void(Q[r>>2]=n.alphaOp[0]);case 34201:return void(Q[r>>2]=n.alphaOp[1]);case 34202:return void(Q[r>>2]=n.alphaOp[2]);case s:return void(Q[r>>2]=n.colorScale);case u:return void(Q[r>>2]=n.alphaScale);default:_("WARNING: Unhandled `pname` in call to `glGetTexEnvi`.")}}},hook_getTexEnvfv:function(e,t,r){if(e==o){var n=R().env;return t===a?(Z[r>>2]=n.envColor[0],Z[r+4>>2]=n.envColor[1],Z[r+8>>2]=n.envColor[2],void(Z[r+12>>2]=n.envColor[3])):void 0}}}},vertexData:null,vertexDataU8:null,tempData:null,indexData:null,vertexCounter:0,mode:-1,rendererCache:null,rendererComponents:[],rendererComponentPointer:0,lastRenderer:null,lastArrayBuffer:null,lastProgram:null,lastStride:-1,matrix:[],matrixStack:[],currentMatrix:0,tempMatrix:null,matricesModified:!1,useTextureMatrix:!1,VERTEX:0,NORMAL:1,COLOR:2,TEXTURE0:3,NUM_ATTRIBUTES:-1,MAX_TEXTURES:-1,totalEnabledClientAttributes:0,enabledClientAttributes:[0,0],clientAttributes:[],liveClientAttributes:[],currentRenderer:null,modifiedClientAttributes:!1,clientActiveTexture:0,clientColor:null,usedTexUnitList:[],fixedFunctionProgram:null,setClientAttribute:function(e,t,r,n,o){var i=Kt.clientAttributes[e];if(i)i.name=e,i.size=t,i.type=r,i.stride=n,i.pointer=o,i.offset=0;else for(var a=0;a<=e;a++)Kt.clientAttributes[a]||(Kt.clientAttributes[a]={name:e,size:t,type:r,stride:n,pointer:o,offset:0});Kt.modifiedClientAttributes=!0},addRendererComponent:function(e,t,r){Kt.rendererComponents[e]?Kt.rendererComponents[e]++:(Kt.rendererComponents[e]=1,Kt.enabledClientAttributes[e]&&console.log("Warning: glTexCoord used after EnableClientState for TEXTURE_COORD_ARRAY for TEXTURE0. Disabling TEXTURE_COORD_ARRAY..."),Kt.enabledClientAttributes[e]=!0,Kt.setClientAttribute(e,t,r,0,Kt.rendererComponentPointer),Kt.rendererComponentPointer+=t*bt.byteSizeByType[r-bt.byteSizeByTypeRoot])},disableBeginEndClientAttributes:function(){for(var e=0;e<Kt.NUM_ATTRIBUTES;e++)Kt.rendererComponents[e]&&(Kt.enabledClientAttributes[e]=!1)},getRenderer:function(){if(Kt.currentRenderer)return Kt.currentRenderer;for(var e=Kt.liveClientAttributes,t=Kt.rendererCache.getStaticKeyView().reset(),r=0,n=0;n<e.length;n++)r|=1<<e[n].name;var o=0;if(Wt.fogEnabled)switch(Wt.fogMode){case 2049:o=1;break;case 9729:o=2;break;default:o=3}t.next(r<<2|o),t.next(bt.currProgram),bt.currProgram||Kt.TexEnvJIT.traverseState(t);var i=t.get();return i?(Kt.currentRenderer=i,i):(i=Kt.createRenderer(),Kt.currentRenderer=i,t.set(i),i)},createRenderer:function(e){for(var t=!!bt.currProgram,r=!1,n=0;n<Kt.MAX_TEXTURES;n++){var o=Kt.TEXTURE0+n;Kt.enabledClientAttributes[o]&&(t||0==Kt.TexEnvJIT.getTexUnitType(n)&&A("GL_TEXTURE"+n+" coords are supplied, but that texture unit is disabled in the fixed-function pipeline."),r=!0)}var i={init:function(){var e="u_texUnit",n="a_texCoord",o="v_texCoord",i=Kt.useTextureMatrix?"u_textureMatrix":null;if(t)bt.shaderInfos[bt.programShaders[bt.currProgram][0]].type==sr.VERTEX_SHADER?(this.vertexShader=bt.shaders[bt.programShaders[bt.currProgram][0]],this.fragmentShader=bt.shaders[bt.programShaders[bt.currProgram][1]]):(this.vertexShader=bt.shaders[bt.programShaders[bt.currProgram][1]],this.fragmentShader=bt.shaders[bt.programShaders[bt.currProgram][0]]),this.program=bt.programs[bt.currProgram],this.usedTexUnitList=[];else{if(Wt.fogEnabled)switch(Wt.fogMode){case 2049:var a=" float fog = exp(-u_fogDensity * u_fogDensity * ecDistance * ecDistance); \n";break;case 9729:a=" float fog = (u_fogEnd - ecDistance) * u_fogScale; \n";break;default:a=" float fog = exp(-u_fogDensity * ecDistance); \n"}Kt.TexEnvJIT.setGLSLVars(e,o,"v_color",i);var s=Kt.TexEnvJIT.genAllPassLines("gl_FragColor",2),u="",c="",l="",d="";this.usedTexUnitList=Kt.TexEnvJIT.getUsedTexUnitList();for(var f=0;f<this.usedTexUnitList.length;f++){var m=this.usedTexUnitList[f];u+="attribute vec4 "+n+m+";\n",c+="varying vec4 "+o+m+";\n",l+="uniform sampler2D "+e+m+";\n",d+=" "+o+m+" = "+n+m+";\n",Kt.useTextureMatrix&&(l+="uniform mat4 "+i+m+";\n")}var p=null;Wt.fogEnabled&&(p=" v_fogFragCoord = abs(ecPosition.z);\n");var h=["attribute vec4 a_position;","attribute vec4 a_color;","varying vec4 v_color;",u,c,Wt.fogEnabled?"varying float v_fogFragCoord;":null,"uniform mat4 u_modelView;","uniform mat4 u_projection;","void main()","{"," vec4 ecPosition = u_modelView * a_position;"," gl_Position = u_projection * ecPosition;"," v_color = a_color;",d,p,"}",""].join("\n").replace(/\n\n+/g,"\n");this.vertexShader=sr.createShader(sr.VERTEX_SHADER),sr.shaderSource(this.vertexShader,h),sr.compileShader(this.vertexShader);var v=null;Wt.fogEnabled&&(v=["","varying float v_fogFragCoord; ","uniform vec4 u_fogColor; ","uniform float u_fogEnd; ","uniform float u_fogScale; ","uniform float u_fogDensity; ","float ffog(in float ecDistance) { ",a," fog = clamp(fog, 0.0, 1.0); "," return fog; ","}",""].join("\n"));var E=null;Wt.fogEnabled&&(E="gl_FragColor = vec4(mix(u_fogColor.rgb, gl_FragColor.rgb, ffog(v_fogFragCoord)), gl_FragColor.a);\n");var g=["precision mediump float;",c,l,"varying vec4 v_color;",v,"void main()","{",s,E,"}",""].join("\n").replace(/\n\n+/g,"\n");this.fragmentShader=sr.createShader(sr.FRAGMENT_SHADER),sr.shaderSource(this.fragmentShader,g),sr.compileShader(this.fragmentShader),this.program=sr.createProgram(),sr.attachShader(this.program,this.vertexShader),sr.attachShader(this.program,this.fragmentShader),sr.bindAttribLocation(this.program,Kt.VERTEX,"a_position"),sr.bindAttribLocation(this.program,Kt.COLOR,"a_color"),sr.bindAttribLocation(this.program,Kt.NORMAL,"a_normal");var y=sr.getParameter(sr.MAX_VERTEX_ATTRIBS);for(f=0;f<Kt.MAX_TEXTURES&&Kt.TEXTURE0+f<y;f++)sr.bindAttribLocation(this.program,Kt.TEXTURE0+f,"a_texCoord"+f),sr.bindAttribLocation(this.program,Kt.TEXTURE0+f,n+f);sr.linkProgram(this.program)}this.textureMatrixVersion=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.positionLocation=sr.getAttribLocation(this.program,"a_position"),this.texCoordLocations=[];for(f=0;f<Kt.MAX_TEXTURES;f++)Kt.enabledClientAttributes[Kt.TEXTURE0+f]?this.texCoordLocations[f]=t?sr.getAttribLocation(this.program,"a_texCoord"+f):sr.getAttribLocation(this.program,n+f):this.texCoordLocations[f]=-1;if(this.colorLocation=sr.getAttribLocation(this.program,"a_color"),!t){var w=sr.getParameter(sr.CURRENT_PROGRAM);sr.useProgram(this.program);for(f=0;f<this.usedTexUnitList.length;f++){var b=this.usedTexUnitList[f],_=sr.getUniformLocation(this.program,e+b);sr.uniform1i(_,b)}sr.vertexAttrib4fv(this.colorLocation,[1,1,1,1]),sr.useProgram(w)}this.textureMatrixLocations=[];for(f=0;f<Kt.MAX_TEXTURES;f++)this.textureMatrixLocations[f]=sr.getUniformLocation(this.program,"u_textureMatrix"+f);this.normalLocation=sr.getAttribLocation(this.program,"a_normal"),this.modelViewLocation=sr.getUniformLocation(this.program,"u_modelView"),this.projectionLocation=sr.getUniformLocation(this.program,"u_projection"),this.hasTextures=r,this.hasNormal=Kt.enabledClientAttributes[Kt.NORMAL]&&Kt.clientAttributes[Kt.NORMAL].size>0&&this.normalLocation>=0,this.hasColor=0===this.colorLocation||this.colorLocation>0,this.floatType=sr.FLOAT,this.fogColorLocation=sr.getUniformLocation(this.program,"u_fogColor"),this.fogEndLocation=sr.getUniformLocation(this.program,"u_fogEnd"),this.fogScaleLocation=sr.getUniformLocation(this.program,"u_fogScale"),this.fogDensityLocation=sr.getUniformLocation(this.program,"u_fogDensity"),this.hasFog=!!(this.fogColorLocation||this.fogEndLocation||this.fogScaleLocation||this.fogDensityLocation)},prepare:function(){var e;if(bt.currArrayBuffer)e=bt.currArrayBuffer;else{var t=Kt.firstVertex*Kt.stride,r=Kt.lastVertex*Kt.stride;F(r<=bt.MAX_TEMP_BUFFER_SIZE,"too much vertex data"),e=bt.getTempVertexBuffer(r)}bt.currArrayBuffer||(e!=Kt.lastArrayBuffer&&(sr.bindBuffer(sr.ARRAY_BUFFER,e),Kt.lastArrayBuffer=e),sr.bufferSubData(sr.ARRAY_BUFFER,t,Kt.vertexData.subarray(t>>2,r>>2))),bt.currProgram||Kt.fixedFunctionProgram!=this.program&&(sr.useProgram(this.program),Kt.fixedFunctionProgram=this.program),this.modelViewLocation&&this.modelViewMatrixVersion!=Kt.matrixVersion[0]&&(this.modelViewMatrixVersion=Kt.matrixVersion[0],sr.uniformMatrix4fv(this.modelViewLocation,!1,Kt.matrix[0])),this.projectionLocation&&this.projectionMatrixVersion!=Kt.matrixVersion[1]&&(this.projectionMatrixVersion=Kt.matrixVersion[1],sr.uniformMatrix4fv(this.projectionLocation,!1,Kt.matrix[1]));var n=Kt.clientAttributes,o=n[Kt.VERTEX];if(sr.vertexAttribPointer(this.positionLocation,o.size,o.type,!1,Kt.stride,o.offset),sr.enableVertexAttribArray(this.positionLocation),this.hasNormal){var i=n[Kt.NORMAL];sr.vertexAttribPointer(this.normalLocation,i.size,i.type,!0,Kt.stride,i.offset),sr.enableVertexAttribArray(this.normalLocation)}if(this.hasTextures)for(var a=0;a<Kt.MAX_TEXTURES;a++){var s=this.texCoordLocations[a];if(!(void 0===s||s<0)){var u=n[Kt.TEXTURE0+a];u.size?(sr.vertexAttribPointer(s,u.size,u.type,!1,Kt.stride,u.offset),sr.enableVertexAttribArray(s)):(sr.vertexAttrib4f(s,0,0,0,1),sr.disableVertexAttribArray(s));var c=2+a;this.textureMatrixLocations[a]&&this.textureMatrixVersion[c]!=Kt.matrixVersion[c]&&(this.textureMatrixVersion[c]=Kt.matrixVersion[c],sr.uniformMatrix4fv(this.textureMatrixLocations[a],!1,Kt.matrix[c]))}}if(Kt.enabledClientAttributes[Kt.COLOR]){var l=n[Kt.COLOR];sr.vertexAttribPointer(this.colorLocation,l.size,l.type,!0,Kt.stride,l.offset),sr.enableVertexAttribArray(this.colorLocation)}else this.hasColor&&(sr.disableVertexAttribArray(this.colorLocation),sr.vertexAttrib4fv(this.colorLocation,Kt.clientColor));this.hasFog&&(this.fogColorLocation&&sr.uniform4fv(this.fogColorLocation,Wt.fogColor),this.fogEndLocation&&sr.uniform1f(this.fogEndLocation,Wt.fogEnd),this.fogScaleLocation&&sr.uniform1f(this.fogScaleLocation,1/(Wt.fogEnd-Wt.fogStart)),this.fogDensityLocation&&sr.uniform1f(this.fogDensityLocation,Wt.fogDensity))},cleanup:function(){if(sr.disableVertexAttribArray(this.positionLocation),this.hasTextures)for(var e=0;e<Kt.MAX_TEXTURES;e++)Kt.enabledClientAttributes[Kt.TEXTURE0+e]&&this.texCoordLocations[e]>=0&&sr.disableVertexAttribArray(this.texCoordLocations[e]);this.hasColor&&sr.disableVertexAttribArray(this.colorLocation),this.hasNormal&&sr.disableVertexAttribArray(this.normalLocation),bt.currProgram||(sr.useProgram(null),Kt.fixedFunctionProgram=0),bt.currArrayBuffer||(sr.bindBuffer(sr.ARRAY_BUFFER,null),Kt.lastArrayBuffer=null),Kt.matricesModified=!0}};return i.init(),i},setupFuncs:function(){Kt.MapTreeLib=Kt.spawnMapTreeLib(),Kt.spawnMapTreeLib=null,Kt.TexEnvJIT=Kt.spawnTexEnvJIT(),Kt.spawnTexEnvJIT=null,Kt.setupHooks()},setupHooks:function(){Wt.hasRunInit||Wt.init();var e=Vt;Vt=function(t){Kt.TexEnvJIT.hook_activeTexture(t),e(t)};var t=_t;_t=function(e){Kt.TexEnvJIT.hook_enable(e),t(e)};var r=Tt;Tt=function(e){Kt.TexEnvJIT.hook_disable(e),r(e)};0;0;0;var n=Mt;Mt=function(e,t){if(35725===e&&sr.getParameter(sr.CURRENT_PROGRAM)==Kt.fixedFunctionProgram)return void(Q[t>>2]=0);n(e,t)}},initted:!1,init:function(){if(_("WARNING: using emscripten GL immediate mode emulation. This is very limited in what it supports"),Kt.initted=!0,o.useWebGL){Kt.MAX_TEXTURES=o.GL_MAX_TEXTURE_IMAGE_UNITS||sr.getParameter(sr.MAX_TEXTURE_IMAGE_UNITS),Kt.TexEnvJIT.init(sr,Kt.MAX_TEXTURES),Kt.NUM_ATTRIBUTES=3+Kt.MAX_TEXTURES,Kt.clientAttributes=[],Wt.enabledClientAttribIndices=[];for(var e=0;e<Kt.NUM_ATTRIBUTES;e++)Kt.clientAttributes.push({}),Wt.enabledClientAttribIndices.push(!1);Kt.matrix=[],Kt.matrixStack=[],Kt.matrixVersion=[];for(e=0;e<2+Kt.MAX_TEXTURES;e++)Kt.matrixStack.push([]),Kt.matrixVersion.push(0),Kt.matrix.push(Kt.matrixLib.mat4.create()),Kt.matrixLib.mat4.identity(Kt.matrix[e]);Kt.rendererCache=Kt.MapTreeLib.create(),Kt.tempData=new Float32Array(bt.MAX_TEMP_BUFFER_SIZE>>2),Kt.indexData=new Uint16Array(bt.MAX_TEMP_BUFFER_SIZE>>1),Kt.vertexDataU8=new Uint8Array(Kt.tempData.buffer),bt.generateTempBuffers(!0,bt.currentContext),Kt.clientColor=new Float32Array([1,1,1,1])}},prepareClientAttributes:function(e,t){if(Kt.modifiedClientAttributes){Kt.modifiedClientAttributes=!1;var r=2147483647,n=0,o=2147483647,i=0,a=Kt.liveClientAttributes;a.length=0;for(var s=0;s<3+Kt.MAX_TEXTURES;s++)if(Kt.enabledClientAttributes[s]){var u=Kt.clientAttributes[s];a.push(u),r=Math.min(r,u.pointer),u.sizeBytes=u.size*bt.byteSizeByType[u.type-bt.byteSizeByTypeRoot],n+=u.sizeBytes,o=Math.min(o,u.stride),i=Math.max(i,u.stride)}if((o!=i||i<n)&&!t){Kt.restrideBuffer||(Kt.restrideBuffer=Rr(bt.MAX_TEMP_BUFFER_SIZE));var c=Kt.restrideBuffer;n=0;for(s=0;s<a.length;s++){var l=(u=a[s]).sizeBytes;l%4!=0&&(l+=4-l%4),u.offset=n,n+=l}for(s=0;s<a.length;s++){u=a[s];var d=Math.max(u.sizeBytes,u.stride);if(3&d||3&u.sizeBytes)for(p=0;p<e;p++)for(h=0;h<u.sizeBytes;h++)Y[c+u.offset+n*p+h]=Y[u.pointer+p*d+h];else for(var f=u.sizeBytes>>2,m=Math.max(u.sizeBytes,u.stride)>>2,p=0;p<e;p++)for(var h=0;h<f;h++)Q[(c+u.offset+n*p>>2)+h]=Q[(u.pointer>>2)+p*m+h];u.pointer=c+u.offset}Kt.stride=n,Kt.vertexPointer=c}else{bt.currArrayBuffer?Kt.vertexPointer=0:Kt.vertexPointer=r;for(s=0;s<a.length;s++){(u=a[s]).offset=u.pointer-Kt.vertexPointer}Kt.stride=Math.max(i,n)}t||(Kt.vertexCounter=Kt.stride*e/4)}else Kt.vertexCounter=Kt.stride*e/4},flush:function(e,t,r){F(e>=0||!e),t=t||0,r=r||0;var n=Kt.getRenderer(),o=4*Kt.vertexCounter/Kt.stride;if(o){F(o%1==0,"`numVertexes` must be an integer.");var i=!1,a=0;if(e){if(a=e,!bt.currArrayBuffer&&Kt.firstVertex>Kt.lastVertex){F(!bt.currElementArrayBuffer);for(var s=0;s<e;s++){var u=K[r+2*s>>1];Kt.firstVertex=Math.min(Kt.firstVertex,u),Kt.lastVertex=Math.max(Kt.lastVertex,u+1)}}if(!bt.currElementArrayBuffer){F(e<<1<=bt.MAX_TEMP_BUFFER_SIZE,"too many immediate mode indexes (a)");var c=bt.getTempIndexBuffer(e<<1);sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,c),sr.bufferSubData(sr.ELEMENT_ARRAY_BUFFER,0,K.subarray(r>>1,r+(e<<1)>>1)),r=0,i=!0}}else if(Kt.mode>6){if(7!=Kt.mode)throw"unsupported immediate mode "+Kt.mode;F(Kt.firstVertex%4==0),F((r=3*Kt.firstVertex)+((a=6*(o/4))<<1)<=bt.MAX_TEMP_BUFFER_SIZE,"too many immediate mode indexes (b)"),sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,bt.currentContext.tempQuadIndexBuffer),i=!0}n.prepare(),a?sr.drawElements(sr.TRIANGLES,a,sr.UNSIGNED_SHORT,r):sr.drawArrays(Kt.mode,t,o),i&&sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,bt.buffers[bt.currElementArrayBuffer]||null),n.cleanup()}}};Kt.matrixLib=(zt={},Gt={},Ht={},Yt={},qt=Float32Array,zt.create=function(e){var t=new qt(3);return e?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):t[0]=t[1]=t[2]=0,t},zt.set=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},zt.add=function(e,t,r){return r&&e!==r?(r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r):(e[0]+=t[0],e[1]+=t[1],e[2]+=t[2],e)},zt.subtract=function(e,t,r){return r&&e!==r?(r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r):(e[0]-=t[0],e[1]-=t[1],e[2]-=t[2],e)},zt.multiply=function(e,t,r){return r&&e!==r?(r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r):(e[0]*=t[0],e[1]*=t[1],e[2]*=t[2],e)},zt.negate=function(e,t){return t||(t=e),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},zt.scale=function(e,t,r){return r&&e!==r?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r):(e[0]*=t,e[1]*=t,e[2]*=t,e)},zt.normalize=function(e,t){t||(t=e);var r=e[0],n=e[1],o=e[2],i=Math.sqrt(r*r+n*n+o*o);return i?1===i?(t[0]=r,t[1]=n,t[2]=o,t):(i=1/i,t[0]=r*i,t[1]=n*i,t[2]=o*i,t):(t[0]=0,t[1]=0,t[2]=0,t)},zt.cross=function(e,t,r){r||(r=e);var n=e[0],o=e[1],i=e[2],a=t[0],s=t[1],u=t[2];return r[0]=o*u-i*s,r[1]=i*a-n*u,r[2]=n*s-o*a,r},zt.length=function(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)},zt.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},zt.direction=function(e,t,r){r||(r=e);var n=e[0]-t[0],o=e[1]-t[1],i=e[2]-t[2],a=Math.sqrt(n*n+o*o+i*i);return a?(a=1/a,r[0]=n*a,r[1]=o*a,r[2]=i*a,r):(r[0]=0,r[1]=0,r[2]=0,r)},zt.lerp=function(e,t,r,n){return n||(n=e),n[0]=e[0]+r*(t[0]-e[0]),n[1]=e[1]+r*(t[1]-e[1]),n[2]=e[2]+r*(t[2]-e[2]),n},zt.dist=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],o=t[2]-e[2];return Math.sqrt(r*r+n*n+o*o)},zt.unproject=function(e,t,r,n,o){o||(o=e);var i=Ht.create(),a=new qt(4);return a[0]=2*(e[0]-n[0])/n[2]-1,a[1]=2*(e[1]-n[1])/n[3]-1,a[2]=2*e[2]-1,a[3]=1,Ht.multiply(r,t,i),Ht.inverse(i)?(Ht.multiplyVec4(i,a),0===a[3]?null:(o[0]=a[0]/a[3],o[1]=a[1]/a[3],o[2]=a[2]/a[3],o)):null},zt.str=function(e){return"["+e[0]+", "+e[1]+", "+e[2]+"]"},Gt.create=function(e){var t=new qt(9);return e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]),t},Gt.set=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},Gt.identity=function(e){return e||(e=Gt.create()),e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},Gt.transpose=function(e,t){if(!t||e===t){var r=e[1],n=e[2],o=e[5];return e[1]=e[3],e[2]=e[6],e[3]=r,e[5]=e[7],e[6]=n,e[7]=o,e}return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t},Gt.toMat4=function(e,t){return t||(t=Ht.create()),t[15]=1,t[14]=0,t[13]=0,t[12]=0,t[11]=0,t[10]=e[8],t[9]=e[7],t[8]=e[6],t[7]=0,t[6]=e[5],t[5]=e[4],t[4]=e[3],t[3]=0,t[2]=e[2],t[1]=e[1],t[0]=e[0],t},Gt.str=function(e){return"["+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+"]"},Ht.create=function(e){var t=new qt(16);return e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t},Ht.set=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},Ht.identity=function(e){return e||(e=Ht.create()),e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},Ht.transpose=function(e,t){if(!t||e===t){var r=e[1],n=e[2],o=e[3],i=e[6],a=e[7],s=e[11];return e[1]=e[4],e[2]=e[8],e[3]=e[12],e[4]=r,e[6]=e[9],e[7]=e[13],e[8]=n,e[9]=i,e[11]=e[14],e[12]=o,e[13]=a,e[14]=s,e}return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t},Ht.determinant=function(e){var t=e[0],r=e[1],n=e[2],o=e[3],i=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],d=e[10],f=e[11],m=e[12],p=e[13],h=e[14],v=e[15];return m*l*s*o-c*p*s*o-m*a*d*o+i*p*d*o+c*a*h*o-i*l*h*o-m*l*n*u+c*p*n*u+m*r*d*u-t*p*d*u-c*r*h*u+t*l*h*u+m*a*n*f-i*p*n*f-m*r*s*f+t*p*s*f+i*r*h*f-t*a*h*f-c*a*n*v+i*l*n*v+c*r*s*v-t*l*s*v-i*r*d*v+t*a*d*v},Ht.inverse=function(e,t){t||(t=e);var r,n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=e[9],m=e[10],p=e[11],h=e[12],v=e[13],E=e[14],g=e[15],y=n*u-o*s,w=n*c-i*s,b=n*l-a*s,_=o*c-i*u,T=o*l-a*u,x=i*l-a*c,A=d*v-f*h,M=d*E-m*h,S=d*g-p*h,O=f*E-m*v,R=f*g-p*v,D=m*g-p*E,k=y*D-w*R+b*O+_*S-T*M+x*A;return k?(r=1/k,t[0]=(u*D-c*R+l*O)*r,t[1]=(-o*D+i*R-a*O)*r,t[2]=(v*x-E*T+g*_)*r,t[3]=(-f*x+m*T-p*_)*r,t[4]=(-s*D+c*S-l*M)*r,t[5]=(n*D-i*S+a*M)*r,t[6]=(-h*x+E*b-g*w)*r,t[7]=(d*x-m*b+p*w)*r,t[8]=(s*R-u*S+l*A)*r,t[9]=(-n*R+o*S-a*A)*r,t[10]=(h*T-v*b+g*y)*r,t[11]=(-d*T+f*b-p*y)*r,t[12]=(-s*O+u*M-c*A)*r,t[13]=(n*O-o*M+i*A)*r,t[14]=(-h*_+v*w-E*y)*r,t[15]=(d*_-f*w+m*y)*r,t):null},Ht.toRotationMat=function(e,t){return t||(t=Ht.create()),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},Ht.toMat3=function(e,t){return t||(t=Gt.create()),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},Ht.toInverseMat3=function(e,t){var r,n=e[0],o=e[1],i=e[2],a=e[4],s=e[5],u=e[6],c=e[8],l=e[9],d=e[10],f=d*s-u*l,m=-d*a+u*c,p=l*a-s*c,h=n*f+o*m+i*p;return h?(r=1/h,t||(t=Gt.create()),t[0]=f*r,t[1]=(-d*o+i*l)*r,t[2]=(u*o-i*s)*r,t[3]=m*r,t[4]=(d*n-i*c)*r,t[5]=(-u*n+i*a)*r,t[6]=p*r,t[7]=(-l*n+o*c)*r,t[8]=(s*n-o*a)*r,t):null},Ht.multiply=function(e,t,r){r||(r=e);var n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=e[9],m=e[10],p=e[11],h=e[12],v=e[13],E=e[14],g=e[15],y=t[0],w=t[1],b=t[2],_=t[3],T=t[4],x=t[5],A=t[6],M=t[7],S=t[8],O=t[9],R=t[10],D=t[11],k=t[12],L=t[13],F=t[14],C=t[15];return r[0]=y*n+w*s+b*d+_*h,r[1]=y*o+w*u+b*f+_*v,r[2]=y*i+w*c+b*m+_*E,r[3]=y*a+w*l+b*p+_*g,r[4]=T*n+x*s+A*d+M*h,r[5]=T*o+x*u+A*f+M*v,r[6]=T*i+x*c+A*m+M*E,r[7]=T*a+x*l+A*p+M*g,r[8]=S*n+O*s+R*d+D*h,r[9]=S*o+O*u+R*f+D*v,r[10]=S*i+O*c+R*m+D*E,r[11]=S*a+O*l+R*p+D*g,r[12]=k*n+L*s+F*d+C*h,r[13]=k*o+L*u+F*f+C*v,r[14]=k*i+L*c+F*m+C*E,r[15]=k*a+L*l+F*p+C*g,r},Ht.multiplyVec3=function(e,t,r){r||(r=t);var n=t[0],o=t[1],i=t[2];return r[0]=e[0]*n+e[4]*o+e[8]*i+e[12],r[1]=e[1]*n+e[5]*o+e[9]*i+e[13],r[2]=e[2]*n+e[6]*o+e[10]*i+e[14],r},Ht.multiplyVec4=function(e,t,r){r||(r=t);var n=t[0],o=t[1],i=t[2],a=t[3];return r[0]=e[0]*n+e[4]*o+e[8]*i+e[12]*a,r[1]=e[1]*n+e[5]*o+e[9]*i+e[13]*a,r[2]=e[2]*n+e[6]*o+e[10]*i+e[14]*a,r[3]=e[3]*n+e[7]*o+e[11]*i+e[15]*a,r},Ht.translate=function(e,t,r){var n,o,i,a,s,u,c,l,d,f,m,p,h=t[0],v=t[1],E=t[2];return r&&e!==r?(n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=e[9],m=e[10],p=e[11],r[0]=n,r[1]=o,r[2]=i,r[3]=a,r[4]=s,r[5]=u,r[6]=c,r[7]=l,r[8]=d,r[9]=f,r[10]=m,r[11]=p,r[12]=n*h+s*v+d*E+e[12],r[13]=o*h+u*v+f*E+e[13],r[14]=i*h+c*v+m*E+e[14],r[15]=a*h+l*v+p*E+e[15],r):(e[12]=e[0]*h+e[4]*v+e[8]*E+e[12],e[13]=e[1]*h+e[5]*v+e[9]*E+e[13],e[14]=e[2]*h+e[6]*v+e[10]*E+e[14],e[15]=e[3]*h+e[7]*v+e[11]*E+e[15],e)},Ht.scale=function(e,t,r){var n=t[0],o=t[1],i=t[2];return r&&e!==r?(r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*o,r[7]=e[7]*o,r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11]*i,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r):(e[0]*=n,e[1]*=n,e[2]*=n,e[3]*=n,e[4]*=o,e[5]*=o,e[6]*=o,e[7]*=o,e[8]*=i,e[9]*=i,e[10]*=i,e[11]*=i,e)},Ht.rotate=function(e,t,r,n){var o,i,a,s,u,c,l,d,f,m,p,h,v,E,g,y,w,b,_,T,x,A,M,S,O=r[0],R=r[1],D=r[2],k=Math.sqrt(O*O+R*R+D*D);return k?(1!==k&&(O*=k=1/k,R*=k,D*=k),o=Math.sin(t),a=1-(i=Math.cos(t)),s=e[0],u=e[1],c=e[2],l=e[3],d=e[4],f=e[5],m=e[6],p=e[7],h=e[8],v=e[9],E=e[10],g=e[11],y=O*O*a+i,w=R*O*a+D*o,b=D*O*a-R*o,_=O*R*a-D*o,T=R*R*a+i,x=D*R*a+O*o,A=O*D*a+R*o,M=R*D*a-O*o,S=D*D*a+i,n?e!==n&&(n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]):n=e,n[0]=s*y+d*w+h*b,n[1]=u*y+f*w+v*b,n[2]=c*y+m*w+E*b,n[3]=l*y+p*w+g*b,n[4]=s*_+d*T+h*x,n[5]=u*_+f*T+v*x,n[6]=c*_+m*T+E*x,n[7]=l*_+p*T+g*x,n[8]=s*A+d*M+h*S,n[9]=u*A+f*M+v*S,n[10]=c*A+m*M+E*S,n[11]=l*A+p*M+g*S,n):null},Ht.rotateX=function(e,t,r){var n=Math.sin(t),o=Math.cos(t),i=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],d=e[10],f=e[11];return r?e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]):r=e,r[4]=i*o+c*n,r[5]=a*o+l*n,r[6]=s*o+d*n,r[7]=u*o+f*n,r[8]=i*-n+c*o,r[9]=a*-n+l*o,r[10]=s*-n+d*o,r[11]=u*-n+f*o,r},Ht.rotateY=function(e,t,r){var n=Math.sin(t),o=Math.cos(t),i=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],d=e[10],f=e[11];return r?e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]):r=e,r[0]=i*o+c*-n,r[1]=a*o+l*-n,r[2]=s*o+d*-n,r[3]=u*o+f*-n,r[8]=i*n+c*o,r[9]=a*n+l*o,r[10]=s*n+d*o,r[11]=u*n+f*o,r},Ht.rotateZ=function(e,t,r){var n=Math.sin(t),o=Math.cos(t),i=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],d=e[6],f=e[7];return r?e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]):r=e,r[0]=i*o+c*n,r[1]=a*o+l*n,r[2]=s*o+d*n,r[3]=u*o+f*n,r[4]=i*-n+c*o,r[5]=a*-n+l*o,r[6]=s*-n+d*o,r[7]=u*-n+f*o,r},Ht.frustum=function(e,t,r,n,o,i,a){a||(a=Ht.create());var s=t-e,u=n-r,c=i-o;return a[0]=2*o/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*o/u,a[6]=0,a[7]=0,a[8]=(t+e)/s,a[9]=(n+r)/u,a[10]=-(i+o)/c,a[11]=-1,a[12]=0,a[13]=0,a[14]=-i*o*2/c,a[15]=0,a},Ht.perspective=function(e,t,r,n,o){var i=r*Math.tan(e*Math.PI/360),a=i*t;return Ht.frustum(-a,a,-i,i,r,n,o)},Ht.ortho=function(e,t,r,n,o,i,a){a||(a=Ht.create());var s=t-e,u=n-r,c=i-o;return a[0]=2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2/u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=-2/c,a[11]=0,a[12]=-(e+t)/s,a[13]=-(n+r)/u,a[14]=-(i+o)/c,a[15]=1,a},Ht.lookAt=function(e,t,r,n){n||(n=Ht.create());var o,i,a,s,u,c,l,d,f,m,p=e[0],h=e[1],v=e[2],E=r[0],g=r[1],y=r[2],w=t[0],b=t[1],_=t[2];return p===w&&h===b&&v===_?Ht.identity(n):(l=p-w,d=h-b,f=v-_,o=g*(f*=m=1/Math.sqrt(l*l+d*d+f*f))-y*(d*=m),i=y*(l*=m)-E*f,a=E*d-g*l,(m=Math.sqrt(o*o+i*i+a*a))?(o*=m=1/m,i*=m,a*=m):(o=0,i=0,a=0),s=d*a-f*i,u=f*o-l*a,c=l*i-d*o,(m=Math.sqrt(s*s+u*u+c*c))?(s*=m=1/m,u*=m,c*=m):(s=0,u=0,c=0),n[0]=o,n[1]=s,n[2]=l,n[3]=0,n[4]=i,n[5]=u,n[6]=d,n[7]=0,n[8]=a,n[9]=c,n[10]=f,n[11]=0,n[12]=-(o*p+i*h+a*v),n[13]=-(s*p+u*h+c*v),n[14]=-(l*p+d*h+f*v),n[15]=1,n)},Ht.fromRotationTranslation=function(e,t,r){r||(r=Ht.create());var n=e[0],o=e[1],i=e[2],a=e[3],s=n+n,u=o+o,c=i+i,l=n*s,d=n*u,f=n*c,m=o*u,p=o*c,h=i*c,v=a*s,E=a*u,g=a*c;return r[0]=1-(m+h),r[1]=d+g,r[2]=f-E,r[3]=0,r[4]=d-g,r[5]=1-(l+h),r[6]=p+v,r[7]=0,r[8]=f+E,r[9]=p-v,r[10]=1-(l+m),r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r},Ht.str=function(e){return"["+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+"]"},Yt.create=function(e){var t=new qt(4);return e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]),t},Yt.set=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Yt.calculateW=function(e,t){var r=e[0],n=e[1],o=e[2];return t&&e!==t?(t[0]=r,t[1]=n,t[2]=o,t[3]=-Math.sqrt(Math.abs(1-r*r-n*n-o*o)),t):(e[3]=-Math.sqrt(Math.abs(1-r*r-n*n-o*o)),e)},Yt.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},Yt.inverse=function(e,t){var r=e[0],n=e[1],o=e[2],i=e[3],a=r*r+n*n+o*o+i*i,s=a?1/a:0;return t&&e!==t?(t[0]=-e[0]*s,t[1]=-e[1]*s,t[2]=-e[2]*s,t[3]=e[3]*s,t):(e[0]*=-s,e[1]*=-s,e[2]*=-s,e[3]*=s,e)},Yt.conjugate=function(e,t){return t&&e!==t?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t):(e[0]*=-1,e[1]*=-1,e[2]*=-1,e)},Yt.length=function(e){var t=e[0],r=e[1],n=e[2],o=e[3];return Math.sqrt(t*t+r*r+n*n+o*o)},Yt.normalize=function(e,t){t||(t=e);var r=e[0],n=e[1],o=e[2],i=e[3],a=Math.sqrt(r*r+n*n+o*o+i*i);return 0===a?(t[0]=0,t[1]=0,t[2]=0,t[3]=0,t):(a=1/a,t[0]=r*a,t[1]=n*a,t[2]=o*a,t[3]=i*a,t)},Yt.add=function(e,t,r){return r&&e!==r?(r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r):(e[0]+=t[0],e[1]+=t[1],e[2]+=t[2],e[3]+=t[3],e)},Yt.multiply=function(e,t,r){r||(r=e);var n=e[0],o=e[1],i=e[2],a=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return r[0]=n*l+a*s+o*c-i*u,r[1]=o*l+a*u+i*s-n*c,r[2]=i*l+a*c+n*u-o*s,r[3]=a*l-n*s-o*u-i*c,r},Yt.multiplyVec3=function(e,t,r){r||(r=t);var n=t[0],o=t[1],i=t[2],a=e[0],s=e[1],u=e[2],c=e[3],l=c*n+s*i-u*o,d=c*o+u*n-a*i,f=c*i+a*o-s*n,m=-a*n-s*o-u*i;return r[0]=l*c+m*-a+d*-u-f*-s,r[1]=d*c+m*-s+f*-a-l*-u,r[2]=f*c+m*-u+l*-s-d*-a,r},Yt.scale=function(e,t,r){return r&&e!==r?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r):(e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e)},Yt.toMat3=function(e,t){t||(t=Gt.create());var r=e[0],n=e[1],o=e[2],i=e[3],a=r+r,s=n+n,u=o+o,c=r*a,l=r*s,d=r*u,f=n*s,m=n*u,p=o*u,h=i*a,v=i*s,E=i*u;return t[0]=1-(f+p),t[1]=l+E,t[2]=d-v,t[3]=l-E,t[4]=1-(c+p),t[5]=m+h,t[6]=d+v,t[7]=m-h,t[8]=1-(c+f),t},Yt.toMat4=function(e,t){t||(t=Ht.create());var r=e[0],n=e[1],o=e[2],i=e[3],a=r+r,s=n+n,u=o+o,c=r*a,l=r*s,d=r*u,f=n*s,m=n*u,p=o*u,h=i*a,v=i*s,E=i*u;return t[0]=1-(f+p),t[1]=l+E,t[2]=d-v,t[3]=0,t[4]=l-E,t[5]=1-(c+p),t[6]=m+h,t[7]=0,t[8]=d+v,t[9]=m-h,t[10]=1-(c+f),t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},Yt.slerp=function(e,t,r,n){n||(n=e);var o,i,a,s,u=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3];return Math.abs(u)>=1?(n!==e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]),n):(o=Math.acos(u),i=Math.sqrt(1-u*u),Math.abs(i)<.001?(n[0]=.5*e[0]+.5*t[0],n[1]=.5*e[1]+.5*t[1],n[2]=.5*e[2]+.5*t[2],n[3]=.5*e[3]+.5*t[3],n):(a=Math.sin((1-r)*o)/i,s=Math.sin(r*o)/i,n[0]=e[0]*a+t[0]*s,n[1]=e[1]*a+t[1]*s,n[2]=e[2]*a+t[2]*s,n[3]=e[3]*a+t[3]*s,n))},Yt.str=function(e){return"["+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+"]"},{vec3:zt,mat3:Gt,mat4:Ht,quat4:Yt});var Qt=ye;var Jt=we;function Zt(){var e=Zt;return e.LLVM_SAVEDSTACKS||(e.LLVM_SAVEDSTACKS=[]),e.LLVM_SAVEDSTACKS.push(Pr()),e.LLVM_SAVEDSTACKS.length-1}var $t=Ae;j("GMT",5313216,4);function er(){if(!er.called){er.called=!0,Q[Ar()>>2]=60*(new Date).getTimezoneOffset();var e=new Date(2e3,0,1),t=new Date(2e3,6,1);Q[Tr()>>2]=Number(e.getTimezoneOffset()!=t.getTimezoneOffset());var r=a(e),n=a(t),o=N(vr(r),"i8",0),i=N(vr(n),"i8",0);t.getTimezoneOffset()<e.getTimezoneOffset()?(Q[Mr()>>2]=o,Q[Mr()+4>>2]=i):(Q[Mr()>>2]=i,Q[Mr()+4>>2]=o)}function a(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}}function tr(e,t){er();var r=new Date(1e3*Q[e>>2]);Q[t>>2]=r.getSeconds(),Q[t+4>>2]=r.getMinutes(),Q[t+8>>2]=r.getHours(),Q[t+12>>2]=r.getDate(),Q[t+16>>2]=r.getMonth(),Q[t+20>>2]=r.getFullYear()-1900,Q[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),o=(r.getTime()-n.getTime())/864e5|0;Q[t+28>>2]=o,Q[t+36>>2]=-60*r.getTimezoneOffset();var i=new Date(2e3,6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));Q[t+32>>2]=s;var u=Q[Mr()+(s?4:0)>>2];return Q[t+40>>2]=u,t}function rr(e){var t=e/1e3;if((s||u)&&self.performance&&self.performance.now)for(var r=self.performance.now();self.performance.now()-r<t;);else for(r=Date.now();Date.now()-r<t;);return 0}function nr(e){nn("Cannot enlarge memory arrays to size "+e+" bytes (OOM). Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+Y.length+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}var or=be;function ir(e){return e%4==0&&(e%100!=0||e%400==0)}function ar(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}var sr,ur=[31,29,31,30,31,30,31,31,30,31,30,31],cr=[31,28,31,30,31,30,31,31,30,31,30,31];function lr(e,t){for(var r=new Date(e.getTime());t>0;){var n=ir(r.getFullYear()),o=r.getMonth(),i=(n?ur:cr)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function dr(e,t,r,n){var o=Q[n+40>>2],i={tm_sec:Q[n>>2],tm_min:Q[n+4>>2],tm_hour:Q[n+8>>2],tm_mday:Q[n+12>>2],tm_mon:Q[n+16>>2],tm_year:Q[n+20>>2],tm_wday:Q[n+24>>2],tm_yday:Q[n+28>>2],tm_isdst:Q[n+32>>2],tm_gmtoff:Q[n+36>>2],tm_zone:o?B(o):""},a=B(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return d(e,t,"0")}function m(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function h(e){var t=lr(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=p(r),i=p(n);return m(o,t)<=0?m(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var v={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return f((e.tm_year+1900)/100|0,2)},"%d":function(e){return f(e.tm_mday,2)},"%e":function(e){return d(e.tm_mday,2," ")},"%g":function(e){return h(e).toString().substring(2)},"%G":function(e){return h(e)},"%H":function(e){return f(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":function(e){return f(e.tm_mday+ar(ir(e.tm_year+1900)?ur:cr,e.tm_mon-1),3)},"%m":function(e){return f(e.tm_mon+1,2)},"%M":function(e){return f(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return f(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),r=0===t.getDay()?t:lr(t,7-t.getDay()),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(r,n)<0){var o=ar(ir(n.getFullYear())?ur:cr,n.getMonth()-1)-31,i=31-r.getDate()+o+n.getDate();return f(Math.ceil(i/7),2)}return 0===m(r,t)?"01":"00"},"%V":function(e){var t,r=new Date(e.tm_year+1900,0,4),n=new Date(e.tm_year+1901,0,4),o=p(r),i=p(n),a=lr(new Date(e.tm_year+1900,0,1),e.tm_yday);return m(a,o)<0?"53":m(i,a)<=0?"01":(t=o.getFullYear()<e.tm_year+1900?e.tm_yday+32-o.getDate():e.tm_yday+1-o.getDate(),f(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),r=1===t.getDay()?t:lr(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(r,n)<0){var o=ar(ir(n.getFullYear())?ur:cr,n.getMonth()-1)-31,i=31-r.getDate()+o+n.getDate();return f(Math.ceil(i/7),2)}return 0===m(r,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in v)a.indexOf(u)>=0&&(a=a.replace(new RegExp(u,"g"),v[u](i)));var E=vr(a,!1);return E.length>t?0:(z(E,e),E.length-1)}function fr(e){return Ge(10),-1}if(et.staticInit(),l){var mr=r(8952),pr=r(9942);Qe.staticInit()}o.requestFullScreen=function(e,t,r){_("Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead."),o.requestFullScreen=o.requestFullscreen,nt.requestFullScreen(e,t,r)},o.requestFullscreen=function(e,t,r){nt.requestFullscreen(e,t,r)},o.requestAnimationFrame=function(e){nt.requestAnimationFrame(e)},o.setCanvasSize=function(e,t,r){nt.setCanvasSize(e,t,r)},o.pauseMainLoop=function(){nt.mainLoop.pause()},o.resumeMainLoop=function(){nt.mainLoop.resume()},o.getUserMedia=function(){nt.getUserMedia()},o.createContext=function(e,t,r,n){return nt.createContext(e,t,r,n)},rt=c?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:"object"==typeof performance&&performance&&"function"==typeof performance.now?function(){return performance.now()}:Date.now,Kt.setupFuncs(),nt.moduleContextCreatedCallbacks.push(function(){Kt.init()}),bt.init(),Wt.init();var hr=!0;function vr(e,t,r){var n=r>0?r:V(e)+1,o=new Array(n),i=X(e,o,0,o.length);return t&&(o.length=i),o}function Er(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];n>255&&(hr&&F(!1,"Character code "+n+" ("+String.fromCharCode(n)+") at offset "+r+" not in 0x00-0xFF."),n&=255),t.push(String.fromCharCode(n))}return t.join("")}var gr="function"==typeof atob?atob:function(e){var t,r,n,o,i,a,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",c=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=s.indexOf(e.charAt(c++))<<2|(o=s.indexOf(e.charAt(c++)))>>4,r=(15&o)<<4|(i=s.indexOf(e.charAt(c++)))>>2,n=(3&i)<<6|(a=s.indexOf(e.charAt(c++))),u+=String.fromCharCode(t),64!==i&&(u+=String.fromCharCode(r)),64!==a&&(u+=String.fromCharCode(n))}while(c<e.length);return u};function yr(e){if(Ce(e))return function(e){if("boolean"==typeof c&&c){var t;try{t=Buffer.from(e,"base64")}catch(r){t=new Buffer(e,"base64")}return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}try{for(var r=gr(e),n=new Uint8Array(r.length),o=0;o<r.length;++o)n[o]=r.charCodeAt(o);return n}catch(e){throw new Error("Converting base64 string to bytes failed.")}}(e.slice(Fe.length))}var wr={f:D,d:function(){return R},b:function(e){nn("Stack overflow! Attempted to allocate "+e+" bytes on the stack, but stack has only "+(te-Pr()+e)+" bytes available!")},kb:function(e){se(e,"dd")},$a:function(e){se(e,"ddd")},Qa:function(e){se(e,"di")},Ga:function(e){se(e,"did")},Hd:function(e){se(e,"i")},Dd:function(e){se(e,"ii")},xd:function(e){se(e,"iidi")},rd:function(e){se(e,"iidiiii")},hd:function(e){se(e,"iii")},ad:function(e){se(e,"iiii")},Vc:function(e){se(e,"iiiid")},Rc:function(e){se(e,"iiiii")},Ic:function(e){se(e,"iiiiid")},Dc:function(e){se(e,"iiiiii")},xc:function(e){se(e,"iiiiiid")},rc:function(e){se(e,"iiiiiii")},lc:function(e){se(e,"iiiiiiii")},gc:function(e){se(e,"iiiiiiiii")},$b:function(e){se(e,"iiiiiiiiii")},Vb:function(e){se(e,"iiiiiiiiiii")},Sb:function(e){se(e,"iiiiiiiiiiii")},Rb:function(e){se(e,"iiiiiiiiiiiii")},Qb:function(e){se(e,"iiiiiiiiiiiiii")},Pb:function(e){se(e,"iiiiiiiiiiiiiii")},Ob:function(e){se(e,"iiiiiiiiiiiiiiii")},Nb:function(e){se(e,"iiiiiiiiiiiiiiiii")},Mb:function(e){se(e,"iiiiiiiiiiiiiiiiii")},Lb:function(e){se(e,"iiiiiiiiiiiiiiiiiii")},Kb:function(e){se(e,"iiiiiiiiiiiiiiiiiiii")},Jb:function(e){se(e,"iiiiiiiiiiiiiiiiiiiii")},Ib:function(e){se(e,"iiiiij")},Hb:function(e){se(e,"iiiij")},Gb:function(e){se(e,"iiiijj")},Fb:function(e){se(e,"iiiji")},Eb:function(e){se(e,"iiijj")},Db:function(e){se(e,"iiji")},Cb:function(e){se(e,"iijijji")},Bb:function(e){se(e,"iijijjji")},Ab:function(e){se(e,"jii")},zb:function(e){se(e,"jiii")},yb:function(e){se(e,"jiiii")},xb:function(e){se(e,"jiiiii")},wb:function(e){se(e,"jiij")},vb:function(e){se(e,"jij")},ub:function(e){se(e,"jiji")},tb:function(e){se(e,"jijii")},sb:function(e){se(e,"jijiii")},rb:function(e){se(e,"jijiiii")},qb:function(e){se(e,"jijiiiii")},pb:function(e){se(e,"jijij")},ob:function(e){se(e,"jijj")},nb:function(e){se(e,"jijji")},mb:function(e){se(e,"jijjiii")},lb:function(e){se(e,"v")},jb:function(e){se(e,"vi")},ib:function(e){se(e,"vid")},hb:function(e){se(e,"vidddiii")},gb:function(e){se(e,"vidi")},fb:function(e){se(e,"vii")},eb:function(e){se(e,"viid")},db:function(e){se(e,"viii")},cb:function(e){se(e,"viiidd")},bb:function(e){se(e,"viiii")},ab:function(e){se(e,"viiiii")},_a:function(e){se(e,"viiiiii")},Za:function(e){se(e,"viiiiiii")},Ya:function(e){se(e,"viiiiiiii")},Xa:function(e){se(e,"viiiiiiiii")},Wa:function(e){se(e,"viiiiiiiiii")},Va:function(e){se(e,"viiiiiiiiiii")},Ua:function(e){se(e,"viiiiiiiiiiii")},Ta:function(e){se(e,"viiiiiiiiiiiii")},Sa:function(e){se(e,"viiiiiiiiiiiiii")},Ra:function(e){se(e,"viiiiiiiiiiiiiii")},Pa:function(e){se(e,"viiiiiiiiiiiiiiii")},Oa:function(e){se(e,"viiiiiiiiiiiiiiiii")},Na:function(e){se(e,"viiiiiiiiiiiiiiiiii")},Ma:function(e){se(e,"viiiiiiiiiiiiiiiiiii")},La:function(e){se(e,"viiiiiiiiiiiiiiiiiiii")},Ka:function(e){se(e,"viijii")},Ja:function(e){se(e,"vij")},Ia:function(e){se(e,"viji")},Ha:function(e){se(e,"vijjii")},H:function(e,t){var r=Pr();try{return Ir(e,t)}catch(e){if(Nr(r),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},W:function(e,t){var r=Pr();try{return Ur(e,t)}catch(e){if(Nr(r),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},y:function(e){var t=Pr();try{return Br(e)}catch(e){if(Nr(t),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},k:function(e,t){var r=Pr();try{return Xr(e,t)}catch(e){if(Nr(r),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},Fa:function(e,t,r,n){var o=Pr();try{return jr(e,t,r,n)}catch(e){if(Nr(o),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},i:function(e,t,r){var n=Pr();try{return Vr(e,t,r)}catch(e){if(Nr(n),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},r:function(e,t,r,n){var o=Pr();try{return zr(e,t,r,n)}catch(e){if(Nr(o),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},N:function(e,t,r,n,o){var i=Pr();try{return Gr(e,t,r,n,o)}catch(e){if(Nr(i),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},ha:function(e,t,r,n,o,i){var a=Pr();try{return Hr(e,t,r,n,o,i)}catch(e){if(Nr(a),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},x:function(e){var t=Pr();try{Yr(e)}catch(e){if(Nr(t),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},j:function(e,t){var r=Pr();try{qr(e,t)}catch(e){if(Nr(r),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},o:function(e,t,r){var n=Pr();try{Wr(e,t,r)}catch(e){if(Nr(n),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},na:function(e,t,r,n){var o=Pr();try{Kr(e,t,r,n)}catch(e){if(Nr(o),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},l:function(e,t,r,n){var o=Pr();try{Qr(e,t,r,n)}catch(e){if(Nr(o),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},A:function(e,t,r,n,o,i){var a=Pr();try{Jr(e,t,r,n,o,i)}catch(e){if(Nr(a),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},M:function(e,t,r,n,o){var i=Pr();try{Zr(e,t,r,n,o)}catch(e){if(Nr(i),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},ga:function(e,t,r,n,o,i){var a=Pr();try{$r(e,t,r,n,o,i)}catch(e){if(Nr(a),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},Gd:function(e,t){e in ot.glAttributes||nn("Unknown SDL GL attribute ("+e+"). Please check if your SDL version is supported."),ot.glAttributes[e]=t},L:function(){nt.doSwapBuffers&&nt.doSwapBuffers()},Fd:function(){return ot.errorMessage||(ot.errorMessage=N(vr("unknown SDL-emscripten error"),"i8",0)),ot.errorMessage},Ed:function(e){if(ot.startTime=Date.now(),ot.initFlags=e,!o.doNotCaptureKeyboard){var t=o.keyboardListeningElement||document;t.addEventListener("keydown",ot.receiveEvent),t.addEventListener("keyup",ot.receiveEvent),t.addEventListener("keypress",ot.receiveEvent),window.addEventListener("focus",ot.receiveEvent),window.addEventListener("blur",ot.receiveEvent),document.addEventListener("visibilitychange",ot.receiveEvent)}return window.addEventListener("unload",ot.receiveEvent),ot.keyboardState=Rr(65536),kr(ot.keyboardState,0,65536),ot.DOMEventToSDLEvent.keydown=768,ot.DOMEventToSDLEvent.keyup=769,ot.DOMEventToSDLEvent.keypress=771,ot.DOMEventToSDLEvent.mousedown=1025,ot.DOMEventToSDLEvent.mouseup=1026,ot.DOMEventToSDLEvent.mousemove=1024,ot.DOMEventToSDLEvent.wheel=1027,ot.DOMEventToSDLEvent.touchstart=1792,ot.DOMEventToSDLEvent.touchend=1793,ot.DOMEventToSDLEvent.touchmove=1794,ot.DOMEventToSDLEvent.unload=256,ot.DOMEventToSDLEvent.resize=28673,ot.DOMEventToSDLEvent.visibilitychange=512,ot.DOMEventToSDLEvent.focus=512,ot.DOMEventToSDLEvent.blur=512,ot.DOMEventToSDLEvent.joystick_axis_motion=1536,ot.DOMEventToSDLEvent.joystick_button_down=1539,ot.DOMEventToSDLEvent.joystick_button_up=1540,0},K:function(){!function(){for(var e=0;e<ot.numChannels;++e)ot.channels[e].audio&&(ot.channels[e].audio.pause(),ot.channels[e].audio=void 0);ot.music.audio&&ot.music.audio.pause(),ot.music.audio=void 0}();var e=o.keyboardListeningElement||document;e.removeEventListener("keydown",ot.receiveEvent),e.removeEventListener("keyup",ot.receiveEvent),e.removeEventListener("keypress",ot.receiveEvent)},g:function(e,t,r,n){nn("Assertion failed: "+B(e)+", at: "+[t?B(t):"unknown filename",r,n?B(n):"unknown function"])},Cd:at,Bd:function(e,t){return st(e,t)},n:function(e){return Rr(e)},Ad:function(){throw L=!0,"Pure virtual function called!"},m:function(e,t,r){throw ut[e]={ptr:e,adjusted:[e],type:t,destructor:r,refcount:0,caught:!1,rethrown:!1},"uncaught_exception"in _r?_r.uncaught_exceptions++:_r.uncaught_exceptions=1,e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."},zd:function(){return _r.uncaught_exceptions},ma:function(){},yd:function(e,t){return Ge(1),-1},Ea:Ge,la:function(e,t){ct.varargs=t;try{var r=ct.getStr();return et.unlink(r),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},wd:function(e,t){ct.varargs=t;try{nn("cannot wait on child processes")}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},vd:function(e,t){ct.varargs=t;try{var r=ct.getStr();return et.chdir(r),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Da:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get(),i=ct.get(),a=ct.get(),s=4294967296*n+(o>>>0),u=9007199254740992;return s<=-u||s>=u?-75:(et.llseek(r,s,a),Ie=[r.position>>>0,(Pe=r.position,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[i>>2]=Ie[0],Q[i+4>>2]=Ie[1],r.getdents&&0===s&&0===a&&(r.getdents=null),0)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},ud:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();return ct.doReadv(r,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Ca:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();return ct.doWritev(r,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},td:function(e,t){ct.varargs=t;try{var r=ct.get(),n=ct.get();if(0===n)return-22;var o=et.cwd();return n<V(o)+1?-34:(j(o,r,n),r)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},sd:function(e,t){ct.varargs=t;try{ct.get();var r=ct.get();return Q[r>>2]=-1,Q[r+4>>2]=-1,Q[r+8>>2]=-1,Q[r+12>>2]=-1,0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Ba:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get();return ct.doStat(et.stat,r,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},qd:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get();return ct.doStat(et.lstat,r,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},pd:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get();return ct.doStat(et.stat,r.path,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},od:function(e,t){return lt(0,t)},nd:function(e,t){ct.varargs=t;try{return dt}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},md:function(e,t){return lt(0,t)},ld:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();r.getdents||(r.getdents=et.readdir(r.path));for(var i=280,a=0,s=et.llseek(r,0,1),u=Math.floor(s/i);u<r.getdents.length&&a+i<=o;){var c,l,d=r.getdents[u];if("."===d[0])c=1,l=4;else{var f=et.lookupNode(r.node,d);c=f.id,l=et.isChrdev(f.mode)?2:et.isDir(f.mode)?4:et.isLink(f.mode)?10:8}Ie=[c>>>0,(Pe=c,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[n+a>>2]=Ie[0],Q[n+a+4>>2]=Ie[1],Ie=[(u+1)*i>>>0,(Pe=(u+1)*i,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[n+a+8>>2]=Ie[0],Q[n+a+12>>2]=Ie[1],W[n+a+16>>1]=280,Y[n+a+18|0]=l,j(d,n+a+19,256),a+=i,u+=1}return et.llseek(r,u*i,0),a}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},V:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD();switch(ct.get()){case 0:return(n=ct.get())<0?-22:et.open(r.path,r.flags,0,n).fd;case 1:case 2:case 13:case 14:return 0;case 3:return r.flags;case 4:var n=ct.get();return r.flags|=n,0;case 12:n=ct.get();return W[n+0>>1]=2,0;case 16:case 8:default:return-22;case 9:return Ge(22),-1}}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},kd:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();return et.read(r,Y,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},jd:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get();return ct.doAccess(r,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},id:function(e,t){ct.varargs=t;try{ct.get(),ct.get(),ct.get();var r=ct.get();return r&&(Q[r>>2]=-1,Q[r+4>>2]=-1,Q[r+8>>2]=-1,Q[r+12>>2]=-1),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},gd:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.getStr();return et.rename(r,n),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},fd:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get();return ct.doMkdir(r,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},ed:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();return et.write(r,Y,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Aa:function(e,t){ct.varargs=t;try{var r=ct.getStr();return et.rmdir(r),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},dd:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD();return et.open(r.path,r.flags,0).fd}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},cd:function(e,t){ct.varargs=t;try{var r=ct.get();if(0==r)throw new et.ErrnoError(14);var n=ft.createPipe();return Q[r>>2]=n.readable_fd,Q[r+4>>2]=n.writable_fd,0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},fa:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get(),o=ct.get();return et.open(r,n,o).fd}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},ea:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get();switch(n){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return r.tty?0:-25;case 21519:if(!r.tty)return-25;var o=ct.get();return Q[o>>2]=0,0;case 21520:return r.tty?-22:-25;case 21531:o=ct.get();return et.ioctl(r,n,o);default:nn("bad ioctl syscall "+n)}}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},R:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD();return et.close(r),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},bd:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get();return r.fd===n?n:ct.doDup(r.path,r.flags,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},$c:function(e,t){ct.varargs=t;try{ct.get();var r=ct.get();return kr(r,0,136),Q[r>>2]=1,Q[r+4>>2]=2,Q[r+8>>2]=3,Q[r+12>>2]=4,0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},_c:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.getStr();return et.symlink(r,n),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Zc:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get(),o=ct.get();return ct.doReadlink(r,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Yc:function(e,t){ct.varargs=t;try{return function(e,t){if(-1===e||0===t)return-22;var r=ct.mappings[e];if(!r)return 0;if(t===r.len){var n=et.getStream(r.fd);ct.doMsync(e,n,t,r.flags),et.munmap(n),ct.mappings[e]=null,r.allocated&&Sr(r.malloc)}return 0}(ct.get(),ct.get())}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},U:function(){},$:function(e){return mt(e)},h:function(){o.abort()},Xc:function(e,t){A("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"),fe.unshift({func:e,arg:t})},Wc:pt,v:function e(){return void 0===e.start&&(e.start=Date.now()),1e3*(Date.now()-e.start)|0},Uc:function(e,t){return e-t},Tc:function(){return ht.apply(null,arguments)},za:function(){return ht.apply(null,arguments)},da:ht,ka:function(){return ht.apply(null,arguments)},c:function(e){return je[e]()},ya:function(e){return je[e]()},Q:function(e,t){return je[e](t)},Sc:function(e,t,r){return je[e](t,r)},xa:function(e,t,r,n){return je[e](t,r,n)},Qc:function(e,t,r,n,o){return je[e](t,r,n,o)},Pc:function(e,t,r){var n=o.canvas;Q[e>>2]=n.width,Q[t>>2]=n.height,Q[r>>2]=nt.isFullscreen?1:0},Oc:vt,Nc:function(e,t){Et(e,t)},Mc:function(e,t,r){q.set(q.subarray(t,t+r),e)},Lc:function(e){nr(e)},ja:function(){return gt.apply(null,arguments)},F:mt,Kc:yt,Jc:wt,Hc:function(){return Ge(11),-1},E:function e(t){return 0===t?0:(t=B(t),it.hasOwnProperty(t)?(e.ret&&Sr(e.ret),e.ret=(r=it[t],n=V(r)+1,(o=Rr(n))&&X(r,Y,o,n),o)):0);var r,n,o},wa:function(){throw"getpwnam: TODO"},Gc:function(e){return 0},ca:function(e){var t=Date.now();return Q[e>>2]=t/1e3|0,Q[e+4>>2]=t%1e3*1e3|0,0},p:function(e){Kt.enabledClientAttributes_preBegin=Kt.enabledClientAttributes,Kt.enabledClientAttributes=[],Kt.clientAttributes_preBegin=Kt.clientAttributes,Kt.clientAttributes=[];for(var t=0;t<Kt.clientAttributes_preBegin.length;t++)Kt.clientAttributes.push({});Kt.mode=e,Kt.vertexCounter=0;var r=Kt.rendererComponents=[];for(t=0;t<Kt.NUM_ATTRIBUTES;t++)r[t]=0;Kt.rendererComponentPointer=0,Kt.vertexData=Kt.tempData},Fc:function(e,t){sr.blendFunc(e,t)},Ec:function(e){sr.clear(e)},va:function(e,t,r,n){sr.clearColor(e,t,r,n)},w:function(e,t,r){!function(e,t,r,n){if(e=Math.max(Math.min(e,1),0),t=Math.max(Math.min(t,1),0),r=Math.max(Math.min(r,1),0),n=Math.max(Math.min(n,1),0),Kt.mode>=0){var o=Kt.vertexCounter<<2;Kt.vertexDataU8[o+0]=255*e,Kt.vertexDataU8[o+1]=255*t,Kt.vertexDataU8[o+2]=255*r,Kt.vertexDataU8[o+3]=255*n,Kt.vertexCounter++,Kt.addRendererComponent(Kt.COLOR,4,sr.UNSIGNED_BYTE)}else Kt.clientColor[0]=e,Kt.clientColor[1]=t,Kt.clientColor[2]=r,Kt.clientColor[3]=n}(e,t,r,1)},Cc:function(e){sr.depthFunc(e)},C:Tt,z:_t,q:function(){Kt.prepareClientAttributes(Kt.rendererComponents[Kt.VERTEX],!0),Kt.firstVertex=0,Kt.lastVertex=Kt.vertexCounter/(Kt.stride>>2),Kt.flush(),Kt.disableBeginEndClientAttributes(),Kt.mode=-1,Kt.enabledClientAttributes=Kt.enabledClientAttributes_preBegin,Kt.clientAttributes=Kt.clientAttributes_preBegin,Kt.currentRenderer=null,Kt.modifiedClientAttributes=!0},Bc:function(){sr.finish()},Ac:function(){sr.flush()},zc:function(e,t,r,n,o,i){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.multiply(Kt.matrix[Kt.currentMatrix],Kt.matrixLib.mat4.frustum(e,t,r,n,o,i))},yc:It,ua:Mt,_:function(){throw"glLightfv: TODO"},B:function(e){sr.lineWidth(e)},T:function(){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.identity(Kt.matrix[Kt.currentMatrix])},G:function(e){if(5888==e)Kt.currentMatrix=0;else if(5889==e)Kt.currentMatrix=1;else{if(5890!=e)throw"Wrong mode "+e+" passed to glMatrixMode";Kt.useTextureMatrix=!0,Kt.currentMatrix=2+Kt.clientActiveTexture}},wc:function(){},vc:function(e,t,r,n,o,i){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.multiply(Kt.matrix[Kt.currentMatrix],Kt.matrixLib.mat4.ortho(e,t,r,n,o,i))},uc:function(){},tc:function(e,t){sr.polygonOffset(e,t)},ba:function(){0!=Kt.matrixStack[Kt.currentMatrix].length?(Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrix[Kt.currentMatrix]=Kt.matrixStack[Kt.currentMatrix].pop()):bt.recordError(1284)},aa:function(){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixStack[Kt.currentMatrix].push(Array.prototype.slice.call(Kt.matrix[Kt.currentMatrix]))},sc:function(e,t,r,n){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.rotate(Kt.matrix[Kt.currentMatrix],e*Math.PI/180,[t,r,n])},ta:function(e,t,r){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.scale(Kt.matrix[Kt.currentMatrix],[e,t,r])},qc:function(e,t,r){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.scale(Kt.matrix[Kt.currentMatrix],[e,t,r])},pc:function(){A("TODO: glShadeModel")},sa:function(e,t,r){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.translate(Kt.matrix[Kt.currentMatrix],[e,t,r])},ra:function(e,t,r){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.translate(Kt.matrix[Kt.currentMatrix],[e,t,r])},D:function(e,t,r){F(Kt.mode>=0),Kt.vertexData[Kt.vertexCounter++]=e,Kt.vertexData[Kt.vertexCounter++]=t,Kt.vertexData[Kt.vertexCounter++]=r,Kt.vertexData[Kt.vertexCounter++]=1,F(Kt.vertexCounter<<2<bt.MAX_TEMP_BUFFER_SIZE),Kt.addRendererComponent(Kt.VERTEX,4,sr.FLOAT)},oc:function(e,t,r,n){sr.viewport(e,t,r,n)},nc:function(e,t,r,n,i){var a;a=-1==i?o.canvas:document.getElementById("gl3d_"+(i+1)),0==e&&0==t&&(e=a.width,t=a.height),ot.addedResizeListener||(ot.addedResizeListener=!0,nt.resizeListeners.push(function(e,t){ot.settingVideoMode||ot.receiveEvent({type:"resize",w:e,h:t})})),e===a.width&&t===a.height||(ot.settingVideoMode=!0,nt.setCanvasSize(e,t),ot.settingVideoMode=!1),ot.screen&&(ot.freeSurface(ot.screen),F(!ot.screen)),ot.GL&&(n|=67108864);var s=1&(n=n||0),u=2097152&n,c=67108864&n,l=Rr(60),d=Rr(44),f=u?1:4,m=0;s||c||(m=Rr(e*t*4)),Q[l>>2]=n,Q[l+4>>2]=d,Q[l+8>>2]=e,Q[l+12>>2]=t,Q[l+16>>2]=e*f,Q[l+20>>2]=m,Q[l+36>>2]=0,Q[l+40>>2]=0,Q[l+44>>2]=o.canvas.width,Q[l+48>>2]=o.canvas.height,Q[l+56>>2]=1,Q[d>>2]=-2042224636,Q[d+4>>2]=0,Y[d+8|0]=8*f,Y[d+9|0]=f,ot.GL=ot.GL||c;var p,h={antialias:0!=ot.glAttributes[13]&&ot.glAttributes[14]>1,depth:ot.glAttributes[6]>0,stencil:ot.glAttributes[7]>0},v={antialias:!1,alpha:!1};if(h)for(var E in h)v[E]=h[E];var g=bt.createContext(a,v);return g&&(p=bt.getContext(g).GLctx),o.ctx=p,bt.makeContextCurrent(g),o.useWebGL=!0,nt.moduleContextCreatedCallbacks.forEach(function(e){e()}),nt.init(),ot.surfaces[l]={width:e,height:t,canvas:a,ctx:p,surf:l,buffer:m,pixelFormat:d,alpha:255,flags:n,locked:0,usePageCanvas:!0,source:"screen",isFlagSet:function(e){return n&e}},ot.screen=l,g},mc:function(e,t){return _("Calling stub instead of kill()"),Ge($e.EPERM),-1},Tb:function(e,t){var r=Or(t)>>>0,n=Or(e)>>>0;return 0|(D(n),r)},S:Qt,kc:function(e){return t=e,Math.pow(2,t);var t},u:function(e){return t=e,Math.log(t)/Math.LN10;var t},jc:function(e){return t=e,Math.log(t)/Math.LN2;var t},P:Jt,s:function(e){var t=Zt,r=t.LLVM_SAVEDSTACKS[e];t.LLVM_SAVEDSTACKS.splice(e,1),Nr(r)},t:Zt,Z:function(){nn("trap!")},J:$t,ic:function(e){return tr(e,5313168)},hc:tr,e:Et,fc:function(){if("undefined"==typeof window){var e=o.ccall("mp_hal_get_interrupt_char","number",["number"],["null"]),t=r(8952),n=Buffer.alloc(1);try{t.readSync(process.stdin.fd,n,0,1)>0&&(n[0]==e?o.ccall("mp_keyboard_interrupt","null",["null"],["null"]):process.stdout.write(String.fromCharCode(n[0])))}catch(e){if("EAGAIN"!==e.code)throw e}}},O:function(){return(new Date).getTime()},ec:function(e,t){if(0===e)return Ge(22),-1;var r=Q[e>>2],n=Q[e+4>>2];return n<0||n>999999999||r<0?(Ge(22),-1):(0!==t&&(Q[t>>2]=0,Q[t+4>>2]=0),rr(1e6*r+n/1e3))},ia:function(){_("missing function: popen"),nn(-1)},dc:function(){return 0},I:function(e){return _("Calling stub instead of raise()"),Ge($e.ENOSYS),A("raise() returning an error as we do not support it"),-1},cc:function(e,t,r){if(0===e)return Ge(22),-1;var n=B(e),o=B(t);return""===n||-1!==n.indexOf("=")?(Ge(22),-1):(it.hasOwnProperty(n)&&!r||(it[n]=o,at(xr())),0)},bc:function(e,t,r){return _("Calling stub instead of sigaction()"),0},ac:function(e){return Q[e>>2]=0,0},_b:or,Zb:dr,Yb:function(e,t,r,n){return dr(e,t,r,n)},qa:function(e){switch(e){case 30:case 75:return 16384;case 85:return q.length/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return Ge(22),-1},Y:function(e){return Ge(11),-1},X:function(e){var t=Date.now()/1e3|0;return e&&(Q[e>>2]=t),t},Xb:function(e){return 0===e||""===(e=B(e))||-1!==e.indexOf("=")?(Ge(22),-1):(it.hasOwnProperty(e)&&(delete it[e],at(xr())),0)},pa:rr,Wb:function(e,t){var r;if(t){var n=8;r=1e3*Q[t+n>>2],r+=Q[t+(n=12)>>2]/1e3}else r=Date.now();e=B(e);try{return et.utime(e,r,r),0}catch(e){return et.handleFSError(e),-1}},oa:function(){return fr.apply(null,arguments)},Ub:nr,a:ne},br=o.asm({},wr,H);o.asm=br;o.__ZN4giac13giac_rendererEPKc=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Id.apply(null,arguments)};var _r=o.__ZSt18uncaught_exceptionv=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Jd.apply(null,arguments)},Tr=(o.___errno_location=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Kd.apply(null,arguments)},o.__get_daylight=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Ld.apply(null,arguments)}),xr=o.__get_environ=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Md.apply(null,arguments)},Ar=o.__get_timezone=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Nd.apply(null,arguments)},Mr=o.__get_tzname=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Od.apply(null,arguments)},Sr=(o._caseval=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Pd.apply(null,arguments)},o._fflush=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Qd.apply(null,arguments)},o._free=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Rd.apply(null,arguments)}),Or=o._llvm_bswap_i32=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Sd.apply(null,arguments)},Rr=o._malloc=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Td.apply(null,arguments)},Dr=o._memcpy=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Ud.apply(null,arguments)},kr=o._memset=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Vd.apply(null,arguments)},Lr=(o._mp_js_do_str=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Wd.apply(null,arguments)},o._mp_js_init=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Xd.apply(null,arguments)},o._nws_caseval=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Yd.apply(null,arguments)},o._quickjs_ck_eval=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Zd.apply(null,arguments)},o._setThrew=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm._d.apply(null,arguments)}),Fr=(o.establishStackSpace=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.qe.apply(null,arguments)},o.globalCtors=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.re.apply(null,arguments)}),Cr=o.stackAlloc=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.se.apply(null,arguments)},Nr=o.stackRestore=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.te.apply(null,arguments)},Pr=o.stackSave=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ue.apply(null,arguments)},Ir=o.dynCall_dd=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.$d.apply(null,arguments)},Ur=o.dynCall_di=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ae.apply(null,arguments)},Br=o.dynCall_i=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.be.apply(null,arguments)},Xr=o.dynCall_ii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ce.apply(null,arguments)},jr=o.dynCall_iidi=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.de.apply(null,arguments)},Vr=o.dynCall_iii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ee.apply(null,arguments)},zr=o.dynCall_iiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.fe.apply(null,arguments)},Gr=o.dynCall_iiiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ge.apply(null,arguments)},Hr=o.dynCall_iiiiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.he.apply(null,arguments)},Yr=o.dynCall_v=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ie.apply(null,arguments)},qr=o.dynCall_vi=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.je.apply(null,arguments)},Wr=o.dynCall_vii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ke.apply(null,arguments)},Kr=o.dynCall_viid=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.le.apply(null,arguments)},Qr=o.dynCall_viii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.me.apply(null,arguments)},Jr=o.dynCall_viiidd=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ne.apply(null,arguments)},Zr=o.dynCall_viiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.oe.apply(null,arguments)},$r=o.dynCall_viiiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.pe.apply(null,arguments)};function en(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function tn(e){function t(){o.calledRun||(o.calledRun=!0,L||(ae(),F(!pe),pe=!0,o.noFSInit||et.init.initialized||et.init(),qe.init(),ft.root=et.mount(ft,{},null),ue(le),ae(),et.ignorePermissions=!1,ue(de),o.onRuntimeInitialized&&o.onRuntimeInitialized(),F(!o._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(ae(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)Ee(o.postRun.shift());ue(me)}()))}e=e||f,Me>0||(F(!0),J[2639055]=34821223,J[2639054]=2310721022,function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)ve(o.preRun.shift());ue(ce)}(),Me>0||o.calledRun||(o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),t()},1)):t(),ae()))}o.asm=br,Object.getOwnPropertyDescriptor(o,"intArrayFromString")||(o.intArrayFromString=function(){nn("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"intArrayToString")||(o.intArrayToString=function(){nn("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),o.ccall=C,o.cwrap=function(e,t,r,n){return function(){return C(e,t,r,arguments,n)}},Object.getOwnPropertyDescriptor(o,"setValue")||(o.setValue=function(){nn("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getValue")||(o.getValue=function(){nn("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"allocate")||(o.allocate=function(){nn("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getMemory")||(o.getMemory=function(){nn("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"AsciiToString")||(o.AsciiToString=function(){nn("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToAscii")||(o.stringToAscii=function(){nn("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"UTF8ArrayToString")||(o.UTF8ArrayToString=function(){nn("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"UTF8ToString")||(o.UTF8ToString=function(){nn("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToUTF8Array")||(o.stringToUTF8Array=function(){nn("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToUTF8")||(o.stringToUTF8=function(){nn("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF8")||(o.lengthBytesUTF8=function(){nn("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"UTF16ToString")||(o.UTF16ToString=function(){nn("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToUTF16")||(o.stringToUTF16=function(){nn("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF16")||(o.lengthBytesUTF16=function(){nn("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"UTF32ToString")||(o.UTF32ToString=function(){nn("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToUTF32")||(o.stringToUTF32=function(){nn("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF32")||(o.lengthBytesUTF32=function(){nn("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"allocateUTF8")||(o.allocateUTF8=function(){nn("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stackTrace")||(o.stackTrace=function(){nn("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnPreRun")||(o.addOnPreRun=function(){nn("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnInit")||(o.addOnInit=function(){nn("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnPreMain")||(o.addOnPreMain=function(){nn("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnExit")||(o.addOnExit=function(){nn("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnPostRun")||(o.addOnPostRun=function(){nn("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),o.writeStringToMemory=function(e,t,r){var n,o;A("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"),r&&(o=t+V(e),n=Y[o]),j(e,t,1/0),r&&(Y[o]=n)},Object.getOwnPropertyDescriptor(o,"writeArrayToMemory")||(o.writeArrayToMemory=function(){nn("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"writeAsciiToMemory")||(o.writeAsciiToMemory=function(){nn("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addRunDependency")||(o.addRunDependency=function(){nn("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"removeRunDependency")||(o.removeRunDependency=function(){nn("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"ENV")||(o.ENV=function(){nn("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"FS")||(o.FS=function(){nn("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"FS_createFolder")||(o.FS_createFolder=function(){nn("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createPath")||(o.FS_createPath=function(){nn("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createDataFile")||(o.FS_createDataFile=function(){nn("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createPreloadedFile")||(o.FS_createPreloadedFile=function(){nn("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createLazyFile")||(o.FS_createLazyFile=function(){nn("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createLink")||(o.FS_createLink=function(){nn("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createDevice")||(o.FS_createDevice=function(){nn("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_unlink")||(o.FS_unlink=function(){nn("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"GL")||(o.GL=function(){nn("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"dynamicAlloc")||(o.dynamicAlloc=function(){nn("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"warnOnce")||(o.warnOnce=function(){nn("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"loadDynamicLibrary")||(o.loadDynamicLibrary=function(){nn("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"loadWebAssemblyModule")||(o.loadWebAssemblyModule=function(){nn("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getLEB")||(o.getLEB=function(){nn("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getFunctionTables")||(o.getFunctionTables=function(){nn("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"alignFunctionTables")||(o.alignFunctionTables=function(){nn("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"registerFunctions")||(o.registerFunctions=function(){nn("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addFunction")||(o.addFunction=function(){nn("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"removeFunction")||(o.removeFunction=function(){nn("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getFuncWrapper")||(o.getFuncWrapper=function(){nn("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"prettyPrint")||(o.prettyPrint=function(){nn("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"makeBigInt")||(o.makeBigInt=function(){nn("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"dynCall")||(o.dynCall=function(){nn("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getCompilerSetting")||(o.getCompilerSetting=function(){nn("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stackSave")||(o.stackSave=function(){nn("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stackRestore")||(o.stackRestore=function(){nn("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stackAlloc")||(o.stackAlloc=function(){nn("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"establishStackSpace")||(o.establishStackSpace=function(){nn("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"print")||(o.print=function(){nn("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"printErr")||(o.printErr=function(){nn("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getTempRet0")||(o.getTempRet0=function(){nn("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"setTempRet0")||(o.setTempRet0=function(){nn("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"callMain")||(o.callMain=function(){nn("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),o.Pointer_stringify=function(e,t){nn("this function has been removed - you should use UTF8ToString(ptr, maxBytesToRead) instead!")},Object.getOwnPropertyDescriptor(o,"intArrayFromBase64")||(o.intArrayFromBase64=function(){nn("'intArrayFromBase64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"tryParseAsDataURI")||(o.tryParseAsDataURI=function(){nn("'tryParseAsDataURI' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"ALLOC_NORMAL")||Object.defineProperty(o,"ALLOC_NORMAL",{get:function(){nn("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(o,"ALLOC_STACK")||Object.defineProperty(o,"ALLOC_STACK",{get:function(){nn("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(o,"ALLOC_DYNAMIC")||Object.defineProperty(o,"ALLOC_DYNAMIC",{get:function(){nn("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(o,"ALLOC_NONE")||Object.defineProperty(o,"ALLOC_NONE",{get:function(){nn("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Oe=function e(){o.calledRun||tn(),o.calledRun||(Oe=e)},o.run=tn;var rn=[];function nn(e){o.onAbort&&o.onAbort(e),b(e+=""),_(e),L=!0;var t="abort("+e+") at "+ze();throw rn&&rn.forEach(function(r){t=r(t,e)}),t}if(o.abort=nn,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();o.noExitRuntime=!0;const on=o},5075:(e,t,r)=>{e.exports=r.p+"4d81e8d193751fb4316a.wasm"}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["vendors-node_modules_basthon_xcas-wasm_src_index_js"],{1771:(e,t,r)=>{r.r(t),r.d(t,{default:()=>on}),e=r.hmd(e);var n={disable3d:0,tableaucm:0,debug:0,Datestart:Date.now(),ready:!1,colorinit:!1,usemathjax:!1,prettyprint:!0,histcount:0,selection:"",langue:-1,calc:1,xwaspy_shift:33,gr2d_ncanvas:0,initconfigstring:"",python_mode:0,python_indent:4,warnpy:!0};window.innerWidth??=1080;var o=void 0!==o?o:{};o.print=(...e)=>console.log(...e),o.printErr=(...e)=>console.error(...e);var i,a={};for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);var s,u,c,l,d,f=[],m="./this.program",p=function(e,t){throw t};if(s="object"==typeof window,u="function"==typeof importScripts,l="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,c=l&&!s&&!u,d=!s&&!c&&!u,o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var h,v,E,g,y,w="";if(c)w="//",h=function(e,t){var n;return(n=yr(e))||(g||(g=r(8952)),y||(y=r(9942)),e=y.normalize(e),n=g.readFileSync(e)),t?n:n.toString()},E=function(e){var t=h(e,!0);return t.buffer||(t=new Uint8Array(t)),F(t.buffer),t},process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),e.exports=o,process.on("uncaughtException",function(e){if(!(e instanceof en))throw e}),process.on("unhandledRejection",nn),p=function(e){process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"};else if(d)"undefined"!=typeof read&&(h=function(e){var t=yr(e);return t?Er(t):read(e)}),E=function(e){var t;return(t=yr(e))?t:"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(F("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?f=scriptArgs:"undefined"!=typeof arguments&&(f=arguments),"function"==typeof quit&&(p=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print);else{if(!s&&!u)throw new Error("environment detection error");u?w=self.location.href:document.currentScript&&(w=document.currentScript.src),w=0!==w.indexOf("blob:")?w.substr(0,w.lastIndexOf("/")+1):"",h=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){var r=yr(e);if(r)return Er(r);throw t}},u&&(E=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){var r=yr(e);if(r)return r;throw t}}),v=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){if(200==n.status||0==n.status&&n.response)t(n.response);else{var o=yr(e);o?t(o.buffer):r()}},n.onerror=r,n.send(null)}}var b=o.print||console.log.bind(console),_=o.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);function T(e){F(ne);var t=Q[ne>>2],r=t+e+15&-16;return r>vt()&&nn("failure to dynamicAlloc - memory growth etc. is not supported there, call malloc/sbrk directly"),Q[ne>>2]=r,t}function x(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":case"float":return 4;case"i64":case"double":return 8;default:if("*"===e[e.length-1])return 4;if("i"===e[0]){var t=parseInt(e.substr(1));return F(t%8==0,"getNativeTypeSize invalid bits "+t+", type "+e),t/8}return 0}}function A(e){A.shown||(A.shown={}),A.shown[e]||(A.shown[e]=1,_(e))}a=null,o.arguments&&(f=o.arguments),Object.getOwnPropertyDescriptor(o,"arguments")||Object.defineProperty(o,"arguments",{get:function(){nn("Module.arguments has been replaced with plain arguments_")}}),o.thisProgram&&(m=o.thisProgram),Object.getOwnPropertyDescriptor(o,"thisProgram")||Object.defineProperty(o,"thisProgram",{get:function(){nn("Module.thisProgram has been replaced with plain thisProgram")}}),o.quit&&(p=o.quit),Object.getOwnPropertyDescriptor(o,"quit")||Object.defineProperty(o,"quit",{get:function(){nn("Module.quit has been replaced with plain quit_")}}),F(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),F(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),F(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),F(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),F(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),F(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),F(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),F(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),Object.getOwnPropertyDescriptor(o,"read")||Object.defineProperty(o,"read",{get:function(){nn("Module.read has been replaced with plain read_")}}),Object.getOwnPropertyDescriptor(o,"readAsync")||Object.defineProperty(o,"readAsync",{get:function(){nn("Module.readAsync has been replaced with plain readAsync")}}),Object.getOwnPropertyDescriptor(o,"readBinary")||Object.defineProperty(o,"readBinary",{get:function(){nn("Module.readBinary has been replaced with plain readBinary")}}),Pr=Nr=Cr=function(){nn("cannot use the stack before compiled code is ready to run, and has provided stack access")};var M,S,O={"f64-rem":function(e,t){return e%t},debugger:function(){}},R=(new Array(0),0),D=function(e){R=e};function k(e,t,r,n){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":Y[e|0]=t;break;case"i16":W[e>>1]=t;break;case"i32":Q[e>>2]=t;break;case"i64":Ie=[t>>>0,(Pe=t,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[e>>2]=Ie[0],Q[e+4>>2]=Ie[1];break;case"float":Z[e>>2]=t;break;case"double":$[e>>3]=t;break;default:nn("invalid type for setValue: "+r)}}o.wasmBinary&&(M=o.wasmBinary),Object.getOwnPropertyDescriptor(o,"wasmBinary")||Object.defineProperty(o,"wasmBinary",{get:function(){nn("Module.wasmBinary has been replaced with plain wasmBinary")}}),"object"!=typeof WebAssembly&&nn("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.");var L=!1;function F(e,t){e||nn("Assertion failed: "+t)}function C(e,t,r,n,i){var a={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);j(e,t=Cr(r),r)}return t},array:function(e){var t=Cr(e.length);return z(e,t),t}};var s=function(e){var t=o["_"+e];return F(t,"Cannot call unknown function "+e+", make sure it is exported"),t}(e),u=[],c=0;if(F("array"!==t,'Return type should not be "array".'),n)for(var l=0;l<n.length;l++){var d=a[r[l]];d?(0===c&&(c=Pr()),u[l]=d(n[l])):u[l]=n[l]}var f=s.apply(null,u);return F(!(i&&i.async),"async call is only supported with Emterpretify for now, see #9029"),f=function(e){return"string"===t?B(e):"boolean"===t?Boolean(e):e}(f),0!==c&&Nr(c),f}function N(e,t,r,n){var o,i;"number"==typeof e?(o=!0,i=e):(o=!1,i=e.length);var a,s="string"==typeof t?t:null;if(a=3==r?n:[Rr,Cr,T][r](Math.max(i,s?1:t.length)),o){var u;for(n=a,F(!(3&a)),u=a+(-4&i);n<u;n+=4)Q[n>>2]=0;for(u=a+i;n<u;)Y[n++|0]=0;return a}if("i8"===s)return e.subarray||e.slice?q.set(e,a):q.set(new Uint8Array(e),a),a;for(var c,l,d,f=0;f<i;){var m=e[f];0!==(c=s||t[f])?(F(c,"Must know what type to store in allocate!"),"i64"==c&&(c="i32"),k(a+f,m,c),d!==c&&(l=x(c),d=c),f+=l):f++}return a}function P(e){return pe?Rr(e):T(e)}var I="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function U(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&I)return I.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|u:(240!=(248&a)&&A("Invalid UTF-8 leading byte 0x"+a.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"),a=(7&a)<<18|s<<12|u<<6|63&e[t++]),a<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function B(e,t){return e?U(q,e,t):""}function X(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a);if(s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;s>=2097152&&A("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function j(e,t,r){return F("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),X(e,q,t,r)}function V(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");function z(e,t){F(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),Y.set(e,t)}function G(e,t,r){for(var n=0;n<e.length;++n)F(e.charCodeAt(n)==e.charCodeAt(n)&255),Y[t++|0]=e.charCodeAt(n);r||(Y[t|0]=0)}var H,Y,q,W,K,Q,J,Z,$,ee=65536;var te=10556880,re=10556880,ne=5313968;F(!0,"stack must start aligned"),F(!0,"heap must start aligned");var oe=5242880;o.TOTAL_STACK&&F(oe===o.TOTAL_STACK,"the stack size can no longer be determined at runtime");var ie=o.TOTAL_MEMORY||268435456;function ae(){var e=J[2639219],t=J[2639218];34821223==e&&2310721022==t||nn("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+t.toString(16)+" "+e.toString(16)),1668509029!==Q[0]&&nn("Runtime error: The application has corrupted its heap memory area (address zero)!")}if(Object.getOwnPropertyDescriptor(o,"TOTAL_MEMORY")||Object.defineProperty(o,"TOTAL_MEMORY",{get:function(){nn("Module.TOTAL_MEMORY has been replaced with plain INITIAL_TOTAL_MEMORY")}}),F(ie>=oe,"TOTAL_MEMORY should be larger than TOTAL_STACK, was "+ie+"! (TOTAL_STACK="+oe+")"),F("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),(S=o.wasmMemory?o.wasmMemory:new WebAssembly.Memory({initial:ie/ee,maximum:ie/ee}))&&(H=S.buffer),F((ie=H.byteLength)%ee===0),o.HEAP8=Y=new Int8Array(H),o.HEAP16=W=new Int16Array(H),o.HEAP32=Q=new Int32Array(H),o.HEAPU8=q=new Uint8Array(H),o.HEAPU16=K=new Uint16Array(H),o.HEAPU32=J=new Uint32Array(H),o.HEAPF32=Z=new Float32Array(H),o.HEAPF64=$=new Float64Array(H),Q[ne>>2]=re,Q[0]=1668509029,W[1]=25459,115!==q[2]||99!==q[3])throw"Runtime error: expected the system to be little-endian!";function se(e,t){nn("Invalid function pointer "+e+" called with signature '"+t+"'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). Build with ASSERTIONS=2 for more info.")}function ue(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?o.dynCall_v(r):o.dynCall_vi(r,t.arg):r(void 0===t.arg?null:t.arg)}else t()}}var ce=[],le=[],de=[],fe=[],me=[],pe=!1,he=!1;function ve(e){ce.unshift(e)}function Ee(e){me.unshift(e)}F(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),F(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),F(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),F(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var ge=Math.abs,ye=Math.cos,we=Math.sin,be=Math.sqrt,_e=Math.ceil,Te=Math.floor,xe=Math.min,Ae=Math.trunc,Me=0,Se=null,Oe=null,Re={};function De(e){for(var t=e;;){if(!Re[e])return e;e=t+Math.random()}return e}function ke(e){Me++,o.monitorRunDependencies&&o.monitorRunDependencies(Me),e?(F(!Re[e]),Re[e]=1,null===Se&&"undefined"!=typeof setInterval&&(Se=setInterval(function(){if(L)return clearInterval(Se),void(Se=null);var e=!1;for(var t in Re)e||(e=!0,_("still waiting on run dependencies:")),_("dependency: "+t);e&&_("(end of list)")},1e4))):_("warning: run dependency added without ID")}function Le(e){if(Me--,o.monitorRunDependencies&&o.monitorRunDependencies(Me),e?(F(Re[e]),delete Re[e]):_("warning: run dependency removed without ID"),0==Me&&(null!==Se&&(clearInterval(Se),Se=null),Oe)){var t=Oe;Oe=null,t()}}o.preloadedImages={},o.preloadedAudios={};var Fe="data:application/wasm;base64,";function Ce(e){return String.prototype.startsWith?e.startsWith(Fe):0===e.indexOf(Fe)}var Ne,Pe,Ie,Ue=new URL(r(5075),r.b).href;function Be(){try{if(M)return new Uint8Array(M);var e=yr(Ue);if(e)return e;if(E)return E(Ue);throw"both async and sync fetching of the wasm failed"}catch(e){nn(e)}}function Xe(e){var t={env:e,global:{NaN:NaN,Infinity:1/0},"global.Math":Math,asm2wasm:O};function r(e,t){var r=e.exports;o.asm=r,Le("wasm-instantiate")}ke("wasm-instantiate");var n=o;function i(e){F(o===n,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),n=null,r(e.instance)}function a(e){return(M||!s&&!u||"function"!=typeof fetch?new Promise(function(e,t){e(Be())}):fetch(Ue,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Ue+"'";return e.arrayBuffer()}).catch(function(){return Be()})).then(function(e){return WebAssembly.instantiate(e,t)}).then(e,function(e){_("failed to asynchronously prepare wasm: "+e),nn(e)})}if(o.instantiateWasm)try{return o.instantiateWasm(t,r)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}return function(){if(M||"function"!=typeof WebAssembly.instantiateStreaming||Ce(Ue)||"function"!=typeof fetch)return a(i);fetch(Ue,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,t).then(i,function(e){_("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),a(i)})})}(),{}}Ce(Ue)||(Ne=Ue,Ue=o.locateFile?o.locateFile(Ne,w):Ne),o.asm=function(e,t,r){t.memory=S,t.table=new WebAssembly.Table({initial:10295,maximum:10295,element:"anyfunc"}),t.__memory_base=1024,t.__table_base=0;var n=Xe(t);return F(n,"binaryen setup failed (no wasm support?)"),n};var je=[function(){return void 0!==n?Date.now()-n.Datestart:Date.now()},function(){if(o.worker)return 0;var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/");return t>-1||r>-1?1:0},function(e,t,r){var n=B(e);console.log("url:"+n);var i=new XMLHttpRequest,a=r;if(i.open("GET",n,!1),i.overrideMimeType("application/octet-stream"),i.send(null),200===i.status){console.log("Réponse reçue: %s",i.responseText);var s=i.responseText;s.length>=a-1&&(s=s.substr(0,a-1)),o.writeStringToMemory(s,t)}else console.log("Status de la réponse: %d (%s)",i.status,i.statusText),o.writeStringToMemory("ERROR",t)},function(e){var t=B(e),r=prompt(t," ");return null==r?0:N(vr(r),"i8",0)},function(e){return n.assistant_matr_maxrows},function(e){return n.assistant_matr_maxcols},function(e){n.sheet_recompute(" ".substr(0,0)),n.open_sheet(!0)},function(e,t,r){var o=B(e);console.log(o),n.sheet_set_ij(o,t,r)},function(e){var t=B(e),r=prompt(t,"n");return null==r?-4:"next"==r||"n"==r||"sst"==r?-1:"sst_in"==r||"s"==r?-2:"cont"==r||"c"==r?-3:"kill"==r||"k"==r?-4:"break"==r||"b"==r?-5:"delete"==r||"d"==r?-6:N(vr(r),"i8",0)},function(e){if(void 0!==n&&n.warnpy){var t=B(e);alert(t)}},function(){var e=window.innerWidth;return"undefined"!=typeof svgwidth?1*svgwidth:e>=1e3?9*e/1e3:e/60},function(){return void 0!==n&&void 0!==n.disable3d&&n.disable3d?n.disable3d:o.worker?1:0},function(){return void 0!==n&&void 0!==n.add_evalf?1*n.add_evalf:1},function(){return void 0!==n&&void 0!==n.js_bigint?1*n.js_bigint:0},function(e,t,r,n){var i,a,s,u;s=n,u=(a=t)/4/(i=e);var c,l,d=new(window.AudioContext||window.webkitAudioContext),f=d.createBuffer(i,a,d.sampleRate),m=new Uint8Array(o.HEAPU8.buffer,s,a),p=new Float32Array(m.buffer,m.byteOffset,a/4);for(c=0;c<i;c++){var h=f.getChannelData(c);for(l=0;l<u;++l)h[l]=p[c*u+l]}var v=d.createBufferSource();v.buffer=f,v.connect(d.destination),v.start()},function(e){var t=B(e);console.log(t)},function(e,t){var r=B(e);r=r.substr(0,t),n.add_python_output(r),r=n.clean_for_html(r);var o=document.getElementById("consolediv");null!=o&&"block"!=o.style.display&&(o.style.display="block",n.set_config_width());var i=document.getElementById("output");null!=i&&(i.style.display="inherit",i.innerHTML+=r,i.scrollTop=99999)},function(e){var t=B(e);n.python_output+=t}];le.push({func:function(){Fr()}});function Ve(e){return e.replace(/__Z[\w\d_]+/g,function(e){var t,r=(t=e,A("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),t);return e===r?e:r+" ["+e+"]"})}function ze(){var e=function(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}();return o.extraStackTrace&&(e+="\n"+o.extraStackTrace()),Ve(e)}function Ge(e){return o.___errno_location?Q[o.___errno_location()>>2]=e:_("failed to set errno from JS"),e}F(!0);var He={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=He.normalizeArray(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=He.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return He.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return He.normalize(e.join("/"))},join2:function(e,t){return He.normalize(e+"/"+t)}},Ye={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:et.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=He.normalizeArray(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Ye.resolve(e).substr(1),t=Ye.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},qe={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){qe.ttys[e]={input:[],output:[],ops:t},et.registerDevice(e,qe.stream_ops)},stream_ops:{open:function(e){var t=qe.ttys[e.node.rdev];if(!t)throw new et.ErrnoError(19);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new et.ErrnoError(6);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new et.ErrnoError(5)}if(void 0===s&&0===i)throw new et.ErrnoError(11);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new et.ErrnoError(6);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new et.ErrnoError(5)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(c){var r=Buffer.alloc?Buffer.alloc(256):new Buffer(256),n=0,o="win32"!=process.platform,i=process.stdin.fd;if(o){var a=!1;try{i=mr.openSync("/dev/stdin","r"),a=!0}catch(e){}}try{n=mr.readSync(i,r,0,256,null)}catch(e){if(-1==e.toString().indexOf("EOF"))throw e;n=0}a&&mr.closeSync(i),t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=vr(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(b(U(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(b(U(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(_(U(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(U(e.output,0)),e.output=[])}}},We={ops_table:null,mount:function(e){return We.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(et.isBlkdev(r)||et.isFIFO(r))throw new et.ErrnoError(1);We.ops_table||(We.ops_table={dir:{node:{getattr:We.node_ops.getattr,setattr:We.node_ops.setattr,lookup:We.node_ops.lookup,mknod:We.node_ops.mknod,rename:We.node_ops.rename,unlink:We.node_ops.unlink,rmdir:We.node_ops.rmdir,readdir:We.node_ops.readdir,symlink:We.node_ops.symlink},stream:{llseek:We.stream_ops.llseek}},file:{node:{getattr:We.node_ops.getattr,setattr:We.node_ops.setattr},stream:{llseek:We.stream_ops.llseek,read:We.stream_ops.read,write:We.stream_ops.write,allocate:We.stream_ops.allocate,mmap:We.stream_ops.mmap,msync:We.stream_ops.msync}},link:{node:{getattr:We.node_ops.getattr,setattr:We.node_ops.setattr,readlink:We.node_ops.readlink},stream:{}},chrdev:{node:{getattr:We.node_ops.getattr,setattr:We.node_ops.setattr},stream:et.chrdev_stream_ops}});var o=et.createNode(e,t,r,n);return et.isDir(o.mode)?(o.node_ops=We.ops_table.dir.node,o.stream_ops=We.ops_table.dir.stream,o.contents={}):et.isFile(o.mode)?(o.node_ops=We.ops_table.file.node,o.stream_ops=We.ops_table.file.stream,o.usedBytes=0,o.contents=null):et.isLink(o.mode)?(o.node_ops=We.ops_table.link.node,o.stream_ops=We.ops_table.link.stream):et.isChrdev(o.mode)&&(o.node_ops=We.ops_table.chrdev.node,o.stream_ops=We.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o),o},getFileDataAsRegularArray:function(e){if(e.contents&&e.contents.subarray){for(var t=[],r=0;r<e.usedBytes;++r)t.push(e.contents[r]);return t}return e.contents},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t){if(0==t)return e.contents=null,void(e.usedBytes=0);if(!e.contents||e.contents.subarray){var r=e.contents;return e.contents=new Uint8Array(new ArrayBuffer(t)),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),void(e.usedBytes=t)}if(e.contents||(e.contents=[]),e.contents.length>t)e.contents.length=t;else for(;e.contents.length<t;)e.contents.push(0);e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=et.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,et.isDir(e.mode)?t.size=4096:et.isFile(e.mode)?t.size=e.usedBytes:et.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&We.resizeFileStorage(e,t.size)},lookup:function(e,t){throw et.genericErrors[2]},mknod:function(e,t,r,n){return We.createNode(e,t,r,n)},rename:function(e,t,r){if(et.isDir(e.mode)){var n;try{n=et.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new et.ErrnoError(39)}delete e.parent.contents[e.name],e.name=r,t.contents[r]=e,e.parent=t},unlink:function(e,t){delete e.contents[t]},rmdir:function(e,t){var r=et.lookupNode(e,t);for(var n in r.contents)throw new et.ErrnoError(39);delete e.contents[t]},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=We.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!et.isLink(e.mode))throw new et.ErrnoError(22);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(F(a>=0),a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return F(0===o,"canOwn must imply no weird position inside the file"),a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=new Uint8Array(t.subarray(r,r+n)),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(We.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&et.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new et.ErrnoError(22);return n},allocate:function(e,t,r){We.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i,a){if(!et.isFile(e.node.mode))throw new et.ErrnoError(19);var s,u,c=e.node.contents;if(2&a||c.buffer!==t&&c.buffer!==t.buffer){(o>0||o+n<e.node.usedBytes)&&(c=c.subarray?c.subarray(o,o+n):Array.prototype.slice.call(c,o,o+n)),u=!0;var l=t.buffer==Y.buffer;if(!(s=Rr(n)))throw new et.ErrnoError(12);(l?Y:t).set(c,s)}else u=!1,s=c.byteOffset;return{ptr:s,allocated:u}},msync:function(e,t,r,n,o){if(!et.isFile(e.node.mode))throw new et.ErrnoError(19);if(2&o)return 0;We.stream_ops.write(e,t,0,n,r,!1);return 0}}},Ke={dbs:{},indexedDB:function(){if("undefined"!=typeof indexedDB)return indexedDB;var e=null;return"object"==typeof window&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),F(e,"IDBFS used, but indexedDB not supported"),e},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function(e){return We.mount.apply(null,arguments)},syncfs:function(e,t,r){Ke.getLocalSet(e,function(n,o){if(n)return r(n);Ke.getRemoteSet(e,function(e,n){if(e)return r(e);var i=t?n:o,a=t?o:n;Ke.reconcile(i,a,r)})})},getDB:function(e,t){var r,n=Ke.dbs[e];if(n)return t(null,n);try{r=Ke.indexedDB().open(e,Ke.DB_VERSION)}catch(e){return t(e)}if(!r)return t("Unable to connect to IndexedDB");r.onupgradeneeded=function(e){var t,r=e.target.result,n=e.target.transaction;(t=r.objectStoreNames.contains(Ke.DB_STORE_NAME)?n.objectStore(Ke.DB_STORE_NAME):r.createObjectStore(Ke.DB_STORE_NAME)).indexNames.contains("timestamp")||t.createIndex("timestamp","timestamp",{unique:!1})},r.onsuccess=function(){n=r.result,Ke.dbs[e]=n,t(null,n)},r.onerror=function(e){t(this.error),e.preventDefault()}},getLocalSet:function(e,t){var r={};function n(e){return"."!==e&&".."!==e}function o(e){return function(t){return He.join2(e,t)}}for(var i=et.readdir(e.mountpoint).filter(n).map(o(e.mountpoint));i.length;){var a,s=i.pop();try{a=et.stat(s)}catch(e){return t(e)}et.isDir(a.mode)&&i.push.apply(i,et.readdir(s).filter(n).map(o(s))),r[s]={timestamp:a.mtime}}return t(null,{type:"local",entries:r})},getRemoteSet:function(e,t){var r={};Ke.getDB(e.mountpoint,function(e,n){if(e)return t(e);try{var o=n.transaction([Ke.DB_STORE_NAME],"readonly");o.onerror=function(e){t(this.error),e.preventDefault()},o.objectStore(Ke.DB_STORE_NAME).index("timestamp").openKeyCursor().onsuccess=function(e){var o=e.target.result;if(!o)return t(null,{type:"remote",db:n,entries:r});r[o.primaryKey]={timestamp:o.key},o.continue()}}catch(e){return t(e)}})},loadLocalEntry:function(e,t){var r,n;try{n=et.lookupPath(e).node,r=et.stat(e)}catch(e){return t(e)}return et.isDir(r.mode)?t(null,{timestamp:r.mtime,mode:r.mode}):et.isFile(r.mode)?(n.contents=We.getFileDataAsTypedArray(n),t(null,{timestamp:r.mtime,mode:r.mode,contents:n.contents})):t(new Error("node type not supported"))},storeLocalEntry:function(e,t,r){try{if(et.isDir(t.mode))et.mkdir(e,t.mode);else{if(!et.isFile(t.mode))return r(new Error("node type not supported"));et.writeFile(e,t.contents,{canOwn:!0})}et.chmod(e,t.mode),et.utime(e,t.timestamp,t.timestamp)}catch(e){return r(e)}r(null)},removeLocalEntry:function(e,t){try{et.lookupPath(e);var r=et.stat(e);et.isDir(r.mode)?et.rmdir(e):et.isFile(r.mode)&&et.unlink(e)}catch(e){return t(e)}t(null)},loadRemoteEntry:function(e,t,r){var n=e.get(t);n.onsuccess=function(e){r(null,e.target.result)},n.onerror=function(e){r(this.error),e.preventDefault()}},storeRemoteEntry:function(e,t,r,n){var o=e.put(r,t);o.onsuccess=function(){n(null)},o.onerror=function(e){n(this.error),e.preventDefault()}},removeRemoteEntry:function(e,t,r){var n=e.delete(t);n.onsuccess=function(){r(null)},n.onerror=function(e){r(this.error),e.preventDefault()}},reconcile:function(e,t,r){var n=0,o=[];Object.keys(e.entries).forEach(function(r){var i=e.entries[r],a=t.entries[r];(!a||i.timestamp>a.timestamp)&&(o.push(r),n++)});var i=[];if(Object.keys(t.entries).forEach(function(r){t.entries[r];e.entries[r]||(i.push(r),n++)}),!n)return r(null);var a=!1,s=("remote"===e.type?e.db:t.db).transaction([Ke.DB_STORE_NAME],"readwrite"),u=s.objectStore(Ke.DB_STORE_NAME);function c(e){if(e&&!a)return a=!0,r(e)}s.onerror=function(e){c(this.error),e.preventDefault()},s.oncomplete=function(e){a||r(null)},o.sort().forEach(function(e){"local"===t.type?Ke.loadRemoteEntry(u,e,function(t,r){if(t)return c(t);Ke.storeLocalEntry(e,r,c)}):Ke.loadLocalEntry(e,function(t,r){if(t)return c(t);Ke.storeRemoteEntry(u,e,r,c)})}),i.sort().reverse().forEach(function(e){"local"===t.type?Ke.removeLocalEntry(e,c):Ke.removeRemoteEntry(u,e,c)})}},Qe={isWindows:!1,staticInit:function(){Qe.isWindows=!!process.platform.match(/^win/);var e=process.binding("constants");e.fs&&(e=e.fs),Qe.flagsForNodeMap={1024:e.O_APPEND,64:e.O_CREAT,128:e.O_EXCL,0:e.O_RDONLY,2:e.O_RDWR,4096:e.O_SYNC,512:e.O_TRUNC,1:e.O_WRONLY}},bufferFrom:function(e){return Buffer.alloc?Buffer.from(e):new Buffer(e)},mount:function(e){return F(l),Qe.createNode(null,"/",Qe.getMode(e.opts.root),0)},createNode:function(e,t,r,n){if(!et.isDir(r)&&!et.isFile(r)&&!et.isLink(r))throw new et.ErrnoError(22);var o=et.createNode(e,t,r);return o.node_ops=Qe.node_ops,o.stream_ops=Qe.stream_ops,o},getMode:function(e){var t;try{t=mr.lstatSync(e),Qe.isWindows&&(t.mode=t.mode|(292&t.mode)>>2)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}return t.mode},realPath:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.mount.opts.root),t.reverse(),He.join.apply(null,t)},flagsForNode:function(e){e&=-2097153,e&=-2049,e&=-32769,e&=-524289;var t=0;for(var r in Qe.flagsForNodeMap)e&r&&(t|=Qe.flagsForNodeMap[r],e^=r);if(e)throw new et.ErrnoError(22);return t},node_ops:{getattr:function(e){var t,r=Qe.realPath(e);try{t=mr.lstatSync(r)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}return Qe.isWindows&&!t.blksize&&(t.blksize=4096),Qe.isWindows&&!t.blocks&&(t.blocks=(t.size+t.blksize-1)/t.blksize|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,blksize:t.blksize,blocks:t.blocks}},setattr:function(e,t){var r=Qe.realPath(e);try{if(void 0!==t.mode&&(mr.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.timestamp){var n=new Date(t.timestamp);mr.utimesSync(r,n,n)}void 0!==t.size&&mr.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},lookup:function(e,t){var r=He.join2(Qe.realPath(e),t),n=Qe.getMode(r);return Qe.createNode(e,t,n)},mknod:function(e,t,r,n){var o=Qe.createNode(e,t,r,n),i=Qe.realPath(o);try{et.isDir(o.mode)?mr.mkdirSync(i,o.mode):mr.writeFileSync(i,"",{mode:o.mode})}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}return o},rename:function(e,t,r){var n=Qe.realPath(e),o=He.join2(Qe.realPath(t),r);try{mr.renameSync(n,o)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},unlink:function(e,t){var r=He.join2(Qe.realPath(e),t);try{mr.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},rmdir:function(e,t){var r=He.join2(Qe.realPath(e),t);try{mr.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},readdir:function(e){var t=Qe.realPath(e);try{return mr.readdirSync(t)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},symlink:function(e,t,r){var n=He.join2(Qe.realPath(e),t);try{mr.symlinkSync(r,n)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},readlink:function(e){var t=Qe.realPath(e);try{return t=mr.readlinkSync(t),t=pr.relative(pr.resolve(e.mount.opts.root),t)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}}},stream_ops:{open:function(e){var t=Qe.realPath(e.node);try{et.isFile(e.node.mode)&&(e.nfd=mr.openSync(t,Qe.flagsForNode(e.flags)))}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},close:function(e){try{et.isFile(e.node.mode)&&e.nfd&&mr.closeSync(e.nfd)}catch(e){if(!e.code)throw e;throw new et.ErrnoError(-e.errno)}},read:function(e,t,r,n,o){if(0===n)return 0;try{return mr.readSync(e.nfd,Qe.bufferFrom(t.buffer),r,n,o)}catch(e){throw new et.ErrnoError(-e.errno)}},write:function(e,t,r,n,o){try{return mr.writeSync(e.nfd,Qe.bufferFrom(t.buffer),r,n,o)}catch(e){throw new et.ErrnoError(-e.errno)}},llseek:function(e,t,r){var n=t;if(1===r)n+=e.position;else if(2===r&&et.isFile(e.node.mode))try{n+=mr.fstatSync(e.nfd).size}catch(e){throw new et.ErrnoError(-e.errno)}if(n<0)throw new et.ErrnoError(22);return n}}},Je={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function(e){F(u),Je.reader||(Je.reader=new FileReaderSync);var t=Je.createNode(null,"/",Je.DIR_MODE,0),r={};function n(e){for(var n=e.split("/"),o=t,i=0;i<n.length-1;i++){var a=n.slice(0,i+1).join("/");r[a]||(r[a]=Je.createNode(o,n[i],Je.DIR_MODE,0)),o=r[a]}return o}function o(e){var t=e.split("/");return t[t.length-1]}return Array.prototype.forEach.call(e.opts.files||[],function(e){Je.createNode(n(e.name),o(e.name),Je.FILE_MODE,0,e,e.lastModifiedDate)}),(e.opts.blobs||[]).forEach(function(e){Je.createNode(n(e.name),o(e.name),Je.FILE_MODE,0,e.data)}),(e.opts.packages||[]).forEach(function(e){e.metadata.files.forEach(function(t){var r=t.filename.substr(1);Je.createNode(n(r),o(r),Je.FILE_MODE,0,e.blob.slice(t.start,t.end))})}),t},createNode:function(e,t,r,n,o,i){var a=et.createNode(e,t,r);return a.mode=r,a.node_ops=Je.node_ops,a.stream_ops=Je.stream_ops,a.timestamp=(i||new Date).getTime(),F(Je.FILE_MODE!==Je.DIR_MODE),r===Je.FILE_MODE?(a.size=o.size,a.contents=o):(a.size=4096,a.contents={}),e&&(e.contents[t]=a),a},node_ops:{getattr:function(e){return{dev:1,ino:void 0,mode:e.mode,nlink:1,uid:0,gid:0,rdev:void 0,size:e.size,atime:new Date(e.timestamp),mtime:new Date(e.timestamp),ctime:new Date(e.timestamp),blksize:4096,blocks:Math.ceil(e.size/4096)}},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp)},lookup:function(e,t){throw new et.ErrnoError(2)},mknod:function(e,t,r,n){throw new et.ErrnoError(1)},rename:function(e,t,r){throw new et.ErrnoError(1)},unlink:function(e,t){throw new et.ErrnoError(1)},rmdir:function(e,t){throw new et.ErrnoError(1)},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){throw new et.ErrnoError(1)},readlink:function(e){throw new et.ErrnoError(1)}},stream_ops:{read:function(e,t,r,n,o){if(o>=e.node.size)return 0;var i=e.node.contents.slice(o,o+n),a=Je.reader.readAsArrayBuffer(i);return t.set(new Uint8Array(a),r),i.size},write:function(e,t,r,n,o){throw new et.ErrnoError(5)},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&et.isFile(e.node.mode)&&(n+=e.node.size),n<0)throw new et.ErrnoError(22);return n}}},Ze={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"},$e={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86},et={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(e){if(!(e instanceof et.ErrnoError))throw e+" : "+ze();return Ge(e.errno)},lookupPath:function(e,t){if(t=t||{},!(e=Ye.resolve(et.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===t[n]&&(t[n]=r[n]);if(t.recurse_count>8)throw new et.ErrnoError(40);for(var o=He.normalizeArray(e.split("/").filter(function(e){return!!e}),!1),i=et.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&t.parent)break;if(i=et.lookupNode(i,o[s]),a=He.join2(a,o[s]),et.isMountpoint(i)&&(!u||u&&t.follow_mount)&&(i=i.mounted.root),!u||t.follow)for(var c=0;et.isLink(i.mode);){var l=et.readlink(a);if(a=Ye.resolve(He.dirname(a),l),i=et.lookupPath(a,{recurse_count:t.recurse_count}).node,c++>40)throw new et.ErrnoError(40)}}return{path:a,node:i}},getPath:function(e){for(var t;;){if(et.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%et.nameTable.length},hashAddNode:function(e){var t=et.hashName(e.parent.id,e.name);e.name_next=et.nameTable[t],et.nameTable[t]=e},hashRemoveNode:function(e){var t=et.hashName(e.parent.id,e.name);if(et.nameTable[t]===e)et.nameTable[t]=e.name_next;else for(var r=et.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=et.mayLookup(e);if(r)throw new et.ErrnoError(r,e);for(var n=et.hashName(e.id,t),o=et.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return et.lookup(e,t)},createNode:function(e,t,r,n){if(!et.FSNode){et.FSNode=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=et.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},et.FSNode.prototype={};var o=365,i=146;Object.defineProperties(et.FSNode.prototype,{read:{get:function(){return(this.mode&o)===o},set:function(e){e?this.mode|=o:this.mode&=-366}},write:{get:function(){return(this.mode&i)===i},set:function(e){e?this.mode|=i:this.mode&=-147}},isFolder:{get:function(){return et.isDir(this.mode)}},isDevice:{get:function(){return et.isChrdev(this.mode)}}})}var a=new et.FSNode(e,t,r,n);return et.hashAddNode(a),a},destroyNode:function(e){et.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return!(49152&~e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var t=et.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return et.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:13},mayLookup:function(e){var t=et.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:13)},mayCreate:function(e,t){try{et.lookupNode(e,t);return 17}catch(e){}return et.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=et.lookupNode(e,t)}catch(e){return e.errno}var o=et.nodePermissions(e,"wx");if(o)return o;if(r){if(!et.isDir(n.mode))return 20;if(et.isRoot(n)||et.getPath(n)===et.cwd())return 16}else if(et.isDir(n.mode))return 21;return 0},mayOpen:function(e,t){return e?et.isLink(e.mode)?40:et.isDir(e.mode)&&("r"!==et.flagsToPermissionString(t)||512&t)?21:et.nodePermissions(e,et.flagsToPermissionString(t)):2},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||et.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!et.streams[r])return r;throw new et.ErrnoError(24)},getStream:function(e){return et.streams[e]},createStream:function(e,t,r){et.FSStream||(et.FSStream=function(){},et.FSStream.prototype={},Object.defineProperties(et.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}));var n=new et.FSStream;for(var o in e)n[o]=e[o];e=n;var i=et.nextfd(t,r);return e.fd=i,et.streams[i]=e,e},closeStream:function(e){et.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=et.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new et.ErrnoError(29)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){et.devices[e]={stream_ops:t}},getDevice:function(e){return et.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),et.syncFSRequests++,et.syncFSRequests>1&&console.log("warning: "+et.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=et.getMounts(et.root.mount),n=0;function o(e){return F(et.syncFSRequests>0),et.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach(function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)})},mount:function(e,t,r){var n,o="/"===r,i=!r;if(o&&et.root)throw new et.ErrnoError(16);if(!o&&!i){var a=et.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,et.isMountpoint(n))throw new et.ErrnoError(16);if(!et.isDir(n.mode))throw new et.ErrnoError(20)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?et.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(e){var t=et.lookupPath(e,{follow_mount:!1});if(!et.isMountpoint(t.node))throw new et.ErrnoError(22);var r=t.node,n=r.mounted,o=et.getMounts(n);Object.keys(et.nameTable).forEach(function(e){for(var t=et.nameTable[e];t;){var r=t.name_next;-1!==o.indexOf(t.mount)&&et.destroyNode(t),t=r}}),r.mounted=null;var i=r.mount.mounts.indexOf(n);F(-1!==i),r.mount.mounts.splice(i,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=et.lookupPath(e,{parent:!0}).node,o=He.basename(e);if(!o||"."===o||".."===o)throw new et.ErrnoError(22);var i=et.mayCreate(n,o);if(i)throw new et.ErrnoError(i);if(!n.node_ops.mknod)throw new et.ErrnoError(1);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,et.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,et.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{et.mkdir(n,t)}catch(e){if(17!=e.errno)throw e}}},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,et.mknod(e,t,r)},symlink:function(e,t){if(!Ye.resolve(e))throw new et.ErrnoError(2);var r=et.lookupPath(t,{parent:!0}).node;if(!r)throw new et.ErrnoError(2);var n=He.basename(t),o=et.mayCreate(r,n);if(o)throw new et.ErrnoError(o);if(!r.node_ops.symlink)throw new et.ErrnoError(1);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=He.dirname(e),i=He.dirname(t),a=He.basename(e),s=He.basename(t);try{r=et.lookupPath(e,{parent:!0}).node,n=et.lookupPath(t,{parent:!0}).node}catch(e){throw new et.ErrnoError(16)}if(!r||!n)throw new et.ErrnoError(2);if(r.mount!==n.mount)throw new et.ErrnoError(18);var u,c=et.lookupNode(r,a),l=Ye.relative(e,i);if("."!==l.charAt(0))throw new et.ErrnoError(22);if("."!==(l=Ye.relative(t,o)).charAt(0))throw new et.ErrnoError(39);try{u=et.lookupNode(n,s)}catch(e){}if(c!==u){var d=et.isDir(c.mode),f=et.mayDelete(r,a,d);if(f)throw new et.ErrnoError(f);if(f=u?et.mayDelete(n,s,d):et.mayCreate(n,s))throw new et.ErrnoError(f);if(!r.node_ops.rename)throw new et.ErrnoError(1);if(et.isMountpoint(c)||u&&et.isMountpoint(u))throw new et.ErrnoError(16);if(n!==r&&(f=et.nodePermissions(r,"w")))throw new et.ErrnoError(f);try{et.trackingDelegate.willMovePath&&et.trackingDelegate.willMovePath(e,t)}catch(r){console.log("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}et.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{et.hashAddNode(c)}try{et.trackingDelegate.onMovePath&&et.trackingDelegate.onMovePath(e,t)}catch(r){console.log("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}}},rmdir:function(e){var t=et.lookupPath(e,{parent:!0}).node,r=He.basename(e),n=et.lookupNode(t,r),o=et.mayDelete(t,r,!0);if(o)throw new et.ErrnoError(o);if(!t.node_ops.rmdir)throw new et.ErrnoError(1);if(et.isMountpoint(n))throw new et.ErrnoError(16);try{et.trackingDelegate.willDeletePath&&et.trackingDelegate.willDeletePath(e)}catch(t){console.log("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,r),et.destroyNode(n);try{et.trackingDelegate.onDeletePath&&et.trackingDelegate.onDeletePath(e)}catch(t){console.log("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){var t=et.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new et.ErrnoError(20);return t.node_ops.readdir(t)},unlink:function(e){var t=et.lookupPath(e,{parent:!0}).node,r=He.basename(e),n=et.lookupNode(t,r),o=et.mayDelete(t,r,!1);if(o)throw new et.ErrnoError(o);if(!t.node_ops.unlink)throw new et.ErrnoError(1);if(et.isMountpoint(n))throw new et.ErrnoError(16);try{et.trackingDelegate.willDeletePath&&et.trackingDelegate.willDeletePath(e)}catch(t){console.log("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,r),et.destroyNode(n);try{et.trackingDelegate.onDeletePath&&et.trackingDelegate.onDeletePath(e)}catch(t){console.log("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){var t=et.lookupPath(e).node;if(!t)throw new et.ErrnoError(2);if(!t.node_ops.readlink)throw new et.ErrnoError(22);return Ye.resolve(et.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var r=et.lookupPath(e,{follow:!t}).node;if(!r)throw new et.ErrnoError(2);if(!r.node_ops.getattr)throw new et.ErrnoError(1);return r.node_ops.getattr(r)},lstat:function(e){return et.stat(e,!0)},chmod:function(e,t,r){var n;"string"==typeof e?n=et.lookupPath(e,{follow:!r}).node:n=e;if(!n.node_ops.setattr)throw new et.ErrnoError(1);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){et.chmod(e,t,!0)},fchmod:function(e,t){var r=et.getStream(e);if(!r)throw new et.ErrnoError(9);et.chmod(r.node,t)},chown:function(e,t,r,n){var o;"string"==typeof e?o=et.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new et.ErrnoError(1);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){et.chown(e,t,r,!0)},fchown:function(e,t,r){var n=et.getStream(e);if(!n)throw new et.ErrnoError(9);et.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new et.ErrnoError(22);var r;"string"==typeof e?r=et.lookupPath(e,{follow:!0}).node:r=e;if(!r.node_ops.setattr)throw new et.ErrnoError(1);if(et.isDir(r.mode))throw new et.ErrnoError(21);if(!et.isFile(r.mode))throw new et.ErrnoError(22);var n=et.nodePermissions(r,"w");if(n)throw new et.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=et.getStream(e);if(!r)throw new et.ErrnoError(9);if(!(2097155&r.flags))throw new et.ErrnoError(22);et.truncate(r.node,t)},utime:function(e,t,r){var n=et.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(e,t,r,n,i){if(""===e)throw new et.ErrnoError(2);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?et.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=He.normalize(e);try{a=et.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new et.ErrnoError(17)}else a=et.mknod(e,r,0),s=!0;if(!a)throw new et.ErrnoError(2);if(et.isChrdev(a.mode)&&(t&=-513),65536&t&&!et.isDir(a.mode))throw new et.ErrnoError(20);if(!s){var u=et.mayOpen(a,t);if(u)throw new et.ErrnoError(u)}512&t&&et.truncate(a,0),t&=-641;var c=et.createStream({node:a,path:et.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&t||(et.readFiles||(et.readFiles={}),e in et.readFiles||(et.readFiles[e]=1,console.log("FS.trackingDelegate error on read file: "+e)));try{if(et.trackingDelegate.onOpenFile){var l=0;1!=(2097155&t)&&(l|=et.tracking.openFlags.READ),2097155&t&&(l|=et.tracking.openFlags.WRITE),et.trackingDelegate.onOpenFile(e,l)}}catch(t){console.log("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return c},close:function(e){if(et.isClosed(e))throw new et.ErrnoError(9);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{et.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,r){if(et.isClosed(e))throw new et.ErrnoError(9);if(!e.seekable||!e.stream_ops.llseek)throw new et.ErrnoError(29);if(0!=r&&1!=r&&2!=r)throw new et.ErrnoError(22);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:function(e,t,r,n,o){if(n<0||o<0)throw new et.ErrnoError(22);if(et.isClosed(e))throw new et.ErrnoError(9);if(1==(2097155&e.flags))throw new et.ErrnoError(9);if(et.isDir(e.node.mode))throw new et.ErrnoError(21);if(!e.stream_ops.read)throw new et.ErrnoError(22);var i=void 0!==o;if(i){if(!e.seekable)throw new et.ErrnoError(29)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:function(e,t,r,n,o,i){if(n<0||o<0)throw new et.ErrnoError(22);if(et.isClosed(e))throw new et.ErrnoError(9);if(!(2097155&e.flags))throw new et.ErrnoError(9);if(et.isDir(e.node.mode))throw new et.ErrnoError(21);if(!e.stream_ops.write)throw new et.ErrnoError(22);1024&e.flags&&et.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new et.ErrnoError(29)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);a||(e.position+=s);try{e.path&&et.trackingDelegate.onWriteToFile&&et.trackingDelegate.onWriteToFile(e.path)}catch(t){console.log("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return s},allocate:function(e,t,r){if(et.isClosed(e))throw new et.ErrnoError(9);if(t<0||r<=0)throw new et.ErrnoError(22);if(!(2097155&e.flags))throw new et.ErrnoError(9);if(!et.isFile(e.node.mode)&&!et.isDir(e.node.mode))throw new et.ErrnoError(19);if(!e.stream_ops.allocate)throw new et.ErrnoError(95);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o,i,a){if(2&i&&!(2&a)&&2!=(2097155&e.flags))throw new et.ErrnoError(13);if(1==(2097155&e.flags))throw new et.ErrnoError(13);if(!e.stream_ops.mmap)throw new et.ErrnoError(19);return e.stream_ops.mmap(e,t,r,n,o,i,a)},msync:function(e,t,r,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0},munmap:function(e){return 0},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new et.ErrnoError(25);return e.stream_ops.ioctl(e,t,r)},readFile:function(e,t){if((t=t||{}).flags=t.flags||"r",t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=et.open(e,t.flags),o=et.stat(e).size,i=new Uint8Array(o);return et.read(n,i,0,o,0),"utf8"===t.encoding?r=U(i,0):"binary"===t.encoding&&(r=i),et.close(n),r},writeFile:function(e,t,r){(r=r||{}).flags=r.flags||"w";var n=et.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(V(t)+1),i=X(t,o,0,o.length);et.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");et.write(n,t,0,t.byteLength,void 0,r.canOwn)}et.close(n)},cwd:function(){return et.currentPath},chdir:function(e){var t=et.lookupPath(e,{follow:!0});if(null===t.node)throw new et.ErrnoError(2);if(!et.isDir(t.node.mode))throw new et.ErrnoError(20);var r=et.nodePermissions(t.node,"x");if(r)throw new et.ErrnoError(r);et.currentPath=t.path},createDefaultDirectories:function(){et.mkdir("/tmp"),et.mkdir("/home"),et.mkdir("/home/web_user")},createDefaultDevices:function(){var e;if(et.mkdir("/dev"),et.registerDevice(et.makedev(1,3),{read:function(){return 0},write:function(e,t,r,n,o){return n}}),et.mkdev("/dev/null",et.makedev(1,3)),qe.register(et.makedev(5,0),qe.default_tty_ops),qe.register(et.makedev(6,0),qe.default_tty1_ops),et.mkdev("/dev/tty",et.makedev(5,0)),et.mkdev("/dev/tty1",et.makedev(6,0)),"object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);e=function(){return crypto.getRandomValues(t),t[0]}}else if(c)try{var n=r(328);e=function(){return n.randomBytes(1)[0]}}catch(e){}e||(e=function(){nn("no cryptographic support found for random_device. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}),et.createDevice("/dev","random",e),et.createDevice("/dev","urandom",e),et.mkdir("/dev/shm"),et.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){et.mkdir("/proc"),et.mkdir("/proc/self"),et.mkdir("/proc/self/fd"),et.mount({mount:function(){var e=et.createNode("/proc/self","fd",16895,73);return e.node_ops={lookup:function(e,t){var r=+t,n=et.getStream(r);if(!n)throw new et.ErrnoError(9);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){o.stdin?et.createDevice("/dev","stdin",o.stdin):et.symlink("/dev/tty","/dev/stdin"),o.stdout?et.createDevice("/dev","stdout",null,o.stdout):et.symlink("/dev/tty","/dev/stdout"),o.stderr?et.createDevice("/dev","stderr",null,o.stderr):et.symlink("/dev/tty1","/dev/stderr");var e=et.open("/dev/stdin","r"),t=et.open("/dev/stdout","w"),r=et.open("/dev/stderr","w");F(0===e.fd,"invalid handle for stdin ("+e.fd+")"),F(1===t.fd,"invalid handle for stdout ("+t.fd+")"),F(2===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:function(){et.ErrnoError||(et.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){for(var t in this.errno=e,$e)if($e[t]===e){this.code=t;break}},this.setErrno(e),this.message=Ze[e],this.stack&&Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack&&(this.stack=Ve(this.stack))},et.ErrnoError.prototype=new Error,et.ErrnoError.prototype.constructor=et.ErrnoError,[2].forEach(function(e){et.genericErrors[e]=new et.ErrnoError(e),et.genericErrors[e].stack="<generic error, no stack>"}))},staticInit:function(){et.ensureErrnoError(),et.nameTable=new Array(4096),et.mount(We,{},"/"),et.createDefaultDirectories(),et.createDefaultDevices(),et.createSpecialDirectories(),et.filesystems={MEMFS:We,IDBFS:Ke,NODEFS:Qe,WORKERFS:Je}},init:function(e,t,r){F(!et.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),et.init.initialized=!0,et.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=t||o.stdout,o.stderr=r||o.stderr,et.createStandardStreams()},quit:function(){et.init.initialized=!1;var e=o._fflush;e&&e(0);for(var t=0;t<et.streams.length;t++){var r=et.streams[t];r&&et.close(r)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},joinPath:function(e,t){var r=He.join.apply(null,e);return t&&"/"==r[0]&&(r=r.substr(1)),r},absolutePath:function(e,t){return Ye.resolve(t,e)},standardizePath:function(e){return He.normalize(e)},findObject:function(e,t){var r=et.analyzePath(e,t);return r.exists?r.object:(Ge(r.error),null)},analyzePath:function(e,t){try{e=(n=et.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=et.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=He.basename(e),n=et.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createFolder:function(e,t,r,n){var o=He.join2("string"==typeof e?e:et.getPath(e),t),i=et.getMode(r,n);return et.mkdir(o,i)},createPath:function(e,t,r,n){e="string"==typeof e?e:et.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=He.join2(e,i);try{et.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,t,r,n,o){var i=He.join2("string"==typeof e?e:et.getPath(e),t),a=et.getMode(n,o);return et.create(i,a)},createDataFile:function(e,t,r,n,o,i){var a=t?He.join2("string"==typeof e?e:et.getPath(e),t):e,s=et.getMode(n,o),u=et.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}et.chmod(u,146|s);var f=et.open(u,"w");et.write(f,r,0,r.length,0,i),et.close(f),et.chmod(u,s)}return u},createDevice:function(e,t,r,n){var o=He.join2("string"==typeof e?e:et.getPath(e),t),i=et.getMode(!!r,!!n);et.createDevice.major||(et.createDevice.major=64);var a=et.makedev(et.createDevice.major++,0);return et.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new et.ErrnoError(5)}if(void 0===u&&0===a)throw new et.ErrnoError(11);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,o,i){for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new et.ErrnoError(5)}return o&&(e.node.timestamp=Date.now()),a}}),et.mkdev(o,i,a)},createLink:function(e,t,r,n,o){var i=He.join2("string"==typeof e?e:et.getPath(e),t);return et.symlink(r,i)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;var t=!0;if("undefined"!=typeof XMLHttpRequest)throw new 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.");if(!h)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=vr(h(e.url),!0),e.usedBytes=e.contents.length}catch(e){t=!1}return t||Ge(5),t},createLazyFile:function(e,t,r,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter(function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):vr(o.responseText||"",!0)}(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]}),!i&&n||(a=n=1,n=this.getter(0).length,a=n,console.log("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=et.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var l={};return Object.keys(c.stream_ops).forEach(function(e){var t=c.stream_ops[e];l[e]=function(){if(!et.forceLoadFile(c))throw new et.ErrnoError(5);return t.apply(null,arguments)}}),l.read=function(e,t,r,n,o){if(!et.forceLoadFile(c))throw new et.ErrnoError(5);var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(F(a>=0),i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a},c.stream_ops=l,c},createPreloadedFile:function(e,t,r,n,i,a,s,u,c,l){nt.init();var d=t?Ye.resolve(He.join2(e,t)):e,f=De("cp "+d);function m(r){function m(r){l&&l(),u||et.createDataFile(e,t,r,n,i,c),a&&a(),Le(f)}var p=!1;o.preloadPlugins.forEach(function(e){p||e.canHandle(d)&&(e.handle(r,d,m,function(){s&&s(),Le(f)}),p=!0)}),p||m(r)}ke(f),"string"==typeof r?nt.asyncLoad(r,function(e){m(e)},s):m(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=et.indexedDB();try{var o=n.open(et.DB_NAME(),et.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=function(){console.log("creating db"),o.result.createObjectStore(et.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([et.DB_STORE_NAME],"readwrite"),i=n.objectStore(et.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach(function(e){var t=i.put(et.analyzePath(e).object.contents,e);t.onsuccess=function(){++a+s==u&&c()},t.onerror=function(){s++,a+s==u&&c()}}),n.onerror=r},o.onerror=r},loadFilesFromDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=et.indexedDB();try{var o=n.open(et.DB_NAME(),et.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([et.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(et.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?t():r()}e.forEach(function(e){var t=a.get(e);t.onsuccess=function(){et.analyzePath(e).exists&&et.unlink(e),et.createDataFile(He.dirname(e),He.basename(e),t.result,!0,!0,!0),++s+u==c&&l()},t.onerror=function(){u++,s+u==c&&l()}}),i.onerror=r},o.onerror=r}};function tt(e,t){if(nt.mainLoop.timingMode=e,nt.mainLoop.timingValue=t,!nt.mainLoop.func)return console.error("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."),1;if(0==e)nt.mainLoop.scheduler=function(){var e=0|Math.max(0,nt.mainLoop.tickStartTime+t-rt());setTimeout(nt.mainLoop.runner,e)},nt.mainLoop.method="timeout";else if(1==e)nt.mainLoop.scheduler=function(){nt.requestAnimationFrame(nt.mainLoop.runner)},nt.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",function(e){e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())},!0),setImmediate=function(e){r.push(e),u?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}nt.mainLoop.scheduler=function(){setImmediate(nt.mainLoop.runner)},nt.mainLoop.method="immediate"}return 0}function rt(){nn()}var nt={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){nt.mainLoop.scheduler=null,nt.mainLoop.currentlyRunningMainloop++},resume:function(){nt.mainLoop.currentlyRunningMainloop++;var e=nt.mainLoop.timingMode,t=nt.mainLoop.timingValue,r=nt.mainLoop.func;nt.mainLoop.func=null,function(e,t,r,n,i){var a;o.noExitRuntime=!0,F(!nt.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),nt.mainLoop.func=e,nt.mainLoop.arg=n,a=void 0!==n?function(){o.dynCall_vi(e,n)}:function(){o.dynCall_v(e)};var s=nt.mainLoop.currentlyRunningMainloop;if(nt.mainLoop.runner=function(){if(!L)if(nt.mainLoop.queue.length>0){var e=Date.now(),t=nt.mainLoop.queue.shift();if(t.func(t.arg),nt.mainLoop.remainingBlockers){var r=nt.mainLoop.remainingBlockers,n=r%1==0?r-1:Math.floor(r);t.counted?nt.mainLoop.remainingBlockers=n:(n+=.5,nt.mainLoop.remainingBlockers=(8*r+n)/9)}if(console.log('main loop blocker "'+t.name+'" took '+(Date.now()-e)+" ms"),nt.mainLoop.updateStatus(),s<nt.mainLoop.currentlyRunningMainloop)return;setTimeout(nt.mainLoop.runner,0)}else s<nt.mainLoop.currentlyRunningMainloop||(nt.mainLoop.currentFrameNumber=nt.mainLoop.currentFrameNumber+1|0,1==nt.mainLoop.timingMode&&nt.mainLoop.timingValue>1&&nt.mainLoop.currentFrameNumber%nt.mainLoop.timingValue!=0?nt.mainLoop.scheduler():(0==nt.mainLoop.timingMode&&(nt.mainLoop.tickStartTime=rt()),bt.newRenderingFrameStarted(),"timeout"===nt.mainLoop.method&&o.ctx&&(_("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),nt.mainLoop.method=""),nt.mainLoop.runIter(a),ae(),s<nt.mainLoop.currentlyRunningMainloop||("object"==typeof ot&&ot.audio&&ot.audio.queueNewAudioData&&ot.audio.queueNewAudioData(),nt.mainLoop.scheduler())))},i||(t&&t>0?tt(0,1e3/t):tt(1,1),nt.mainLoop.scheduler()),r)throw"SimulateInfiniteLoop"}(r,0,!1,nt.mainLoop.arg,!0),tt(e,t),nt.mainLoop.scheduler()},updateStatus:function(){if(o.setStatus){var e=o.statusMessage||"Please wait...",t=nt.mainLoop.remainingBlockers,r=nt.mainLoop.expectedBlockers;t?t<r?o.setStatus(e+" ("+(r-t)+"/"+r+")"):o.setStatus(e):o.setStatus("")}},runIter:function(e){if(!L){if(o.preMainLoop)if(!1===o.preMainLoop())return;try{e()}catch(e){if(e instanceof en)return;throw e&&"object"==typeof e&&e.stack&&_("exception thrown: "+[e,e.stack]),e}o.postMainLoop&&o.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(o.preloadPlugins||(o.preloadPlugins=[]),!nt.initted){nt.initted=!0;try{new Blob,nt.hasBlobConstructor=!0}catch(e){nt.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}nt.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:nt.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),nt.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,o.noImageDecoding||void 0!==nt.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),o.noImageDecoding=!0);var e={canHandle:function(e){return!o.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var i=null;if(nt.hasBlobConstructor)try{(i=new Blob([e],{type:nt.getMimetype(t)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:nt.getMimetype(t)}))}catch(e){A("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!i){var a=new nt.BlobBuilder;a.append(new Uint8Array(e).buffer),i=a.getBlob()}var s=nt.URLObject.createObjectURL(i);F("string"==typeof s,"createObjectURL must return a url as a string");var u=new Image;u.onload=function(){F(u.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=u.width,n.height=u.height,n.getContext("2d").drawImage(u,0,0),o.preloadedImages[t]=n,nt.URLObject.revokeObjectURL(s),r&&r(e)},u.onerror=function(e){console.log("Image "+s+" could not be decoded"),n&&n()},u.src=s}};o.preloadPlugins.push(e);var t={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var i=!1;function a(n){i||(i=!0,o.preloadedAudios[t]=n,r&&r(e))}function s(){i||(i=!0,o.preloadedAudios[t]=new Audio,n&&n())}if(!nt.hasBlobConstructor)return s();try{var u=new Blob([e],{type:nt.getMimetype(t)})}catch(e){return s()}var c=nt.URLObject.createObjectURL(u);F("string"==typeof c,"createObjectURL must return a url as a string");var l=new Audio;l.addEventListener("canplaythrough",function(){a(l)},!1),l.onerror=function(r){i||(console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),l.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),a(l))},l.src=c,nt.safeSetTimeout(function(){a(l)},1e4)}};o.preloadPlugins.push(t);var r=o.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&r.addEventListener("click",function(e){!nt.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())},!1))}function n(){nt.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},createContext:function(e,t,r,n){if(t&&o.ctx&&e==o.canvas)return o.ctx;var i,a;if(t){var s={antialias:!1,alpha:!1,majorVersion:1};if(n)for(var u in n)s[u]=n[u];void 0!==bt&&(a=bt.createContext(e,s))&&(i=bt.getContext(a).GLctx)}else i=e.getContext("2d");return i?(r&&(t||F(void 0===sr,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=i,t&&bt.makeContextCurrent(a),o.useWebGL=t,nt.moduleContextCreatedCallbacks.forEach(function(e){e()}),nt.init()),i):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t,r){nt.lockPointer=e,nt.resizeCanvas=t,nt.vrDevice=r,void 0===nt.lockPointer&&(nt.lockPointer=!0),void 0===nt.resizeCanvas&&(nt.resizeCanvas=!1),void 0===nt.vrDevice&&(nt.vrDevice=null);var n=o.canvas;function i(){nt.isFullscreen=!1;var e=n.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.exitFullscreen=nt.exitFullscreen,nt.lockPointer&&n.requestPointerLock(),nt.isFullscreen=!0,nt.resizeCanvas?nt.setFullscreenCanvasSize():nt.updateCanvasDimensions(n)):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),nt.resizeCanvas?nt.setWindowedCanvasSize():nt.updateCanvasDimensions(n)),o.onFullScreen&&o.onFullScreen(nt.isFullscreen),o.onFullscreen&&o.onFullscreen(nt.isFullscreen)}nt.fullscreenHandlersInstalled||(nt.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("MSFullscreenChange",i,!1));var a=document.createElement("div");n.parentNode.insertBefore(a,n),a.appendChild(n),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?function(){a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?a.requestFullscreen({vrDisplay:r}):a.requestFullscreen()},requestFullScreen:function(e,t,r){return _("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead."),nt.requestFullScreen=function(e,t,r){return nt.requestFullscreen(e,t,r)},nt.requestFullscreen(e,t,r)},exitFullscreen:function(){return!!nt.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===nt.nextRAF)nt.nextRAF=t+1e3/60;else for(;t+2>=nt.nextRAF;)nt.nextRAF+=1e3/60;var r=Math.max(nt.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,nt.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeCallback:function(e){return function(){if(!L)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){nt.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(nt.allowAsyncCallbacks=!0,nt.queuedAsyncCallbacks.length>0){var e=nt.queuedAsyncCallbacks;nt.queuedAsyncCallbacks=[],e.forEach(function(e){e()})}},safeRequestAnimationFrame:function(e){return nt.requestAnimationFrame(function(){L||(nt.allowAsyncCallbacks?e():nt.queuedAsyncCallbacks.push(e))})},safeSetTimeout:function(e,t){return o.noExitRuntime=!0,setTimeout(function(){L||(nt.allowAsyncCallbacks?e():nt.queuedAsyncCallbacks.push(e))},t)},safeSetInterval:function(e,t){return o.noExitRuntime=!0,setInterval(function(){L||nt.allowAsyncCallbacks&&e()},t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(nt.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?nt.mouseMovementX=nt.mouseMovementY=0:(nt.mouseMovementX=nt.getMovementX(e),nt.mouseMovementY=nt.getMovementY(e)),void 0!==ot?(nt.mouseX=ot.mouseX+nt.mouseMovementX,nt.mouseY=ot.mouseY+nt.mouseMovementY):(nt.mouseX+=nt.mouseMovementX,nt.mouseY+=nt.mouseMovementY);else{var t=o.canvas.getBoundingClientRect(),r=o.canvas.width,n=o.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(F(void 0!==i&&void 0!==a,"Unable to retrieve scroll position, mouse positions likely broken."),"touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var s=e.touch;if(void 0===s)return;var u=s.pageX-(i+t.left),c=s.pageY-(a+t.top),l={x:u*=r/t.width,y:c*=n/t.height};if("touchstart"===e.type)nt.lastTouches[s.identifier]=l,nt.touches[s.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=nt.touches[s.identifier];d||(d=l),nt.lastTouches[s.identifier]=d,nt.touches[s.identifier]=l}return}var f=e.pageX-(i+t.left),m=e.pageY-(a+t.top);f*=r/t.width,m*=n/t.height,nt.mouseMovementX=f-nt.mouseX,nt.mouseMovementY=m-nt.mouseY,nt.mouseX=f,nt.mouseY=m}},asyncLoad:function(e,t,r,n){var o=n?"":De("al "+e);v(e,function(r){F(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&Le(o)},function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()}),o&&ke(o)},resizeListeners:[],updateResizeListeners:function(){var e=o.canvas;nt.resizeListeners.forEach(function(t){t(e.width,e.height)})},setCanvasSize:function(e,t,r){var n=o.canvas;nt.updateCanvasDimensions(n,e,t),r||nt.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(void 0!==ot){var e=J[ot.screen>>2];e|=8388608,Q[ot.screen>>2]=e}nt.updateCanvasDimensions(o.canvas),nt.updateResizeListeners()},setWindowedCanvasSize:function(){if(void 0!==ot){var e=J[ot.screen>>2];e&=-8388609,Q[ot.screen>>2]=e}nt.updateCanvasDimensions(o.canvas),nt.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,i=r;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/i<o.forcedAspectRatio?n=Math.round(i*o.forcedAspectRatio):i=Math.round(n/o.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var a=Math.min(screen.width/n,screen.height/i);n=Math.round(n*a),i=Math.round(i*a)}nt.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||i!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=nt.nextWgetRequestHandle;return nt.nextWgetRequestHandle++,e}};var ot={defaults:{width:320,height:200,copyOnLock:!0,discardOnLock:!1,opaqueFrontBuffer:!0},version:null,surfaces:{},canvasPool:[],events:[],fonts:[null],audios:[null],rwops:[null],music:{audio:null,volume:1},mixerFrequency:22050,mixerFormat:32784,mixerNumChannels:2,mixerChunkSize:1024,channelMinimumNumber:0,GL:!1,glAttributes:{0:3,1:3,2:2,3:0,4:0,5:1,6:16,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:1,16:0,17:0,18:0},keyboardState:null,keyboardMap:{},canRequestFullscreen:!1,isRequestingFullscreen:!1,textInput:!1,startTime:null,initFlags:0,buttonState:0,modState:0,DOMButtons:[0,0,0],DOMEventToSDLEvent:{},TOUCH_DEFAULT_ID:0,eventHandler:null,eventHandlerContext:null,eventHandlerTemp:0,keyCodes:{16:1249,17:1248,18:1250,20:1081,33:1099,34:1102,35:1101,36:1098,37:1104,38:1106,39:1103,40:1105,44:316,45:1097,46:127,91:1251,93:1125,96:1122,97:1113,98:1114,99:1115,100:1116,101:1117,102:1118,103:1119,104:1120,105:1121,106:1109,107:1111,109:1110,110:1123,111:1108,112:1082,113:1083,114:1084,115:1085,116:1086,117:1087,118:1088,119:1089,120:1090,121:1091,122:1092,123:1093,124:1128,125:1129,126:1130,127:1131,128:1132,129:1133,130:1134,131:1135,132:1136,133:1137,134:1138,135:1139,144:1107,160:94,161:33,162:34,163:35,164:36,165:37,166:38,167:95,168:40,169:41,170:42,171:43,172:124,173:45,174:123,175:125,176:126,181:127,182:129,183:128,188:44,190:46,191:47,192:96,219:91,220:92,221:93,222:39,224:1251},scanCodes:{8:42,9:43,13:40,27:41,32:44,35:204,39:53,44:54,46:55,47:56,48:39,49:30,50:31,51:32,52:33,53:34,54:35,55:36,56:37,57:38,58:203,59:51,61:46,91:47,92:49,93:48,96:52,97:4,98:5,99:6,100:7,101:8,102:9,103:10,104:11,105:12,106:13,107:14,108:15,109:16,110:17,111:18,112:19,113:20,114:21,115:22,116:23,117:24,118:25,119:26,120:27,121:28,122:29,127:76,305:224,308:226,316:70},loadRect:function(e){return{x:Q[e+0>>2],y:Q[e+4>>2],w:Q[e+8>>2],h:Q[e+12>>2]}},updateRect:function(e,t){Q[e>>2]=t.x,Q[e+4>>2]=t.y,Q[e+8>>2]=t.w,Q[e+12>>2]=t.h},intersectionOfRects:function(e,t){var r=Math.max(e.x,t.x),n=Math.max(e.y,t.y),o=Math.min(e.x+e.w,t.x+t.w),i=Math.min(e.y+e.h,t.y+t.h);return{x:r,y:n,w:Math.max(r,o)-r,h:Math.max(n,i)-n}},checkPixelFormat:function(e){-2042224636!=Q[e>>2]&&A("Unsupported pixel format!")},loadColorToCSSRGB:function(e){var t=Q[e>>2];return"rgb("+(255&t)+","+(t>>8&255)+","+(t>>16&255)+")"},loadColorToCSSRGBA:function(e){var t=Q[e>>2];return"rgba("+(255&t)+","+(t>>8&255)+","+(t>>16&255)+","+(t>>24&255)/255+")"},translateColorToCSSRGBA:function(e){return"rgba("+(255&e)+","+(e>>8&255)+","+(e>>16&255)+","+(e>>>24)/255+")"},translateRGBAToCSSRGBA:function(e,t,r,n){return"rgba("+(255&e)+","+(255&t)+","+(255&r)+","+(255&n)/255+")"},translateRGBAToColor:function(e,t,r,n){return e|t<<8|r<<16|n<<24},makeSurface:function(e,t,r,n,i,a,s,u,c){var l,d=1&(r=r||0),f=2097152&r,m=67108864&r,p=Rr(60),h=Rr(44),v=f?1:4,E=0;d||m||(E=Rr(e*t*4)),Q[p>>2]=r,Q[p+4>>2]=h,Q[p+8>>2]=e,Q[p+12>>2]=t,Q[p+16>>2]=e*v,Q[p+20>>2]=E,Q[p+36>>2]=0,Q[p+40>>2]=0,Q[p+44>>2]=o.canvas.width,Q[p+48>>2]=o.canvas.height,Q[p+56>>2]=1,Q[h>>2]=-2042224636,Q[h+4>>2]=0,Y[h+8|0]=8*v,Y[h+9|0]=v,Q[h+12>>2]=a||255,Q[h+16>>2]=s||65280,Q[h+20>>2]=u||16711680,Q[h+24>>2]=c||4278190080,ot.GL=ot.GL||m,n?l=o.canvas:((l=ot.canvasPool.length>0?ot.canvasPool.pop():document.createElement("canvas")).width=e,l.height=t);var g={antialias:0!=ot.glAttributes[13]&&ot.glAttributes[14]>1,depth:ot.glAttributes[6]>0,stencil:ot.glAttributes[7]>0,alpha:ot.glAttributes[3]>0},y=nt.createContext(l,m,n,g);return ot.surfaces[p]={width:e,height:t,canvas:l,ctx:y,surf:p,buffer:E,pixelFormat:h,alpha:255,flags:r,locked:0,usePageCanvas:n,source:i,isFlagSet:function(e){return r&e}},p},copyIndexedColorData:function(e,t,r,n,i){if(e.colors){var a=o.canvas.width,s=o.canvas.height,u=t||0,c=r||0,l=(n||a-u)+u,d=(i||s-c)+c,f=e.buffer;e.image.data32||(e.image.data32=new Uint32Array(e.image.data.buffer));for(var m=e.image.data32,p=e.colors32,h=c;h<d;++h)for(var v=h*a,E=u;E<l;++E)m[v+E]=p[q[f+v+E|0]]}},freeSurface:function(e){var t=e+56,r=Q[t>>2];if(r>1)Q[t>>2]=r-1;else{var n=ot.surfaces[e];!n.usePageCanvas&&n.canvas&&ot.canvasPool.push(n.canvas),n.buffer&&Sr(n.buffer),Sr(n.pixelFormat),Sr(e),ot.surfaces[e]=null,e===ot.screen&&(ot.screen=null)}},blitSurface:function(e,t,r,n,i){var a,s,u,c,l=ot.surfaces[e],d=ot.surfaces[r];if(a=t?ot.loadRect(t):{x:0,y:0,w:l.width,h:l.height},s=n?ot.loadRect(n):{x:0,y:0,w:l.width,h:l.height},d.clipRect){var f=i&&0!==a.w?a.w/s.w:1,m=i&&0!==a.h?a.h/s.h:1;s=ot.intersectionOfRects(d.clipRect,s),a.w=s.w*f,a.h=s.h*m,n&&ot.updateRect(n,s)}if(i?(u=s.w,c=s.h):(u=a.w,c=a.h),0===a.w||0===a.h||0===u||0===c)return 0;var p=d.ctx.globalAlpha;return d.ctx.globalAlpha=l.alpha/255,d.ctx.drawImage(l.canvas,a.x,a.y,a.w,a.h,s.x,s.y,u,c),d.ctx.globalAlpha=p,r!=ot.screen&&(A("WARNING: copying canvas data to memory for compatibility"),function(e){var t=ot.surfaces[e];if(t.locked++,t.locked>1)return 0;if(t.buffer||(t.buffer=Rr(t.width*t.height*4),Q[e+20>>2]=t.buffer),Q[e+20>>2]=t.buffer,e==ot.screen&&o.screenIsReadOnly&&t.image)return 0;if(ot.defaults.discardOnLock){if(t.image||(t.image=t.ctx.createImageData(t.width,t.height)),!ot.defaults.opaqueFrontBuffer)return}else t.image=t.ctx.getImageData(0,0,t.width,t.height);if(e==ot.screen&&ot.defaults.opaqueFrontBuffer)for(var r=t.image.data,n=r.length,i=0;i<n/4;i++)r[4*i+3]=255;if(ot.defaults.copyOnLock&&!ot.defaults.discardOnLock){if(t.isFlagSet(2097152))throw"CopyOnLock is not supported for SDL_LockSurface with SDL_HWPALETTE flag set"+(new Error).stack;q.set(t.image.data,t.buffer)}}(r),d.locked--),0},downFingers:{},savedKeydown:null,receiveEvent:function(e){function t(){for(var e in ot.keyboardMap)ot.events.push({type:"keyup",keyCode:ot.keyboardMap[e]})}switch(e.type){case"touchstart":case"touchmove":e.preventDefault();var r=[];if("touchstart"===e.type)for(var n=0;n<e.touches.length;n++){var i=e.touches[n];1!=ot.downFingers[i.identifier]&&(ot.downFingers[i.identifier]=!0,r.push(i))}else r=e.touches;var a=r[0];if(a){var s;switch("touchstart"==e.type&&(ot.DOMButtons[0]=1),e.type){case"touchstart":s="mousedown";break;case"touchmove":s="mousemove"}var u={type:s,button:0,pageX:a.clientX,pageY:a.clientY};ot.events.push(u)}for(n=0;n<r.length;n++){i=r[n];ot.events.push({type:e.type,touch:i})}break;case"touchend":e.preventDefault();for(n=0;n<e.changedTouches.length;n++){i=e.changedTouches[n];!0===ot.downFingers[i.identifier]&&delete ot.downFingers[i.identifier]}u={type:"mouseup",button:0,pageX:e.changedTouches[0].clientX,pageY:e.changedTouches[0].clientY};ot.DOMButtons[0]=0,ot.events.push(u);for(n=0;n<e.changedTouches.length;n++){i=e.changedTouches[n];ot.events.push({type:"touchend",touch:i})}break;case"DOMMouseScroll":case"mousewheel":case"wheel":var c=-nt.getMouseWheelDelta(e),l=(c=0==c?0:c>0?Math.max(c,1):Math.min(c,-1))>0?3:4;ot.events.push({type:"mousedown",button:l,pageX:e.pageX,pageY:e.pageY}),ot.events.push({type:"mouseup",button:l,pageX:e.pageX,pageY:e.pageY}),ot.events.push({type:"wheel",deltaX:0,deltaY:c}),e.preventDefault();break;case"mousemove":if(1===ot.DOMButtons[0]&&ot.events.push({type:"touchmove",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),nt.pointerLock&&("mozMovementX"in e&&(e.movementX=e.mozMovementX,e.movementY=e.mozMovementY),0==e.movementX&&0==e.movementY))return void e.preventDefault();case"keydown":case"keyup":case"keypress":case"mousedown":case"mouseup":if("keydown"===e.type&&(ot.unicode||ot.textInput)&&8!==e.keyCode&&9!==e.keyCode||e.preventDefault(),"mousedown"==e.type)ot.DOMButtons[e.button]=1,ot.events.push({type:"touchstart",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}});else if("mouseup"==e.type){if(!ot.DOMButtons[e.button])return;ot.events.push({type:"touchend",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),ot.DOMButtons[e.button]=0}"keydown"===e.type||"mousedown"===e.type?ot.canRequestFullscreen=!0:"keyup"!==e.type&&"mouseup"!==e.type||(ot.isRequestingFullscreen&&(o.requestFullscreen(!0,!0),ot.isRequestingFullscreen=!1),ot.canRequestFullscreen=!1),"keypress"===e.type&&ot.savedKeydown?(ot.savedKeydown.keypressCharCode=e.charCode,ot.savedKeydown=null):"keydown"===e.type&&(ot.savedKeydown=e),("keypress"!==e.type||ot.textInput)&&ot.events.push(e);break;case"mouseout":for(n=0;n<3;n++)ot.DOMButtons[n]&&(ot.events.push({type:"mouseup",button:n,pageX:e.pageX,pageY:e.pageY}),ot.DOMButtons[n]=0);e.preventDefault();break;case"focus":ot.events.push(e),e.preventDefault();break;case"blur":ot.events.push(e),t(),e.preventDefault();break;case"visibilitychange":ot.events.push({type:"visibilitychange",visible:!document.hidden}),t(),e.preventDefault();break;case"unload":return void(nt.mainLoop.runner&&(ot.events.push(e),nt.mainLoop.runner()));case"resize":ot.events.push(e),e.preventDefault&&e.preventDefault()}ot.events.length>=1e4&&(_("SDL event queue full, dropping events"),ot.events=ot.events.slice(0,1e4)),ot.flushEventsToHandler()},lookupKeyCodeForEvent:function(e){var t=e.keyCode;return t>=65&&t<=90?t+=32:(t=ot.keyCodes[e.keyCode]||e.keyCode,e.location===KeyboardEvent.DOM_KEY_LOCATION_RIGHT&&t>=1248&&t<=1251&&(t+=4)),t},handleEvent:function(e){if(!e.handled)switch(e.handled=!0,e.type){case"touchstart":case"touchend":case"touchmove":nt.calculateMouseEvent(e);break;case"keydown":case"keyup":var t="keydown"===e.type,r=ot.lookupKeyCodeForEvent(e);Y[ot.keyboardState+r|0]=t,ot.modState=(Y[ot.keyboardState+1248|0]?64:0)|(Y[ot.keyboardState+1249|0]?1:0)|(Y[ot.keyboardState+1250|0]?256:0)|(Y[ot.keyboardState+1252|0]?128:0)|(Y[ot.keyboardState+1253|0]?2:0)|(Y[ot.keyboardState+1254|0]?512:0),t?ot.keyboardMap[r]=e.keyCode:delete ot.keyboardMap[r];break;case"mousedown":case"mouseup":"mousedown"==e.type?ot.buttonState|=1<<e.button:"mouseup"==e.type&&(ot.buttonState&=~(1<<e.button));case"mousemove":nt.calculateMouseEvent(e)}},flushEventsToHandler:function(){if(ot.eventHandler)for(;ot.pollEvent(ot.eventHandlerTemp);)o.dynCall_iii(ot.eventHandler,ot.eventHandlerContext,ot.eventHandlerTemp)},pollEvent:function(e){if(512&ot.initFlags&&ot.joystickEventState&&ot.queryJoysticks(),e){for(;ot.events.length>0;)if(!1!==ot.makeCEvent(ot.events.shift(),e))return 1;return 0}return ot.events.length>0},makeCEvent:function(e,t){if("number"==typeof e)return Dr(t,e,28),void Sr(e);switch(ot.handleEvent(e),e.type){case"keydown":case"keyup":var r,n="keydown"===e.type,i=ot.lookupKeyCodeForEvent(e);r=i>=1024?i-1024:ot.scanCodes[i]||i,Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Y[t+8|0]=n?1:0,Y[t+9|0]=0,Q[t+12>>2]=r,Q[t+16>>2]=i,W[t+20>>1]=ot.modState,Q[t+24>>2]=e.keypressCharCode||i;break;case"keypress":Q[t>>2]=ot.DOMEventToSDLEvent[e.type];for(var a=vr(String.fromCharCode(e.charCode)),s=0;s<a.length;++s)Y[t+(8+s)|0]=a[s];break;case"mousedown":case"mouseup":case"mousemove":if("mousemove"!=e.type){n="mousedown"===e.type;Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Q[t+8>>2]=0,Q[t+12>>2]=0,Y[t+16|0]=e.button+1,Y[t+17|0]=n?1:0,Q[t+20>>2]=nt.mouseX,Q[t+24>>2]=nt.mouseY}else Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Q[t+8>>2]=0,Q[t+12>>2]=0,Q[t+16>>2]=ot.buttonState,Q[t+20>>2]=nt.mouseX,Q[t+24>>2]=nt.mouseY,Q[t+28>>2]=nt.mouseMovementX,Q[t+32>>2]=nt.mouseMovementY;break;case"wheel":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+16>>2]=e.deltaX,Q[t+20>>2]=e.deltaY;break;case"touchstart":case"touchend":case"touchmove":var u=e.touch;if(!nt.touches[u.identifier])break;var c=o.canvas.width,l=o.canvas.height,d=nt.touches[u.identifier].x/c,f=nt.touches[u.identifier].y/l,m=d-nt.lastTouches[u.identifier].x/c,p=f-nt.lastTouches[u.identifier].y/l;if(void 0===u.deviceID&&(u.deviceID=ot.TOUCH_DEFAULT_ID),0===m&&0===p&&"touchmove"===e.type)return!1;Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=Date.now()-ot.startTime|0,Ie=[u.deviceID>>>0,(Pe=u.deviceID,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[t+8>>2]=Ie[0],Q[t+12>>2]=Ie[1],Ie=[u.identifier>>>0,(Pe=u.identifier,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[t+16>>2]=Ie[0],Q[t+20>>2]=Ie[1],Z[t+24>>2]=d,Z[t+28>>2]=f,Z[t+32>>2]=m,Z[t+36>>2]=p,void 0!==u.force?Z[t+40>>2]=u.force:Z[t+40>>2]="touchend"==e.type?0:1;break;case"unload":Q[t>>2]=ot.DOMEventToSDLEvent[e.type];break;case"resize":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=e.w,Q[t+8>>2]=e.h;break;case"joystick_button_up":case"joystick_button_down":var h="joystick_button_up"===e.type?0:1;Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Y[t+4|0]=e.index,Y[t+5|0]=e.button,Y[t+6|0]=h;break;case"joystick_axis_motion":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Y[t+4|0]=e.index,Y[t+5|0]=e.axis,Q[t+8>>2]=ot.joystickAxisValueConversion(e.value);break;case"focus":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Y[t+8|0]=12;break;case"blur":Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Y[t+8|0]=13;break;case"visibilitychange":var v=e.visible?1:2;Q[t>>2]=ot.DOMEventToSDLEvent[e.type],Q[t+4>>2]=0,Y[t+8|0]=v;break;default:throw"Unhandled SDL event: "+e.type}},makeFontString:function(e,t){return"'"!=t.charAt(0)&&'"'!=t.charAt(0)&&(t='"'+t+'"'),e+"px "+t+", serif"},estimateTextWidth:function(e,t){var r=e.size,n=ot.makeFontString(r,e.name),o=ot.ttfContext;return F(o,"TTF_Init must have been called"),o.font=n,0|o.measureText(t).width},allocateChannels:function(e){if(!(ot.numChannels&&ot.numChannels>=e&&0!=e)){ot.numChannels=e,ot.channels=[];for(var t=0;t<e;t++)ot.channels[t]={audio:null,volume:1}}},setGetVolume:function(e,t){if(!e)return 0;var r=128*e.volume;if(-1!=t&&(e.volume=Math.min(Math.max(t,0),128)/128,e.audio))try{e.audio.volume=e.volume,e.audio.webAudioGainNode&&(e.audio.webAudioGainNode.gain.value=e.volume)}catch(e){_("setGetVolume failed to set audio volume: "+e)}return r},setPannerPosition:function(e,t,r,n){e&&e.audio&&e.audio.webAudioPannerNode&&e.audio.webAudioPannerNode.setPosition(t,r,n)},playWebAudio:function(e){if(e&&!e.webAudioNode&&ot.webAudioAvailable())try{var t=e.resource.webAudio;if(e.paused=!1,!t.decodedBuffer)return void 0===t.onDecodeComplete&&nn("Cannot play back audio object that was not loaded"),void t.onDecodeComplete.push(function(){e.paused||ot.playWebAudio(e)});e.webAudioNode=ot.audioContext.createBufferSource(),e.webAudioNode.buffer=t.decodedBuffer,e.webAudioNode.loop=e.loop,e.webAudioNode.onended=function(){e.onended()},e.webAudioPannerNode=ot.audioContext.createPanner(),e.webAudioPannerNode.setPosition(0,0,-.5),e.webAudioPannerNode.panningModel="equalpower",e.webAudioGainNode=ot.audioContext.createGain(),e.webAudioGainNode.gain.value=e.volume,e.webAudioNode.connect(e.webAudioPannerNode),e.webAudioPannerNode.connect(e.webAudioGainNode),e.webAudioGainNode.connect(ot.audioContext.destination),e.webAudioNode.start(0,e.currentPosition),e.startTime=ot.audioContext.currentTime-e.currentPosition}catch(e){_("playWebAudio failed: "+e)}},pauseWebAudio:function(e){if(e){if(e.webAudioNode)try{e.currentPosition=(ot.audioContext.currentTime-e.startTime)%e.resource.webAudio.decodedBuffer.duration,e.webAudioNode.onended=void 0,e.webAudioNode.stop(0),e.webAudioNode=void 0}catch(e){_("pauseWebAudio failed: "+e)}e.paused=!0}},openAudioContext:function(){ot.audioContext||("undefined"!=typeof AudioContext?ot.audioContext=new AudioContext:"undefined"!=typeof webkitAudioContext&&(ot.audioContext=new webkitAudioContext))},webAudioAvailable:function(){return!!ot.audioContext},fillWebAudioBufferFromHeap:function(e,t,r){for(var n=ot.audio.channels,o=0;o<n;++o){var i=r.getChannelData(o);if(i.length!=t)throw"Web Audio output buffer length mismatch! Destination size: "+i.length+" samples vs expected "+t+" samples!";if(32784==ot.audio.format)for(var a=0;a<t;++a)i[a]=W[e+2*(a*n+o)>>1]/32768;else if(8==ot.audio.format)for(a=0;a<t;++a){var s=Y[e+(a*n+o)|0];i[a]=(s>=0?s-128:s+128)/128}else{if(33056!=ot.audio.format)throw"Invalid SDL audio format "+ot.audio.format+"!";for(a=0;a<t;++a)i[a]=Z[e+4*(a*n+o)>>2]}}},debugSurface:function(e){console.log("dumping surface "+[e.surf,e.source,e.width,e.height]);for(var t=e.ctx.getImageData(0,0,e.width,e.height).data,r=Math.min(e.width,e.height),n=0;n<r;n++)console.log(" diagonal "+n+":"+[t[n*e.width*4+4*n+0],t[n*e.width*4+4*n+1],t[n*e.width*4+4*n+2],t[n*e.width*4+4*n+3]])},joystickEventState:1,lastJoystickState:{},joystickNamePool:{},recordJoystickState:function(e,t){for(var r=new Array(t.buttons.length),n=0;n<t.buttons.length;n++)r[n]=ot.getJoystickButtonState(t.buttons[n]);ot.lastJoystickState[e]={buttons:r,axes:t.axes.slice(0),timestamp:t.timestamp,index:t.index,id:t.id}},getJoystickButtonState:function(e){return"object"==typeof e?e.pressed:e>0},queryJoysticks:function(){for(var e in ot.lastJoystickState){var t=ot.getGamepad(e-1),r=ot.lastJoystickState[e];if(void 0===t)return;if(null===t)return;if("number"!=typeof t.timestamp||t.timestamp!==r.timestamp||!t.timestamp){var n;for(n=0;n<t.buttons.length;n++){var o=ot.getJoystickButtonState(t.buttons[n]);o!==r.buttons[n]&&ot.events.push({type:o?"joystick_button_down":"joystick_button_up",joystick:e,index:e-1,button:n})}for(n=0;n<t.axes.length;n++)t.axes[n]!==r.axes[n]&&ot.events.push({type:"joystick_axis_motion",joystick:e,index:e-1,axis:n,value:t.axes[n]});ot.recordJoystickState(e,t)}}},joystickAxisValueConversion:function(e){return e=Math.min(1,Math.max(e,-1)),Math.ceil(32767.5*(e+1)-32768)},getGamepads:function(){var e=navigator.getGamepads||navigator.webkitGamepads||navigator.mozGamepads||navigator.gamepads||navigator.webkitGetGamepads;return void 0!==e?e.apply(navigator):[]},getGamepad:function(e){var t=ot.getGamepads();return t.length>e&&e>=0?t[e]:null}};var it={};function at(e){var t,r;at.called?(r=Q[e>>2],t=Q[r>>2]):(at.called=!0,it.USER=it.LOGNAME="web_user",it.PATH="/",it.PWD="/",it.HOME="/home/web_user",it.LANG="C.UTF-8",it.LANG=("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",it._=m,t=P(1024),r=P(256),Q[r>>2]=t,Q[e>>2]=r);var n=[],o=0;for(var i in it)if("string"==typeof it[i]){var a=i+"="+it[i];n.push(a),o+=a.length}if(o>1024)throw new Error("Environment size exceeded TOTAL_ENV_SIZE!");for(var s=0;s<n.length;s++){G(a=n[s],t),Q[r+4*s>>2]=t,t+=a.length+1}Q[r+4*n.length>>2]=0}function st(e,t){var r;if(0===e)r=Date.now();else{if(1!==e||!(c||"undefined"!=typeof dateNow||"object"==typeof performance&&performance&&"function"==typeof performance.now))return Ge(22),-1;r=rt()}return Q[t>>2]=r/1e3|0,Q[t+4>>2]=r%1e3*1e3*1e3|0,0}var ut={};var ct={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:function(e,t){if("/"!==t[0]){var r;if(-100===e)r=et.cwd();else{var n=et.getStream(e);if(!n)throw new et.ErrnoError(9);r=n.path}t=He.join2(r,t)}return t},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&He.normalize(t)!==He.normalize(et.getPath(e.node)))return-20;throw e}return Q[r>>2]=n.dev,Q[r+4>>2]=0,Q[r+8>>2]=n.ino,Q[r+12>>2]=n.mode,Q[r+16>>2]=n.nlink,Q[r+20>>2]=n.uid,Q[r+24>>2]=n.gid,Q[r+28>>2]=n.rdev,Q[r+32>>2]=0,Ie=[n.size>>>0,(Pe=n.size,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[r+40>>2]=Ie[0],Q[r+44>>2]=Ie[1],Q[r+48>>2]=4096,Q[r+52>>2]=n.blocks,Q[r+56>>2]=n.atime.getTime()/1e3|0,Q[r+60>>2]=0,Q[r+64>>2]=n.mtime.getTime()/1e3|0,Q[r+68>>2]=0,Q[r+72>>2]=n.ctime.getTime()/1e3|0,Q[r+76>>2]=0,Ie=[n.ino>>>0,(Pe=n.ino,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[r+80>>2]=Ie[0],Q[r+84>>2]=Ie[1],0},doMsync:function(e,t,r,n){var o=new Uint8Array(q.subarray(e,e+r));et.msync(t,o,0,r,n)},doMkdir:function(e,t){return"/"===(e=He.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),et.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-22}return et.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-22;var n=et.readlink(e),o=Math.min(r,V(n)),i=Y[t+o];return j(n,t,r+1),Y[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-22;var r;if(!(r=et.lookupPath(e,{follow:!0}).node))return-2;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&et.nodePermissions(r,n)?-13:0},doDup:function(e,t,r){var n=et.getStream(r);return n&&et.close(n),et.open(e,t,0,r,r).fd},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=Q[t+8*i>>2],s=Q[t+(8*i+4)>>2],u=et.read(e,Y,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=Q[t+8*i>>2],s=Q[t+(8*i+4)>>2],u=et.write(e,Y,a,s,n);if(u<0)return-1;o+=u}return o},varargs:0,get:function(e){return ct.varargs+=4,Q[ct.varargs-4>>2]},getStr:function(){return B(ct.get())},getStreamFromFD:function(){var e=et.getStream(ct.get());if(!e)throw new et.ErrnoError(9);return e},get64:function(){var e=ct.get(),t=ct.get();return F(e>=0?0===t:-1===t),e},getZero:function(){F(0===ct.get())}};function lt(e,t){ct.varargs=t;try{return 0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}}var dt=42;var ft={BUCKET_BUFFER_SIZE:8192,mount:function(e){return et.createNode(null,"/",16895,0)},createPipe:function(){var e={buckets:[]};e.buckets.push({buffer:new Uint8Array(ft.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=ft.nextname(),r=ft.nextname(),n=et.createNode(ft.root,t,4096,0),o=et.createNode(ft.root,r,4096,0);n.pipe=e,o.pipe=e;var i=et.createStream({path:t,node:n,flags:et.modeStringToFlags("r"),seekable:!1,stream_ops:ft.stream_ops});n.stream=i;var a=et.createStream({path:r,node:o,flags:et.modeStringToFlags("w"),seekable:!1,stream_ops:ft.stream_ops});return o.stream=a,{readable_fd:i.fd,writable_fd:a.fd}},stream_ops:{poll:function(e){var t=e.node.pipe;if(1==(2097155&e.flags))return 260;if(t.buckets.length>0)for(var r=0;r<t.buckets.length;r++){var n=t.buckets[r];if(n.offset-n.roffset>0)return 65}return 0},ioctl:function(e,t,r){return $e.EINVAL},fsync:function(e){return $e.EINVAL},read:function(e,t,r,n,o){for(var i=e.node.pipe,a=0,s=0;s<i.buckets.length;s++){var u=i.buckets[s];a+=u.offset-u.roffset}F(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var c=t.subarray(r,r+n);if(n<=0)return 0;if(0==a)throw new et.ErrnoError($e.EAGAIN);var l=Math.min(a,n),d=l,f=0;for(s=0;s<i.buckets.length;s++){var m=i.buckets[s],p=m.offset-m.roffset;if(l<=p){var h=m.buffer.subarray(m.roffset,m.offset);l<p?(h=h.subarray(0,l),m.roffset+=l):f++,c.set(h);break}h=m.buffer.subarray(m.roffset,m.offset);c.set(h),c=c.subarray(h.byteLength),l-=h.byteLength,f++}return f&&f==i.buckets.length&&(f--,i.buckets[f].offset=0,i.buckets[f].roffset=0),i.buckets.splice(0,f),d},write:function(e,t,r,n,o){var i=e.node.pipe;F(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var a=t.subarray(r,r+n),s=a.byteLength;if(s<=0)return 0;var u=null;0==i.buckets.length?(u={buffer:new Uint8Array(ft.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(u)):u=i.buckets[i.buckets.length-1],F(u.offset<=ft.BUCKET_BUFFER_SIZE);var c=ft.BUCKET_BUFFER_SIZE-u.offset;if(c>=s)return u.buffer.set(a,u.offset),u.offset+=s,s;c>0&&(u.buffer.set(a.subarray(0,c),u.offset),u.offset+=c,a=a.subarray(c,a.byteLength));for(var l=a.byteLength/ft.BUCKET_BUFFER_SIZE|0,d=a.byteLength%ft.BUCKET_BUFFER_SIZE,f=0;f<l;f++){var m={buffer:new Uint8Array(ft.BUCKET_BUFFER_SIZE),offset:ft.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(m),m.buffer.set(a.subarray(0,ft.BUCKET_BUFFER_SIZE)),a=a.subarray(ft.BUCKET_BUFFER_SIZE,a.byteLength)}if(d>0){m={buffer:new Uint8Array(ft.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0};i.buckets.push(m),m.buffer.set(a)}return s},close:function(e){e.node.pipe.buckets=null}},nextname:function(){return ft.nextname.current||(ft.nextname.current=0),"pipe["+ft.nextname.current+++"]"}};function mt(e){!function(e,t){if(function(){var e=b,t=_,r=!1;b=_=function(e){r=!0};try{var n=o._fflush;n&&n(0),["stdout","stderr"].forEach(function(e){var t=et.analyzePath("/dev/"+e);if(t){var n=t.object.rdev,o=qe.ttys[n];o&&o.output&&o.output.length&&(r=!0)}})}catch(e){}b=e,_=t,r&&A("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}(),t&&o.noExitRuntime&&0===e)return;o.noExitRuntime?t||_("exit("+e+") called, but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)"):(L=!0,ae(),he=!0,o.onExit&&o.onExit(e));p(e,new en(e))}(e)}var pt=_e;function ht(){nn("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function vt(){return Y.length}function Et(e,t){throw Lr(e,t||1),"longjmp"}function gt(){return Ge(8),-1}var yt=ge,wt=Te;var bt={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],currArrayBuffer:0,currElementArrayBuffer:0,byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){bt.createLog2ceilLookup(bt.MAX_TEMP_BUFFER_SIZE),bt.miniTempBuffer=new Float32Array(bt.MINI_TEMP_BUFFER_SIZE);for(var e=0;e<bt.MINI_TEMP_BUFFER_SIZE;e++)bt.miniTempBufferViews[e]=bt.miniTempBuffer.subarray(0,e+1)},recordError:function(e){bt.lastError||(bt.lastError=e)},getNewId:function(e){for(var t=bt.counter++,r=e.length;r<t;r++)e[r]=null;return t},MINI_TEMP_BUFFER_SIZE:256,miniTempBuffer:null,miniTempBufferViews:[0],MAX_TEMP_BUFFER_SIZE:2097152,numTempVertexBuffersPerSize:64,log2ceilLookup:null,createLog2ceilLookup:function(e){bt.log2ceilLookup=new Uint8Array(e+1);var t=0,r=1;bt.log2ceilLookup[0]=0;for(var n=1;n<=e;++n)n>r&&(r<<=1,++t),bt.log2ceilLookup[n]=t},generateTempBuffers:function(e,t){var r=bt.log2ceilLookup[bt.MAX_TEMP_BUFFER_SIZE];t.tempVertexBufferCounters1=[],t.tempVertexBufferCounters2=[],t.tempVertexBufferCounters1.length=t.tempVertexBufferCounters2.length=r+1,t.tempVertexBuffers1=[],t.tempVertexBuffers2=[],t.tempVertexBuffers1.length=t.tempVertexBuffers2.length=r+1,t.tempIndexBuffers=[],t.tempIndexBuffers.length=r+1;for(var n=0;n<=r;++n){t.tempIndexBuffers[n]=null,t.tempVertexBufferCounters1[n]=t.tempVertexBufferCounters2[n]=0;var o=bt.numTempVertexBuffersPerSize;t.tempVertexBuffers1[n]=[],t.tempVertexBuffers2[n]=[];var i=t.tempVertexBuffers1[n],a=t.tempVertexBuffers2[n];i.length=a.length=o;for(var s=0;s<o;++s)i[s]=a[s]=null}if(e){t.tempQuadIndexBuffer=sr.createBuffer(),t.GLctx.bindBuffer(t.GLctx.ELEMENT_ARRAY_BUFFER,t.tempQuadIndexBuffer);for(var u=bt.MAX_TEMP_BUFFER_SIZE>>1,c=new Uint16Array(u),l=(n=0,0);!(c[n++]=l,n>=u||(c[n++]=l+1,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l+3,n>=u));)l+=4;t.GLctx.bufferData(t.GLctx.ELEMENT_ARRAY_BUFFER,c,t.GLctx.STATIC_DRAW),t.GLctx.bindBuffer(t.GLctx.ELEMENT_ARRAY_BUFFER,null)}},getTempVertexBuffer:function(e){var t=bt.log2ceilLookup[e],r=bt.currentContext.tempVertexBuffers1[t],n=bt.currentContext.tempVertexBufferCounters1[t];bt.currentContext.tempVertexBufferCounters1[t]=bt.currentContext.tempVertexBufferCounters1[t]+1&bt.numTempVertexBuffersPerSize-1;var o=r[n];if(o)return o;var i=sr.getParameter(sr.ARRAY_BUFFER_BINDING);return r[n]=sr.createBuffer(),sr.bindBuffer(sr.ARRAY_BUFFER,r[n]),sr.bufferData(sr.ARRAY_BUFFER,1<<t,sr.DYNAMIC_DRAW),sr.bindBuffer(sr.ARRAY_BUFFER,i),r[n]},getTempIndexBuffer:function(e){var t=bt.log2ceilLookup[e],r=bt.currentContext.tempIndexBuffers[t];if(r)return r;var n=sr.getParameter(sr.ELEMENT_ARRAY_BUFFER_BINDING);return bt.currentContext.tempIndexBuffers[t]=sr.createBuffer(),sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,bt.currentContext.tempIndexBuffers[t]),sr.bufferData(sr.ELEMENT_ARRAY_BUFFER,1<<t,sr.DYNAMIC_DRAW),sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,n),bt.currentContext.tempIndexBuffers[t]},newRenderingFrameStarted:function(){if(bt.currentContext){var e=bt.currentContext.tempVertexBuffers1;bt.currentContext.tempVertexBuffers1=bt.currentContext.tempVertexBuffers2,bt.currentContext.tempVertexBuffers2=e,e=bt.currentContext.tempVertexBufferCounters1,bt.currentContext.tempVertexBufferCounters1=bt.currentContext.tempVertexBufferCounters2,bt.currentContext.tempVertexBufferCounters2=e;for(var t=bt.log2ceilLookup[bt.MAX_TEMP_BUFFER_SIZE],r=0;r<=t;++r)bt.currentContext.tempVertexBufferCounters1[r]=0}},getSource:function(e,t,r,n){for(var o="",i=0;i<t;++i){var a=n?Q[n+4*i>>2]:-1;o+=B(Q[r+4*i>>2],a<0?void 0:a)}if(35632==sr.getShaderParameter(bt.shaders[e],35663)&&(Wt.findToken(o,"dFdx")||Wt.findToken(o,"dFdy")||Wt.findToken(o,"fwidth"))){o="#extension GL_OES_standard_derivatives : enable\n"+o;sr.getExtension("OES_standard_derivatives")}return o},createContext:function(e,t){var r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return r?bt.registerContext(r,t):0},registerContext:function(e,t){var r=Rr(8),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),bt.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&bt.initExtensions(n),r},makeContextCurrent:function(e){return bt.currentContext=bt.contexts[e],o.ctx=sr=bt.currentContext&&bt.currentContext.GLctx,!(e&&!sr)},getContext:function(e){return bt.contexts[e]},deleteContext:function(e){bt.currentContext===bt.contexts[e]&&(bt.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(bt.contexts[e].GLctx.canvas),bt.contexts[e]&&bt.contexts[e].GLctx.canvas&&(bt.contexts[e].GLctx.canvas.GLctxObject=void 0),Sr(bt.contexts[e]),bt.contexts[e]=null},acquireInstancedArraysExtension:function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,i){t.drawElementsInstancedANGLE(e,r,n,o,i)})},acquireVertexArrayObjectExtension:function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})},acquireDrawBuffersExtension:function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)})},initExtensions:function(e){if(e||(e=bt.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;e.compressionExt=t.getExtension("WEBGL_compressed_texture_s3tc"),e.anisotropicExt=t.getExtension("EXT_texture_filter_anisotropic"),e.version<2&&(bt.acquireInstancedArraysExtension(t),bt.acquireVertexArrayObjectExtension(t),bt.acquireDrawBuffersExtension(t)),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query");var r=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2"],n=t.getSupportedExtensions();n&&n.length>0&&t.getSupportedExtensions().forEach(function(e){-1!=r.indexOf(e)&&t.getExtension(e)})}},populateUniformTable:function(e){for(var t=bt.programs[e],r=bt.programInfos[e]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},n=r.uniforms,o=sr.getProgramParameter(t,35718),i=0;i<o;++i){var a=sr.getActiveUniform(t,i),s=a.name;r.maxUniformLength=Math.max(r.maxUniformLength,s.length+1),"]"==s.slice(-1)&&(s=s.slice(0,s.lastIndexOf("[")));var u=sr.getUniformLocation(t,s);if(u){var c=bt.getNewId(bt.uniforms);n[s]=[a.size,c],bt.uniforms[c]=u;for(var l=1;l<a.size;++l){var d=s+"["+l+"]";u=sr.getUniformLocation(t,d),c=bt.getNewId(bt.uniforms),bt.uniforms[c]=u}}}}};function _t(e){sr.enable(e)}function Tt(e){sr.disable(e)}function xt(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&bt.recordError(1280));case 36345:n=0;break;case 34466:var o=sr.getParameter(34467);n=o?o.length:0}if(void 0===n){var i=sr.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void bt.recordError(1280);case"object":if(null===i)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:n=0;break;default:return void bt.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var a=0;a<i.length;++a)switch(r){case 0:Q[t+4*a>>2]=i[a];break;case 2:Z[t+4*a>>2]=i[a];break;case 4:Y[t+a|0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return bt.recordError(1280),void _("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return bt.recordError(1280),void _("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+i+" of type "+typeof i+"!")}}switch(r){case 1:Ie=[n>>>0,(Pe=n,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[t>>2]=Ie[0],Q[t+4>>2]=Ie[1];break;case 0:Q[t>>2]=n;break;case 2:Z[t>>2]=n;break;case 4:Y[t|0]=n?1:0}}else bt.recordError(1281)}function At(e,t){xt(e,t,4)}function Mt(e,t){xt(e,t,0)}function St(e){var t=V(e)+1,r=Rr(t);return j(e,r,t),r}function Ot(e){if(bt.stringCache[e])return bt.stringCache[e];var t;switch(e){case 7939:for(var r=sr.getSupportedExtensions(),n=[],o=0;o<r.length;++o)n.push(r[o]),n.push("GL_"+r[o]);t=St(n.join(" "));break;case 7936:case 7937:case 37445:case 37446:var i=sr.getParameter(e);i||bt.recordError(1280),t=St(i);break;case 7938:var a=sr.getParameter(sr.VERSION);t=St(a="OpenGL ES 2.0 ("+a+")");break;case 35724:var s=sr.getParameter(sr.SHADING_LANGUAGE_VERSION),u=s.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==u&&(3==u[1].length&&(u[1]=u[1]+"0"),s="OpenGL ES GLSL ES "+u[1]+" ("+s+")"),t=St(s);break;default:return bt.recordError(1280),0}return bt.stringCache[e]=t,t}function Rt(e){var t=bt.getNewId(bt.shaders);return bt.shaders[t]=sr.createShader(e),t}function Dt(e,t){sr.attachShader(bt.programs[e],bt.shaders[t])}function kt(e,t){sr.detachShader(bt.programs[e],bt.shaders[t])}function Lt(e){sr.useProgram(bt.programs[e])}function Ft(e){if(e){var t=bt.programs[e];t?(sr.deleteProgram(t),t.name=0,bt.programs[e]=null,bt.programInfos[e]=null):bt.recordError(1281)}}function Ct(e,t,r){sr.bindAttribLocation(bt.programs[e],t,B(r))}function Nt(e){sr.linkProgram(bt.programs[e]),bt.populateUniformTable(e)}function Pt(e,t){e==sr.ARRAY_BUFFER?(bt.currArrayBuffer=t,Kt.lastArrayBuffer=t):e==sr.ELEMENT_ARRAY_BUFFER&&(bt.currElementArrayBuffer=t),sr.bindBuffer(e,bt.buffers[t])}function It(e,t){xt(e,t,2)}function Ut(e,t){sr.hint(e,t)}function Bt(e){sr.enableVertexAttribArray(e)}function Xt(e){sr.disableVertexAttribArray(e)}function jt(e,t,r,n,o,i){sr.vertexAttribPointer(e,t,r,!!n,o,i)}function Vt(e){sr.activeTexture(e)}var zt,Gt,Ht,Yt,qt,Wt={fogStart:0,fogEnd:1,fogDensity:1,fogColor:null,fogMode:2048,fogEnabled:!1,vaos:[],currentVao:null,enabledVertexAttribArrays:{},hasRunInit:!1,findToken:function(e,t){function r(e){return e>=48&&e<=57||(e>=65&&e<=90||e>=97&&e<=122)}for(var n=-1;;){if((n=e.indexOf(t,n+1))<0)break;if(!(n>0&&r(e[n-1]))&&!((n+=t.length)<e.length-1&&r(e[n+1])))return!0}return!1},init:function(){if(!Wt.hasRunInit){Wt.hasRunInit=!0,Wt.fogColor=new Float32Array(4),_("WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work.");var e={2884:1,3042:1,3024:1,2960:1,2929:1,3089:1,32823:1,32926:1,32928:1},t=_t;_t=function(r){Kt.lastRenderer&&Kt.lastRenderer.cleanup(),2912!=r?3553!=r&&r in e&&t(r):1!=Wt.fogEnabled&&(Kt.currentRenderer=null,Wt.fogEnabled=!0)};var r=Tt;Tt=function(t){Kt.lastRenderer&&Kt.lastRenderer.cleanup(),2912!=t?3553!=t&&t in e&&r(t):0!=Wt.fogEnabled&&(Kt.currentRenderer=null,Wt.fogEnabled=!1)};var n=At;At=function(e,t){var r=Wt.getAttributeFromCapability(e);if(null===r)n(e,t);else{var o=Kt.enabledClientAttributes[r];Y[t|0]=!0===o?1:0}};var o=Mt;Mt=function(e,t){switch(e){case 34018:e=sr.MAX_TEXTURE_IMAGE_UNITS;break;case 35658:var r=sr.getParameter(sr.MAX_VERTEX_UNIFORM_VECTORS);return void(Q[t>>2]=4*r);case 35657:r=sr.getParameter(sr.MAX_FRAGMENT_UNIFORM_VECTORS);return void(Q[t>>2]=4*r);case 35659:r=sr.getParameter(sr.MAX_VARYING_VECTORS);return void(Q[t>>2]=4*r);case 34929:e=sr.MAX_COMBINED_TEXTURE_IMAGE_UNITS;break;case 32890:var n=Kt.clientAttributes[Kt.VERTEX];return void(Q[t>>2]=n?n.size:0);case 32891:n=Kt.clientAttributes[Kt.VERTEX];return void(Q[t>>2]=n?n.type:0);case 32892:n=Kt.clientAttributes[Kt.VERTEX];return void(Q[t>>2]=n?n.stride:0);case 32897:n=Kt.clientAttributes[Kt.COLOR];return void(Q[t>>2]=n?n.size:0);case 32898:n=Kt.clientAttributes[Kt.COLOR];return void(Q[t>>2]=n?n.type:0);case 32899:n=Kt.clientAttributes[Kt.COLOR];return void(Q[t>>2]=n?n.stride:0);case 32904:n=Kt.clientAttributes[Kt.TEXTURE0+Kt.clientActiveTexture];return void(Q[t>>2]=n?n.size:0);case 32905:n=Kt.clientAttributes[Kt.TEXTURE0+Kt.clientActiveTexture];return void(Q[t>>2]=n?n.type:0);case 32906:n=Kt.clientAttributes[Kt.TEXTURE0+Kt.clientActiveTexture];return void(Q[t>>2]=n?n.stride:0)}o(e,t)};var i=Ot;Ot=function(e){if(bt.stringCache[e])return bt.stringCache[e];if(7939===e){var t=St(sr.getSupportedExtensions().join(" ")+" GL_EXT_texture_env_combine GL_ARB_texture_env_crossbar GL_ATI_texture_env_combine3 GL_NV_texture_env_combine4 GL_EXT_texture_env_dot3 GL_ARB_multitexture GL_ARB_vertex_buffer_object GL_EXT_framebuffer_object GL_ARB_vertex_program GL_ARB_fragment_program GL_ARB_shading_language_100 GL_ARB_shader_objects GL_ARB_vertex_shader GL_ARB_fragment_shader GL_ARB_texture_cube_map GL_EXT_draw_range_elements"+(bt.currentContext.compressionExt?" GL_ARB_texture_compression GL_EXT_texture_compression_s3tc":"")+(bt.currentContext.anisotropicExt?" GL_EXT_texture_filter_anisotropic":""));return bt.stringCache[e]=t,t}return i(e)},bt.shaderInfos={};var a=Rt;Rt=function(e){var t=a(e);return bt.shaderInfos[t]={type:e,ftransform:!1},t},bt.programShaders={};var s=Dt;Dt=function(e,t){bt.programShaders[e]||(bt.programShaders[e]=[]),bt.programShaders[e].push(t),s(e,t)};var u=kt;kt=function(e,t){var r=bt.programShaders[e];if(r){var n=r.indexOf(t);r.splice(n,1),u(e,t)}else _("WARNING: _glDetachShader received invalid program: "+e)};var c=Lt;Lt=function(e){bt.currProgram!=e&&(Kt.currentRenderer=null,bt.currProgram=e,Kt.fixedFunctionProgram=0,c(e))};var l=Ft;Ft=function(e){l(e),e==bt.currProgram&&(Kt.currentRenderer=null,bt.currProgram=0)};var d={},f=Ct;Ct=function(e,t,r){0==t&&(d[e]=!0),f(e,t,r)};var m=Nt;Nt=function(e){e in d||sr.bindAttribLocation(bt.programs[e],0,"a_position"),m(e)};var p=Pt;Pt=function(e,t){p(e,t),e==sr.ARRAY_BUFFER?Wt.currentVao&&(F(Wt.currentVao.arrayBuffer==t||0==Wt.currentVao.arrayBuffer||0==t,"TODO: support for multiple array buffers in vao"),Wt.currentVao.arrayBuffer=t):e==sr.ELEMENT_ARRAY_BUFFER&&Wt.currentVao&&(Wt.currentVao.elementArrayBuffer=t)};var h=It;It=function(e,t){2982==e?Z.set(Kt.matrix[0],t>>2):2983==e?Z.set(Kt.matrix[1],t>>2):2984==e?Z.set(Kt.matrix[2+Kt.clientActiveTexture],t>>2):2918==e?Z.set(Wt.fogColor,t>>2):2915==e?Z[t>>2]=Wt.fogStart:2916==e?Z[t>>2]=Wt.fogEnd:2914==e?Z[t>>2]=Wt.fogDensity:2917==e?Z[t>>2]=Wt.fogMode:h(e,t)};var v=Ut;Ut=function(e,t){34031!=e&&v(e,t)};var E=Bt;Bt=function(e){E(e),Wt.enabledVertexAttribArrays[e]=1,Wt.currentVao&&(Wt.currentVao.enabledVertexAttribArrays[e]=1)};var g=Xt;Xt=function(e){g(e),delete Wt.enabledVertexAttribArrays[e],Wt.currentVao&&delete Wt.currentVao.enabledVertexAttribArrays[e]};var y=jt;jt=function(e,t,r,n,o,i){y(e,t,r,n,o,i),Wt.currentVao&&(Wt.currentVao.vertexAttribPointers[e]=[e,t,r,n,o,i])}}},getAttributeFromCapability:function(e){var t=null;switch(e){case 3553:nn("GL_TEXTURE_2D is not a spec-defined capability for gl{Enable,Disable}ClientState.");case 32888:t=Kt.TEXTURE0+Kt.clientActiveTexture;break;case 32884:t=Kt.VERTEX;break;case 32885:t=Kt.NORMAL;break;case 32886:t=Kt.COLOR}return t}},Kt={MapTreeLib:null,spawnMapTreeLib:function(){function e(){var e,t,r=[];this.insert=function(e,t){return!this.contains(0|e)&&(r.push([e,t]),!0)},this.contains=function(t){for(e=0;e<r.length;++e)if(r[e][0]===t)return!0;return!1},this.get=function(e){for(t=0;t<r.length;++t)if(r[t][0]===e)return r[t][1]}}function t(){function t(){var r=new e;this.child=function(e){return r.contains(0|e)||r.insert(0|e,new t),r.get(0|e)},this.value=void 0,this.get=function(){return this.value},this.set=function(e){this.value=e}}function r(e){var t;this.reset=function(){return t=e,this},this.reset(),this.next=function(e){return t=t.child(e),this},this.get=function(){return t.get()},this.set=function(e){t.set(e)}}var n,o;this.createKeyView=function(){return new r(n)},this.clear=function(){n=new t,o=this.createKeyView()},this.clear(),this.getStaticKeyView=function(){return o.reset(),o}}return{create:function(){return new t}}},TexEnvJIT:null,spawnTexEnvJIT:function(){var e=3552,t=3553,r=32879,n=34067,o=8960,a=8705,s=34163,u=3356,c=7681,l=8448,d=5890,f=34166,m=34168,p=768,h=770,v="tej_",E="uTexUnit",g="vTexCoord",y="vPrimColor",w="uTexMatrix",b=null,T=0,x=[];function A(e){F(!1,"[TexEnvJIT] ABORT: "+e)}function M(e){A("No support: "+e)}function S(e){A("Sanity failure: "+e)}function O(o){var i=b[o].getTexType(),a=null;switch(i){case e:case t:a="texture2D";break;case r:return M("No support for 3D textures.");case n:a="textureCube";break;default:return S("Unknown texType: 0x"+i.toString(16))}var s=g+o;return null!=w&&(s="("+w+o+" * "+s+")"),a+"("+E+o+", "+s+".xy)"}function R(){return b[T]}function D(e,t,r,n,o){var i=null;switch(n){case d:i=O(e);break;case f:i=t;break;case 34167:i=y;break;case m:i=r;break;default:return M("Unsupported combiner src: 0x"+n.toString(16))}var a=null;switch(o){case p:a=i+".rgb";break;case 769:a="(vec3(1.0) - "+i+".rgb)";break;case h:a=i+".a";break;case 771:a="(1.0 - "+i+".a)";break;default:return M("Unsupported combiner op: 0x"+o.toString(16))}return a}function k(e){return e==Math.round(e)?e+".0":e}function L(){this.mode=l,this.colorCombiner=l,this.alphaCombiner=l,this.colorScale=1,this.alphaScale=1,this.envColor=[0,0,0,0],this.colorSrc=[d,m,f],this.alphaSrc=[d,m,f],this.colorOp=[p,p,h],this.alphaOp=[h,h,h],this.traverseKey={7681:0,8448:1,260:2,3042:3,8449:4,34160:5,34023:3,34165:4,5890:0,34166:1,34167:2,34168:3,768:0,769:1,770:2,771:3},this.key0=-1,this.key1=0,this.key2=0,this.computeKey0=function(){var e=this.traverseKey,t=1638400*e[this.mode];return t+=327680*e[this.colorCombiner],t+=65536*e[this.alphaCombiner],t+=16384*(this.colorScale-1),t+=4096*(this.alphaScale-1),t+=1024*e[this.colorSrc[0]],t+=256*e[this.colorSrc[1]],t+=64*e[this.colorSrc[2]],t+=16*e[this.alphaSrc[0]],t+=4*e[this.alphaSrc[1]],t+=e[this.alphaSrc[2]]},this.computeKey1=function(){var e=this.traverseKey;return i=4096*e[this.colorOp[0]],i+=1024*e[this.colorOp[1]],i+=256*e[this.colorOp[2]],i+=16*e[this.alphaOp[0]],i+=4*e[this.alphaOp[1]],i+=e[this.alphaOp[2]]},this.computeKey2=function(){return 16777216*this.envColor[0]+65536*this.envColor[1]+256*this.envColor[2]+1+this.envColor[3]},this.recomputeKey=function(){this.key0=this.computeKey0(),this.key1=this.computeKey1(),this.key2=this.computeKey2()},this.invalidateKey=function(){this.key0=-1,Kt.currentRenderer=null}}function C(){this.env=new L,this.enabled_tex1D=!1,this.enabled_tex2D=!1,this.enabled_tex3D=!1,this.enabled_texCube=!1,this.texTypesEnabled=0,this.traverseState=function(e){this.texTypesEnabled?(-1==this.env.key0&&this.env.recomputeKey(),e.next(this.texTypesEnabled|this.env.key0<<4),e.next(this.env.key1),e.next(this.env.key2)):e.next(0)}}return C.prototype.enabled=function(){return this.texTypesEnabled},C.prototype.genPassLines=function(e,t,r){if(!this.enabled())return["vec4 "+e+" = "+t+";"];for(var n,o=this.env.genPassLines(e,t,r).join("\n"),i="",a=/(texture.*?\(.*?\))/g,s=0;n=a.exec(o);){var u=n[1];if(-1!=o.slice(n.index+1).indexOf(u)){var c=v+"env"+r+"_"+"texload"+s++;i+="vec4 "+c+" = "+u+";\n"+"\n",o=o.split(u).join(c),a=/(texture.*\(.*\))/g}}return[i+o]},C.prototype.getTexType=function(){return this.enabled_texCube?n:this.enabled_tex3D?r:this.enabled_tex2D?t:this.enabled_tex1D?e:0},L.prototype.genPassLines=function(e,t,r){switch(this.mode){case c:return["vec4 "+e+" = "+O(r)+";"];case 260:var n=(a=v+"env"+r+"_")+"color",o=a+"alpha";return["vec4 "+(i=a+"tex")+" = "+O(r)+";","vec3 "+n+" = "+t+".rgb + "+i+".rgb;","float "+o+" = "+t+".a * "+i+".a;","vec4 "+e+" = vec4("+n+", "+o+");"];case l:return[(d=["vec4 "+e," = ",t," * ",O(r),";"]).join("")];case 8449:n=(a=v+"env"+r+"_")+"color",o=a+"alpha";return["vec4 "+(i=a+"tex")+" = "+O(r)+";",["vec3 "+n+" = ",t+".rgb * (1.0 - "+i+".a)"," + ",i+".rgb * "+i+".a",";"].join(""),"float "+o+" = "+t+".a;","vec4 "+e+" = vec4("+n+", "+o+");"];case 3042:var i;n=(a=v+"env"+r+"_")+"color",o=a+"alpha";return["vec4 "+(i=a+"tex")+" = "+O(r)+";",["vec3 "+n+" = ",t+".rgb * (1.0 - "+i+".rgb)"," + ",y+".rgb * "+i+".rgb",";"].join(""),"float "+o+" = "+i+".a;","vec4 "+e+" = vec4("+n+", "+o+");"];case 34160:n=(a=v+"env"+r+"_")+"color",o=a+"alpha";var a,s=this.genCombinerLines(!0,n,t,r,this.colorCombiner,this.colorSrc,this.colorOp),u=this.genCombinerLines(!1,o,t,r,this.alphaCombiner,this.alphaSrc,this.alphaOp),d=["vec4 "+e," = ","vec4(",1==this.colorScale?n:n+" * "+k(this.colorScale),", ",1==this.alphaScale?o:o+" * "+k(this.alphaScale),")",";"].join("");return[].concat(s,u,[d])}return M("Unsupported TexEnv mode: 0x"+this.mode.toString(16))},L.prototype.genCombinerLines=function(e,t,r,n,o,i,a){var s=null;switch(o){case c:s=1;break;case l:case 260:case 34023:s=2;break;case 34165:s=3;break;default:return M("Unsupported combiner: 0x"+o.toString(16))}var u=["vec4(",k(this.envColor[0]),", ",k(this.envColor[1]),", ",k(this.envColor[2]),", ",k(this.envColor[3]),")"].join(""),d=s>=1?D(n,u,r,i[0],a[0]):null,f=s>=2?D(n,u,r,i[1],a[1]):null,m=s>=3?D(n,u,r,i[2],a[2]):null,E=e?"vec3":"float",g=null;switch(o){case c:g=[[E+" "+t," = ",d,";"].join("")];break;case l:g=[[E+" "+t+" = ",d+" * "+f,";"].join("")];break;case 260:g=[[E+" "+t+" = ",d+" + "+f,";"].join("")];break;case 34023:g=[[E+" "+t+" = ",d+" - "+f,";"].join("")];break;case 34165:var y=v+"env"+n+"_"+"colorSrc2";g=[function(e){switch(e){case p:case 769:return"vec3";case h:case 771:return"float"}return M("Unsupported combiner op: 0x"+e.toString(16))}(this.colorOp[2])+" "+y+" = "+m+";",[E+" "+t," = ",d+" * "+y," + ",f+" * (1.0 - "+y+")",";"].join("")];break;default:return S("Unmatched TexEnv.colorCombiner?")}return g},{init:function(e,t){var r=0;t?r=t:e&&(r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),F(r>0),b=[];for(var n=0;n<r;n++)b.push(new C)},setGLSLVars:function(e,t,r,n){E=e,g=t,y=r,w=n},genAllPassLines:function(e,t){t=t||0,x.length=0;for(var r=[],n=y,o=0;o<b.length;o++)if(b[o].enabled()){x.push(o);var i=v+"env"+o+"_"+"result",a=b[o].genPassLines(i,n,o);r=r.concat(a,[""]),n=i}r.push(e+" = "+n+";");var s="";for(o=0;o<t;o++)s+=" ";return s+r.join("\n"+s)},getUsedTexUnitList:function(){return x},traverseState:function(e){for(var t=0;t<b.length;t++)b[t].traverseState(e)},getTexUnitType:function(e){return F(e>=0&&e<b.length),b[e].getTexType()},hook_activeTexture:function(e){T=e-33984},hook_enable:function(o){var i=R();switch(o){case e:i.enabled_tex1D||(Kt.currentRenderer=null,i.enabled_tex1D=!0,i.texTypesEnabled|=1);break;case t:i.enabled_tex2D||(Kt.currentRenderer=null,i.enabled_tex2D=!0,i.texTypesEnabled|=2);break;case r:i.enabled_tex3D||(Kt.currentRenderer=null,i.enabled_tex3D=!0,i.texTypesEnabled|=4);break;case n:i.enabled_texCube||(Kt.currentRenderer=null,i.enabled_texCube=!0,i.texTypesEnabled|=8)}},hook_disable:function(o){var i=R();switch(o){case e:i.enabled_tex1D&&(Kt.currentRenderer=null,i.enabled_tex1D=!1,i.texTypesEnabled&=-2);break;case t:i.enabled_tex2D&&(Kt.currentRenderer=null,i.enabled_tex2D=!1,i.texTypesEnabled&=-3);break;case r:i.enabled_tex3D&&(Kt.currentRenderer=null,i.enabled_tex3D=!1,i.texTypesEnabled&=-5);break;case n:i.enabled_texCube&&(Kt.currentRenderer=null,i.enabled_texCube=!1,i.texTypesEnabled&=-9)}},hook_texEnvf:function(e,t,r){if(e==o){var n=R().env;switch(t){case s:n.colorScale!=r&&(n.invalidateKey(),n.colorScale=r);break;case u:n.alphaScale!=r&&(n.invalidateKey(),n.alphaScale=r);break;default:_("WARNING: Unhandled `pname` in call to `glTexEnvf`.")}}},hook_texEnvi:function(e,t,r){if(e==o){var n=R().env;switch(t){case 8704:n.mode!=r&&(n.invalidateKey(),n.mode=r);break;case 34161:n.colorCombiner!=r&&(n.invalidateKey(),n.colorCombiner=r);break;case 34162:n.alphaCombiner!=r&&(n.invalidateKey(),n.alphaCombiner=r);break;case 34176:n.colorSrc[0]!=r&&(n.invalidateKey(),n.colorSrc[0]=r);break;case 34177:n.colorSrc[1]!=r&&(n.invalidateKey(),n.colorSrc[1]=r);break;case 34178:n.colorSrc[2]!=r&&(n.invalidateKey(),n.colorSrc[2]=r);break;case 34184:n.alphaSrc[0]!=r&&(n.invalidateKey(),n.alphaSrc[0]=r);break;case 34185:n.alphaSrc[1]!=r&&(n.invalidateKey(),n.alphaSrc[1]=r);break;case 34186:n.alphaSrc[2]!=r&&(n.invalidateKey(),n.alphaSrc[2]=r);break;case 34192:n.colorOp[0]!=r&&(n.invalidateKey(),n.colorOp[0]=r);break;case 34193:n.colorOp[1]!=r&&(n.invalidateKey(),n.colorOp[1]=r);break;case 34194:n.colorOp[2]!=r&&(n.invalidateKey(),n.colorOp[2]=r);break;case 34200:n.alphaOp[0]!=r&&(n.invalidateKey(),n.alphaOp[0]=r);break;case 34201:n.alphaOp[1]!=r&&(n.invalidateKey(),n.alphaOp[1]=r);break;case 34202:n.alphaOp[2]!=r&&(n.invalidateKey(),n.alphaOp[2]=r);break;case s:n.colorScale!=r&&(n.invalidateKey(),n.colorScale=r);break;case u:n.alphaScale!=r&&(n.invalidateKey(),n.alphaScale=r);break;default:_("WARNING: Unhandled `pname` in call to `glTexEnvi`.")}}},hook_texEnvfv:function(e,t,r){if(e==o){var n=R().env;if(t===a)for(var i=0;i<4;i++){var s=Z[r+4*i>>2];n.envColor[i]!=s&&(n.invalidateKey(),n.envColor[i]=s)}else _("WARNING: Unhandled `pname` in call to `glTexEnvfv`.")}},hook_getTexEnviv:function(e,t,r){if(e==o){var n=R().env;switch(t){case 8704:return void(Q[r>>2]=n.mode);case a:return Q[r>>2]=Math.max(Math.min(255*n.envColor[0],255,-255)),Q[r+1>>2]=Math.max(Math.min(255*n.envColor[1],255,-255)),Q[r+2>>2]=Math.max(Math.min(255*n.envColor[2],255,-255)),void(Q[r+3>>2]=Math.max(Math.min(255*n.envColor[3],255,-255)));case 34161:return void(Q[r>>2]=n.colorCombiner);case 34162:return void(Q[r>>2]=n.alphaCombiner);case 34176:return void(Q[r>>2]=n.colorSrc[0]);case 34177:return void(Q[r>>2]=n.colorSrc[1]);case 34178:return void(Q[r>>2]=n.colorSrc[2]);case 34184:return void(Q[r>>2]=n.alphaSrc[0]);case 34185:return void(Q[r>>2]=n.alphaSrc[1]);case 34186:return void(Q[r>>2]=n.alphaSrc[2]);case 34192:return void(Q[r>>2]=n.colorOp[0]);case 34193:return void(Q[r>>2]=n.colorOp[1]);case 34194:return void(Q[r>>2]=n.colorOp[2]);case 34200:return void(Q[r>>2]=n.alphaOp[0]);case 34201:return void(Q[r>>2]=n.alphaOp[1]);case 34202:return void(Q[r>>2]=n.alphaOp[2]);case s:return void(Q[r>>2]=n.colorScale);case u:return void(Q[r>>2]=n.alphaScale);default:_("WARNING: Unhandled `pname` in call to `glGetTexEnvi`.")}}},hook_getTexEnvfv:function(e,t,r){if(e==o){var n=R().env;return t===a?(Z[r>>2]=n.envColor[0],Z[r+4>>2]=n.envColor[1],Z[r+8>>2]=n.envColor[2],void(Z[r+12>>2]=n.envColor[3])):void 0}}}},vertexData:null,vertexDataU8:null,tempData:null,indexData:null,vertexCounter:0,mode:-1,rendererCache:null,rendererComponents:[],rendererComponentPointer:0,lastRenderer:null,lastArrayBuffer:null,lastProgram:null,lastStride:-1,matrix:[],matrixStack:[],currentMatrix:0,tempMatrix:null,matricesModified:!1,useTextureMatrix:!1,VERTEX:0,NORMAL:1,COLOR:2,TEXTURE0:3,NUM_ATTRIBUTES:-1,MAX_TEXTURES:-1,totalEnabledClientAttributes:0,enabledClientAttributes:[0,0],clientAttributes:[],liveClientAttributes:[],currentRenderer:null,modifiedClientAttributes:!1,clientActiveTexture:0,clientColor:null,usedTexUnitList:[],fixedFunctionProgram:null,setClientAttribute:function(e,t,r,n,o){var i=Kt.clientAttributes[e];if(i)i.name=e,i.size=t,i.type=r,i.stride=n,i.pointer=o,i.offset=0;else for(var a=0;a<=e;a++)Kt.clientAttributes[a]||(Kt.clientAttributes[a]={name:e,size:t,type:r,stride:n,pointer:o,offset:0});Kt.modifiedClientAttributes=!0},addRendererComponent:function(e,t,r){Kt.rendererComponents[e]?Kt.rendererComponents[e]++:(Kt.rendererComponents[e]=1,Kt.enabledClientAttributes[e]&&console.log("Warning: glTexCoord used after EnableClientState for TEXTURE_COORD_ARRAY for TEXTURE0. Disabling TEXTURE_COORD_ARRAY..."),Kt.enabledClientAttributes[e]=!0,Kt.setClientAttribute(e,t,r,0,Kt.rendererComponentPointer),Kt.rendererComponentPointer+=t*bt.byteSizeByType[r-bt.byteSizeByTypeRoot])},disableBeginEndClientAttributes:function(){for(var e=0;e<Kt.NUM_ATTRIBUTES;e++)Kt.rendererComponents[e]&&(Kt.enabledClientAttributes[e]=!1)},getRenderer:function(){if(Kt.currentRenderer)return Kt.currentRenderer;for(var e=Kt.liveClientAttributes,t=Kt.rendererCache.getStaticKeyView().reset(),r=0,n=0;n<e.length;n++)r|=1<<e[n].name;var o=0;if(Wt.fogEnabled)switch(Wt.fogMode){case 2049:o=1;break;case 9729:o=2;break;default:o=3}t.next(r<<2|o),t.next(bt.currProgram),bt.currProgram||Kt.TexEnvJIT.traverseState(t);var i=t.get();return i?(Kt.currentRenderer=i,i):(i=Kt.createRenderer(),Kt.currentRenderer=i,t.set(i),i)},createRenderer:function(e){for(var t=!!bt.currProgram,r=!1,n=0;n<Kt.MAX_TEXTURES;n++){var o=Kt.TEXTURE0+n;Kt.enabledClientAttributes[o]&&(t||0==Kt.TexEnvJIT.getTexUnitType(n)&&A("GL_TEXTURE"+n+" coords are supplied, but that texture unit is disabled in the fixed-function pipeline."),r=!0)}var i={init:function(){var e="u_texUnit",n="a_texCoord",o="v_texCoord",i=Kt.useTextureMatrix?"u_textureMatrix":null;if(t)bt.shaderInfos[bt.programShaders[bt.currProgram][0]].type==sr.VERTEX_SHADER?(this.vertexShader=bt.shaders[bt.programShaders[bt.currProgram][0]],this.fragmentShader=bt.shaders[bt.programShaders[bt.currProgram][1]]):(this.vertexShader=bt.shaders[bt.programShaders[bt.currProgram][1]],this.fragmentShader=bt.shaders[bt.programShaders[bt.currProgram][0]]),this.program=bt.programs[bt.currProgram],this.usedTexUnitList=[];else{if(Wt.fogEnabled)switch(Wt.fogMode){case 2049:var a=" float fog = exp(-u_fogDensity * u_fogDensity * ecDistance * ecDistance); \n";break;case 9729:a=" float fog = (u_fogEnd - ecDistance) * u_fogScale; \n";break;default:a=" float fog = exp(-u_fogDensity * ecDistance); \n"}Kt.TexEnvJIT.setGLSLVars(e,o,"v_color",i);var s=Kt.TexEnvJIT.genAllPassLines("gl_FragColor",2),u="",c="",l="",d="";this.usedTexUnitList=Kt.TexEnvJIT.getUsedTexUnitList();for(var f=0;f<this.usedTexUnitList.length;f++){var m=this.usedTexUnitList[f];u+="attribute vec4 "+n+m+";\n",c+="varying vec4 "+o+m+";\n",l+="uniform sampler2D "+e+m+";\n",d+=" "+o+m+" = "+n+m+";\n",Kt.useTextureMatrix&&(l+="uniform mat4 "+i+m+";\n")}var p=null;Wt.fogEnabled&&(p=" v_fogFragCoord = abs(ecPosition.z);\n");var h=["attribute vec4 a_position;","attribute vec4 a_color;","varying vec4 v_color;",u,c,Wt.fogEnabled?"varying float v_fogFragCoord;":null,"uniform mat4 u_modelView;","uniform mat4 u_projection;","void main()","{"," vec4 ecPosition = u_modelView * a_position;"," gl_Position = u_projection * ecPosition;"," v_color = a_color;",d,p,"}",""].join("\n").replace(/\n\n+/g,"\n");this.vertexShader=sr.createShader(sr.VERTEX_SHADER),sr.shaderSource(this.vertexShader,h),sr.compileShader(this.vertexShader);var v=null;Wt.fogEnabled&&(v=["","varying float v_fogFragCoord; ","uniform vec4 u_fogColor; ","uniform float u_fogEnd; ","uniform float u_fogScale; ","uniform float u_fogDensity; ","float ffog(in float ecDistance) { ",a," fog = clamp(fog, 0.0, 1.0); "," return fog; ","}",""].join("\n"));var E=null;Wt.fogEnabled&&(E="gl_FragColor = vec4(mix(u_fogColor.rgb, gl_FragColor.rgb, ffog(v_fogFragCoord)), gl_FragColor.a);\n");var g=["precision mediump float;",c,l,"varying vec4 v_color;",v,"void main()","{",s,E,"}",""].join("\n").replace(/\n\n+/g,"\n");this.fragmentShader=sr.createShader(sr.FRAGMENT_SHADER),sr.shaderSource(this.fragmentShader,g),sr.compileShader(this.fragmentShader),this.program=sr.createProgram(),sr.attachShader(this.program,this.vertexShader),sr.attachShader(this.program,this.fragmentShader),sr.bindAttribLocation(this.program,Kt.VERTEX,"a_position"),sr.bindAttribLocation(this.program,Kt.COLOR,"a_color"),sr.bindAttribLocation(this.program,Kt.NORMAL,"a_normal");var y=sr.getParameter(sr.MAX_VERTEX_ATTRIBS);for(f=0;f<Kt.MAX_TEXTURES&&Kt.TEXTURE0+f<y;f++)sr.bindAttribLocation(this.program,Kt.TEXTURE0+f,"a_texCoord"+f),sr.bindAttribLocation(this.program,Kt.TEXTURE0+f,n+f);sr.linkProgram(this.program)}this.textureMatrixVersion=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.positionLocation=sr.getAttribLocation(this.program,"a_position"),this.texCoordLocations=[];for(f=0;f<Kt.MAX_TEXTURES;f++)Kt.enabledClientAttributes[Kt.TEXTURE0+f]?this.texCoordLocations[f]=t?sr.getAttribLocation(this.program,"a_texCoord"+f):sr.getAttribLocation(this.program,n+f):this.texCoordLocations[f]=-1;if(this.colorLocation=sr.getAttribLocation(this.program,"a_color"),!t){var w=sr.getParameter(sr.CURRENT_PROGRAM);sr.useProgram(this.program);for(f=0;f<this.usedTexUnitList.length;f++){var b=this.usedTexUnitList[f],_=sr.getUniformLocation(this.program,e+b);sr.uniform1i(_,b)}sr.vertexAttrib4fv(this.colorLocation,[1,1,1,1]),sr.useProgram(w)}this.textureMatrixLocations=[];for(f=0;f<Kt.MAX_TEXTURES;f++)this.textureMatrixLocations[f]=sr.getUniformLocation(this.program,"u_textureMatrix"+f);this.normalLocation=sr.getAttribLocation(this.program,"a_normal"),this.modelViewLocation=sr.getUniformLocation(this.program,"u_modelView"),this.projectionLocation=sr.getUniformLocation(this.program,"u_projection"),this.hasTextures=r,this.hasNormal=Kt.enabledClientAttributes[Kt.NORMAL]&&Kt.clientAttributes[Kt.NORMAL].size>0&&this.normalLocation>=0,this.hasColor=0===this.colorLocation||this.colorLocation>0,this.floatType=sr.FLOAT,this.fogColorLocation=sr.getUniformLocation(this.program,"u_fogColor"),this.fogEndLocation=sr.getUniformLocation(this.program,"u_fogEnd"),this.fogScaleLocation=sr.getUniformLocation(this.program,"u_fogScale"),this.fogDensityLocation=sr.getUniformLocation(this.program,"u_fogDensity"),this.hasFog=!!(this.fogColorLocation||this.fogEndLocation||this.fogScaleLocation||this.fogDensityLocation)},prepare:function(){var e;if(bt.currArrayBuffer)e=bt.currArrayBuffer;else{var t=Kt.firstVertex*Kt.stride,r=Kt.lastVertex*Kt.stride;F(r<=bt.MAX_TEMP_BUFFER_SIZE,"too much vertex data"),e=bt.getTempVertexBuffer(r)}bt.currArrayBuffer||(e!=Kt.lastArrayBuffer&&(sr.bindBuffer(sr.ARRAY_BUFFER,e),Kt.lastArrayBuffer=e),sr.bufferSubData(sr.ARRAY_BUFFER,t,Kt.vertexData.subarray(t>>2,r>>2))),bt.currProgram||Kt.fixedFunctionProgram!=this.program&&(sr.useProgram(this.program),Kt.fixedFunctionProgram=this.program),this.modelViewLocation&&this.modelViewMatrixVersion!=Kt.matrixVersion[0]&&(this.modelViewMatrixVersion=Kt.matrixVersion[0],sr.uniformMatrix4fv(this.modelViewLocation,!1,Kt.matrix[0])),this.projectionLocation&&this.projectionMatrixVersion!=Kt.matrixVersion[1]&&(this.projectionMatrixVersion=Kt.matrixVersion[1],sr.uniformMatrix4fv(this.projectionLocation,!1,Kt.matrix[1]));var n=Kt.clientAttributes,o=n[Kt.VERTEX];if(sr.vertexAttribPointer(this.positionLocation,o.size,o.type,!1,Kt.stride,o.offset),sr.enableVertexAttribArray(this.positionLocation),this.hasNormal){var i=n[Kt.NORMAL];sr.vertexAttribPointer(this.normalLocation,i.size,i.type,!0,Kt.stride,i.offset),sr.enableVertexAttribArray(this.normalLocation)}if(this.hasTextures)for(var a=0;a<Kt.MAX_TEXTURES;a++){var s=this.texCoordLocations[a];if(!(void 0===s||s<0)){var u=n[Kt.TEXTURE0+a];u.size?(sr.vertexAttribPointer(s,u.size,u.type,!1,Kt.stride,u.offset),sr.enableVertexAttribArray(s)):(sr.vertexAttrib4f(s,0,0,0,1),sr.disableVertexAttribArray(s));var c=2+a;this.textureMatrixLocations[a]&&this.textureMatrixVersion[c]!=Kt.matrixVersion[c]&&(this.textureMatrixVersion[c]=Kt.matrixVersion[c],sr.uniformMatrix4fv(this.textureMatrixLocations[a],!1,Kt.matrix[c]))}}if(Kt.enabledClientAttributes[Kt.COLOR]){var l=n[Kt.COLOR];sr.vertexAttribPointer(this.colorLocation,l.size,l.type,!0,Kt.stride,l.offset),sr.enableVertexAttribArray(this.colorLocation)}else this.hasColor&&(sr.disableVertexAttribArray(this.colorLocation),sr.vertexAttrib4fv(this.colorLocation,Kt.clientColor));this.hasFog&&(this.fogColorLocation&&sr.uniform4fv(this.fogColorLocation,Wt.fogColor),this.fogEndLocation&&sr.uniform1f(this.fogEndLocation,Wt.fogEnd),this.fogScaleLocation&&sr.uniform1f(this.fogScaleLocation,1/(Wt.fogEnd-Wt.fogStart)),this.fogDensityLocation&&sr.uniform1f(this.fogDensityLocation,Wt.fogDensity))},cleanup:function(){if(sr.disableVertexAttribArray(this.positionLocation),this.hasTextures)for(var e=0;e<Kt.MAX_TEXTURES;e++)Kt.enabledClientAttributes[Kt.TEXTURE0+e]&&this.texCoordLocations[e]>=0&&sr.disableVertexAttribArray(this.texCoordLocations[e]);this.hasColor&&sr.disableVertexAttribArray(this.colorLocation),this.hasNormal&&sr.disableVertexAttribArray(this.normalLocation),bt.currProgram||(sr.useProgram(null),Kt.fixedFunctionProgram=0),bt.currArrayBuffer||(sr.bindBuffer(sr.ARRAY_BUFFER,null),Kt.lastArrayBuffer=null),Kt.matricesModified=!0}};return i.init(),i},setupFuncs:function(){Kt.MapTreeLib=Kt.spawnMapTreeLib(),Kt.spawnMapTreeLib=null,Kt.TexEnvJIT=Kt.spawnTexEnvJIT(),Kt.spawnTexEnvJIT=null,Kt.setupHooks()},setupHooks:function(){Wt.hasRunInit||Wt.init();var e=Vt;Vt=function(t){Kt.TexEnvJIT.hook_activeTexture(t),e(t)};var t=_t;_t=function(e){Kt.TexEnvJIT.hook_enable(e),t(e)};var r=Tt;Tt=function(e){Kt.TexEnvJIT.hook_disable(e),r(e)};0;0;0;var n=Mt;Mt=function(e,t){if(35725===e&&sr.getParameter(sr.CURRENT_PROGRAM)==Kt.fixedFunctionProgram)return void(Q[t>>2]=0);n(e,t)}},initted:!1,init:function(){if(_("WARNING: using emscripten GL immediate mode emulation. This is very limited in what it supports"),Kt.initted=!0,o.useWebGL){Kt.MAX_TEXTURES=o.GL_MAX_TEXTURE_IMAGE_UNITS||sr.getParameter(sr.MAX_TEXTURE_IMAGE_UNITS),Kt.TexEnvJIT.init(sr,Kt.MAX_TEXTURES),Kt.NUM_ATTRIBUTES=3+Kt.MAX_TEXTURES,Kt.clientAttributes=[],Wt.enabledClientAttribIndices=[];for(var e=0;e<Kt.NUM_ATTRIBUTES;e++)Kt.clientAttributes.push({}),Wt.enabledClientAttribIndices.push(!1);Kt.matrix=[],Kt.matrixStack=[],Kt.matrixVersion=[];for(e=0;e<2+Kt.MAX_TEXTURES;e++)Kt.matrixStack.push([]),Kt.matrixVersion.push(0),Kt.matrix.push(Kt.matrixLib.mat4.create()),Kt.matrixLib.mat4.identity(Kt.matrix[e]);Kt.rendererCache=Kt.MapTreeLib.create(),Kt.tempData=new Float32Array(bt.MAX_TEMP_BUFFER_SIZE>>2),Kt.indexData=new Uint16Array(bt.MAX_TEMP_BUFFER_SIZE>>1),Kt.vertexDataU8=new Uint8Array(Kt.tempData.buffer),bt.generateTempBuffers(!0,bt.currentContext),Kt.clientColor=new Float32Array([1,1,1,1])}},prepareClientAttributes:function(e,t){if(Kt.modifiedClientAttributes){Kt.modifiedClientAttributes=!1;var r=2147483647,n=0,o=2147483647,i=0,a=Kt.liveClientAttributes;a.length=0;for(var s=0;s<3+Kt.MAX_TEXTURES;s++)if(Kt.enabledClientAttributes[s]){var u=Kt.clientAttributes[s];a.push(u),r=Math.min(r,u.pointer),u.sizeBytes=u.size*bt.byteSizeByType[u.type-bt.byteSizeByTypeRoot],n+=u.sizeBytes,o=Math.min(o,u.stride),i=Math.max(i,u.stride)}if((o!=i||i<n)&&!t){Kt.restrideBuffer||(Kt.restrideBuffer=Rr(bt.MAX_TEMP_BUFFER_SIZE));var c=Kt.restrideBuffer;n=0;for(s=0;s<a.length;s++){var l=(u=a[s]).sizeBytes;l%4!=0&&(l+=4-l%4),u.offset=n,n+=l}for(s=0;s<a.length;s++){u=a[s];var d=Math.max(u.sizeBytes,u.stride);if(3&d||3&u.sizeBytes)for(p=0;p<e;p++)for(h=0;h<u.sizeBytes;h++)Y[c+u.offset+n*p+h]=Y[u.pointer+p*d+h];else for(var f=u.sizeBytes>>2,m=Math.max(u.sizeBytes,u.stride)>>2,p=0;p<e;p++)for(var h=0;h<f;h++)Q[(c+u.offset+n*p>>2)+h]=Q[(u.pointer>>2)+p*m+h];u.pointer=c+u.offset}Kt.stride=n,Kt.vertexPointer=c}else{bt.currArrayBuffer?Kt.vertexPointer=0:Kt.vertexPointer=r;for(s=0;s<a.length;s++){(u=a[s]).offset=u.pointer-Kt.vertexPointer}Kt.stride=Math.max(i,n)}t||(Kt.vertexCounter=Kt.stride*e/4)}else Kt.vertexCounter=Kt.stride*e/4},flush:function(e,t,r){F(e>=0||!e),t=t||0,r=r||0;var n=Kt.getRenderer(),o=4*Kt.vertexCounter/Kt.stride;if(o){F(o%1==0,"`numVertexes` must be an integer.");var i=!1,a=0;if(e){if(a=e,!bt.currArrayBuffer&&Kt.firstVertex>Kt.lastVertex){F(!bt.currElementArrayBuffer);for(var s=0;s<e;s++){var u=K[r+2*s>>1];Kt.firstVertex=Math.min(Kt.firstVertex,u),Kt.lastVertex=Math.max(Kt.lastVertex,u+1)}}if(!bt.currElementArrayBuffer){F(e<<1<=bt.MAX_TEMP_BUFFER_SIZE,"too many immediate mode indexes (a)");var c=bt.getTempIndexBuffer(e<<1);sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,c),sr.bufferSubData(sr.ELEMENT_ARRAY_BUFFER,0,K.subarray(r>>1,r+(e<<1)>>1)),r=0,i=!0}}else if(Kt.mode>6){if(7!=Kt.mode)throw"unsupported immediate mode "+Kt.mode;F(Kt.firstVertex%4==0),F((r=3*Kt.firstVertex)+((a=6*(o/4))<<1)<=bt.MAX_TEMP_BUFFER_SIZE,"too many immediate mode indexes (b)"),sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,bt.currentContext.tempQuadIndexBuffer),i=!0}n.prepare(),a?sr.drawElements(sr.TRIANGLES,a,sr.UNSIGNED_SHORT,r):sr.drawArrays(Kt.mode,t,o),i&&sr.bindBuffer(sr.ELEMENT_ARRAY_BUFFER,bt.buffers[bt.currElementArrayBuffer]||null),n.cleanup()}}};Kt.matrixLib=(zt={},Gt={},Ht={},Yt={},qt=Float32Array,zt.create=function(e){var t=new qt(3);return e?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):t[0]=t[1]=t[2]=0,t},zt.set=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},zt.add=function(e,t,r){return r&&e!==r?(r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r):(e[0]+=t[0],e[1]+=t[1],e[2]+=t[2],e)},zt.subtract=function(e,t,r){return r&&e!==r?(r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r):(e[0]-=t[0],e[1]-=t[1],e[2]-=t[2],e)},zt.multiply=function(e,t,r){return r&&e!==r?(r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r):(e[0]*=t[0],e[1]*=t[1],e[2]*=t[2],e)},zt.negate=function(e,t){return t||(t=e),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},zt.scale=function(e,t,r){return r&&e!==r?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r):(e[0]*=t,e[1]*=t,e[2]*=t,e)},zt.normalize=function(e,t){t||(t=e);var r=e[0],n=e[1],o=e[2],i=Math.sqrt(r*r+n*n+o*o);return i?1===i?(t[0]=r,t[1]=n,t[2]=o,t):(i=1/i,t[0]=r*i,t[1]=n*i,t[2]=o*i,t):(t[0]=0,t[1]=0,t[2]=0,t)},zt.cross=function(e,t,r){r||(r=e);var n=e[0],o=e[1],i=e[2],a=t[0],s=t[1],u=t[2];return r[0]=o*u-i*s,r[1]=i*a-n*u,r[2]=n*s-o*a,r},zt.length=function(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)},zt.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},zt.direction=function(e,t,r){r||(r=e);var n=e[0]-t[0],o=e[1]-t[1],i=e[2]-t[2],a=Math.sqrt(n*n+o*o+i*i);return a?(a=1/a,r[0]=n*a,r[1]=o*a,r[2]=i*a,r):(r[0]=0,r[1]=0,r[2]=0,r)},zt.lerp=function(e,t,r,n){return n||(n=e),n[0]=e[0]+r*(t[0]-e[0]),n[1]=e[1]+r*(t[1]-e[1]),n[2]=e[2]+r*(t[2]-e[2]),n},zt.dist=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],o=t[2]-e[2];return Math.sqrt(r*r+n*n+o*o)},zt.unproject=function(e,t,r,n,o){o||(o=e);var i=Ht.create(),a=new qt(4);return a[0]=2*(e[0]-n[0])/n[2]-1,a[1]=2*(e[1]-n[1])/n[3]-1,a[2]=2*e[2]-1,a[3]=1,Ht.multiply(r,t,i),Ht.inverse(i)?(Ht.multiplyVec4(i,a),0===a[3]?null:(o[0]=a[0]/a[3],o[1]=a[1]/a[3],o[2]=a[2]/a[3],o)):null},zt.str=function(e){return"["+e[0]+", "+e[1]+", "+e[2]+"]"},Gt.create=function(e){var t=new qt(9);return e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]),t},Gt.set=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},Gt.identity=function(e){return e||(e=Gt.create()),e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},Gt.transpose=function(e,t){if(!t||e===t){var r=e[1],n=e[2],o=e[5];return e[1]=e[3],e[2]=e[6],e[3]=r,e[5]=e[7],e[6]=n,e[7]=o,e}return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t},Gt.toMat4=function(e,t){return t||(t=Ht.create()),t[15]=1,t[14]=0,t[13]=0,t[12]=0,t[11]=0,t[10]=e[8],t[9]=e[7],t[8]=e[6],t[7]=0,t[6]=e[5],t[5]=e[4],t[4]=e[3],t[3]=0,t[2]=e[2],t[1]=e[1],t[0]=e[0],t},Gt.str=function(e){return"["+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+"]"},Ht.create=function(e){var t=new qt(16);return e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t},Ht.set=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},Ht.identity=function(e){return e||(e=Ht.create()),e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},Ht.transpose=function(e,t){if(!t||e===t){var r=e[1],n=e[2],o=e[3],i=e[6],a=e[7],s=e[11];return e[1]=e[4],e[2]=e[8],e[3]=e[12],e[4]=r,e[6]=e[9],e[7]=e[13],e[8]=n,e[9]=i,e[11]=e[14],e[12]=o,e[13]=a,e[14]=s,e}return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t},Ht.determinant=function(e){var t=e[0],r=e[1],n=e[2],o=e[3],i=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],d=e[10],f=e[11],m=e[12],p=e[13],h=e[14],v=e[15];return m*l*s*o-c*p*s*o-m*a*d*o+i*p*d*o+c*a*h*o-i*l*h*o-m*l*n*u+c*p*n*u+m*r*d*u-t*p*d*u-c*r*h*u+t*l*h*u+m*a*n*f-i*p*n*f-m*r*s*f+t*p*s*f+i*r*h*f-t*a*h*f-c*a*n*v+i*l*n*v+c*r*s*v-t*l*s*v-i*r*d*v+t*a*d*v},Ht.inverse=function(e,t){t||(t=e);var r,n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=e[9],m=e[10],p=e[11],h=e[12],v=e[13],E=e[14],g=e[15],y=n*u-o*s,w=n*c-i*s,b=n*l-a*s,_=o*c-i*u,T=o*l-a*u,x=i*l-a*c,A=d*v-f*h,M=d*E-m*h,S=d*g-p*h,O=f*E-m*v,R=f*g-p*v,D=m*g-p*E,k=y*D-w*R+b*O+_*S-T*M+x*A;return k?(r=1/k,t[0]=(u*D-c*R+l*O)*r,t[1]=(-o*D+i*R-a*O)*r,t[2]=(v*x-E*T+g*_)*r,t[3]=(-f*x+m*T-p*_)*r,t[4]=(-s*D+c*S-l*M)*r,t[5]=(n*D-i*S+a*M)*r,t[6]=(-h*x+E*b-g*w)*r,t[7]=(d*x-m*b+p*w)*r,t[8]=(s*R-u*S+l*A)*r,t[9]=(-n*R+o*S-a*A)*r,t[10]=(h*T-v*b+g*y)*r,t[11]=(-d*T+f*b-p*y)*r,t[12]=(-s*O+u*M-c*A)*r,t[13]=(n*O-o*M+i*A)*r,t[14]=(-h*_+v*w-E*y)*r,t[15]=(d*_-f*w+m*y)*r,t):null},Ht.toRotationMat=function(e,t){return t||(t=Ht.create()),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},Ht.toMat3=function(e,t){return t||(t=Gt.create()),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},Ht.toInverseMat3=function(e,t){var r,n=e[0],o=e[1],i=e[2],a=e[4],s=e[5],u=e[6],c=e[8],l=e[9],d=e[10],f=d*s-u*l,m=-d*a+u*c,p=l*a-s*c,h=n*f+o*m+i*p;return h?(r=1/h,t||(t=Gt.create()),t[0]=f*r,t[1]=(-d*o+i*l)*r,t[2]=(u*o-i*s)*r,t[3]=m*r,t[4]=(d*n-i*c)*r,t[5]=(-u*n+i*a)*r,t[6]=p*r,t[7]=(-l*n+o*c)*r,t[8]=(s*n-o*a)*r,t):null},Ht.multiply=function(e,t,r){r||(r=e);var n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=e[9],m=e[10],p=e[11],h=e[12],v=e[13],E=e[14],g=e[15],y=t[0],w=t[1],b=t[2],_=t[3],T=t[4],x=t[5],A=t[6],M=t[7],S=t[8],O=t[9],R=t[10],D=t[11],k=t[12],L=t[13],F=t[14],C=t[15];return r[0]=y*n+w*s+b*d+_*h,r[1]=y*o+w*u+b*f+_*v,r[2]=y*i+w*c+b*m+_*E,r[3]=y*a+w*l+b*p+_*g,r[4]=T*n+x*s+A*d+M*h,r[5]=T*o+x*u+A*f+M*v,r[6]=T*i+x*c+A*m+M*E,r[7]=T*a+x*l+A*p+M*g,r[8]=S*n+O*s+R*d+D*h,r[9]=S*o+O*u+R*f+D*v,r[10]=S*i+O*c+R*m+D*E,r[11]=S*a+O*l+R*p+D*g,r[12]=k*n+L*s+F*d+C*h,r[13]=k*o+L*u+F*f+C*v,r[14]=k*i+L*c+F*m+C*E,r[15]=k*a+L*l+F*p+C*g,r},Ht.multiplyVec3=function(e,t,r){r||(r=t);var n=t[0],o=t[1],i=t[2];return r[0]=e[0]*n+e[4]*o+e[8]*i+e[12],r[1]=e[1]*n+e[5]*o+e[9]*i+e[13],r[2]=e[2]*n+e[6]*o+e[10]*i+e[14],r},Ht.multiplyVec4=function(e,t,r){r||(r=t);var n=t[0],o=t[1],i=t[2],a=t[3];return r[0]=e[0]*n+e[4]*o+e[8]*i+e[12]*a,r[1]=e[1]*n+e[5]*o+e[9]*i+e[13]*a,r[2]=e[2]*n+e[6]*o+e[10]*i+e[14]*a,r[3]=e[3]*n+e[7]*o+e[11]*i+e[15]*a,r},Ht.translate=function(e,t,r){var n,o,i,a,s,u,c,l,d,f,m,p,h=t[0],v=t[1],E=t[2];return r&&e!==r?(n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=e[9],m=e[10],p=e[11],r[0]=n,r[1]=o,r[2]=i,r[3]=a,r[4]=s,r[5]=u,r[6]=c,r[7]=l,r[8]=d,r[9]=f,r[10]=m,r[11]=p,r[12]=n*h+s*v+d*E+e[12],r[13]=o*h+u*v+f*E+e[13],r[14]=i*h+c*v+m*E+e[14],r[15]=a*h+l*v+p*E+e[15],r):(e[12]=e[0]*h+e[4]*v+e[8]*E+e[12],e[13]=e[1]*h+e[5]*v+e[9]*E+e[13],e[14]=e[2]*h+e[6]*v+e[10]*E+e[14],e[15]=e[3]*h+e[7]*v+e[11]*E+e[15],e)},Ht.scale=function(e,t,r){var n=t[0],o=t[1],i=t[2];return r&&e!==r?(r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*o,r[7]=e[7]*o,r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11]*i,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r):(e[0]*=n,e[1]*=n,e[2]*=n,e[3]*=n,e[4]*=o,e[5]*=o,e[6]*=o,e[7]*=o,e[8]*=i,e[9]*=i,e[10]*=i,e[11]*=i,e)},Ht.rotate=function(e,t,r,n){var o,i,a,s,u,c,l,d,f,m,p,h,v,E,g,y,w,b,_,T,x,A,M,S,O=r[0],R=r[1],D=r[2],k=Math.sqrt(O*O+R*R+D*D);return k?(1!==k&&(O*=k=1/k,R*=k,D*=k),o=Math.sin(t),a=1-(i=Math.cos(t)),s=e[0],u=e[1],c=e[2],l=e[3],d=e[4],f=e[5],m=e[6],p=e[7],h=e[8],v=e[9],E=e[10],g=e[11],y=O*O*a+i,w=R*O*a+D*o,b=D*O*a-R*o,_=O*R*a-D*o,T=R*R*a+i,x=D*R*a+O*o,A=O*D*a+R*o,M=R*D*a-O*o,S=D*D*a+i,n?e!==n&&(n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]):n=e,n[0]=s*y+d*w+h*b,n[1]=u*y+f*w+v*b,n[2]=c*y+m*w+E*b,n[3]=l*y+p*w+g*b,n[4]=s*_+d*T+h*x,n[5]=u*_+f*T+v*x,n[6]=c*_+m*T+E*x,n[7]=l*_+p*T+g*x,n[8]=s*A+d*M+h*S,n[9]=u*A+f*M+v*S,n[10]=c*A+m*M+E*S,n[11]=l*A+p*M+g*S,n):null},Ht.rotateX=function(e,t,r){var n=Math.sin(t),o=Math.cos(t),i=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],d=e[10],f=e[11];return r?e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]):r=e,r[4]=i*o+c*n,r[5]=a*o+l*n,r[6]=s*o+d*n,r[7]=u*o+f*n,r[8]=i*-n+c*o,r[9]=a*-n+l*o,r[10]=s*-n+d*o,r[11]=u*-n+f*o,r},Ht.rotateY=function(e,t,r){var n=Math.sin(t),o=Math.cos(t),i=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],d=e[10],f=e[11];return r?e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]):r=e,r[0]=i*o+c*-n,r[1]=a*o+l*-n,r[2]=s*o+d*-n,r[3]=u*o+f*-n,r[8]=i*n+c*o,r[9]=a*n+l*o,r[10]=s*n+d*o,r[11]=u*n+f*o,r},Ht.rotateZ=function(e,t,r){var n=Math.sin(t),o=Math.cos(t),i=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],d=e[6],f=e[7];return r?e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]):r=e,r[0]=i*o+c*n,r[1]=a*o+l*n,r[2]=s*o+d*n,r[3]=u*o+f*n,r[4]=i*-n+c*o,r[5]=a*-n+l*o,r[6]=s*-n+d*o,r[7]=u*-n+f*o,r},Ht.frustum=function(e,t,r,n,o,i,a){a||(a=Ht.create());var s=t-e,u=n-r,c=i-o;return a[0]=2*o/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*o/u,a[6]=0,a[7]=0,a[8]=(t+e)/s,a[9]=(n+r)/u,a[10]=-(i+o)/c,a[11]=-1,a[12]=0,a[13]=0,a[14]=-i*o*2/c,a[15]=0,a},Ht.perspective=function(e,t,r,n,o){var i=r*Math.tan(e*Math.PI/360),a=i*t;return Ht.frustum(-a,a,-i,i,r,n,o)},Ht.ortho=function(e,t,r,n,o,i,a){a||(a=Ht.create());var s=t-e,u=n-r,c=i-o;return a[0]=2/s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2/u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=-2/c,a[11]=0,a[12]=-(e+t)/s,a[13]=-(n+r)/u,a[14]=-(i+o)/c,a[15]=1,a},Ht.lookAt=function(e,t,r,n){n||(n=Ht.create());var o,i,a,s,u,c,l,d,f,m,p=e[0],h=e[1],v=e[2],E=r[0],g=r[1],y=r[2],w=t[0],b=t[1],_=t[2];return p===w&&h===b&&v===_?Ht.identity(n):(l=p-w,d=h-b,f=v-_,o=g*(f*=m=1/Math.sqrt(l*l+d*d+f*f))-y*(d*=m),i=y*(l*=m)-E*f,a=E*d-g*l,(m=Math.sqrt(o*o+i*i+a*a))?(o*=m=1/m,i*=m,a*=m):(o=0,i=0,a=0),s=d*a-f*i,u=f*o-l*a,c=l*i-d*o,(m=Math.sqrt(s*s+u*u+c*c))?(s*=m=1/m,u*=m,c*=m):(s=0,u=0,c=0),n[0]=o,n[1]=s,n[2]=l,n[3]=0,n[4]=i,n[5]=u,n[6]=d,n[7]=0,n[8]=a,n[9]=c,n[10]=f,n[11]=0,n[12]=-(o*p+i*h+a*v),n[13]=-(s*p+u*h+c*v),n[14]=-(l*p+d*h+f*v),n[15]=1,n)},Ht.fromRotationTranslation=function(e,t,r){r||(r=Ht.create());var n=e[0],o=e[1],i=e[2],a=e[3],s=n+n,u=o+o,c=i+i,l=n*s,d=n*u,f=n*c,m=o*u,p=o*c,h=i*c,v=a*s,E=a*u,g=a*c;return r[0]=1-(m+h),r[1]=d+g,r[2]=f-E,r[3]=0,r[4]=d-g,r[5]=1-(l+h),r[6]=p+v,r[7]=0,r[8]=f+E,r[9]=p-v,r[10]=1-(l+m),r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r},Ht.str=function(e){return"["+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+"]"},Yt.create=function(e){var t=new qt(4);return e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]),t},Yt.set=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Yt.calculateW=function(e,t){var r=e[0],n=e[1],o=e[2];return t&&e!==t?(t[0]=r,t[1]=n,t[2]=o,t[3]=-Math.sqrt(Math.abs(1-r*r-n*n-o*o)),t):(e[3]=-Math.sqrt(Math.abs(1-r*r-n*n-o*o)),e)},Yt.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},Yt.inverse=function(e,t){var r=e[0],n=e[1],o=e[2],i=e[3],a=r*r+n*n+o*o+i*i,s=a?1/a:0;return t&&e!==t?(t[0]=-e[0]*s,t[1]=-e[1]*s,t[2]=-e[2]*s,t[3]=e[3]*s,t):(e[0]*=-s,e[1]*=-s,e[2]*=-s,e[3]*=s,e)},Yt.conjugate=function(e,t){return t&&e!==t?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t):(e[0]*=-1,e[1]*=-1,e[2]*=-1,e)},Yt.length=function(e){var t=e[0],r=e[1],n=e[2],o=e[3];return Math.sqrt(t*t+r*r+n*n+o*o)},Yt.normalize=function(e,t){t||(t=e);var r=e[0],n=e[1],o=e[2],i=e[3],a=Math.sqrt(r*r+n*n+o*o+i*i);return 0===a?(t[0]=0,t[1]=0,t[2]=0,t[3]=0,t):(a=1/a,t[0]=r*a,t[1]=n*a,t[2]=o*a,t[3]=i*a,t)},Yt.add=function(e,t,r){return r&&e!==r?(r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r):(e[0]+=t[0],e[1]+=t[1],e[2]+=t[2],e[3]+=t[3],e)},Yt.multiply=function(e,t,r){r||(r=e);var n=e[0],o=e[1],i=e[2],a=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return r[0]=n*l+a*s+o*c-i*u,r[1]=o*l+a*u+i*s-n*c,r[2]=i*l+a*c+n*u-o*s,r[3]=a*l-n*s-o*u-i*c,r},Yt.multiplyVec3=function(e,t,r){r||(r=t);var n=t[0],o=t[1],i=t[2],a=e[0],s=e[1],u=e[2],c=e[3],l=c*n+s*i-u*o,d=c*o+u*n-a*i,f=c*i+a*o-s*n,m=-a*n-s*o-u*i;return r[0]=l*c+m*-a+d*-u-f*-s,r[1]=d*c+m*-s+f*-a-l*-u,r[2]=f*c+m*-u+l*-s-d*-a,r},Yt.scale=function(e,t,r){return r&&e!==r?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r):(e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e)},Yt.toMat3=function(e,t){t||(t=Gt.create());var r=e[0],n=e[1],o=e[2],i=e[3],a=r+r,s=n+n,u=o+o,c=r*a,l=r*s,d=r*u,f=n*s,m=n*u,p=o*u,h=i*a,v=i*s,E=i*u;return t[0]=1-(f+p),t[1]=l+E,t[2]=d-v,t[3]=l-E,t[4]=1-(c+p),t[5]=m+h,t[6]=d+v,t[7]=m-h,t[8]=1-(c+f),t},Yt.toMat4=function(e,t){t||(t=Ht.create());var r=e[0],n=e[1],o=e[2],i=e[3],a=r+r,s=n+n,u=o+o,c=r*a,l=r*s,d=r*u,f=n*s,m=n*u,p=o*u,h=i*a,v=i*s,E=i*u;return t[0]=1-(f+p),t[1]=l+E,t[2]=d-v,t[3]=0,t[4]=l-E,t[5]=1-(c+p),t[6]=m+h,t[7]=0,t[8]=d+v,t[9]=m-h,t[10]=1-(c+f),t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},Yt.slerp=function(e,t,r,n){n||(n=e);var o,i,a,s,u=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3];return Math.abs(u)>=1?(n!==e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]),n):(o=Math.acos(u),i=Math.sqrt(1-u*u),Math.abs(i)<.001?(n[0]=.5*e[0]+.5*t[0],n[1]=.5*e[1]+.5*t[1],n[2]=.5*e[2]+.5*t[2],n[3]=.5*e[3]+.5*t[3],n):(a=Math.sin((1-r)*o)/i,s=Math.sin(r*o)/i,n[0]=e[0]*a+t[0]*s,n[1]=e[1]*a+t[1]*s,n[2]=e[2]*a+t[2]*s,n[3]=e[3]*a+t[3]*s,n))},Yt.str=function(e){return"["+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+"]"},{vec3:zt,mat3:Gt,mat4:Ht,quat4:Yt});var Qt=ye;var Jt=we;function Zt(){var e=Zt;return e.LLVM_SAVEDSTACKS||(e.LLVM_SAVEDSTACKS=[]),e.LLVM_SAVEDSTACKS.push(Pr()),e.LLVM_SAVEDSTACKS.length-1}var $t=Ae;j("GMT",5313872,4);function er(){if(!er.called){er.called=!0,Q[Ar()>>2]=60*(new Date).getTimezoneOffset();var e=new Date(2e3,0,1),t=new Date(2e3,6,1);Q[Tr()>>2]=Number(e.getTimezoneOffset()!=t.getTimezoneOffset());var r=a(e),n=a(t),o=N(vr(r),"i8",0),i=N(vr(n),"i8",0);t.getTimezoneOffset()<e.getTimezoneOffset()?(Q[Mr()>>2]=o,Q[Mr()+4>>2]=i):(Q[Mr()>>2]=i,Q[Mr()+4>>2]=o)}function a(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}}function tr(e,t){er();var r=new Date(1e3*Q[e>>2]);Q[t>>2]=r.getSeconds(),Q[t+4>>2]=r.getMinutes(),Q[t+8>>2]=r.getHours(),Q[t+12>>2]=r.getDate(),Q[t+16>>2]=r.getMonth(),Q[t+20>>2]=r.getFullYear()-1900,Q[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),o=(r.getTime()-n.getTime())/864e5|0;Q[t+28>>2]=o,Q[t+36>>2]=-60*r.getTimezoneOffset();var i=new Date(2e3,6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));Q[t+32>>2]=s;var u=Q[Mr()+(s?4:0)>>2];return Q[t+40>>2]=u,t}function rr(e){var t=e/1e3;if((s||u)&&self.performance&&self.performance.now)for(var r=self.performance.now();self.performance.now()-r<t;);else for(r=Date.now();Date.now()-r<t;);return 0}function nr(e){nn("Cannot enlarge memory arrays to size "+e+" bytes (OOM). Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+Y.length+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}var or=be;function ir(e){return e%4==0&&(e%100!=0||e%400==0)}function ar(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}var sr,ur=[31,29,31,30,31,30,31,31,30,31,30,31],cr=[31,28,31,30,31,30,31,31,30,31,30,31];function lr(e,t){for(var r=new Date(e.getTime());t>0;){var n=ir(r.getFullYear()),o=r.getMonth(),i=(n?ur:cr)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function dr(e,t,r,n){var o=Q[n+40>>2],i={tm_sec:Q[n>>2],tm_min:Q[n+4>>2],tm_hour:Q[n+8>>2],tm_mday:Q[n+12>>2],tm_mon:Q[n+16>>2],tm_year:Q[n+20>>2],tm_wday:Q[n+24>>2],tm_yday:Q[n+28>>2],tm_isdst:Q[n+32>>2],tm_gmtoff:Q[n+36>>2],tm_zone:o?B(o):""},a=B(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return d(e,t,"0")}function m(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function h(e){var t=lr(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=p(r),i=p(n);return m(o,t)<=0?m(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var v={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return f((e.tm_year+1900)/100|0,2)},"%d":function(e){return f(e.tm_mday,2)},"%e":function(e){return d(e.tm_mday,2," ")},"%g":function(e){return h(e).toString().substring(2)},"%G":function(e){return h(e)},"%H":function(e){return f(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":function(e){return f(e.tm_mday+ar(ir(e.tm_year+1900)?ur:cr,e.tm_mon-1),3)},"%m":function(e){return f(e.tm_mon+1,2)},"%M":function(e){return f(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return f(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),r=0===t.getDay()?t:lr(t,7-t.getDay()),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(r,n)<0){var o=ar(ir(n.getFullYear())?ur:cr,n.getMonth()-1)-31,i=31-r.getDate()+o+n.getDate();return f(Math.ceil(i/7),2)}return 0===m(r,t)?"01":"00"},"%V":function(e){var t,r=new Date(e.tm_year+1900,0,4),n=new Date(e.tm_year+1901,0,4),o=p(r),i=p(n),a=lr(new Date(e.tm_year+1900,0,1),e.tm_yday);return m(a,o)<0?"53":m(i,a)<=0?"01":(t=o.getFullYear()<e.tm_year+1900?e.tm_yday+32-o.getDate():e.tm_yday+1-o.getDate(),f(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),r=1===t.getDay()?t:lr(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(r,n)<0){var o=ar(ir(n.getFullYear())?ur:cr,n.getMonth()-1)-31,i=31-r.getDate()+o+n.getDate();return f(Math.ceil(i/7),2)}return 0===m(r,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in v)a.indexOf(u)>=0&&(a=a.replace(new RegExp(u,"g"),v[u](i)));var E=vr(a,!1);return E.length>t?0:(z(E,e),E.length-1)}function fr(e){return Ge(10),-1}if(et.staticInit(),l){var mr=r(8952),pr=r(9942);Qe.staticInit()}o.requestFullScreen=function(e,t,r){_("Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead."),o.requestFullScreen=o.requestFullscreen,nt.requestFullScreen(e,t,r)},o.requestFullscreen=function(e,t,r){nt.requestFullscreen(e,t,r)},o.requestAnimationFrame=function(e){nt.requestAnimationFrame(e)},o.setCanvasSize=function(e,t,r){nt.setCanvasSize(e,t,r)},o.pauseMainLoop=function(){nt.mainLoop.pause()},o.resumeMainLoop=function(){nt.mainLoop.resume()},o.getUserMedia=function(){nt.getUserMedia()},o.createContext=function(e,t,r,n){return nt.createContext(e,t,r,n)},rt=c?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:"object"==typeof performance&&performance&&"function"==typeof performance.now?function(){return performance.now()}:Date.now,Kt.setupFuncs(),nt.moduleContextCreatedCallbacks.push(function(){Kt.init()}),bt.init(),Wt.init();var hr=!0;function vr(e,t,r){var n=r>0?r:V(e)+1,o=new Array(n),i=X(e,o,0,o.length);return t&&(o.length=i),o}function Er(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];n>255&&(hr&&F(!1,"Character code "+n+" ("+String.fromCharCode(n)+") at offset "+r+" not in 0x00-0xFF."),n&=255),t.push(String.fromCharCode(n))}return t.join("")}var gr="function"==typeof atob?atob:function(e){var t,r,n,o,i,a,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",c=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=s.indexOf(e.charAt(c++))<<2|(o=s.indexOf(e.charAt(c++)))>>4,r=(15&o)<<4|(i=s.indexOf(e.charAt(c++)))>>2,n=(3&i)<<6|(a=s.indexOf(e.charAt(c++))),u+=String.fromCharCode(t),64!==i&&(u+=String.fromCharCode(r)),64!==a&&(u+=String.fromCharCode(n))}while(c<e.length);return u};function yr(e){if(Ce(e))return function(e){if("boolean"==typeof c&&c){var t;try{t=Buffer.from(e,"base64")}catch(r){t=new Buffer(e,"base64")}return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}try{for(var r=gr(e),n=new Uint8Array(r.length),o=0;o<r.length;++o)n[o]=r.charCodeAt(o);return n}catch(e){throw new Error("Converting base64 string to bytes failed.")}}(e.slice(Fe.length))}var wr={f:D,d:function(){return R},b:function(e){nn("Stack overflow! Attempted to allocate "+e+" bytes on the stack, but stack has only "+(te-Pr()+e)+" bytes available!")},kb:function(e){se(e,"dd")},$a:function(e){se(e,"ddd")},Qa:function(e){se(e,"di")},Ga:function(e){se(e,"did")},Hd:function(e){se(e,"i")},Dd:function(e){se(e,"ii")},xd:function(e){se(e,"iidi")},rd:function(e){se(e,"iidiiii")},hd:function(e){se(e,"iii")},ad:function(e){se(e,"iiii")},Vc:function(e){se(e,"iiiid")},Rc:function(e){se(e,"iiiii")},Ic:function(e){se(e,"iiiiid")},Dc:function(e){se(e,"iiiiii")},xc:function(e){se(e,"iiiiiid")},rc:function(e){se(e,"iiiiiii")},lc:function(e){se(e,"iiiiiiii")},gc:function(e){se(e,"iiiiiiiii")},$b:function(e){se(e,"iiiiiiiiii")},Vb:function(e){se(e,"iiiiiiiiiii")},Sb:function(e){se(e,"iiiiiiiiiiii")},Rb:function(e){se(e,"iiiiiiiiiiiii")},Qb:function(e){se(e,"iiiiiiiiiiiiii")},Pb:function(e){se(e,"iiiiiiiiiiiiiii")},Ob:function(e){se(e,"iiiiiiiiiiiiiiii")},Nb:function(e){se(e,"iiiiiiiiiiiiiiiii")},Mb:function(e){se(e,"iiiiiiiiiiiiiiiiii")},Lb:function(e){se(e,"iiiiiiiiiiiiiiiiiii")},Kb:function(e){se(e,"iiiiiiiiiiiiiiiiiiii")},Jb:function(e){se(e,"iiiiiiiiiiiiiiiiiiiii")},Ib:function(e){se(e,"iiiiij")},Hb:function(e){se(e,"iiiij")},Gb:function(e){se(e,"iiiijj")},Fb:function(e){se(e,"iiiji")},Eb:function(e){se(e,"iiijj")},Db:function(e){se(e,"iiji")},Cb:function(e){se(e,"iijijji")},Bb:function(e){se(e,"iijijjji")},Ab:function(e){se(e,"jii")},zb:function(e){se(e,"jiii")},yb:function(e){se(e,"jiiii")},xb:function(e){se(e,"jiiiii")},wb:function(e){se(e,"jiij")},vb:function(e){se(e,"jij")},ub:function(e){se(e,"jiji")},tb:function(e){se(e,"jijii")},sb:function(e){se(e,"jijiii")},rb:function(e){se(e,"jijiiii")},qb:function(e){se(e,"jijiiiii")},pb:function(e){se(e,"jijij")},ob:function(e){se(e,"jijj")},nb:function(e){se(e,"jijji")},mb:function(e){se(e,"jijjiii")},lb:function(e){se(e,"v")},jb:function(e){se(e,"vi")},ib:function(e){se(e,"vid")},hb:function(e){se(e,"vidddiii")},gb:function(e){se(e,"vidi")},fb:function(e){se(e,"vii")},eb:function(e){se(e,"viid")},db:function(e){se(e,"viii")},cb:function(e){se(e,"viiidd")},bb:function(e){se(e,"viiii")},ab:function(e){se(e,"viiiii")},_a:function(e){se(e,"viiiiii")},Za:function(e){se(e,"viiiiiii")},Ya:function(e){se(e,"viiiiiiii")},Xa:function(e){se(e,"viiiiiiiii")},Wa:function(e){se(e,"viiiiiiiiii")},Va:function(e){se(e,"viiiiiiiiiii")},Ua:function(e){se(e,"viiiiiiiiiiii")},Ta:function(e){se(e,"viiiiiiiiiiiii")},Sa:function(e){se(e,"viiiiiiiiiiiiii")},Ra:function(e){se(e,"viiiiiiiiiiiiiii")},Pa:function(e){se(e,"viiiiiiiiiiiiiiii")},Oa:function(e){se(e,"viiiiiiiiiiiiiiiii")},Na:function(e){se(e,"viiiiiiiiiiiiiiiiii")},Ma:function(e){se(e,"viiiiiiiiiiiiiiiiiii")},La:function(e){se(e,"viiiiiiiiiiiiiiiiiiii")},Ka:function(e){se(e,"viijii")},Ja:function(e){se(e,"vij")},Ia:function(e){se(e,"viji")},Ha:function(e){se(e,"vijjii")},H:function(e,t){var r=Pr();try{return Ir(e,t)}catch(e){if(Nr(r),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},X:function(e,t){var r=Pr();try{return Ur(e,t)}catch(e){if(Nr(r),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},y:function(e){var t=Pr();try{return Br(e)}catch(e){if(Nr(t),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},k:function(e,t){var r=Pr();try{return Xr(e,t)}catch(e){if(Nr(r),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},Fa:function(e,t,r,n){var o=Pr();try{return jr(e,t,r,n)}catch(e){if(Nr(o),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},i:function(e,t,r){var n=Pr();try{return Vr(e,t,r)}catch(e){if(Nr(n),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},r:function(e,t,r,n){var o=Pr();try{return zr(e,t,r,n)}catch(e){if(Nr(o),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},N:function(e,t,r,n,o){var i=Pr();try{return Gr(e,t,r,n,o)}catch(e){if(Nr(i),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},ha:function(e,t,r,n,o,i){var a=Pr();try{return Hr(e,t,r,n,o,i)}catch(e){if(Nr(a),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},x:function(e){var t=Pr();try{Yr(e)}catch(e){if(Nr(t),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},j:function(e,t){var r=Pr();try{qr(e,t)}catch(e){if(Nr(r),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},o:function(e,t,r){var n=Pr();try{Wr(e,t,r)}catch(e){if(Nr(n),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},na:function(e,t,r,n){var o=Pr();try{Kr(e,t,r,n)}catch(e){if(Nr(o),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},l:function(e,t,r,n){var o=Pr();try{Qr(e,t,r,n)}catch(e){if(Nr(o),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},A:function(e,t,r,n,o,i){var a=Pr();try{Jr(e,t,r,n,o,i)}catch(e){if(Nr(a),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},M:function(e,t,r,n,o){var i=Pr();try{Zr(e,t,r,n,o)}catch(e){if(Nr(i),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},ga:function(e,t,r,n,o,i){var a=Pr();try{$r(e,t,r,n,o,i)}catch(e){if(Nr(a),e!==e+0&&"longjmp"!==e)throw e;Lr(1,0)}},Gd:function(e,t){e in ot.glAttributes||nn("Unknown SDL GL attribute ("+e+"). Please check if your SDL version is supported."),ot.glAttributes[e]=t},L:function(){nt.doSwapBuffers&&nt.doSwapBuffers()},Fd:function(){return ot.errorMessage||(ot.errorMessage=N(vr("unknown SDL-emscripten error"),"i8",0)),ot.errorMessage},Ed:function(e){if(ot.startTime=Date.now(),ot.initFlags=e,!o.doNotCaptureKeyboard){var t=o.keyboardListeningElement||document;t.addEventListener("keydown",ot.receiveEvent),t.addEventListener("keyup",ot.receiveEvent),t.addEventListener("keypress",ot.receiveEvent),window.addEventListener("focus",ot.receiveEvent),window.addEventListener("blur",ot.receiveEvent),document.addEventListener("visibilitychange",ot.receiveEvent)}return window.addEventListener("unload",ot.receiveEvent),ot.keyboardState=Rr(65536),kr(ot.keyboardState,0,65536),ot.DOMEventToSDLEvent.keydown=768,ot.DOMEventToSDLEvent.keyup=769,ot.DOMEventToSDLEvent.keypress=771,ot.DOMEventToSDLEvent.mousedown=1025,ot.DOMEventToSDLEvent.mouseup=1026,ot.DOMEventToSDLEvent.mousemove=1024,ot.DOMEventToSDLEvent.wheel=1027,ot.DOMEventToSDLEvent.touchstart=1792,ot.DOMEventToSDLEvent.touchend=1793,ot.DOMEventToSDLEvent.touchmove=1794,ot.DOMEventToSDLEvent.unload=256,ot.DOMEventToSDLEvent.resize=28673,ot.DOMEventToSDLEvent.visibilitychange=512,ot.DOMEventToSDLEvent.focus=512,ot.DOMEventToSDLEvent.blur=512,ot.DOMEventToSDLEvent.joystick_axis_motion=1536,ot.DOMEventToSDLEvent.joystick_button_down=1539,ot.DOMEventToSDLEvent.joystick_button_up=1540,0},K:function(){!function(){for(var e=0;e<ot.numChannels;++e)ot.channels[e].audio&&(ot.channels[e].audio.pause(),ot.channels[e].audio=void 0);ot.music.audio&&ot.music.audio.pause(),ot.music.audio=void 0}();var e=o.keyboardListeningElement||document;e.removeEventListener("keydown",ot.receiveEvent),e.removeEventListener("keyup",ot.receiveEvent),e.removeEventListener("keypress",ot.receiveEvent)},g:function(e,t,r,n){nn("Assertion failed: "+B(e)+", at: "+[t?B(t):"unknown filename",r,n?B(n):"unknown function"])},Cd:at,Bd:function(e,t){return st(e,t)},n:function(e){return Rr(e)},Ad:function(){throw L=!0,"Pure virtual function called!"},m:function(e,t,r){throw ut[e]={ptr:e,adjusted:[e],type:t,destructor:r,refcount:0,caught:!1,rethrown:!1},"uncaught_exception"in _r?_r.uncaught_exceptions++:_r.uncaught_exceptions=1,e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."},zd:function(){return _r.uncaught_exceptions},ma:function(){},yd:function(e,t){return Ge(1),-1},Ea:Ge,la:function(e,t){ct.varargs=t;try{var r=ct.getStr();return et.unlink(r),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},wd:function(e,t){ct.varargs=t;try{nn("cannot wait on child processes")}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},vd:function(e,t){ct.varargs=t;try{var r=ct.getStr();return et.chdir(r),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Da:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get(),i=ct.get(),a=ct.get(),s=4294967296*n+(o>>>0),u=9007199254740992;return s<=-u||s>=u?-75:(et.llseek(r,s,a),Ie=[r.position>>>0,(Pe=r.position,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[i>>2]=Ie[0],Q[i+4>>2]=Ie[1],r.getdents&&0===s&&0===a&&(r.getdents=null),0)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},ud:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();return ct.doReadv(r,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Ca:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();return ct.doWritev(r,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},td:function(e,t){ct.varargs=t;try{var r=ct.get(),n=ct.get();if(0===n)return-22;var o=et.cwd();return n<V(o)+1?-34:(j(o,r,n),r)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},sd:function(e,t){ct.varargs=t;try{ct.get();var r=ct.get();return Q[r>>2]=-1,Q[r+4>>2]=-1,Q[r+8>>2]=-1,Q[r+12>>2]=-1,0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Ba:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get();return ct.doStat(et.stat,r,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},qd:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get();return ct.doStat(et.lstat,r,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},pd:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get();return ct.doStat(et.stat,r.path,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},od:function(e,t){return lt(0,t)},nd:function(e,t){ct.varargs=t;try{return dt}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},md:function(e,t){return lt(0,t)},ld:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();r.getdents||(r.getdents=et.readdir(r.path));for(var i=280,a=0,s=et.llseek(r,0,1),u=Math.floor(s/i);u<r.getdents.length&&a+i<=o;){var c,l,d=r.getdents[u];if("."===d[0])c=1,l=4;else{var f=et.lookupNode(r.node,d);c=f.id,l=et.isChrdev(f.mode)?2:et.isDir(f.mode)?4:et.isLink(f.mode)?10:8}Ie=[c>>>0,(Pe=c,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[n+a>>2]=Ie[0],Q[n+a+4>>2]=Ie[1],Ie=[(u+1)*i>>>0,(Pe=(u+1)*i,+ge(Pe)>=1?Pe>0?(0|xe(+Te(Pe/4294967296),4294967295))>>>0:~~+_e((Pe-+(~~Pe>>>0))/4294967296)>>>0:0)],Q[n+a+8>>2]=Ie[0],Q[n+a+12>>2]=Ie[1],W[n+a+16>>1]=280,Y[n+a+18|0]=l,j(d,n+a+19,256),a+=i,u+=1}return et.llseek(r,u*i,0),a}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},W:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD();switch(ct.get()){case 0:return(n=ct.get())<0?-22:et.open(r.path,r.flags,0,n).fd;case 1:case 2:case 13:case 14:return 0;case 3:return r.flags;case 4:var n=ct.get();return r.flags|=n,0;case 12:n=ct.get();return W[n+0>>1]=2,0;case 16:case 8:default:return-22;case 9:return Ge(22),-1}}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},kd:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();return et.read(r,Y,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},jd:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get();return ct.doAccess(r,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},id:function(e,t){ct.varargs=t;try{ct.get(),ct.get(),ct.get();var r=ct.get();return r&&(Q[r>>2]=-1,Q[r+4>>2]=-1,Q[r+8>>2]=-1,Q[r+12>>2]=-1),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},gd:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.getStr();return et.rename(r,n),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},fd:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get();return ct.doMkdir(r,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},ed:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get(),o=ct.get();return et.write(r,Y,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Aa:function(e,t){ct.varargs=t;try{var r=ct.getStr();return et.rmdir(r),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},dd:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD();return et.open(r.path,r.flags,0).fd}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},cd:function(e,t){ct.varargs=t;try{var r=ct.get();if(0==r)throw new et.ErrnoError(14);var n=ft.createPipe();return Q[r>>2]=n.readable_fd,Q[r+4>>2]=n.writable_fd,0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},fa:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get(),o=ct.get();return et.open(r,n,o).fd}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},ea:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get();switch(n){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return r.tty?0:-25;case 21519:if(!r.tty)return-25;var o=ct.get();return Q[o>>2]=0,0;case 21520:return r.tty?-22:-25;case 21531:o=ct.get();return et.ioctl(r,n,o);default:nn("bad ioctl syscall "+n)}}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},R:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD();return et.close(r),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},bd:function(e,t){ct.varargs=t;try{var r=ct.getStreamFromFD(),n=ct.get();return r.fd===n?n:ct.doDup(r.path,r.flags,n)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},$c:function(e,t){ct.varargs=t;try{ct.get();var r=ct.get();return kr(r,0,136),Q[r>>2]=1,Q[r+4>>2]=2,Q[r+8>>2]=3,Q[r+12>>2]=4,0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},_c:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.getStr();return et.symlink(r,n),0}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Zc:function(e,t){ct.varargs=t;try{var r=ct.getStr(),n=ct.get(),o=ct.get();return ct.doReadlink(r,n,o)}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},Yc:function(e,t){ct.varargs=t;try{return function(e,t){if(-1===e||0===t)return-22;var r=ct.mappings[e];if(!r)return 0;if(t===r.len){var n=et.getStream(r.fd);ct.doMsync(e,n,t,r.flags),et.munmap(n),ct.mappings[e]=null,r.allocated&&Sr(r.malloc)}return 0}(ct.get(),ct.get())}catch(e){return void 0!==et&&e instanceof et.ErrnoError||nn(e),-e.errno}},V:function(){},$:function(e){return mt(e)},h:function(){o.abort()},Xc:function(e,t){A("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"),fe.unshift({func:e,arg:t})},Wc:pt,v:function e(){return void 0===e.start&&(e.start=Date.now()),1e3*(Date.now()-e.start)|0},Uc:function(e,t){return e-t},Tc:function(){return ht.apply(null,arguments)},za:function(){return ht.apply(null,arguments)},da:ht,ka:function(){return ht.apply(null,arguments)},c:function(e){return je[e]()},ya:function(e){return je[e]()},Q:function(e,t){return je[e](t)},Sc:function(e,t,r){return je[e](t,r)},xa:function(e,t,r,n){return je[e](t,r,n)},Qc:function(e,t,r,n,o){return je[e](t,r,n,o)},Pc:function(e,t,r){var n=o.canvas;Q[e>>2]=n.width,Q[t>>2]=n.height,Q[r>>2]=nt.isFullscreen?1:0},Oc:vt,Nc:function(e,t){Et(e,t)},Mc:function(e,t,r){q.set(q.subarray(t,t+r),e)},Lc:function(e){nr(e)},ja:function(){return gt.apply(null,arguments)},F:mt,Kc:yt,Jc:wt,Hc:function(){return Ge(11),-1},D:function e(t){return 0===t?0:(t=B(t),it.hasOwnProperty(t)?(e.ret&&Sr(e.ret),e.ret=(r=it[t],n=V(r)+1,(o=Rr(n))&&X(r,Y,o,n),o)):0);var r,n,o},wa:function(){throw"getpwnam: TODO"},Gc:function(e){return 0},ca:function(e){var t=Date.now();return Q[e>>2]=t/1e3|0,Q[e+4>>2]=t%1e3*1e3|0,0},p:function(e){Kt.enabledClientAttributes_preBegin=Kt.enabledClientAttributes,Kt.enabledClientAttributes=[],Kt.clientAttributes_preBegin=Kt.clientAttributes,Kt.clientAttributes=[];for(var t=0;t<Kt.clientAttributes_preBegin.length;t++)Kt.clientAttributes.push({});Kt.mode=e,Kt.vertexCounter=0;var r=Kt.rendererComponents=[];for(t=0;t<Kt.NUM_ATTRIBUTES;t++)r[t]=0;Kt.rendererComponentPointer=0,Kt.vertexData=Kt.tempData},Fc:function(e,t){sr.blendFunc(e,t)},Ec:function(e){sr.clear(e)},va:function(e,t,r,n){sr.clearColor(e,t,r,n)},w:function(e,t,r){!function(e,t,r,n){if(e=Math.max(Math.min(e,1),0),t=Math.max(Math.min(t,1),0),r=Math.max(Math.min(r,1),0),n=Math.max(Math.min(n,1),0),Kt.mode>=0){var o=Kt.vertexCounter<<2;Kt.vertexDataU8[o+0]=255*e,Kt.vertexDataU8[o+1]=255*t,Kt.vertexDataU8[o+2]=255*r,Kt.vertexDataU8[o+3]=255*n,Kt.vertexCounter++,Kt.addRendererComponent(Kt.COLOR,4,sr.UNSIGNED_BYTE)}else Kt.clientColor[0]=e,Kt.clientColor[1]=t,Kt.clientColor[2]=r,Kt.clientColor[3]=n}(e,t,r,1)},Cc:function(e){sr.depthFunc(e)},C:Tt,z:_t,q:function(){Kt.prepareClientAttributes(Kt.rendererComponents[Kt.VERTEX],!0),Kt.firstVertex=0,Kt.lastVertex=Kt.vertexCounter/(Kt.stride>>2),Kt.flush(),Kt.disableBeginEndClientAttributes(),Kt.mode=-1,Kt.enabledClientAttributes=Kt.enabledClientAttributes_preBegin,Kt.clientAttributes=Kt.clientAttributes_preBegin,Kt.currentRenderer=null,Kt.modifiedClientAttributes=!0},Bc:function(){sr.finish()},Ac:function(){sr.flush()},zc:function(e,t,r,n,o,i){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.multiply(Kt.matrix[Kt.currentMatrix],Kt.matrixLib.mat4.frustum(e,t,r,n,o,i))},yc:It,ua:Mt,_:function(){throw"glLightfv: TODO"},B:function(e){sr.lineWidth(e)},U:function(){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.identity(Kt.matrix[Kt.currentMatrix])},G:function(e){if(5888==e)Kt.currentMatrix=0;else if(5889==e)Kt.currentMatrix=1;else{if(5890!=e)throw"Wrong mode "+e+" passed to glMatrixMode";Kt.useTextureMatrix=!0,Kt.currentMatrix=2+Kt.clientActiveTexture}},wc:function(){},vc:function(e,t,r,n,o,i){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.multiply(Kt.matrix[Kt.currentMatrix],Kt.matrixLib.mat4.ortho(e,t,r,n,o,i))},uc:function(){},tc:function(e,t){sr.polygonOffset(e,t)},ba:function(){0!=Kt.matrixStack[Kt.currentMatrix].length?(Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrix[Kt.currentMatrix]=Kt.matrixStack[Kt.currentMatrix].pop()):bt.recordError(1284)},aa:function(){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixStack[Kt.currentMatrix].push(Array.prototype.slice.call(Kt.matrix[Kt.currentMatrix]))},sc:function(e,t,r,n){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.rotate(Kt.matrix[Kt.currentMatrix],e*Math.PI/180,[t,r,n])},ta:function(e,t,r){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.scale(Kt.matrix[Kt.currentMatrix],[e,t,r])},qc:function(e,t,r){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.scale(Kt.matrix[Kt.currentMatrix],[e,t,r])},pc:function(){A("TODO: glShadeModel")},sa:function(e,t,r){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.translate(Kt.matrix[Kt.currentMatrix],[e,t,r])},ra:function(e,t,r){Kt.matricesModified=!0,Kt.matrixVersion[Kt.currentMatrix]=Kt.matrixVersion[Kt.currentMatrix]+1|0,Kt.matrixLib.mat4.translate(Kt.matrix[Kt.currentMatrix],[e,t,r])},E:function(e,t,r){F(Kt.mode>=0),Kt.vertexData[Kt.vertexCounter++]=e,Kt.vertexData[Kt.vertexCounter++]=t,Kt.vertexData[Kt.vertexCounter++]=r,Kt.vertexData[Kt.vertexCounter++]=1,F(Kt.vertexCounter<<2<bt.MAX_TEMP_BUFFER_SIZE),Kt.addRendererComponent(Kt.VERTEX,4,sr.FLOAT)},oc:function(e,t,r,n){sr.viewport(e,t,r,n)},nc:function(e,t,r,n,i){var a;a=-1==i?o.canvas:document.getElementById("gl3d_"+(i+1)),0==e&&0==t&&(e=a.width,t=a.height),ot.addedResizeListener||(ot.addedResizeListener=!0,nt.resizeListeners.push(function(e,t){ot.settingVideoMode||ot.receiveEvent({type:"resize",w:e,h:t})})),e===a.width&&t===a.height||(ot.settingVideoMode=!0,nt.setCanvasSize(e,t),ot.settingVideoMode=!1),ot.screen&&(ot.freeSurface(ot.screen),F(!ot.screen)),ot.GL&&(n|=67108864);var s=1&(n=n||0),u=2097152&n,c=67108864&n,l=Rr(60),d=Rr(44),f=u?1:4,m=0;s||c||(m=Rr(e*t*4)),Q[l>>2]=n,Q[l+4>>2]=d,Q[l+8>>2]=e,Q[l+12>>2]=t,Q[l+16>>2]=e*f,Q[l+20>>2]=m,Q[l+36>>2]=0,Q[l+40>>2]=0,Q[l+44>>2]=o.canvas.width,Q[l+48>>2]=o.canvas.height,Q[l+56>>2]=1,Q[d>>2]=-2042224636,Q[d+4>>2]=0,Y[d+8|0]=8*f,Y[d+9|0]=f,ot.GL=ot.GL||c;var p,h={antialias:0!=ot.glAttributes[13]&&ot.glAttributes[14]>1,depth:ot.glAttributes[6]>0,stencil:ot.glAttributes[7]>0},v={antialias:!1,alpha:!1};if(h)for(var E in h)v[E]=h[E];var g=bt.createContext(a,v);return g&&(p=bt.getContext(g).GLctx),o.ctx=p,bt.makeContextCurrent(g),o.useWebGL=!0,nt.moduleContextCreatedCallbacks.forEach(function(e){e()}),nt.init(),ot.surfaces[l]={width:e,height:t,canvas:a,ctx:p,surf:l,buffer:m,pixelFormat:d,alpha:255,flags:n,locked:0,usePageCanvas:!0,source:"screen",isFlagSet:function(e){return n&e}},ot.screen=l,g},mc:function(e,t){return _("Calling stub instead of kill()"),Ge($e.EPERM),-1},Tb:function(e,t){var r=Or(t)>>>0,n=Or(e)>>>0;return 0|(D(n),r)},T:Qt,kc:function(e){return t=e,Math.pow(2,t);var t},u:function(e){return t=e,Math.log(t)/Math.LN10;var t},jc:function(e){return t=e,Math.log(t)/Math.LN2;var t},P:Jt,s:function(e){var t=Zt,r=t.LLVM_SAVEDSTACKS[e];t.LLVM_SAVEDSTACKS.splice(e,1),Nr(r)},t:Zt,Z:function(){nn("trap!")},J:$t,ic:function(e){return tr(e,5313824)},hc:tr,e:Et,fc:function(){if("undefined"==typeof window){var e=o.ccall("mp_hal_get_interrupt_char","number",["number"],["null"]),t=r(8952),n=Buffer.alloc(1);try{t.readSync(process.stdin.fd,n,0,1)>0&&(n[0]==e?o.ccall("mp_keyboard_interrupt","null",["null"],["null"]):process.stdout.write(String.fromCharCode(n[0])))}catch(e){if("EAGAIN"!==e.code)throw e}}},O:function(){return(new Date).getTime()},ec:function(e,t){if(0===e)return Ge(22),-1;var r=Q[e>>2],n=Q[e+4>>2];return n<0||n>999999999||r<0?(Ge(22),-1):(0!==t&&(Q[t>>2]=0,Q[t+4>>2]=0),rr(1e6*r+n/1e3))},ia:function(){_("missing function: popen"),nn(-1)},dc:function(){return 0},I:function(e){return _("Calling stub instead of raise()"),Ge($e.ENOSYS),A("raise() returning an error as we do not support it"),-1},cc:function(e,t,r){if(0===e)return Ge(22),-1;var n=B(e),o=B(t);return""===n||-1!==n.indexOf("=")?(Ge(22),-1):(it.hasOwnProperty(n)&&!r||(it[n]=o,at(xr())),0)},bc:function(e,t,r){return _("Calling stub instead of sigaction()"),0},ac:function(e){return Q[e>>2]=0,0},_b:or,Zb:dr,Yb:function(e,t,r,n){return dr(e,t,r,n)},qa:function(e){switch(e){case 30:case 75:return 16384;case 85:return q.length/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return Ge(22),-1},S:function(e){return Ge(11),-1},Y:function(e){var t=Date.now()/1e3|0;return e&&(Q[e>>2]=t),t},Xb:function(e){return 0===e||""===(e=B(e))||-1!==e.indexOf("=")?(Ge(22),-1):(it.hasOwnProperty(e)&&(delete it[e],at(xr())),0)},pa:rr,Wb:function(e,t){var r;if(t){var n=8;r=1e3*Q[t+n>>2],r+=Q[t+(n=12)>>2]/1e3}else r=Date.now();e=B(e);try{return et.utime(e,r,r),0}catch(e){return et.handleFSError(e),-1}},oa:function(){return fr.apply(null,arguments)},Ub:nr,a:ne},br=o.asm({},wr,H);o.asm=br;o.__ZN4giac13giac_rendererEPKc=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Id.apply(null,arguments)};var _r=o.__ZSt18uncaught_exceptionv=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Jd.apply(null,arguments)},Tr=(o.___errno_location=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Kd.apply(null,arguments)},o.__get_daylight=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Ld.apply(null,arguments)}),xr=o.__get_environ=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Md.apply(null,arguments)},Ar=o.__get_timezone=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Nd.apply(null,arguments)},Mr=o.__get_tzname=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Od.apply(null,arguments)},Sr=(o._caseval=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Pd.apply(null,arguments)},o._fflush=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Qd.apply(null,arguments)},o._free=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Rd.apply(null,arguments)}),Or=o._llvm_bswap_i32=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Sd.apply(null,arguments)},Rr=o._malloc=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Td.apply(null,arguments)},Dr=o._memcpy=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Ud.apply(null,arguments)},kr=o._memset=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Vd.apply(null,arguments)},Lr=(o._mp_js_do_str=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Wd.apply(null,arguments)},o._mp_js_init=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Xd.apply(null,arguments)},o._nws_caseval=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Yd.apply(null,arguments)},o._quickjs_ck_eval=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.Zd.apply(null,arguments)},o._setThrew=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm._d.apply(null,arguments)}),Fr=(o.establishStackSpace=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.qe.apply(null,arguments)},o.globalCtors=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.re.apply(null,arguments)}),Cr=o.stackAlloc=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.se.apply(null,arguments)},Nr=o.stackRestore=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.te.apply(null,arguments)},Pr=o.stackSave=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ue.apply(null,arguments)},Ir=o.dynCall_dd=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.$d.apply(null,arguments)},Ur=o.dynCall_di=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ae.apply(null,arguments)},Br=o.dynCall_i=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.be.apply(null,arguments)},Xr=o.dynCall_ii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ce.apply(null,arguments)},jr=o.dynCall_iidi=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.de.apply(null,arguments)},Vr=o.dynCall_iii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ee.apply(null,arguments)},zr=o.dynCall_iiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.fe.apply(null,arguments)},Gr=o.dynCall_iiiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ge.apply(null,arguments)},Hr=o.dynCall_iiiiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.he.apply(null,arguments)},Yr=o.dynCall_v=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ie.apply(null,arguments)},qr=o.dynCall_vi=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.je.apply(null,arguments)},Wr=o.dynCall_vii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ke.apply(null,arguments)},Kr=o.dynCall_viid=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.le.apply(null,arguments)},Qr=o.dynCall_viii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.me.apply(null,arguments)},Jr=o.dynCall_viiidd=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.ne.apply(null,arguments)},Zr=o.dynCall_viiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.oe.apply(null,arguments)},$r=o.dynCall_viiiii=function(){return F(pe,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),F(!he,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o.asm.pe.apply(null,arguments)};function en(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function tn(e){function t(){o.calledRun||(o.calledRun=!0,L||(ae(),F(!pe),pe=!0,o.noFSInit||et.init.initialized||et.init(),qe.init(),ft.root=et.mount(ft,{},null),ue(le),ae(),et.ignorePermissions=!1,ue(de),o.onRuntimeInitialized&&o.onRuntimeInitialized(),F(!o._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(ae(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)Ee(o.postRun.shift());ue(me)}()))}e=e||f,Me>0||(F(!0),J[2639219]=34821223,J[2639218]=2310721022,function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)ve(o.preRun.shift());ue(ce)}(),Me>0||o.calledRun||(o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),t()},1)):t(),ae()))}o.asm=br,Object.getOwnPropertyDescriptor(o,"intArrayFromString")||(o.intArrayFromString=function(){nn("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"intArrayToString")||(o.intArrayToString=function(){nn("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),o.ccall=C,o.cwrap=function(e,t,r,n){return function(){return C(e,t,r,arguments,n)}},Object.getOwnPropertyDescriptor(o,"setValue")||(o.setValue=function(){nn("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getValue")||(o.getValue=function(){nn("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"allocate")||(o.allocate=function(){nn("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getMemory")||(o.getMemory=function(){nn("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"AsciiToString")||(o.AsciiToString=function(){nn("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToAscii")||(o.stringToAscii=function(){nn("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"UTF8ArrayToString")||(o.UTF8ArrayToString=function(){nn("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"UTF8ToString")||(o.UTF8ToString=function(){nn("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToUTF8Array")||(o.stringToUTF8Array=function(){nn("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToUTF8")||(o.stringToUTF8=function(){nn("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF8")||(o.lengthBytesUTF8=function(){nn("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"UTF16ToString")||(o.UTF16ToString=function(){nn("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToUTF16")||(o.stringToUTF16=function(){nn("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF16")||(o.lengthBytesUTF16=function(){nn("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"UTF32ToString")||(o.UTF32ToString=function(){nn("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stringToUTF32")||(o.stringToUTF32=function(){nn("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF32")||(o.lengthBytesUTF32=function(){nn("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"allocateUTF8")||(o.allocateUTF8=function(){nn("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stackTrace")||(o.stackTrace=function(){nn("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnPreRun")||(o.addOnPreRun=function(){nn("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnInit")||(o.addOnInit=function(){nn("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnPreMain")||(o.addOnPreMain=function(){nn("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnExit")||(o.addOnExit=function(){nn("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addOnPostRun")||(o.addOnPostRun=function(){nn("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),o.writeStringToMemory=function(e,t,r){var n,o;A("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"),r&&(o=t+V(e),n=Y[o]),j(e,t,1/0),r&&(Y[o]=n)},Object.getOwnPropertyDescriptor(o,"writeArrayToMemory")||(o.writeArrayToMemory=function(){nn("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"writeAsciiToMemory")||(o.writeAsciiToMemory=function(){nn("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addRunDependency")||(o.addRunDependency=function(){nn("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"removeRunDependency")||(o.removeRunDependency=function(){nn("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"ENV")||(o.ENV=function(){nn("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"FS")||(o.FS=function(){nn("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"FS_createFolder")||(o.FS_createFolder=function(){nn("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createPath")||(o.FS_createPath=function(){nn("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createDataFile")||(o.FS_createDataFile=function(){nn("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createPreloadedFile")||(o.FS_createPreloadedFile=function(){nn("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createLazyFile")||(o.FS_createLazyFile=function(){nn("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createLink")||(o.FS_createLink=function(){nn("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_createDevice")||(o.FS_createDevice=function(){nn("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"FS_unlink")||(o.FS_unlink=function(){nn("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(o,"GL")||(o.GL=function(){nn("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"dynamicAlloc")||(o.dynamicAlloc=function(){nn("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"warnOnce")||(o.warnOnce=function(){nn("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"loadDynamicLibrary")||(o.loadDynamicLibrary=function(){nn("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"loadWebAssemblyModule")||(o.loadWebAssemblyModule=function(){nn("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getLEB")||(o.getLEB=function(){nn("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getFunctionTables")||(o.getFunctionTables=function(){nn("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"alignFunctionTables")||(o.alignFunctionTables=function(){nn("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"registerFunctions")||(o.registerFunctions=function(){nn("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"addFunction")||(o.addFunction=function(){nn("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"removeFunction")||(o.removeFunction=function(){nn("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getFuncWrapper")||(o.getFuncWrapper=function(){nn("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"prettyPrint")||(o.prettyPrint=function(){nn("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"makeBigInt")||(o.makeBigInt=function(){nn("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"dynCall")||(o.dynCall=function(){nn("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getCompilerSetting")||(o.getCompilerSetting=function(){nn("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stackSave")||(o.stackSave=function(){nn("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stackRestore")||(o.stackRestore=function(){nn("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"stackAlloc")||(o.stackAlloc=function(){nn("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"establishStackSpace")||(o.establishStackSpace=function(){nn("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"print")||(o.print=function(){nn("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"printErr")||(o.printErr=function(){nn("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"getTempRet0")||(o.getTempRet0=function(){nn("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"setTempRet0")||(o.setTempRet0=function(){nn("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"callMain")||(o.callMain=function(){nn("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),o.Pointer_stringify=function(e,t){nn("this function has been removed - you should use UTF8ToString(ptr, maxBytesToRead) instead!")},Object.getOwnPropertyDescriptor(o,"intArrayFromBase64")||(o.intArrayFromBase64=function(){nn("'intArrayFromBase64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"tryParseAsDataURI")||(o.tryParseAsDataURI=function(){nn("'tryParseAsDataURI' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(o,"ALLOC_NORMAL")||Object.defineProperty(o,"ALLOC_NORMAL",{get:function(){nn("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(o,"ALLOC_STACK")||Object.defineProperty(o,"ALLOC_STACK",{get:function(){nn("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(o,"ALLOC_DYNAMIC")||Object.defineProperty(o,"ALLOC_DYNAMIC",{get:function(){nn("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(o,"ALLOC_NONE")||Object.defineProperty(o,"ALLOC_NONE",{get:function(){nn("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Oe=function e(){o.calledRun||tn(),o.calledRun||(Oe=e)},o.run=tn;var rn=[];function nn(e){o.onAbort&&o.onAbort(e),b(e+=""),_(e),L=!0;var t="abort("+e+") at "+ze();throw rn&&rn.forEach(function(r){t=r(t,e)}),t}if(o.abort=nn,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();o.noExitRuntime=!0;const on=o},5075:(e,t,r)=>{e.exports=r.p+"c621a8b7eb8496a5e6a6.wasm"}}]);
|
|
2
2
|
//# sourceMappingURL=vendors-node_modules_basthon_xcas-wasm_src_index_js.js.map
|