From d32482a92517fe4e2a31ed404603090721177c37 Mon Sep 17 00:00:00 2001 From: Jd-1206 Date: Mon, 28 Oct 2024 14:34:52 -0400 Subject: [PATCH] actually, lets try this instead... --- public/modules/RSDKv4.js | 2 +- public/modules/RSDKv4.wasm | Bin 1340671 -> 1339532 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/public/modules/RSDKv4.js b/public/modules/RSDKv4.js index 8f00b53..37e7812 100644 --- a/public/modules/RSDKv4.js +++ b/public/modules/RSDKv4.js @@ -1 +1 @@ -var Module=typeof Module!="undefined"?Module:{};var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror,binary=true)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?undefined:"utf8",(err,data)=>{if(err)onerror(err);else onload(binary?data.buffer:data)})};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);if(typeof module!="undefined"){module["exports"]=Module}process.on("uncaughtException",ex=>{if(ex!=="unwind"&&!(ex instanceof ExitStatus)&&!(ex.context instanceof ExitStatus)){throw ex}});quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow};Module["inspect"]=()=>"[Emscripten Module object]"}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=filename=>filename.startsWith(dataURIPrefix);var isFileURI=filename=>filename.startsWith("file://");var wasmBinaryFile;wasmBinaryFile="RSDKv4.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{if(!response["ok"]){throw"failed to load wasm binary file at '"+binaryFile+"'"}return response["arrayBuffer"]()}).catch(()=>getBinarySync(binaryFile))}else if(readAsync){return new Promise((resolve,reject)=>{readAsync(binaryFile,response=>resolve(new Uint8Array(response)),reject)})}}return Promise.resolve().then(()=>getBinarySync(binaryFile))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(binary=>WebAssembly.instantiate(binary,imports)).then(instance=>instance).then(receiver,reason=>{err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)})})}return instantiateArrayBuffer(binaryFile,imports,callback)}function createWasm(){var info={"a":wasmImports};function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports["If"];updateMemoryViews();wasmTable=wasmExports["Kf"];addOnInit(wasmExports["Jf"]);removeRunDependency("wasm-instantiate");return wasmExports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);return false}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult);return{}}var tempDouble;var tempI64;var ASM_CONSTS={692072:()=>{FS.syncfs(false,function(err){if(err)console.error(err)})},692143:()=>{FS.syncfs(false,function(err){if(err)console.error(err)})},692214:()=>{FS.syncfs(false,function(err){if(err)console.error(err)})},692285:()=>{if(typeof AudioContext!=="undefined"){return true}else if(typeof webkitAudioContext!=="undefined"){return true}return false},692432:()=>{if(typeof navigator.mediaDevices!=="undefined"&&typeof navigator.mediaDevices.getUserMedia!=="undefined"){return true}else if(typeof navigator.webkitGetUserMedia!=="undefined"){return true}return false},692666:$0=>{if(typeof Module["SDL2"]==="undefined"){Module["SDL2"]={}}var SDL2=Module["SDL2"];if(!$0){SDL2.audio={}}else{SDL2.capture={}}if(!SDL2.audioContext){if(typeof AudioContext!=="undefined"){SDL2.audioContext=new AudioContext}else if(typeof webkitAudioContext!=="undefined"){SDL2.audioContext=new webkitAudioContext}if(SDL2.audioContext){autoResumeAudioContext(SDL2.audioContext)}}return SDL2.audioContext===undefined?-1:0},693159:()=>{var SDL2=Module["SDL2"];return SDL2.audioContext.sampleRate},693227:($0,$1,$2,$3)=>{var SDL2=Module["SDL2"];var have_microphone=function(stream){if(SDL2.capture.silenceTimer!==undefined){clearTimeout(SDL2.capture.silenceTimer);SDL2.capture.silenceTimer=undefined}SDL2.capture.mediaStreamNode=SDL2.audioContext.createMediaStreamSource(stream);SDL2.capture.scriptProcessorNode=SDL2.audioContext.createScriptProcessor($1,$0,1);SDL2.capture.scriptProcessorNode.onaudioprocess=function(audioProcessingEvent){if(SDL2===undefined||SDL2.capture===undefined){return}audioProcessingEvent.outputBuffer.getChannelData(0).fill(0);SDL2.capture.currentCaptureBuffer=audioProcessingEvent.inputBuffer;dynCall("vi",$2,[$3])};SDL2.capture.mediaStreamNode.connect(SDL2.capture.scriptProcessorNode);SDL2.capture.scriptProcessorNode.connect(SDL2.audioContext.destination);SDL2.capture.stream=stream};var no_microphone=function(error){};SDL2.capture.silenceBuffer=SDL2.audioContext.createBuffer($0,$1,SDL2.audioContext.sampleRate);SDL2.capture.silenceBuffer.getChannelData(0).fill(0);var silence_callback=function(){SDL2.capture.currentCaptureBuffer=SDL2.capture.silenceBuffer;dynCall("vi",$2,[$3])};SDL2.capture.silenceTimer=setTimeout(silence_callback,$1/SDL2.audioContext.sampleRate*1e3);if(navigator.mediaDevices!==undefined&&navigator.mediaDevices.getUserMedia!==undefined){navigator.mediaDevices.getUserMedia({audio:true,video:false}).then(have_microphone).catch(no_microphone)}else if(navigator.webkitGetUserMedia!==undefined){navigator.webkitGetUserMedia({audio:true,video:false},have_microphone,no_microphone)}},694879:($0,$1,$2,$3)=>{var SDL2=Module["SDL2"];SDL2.audio.scriptProcessorNode=SDL2.audioContext["createScriptProcessor"]($1,0,$0);SDL2.audio.scriptProcessorNode["onaudioprocess"]=function(e){if(SDL2===undefined||SDL2.audio===undefined){return}SDL2.audio.currentOutputBuffer=e["outputBuffer"];dynCall("vi",$2,[$3])};SDL2.audio.scriptProcessorNode["connect"](SDL2.audioContext["destination"])},695289:($0,$1)=>{var SDL2=Module["SDL2"];var numChannels=SDL2.capture.currentCaptureBuffer.numberOfChannels;for(var c=0;c{var SDL2=Module["SDL2"];var numChannels=SDL2.audio.currentOutputBuffer["numberOfChannels"];for(var c=0;c>2]}}},696374:$0=>{var SDL2=Module["SDL2"];if($0){if(SDL2.capture.silenceTimer!==undefined){clearTimeout(SDL2.capture.silenceTimer)}if(SDL2.capture.stream!==undefined){var tracks=SDL2.capture.stream.getAudioTracks();for(var i=0;i{var w=$0;var h=$1;var pixels=$2;if(!Module["SDL2"])Module["SDL2"]={};var SDL2=Module["SDL2"];if(SDL2.ctxCanvas!==Module["canvas"]){SDL2.ctx=Module["createContext"](Module["canvas"],false,true);SDL2.ctxCanvas=Module["canvas"]}if(SDL2.w!==w||SDL2.h!==h||SDL2.imageCtx!==SDL2.ctx){SDL2.image=SDL2.ctx.createImageData(w,h);SDL2.w=w;SDL2.h=h;SDL2.imageCtx=SDL2.ctx}var data=SDL2.image.data;var src=pixels>>2;var dst=0;var num;if(typeof CanvasPixelArray!=="undefined"&&data instanceof CanvasPixelArray){num=data.length;while(dst>8&255;data[dst+2]=val>>16&255;data[dst+3]=255;src++;dst+=4}}else{if(SDL2.data32Data!==data){SDL2.data32=new Int32Array(data.buffer);SDL2.data8=new Uint8Array(data.buffer);SDL2.data32Data=data}var data32=SDL2.data32;num=data32.length;data32.set(HEAP32.subarray(src,src+num));var data8=SDL2.data8;var i=3;var j=i+4*num;if(num%8==0){while(i{var w=$0;var h=$1;var hot_x=$2;var hot_y=$3;var pixels=$4;var canvas=document.createElement("canvas");canvas.width=w;canvas.height=h;var ctx=canvas.getContext("2d");var image=ctx.createImageData(w,h);var data=image.data;var src=pixels>>2;var dst=0;var num;if(typeof CanvasPixelArray!=="undefined"&&data instanceof CanvasPixelArray){num=data.length;while(dst>8&255;data[dst+2]=val>>16&255;data[dst+3]=val>>24&255;src++;dst+=4}}else{var data32=new Int32Array(data.buffer);num=data32.length;data32.set(HEAP32.subarray(src,src+num))}ctx.putImageData(image,0,0);var url=hot_x===0&&hot_y===0?"url("+canvas.toDataURL()+"), auto":"url("+canvas.toDataURL()+") "+hot_x+" "+hot_y+", auto";var urlBuf=_malloc(url.length+1);stringToUTF8(url,urlBuf,url.length+1);return urlBuf},700004:$0=>{if(Module["canvas"]){Module["canvas"].style["cursor"]=UTF8ToString($0)}},700087:()=>{if(Module["canvas"]){Module["canvas"].style["cursor"]="none"}},700156:()=>window.innerWidth,700186:()=>window.innerHeight};function ExitStatus(status){this.name="ExitStatus";this.message=`Program terminated with exit(${status})`;this.status=status}var listenOnce=(object,event,func)=>{object.addEventListener(event,func,{"once":true})};var autoResumeAudioContext=(ctx,elements)=>{if(!elements){elements=[document,document.getElementById("canvas")]}["keydown","mousedown","touchstart"].forEach(event=>{elements.forEach(element=>{if(element){listenOnce(element,event,()=>{if(ctx.state==="suspended")ctx.resume()})}})})};var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var dynCallLegacy=(sig,ptr,args)=>{var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)};var wasmTableMirror=[];var wasmTable;var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var dynCall=(sig,ptr,args)=>{if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr).apply(null,args);return rtn};var noExitRuntime=Module["noExitRuntime"]||true;function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;case"*":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;var UTF8ArrayToString=(heapOrArray,idx,maxBytesToRead)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var ___assert_fail=(condition,filename,line,func)=>{abort(`Assertion failed: ${UTF8ToString(condition)}, at: `+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])};function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}var exceptionLast=0;var uncaughtExceptionCount=0;var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var setErrNo=value=>{HEAP32[___errno_location()>>2]=value;return value};var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:path=>{if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},join:function(){var paths=Array.prototype.slice.call(arguments);return PATH.normalize(paths.join("/"))},join2:(l,r)=>PATH.normalize(l+"/"+r)};var initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto["getRandomValues"]=="function"){return view=>crypto.getRandomValues(view)}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return view=>crypto_module["randomFillSync"](view)}var randomBytes=crypto_module["randomBytes"];return view=>(view.set(randomBytes(view.byteLength)),view)}catch(e){}}abort("initRandomDevice")};var randomFill=view=>(randomFill=initRandomFill())(view);var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf)}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}FS_stdin_getChar_buffer=intArrayFromString(result,true)}return FS_stdin_getChar_buffer.shift()};var TTY={ttys:[],init(){},shutdown(){},register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close(stream){stream.tty.ops.fsync(stream.tty)},fsync(stream){stream.tty.ops.fsync(stream.tty)},read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}},ioctl_tcgets(tty){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(tty,optional_actions,data){return 0},ioctl_tiocgwinsz(tty){return[24,80]}},default_tty1_ops:{put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};var mmapAlloc=size=>{abort()};var MEMFS={ops_table:null,mount(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp}return node},getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup(parent,name){throw FS.genericErrors[44]},mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length{var dep=!noRunDep?getUniqueRunDependency(`al ${url}`):"";readAsync(url,arrayBuffer=>{assert(arrayBuffer,`Loading data file "${url}" failed (no arrayBuffer).`);onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},event=>{if(onerror){onerror()}else{throw`Loading data file "${url}" failed.`}});if(dep)addRunDependency(dep)};var FS_createDataFile=(parent,name,fileData,canRead,canWrite,canOwn)=>{FS.createDataFile(parent,name,fileData,canRead,canWrite,canOwn)};var preloadPlugins=Module["preloadPlugins"]||[];var FS_handledByPreloadPlugin=(byteArray,fullname,finish,onerror)=>{if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(plugin=>{if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true}});return handled};var FS_createPreloadedFile=(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency(`cp ${fullname}`);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,()=>{if(onerror)onerror();removeRunDependency(dep)})){return}finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,byteArray=>processData(byteArray),onerror)}else{processData(url)}};var FS_modeStringToFlags=str=>{var flagModes={"r":0,"r+":2,"w":512|64|1,"w+":512|64|2,"a":1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error(`Unknown file open mode: ${str}`)}return flags};var FS_getMode=(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode};var IDBFS={dbs:{},indexedDB:()=>{if(typeof indexedDB!="undefined")return indexedDB;var ret=null;if(typeof window=="object")ret=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;assert(ret,"IDBFS used, but indexedDB not supported");return ret},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function(mount){return MEMFS.mount.apply(null,arguments)},syncfs:(mount,populate,callback)=>{IDBFS.getLocalSet(mount,(err,local)=>{if(err)return callback(err);IDBFS.getRemoteSet(mount,(err,remote)=>{if(err)return callback(err);var src=populate?remote:local;var dst=populate?local:remote;IDBFS.reconcile(src,dst,callback)})})},quit:()=>{Object.values(IDBFS.dbs).forEach(value=>value.close());IDBFS.dbs={}},getDB:(name,callback)=>{var db=IDBFS.dbs[name];if(db){return callback(null,db)}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION)}catch(e){return callback(e)}if(!req){return callback("Unable to connect to IndexedDB")}req.onupgradeneeded=e=>{var db=e.target.result;var transaction=e.target.transaction;var fileStore;if(db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)){fileStore=transaction.objectStore(IDBFS.DB_STORE_NAME)}else{fileStore=db.createObjectStore(IDBFS.DB_STORE_NAME)}if(!fileStore.indexNames.contains("timestamp")){fileStore.createIndex("timestamp","timestamp",{unique:false})}};req.onsuccess=()=>{db=req.result;IDBFS.dbs[name]=db;callback(null,db)};req.onerror=e=>{callback(e.target.error);e.preventDefault()}},getLocalSet:(mount,callback)=>{var entries={};function isRealDir(p){return p!=="."&&p!==".."}function toAbsolute(root){return p=>PATH.join2(root,p)}var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat;try{stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){check.push.apply(check,FS.readdir(path).filter(isRealDir).map(toAbsolute(path)))}entries[path]={"timestamp":stat.mtime}}return callback(null,{type:"local",entries:entries})},getRemoteSet:(mount,callback)=>{var entries={};IDBFS.getDB(mount.mountpoint,(err,db)=>{if(err)return callback(err);try{var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readonly");transaction.onerror=e=>{callback(e.target.error);e.preventDefault()};var store=transaction.objectStore(IDBFS.DB_STORE_NAME);var index=store.index("timestamp");index.openKeyCursor().onsuccess=event=>{var cursor=event.target.result;if(!cursor){return callback(null,{type:"remote",db:db,entries:entries})}entries[cursor.primaryKey]={"timestamp":cursor.key};cursor.continue()}}catch(e){return callback(e)}})},loadLocalEntry:(path,callback)=>{var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){return callback(null,{"timestamp":stat.mtime,"mode":stat.mode})}else if(FS.isFile(stat.mode)){node.contents=MEMFS.getFileDataAsTypedArray(node);return callback(null,{"timestamp":stat.mtime,"mode":stat.mode,"contents":node.contents})}else{return callback(new Error("node type not supported"))}},storeLocalEntry:(path,entry,callback)=>{try{if(FS.isDir(entry["mode"])){FS.mkdirTree(path,entry["mode"])}else if(FS.isFile(entry["mode"])){FS.writeFile(path,entry["contents"],{canOwn:true})}else{return callback(new Error("node type not supported"))}FS.chmod(path,entry["mode"]);FS.utime(path,entry["timestamp"],entry["timestamp"])}catch(e){return callback(e)}callback(null)},removeLocalEntry:(path,callback)=>{try{var stat=FS.stat(path);if(FS.isDir(stat.mode)){FS.rmdir(path)}else if(FS.isFile(stat.mode)){FS.unlink(path)}}catch(e){return callback(e)}callback(null)},loadRemoteEntry:(store,path,callback)=>{var req=store.get(path);req.onsuccess=event=>{callback(null,event.target.result)};req.onerror=e=>{callback(e.target.error);e.preventDefault()}},storeRemoteEntry:(store,path,entry,callback)=>{try{var req=store.put(entry,path)}catch(e){callback(e);return}req.onsuccess=()=>{callback(null)};req.onerror=e=>{callback(e.target.error);e.preventDefault()}},removeRemoteEntry:(store,path,callback)=>{var req=store.delete(path);req.onsuccess=()=>{callback(null)};req.onerror=e=>{callback(e.target.error);e.preventDefault()}},reconcile:(src,dst,callback)=>{var total=0;var create=[];Object.keys(src.entries).forEach(function(key){var e=src.entries[key];var e2=dst.entries[key];if(!e2||e["timestamp"].getTime()!=e2["timestamp"].getTime()){create.push(key);total++}});var remove=[];Object.keys(dst.entries).forEach(function(key){if(!src.entries[key]){remove.push(key);total++}});if(!total){return callback(null)}var errored=false;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err&&!errored){errored=true;return callback(err)}}transaction.onerror=e=>{done(this.error);e.preventDefault()};transaction.oncomplete=e=>{if(!errored){callback(null)}};create.sort().forEach(path=>{if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(err,entry)=>{if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)})}else{IDBFS.loadLocalEntry(path,(err,entry)=>{if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)})}});remove.sort().reverse().forEach(path=>{if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}})}};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(path,opts={}){path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32)}var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?`${mount}/${path}`:mount+path}path=path?`${node.name}/${path}`:node.name;node=node.parent}},hashName(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode(node){FS.hashRemoveNode(node)},isRoot(node){return node===node.parent},isMountpoint(node){return!!node.mounted},isFile(mode){return(mode&61440)===32768},isDir(mode){return(mode&61440)===16384},isLink(mode){return(mode&61440)===40960},isChrdev(mode){return(mode&61440)===8192},isBlkdev(mode){return(mode&61440)===24576},isFIFO(mode){return(mode&61440)===4096},isSocket(mode){return(mode&49152)===49152},flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}return stream},getStream:fd=>FS.streams[fd],createStream(stream,fd=-1){if(!FS.FSStream){FS.FSStream=function(){this.shared={}};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get(){return this.node},set(val){this.node=val}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(val){this.shared.flags=val}},position:{get(){return this.shared.position},set(val){this.shared.position=val}}})}stream=Object.assign(new FS.FSStream,stream);if(fd==-1){fd=FS.nextfd()}stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream(fd){FS.streams[fd]=null},chrdev_stream_ops:{open(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek(){throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`)}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(mount=>{if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(hash=>{var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup(parent,name){return parent.node_ops.lookup(parent,name)},mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var i=0;i0,ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59)}return stream.stream_ops.ioctl(stream,cmd,arg)},readFile(path,opts={}){opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error(`Invalid encoding type "${opts.encoding}"`)}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret},writeFile(path,data,opts={}){opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,undefined,opts.canOwn)}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{throw new Error("Unsupported data type")}FS.close(stream)},cwd:()=>FS.currentPath,chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=()=>{if(randomLeft===0){randomLeft=randomFill(randomBuffer).byteLength}return randomBuffer[--randomLeft]};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount(){var node=FS.createNode(proc_self,"fd",16384|511,73);node.node_ops={lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path}};ret.parent=ret;return ret}};return node}},{},"/proc/self/fd")},createStandardStreams(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},ensureErrnoError(){if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.name="ErrnoError";this.node=node;this.setErrno=function(errno){this.errno=errno};this.setErrno(errno);this.message="FS error"};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[44].forEach(code=>{FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack=""})},staticInit(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS}},init(input,output,error){FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()},quit(){FS.init.initialized=false;for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(key=>{var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true}};node.stream_ops=stream_ops;return node}};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return PATH.join2(dir,path)},doStat(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-54}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=stat.mode;HEAPU32[buf+8>>2]=stat.nlink;HEAP32[buf+12>>2]=stat.uid;HEAP32[buf+16>>2]=stat.gid;HEAP32[buf+20>>2]=stat.rdev;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+24>>2]=tempI64[0],HEAP32[buf+28>>2]=tempI64[1];HEAP32[buf+32>>2]=4096;HEAP32[buf+36>>2]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();tempI64=[Math.floor(atime/1e3)>>>0,(tempDouble=Math.floor(atime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAPU32[buf+48>>2]=atime%1e3*1e3;tempI64=[Math.floor(mtime/1e3)>>>0,(tempDouble=Math.floor(mtime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+56>>2]=tempI64[0],HEAP32[buf+60>>2]=tempI64[1];HEAPU32[buf+64>>2]=mtime%1e3*1e3;tempI64=[Math.floor(ctime/1e3)>>>0,(tempDouble=Math.floor(ctime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+72>>2]=tempI64[0],HEAP32[buf+76>>2]=tempI64[1];HEAPU32[buf+80>>2]=ctime%1e3*1e3;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+88>>2]=tempI64[0],HEAP32[buf+92>>2]=tempI64[1];return 0},doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},varargs:undefined,get(){var ret=HEAP32[+SYSCALLS.varargs>>2];SYSCALLS.varargs+=4;return ret},getp(){return SYSCALLS.get()},getStr(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream}};function ___syscall_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}while(FS.streams[arg]){arg++}var newStream;newStream=FS.createStream(stream,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 5:{var arg=SYSCALLS.getp();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);function ___syscall_getcwd(buf,size){try{if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd)+1;if(size>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:{if(!stream.tty)return-59;return 0}case 21505:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcgets){var termios=stream.tty.ops.ioctl_tcgets(stream);var argp=SYSCALLS.getp();HEAP32[argp>>2]=termios.c_iflag||0;HEAP32[argp+4>>2]=termios.c_oflag||0;HEAP32[argp+8>>2]=termios.c_cflag||0;HEAP32[argp+12>>2]=termios.c_lflag||0;for(var i=0;i<32;i++){HEAP8[argp+i+17>>0]=termios.c_cc[i]||0}return 0}return 0}case 21510:case 21511:case 21512:{if(!stream.tty)return-59;return 0}case 21506:case 21507:case 21508:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcsets){var argp=SYSCALLS.getp();var c_iflag=HEAP32[argp>>2];var c_oflag=HEAP32[argp+4>>2];var c_cflag=HEAP32[argp+8>>2];var c_lflag=HEAP32[argp+12>>2];var c_cc=[];for(var i=0;i<32;i++){c_cc.push(HEAP8[argp+i+17>>0])}return stream.tty.ops.ioctl_tcsets(stream.tty,op,{c_iflag:c_iflag,c_oflag:c_oflag,c_cflag:c_cflag,c_lflag:c_lflag,c_cc:c_cc})}return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.getp();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.getp();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tiocgwinsz){var winsize=stream.tty.ops.ioctl_tiocgwinsz(stream.tty);var argp=SYSCALLS.getp();HEAP16[argp>>1]=winsize[0];HEAP16[argp+2>>1]=winsize[1]}return 0}case 21524:{if(!stream.tty)return-59;return 0}case 21515:{if(!stream.tty)return-59;return 0}default:return-28}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_lstat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_newfstatat(dirfd,path,buf,flags){try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_openat(dirfd,path,flags,varargs){SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?SYSCALLS.get():0;return FS.open(path,flags,mode).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}var nowIsMonotonic=true;var __emscripten_get_now_is_monotonic=()=>nowIsMonotonic;var _abort=()=>{abort("")};var _emscripten_set_main_loop_timing=(mode,value)=>{Browser.mainLoop.timingMode=mode;Browser.mainLoop.timingValue=value;if(!Browser.mainLoop.func){return 1}if(!Browser.mainLoop.running){Browser.mainLoop.running=true}if(mode==0){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setTimeout(){var timeUntilNextTick=Math.max(0,Browser.mainLoop.tickStartTime+value-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,timeUntilNextTick)};Browser.mainLoop.method="timeout"}else if(mode==1){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_rAF(){Browser.requestAnimationFrame(Browser.mainLoop.runner)};Browser.mainLoop.method="rAF"}else if(mode==2){if(typeof Browser.setImmediate=="undefined"){if(typeof setImmediate=="undefined"){var setImmediates=[];var emscriptenMainLoopMessageId="setimmediate";var Browser_setImmediate_messageHandler=event=>{if(event.data===emscriptenMainLoopMessageId||event.data.target===emscriptenMainLoopMessageId){event.stopPropagation();setImmediates.shift()()}};addEventListener("message",Browser_setImmediate_messageHandler,true);Browser.setImmediate=function Browser_emulated_setImmediate(func){setImmediates.push(func);if(ENVIRONMENT_IS_WORKER){if(Module["setImmediates"]===undefined)Module["setImmediates"]=[];Module["setImmediates"].push(func);postMessage({target:emscriptenMainLoopMessageId})}else postMessage(emscriptenMainLoopMessageId,"*")}}else{Browser.setImmediate=setImmediate}}Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setImmediate(){Browser.setImmediate(Browser.mainLoop.runner)};Browser.mainLoop.method="immediate"}return 0};var _emscripten_get_now;_emscripten_get_now=()=>performance.now();var setMainLoop=(browserIterationFunc,fps,simulateInfiniteLoop,arg,noSetTiming)=>{assert(!Browser.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.");Browser.mainLoop.func=browserIterationFunc;Browser.mainLoop.arg=arg;var thisMainLoopId=Browser.mainLoop.currentlyRunningMainloop;function checkIsRunning(){if(thisMainLoopId0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}Browser.mainLoop.updateStatus();if(!checkIsRunning())return;setTimeout(Browser.mainLoop.runner,0);return}if(!checkIsRunning())return;Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0;if(Browser.mainLoop.timingMode==1&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else if(Browser.mainLoop.timingMode==0){Browser.mainLoop.tickStartTime=_emscripten_get_now()}GL.newRenderingFrameStarted();Browser.mainLoop.runIter(browserIterationFunc);if(!checkIsRunning())return;if(typeof SDL=="object"&&SDL.audio&&SDL.audio.queueNewAudioData)SDL.audio.queueNewAudioData();Browser.mainLoop.scheduler()};if(!noSetTiming){if(fps&&fps>0){_emscripten_set_main_loop_timing(0,1e3/fps)}else{_emscripten_set_main_loop_timing(1,1)}Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"unwind"}};var handleException=e=>{if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0;var _proc_exit=code=>{EXITSTATUS=code;if(!keepRuntimeAlive()){if(Module["onExit"])Module["onExit"](code);ABORT=true}quit_(code,new ExitStatus(code))};var exitJS=(status,implicit)=>{EXITSTATUS=status;_proc_exit(status)};var _exit=exitJS;var maybeExit=()=>{if(!keepRuntimeAlive()){try{_exit(EXITSTATUS)}catch(e){handleException(e)}}};var callUserCallback=func=>{if(ABORT){return}try{func();maybeExit()}catch(e){handleException(e)}};var safeSetTimeout=(func,timeout)=>setTimeout(()=>{callUserCallback(func)},timeout);var warnOnce=text=>{if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text)}};var Browser={mainLoop:{running:false,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++},resume(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;setMainLoop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()},updateStatus(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining{assert(img.complete,`Image ${name} could not be decoded`);var canvas=document.createElement("canvas");canvas.width=img.width;canvas.height=img.height;var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);preloadedImages[name]=canvas;URL.revokeObjectURL(url);if(onload)onload(byteArray)};img.onerror=event=>{err(`Image ${url} could not be decoded`);if(onerror)onerror()};img.src=url};preloadPlugins.push(imagePlugin);var audioPlugin={};audioPlugin["canHandle"]=function audioPlugin_canHandle(name){return!Module.noAudioDecoding&&name.substr(-4)in{".ogg":1,".wav":1,".mp3":1}};audioPlugin["handle"]=function audioPlugin_handle(byteArray,name,onload,onerror){var done=false;function finish(audio){if(done)return;done=true;preloadedAudios[name]=audio;if(onload)onload(byteArray)}var b=new Blob([byteArray],{type:Browser.getMimetype(name)});var url=URL.createObjectURL(b);var audio=new Audio;audio.addEventListener("canplaythrough",()=>finish(audio),false);audio.onerror=function audio_onerror(event){if(done)return;err(`warning: browser could not fully decode audio ${name}, trying slower base64 approach`);function encode64(data){var BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var PAD="=";var ret="";var leftchar=0;var leftbits=0;for(var i=0;i=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src="data:audio/x-"+name.substr(-3)+";base64,"+encode64(byteArray);finish(audio)};audio.src=url;safeSetTimeout(()=>{finish(audio)},1e4)};preloadPlugins.push(audioPlugin);function pointerLockChange(){Browser.pointerLock=document["pointerLockElement"]===Module["canvas"]||document["mozPointerLockElement"]===Module["canvas"]||document["webkitPointerLockElement"]===Module["canvas"]||document["msPointerLockElement"]===Module["canvas"]}var canvas=Module["canvas"];if(canvas){canvas.requestPointerLock=canvas["requestPointerLock"]||canvas["mozRequestPointerLock"]||canvas["webkitRequestPointerLock"]||canvas["msRequestPointerLock"]||(()=>{});canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||(()=>{});canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener("pointerlockchange",pointerLockChange,false);document.addEventListener("mozpointerlockchange",pointerLockChange,false);document.addEventListener("webkitpointerlockchange",pointerLockChange,false);document.addEventListener("mspointerlockchange",pointerLockChange,false);if(Module["elementPointerLock"]){canvas.addEventListener("click",ev=>{if(!Browser.pointerLock&&Module["canvas"].requestPointerLock){Module["canvas"].requestPointerLock();ev.preventDefault()}},false)}}},createContext(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false,majorVersion:1};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}if(typeof GL!="undefined"){contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}}}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx=="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach(callback=>callback());Browser.init()}return ctx},destroyContext(canvas,useWebGL,setInModule){},fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen(lockPointer,resizeCanvas){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;if(typeof Browser.lockPointer=="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas=="undefined")Browser.resizeCanvas=false;var canvas=Module["canvas"];function fullscreenChange(){Browser.isFullscreen=false;var canvasContainer=canvas.parentNode;if((document["fullscreenElement"]||document["mozFullScreenElement"]||document["msFullscreenElement"]||document["webkitFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvasContainer){canvas.exitFullscreen=Browser.exitFullscreen;if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullscreen=true;if(Browser.resizeCanvas){Browser.setFullscreenCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas){Browser.setWindowedCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}if(Module["onFullScreen"])Module["onFullScreen"](Browser.isFullscreen);if(Module["onFullscreen"])Module["onFullscreen"](Browser.isFullscreen)}if(!Browser.fullscreenHandlersInstalled){Browser.fullscreenHandlersInstalled=true;document.addEventListener("fullscreenchange",fullscreenChange,false);document.addEventListener("mozfullscreenchange",fullscreenChange,false);document.addEventListener("webkitfullscreenchange",fullscreenChange,false);document.addEventListener("MSFullscreenChange",fullscreenChange,false)}var canvasContainer=document.createElement("div");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullscreen=canvasContainer["requestFullscreen"]||canvasContainer["mozRequestFullScreen"]||canvasContainer["msRequestFullscreen"]||(canvasContainer["webkitRequestFullscreen"]?()=>canvasContainer["webkitRequestFullscreen"](Element["ALLOW_KEYBOARD_INPUT"]):null)||(canvasContainer["webkitRequestFullScreen"]?()=>canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"]):null);canvasContainer.requestFullscreen()},exitFullscreen(){if(!Browser.isFullscreen){return false}var CFS=document["exitFullscreen"]||document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["msExitFullscreen"]||document["webkitCancelFullScreen"]||(()=>{});CFS.apply(document,[]);return true},nextRAF:0,fakeRequestAnimationFrame(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)},requestAnimationFrame(func){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(func);return}var RAF=Browser.fakeRequestAnimationFrame;RAF(func)},safeSetTimeout(func,timeout){return safeSetTimeout(func,timeout)},safeRequestAnimationFrame(func){return Browser.requestAnimationFrame(()=>{callUserCallback(func)})},getMimetype(name){return{"jpg":"image/jpeg","jpeg":"image/jpeg","png":"image/png","bmp":"image/bmp","ogg":"audio/ogg","wav":"audio/wav","mp3":"audio/mpeg"}[name.substr(name.lastIndexOf(".")+1)]},getUserMedia(func){if(!window.getUserMedia){window.getUserMedia=navigator["getUserMedia"]||navigator["mozGetUserMedia"]}window.getUserMedia(func)},getMovementX(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0},getMovementY(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0},getMouseWheelDelta(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail/3;break;case"mousewheel":delta=event.wheelDelta/120;break;case"wheel":delta=event.deltaY;switch(event.deltaMode){case 0:delta/=100;break;case 1:delta/=3;break;case 2:delta*=80;break;default:throw"unrecognized mouse wheel delta mode: "+event.deltaMode}break;default:throw"unrecognized mouse wheel event: "+event.type}return delta},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent(event){if(Browser.pointerLock){if(event.type!="mousemove"&&"mozMovementX"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!="undefined"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{var rect=Module["canvas"].getBoundingClientRect();var cw=Module["canvas"].width;var ch=Module["canvas"].height;var scrollX=typeof window.scrollX!="undefined"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!="undefined"?window.scrollY:window.pageYOffset;if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};if(event.type==="touchstart"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type==="touchend"||event.type==="touchmove"){var last=Browser.touches[touch.identifier];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}},resizeListeners:[],updateResizeListeners(){var canvas=Module["canvas"];Browser.resizeListeners.forEach(listener=>listener(canvas.width,canvas.height))},setCanvasSize(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags|8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags&~8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},updateCanvasDimensions(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module["forcedAspectRatio"]&&Module["forcedAspectRatio"]>0){if(w/h>2];if(param==12321){var alphaSize=HEAP32[attribList+4>>2];EGL.contextAttributes.alpha=alphaSize>0}else if(param==12325){var depthSize=HEAP32[attribList+4>>2];EGL.contextAttributes.depth=depthSize>0}else if(param==12326){var stencilSize=HEAP32[attribList+4>>2];EGL.contextAttributes.stencil=stencilSize>0}else if(param==12337){var samples=HEAP32[attribList+4>>2];EGL.contextAttributes.antialias=samples>0}else if(param==12338){var samples=HEAP32[attribList+4>>2];EGL.contextAttributes.antialias=samples==1}else if(param==12544){var requestedPriority=HEAP32[attribList+4>>2];EGL.contextAttributes.lowLatency=requestedPriority!=12547}else if(param==12344){break}attribList+=8}}if((!config||!config_size)&&!numConfigs){EGL.setErrorCode(12300);return 0}if(numConfigs){HEAP32[numConfigs>>2]=1}if(config&&config_size>0){HEAPU32[config>>2]=62002}EGL.setErrorCode(12288);return 1}};var _eglBindAPI=api=>{if(api==12448){EGL.setErrorCode(12288);return 1}EGL.setErrorCode(12300);return 0};var _eglChooseConfig=(display,attrib_list,configs,config_size,numConfigs)=>EGL.chooseConfig(display,attrib_list,configs,config_size,numConfigs);var webgl_enable_ANGLE_instanced_arrays=ctx=>{var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=(index,divisor)=>ext["vertexAttribDivisorANGLE"](index,divisor);ctx["drawArraysInstanced"]=(mode,first,count,primcount)=>ext["drawArraysInstancedANGLE"](mode,first,count,primcount);ctx["drawElementsInstanced"]=(mode,count,type,indices,primcount)=>ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount);return 1}};var webgl_enable_OES_vertex_array_object=ctx=>{var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=()=>ext["createVertexArrayOES"]();ctx["deleteVertexArray"]=vao=>ext["deleteVertexArrayOES"](vao);ctx["bindVertexArray"]=vao=>ext["bindVertexArrayOES"](vao);ctx["isVertexArray"]=vao=>ext["isVertexArrayOES"](vao);return 1}};var webgl_enable_WEBGL_draw_buffers=ctx=>{var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=(n,bufs)=>ext["drawBuffersWEBGL"](n,bufs);return 1}};var webgl_enable_WEBGL_multi_draw=ctx=>!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"));var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:table=>{var ret=GL.counter++;for(var i=table.length;i32-Math.clz32(i===0?0:i-1),generateTempBuffers:(quads,context)=>{var largestIndex=GL.log2ceilLookup(GL.MAX_TEMP_BUFFER_SIZE);context.tempVertexBufferCounters1=[];context.tempVertexBufferCounters2=[];context.tempVertexBufferCounters1.length=context.tempVertexBufferCounters2.length=largestIndex+1;context.tempVertexBuffers1=[];context.tempVertexBuffers2=[];context.tempVertexBuffers1.length=context.tempVertexBuffers2.length=largestIndex+1;context.tempIndexBuffers=[];context.tempIndexBuffers.length=largestIndex+1;for(var i=0;i<=largestIndex;++i){context.tempIndexBuffers[i]=null;context.tempVertexBufferCounters1[i]=context.tempVertexBufferCounters2[i]=0;var ringbufferLength=GL.numTempVertexBuffersPerSize;context.tempVertexBuffers1[i]=[];context.tempVertexBuffers2[i]=[];var ringbuffer1=context.tempVertexBuffers1[i];var ringbuffer2=context.tempVertexBuffers2[i];ringbuffer1.length=ringbuffer2.length=ringbufferLength;for(var j=0;j>1;var quadIndexes=new Uint16Array(numIndexes);var i=0,v=0;while(1){quadIndexes[i++]=v;if(i>=numIndexes)break;quadIndexes[i++]=v+1;if(i>=numIndexes)break;quadIndexes[i++]=v+2;if(i>=numIndexes)break;quadIndexes[i++]=v;if(i>=numIndexes)break;quadIndexes[i++]=v+2;if(i>=numIndexes)break;quadIndexes[i++]=v+3;if(i>=numIndexes)break;v+=4}context.GLctx.bufferData(34963,quadIndexes,35044);context.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:function getTempVertexBuffer(sizeBytes){var idx=GL.log2ceilLookup(sizeBytes);var ringbuffer=GL.currentContext.tempVertexBuffers1[idx];var nextFreeBufferIndex=GL.currentContext.tempVertexBufferCounters1[idx];GL.currentContext.tempVertexBufferCounters1[idx]=GL.currentContext.tempVertexBufferCounters1[idx]+1&GL.numTempVertexBuffersPerSize-1;var vbo=ringbuffer[nextFreeBufferIndex];if(vbo){return vbo}var prevVBO=GLctx.getParameter(34964);ringbuffer[nextFreeBufferIndex]=GLctx.createBuffer();GLctx.bindBuffer(34962,ringbuffer[nextFreeBufferIndex]);GLctx.bufferData(34962,1<{var source="";for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}var type=GLctx.getShaderParameter(GL.shaders[shader],35663);if(type==35632){if(GLEmulation.findToken(source,"dFdx")||GLEmulation.findToken(source,"dFdy")||GLEmulation.findToken(source,"fwidth")){source="#extension GL_OES_standard_derivatives : enable\n"+source;var extension=GLctx.getExtension("OES_standard_derivatives")}}return source},createContext:(canvas,webGLContextAttributes)=>{if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;function fixedGetContext(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}canvas.getContext=fixedGetContext}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:(ctx,webGLContextAttributes)=>{var handle=GL.getNewId(GL.contexts);var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault=="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:contextHandle=>{GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:contextHandle=>GL.contexts[contextHandle],deleteContext:contextHandle=>{if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents=="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;GL.contexts[contextHandle]=null},initExtensions:context=>{if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;context.compressionExt=GLctx.getExtension("WEBGL_compressed_texture_s3tc");context.anisotropicExt=GLctx.getExtension("EXT_texture_filter_anisotropic");webgl_enable_ANGLE_instanced_arrays(GLctx);webgl_enable_OES_vertex_array_object(GLctx);webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(ext=>{if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})},getExtensions(){var exts=GLctx.getSupportedExtensions()||[];exts=exts.concat(exts.map(e=>"GL_"+e));return exts}};var _eglCreateContext=(display,config,hmm,contextAttribs)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}var glesContextVersion=1;for(;;){var param=HEAP32[contextAttribs>>2];if(param==12440){glesContextVersion=HEAP32[contextAttribs+4>>2]}else if(param==12344){break}else{EGL.setErrorCode(12292);return 0}contextAttribs+=8}if(glesContextVersion!=2){EGL.setErrorCode(12293);return 0}EGL.contextAttributes.majorVersion=glesContextVersion-1;EGL.contextAttributes.minorVersion=0;EGL.context=GL.createContext(Module["canvas"],EGL.contextAttributes);if(EGL.context!=0){EGL.setErrorCode(12288);GL.makeContextCurrent(EGL.context);Module.useWebGL=true;Browser.moduleContextCreatedCallbacks.forEach(function(callback){callback()});GL.makeContextCurrent(null);return 62004}else{EGL.setErrorCode(12297);return 0}};var _eglCreateWindowSurface=(display,config,win,attrib_list)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(config!=62002){EGL.setErrorCode(12293);return 0}EGL.setErrorCode(12288);return 62006};var _eglDestroyContext=(display,context)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(context!=62004){EGL.setErrorCode(12294);return 0}GL.deleteContext(EGL.context);EGL.setErrorCode(12288);if(EGL.currentContext==context){EGL.currentContext=0}return 1};var _eglDestroySurface=(display,surface)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(surface!=62006){EGL.setErrorCode(12301);return 1}if(EGL.currentReadSurface==surface){EGL.currentReadSurface=0}if(EGL.currentDrawSurface==surface){EGL.currentDrawSurface=0}EGL.setErrorCode(12288);return 1};var _eglGetConfigAttrib=(display,config,attribute,value)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(config!=62002){EGL.setErrorCode(12293);return 0}if(!value){EGL.setErrorCode(12300);return 0}EGL.setErrorCode(12288);switch(attribute){case 12320:HEAP32[value>>2]=EGL.contextAttributes.alpha?32:24;return 1;case 12321:HEAP32[value>>2]=EGL.contextAttributes.alpha?8:0;return 1;case 12322:HEAP32[value>>2]=8;return 1;case 12323:HEAP32[value>>2]=8;return 1;case 12324:HEAP32[value>>2]=8;return 1;case 12325:HEAP32[value>>2]=EGL.contextAttributes.depth?24:0;return 1;case 12326:HEAP32[value>>2]=EGL.contextAttributes.stencil?8:0;return 1;case 12327:HEAP32[value>>2]=12344;return 1;case 12328:HEAP32[value>>2]=62002;return 1;case 12329:HEAP32[value>>2]=0;return 1;case 12330:HEAP32[value>>2]=4096;return 1;case 12331:HEAP32[value>>2]=16777216;return 1;case 12332:HEAP32[value>>2]=4096;return 1;case 12333:HEAP32[value>>2]=0;return 1;case 12334:HEAP32[value>>2]=0;return 1;case 12335:HEAP32[value>>2]=12344;return 1;case 12337:HEAP32[value>>2]=EGL.contextAttributes.antialias?4:0;return 1;case 12338:HEAP32[value>>2]=EGL.contextAttributes.antialias?1:0;return 1;case 12339:HEAP32[value>>2]=4;return 1;case 12340:HEAP32[value>>2]=12344;return 1;case 12341:case 12342:case 12343:HEAP32[value>>2]=-1;return 1;case 12345:case 12346:HEAP32[value>>2]=0;return 1;case 12347:HEAP32[value>>2]=0;return 1;case 12348:HEAP32[value>>2]=1;return 1;case 12349:case 12350:HEAP32[value>>2]=0;return 1;case 12351:HEAP32[value>>2]=12430;return 1;case 12352:HEAP32[value>>2]=4;return 1;case 12354:HEAP32[value>>2]=0;return 1;default:EGL.setErrorCode(12292);return 0}};var _eglGetDisplay=nativeDisplayType=>{EGL.setErrorCode(12288);return 62e3};var _eglGetError=()=>EGL.errorCode;var _eglInitialize=(display,majorVersion,minorVersion)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(majorVersion){HEAP32[majorVersion>>2]=1}if(minorVersion){HEAP32[minorVersion>>2]=4}EGL.defaultDisplayInitialized=true;EGL.setErrorCode(12288);return 1};var _eglMakeCurrent=(display,draw,read,context)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(context!=0&&context!=62004){EGL.setErrorCode(12294);return 0}if(read!=0&&read!=62006||draw!=0&&draw!=62006){EGL.setErrorCode(12301);return 0}GL.makeContextCurrent(context?EGL.context:null);EGL.currentContext=context;EGL.currentDrawSurface=draw;EGL.currentReadSurface=read;EGL.setErrorCode(12288);return 1};var stringToNewUTF8=str=>{var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8(str,ret,size);return ret};var _eglQueryString=(display,name)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}EGL.setErrorCode(12288);if(EGL.stringCache[name])return EGL.stringCache[name];var ret;switch(name){case 12371:ret=stringToNewUTF8("Emscripten");break;case 12372:ret=stringToNewUTF8("1.4 Emscripten EGL");break;case 12373:ret=stringToNewUTF8("");break;case 12429:ret=stringToNewUTF8("OpenGL_ES");break;default:EGL.setErrorCode(12300);return 0}EGL.stringCache[name]=ret;return ret};var _eglSwapBuffers=(dpy,surface)=>{if(!EGL.defaultDisplayInitialized){EGL.setErrorCode(12289)}else if(!Module.ctx){EGL.setErrorCode(12290)}else if(Module.ctx.isContextLost()){EGL.setErrorCode(12302)}else{EGL.setErrorCode(12288);return 1}return 0};var _eglSwapInterval=(display,interval)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(interval==0)_emscripten_set_main_loop_timing(0,0);else _emscripten_set_main_loop_timing(1,interval);EGL.setErrorCode(12288);return 1};var _eglTerminate=display=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}EGL.currentContext=0;EGL.currentReadSurface=0;EGL.currentDrawSurface=0;EGL.defaultDisplayInitialized=false;EGL.setErrorCode(12288);return 1};var _eglWaitClient=()=>{EGL.setErrorCode(12288);return 1};var _eglWaitGL=_eglWaitClient;var _eglWaitNative=nativeEngineId=>{EGL.setErrorCode(12288);return 1};var readEmAsmArgsArray=[];var readEmAsmArgs=(sigPtr,buf)=>{readEmAsmArgsArray.length=0;var ch;while(ch=HEAPU8[sigPtr++]){var wide=ch!=105;wide&=ch!=112;buf+=wide&&buf%8?4:0;readEmAsmArgsArray.push(ch==112?HEAPU32[buf>>2]:ch==105?HEAP32[buf>>2]:HEAPF64[buf>>3]);buf+=wide?8:4}return readEmAsmArgsArray};var runEmAsmFunction=(code,sigPtr,argbuf)=>{var args=readEmAsmArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)};var _emscripten_asm_const_int=(code,sigPtr,argbuf)=>runEmAsmFunction(code,sigPtr,argbuf);var runMainThreadEmAsm=(code,sigPtr,argbuf,sync)=>{var args=readEmAsmArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)};var _emscripten_asm_const_int_sync_on_main_thread=(code,sigPtr,argbuf)=>runMainThreadEmAsm(code,sigPtr,argbuf,1);var _emscripten_date_now=()=>Date.now();var withStackSave=f=>{var stack=stackSave();var ret=f();stackRestore(stack);return ret};var JSEvents={inEventHandler:0,removeAllEventListeners(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort((x,y)=>x.precedence{for(var i=0;icString>2?UTF8ToString(cString):cString;var specialHTMLTargets=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];var findEventTarget=target=>{target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!="undefined"?document.querySelector(target):undefined);return domElement};var findCanvasEventTarget=target=>findEventTarget(target);var _emscripten_get_canvas_element_size=(target,width,height)=>{var canvas=findCanvasEventTarget(target);if(!canvas)return-4;HEAP32[width>>2]=canvas.width;HEAP32[height>>2]=canvas.height};var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var getCanvasElementSize=target=>withStackSave(()=>{var w=stackAlloc(8);var h=w+4;var targetInt=stringToUTF8OnStack(target.id);var ret=_emscripten_get_canvas_element_size(targetInt,w,h);var size=[HEAP32[w>>2],HEAP32[h>>2]];return size});var _emscripten_set_canvas_element_size=(target,width,height)=>{var canvas=findCanvasEventTarget(target);if(!canvas)return-4;canvas.width=width;canvas.height=height;return 0};var setCanvasElementSize=(target,width,height)=>{if(!target.controlTransferredOffscreen){target.width=width;target.height=height}else{withStackSave(()=>{var targetInt=stringToUTF8OnStack(target.id);_emscripten_set_canvas_element_size(targetInt,width,height)})}};var registerRestoreOldStyle=canvas=>{var canvasSize=getCanvasElementSize(canvas);var oldWidth=canvasSize[0];var oldHeight=canvasSize[1];var oldCssWidth=canvas.style.width;var oldCssHeight=canvas.style.height;var oldBackgroundColor=canvas.style.backgroundColor;var oldDocumentBackgroundColor=document.body.style.backgroundColor;var oldPaddingLeft=canvas.style.paddingLeft;var oldPaddingRight=canvas.style.paddingRight;var oldPaddingTop=canvas.style.paddingTop;var oldPaddingBottom=canvas.style.paddingBottom;var oldMarginLeft=canvas.style.marginLeft;var oldMarginRight=canvas.style.marginRight;var oldMarginTop=canvas.style.marginTop;var oldMarginBottom=canvas.style.marginBottom;var oldDocumentBodyMargin=document.body.style.margin;var oldDocumentOverflow=document.documentElement.style.overflow;var oldDocumentScroll=document.body.scroll;var oldImageRendering=canvas.style.imageRendering;function restoreOldStyle(){var fullscreenElement=document.fullscreenElement||document.webkitFullscreenElement;if(!fullscreenElement){document.removeEventListener("fullscreenchange",restoreOldStyle);document.removeEventListener("webkitfullscreenchange",restoreOldStyle);setCanvasElementSize(canvas,oldWidth,oldHeight);canvas.style.width=oldCssWidth;canvas.style.height=oldCssHeight;canvas.style.backgroundColor=oldBackgroundColor;if(!oldDocumentBackgroundColor)document.body.style.backgroundColor="white";document.body.style.backgroundColor=oldDocumentBackgroundColor;canvas.style.paddingLeft=oldPaddingLeft;canvas.style.paddingRight=oldPaddingRight;canvas.style.paddingTop=oldPaddingTop;canvas.style.paddingBottom=oldPaddingBottom;canvas.style.marginLeft=oldMarginLeft;canvas.style.marginRight=oldMarginRight;canvas.style.marginTop=oldMarginTop;canvas.style.marginBottom=oldMarginBottom;document.body.style.margin=oldDocumentBodyMargin;document.documentElement.style.overflow=oldDocumentOverflow;document.body.scroll=oldDocumentScroll;canvas.style.imageRendering=oldImageRendering;if(canvas.GLctxObject)canvas.GLctxObject.GLctx.viewport(0,0,oldWidth,oldHeight);if(currentFullscreenStrategy.canvasResizedCallback){getWasmTableEntry(currentFullscreenStrategy.canvasResizedCallback)(37,0,currentFullscreenStrategy.canvasResizedCallbackUserData)}}}document.addEventListener("fullscreenchange",restoreOldStyle);document.addEventListener("webkitfullscreenchange",restoreOldStyle);return restoreOldStyle};var setLetterbox=(element,topBottom,leftRight)=>{element.style.paddingLeft=element.style.paddingRight=leftRight+"px";element.style.paddingTop=element.style.paddingBottom=topBottom+"px"};var getBoundingClientRect=e=>specialHTMLTargets.indexOf(e)<0?e.getBoundingClientRect():{"left":0,"top":0};var JSEvents_resizeCanvasForFullscreen=(target,strategy)=>{var restoreOldStyle=registerRestoreOldStyle(target);var cssWidth=strategy.softFullscreen?innerWidth:screen.width;var cssHeight=strategy.softFullscreen?innerHeight:screen.height;var rect=getBoundingClientRect(target);var windowedCssWidth=rect.width;var windowedCssHeight=rect.height;var canvasSize=getCanvasElementSize(target);var windowedRttWidth=canvasSize[0];var windowedRttHeight=canvasSize[1];if(strategy.scaleMode==3){setLetterbox(target,(cssHeight-windowedCssHeight)/2,(cssWidth-windowedCssWidth)/2);cssWidth=windowedCssWidth;cssHeight=windowedCssHeight}else if(strategy.scaleMode==2){if(cssWidth*windowedRttHeight{if(strategy.scaleMode!=0||strategy.canvasResolutionScaleMode!=0){JSEvents_resizeCanvasForFullscreen(target,strategy)}if(target.requestFullscreen){target.requestFullscreen()}else if(target.webkitRequestFullscreen){target.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}else{return JSEvents.fullscreenEnabled()?-3:-1}currentFullscreenStrategy=strategy;if(strategy.canvasResizedCallback){getWasmTableEntry(strategy.canvasResizedCallback)(37,0,strategy.canvasResizedCallbackUserData)}return 0};var _emscripten_exit_fullscreen=()=>{if(!JSEvents.fullscreenEnabled())return-1;JSEvents.removeDeferredCalls(JSEvents_requestFullscreen);var d=specialHTMLTargets[1];if(d.exitFullscreen){d.fullscreenElement&&d.exitFullscreen()}else if(d.webkitExitFullscreen){d.webkitFullscreenElement&&d.webkitExitFullscreen()}else{return-1}return 0};var requestPointerLock=target=>{if(target.requestPointerLock){target.requestPointerLock()}else{if(document.body.requestPointerLock){return-3}return-1}return 0};var _emscripten_exit_pointerlock=()=>{JSEvents.removeDeferredCalls(requestPointerLock);if(document.exitPointerLock){document.exitPointerLock()}else{return-1}return 0};var _emscripten_get_device_pixel_ratio=()=>typeof devicePixelRatio=="number"&&devicePixelRatio||1;var _emscripten_get_element_css_size=(target,width,height)=>{target=findEventTarget(target);if(!target)return-4;var rect=getBoundingClientRect(target);HEAPF64[width>>3]=rect.width;HEAPF64[height>>3]=rect.height;return 0};var fillGamepadEventData=(eventStruct,e)=>{HEAPF64[eventStruct>>3]=e.timestamp;for(var i=0;i>3]=e.axes[i]}for(var i=0;i>3]=e.buttons[i].value}else{HEAPF64[eventStruct+i*8+528>>3]=e.buttons[i]}}for(var i=0;i>2]=e.buttons[i].pressed}else{HEAP32[eventStruct+i*4+1040>>2]=e.buttons[i]==1}}HEAP32[eventStruct+1296>>2]=e.connected;HEAP32[eventStruct+1300>>2]=e.index;HEAP32[eventStruct+8>>2]=e.axes.length;HEAP32[eventStruct+12>>2]=e.buttons.length;stringToUTF8(e.id,eventStruct+1304,64);stringToUTF8(e.mapping,eventStruct+1368,64)};var _emscripten_get_gamepad_status=(index,gamepadState)=>{if(index<0||index>=JSEvents.lastGamepadState.length)return-5;if(!JSEvents.lastGamepadState[index])return-7;fillGamepadEventData(gamepadState,JSEvents.lastGamepadState[index]);return 0};var _emscripten_get_num_gamepads=()=>JSEvents.lastGamepadState.length;var _emscripten_get_screen_size=(width,height)=>{HEAP32[width>>2]=screen.width;HEAP32[height>>2]=screen.height};function _glActiveTexture(x0){GLctx.activeTexture(x0)}var _emscripten_glActiveTexture=_glActiveTexture;var _glAlphaFunc=(func,ref)=>{switch(func){case 512:case 513:case 514:case 515:case 516:case 517:case 518:case 519:GLEmulation.alphaTestRef=ref;if(GLEmulation.alphaTestFunc!=func){GLEmulation.alphaTestFunc=func;GLImmediate.currentRenderer=null}break;default:break}};var _emscripten_glAlphaFunc=_glAlphaFunc;var _glAttachShader=(program,shader)=>{GLctx.attachShader(GL.programs[program],GL.shaders[shader])};var _emscripten_glAttachShader=_glAttachShader;function _glEnable(x0){GLctx.enable(x0)}function _glDisable(x0){GLctx.disable(x0)}function _glIsEnabled(x0){return GLctx.isEnabled(x0)}var writeI53ToI64=(ptr,num)=>{HEAPU32[ptr>>2]=num;var lower=HEAPU32[ptr>>2];HEAPU32[ptr+4>>2]=(num-lower)/4294967296};var emscriptenWebGLGet=(name_,p,type)=>{if(!p){GL.recordError(1281);return}var ret=undefined;switch(name_){case 36346:ret=1;break;case 36344:if(type!=0&&type!=1){GL.recordError(1280)}return;case 36345:ret=0;break;case 34466:var formats=GLctx.getParameter(34467);ret=formats?formats.length:0;break}if(ret===undefined){var result=GLctx.getParameter(name_);switch(typeof result){case"number":ret=result;break;case"boolean":ret=result?1:0;break;case"string":GL.recordError(1280);return;case"object":if(result===null){switch(name_){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:{ret=0;break}default:{GL.recordError(1280);return}}}else if(result instanceof Float32Array||result instanceof Uint32Array||result instanceof Int32Array||result instanceof Array){for(var i=0;i>2]=result[i];break;case 2:HEAPF32[p+i*4>>2]=result[i];break;case 4:HEAP8[p+i>>0]=result[i]?1:0;break}}return}else{try{ret=result.name|0}catch(e){GL.recordError(1280);err("GL_INVALID_ENUM in glGet"+type+"v: Unknown object returned from WebGL getParameter("+name_+")! (error: "+e+")");return}}break;default:GL.recordError(1280);err("GL_INVALID_ENUM in glGet"+type+"v: Native code calling glGet"+type+"v("+name_+") and it returns "+result+" of type "+typeof result+"!");return}}switch(type){case 1:writeI53ToI64(p,ret);break;case 0:HEAP32[p>>2]=ret;break;case 2:HEAPF32[p>>2]=ret;break;case 4:HEAP8[p>>0]=ret?1:0;break}};var _glGetBooleanv=(name_,p)=>{emscriptenWebGLGet(name_,p,4)};var _glGetIntegerv=(name_,p)=>{emscriptenWebGLGet(name_,p,0)};var _glGetString=name_=>{var ret=GL.stringCache[name_];if(!ret){switch(name_){case 7939:ret=stringToNewUTF8(GL.getExtensions().join(" "));break;case 7936:case 7937:case 37445:case 37446:var s=GLctx.getParameter(name_);if(!s){GL.recordError(1280)}ret=s?stringToNewUTF8(s):0;break;case 7938:var glVersion=GLctx.getParameter(7938);{glVersion="OpenGL ES 2.0 ("+glVersion+")"}ret=stringToNewUTF8(glVersion);break;case 35724:var glslVersion=GLctx.getParameter(35724);var ver_re=/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;var ver_num=glslVersion.match(ver_re);if(ver_num!==null){if(ver_num[1].length==3)ver_num[1]=ver_num[1]+"0";glslVersion="OpenGL ES GLSL ES "+ver_num[1]+" ("+glslVersion+")"}ret=stringToNewUTF8(glslVersion);break;default:GL.recordError(1280)}GL.stringCache[name_]=ret}return ret};var _glCreateShader=shaderType=>{var id=GL.getNewId(GL.shaders);GL.shaders[id]=GLctx.createShader(shaderType);return id};var _glShaderSource=(shader,count,string,length)=>{var source=GL.getSource(shader,count,string,length);GLctx.shaderSource(GL.shaders[shader],source)};var _glCompileShader=shader=>{GLctx.compileShader(GL.shaders[shader])};var _glDetachShader=(program,shader)=>{GLctx.detachShader(GL.programs[program],GL.shaders[shader])};var _glUseProgram=program=>{program=GL.programs[program];GLctx.useProgram(program);GLctx.currentProgram=program};var _glDeleteProgram=id=>{if(!id)return;var program=GL.programs[id];if(!program){GL.recordError(1281);return}GLctx.deleteProgram(program);program.name=0;GL.programs[id]=null};var _glBindAttribLocation=(program,index,name)=>{GLctx.bindAttribLocation(GL.programs[program],index,UTF8ToString(name))};var _glLinkProgram=program=>{program=GL.programs[program];GLctx.linkProgram(program);program.uniformLocsById=0;program.uniformSizeAndIdsByName={}};var _glBindBuffer=(target,buffer)=>{if(target==34962){GLctx.currentArrayBufferBinding=buffer;GLImmediate.lastArrayBuffer=buffer}else if(target==34963){GLctx.currentElementArrayBufferBinding=buffer}GLctx.bindBuffer(target,GL.buffers[buffer])};var _glGetFloatv=(name_,p)=>{emscriptenWebGLGet(name_,p,2)};function _glHint(x0,x1){GLctx.hint(x0,x1)}var _glEnableVertexAttribArray=index=>{GLctx.enableVertexAttribArray(index)};var _glDisableVertexAttribArray=index=>{GLctx.disableVertexAttribArray(index)};var _glVertexAttribPointer=(index,size,type,normalized,stride,ptr)=>{GLctx.vertexAttribPointer(index,size,type,!!normalized,stride,ptr)};var ptrToString=ptr=>{ptr>>>=0;return"0x"+ptr.toString(16).padStart(8,"0")};var GLEmulation={fogStart:0,fogEnd:1,fogDensity:1,fogColor:null,fogMode:2048,fogEnabled:false,MAX_CLIP_PLANES:6,clipPlaneEnabled:[false,false,false,false,false,false],clipPlaneEquation:[],lightingEnabled:false,lightModelAmbient:null,lightModelLocalViewer:false,lightModelTwoSide:false,materialAmbient:null,materialDiffuse:null,materialSpecular:null,materialShininess:null,materialEmission:null,MAX_LIGHTS:8,lightEnabled:[false,false,false,false,false,false,false,false],lightAmbient:[],lightDiffuse:[],lightSpecular:[],lightPosition:[],alphaTestEnabled:false,alphaTestFunc:519,alphaTestRef:0,pointSize:1,vaos:[],currentVao:null,enabledVertexAttribArrays:{},hasRunInit:false,findToken(source,token){function isIdentChar(ch){if(ch>=48&&ch<=57)return true;if(ch>=65&&ch<=90)return true;if(ch>=97&&ch<=122)return true;return false}var i=-1;do{i=source.indexOf(token,i+1);if(i<0){break}if(i>0&&isIdentChar(source[i-1])){continue}i+=token.length;if(i{if(GLImmediate.lastRenderer)GLImmediate.lastRenderer.cleanup();if(cap==2912){if(GLEmulation.fogEnabled!=true){GLImmediate.currentRenderer=null;GLEmulation.fogEnabled=true}return}else if(cap>=12288&&cap<12294){var clipPlaneId=cap-12288;if(GLEmulation.clipPlaneEnabled[clipPlaneId]!=true){GLImmediate.currentRenderer=null;GLEmulation.clipPlaneEnabled[clipPlaneId]=true}return}else if(cap>=16384&&cap<16392){var lightId=cap-16384;if(GLEmulation.lightEnabled[lightId]!=true){GLImmediate.currentRenderer=null;GLEmulation.lightEnabled[lightId]=true}return}else if(cap==2896){if(GLEmulation.lightingEnabled!=true){GLImmediate.currentRenderer=null;GLEmulation.lightingEnabled=true}return}else if(cap==3008){if(GLEmulation.alphaTestEnabled!=true){GLImmediate.currentRenderer=null;GLEmulation.alphaTestEnabled=true}return}else if(cap==3553){return}else if(!(cap in validCapabilities)){return}glEnable(cap)};var glDisable=_glDisable;_glDisable=_emscripten_glDisable=cap=>{if(GLImmediate.lastRenderer)GLImmediate.lastRenderer.cleanup();if(cap==2912){if(GLEmulation.fogEnabled!=false){GLImmediate.currentRenderer=null;GLEmulation.fogEnabled=false}return}else if(cap>=12288&&cap<12294){var clipPlaneId=cap-12288;if(GLEmulation.clipPlaneEnabled[clipPlaneId]!=false){GLImmediate.currentRenderer=null;GLEmulation.clipPlaneEnabled[clipPlaneId]=false}return}else if(cap>=16384&&cap<16392){var lightId=cap-16384;if(GLEmulation.lightEnabled[lightId]!=false){GLImmediate.currentRenderer=null;GLEmulation.lightEnabled[lightId]=false}return}else if(cap==2896){if(GLEmulation.lightingEnabled!=false){GLImmediate.currentRenderer=null;GLEmulation.lightingEnabled=false}return}else if(cap==3008){if(GLEmulation.alphaTestEnabled!=false){GLImmediate.currentRenderer=null;GLEmulation.alphaTestEnabled=false}return}else if(cap==3553){return}else if(!(cap in validCapabilities)){return}glDisable(cap)};_glIsEnabled=_emscripten_glIsEnabled=cap=>{if(cap==2912){return GLEmulation.fogEnabled?1:0}else if(cap>=12288&&cap<12294){var clipPlaneId=cap-12288;return GLEmulation.clipPlaneEnabled[clipPlaneId]?1:0}else if(cap>=16384&&cap<16392){var lightId=cap-16384;return GLEmulation.lightEnabled[lightId]?1:0}else if(cap==2896){return GLEmulation.lightingEnabled?1:0}else if(cap==3008){return GLEmulation.alphaTestEnabled?1:0}else if(!(cap in validCapabilities)){return 0}return GLctx.isEnabled(cap)};var glGetBooleanv=_glGetBooleanv;_glGetBooleanv=_emscripten_glGetBooleanv=(pname,p)=>{var attrib=GLEmulation.getAttributeFromCapability(pname);if(attrib!==null){var result=GLImmediate.enabledClientAttributes[attrib];HEAP8[p>>0]=result===true?1:0;return}glGetBooleanv(pname,p)};var glGetIntegerv=_glGetIntegerv;_glGetIntegerv=_emscripten_glGetIntegerv=(pname,params)=>{switch(pname){case 34018:pname=GLctx.MAX_TEXTURE_IMAGE_UNITS;break;case 35658:{var result=GLctx.getParameter(GLctx.MAX_VERTEX_UNIFORM_VECTORS);HEAP32[params>>2]=result*4;return}case 35657:{var result=GLctx.getParameter(GLctx.MAX_FRAGMENT_UNIFORM_VECTORS);HEAP32[params>>2]=result*4;return}case 35659:{var result=GLctx.getParameter(GLctx.MAX_VARYING_VECTORS);HEAP32[params>>2]=result*4;return}case 34929:pname=GLctx.MAX_COMBINED_TEXTURE_IMAGE_UNITS;break;case 32890:{var attribute=GLImmediate.clientAttributes[GLImmediate.VERTEX];HEAP32[params>>2]=attribute?attribute.size:0;return}case 32891:{var attribute=GLImmediate.clientAttributes[GLImmediate.VERTEX];HEAP32[params>>2]=attribute?attribute.type:0;return}case 32892:{var attribute=GLImmediate.clientAttributes[GLImmediate.VERTEX];HEAP32[params>>2]=attribute?attribute.stride:0;return}case 32897:{var attribute=GLImmediate.clientAttributes[GLImmediate.COLOR];HEAP32[params>>2]=attribute?attribute.size:0;return}case 32898:{var attribute=GLImmediate.clientAttributes[GLImmediate.COLOR];HEAP32[params>>2]=attribute?attribute.type:0;return}case 32899:{var attribute=GLImmediate.clientAttributes[GLImmediate.COLOR];HEAP32[params>>2]=attribute?attribute.stride:0;return}case 32904:{var attribute=GLImmediate.clientAttributes[GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture];HEAP32[params>>2]=attribute?attribute.size:0;return}case 32905:{var attribute=GLImmediate.clientAttributes[GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture];HEAP32[params>>2]=attribute?attribute.type:0;return}case 32906:{var attribute=GLImmediate.clientAttributes[GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture];HEAP32[params>>2]=attribute?attribute.stride:0;return}case 3378:{HEAP32[params>>2]=GLEmulation.MAX_CLIP_PLANES;return}case 2976:{HEAP32[params>>2]=GLImmediate.currentMatrix+5888;return}case 3009:{HEAP32[params>>2]=GLEmulation.alphaTestFunc;return}}glGetIntegerv(pname,params)};var glGetString=_glGetString;_glGetString=_emscripten_glGetString=name_=>{if(GL.stringCache[name_])return GL.stringCache[name_];switch(name_){case 7939:var ret=stringToNewUTF8((GLctx.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"+(GL.currentContext.compressionExt?" GL_ARB_texture_compression GL_EXT_texture_compression_s3tc":"")+(GL.currentContext.anisotropicExt?" GL_EXT_texture_filter_anisotropic":""));return GL.stringCache[name_]=ret}return glGetString(name_)};GL.shaderInfos={};var glCreateShader=_glCreateShader;_glCreateShader=_emscripten_glCreateShader=shaderType=>{var id=glCreateShader(shaderType);GL.shaderInfos[id]={type:shaderType,ftransform:false};return id};function ensurePrecision(source){if(!/precision +(low|medium|high)p +float *;/.test(source)){source="#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n"+source}return source}_glShaderSource=_emscripten_glShaderSource=(shader,count,string,length)=>{var source=GL.getSource(shader,count,string,length);if(GL.shaderInfos[shader].type==GLctx.VERTEX_SHADER){var has_pm=source.search(/u_projection/)>=0;var has_mm=source.search(/u_modelView/)>=0;var has_pv=source.search(/a_position/)>=0;var need_pm=0,need_mm=0,need_pv=0;var old=source;source=source.replace(/ftransform\(\)/g,"(u_projection * u_modelView * a_position)");if(old!=source)need_pm=need_mm=need_pv=1;old=source;source=source.replace(/gl_ProjectionMatrix/g,"u_projection");if(old!=source)need_pm=1;old=source;source=source.replace(/gl_ModelViewMatrixTranspose\[2\]/g,"vec4(u_modelView[0][2], u_modelView[1][2], u_modelView[2][2], u_modelView[3][2])");if(old!=source)need_mm=1;old=source;source=source.replace(/gl_ModelViewMatrix/g,"u_modelView");if(old!=source)need_mm=1;old=source;source=source.replace(/gl_Vertex/g,"a_position");if(old!=source)need_pv=1;old=source;source=source.replace(/gl_ModelViewProjectionMatrix/g,"(u_projection * u_modelView)");if(old!=source)need_pm=need_mm=1;if(need_pv&&!has_pv)source="attribute vec4 a_position; \n"+source;if(need_mm&&!has_mm)source="uniform mat4 u_modelView; \n"+source;if(need_pm&&!has_pm)source="uniform mat4 u_projection; \n"+source;GL.shaderInfos[shader].ftransform=need_pm||need_mm||need_pv;for(var i=0;i{GLctx.compileShader(GL.shaders[shader])};GL.programShaders={};var glAttachShader=_glAttachShader;_glAttachShader=_emscripten_glAttachShader=(program,shader)=>{if(!GL.programShaders[program])GL.programShaders[program]=[];GL.programShaders[program].push(shader);glAttachShader(program,shader)};var glDetachShader=_glDetachShader;_glDetachShader=_emscripten_glDetachShader=(program,shader)=>{var programShader=GL.programShaders[program];if(!programShader){err(`WARNING: _glDetachShader received invalid program: ${program}`);return}var index=programShader.indexOf(shader);programShader.splice(index,1);glDetachShader(program,shader)};var glUseProgram=_glUseProgram;_glUseProgram=_emscripten_glUseProgram=program=>{if(GL.currProgram!=program){GLImmediate.currentRenderer=null;GL.currProgram=program;GLImmediate.fixedFunctionProgram=0;glUseProgram(program)}};var glDeleteProgram=_glDeleteProgram;_glDeleteProgram=_emscripten_glDeleteProgram=program=>{glDeleteProgram(program);if(program==GL.currProgram){GLImmediate.currentRenderer=null;GL.currProgram=0}};var zeroUsedPrograms={};var glBindAttribLocation=_glBindAttribLocation;_glBindAttribLocation=_emscripten_glBindAttribLocation=(program,index,name)=>{if(index==0)zeroUsedPrograms[program]=true;glBindAttribLocation(program,index,name)};var glLinkProgram=_glLinkProgram;_glLinkProgram=_emscripten_glLinkProgram=program=>{if(!(program in zeroUsedPrograms)){GLctx.bindAttribLocation(GL.programs[program],0,"a_position")}glLinkProgram(program)};var glBindBuffer=_glBindBuffer;_glBindBuffer=_emscripten_glBindBuffer=(target,buffer)=>{glBindBuffer(target,buffer);if(target==GLctx.ARRAY_BUFFER){if(GLEmulation.currentVao){GLEmulation.currentVao.arrayBuffer=buffer}}else if(target==GLctx.ELEMENT_ARRAY_BUFFER){if(GLEmulation.currentVao)GLEmulation.currentVao.elementArrayBuffer=buffer}};var glGetFloatv=_glGetFloatv;_glGetFloatv=_emscripten_glGetFloatv=(pname,params)=>{if(pname==2982){HEAPF32.set(GLImmediate.matrix[0],params>>2)}else if(pname==2983){HEAPF32.set(GLImmediate.matrix[1],params>>2)}else if(pname==2984){HEAPF32.set(GLImmediate.matrix[2+GLImmediate.clientActiveTexture],params>>2)}else if(pname==2918){HEAPF32.set(GLEmulation.fogColor,params>>2)}else if(pname==2915){HEAPF32[params>>2]=GLEmulation.fogStart}else if(pname==2916){HEAPF32[params>>2]=GLEmulation.fogEnd}else if(pname==2914){HEAPF32[params>>2]=GLEmulation.fogDensity}else if(pname==2917){HEAPF32[params>>2]=GLEmulation.fogMode}else if(pname==2899){HEAPF32[params>>2]=GLEmulation.lightModelAmbient[0];HEAPF32[params+4>>2]=GLEmulation.lightModelAmbient[1];HEAPF32[params+8>>2]=GLEmulation.lightModelAmbient[2];HEAPF32[params+12>>2]=GLEmulation.lightModelAmbient[3]}else if(pname==3010){HEAPF32[params>>2]=GLEmulation.alphaTestRef}else{glGetFloatv(pname,params)}};var glHint=_glHint;_glHint=_emscripten_glHint=(target,mode)=>{if(target==34031){return}glHint(target,mode)};var glEnableVertexAttribArray=_glEnableVertexAttribArray;_glEnableVertexAttribArray=_emscripten_glEnableVertexAttribArray=index=>{glEnableVertexAttribArray(index);GLEmulation.enabledVertexAttribArrays[index]=1;if(GLEmulation.currentVao)GLEmulation.currentVao.enabledVertexAttribArrays[index]=1};var glDisableVertexAttribArray=_glDisableVertexAttribArray;_glDisableVertexAttribArray=_emscripten_glDisableVertexAttribArray=index=>{glDisableVertexAttribArray(index);delete GLEmulation.enabledVertexAttribArrays[index];if(GLEmulation.currentVao)delete GLEmulation.currentVao.enabledVertexAttribArrays[index]};var glVertexAttribPointer=_glVertexAttribPointer;_glVertexAttribPointer=_emscripten_glVertexAttribPointer=(index,size,type,normalized,stride,pointer)=>{glVertexAttribPointer(index,size,type,normalized,stride,pointer);if(GLEmulation.currentVao){GLEmulation.currentVao.vertexAttribPointers[index]=[index,size,type,normalized,stride,pointer]}}},getAttributeFromCapability(cap){var attrib=null;switch(cap){case 3553:case 32888:attrib=GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture;break;case 32884:attrib=GLImmediate.VERTEX;break;case 32885:attrib=GLImmediate.NORMAL;break;case 32886:attrib=GLImmediate.COLOR;break}return attrib}};var GLImmediate={MapTreeLib:null,spawnMapTreeLib:()=>{function CNaiveListMap(){var list=[];this.insert=function CNaiveListMap_insert(key,val){if(this.contains(key|0))return false;list.push([key,val]);return true};var __contains_i;this.contains=function CNaiveListMap_contains(key){for(__contains_i=0;__contains_inew CMapTree}},TexEnvJIT:null,spawnTexEnvJIT:()=>{var GL_TEXTURE0=33984;var GL_TEXTURE_1D=3552;var GL_TEXTURE_2D=3553;var GL_TEXTURE_3D=32879;var GL_TEXTURE_CUBE_MAP=34067;var GL_TEXTURE_ENV=8960;var GL_TEXTURE_ENV_MODE=8704;var GL_TEXTURE_ENV_COLOR=8705;var GL_SRC0_RGB=34176;var GL_SRC1_RGB=34177;var GL_SRC2_RGB=34178;var GL_SRC0_ALPHA=34184;var GL_SRC1_ALPHA=34185;var GL_SRC2_ALPHA=34186;var GL_OPERAND0_RGB=34192;var GL_OPERAND1_RGB=34193;var GL_OPERAND2_RGB=34194;var GL_OPERAND0_ALPHA=34200;var GL_OPERAND1_ALPHA=34201;var GL_OPERAND2_ALPHA=34202;var GL_COMBINE_RGB=34161;var GL_COMBINE_ALPHA=34162;var GL_RGB_SCALE=34163;var GL_ALPHA_SCALE=3356;var GL_ADD=260;var GL_BLEND=3042;var GL_REPLACE=7681;var GL_MODULATE=8448;var GL_DECAL=8449;var GL_COMBINE=34160;var GL_SUBTRACT=34023;var GL_INTERPOLATE=34165;var GL_TEXTURE=5890;var GL_CONSTANT=34166;var GL_PRIMARY_COLOR=34167;var GL_PREVIOUS=34168;var GL_SRC_COLOR=768;var GL_ONE_MINUS_SRC_COLOR=769;var GL_SRC_ALPHA=770;var GL_ONE_MINUS_SRC_ALPHA=771;var TEXENVJIT_NAMESPACE_PREFIX="tej_";var TEX_UNIT_UNIFORM_PREFIX="uTexUnit";var TEX_COORD_VARYING_PREFIX="vTexCoord";var PRIM_COLOR_VARYING="vPrimColor";var TEX_MATRIX_UNIFORM_PREFIX="uTexMatrix";var s_texUnits=null;var s_activeTexture=0;var s_requiredTexUnitsForPass=[];function abort(info){assert(false,"[TexEnvJIT] ABORT: "+info)}function abort_noSupport(info){abort("No support: "+info)}function abort_sanity(info){abort("Sanity failure: "+info)}function genTexUnitSampleExpr(texUnitID){var texUnit=s_texUnits[texUnitID];var texType=texUnit.getTexType();var func=null;switch(texType){case GL_TEXTURE_1D:func="texture2D";break;case GL_TEXTURE_2D:func="texture2D";break;case GL_TEXTURE_3D:return abort_noSupport("No support for 3D textures.");case GL_TEXTURE_CUBE_MAP:func="textureCube";break;default:return abort_sanity("Unknown texType: "+ptrToString(texType))}var texCoordExpr=TEX_COORD_VARYING_PREFIX+texUnitID;if(TEX_MATRIX_UNIFORM_PREFIX!=null){texCoordExpr="("+TEX_MATRIX_UNIFORM_PREFIX+texUnitID+" * "+texCoordExpr+")"}return func+"("+TEX_UNIT_UNIFORM_PREFIX+texUnitID+", "+texCoordExpr+".xy)"}function getTypeFromCombineOp(op){switch(op){case GL_SRC_COLOR:case GL_ONE_MINUS_SRC_COLOR:return"vec3";case GL_SRC_ALPHA:case GL_ONE_MINUS_SRC_ALPHA:return"float"}return abort_noSupport("Unsupported combiner op: "+ptrToString(op))}function getCurTexUnit(){return s_texUnits[s_activeTexture]}function genCombinerSourceExpr(texUnitID,constantExpr,previousVar,src,op){var srcExpr=null;switch(src){case GL_TEXTURE:srcExpr=genTexUnitSampleExpr(texUnitID);break;case GL_CONSTANT:srcExpr=constantExpr;break;case GL_PRIMARY_COLOR:srcExpr=PRIM_COLOR_VARYING;break;case GL_PREVIOUS:srcExpr=previousVar;break;default:return abort_noSupport("Unsupported combiner src: "+ptrToString(src))}var expr=null;switch(op){case GL_SRC_COLOR:expr=srcExpr+".rgb";break;case GL_ONE_MINUS_SRC_COLOR:expr="(vec3(1.0) - "+srcExpr+".rgb)";break;case GL_SRC_ALPHA:expr=srcExpr+".a";break;case GL_ONE_MINUS_SRC_ALPHA:expr="(1.0 - "+srcExpr+".a)";break;default:return abort_noSupport("Unsupported combiner op: "+ptrToString(op))}return expr}function valToFloatLiteral(val){if(val==Math.round(val))return val+".0";return val}function CTexEnv(){this.mode=GL_MODULATE;this.colorCombiner=GL_MODULATE;this.alphaCombiner=GL_MODULATE;this.colorScale=1;this.alphaScale=1;this.envColor=[0,0,0,0];this.colorSrc=[GL_TEXTURE,GL_PREVIOUS,GL_CONSTANT];this.alphaSrc=[GL_TEXTURE,GL_PREVIOUS,GL_CONSTANT];this.colorOp=[GL_SRC_COLOR,GL_SRC_COLOR,GL_SRC_ALPHA];this.alphaOp=[GL_SRC_ALPHA,GL_SRC_ALPHA,GL_SRC_ALPHA];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 k=this.traverseKey;var key=k[this.mode]*1638400;key+=k[this.colorCombiner]*327680;key+=k[this.alphaCombiner]*65536;key+=(this.colorScale-1)*16384;key+=(this.alphaScale-1)*4096;key+=k[this.colorSrc[0]]*1024;key+=k[this.colorSrc[1]]*256;key+=k[this.colorSrc[2]]*64;key+=k[this.alphaSrc[0]]*16;key+=k[this.alphaSrc[1]]*4;key+=k[this.alphaSrc[2]];return key};this.computeKey1=function(){var k=this.traverseKey;var key=k[this.colorOp[0]]*4096;key+=k[this.colorOp[1]]*1024;key+=k[this.colorOp[2]]*256;key+=k[this.alphaOp[0]]*16;key+=k[this.alphaOp[1]]*4;key+=k[this.alphaOp[2]];return key};this.computeKey2=function(){return this.envColor[0]*16777216+this.envColor[1]*65536+this.envColor[2]*256+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;GLImmediate.currentRenderer=null}}function CTexUnit(){this.env=new CTexEnv;this.enabled_tex1D=false;this.enabled_tex2D=false;this.enabled_tex3D=false;this.enabled_texCube=false;this.texTypesEnabled=0;this.traverseState=function CTexUnit_traverseState(keyView){if(this.texTypesEnabled){if(this.env.key0==-1){this.env.recomputeKey()}keyView.next(this.texTypesEnabled|this.env.key0<<4);keyView.next(this.env.key1);keyView.next(this.env.key2)}else{keyView.next(0)}}}CTexUnit.prototype.enabled=function CTexUnit_enabled(){return this.texTypesEnabled};CTexUnit.prototype.genPassLines=function CTexUnit_genPassLines(passOutputVar,passInputVar,texUnitID){if(!this.enabled()){return["vec4 "+passOutputVar+" = "+passInputVar+";"]}var lines=this.env.genPassLines(passOutputVar,passInputVar,texUnitID).join("\n");var texLoadLines="";var texLoadRegex=/(texture.*?\(.*?\))/g;var loadCounter=0;var load;while(load=texLoadRegex.exec(lines)){var texLoadExpr=load[1];var secondOccurrence=lines.slice(load.index+1).indexOf(texLoadExpr);if(secondOccurrence!=-1){var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var texLoadVar=prefix+"texload"+loadCounter++;var texLoadLine="vec4 "+texLoadVar+" = "+texLoadExpr+";\n";texLoadLines+=texLoadLine+"\n";lines=lines.split(texLoadExpr).join(texLoadVar);texLoadRegex=/(texture.*\(.*\))/g}}return[texLoadLines+lines]};CTexUnit.prototype.getTexType=function CTexUnit_getTexType(){if(this.enabled_texCube){return GL_TEXTURE_CUBE_MAP}else if(this.enabled_tex3D){return GL_TEXTURE_3D}else if(this.enabled_tex2D){return GL_TEXTURE_2D}else if(this.enabled_tex1D){return GL_TEXTURE_1D}return 0};CTexEnv.prototype.genPassLines=function CTexEnv_genPassLines(passOutputVar,passInputVar,texUnitID){switch(this.mode){case GL_REPLACE:{return["vec4 "+passOutputVar+" = "+genTexUnitSampleExpr(texUnitID)+";"]}case GL_ADD:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var texVar=prefix+"tex";var colorVar=prefix+"color";var alphaVar=prefix+"alpha";return["vec4 "+texVar+" = "+genTexUnitSampleExpr(texUnitID)+";","vec3 "+colorVar+" = "+passInputVar+".rgb + "+texVar+".rgb;","float "+alphaVar+" = "+passInputVar+".a * "+texVar+".a;","vec4 "+passOutputVar+" = vec4("+colorVar+", "+alphaVar+");"]}case GL_MODULATE:{var line=["vec4 "+passOutputVar," = ",passInputVar," * ",genTexUnitSampleExpr(texUnitID),";"];return[line.join("")]}case GL_DECAL:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var texVar=prefix+"tex";var colorVar=prefix+"color";var alphaVar=prefix+"alpha";return["vec4 "+texVar+" = "+genTexUnitSampleExpr(texUnitID)+";",["vec3 "+colorVar+" = ",passInputVar+".rgb * (1.0 - "+texVar+".a)"," + ",texVar+".rgb * "+texVar+".a",";"].join(""),"float "+alphaVar+" = "+passInputVar+".a;","vec4 "+passOutputVar+" = vec4("+colorVar+", "+alphaVar+");"]}case GL_BLEND:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var texVar=prefix+"tex";var colorVar=prefix+"color";var alphaVar=prefix+"alpha";return["vec4 "+texVar+" = "+genTexUnitSampleExpr(texUnitID)+";",["vec3 "+colorVar+" = ",passInputVar+".rgb * (1.0 - "+texVar+".rgb)"," + ",PRIM_COLOR_VARYING+".rgb * "+texVar+".rgb",";"].join(""),"float "+alphaVar+" = "+texVar+".a;","vec4 "+passOutputVar+" = vec4("+colorVar+", "+alphaVar+");"]}case GL_COMBINE:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var colorVar=prefix+"color";var alphaVar=prefix+"alpha";var colorLines=this.genCombinerLines(true,colorVar,passInputVar,texUnitID,this.colorCombiner,this.colorSrc,this.colorOp);var alphaLines=this.genCombinerLines(false,alphaVar,passInputVar,texUnitID,this.alphaCombiner,this.alphaSrc,this.alphaOp);var scaledColor=this.colorScale==1?colorVar:colorVar+" * "+valToFloatLiteral(this.colorScale);var scaledAlpha=this.alphaScale==1?alphaVar:alphaVar+" * "+valToFloatLiteral(this.alphaScale);var line=["vec4 "+passOutputVar," = ","vec4(",scaledColor,", ",scaledAlpha,")",";"].join("");return[].concat(colorLines,alphaLines,[line])}}return abort_noSupport("Unsupported TexEnv mode: "+ptrToString(this.mode))};CTexEnv.prototype.genCombinerLines=function CTexEnv_getCombinerLines(isColor,outputVar,passInputVar,texUnitID,combiner,srcArr,opArr){var argsNeeded=null;switch(combiner){case GL_REPLACE:argsNeeded=1;break;case GL_MODULATE:case GL_ADD:case GL_SUBTRACT:argsNeeded=2;break;case GL_INTERPOLATE:argsNeeded=3;break;default:return abort_noSupport("Unsupported combiner: "+ptrToString(combiner))}var constantExpr=["vec4(",valToFloatLiteral(this.envColor[0]),", ",valToFloatLiteral(this.envColor[1]),", ",valToFloatLiteral(this.envColor[2]),", ",valToFloatLiteral(this.envColor[3]),")"].join("");var src0Expr=argsNeeded>=1?genCombinerSourceExpr(texUnitID,constantExpr,passInputVar,srcArr[0],opArr[0]):null;var src1Expr=argsNeeded>=2?genCombinerSourceExpr(texUnitID,constantExpr,passInputVar,srcArr[1],opArr[1]):null;var src2Expr=argsNeeded>=3?genCombinerSourceExpr(texUnitID,constantExpr,passInputVar,srcArr[2],opArr[2]):null;var outputType=isColor?"vec3":"float";var lines=null;switch(combiner){case GL_REPLACE:{var line=[outputType+" "+outputVar," = ",src0Expr,";"];lines=[line.join("")];break}case GL_MODULATE:{var line=[outputType+" "+outputVar+" = ",src0Expr+" * "+src1Expr,";"];lines=[line.join("")];break}case GL_ADD:{var line=[outputType+" "+outputVar+" = ",src0Expr+" + "+src1Expr,";"];lines=[line.join("")];break}case GL_SUBTRACT:{var line=[outputType+" "+outputVar+" = ",src0Expr+" - "+src1Expr,";"];lines=[line.join("")];break}case GL_INTERPOLATE:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var arg2Var=prefix+"colorSrc2";var arg2Line=getTypeFromCombineOp(this.colorOp[2])+" "+arg2Var+" = "+src2Expr+";";var line=[outputType+" "+outputVar," = ",src0Expr+" * "+arg2Var," + ",src1Expr+" * (1.0 - "+arg2Var+")",";"];lines=[arg2Line,line.join("")];break}default:return abort_sanity("Unmatched TexEnv.colorCombiner?")}return lines};return{init:(gl,specifiedMaxTextureImageUnits)=>{var maxTexUnits=0;if(specifiedMaxTextureImageUnits){maxTexUnits=specifiedMaxTextureImageUnits}else if(gl){maxTexUnits=gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)}s_texUnits=[];for(var i=0;i{TEX_UNIT_UNIFORM_PREFIX=uTexUnitPrefix;TEX_COORD_VARYING_PREFIX=vTexCoordPrefix;PRIM_COLOR_VARYING=vPrimColor;TEX_MATRIX_UNIFORM_PREFIX=uTexMatrixPrefix},genAllPassLines:(resultDest,indentSize=0)=>{s_requiredTexUnitsForPass.length=0;var lines=[];var lastPassVar=PRIM_COLOR_VARYING;for(var i=0;is_requiredTexUnitsForPass,getActiveTexture:()=>s_activeTexture,traverseState:keyView=>{for(var i=0;is_texUnits[texUnitID].getTexType(),hook_activeTexture:texture=>{s_activeTexture=texture-GL_TEXTURE0;if(GLImmediate.currentMatrix>=2){GLImmediate.currentMatrix=2+s_activeTexture}},hook_enable:cap=>{var cur=getCurTexUnit();switch(cap){case GL_TEXTURE_1D:if(!cur.enabled_tex1D){GLImmediate.currentRenderer=null;cur.enabled_tex1D=true;cur.texTypesEnabled|=1}break;case GL_TEXTURE_2D:if(!cur.enabled_tex2D){GLImmediate.currentRenderer=null;cur.enabled_tex2D=true;cur.texTypesEnabled|=2}break;case GL_TEXTURE_3D:if(!cur.enabled_tex3D){GLImmediate.currentRenderer=null;cur.enabled_tex3D=true;cur.texTypesEnabled|=4}break;case GL_TEXTURE_CUBE_MAP:if(!cur.enabled_texCube){GLImmediate.currentRenderer=null;cur.enabled_texCube=true;cur.texTypesEnabled|=8}break}},hook_disable:cap=>{var cur=getCurTexUnit();switch(cap){case GL_TEXTURE_1D:if(cur.enabled_tex1D){GLImmediate.currentRenderer=null;cur.enabled_tex1D=false;cur.texTypesEnabled&=~1}break;case GL_TEXTURE_2D:if(cur.enabled_tex2D){GLImmediate.currentRenderer=null;cur.enabled_tex2D=false;cur.texTypesEnabled&=~2}break;case GL_TEXTURE_3D:if(cur.enabled_tex3D){GLImmediate.currentRenderer=null;cur.enabled_tex3D=false;cur.texTypesEnabled&=~4}break;case GL_TEXTURE_CUBE_MAP:if(cur.enabled_texCube){GLImmediate.currentRenderer=null;cur.enabled_texCube=false;cur.texTypesEnabled&=~8}break}},hook_texEnvf(target,pname,param){if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_RGB_SCALE:if(env.colorScale!=param){env.invalidateKey();env.colorScale=param}break;case GL_ALPHA_SCALE:if(env.alphaScale!=param){env.invalidateKey();env.alphaScale=param}break;default:err("WARNING: Unhandled `pname` in call to `glTexEnvf`.")}},hook_texEnvi(target,pname,param){if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_TEXTURE_ENV_MODE:if(env.mode!=param){env.invalidateKey();env.mode=param}break;case GL_COMBINE_RGB:if(env.colorCombiner!=param){env.invalidateKey();env.colorCombiner=param}break;case GL_COMBINE_ALPHA:if(env.alphaCombiner!=param){env.invalidateKey();env.alphaCombiner=param}break;case GL_SRC0_RGB:if(env.colorSrc[0]!=param){env.invalidateKey();env.colorSrc[0]=param}break;case GL_SRC1_RGB:if(env.colorSrc[1]!=param){env.invalidateKey();env.colorSrc[1]=param}break;case GL_SRC2_RGB:if(env.colorSrc[2]!=param){env.invalidateKey();env.colorSrc[2]=param}break;case GL_SRC0_ALPHA:if(env.alphaSrc[0]!=param){env.invalidateKey();env.alphaSrc[0]=param}break;case GL_SRC1_ALPHA:if(env.alphaSrc[1]!=param){env.invalidateKey();env.alphaSrc[1]=param}break;case GL_SRC2_ALPHA:if(env.alphaSrc[2]!=param){env.invalidateKey();env.alphaSrc[2]=param}break;case GL_OPERAND0_RGB:if(env.colorOp[0]!=param){env.invalidateKey();env.colorOp[0]=param}break;case GL_OPERAND1_RGB:if(env.colorOp[1]!=param){env.invalidateKey();env.colorOp[1]=param}break;case GL_OPERAND2_RGB:if(env.colorOp[2]!=param){env.invalidateKey();env.colorOp[2]=param}break;case GL_OPERAND0_ALPHA:if(env.alphaOp[0]!=param){env.invalidateKey();env.alphaOp[0]=param}break;case GL_OPERAND1_ALPHA:if(env.alphaOp[1]!=param){env.invalidateKey();env.alphaOp[1]=param}break;case GL_OPERAND2_ALPHA:if(env.alphaOp[2]!=param){env.invalidateKey();env.alphaOp[2]=param}break;case GL_RGB_SCALE:if(env.colorScale!=param){env.invalidateKey();env.colorScale=param}break;case GL_ALPHA_SCALE:if(env.alphaScale!=param){env.invalidateKey();env.alphaScale=param}break;default:err("WARNING: Unhandled `pname` in call to `glTexEnvi`.")}},hook_texEnvfv(target,pname,params){if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_TEXTURE_ENV_COLOR:{for(var i=0;i<4;i++){var param=HEAPF32[params+i*4>>2];if(env.envColor[i]!=param){env.invalidateKey();env.envColor[i]=param}}break}default:err("WARNING: Unhandled `pname` in call to `glTexEnvfv`.")}},hook_getTexEnviv(target,pname,param){if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_TEXTURE_ENV_MODE:HEAP32[param>>2]=env.mode;return;case GL_TEXTURE_ENV_COLOR:HEAP32[param>>2]=Math.max(Math.min(env.envColor[0]*255,255,-255));HEAP32[param+1>>2]=Math.max(Math.min(env.envColor[1]*255,255,-255));HEAP32[param+2>>2]=Math.max(Math.min(env.envColor[2]*255,255,-255));HEAP32[param+3>>2]=Math.max(Math.min(env.envColor[3]*255,255,-255));return;case GL_COMBINE_RGB:HEAP32[param>>2]=env.colorCombiner;return;case GL_COMBINE_ALPHA:HEAP32[param>>2]=env.alphaCombiner;return;case GL_SRC0_RGB:HEAP32[param>>2]=env.colorSrc[0];return;case GL_SRC1_RGB:HEAP32[param>>2]=env.colorSrc[1];return;case GL_SRC2_RGB:HEAP32[param>>2]=env.colorSrc[2];return;case GL_SRC0_ALPHA:HEAP32[param>>2]=env.alphaSrc[0];return;case GL_SRC1_ALPHA:HEAP32[param>>2]=env.alphaSrc[1];return;case GL_SRC2_ALPHA:HEAP32[param>>2]=env.alphaSrc[2];return;case GL_OPERAND0_RGB:HEAP32[param>>2]=env.colorOp[0];return;case GL_OPERAND1_RGB:HEAP32[param>>2]=env.colorOp[1];return;case GL_OPERAND2_RGB:HEAP32[param>>2]=env.colorOp[2];return;case GL_OPERAND0_ALPHA:HEAP32[param>>2]=env.alphaOp[0];return;case GL_OPERAND1_ALPHA:HEAP32[param>>2]=env.alphaOp[1];return;case GL_OPERAND2_ALPHA:HEAP32[param>>2]=env.alphaOp[2];return;case GL_RGB_SCALE:HEAP32[param>>2]=env.colorScale;return;case GL_ALPHA_SCALE:HEAP32[param>>2]=env.alphaScale;return;default:err("WARNING: Unhandled `pname` in call to `glGetTexEnvi`.")}},hook_getTexEnvfv:(target,pname,param)=>{if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_TEXTURE_ENV_COLOR:HEAPF32[param>>2]=env.envColor[0];HEAPF32[param+4>>2]=env.envColor[1];HEAPF32[param+8>>2]=env.envColor[2];HEAPF32[param+12>>2]=env.envColor[3];return}}}},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:false,useTextureMatrix:false,VERTEX:0,NORMAL:1,COLOR:2,TEXTURE0:3,NUM_ATTRIBUTES:-1,MAX_TEXTURES:-1,totalEnabledClientAttributes:0,enabledClientAttributes:[0,0],clientAttributes:[],liveClientAttributes:[],currentRenderer:null,modifiedClientAttributes:false,clientActiveTexture:0,clientColor:null,usedTexUnitList:[],fixedFunctionProgram:null,setClientAttribute(name,size,type,stride,pointer){var attrib=GLImmediate.clientAttributes[name];if(!attrib){for(var i=0;i<=name;i++){if(!GLImmediate.clientAttributes[i]){GLImmediate.clientAttributes[i]={name:name,size:size,type:type,stride:stride,pointer:pointer,offset:0}}}}else{attrib.name=name;attrib.size=size;attrib.type=type;attrib.stride=stride;attrib.pointer=pointer;attrib.offset=0}GLImmediate.modifiedClientAttributes=true},addRendererComponent(name,size,type){if(!GLImmediate.rendererComponents[name]){GLImmediate.rendererComponents[name]=1;GLImmediate.enabledClientAttributes[name]=true;GLImmediate.setClientAttribute(name,size,type,0,GLImmediate.rendererComponentPointer);GLImmediate.rendererComponentPointer+=size*GL.byteSizeByType[type-GL.byteSizeByTypeRoot]}else{GLImmediate.rendererComponents[name]++}},disableBeginEndClientAttributes(){for(var i=0;i0&&this.normalLocation>=0;this.hasColor=this.colorLocation===0||this.colorLocation>0;this.floatType=GLctx.FLOAT;this.fogColorLocation=GLctx.getUniformLocation(this.program,"u_fogColor");this.fogEndLocation=GLctx.getUniformLocation(this.program,"u_fogEnd");this.fogScaleLocation=GLctx.getUniformLocation(this.program,"u_fogScale");this.fogDensityLocation=GLctx.getUniformLocation(this.program,"u_fogDensity");this.hasFog=!!(this.fogColorLocation||this.fogEndLocation||this.fogScaleLocation||this.fogDensityLocation);this.pointSizeLocation=GLctx.getUniformLocation(this.program,"u_pointSize");this.hasClipPlane=false;this.clipPlaneEquationLocation=[];for(var clipPlaneId=0;clipPlaneId>2,end>>2))}if(canSkip)return;GLImmediate.lastRenderer=this;GLImmediate.lastProgram=GL.currProgram||this.program;GLImmediate.lastStride=GLImmediate.stride;GLImmediate.matricesModified=false;if(!GL.currProgram){if(GLImmediate.fixedFunctionProgram!=this.program){GLctx.useProgram(this.program);GLImmediate.fixedFunctionProgram=this.program}}if(this.modelViewLocation&&this.modelViewMatrixVersion!=GLImmediate.matrixVersion[0]){this.modelViewMatrixVersion=GLImmediate.matrixVersion[0];GLctx.uniformMatrix4fv(this.modelViewLocation,false,GLImmediate.matrix[0]);if(GLEmulation.lightEnabled){var tmpMVinv=GLImmediate.matrixLib.mat4.create(GLImmediate.matrix[0]);GLImmediate.matrixLib.mat4.inverse(tmpMVinv);GLImmediate.matrixLib.mat4.transpose(tmpMVinv);GLctx.uniformMatrix3fv(this.normalMatrixLocation,false,GLImmediate.matrixLib.mat4.toMat3(tmpMVinv))}}if(this.projectionLocation&&this.projectionMatrixVersion!=GLImmediate.matrixVersion[1]){this.projectionMatrixVersion=GLImmediate.matrixVersion[1];GLctx.uniformMatrix4fv(this.projectionLocation,false,GLImmediate.matrix[1])}var clientAttributes=GLImmediate.clientAttributes;var posAttr=clientAttributes[GLImmediate.VERTEX];GLctx.vertexAttribPointer(this.positionLocation,posAttr.size,posAttr.type,false,GLImmediate.stride,posAttr.offset);GLctx.enableVertexAttribArray(this.positionLocation);if(this.hasNormal){var normalAttr=clientAttributes[GLImmediate.NORMAL];GLctx.vertexAttribPointer(this.normalLocation,normalAttr.size,normalAttr.type,true,GLImmediate.stride,normalAttr.offset);GLctx.enableVertexAttribArray(this.normalLocation)}if(this.hasTextures){for(var i=0;i=0){GLctx.disableVertexAttribArray(this.texCoordLocations[i])}}}if(this.hasColor){GLctx.disableVertexAttribArray(this.colorLocation)}if(this.hasNormal){GLctx.disableVertexAttribArray(this.normalLocation)}if(!GL.currProgram){GLctx.useProgram(null);GLImmediate.fixedFunctionProgram=0}if(!GLctx.currentArrayBufferBinding){GLctx.bindBuffer(GLctx.ARRAY_BUFFER,null);GLImmediate.lastArrayBuffer=null}GLImmediate.lastRenderer=null;GLImmediate.lastProgram=null;GLImmediate.matricesModified=true};this.init()}return new Renderer},setupFuncs(){GLImmediate.MapTreeLib=GLImmediate.spawnMapTreeLib();GLImmediate.spawnMapTreeLib=null;GLImmediate.TexEnvJIT=GLImmediate.spawnTexEnvJIT();GLImmediate.spawnTexEnvJIT=null;GLImmediate.setupHooks()},setupHooks(){if(!GLEmulation.hasRunInit){GLEmulation.init()}var glActiveTexture=_glActiveTexture;_glActiveTexture=_emscripten_glActiveTexture=texture=>{GLImmediate.TexEnvJIT.hook_activeTexture(texture);glActiveTexture(texture)};var glEnable=_glEnable;_glEnable=_emscripten_glEnable=cap=>{GLImmediate.TexEnvJIT.hook_enable(cap);glEnable(cap)};var glDisable=_glDisable;_glDisable=_emscripten_glDisable=cap=>{GLImmediate.TexEnvJIT.hook_disable(cap);glDisable(cap)};_glTexEnvf=_emscripten_glTexEnvf=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_texEnvf(target,pname,param)};_glTexEnvi=_emscripten_glTexEnvi=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_texEnvi(target,pname,param)};_glTexEnvfv=_emscripten_glTexEnvfv=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_texEnvfv(target,pname,param)};_glGetTexEnviv=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_getTexEnviv(target,pname,param)};_glGetTexEnvfv=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_getTexEnvfv(target,pname,param)};var glGetIntegerv=_glGetIntegerv;_glGetIntegerv=_emscripten_glGetIntegerv=(pname,params)=>{switch(pname){case 35725:{var cur=GLctx.getParameter(GLctx.CURRENT_PROGRAM);if(cur==GLImmediate.fixedFunctionProgram){HEAP32[params>>2]=0;return}break}}glGetIntegerv(pname,params)}},initted:false,init(){err("WARNING: using emscripten GL immediate mode emulation. This is very limited in what it supports");GLImmediate.initted=true;if(!Module.useWebGL)return;GLImmediate.MAX_TEXTURES=Math.min(Module["GL_MAX_TEXTURE_IMAGE_UNITS"]||GLctx.getParameter(GLctx.MAX_TEXTURE_IMAGE_UNITS),28);GLImmediate.TexEnvJIT.init(GLctx,GLImmediate.MAX_TEXTURES);GLImmediate.NUM_ATTRIBUTES=3+GLImmediate.MAX_TEXTURES;GLImmediate.clientAttributes=[];GLEmulation.enabledClientAttribIndices=[];for(var i=0;i>2);GLImmediate.indexData=new Uint16Array(GL.MAX_TEMP_BUFFER_SIZE>>1);GLImmediate.vertexDataU8=new Uint8Array(GLImmediate.tempData.buffer);GL.generateTempBuffers(true,GL.currentContext);GLImmediate.clientColor=new Float32Array([1,1,1,1])},prepareClientAttributes(count,beginEnd){if(!GLImmediate.modifiedClientAttributes){GLImmediate.vertexCounter=GLImmediate.stride*count/4;return}GLImmediate.modifiedClientAttributes=false;var clientStartPointer=2147483647;var bytes=0;var minStride=2147483647;var maxStride=0;var attributes=GLImmediate.liveClientAttributes;attributes.length=0;for(var i=0;i<3+GLImmediate.MAX_TEXTURES;i++){if(GLImmediate.enabledClientAttributes[i]){var attr=GLImmediate.clientAttributes[i];attributes.push(attr);clientStartPointer=Math.min(clientStartPointer,attr.pointer);attr.sizeBytes=attr.size*GL.byteSizeByType[attr.type-GL.byteSizeByTypeRoot];bytes+=attr.sizeBytes;minStride=Math.min(minStride,attr.stride);maxStride=Math.max(maxStride,attr.stride)}}if((minStride!=maxStride||maxStride>2;var srcStride4=Math.max(attr.sizeBytes,attr.stride)>>2;for(var j=0;j>2)+k]=HEAP32[(attr.pointer>>2)+j*srcStride4+k]}}}else{for(var j=0;jGLImmediate.lastVertex){for(var i=0;i>1];GLImmediate.firstVertex=Math.min(GLImmediate.firstVertex,currIndex);GLImmediate.lastVertex=Math.max(GLImmediate.lastVertex,currIndex+1)}}if(!GLctx.currentElementArrayBufferBinding){var indexBuffer=GL.getTempIndexBuffer(numProvidedIndexes<<1);GLctx.bindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,indexBuffer);GLctx.bufferSubData(GLctx.ELEMENT_ARRAY_BUFFER,0,HEAPU16.subarray(ptr>>1,ptr+(numProvidedIndexes<<1)>>1));ptr=0;emulatedElementArrayBuffer=true}}else if(GLImmediate.mode>6){if(GLImmediate.mode!=7)throw"unsupported immediate mode "+GLImmediate.mode;ptr=GLImmediate.firstVertex*3;var numQuads=numVertexes/4;numIndexes=numQuads*6;GLctx.bindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,GL.currentContext.tempQuadIndexBuffer);emulatedElementArrayBuffer=true;GLImmediate.mode=GLctx.TRIANGLES}renderer.prepare();if(numIndexes){GLctx.drawElements(GLImmediate.mode,numIndexes,GLctx.UNSIGNED_SHORT,ptr)}else{GLctx.drawArrays(GLImmediate.mode,startIndex,numVertexes)}if(emulatedElementArrayBuffer){GLctx.bindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,GL.buffers[GLctx.currentElementArrayBufferBinding]||null)}}};GLImmediate.matrixLib=function(){var vec3={};var mat3={};var mat4={};var quat4={};var MatrixArray=Float32Array;vec3.create=function(vec){var dest=new MatrixArray(3);if(vec){dest[0]=vec[0];dest[1]=vec[1];dest[2]=vec[2]}else{dest[0]=dest[1]=dest[2]=0}return dest};vec3.set=function(vec,dest){dest[0]=vec[0];dest[1]=vec[1];dest[2]=vec[2];return dest};vec3.add=function(vec,vec2,dest){if(!dest||vec===dest){vec[0]+=vec2[0];vec[1]+=vec2[1];vec[2]+=vec2[2];return vec}dest[0]=vec[0]+vec2[0];dest[1]=vec[1]+vec2[1];dest[2]=vec[2]+vec2[2];return dest};vec3.subtract=function(vec,vec2,dest){if(!dest||vec===dest){vec[0]-=vec2[0];vec[1]-=vec2[1];vec[2]-=vec2[2];return vec}dest[0]=vec[0]-vec2[0];dest[1]=vec[1]-vec2[1];dest[2]=vec[2]-vec2[2];return dest};vec3.multiply=function(vec,vec2,dest){if(!dest||vec===dest){vec[0]*=vec2[0];vec[1]*=vec2[1];vec[2]*=vec2[2];return vec}dest[0]=vec[0]*vec2[0];dest[1]=vec[1]*vec2[1];dest[2]=vec[2]*vec2[2];return dest};vec3.negate=function(vec,dest){if(!dest){dest=vec}dest[0]=-vec[0];dest[1]=-vec[1];dest[2]=-vec[2];return dest};vec3.scale=function(vec,val,dest){if(!dest||vec===dest){vec[0]*=val;vec[1]*=val;vec[2]*=val;return vec}dest[0]=vec[0]*val;dest[1]=vec[1]*val;dest[2]=vec[2]*val;return dest};vec3.normalize=function(vec,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2],len=Math.sqrt(x*x+y*y+z*z);if(!len){dest[0]=0;dest[1]=0;dest[2]=0;return dest}else if(len===1){dest[0]=x;dest[1]=y;dest[2]=z;return dest}len=1/len;dest[0]=x*len;dest[1]=y*len;dest[2]=z*len;return dest};vec3.cross=function(vec,vec2,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2],x2=vec2[0],y2=vec2[1],z2=vec2[2];dest[0]=y*z2-z*y2;dest[1]=z*x2-x*z2;dest[2]=x*y2-y*x2;return dest};vec3.length=function(vec){var x=vec[0],y=vec[1],z=vec[2];return Math.sqrt(x*x+y*y+z*z)};vec3.dot=function(vec,vec2){return vec[0]*vec2[0]+vec[1]*vec2[1]+vec[2]*vec2[2]};vec3.direction=function(vec,vec2,dest){if(!dest){dest=vec}var x=vec[0]-vec2[0],y=vec[1]-vec2[1],z=vec[2]-vec2[2],len=Math.sqrt(x*x+y*y+z*z);if(!len){dest[0]=0;dest[1]=0;dest[2]=0;return dest}len=1/len;dest[0]=x*len;dest[1]=y*len;dest[2]=z*len;return dest};vec3.lerp=function(vec,vec2,lerp,dest){if(!dest){dest=vec}dest[0]=vec[0]+lerp*(vec2[0]-vec[0]);dest[1]=vec[1]+lerp*(vec2[1]-vec[1]);dest[2]=vec[2]+lerp*(vec2[2]-vec[2]);return dest};vec3.dist=function(vec,vec2){var x=vec2[0]-vec[0],y=vec2[1]-vec[1],z=vec2[2]-vec[2];return Math.sqrt(x*x+y*y+z*z)};vec3.unproject=function(vec,view,proj,viewport,dest){if(!dest){dest=vec}var m=mat4.create();var v=new MatrixArray(4);v[0]=(vec[0]-viewport[0])*2/viewport[2]-1;v[1]=(vec[1]-viewport[1])*2/viewport[3]-1;v[2]=2*vec[2]-1;v[3]=1;mat4.multiply(proj,view,m);if(!mat4.inverse(m)){return null}mat4.multiplyVec4(m,v);if(v[3]===0){return null}dest[0]=v[0]/v[3];dest[1]=v[1]/v[3];dest[2]=v[2]/v[3];return dest};vec3.str=function(vec){return"["+vec[0]+", "+vec[1]+", "+vec[2]+"]"};mat3.create=function(mat){var dest=new MatrixArray(9);if(mat){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8]}return dest};mat3.set=function(mat,dest){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8];return dest};mat3.identity=function(dest){if(!dest){dest=mat3.create()}dest[0]=1;dest[1]=0;dest[2]=0;dest[3]=0;dest[4]=1;dest[5]=0;dest[6]=0;dest[7]=0;dest[8]=1;return dest};mat3.transpose=function(mat,dest){if(!dest||mat===dest){var a01=mat[1],a02=mat[2],a12=mat[5];mat[1]=mat[3];mat[2]=mat[6];mat[3]=a01;mat[5]=mat[7];mat[6]=a02;mat[7]=a12;return mat}dest[0]=mat[0];dest[1]=mat[3];dest[2]=mat[6];dest[3]=mat[1];dest[4]=mat[4];dest[5]=mat[7];dest[6]=mat[2];dest[7]=mat[5];dest[8]=mat[8];return dest};mat3.toMat4=function(mat,dest){if(!dest){dest=mat4.create()}dest[15]=1;dest[14]=0;dest[13]=0;dest[12]=0;dest[11]=0;dest[10]=mat[8];dest[9]=mat[7];dest[8]=mat[6];dest[7]=0;dest[6]=mat[5];dest[5]=mat[4];dest[4]=mat[3];dest[3]=0;dest[2]=mat[2];dest[1]=mat[1];dest[0]=mat[0];return dest};mat3.str=function(mat){return"["+mat[0]+", "+mat[1]+", "+mat[2]+", "+mat[3]+", "+mat[4]+", "+mat[5]+", "+mat[6]+", "+mat[7]+", "+mat[8]+"]"};mat4.create=function(mat){var dest=new MatrixArray(16);if(mat){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8];dest[9]=mat[9];dest[10]=mat[10];dest[11]=mat[11];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}return dest};mat4.set=function(mat,dest){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8];dest[9]=mat[9];dest[10]=mat[10];dest[11]=mat[11];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15];return dest};mat4.identity=function(dest){if(!dest){dest=mat4.create()}dest[0]=1;dest[1]=0;dest[2]=0;dest[3]=0;dest[4]=0;dest[5]=1;dest[6]=0;dest[7]=0;dest[8]=0;dest[9]=0;dest[10]=1;dest[11]=0;dest[12]=0;dest[13]=0;dest[14]=0;dest[15]=1;return dest};mat4.transpose=function(mat,dest){if(!dest||mat===dest){var a01=mat[1],a02=mat[2],a03=mat[3],a12=mat[6],a13=mat[7],a23=mat[11];mat[1]=mat[4];mat[2]=mat[8];mat[3]=mat[12];mat[4]=a01;mat[6]=mat[9];mat[7]=mat[13];mat[8]=a02;mat[9]=a12;mat[11]=mat[14];mat[12]=a03;mat[13]=a13;mat[14]=a23;return mat}dest[0]=mat[0];dest[1]=mat[4];dest[2]=mat[8];dest[3]=mat[12];dest[4]=mat[1];dest[5]=mat[5];dest[6]=mat[9];dest[7]=mat[13];dest[8]=mat[2];dest[9]=mat[6];dest[10]=mat[10];dest[11]=mat[14];dest[12]=mat[3];dest[13]=mat[7];dest[14]=mat[11];dest[15]=mat[15];return dest};mat4.determinant=function(mat){var a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11],a30=mat[12],a31=mat[13],a32=mat[14],a33=mat[15];return a30*a21*a12*a03-a20*a31*a12*a03-a30*a11*a22*a03+a10*a31*a22*a03+a20*a11*a32*a03-a10*a21*a32*a03-a30*a21*a02*a13+a20*a31*a02*a13+a30*a01*a22*a13-a00*a31*a22*a13-a20*a01*a32*a13+a00*a21*a32*a13+a30*a11*a02*a23-a10*a31*a02*a23-a30*a01*a12*a23+a00*a31*a12*a23+a10*a01*a32*a23-a00*a11*a32*a23-a20*a11*a02*a33+a10*a21*a02*a33+a20*a01*a12*a33-a00*a21*a12*a33-a10*a01*a22*a33+a00*a11*a22*a33};mat4.inverse=function(mat,dest){if(!dest){dest=mat}var a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11],a30=mat[12],a31=mat[13],a32=mat[14],a33=mat[15],b00=a00*a11-a01*a10,b01=a00*a12-a02*a10,b02=a00*a13-a03*a10,b03=a01*a12-a02*a11,b04=a01*a13-a03*a11,b05=a02*a13-a03*a12,b06=a20*a31-a21*a30,b07=a20*a32-a22*a30,b08=a20*a33-a23*a30,b09=a21*a32-a22*a31,b10=a21*a33-a23*a31,b11=a22*a33-a23*a32,d=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06,invDet;if(!d){return null}invDet=1/d;dest[0]=(a11*b11-a12*b10+a13*b09)*invDet;dest[1]=(-a01*b11+a02*b10-a03*b09)*invDet;dest[2]=(a31*b05-a32*b04+a33*b03)*invDet;dest[3]=(-a21*b05+a22*b04-a23*b03)*invDet;dest[4]=(-a10*b11+a12*b08-a13*b07)*invDet;dest[5]=(a00*b11-a02*b08+a03*b07)*invDet;dest[6]=(-a30*b05+a32*b02-a33*b01)*invDet;dest[7]=(a20*b05-a22*b02+a23*b01)*invDet;dest[8]=(a10*b10-a11*b08+a13*b06)*invDet;dest[9]=(-a00*b10+a01*b08-a03*b06)*invDet;dest[10]=(a30*b04-a31*b02+a33*b00)*invDet;dest[11]=(-a20*b04+a21*b02-a23*b00)*invDet;dest[12]=(-a10*b09+a11*b07-a12*b06)*invDet;dest[13]=(a00*b09-a01*b07+a02*b06)*invDet;dest[14]=(-a30*b03+a31*b01-a32*b00)*invDet;dest[15]=(a20*b03-a21*b01+a22*b00)*invDet;return dest};mat4.toRotationMat=function(mat,dest){if(!dest){dest=mat4.create()}dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8];dest[9]=mat[9];dest[10]=mat[10];dest[11]=mat[11];dest[12]=0;dest[13]=0;dest[14]=0;dest[15]=1;return dest};mat4.toMat3=function(mat,dest){if(!dest){dest=mat3.create()}dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[4];dest[4]=mat[5];dest[5]=mat[6];dest[6]=mat[8];dest[7]=mat[9];dest[8]=mat[10];return dest};mat4.toInverseMat3=function(mat,dest){var a00=mat[0],a01=mat[1],a02=mat[2],a10=mat[4],a11=mat[5],a12=mat[6],a20=mat[8],a21=mat[9],a22=mat[10],b01=a22*a11-a12*a21,b11=-a22*a10+a12*a20,b21=a21*a10-a11*a20,d=a00*b01+a01*b11+a02*b21,id;if(!d){return null}id=1/d;if(!dest){dest=mat3.create()}dest[0]=b01*id;dest[1]=(-a22*a01+a02*a21)*id;dest[2]=(a12*a01-a02*a11)*id;dest[3]=b11*id;dest[4]=(a22*a00-a02*a20)*id;dest[5]=(-a12*a00+a02*a10)*id;dest[6]=b21*id;dest[7]=(-a21*a00+a01*a20)*id;dest[8]=(a11*a00-a01*a10)*id;return dest};mat4.multiply=function(mat,mat2,dest){if(!dest){dest=mat}var a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11],a30=mat[12],a31=mat[13],a32=mat[14],a33=mat[15],b00=mat2[0],b01=mat2[1],b02=mat2[2],b03=mat2[3],b10=mat2[4],b11=mat2[5],b12=mat2[6],b13=mat2[7],b20=mat2[8],b21=mat2[9],b22=mat2[10],b23=mat2[11],b30=mat2[12],b31=mat2[13],b32=mat2[14],b33=mat2[15];dest[0]=b00*a00+b01*a10+b02*a20+b03*a30;dest[1]=b00*a01+b01*a11+b02*a21+b03*a31;dest[2]=b00*a02+b01*a12+b02*a22+b03*a32;dest[3]=b00*a03+b01*a13+b02*a23+b03*a33;dest[4]=b10*a00+b11*a10+b12*a20+b13*a30;dest[5]=b10*a01+b11*a11+b12*a21+b13*a31;dest[6]=b10*a02+b11*a12+b12*a22+b13*a32;dest[7]=b10*a03+b11*a13+b12*a23+b13*a33;dest[8]=b20*a00+b21*a10+b22*a20+b23*a30;dest[9]=b20*a01+b21*a11+b22*a21+b23*a31;dest[10]=b20*a02+b21*a12+b22*a22+b23*a32;dest[11]=b20*a03+b21*a13+b22*a23+b23*a33;dest[12]=b30*a00+b31*a10+b32*a20+b33*a30;dest[13]=b30*a01+b31*a11+b32*a21+b33*a31;dest[14]=b30*a02+b31*a12+b32*a22+b33*a32;dest[15]=b30*a03+b31*a13+b32*a23+b33*a33;return dest};mat4.multiplyVec3=function(mat,vec,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2];dest[0]=mat[0]*x+mat[4]*y+mat[8]*z+mat[12];dest[1]=mat[1]*x+mat[5]*y+mat[9]*z+mat[13];dest[2]=mat[2]*x+mat[6]*y+mat[10]*z+mat[14];return dest};mat4.multiplyVec4=function(mat,vec,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2],w=vec[3];dest[0]=mat[0]*x+mat[4]*y+mat[8]*z+mat[12]*w;dest[1]=mat[1]*x+mat[5]*y+mat[9]*z+mat[13]*w;dest[2]=mat[2]*x+mat[6]*y+mat[10]*z+mat[14]*w;dest[3]=mat[3]*x+mat[7]*y+mat[11]*z+mat[15]*w;return dest};mat4.translate=function(mat,vec,dest){var x=vec[0],y=vec[1],z=vec[2],a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23;if(!dest||mat===dest){mat[12]=mat[0]*x+mat[4]*y+mat[8]*z+mat[12];mat[13]=mat[1]*x+mat[5]*y+mat[9]*z+mat[13];mat[14]=mat[2]*x+mat[6]*y+mat[10]*z+mat[14];mat[15]=mat[3]*x+mat[7]*y+mat[11]*z+mat[15];return mat}a00=mat[0];a01=mat[1];a02=mat[2];a03=mat[3];a10=mat[4];a11=mat[5];a12=mat[6];a13=mat[7];a20=mat[8];a21=mat[9];a22=mat[10];a23=mat[11];dest[0]=a00;dest[1]=a01;dest[2]=a02;dest[3]=a03;dest[4]=a10;dest[5]=a11;dest[6]=a12;dest[7]=a13;dest[8]=a20;dest[9]=a21;dest[10]=a22;dest[11]=a23;dest[12]=a00*x+a10*y+a20*z+mat[12];dest[13]=a01*x+a11*y+a21*z+mat[13];dest[14]=a02*x+a12*y+a22*z+mat[14];dest[15]=a03*x+a13*y+a23*z+mat[15];return dest};mat4.scale=function(mat,vec,dest){var x=vec[0],y=vec[1],z=vec[2];if(!dest||mat===dest){mat[0]*=x;mat[1]*=x;mat[2]*=x;mat[3]*=x;mat[4]*=y;mat[5]*=y;mat[6]*=y;mat[7]*=y;mat[8]*=z;mat[9]*=z;mat[10]*=z;mat[11]*=z;return mat}dest[0]=mat[0]*x;dest[1]=mat[1]*x;dest[2]=mat[2]*x;dest[3]=mat[3]*x;dest[4]=mat[4]*y;dest[5]=mat[5]*y;dest[6]=mat[6]*y;dest[7]=mat[7]*y;dest[8]=mat[8]*z;dest[9]=mat[9]*z;dest[10]=mat[10]*z;dest[11]=mat[11]*z;dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15];return dest};mat4.rotate=function(mat,angle,axis,dest){var x=axis[0],y=axis[1],z=axis[2],len=Math.sqrt(x*x+y*y+z*z),s,c,t,a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,b00,b01,b02,b10,b11,b12,b20,b21,b22;if(!len){return null}if(len!==1){len=1/len;x*=len;y*=len;z*=len}s=Math.sin(angle);c=Math.cos(angle);t=1-c;a00=mat[0];a01=mat[1];a02=mat[2];a03=mat[3];a10=mat[4];a11=mat[5];a12=mat[6];a13=mat[7];a20=mat[8];a21=mat[9];a22=mat[10];a23=mat[11];b00=x*x*t+c;b01=y*x*t+z*s;b02=z*x*t-y*s;b10=x*y*t-z*s;b11=y*y*t+c;b12=z*y*t+x*s;b20=x*z*t+y*s;b21=y*z*t-x*s;b22=z*z*t+c;if(!dest){dest=mat}else if(mat!==dest){dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}dest[0]=a00*b00+a10*b01+a20*b02;dest[1]=a01*b00+a11*b01+a21*b02;dest[2]=a02*b00+a12*b01+a22*b02;dest[3]=a03*b00+a13*b01+a23*b02;dest[4]=a00*b10+a10*b11+a20*b12;dest[5]=a01*b10+a11*b11+a21*b12;dest[6]=a02*b10+a12*b11+a22*b12;dest[7]=a03*b10+a13*b11+a23*b12;dest[8]=a00*b20+a10*b21+a20*b22;dest[9]=a01*b20+a11*b21+a21*b22;dest[10]=a02*b20+a12*b21+a22*b22;dest[11]=a03*b20+a13*b21+a23*b22;return dest};mat4.rotateX=function(mat,angle,dest){var s=Math.sin(angle),c=Math.cos(angle),a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11];if(!dest){dest=mat}else if(mat!==dest){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}dest[4]=a10*c+a20*s;dest[5]=a11*c+a21*s;dest[6]=a12*c+a22*s;dest[7]=a13*c+a23*s;dest[8]=a10*-s+a20*c;dest[9]=a11*-s+a21*c;dest[10]=a12*-s+a22*c;dest[11]=a13*-s+a23*c;return dest};mat4.rotateY=function(mat,angle,dest){var s=Math.sin(angle),c=Math.cos(angle),a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11];if(!dest){dest=mat}else if(mat!==dest){dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}dest[0]=a00*c+a20*-s;dest[1]=a01*c+a21*-s;dest[2]=a02*c+a22*-s;dest[3]=a03*c+a23*-s;dest[8]=a00*s+a20*c;dest[9]=a01*s+a21*c;dest[10]=a02*s+a22*c;dest[11]=a03*s+a23*c;return dest};mat4.rotateZ=function(mat,angle,dest){var s=Math.sin(angle),c=Math.cos(angle),a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7];if(!dest){dest=mat}else if(mat!==dest){dest[8]=mat[8];dest[9]=mat[9];dest[10]=mat[10];dest[11]=mat[11];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}dest[0]=a00*c+a10*s;dest[1]=a01*c+a11*s;dest[2]=a02*c+a12*s;dest[3]=a03*c+a13*s;dest[4]=a00*-s+a10*c;dest[5]=a01*-s+a11*c;dest[6]=a02*-s+a12*c;dest[7]=a03*-s+a13*c;return dest};mat4.frustum=function(left,right,bottom,top,near,far,dest){if(!dest){dest=mat4.create()}var rl=right-left,tb=top-bottom,fn=far-near;dest[0]=near*2/rl;dest[1]=0;dest[2]=0;dest[3]=0;dest[4]=0;dest[5]=near*2/tb;dest[6]=0;dest[7]=0;dest[8]=(right+left)/rl;dest[9]=(top+bottom)/tb;dest[10]=-(far+near)/fn;dest[11]=-1;dest[12]=0;dest[13]=0;dest[14]=-(far*near*2)/fn;dest[15]=0;return dest};mat4.perspective=function(fovy,aspect,near,far,dest){var top=near*Math.tan(fovy*Math.PI/360),right=top*aspect;return mat4.frustum(-right,right,-top,top,near,far,dest)};mat4.ortho=function(left,right,bottom,top,near,far,dest){if(!dest){dest=mat4.create()}var rl=right-left,tb=top-bottom,fn=far-near;dest[0]=2/rl;dest[1]=0;dest[2]=0;dest[3]=0;dest[4]=0;dest[5]=2/tb;dest[6]=0;dest[7]=0;dest[8]=0;dest[9]=0;dest[10]=-2/fn;dest[11]=0;dest[12]=-(left+right)/rl;dest[13]=-(top+bottom)/tb;dest[14]=-(far+near)/fn;dest[15]=1;return dest};mat4.lookAt=function(eye,center,up,dest){if(!dest){dest=mat4.create()}var x0,x1,x2,y0,y1,y2,z0,z1,z2,len,eyex=eye[0],eyey=eye[1],eyez=eye[2],upx=up[0],upy=up[1],upz=up[2],centerx=center[0],centery=center[1],centerz=center[2];if(eyex===centerx&&eyey===centery&&eyez===centerz){return mat4.identity(dest)}z0=eyex-centerx;z1=eyey-centery;z2=eyez-centerz;len=1/Math.sqrt(z0*z0+z1*z1+z2*z2);z0*=len;z1*=len;z2*=len;x0=upy*z2-upz*z1;x1=upz*z0-upx*z2;x2=upx*z1-upy*z0;len=Math.sqrt(x0*x0+x1*x1+x2*x2);if(!len){x0=0;x1=0;x2=0}else{len=1/len;x0*=len;x1*=len;x2*=len}y0=z1*x2-z2*x1;y1=z2*x0-z0*x2;y2=z0*x1-z1*x0;len=Math.sqrt(y0*y0+y1*y1+y2*y2);if(!len){y0=0;y1=0;y2=0}else{len=1/len;y0*=len;y1*=len;y2*=len}dest[0]=x0;dest[1]=y0;dest[2]=z0;dest[3]=0;dest[4]=x1;dest[5]=y1;dest[6]=z1;dest[7]=0;dest[8]=x2;dest[9]=y2;dest[10]=z2;dest[11]=0;dest[12]=-(x0*eyex+x1*eyey+x2*eyez);dest[13]=-(y0*eyex+y1*eyey+y2*eyez);dest[14]=-(z0*eyex+z1*eyey+z2*eyez);dest[15]=1;return dest};mat4.fromRotationTranslation=function(quat,vec,dest){if(!dest){dest=mat4.create()}var x=quat[0],y=quat[1],z=quat[2],w=quat[3],x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2;dest[0]=1-(yy+zz);dest[1]=xy+wz;dest[2]=xz-wy;dest[3]=0;dest[4]=xy-wz;dest[5]=1-(xx+zz);dest[6]=yz+wx;dest[7]=0;dest[8]=xz+wy;dest[9]=yz-wx;dest[10]=1-(xx+yy);dest[11]=0;dest[12]=vec[0];dest[13]=vec[1];dest[14]=vec[2];dest[15]=1;return dest};mat4.str=function(mat){return"["+mat[0]+", "+mat[1]+", "+mat[2]+", "+mat[3]+", "+mat[4]+", "+mat[5]+", "+mat[6]+", "+mat[7]+", "+mat[8]+", "+mat[9]+", "+mat[10]+", "+mat[11]+", "+mat[12]+", "+mat[13]+", "+mat[14]+", "+mat[15]+"]"};quat4.create=function(quat){var dest=new MatrixArray(4);if(quat){dest[0]=quat[0];dest[1]=quat[1];dest[2]=quat[2];dest[3]=quat[3]}return dest};quat4.set=function(quat,dest){dest[0]=quat[0];dest[1]=quat[1];dest[2]=quat[2];dest[3]=quat[3];return dest};quat4.calculateW=function(quat,dest){var x=quat[0],y=quat[1],z=quat[2];if(!dest||quat===dest){quat[3]=-Math.sqrt(Math.abs(1-x*x-y*y-z*z));return quat}dest[0]=x;dest[1]=y;dest[2]=z;dest[3]=-Math.sqrt(Math.abs(1-x*x-y*y-z*z));return dest};quat4.dot=function(quat,quat2){return quat[0]*quat2[0]+quat[1]*quat2[1]+quat[2]*quat2[2]+quat[3]*quat2[3]};quat4.inverse=function(quat,dest){var q0=quat[0],q1=quat[1],q2=quat[2],q3=quat[3],dot=q0*q0+q1*q1+q2*q2+q3*q3,invDot=dot?1/dot:0;if(!dest||quat===dest){quat[0]*=-invDot;quat[1]*=-invDot;quat[2]*=-invDot;quat[3]*=invDot;return quat}dest[0]=-quat[0]*invDot;dest[1]=-quat[1]*invDot;dest[2]=-quat[2]*invDot;dest[3]=quat[3]*invDot;return dest};quat4.conjugate=function(quat,dest){if(!dest||quat===dest){quat[0]*=-1;quat[1]*=-1;quat[2]*=-1;return quat}dest[0]=-quat[0];dest[1]=-quat[1];dest[2]=-quat[2];dest[3]=quat[3];return dest};quat4.length=function(quat){var x=quat[0],y=quat[1],z=quat[2],w=quat[3];return Math.sqrt(x*x+y*y+z*z+w*w)};quat4.normalize=function(quat,dest){if(!dest){dest=quat}var x=quat[0],y=quat[1],z=quat[2],w=quat[3],len=Math.sqrt(x*x+y*y+z*z+w*w);if(len===0){dest[0]=0;dest[1]=0;dest[2]=0;dest[3]=0;return dest}len=1/len;dest[0]=x*len;dest[1]=y*len;dest[2]=z*len;dest[3]=w*len;return dest};quat4.add=function(quat,quat2,dest){if(!dest||quat===dest){quat[0]+=quat2[0];quat[1]+=quat2[1];quat[2]+=quat2[2];quat[3]+=quat2[3];return quat}dest[0]=quat[0]+quat2[0];dest[1]=quat[1]+quat2[1];dest[2]=quat[2]+quat2[2];dest[3]=quat[3]+quat2[3];return dest};quat4.multiply=function(quat,quat2,dest){if(!dest){dest=quat}var qax=quat[0],qay=quat[1],qaz=quat[2],qaw=quat[3],qbx=quat2[0],qby=quat2[1],qbz=quat2[2],qbw=quat2[3];dest[0]=qax*qbw+qaw*qbx+qay*qbz-qaz*qby;dest[1]=qay*qbw+qaw*qby+qaz*qbx-qax*qbz;dest[2]=qaz*qbw+qaw*qbz+qax*qby-qay*qbx;dest[3]=qaw*qbw-qax*qbx-qay*qby-qaz*qbz;return dest};quat4.multiplyVec3=function(quat,vec,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2],qx=quat[0],qy=quat[1],qz=quat[2],qw=quat[3],ix=qw*x+qy*z-qz*y,iy=qw*y+qz*x-qx*z,iz=qw*z+qx*y-qy*x,iw=-qx*x-qy*y-qz*z;dest[0]=ix*qw+iw*-qx+iy*-qz-iz*-qy;dest[1]=iy*qw+iw*-qy+iz*-qx-ix*-qz;dest[2]=iz*qw+iw*-qz+ix*-qy-iy*-qx;return dest};quat4.scale=function(quat,val,dest){if(!dest||quat===dest){quat[0]*=val;quat[1]*=val;quat[2]*=val;quat[3]*=val;return quat}dest[0]=quat[0]*val;dest[1]=quat[1]*val;dest[2]=quat[2]*val;dest[3]=quat[3]*val;return dest};quat4.toMat3=function(quat,dest){if(!dest){dest=mat3.create()}var x=quat[0],y=quat[1],z=quat[2],w=quat[3],x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2;dest[0]=1-(yy+zz);dest[1]=xy+wz;dest[2]=xz-wy;dest[3]=xy-wz;dest[4]=1-(xx+zz);dest[5]=yz+wx;dest[6]=xz+wy;dest[7]=yz-wx;dest[8]=1-(xx+yy);return dest};quat4.toMat4=function(quat,dest){if(!dest){dest=mat4.create()}var x=quat[0],y=quat[1],z=quat[2],w=quat[3],x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2;dest[0]=1-(yy+zz);dest[1]=xy+wz;dest[2]=xz-wy;dest[3]=0;dest[4]=xy-wz;dest[5]=1-(xx+zz);dest[6]=yz+wx;dest[7]=0;dest[8]=xz+wy;dest[9]=yz-wx;dest[10]=1-(xx+yy);dest[11]=0;dest[12]=0;dest[13]=0;dest[14]=0;dest[15]=1;return dest};quat4.slerp=function(quat,quat2,slerp,dest){if(!dest){dest=quat}var cosHalfTheta=quat[0]*quat2[0]+quat[1]*quat2[1]+quat[2]*quat2[2]+quat[3]*quat2[3],halfTheta,sinHalfTheta,ratioA,ratioB;if(Math.abs(cosHalfTheta)>=1){if(dest!==quat){dest[0]=quat[0];dest[1]=quat[1];dest[2]=quat[2];dest[3]=quat[3]}return dest}halfTheta=Math.acos(cosHalfTheta);sinHalfTheta=Math.sqrt(1-cosHalfTheta*cosHalfTheta);if(Math.abs(sinHalfTheta)<.001){dest[0]=quat[0]*.5+quat2[0]*.5;dest[1]=quat[1]*.5+quat2[1]*.5;dest[2]=quat[2]*.5+quat2[2]*.5;dest[3]=quat[3]*.5+quat2[3]*.5;return dest}ratioA=Math.sin((1-slerp)*halfTheta)/sinHalfTheta;ratioB=Math.sin(slerp*halfTheta)/sinHalfTheta;dest[0]=quat[0]*ratioA+quat2[0]*ratioB;dest[1]=quat[1]*ratioA+quat2[1]*ratioB;dest[2]=quat[2]*ratioA+quat2[2]*ratioB;dest[3]=quat[3]*ratioA+quat2[3]*ratioB;return dest};quat4.str=function(quat){return"["+quat[0]+", "+quat[1]+", "+quat[2]+", "+quat[3]+"]"};return{vec3:vec3,mat3:mat3,mat4:mat4,quat4:quat4}}();var _glBegin=mode=>{GLImmediate.enabledClientAttributes_preBegin=GLImmediate.enabledClientAttributes;GLImmediate.enabledClientAttributes=[];GLImmediate.clientAttributes_preBegin=GLImmediate.clientAttributes;GLImmediate.clientAttributes=[];for(var i=0;i{GLctx.disjointTimerQueryExt["beginQueryEXT"](target,GL.queries[id])};var _emscripten_glBeginQueryEXT=_glBeginQueryEXT;var _emscripten_glBindAttribLocation=_glBindAttribLocation;var _emscripten_glBindBuffer=_glBindBuffer;var _glBindFramebuffer=(target,framebuffer)=>{GLctx.bindFramebuffer(target,GL.framebuffers[framebuffer])};var _emscripten_glBindFramebuffer=_glBindFramebuffer;var _glBindProgram=(type,id)=>{};var _emscripten_glBindProgram=_glBindProgram;var _glBindRenderbuffer=(target,renderbuffer)=>{GLctx.bindRenderbuffer(target,GL.renderbuffers[renderbuffer])};var _emscripten_glBindRenderbuffer=_glBindRenderbuffer;var _glBindTexture=(target,texture)=>{GLctx.bindTexture(target,GL.textures[texture])};var _emscripten_glBindTexture=_glBindTexture;var _glEnableClientState=cap=>{var attrib=GLEmulation.getAttributeFromCapability(cap);if(attrib===null){return}if(!GLImmediate.enabledClientAttributes[attrib]){GLImmediate.enabledClientAttributes[attrib]=true;GLImmediate.totalEnabledClientAttributes++;GLImmediate.currentRenderer=null;if(GLEmulation.currentVao)GLEmulation.currentVao.enabledClientStates[cap]=1;GLImmediate.modifiedClientAttributes=true}};var emulGlBindVertexArray=vao=>{GLEmulation.currentVao=null;if(GLImmediate.lastRenderer)GLImmediate.lastRenderer.cleanup();_glBindBuffer(GLctx.ARRAY_BUFFER,0);_glBindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,0);for(var vaa in GLEmulation.enabledVertexAttribArrays){GLctx.disableVertexAttribArray(vaa)}GLEmulation.enabledVertexAttribArrays={};GLImmediate.enabledClientAttributes=[0,0];GLImmediate.totalEnabledClientAttributes=0;GLImmediate.modifiedClientAttributes=true;if(vao){var info=GLEmulation.vaos[vao];_glBindBuffer(GLctx.ARRAY_BUFFER,info.arrayBuffer);_glBindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,info.elementArrayBuffer);for(var vaa in info.enabledVertexAttribArrays){_glEnableVertexAttribArray(vaa)}for(var vaa in info.vertexAttribPointers){_glVertexAttribPointer.apply(null,info.vertexAttribPointers[vaa])}for(var attrib in info.enabledClientStates){_glEnableClientState(attrib|0)}GLEmulation.currentVao=info}};var _glBindVertexArray=vao=>{emulGlBindVertexArray(vao);var ibo=GLctx.getParameter(34965);GLctx.currentElementArrayBufferBinding=ibo?ibo.name|0:0};var _glBindVertexArrayOES=_glBindVertexArray;var _emscripten_glBindVertexArrayOES=_glBindVertexArrayOES;function _glBlendColor(x0,x1,x2,x3){GLctx.blendColor(x0,x1,x2,x3)}var _emscripten_glBlendColor=_glBlendColor;function _glBlendEquation(x0){GLctx.blendEquation(x0)}var _emscripten_glBlendEquation=_glBlendEquation;function _glBlendEquationSeparate(x0,x1){GLctx.blendEquationSeparate(x0,x1)}var _emscripten_glBlendEquationSeparate=_glBlendEquationSeparate;function _glBlendFunc(x0,x1){GLctx.blendFunc(x0,x1)}var _emscripten_glBlendFunc=_glBlendFunc;function _glBlendFuncSeparate(x0,x1,x2,x3){GLctx.blendFuncSeparate(x0,x1,x2,x3)}var _emscripten_glBlendFuncSeparate=_glBlendFuncSeparate;var _glBufferData=(target,size,data,usage)=>{switch(usage){case 35041:case 35042:usage=35040;break;case 35045:case 35046:usage=35044;break;case 35049:case 35050:usage=35048;break}GLctx.bufferData(target,data?HEAPU8.subarray(data,data+size):size,usage)};var _emscripten_glBufferData=_glBufferData;var _glBufferSubData=(target,offset,size,data)=>{GLctx.bufferSubData(target,offset,HEAPU8.subarray(data,data+size))};var _emscripten_glBufferSubData=_glBufferSubData;function _glCheckFramebufferStatus(x0){return GLctx.checkFramebufferStatus(x0)}var _emscripten_glCheckFramebufferStatus=_glCheckFramebufferStatus;function _glClear(x0){GLctx.clear(x0)}var _emscripten_glClear=_glClear;function _glClearColor(x0,x1,x2,x3){GLctx.clearColor(x0,x1,x2,x3)}var _emscripten_glClearColor=_glClearColor;function _glClearDepthf(x0){GLctx.clearDepth(x0)}var _emscripten_glClearDepthf=_glClearDepthf;function _glClearStencil(x0){GLctx.clearStencil(x0)}var _emscripten_glClearStencil=_glClearStencil;var _glClientActiveTexture=texture=>{GLImmediate.clientActiveTexture=texture-33984};var _emscripten_glClientActiveTexture=_glClientActiveTexture;var _glClipPlane=(pname,param)=>{if(pname>=12288&&pname<12294){var clipPlaneId=pname-12288;GLEmulation.clipPlaneEquation[clipPlaneId][0]=HEAPF64[param>>3];GLEmulation.clipPlaneEquation[clipPlaneId][1]=HEAPF64[param+8>>3];GLEmulation.clipPlaneEquation[clipPlaneId][2]=HEAPF64[param+16>>3];GLEmulation.clipPlaneEquation[clipPlaneId][3]=HEAPF64[param+24>>3];var tmpMV=GLImmediate.matrixLib.mat4.create(GLImmediate.matrix[0]);GLImmediate.matrixLib.mat4.inverse(tmpMV);GLImmediate.matrixLib.mat4.transpose(tmpMV);GLImmediate.matrixLib.mat4.multiplyVec4(tmpMV,GLEmulation.clipPlaneEquation[clipPlaneId])}};var _emscripten_glClipPlane=_glClipPlane;var _glColor4f=(r,g,b,a)=>{r=Math.max(Math.min(r,1),0);g=Math.max(Math.min(g,1),0);b=Math.max(Math.min(b,1),0);a=Math.max(Math.min(a,1),0);if(GLImmediate.mode>=0){var start=GLImmediate.vertexCounter<<2;GLImmediate.vertexDataU8[start+0]=r*255;GLImmediate.vertexDataU8[start+1]=g*255;GLImmediate.vertexDataU8[start+2]=b*255;GLImmediate.vertexDataU8[start+3]=a*255;GLImmediate.vertexCounter++;GLImmediate.addRendererComponent(GLImmediate.COLOR,4,GLctx.UNSIGNED_BYTE)}else{GLImmediate.clientColor[0]=r;GLImmediate.clientColor[1]=g;GLImmediate.clientColor[2]=b;GLImmediate.clientColor[3]=a}};var _glColor3f=(r,g,b)=>{_glColor4f(r,g,b,1)};var _glColor3d=_glColor3f;var _emscripten_glColor3d=_glColor3d;var _emscripten_glColor3f=_glColor3f;var _glColor3fv=p=>{_glColor3f(HEAPF32[p>>2],HEAPF32[p+4>>2],HEAPF32[p+8>>2])};var _emscripten_glColor3fv=_glColor3fv;var _glColor4ub=(r,g,b,a)=>{_glColor4f((r&255)/255,(g&255)/255,(b&255)/255,(a&255)/255)};var _glColor3ub=(r,g,b)=>{_glColor4ub(r,g,b,255)};var _emscripten_glColor3ub=_glColor3ub;var _glColor3ubv=p=>{_glColor3ub(HEAP8[p>>0],HEAP8[p+1>>0],HEAP8[p+2>>0])};var _emscripten_glColor3ubv=_glColor3ubv;var _glColor4ui=(r,g,b,a)=>{_glColor4f((r>>>0)/4294967295,(g>>>0)/4294967295,(b>>>0)/4294967295,(a>>>0)/4294967295)};var _glColor3ui=(r,g,b)=>{_glColor4ui(r,g,b,4294967295)};var _emscripten_glColor3ui=_glColor3ui;var _glColor3uiv=p=>{_glColor3ui(HEAP32[p>>2],HEAP32[p+4>>2],HEAP32[p+8>>2])};var _emscripten_glColor3uiv=_glColor3uiv;var _glColor4us=(r,g,b,a)=>{_glColor4f((r&65535)/65535,(g&65535)/65535,(b&65535)/65535,(a&65535)/65535)};var _glColor3us=(r,g,b)=>{_glColor4us(r,g,b,65535)};var _emscripten_glColor3us=_glColor3us;var _glColor3usv=p=>{_glColor3us(HEAP16[p>>1],HEAP16[p+2>>1],HEAP16[p+4>>1])};var _emscripten_glColor3usv=_glColor3usv;var _glColor4d=_glColor4f;var _emscripten_glColor4d=_glColor4d;var _emscripten_glColor4f=_glColor4f;var _glColor4fv=p=>{_glColor4f(HEAPF32[p>>2],HEAPF32[p+4>>2],HEAPF32[p+8>>2],HEAPF32[p+12>>2])};var _emscripten_glColor4fv=_glColor4fv;var _emscripten_glColor4ub=_glColor4ub;var _glColor4ubv=p=>{_glColor4ub(HEAP8[p>>0],HEAP8[p+1>>0],HEAP8[p+2>>0],HEAP8[p+3>>0])};var _emscripten_glColor4ubv=_glColor4ubv;var _emscripten_glColor4ui=_glColor4ui;var _emscripten_glColor4us=_glColor4us;var _glColorMask=(red,green,blue,alpha)=>{GLctx.colorMask(!!red,!!green,!!blue,!!alpha)};var _emscripten_glColorMask=_glColorMask;var _glColorPointer=(size,type,stride,pointer)=>{GLImmediate.setClientAttribute(GLImmediate.COLOR,size,type,stride,pointer)};var _emscripten_glColorPointer=_glColorPointer;var _emscripten_glCompileShader=_glCompileShader;var _glCompressedTexImage2D=(target,level,internalFormat,width,height,border,imageSize,data)=>{GLctx.compressedTexImage2D(target,level,internalFormat,width,height,border,data?HEAPU8.subarray(data,data+imageSize):null)};var _emscripten_glCompressedTexImage2D=_glCompressedTexImage2D;var _glCompressedTexSubImage2D=(target,level,xoffset,yoffset,width,height,format,imageSize,data)=>{GLctx.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,data?HEAPU8.subarray(data,data+imageSize):null)};var _emscripten_glCompressedTexSubImage2D=_glCompressedTexSubImage2D;function _glCopyTexImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx.copyTexImage2D(x0,x1,x2,x3,x4,x5,x6,x7)}var _emscripten_glCopyTexImage2D=_glCopyTexImage2D;function _glCopyTexSubImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx.copyTexSubImage2D(x0,x1,x2,x3,x4,x5,x6,x7)}var _emscripten_glCopyTexSubImage2D=_glCopyTexSubImage2D;var _glCreateProgram=()=>{var id=GL.getNewId(GL.programs);var program=GLctx.createProgram();program.name=id;program.maxUniformLength=program.maxAttributeLength=program.maxUniformBlockNameLength=0;program.uniformIdCounter=1;GL.programs[id]=program;return id};var _emscripten_glCreateProgram=_glCreateProgram;var _emscripten_glCreateShader=_glCreateShader;function _glCullFace(x0){GLctx.cullFace(x0)}var _emscripten_glCullFace=_glCullFace;var _glDeleteBuffers=(n,buffers)=>{for(var i=0;i>2];var buffer=GL.buffers[id];if(!buffer)continue;GLctx.deleteBuffer(buffer);buffer.name=0;GL.buffers[id]=null;if(id==GLctx.currentArrayBufferBinding)GLctx.currentArrayBufferBinding=0;if(id==GLctx.currentElementArrayBufferBinding)GLctx.currentElementArrayBufferBinding=0}};var _emscripten_glDeleteBuffers=_glDeleteBuffers;var _glDeleteFramebuffers=(n,framebuffers)=>{for(var i=0;i>2];var framebuffer=GL.framebuffers[id];if(!framebuffer)continue;GLctx.deleteFramebuffer(framebuffer);framebuffer.name=0;GL.framebuffers[id]=null}};var _emscripten_glDeleteFramebuffers=_glDeleteFramebuffers;var _glDeleteShader=id=>{if(!id)return;var shader=GL.shaders[id];if(!shader){GL.recordError(1281);return}GLctx.deleteShader(shader);GL.shaders[id]=null};var _glDeleteObject=id=>{if(GL.programs[id]){_glDeleteProgram(id)}else if(GL.shaders[id]){_glDeleteShader(id)}else{err(`WARNING: deleteObject received invalid id: ${id}`)}};var _emscripten_glDeleteObject=_glDeleteObject;var _emscripten_glDeleteProgram=_glDeleteProgram;var _glDeleteQueriesEXT=(n,ids)=>{for(var i=0;i>2];var query=GL.queries[id];if(!query)continue;GLctx.disjointTimerQueryExt["deleteQueryEXT"](query);GL.queries[id]=null}};var _emscripten_glDeleteQueriesEXT=_glDeleteQueriesEXT;var _glDeleteRenderbuffers=(n,renderbuffers)=>{for(var i=0;i>2];var renderbuffer=GL.renderbuffers[id];if(!renderbuffer)continue;GLctx.deleteRenderbuffer(renderbuffer);renderbuffer.name=0;GL.renderbuffers[id]=null}};var _emscripten_glDeleteRenderbuffers=_glDeleteRenderbuffers;var _emscripten_glDeleteShader=_glDeleteShader;var _glDeleteTextures=(n,textures)=>{for(var i=0;i>2];var texture=GL.textures[id];if(!texture)continue;GLctx.deleteTexture(texture);texture.name=0;GL.textures[id]=null}};var _emscripten_glDeleteTextures=_glDeleteTextures;var emulGlDeleteVertexArrays=(n,vaos)=>{for(var i=0;i>2];GLEmulation.vaos[id]=null;if(GLEmulation.currentVao&&GLEmulation.currentVao.id==id)GLEmulation.currentVao=null}};var _glDeleteVertexArrays=(n,vaos)=>{emulGlDeleteVertexArrays(n,vaos)};var _glDeleteVertexArraysOES=_glDeleteVertexArrays;var _emscripten_glDeleteVertexArraysOES=_glDeleteVertexArraysOES;function _glDepthFunc(x0){GLctx.depthFunc(x0)}var _emscripten_glDepthFunc=_glDepthFunc;var _glDepthMask=flag=>{GLctx.depthMask(!!flag)};var _emscripten_glDepthMask=_glDepthMask;function _glDepthRangef(x0,x1){GLctx.depthRange(x0,x1)}var _emscripten_glDepthRangef=_glDepthRangef;var _emscripten_glDetachShader=_glDetachShader;var _emscripten_glDisable=_glDisable;var _glDisableClientState=cap=>{var attrib=GLEmulation.getAttributeFromCapability(cap);if(attrib===null){return}if(GLImmediate.enabledClientAttributes[attrib]){GLImmediate.enabledClientAttributes[attrib]=false;GLImmediate.totalEnabledClientAttributes--;GLImmediate.currentRenderer=null;if(GLEmulation.currentVao)delete GLEmulation.currentVao.enabledClientStates[cap];GLImmediate.modifiedClientAttributes=true}};var _emscripten_glDisableClientState=_glDisableClientState;var _emscripten_glDisableVertexAttribArray=_glDisableVertexAttribArray;var _glDrawArrays=(mode,first,count)=>{if(GLImmediate.totalEnabledClientAttributes==0&&mode<=6){GLctx.drawArrays(mode,first,count);return}GLImmediate.prepareClientAttributes(count,false);GLImmediate.mode=mode;if(!GLctx.currentArrayBufferBinding){GLImmediate.vertexData=HEAPF32.subarray(GLImmediate.vertexPointer>>2,GLImmediate.vertexPointer+(first+count)*GLImmediate.stride>>2);GLImmediate.firstVertex=first;GLImmediate.lastVertex=first+count}GLImmediate.flush(null,first);GLImmediate.mode=-1};var _emscripten_glDrawArrays=_glDrawArrays;var _glDrawArraysInstanced=(mode,first,count,primcount)=>{GLctx.drawArraysInstanced(mode,first,count,primcount)};var _glDrawArraysInstancedANGLE=_glDrawArraysInstanced;var _emscripten_glDrawArraysInstancedANGLE=_glDrawArraysInstancedANGLE;var _glDrawBuffer=()=>{throw"glDrawBuffer: TODO"};var _emscripten_glDrawBuffer=_glDrawBuffer;var tempFixedLengthArray=[];var _glDrawBuffers=(n,bufs)=>{var bufArray=tempFixedLengthArray[n];for(var i=0;i>2]}GLctx.drawBuffers(bufArray)};var _glDrawBuffersWEBGL=_glDrawBuffers;var _emscripten_glDrawBuffersWEBGL=_glDrawBuffersWEBGL;var _glDrawElements=(mode,count,type,indices,start,end)=>{if(GLImmediate.totalEnabledClientAttributes==0&&mode<=6&&GLctx.currentElementArrayBufferBinding){GLctx.drawElements(mode,count,type,indices);return}GLImmediate.prepareClientAttributes(count,false);GLImmediate.mode=mode;if(!GLctx.currentArrayBufferBinding){GLImmediate.firstVertex=end?start:HEAP8.length;GLImmediate.lastVertex=end?end+1:0;GLImmediate.vertexData=HEAPF32.subarray(GLImmediate.vertexPointer>>2,end?GLImmediate.vertexPointer+(end+1)*GLImmediate.stride>>2:undefined)}GLImmediate.flush(count,0,indices);GLImmediate.mode=-1};var _emscripten_glDrawElements=_glDrawElements;var _glDrawElementsInstanced=(mode,count,type,indices,primcount)=>{GLctx.drawElementsInstanced(mode,count,type,indices,primcount)};var _glDrawElementsInstancedANGLE=_glDrawElementsInstanced;var _emscripten_glDrawElementsInstancedANGLE=_glDrawElementsInstancedANGLE;var _glDrawRangeElements=(mode,start,end,count,type,indices)=>{_glDrawElements(mode,count,type,indices,start,end)};var _emscripten_glDrawRangeElements=_glDrawRangeElements;var _emscripten_glEnable=_glEnable;var _emscripten_glEnableClientState=_glEnableClientState;var _emscripten_glEnableVertexAttribArray=_glEnableVertexAttribArray;var _glEnd=()=>{GLImmediate.prepareClientAttributes(GLImmediate.rendererComponents[GLImmediate.VERTEX],true);GLImmediate.firstVertex=0;GLImmediate.lastVertex=GLImmediate.vertexCounter/(GLImmediate.stride>>2);GLImmediate.flush();GLImmediate.disableBeginEndClientAttributes();GLImmediate.mode=-1;GLImmediate.enabledClientAttributes=GLImmediate.enabledClientAttributes_preBegin;GLImmediate.clientAttributes=GLImmediate.clientAttributes_preBegin;GLImmediate.currentRenderer=null;GLImmediate.modifiedClientAttributes=true};var _emscripten_glEnd=_glEnd;var _glEndQueryEXT=target=>{GLctx.disjointTimerQueryExt["endQueryEXT"](target)};var _emscripten_glEndQueryEXT=_glEndQueryEXT;function _glFinish(){GLctx.finish()}var _emscripten_glFinish=_glFinish;function _glFlush(){GLctx.flush()}var _emscripten_glFlush=_glFlush;var _glFramebufferRenderbuffer=(target,attachment,renderbuffertarget,renderbuffer)=>{GLctx.framebufferRenderbuffer(target,attachment,renderbuffertarget,GL.renderbuffers[renderbuffer])};var _emscripten_glFramebufferRenderbuffer=_glFramebufferRenderbuffer;var _glFramebufferTexture2D=(target,attachment,textarget,texture,level)=>{GLctx.framebufferTexture2D(target,attachment,textarget,GL.textures[texture],level)};var _emscripten_glFramebufferTexture2D=_glFramebufferTexture2D;function _glFrontFace(x0){GLctx.frontFace(x0)}var _emscripten_glFrontFace=_glFrontFace;var _glFrustum=(left,right,bottom,top_,nearVal,farVal)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],GLImmediate.matrixLib.mat4.frustum(left,right,bottom,top_,nearVal,farVal))};var _emscripten_glFrustum=_glFrustum;var __glGenObject=(n,buffers,createFunction,objectTable)=>{for(var i=0;i>2]=id}};var _glGenBuffers=(n,buffers)=>{__glGenObject(n,buffers,"createBuffer",GL.buffers)};var _emscripten_glGenBuffers=_glGenBuffers;var _glGenFramebuffers=(n,ids)=>{__glGenObject(n,ids,"createFramebuffer",GL.framebuffers)};var _emscripten_glGenFramebuffers=_glGenFramebuffers;var _glGenQueriesEXT=(n,ids)=>{for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.queries);query.name=id;GL.queries[id]=query;HEAP32[ids+i*4>>2]=id}};var _emscripten_glGenQueriesEXT=_glGenQueriesEXT;var _glGenRenderbuffers=(n,renderbuffers)=>{__glGenObject(n,renderbuffers,"createRenderbuffer",GL.renderbuffers)};var _emscripten_glGenRenderbuffers=_glGenRenderbuffers;var _glGenTextures=(n,textures)=>{__glGenObject(n,textures,"createTexture",GL.textures)};var _emscripten_glGenTextures=_glGenTextures;var emulGlGenVertexArrays=(n,vaos)=>{for(var i=0;i>2]=id}};function _glGenVertexArrays(n,arrays){emulGlGenVertexArrays(n,arrays)}var _glGenVertexArraysOES=_glGenVertexArrays;var _emscripten_glGenVertexArraysOES=_glGenVertexArraysOES;function _glGenerateMipmap(x0){GLctx.generateMipmap(x0)}var _emscripten_glGenerateMipmap=_glGenerateMipmap;var __glGetActiveAttribOrUniform=(funcName,program,index,bufSize,length,size,type,name)=>{program=GL.programs[program];var info=GLctx[funcName](program,index);if(info){var numBytesWrittenExclNull=name&&stringToUTF8(info.name,name,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull;if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}};var _glGetActiveAttrib=(program,index,bufSize,length,size,type,name)=>{__glGetActiveAttribOrUniform("getActiveAttrib",program,index,bufSize,length,size,type,name)};var _emscripten_glGetActiveAttrib=_glGetActiveAttrib;var _glGetActiveUniform=(program,index,bufSize,length,size,type,name)=>{__glGetActiveAttribOrUniform("getActiveUniform",program,index,bufSize,length,size,type,name)};var _emscripten_glGetActiveUniform=_glGetActiveUniform;var _glGetAttachedShaders=(program,maxCount,count,shaders)=>{var result=GLctx.getAttachedShaders(GL.programs[program]);var len=result.length;if(len>maxCount){len=maxCount}HEAP32[count>>2]=len;for(var i=0;i>2]=id}};var _emscripten_glGetAttachedShaders=_glGetAttachedShaders;var _glGetAttribLocation=(program,name)=>GLctx.getAttribLocation(GL.programs[program],UTF8ToString(name));var _emscripten_glGetAttribLocation=_glGetAttribLocation;var _emscripten_glGetBooleanv=_glGetBooleanv;var _glGetBufferParameteriv=(target,value,data)=>{if(!data){GL.recordError(1281);return}HEAP32[data>>2]=GLctx.getBufferParameter(target,value)};var _emscripten_glGetBufferParameteriv=_glGetBufferParameteriv;var _glGetError=()=>{var error=GLctx.getError()||GL.lastError;GL.lastError=0;return error};var _emscripten_glGetError=_glGetError;var _emscripten_glGetFloatv=_glGetFloatv;var _glGetFramebufferAttachmentParameteriv=(target,attachment,pname,params)=>{var result=GLctx.getFramebufferAttachmentParameter(target,attachment,pname);if(result instanceof WebGLRenderbuffer||result instanceof WebGLTexture){result=result.name|0}HEAP32[params>>2]=result};var _emscripten_glGetFramebufferAttachmentParameteriv=_glGetFramebufferAttachmentParameteriv;var _glGetProgramInfoLog=(program,maxLength,length,infoLog)=>{var log=GLctx.getProgramInfoLog(GL.programs[program]);if(log===null)log="(unknown error)";var numBytesWrittenExclNull=maxLength>0&&infoLog?stringToUTF8(log,infoLog,maxLength):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull};var _glGetShaderInfoLog=(shader,maxLength,length,infoLog)=>{var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";var numBytesWrittenExclNull=maxLength>0&&infoLog?stringToUTF8(log,infoLog,maxLength):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull};var _glGetInfoLog=(id,maxLength,length,infoLog)=>{if(GL.programs[id]){_glGetProgramInfoLog(id,maxLength,length,infoLog)}else if(GL.shaders[id]){_glGetShaderInfoLog(id,maxLength,length,infoLog)}else{err(`WARNING: glGetInfoLog received invalid id: ${id}`)}};var _emscripten_glGetInfoLog=_glGetInfoLog;var _emscripten_glGetIntegerv=_glGetIntegerv;var _glGetProgramiv=(program,pname,p)=>{if(!p){GL.recordError(1281);return}if(program>=GL.counter){GL.recordError(1281);return}program=GL.programs[program];if(pname==35716){var log=GLctx.getProgramInfoLog(program);if(log===null)log="(unknown error)";HEAP32[p>>2]=log.length+1}else if(pname==35719){if(!program.maxUniformLength){for(var i=0;i>2]=program.maxUniformLength}else if(pname==35722){if(!program.maxAttributeLength){for(var i=0;i>2]=program.maxAttributeLength}else if(pname==35381){if(!program.maxUniformBlockNameLength){for(var i=0;i>2]=program.maxUniformBlockNameLength}else{HEAP32[p>>2]=GLctx.getProgramParameter(program,pname)}};var _glGetShaderiv=(shader,pname,p)=>{if(!p){GL.recordError(1281);return}if(pname==35716){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";var logLength=log?log.length+1:0;HEAP32[p>>2]=logLength}else if(pname==35720){var source=GLctx.getShaderSource(GL.shaders[shader]);var sourceLength=source?source.length+1:0;HEAP32[p>>2]=sourceLength}else{HEAP32[p>>2]=GLctx.getShaderParameter(GL.shaders[shader],pname)}};var _glGetObjectParameteriv=(id,type,result)=>{if(GL.programs[id]){if(type==35716){var log=GLctx.getProgramInfoLog(GL.programs[id]);if(log===null)log="(unknown error)";HEAP32[result>>2]=log.length;return}_glGetProgramiv(id,type,result)}else if(GL.shaders[id]){if(type==35716){var log=GLctx.getShaderInfoLog(GL.shaders[id]);if(log===null)log="(unknown error)";HEAP32[result>>2]=log.length;return}else if(type==35720){var source=GLctx.getShaderSource(GL.shaders[id]);if(source===null)return;HEAP32[result>>2]=source.length;return}_glGetShaderiv(id,type,result)}else{err(`WARNING: getObjectParameteriv received invalid id: ${id}`)}};var _emscripten_glGetObjectParameteriv=_glGetObjectParameteriv;var _glGetPointerv=(name,p)=>{var attribute;switch(name){case 32910:attribute=GLImmediate.clientAttributes[GLImmediate.VERTEX];break;case 32912:attribute=GLImmediate.clientAttributes[GLImmediate.COLOR];break;case 32914:attribute=GLImmediate.clientAttributes[GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture];break;default:GL.recordError(1280);return}HEAP32[p>>2]=attribute?attribute.pointer:0};var _emscripten_glGetPointerv=_glGetPointerv;var _emscripten_glGetProgramInfoLog=_glGetProgramInfoLog;var _emscripten_glGetProgramiv=_glGetProgramiv;var _glGetQueryObjecti64vEXT=(id,pname,params)=>{if(!params){GL.recordError(1281);return}var query=GL.queries[id];var param;{param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname)}var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}writeI53ToI64(params,ret)};var _emscripten_glGetQueryObjecti64vEXT=_glGetQueryObjecti64vEXT;var _glGetQueryObjectivEXT=(id,pname,params)=>{if(!params){GL.recordError(1281);return}var query=GL.queries[id];var param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname);var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}HEAP32[params>>2]=ret};var _emscripten_glGetQueryObjectivEXT=_glGetQueryObjectivEXT;var _glGetQueryObjectui64vEXT=_glGetQueryObjecti64vEXT;var _emscripten_glGetQueryObjectui64vEXT=_glGetQueryObjectui64vEXT;var _glGetQueryObjectuivEXT=_glGetQueryObjectivEXT;var _emscripten_glGetQueryObjectuivEXT=_glGetQueryObjectuivEXT;var _glGetQueryivEXT=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.disjointTimerQueryExt["getQueryEXT"](target,pname)};var _emscripten_glGetQueryivEXT=_glGetQueryivEXT;var _glGetRenderbufferParameteriv=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getRenderbufferParameter(target,pname)};var _emscripten_glGetRenderbufferParameteriv=_glGetRenderbufferParameteriv;var _emscripten_glGetShaderInfoLog=_glGetShaderInfoLog;var _glGetShaderPrecisionFormat=(shaderType,precisionType,range,precision)=>{var result=GLctx.getShaderPrecisionFormat(shaderType,precisionType);HEAP32[range>>2]=result.rangeMin;HEAP32[range+4>>2]=result.rangeMax;HEAP32[precision>>2]=result.precision};var _emscripten_glGetShaderPrecisionFormat=_glGetShaderPrecisionFormat;var _glGetShaderSource=(shader,bufSize,length,source)=>{var result=GLctx.getShaderSource(GL.shaders[shader]);if(!result)return;var numBytesWrittenExclNull=bufSize>0&&source?stringToUTF8(result,source,bufSize):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull};var _emscripten_glGetShaderSource=_glGetShaderSource;var _emscripten_glGetShaderiv=_glGetShaderiv;var _emscripten_glGetString=_glGetString;var _glGetTexEnvfv=(target,pname,param)=>{throw"GL emulation not initialized!"};var _emscripten_glGetTexEnvfv=_glGetTexEnvfv;var _glGetTexEnviv=(target,pname,param)=>{throw"GL emulation not initialized!"};var _emscripten_glGetTexEnviv=_glGetTexEnviv;var _glGetTexLevelParameteriv=(target,level,pname,params)=>{throw"glGetTexLevelParameteriv: TODO"};var _emscripten_glGetTexLevelParameteriv=_glGetTexLevelParameteriv;var _glGetTexParameterfv=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAPF32[params>>2]=GLctx.getTexParameter(target,pname)};var _emscripten_glGetTexParameterfv=_glGetTexParameterfv;var _glGetTexParameteriv=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getTexParameter(target,pname)};var _emscripten_glGetTexParameteriv=_glGetTexParameteriv;var jstoi_q=str=>parseInt(str);var webglGetLeftBracePos=name=>name.slice(-1)=="]"&&name.lastIndexOf("[");var webglPrepareUniformLocationsBeforeFirstUse=program=>{var uniformLocsById=program.uniformLocsById,uniformSizeAndIdsByName=program.uniformSizeAndIdsByName,i,j;if(!uniformLocsById){program.uniformLocsById=uniformLocsById={};program.uniformArrayNamesById={};for(i=0;i0?nm.slice(0,lb):nm;var id=program.uniformIdCounter;program.uniformIdCounter+=sz;uniformSizeAndIdsByName[arrayName]=[sz,id];for(j=0;j{name=UTF8ToString(name);if(program=GL.programs[program]){webglPrepareUniformLocationsBeforeFirstUse(program);var uniformLocsById=program.uniformLocsById;var arrayIndex=0;var uniformBaseName=name;var leftBrace=webglGetLeftBracePos(name);if(leftBrace>0){arrayIndex=jstoi_q(name.slice(leftBrace+1))>>>0;uniformBaseName=name.slice(0,leftBrace)}var sizeAndId=program.uniformSizeAndIdsByName[uniformBaseName];if(sizeAndId&&arrayIndex{var p=GLctx.currentProgram;if(p){var webglLoc=p.uniformLocsById[location];if(typeof webglLoc=="number"){p.uniformLocsById[location]=webglLoc=GLctx.getUniformLocation(p,p.uniformArrayNamesById[location]+(webglLoc>0?"["+webglLoc+"]":""))}return webglLoc}else{GL.recordError(1282)}};var emscriptenWebGLGetUniform=(program,location,params,type)=>{if(!params){GL.recordError(1281);return}program=GL.programs[program];webglPrepareUniformLocationsBeforeFirstUse(program);var data=GLctx.getUniform(program,webglGetUniformLocation(location));if(typeof data=="number"||typeof data=="boolean"){switch(type){case 0:HEAP32[params>>2]=data;break;case 2:HEAPF32[params>>2]=data;break}}else{for(var i=0;i>2]=data[i];break;case 2:HEAPF32[params+i*4>>2]=data[i];break}}}};var _glGetUniformfv=(program,location,params)=>{emscriptenWebGLGetUniform(program,location,params,2)};var _emscripten_glGetUniformfv=_glGetUniformfv;var _glGetUniformiv=(program,location,params)=>{emscriptenWebGLGetUniform(program,location,params,0)};var _emscripten_glGetUniformiv=_glGetUniformiv;var _glGetVertexAttribPointerv=(index,pname,pointer)=>{if(!pointer){GL.recordError(1281);return}HEAP32[pointer>>2]=GLctx.getVertexAttribOffset(index,pname)};var _emscripten_glGetVertexAttribPointerv=_glGetVertexAttribPointerv;var emscriptenWebGLGetVertexAttrib=(index,pname,params,type)=>{if(!params){GL.recordError(1281);return}var data=GLctx.getVertexAttrib(index,pname);if(pname==34975){HEAP32[params>>2]=data&&data["name"]}else if(typeof data=="number"||typeof data=="boolean"){switch(type){case 0:HEAP32[params>>2]=data;break;case 2:HEAPF32[params>>2]=data;break;case 5:HEAP32[params>>2]=Math.fround(data);break}}else{for(var i=0;i>2]=data[i];break;case 2:HEAPF32[params+i*4>>2]=data[i];break;case 5:HEAP32[params+i*4>>2]=Math.fround(data[i]);break}}}};var _glGetVertexAttribfv=(index,pname,params)=>{emscriptenWebGLGetVertexAttrib(index,pname,params,2)};var _emscripten_glGetVertexAttribfv=_glGetVertexAttribfv;var _glGetVertexAttribiv=(index,pname,params)=>{emscriptenWebGLGetVertexAttrib(index,pname,params,5)};var _emscripten_glGetVertexAttribiv=_glGetVertexAttribiv;var _emscripten_glHint=_glHint;var _glIsBuffer=buffer=>{var b=GL.buffers[buffer];if(!b)return 0;return GLctx.isBuffer(b)};var _emscripten_glIsBuffer=_glIsBuffer;var _emscripten_glIsEnabled=_glIsEnabled;var _glIsFramebuffer=framebuffer=>{var fb=GL.framebuffers[framebuffer];if(!fb)return 0;return GLctx.isFramebuffer(fb)};var _emscripten_glIsFramebuffer=_glIsFramebuffer;var _glIsProgram=program=>{program=GL.programs[program];if(!program)return 0;return GLctx.isProgram(program)};var _emscripten_glIsProgram=_glIsProgram;var _glIsQueryEXT=id=>{var query=GL.queries[id];if(!query)return 0;return GLctx.disjointTimerQueryExt["isQueryEXT"](query)};var _emscripten_glIsQueryEXT=_glIsQueryEXT;var _glIsRenderbuffer=renderbuffer=>{var rb=GL.renderbuffers[renderbuffer];if(!rb)return 0;return GLctx.isRenderbuffer(rb)};var _emscripten_glIsRenderbuffer=_glIsRenderbuffer;var _glIsShader=shader=>{var s=GL.shaders[shader];if(!s)return 0;return GLctx.isShader(s)};var _emscripten_glIsShader=_glIsShader;var _glIsTexture=id=>{var texture=GL.textures[id];if(!texture)return 0;return GLctx.isTexture(texture)};var _emscripten_glIsTexture=_glIsTexture;var emulGlIsVertexArray=array=>{var vao=GLEmulation.vaos[array];if(!vao)return 0;return 1};var _glIsVertexArray=array=>emulGlIsVertexArray(array);var _glIsVertexArrayOES=_glIsVertexArray;var _emscripten_glIsVertexArrayOES=_glIsVertexArrayOES;var _glLightModelf=(pname,param)=>{if(pname==2898){GLEmulation.lightModelTwoSide=param!=0?true:false}else{throw"glLightModelf: TODO: "+pname}};var _emscripten_glLightModelf=_glLightModelf;var _glLightModelfv=(pname,param)=>{if(pname==2899){GLEmulation.lightModelAmbient[0]=HEAPF32[param>>2];GLEmulation.lightModelAmbient[1]=HEAPF32[param+4>>2];GLEmulation.lightModelAmbient[2]=HEAPF32[param+8>>2];GLEmulation.lightModelAmbient[3]=HEAPF32[param+12>>2]}else{throw"glLightModelfv: TODO: "+pname}};var _emscripten_glLightModelfv=_glLightModelfv;var _glLightfv=(light,pname,param)=>{if(light>=16384&&light<16392){var lightId=light-16384;if(pname==4608){GLEmulation.lightAmbient[lightId][0]=HEAPF32[param>>2];GLEmulation.lightAmbient[lightId][1]=HEAPF32[param+4>>2];GLEmulation.lightAmbient[lightId][2]=HEAPF32[param+8>>2];GLEmulation.lightAmbient[lightId][3]=HEAPF32[param+12>>2]}else if(pname==4609){GLEmulation.lightDiffuse[lightId][0]=HEAPF32[param>>2];GLEmulation.lightDiffuse[lightId][1]=HEAPF32[param+4>>2];GLEmulation.lightDiffuse[lightId][2]=HEAPF32[param+8>>2];GLEmulation.lightDiffuse[lightId][3]=HEAPF32[param+12>>2]}else if(pname==4610){GLEmulation.lightSpecular[lightId][0]=HEAPF32[param>>2];GLEmulation.lightSpecular[lightId][1]=HEAPF32[param+4>>2];GLEmulation.lightSpecular[lightId][2]=HEAPF32[param+8>>2];GLEmulation.lightSpecular[lightId][3]=HEAPF32[param+12>>2]}else if(pname==4611){GLEmulation.lightPosition[lightId][0]=HEAPF32[param>>2];GLEmulation.lightPosition[lightId][1]=HEAPF32[param+4>>2];GLEmulation.lightPosition[lightId][2]=HEAPF32[param+8>>2];GLEmulation.lightPosition[lightId][3]=HEAPF32[param+12>>2];GLImmediate.matrixLib.mat4.multiplyVec4(GLImmediate.matrix[0],GLEmulation.lightPosition[lightId])}else{throw"glLightfv: TODO: "+pname}}};var _emscripten_glLightfv=_glLightfv;function _glLineWidth(x0){GLctx.lineWidth(x0)}var _emscripten_glLineWidth=_glLineWidth;var _emscripten_glLinkProgram=_glLinkProgram;var _glLoadIdentity=()=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.identity(GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadIdentity=_glLoadIdentity;var _glLoadMatrixd=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.set(HEAPF64.subarray(matrix>>3,matrix+128>>3),GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadMatrixd=_glLoadMatrixd;var _glLoadMatrixf=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.set(HEAPF32.subarray(matrix>>2,matrix+64>>2),GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadMatrixf=_glLoadMatrixf;var _glLoadTransposeMatrixd=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.set(HEAPF64.subarray(matrix>>3,matrix+128>>3),GLImmediate.matrix[GLImmediate.currentMatrix]);GLImmediate.matrixLib.mat4.transpose(GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadTransposeMatrixd=_glLoadTransposeMatrixd;var _glLoadTransposeMatrixf=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.set(HEAPF32.subarray(matrix>>2,matrix+64>>2),GLImmediate.matrix[GLImmediate.currentMatrix]);GLImmediate.matrixLib.mat4.transpose(GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadTransposeMatrixf=_glLoadTransposeMatrixf;var _glMaterialfv=(face,pname,param)=>{if(face!=1028&&face!=1032){throw"glMaterialfv: TODO"+face}if(pname==4608){GLEmulation.materialAmbient[0]=HEAPF32[param>>2];GLEmulation.materialAmbient[1]=HEAPF32[param+4>>2];GLEmulation.materialAmbient[2]=HEAPF32[param+8>>2];GLEmulation.materialAmbient[3]=HEAPF32[param+12>>2]}else if(pname==4609){GLEmulation.materialDiffuse[0]=HEAPF32[param>>2];GLEmulation.materialDiffuse[1]=HEAPF32[param+4>>2];GLEmulation.materialDiffuse[2]=HEAPF32[param+8>>2];GLEmulation.materialDiffuse[3]=HEAPF32[param+12>>2]}else if(pname==4610){GLEmulation.materialSpecular[0]=HEAPF32[param>>2];GLEmulation.materialSpecular[1]=HEAPF32[param+4>>2];GLEmulation.materialSpecular[2]=HEAPF32[param+8>>2];GLEmulation.materialSpecular[3]=HEAPF32[param+12>>2]}else if(pname==5633){GLEmulation.materialShininess[0]=HEAPF32[param>>2]}else{throw"glMaterialfv: TODO: "+pname}};var _emscripten_glMaterialfv=_glMaterialfv;var _glMatrixMode=mode=>{if(mode==5888){GLImmediate.currentMatrix=0}else if(mode==5889){GLImmediate.currentMatrix=1}else if(mode==5890){GLImmediate.useTextureMatrix=true;GLImmediate.currentMatrix=2+GLImmediate.TexEnvJIT.getActiveTexture()}else{throw"Wrong mode "+mode+" passed to glMatrixMode"}};var _emscripten_glMatrixMode=_glMatrixMode;var _glMultMatrixd=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],HEAPF64.subarray(matrix>>3,matrix+128>>3))};var _emscripten_glMultMatrixd=_glMultMatrixd;var _glMultMatrixf=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],HEAPF32.subarray(matrix>>2,matrix+64>>2))};var _emscripten_glMultMatrixf=_glMultMatrixf;var _glMultTransposeMatrixd=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;var colMajor=GLImmediate.matrixLib.mat4.create();GLImmediate.matrixLib.mat4.set(HEAPF64.subarray(matrix>>3,matrix+128>>3),colMajor);GLImmediate.matrixLib.mat4.transpose(colMajor);GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],colMajor)};var _emscripten_glMultTransposeMatrixd=_glMultTransposeMatrixd;var _glMultTransposeMatrixf=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;var colMajor=GLImmediate.matrixLib.mat4.create();GLImmediate.matrixLib.mat4.set(HEAPF32.subarray(matrix>>2,matrix+64>>2),colMajor);GLImmediate.matrixLib.mat4.transpose(colMajor);GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],colMajor)};var _emscripten_glMultTransposeMatrixf=_glMultTransposeMatrixf;var _glNormal3f=(x,y,z)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=x;GLImmediate.vertexData[GLImmediate.vertexCounter++]=y;GLImmediate.vertexData[GLImmediate.vertexCounter++]=z;GLImmediate.addRendererComponent(GLImmediate.NORMAL,3,GLctx.FLOAT)};var _emscripten_glNormal3f=_glNormal3f;var _glNormalPointer=(type,stride,pointer)=>{GLImmediate.setClientAttribute(GLImmediate.NORMAL,3,type,stride,pointer)};var _emscripten_glNormalPointer=_glNormalPointer;var _glOrtho=(left,right,bottom,top_,nearVal,farVal)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],GLImmediate.matrixLib.mat4.ortho(left,right,bottom,top_,nearVal,farVal))};var _emscripten_glOrtho=_glOrtho;var _glPixelStorei=(pname,param)=>{if(pname==3317){GL.unpackAlignment=param}GLctx.pixelStorei(pname,param)};var _emscripten_glPixelStorei=_glPixelStorei;var _glPolygonMode=()=>{};var _emscripten_glPolygonMode=_glPolygonMode;function _glPolygonOffset(x0,x1){GLctx.polygonOffset(x0,x1)}var _emscripten_glPolygonOffset=_glPolygonOffset;var _glPopMatrix=()=>{if(GLImmediate.matrixStack[GLImmediate.currentMatrix].length==0){GL.recordError(1284);return}GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrix[GLImmediate.currentMatrix]=GLImmediate.matrixStack[GLImmediate.currentMatrix].pop()};var _emscripten_glPopMatrix=_glPopMatrix;var _glPushMatrix=()=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixStack[GLImmediate.currentMatrix].push(Array.prototype.slice.call(GLImmediate.matrix[GLImmediate.currentMatrix]))};var _emscripten_glPushMatrix=_glPushMatrix;var _glQueryCounterEXT=(id,target)=>{GLctx.disjointTimerQueryExt["queryCounterEXT"](GL.queries[id],target)};var _emscripten_glQueryCounterEXT=_glQueryCounterEXT;var _glReadBuffer=()=>{throw"glReadBuffer: TODO"};var _emscripten_glReadBuffer=_glReadBuffer;var computeUnpackAlignedImageSize=(width,height,sizePerPixel,alignment)=>{function roundedToNextMultipleOf(x,y){return x+y-1&-y}var plainRowSize=width*sizePerPixel;var alignedRowSize=roundedToNextMultipleOf(plainRowSize,alignment);return height*alignedRowSize};var colorChannelsInGlTextureFormat=format=>{var colorChannels={5:3,6:4,8:2,29502:3,29504:4};return colorChannels[format-6402]||1};var heapObjectForWebGLType=type=>{type-=5120;if(type==1)return HEAPU8;if(type==4)return HEAP32;if(type==6)return HEAPF32;if(type==5||type==28922)return HEAPU32;return HEAPU16};var heapAccessShiftForWebGLHeap=heap=>31-Math.clz32(heap.BYTES_PER_ELEMENT);var emscriptenWebGLGetTexPixelData=(type,format,width,height,pixels,internalFormat)=>{var heap=heapObjectForWebGLType(type);var shift=heapAccessShiftForWebGLHeap(heap);var byteSize=1<>shift,pixels+bytes>>shift)};var _glReadPixels=(x,y,width,height,format,type,pixels)=>{var pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,format);if(!pixelData){GL.recordError(1280);return}GLctx.readPixels(x,y,width,height,format,type,pixelData)};var _emscripten_glReadPixels=_glReadPixels;var _glReleaseShaderCompiler=()=>{};var _emscripten_glReleaseShaderCompiler=_glReleaseShaderCompiler;function _glRenderbufferStorage(x0,x1,x2,x3){GLctx.renderbufferStorage(x0,x1,x2,x3)}var _emscripten_glRenderbufferStorage=_glRenderbufferStorage;var _glRotated=(angle,x,y,z)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.rotate(GLImmediate.matrix[GLImmediate.currentMatrix],angle*Math.PI/180,[x,y,z])};var _emscripten_glRotated=_glRotated;var _glRotatef=_glRotated;var _emscripten_glRotatef=_glRotatef;var _glSampleCoverage=(value,invert)=>{GLctx.sampleCoverage(value,!!invert)};var _emscripten_glSampleCoverage=_glSampleCoverage;var _glScaled=(x,y,z)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.scale(GLImmediate.matrix[GLImmediate.currentMatrix],[x,y,z])};var _emscripten_glScaled=_glScaled;var _glScalef=_glScaled;var _emscripten_glScalef=_glScalef;function _glScissor(x0,x1,x2,x3){GLctx.scissor(x0,x1,x2,x3)}var _emscripten_glScissor=_glScissor;var _glShadeModel=()=>warnOnce("TODO: glShadeModel");var _emscripten_glShadeModel=_glShadeModel;var _glShaderBinary=(count,shaders,binaryformat,binary,length)=>{GL.recordError(1280)};var _emscripten_glShaderBinary=_glShaderBinary;var _emscripten_glShaderSource=_glShaderSource;function _glStencilFunc(x0,x1,x2){GLctx.stencilFunc(x0,x1,x2)}var _emscripten_glStencilFunc=_glStencilFunc;function _glStencilFuncSeparate(x0,x1,x2,x3){GLctx.stencilFuncSeparate(x0,x1,x2,x3)}var _emscripten_glStencilFuncSeparate=_glStencilFuncSeparate;function _glStencilMask(x0){GLctx.stencilMask(x0)}var _emscripten_glStencilMask=_glStencilMask;function _glStencilMaskSeparate(x0,x1){GLctx.stencilMaskSeparate(x0,x1)}var _emscripten_glStencilMaskSeparate=_glStencilMaskSeparate;function _glStencilOp(x0,x1,x2){GLctx.stencilOp(x0,x1,x2)}var _emscripten_glStencilOp=_glStencilOp;function _glStencilOpSeparate(x0,x1,x2,x3){GLctx.stencilOpSeparate(x0,x1,x2,x3)}var _emscripten_glStencilOpSeparate=_glStencilOpSeparate;var _glTexCoord2i=(u,v)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=u;GLImmediate.vertexData[GLImmediate.vertexCounter++]=v;GLImmediate.addRendererComponent(GLImmediate.TEXTURE0,2,GLctx.FLOAT)};var _glTexCoord2f=_glTexCoord2i;var _emscripten_glTexCoord2f=_glTexCoord2f;var _glTexCoord2fv=v=>{_glTexCoord2i(HEAPF32[v>>2],HEAPF32[v+4>>2])};var _emscripten_glTexCoord2fv=_glTexCoord2fv;var _emscripten_glTexCoord2i=_glTexCoord2i;var _glTexCoord3f=(target,level,internalformat,width,border,format,type,data)=>{throw"glTexCoord3f: TODO"};var _emscripten_glTexCoord3f=_glTexCoord3f;var _glTexCoord4f=()=>{throw"glTexCoord4f: TODO"};var _emscripten_glTexCoord4f=_glTexCoord4f;var _glTexCoordPointer=(size,type,stride,pointer)=>{GLImmediate.setClientAttribute(GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture,size,type,stride,pointer)};var _emscripten_glTexCoordPointer=_glTexCoordPointer;var _glTexGenfv=(coord,pname,param)=>{throw"glTexGenfv: TODO"};var _emscripten_glTexGenfv=_glTexGenfv;var _glTexGeni=(coord,pname,param)=>{throw"glTexGeni: TODO"};var _emscripten_glTexGeni=_glTexGeni;var _glTexImage1D=(target,level,internalformat,width,border,format,type,data)=>{throw"glTexImage1D: TODO"};var _emscripten_glTexImage1D=_glTexImage1D;var _glTexImage2D=(target,level,internalFormat,width,height,border,format,type,pixels)=>{GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixels?emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat):null)};var _emscripten_glTexImage2D=_glTexImage2D;function _glTexParameterf(x0,x1,x2){GLctx.texParameterf(x0,x1,x2)}var _emscripten_glTexParameterf=_glTexParameterf;var _glTexParameterfv=(target,pname,params)=>{var param=HEAPF32[params>>2];GLctx.texParameterf(target,pname,param)};var _emscripten_glTexParameterfv=_glTexParameterfv;function _glTexParameteri(x0,x1,x2){GLctx.texParameteri(x0,x1,x2)}var _emscripten_glTexParameteri=_glTexParameteri;var _glTexParameteriv=(target,pname,params)=>{var param=HEAP32[params>>2];GLctx.texParameteri(target,pname,param)};var _emscripten_glTexParameteriv=_glTexParameteriv;var _glTexSubImage2D=(target,level,xoffset,yoffset,width,height,format,type,pixels)=>{var pixelData=null;if(pixels)pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,0);GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixelData)};var _emscripten_glTexSubImage2D=_glTexSubImage2D;var _glTranslated=(x,y,z)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.translate(GLImmediate.matrix[GLImmediate.currentMatrix],[x,y,z])};var _emscripten_glTranslated=_glTranslated;var _glTranslatef=_glTranslated;var _emscripten_glTranslatef=_glTranslatef;var _glUniform1f=(location,v0)=>{GLctx.uniform1f(webglGetUniformLocation(location),v0)};var _emscripten_glUniform1f=_glUniform1f;var miniTempWebGLFloatBuffers=[];var _glUniform1fv=(location,count,value)=>{if(count<=288){var view=miniTempWebGLFloatBuffers[count-1];for(var i=0;i>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*4>>2)}GLctx.uniform1fv(webglGetUniformLocation(location),view)};var _emscripten_glUniform1fv=_glUniform1fv;var _glUniform1i=(location,v0)=>{GLctx.uniform1i(webglGetUniformLocation(location),v0)};var _emscripten_glUniform1i=_glUniform1i;var miniTempWebGLIntBuffers=[];var _glUniform1iv=(location,count,value)=>{if(count<=288){var view=miniTempWebGLIntBuffers[count-1];for(var i=0;i>2]}}else{var view=HEAP32.subarray(value>>2,value+count*4>>2)}GLctx.uniform1iv(webglGetUniformLocation(location),view)};var _emscripten_glUniform1iv=_glUniform1iv;var _glUniform2f=(location,v0,v1)=>{GLctx.uniform2f(webglGetUniformLocation(location),v0,v1)};var _emscripten_glUniform2f=_glUniform2f;var _glUniform2fv=(location,count,value)=>{if(count<=144){var view=miniTempWebGLFloatBuffers[2*count-1];for(var i=0;i<2*count;i+=2){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*8>>2)}GLctx.uniform2fv(webglGetUniformLocation(location),view)};var _emscripten_glUniform2fv=_glUniform2fv;var _glUniform2i=(location,v0,v1)=>{GLctx.uniform2i(webglGetUniformLocation(location),v0,v1)};var _emscripten_glUniform2i=_glUniform2i;var _glUniform2iv=(location,count,value)=>{if(count<=144){var view=miniTempWebGLIntBuffers[2*count-1];for(var i=0;i<2*count;i+=2){view[i]=HEAP32[value+4*i>>2];view[i+1]=HEAP32[value+(4*i+4)>>2]}}else{var view=HEAP32.subarray(value>>2,value+count*8>>2)}GLctx.uniform2iv(webglGetUniformLocation(location),view)};var _emscripten_glUniform2iv=_glUniform2iv;var _glUniform3f=(location,v0,v1,v2)=>{GLctx.uniform3f(webglGetUniformLocation(location),v0,v1,v2)};var _emscripten_glUniform3f=_glUniform3f;var _glUniform3fv=(location,count,value)=>{if(count<=96){var view=miniTempWebGLFloatBuffers[3*count-1];for(var i=0;i<3*count;i+=3){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*12>>2)}GLctx.uniform3fv(webglGetUniformLocation(location),view)};var _emscripten_glUniform3fv=_glUniform3fv;var _glUniform3i=(location,v0,v1,v2)=>{GLctx.uniform3i(webglGetUniformLocation(location),v0,v1,v2)};var _emscripten_glUniform3i=_glUniform3i;var _glUniform3iv=(location,count,value)=>{if(count<=96){var view=miniTempWebGLIntBuffers[3*count-1];for(var i=0;i<3*count;i+=3){view[i]=HEAP32[value+4*i>>2];view[i+1]=HEAP32[value+(4*i+4)>>2];view[i+2]=HEAP32[value+(4*i+8)>>2]}}else{var view=HEAP32.subarray(value>>2,value+count*12>>2)}GLctx.uniform3iv(webglGetUniformLocation(location),view)};var _emscripten_glUniform3iv=_glUniform3iv;var _glUniform4f=(location,v0,v1,v2,v3)=>{GLctx.uniform4f(webglGetUniformLocation(location),v0,v1,v2,v3)};var _emscripten_glUniform4f=_glUniform4f;var _glUniform4fv=(location,count,value)=>{if(count<=72){var view=miniTempWebGLFloatBuffers[4*count-1];var heap=HEAPF32;value>>=2;for(var i=0;i<4*count;i+=4){var dst=value+i;view[i]=heap[dst];view[i+1]=heap[dst+1];view[i+2]=heap[dst+2];view[i+3]=heap[dst+3]}}else{var view=HEAPF32.subarray(value>>2,value+count*16>>2)}GLctx.uniform4fv(webglGetUniformLocation(location),view)};var _emscripten_glUniform4fv=_glUniform4fv;var _glUniform4i=(location,v0,v1,v2,v3)=>{GLctx.uniform4i(webglGetUniformLocation(location),v0,v1,v2,v3)};var _emscripten_glUniform4i=_glUniform4i;var _glUniform4iv=(location,count,value)=>{if(count<=72){var view=miniTempWebGLIntBuffers[4*count-1];for(var i=0;i<4*count;i+=4){view[i]=HEAP32[value+4*i>>2];view[i+1]=HEAP32[value+(4*i+4)>>2];view[i+2]=HEAP32[value+(4*i+8)>>2];view[i+3]=HEAP32[value+(4*i+12)>>2]}}else{var view=HEAP32.subarray(value>>2,value+count*16>>2)}GLctx.uniform4iv(webglGetUniformLocation(location),view)};var _emscripten_glUniform4iv=_glUniform4iv;var _glUniformMatrix2fv=(location,count,transpose,value)=>{if(count<=72){var view=miniTempWebGLFloatBuffers[4*count-1];for(var i=0;i<4*count;i+=4){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*16>>2)}GLctx.uniformMatrix2fv(webglGetUniformLocation(location),!!transpose,view)};var _emscripten_glUniformMatrix2fv=_glUniformMatrix2fv;var _glUniformMatrix3fv=(location,count,transpose,value)=>{if(count<=32){var view=miniTempWebGLFloatBuffers[9*count-1];for(var i=0;i<9*count;i+=9){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2];view[i+4]=HEAPF32[value+(4*i+16)>>2];view[i+5]=HEAPF32[value+(4*i+20)>>2];view[i+6]=HEAPF32[value+(4*i+24)>>2];view[i+7]=HEAPF32[value+(4*i+28)>>2];view[i+8]=HEAPF32[value+(4*i+32)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*36>>2)}GLctx.uniformMatrix3fv(webglGetUniformLocation(location),!!transpose,view)};var _emscripten_glUniformMatrix3fv=_glUniformMatrix3fv;var _glUniformMatrix4fv=(location,count,transpose,value)=>{if(count<=18){var view=miniTempWebGLFloatBuffers[16*count-1];var heap=HEAPF32;value>>=2;for(var i=0;i<16*count;i+=16){var dst=value+i;view[i]=heap[dst];view[i+1]=heap[dst+1];view[i+2]=heap[dst+2];view[i+3]=heap[dst+3];view[i+4]=heap[dst+4];view[i+5]=heap[dst+5];view[i+6]=heap[dst+6];view[i+7]=heap[dst+7];view[i+8]=heap[dst+8];view[i+9]=heap[dst+9];view[i+10]=heap[dst+10];view[i+11]=heap[dst+11];view[i+12]=heap[dst+12];view[i+13]=heap[dst+13];view[i+14]=heap[dst+14];view[i+15]=heap[dst+15]}}else{var view=HEAPF32.subarray(value>>2,value+count*64>>2)}GLctx.uniformMatrix4fv(webglGetUniformLocation(location),!!transpose,view)};var _emscripten_glUniformMatrix4fv=_glUniformMatrix4fv;var _emscripten_glUseProgram=_glUseProgram;var _glValidateProgram=program=>{GLctx.validateProgram(GL.programs[program])};var _emscripten_glValidateProgram=_glValidateProgram;var _glVertex2f=(x,y)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=x;GLImmediate.vertexData[GLImmediate.vertexCounter++]=y;GLImmediate.vertexData[GLImmediate.vertexCounter++]=0;GLImmediate.vertexData[GLImmediate.vertexCounter++]=1;GLImmediate.addRendererComponent(GLImmediate.VERTEX,4,GLctx.FLOAT)};var _emscripten_glVertex2f=_glVertex2f;var _glVertex2fv=p=>{_glVertex2f(HEAPF32[p>>2],HEAPF32[p+4>>2])};var _emscripten_glVertex2fv=_glVertex2fv;var _glVertex2i=_glVertex2f;var _emscripten_glVertex2i=_glVertex2i;var _glVertex3f=(x,y,z)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=x;GLImmediate.vertexData[GLImmediate.vertexCounter++]=y;GLImmediate.vertexData[GLImmediate.vertexCounter++]=z;GLImmediate.vertexData[GLImmediate.vertexCounter++]=1;GLImmediate.addRendererComponent(GLImmediate.VERTEX,4,GLctx.FLOAT)};var _emscripten_glVertex3f=_glVertex3f;var _glVertex3fv=p=>{_glVertex3f(HEAPF32[p>>2],HEAPF32[p+4>>2],HEAPF32[p+8>>2])};var _emscripten_glVertex3fv=_glVertex3fv;var _glVertex3i=_glVertex3f;var _emscripten_glVertex3i=_glVertex3i;var _glVertex4f=(x,y,z,w)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=x;GLImmediate.vertexData[GLImmediate.vertexCounter++]=y;GLImmediate.vertexData[GLImmediate.vertexCounter++]=z;GLImmediate.vertexData[GLImmediate.vertexCounter++]=w;GLImmediate.addRendererComponent(GLImmediate.VERTEX,4,GLctx.FLOAT)};var _emscripten_glVertex4f=_glVertex4f;var _glVertex4fv=p=>{_glVertex4f(HEAPF32[p>>2],HEAPF32[p+4>>2],HEAPF32[p+8>>2],HEAPF32[p+12>>2])};var _emscripten_glVertex4fv=_glVertex4fv;var _glVertex4i=_glVertex4f;var _emscripten_glVertex4i=_glVertex4i;function _glVertexAttrib1f(x0,x1){GLctx.vertexAttrib1f(x0,x1)}var _emscripten_glVertexAttrib1f=_glVertexAttrib1f;var _glVertexAttrib1fv=(index,v)=>{GLctx.vertexAttrib1f(index,HEAPF32[v>>2])};var _emscripten_glVertexAttrib1fv=_glVertexAttrib1fv;function _glVertexAttrib2f(x0,x1,x2){GLctx.vertexAttrib2f(x0,x1,x2)}var _emscripten_glVertexAttrib2f=_glVertexAttrib2f;var _glVertexAttrib2fv=(index,v)=>{GLctx.vertexAttrib2f(index,HEAPF32[v>>2],HEAPF32[v+4>>2])};var _emscripten_glVertexAttrib2fv=_glVertexAttrib2fv;function _glVertexAttrib3f(x0,x1,x2,x3){GLctx.vertexAttrib3f(x0,x1,x2,x3)}var _emscripten_glVertexAttrib3f=_glVertexAttrib3f;var _glVertexAttrib3fv=(index,v)=>{GLctx.vertexAttrib3f(index,HEAPF32[v>>2],HEAPF32[v+4>>2],HEAPF32[v+8>>2])};var _emscripten_glVertexAttrib3fv=_glVertexAttrib3fv;function _glVertexAttrib4f(x0,x1,x2,x3,x4){GLctx.vertexAttrib4f(x0,x1,x2,x3,x4)}var _emscripten_glVertexAttrib4f=_glVertexAttrib4f;var _glVertexAttrib4fv=(index,v)=>{GLctx.vertexAttrib4f(index,HEAPF32[v>>2],HEAPF32[v+4>>2],HEAPF32[v+8>>2],HEAPF32[v+12>>2])};var _emscripten_glVertexAttrib4fv=_glVertexAttrib4fv;var _glVertexAttribDivisor=(index,divisor)=>{GLctx.vertexAttribDivisor(index,divisor)};var _glVertexAttribDivisorANGLE=_glVertexAttribDivisor;var _emscripten_glVertexAttribDivisorANGLE=_glVertexAttribDivisorANGLE;var _emscripten_glVertexAttribPointer=_glVertexAttribPointer;var _glVertexPointer=(size,type,stride,pointer)=>{GLImmediate.setClientAttribute(GLImmediate.VERTEX,size,type,stride,pointer)};var _emscripten_glVertexPointer=_glVertexPointer;function _glViewport(x0,x1,x2,x3){GLctx.viewport(x0,x1,x2,x3)}var _emscripten_glViewport=_glViewport;var _emscripten_has_asyncify=()=>0;var _emscripten_memcpy_js=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var doRequestFullscreen=(target,strategy)=>{if(!JSEvents.fullscreenEnabled())return-1;target=findEventTarget(target);if(!target)return-4;if(!target.requestFullscreen&&!target.webkitRequestFullscreen){return-3}var canPerformRequests=JSEvents.canPerformEventHandlerRequests();if(!canPerformRequests){if(strategy.deferUntilInEventHandler){JSEvents.deferCall(JSEvents_requestFullscreen,1,[target,strategy]);return 1}return-2}return JSEvents_requestFullscreen(target,strategy)};var _emscripten_request_fullscreen_strategy=(target,deferUntilInEventHandler,fullscreenStrategy)=>{var strategy={scaleMode:HEAP32[fullscreenStrategy>>2],canvasResolutionScaleMode:HEAP32[fullscreenStrategy+4>>2],filteringMode:HEAP32[fullscreenStrategy+8>>2],deferUntilInEventHandler:deferUntilInEventHandler,canvasResizedCallback:HEAP32[fullscreenStrategy+12>>2],canvasResizedCallbackUserData:HEAP32[fullscreenStrategy+16>>2]};return doRequestFullscreen(target,strategy)};var _emscripten_request_pointerlock=(target,deferUntilInEventHandler)=>{target=findEventTarget(target);if(!target)return-4;if(!target.requestPointerLock){return-1}var canPerformRequests=JSEvents.canPerformEventHandlerRequests();if(!canPerformRequests){if(deferUntilInEventHandler){JSEvents.deferCall(requestPointerLock,2,[target]);return 1}return-2}return requestPointerLock(target)};var getHeapMax=()=>2147483648;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}var alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var _emscripten_sample_gamepad_data=()=>(JSEvents.lastGamepadState=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():null)?0:-1;var registerBeforeUnloadEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString)=>{var beforeUnloadEventHandlerFunc=(e=event)=>{var confirmationMessage=getWasmTableEntry(callbackfunc)(eventTypeId,0,userData);if(confirmationMessage){confirmationMessage=UTF8ToString(confirmationMessage)}if(confirmationMessage){e.preventDefault();e.returnValue=confirmationMessage;return confirmationMessage}};var eventHandler={target:findEventTarget(target),eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:beforeUnloadEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_beforeunload_callback_on_thread=(userData,callbackfunc,targetThread)=>{if(typeof onbeforeunload=="undefined")return-1;if(targetThread!==1)return-5;return registerBeforeUnloadEventCallback(2,userData,true,callbackfunc,28,"beforeunload")};var registerFocusEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.focusEvent)JSEvents.focusEvent=_malloc(256);var focusEventHandlerFunc=(e=event)=>{var nodeName=JSEvents.getNodeNameForTarget(e.target);var id=e.target.id?e.target.id:"";var focusEvent=JSEvents.focusEvent;stringToUTF8(nodeName,focusEvent+0,128);stringToUTF8(id,focusEvent+128,128);if(getWasmTableEntry(callbackfunc)(eventTypeId,focusEvent,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:focusEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_blur_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerFocusEventCallback(target,userData,useCapture,callbackfunc,12,"blur",targetThread);var _emscripten_set_element_css_size=(target,width,height)=>{target=findEventTarget(target);if(!target)return-4;target.style.width=width+"px";target.style.height=height+"px";return 0};var _emscripten_set_focus_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerFocusEventCallback(target,userData,useCapture,callbackfunc,13,"focus",targetThread);var fillFullscreenChangeEventData=eventStruct=>{var fullscreenElement=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;var isFullscreen=!!fullscreenElement;HEAP32[eventStruct>>2]=isFullscreen;HEAP32[eventStruct+4>>2]=JSEvents.fullscreenEnabled();var reportedElement=isFullscreen?fullscreenElement:JSEvents.previousFullscreenElement;var nodeName=JSEvents.getNodeNameForTarget(reportedElement);var id=reportedElement&&reportedElement.id?reportedElement.id:"";stringToUTF8(nodeName,eventStruct+8,128);stringToUTF8(id,eventStruct+136,128);HEAP32[eventStruct+264>>2]=reportedElement?reportedElement.clientWidth:0;HEAP32[eventStruct+268>>2]=reportedElement?reportedElement.clientHeight:0;HEAP32[eventStruct+272>>2]=screen.width;HEAP32[eventStruct+276>>2]=screen.height;if(isFullscreen){JSEvents.previousFullscreenElement=fullscreenElement}};var registerFullscreenChangeEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.fullscreenChangeEvent)JSEvents.fullscreenChangeEvent=_malloc(280);var fullscreenChangeEventhandlerFunc=(e=event)=>{var fullscreenChangeEvent=JSEvents.fullscreenChangeEvent;fillFullscreenChangeEventData(fullscreenChangeEvent);if(getWasmTableEntry(callbackfunc)(eventTypeId,fullscreenChangeEvent,userData))e.preventDefault()};var eventHandler={target:target,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:fullscreenChangeEventhandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_fullscreenchange_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>{if(!JSEvents.fullscreenEnabled())return-1;target=findEventTarget(target);if(!target)return-4;registerFullscreenChangeEventCallback(target,userData,useCapture,callbackfunc,19,"webkitfullscreenchange",targetThread);return registerFullscreenChangeEventCallback(target,userData,useCapture,callbackfunc,19,"fullscreenchange",targetThread)};var registerGamepadEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.gamepadEvent)JSEvents.gamepadEvent=_malloc(1432);var gamepadEventHandlerFunc=(e=event)=>{var gamepadEvent=JSEvents.gamepadEvent;fillGamepadEventData(gamepadEvent,e["gamepad"]);if(getWasmTableEntry(callbackfunc)(eventTypeId,gamepadEvent,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:gamepadEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_gamepadconnected_callback_on_thread=(userData,useCapture,callbackfunc,targetThread)=>{if(!navigator.getGamepads&&!navigator.webkitGetGamepads)return-1;return registerGamepadEventCallback(2,userData,useCapture,callbackfunc,26,"gamepadconnected",targetThread)};var _emscripten_set_gamepaddisconnected_callback_on_thread=(userData,useCapture,callbackfunc,targetThread)=>{if(!navigator.getGamepads&&!navigator.webkitGetGamepads)return-1;return registerGamepadEventCallback(2,userData,useCapture,callbackfunc,27,"gamepaddisconnected",targetThread)};var registerKeyEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.keyEvent)JSEvents.keyEvent=_malloc(176);var keyEventHandlerFunc=e=>{var keyEventData=JSEvents.keyEvent;HEAPF64[keyEventData>>3]=e.timeStamp;var idx=keyEventData>>2;HEAP32[idx+2]=e.location;HEAP32[idx+3]=e.ctrlKey;HEAP32[idx+4]=e.shiftKey;HEAP32[idx+5]=e.altKey;HEAP32[idx+6]=e.metaKey;HEAP32[idx+7]=e.repeat;HEAP32[idx+8]=e.charCode;HEAP32[idx+9]=e.keyCode;HEAP32[idx+10]=e.which;stringToUTF8(e.key||"",keyEventData+44,32);stringToUTF8(e.code||"",keyEventData+76,32);stringToUTF8(e.char||"",keyEventData+108,32);stringToUTF8(e.locale||"",keyEventData+140,32);if(getWasmTableEntry(callbackfunc)(eventTypeId,keyEventData,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:keyEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_keydown_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerKeyEventCallback(target,userData,useCapture,callbackfunc,2,"keydown",targetThread);var _emscripten_set_keypress_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerKeyEventCallback(target,userData,useCapture,callbackfunc,1,"keypress",targetThread);var _emscripten_set_keyup_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerKeyEventCallback(target,userData,useCapture,callbackfunc,3,"keyup",targetThread);var _emscripten_set_main_loop=(func,fps,simulateInfiniteLoop)=>{var browserIterationFunc=getWasmTableEntry(func);setMainLoop(browserIterationFunc,fps,simulateInfiniteLoop)};var fillMouseEventData=(eventStruct,e,target)=>{HEAPF64[eventStruct>>3]=e.timeStamp;var idx=eventStruct>>2;HEAP32[idx+2]=e.screenX;HEAP32[idx+3]=e.screenY;HEAP32[idx+4]=e.clientX;HEAP32[idx+5]=e.clientY;HEAP32[idx+6]=e.ctrlKey;HEAP32[idx+7]=e.shiftKey;HEAP32[idx+8]=e.altKey;HEAP32[idx+9]=e.metaKey;HEAP16[idx*2+20]=e.button;HEAP16[idx*2+21]=e.buttons;HEAP32[idx+11]=e["movementX"];HEAP32[idx+12]=e["movementY"];var rect=getBoundingClientRect(target);HEAP32[idx+13]=e.clientX-rect.left;HEAP32[idx+14]=e.clientY-rect.top};var registerMouseEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.mouseEvent)JSEvents.mouseEvent=_malloc(72);target=findEventTarget(target);var mouseEventHandlerFunc=(e=event)=>{fillMouseEventData(JSEvents.mouseEvent,e,target);if(getWasmTableEntry(callbackfunc)(eventTypeId,JSEvents.mouseEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString!="mousemove"&&eventTypeString!="mouseenter"&&eventTypeString!="mouseleave",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:mouseEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_mousedown_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,5,"mousedown",targetThread);var _emscripten_set_mouseenter_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,33,"mouseenter",targetThread);var _emscripten_set_mouseleave_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,34,"mouseleave",targetThread);var _emscripten_set_mousemove_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,8,"mousemove",targetThread);var _emscripten_set_mouseup_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,6,"mouseup",targetThread);var fillPointerlockChangeEventData=eventStruct=>{var pointerLockElement=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement||document.msPointerLockElement;var isPointerlocked=!!pointerLockElement;HEAP32[eventStruct>>2]=isPointerlocked;var nodeName=JSEvents.getNodeNameForTarget(pointerLockElement);var id=pointerLockElement&&pointerLockElement.id?pointerLockElement.id:"";stringToUTF8(nodeName,eventStruct+4,128);stringToUTF8(id,eventStruct+132,128)};var registerPointerlockChangeEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.pointerlockChangeEvent)JSEvents.pointerlockChangeEvent=_malloc(260);var pointerlockChangeEventHandlerFunc=(e=event)=>{var pointerlockChangeEvent=JSEvents.pointerlockChangeEvent;fillPointerlockChangeEventData(pointerlockChangeEvent);if(getWasmTableEntry(callbackfunc)(eventTypeId,pointerlockChangeEvent,userData))e.preventDefault()};var eventHandler={target:target,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:pointerlockChangeEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_pointerlockchange_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>{if(!document||!document.body||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock){return-1}target=findEventTarget(target);if(!target)return-4;registerPointerlockChangeEventCallback(target,userData,useCapture,callbackfunc,20,"mozpointerlockchange",targetThread);registerPointerlockChangeEventCallback(target,userData,useCapture,callbackfunc,20,"webkitpointerlockchange",targetThread);registerPointerlockChangeEventCallback(target,userData,useCapture,callbackfunc,20,"mspointerlockchange",targetThread);return registerPointerlockChangeEventCallback(target,userData,useCapture,callbackfunc,20,"pointerlockchange",targetThread)};var registerUiEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.uiEvent)JSEvents.uiEvent=_malloc(36);target=findEventTarget(target);var uiEventHandlerFunc=(e=event)=>{if(e.target!=target){return}var b=document.body;if(!b){return}var uiEvent=JSEvents.uiEvent;HEAP32[uiEvent>>2]=e.detail;HEAP32[uiEvent+4>>2]=b.clientWidth;HEAP32[uiEvent+8>>2]=b.clientHeight;HEAP32[uiEvent+12>>2]=innerWidth;HEAP32[uiEvent+16>>2]=innerHeight;HEAP32[uiEvent+20>>2]=outerWidth;HEAP32[uiEvent+24>>2]=outerHeight;HEAP32[uiEvent+28>>2]=pageXOffset;HEAP32[uiEvent+32>>2]=pageYOffset;if(getWasmTableEntry(callbackfunc)(eventTypeId,uiEvent,userData))e.preventDefault()};var eventHandler={target:target,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:uiEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_resize_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerUiEventCallback(target,userData,useCapture,callbackfunc,10,"resize",targetThread);var registerTouchEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.touchEvent)JSEvents.touchEvent=_malloc(1696);target=findEventTarget(target);var touchEventHandlerFunc=e=>{var t,touches={},et=e.touches;for(var i=0;i>3]=e.timeStamp;var idx=touchEvent>>2;HEAP32[idx+3]=e.ctrlKey;HEAP32[idx+4]=e.shiftKey;HEAP32[idx+5]=e.altKey;HEAP32[idx+6]=e.metaKey;idx+=7;var targetRect=getBoundingClientRect(target);var numTouches=0;for(var i in touches){t=touches[i];HEAP32[idx+0]=t.identifier;HEAP32[idx+1]=t.screenX;HEAP32[idx+2]=t.screenY;HEAP32[idx+3]=t.clientX;HEAP32[idx+4]=t.clientY;HEAP32[idx+5]=t.pageX;HEAP32[idx+6]=t.pageY;HEAP32[idx+7]=t.isChanged;HEAP32[idx+8]=t.onTarget;HEAP32[idx+9]=t.clientX-targetRect.left;HEAP32[idx+10]=t.clientY-targetRect.top;idx+=13;if(++numTouches>31){break}}HEAP32[touchEvent+8>>2]=numTouches;if(getWasmTableEntry(callbackfunc)(eventTypeId,touchEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString=="touchstart"||eventTypeString=="touchend",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:touchEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_touchcancel_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerTouchEventCallback(target,userData,useCapture,callbackfunc,25,"touchcancel",targetThread);var _emscripten_set_touchend_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerTouchEventCallback(target,userData,useCapture,callbackfunc,23,"touchend",targetThread);var _emscripten_set_touchmove_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerTouchEventCallback(target,userData,useCapture,callbackfunc,24,"touchmove",targetThread);var _emscripten_set_touchstart_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerTouchEventCallback(target,userData,useCapture,callbackfunc,22,"touchstart",targetThread);var fillVisibilityChangeEventData=eventStruct=>{var visibilityStates=["hidden","visible","prerender","unloaded"];var visibilityState=visibilityStates.indexOf(document.visibilityState);HEAP32[eventStruct>>2]=document.hidden;HEAP32[eventStruct+4>>2]=visibilityState};var registerVisibilityChangeEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.visibilityChangeEvent)JSEvents.visibilityChangeEvent=_malloc(8);var visibilityChangeEventHandlerFunc=(e=event)=>{var visibilityChangeEvent=JSEvents.visibilityChangeEvent;fillVisibilityChangeEventData(visibilityChangeEvent);if(getWasmTableEntry(callbackfunc)(eventTypeId,visibilityChangeEvent,userData))e.preventDefault()};var eventHandler={target:target,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:visibilityChangeEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_visibilitychange_callback_on_thread=(userData,useCapture,callbackfunc,targetThread)=>{if(!specialHTMLTargets[1]){return-4}return registerVisibilityChangeEventCallback(specialHTMLTargets[1],userData,useCapture,callbackfunc,21,"visibilitychange",targetThread)};var registerWheelEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.wheelEvent)JSEvents.wheelEvent=_malloc(104);var wheelHandlerFunc=(e=event)=>{var wheelEvent=JSEvents.wheelEvent;fillMouseEventData(wheelEvent,e,target);HEAPF64[wheelEvent+72>>3]=e["deltaX"];HEAPF64[wheelEvent+80>>3]=e["deltaY"];HEAPF64[wheelEvent+88>>3]=e["deltaZ"];HEAP32[wheelEvent+96>>2]=e["deltaMode"];if(getWasmTableEntry(callbackfunc)(eventTypeId,wheelEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:wheelHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_wheel_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>{target=findEventTarget(target);if(!target)return-4;if(typeof target.onwheel!="undefined"){return registerWheelEventCallback(target,userData,useCapture,callbackfunc,9,"wheel",targetThread)}else{return-1}};var _emscripten_set_window_title=title=>document.title=UTF8ToString(title);var _emscripten_sleep=()=>{throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"};var ENV={};var getExecutableName=()=>thisProgram||"./this.program";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};var stringToAscii=(str,buffer)=>{for(var i=0;i>0]=str.charCodeAt(i)}HEAP8[buffer>>0]=0};var _environ_get=(__environ,environ_buf)=>{var bufSize=0;getEnvStrings().forEach((string,i)=>{var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1});return 0};var _environ_sizes_get=(penviron_count,penviron_buf_size)=>{var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(string=>bufSize+=string.length+1);HEAPU32[penviron_buf_size>>2]=bufSize;return 0};function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doReadv=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var convertI32PairToI53Checked=(lo,hi)=>hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN;function _fd_seek(fd,offset_low,offset_high,whence,newOffset){var offset=convertI32PairToI53Checked(offset_low,offset_high);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doWritev=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!=="undefined"){offset+=curr}}return ret};function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU32[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var GLEW={isLinaroFork:1,extensions:null,error:{0:null,1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null},version:{1:null,2:null,3:null,4:null},errorStringConstantFromCode(error){if(GLEW.isLinaroFork){switch(error){case 4:return"OpenGL ES lib expected, found OpenGL lib";case 5:return"OpenGL lib expected, found OpenGL ES lib";case 6:return"Missing EGL version";case 7:return"EGL 1.1 and up are supported";default:break}}switch(error){case 0:return"No error";case 1:return"Missing GL version";case 2:return"GL 1.1 and up are supported";case 3:return"GLX 1.2 and up are supported";default:return null}},errorString(error){if(!GLEW.error[error]){var string=GLEW.errorStringConstantFromCode(error);if(!string){string="Unknown error";error=8}GLEW.error[error]=stringToNewUTF8(string)}return GLEW.error[error]},versionStringConstantFromCode(name){switch(name){case 1:return"1.10.0";case 2:return"1";case 3:return"10";case 4:return"0";default:return null}},versionString(name){if(!GLEW.version[name]){var string=GLEW.versionStringConstantFromCode(name);if(!string)return 0;GLEW.version[name]=stringToNewUTF8(string)}return GLEW.version[name]},extensionIsSupported(name){if(!GLEW.extensions){GLEW.extensions=GL.getExtensions()}if(GLEW.extensions.includes(name))return 1;return GLEW.extensions.includes("GL_"+name)}};var _glewGetErrorString=error=>GLEW.errorString(error);var _glewInit=()=>0;var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var arraySum=(array,index)=>{var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum};var MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];var addDays=(date,days)=>{var newDate=new Date(date.getTime());while(days>0){var leap=isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)};var _strftime=(s,maxsize,format,tm)=>{var tm_zone=HEAPU32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%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 rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value=="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}return thisDate.getFullYear()}return thisDate.getFullYear()-1}var EXPANSION_RULES_2={"%a":date=>WEEKDAYS[date.tm_wday].substring(0,3),"%A":date=>WEEKDAYS[date.tm_wday],"%b":date=>MONTHS[date.tm_mon].substring(0,3),"%B":date=>MONTHS[date.tm_mon],"%C":date=>{var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":date=>leadingNulls(date.tm_mday,2),"%e":date=>leadingSomething(date.tm_mday,2," "),"%g":date=>getWeekBasedYear(date).toString().substring(2),"%G":date=>getWeekBasedYear(date),"%H":date=>leadingNulls(date.tm_hour,2),"%I":date=>{var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":date=>leadingNulls(date.tm_mday+arraySum(isLeapYear(date.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date.tm_mon-1),3),"%m":date=>leadingNulls(date.tm_mon+1,2),"%M":date=>leadingNulls(date.tm_min,2),"%n":()=>"\n","%p":date=>{if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}return"PM"},"%S":date=>leadingNulls(date.tm_sec,2),"%t":()=>"\t","%u":date=>date.tm_wday||7,"%U":date=>{var days=date.tm_yday+7-date.tm_wday;return leadingNulls(Math.floor(days/7),2)},"%V":date=>{var val=Math.floor((date.tm_yday+7-(date.tm_wday+6)%7)/7);if((date.tm_wday+371-date.tm_yday-2)%7<=2){val++}if(!val){val=52;var dec31=(date.tm_wday+7-date.tm_yday-1)%7;if(dec31==4||dec31==5&&isLeapYear(date.tm_year%400-1)){val++}}else if(val==53){var jan1=(date.tm_wday+371-date.tm_yday)%7;if(jan1!=4&&(jan1!=3||!isLeapYear(date.tm_year)))val=1}return leadingNulls(val,2)},"%w":date=>date.tm_wday,"%W":date=>{var days=date.tm_yday+7-(date.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2)},"%y":date=>(date.tm_year+1900).toString().substring(2),"%Y":date=>date.tm_year+1900,"%z":date=>{var off=date.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":date=>date.tm_zone,"%%":()=>"%"};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1};var _strftime_l=(s,maxsize,format,tm,loc)=>_strftime(s,maxsize,format,tm);var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_unlink"]=FS.unlink;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["requestFullscreen"]=(lockPointer,resizeCanvas)=>Browser.requestFullscreen(lockPointer,resizeCanvas);Module["requestAnimationFrame"]=func=>Browser.requestAnimationFrame(func);Module["setCanvasSize"]=(width,height,noUpdates)=>Browser.setCanvasSize(width,height,noUpdates);Module["pauseMainLoop"]=()=>Browser.mainLoop.pause();Module["resumeMainLoop"]=()=>Browser.mainLoop.resume();Module["getUserMedia"]=()=>Browser.getUserMedia();Module["createContext"]=(canvas,useWebGL,setInModule,webGLContextAttributes)=>Browser.createContext(canvas,useWebGL,setInModule,webGLContextAttributes);var preloadedImages={};var preloadedAudios={};var GLctx;GLImmediate.setupFuncs();Browser.moduleContextCreatedCallbacks.push(()=>GLImmediate.init());GLEmulation.init();for(var i=0;i<32;++i)tempFixedLengthArray.push(new Array(i));var miniTempWebGLFloatBuffersStorage=new Float32Array(288);for(var i=0;i<288;++i){miniTempWebGLFloatBuffers[i]=miniTempWebGLFloatBuffersStorage.subarray(0,i+1)}var miniTempWebGLIntBuffersStorage=new Int32Array(288);for(var i=0;i<288;++i){miniTempWebGLIntBuffers[i]=miniTempWebGLIntBuffersStorage.subarray(0,i+1)}var wasmImports={d:___assert_fail,b:___cxa_throw,ga:___syscall_fcntl64,Sa:___syscall_getcwd,Va:___syscall_getdents64,_a:___syscall_ioctl,Qa:___syscall_lstat64,Pa:___syscall_newfstatat,ha:___syscall_openat,Ra:___syscall_stat64,ab:__emscripten_get_now_is_monotonic,u:_abort,za:_eglBindAPI,Ka:_eglChooseConfig,Ia:_eglCreateContext,Ga:_eglCreateWindowSurface,Ha:_eglDestroyContext,Fa:_eglDestroySurface,Ja:_eglGetConfigAttrib,aa:_eglGetDisplay,xa:_eglGetError,Ma:_eglInitialize,Ea:_eglMakeCurrent,ya:_eglQueryString,Da:_eglSwapBuffers,Ca:_eglSwapInterval,La:_eglTerminate,Aa:_eglWaitGL,Ba:_eglWaitNative,x:_emscripten_asm_const_int,a:_emscripten_asm_const_int_sync_on_main_thread,ia:_emscripten_date_now,ra:_emscripten_exit_fullscreen,va:_emscripten_exit_pointerlock,i:_emscripten_get_device_pixel_ratio,h:_emscripten_get_element_css_size,ba:_emscripten_get_gamepad_status,D:_emscripten_get_now,Na:_emscripten_get_num_gamepads,wa:_emscripten_get_screen_size,Ld:_emscripten_glActiveTexture,_e:_emscripten_glAlphaFunc,na:_emscripten_glAttachShader,Cf:_emscripten_glBegin,Td:_emscripten_glBeginQueryEXT,Jd:_emscripten_glBindAttribLocation,Id:_emscripten_glBindBuffer,Hd:_emscripten_glBindFramebuffer,Ef:_emscripten_glBindProgram,Gd:_emscripten_glBindRenderbuffer,Fd:_emscripten_glBindTexture,de:_emscripten_glBindVertexArrayOES,Ed:_emscripten_glBlendColor,Dd:_emscripten_glBlendEquation,Cd:_emscripten_glBlendEquationSeparate,Bd:_emscripten_glBlendFunc,Ad:_emscripten_glBlendFuncSeparate,zd:_emscripten_glBufferData,yd:_emscripten_glBufferSubData,xd:_emscripten_glCheckFramebufferStatus,wd:_emscripten_glClear,vd:_emscripten_glClearColor,ud:_emscripten_glClearDepthf,td:_emscripten_glClearStencil,Re:_emscripten_glClientActiveTexture,we:_emscripten_glClipPlane,rf:_emscripten_glColor3d,qf:_emscripten_glColor3f,gf:_emscripten_glColor3fv,pf:_emscripten_glColor3ub,ff:_emscripten_glColor3ubv,of:_emscripten_glColor3ui,ef:_emscripten_glColor3uiv,nf:_emscripten_glColor3us,df:_emscripten_glColor3usv,mf:_emscripten_glColor4d,lf:_emscripten_glColor4f,cf:_emscripten_glColor4fv,kf:_emscripten_glColor4ub,bf:_emscripten_glColor4ubv,jf:_emscripten_glColor4ui,hf:_emscripten_glColor4us,sd:_emscripten_glColorMask,Te:_emscripten_glColorPointer,rd:_emscripten_glCompileShader,qd:_emscripten_glCompressedTexImage2D,pd:_emscripten_glCompressedTexSubImage2D,od:_emscripten_glCopyTexImage2D,nd:_emscripten_glCopyTexSubImage2D,qa:_emscripten_glCreateProgram,oa:_emscripten_glCreateShader,md:_emscripten_glCullFace,ld:_emscripten_glDeleteBuffers,kd:_emscripten_glDeleteFramebuffers,la:_emscripten_glDeleteObject,jd:_emscripten_glDeleteProgram,Wd:_emscripten_glDeleteQueriesEXT,id:_emscripten_glDeleteRenderbuffers,hd:_emscripten_glDeleteShader,gd:_emscripten_glDeleteTextures,ce:_emscripten_glDeleteVertexArraysOES,ed:_emscripten_glDepthFunc,dd:_emscripten_glDepthMask,cd:_emscripten_glDepthRangef,ma:_emscripten_glDetachShader,bd:_emscripten_glDisable,We:_emscripten_glDisableClientState,ad:_emscripten_glDisableVertexAttribArray,$c:_emscripten_glDrawArrays,_d:_emscripten_glDrawArraysInstancedANGLE,ve:_emscripten_glDrawBuffer,$d:_emscripten_glDrawBuffersWEBGL,_c:_emscripten_glDrawElements,Zd:_emscripten_glDrawElementsInstancedANGLE,Ye:_emscripten_glDrawRangeElements,Zc:_emscripten_glEnable,Xe:_emscripten_glEnableClientState,Yc:_emscripten_glEnableVertexAttribArray,Bf:_emscripten_glEnd,Sd:_emscripten_glEndQueryEXT,Xc:_emscripten_glFinish,Wc:_emscripten_glFlush,Vc:_emscripten_glFramebufferRenderbuffer,Uc:_emscripten_glFramebufferTexture2D,Tc:_emscripten_glFrontFace,De:_emscripten_glFrustum,Sc:_emscripten_glGenBuffers,Qc:_emscripten_glGenFramebuffers,Xd:_emscripten_glGenQueriesEXT,Pc:_emscripten_glGenRenderbuffers,Oc:_emscripten_glGenTextures,be:_emscripten_glGenVertexArraysOES,Rc:_emscripten_glGenerateMipmap,Nc:_emscripten_glGetActiveAttrib,Lc:_emscripten_glGetActiveUniform,Kc:_emscripten_glGetAttachedShaders,Jc:_emscripten_glGetAttribLocation,Ic:_emscripten_glGetBooleanv,Hc:_emscripten_glGetBufferParameteriv,Gc:_emscripten_glGetError,Fc:_emscripten_glGetFloatv,Ec:_emscripten_glGetFramebufferAttachmentParameteriv,Ff:_emscripten_glGetInfoLog,Dc:_emscripten_glGetIntegerv,ka:_emscripten_glGetObjectParameteriv,Df:_emscripten_glGetPointerv,Ac:_emscripten_glGetProgramInfoLog,Cc:_emscripten_glGetProgramiv,Nd:_emscripten_glGetQueryObjecti64vEXT,Pd:_emscripten_glGetQueryObjectivEXT,Md:_emscripten_glGetQueryObjectui64vEXT,Od:_emscripten_glGetQueryObjectuivEXT,Qd:_emscripten_glGetQueryivEXT,zc:_emscripten_glGetRenderbufferParameteriv,xc:_emscripten_glGetShaderInfoLog,wc:_emscripten_glGetShaderPrecisionFormat,vc:_emscripten_glGetShaderSource,yc:_emscripten_glGetShaderiv,uc:_emscripten_glGetString,ne:_emscripten_glGetTexEnvfv,me:_emscripten_glGetTexEnviv,fe:_emscripten_glGetTexLevelParameteriv,tc:_emscripten_glGetTexParameterfv,sc:_emscripten_glGetTexParameteriv,pc:_emscripten_glGetUniformLocation,rc:_emscripten_glGetUniformfv,qc:_emscripten_glGetUniformiv,mc:_emscripten_glGetVertexAttribPointerv,oc:_emscripten_glGetVertexAttribfv,nc:_emscripten_glGetVertexAttribiv,lc:_emscripten_glHint,kc:_emscripten_glIsBuffer,jc:_emscripten_glIsEnabled,ic:_emscripten_glIsFramebuffer,hc:_emscripten_glIsProgram,Ud:_emscripten_glIsQueryEXT,fc:_emscripten_glIsRenderbuffer,ec:_emscripten_glIsShader,dc:_emscripten_glIsTexture,ae:_emscripten_glIsVertexArrayOES,se:_emscripten_glLightModelf,re:_emscripten_glLightModelfv,te:_emscripten_glLightfv,cc:_emscripten_glLineWidth,bc:_emscripten_glLinkProgram,Ne:_emscripten_glLoadIdentity,Me:_emscripten_glLoadMatrixd,Le:_emscripten_glLoadMatrixf,Je:_emscripten_glLoadTransposeMatrixd,Ke:_emscripten_glLoadTransposeMatrixf,qe:_emscripten_glMaterialfv,Qe:_emscripten_glMatrixMode,Ge:_emscripten_glMultMatrixd,Fe:_emscripten_glMultMatrixf,He:_emscripten_glMultTransposeMatrixd,Ie:_emscripten_glMultTransposeMatrixf,Ze:_emscripten_glNormal3f,Ue:_emscripten_glNormalPointer,Ee:_emscripten_glOrtho,ac:_emscripten_glPixelStorei,$e:_emscripten_glPolygonMode,$b:_emscripten_glPolygonOffset,Oe:_emscripten_glPopMatrix,Pe:_emscripten_glPushMatrix,Rd:_emscripten_glQueryCounterEXT,ue:_emscripten_glReadBuffer,_b:_emscripten_glReadPixels,Zb:_emscripten_glReleaseShaderCompiler,Yb:_emscripten_glRenderbufferStorage,Ce:_emscripten_glRotated,Be:_emscripten_glRotatef,Xb:_emscripten_glSampleCoverage,Ae:_emscripten_glScaled,ze:_emscripten_glScalef,Wb:_emscripten_glScissor,ee:_emscripten_glShadeModel,Vb:_emscripten_glShaderBinary,Ub:_emscripten_glShaderSource,Tb:_emscripten_glStencilFunc,Sb:_emscripten_glStencilFuncSeparate,Rb:_emscripten_glStencilMask,Qb:_emscripten_glStencilMaskSeparate,Pb:_emscripten_glStencilOp,Ob:_emscripten_glStencilOpSeparate,ke:_emscripten_glTexCoord2f,ge:_emscripten_glTexCoord2fv,je:_emscripten_glTexCoord2i,ie:_emscripten_glTexCoord3f,he:_emscripten_glTexCoord4f,Se:_emscripten_glTexCoordPointer,oe:_emscripten_glTexGenfv,pe:_emscripten_glTexGeni,le:_emscripten_glTexImage1D,Nb:_emscripten_glTexImage2D,Mb:_emscripten_glTexParameterf,Lb:_emscripten_glTexParameterfv,Kb:_emscripten_glTexParameteri,Jb:_emscripten_glTexParameteriv,Ib:_emscripten_glTexSubImage2D,ye:_emscripten_glTranslated,xe:_emscripten_glTranslatef,Hb:_emscripten_glUniform1f,Gb:_emscripten_glUniform1fv,Fb:_emscripten_glUniform1i,Eb:_emscripten_glUniform1iv,Db:_emscripten_glUniform2f,Cb:_emscripten_glUniform2fv,Bb:_emscripten_glUniform2i,Ab:_emscripten_glUniform2iv,zb:_emscripten_glUniform3f,yb:_emscripten_glUniform3fv,xb:_emscripten_glUniform3i,wb:_emscripten_glUniform3iv,vb:_emscripten_glUniform4f,ub:_emscripten_glUniform4fv,sb:_emscripten_glUniform4i,rb:_emscripten_glUniform4iv,qb:_emscripten_glUniformMatrix2fv,pb:_emscripten_glUniformMatrix3fv,ob:_emscripten_glUniformMatrix4fv,pa:_emscripten_glUseProgram,nb:_emscripten_glValidateProgram,Af:_emscripten_glVertex2f,uf:_emscripten_glVertex2fv,zf:_emscripten_glVertex2i,yf:_emscripten_glVertex3f,tf:_emscripten_glVertex3fv,xf:_emscripten_glVertex3i,wf:_emscripten_glVertex4f,sf:_emscripten_glVertex4fv,vf:_emscripten_glVertex4i,mb:_emscripten_glVertexAttrib1f,lb:_emscripten_glVertexAttrib1fv,kb:_emscripten_glVertexAttrib2f,jb:_emscripten_glVertexAttrib2fv,hb:_emscripten_glVertexAttrib3f,gb:_emscripten_glVertexAttrib3fv,fb:_emscripten_glVertexAttrib4f,eb:_emscripten_glVertexAttrib4fv,Yd:_emscripten_glVertexAttribDivisorANGLE,db:_emscripten_glVertexAttribPointer,Ve:_emscripten_glVertexPointer,cb:_emscripten_glViewport,C:_emscripten_has_asyncify,bb:_emscripten_memcpy_js,sa:_emscripten_request_fullscreen_strategy,$:_emscripten_request_pointerlock,Ua:_emscripten_resize_heap,ca:_emscripten_sample_gamepad_data,H:_emscripten_set_beforeunload_callback_on_thread,T:_emscripten_set_blur_callback_on_thread,m:_emscripten_set_canvas_element_size,A:_emscripten_set_element_css_size,U:_emscripten_set_focus_callback_on_thread,K:_emscripten_set_fullscreenchange_callback_on_thread,t:_emscripten_set_gamepadconnected_callback_on_thread,s:_emscripten_set_gamepaddisconnected_callback_on_thread,N:_emscripten_set_keydown_callback_on_thread,L:_emscripten_set_keypress_callback_on_thread,M:_emscripten_set_keyup_callback_on_thread,fd:_emscripten_set_main_loop,Z:_emscripten_set_mousedown_callback_on_thread,X:_emscripten_set_mouseenter_callback_on_thread,W:_emscripten_set_mouseleave_callback_on_thread,_:_emscripten_set_mousemove_callback_on_thread,Y:_emscripten_set_mouseup_callback_on_thread,O:_emscripten_set_pointerlockchange_callback_on_thread,J:_emscripten_set_resize_callback_on_thread,P:_emscripten_set_touchcancel_callback_on_thread,R:_emscripten_set_touchend_callback_on_thread,Q:_emscripten_set_touchmove_callback_on_thread,S:_emscripten_set_touchstart_callback_on_thread,I:_emscripten_set_visibilitychange_callback_on_thread,V:_emscripten_set_wheel_callback_on_thread,ta:_emscripten_set_window_title,B:_emscripten_sleep,Wa:_environ_get,Xa:_environ_sizes_get,v:_fd_close,Za:_fd_read,Oa:_fd_seek,Ya:_fd_write,p:_glBindFramebuffer,f:_glBindTexture,k:_glBlendFunc,Bc:_glClear,Kd:_glClearColor,tb:_glColorPointer,ja:_glDeleteFramebuffers,q:_glDeleteTextures,e:_glDisable,l:_glDisableClientState,ea:_glDrawElements,g:_glEnable,w:_glEnableClientState,Vd:_glFramebufferTexture2D,af:_glGenFramebuffers,G:_glGenTextures,$a:_glGetIntegerv,z:_glLightfv,j:_glLoadIdentity,gc:_glLoadMatrixf,r:_glMatrixMode,Mc:_glMultMatrixf,ib:_glNormalPointer,da:_glPopMatrix,fa:_glPushMatrix,ua:_glScalef,E:_glTexCoordPointer,o:_glTexImage2D,c:_glTexParameterf,n:_glTexSubImage2D,F:_glVertexPointer,y:_glViewport,Gf:_glewGetErrorString,Hf:_glewInit,Ta:_strftime_l};var wasmExports=createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports["Jf"])();var _malloc=a0=>(_malloc=wasmExports["Lf"])(a0);var _free=a0=>(_free=wasmExports["free"])(a0);var ___errno_location=()=>(___errno_location=wasmExports["Mf"])();var _RSDK_Initialize=Module["_RSDK_Initialize"]=()=>(_RSDK_Initialize=Module["_RSDK_Initialize"]=wasmExports["Nf"])();var _RSDK_Configure=Module["_RSDK_Configure"]=(a0,a1)=>(_RSDK_Configure=Module["_RSDK_Configure"]=wasmExports["Of"])(a0,a1);var _main=Module["_main"]=(a0,a1)=>(_main=Module["_main"]=wasmExports["Pf"])(a0,a1);var stackSave=()=>(stackSave=wasmExports["Qf"])();var stackRestore=a0=>(stackRestore=wasmExports["Rf"])(a0);var stackAlloc=a0=>(stackAlloc=wasmExports["Sf"])(a0);var ___cxa_increment_exception_refcount=a0=>(___cxa_increment_exception_refcount=wasmExports["__cxa_increment_exception_refcount"])(a0);var ___cxa_is_pointer_type=a0=>(___cxa_is_pointer_type=wasmExports["Tf"])(a0);var dynCall_iiji=Module["dynCall_iiji"]=(a0,a1,a2,a3,a4)=>(dynCall_iiji=Module["dynCall_iiji"]=wasmExports["Uf"])(a0,a1,a2,a3,a4);var dynCall_jiji=Module["dynCall_jiji"]=(a0,a1,a2,a3,a4)=>(dynCall_jiji=Module["dynCall_jiji"]=wasmExports["Vf"])(a0,a1,a2,a3,a4);var dynCall_ji=Module["dynCall_ji"]=(a0,a1)=>(dynCall_ji=Module["dynCall_ji"]=wasmExports["Wf"])(a0,a1);var dynCall_iiiiij=Module["dynCall_iiiiij"]=(a0,a1,a2,a3,a4,a5,a6)=>(dynCall_iiiiij=Module["dynCall_iiiiij"]=wasmExports["Xf"])(a0,a1,a2,a3,a4,a5,a6);var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=(a0,a1,a2,a3,a4,a5,a6,a7,a8)=>(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=wasmExports["Yf"])(a0,a1,a2,a3,a4,a5,a6,a7,a8);var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)=>(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=wasmExports["Zf"])(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9);Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_unlink"]=FS.unlink;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(){var entryFunction=_main;var argc=0;var argv=0;try{var ret=entryFunction(argc,argv);exitJS(ret,true);return ret}catch(e){return handleException(e)}}function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;run(); +var Module=typeof Module!="undefined"?Module:{};var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror,binary=true)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?undefined:"utf8",(err,data)=>{if(err)onerror(err);else onload(binary?data.buffer:data)})};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);if(typeof module!="undefined"){module["exports"]=Module}process.on("uncaughtException",ex=>{if(ex!=="unwind"&&!(ex instanceof ExitStatus)&&!(ex.context instanceof ExitStatus)){throw ex}});quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow};Module["inspect"]=()=>"[Emscripten Module object]"}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=filename=>filename.startsWith(dataURIPrefix);var isFileURI=filename=>filename.startsWith("file://");var wasmBinaryFile;wasmBinaryFile="RSDKv4.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{if(!response["ok"]){throw"failed to load wasm binary file at '"+binaryFile+"'"}return response["arrayBuffer"]()}).catch(()=>getBinarySync(binaryFile))}else if(readAsync){return new Promise((resolve,reject)=>{readAsync(binaryFile,response=>resolve(new Uint8Array(response)),reject)})}}return Promise.resolve().then(()=>getBinarySync(binaryFile))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(binary=>WebAssembly.instantiate(binary,imports)).then(instance=>instance).then(receiver,reason=>{err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)})})}return instantiateArrayBuffer(binaryFile,imports,callback)}function createWasm(){var info={"a":wasmImports};function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports["If"];updateMemoryViews();wasmTable=wasmExports["Kf"];addOnInit(wasmExports["Jf"]);removeRunDependency("wasm-instantiate");return wasmExports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);return false}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult);return{}}var tempDouble;var tempI64;var ASM_CONSTS={692072:()=>{FS.syncfs(false,function(err){if(err)console.error(err)})},692143:()=>{FS.syncfs(false,function(err){if(err)console.error(err)})},692214:()=>{FS.syncfs(false,function(err){if(err)console.error(err)})},692285:()=>{if(typeof AudioContext!=="undefined"){return true}else if(typeof webkitAudioContext!=="undefined"){return true}return false},692432:()=>{if(typeof navigator.mediaDevices!=="undefined"&&typeof navigator.mediaDevices.getUserMedia!=="undefined"){return true}else if(typeof navigator.webkitGetUserMedia!=="undefined"){return true}return false},692666:$0=>{if(typeof Module["SDL2"]==="undefined"){Module["SDL2"]={}}var SDL2=Module["SDL2"];if(!$0){SDL2.audio={}}else{SDL2.capture={}}if(!SDL2.audioContext){if(typeof AudioContext!=="undefined"){SDL2.audioContext=new AudioContext}else if(typeof webkitAudioContext!=="undefined"){SDL2.audioContext=new webkitAudioContext}if(SDL2.audioContext){autoResumeAudioContext(SDL2.audioContext)}}return SDL2.audioContext===undefined?-1:0},693159:()=>{var SDL2=Module["SDL2"];return SDL2.audioContext.sampleRate},693227:($0,$1,$2,$3)=>{var SDL2=Module["SDL2"];var have_microphone=function(stream){if(SDL2.capture.silenceTimer!==undefined){clearTimeout(SDL2.capture.silenceTimer);SDL2.capture.silenceTimer=undefined}SDL2.capture.mediaStreamNode=SDL2.audioContext.createMediaStreamSource(stream);SDL2.capture.scriptProcessorNode=SDL2.audioContext.createScriptProcessor($1,$0,1);SDL2.capture.scriptProcessorNode.onaudioprocess=function(audioProcessingEvent){if(SDL2===undefined||SDL2.capture===undefined){return}audioProcessingEvent.outputBuffer.getChannelData(0).fill(0);SDL2.capture.currentCaptureBuffer=audioProcessingEvent.inputBuffer;dynCall("vi",$2,[$3])};SDL2.capture.mediaStreamNode.connect(SDL2.capture.scriptProcessorNode);SDL2.capture.scriptProcessorNode.connect(SDL2.audioContext.destination);SDL2.capture.stream=stream};var no_microphone=function(error){};SDL2.capture.silenceBuffer=SDL2.audioContext.createBuffer($0,$1,SDL2.audioContext.sampleRate);SDL2.capture.silenceBuffer.getChannelData(0).fill(0);var silence_callback=function(){SDL2.capture.currentCaptureBuffer=SDL2.capture.silenceBuffer;dynCall("vi",$2,[$3])};SDL2.capture.silenceTimer=setTimeout(silence_callback,$1/SDL2.audioContext.sampleRate*1e3);if(navigator.mediaDevices!==undefined&&navigator.mediaDevices.getUserMedia!==undefined){navigator.mediaDevices.getUserMedia({audio:true,video:false}).then(have_microphone).catch(no_microphone)}else if(navigator.webkitGetUserMedia!==undefined){navigator.webkitGetUserMedia({audio:true,video:false},have_microphone,no_microphone)}},694879:($0,$1,$2,$3)=>{var SDL2=Module["SDL2"];SDL2.audio.scriptProcessorNode=SDL2.audioContext["createScriptProcessor"]($1,0,$0);SDL2.audio.scriptProcessorNode["onaudioprocess"]=function(e){if(SDL2===undefined||SDL2.audio===undefined){return}SDL2.audio.currentOutputBuffer=e["outputBuffer"];dynCall("vi",$2,[$3])};SDL2.audio.scriptProcessorNode["connect"](SDL2.audioContext["destination"])},695289:($0,$1)=>{var SDL2=Module["SDL2"];var numChannels=SDL2.capture.currentCaptureBuffer.numberOfChannels;for(var c=0;c{var SDL2=Module["SDL2"];var numChannels=SDL2.audio.currentOutputBuffer["numberOfChannels"];for(var c=0;c>2]}}},696374:$0=>{var SDL2=Module["SDL2"];if($0){if(SDL2.capture.silenceTimer!==undefined){clearTimeout(SDL2.capture.silenceTimer)}if(SDL2.capture.stream!==undefined){var tracks=SDL2.capture.stream.getAudioTracks();for(var i=0;i{var w=$0;var h=$1;var pixels=$2;if(!Module["SDL2"])Module["SDL2"]={};var SDL2=Module["SDL2"];if(SDL2.ctxCanvas!==Module["canvas"]){SDL2.ctx=Module["createContext"](Module["canvas"],false,true);SDL2.ctxCanvas=Module["canvas"]}if(SDL2.w!==w||SDL2.h!==h||SDL2.imageCtx!==SDL2.ctx){SDL2.image=SDL2.ctx.createImageData(w,h);SDL2.w=w;SDL2.h=h;SDL2.imageCtx=SDL2.ctx}var data=SDL2.image.data;var src=pixels>>2;var dst=0;var num;if(typeof CanvasPixelArray!=="undefined"&&data instanceof CanvasPixelArray){num=data.length;while(dst>8&255;data[dst+2]=val>>16&255;data[dst+3]=255;src++;dst+=4}}else{if(SDL2.data32Data!==data){SDL2.data32=new Int32Array(data.buffer);SDL2.data8=new Uint8Array(data.buffer);SDL2.data32Data=data}var data32=SDL2.data32;num=data32.length;data32.set(HEAP32.subarray(src,src+num));var data8=SDL2.data8;var i=3;var j=i+4*num;if(num%8==0){while(i{var w=$0;var h=$1;var hot_x=$2;var hot_y=$3;var pixels=$4;var canvas=document.createElement("canvas");canvas.width=w;canvas.height=h;var ctx=canvas.getContext("2d");var image=ctx.createImageData(w,h);var data=image.data;var src=pixels>>2;var dst=0;var num;if(typeof CanvasPixelArray!=="undefined"&&data instanceof CanvasPixelArray){num=data.length;while(dst>8&255;data[dst+2]=val>>16&255;data[dst+3]=val>>24&255;src++;dst+=4}}else{var data32=new Int32Array(data.buffer);num=data32.length;data32.set(HEAP32.subarray(src,src+num))}ctx.putImageData(image,0,0);var url=hot_x===0&&hot_y===0?"url("+canvas.toDataURL()+"), auto":"url("+canvas.toDataURL()+") "+hot_x+" "+hot_y+", auto";var urlBuf=_malloc(url.length+1);stringToUTF8(url,urlBuf,url.length+1);return urlBuf},700004:$0=>{if(Module["canvas"]){Module["canvas"].style["cursor"]=UTF8ToString($0)}},700087:()=>{if(Module["canvas"]){Module["canvas"].style["cursor"]="none"}},700156:()=>window.innerWidth,700186:()=>window.innerHeight};function ExitStatus(status){this.name="ExitStatus";this.message=`Program terminated with exit(${status})`;this.status=status}var listenOnce=(object,event,func)=>{object.addEventListener(event,func,{"once":true})};var autoResumeAudioContext=(ctx,elements)=>{if(!elements){elements=[document,document.getElementById("canvas")]}["keydown","mousedown","touchstart"].forEach(event=>{elements.forEach(element=>{if(element){listenOnce(element,event,()=>{if(ctx.state==="suspended")ctx.resume()})}})})};var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var dynCallLegacy=(sig,ptr,args)=>{var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)};var wasmTableMirror=[];var wasmTable;var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var dynCall=(sig,ptr,args)=>{if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr).apply(null,args);return rtn};var noExitRuntime=Module["noExitRuntime"]||true;function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;case"*":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;var UTF8ArrayToString=(heapOrArray,idx,maxBytesToRead)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var ___assert_fail=(condition,filename,line,func)=>{abort(`Assertion failed: ${UTF8ToString(condition)}, at: `+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])};function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}var exceptionLast=0;var uncaughtExceptionCount=0;var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var setErrNo=value=>{HEAP32[___errno_location()>>2]=value;return value};var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:path=>{if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},join:function(){var paths=Array.prototype.slice.call(arguments);return PATH.normalize(paths.join("/"))},join2:(l,r)=>PATH.normalize(l+"/"+r)};var initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto["getRandomValues"]=="function"){return view=>crypto.getRandomValues(view)}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return view=>crypto_module["randomFillSync"](view)}var randomBytes=crypto_module["randomBytes"];return view=>(view.set(randomBytes(view.byteLength)),view)}catch(e){}}abort("initRandomDevice")};var randomFill=view=>(randomFill=initRandomFill())(view);var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf)}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}FS_stdin_getChar_buffer=intArrayFromString(result,true)}return FS_stdin_getChar_buffer.shift()};var TTY={ttys:[],init(){},shutdown(){},register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close(stream){stream.tty.ops.fsync(stream.tty)},fsync(stream){stream.tty.ops.fsync(stream.tty)},read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}},ioctl_tcgets(tty){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(tty,optional_actions,data){return 0},ioctl_tiocgwinsz(tty){return[24,80]}},default_tty1_ops:{put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};var mmapAlloc=size=>{abort()};var MEMFS={ops_table:null,mount(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp}return node},getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup(parent,name){throw FS.genericErrors[44]},mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length{var dep=!noRunDep?getUniqueRunDependency(`al ${url}`):"";readAsync(url,arrayBuffer=>{assert(arrayBuffer,`Loading data file "${url}" failed (no arrayBuffer).`);onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},event=>{if(onerror){onerror()}else{throw`Loading data file "${url}" failed.`}});if(dep)addRunDependency(dep)};var FS_createDataFile=(parent,name,fileData,canRead,canWrite,canOwn)=>{FS.createDataFile(parent,name,fileData,canRead,canWrite,canOwn)};var preloadPlugins=Module["preloadPlugins"]||[];var FS_handledByPreloadPlugin=(byteArray,fullname,finish,onerror)=>{if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(plugin=>{if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true}});return handled};var FS_createPreloadedFile=(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency(`cp ${fullname}`);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,()=>{if(onerror)onerror();removeRunDependency(dep)})){return}finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,byteArray=>processData(byteArray),onerror)}else{processData(url)}};var FS_modeStringToFlags=str=>{var flagModes={"r":0,"r+":2,"w":512|64|1,"w+":512|64|2,"a":1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error(`Unknown file open mode: ${str}`)}return flags};var FS_getMode=(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode};var IDBFS={dbs:{},indexedDB:()=>{if(typeof indexedDB!="undefined")return indexedDB;var ret=null;if(typeof window=="object")ret=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;assert(ret,"IDBFS used, but indexedDB not supported");return ret},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function(mount){return MEMFS.mount.apply(null,arguments)},syncfs:(mount,populate,callback)=>{IDBFS.getLocalSet(mount,(err,local)=>{if(err)return callback(err);IDBFS.getRemoteSet(mount,(err,remote)=>{if(err)return callback(err);var src=populate?remote:local;var dst=populate?local:remote;IDBFS.reconcile(src,dst,callback)})})},quit:()=>{Object.values(IDBFS.dbs).forEach(value=>value.close());IDBFS.dbs={}},getDB:(name,callback)=>{var db=IDBFS.dbs[name];if(db){return callback(null,db)}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION)}catch(e){return callback(e)}if(!req){return callback("Unable to connect to IndexedDB")}req.onupgradeneeded=e=>{var db=e.target.result;var transaction=e.target.transaction;var fileStore;if(db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)){fileStore=transaction.objectStore(IDBFS.DB_STORE_NAME)}else{fileStore=db.createObjectStore(IDBFS.DB_STORE_NAME)}if(!fileStore.indexNames.contains("timestamp")){fileStore.createIndex("timestamp","timestamp",{unique:false})}};req.onsuccess=()=>{db=req.result;IDBFS.dbs[name]=db;callback(null,db)};req.onerror=e=>{callback(e.target.error);e.preventDefault()}},getLocalSet:(mount,callback)=>{var entries={};function isRealDir(p){return p!=="."&&p!==".."}function toAbsolute(root){return p=>PATH.join2(root,p)}var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat;try{stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){check.push.apply(check,FS.readdir(path).filter(isRealDir).map(toAbsolute(path)))}entries[path]={"timestamp":stat.mtime}}return callback(null,{type:"local",entries:entries})},getRemoteSet:(mount,callback)=>{var entries={};IDBFS.getDB(mount.mountpoint,(err,db)=>{if(err)return callback(err);try{var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readonly");transaction.onerror=e=>{callback(e.target.error);e.preventDefault()};var store=transaction.objectStore(IDBFS.DB_STORE_NAME);var index=store.index("timestamp");index.openKeyCursor().onsuccess=event=>{var cursor=event.target.result;if(!cursor){return callback(null,{type:"remote",db:db,entries:entries})}entries[cursor.primaryKey]={"timestamp":cursor.key};cursor.continue()}}catch(e){return callback(e)}})},loadLocalEntry:(path,callback)=>{var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){return callback(null,{"timestamp":stat.mtime,"mode":stat.mode})}else if(FS.isFile(stat.mode)){node.contents=MEMFS.getFileDataAsTypedArray(node);return callback(null,{"timestamp":stat.mtime,"mode":stat.mode,"contents":node.contents})}else{return callback(new Error("node type not supported"))}},storeLocalEntry:(path,entry,callback)=>{try{if(FS.isDir(entry["mode"])){FS.mkdirTree(path,entry["mode"])}else if(FS.isFile(entry["mode"])){FS.writeFile(path,entry["contents"],{canOwn:true})}else{return callback(new Error("node type not supported"))}FS.chmod(path,entry["mode"]);FS.utime(path,entry["timestamp"],entry["timestamp"])}catch(e){return callback(e)}callback(null)},removeLocalEntry:(path,callback)=>{try{var stat=FS.stat(path);if(FS.isDir(stat.mode)){FS.rmdir(path)}else if(FS.isFile(stat.mode)){FS.unlink(path)}}catch(e){return callback(e)}callback(null)},loadRemoteEntry:(store,path,callback)=>{var req=store.get(path);req.onsuccess=event=>{callback(null,event.target.result)};req.onerror=e=>{callback(e.target.error);e.preventDefault()}},storeRemoteEntry:(store,path,entry,callback)=>{try{var req=store.put(entry,path)}catch(e){callback(e);return}req.onsuccess=()=>{callback(null)};req.onerror=e=>{callback(e.target.error);e.preventDefault()}},removeRemoteEntry:(store,path,callback)=>{var req=store.delete(path);req.onsuccess=()=>{callback(null)};req.onerror=e=>{callback(e.target.error);e.preventDefault()}},reconcile:(src,dst,callback)=>{var total=0;var create=[];Object.keys(src.entries).forEach(function(key){var e=src.entries[key];var e2=dst.entries[key];if(!e2||e["timestamp"].getTime()!=e2["timestamp"].getTime()){create.push(key);total++}});var remove=[];Object.keys(dst.entries).forEach(function(key){if(!src.entries[key]){remove.push(key);total++}});if(!total){return callback(null)}var errored=false;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err&&!errored){errored=true;return callback(err)}}transaction.onerror=e=>{done(this.error);e.preventDefault()};transaction.oncomplete=e=>{if(!errored){callback(null)}};create.sort().forEach(path=>{if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(err,entry)=>{if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)})}else{IDBFS.loadLocalEntry(path,(err,entry)=>{if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)})}});remove.sort().reverse().forEach(path=>{if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}})}};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(path,opts={}){path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32)}var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?`${mount}/${path}`:mount+path}path=path?`${node.name}/${path}`:node.name;node=node.parent}},hashName(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode(node){FS.hashRemoveNode(node)},isRoot(node){return node===node.parent},isMountpoint(node){return!!node.mounted},isFile(mode){return(mode&61440)===32768},isDir(mode){return(mode&61440)===16384},isLink(mode){return(mode&61440)===40960},isChrdev(mode){return(mode&61440)===8192},isBlkdev(mode){return(mode&61440)===24576},isFIFO(mode){return(mode&61440)===4096},isSocket(mode){return(mode&49152)===49152},flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}return stream},getStream:fd=>FS.streams[fd],createStream(stream,fd=-1){if(!FS.FSStream){FS.FSStream=function(){this.shared={}};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get(){return this.node},set(val){this.node=val}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(val){this.shared.flags=val}},position:{get(){return this.shared.position},set(val){this.shared.position=val}}})}stream=Object.assign(new FS.FSStream,stream);if(fd==-1){fd=FS.nextfd()}stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream(fd){FS.streams[fd]=null},chrdev_stream_ops:{open(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek(){throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`)}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(mount=>{if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(hash=>{var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup(parent,name){return parent.node_ops.lookup(parent,name)},mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var i=0;i0,ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59)}return stream.stream_ops.ioctl(stream,cmd,arg)},readFile(path,opts={}){opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error(`Invalid encoding type "${opts.encoding}"`)}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret},writeFile(path,data,opts={}){opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,undefined,opts.canOwn)}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{throw new Error("Unsupported data type")}FS.close(stream)},cwd:()=>FS.currentPath,chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=()=>{if(randomLeft===0){randomLeft=randomFill(randomBuffer).byteLength}return randomBuffer[--randomLeft]};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount(){var node=FS.createNode(proc_self,"fd",16384|511,73);node.node_ops={lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path}};ret.parent=ret;return ret}};return node}},{},"/proc/self/fd")},createStandardStreams(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},ensureErrnoError(){if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.name="ErrnoError";this.node=node;this.setErrno=function(errno){this.errno=errno};this.setErrno(errno);this.message="FS error"};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[44].forEach(code=>{FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack=""})},staticInit(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS}},init(input,output,error){FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()},quit(){FS.init.initialized=false;for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(key=>{var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true}};node.stream_ops=stream_ops;return node}};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return PATH.join2(dir,path)},doStat(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-54}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=stat.mode;HEAPU32[buf+8>>2]=stat.nlink;HEAP32[buf+12>>2]=stat.uid;HEAP32[buf+16>>2]=stat.gid;HEAP32[buf+20>>2]=stat.rdev;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+24>>2]=tempI64[0],HEAP32[buf+28>>2]=tempI64[1];HEAP32[buf+32>>2]=4096;HEAP32[buf+36>>2]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();tempI64=[Math.floor(atime/1e3)>>>0,(tempDouble=Math.floor(atime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAPU32[buf+48>>2]=atime%1e3*1e3;tempI64=[Math.floor(mtime/1e3)>>>0,(tempDouble=Math.floor(mtime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+56>>2]=tempI64[0],HEAP32[buf+60>>2]=tempI64[1];HEAPU32[buf+64>>2]=mtime%1e3*1e3;tempI64=[Math.floor(ctime/1e3)>>>0,(tempDouble=Math.floor(ctime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+72>>2]=tempI64[0],HEAP32[buf+76>>2]=tempI64[1];HEAPU32[buf+80>>2]=ctime%1e3*1e3;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+88>>2]=tempI64[0],HEAP32[buf+92>>2]=tempI64[1];return 0},doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},varargs:undefined,get(){var ret=HEAP32[+SYSCALLS.varargs>>2];SYSCALLS.varargs+=4;return ret},getp(){return SYSCALLS.get()},getStr(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream}};function ___syscall_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}while(FS.streams[arg]){arg++}var newStream;newStream=FS.createStream(stream,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 5:{var arg=SYSCALLS.getp();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);function ___syscall_getcwd(buf,size){try{if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd)+1;if(size>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:{if(!stream.tty)return-59;return 0}case 21505:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcgets){var termios=stream.tty.ops.ioctl_tcgets(stream);var argp=SYSCALLS.getp();HEAP32[argp>>2]=termios.c_iflag||0;HEAP32[argp+4>>2]=termios.c_oflag||0;HEAP32[argp+8>>2]=termios.c_cflag||0;HEAP32[argp+12>>2]=termios.c_lflag||0;for(var i=0;i<32;i++){HEAP8[argp+i+17>>0]=termios.c_cc[i]||0}return 0}return 0}case 21510:case 21511:case 21512:{if(!stream.tty)return-59;return 0}case 21506:case 21507:case 21508:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcsets){var argp=SYSCALLS.getp();var c_iflag=HEAP32[argp>>2];var c_oflag=HEAP32[argp+4>>2];var c_cflag=HEAP32[argp+8>>2];var c_lflag=HEAP32[argp+12>>2];var c_cc=[];for(var i=0;i<32;i++){c_cc.push(HEAP8[argp+i+17>>0])}return stream.tty.ops.ioctl_tcsets(stream.tty,op,{c_iflag:c_iflag,c_oflag:c_oflag,c_cflag:c_cflag,c_lflag:c_lflag,c_cc:c_cc})}return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.getp();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.getp();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tiocgwinsz){var winsize=stream.tty.ops.ioctl_tiocgwinsz(stream.tty);var argp=SYSCALLS.getp();HEAP16[argp>>1]=winsize[0];HEAP16[argp+2>>1]=winsize[1]}return 0}case 21524:{if(!stream.tty)return-59;return 0}case 21515:{if(!stream.tty)return-59;return 0}default:return-28}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_lstat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_newfstatat(dirfd,path,buf,flags){try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_openat(dirfd,path,flags,varargs){SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?SYSCALLS.get():0;return FS.open(path,flags,mode).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}var nowIsMonotonic=true;var __emscripten_get_now_is_monotonic=()=>nowIsMonotonic;var _abort=()=>{abort("")};var _emscripten_set_main_loop_timing=(mode,value)=>{Browser.mainLoop.timingMode=mode;Browser.mainLoop.timingValue=value;if(!Browser.mainLoop.func){return 1}if(!Browser.mainLoop.running){Browser.mainLoop.running=true}if(mode==0){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setTimeout(){var timeUntilNextTick=Math.max(0,Browser.mainLoop.tickStartTime+value-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,timeUntilNextTick)};Browser.mainLoop.method="timeout"}else if(mode==1){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_rAF(){Browser.requestAnimationFrame(Browser.mainLoop.runner)};Browser.mainLoop.method="rAF"}else if(mode==2){if(typeof Browser.setImmediate=="undefined"){if(typeof setImmediate=="undefined"){var setImmediates=[];var emscriptenMainLoopMessageId="setimmediate";var Browser_setImmediate_messageHandler=event=>{if(event.data===emscriptenMainLoopMessageId||event.data.target===emscriptenMainLoopMessageId){event.stopPropagation();setImmediates.shift()()}};addEventListener("message",Browser_setImmediate_messageHandler,true);Browser.setImmediate=function Browser_emulated_setImmediate(func){setImmediates.push(func);if(ENVIRONMENT_IS_WORKER){if(Module["setImmediates"]===undefined)Module["setImmediates"]=[];Module["setImmediates"].push(func);postMessage({target:emscriptenMainLoopMessageId})}else postMessage(emscriptenMainLoopMessageId,"*")}}else{Browser.setImmediate=setImmediate}}Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setImmediate(){Browser.setImmediate(Browser.mainLoop.runner)};Browser.mainLoop.method="immediate"}return 0};var _emscripten_get_now;_emscripten_get_now=()=>performance.now();var setMainLoop=(browserIterationFunc,fps,simulateInfiniteLoop,arg,noSetTiming)=>{assert(!Browser.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.");Browser.mainLoop.func=browserIterationFunc;Browser.mainLoop.arg=arg;var thisMainLoopId=Browser.mainLoop.currentlyRunningMainloop;function checkIsRunning(){if(thisMainLoopId0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}Browser.mainLoop.updateStatus();if(!checkIsRunning())return;setTimeout(Browser.mainLoop.runner,0);return}if(!checkIsRunning())return;Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0;if(Browser.mainLoop.timingMode==1&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else if(Browser.mainLoop.timingMode==0){Browser.mainLoop.tickStartTime=_emscripten_get_now()}GL.newRenderingFrameStarted();Browser.mainLoop.runIter(browserIterationFunc);if(!checkIsRunning())return;if(typeof SDL=="object"&&SDL.audio&&SDL.audio.queueNewAudioData)SDL.audio.queueNewAudioData();Browser.mainLoop.scheduler()};if(!noSetTiming){if(fps&&fps>0){_emscripten_set_main_loop_timing(0,1e3/fps)}else{_emscripten_set_main_loop_timing(1,1)}Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"unwind"}};var handleException=e=>{if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0;var _proc_exit=code=>{EXITSTATUS=code;if(!keepRuntimeAlive()){if(Module["onExit"])Module["onExit"](code);ABORT=true}quit_(code,new ExitStatus(code))};var exitJS=(status,implicit)=>{EXITSTATUS=status;_proc_exit(status)};var _exit=exitJS;var maybeExit=()=>{if(!keepRuntimeAlive()){try{_exit(EXITSTATUS)}catch(e){handleException(e)}}};var callUserCallback=func=>{if(ABORT){return}try{func();maybeExit()}catch(e){handleException(e)}};var safeSetTimeout=(func,timeout)=>setTimeout(()=>{callUserCallback(func)},timeout);var warnOnce=text=>{if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text)}};var Browser={mainLoop:{running:false,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++},resume(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;setMainLoop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()},updateStatus(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining{assert(img.complete,`Image ${name} could not be decoded`);var canvas=document.createElement("canvas");canvas.width=img.width;canvas.height=img.height;var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);preloadedImages[name]=canvas;URL.revokeObjectURL(url);if(onload)onload(byteArray)};img.onerror=event=>{err(`Image ${url} could not be decoded`);if(onerror)onerror()};img.src=url};preloadPlugins.push(imagePlugin);var audioPlugin={};audioPlugin["canHandle"]=function audioPlugin_canHandle(name){return!Module.noAudioDecoding&&name.substr(-4)in{".ogg":1,".wav":1,".mp3":1}};audioPlugin["handle"]=function audioPlugin_handle(byteArray,name,onload,onerror){var done=false;function finish(audio){if(done)return;done=true;preloadedAudios[name]=audio;if(onload)onload(byteArray)}var b=new Blob([byteArray],{type:Browser.getMimetype(name)});var url=URL.createObjectURL(b);var audio=new Audio;audio.addEventListener("canplaythrough",()=>finish(audio),false);audio.onerror=function audio_onerror(event){if(done)return;err(`warning: browser could not fully decode audio ${name}, trying slower base64 approach`);function encode64(data){var BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var PAD="=";var ret="";var leftchar=0;var leftbits=0;for(var i=0;i=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src="data:audio/x-"+name.substr(-3)+";base64,"+encode64(byteArray);finish(audio)};audio.src=url;safeSetTimeout(()=>{finish(audio)},1e4)};preloadPlugins.push(audioPlugin);function pointerLockChange(){Browser.pointerLock=document["pointerLockElement"]===Module["canvas"]||document["mozPointerLockElement"]===Module["canvas"]||document["webkitPointerLockElement"]===Module["canvas"]||document["msPointerLockElement"]===Module["canvas"]}var canvas=Module["canvas"];if(canvas){canvas.requestPointerLock=canvas["requestPointerLock"]||canvas["mozRequestPointerLock"]||canvas["webkitRequestPointerLock"]||canvas["msRequestPointerLock"]||(()=>{});canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||(()=>{});canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener("pointerlockchange",pointerLockChange,false);document.addEventListener("mozpointerlockchange",pointerLockChange,false);document.addEventListener("webkitpointerlockchange",pointerLockChange,false);document.addEventListener("mspointerlockchange",pointerLockChange,false);if(Module["elementPointerLock"]){canvas.addEventListener("click",ev=>{if(!Browser.pointerLock&&Module["canvas"].requestPointerLock){Module["canvas"].requestPointerLock();ev.preventDefault()}},false)}}},createContext(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false,majorVersion:1};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}if(typeof GL!="undefined"){contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}}}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx=="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach(callback=>callback());Browser.init()}return ctx},destroyContext(canvas,useWebGL,setInModule){},fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen(lockPointer,resizeCanvas){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;if(typeof Browser.lockPointer=="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas=="undefined")Browser.resizeCanvas=false;var canvas=Module["canvas"];function fullscreenChange(){Browser.isFullscreen=false;var canvasContainer=canvas.parentNode;if((document["fullscreenElement"]||document["mozFullScreenElement"]||document["msFullscreenElement"]||document["webkitFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvasContainer){canvas.exitFullscreen=Browser.exitFullscreen;if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullscreen=true;if(Browser.resizeCanvas){Browser.setFullscreenCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas){Browser.setWindowedCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}if(Module["onFullScreen"])Module["onFullScreen"](Browser.isFullscreen);if(Module["onFullscreen"])Module["onFullscreen"](Browser.isFullscreen)}if(!Browser.fullscreenHandlersInstalled){Browser.fullscreenHandlersInstalled=true;document.addEventListener("fullscreenchange",fullscreenChange,false);document.addEventListener("mozfullscreenchange",fullscreenChange,false);document.addEventListener("webkitfullscreenchange",fullscreenChange,false);document.addEventListener("MSFullscreenChange",fullscreenChange,false)}var canvasContainer=document.createElement("div");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullscreen=canvasContainer["requestFullscreen"]||canvasContainer["mozRequestFullScreen"]||canvasContainer["msRequestFullscreen"]||(canvasContainer["webkitRequestFullscreen"]?()=>canvasContainer["webkitRequestFullscreen"](Element["ALLOW_KEYBOARD_INPUT"]):null)||(canvasContainer["webkitRequestFullScreen"]?()=>canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"]):null);canvasContainer.requestFullscreen()},exitFullscreen(){if(!Browser.isFullscreen){return false}var CFS=document["exitFullscreen"]||document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["msExitFullscreen"]||document["webkitCancelFullScreen"]||(()=>{});CFS.apply(document,[]);return true},nextRAF:0,fakeRequestAnimationFrame(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)},requestAnimationFrame(func){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(func);return}var RAF=Browser.fakeRequestAnimationFrame;RAF(func)},safeSetTimeout(func,timeout){return safeSetTimeout(func,timeout)},safeRequestAnimationFrame(func){return Browser.requestAnimationFrame(()=>{callUserCallback(func)})},getMimetype(name){return{"jpg":"image/jpeg","jpeg":"image/jpeg","png":"image/png","bmp":"image/bmp","ogg":"audio/ogg","wav":"audio/wav","mp3":"audio/mpeg"}[name.substr(name.lastIndexOf(".")+1)]},getUserMedia(func){if(!window.getUserMedia){window.getUserMedia=navigator["getUserMedia"]||navigator["mozGetUserMedia"]}window.getUserMedia(func)},getMovementX(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0},getMovementY(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0},getMouseWheelDelta(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail/3;break;case"mousewheel":delta=event.wheelDelta/120;break;case"wheel":delta=event.deltaY;switch(event.deltaMode){case 0:delta/=100;break;case 1:delta/=3;break;case 2:delta*=80;break;default:throw"unrecognized mouse wheel delta mode: "+event.deltaMode}break;default:throw"unrecognized mouse wheel event: "+event.type}return delta},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent(event){if(Browser.pointerLock){if(event.type!="mousemove"&&"mozMovementX"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!="undefined"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{var rect=Module["canvas"].getBoundingClientRect();var cw=Module["canvas"].width;var ch=Module["canvas"].height;var scrollX=typeof window.scrollX!="undefined"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!="undefined"?window.scrollY:window.pageYOffset;if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};if(event.type==="touchstart"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type==="touchend"||event.type==="touchmove"){var last=Browser.touches[touch.identifier];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}},resizeListeners:[],updateResizeListeners(){var canvas=Module["canvas"];Browser.resizeListeners.forEach(listener=>listener(canvas.width,canvas.height))},setCanvasSize(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags|8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags&~8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},updateCanvasDimensions(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module["forcedAspectRatio"]&&Module["forcedAspectRatio"]>0){if(w/h>2];if(param==12321){var alphaSize=HEAP32[attribList+4>>2];EGL.contextAttributes.alpha=alphaSize>0}else if(param==12325){var depthSize=HEAP32[attribList+4>>2];EGL.contextAttributes.depth=depthSize>0}else if(param==12326){var stencilSize=HEAP32[attribList+4>>2];EGL.contextAttributes.stencil=stencilSize>0}else if(param==12337){var samples=HEAP32[attribList+4>>2];EGL.contextAttributes.antialias=samples>0}else if(param==12338){var samples=HEAP32[attribList+4>>2];EGL.contextAttributes.antialias=samples==1}else if(param==12544){var requestedPriority=HEAP32[attribList+4>>2];EGL.contextAttributes.lowLatency=requestedPriority!=12547}else if(param==12344){break}attribList+=8}}if((!config||!config_size)&&!numConfigs){EGL.setErrorCode(12300);return 0}if(numConfigs){HEAP32[numConfigs>>2]=1}if(config&&config_size>0){HEAPU32[config>>2]=62002}EGL.setErrorCode(12288);return 1}};var _eglBindAPI=api=>{if(api==12448){EGL.setErrorCode(12288);return 1}EGL.setErrorCode(12300);return 0};var _eglChooseConfig=(display,attrib_list,configs,config_size,numConfigs)=>EGL.chooseConfig(display,attrib_list,configs,config_size,numConfigs);var webgl_enable_ANGLE_instanced_arrays=ctx=>{var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=(index,divisor)=>ext["vertexAttribDivisorANGLE"](index,divisor);ctx["drawArraysInstanced"]=(mode,first,count,primcount)=>ext["drawArraysInstancedANGLE"](mode,first,count,primcount);ctx["drawElementsInstanced"]=(mode,count,type,indices,primcount)=>ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount);return 1}};var webgl_enable_OES_vertex_array_object=ctx=>{var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=()=>ext["createVertexArrayOES"]();ctx["deleteVertexArray"]=vao=>ext["deleteVertexArrayOES"](vao);ctx["bindVertexArray"]=vao=>ext["bindVertexArrayOES"](vao);ctx["isVertexArray"]=vao=>ext["isVertexArrayOES"](vao);return 1}};var webgl_enable_WEBGL_draw_buffers=ctx=>{var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=(n,bufs)=>ext["drawBuffersWEBGL"](n,bufs);return 1}};var webgl_enable_WEBGL_multi_draw=ctx=>!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"));var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:table=>{var ret=GL.counter++;for(var i=table.length;i32-Math.clz32(i===0?0:i-1),generateTempBuffers:(quads,context)=>{var largestIndex=GL.log2ceilLookup(GL.MAX_TEMP_BUFFER_SIZE);context.tempVertexBufferCounters1=[];context.tempVertexBufferCounters2=[];context.tempVertexBufferCounters1.length=context.tempVertexBufferCounters2.length=largestIndex+1;context.tempVertexBuffers1=[];context.tempVertexBuffers2=[];context.tempVertexBuffers1.length=context.tempVertexBuffers2.length=largestIndex+1;context.tempIndexBuffers=[];context.tempIndexBuffers.length=largestIndex+1;for(var i=0;i<=largestIndex;++i){context.tempIndexBuffers[i]=null;context.tempVertexBufferCounters1[i]=context.tempVertexBufferCounters2[i]=0;var ringbufferLength=GL.numTempVertexBuffersPerSize;context.tempVertexBuffers1[i]=[];context.tempVertexBuffers2[i]=[];var ringbuffer1=context.tempVertexBuffers1[i];var ringbuffer2=context.tempVertexBuffers2[i];ringbuffer1.length=ringbuffer2.length=ringbufferLength;for(var j=0;j>1;var quadIndexes=new Uint16Array(numIndexes);var i=0,v=0;while(1){quadIndexes[i++]=v;if(i>=numIndexes)break;quadIndexes[i++]=v+1;if(i>=numIndexes)break;quadIndexes[i++]=v+2;if(i>=numIndexes)break;quadIndexes[i++]=v;if(i>=numIndexes)break;quadIndexes[i++]=v+2;if(i>=numIndexes)break;quadIndexes[i++]=v+3;if(i>=numIndexes)break;v+=4}context.GLctx.bufferData(34963,quadIndexes,35044);context.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:function getTempVertexBuffer(sizeBytes){var idx=GL.log2ceilLookup(sizeBytes);var ringbuffer=GL.currentContext.tempVertexBuffers1[idx];var nextFreeBufferIndex=GL.currentContext.tempVertexBufferCounters1[idx];GL.currentContext.tempVertexBufferCounters1[idx]=GL.currentContext.tempVertexBufferCounters1[idx]+1&GL.numTempVertexBuffersPerSize-1;var vbo=ringbuffer[nextFreeBufferIndex];if(vbo){return vbo}var prevVBO=GLctx.getParameter(34964);ringbuffer[nextFreeBufferIndex]=GLctx.createBuffer();GLctx.bindBuffer(34962,ringbuffer[nextFreeBufferIndex]);GLctx.bufferData(34962,1<{var source="";for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}var type=GLctx.getShaderParameter(GL.shaders[shader],35663);if(type==35632){if(GLEmulation.findToken(source,"dFdx")||GLEmulation.findToken(source,"dFdy")||GLEmulation.findToken(source,"fwidth")){source="#extension GL_OES_standard_derivatives : enable\n"+source;var extension=GLctx.getExtension("OES_standard_derivatives")}}return source},createContext:(canvas,webGLContextAttributes)=>{if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;function fixedGetContext(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}canvas.getContext=fixedGetContext}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:(ctx,webGLContextAttributes)=>{var handle=GL.getNewId(GL.contexts);var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault=="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:contextHandle=>{GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:contextHandle=>GL.contexts[contextHandle],deleteContext:contextHandle=>{if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents=="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;GL.contexts[contextHandle]=null},initExtensions:context=>{if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;context.compressionExt=GLctx.getExtension("WEBGL_compressed_texture_s3tc");context.anisotropicExt=GLctx.getExtension("EXT_texture_filter_anisotropic");webgl_enable_ANGLE_instanced_arrays(GLctx);webgl_enable_OES_vertex_array_object(GLctx);webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(ext=>{if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})},getExtensions(){var exts=GLctx.getSupportedExtensions()||[];exts=exts.concat(exts.map(e=>"GL_"+e));return exts}};var _eglCreateContext=(display,config,hmm,contextAttribs)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}var glesContextVersion=1;for(;;){var param=HEAP32[contextAttribs>>2];if(param==12440){glesContextVersion=HEAP32[contextAttribs+4>>2]}else if(param==12344){break}else{EGL.setErrorCode(12292);return 0}contextAttribs+=8}if(glesContextVersion!=2){EGL.setErrorCode(12293);return 0}EGL.contextAttributes.majorVersion=glesContextVersion-1;EGL.contextAttributes.minorVersion=0;EGL.context=GL.createContext(Module["canvas"],EGL.contextAttributes);if(EGL.context!=0){EGL.setErrorCode(12288);GL.makeContextCurrent(EGL.context);Module.useWebGL=true;Browser.moduleContextCreatedCallbacks.forEach(function(callback){callback()});GL.makeContextCurrent(null);return 62004}else{EGL.setErrorCode(12297);return 0}};var _eglCreateWindowSurface=(display,config,win,attrib_list)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(config!=62002){EGL.setErrorCode(12293);return 0}EGL.setErrorCode(12288);return 62006};var _eglDestroyContext=(display,context)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(context!=62004){EGL.setErrorCode(12294);return 0}GL.deleteContext(EGL.context);EGL.setErrorCode(12288);if(EGL.currentContext==context){EGL.currentContext=0}return 1};var _eglDestroySurface=(display,surface)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(surface!=62006){EGL.setErrorCode(12301);return 1}if(EGL.currentReadSurface==surface){EGL.currentReadSurface=0}if(EGL.currentDrawSurface==surface){EGL.currentDrawSurface=0}EGL.setErrorCode(12288);return 1};var _eglGetConfigAttrib=(display,config,attribute,value)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(config!=62002){EGL.setErrorCode(12293);return 0}if(!value){EGL.setErrorCode(12300);return 0}EGL.setErrorCode(12288);switch(attribute){case 12320:HEAP32[value>>2]=EGL.contextAttributes.alpha?32:24;return 1;case 12321:HEAP32[value>>2]=EGL.contextAttributes.alpha?8:0;return 1;case 12322:HEAP32[value>>2]=8;return 1;case 12323:HEAP32[value>>2]=8;return 1;case 12324:HEAP32[value>>2]=8;return 1;case 12325:HEAP32[value>>2]=EGL.contextAttributes.depth?24:0;return 1;case 12326:HEAP32[value>>2]=EGL.contextAttributes.stencil?8:0;return 1;case 12327:HEAP32[value>>2]=12344;return 1;case 12328:HEAP32[value>>2]=62002;return 1;case 12329:HEAP32[value>>2]=0;return 1;case 12330:HEAP32[value>>2]=4096;return 1;case 12331:HEAP32[value>>2]=16777216;return 1;case 12332:HEAP32[value>>2]=4096;return 1;case 12333:HEAP32[value>>2]=0;return 1;case 12334:HEAP32[value>>2]=0;return 1;case 12335:HEAP32[value>>2]=12344;return 1;case 12337:HEAP32[value>>2]=EGL.contextAttributes.antialias?4:0;return 1;case 12338:HEAP32[value>>2]=EGL.contextAttributes.antialias?1:0;return 1;case 12339:HEAP32[value>>2]=4;return 1;case 12340:HEAP32[value>>2]=12344;return 1;case 12341:case 12342:case 12343:HEAP32[value>>2]=-1;return 1;case 12345:case 12346:HEAP32[value>>2]=0;return 1;case 12347:HEAP32[value>>2]=0;return 1;case 12348:HEAP32[value>>2]=1;return 1;case 12349:case 12350:HEAP32[value>>2]=0;return 1;case 12351:HEAP32[value>>2]=12430;return 1;case 12352:HEAP32[value>>2]=4;return 1;case 12354:HEAP32[value>>2]=0;return 1;default:EGL.setErrorCode(12292);return 0}};var _eglGetDisplay=nativeDisplayType=>{EGL.setErrorCode(12288);return 62e3};var _eglGetError=()=>EGL.errorCode;var _eglInitialize=(display,majorVersion,minorVersion)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(majorVersion){HEAP32[majorVersion>>2]=1}if(minorVersion){HEAP32[minorVersion>>2]=4}EGL.defaultDisplayInitialized=true;EGL.setErrorCode(12288);return 1};var _eglMakeCurrent=(display,draw,read,context)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(context!=0&&context!=62004){EGL.setErrorCode(12294);return 0}if(read!=0&&read!=62006||draw!=0&&draw!=62006){EGL.setErrorCode(12301);return 0}GL.makeContextCurrent(context?EGL.context:null);EGL.currentContext=context;EGL.currentDrawSurface=draw;EGL.currentReadSurface=read;EGL.setErrorCode(12288);return 1};var stringToNewUTF8=str=>{var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8(str,ret,size);return ret};var _eglQueryString=(display,name)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}EGL.setErrorCode(12288);if(EGL.stringCache[name])return EGL.stringCache[name];var ret;switch(name){case 12371:ret=stringToNewUTF8("Emscripten");break;case 12372:ret=stringToNewUTF8("1.4 Emscripten EGL");break;case 12373:ret=stringToNewUTF8("");break;case 12429:ret=stringToNewUTF8("OpenGL_ES");break;default:EGL.setErrorCode(12300);return 0}EGL.stringCache[name]=ret;return ret};var _eglSwapBuffers=(dpy,surface)=>{if(!EGL.defaultDisplayInitialized){EGL.setErrorCode(12289)}else if(!Module.ctx){EGL.setErrorCode(12290)}else if(Module.ctx.isContextLost()){EGL.setErrorCode(12302)}else{EGL.setErrorCode(12288);return 1}return 0};var _eglSwapInterval=(display,interval)=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}if(interval==0)_emscripten_set_main_loop_timing(0,0);else _emscripten_set_main_loop_timing(1,interval);EGL.setErrorCode(12288);return 1};var _eglTerminate=display=>{if(display!=62e3){EGL.setErrorCode(12296);return 0}EGL.currentContext=0;EGL.currentReadSurface=0;EGL.currentDrawSurface=0;EGL.defaultDisplayInitialized=false;EGL.setErrorCode(12288);return 1};var _eglWaitClient=()=>{EGL.setErrorCode(12288);return 1};var _eglWaitGL=_eglWaitClient;var _eglWaitNative=nativeEngineId=>{EGL.setErrorCode(12288);return 1};var readEmAsmArgsArray=[];var readEmAsmArgs=(sigPtr,buf)=>{readEmAsmArgsArray.length=0;var ch;while(ch=HEAPU8[sigPtr++]){var wide=ch!=105;wide&=ch!=112;buf+=wide&&buf%8?4:0;readEmAsmArgsArray.push(ch==112?HEAPU32[buf>>2]:ch==105?HEAP32[buf>>2]:HEAPF64[buf>>3]);buf+=wide?8:4}return readEmAsmArgsArray};var runEmAsmFunction=(code,sigPtr,argbuf)=>{var args=readEmAsmArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)};var _emscripten_asm_const_int=(code,sigPtr,argbuf)=>runEmAsmFunction(code,sigPtr,argbuf);var runMainThreadEmAsm=(code,sigPtr,argbuf,sync)=>{var args=readEmAsmArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)};var _emscripten_asm_const_int_sync_on_main_thread=(code,sigPtr,argbuf)=>runMainThreadEmAsm(code,sigPtr,argbuf,1);var _emscripten_date_now=()=>Date.now();var withStackSave=f=>{var stack=stackSave();var ret=f();stackRestore(stack);return ret};var JSEvents={inEventHandler:0,removeAllEventListeners(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort((x,y)=>x.precedence{for(var i=0;icString>2?UTF8ToString(cString):cString;var specialHTMLTargets=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];var findEventTarget=target=>{target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!="undefined"?document.querySelector(target):undefined);return domElement};var findCanvasEventTarget=target=>findEventTarget(target);var _emscripten_get_canvas_element_size=(target,width,height)=>{var canvas=findCanvasEventTarget(target);if(!canvas)return-4;HEAP32[width>>2]=canvas.width;HEAP32[height>>2]=canvas.height};var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var getCanvasElementSize=target=>withStackSave(()=>{var w=stackAlloc(8);var h=w+4;var targetInt=stringToUTF8OnStack(target.id);var ret=_emscripten_get_canvas_element_size(targetInt,w,h);var size=[HEAP32[w>>2],HEAP32[h>>2]];return size});var _emscripten_set_canvas_element_size=(target,width,height)=>{var canvas=findCanvasEventTarget(target);if(!canvas)return-4;canvas.width=width;canvas.height=height;return 0};var setCanvasElementSize=(target,width,height)=>{if(!target.controlTransferredOffscreen){target.width=width;target.height=height}else{withStackSave(()=>{var targetInt=stringToUTF8OnStack(target.id);_emscripten_set_canvas_element_size(targetInt,width,height)})}};var registerRestoreOldStyle=canvas=>{var canvasSize=getCanvasElementSize(canvas);var oldWidth=canvasSize[0];var oldHeight=canvasSize[1];var oldCssWidth=canvas.style.width;var oldCssHeight=canvas.style.height;var oldBackgroundColor=canvas.style.backgroundColor;var oldDocumentBackgroundColor=document.body.style.backgroundColor;var oldPaddingLeft=canvas.style.paddingLeft;var oldPaddingRight=canvas.style.paddingRight;var oldPaddingTop=canvas.style.paddingTop;var oldPaddingBottom=canvas.style.paddingBottom;var oldMarginLeft=canvas.style.marginLeft;var oldMarginRight=canvas.style.marginRight;var oldMarginTop=canvas.style.marginTop;var oldMarginBottom=canvas.style.marginBottom;var oldDocumentBodyMargin=document.body.style.margin;var oldDocumentOverflow=document.documentElement.style.overflow;var oldDocumentScroll=document.body.scroll;var oldImageRendering=canvas.style.imageRendering;function restoreOldStyle(){var fullscreenElement=document.fullscreenElement||document.webkitFullscreenElement;if(!fullscreenElement){document.removeEventListener("fullscreenchange",restoreOldStyle);document.removeEventListener("webkitfullscreenchange",restoreOldStyle);setCanvasElementSize(canvas,oldWidth,oldHeight);canvas.style.width=oldCssWidth;canvas.style.height=oldCssHeight;canvas.style.backgroundColor=oldBackgroundColor;if(!oldDocumentBackgroundColor)document.body.style.backgroundColor="white";document.body.style.backgroundColor=oldDocumentBackgroundColor;canvas.style.paddingLeft=oldPaddingLeft;canvas.style.paddingRight=oldPaddingRight;canvas.style.paddingTop=oldPaddingTop;canvas.style.paddingBottom=oldPaddingBottom;canvas.style.marginLeft=oldMarginLeft;canvas.style.marginRight=oldMarginRight;canvas.style.marginTop=oldMarginTop;canvas.style.marginBottom=oldMarginBottom;document.body.style.margin=oldDocumentBodyMargin;document.documentElement.style.overflow=oldDocumentOverflow;document.body.scroll=oldDocumentScroll;canvas.style.imageRendering=oldImageRendering;if(canvas.GLctxObject)canvas.GLctxObject.GLctx.viewport(0,0,oldWidth,oldHeight);if(currentFullscreenStrategy.canvasResizedCallback){getWasmTableEntry(currentFullscreenStrategy.canvasResizedCallback)(37,0,currentFullscreenStrategy.canvasResizedCallbackUserData)}}}document.addEventListener("fullscreenchange",restoreOldStyle);document.addEventListener("webkitfullscreenchange",restoreOldStyle);return restoreOldStyle};var setLetterbox=(element,topBottom,leftRight)=>{element.style.paddingLeft=element.style.paddingRight=leftRight+"px";element.style.paddingTop=element.style.paddingBottom=topBottom+"px"};var getBoundingClientRect=e=>specialHTMLTargets.indexOf(e)<0?e.getBoundingClientRect():{"left":0,"top":0};var JSEvents_resizeCanvasForFullscreen=(target,strategy)=>{var restoreOldStyle=registerRestoreOldStyle(target);var cssWidth=strategy.softFullscreen?innerWidth:screen.width;var cssHeight=strategy.softFullscreen?innerHeight:screen.height;var rect=getBoundingClientRect(target);var windowedCssWidth=rect.width;var windowedCssHeight=rect.height;var canvasSize=getCanvasElementSize(target);var windowedRttWidth=canvasSize[0];var windowedRttHeight=canvasSize[1];if(strategy.scaleMode==3){setLetterbox(target,(cssHeight-windowedCssHeight)/2,(cssWidth-windowedCssWidth)/2);cssWidth=windowedCssWidth;cssHeight=windowedCssHeight}else if(strategy.scaleMode==2){if(cssWidth*windowedRttHeight{if(strategy.scaleMode!=0||strategy.canvasResolutionScaleMode!=0){JSEvents_resizeCanvasForFullscreen(target,strategy)}if(target.requestFullscreen){target.requestFullscreen()}else if(target.webkitRequestFullscreen){target.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}else{return JSEvents.fullscreenEnabled()?-3:-1}currentFullscreenStrategy=strategy;if(strategy.canvasResizedCallback){getWasmTableEntry(strategy.canvasResizedCallback)(37,0,strategy.canvasResizedCallbackUserData)}return 0};var _emscripten_exit_fullscreen=()=>{if(!JSEvents.fullscreenEnabled())return-1;JSEvents.removeDeferredCalls(JSEvents_requestFullscreen);var d=specialHTMLTargets[1];if(d.exitFullscreen){d.fullscreenElement&&d.exitFullscreen()}else if(d.webkitExitFullscreen){d.webkitFullscreenElement&&d.webkitExitFullscreen()}else{return-1}return 0};var requestPointerLock=target=>{if(target.requestPointerLock){target.requestPointerLock()}else{if(document.body.requestPointerLock){return-3}return-1}return 0};var _emscripten_exit_pointerlock=()=>{JSEvents.removeDeferredCalls(requestPointerLock);if(document.exitPointerLock){document.exitPointerLock()}else{return-1}return 0};var _emscripten_get_device_pixel_ratio=()=>typeof devicePixelRatio=="number"&&devicePixelRatio||1;var _emscripten_get_element_css_size=(target,width,height)=>{target=findEventTarget(target);if(!target)return-4;var rect=getBoundingClientRect(target);HEAPF64[width>>3]=rect.width;HEAPF64[height>>3]=rect.height;return 0};var fillGamepadEventData=(eventStruct,e)=>{HEAPF64[eventStruct>>3]=e.timestamp;for(var i=0;i>3]=e.axes[i]}for(var i=0;i>3]=e.buttons[i].value}else{HEAPF64[eventStruct+i*8+528>>3]=e.buttons[i]}}for(var i=0;i>2]=e.buttons[i].pressed}else{HEAP32[eventStruct+i*4+1040>>2]=e.buttons[i]==1}}HEAP32[eventStruct+1296>>2]=e.connected;HEAP32[eventStruct+1300>>2]=e.index;HEAP32[eventStruct+8>>2]=e.axes.length;HEAP32[eventStruct+12>>2]=e.buttons.length;stringToUTF8(e.id,eventStruct+1304,64);stringToUTF8(e.mapping,eventStruct+1368,64)};var _emscripten_get_gamepad_status=(index,gamepadState)=>{if(index<0||index>=JSEvents.lastGamepadState.length)return-5;if(!JSEvents.lastGamepadState[index])return-7;fillGamepadEventData(gamepadState,JSEvents.lastGamepadState[index]);return 0};var _emscripten_get_num_gamepads=()=>JSEvents.lastGamepadState.length;var _emscripten_get_screen_size=(width,height)=>{HEAP32[width>>2]=screen.width;HEAP32[height>>2]=screen.height};function _glActiveTexture(x0){GLctx.activeTexture(x0)}var _emscripten_glActiveTexture=_glActiveTexture;var _glAlphaFunc=(func,ref)=>{switch(func){case 512:case 513:case 514:case 515:case 516:case 517:case 518:case 519:GLEmulation.alphaTestRef=ref;if(GLEmulation.alphaTestFunc!=func){GLEmulation.alphaTestFunc=func;GLImmediate.currentRenderer=null}break;default:break}};var _emscripten_glAlphaFunc=_glAlphaFunc;var _glAttachShader=(program,shader)=>{GLctx.attachShader(GL.programs[program],GL.shaders[shader])};var _emscripten_glAttachShader=_glAttachShader;function _glEnable(x0){GLctx.enable(x0)}function _glDisable(x0){GLctx.disable(x0)}function _glIsEnabled(x0){return GLctx.isEnabled(x0)}var writeI53ToI64=(ptr,num)=>{HEAPU32[ptr>>2]=num;var lower=HEAPU32[ptr>>2];HEAPU32[ptr+4>>2]=(num-lower)/4294967296};var emscriptenWebGLGet=(name_,p,type)=>{if(!p){GL.recordError(1281);return}var ret=undefined;switch(name_){case 36346:ret=1;break;case 36344:if(type!=0&&type!=1){GL.recordError(1280)}return;case 36345:ret=0;break;case 34466:var formats=GLctx.getParameter(34467);ret=formats?formats.length:0;break}if(ret===undefined){var result=GLctx.getParameter(name_);switch(typeof result){case"number":ret=result;break;case"boolean":ret=result?1:0;break;case"string":GL.recordError(1280);return;case"object":if(result===null){switch(name_){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:{ret=0;break}default:{GL.recordError(1280);return}}}else if(result instanceof Float32Array||result instanceof Uint32Array||result instanceof Int32Array||result instanceof Array){for(var i=0;i>2]=result[i];break;case 2:HEAPF32[p+i*4>>2]=result[i];break;case 4:HEAP8[p+i>>0]=result[i]?1:0;break}}return}else{try{ret=result.name|0}catch(e){GL.recordError(1280);err("GL_INVALID_ENUM in glGet"+type+"v: Unknown object returned from WebGL getParameter("+name_+")! (error: "+e+")");return}}break;default:GL.recordError(1280);err("GL_INVALID_ENUM in glGet"+type+"v: Native code calling glGet"+type+"v("+name_+") and it returns "+result+" of type "+typeof result+"!");return}}switch(type){case 1:writeI53ToI64(p,ret);break;case 0:HEAP32[p>>2]=ret;break;case 2:HEAPF32[p>>2]=ret;break;case 4:HEAP8[p>>0]=ret?1:0;break}};var _glGetBooleanv=(name_,p)=>{emscriptenWebGLGet(name_,p,4)};var _glGetIntegerv=(name_,p)=>{emscriptenWebGLGet(name_,p,0)};var _glGetString=name_=>{var ret=GL.stringCache[name_];if(!ret){switch(name_){case 7939:ret=stringToNewUTF8(GL.getExtensions().join(" "));break;case 7936:case 7937:case 37445:case 37446:var s=GLctx.getParameter(name_);if(!s){GL.recordError(1280)}ret=s?stringToNewUTF8(s):0;break;case 7938:var glVersion=GLctx.getParameter(7938);{glVersion="OpenGL ES 2.0 ("+glVersion+")"}ret=stringToNewUTF8(glVersion);break;case 35724:var glslVersion=GLctx.getParameter(35724);var ver_re=/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;var ver_num=glslVersion.match(ver_re);if(ver_num!==null){if(ver_num[1].length==3)ver_num[1]=ver_num[1]+"0";glslVersion="OpenGL ES GLSL ES "+ver_num[1]+" ("+glslVersion+")"}ret=stringToNewUTF8(glslVersion);break;default:GL.recordError(1280)}GL.stringCache[name_]=ret}return ret};var _glCreateShader=shaderType=>{var id=GL.getNewId(GL.shaders);GL.shaders[id]=GLctx.createShader(shaderType);return id};var _glShaderSource=(shader,count,string,length)=>{var source=GL.getSource(shader,count,string,length);GLctx.shaderSource(GL.shaders[shader],source)};var _glCompileShader=shader=>{GLctx.compileShader(GL.shaders[shader])};var _glDetachShader=(program,shader)=>{GLctx.detachShader(GL.programs[program],GL.shaders[shader])};var _glUseProgram=program=>{program=GL.programs[program];GLctx.useProgram(program);GLctx.currentProgram=program};var _glDeleteProgram=id=>{if(!id)return;var program=GL.programs[id];if(!program){GL.recordError(1281);return}GLctx.deleteProgram(program);program.name=0;GL.programs[id]=null};var _glBindAttribLocation=(program,index,name)=>{GLctx.bindAttribLocation(GL.programs[program],index,UTF8ToString(name))};var _glLinkProgram=program=>{program=GL.programs[program];GLctx.linkProgram(program);program.uniformLocsById=0;program.uniformSizeAndIdsByName={}};var _glBindBuffer=(target,buffer)=>{if(target==34962){GLctx.currentArrayBufferBinding=buffer;GLImmediate.lastArrayBuffer=buffer}else if(target==34963){GLctx.currentElementArrayBufferBinding=buffer}GLctx.bindBuffer(target,GL.buffers[buffer])};var _glGetFloatv=(name_,p)=>{emscriptenWebGLGet(name_,p,2)};function _glHint(x0,x1){GLctx.hint(x0,x1)}var _glEnableVertexAttribArray=index=>{GLctx.enableVertexAttribArray(index)};var _glDisableVertexAttribArray=index=>{GLctx.disableVertexAttribArray(index)};var _glVertexAttribPointer=(index,size,type,normalized,stride,ptr)=>{GLctx.vertexAttribPointer(index,size,type,!!normalized,stride,ptr)};var ptrToString=ptr=>{ptr>>>=0;return"0x"+ptr.toString(16).padStart(8,"0")};var GLEmulation={fogStart:0,fogEnd:1,fogDensity:1,fogColor:null,fogMode:2048,fogEnabled:false,MAX_CLIP_PLANES:6,clipPlaneEnabled:[false,false,false,false,false,false],clipPlaneEquation:[],lightingEnabled:false,lightModelAmbient:null,lightModelLocalViewer:false,lightModelTwoSide:false,materialAmbient:null,materialDiffuse:null,materialSpecular:null,materialShininess:null,materialEmission:null,MAX_LIGHTS:8,lightEnabled:[false,false,false,false,false,false,false,false],lightAmbient:[],lightDiffuse:[],lightSpecular:[],lightPosition:[],alphaTestEnabled:false,alphaTestFunc:519,alphaTestRef:0,pointSize:1,vaos:[],currentVao:null,enabledVertexAttribArrays:{},hasRunInit:false,findToken(source,token){function isIdentChar(ch){if(ch>=48&&ch<=57)return true;if(ch>=65&&ch<=90)return true;if(ch>=97&&ch<=122)return true;return false}var i=-1;do{i=source.indexOf(token,i+1);if(i<0){break}if(i>0&&isIdentChar(source[i-1])){continue}i+=token.length;if(i{if(GLImmediate.lastRenderer)GLImmediate.lastRenderer.cleanup();if(cap==2912){if(GLEmulation.fogEnabled!=true){GLImmediate.currentRenderer=null;GLEmulation.fogEnabled=true}return}else if(cap>=12288&&cap<12294){var clipPlaneId=cap-12288;if(GLEmulation.clipPlaneEnabled[clipPlaneId]!=true){GLImmediate.currentRenderer=null;GLEmulation.clipPlaneEnabled[clipPlaneId]=true}return}else if(cap>=16384&&cap<16392){var lightId=cap-16384;if(GLEmulation.lightEnabled[lightId]!=true){GLImmediate.currentRenderer=null;GLEmulation.lightEnabled[lightId]=true}return}else if(cap==2896){if(GLEmulation.lightingEnabled!=true){GLImmediate.currentRenderer=null;GLEmulation.lightingEnabled=true}return}else if(cap==3008){if(GLEmulation.alphaTestEnabled!=true){GLImmediate.currentRenderer=null;GLEmulation.alphaTestEnabled=true}return}else if(cap==3553){return}else if(!(cap in validCapabilities)){return}glEnable(cap)};var glDisable=_glDisable;_glDisable=_emscripten_glDisable=cap=>{if(GLImmediate.lastRenderer)GLImmediate.lastRenderer.cleanup();if(cap==2912){if(GLEmulation.fogEnabled!=false){GLImmediate.currentRenderer=null;GLEmulation.fogEnabled=false}return}else if(cap>=12288&&cap<12294){var clipPlaneId=cap-12288;if(GLEmulation.clipPlaneEnabled[clipPlaneId]!=false){GLImmediate.currentRenderer=null;GLEmulation.clipPlaneEnabled[clipPlaneId]=false}return}else if(cap>=16384&&cap<16392){var lightId=cap-16384;if(GLEmulation.lightEnabled[lightId]!=false){GLImmediate.currentRenderer=null;GLEmulation.lightEnabled[lightId]=false}return}else if(cap==2896){if(GLEmulation.lightingEnabled!=false){GLImmediate.currentRenderer=null;GLEmulation.lightingEnabled=false}return}else if(cap==3008){if(GLEmulation.alphaTestEnabled!=false){GLImmediate.currentRenderer=null;GLEmulation.alphaTestEnabled=false}return}else if(cap==3553){return}else if(!(cap in validCapabilities)){return}glDisable(cap)};_glIsEnabled=_emscripten_glIsEnabled=cap=>{if(cap==2912){return GLEmulation.fogEnabled?1:0}else if(cap>=12288&&cap<12294){var clipPlaneId=cap-12288;return GLEmulation.clipPlaneEnabled[clipPlaneId]?1:0}else if(cap>=16384&&cap<16392){var lightId=cap-16384;return GLEmulation.lightEnabled[lightId]?1:0}else if(cap==2896){return GLEmulation.lightingEnabled?1:0}else if(cap==3008){return GLEmulation.alphaTestEnabled?1:0}else if(!(cap in validCapabilities)){return 0}return GLctx.isEnabled(cap)};var glGetBooleanv=_glGetBooleanv;_glGetBooleanv=_emscripten_glGetBooleanv=(pname,p)=>{var attrib=GLEmulation.getAttributeFromCapability(pname);if(attrib!==null){var result=GLImmediate.enabledClientAttributes[attrib];HEAP8[p>>0]=result===true?1:0;return}glGetBooleanv(pname,p)};var glGetIntegerv=_glGetIntegerv;_glGetIntegerv=_emscripten_glGetIntegerv=(pname,params)=>{switch(pname){case 34018:pname=GLctx.MAX_TEXTURE_IMAGE_UNITS;break;case 35658:{var result=GLctx.getParameter(GLctx.MAX_VERTEX_UNIFORM_VECTORS);HEAP32[params>>2]=result*4;return}case 35657:{var result=GLctx.getParameter(GLctx.MAX_FRAGMENT_UNIFORM_VECTORS);HEAP32[params>>2]=result*4;return}case 35659:{var result=GLctx.getParameter(GLctx.MAX_VARYING_VECTORS);HEAP32[params>>2]=result*4;return}case 34929:pname=GLctx.MAX_COMBINED_TEXTURE_IMAGE_UNITS;break;case 32890:{var attribute=GLImmediate.clientAttributes[GLImmediate.VERTEX];HEAP32[params>>2]=attribute?attribute.size:0;return}case 32891:{var attribute=GLImmediate.clientAttributes[GLImmediate.VERTEX];HEAP32[params>>2]=attribute?attribute.type:0;return}case 32892:{var attribute=GLImmediate.clientAttributes[GLImmediate.VERTEX];HEAP32[params>>2]=attribute?attribute.stride:0;return}case 32897:{var attribute=GLImmediate.clientAttributes[GLImmediate.COLOR];HEAP32[params>>2]=attribute?attribute.size:0;return}case 32898:{var attribute=GLImmediate.clientAttributes[GLImmediate.COLOR];HEAP32[params>>2]=attribute?attribute.type:0;return}case 32899:{var attribute=GLImmediate.clientAttributes[GLImmediate.COLOR];HEAP32[params>>2]=attribute?attribute.stride:0;return}case 32904:{var attribute=GLImmediate.clientAttributes[GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture];HEAP32[params>>2]=attribute?attribute.size:0;return}case 32905:{var attribute=GLImmediate.clientAttributes[GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture];HEAP32[params>>2]=attribute?attribute.type:0;return}case 32906:{var attribute=GLImmediate.clientAttributes[GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture];HEAP32[params>>2]=attribute?attribute.stride:0;return}case 3378:{HEAP32[params>>2]=GLEmulation.MAX_CLIP_PLANES;return}case 2976:{HEAP32[params>>2]=GLImmediate.currentMatrix+5888;return}case 3009:{HEAP32[params>>2]=GLEmulation.alphaTestFunc;return}}glGetIntegerv(pname,params)};var glGetString=_glGetString;_glGetString=_emscripten_glGetString=name_=>{if(GL.stringCache[name_])return GL.stringCache[name_];switch(name_){case 7939:var ret=stringToNewUTF8((GLctx.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"+(GL.currentContext.compressionExt?" GL_ARB_texture_compression GL_EXT_texture_compression_s3tc":"")+(GL.currentContext.anisotropicExt?" GL_EXT_texture_filter_anisotropic":""));return GL.stringCache[name_]=ret}return glGetString(name_)};GL.shaderInfos={};var glCreateShader=_glCreateShader;_glCreateShader=_emscripten_glCreateShader=shaderType=>{var id=glCreateShader(shaderType);GL.shaderInfos[id]={type:shaderType,ftransform:false};return id};function ensurePrecision(source){if(!/precision +(low|medium|high)p +float *;/.test(source)){source="#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n"+source}return source}_glShaderSource=_emscripten_glShaderSource=(shader,count,string,length)=>{var source=GL.getSource(shader,count,string,length);if(GL.shaderInfos[shader].type==GLctx.VERTEX_SHADER){var has_pm=source.search(/u_projection/)>=0;var has_mm=source.search(/u_modelView/)>=0;var has_pv=source.search(/a_position/)>=0;var need_pm=0,need_mm=0,need_pv=0;var old=source;source=source.replace(/ftransform\(\)/g,"(u_projection * u_modelView * a_position)");if(old!=source)need_pm=need_mm=need_pv=1;old=source;source=source.replace(/gl_ProjectionMatrix/g,"u_projection");if(old!=source)need_pm=1;old=source;source=source.replace(/gl_ModelViewMatrixTranspose\[2\]/g,"vec4(u_modelView[0][2], u_modelView[1][2], u_modelView[2][2], u_modelView[3][2])");if(old!=source)need_mm=1;old=source;source=source.replace(/gl_ModelViewMatrix/g,"u_modelView");if(old!=source)need_mm=1;old=source;source=source.replace(/gl_Vertex/g,"a_position");if(old!=source)need_pv=1;old=source;source=source.replace(/gl_ModelViewProjectionMatrix/g,"(u_projection * u_modelView)");if(old!=source)need_pm=need_mm=1;if(need_pv&&!has_pv)source="attribute vec4 a_position; \n"+source;if(need_mm&&!has_mm)source="uniform mat4 u_modelView; \n"+source;if(need_pm&&!has_pm)source="uniform mat4 u_projection; \n"+source;GL.shaderInfos[shader].ftransform=need_pm||need_mm||need_pv;for(var i=0;i{GLctx.compileShader(GL.shaders[shader])};GL.programShaders={};var glAttachShader=_glAttachShader;_glAttachShader=_emscripten_glAttachShader=(program,shader)=>{if(!GL.programShaders[program])GL.programShaders[program]=[];GL.programShaders[program].push(shader);glAttachShader(program,shader)};var glDetachShader=_glDetachShader;_glDetachShader=_emscripten_glDetachShader=(program,shader)=>{var programShader=GL.programShaders[program];if(!programShader){err(`WARNING: _glDetachShader received invalid program: ${program}`);return}var index=programShader.indexOf(shader);programShader.splice(index,1);glDetachShader(program,shader)};var glUseProgram=_glUseProgram;_glUseProgram=_emscripten_glUseProgram=program=>{if(GL.currProgram!=program){GLImmediate.currentRenderer=null;GL.currProgram=program;GLImmediate.fixedFunctionProgram=0;glUseProgram(program)}};var glDeleteProgram=_glDeleteProgram;_glDeleteProgram=_emscripten_glDeleteProgram=program=>{glDeleteProgram(program);if(program==GL.currProgram){GLImmediate.currentRenderer=null;GL.currProgram=0}};var zeroUsedPrograms={};var glBindAttribLocation=_glBindAttribLocation;_glBindAttribLocation=_emscripten_glBindAttribLocation=(program,index,name)=>{if(index==0)zeroUsedPrograms[program]=true;glBindAttribLocation(program,index,name)};var glLinkProgram=_glLinkProgram;_glLinkProgram=_emscripten_glLinkProgram=program=>{if(!(program in zeroUsedPrograms)){GLctx.bindAttribLocation(GL.programs[program],0,"a_position")}glLinkProgram(program)};var glBindBuffer=_glBindBuffer;_glBindBuffer=_emscripten_glBindBuffer=(target,buffer)=>{glBindBuffer(target,buffer);if(target==GLctx.ARRAY_BUFFER){if(GLEmulation.currentVao){GLEmulation.currentVao.arrayBuffer=buffer}}else if(target==GLctx.ELEMENT_ARRAY_BUFFER){if(GLEmulation.currentVao)GLEmulation.currentVao.elementArrayBuffer=buffer}};var glGetFloatv=_glGetFloatv;_glGetFloatv=_emscripten_glGetFloatv=(pname,params)=>{if(pname==2982){HEAPF32.set(GLImmediate.matrix[0],params>>2)}else if(pname==2983){HEAPF32.set(GLImmediate.matrix[1],params>>2)}else if(pname==2984){HEAPF32.set(GLImmediate.matrix[2+GLImmediate.clientActiveTexture],params>>2)}else if(pname==2918){HEAPF32.set(GLEmulation.fogColor,params>>2)}else if(pname==2915){HEAPF32[params>>2]=GLEmulation.fogStart}else if(pname==2916){HEAPF32[params>>2]=GLEmulation.fogEnd}else if(pname==2914){HEAPF32[params>>2]=GLEmulation.fogDensity}else if(pname==2917){HEAPF32[params>>2]=GLEmulation.fogMode}else if(pname==2899){HEAPF32[params>>2]=GLEmulation.lightModelAmbient[0];HEAPF32[params+4>>2]=GLEmulation.lightModelAmbient[1];HEAPF32[params+8>>2]=GLEmulation.lightModelAmbient[2];HEAPF32[params+12>>2]=GLEmulation.lightModelAmbient[3]}else if(pname==3010){HEAPF32[params>>2]=GLEmulation.alphaTestRef}else{glGetFloatv(pname,params)}};var glHint=_glHint;_glHint=_emscripten_glHint=(target,mode)=>{if(target==34031){return}glHint(target,mode)};var glEnableVertexAttribArray=_glEnableVertexAttribArray;_glEnableVertexAttribArray=_emscripten_glEnableVertexAttribArray=index=>{glEnableVertexAttribArray(index);GLEmulation.enabledVertexAttribArrays[index]=1;if(GLEmulation.currentVao)GLEmulation.currentVao.enabledVertexAttribArrays[index]=1};var glDisableVertexAttribArray=_glDisableVertexAttribArray;_glDisableVertexAttribArray=_emscripten_glDisableVertexAttribArray=index=>{glDisableVertexAttribArray(index);delete GLEmulation.enabledVertexAttribArrays[index];if(GLEmulation.currentVao)delete GLEmulation.currentVao.enabledVertexAttribArrays[index]};var glVertexAttribPointer=_glVertexAttribPointer;_glVertexAttribPointer=_emscripten_glVertexAttribPointer=(index,size,type,normalized,stride,pointer)=>{glVertexAttribPointer(index,size,type,normalized,stride,pointer);if(GLEmulation.currentVao){GLEmulation.currentVao.vertexAttribPointers[index]=[index,size,type,normalized,stride,pointer]}}},getAttributeFromCapability(cap){var attrib=null;switch(cap){case 3553:case 32888:attrib=GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture;break;case 32884:attrib=GLImmediate.VERTEX;break;case 32885:attrib=GLImmediate.NORMAL;break;case 32886:attrib=GLImmediate.COLOR;break}return attrib}};var GLImmediate={MapTreeLib:null,spawnMapTreeLib:()=>{function CNaiveListMap(){var list=[];this.insert=function CNaiveListMap_insert(key,val){if(this.contains(key|0))return false;list.push([key,val]);return true};var __contains_i;this.contains=function CNaiveListMap_contains(key){for(__contains_i=0;__contains_inew CMapTree}},TexEnvJIT:null,spawnTexEnvJIT:()=>{var GL_TEXTURE0=33984;var GL_TEXTURE_1D=3552;var GL_TEXTURE_2D=3553;var GL_TEXTURE_3D=32879;var GL_TEXTURE_CUBE_MAP=34067;var GL_TEXTURE_ENV=8960;var GL_TEXTURE_ENV_MODE=8704;var GL_TEXTURE_ENV_COLOR=8705;var GL_SRC0_RGB=34176;var GL_SRC1_RGB=34177;var GL_SRC2_RGB=34178;var GL_SRC0_ALPHA=34184;var GL_SRC1_ALPHA=34185;var GL_SRC2_ALPHA=34186;var GL_OPERAND0_RGB=34192;var GL_OPERAND1_RGB=34193;var GL_OPERAND2_RGB=34194;var GL_OPERAND0_ALPHA=34200;var GL_OPERAND1_ALPHA=34201;var GL_OPERAND2_ALPHA=34202;var GL_COMBINE_RGB=34161;var GL_COMBINE_ALPHA=34162;var GL_RGB_SCALE=34163;var GL_ALPHA_SCALE=3356;var GL_ADD=260;var GL_BLEND=3042;var GL_REPLACE=7681;var GL_MODULATE=8448;var GL_DECAL=8449;var GL_COMBINE=34160;var GL_SUBTRACT=34023;var GL_INTERPOLATE=34165;var GL_TEXTURE=5890;var GL_CONSTANT=34166;var GL_PRIMARY_COLOR=34167;var GL_PREVIOUS=34168;var GL_SRC_COLOR=768;var GL_ONE_MINUS_SRC_COLOR=769;var GL_SRC_ALPHA=770;var GL_ONE_MINUS_SRC_ALPHA=771;var TEXENVJIT_NAMESPACE_PREFIX="tej_";var TEX_UNIT_UNIFORM_PREFIX="uTexUnit";var TEX_COORD_VARYING_PREFIX="vTexCoord";var PRIM_COLOR_VARYING="vPrimColor";var TEX_MATRIX_UNIFORM_PREFIX="uTexMatrix";var s_texUnits=null;var s_activeTexture=0;var s_requiredTexUnitsForPass=[];function abort(info){assert(false,"[TexEnvJIT] ABORT: "+info)}function abort_noSupport(info){abort("No support: "+info)}function abort_sanity(info){abort("Sanity failure: "+info)}function genTexUnitSampleExpr(texUnitID){var texUnit=s_texUnits[texUnitID];var texType=texUnit.getTexType();var func=null;switch(texType){case GL_TEXTURE_1D:func="texture2D";break;case GL_TEXTURE_2D:func="texture2D";break;case GL_TEXTURE_3D:return abort_noSupport("No support for 3D textures.");case GL_TEXTURE_CUBE_MAP:func="textureCube";break;default:return abort_sanity("Unknown texType: "+ptrToString(texType))}var texCoordExpr=TEX_COORD_VARYING_PREFIX+texUnitID;if(TEX_MATRIX_UNIFORM_PREFIX!=null){texCoordExpr="("+TEX_MATRIX_UNIFORM_PREFIX+texUnitID+" * "+texCoordExpr+")"}return func+"("+TEX_UNIT_UNIFORM_PREFIX+texUnitID+", "+texCoordExpr+".xy)"}function getTypeFromCombineOp(op){switch(op){case GL_SRC_COLOR:case GL_ONE_MINUS_SRC_COLOR:return"vec3";case GL_SRC_ALPHA:case GL_ONE_MINUS_SRC_ALPHA:return"float"}return abort_noSupport("Unsupported combiner op: "+ptrToString(op))}function getCurTexUnit(){return s_texUnits[s_activeTexture]}function genCombinerSourceExpr(texUnitID,constantExpr,previousVar,src,op){var srcExpr=null;switch(src){case GL_TEXTURE:srcExpr=genTexUnitSampleExpr(texUnitID);break;case GL_CONSTANT:srcExpr=constantExpr;break;case GL_PRIMARY_COLOR:srcExpr=PRIM_COLOR_VARYING;break;case GL_PREVIOUS:srcExpr=previousVar;break;default:return abort_noSupport("Unsupported combiner src: "+ptrToString(src))}var expr=null;switch(op){case GL_SRC_COLOR:expr=srcExpr+".rgb";break;case GL_ONE_MINUS_SRC_COLOR:expr="(vec3(1.0) - "+srcExpr+".rgb)";break;case GL_SRC_ALPHA:expr=srcExpr+".a";break;case GL_ONE_MINUS_SRC_ALPHA:expr="(1.0 - "+srcExpr+".a)";break;default:return abort_noSupport("Unsupported combiner op: "+ptrToString(op))}return expr}function valToFloatLiteral(val){if(val==Math.round(val))return val+".0";return val}function CTexEnv(){this.mode=GL_MODULATE;this.colorCombiner=GL_MODULATE;this.alphaCombiner=GL_MODULATE;this.colorScale=1;this.alphaScale=1;this.envColor=[0,0,0,0];this.colorSrc=[GL_TEXTURE,GL_PREVIOUS,GL_CONSTANT];this.alphaSrc=[GL_TEXTURE,GL_PREVIOUS,GL_CONSTANT];this.colorOp=[GL_SRC_COLOR,GL_SRC_COLOR,GL_SRC_ALPHA];this.alphaOp=[GL_SRC_ALPHA,GL_SRC_ALPHA,GL_SRC_ALPHA];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 k=this.traverseKey;var key=k[this.mode]*1638400;key+=k[this.colorCombiner]*327680;key+=k[this.alphaCombiner]*65536;key+=(this.colorScale-1)*16384;key+=(this.alphaScale-1)*4096;key+=k[this.colorSrc[0]]*1024;key+=k[this.colorSrc[1]]*256;key+=k[this.colorSrc[2]]*64;key+=k[this.alphaSrc[0]]*16;key+=k[this.alphaSrc[1]]*4;key+=k[this.alphaSrc[2]];return key};this.computeKey1=function(){var k=this.traverseKey;var key=k[this.colorOp[0]]*4096;key+=k[this.colorOp[1]]*1024;key+=k[this.colorOp[2]]*256;key+=k[this.alphaOp[0]]*16;key+=k[this.alphaOp[1]]*4;key+=k[this.alphaOp[2]];return key};this.computeKey2=function(){return this.envColor[0]*16777216+this.envColor[1]*65536+this.envColor[2]*256+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;GLImmediate.currentRenderer=null}}function CTexUnit(){this.env=new CTexEnv;this.enabled_tex1D=false;this.enabled_tex2D=false;this.enabled_tex3D=false;this.enabled_texCube=false;this.texTypesEnabled=0;this.traverseState=function CTexUnit_traverseState(keyView){if(this.texTypesEnabled){if(this.env.key0==-1){this.env.recomputeKey()}keyView.next(this.texTypesEnabled|this.env.key0<<4);keyView.next(this.env.key1);keyView.next(this.env.key2)}else{keyView.next(0)}}}CTexUnit.prototype.enabled=function CTexUnit_enabled(){return this.texTypesEnabled};CTexUnit.prototype.genPassLines=function CTexUnit_genPassLines(passOutputVar,passInputVar,texUnitID){if(!this.enabled()){return["vec4 "+passOutputVar+" = "+passInputVar+";"]}var lines=this.env.genPassLines(passOutputVar,passInputVar,texUnitID).join("\n");var texLoadLines="";var texLoadRegex=/(texture.*?\(.*?\))/g;var loadCounter=0;var load;while(load=texLoadRegex.exec(lines)){var texLoadExpr=load[1];var secondOccurrence=lines.slice(load.index+1).indexOf(texLoadExpr);if(secondOccurrence!=-1){var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var texLoadVar=prefix+"texload"+loadCounter++;var texLoadLine="vec4 "+texLoadVar+" = "+texLoadExpr+";\n";texLoadLines+=texLoadLine+"\n";lines=lines.split(texLoadExpr).join(texLoadVar);texLoadRegex=/(texture.*\(.*\))/g}}return[texLoadLines+lines]};CTexUnit.prototype.getTexType=function CTexUnit_getTexType(){if(this.enabled_texCube){return GL_TEXTURE_CUBE_MAP}else if(this.enabled_tex3D){return GL_TEXTURE_3D}else if(this.enabled_tex2D){return GL_TEXTURE_2D}else if(this.enabled_tex1D){return GL_TEXTURE_1D}return 0};CTexEnv.prototype.genPassLines=function CTexEnv_genPassLines(passOutputVar,passInputVar,texUnitID){switch(this.mode){case GL_REPLACE:{return["vec4 "+passOutputVar+" = "+genTexUnitSampleExpr(texUnitID)+";"]}case GL_ADD:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var texVar=prefix+"tex";var colorVar=prefix+"color";var alphaVar=prefix+"alpha";return["vec4 "+texVar+" = "+genTexUnitSampleExpr(texUnitID)+";","vec3 "+colorVar+" = "+passInputVar+".rgb + "+texVar+".rgb;","float "+alphaVar+" = "+passInputVar+".a * "+texVar+".a;","vec4 "+passOutputVar+" = vec4("+colorVar+", "+alphaVar+");"]}case GL_MODULATE:{var line=["vec4 "+passOutputVar," = ",passInputVar," * ",genTexUnitSampleExpr(texUnitID),";"];return[line.join("")]}case GL_DECAL:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var texVar=prefix+"tex";var colorVar=prefix+"color";var alphaVar=prefix+"alpha";return["vec4 "+texVar+" = "+genTexUnitSampleExpr(texUnitID)+";",["vec3 "+colorVar+" = ",passInputVar+".rgb * (1.0 - "+texVar+".a)"," + ",texVar+".rgb * "+texVar+".a",";"].join(""),"float "+alphaVar+" = "+passInputVar+".a;","vec4 "+passOutputVar+" = vec4("+colorVar+", "+alphaVar+");"]}case GL_BLEND:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var texVar=prefix+"tex";var colorVar=prefix+"color";var alphaVar=prefix+"alpha";return["vec4 "+texVar+" = "+genTexUnitSampleExpr(texUnitID)+";",["vec3 "+colorVar+" = ",passInputVar+".rgb * (1.0 - "+texVar+".rgb)"," + ",PRIM_COLOR_VARYING+".rgb * "+texVar+".rgb",";"].join(""),"float "+alphaVar+" = "+texVar+".a;","vec4 "+passOutputVar+" = vec4("+colorVar+", "+alphaVar+");"]}case GL_COMBINE:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var colorVar=prefix+"color";var alphaVar=prefix+"alpha";var colorLines=this.genCombinerLines(true,colorVar,passInputVar,texUnitID,this.colorCombiner,this.colorSrc,this.colorOp);var alphaLines=this.genCombinerLines(false,alphaVar,passInputVar,texUnitID,this.alphaCombiner,this.alphaSrc,this.alphaOp);var scaledColor=this.colorScale==1?colorVar:colorVar+" * "+valToFloatLiteral(this.colorScale);var scaledAlpha=this.alphaScale==1?alphaVar:alphaVar+" * "+valToFloatLiteral(this.alphaScale);var line=["vec4 "+passOutputVar," = ","vec4(",scaledColor,", ",scaledAlpha,")",";"].join("");return[].concat(colorLines,alphaLines,[line])}}return abort_noSupport("Unsupported TexEnv mode: "+ptrToString(this.mode))};CTexEnv.prototype.genCombinerLines=function CTexEnv_getCombinerLines(isColor,outputVar,passInputVar,texUnitID,combiner,srcArr,opArr){var argsNeeded=null;switch(combiner){case GL_REPLACE:argsNeeded=1;break;case GL_MODULATE:case GL_ADD:case GL_SUBTRACT:argsNeeded=2;break;case GL_INTERPOLATE:argsNeeded=3;break;default:return abort_noSupport("Unsupported combiner: "+ptrToString(combiner))}var constantExpr=["vec4(",valToFloatLiteral(this.envColor[0]),", ",valToFloatLiteral(this.envColor[1]),", ",valToFloatLiteral(this.envColor[2]),", ",valToFloatLiteral(this.envColor[3]),")"].join("");var src0Expr=argsNeeded>=1?genCombinerSourceExpr(texUnitID,constantExpr,passInputVar,srcArr[0],opArr[0]):null;var src1Expr=argsNeeded>=2?genCombinerSourceExpr(texUnitID,constantExpr,passInputVar,srcArr[1],opArr[1]):null;var src2Expr=argsNeeded>=3?genCombinerSourceExpr(texUnitID,constantExpr,passInputVar,srcArr[2],opArr[2]):null;var outputType=isColor?"vec3":"float";var lines=null;switch(combiner){case GL_REPLACE:{var line=[outputType+" "+outputVar," = ",src0Expr,";"];lines=[line.join("")];break}case GL_MODULATE:{var line=[outputType+" "+outputVar+" = ",src0Expr+" * "+src1Expr,";"];lines=[line.join("")];break}case GL_ADD:{var line=[outputType+" "+outputVar+" = ",src0Expr+" + "+src1Expr,";"];lines=[line.join("")];break}case GL_SUBTRACT:{var line=[outputType+" "+outputVar+" = ",src0Expr+" - "+src1Expr,";"];lines=[line.join("")];break}case GL_INTERPOLATE:{var prefix=TEXENVJIT_NAMESPACE_PREFIX+"env"+texUnitID+"_";var arg2Var=prefix+"colorSrc2";var arg2Line=getTypeFromCombineOp(this.colorOp[2])+" "+arg2Var+" = "+src2Expr+";";var line=[outputType+" "+outputVar," = ",src0Expr+" * "+arg2Var," + ",src1Expr+" * (1.0 - "+arg2Var+")",";"];lines=[arg2Line,line.join("")];break}default:return abort_sanity("Unmatched TexEnv.colorCombiner?")}return lines};return{init:(gl,specifiedMaxTextureImageUnits)=>{var maxTexUnits=0;if(specifiedMaxTextureImageUnits){maxTexUnits=specifiedMaxTextureImageUnits}else if(gl){maxTexUnits=gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)}s_texUnits=[];for(var i=0;i{TEX_UNIT_UNIFORM_PREFIX=uTexUnitPrefix;TEX_COORD_VARYING_PREFIX=vTexCoordPrefix;PRIM_COLOR_VARYING=vPrimColor;TEX_MATRIX_UNIFORM_PREFIX=uTexMatrixPrefix},genAllPassLines:(resultDest,indentSize=0)=>{s_requiredTexUnitsForPass.length=0;var lines=[];var lastPassVar=PRIM_COLOR_VARYING;for(var i=0;is_requiredTexUnitsForPass,getActiveTexture:()=>s_activeTexture,traverseState:keyView=>{for(var i=0;is_texUnits[texUnitID].getTexType(),hook_activeTexture:texture=>{s_activeTexture=texture-GL_TEXTURE0;if(GLImmediate.currentMatrix>=2){GLImmediate.currentMatrix=2+s_activeTexture}},hook_enable:cap=>{var cur=getCurTexUnit();switch(cap){case GL_TEXTURE_1D:if(!cur.enabled_tex1D){GLImmediate.currentRenderer=null;cur.enabled_tex1D=true;cur.texTypesEnabled|=1}break;case GL_TEXTURE_2D:if(!cur.enabled_tex2D){GLImmediate.currentRenderer=null;cur.enabled_tex2D=true;cur.texTypesEnabled|=2}break;case GL_TEXTURE_3D:if(!cur.enabled_tex3D){GLImmediate.currentRenderer=null;cur.enabled_tex3D=true;cur.texTypesEnabled|=4}break;case GL_TEXTURE_CUBE_MAP:if(!cur.enabled_texCube){GLImmediate.currentRenderer=null;cur.enabled_texCube=true;cur.texTypesEnabled|=8}break}},hook_disable:cap=>{var cur=getCurTexUnit();switch(cap){case GL_TEXTURE_1D:if(cur.enabled_tex1D){GLImmediate.currentRenderer=null;cur.enabled_tex1D=false;cur.texTypesEnabled&=~1}break;case GL_TEXTURE_2D:if(cur.enabled_tex2D){GLImmediate.currentRenderer=null;cur.enabled_tex2D=false;cur.texTypesEnabled&=~2}break;case GL_TEXTURE_3D:if(cur.enabled_tex3D){GLImmediate.currentRenderer=null;cur.enabled_tex3D=false;cur.texTypesEnabled&=~4}break;case GL_TEXTURE_CUBE_MAP:if(cur.enabled_texCube){GLImmediate.currentRenderer=null;cur.enabled_texCube=false;cur.texTypesEnabled&=~8}break}},hook_texEnvf(target,pname,param){if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_RGB_SCALE:if(env.colorScale!=param){env.invalidateKey();env.colorScale=param}break;case GL_ALPHA_SCALE:if(env.alphaScale!=param){env.invalidateKey();env.alphaScale=param}break;default:err("WARNING: Unhandled `pname` in call to `glTexEnvf`.")}},hook_texEnvi(target,pname,param){if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_TEXTURE_ENV_MODE:if(env.mode!=param){env.invalidateKey();env.mode=param}break;case GL_COMBINE_RGB:if(env.colorCombiner!=param){env.invalidateKey();env.colorCombiner=param}break;case GL_COMBINE_ALPHA:if(env.alphaCombiner!=param){env.invalidateKey();env.alphaCombiner=param}break;case GL_SRC0_RGB:if(env.colorSrc[0]!=param){env.invalidateKey();env.colorSrc[0]=param}break;case GL_SRC1_RGB:if(env.colorSrc[1]!=param){env.invalidateKey();env.colorSrc[1]=param}break;case GL_SRC2_RGB:if(env.colorSrc[2]!=param){env.invalidateKey();env.colorSrc[2]=param}break;case GL_SRC0_ALPHA:if(env.alphaSrc[0]!=param){env.invalidateKey();env.alphaSrc[0]=param}break;case GL_SRC1_ALPHA:if(env.alphaSrc[1]!=param){env.invalidateKey();env.alphaSrc[1]=param}break;case GL_SRC2_ALPHA:if(env.alphaSrc[2]!=param){env.invalidateKey();env.alphaSrc[2]=param}break;case GL_OPERAND0_RGB:if(env.colorOp[0]!=param){env.invalidateKey();env.colorOp[0]=param}break;case GL_OPERAND1_RGB:if(env.colorOp[1]!=param){env.invalidateKey();env.colorOp[1]=param}break;case GL_OPERAND2_RGB:if(env.colorOp[2]!=param){env.invalidateKey();env.colorOp[2]=param}break;case GL_OPERAND0_ALPHA:if(env.alphaOp[0]!=param){env.invalidateKey();env.alphaOp[0]=param}break;case GL_OPERAND1_ALPHA:if(env.alphaOp[1]!=param){env.invalidateKey();env.alphaOp[1]=param}break;case GL_OPERAND2_ALPHA:if(env.alphaOp[2]!=param){env.invalidateKey();env.alphaOp[2]=param}break;case GL_RGB_SCALE:if(env.colorScale!=param){env.invalidateKey();env.colorScale=param}break;case GL_ALPHA_SCALE:if(env.alphaScale!=param){env.invalidateKey();env.alphaScale=param}break;default:err("WARNING: Unhandled `pname` in call to `glTexEnvi`.")}},hook_texEnvfv(target,pname,params){if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_TEXTURE_ENV_COLOR:{for(var i=0;i<4;i++){var param=HEAPF32[params+i*4>>2];if(env.envColor[i]!=param){env.invalidateKey();env.envColor[i]=param}}break}default:err("WARNING: Unhandled `pname` in call to `glTexEnvfv`.")}},hook_getTexEnviv(target,pname,param){if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_TEXTURE_ENV_MODE:HEAP32[param>>2]=env.mode;return;case GL_TEXTURE_ENV_COLOR:HEAP32[param>>2]=Math.max(Math.min(env.envColor[0]*255,255,-255));HEAP32[param+1>>2]=Math.max(Math.min(env.envColor[1]*255,255,-255));HEAP32[param+2>>2]=Math.max(Math.min(env.envColor[2]*255,255,-255));HEAP32[param+3>>2]=Math.max(Math.min(env.envColor[3]*255,255,-255));return;case GL_COMBINE_RGB:HEAP32[param>>2]=env.colorCombiner;return;case GL_COMBINE_ALPHA:HEAP32[param>>2]=env.alphaCombiner;return;case GL_SRC0_RGB:HEAP32[param>>2]=env.colorSrc[0];return;case GL_SRC1_RGB:HEAP32[param>>2]=env.colorSrc[1];return;case GL_SRC2_RGB:HEAP32[param>>2]=env.colorSrc[2];return;case GL_SRC0_ALPHA:HEAP32[param>>2]=env.alphaSrc[0];return;case GL_SRC1_ALPHA:HEAP32[param>>2]=env.alphaSrc[1];return;case GL_SRC2_ALPHA:HEAP32[param>>2]=env.alphaSrc[2];return;case GL_OPERAND0_RGB:HEAP32[param>>2]=env.colorOp[0];return;case GL_OPERAND1_RGB:HEAP32[param>>2]=env.colorOp[1];return;case GL_OPERAND2_RGB:HEAP32[param>>2]=env.colorOp[2];return;case GL_OPERAND0_ALPHA:HEAP32[param>>2]=env.alphaOp[0];return;case GL_OPERAND1_ALPHA:HEAP32[param>>2]=env.alphaOp[1];return;case GL_OPERAND2_ALPHA:HEAP32[param>>2]=env.alphaOp[2];return;case GL_RGB_SCALE:HEAP32[param>>2]=env.colorScale;return;case GL_ALPHA_SCALE:HEAP32[param>>2]=env.alphaScale;return;default:err("WARNING: Unhandled `pname` in call to `glGetTexEnvi`.")}},hook_getTexEnvfv:(target,pname,param)=>{if(target!=GL_TEXTURE_ENV)return;var env=getCurTexUnit().env;switch(pname){case GL_TEXTURE_ENV_COLOR:HEAPF32[param>>2]=env.envColor[0];HEAPF32[param+4>>2]=env.envColor[1];HEAPF32[param+8>>2]=env.envColor[2];HEAPF32[param+12>>2]=env.envColor[3];return}}}},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:false,useTextureMatrix:false,VERTEX:0,NORMAL:1,COLOR:2,TEXTURE0:3,NUM_ATTRIBUTES:-1,MAX_TEXTURES:-1,totalEnabledClientAttributes:0,enabledClientAttributes:[0,0],clientAttributes:[],liveClientAttributes:[],currentRenderer:null,modifiedClientAttributes:false,clientActiveTexture:0,clientColor:null,usedTexUnitList:[],fixedFunctionProgram:null,setClientAttribute(name,size,type,stride,pointer){var attrib=GLImmediate.clientAttributes[name];if(!attrib){for(var i=0;i<=name;i++){if(!GLImmediate.clientAttributes[i]){GLImmediate.clientAttributes[i]={name:name,size:size,type:type,stride:stride,pointer:pointer,offset:0}}}}else{attrib.name=name;attrib.size=size;attrib.type=type;attrib.stride=stride;attrib.pointer=pointer;attrib.offset=0}GLImmediate.modifiedClientAttributes=true},addRendererComponent(name,size,type){if(!GLImmediate.rendererComponents[name]){GLImmediate.rendererComponents[name]=1;GLImmediate.enabledClientAttributes[name]=true;GLImmediate.setClientAttribute(name,size,type,0,GLImmediate.rendererComponentPointer);GLImmediate.rendererComponentPointer+=size*GL.byteSizeByType[type-GL.byteSizeByTypeRoot]}else{GLImmediate.rendererComponents[name]++}},disableBeginEndClientAttributes(){for(var i=0;i0&&this.normalLocation>=0;this.hasColor=this.colorLocation===0||this.colorLocation>0;this.floatType=GLctx.FLOAT;this.fogColorLocation=GLctx.getUniformLocation(this.program,"u_fogColor");this.fogEndLocation=GLctx.getUniformLocation(this.program,"u_fogEnd");this.fogScaleLocation=GLctx.getUniformLocation(this.program,"u_fogScale");this.fogDensityLocation=GLctx.getUniformLocation(this.program,"u_fogDensity");this.hasFog=!!(this.fogColorLocation||this.fogEndLocation||this.fogScaleLocation||this.fogDensityLocation);this.pointSizeLocation=GLctx.getUniformLocation(this.program,"u_pointSize");this.hasClipPlane=false;this.clipPlaneEquationLocation=[];for(var clipPlaneId=0;clipPlaneId>2,end>>2))}if(canSkip)return;GLImmediate.lastRenderer=this;GLImmediate.lastProgram=GL.currProgram||this.program;GLImmediate.lastStride=GLImmediate.stride;GLImmediate.matricesModified=false;if(!GL.currProgram){if(GLImmediate.fixedFunctionProgram!=this.program){GLctx.useProgram(this.program);GLImmediate.fixedFunctionProgram=this.program}}if(this.modelViewLocation&&this.modelViewMatrixVersion!=GLImmediate.matrixVersion[0]){this.modelViewMatrixVersion=GLImmediate.matrixVersion[0];GLctx.uniformMatrix4fv(this.modelViewLocation,false,GLImmediate.matrix[0]);if(GLEmulation.lightEnabled){var tmpMVinv=GLImmediate.matrixLib.mat4.create(GLImmediate.matrix[0]);GLImmediate.matrixLib.mat4.inverse(tmpMVinv);GLImmediate.matrixLib.mat4.transpose(tmpMVinv);GLctx.uniformMatrix3fv(this.normalMatrixLocation,false,GLImmediate.matrixLib.mat4.toMat3(tmpMVinv))}}if(this.projectionLocation&&this.projectionMatrixVersion!=GLImmediate.matrixVersion[1]){this.projectionMatrixVersion=GLImmediate.matrixVersion[1];GLctx.uniformMatrix4fv(this.projectionLocation,false,GLImmediate.matrix[1])}var clientAttributes=GLImmediate.clientAttributes;var posAttr=clientAttributes[GLImmediate.VERTEX];GLctx.vertexAttribPointer(this.positionLocation,posAttr.size,posAttr.type,false,GLImmediate.stride,posAttr.offset);GLctx.enableVertexAttribArray(this.positionLocation);if(this.hasNormal){var normalAttr=clientAttributes[GLImmediate.NORMAL];GLctx.vertexAttribPointer(this.normalLocation,normalAttr.size,normalAttr.type,true,GLImmediate.stride,normalAttr.offset);GLctx.enableVertexAttribArray(this.normalLocation)}if(this.hasTextures){for(var i=0;i=0){GLctx.disableVertexAttribArray(this.texCoordLocations[i])}}}if(this.hasColor){GLctx.disableVertexAttribArray(this.colorLocation)}if(this.hasNormal){GLctx.disableVertexAttribArray(this.normalLocation)}if(!GL.currProgram){GLctx.useProgram(null);GLImmediate.fixedFunctionProgram=0}if(!GLctx.currentArrayBufferBinding){GLctx.bindBuffer(GLctx.ARRAY_BUFFER,null);GLImmediate.lastArrayBuffer=null}GLImmediate.lastRenderer=null;GLImmediate.lastProgram=null;GLImmediate.matricesModified=true};this.init()}return new Renderer},setupFuncs(){GLImmediate.MapTreeLib=GLImmediate.spawnMapTreeLib();GLImmediate.spawnMapTreeLib=null;GLImmediate.TexEnvJIT=GLImmediate.spawnTexEnvJIT();GLImmediate.spawnTexEnvJIT=null;GLImmediate.setupHooks()},setupHooks(){if(!GLEmulation.hasRunInit){GLEmulation.init()}var glActiveTexture=_glActiveTexture;_glActiveTexture=_emscripten_glActiveTexture=texture=>{GLImmediate.TexEnvJIT.hook_activeTexture(texture);glActiveTexture(texture)};var glEnable=_glEnable;_glEnable=_emscripten_glEnable=cap=>{GLImmediate.TexEnvJIT.hook_enable(cap);glEnable(cap)};var glDisable=_glDisable;_glDisable=_emscripten_glDisable=cap=>{GLImmediate.TexEnvJIT.hook_disable(cap);glDisable(cap)};_glTexEnvf=_emscripten_glTexEnvf=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_texEnvf(target,pname,param)};_glTexEnvi=_emscripten_glTexEnvi=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_texEnvi(target,pname,param)};_glTexEnvfv=_emscripten_glTexEnvfv=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_texEnvfv(target,pname,param)};_glGetTexEnviv=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_getTexEnviv(target,pname,param)};_glGetTexEnvfv=(target,pname,param)=>{GLImmediate.TexEnvJIT.hook_getTexEnvfv(target,pname,param)};var glGetIntegerv=_glGetIntegerv;_glGetIntegerv=_emscripten_glGetIntegerv=(pname,params)=>{switch(pname){case 35725:{var cur=GLctx.getParameter(GLctx.CURRENT_PROGRAM);if(cur==GLImmediate.fixedFunctionProgram){HEAP32[params>>2]=0;return}break}}glGetIntegerv(pname,params)}},initted:false,init(){err("WARNING: using emscripten GL immediate mode emulation. This is very limited in what it supports");GLImmediate.initted=true;if(!Module.useWebGL)return;GLImmediate.MAX_TEXTURES=Math.min(Module["GL_MAX_TEXTURE_IMAGE_UNITS"]||GLctx.getParameter(GLctx.MAX_TEXTURE_IMAGE_UNITS),28);GLImmediate.TexEnvJIT.init(GLctx,GLImmediate.MAX_TEXTURES);GLImmediate.NUM_ATTRIBUTES=3+GLImmediate.MAX_TEXTURES;GLImmediate.clientAttributes=[];GLEmulation.enabledClientAttribIndices=[];for(var i=0;i>2);GLImmediate.indexData=new Uint16Array(GL.MAX_TEMP_BUFFER_SIZE>>1);GLImmediate.vertexDataU8=new Uint8Array(GLImmediate.tempData.buffer);GL.generateTempBuffers(true,GL.currentContext);GLImmediate.clientColor=new Float32Array([1,1,1,1])},prepareClientAttributes(count,beginEnd){if(!GLImmediate.modifiedClientAttributes){GLImmediate.vertexCounter=GLImmediate.stride*count/4;return}GLImmediate.modifiedClientAttributes=false;var clientStartPointer=2147483647;var bytes=0;var minStride=2147483647;var maxStride=0;var attributes=GLImmediate.liveClientAttributes;attributes.length=0;for(var i=0;i<3+GLImmediate.MAX_TEXTURES;i++){if(GLImmediate.enabledClientAttributes[i]){var attr=GLImmediate.clientAttributes[i];attributes.push(attr);clientStartPointer=Math.min(clientStartPointer,attr.pointer);attr.sizeBytes=attr.size*GL.byteSizeByType[attr.type-GL.byteSizeByTypeRoot];bytes+=attr.sizeBytes;minStride=Math.min(minStride,attr.stride);maxStride=Math.max(maxStride,attr.stride)}}if((minStride!=maxStride||maxStride>2;var srcStride4=Math.max(attr.sizeBytes,attr.stride)>>2;for(var j=0;j>2)+k]=HEAP32[(attr.pointer>>2)+j*srcStride4+k]}}}else{for(var j=0;jGLImmediate.lastVertex){for(var i=0;i>1];GLImmediate.firstVertex=Math.min(GLImmediate.firstVertex,currIndex);GLImmediate.lastVertex=Math.max(GLImmediate.lastVertex,currIndex+1)}}if(!GLctx.currentElementArrayBufferBinding){var indexBuffer=GL.getTempIndexBuffer(numProvidedIndexes<<1);GLctx.bindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,indexBuffer);GLctx.bufferSubData(GLctx.ELEMENT_ARRAY_BUFFER,0,HEAPU16.subarray(ptr>>1,ptr+(numProvidedIndexes<<1)>>1));ptr=0;emulatedElementArrayBuffer=true}}else if(GLImmediate.mode>6){if(GLImmediate.mode!=7)throw"unsupported immediate mode "+GLImmediate.mode;ptr=GLImmediate.firstVertex*3;var numQuads=numVertexes/4;numIndexes=numQuads*6;GLctx.bindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,GL.currentContext.tempQuadIndexBuffer);emulatedElementArrayBuffer=true;GLImmediate.mode=GLctx.TRIANGLES}renderer.prepare();if(numIndexes){GLctx.drawElements(GLImmediate.mode,numIndexes,GLctx.UNSIGNED_SHORT,ptr)}else{GLctx.drawArrays(GLImmediate.mode,startIndex,numVertexes)}if(emulatedElementArrayBuffer){GLctx.bindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,GL.buffers[GLctx.currentElementArrayBufferBinding]||null)}}};GLImmediate.matrixLib=function(){var vec3={};var mat3={};var mat4={};var quat4={};var MatrixArray=Float32Array;vec3.create=function(vec){var dest=new MatrixArray(3);if(vec){dest[0]=vec[0];dest[1]=vec[1];dest[2]=vec[2]}else{dest[0]=dest[1]=dest[2]=0}return dest};vec3.set=function(vec,dest){dest[0]=vec[0];dest[1]=vec[1];dest[2]=vec[2];return dest};vec3.add=function(vec,vec2,dest){if(!dest||vec===dest){vec[0]+=vec2[0];vec[1]+=vec2[1];vec[2]+=vec2[2];return vec}dest[0]=vec[0]+vec2[0];dest[1]=vec[1]+vec2[1];dest[2]=vec[2]+vec2[2];return dest};vec3.subtract=function(vec,vec2,dest){if(!dest||vec===dest){vec[0]-=vec2[0];vec[1]-=vec2[1];vec[2]-=vec2[2];return vec}dest[0]=vec[0]-vec2[0];dest[1]=vec[1]-vec2[1];dest[2]=vec[2]-vec2[2];return dest};vec3.multiply=function(vec,vec2,dest){if(!dest||vec===dest){vec[0]*=vec2[0];vec[1]*=vec2[1];vec[2]*=vec2[2];return vec}dest[0]=vec[0]*vec2[0];dest[1]=vec[1]*vec2[1];dest[2]=vec[2]*vec2[2];return dest};vec3.negate=function(vec,dest){if(!dest){dest=vec}dest[0]=-vec[0];dest[1]=-vec[1];dest[2]=-vec[2];return dest};vec3.scale=function(vec,val,dest){if(!dest||vec===dest){vec[0]*=val;vec[1]*=val;vec[2]*=val;return vec}dest[0]=vec[0]*val;dest[1]=vec[1]*val;dest[2]=vec[2]*val;return dest};vec3.normalize=function(vec,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2],len=Math.sqrt(x*x+y*y+z*z);if(!len){dest[0]=0;dest[1]=0;dest[2]=0;return dest}else if(len===1){dest[0]=x;dest[1]=y;dest[2]=z;return dest}len=1/len;dest[0]=x*len;dest[1]=y*len;dest[2]=z*len;return dest};vec3.cross=function(vec,vec2,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2],x2=vec2[0],y2=vec2[1],z2=vec2[2];dest[0]=y*z2-z*y2;dest[1]=z*x2-x*z2;dest[2]=x*y2-y*x2;return dest};vec3.length=function(vec){var x=vec[0],y=vec[1],z=vec[2];return Math.sqrt(x*x+y*y+z*z)};vec3.dot=function(vec,vec2){return vec[0]*vec2[0]+vec[1]*vec2[1]+vec[2]*vec2[2]};vec3.direction=function(vec,vec2,dest){if(!dest){dest=vec}var x=vec[0]-vec2[0],y=vec[1]-vec2[1],z=vec[2]-vec2[2],len=Math.sqrt(x*x+y*y+z*z);if(!len){dest[0]=0;dest[1]=0;dest[2]=0;return dest}len=1/len;dest[0]=x*len;dest[1]=y*len;dest[2]=z*len;return dest};vec3.lerp=function(vec,vec2,lerp,dest){if(!dest){dest=vec}dest[0]=vec[0]+lerp*(vec2[0]-vec[0]);dest[1]=vec[1]+lerp*(vec2[1]-vec[1]);dest[2]=vec[2]+lerp*(vec2[2]-vec[2]);return dest};vec3.dist=function(vec,vec2){var x=vec2[0]-vec[0],y=vec2[1]-vec[1],z=vec2[2]-vec[2];return Math.sqrt(x*x+y*y+z*z)};vec3.unproject=function(vec,view,proj,viewport,dest){if(!dest){dest=vec}var m=mat4.create();var v=new MatrixArray(4);v[0]=(vec[0]-viewport[0])*2/viewport[2]-1;v[1]=(vec[1]-viewport[1])*2/viewport[3]-1;v[2]=2*vec[2]-1;v[3]=1;mat4.multiply(proj,view,m);if(!mat4.inverse(m)){return null}mat4.multiplyVec4(m,v);if(v[3]===0){return null}dest[0]=v[0]/v[3];dest[1]=v[1]/v[3];dest[2]=v[2]/v[3];return dest};vec3.str=function(vec){return"["+vec[0]+", "+vec[1]+", "+vec[2]+"]"};mat3.create=function(mat){var dest=new MatrixArray(9);if(mat){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8]}return dest};mat3.set=function(mat,dest){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8];return dest};mat3.identity=function(dest){if(!dest){dest=mat3.create()}dest[0]=1;dest[1]=0;dest[2]=0;dest[3]=0;dest[4]=1;dest[5]=0;dest[6]=0;dest[7]=0;dest[8]=1;return dest};mat3.transpose=function(mat,dest){if(!dest||mat===dest){var a01=mat[1],a02=mat[2],a12=mat[5];mat[1]=mat[3];mat[2]=mat[6];mat[3]=a01;mat[5]=mat[7];mat[6]=a02;mat[7]=a12;return mat}dest[0]=mat[0];dest[1]=mat[3];dest[2]=mat[6];dest[3]=mat[1];dest[4]=mat[4];dest[5]=mat[7];dest[6]=mat[2];dest[7]=mat[5];dest[8]=mat[8];return dest};mat3.toMat4=function(mat,dest){if(!dest){dest=mat4.create()}dest[15]=1;dest[14]=0;dest[13]=0;dest[12]=0;dest[11]=0;dest[10]=mat[8];dest[9]=mat[7];dest[8]=mat[6];dest[7]=0;dest[6]=mat[5];dest[5]=mat[4];dest[4]=mat[3];dest[3]=0;dest[2]=mat[2];dest[1]=mat[1];dest[0]=mat[0];return dest};mat3.str=function(mat){return"["+mat[0]+", "+mat[1]+", "+mat[2]+", "+mat[3]+", "+mat[4]+", "+mat[5]+", "+mat[6]+", "+mat[7]+", "+mat[8]+"]"};mat4.create=function(mat){var dest=new MatrixArray(16);if(mat){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8];dest[9]=mat[9];dest[10]=mat[10];dest[11]=mat[11];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}return dest};mat4.set=function(mat,dest){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8];dest[9]=mat[9];dest[10]=mat[10];dest[11]=mat[11];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15];return dest};mat4.identity=function(dest){if(!dest){dest=mat4.create()}dest[0]=1;dest[1]=0;dest[2]=0;dest[3]=0;dest[4]=0;dest[5]=1;dest[6]=0;dest[7]=0;dest[8]=0;dest[9]=0;dest[10]=1;dest[11]=0;dest[12]=0;dest[13]=0;dest[14]=0;dest[15]=1;return dest};mat4.transpose=function(mat,dest){if(!dest||mat===dest){var a01=mat[1],a02=mat[2],a03=mat[3],a12=mat[6],a13=mat[7],a23=mat[11];mat[1]=mat[4];mat[2]=mat[8];mat[3]=mat[12];mat[4]=a01;mat[6]=mat[9];mat[7]=mat[13];mat[8]=a02;mat[9]=a12;mat[11]=mat[14];mat[12]=a03;mat[13]=a13;mat[14]=a23;return mat}dest[0]=mat[0];dest[1]=mat[4];dest[2]=mat[8];dest[3]=mat[12];dest[4]=mat[1];dest[5]=mat[5];dest[6]=mat[9];dest[7]=mat[13];dest[8]=mat[2];dest[9]=mat[6];dest[10]=mat[10];dest[11]=mat[14];dest[12]=mat[3];dest[13]=mat[7];dest[14]=mat[11];dest[15]=mat[15];return dest};mat4.determinant=function(mat){var a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11],a30=mat[12],a31=mat[13],a32=mat[14],a33=mat[15];return a30*a21*a12*a03-a20*a31*a12*a03-a30*a11*a22*a03+a10*a31*a22*a03+a20*a11*a32*a03-a10*a21*a32*a03-a30*a21*a02*a13+a20*a31*a02*a13+a30*a01*a22*a13-a00*a31*a22*a13-a20*a01*a32*a13+a00*a21*a32*a13+a30*a11*a02*a23-a10*a31*a02*a23-a30*a01*a12*a23+a00*a31*a12*a23+a10*a01*a32*a23-a00*a11*a32*a23-a20*a11*a02*a33+a10*a21*a02*a33+a20*a01*a12*a33-a00*a21*a12*a33-a10*a01*a22*a33+a00*a11*a22*a33};mat4.inverse=function(mat,dest){if(!dest){dest=mat}var a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11],a30=mat[12],a31=mat[13],a32=mat[14],a33=mat[15],b00=a00*a11-a01*a10,b01=a00*a12-a02*a10,b02=a00*a13-a03*a10,b03=a01*a12-a02*a11,b04=a01*a13-a03*a11,b05=a02*a13-a03*a12,b06=a20*a31-a21*a30,b07=a20*a32-a22*a30,b08=a20*a33-a23*a30,b09=a21*a32-a22*a31,b10=a21*a33-a23*a31,b11=a22*a33-a23*a32,d=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06,invDet;if(!d){return null}invDet=1/d;dest[0]=(a11*b11-a12*b10+a13*b09)*invDet;dest[1]=(-a01*b11+a02*b10-a03*b09)*invDet;dest[2]=(a31*b05-a32*b04+a33*b03)*invDet;dest[3]=(-a21*b05+a22*b04-a23*b03)*invDet;dest[4]=(-a10*b11+a12*b08-a13*b07)*invDet;dest[5]=(a00*b11-a02*b08+a03*b07)*invDet;dest[6]=(-a30*b05+a32*b02-a33*b01)*invDet;dest[7]=(a20*b05-a22*b02+a23*b01)*invDet;dest[8]=(a10*b10-a11*b08+a13*b06)*invDet;dest[9]=(-a00*b10+a01*b08-a03*b06)*invDet;dest[10]=(a30*b04-a31*b02+a33*b00)*invDet;dest[11]=(-a20*b04+a21*b02-a23*b00)*invDet;dest[12]=(-a10*b09+a11*b07-a12*b06)*invDet;dest[13]=(a00*b09-a01*b07+a02*b06)*invDet;dest[14]=(-a30*b03+a31*b01-a32*b00)*invDet;dest[15]=(a20*b03-a21*b01+a22*b00)*invDet;return dest};mat4.toRotationMat=function(mat,dest){if(!dest){dest=mat4.create()}dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[8]=mat[8];dest[9]=mat[9];dest[10]=mat[10];dest[11]=mat[11];dest[12]=0;dest[13]=0;dest[14]=0;dest[15]=1;return dest};mat4.toMat3=function(mat,dest){if(!dest){dest=mat3.create()}dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[4];dest[4]=mat[5];dest[5]=mat[6];dest[6]=mat[8];dest[7]=mat[9];dest[8]=mat[10];return dest};mat4.toInverseMat3=function(mat,dest){var a00=mat[0],a01=mat[1],a02=mat[2],a10=mat[4],a11=mat[5],a12=mat[6],a20=mat[8],a21=mat[9],a22=mat[10],b01=a22*a11-a12*a21,b11=-a22*a10+a12*a20,b21=a21*a10-a11*a20,d=a00*b01+a01*b11+a02*b21,id;if(!d){return null}id=1/d;if(!dest){dest=mat3.create()}dest[0]=b01*id;dest[1]=(-a22*a01+a02*a21)*id;dest[2]=(a12*a01-a02*a11)*id;dest[3]=b11*id;dest[4]=(a22*a00-a02*a20)*id;dest[5]=(-a12*a00+a02*a10)*id;dest[6]=b21*id;dest[7]=(-a21*a00+a01*a20)*id;dest[8]=(a11*a00-a01*a10)*id;return dest};mat4.multiply=function(mat,mat2,dest){if(!dest){dest=mat}var a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11],a30=mat[12],a31=mat[13],a32=mat[14],a33=mat[15],b00=mat2[0],b01=mat2[1],b02=mat2[2],b03=mat2[3],b10=mat2[4],b11=mat2[5],b12=mat2[6],b13=mat2[7],b20=mat2[8],b21=mat2[9],b22=mat2[10],b23=mat2[11],b30=mat2[12],b31=mat2[13],b32=mat2[14],b33=mat2[15];dest[0]=b00*a00+b01*a10+b02*a20+b03*a30;dest[1]=b00*a01+b01*a11+b02*a21+b03*a31;dest[2]=b00*a02+b01*a12+b02*a22+b03*a32;dest[3]=b00*a03+b01*a13+b02*a23+b03*a33;dest[4]=b10*a00+b11*a10+b12*a20+b13*a30;dest[5]=b10*a01+b11*a11+b12*a21+b13*a31;dest[6]=b10*a02+b11*a12+b12*a22+b13*a32;dest[7]=b10*a03+b11*a13+b12*a23+b13*a33;dest[8]=b20*a00+b21*a10+b22*a20+b23*a30;dest[9]=b20*a01+b21*a11+b22*a21+b23*a31;dest[10]=b20*a02+b21*a12+b22*a22+b23*a32;dest[11]=b20*a03+b21*a13+b22*a23+b23*a33;dest[12]=b30*a00+b31*a10+b32*a20+b33*a30;dest[13]=b30*a01+b31*a11+b32*a21+b33*a31;dest[14]=b30*a02+b31*a12+b32*a22+b33*a32;dest[15]=b30*a03+b31*a13+b32*a23+b33*a33;return dest};mat4.multiplyVec3=function(mat,vec,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2];dest[0]=mat[0]*x+mat[4]*y+mat[8]*z+mat[12];dest[1]=mat[1]*x+mat[5]*y+mat[9]*z+mat[13];dest[2]=mat[2]*x+mat[6]*y+mat[10]*z+mat[14];return dest};mat4.multiplyVec4=function(mat,vec,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2],w=vec[3];dest[0]=mat[0]*x+mat[4]*y+mat[8]*z+mat[12]*w;dest[1]=mat[1]*x+mat[5]*y+mat[9]*z+mat[13]*w;dest[2]=mat[2]*x+mat[6]*y+mat[10]*z+mat[14]*w;dest[3]=mat[3]*x+mat[7]*y+mat[11]*z+mat[15]*w;return dest};mat4.translate=function(mat,vec,dest){var x=vec[0],y=vec[1],z=vec[2],a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23;if(!dest||mat===dest){mat[12]=mat[0]*x+mat[4]*y+mat[8]*z+mat[12];mat[13]=mat[1]*x+mat[5]*y+mat[9]*z+mat[13];mat[14]=mat[2]*x+mat[6]*y+mat[10]*z+mat[14];mat[15]=mat[3]*x+mat[7]*y+mat[11]*z+mat[15];return mat}a00=mat[0];a01=mat[1];a02=mat[2];a03=mat[3];a10=mat[4];a11=mat[5];a12=mat[6];a13=mat[7];a20=mat[8];a21=mat[9];a22=mat[10];a23=mat[11];dest[0]=a00;dest[1]=a01;dest[2]=a02;dest[3]=a03;dest[4]=a10;dest[5]=a11;dest[6]=a12;dest[7]=a13;dest[8]=a20;dest[9]=a21;dest[10]=a22;dest[11]=a23;dest[12]=a00*x+a10*y+a20*z+mat[12];dest[13]=a01*x+a11*y+a21*z+mat[13];dest[14]=a02*x+a12*y+a22*z+mat[14];dest[15]=a03*x+a13*y+a23*z+mat[15];return dest};mat4.scale=function(mat,vec,dest){var x=vec[0],y=vec[1],z=vec[2];if(!dest||mat===dest){mat[0]*=x;mat[1]*=x;mat[2]*=x;mat[3]*=x;mat[4]*=y;mat[5]*=y;mat[6]*=y;mat[7]*=y;mat[8]*=z;mat[9]*=z;mat[10]*=z;mat[11]*=z;return mat}dest[0]=mat[0]*x;dest[1]=mat[1]*x;dest[2]=mat[2]*x;dest[3]=mat[3]*x;dest[4]=mat[4]*y;dest[5]=mat[5]*y;dest[6]=mat[6]*y;dest[7]=mat[7]*y;dest[8]=mat[8]*z;dest[9]=mat[9]*z;dest[10]=mat[10]*z;dest[11]=mat[11]*z;dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15];return dest};mat4.rotate=function(mat,angle,axis,dest){var x=axis[0],y=axis[1],z=axis[2],len=Math.sqrt(x*x+y*y+z*z),s,c,t,a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,b00,b01,b02,b10,b11,b12,b20,b21,b22;if(!len){return null}if(len!==1){len=1/len;x*=len;y*=len;z*=len}s=Math.sin(angle);c=Math.cos(angle);t=1-c;a00=mat[0];a01=mat[1];a02=mat[2];a03=mat[3];a10=mat[4];a11=mat[5];a12=mat[6];a13=mat[7];a20=mat[8];a21=mat[9];a22=mat[10];a23=mat[11];b00=x*x*t+c;b01=y*x*t+z*s;b02=z*x*t-y*s;b10=x*y*t-z*s;b11=y*y*t+c;b12=z*y*t+x*s;b20=x*z*t+y*s;b21=y*z*t-x*s;b22=z*z*t+c;if(!dest){dest=mat}else if(mat!==dest){dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}dest[0]=a00*b00+a10*b01+a20*b02;dest[1]=a01*b00+a11*b01+a21*b02;dest[2]=a02*b00+a12*b01+a22*b02;dest[3]=a03*b00+a13*b01+a23*b02;dest[4]=a00*b10+a10*b11+a20*b12;dest[5]=a01*b10+a11*b11+a21*b12;dest[6]=a02*b10+a12*b11+a22*b12;dest[7]=a03*b10+a13*b11+a23*b12;dest[8]=a00*b20+a10*b21+a20*b22;dest[9]=a01*b20+a11*b21+a21*b22;dest[10]=a02*b20+a12*b21+a22*b22;dest[11]=a03*b20+a13*b21+a23*b22;return dest};mat4.rotateX=function(mat,angle,dest){var s=Math.sin(angle),c=Math.cos(angle),a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11];if(!dest){dest=mat}else if(mat!==dest){dest[0]=mat[0];dest[1]=mat[1];dest[2]=mat[2];dest[3]=mat[3];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}dest[4]=a10*c+a20*s;dest[5]=a11*c+a21*s;dest[6]=a12*c+a22*s;dest[7]=a13*c+a23*s;dest[8]=a10*-s+a20*c;dest[9]=a11*-s+a21*c;dest[10]=a12*-s+a22*c;dest[11]=a13*-s+a23*c;return dest};mat4.rotateY=function(mat,angle,dest){var s=Math.sin(angle),c=Math.cos(angle),a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a20=mat[8],a21=mat[9],a22=mat[10],a23=mat[11];if(!dest){dest=mat}else if(mat!==dest){dest[4]=mat[4];dest[5]=mat[5];dest[6]=mat[6];dest[7]=mat[7];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}dest[0]=a00*c+a20*-s;dest[1]=a01*c+a21*-s;dest[2]=a02*c+a22*-s;dest[3]=a03*c+a23*-s;dest[8]=a00*s+a20*c;dest[9]=a01*s+a21*c;dest[10]=a02*s+a22*c;dest[11]=a03*s+a23*c;return dest};mat4.rotateZ=function(mat,angle,dest){var s=Math.sin(angle),c=Math.cos(angle),a00=mat[0],a01=mat[1],a02=mat[2],a03=mat[3],a10=mat[4],a11=mat[5],a12=mat[6],a13=mat[7];if(!dest){dest=mat}else if(mat!==dest){dest[8]=mat[8];dest[9]=mat[9];dest[10]=mat[10];dest[11]=mat[11];dest[12]=mat[12];dest[13]=mat[13];dest[14]=mat[14];dest[15]=mat[15]}dest[0]=a00*c+a10*s;dest[1]=a01*c+a11*s;dest[2]=a02*c+a12*s;dest[3]=a03*c+a13*s;dest[4]=a00*-s+a10*c;dest[5]=a01*-s+a11*c;dest[6]=a02*-s+a12*c;dest[7]=a03*-s+a13*c;return dest};mat4.frustum=function(left,right,bottom,top,near,far,dest){if(!dest){dest=mat4.create()}var rl=right-left,tb=top-bottom,fn=far-near;dest[0]=near*2/rl;dest[1]=0;dest[2]=0;dest[3]=0;dest[4]=0;dest[5]=near*2/tb;dest[6]=0;dest[7]=0;dest[8]=(right+left)/rl;dest[9]=(top+bottom)/tb;dest[10]=-(far+near)/fn;dest[11]=-1;dest[12]=0;dest[13]=0;dest[14]=-(far*near*2)/fn;dest[15]=0;return dest};mat4.perspective=function(fovy,aspect,near,far,dest){var top=near*Math.tan(fovy*Math.PI/360),right=top*aspect;return mat4.frustum(-right,right,-top,top,near,far,dest)};mat4.ortho=function(left,right,bottom,top,near,far,dest){if(!dest){dest=mat4.create()}var rl=right-left,tb=top-bottom,fn=far-near;dest[0]=2/rl;dest[1]=0;dest[2]=0;dest[3]=0;dest[4]=0;dest[5]=2/tb;dest[6]=0;dest[7]=0;dest[8]=0;dest[9]=0;dest[10]=-2/fn;dest[11]=0;dest[12]=-(left+right)/rl;dest[13]=-(top+bottom)/tb;dest[14]=-(far+near)/fn;dest[15]=1;return dest};mat4.lookAt=function(eye,center,up,dest){if(!dest){dest=mat4.create()}var x0,x1,x2,y0,y1,y2,z0,z1,z2,len,eyex=eye[0],eyey=eye[1],eyez=eye[2],upx=up[0],upy=up[1],upz=up[2],centerx=center[0],centery=center[1],centerz=center[2];if(eyex===centerx&&eyey===centery&&eyez===centerz){return mat4.identity(dest)}z0=eyex-centerx;z1=eyey-centery;z2=eyez-centerz;len=1/Math.sqrt(z0*z0+z1*z1+z2*z2);z0*=len;z1*=len;z2*=len;x0=upy*z2-upz*z1;x1=upz*z0-upx*z2;x2=upx*z1-upy*z0;len=Math.sqrt(x0*x0+x1*x1+x2*x2);if(!len){x0=0;x1=0;x2=0}else{len=1/len;x0*=len;x1*=len;x2*=len}y0=z1*x2-z2*x1;y1=z2*x0-z0*x2;y2=z0*x1-z1*x0;len=Math.sqrt(y0*y0+y1*y1+y2*y2);if(!len){y0=0;y1=0;y2=0}else{len=1/len;y0*=len;y1*=len;y2*=len}dest[0]=x0;dest[1]=y0;dest[2]=z0;dest[3]=0;dest[4]=x1;dest[5]=y1;dest[6]=z1;dest[7]=0;dest[8]=x2;dest[9]=y2;dest[10]=z2;dest[11]=0;dest[12]=-(x0*eyex+x1*eyey+x2*eyez);dest[13]=-(y0*eyex+y1*eyey+y2*eyez);dest[14]=-(z0*eyex+z1*eyey+z2*eyez);dest[15]=1;return dest};mat4.fromRotationTranslation=function(quat,vec,dest){if(!dest){dest=mat4.create()}var x=quat[0],y=quat[1],z=quat[2],w=quat[3],x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2;dest[0]=1-(yy+zz);dest[1]=xy+wz;dest[2]=xz-wy;dest[3]=0;dest[4]=xy-wz;dest[5]=1-(xx+zz);dest[6]=yz+wx;dest[7]=0;dest[8]=xz+wy;dest[9]=yz-wx;dest[10]=1-(xx+yy);dest[11]=0;dest[12]=vec[0];dest[13]=vec[1];dest[14]=vec[2];dest[15]=1;return dest};mat4.str=function(mat){return"["+mat[0]+", "+mat[1]+", "+mat[2]+", "+mat[3]+", "+mat[4]+", "+mat[5]+", "+mat[6]+", "+mat[7]+", "+mat[8]+", "+mat[9]+", "+mat[10]+", "+mat[11]+", "+mat[12]+", "+mat[13]+", "+mat[14]+", "+mat[15]+"]"};quat4.create=function(quat){var dest=new MatrixArray(4);if(quat){dest[0]=quat[0];dest[1]=quat[1];dest[2]=quat[2];dest[3]=quat[3]}return dest};quat4.set=function(quat,dest){dest[0]=quat[0];dest[1]=quat[1];dest[2]=quat[2];dest[3]=quat[3];return dest};quat4.calculateW=function(quat,dest){var x=quat[0],y=quat[1],z=quat[2];if(!dest||quat===dest){quat[3]=-Math.sqrt(Math.abs(1-x*x-y*y-z*z));return quat}dest[0]=x;dest[1]=y;dest[2]=z;dest[3]=-Math.sqrt(Math.abs(1-x*x-y*y-z*z));return dest};quat4.dot=function(quat,quat2){return quat[0]*quat2[0]+quat[1]*quat2[1]+quat[2]*quat2[2]+quat[3]*quat2[3]};quat4.inverse=function(quat,dest){var q0=quat[0],q1=quat[1],q2=quat[2],q3=quat[3],dot=q0*q0+q1*q1+q2*q2+q3*q3,invDot=dot?1/dot:0;if(!dest||quat===dest){quat[0]*=-invDot;quat[1]*=-invDot;quat[2]*=-invDot;quat[3]*=invDot;return quat}dest[0]=-quat[0]*invDot;dest[1]=-quat[1]*invDot;dest[2]=-quat[2]*invDot;dest[3]=quat[3]*invDot;return dest};quat4.conjugate=function(quat,dest){if(!dest||quat===dest){quat[0]*=-1;quat[1]*=-1;quat[2]*=-1;return quat}dest[0]=-quat[0];dest[1]=-quat[1];dest[2]=-quat[2];dest[3]=quat[3];return dest};quat4.length=function(quat){var x=quat[0],y=quat[1],z=quat[2],w=quat[3];return Math.sqrt(x*x+y*y+z*z+w*w)};quat4.normalize=function(quat,dest){if(!dest){dest=quat}var x=quat[0],y=quat[1],z=quat[2],w=quat[3],len=Math.sqrt(x*x+y*y+z*z+w*w);if(len===0){dest[0]=0;dest[1]=0;dest[2]=0;dest[3]=0;return dest}len=1/len;dest[0]=x*len;dest[1]=y*len;dest[2]=z*len;dest[3]=w*len;return dest};quat4.add=function(quat,quat2,dest){if(!dest||quat===dest){quat[0]+=quat2[0];quat[1]+=quat2[1];quat[2]+=quat2[2];quat[3]+=quat2[3];return quat}dest[0]=quat[0]+quat2[0];dest[1]=quat[1]+quat2[1];dest[2]=quat[2]+quat2[2];dest[3]=quat[3]+quat2[3];return dest};quat4.multiply=function(quat,quat2,dest){if(!dest){dest=quat}var qax=quat[0],qay=quat[1],qaz=quat[2],qaw=quat[3],qbx=quat2[0],qby=quat2[1],qbz=quat2[2],qbw=quat2[3];dest[0]=qax*qbw+qaw*qbx+qay*qbz-qaz*qby;dest[1]=qay*qbw+qaw*qby+qaz*qbx-qax*qbz;dest[2]=qaz*qbw+qaw*qbz+qax*qby-qay*qbx;dest[3]=qaw*qbw-qax*qbx-qay*qby-qaz*qbz;return dest};quat4.multiplyVec3=function(quat,vec,dest){if(!dest){dest=vec}var x=vec[0],y=vec[1],z=vec[2],qx=quat[0],qy=quat[1],qz=quat[2],qw=quat[3],ix=qw*x+qy*z-qz*y,iy=qw*y+qz*x-qx*z,iz=qw*z+qx*y-qy*x,iw=-qx*x-qy*y-qz*z;dest[0]=ix*qw+iw*-qx+iy*-qz-iz*-qy;dest[1]=iy*qw+iw*-qy+iz*-qx-ix*-qz;dest[2]=iz*qw+iw*-qz+ix*-qy-iy*-qx;return dest};quat4.scale=function(quat,val,dest){if(!dest||quat===dest){quat[0]*=val;quat[1]*=val;quat[2]*=val;quat[3]*=val;return quat}dest[0]=quat[0]*val;dest[1]=quat[1]*val;dest[2]=quat[2]*val;dest[3]=quat[3]*val;return dest};quat4.toMat3=function(quat,dest){if(!dest){dest=mat3.create()}var x=quat[0],y=quat[1],z=quat[2],w=quat[3],x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2;dest[0]=1-(yy+zz);dest[1]=xy+wz;dest[2]=xz-wy;dest[3]=xy-wz;dest[4]=1-(xx+zz);dest[5]=yz+wx;dest[6]=xz+wy;dest[7]=yz-wx;dest[8]=1-(xx+yy);return dest};quat4.toMat4=function(quat,dest){if(!dest){dest=mat4.create()}var x=quat[0],y=quat[1],z=quat[2],w=quat[3],x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2;dest[0]=1-(yy+zz);dest[1]=xy+wz;dest[2]=xz-wy;dest[3]=0;dest[4]=xy-wz;dest[5]=1-(xx+zz);dest[6]=yz+wx;dest[7]=0;dest[8]=xz+wy;dest[9]=yz-wx;dest[10]=1-(xx+yy);dest[11]=0;dest[12]=0;dest[13]=0;dest[14]=0;dest[15]=1;return dest};quat4.slerp=function(quat,quat2,slerp,dest){if(!dest){dest=quat}var cosHalfTheta=quat[0]*quat2[0]+quat[1]*quat2[1]+quat[2]*quat2[2]+quat[3]*quat2[3],halfTheta,sinHalfTheta,ratioA,ratioB;if(Math.abs(cosHalfTheta)>=1){if(dest!==quat){dest[0]=quat[0];dest[1]=quat[1];dest[2]=quat[2];dest[3]=quat[3]}return dest}halfTheta=Math.acos(cosHalfTheta);sinHalfTheta=Math.sqrt(1-cosHalfTheta*cosHalfTheta);if(Math.abs(sinHalfTheta)<.001){dest[0]=quat[0]*.5+quat2[0]*.5;dest[1]=quat[1]*.5+quat2[1]*.5;dest[2]=quat[2]*.5+quat2[2]*.5;dest[3]=quat[3]*.5+quat2[3]*.5;return dest}ratioA=Math.sin((1-slerp)*halfTheta)/sinHalfTheta;ratioB=Math.sin(slerp*halfTheta)/sinHalfTheta;dest[0]=quat[0]*ratioA+quat2[0]*ratioB;dest[1]=quat[1]*ratioA+quat2[1]*ratioB;dest[2]=quat[2]*ratioA+quat2[2]*ratioB;dest[3]=quat[3]*ratioA+quat2[3]*ratioB;return dest};quat4.str=function(quat){return"["+quat[0]+", "+quat[1]+", "+quat[2]+", "+quat[3]+"]"};return{vec3:vec3,mat3:mat3,mat4:mat4,quat4:quat4}}();var _glBegin=mode=>{GLImmediate.enabledClientAttributes_preBegin=GLImmediate.enabledClientAttributes;GLImmediate.enabledClientAttributes=[];GLImmediate.clientAttributes_preBegin=GLImmediate.clientAttributes;GLImmediate.clientAttributes=[];for(var i=0;i{GLctx.disjointTimerQueryExt["beginQueryEXT"](target,GL.queries[id])};var _emscripten_glBeginQueryEXT=_glBeginQueryEXT;var _emscripten_glBindAttribLocation=_glBindAttribLocation;var _emscripten_glBindBuffer=_glBindBuffer;var _glBindFramebuffer=(target,framebuffer)=>{GLctx.bindFramebuffer(target,GL.framebuffers[framebuffer])};var _emscripten_glBindFramebuffer=_glBindFramebuffer;var _glBindProgram=(type,id)=>{};var _emscripten_glBindProgram=_glBindProgram;var _glBindRenderbuffer=(target,renderbuffer)=>{GLctx.bindRenderbuffer(target,GL.renderbuffers[renderbuffer])};var _emscripten_glBindRenderbuffer=_glBindRenderbuffer;var _glBindTexture=(target,texture)=>{GLctx.bindTexture(target,GL.textures[texture])};var _emscripten_glBindTexture=_glBindTexture;var _glEnableClientState=cap=>{var attrib=GLEmulation.getAttributeFromCapability(cap);if(attrib===null){return}if(!GLImmediate.enabledClientAttributes[attrib]){GLImmediate.enabledClientAttributes[attrib]=true;GLImmediate.totalEnabledClientAttributes++;GLImmediate.currentRenderer=null;if(GLEmulation.currentVao)GLEmulation.currentVao.enabledClientStates[cap]=1;GLImmediate.modifiedClientAttributes=true}};var emulGlBindVertexArray=vao=>{GLEmulation.currentVao=null;if(GLImmediate.lastRenderer)GLImmediate.lastRenderer.cleanup();_glBindBuffer(GLctx.ARRAY_BUFFER,0);_glBindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,0);for(var vaa in GLEmulation.enabledVertexAttribArrays){GLctx.disableVertexAttribArray(vaa)}GLEmulation.enabledVertexAttribArrays={};GLImmediate.enabledClientAttributes=[0,0];GLImmediate.totalEnabledClientAttributes=0;GLImmediate.modifiedClientAttributes=true;if(vao){var info=GLEmulation.vaos[vao];_glBindBuffer(GLctx.ARRAY_BUFFER,info.arrayBuffer);_glBindBuffer(GLctx.ELEMENT_ARRAY_BUFFER,info.elementArrayBuffer);for(var vaa in info.enabledVertexAttribArrays){_glEnableVertexAttribArray(vaa)}for(var vaa in info.vertexAttribPointers){_glVertexAttribPointer.apply(null,info.vertexAttribPointers[vaa])}for(var attrib in info.enabledClientStates){_glEnableClientState(attrib|0)}GLEmulation.currentVao=info}};var _glBindVertexArray=vao=>{emulGlBindVertexArray(vao);var ibo=GLctx.getParameter(34965);GLctx.currentElementArrayBufferBinding=ibo?ibo.name|0:0};var _glBindVertexArrayOES=_glBindVertexArray;var _emscripten_glBindVertexArrayOES=_glBindVertexArrayOES;function _glBlendColor(x0,x1,x2,x3){GLctx.blendColor(x0,x1,x2,x3)}var _emscripten_glBlendColor=_glBlendColor;function _glBlendEquation(x0){GLctx.blendEquation(x0)}var _emscripten_glBlendEquation=_glBlendEquation;function _glBlendEquationSeparate(x0,x1){GLctx.blendEquationSeparate(x0,x1)}var _emscripten_glBlendEquationSeparate=_glBlendEquationSeparate;function _glBlendFunc(x0,x1){GLctx.blendFunc(x0,x1)}var _emscripten_glBlendFunc=_glBlendFunc;function _glBlendFuncSeparate(x0,x1,x2,x3){GLctx.blendFuncSeparate(x0,x1,x2,x3)}var _emscripten_glBlendFuncSeparate=_glBlendFuncSeparate;var _glBufferData=(target,size,data,usage)=>{switch(usage){case 35041:case 35042:usage=35040;break;case 35045:case 35046:usage=35044;break;case 35049:case 35050:usage=35048;break}GLctx.bufferData(target,data?HEAPU8.subarray(data,data+size):size,usage)};var _emscripten_glBufferData=_glBufferData;var _glBufferSubData=(target,offset,size,data)=>{GLctx.bufferSubData(target,offset,HEAPU8.subarray(data,data+size))};var _emscripten_glBufferSubData=_glBufferSubData;function _glCheckFramebufferStatus(x0){return GLctx.checkFramebufferStatus(x0)}var _emscripten_glCheckFramebufferStatus=_glCheckFramebufferStatus;function _glClear(x0){GLctx.clear(x0)}var _emscripten_glClear=_glClear;function _glClearColor(x0,x1,x2,x3){GLctx.clearColor(x0,x1,x2,x3)}var _emscripten_glClearColor=_glClearColor;function _glClearDepthf(x0){GLctx.clearDepth(x0)}var _emscripten_glClearDepthf=_glClearDepthf;function _glClearStencil(x0){GLctx.clearStencil(x0)}var _emscripten_glClearStencil=_glClearStencil;var _glClientActiveTexture=texture=>{GLImmediate.clientActiveTexture=texture-33984};var _emscripten_glClientActiveTexture=_glClientActiveTexture;var _glClipPlane=(pname,param)=>{if(pname>=12288&&pname<12294){var clipPlaneId=pname-12288;GLEmulation.clipPlaneEquation[clipPlaneId][0]=HEAPF64[param>>3];GLEmulation.clipPlaneEquation[clipPlaneId][1]=HEAPF64[param+8>>3];GLEmulation.clipPlaneEquation[clipPlaneId][2]=HEAPF64[param+16>>3];GLEmulation.clipPlaneEquation[clipPlaneId][3]=HEAPF64[param+24>>3];var tmpMV=GLImmediate.matrixLib.mat4.create(GLImmediate.matrix[0]);GLImmediate.matrixLib.mat4.inverse(tmpMV);GLImmediate.matrixLib.mat4.transpose(tmpMV);GLImmediate.matrixLib.mat4.multiplyVec4(tmpMV,GLEmulation.clipPlaneEquation[clipPlaneId])}};var _emscripten_glClipPlane=_glClipPlane;var _glColor4f=(r,g,b,a)=>{r=Math.max(Math.min(r,1),0);g=Math.max(Math.min(g,1),0);b=Math.max(Math.min(b,1),0);a=Math.max(Math.min(a,1),0);if(GLImmediate.mode>=0){var start=GLImmediate.vertexCounter<<2;GLImmediate.vertexDataU8[start+0]=r*255;GLImmediate.vertexDataU8[start+1]=g*255;GLImmediate.vertexDataU8[start+2]=b*255;GLImmediate.vertexDataU8[start+3]=a*255;GLImmediate.vertexCounter++;GLImmediate.addRendererComponent(GLImmediate.COLOR,4,GLctx.UNSIGNED_BYTE)}else{GLImmediate.clientColor[0]=r;GLImmediate.clientColor[1]=g;GLImmediate.clientColor[2]=b;GLImmediate.clientColor[3]=a}};var _glColor3f=(r,g,b)=>{_glColor4f(r,g,b,1)};var _glColor3d=_glColor3f;var _emscripten_glColor3d=_glColor3d;var _emscripten_glColor3f=_glColor3f;var _glColor3fv=p=>{_glColor3f(HEAPF32[p>>2],HEAPF32[p+4>>2],HEAPF32[p+8>>2])};var _emscripten_glColor3fv=_glColor3fv;var _glColor4ub=(r,g,b,a)=>{_glColor4f((r&255)/255,(g&255)/255,(b&255)/255,(a&255)/255)};var _glColor3ub=(r,g,b)=>{_glColor4ub(r,g,b,255)};var _emscripten_glColor3ub=_glColor3ub;var _glColor3ubv=p=>{_glColor3ub(HEAP8[p>>0],HEAP8[p+1>>0],HEAP8[p+2>>0])};var _emscripten_glColor3ubv=_glColor3ubv;var _glColor4ui=(r,g,b,a)=>{_glColor4f((r>>>0)/4294967295,(g>>>0)/4294967295,(b>>>0)/4294967295,(a>>>0)/4294967295)};var _glColor3ui=(r,g,b)=>{_glColor4ui(r,g,b,4294967295)};var _emscripten_glColor3ui=_glColor3ui;var _glColor3uiv=p=>{_glColor3ui(HEAP32[p>>2],HEAP32[p+4>>2],HEAP32[p+8>>2])};var _emscripten_glColor3uiv=_glColor3uiv;var _glColor4us=(r,g,b,a)=>{_glColor4f((r&65535)/65535,(g&65535)/65535,(b&65535)/65535,(a&65535)/65535)};var _glColor3us=(r,g,b)=>{_glColor4us(r,g,b,65535)};var _emscripten_glColor3us=_glColor3us;var _glColor3usv=p=>{_glColor3us(HEAP16[p>>1],HEAP16[p+2>>1],HEAP16[p+4>>1])};var _emscripten_glColor3usv=_glColor3usv;var _glColor4d=_glColor4f;var _emscripten_glColor4d=_glColor4d;var _emscripten_glColor4f=_glColor4f;var _glColor4fv=p=>{_glColor4f(HEAPF32[p>>2],HEAPF32[p+4>>2],HEAPF32[p+8>>2],HEAPF32[p+12>>2])};var _emscripten_glColor4fv=_glColor4fv;var _emscripten_glColor4ub=_glColor4ub;var _glColor4ubv=p=>{_glColor4ub(HEAP8[p>>0],HEAP8[p+1>>0],HEAP8[p+2>>0],HEAP8[p+3>>0])};var _emscripten_glColor4ubv=_glColor4ubv;var _emscripten_glColor4ui=_glColor4ui;var _emscripten_glColor4us=_glColor4us;var _glColorMask=(red,green,blue,alpha)=>{GLctx.colorMask(!!red,!!green,!!blue,!!alpha)};var _emscripten_glColorMask=_glColorMask;var _glColorPointer=(size,type,stride,pointer)=>{GLImmediate.setClientAttribute(GLImmediate.COLOR,size,type,stride,pointer)};var _emscripten_glColorPointer=_glColorPointer;var _emscripten_glCompileShader=_glCompileShader;var _glCompressedTexImage2D=(target,level,internalFormat,width,height,border,imageSize,data)=>{GLctx.compressedTexImage2D(target,level,internalFormat,width,height,border,data?HEAPU8.subarray(data,data+imageSize):null)};var _emscripten_glCompressedTexImage2D=_glCompressedTexImage2D;var _glCompressedTexSubImage2D=(target,level,xoffset,yoffset,width,height,format,imageSize,data)=>{GLctx.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,data?HEAPU8.subarray(data,data+imageSize):null)};var _emscripten_glCompressedTexSubImage2D=_glCompressedTexSubImage2D;function _glCopyTexImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx.copyTexImage2D(x0,x1,x2,x3,x4,x5,x6,x7)}var _emscripten_glCopyTexImage2D=_glCopyTexImage2D;function _glCopyTexSubImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx.copyTexSubImage2D(x0,x1,x2,x3,x4,x5,x6,x7)}var _emscripten_glCopyTexSubImage2D=_glCopyTexSubImage2D;var _glCreateProgram=()=>{var id=GL.getNewId(GL.programs);var program=GLctx.createProgram();program.name=id;program.maxUniformLength=program.maxAttributeLength=program.maxUniformBlockNameLength=0;program.uniformIdCounter=1;GL.programs[id]=program;return id};var _emscripten_glCreateProgram=_glCreateProgram;var _emscripten_glCreateShader=_glCreateShader;function _glCullFace(x0){GLctx.cullFace(x0)}var _emscripten_glCullFace=_glCullFace;var _glDeleteBuffers=(n,buffers)=>{for(var i=0;i>2];var buffer=GL.buffers[id];if(!buffer)continue;GLctx.deleteBuffer(buffer);buffer.name=0;GL.buffers[id]=null;if(id==GLctx.currentArrayBufferBinding)GLctx.currentArrayBufferBinding=0;if(id==GLctx.currentElementArrayBufferBinding)GLctx.currentElementArrayBufferBinding=0}};var _emscripten_glDeleteBuffers=_glDeleteBuffers;var _glDeleteFramebuffers=(n,framebuffers)=>{for(var i=0;i>2];var framebuffer=GL.framebuffers[id];if(!framebuffer)continue;GLctx.deleteFramebuffer(framebuffer);framebuffer.name=0;GL.framebuffers[id]=null}};var _emscripten_glDeleteFramebuffers=_glDeleteFramebuffers;var _glDeleteShader=id=>{if(!id)return;var shader=GL.shaders[id];if(!shader){GL.recordError(1281);return}GLctx.deleteShader(shader);GL.shaders[id]=null};var _glDeleteObject=id=>{if(GL.programs[id]){_glDeleteProgram(id)}else if(GL.shaders[id]){_glDeleteShader(id)}else{err(`WARNING: deleteObject received invalid id: ${id}`)}};var _emscripten_glDeleteObject=_glDeleteObject;var _emscripten_glDeleteProgram=_glDeleteProgram;var _glDeleteQueriesEXT=(n,ids)=>{for(var i=0;i>2];var query=GL.queries[id];if(!query)continue;GLctx.disjointTimerQueryExt["deleteQueryEXT"](query);GL.queries[id]=null}};var _emscripten_glDeleteQueriesEXT=_glDeleteQueriesEXT;var _glDeleteRenderbuffers=(n,renderbuffers)=>{for(var i=0;i>2];var renderbuffer=GL.renderbuffers[id];if(!renderbuffer)continue;GLctx.deleteRenderbuffer(renderbuffer);renderbuffer.name=0;GL.renderbuffers[id]=null}};var _emscripten_glDeleteRenderbuffers=_glDeleteRenderbuffers;var _emscripten_glDeleteShader=_glDeleteShader;var _glDeleteTextures=(n,textures)=>{for(var i=0;i>2];var texture=GL.textures[id];if(!texture)continue;GLctx.deleteTexture(texture);texture.name=0;GL.textures[id]=null}};var _emscripten_glDeleteTextures=_glDeleteTextures;var emulGlDeleteVertexArrays=(n,vaos)=>{for(var i=0;i>2];GLEmulation.vaos[id]=null;if(GLEmulation.currentVao&&GLEmulation.currentVao.id==id)GLEmulation.currentVao=null}};var _glDeleteVertexArrays=(n,vaos)=>{emulGlDeleteVertexArrays(n,vaos)};var _glDeleteVertexArraysOES=_glDeleteVertexArrays;var _emscripten_glDeleteVertexArraysOES=_glDeleteVertexArraysOES;function _glDepthFunc(x0){GLctx.depthFunc(x0)}var _emscripten_glDepthFunc=_glDepthFunc;var _glDepthMask=flag=>{GLctx.depthMask(!!flag)};var _emscripten_glDepthMask=_glDepthMask;function _glDepthRangef(x0,x1){GLctx.depthRange(x0,x1)}var _emscripten_glDepthRangef=_glDepthRangef;var _emscripten_glDetachShader=_glDetachShader;var _emscripten_glDisable=_glDisable;var _glDisableClientState=cap=>{var attrib=GLEmulation.getAttributeFromCapability(cap);if(attrib===null){return}if(GLImmediate.enabledClientAttributes[attrib]){GLImmediate.enabledClientAttributes[attrib]=false;GLImmediate.totalEnabledClientAttributes--;GLImmediate.currentRenderer=null;if(GLEmulation.currentVao)delete GLEmulation.currentVao.enabledClientStates[cap];GLImmediate.modifiedClientAttributes=true}};var _emscripten_glDisableClientState=_glDisableClientState;var _emscripten_glDisableVertexAttribArray=_glDisableVertexAttribArray;var _glDrawArrays=(mode,first,count)=>{if(GLImmediate.totalEnabledClientAttributes==0&&mode<=6){GLctx.drawArrays(mode,first,count);return}GLImmediate.prepareClientAttributes(count,false);GLImmediate.mode=mode;if(!GLctx.currentArrayBufferBinding){GLImmediate.vertexData=HEAPF32.subarray(GLImmediate.vertexPointer>>2,GLImmediate.vertexPointer+(first+count)*GLImmediate.stride>>2);GLImmediate.firstVertex=first;GLImmediate.lastVertex=first+count}GLImmediate.flush(null,first);GLImmediate.mode=-1};var _emscripten_glDrawArrays=_glDrawArrays;var _glDrawArraysInstanced=(mode,first,count,primcount)=>{GLctx.drawArraysInstanced(mode,first,count,primcount)};var _glDrawArraysInstancedANGLE=_glDrawArraysInstanced;var _emscripten_glDrawArraysInstancedANGLE=_glDrawArraysInstancedANGLE;var _glDrawBuffer=()=>{throw"glDrawBuffer: TODO"};var _emscripten_glDrawBuffer=_glDrawBuffer;var tempFixedLengthArray=[];var _glDrawBuffers=(n,bufs)=>{var bufArray=tempFixedLengthArray[n];for(var i=0;i>2]}GLctx.drawBuffers(bufArray)};var _glDrawBuffersWEBGL=_glDrawBuffers;var _emscripten_glDrawBuffersWEBGL=_glDrawBuffersWEBGL;var _glDrawElements=(mode,count,type,indices,start,end)=>{if(GLImmediate.totalEnabledClientAttributes==0&&mode<=6&&GLctx.currentElementArrayBufferBinding){GLctx.drawElements(mode,count,type,indices);return}GLImmediate.prepareClientAttributes(count,false);GLImmediate.mode=mode;if(!GLctx.currentArrayBufferBinding){GLImmediate.firstVertex=end?start:HEAP8.length;GLImmediate.lastVertex=end?end+1:0;GLImmediate.vertexData=HEAPF32.subarray(GLImmediate.vertexPointer>>2,end?GLImmediate.vertexPointer+(end+1)*GLImmediate.stride>>2:undefined)}GLImmediate.flush(count,0,indices);GLImmediate.mode=-1};var _emscripten_glDrawElements=_glDrawElements;var _glDrawElementsInstanced=(mode,count,type,indices,primcount)=>{GLctx.drawElementsInstanced(mode,count,type,indices,primcount)};var _glDrawElementsInstancedANGLE=_glDrawElementsInstanced;var _emscripten_glDrawElementsInstancedANGLE=_glDrawElementsInstancedANGLE;var _glDrawRangeElements=(mode,start,end,count,type,indices)=>{_glDrawElements(mode,count,type,indices,start,end)};var _emscripten_glDrawRangeElements=_glDrawRangeElements;var _emscripten_glEnable=_glEnable;var _emscripten_glEnableClientState=_glEnableClientState;var _emscripten_glEnableVertexAttribArray=_glEnableVertexAttribArray;var _glEnd=()=>{GLImmediate.prepareClientAttributes(GLImmediate.rendererComponents[GLImmediate.VERTEX],true);GLImmediate.firstVertex=0;GLImmediate.lastVertex=GLImmediate.vertexCounter/(GLImmediate.stride>>2);GLImmediate.flush();GLImmediate.disableBeginEndClientAttributes();GLImmediate.mode=-1;GLImmediate.enabledClientAttributes=GLImmediate.enabledClientAttributes_preBegin;GLImmediate.clientAttributes=GLImmediate.clientAttributes_preBegin;GLImmediate.currentRenderer=null;GLImmediate.modifiedClientAttributes=true};var _emscripten_glEnd=_glEnd;var _glEndQueryEXT=target=>{GLctx.disjointTimerQueryExt["endQueryEXT"](target)};var _emscripten_glEndQueryEXT=_glEndQueryEXT;function _glFinish(){GLctx.finish()}var _emscripten_glFinish=_glFinish;function _glFlush(){GLctx.flush()}var _emscripten_glFlush=_glFlush;var _glFramebufferRenderbuffer=(target,attachment,renderbuffertarget,renderbuffer)=>{GLctx.framebufferRenderbuffer(target,attachment,renderbuffertarget,GL.renderbuffers[renderbuffer])};var _emscripten_glFramebufferRenderbuffer=_glFramebufferRenderbuffer;var _glFramebufferTexture2D=(target,attachment,textarget,texture,level)=>{GLctx.framebufferTexture2D(target,attachment,textarget,GL.textures[texture],level)};var _emscripten_glFramebufferTexture2D=_glFramebufferTexture2D;function _glFrontFace(x0){GLctx.frontFace(x0)}var _emscripten_glFrontFace=_glFrontFace;var _glFrustum=(left,right,bottom,top_,nearVal,farVal)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],GLImmediate.matrixLib.mat4.frustum(left,right,bottom,top_,nearVal,farVal))};var _emscripten_glFrustum=_glFrustum;var __glGenObject=(n,buffers,createFunction,objectTable)=>{for(var i=0;i>2]=id}};var _glGenBuffers=(n,buffers)=>{__glGenObject(n,buffers,"createBuffer",GL.buffers)};var _emscripten_glGenBuffers=_glGenBuffers;var _glGenFramebuffers=(n,ids)=>{__glGenObject(n,ids,"createFramebuffer",GL.framebuffers)};var _emscripten_glGenFramebuffers=_glGenFramebuffers;var _glGenQueriesEXT=(n,ids)=>{for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.queries);query.name=id;GL.queries[id]=query;HEAP32[ids+i*4>>2]=id}};var _emscripten_glGenQueriesEXT=_glGenQueriesEXT;var _glGenRenderbuffers=(n,renderbuffers)=>{__glGenObject(n,renderbuffers,"createRenderbuffer",GL.renderbuffers)};var _emscripten_glGenRenderbuffers=_glGenRenderbuffers;var _glGenTextures=(n,textures)=>{__glGenObject(n,textures,"createTexture",GL.textures)};var _emscripten_glGenTextures=_glGenTextures;var emulGlGenVertexArrays=(n,vaos)=>{for(var i=0;i>2]=id}};function _glGenVertexArrays(n,arrays){emulGlGenVertexArrays(n,arrays)}var _glGenVertexArraysOES=_glGenVertexArrays;var _emscripten_glGenVertexArraysOES=_glGenVertexArraysOES;function _glGenerateMipmap(x0){GLctx.generateMipmap(x0)}var _emscripten_glGenerateMipmap=_glGenerateMipmap;var __glGetActiveAttribOrUniform=(funcName,program,index,bufSize,length,size,type,name)=>{program=GL.programs[program];var info=GLctx[funcName](program,index);if(info){var numBytesWrittenExclNull=name&&stringToUTF8(info.name,name,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull;if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}};var _glGetActiveAttrib=(program,index,bufSize,length,size,type,name)=>{__glGetActiveAttribOrUniform("getActiveAttrib",program,index,bufSize,length,size,type,name)};var _emscripten_glGetActiveAttrib=_glGetActiveAttrib;var _glGetActiveUniform=(program,index,bufSize,length,size,type,name)=>{__glGetActiveAttribOrUniform("getActiveUniform",program,index,bufSize,length,size,type,name)};var _emscripten_glGetActiveUniform=_glGetActiveUniform;var _glGetAttachedShaders=(program,maxCount,count,shaders)=>{var result=GLctx.getAttachedShaders(GL.programs[program]);var len=result.length;if(len>maxCount){len=maxCount}HEAP32[count>>2]=len;for(var i=0;i>2]=id}};var _emscripten_glGetAttachedShaders=_glGetAttachedShaders;var _glGetAttribLocation=(program,name)=>GLctx.getAttribLocation(GL.programs[program],UTF8ToString(name));var _emscripten_glGetAttribLocation=_glGetAttribLocation;var _emscripten_glGetBooleanv=_glGetBooleanv;var _glGetBufferParameteriv=(target,value,data)=>{if(!data){GL.recordError(1281);return}HEAP32[data>>2]=GLctx.getBufferParameter(target,value)};var _emscripten_glGetBufferParameteriv=_glGetBufferParameteriv;var _glGetError=()=>{var error=GLctx.getError()||GL.lastError;GL.lastError=0;return error};var _emscripten_glGetError=_glGetError;var _emscripten_glGetFloatv=_glGetFloatv;var _glGetFramebufferAttachmentParameteriv=(target,attachment,pname,params)=>{var result=GLctx.getFramebufferAttachmentParameter(target,attachment,pname);if(result instanceof WebGLRenderbuffer||result instanceof WebGLTexture){result=result.name|0}HEAP32[params>>2]=result};var _emscripten_glGetFramebufferAttachmentParameteriv=_glGetFramebufferAttachmentParameteriv;var _glGetProgramInfoLog=(program,maxLength,length,infoLog)=>{var log=GLctx.getProgramInfoLog(GL.programs[program]);if(log===null)log="(unknown error)";var numBytesWrittenExclNull=maxLength>0&&infoLog?stringToUTF8(log,infoLog,maxLength):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull};var _glGetShaderInfoLog=(shader,maxLength,length,infoLog)=>{var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";var numBytesWrittenExclNull=maxLength>0&&infoLog?stringToUTF8(log,infoLog,maxLength):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull};var _glGetInfoLog=(id,maxLength,length,infoLog)=>{if(GL.programs[id]){_glGetProgramInfoLog(id,maxLength,length,infoLog)}else if(GL.shaders[id]){_glGetShaderInfoLog(id,maxLength,length,infoLog)}else{err(`WARNING: glGetInfoLog received invalid id: ${id}`)}};var _emscripten_glGetInfoLog=_glGetInfoLog;var _emscripten_glGetIntegerv=_glGetIntegerv;var _glGetProgramiv=(program,pname,p)=>{if(!p){GL.recordError(1281);return}if(program>=GL.counter){GL.recordError(1281);return}program=GL.programs[program];if(pname==35716){var log=GLctx.getProgramInfoLog(program);if(log===null)log="(unknown error)";HEAP32[p>>2]=log.length+1}else if(pname==35719){if(!program.maxUniformLength){for(var i=0;i>2]=program.maxUniformLength}else if(pname==35722){if(!program.maxAttributeLength){for(var i=0;i>2]=program.maxAttributeLength}else if(pname==35381){if(!program.maxUniformBlockNameLength){for(var i=0;i>2]=program.maxUniformBlockNameLength}else{HEAP32[p>>2]=GLctx.getProgramParameter(program,pname)}};var _glGetShaderiv=(shader,pname,p)=>{if(!p){GL.recordError(1281);return}if(pname==35716){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";var logLength=log?log.length+1:0;HEAP32[p>>2]=logLength}else if(pname==35720){var source=GLctx.getShaderSource(GL.shaders[shader]);var sourceLength=source?source.length+1:0;HEAP32[p>>2]=sourceLength}else{HEAP32[p>>2]=GLctx.getShaderParameter(GL.shaders[shader],pname)}};var _glGetObjectParameteriv=(id,type,result)=>{if(GL.programs[id]){if(type==35716){var log=GLctx.getProgramInfoLog(GL.programs[id]);if(log===null)log="(unknown error)";HEAP32[result>>2]=log.length;return}_glGetProgramiv(id,type,result)}else if(GL.shaders[id]){if(type==35716){var log=GLctx.getShaderInfoLog(GL.shaders[id]);if(log===null)log="(unknown error)";HEAP32[result>>2]=log.length;return}else if(type==35720){var source=GLctx.getShaderSource(GL.shaders[id]);if(source===null)return;HEAP32[result>>2]=source.length;return}_glGetShaderiv(id,type,result)}else{err(`WARNING: getObjectParameteriv received invalid id: ${id}`)}};var _emscripten_glGetObjectParameteriv=_glGetObjectParameteriv;var _glGetPointerv=(name,p)=>{var attribute;switch(name){case 32910:attribute=GLImmediate.clientAttributes[GLImmediate.VERTEX];break;case 32912:attribute=GLImmediate.clientAttributes[GLImmediate.COLOR];break;case 32914:attribute=GLImmediate.clientAttributes[GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture];break;default:GL.recordError(1280);return}HEAP32[p>>2]=attribute?attribute.pointer:0};var _emscripten_glGetPointerv=_glGetPointerv;var _emscripten_glGetProgramInfoLog=_glGetProgramInfoLog;var _emscripten_glGetProgramiv=_glGetProgramiv;var _glGetQueryObjecti64vEXT=(id,pname,params)=>{if(!params){GL.recordError(1281);return}var query=GL.queries[id];var param;{param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname)}var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}writeI53ToI64(params,ret)};var _emscripten_glGetQueryObjecti64vEXT=_glGetQueryObjecti64vEXT;var _glGetQueryObjectivEXT=(id,pname,params)=>{if(!params){GL.recordError(1281);return}var query=GL.queries[id];var param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname);var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}HEAP32[params>>2]=ret};var _emscripten_glGetQueryObjectivEXT=_glGetQueryObjectivEXT;var _glGetQueryObjectui64vEXT=_glGetQueryObjecti64vEXT;var _emscripten_glGetQueryObjectui64vEXT=_glGetQueryObjectui64vEXT;var _glGetQueryObjectuivEXT=_glGetQueryObjectivEXT;var _emscripten_glGetQueryObjectuivEXT=_glGetQueryObjectuivEXT;var _glGetQueryivEXT=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.disjointTimerQueryExt["getQueryEXT"](target,pname)};var _emscripten_glGetQueryivEXT=_glGetQueryivEXT;var _glGetRenderbufferParameteriv=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getRenderbufferParameter(target,pname)};var _emscripten_glGetRenderbufferParameteriv=_glGetRenderbufferParameteriv;var _emscripten_glGetShaderInfoLog=_glGetShaderInfoLog;var _glGetShaderPrecisionFormat=(shaderType,precisionType,range,precision)=>{var result=GLctx.getShaderPrecisionFormat(shaderType,precisionType);HEAP32[range>>2]=result.rangeMin;HEAP32[range+4>>2]=result.rangeMax;HEAP32[precision>>2]=result.precision};var _emscripten_glGetShaderPrecisionFormat=_glGetShaderPrecisionFormat;var _glGetShaderSource=(shader,bufSize,length,source)=>{var result=GLctx.getShaderSource(GL.shaders[shader]);if(!result)return;var numBytesWrittenExclNull=bufSize>0&&source?stringToUTF8(result,source,bufSize):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull};var _emscripten_glGetShaderSource=_glGetShaderSource;var _emscripten_glGetShaderiv=_glGetShaderiv;var _emscripten_glGetString=_glGetString;var _glGetTexEnvfv=(target,pname,param)=>{throw"GL emulation not initialized!"};var _emscripten_glGetTexEnvfv=_glGetTexEnvfv;var _glGetTexEnviv=(target,pname,param)=>{throw"GL emulation not initialized!"};var _emscripten_glGetTexEnviv=_glGetTexEnviv;var _glGetTexLevelParameteriv=(target,level,pname,params)=>{throw"glGetTexLevelParameteriv: TODO"};var _emscripten_glGetTexLevelParameteriv=_glGetTexLevelParameteriv;var _glGetTexParameterfv=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAPF32[params>>2]=GLctx.getTexParameter(target,pname)};var _emscripten_glGetTexParameterfv=_glGetTexParameterfv;var _glGetTexParameteriv=(target,pname,params)=>{if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getTexParameter(target,pname)};var _emscripten_glGetTexParameteriv=_glGetTexParameteriv;var jstoi_q=str=>parseInt(str);var webglGetLeftBracePos=name=>name.slice(-1)=="]"&&name.lastIndexOf("[");var webglPrepareUniformLocationsBeforeFirstUse=program=>{var uniformLocsById=program.uniformLocsById,uniformSizeAndIdsByName=program.uniformSizeAndIdsByName,i,j;if(!uniformLocsById){program.uniformLocsById=uniformLocsById={};program.uniformArrayNamesById={};for(i=0;i0?nm.slice(0,lb):nm;var id=program.uniformIdCounter;program.uniformIdCounter+=sz;uniformSizeAndIdsByName[arrayName]=[sz,id];for(j=0;j{name=UTF8ToString(name);if(program=GL.programs[program]){webglPrepareUniformLocationsBeforeFirstUse(program);var uniformLocsById=program.uniformLocsById;var arrayIndex=0;var uniformBaseName=name;var leftBrace=webglGetLeftBracePos(name);if(leftBrace>0){arrayIndex=jstoi_q(name.slice(leftBrace+1))>>>0;uniformBaseName=name.slice(0,leftBrace)}var sizeAndId=program.uniformSizeAndIdsByName[uniformBaseName];if(sizeAndId&&arrayIndex{var p=GLctx.currentProgram;if(p){var webglLoc=p.uniformLocsById[location];if(typeof webglLoc=="number"){p.uniformLocsById[location]=webglLoc=GLctx.getUniformLocation(p,p.uniformArrayNamesById[location]+(webglLoc>0?"["+webglLoc+"]":""))}return webglLoc}else{GL.recordError(1282)}};var emscriptenWebGLGetUniform=(program,location,params,type)=>{if(!params){GL.recordError(1281);return}program=GL.programs[program];webglPrepareUniformLocationsBeforeFirstUse(program);var data=GLctx.getUniform(program,webglGetUniformLocation(location));if(typeof data=="number"||typeof data=="boolean"){switch(type){case 0:HEAP32[params>>2]=data;break;case 2:HEAPF32[params>>2]=data;break}}else{for(var i=0;i>2]=data[i];break;case 2:HEAPF32[params+i*4>>2]=data[i];break}}}};var _glGetUniformfv=(program,location,params)=>{emscriptenWebGLGetUniform(program,location,params,2)};var _emscripten_glGetUniformfv=_glGetUniformfv;var _glGetUniformiv=(program,location,params)=>{emscriptenWebGLGetUniform(program,location,params,0)};var _emscripten_glGetUniformiv=_glGetUniformiv;var _glGetVertexAttribPointerv=(index,pname,pointer)=>{if(!pointer){GL.recordError(1281);return}HEAP32[pointer>>2]=GLctx.getVertexAttribOffset(index,pname)};var _emscripten_glGetVertexAttribPointerv=_glGetVertexAttribPointerv;var emscriptenWebGLGetVertexAttrib=(index,pname,params,type)=>{if(!params){GL.recordError(1281);return}var data=GLctx.getVertexAttrib(index,pname);if(pname==34975){HEAP32[params>>2]=data&&data["name"]}else if(typeof data=="number"||typeof data=="boolean"){switch(type){case 0:HEAP32[params>>2]=data;break;case 2:HEAPF32[params>>2]=data;break;case 5:HEAP32[params>>2]=Math.fround(data);break}}else{for(var i=0;i>2]=data[i];break;case 2:HEAPF32[params+i*4>>2]=data[i];break;case 5:HEAP32[params+i*4>>2]=Math.fround(data[i]);break}}}};var _glGetVertexAttribfv=(index,pname,params)=>{emscriptenWebGLGetVertexAttrib(index,pname,params,2)};var _emscripten_glGetVertexAttribfv=_glGetVertexAttribfv;var _glGetVertexAttribiv=(index,pname,params)=>{emscriptenWebGLGetVertexAttrib(index,pname,params,5)};var _emscripten_glGetVertexAttribiv=_glGetVertexAttribiv;var _emscripten_glHint=_glHint;var _glIsBuffer=buffer=>{var b=GL.buffers[buffer];if(!b)return 0;return GLctx.isBuffer(b)};var _emscripten_glIsBuffer=_glIsBuffer;var _emscripten_glIsEnabled=_glIsEnabled;var _glIsFramebuffer=framebuffer=>{var fb=GL.framebuffers[framebuffer];if(!fb)return 0;return GLctx.isFramebuffer(fb)};var _emscripten_glIsFramebuffer=_glIsFramebuffer;var _glIsProgram=program=>{program=GL.programs[program];if(!program)return 0;return GLctx.isProgram(program)};var _emscripten_glIsProgram=_glIsProgram;var _glIsQueryEXT=id=>{var query=GL.queries[id];if(!query)return 0;return GLctx.disjointTimerQueryExt["isQueryEXT"](query)};var _emscripten_glIsQueryEXT=_glIsQueryEXT;var _glIsRenderbuffer=renderbuffer=>{var rb=GL.renderbuffers[renderbuffer];if(!rb)return 0;return GLctx.isRenderbuffer(rb)};var _emscripten_glIsRenderbuffer=_glIsRenderbuffer;var _glIsShader=shader=>{var s=GL.shaders[shader];if(!s)return 0;return GLctx.isShader(s)};var _emscripten_glIsShader=_glIsShader;var _glIsTexture=id=>{var texture=GL.textures[id];if(!texture)return 0;return GLctx.isTexture(texture)};var _emscripten_glIsTexture=_glIsTexture;var emulGlIsVertexArray=array=>{var vao=GLEmulation.vaos[array];if(!vao)return 0;return 1};var _glIsVertexArray=array=>emulGlIsVertexArray(array);var _glIsVertexArrayOES=_glIsVertexArray;var _emscripten_glIsVertexArrayOES=_glIsVertexArrayOES;var _glLightModelf=(pname,param)=>{if(pname==2898){GLEmulation.lightModelTwoSide=param!=0?true:false}else{throw"glLightModelf: TODO: "+pname}};var _emscripten_glLightModelf=_glLightModelf;var _glLightModelfv=(pname,param)=>{if(pname==2899){GLEmulation.lightModelAmbient[0]=HEAPF32[param>>2];GLEmulation.lightModelAmbient[1]=HEAPF32[param+4>>2];GLEmulation.lightModelAmbient[2]=HEAPF32[param+8>>2];GLEmulation.lightModelAmbient[3]=HEAPF32[param+12>>2]}else{throw"glLightModelfv: TODO: "+pname}};var _emscripten_glLightModelfv=_glLightModelfv;var _glLightfv=(light,pname,param)=>{if(light>=16384&&light<16392){var lightId=light-16384;if(pname==4608){GLEmulation.lightAmbient[lightId][0]=HEAPF32[param>>2];GLEmulation.lightAmbient[lightId][1]=HEAPF32[param+4>>2];GLEmulation.lightAmbient[lightId][2]=HEAPF32[param+8>>2];GLEmulation.lightAmbient[lightId][3]=HEAPF32[param+12>>2]}else if(pname==4609){GLEmulation.lightDiffuse[lightId][0]=HEAPF32[param>>2];GLEmulation.lightDiffuse[lightId][1]=HEAPF32[param+4>>2];GLEmulation.lightDiffuse[lightId][2]=HEAPF32[param+8>>2];GLEmulation.lightDiffuse[lightId][3]=HEAPF32[param+12>>2]}else if(pname==4610){GLEmulation.lightSpecular[lightId][0]=HEAPF32[param>>2];GLEmulation.lightSpecular[lightId][1]=HEAPF32[param+4>>2];GLEmulation.lightSpecular[lightId][2]=HEAPF32[param+8>>2];GLEmulation.lightSpecular[lightId][3]=HEAPF32[param+12>>2]}else if(pname==4611){GLEmulation.lightPosition[lightId][0]=HEAPF32[param>>2];GLEmulation.lightPosition[lightId][1]=HEAPF32[param+4>>2];GLEmulation.lightPosition[lightId][2]=HEAPF32[param+8>>2];GLEmulation.lightPosition[lightId][3]=HEAPF32[param+12>>2];GLImmediate.matrixLib.mat4.multiplyVec4(GLImmediate.matrix[0],GLEmulation.lightPosition[lightId])}else{throw"glLightfv: TODO: "+pname}}};var _emscripten_glLightfv=_glLightfv;function _glLineWidth(x0){GLctx.lineWidth(x0)}var _emscripten_glLineWidth=_glLineWidth;var _emscripten_glLinkProgram=_glLinkProgram;var _glLoadIdentity=()=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.identity(GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadIdentity=_glLoadIdentity;var _glLoadMatrixd=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.set(HEAPF64.subarray(matrix>>3,matrix+128>>3),GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadMatrixd=_glLoadMatrixd;var _glLoadMatrixf=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.set(HEAPF32.subarray(matrix>>2,matrix+64>>2),GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadMatrixf=_glLoadMatrixf;var _glLoadTransposeMatrixd=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.set(HEAPF64.subarray(matrix>>3,matrix+128>>3),GLImmediate.matrix[GLImmediate.currentMatrix]);GLImmediate.matrixLib.mat4.transpose(GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadTransposeMatrixd=_glLoadTransposeMatrixd;var _glLoadTransposeMatrixf=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.set(HEAPF32.subarray(matrix>>2,matrix+64>>2),GLImmediate.matrix[GLImmediate.currentMatrix]);GLImmediate.matrixLib.mat4.transpose(GLImmediate.matrix[GLImmediate.currentMatrix])};var _emscripten_glLoadTransposeMatrixf=_glLoadTransposeMatrixf;var _glMaterialfv=(face,pname,param)=>{if(face!=1028&&face!=1032){throw"glMaterialfv: TODO"+face}if(pname==4608){GLEmulation.materialAmbient[0]=HEAPF32[param>>2];GLEmulation.materialAmbient[1]=HEAPF32[param+4>>2];GLEmulation.materialAmbient[2]=HEAPF32[param+8>>2];GLEmulation.materialAmbient[3]=HEAPF32[param+12>>2]}else if(pname==4609){GLEmulation.materialDiffuse[0]=HEAPF32[param>>2];GLEmulation.materialDiffuse[1]=HEAPF32[param+4>>2];GLEmulation.materialDiffuse[2]=HEAPF32[param+8>>2];GLEmulation.materialDiffuse[3]=HEAPF32[param+12>>2]}else if(pname==4610){GLEmulation.materialSpecular[0]=HEAPF32[param>>2];GLEmulation.materialSpecular[1]=HEAPF32[param+4>>2];GLEmulation.materialSpecular[2]=HEAPF32[param+8>>2];GLEmulation.materialSpecular[3]=HEAPF32[param+12>>2]}else if(pname==5633){GLEmulation.materialShininess[0]=HEAPF32[param>>2]}else{throw"glMaterialfv: TODO: "+pname}};var _emscripten_glMaterialfv=_glMaterialfv;var _glMatrixMode=mode=>{if(mode==5888){GLImmediate.currentMatrix=0}else if(mode==5889){GLImmediate.currentMatrix=1}else if(mode==5890){GLImmediate.useTextureMatrix=true;GLImmediate.currentMatrix=2+GLImmediate.TexEnvJIT.getActiveTexture()}else{throw"Wrong mode "+mode+" passed to glMatrixMode"}};var _emscripten_glMatrixMode=_glMatrixMode;var _glMultMatrixd=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],HEAPF64.subarray(matrix>>3,matrix+128>>3))};var _emscripten_glMultMatrixd=_glMultMatrixd;var _glMultMatrixf=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],HEAPF32.subarray(matrix>>2,matrix+64>>2))};var _emscripten_glMultMatrixf=_glMultMatrixf;var _glMultTransposeMatrixd=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;var colMajor=GLImmediate.matrixLib.mat4.create();GLImmediate.matrixLib.mat4.set(HEAPF64.subarray(matrix>>3,matrix+128>>3),colMajor);GLImmediate.matrixLib.mat4.transpose(colMajor);GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],colMajor)};var _emscripten_glMultTransposeMatrixd=_glMultTransposeMatrixd;var _glMultTransposeMatrixf=matrix=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;var colMajor=GLImmediate.matrixLib.mat4.create();GLImmediate.matrixLib.mat4.set(HEAPF32.subarray(matrix>>2,matrix+64>>2),colMajor);GLImmediate.matrixLib.mat4.transpose(colMajor);GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],colMajor)};var _emscripten_glMultTransposeMatrixf=_glMultTransposeMatrixf;var _glNormal3f=(x,y,z)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=x;GLImmediate.vertexData[GLImmediate.vertexCounter++]=y;GLImmediate.vertexData[GLImmediate.vertexCounter++]=z;GLImmediate.addRendererComponent(GLImmediate.NORMAL,3,GLctx.FLOAT)};var _emscripten_glNormal3f=_glNormal3f;var _glNormalPointer=(type,stride,pointer)=>{GLImmediate.setClientAttribute(GLImmediate.NORMAL,3,type,stride,pointer)};var _emscripten_glNormalPointer=_glNormalPointer;var _glOrtho=(left,right,bottom,top_,nearVal,farVal)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.multiply(GLImmediate.matrix[GLImmediate.currentMatrix],GLImmediate.matrixLib.mat4.ortho(left,right,bottom,top_,nearVal,farVal))};var _emscripten_glOrtho=_glOrtho;var _glPixelStorei=(pname,param)=>{if(pname==3317){GL.unpackAlignment=param}GLctx.pixelStorei(pname,param)};var _emscripten_glPixelStorei=_glPixelStorei;var _glPolygonMode=()=>{};var _emscripten_glPolygonMode=_glPolygonMode;function _glPolygonOffset(x0,x1){GLctx.polygonOffset(x0,x1)}var _emscripten_glPolygonOffset=_glPolygonOffset;var _glPopMatrix=()=>{if(GLImmediate.matrixStack[GLImmediate.currentMatrix].length==0){GL.recordError(1284);return}GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrix[GLImmediate.currentMatrix]=GLImmediate.matrixStack[GLImmediate.currentMatrix].pop()};var _emscripten_glPopMatrix=_glPopMatrix;var _glPushMatrix=()=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixStack[GLImmediate.currentMatrix].push(Array.prototype.slice.call(GLImmediate.matrix[GLImmediate.currentMatrix]))};var _emscripten_glPushMatrix=_glPushMatrix;var _glQueryCounterEXT=(id,target)=>{GLctx.disjointTimerQueryExt["queryCounterEXT"](GL.queries[id],target)};var _emscripten_glQueryCounterEXT=_glQueryCounterEXT;var _glReadBuffer=()=>{throw"glReadBuffer: TODO"};var _emscripten_glReadBuffer=_glReadBuffer;var computeUnpackAlignedImageSize=(width,height,sizePerPixel,alignment)=>{function roundedToNextMultipleOf(x,y){return x+y-1&-y}var plainRowSize=width*sizePerPixel;var alignedRowSize=roundedToNextMultipleOf(plainRowSize,alignment);return height*alignedRowSize};var colorChannelsInGlTextureFormat=format=>{var colorChannels={5:3,6:4,8:2,29502:3,29504:4};return colorChannels[format-6402]||1};var heapObjectForWebGLType=type=>{type-=5120;if(type==1)return HEAPU8;if(type==4)return HEAP32;if(type==6)return HEAPF32;if(type==5||type==28922)return HEAPU32;return HEAPU16};var heapAccessShiftForWebGLHeap=heap=>31-Math.clz32(heap.BYTES_PER_ELEMENT);var emscriptenWebGLGetTexPixelData=(type,format,width,height,pixels,internalFormat)=>{var heap=heapObjectForWebGLType(type);var shift=heapAccessShiftForWebGLHeap(heap);var byteSize=1<>shift,pixels+bytes>>shift)};var _glReadPixels=(x,y,width,height,format,type,pixels)=>{var pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,format);if(!pixelData){GL.recordError(1280);return}GLctx.readPixels(x,y,width,height,format,type,pixelData)};var _emscripten_glReadPixels=_glReadPixels;var _glReleaseShaderCompiler=()=>{};var _emscripten_glReleaseShaderCompiler=_glReleaseShaderCompiler;function _glRenderbufferStorage(x0,x1,x2,x3){GLctx.renderbufferStorage(x0,x1,x2,x3)}var _emscripten_glRenderbufferStorage=_glRenderbufferStorage;var _glRotated=(angle,x,y,z)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.rotate(GLImmediate.matrix[GLImmediate.currentMatrix],angle*Math.PI/180,[x,y,z])};var _emscripten_glRotated=_glRotated;var _glRotatef=_glRotated;var _emscripten_glRotatef=_glRotatef;var _glSampleCoverage=(value,invert)=>{GLctx.sampleCoverage(value,!!invert)};var _emscripten_glSampleCoverage=_glSampleCoverage;var _glScaled=(x,y,z)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.scale(GLImmediate.matrix[GLImmediate.currentMatrix],[x,y,z])};var _emscripten_glScaled=_glScaled;var _glScalef=_glScaled;var _emscripten_glScalef=_glScalef;function _glScissor(x0,x1,x2,x3){GLctx.scissor(x0,x1,x2,x3)}var _emscripten_glScissor=_glScissor;var _glShadeModel=()=>warnOnce("TODO: glShadeModel");var _emscripten_glShadeModel=_glShadeModel;var _glShaderBinary=(count,shaders,binaryformat,binary,length)=>{GL.recordError(1280)};var _emscripten_glShaderBinary=_glShaderBinary;var _emscripten_glShaderSource=_glShaderSource;function _glStencilFunc(x0,x1,x2){GLctx.stencilFunc(x0,x1,x2)}var _emscripten_glStencilFunc=_glStencilFunc;function _glStencilFuncSeparate(x0,x1,x2,x3){GLctx.stencilFuncSeparate(x0,x1,x2,x3)}var _emscripten_glStencilFuncSeparate=_glStencilFuncSeparate;function _glStencilMask(x0){GLctx.stencilMask(x0)}var _emscripten_glStencilMask=_glStencilMask;function _glStencilMaskSeparate(x0,x1){GLctx.stencilMaskSeparate(x0,x1)}var _emscripten_glStencilMaskSeparate=_glStencilMaskSeparate;function _glStencilOp(x0,x1,x2){GLctx.stencilOp(x0,x1,x2)}var _emscripten_glStencilOp=_glStencilOp;function _glStencilOpSeparate(x0,x1,x2,x3){GLctx.stencilOpSeparate(x0,x1,x2,x3)}var _emscripten_glStencilOpSeparate=_glStencilOpSeparate;var _glTexCoord2i=(u,v)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=u;GLImmediate.vertexData[GLImmediate.vertexCounter++]=v;GLImmediate.addRendererComponent(GLImmediate.TEXTURE0,2,GLctx.FLOAT)};var _glTexCoord2f=_glTexCoord2i;var _emscripten_glTexCoord2f=_glTexCoord2f;var _glTexCoord2fv=v=>{_glTexCoord2i(HEAPF32[v>>2],HEAPF32[v+4>>2])};var _emscripten_glTexCoord2fv=_glTexCoord2fv;var _emscripten_glTexCoord2i=_glTexCoord2i;var _glTexCoord3f=(target,level,internalformat,width,border,format,type,data)=>{throw"glTexCoord3f: TODO"};var _emscripten_glTexCoord3f=_glTexCoord3f;var _glTexCoord4f=()=>{throw"glTexCoord4f: TODO"};var _emscripten_glTexCoord4f=_glTexCoord4f;var _glTexCoordPointer=(size,type,stride,pointer)=>{GLImmediate.setClientAttribute(GLImmediate.TEXTURE0+GLImmediate.clientActiveTexture,size,type,stride,pointer)};var _emscripten_glTexCoordPointer=_glTexCoordPointer;var _glTexGenfv=(coord,pname,param)=>{throw"glTexGenfv: TODO"};var _emscripten_glTexGenfv=_glTexGenfv;var _glTexGeni=(coord,pname,param)=>{throw"glTexGeni: TODO"};var _emscripten_glTexGeni=_glTexGeni;var _glTexImage1D=(target,level,internalformat,width,border,format,type,data)=>{throw"glTexImage1D: TODO"};var _emscripten_glTexImage1D=_glTexImage1D;var _glTexImage2D=(target,level,internalFormat,width,height,border,format,type,pixels)=>{GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixels?emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat):null)};var _emscripten_glTexImage2D=_glTexImage2D;function _glTexParameterf(x0,x1,x2){GLctx.texParameterf(x0,x1,x2)}var _emscripten_glTexParameterf=_glTexParameterf;var _glTexParameterfv=(target,pname,params)=>{var param=HEAPF32[params>>2];GLctx.texParameterf(target,pname,param)};var _emscripten_glTexParameterfv=_glTexParameterfv;function _glTexParameteri(x0,x1,x2){GLctx.texParameteri(x0,x1,x2)}var _emscripten_glTexParameteri=_glTexParameteri;var _glTexParameteriv=(target,pname,params)=>{var param=HEAP32[params>>2];GLctx.texParameteri(target,pname,param)};var _emscripten_glTexParameteriv=_glTexParameteriv;var _glTexSubImage2D=(target,level,xoffset,yoffset,width,height,format,type,pixels)=>{var pixelData=null;if(pixels)pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,0);GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixelData)};var _emscripten_glTexSubImage2D=_glTexSubImage2D;var _glTranslated=(x,y,z)=>{GLImmediate.matricesModified=true;GLImmediate.matrixVersion[GLImmediate.currentMatrix]=GLImmediate.matrixVersion[GLImmediate.currentMatrix]+1|0;GLImmediate.matrixLib.mat4.translate(GLImmediate.matrix[GLImmediate.currentMatrix],[x,y,z])};var _emscripten_glTranslated=_glTranslated;var _glTranslatef=_glTranslated;var _emscripten_glTranslatef=_glTranslatef;var _glUniform1f=(location,v0)=>{GLctx.uniform1f(webglGetUniformLocation(location),v0)};var _emscripten_glUniform1f=_glUniform1f;var miniTempWebGLFloatBuffers=[];var _glUniform1fv=(location,count,value)=>{if(count<=288){var view=miniTempWebGLFloatBuffers[count-1];for(var i=0;i>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*4>>2)}GLctx.uniform1fv(webglGetUniformLocation(location),view)};var _emscripten_glUniform1fv=_glUniform1fv;var _glUniform1i=(location,v0)=>{GLctx.uniform1i(webglGetUniformLocation(location),v0)};var _emscripten_glUniform1i=_glUniform1i;var miniTempWebGLIntBuffers=[];var _glUniform1iv=(location,count,value)=>{if(count<=288){var view=miniTempWebGLIntBuffers[count-1];for(var i=0;i>2]}}else{var view=HEAP32.subarray(value>>2,value+count*4>>2)}GLctx.uniform1iv(webglGetUniformLocation(location),view)};var _emscripten_glUniform1iv=_glUniform1iv;var _glUniform2f=(location,v0,v1)=>{GLctx.uniform2f(webglGetUniformLocation(location),v0,v1)};var _emscripten_glUniform2f=_glUniform2f;var _glUniform2fv=(location,count,value)=>{if(count<=144){var view=miniTempWebGLFloatBuffers[2*count-1];for(var i=0;i<2*count;i+=2){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*8>>2)}GLctx.uniform2fv(webglGetUniformLocation(location),view)};var _emscripten_glUniform2fv=_glUniform2fv;var _glUniform2i=(location,v0,v1)=>{GLctx.uniform2i(webglGetUniformLocation(location),v0,v1)};var _emscripten_glUniform2i=_glUniform2i;var _glUniform2iv=(location,count,value)=>{if(count<=144){var view=miniTempWebGLIntBuffers[2*count-1];for(var i=0;i<2*count;i+=2){view[i]=HEAP32[value+4*i>>2];view[i+1]=HEAP32[value+(4*i+4)>>2]}}else{var view=HEAP32.subarray(value>>2,value+count*8>>2)}GLctx.uniform2iv(webglGetUniformLocation(location),view)};var _emscripten_glUniform2iv=_glUniform2iv;var _glUniform3f=(location,v0,v1,v2)=>{GLctx.uniform3f(webglGetUniformLocation(location),v0,v1,v2)};var _emscripten_glUniform3f=_glUniform3f;var _glUniform3fv=(location,count,value)=>{if(count<=96){var view=miniTempWebGLFloatBuffers[3*count-1];for(var i=0;i<3*count;i+=3){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*12>>2)}GLctx.uniform3fv(webglGetUniformLocation(location),view)};var _emscripten_glUniform3fv=_glUniform3fv;var _glUniform3i=(location,v0,v1,v2)=>{GLctx.uniform3i(webglGetUniformLocation(location),v0,v1,v2)};var _emscripten_glUniform3i=_glUniform3i;var _glUniform3iv=(location,count,value)=>{if(count<=96){var view=miniTempWebGLIntBuffers[3*count-1];for(var i=0;i<3*count;i+=3){view[i]=HEAP32[value+4*i>>2];view[i+1]=HEAP32[value+(4*i+4)>>2];view[i+2]=HEAP32[value+(4*i+8)>>2]}}else{var view=HEAP32.subarray(value>>2,value+count*12>>2)}GLctx.uniform3iv(webglGetUniformLocation(location),view)};var _emscripten_glUniform3iv=_glUniform3iv;var _glUniform4f=(location,v0,v1,v2,v3)=>{GLctx.uniform4f(webglGetUniformLocation(location),v0,v1,v2,v3)};var _emscripten_glUniform4f=_glUniform4f;var _glUniform4fv=(location,count,value)=>{if(count<=72){var view=miniTempWebGLFloatBuffers[4*count-1];var heap=HEAPF32;value>>=2;for(var i=0;i<4*count;i+=4){var dst=value+i;view[i]=heap[dst];view[i+1]=heap[dst+1];view[i+2]=heap[dst+2];view[i+3]=heap[dst+3]}}else{var view=HEAPF32.subarray(value>>2,value+count*16>>2)}GLctx.uniform4fv(webglGetUniformLocation(location),view)};var _emscripten_glUniform4fv=_glUniform4fv;var _glUniform4i=(location,v0,v1,v2,v3)=>{GLctx.uniform4i(webglGetUniformLocation(location),v0,v1,v2,v3)};var _emscripten_glUniform4i=_glUniform4i;var _glUniform4iv=(location,count,value)=>{if(count<=72){var view=miniTempWebGLIntBuffers[4*count-1];for(var i=0;i<4*count;i+=4){view[i]=HEAP32[value+4*i>>2];view[i+1]=HEAP32[value+(4*i+4)>>2];view[i+2]=HEAP32[value+(4*i+8)>>2];view[i+3]=HEAP32[value+(4*i+12)>>2]}}else{var view=HEAP32.subarray(value>>2,value+count*16>>2)}GLctx.uniform4iv(webglGetUniformLocation(location),view)};var _emscripten_glUniform4iv=_glUniform4iv;var _glUniformMatrix2fv=(location,count,transpose,value)=>{if(count<=72){var view=miniTempWebGLFloatBuffers[4*count-1];for(var i=0;i<4*count;i+=4){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*16>>2)}GLctx.uniformMatrix2fv(webglGetUniformLocation(location),!!transpose,view)};var _emscripten_glUniformMatrix2fv=_glUniformMatrix2fv;var _glUniformMatrix3fv=(location,count,transpose,value)=>{if(count<=32){var view=miniTempWebGLFloatBuffers[9*count-1];for(var i=0;i<9*count;i+=9){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2];view[i+4]=HEAPF32[value+(4*i+16)>>2];view[i+5]=HEAPF32[value+(4*i+20)>>2];view[i+6]=HEAPF32[value+(4*i+24)>>2];view[i+7]=HEAPF32[value+(4*i+28)>>2];view[i+8]=HEAPF32[value+(4*i+32)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*36>>2)}GLctx.uniformMatrix3fv(webglGetUniformLocation(location),!!transpose,view)};var _emscripten_glUniformMatrix3fv=_glUniformMatrix3fv;var _glUniformMatrix4fv=(location,count,transpose,value)=>{if(count<=18){var view=miniTempWebGLFloatBuffers[16*count-1];var heap=HEAPF32;value>>=2;for(var i=0;i<16*count;i+=16){var dst=value+i;view[i]=heap[dst];view[i+1]=heap[dst+1];view[i+2]=heap[dst+2];view[i+3]=heap[dst+3];view[i+4]=heap[dst+4];view[i+5]=heap[dst+5];view[i+6]=heap[dst+6];view[i+7]=heap[dst+7];view[i+8]=heap[dst+8];view[i+9]=heap[dst+9];view[i+10]=heap[dst+10];view[i+11]=heap[dst+11];view[i+12]=heap[dst+12];view[i+13]=heap[dst+13];view[i+14]=heap[dst+14];view[i+15]=heap[dst+15]}}else{var view=HEAPF32.subarray(value>>2,value+count*64>>2)}GLctx.uniformMatrix4fv(webglGetUniformLocation(location),!!transpose,view)};var _emscripten_glUniformMatrix4fv=_glUniformMatrix4fv;var _emscripten_glUseProgram=_glUseProgram;var _glValidateProgram=program=>{GLctx.validateProgram(GL.programs[program])};var _emscripten_glValidateProgram=_glValidateProgram;var _glVertex2f=(x,y)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=x;GLImmediate.vertexData[GLImmediate.vertexCounter++]=y;GLImmediate.vertexData[GLImmediate.vertexCounter++]=0;GLImmediate.vertexData[GLImmediate.vertexCounter++]=1;GLImmediate.addRendererComponent(GLImmediate.VERTEX,4,GLctx.FLOAT)};var _emscripten_glVertex2f=_glVertex2f;var _glVertex2fv=p=>{_glVertex2f(HEAPF32[p>>2],HEAPF32[p+4>>2])};var _emscripten_glVertex2fv=_glVertex2fv;var _glVertex2i=_glVertex2f;var _emscripten_glVertex2i=_glVertex2i;var _glVertex3f=(x,y,z)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=x;GLImmediate.vertexData[GLImmediate.vertexCounter++]=y;GLImmediate.vertexData[GLImmediate.vertexCounter++]=z;GLImmediate.vertexData[GLImmediate.vertexCounter++]=1;GLImmediate.addRendererComponent(GLImmediate.VERTEX,4,GLctx.FLOAT)};var _emscripten_glVertex3f=_glVertex3f;var _glVertex3fv=p=>{_glVertex3f(HEAPF32[p>>2],HEAPF32[p+4>>2],HEAPF32[p+8>>2])};var _emscripten_glVertex3fv=_glVertex3fv;var _glVertex3i=_glVertex3f;var _emscripten_glVertex3i=_glVertex3i;var _glVertex4f=(x,y,z,w)=>{GLImmediate.vertexData[GLImmediate.vertexCounter++]=x;GLImmediate.vertexData[GLImmediate.vertexCounter++]=y;GLImmediate.vertexData[GLImmediate.vertexCounter++]=z;GLImmediate.vertexData[GLImmediate.vertexCounter++]=w;GLImmediate.addRendererComponent(GLImmediate.VERTEX,4,GLctx.FLOAT)};var _emscripten_glVertex4f=_glVertex4f;var _glVertex4fv=p=>{_glVertex4f(HEAPF32[p>>2],HEAPF32[p+4>>2],HEAPF32[p+8>>2],HEAPF32[p+12>>2])};var _emscripten_glVertex4fv=_glVertex4fv;var _glVertex4i=_glVertex4f;var _emscripten_glVertex4i=_glVertex4i;function _glVertexAttrib1f(x0,x1){GLctx.vertexAttrib1f(x0,x1)}var _emscripten_glVertexAttrib1f=_glVertexAttrib1f;var _glVertexAttrib1fv=(index,v)=>{GLctx.vertexAttrib1f(index,HEAPF32[v>>2])};var _emscripten_glVertexAttrib1fv=_glVertexAttrib1fv;function _glVertexAttrib2f(x0,x1,x2){GLctx.vertexAttrib2f(x0,x1,x2)}var _emscripten_glVertexAttrib2f=_glVertexAttrib2f;var _glVertexAttrib2fv=(index,v)=>{GLctx.vertexAttrib2f(index,HEAPF32[v>>2],HEAPF32[v+4>>2])};var _emscripten_glVertexAttrib2fv=_glVertexAttrib2fv;function _glVertexAttrib3f(x0,x1,x2,x3){GLctx.vertexAttrib3f(x0,x1,x2,x3)}var _emscripten_glVertexAttrib3f=_glVertexAttrib3f;var _glVertexAttrib3fv=(index,v)=>{GLctx.vertexAttrib3f(index,HEAPF32[v>>2],HEAPF32[v+4>>2],HEAPF32[v+8>>2])};var _emscripten_glVertexAttrib3fv=_glVertexAttrib3fv;function _glVertexAttrib4f(x0,x1,x2,x3,x4){GLctx.vertexAttrib4f(x0,x1,x2,x3,x4)}var _emscripten_glVertexAttrib4f=_glVertexAttrib4f;var _glVertexAttrib4fv=(index,v)=>{GLctx.vertexAttrib4f(index,HEAPF32[v>>2],HEAPF32[v+4>>2],HEAPF32[v+8>>2],HEAPF32[v+12>>2])};var _emscripten_glVertexAttrib4fv=_glVertexAttrib4fv;var _glVertexAttribDivisor=(index,divisor)=>{GLctx.vertexAttribDivisor(index,divisor)};var _glVertexAttribDivisorANGLE=_glVertexAttribDivisor;var _emscripten_glVertexAttribDivisorANGLE=_glVertexAttribDivisorANGLE;var _emscripten_glVertexAttribPointer=_glVertexAttribPointer;var _glVertexPointer=(size,type,stride,pointer)=>{GLImmediate.setClientAttribute(GLImmediate.VERTEX,size,type,stride,pointer)};var _emscripten_glVertexPointer=_glVertexPointer;function _glViewport(x0,x1,x2,x3){GLctx.viewport(x0,x1,x2,x3)}var _emscripten_glViewport=_glViewport;var _emscripten_has_asyncify=()=>0;var _emscripten_memcpy_js=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var doRequestFullscreen=(target,strategy)=>{if(!JSEvents.fullscreenEnabled())return-1;target=findEventTarget(target);if(!target)return-4;if(!target.requestFullscreen&&!target.webkitRequestFullscreen){return-3}var canPerformRequests=JSEvents.canPerformEventHandlerRequests();if(!canPerformRequests){if(strategy.deferUntilInEventHandler){JSEvents.deferCall(JSEvents_requestFullscreen,1,[target,strategy]);return 1}return-2}return JSEvents_requestFullscreen(target,strategy)};var _emscripten_request_fullscreen_strategy=(target,deferUntilInEventHandler,fullscreenStrategy)=>{var strategy={scaleMode:HEAP32[fullscreenStrategy>>2],canvasResolutionScaleMode:HEAP32[fullscreenStrategy+4>>2],filteringMode:HEAP32[fullscreenStrategy+8>>2],deferUntilInEventHandler:deferUntilInEventHandler,canvasResizedCallback:HEAP32[fullscreenStrategy+12>>2],canvasResizedCallbackUserData:HEAP32[fullscreenStrategy+16>>2]};return doRequestFullscreen(target,strategy)};var _emscripten_request_pointerlock=(target,deferUntilInEventHandler)=>{target=findEventTarget(target);if(!target)return-4;if(!target.requestPointerLock){return-1}var canPerformRequests=JSEvents.canPerformEventHandlerRequests();if(!canPerformRequests){if(deferUntilInEventHandler){JSEvents.deferCall(requestPointerLock,2,[target]);return 1}return-2}return requestPointerLock(target)};var getHeapMax=()=>2147483648;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}var alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var _emscripten_sample_gamepad_data=()=>(JSEvents.lastGamepadState=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():null)?0:-1;var registerBeforeUnloadEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString)=>{var beforeUnloadEventHandlerFunc=(e=event)=>{var confirmationMessage=getWasmTableEntry(callbackfunc)(eventTypeId,0,userData);if(confirmationMessage){confirmationMessage=UTF8ToString(confirmationMessage)}if(confirmationMessage){e.preventDefault();e.returnValue=confirmationMessage;return confirmationMessage}};var eventHandler={target:findEventTarget(target),eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:beforeUnloadEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_beforeunload_callback_on_thread=(userData,callbackfunc,targetThread)=>{if(typeof onbeforeunload=="undefined")return-1;if(targetThread!==1)return-5;return registerBeforeUnloadEventCallback(2,userData,true,callbackfunc,28,"beforeunload")};var registerFocusEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.focusEvent)JSEvents.focusEvent=_malloc(256);var focusEventHandlerFunc=(e=event)=>{var nodeName=JSEvents.getNodeNameForTarget(e.target);var id=e.target.id?e.target.id:"";var focusEvent=JSEvents.focusEvent;stringToUTF8(nodeName,focusEvent+0,128);stringToUTF8(id,focusEvent+128,128);if(getWasmTableEntry(callbackfunc)(eventTypeId,focusEvent,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:focusEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_blur_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerFocusEventCallback(target,userData,useCapture,callbackfunc,12,"blur",targetThread);var _emscripten_set_element_css_size=(target,width,height)=>{target=findEventTarget(target);if(!target)return-4;target.style.width=width+"px";target.style.height=height+"px";return 0};var _emscripten_set_focus_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerFocusEventCallback(target,userData,useCapture,callbackfunc,13,"focus",targetThread);var fillFullscreenChangeEventData=eventStruct=>{var fullscreenElement=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;var isFullscreen=!!fullscreenElement;HEAP32[eventStruct>>2]=isFullscreen;HEAP32[eventStruct+4>>2]=JSEvents.fullscreenEnabled();var reportedElement=isFullscreen?fullscreenElement:JSEvents.previousFullscreenElement;var nodeName=JSEvents.getNodeNameForTarget(reportedElement);var id=reportedElement&&reportedElement.id?reportedElement.id:"";stringToUTF8(nodeName,eventStruct+8,128);stringToUTF8(id,eventStruct+136,128);HEAP32[eventStruct+264>>2]=reportedElement?reportedElement.clientWidth:0;HEAP32[eventStruct+268>>2]=reportedElement?reportedElement.clientHeight:0;HEAP32[eventStruct+272>>2]=screen.width;HEAP32[eventStruct+276>>2]=screen.height;if(isFullscreen){JSEvents.previousFullscreenElement=fullscreenElement}};var registerFullscreenChangeEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.fullscreenChangeEvent)JSEvents.fullscreenChangeEvent=_malloc(280);var fullscreenChangeEventhandlerFunc=(e=event)=>{var fullscreenChangeEvent=JSEvents.fullscreenChangeEvent;fillFullscreenChangeEventData(fullscreenChangeEvent);if(getWasmTableEntry(callbackfunc)(eventTypeId,fullscreenChangeEvent,userData))e.preventDefault()};var eventHandler={target:target,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:fullscreenChangeEventhandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_fullscreenchange_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>{if(!JSEvents.fullscreenEnabled())return-1;target=findEventTarget(target);if(!target)return-4;registerFullscreenChangeEventCallback(target,userData,useCapture,callbackfunc,19,"webkitfullscreenchange",targetThread);return registerFullscreenChangeEventCallback(target,userData,useCapture,callbackfunc,19,"fullscreenchange",targetThread)};var registerGamepadEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.gamepadEvent)JSEvents.gamepadEvent=_malloc(1432);var gamepadEventHandlerFunc=(e=event)=>{var gamepadEvent=JSEvents.gamepadEvent;fillGamepadEventData(gamepadEvent,e["gamepad"]);if(getWasmTableEntry(callbackfunc)(eventTypeId,gamepadEvent,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:gamepadEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_gamepadconnected_callback_on_thread=(userData,useCapture,callbackfunc,targetThread)=>{if(!navigator.getGamepads&&!navigator.webkitGetGamepads)return-1;return registerGamepadEventCallback(2,userData,useCapture,callbackfunc,26,"gamepadconnected",targetThread)};var _emscripten_set_gamepaddisconnected_callback_on_thread=(userData,useCapture,callbackfunc,targetThread)=>{if(!navigator.getGamepads&&!navigator.webkitGetGamepads)return-1;return registerGamepadEventCallback(2,userData,useCapture,callbackfunc,27,"gamepaddisconnected",targetThread)};var registerKeyEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.keyEvent)JSEvents.keyEvent=_malloc(176);var keyEventHandlerFunc=e=>{var keyEventData=JSEvents.keyEvent;HEAPF64[keyEventData>>3]=e.timeStamp;var idx=keyEventData>>2;HEAP32[idx+2]=e.location;HEAP32[idx+3]=e.ctrlKey;HEAP32[idx+4]=e.shiftKey;HEAP32[idx+5]=e.altKey;HEAP32[idx+6]=e.metaKey;HEAP32[idx+7]=e.repeat;HEAP32[idx+8]=e.charCode;HEAP32[idx+9]=e.keyCode;HEAP32[idx+10]=e.which;stringToUTF8(e.key||"",keyEventData+44,32);stringToUTF8(e.code||"",keyEventData+76,32);stringToUTF8(e.char||"",keyEventData+108,32);stringToUTF8(e.locale||"",keyEventData+140,32);if(getWasmTableEntry(callbackfunc)(eventTypeId,keyEventData,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:keyEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_keydown_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerKeyEventCallback(target,userData,useCapture,callbackfunc,2,"keydown",targetThread);var _emscripten_set_keypress_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerKeyEventCallback(target,userData,useCapture,callbackfunc,1,"keypress",targetThread);var _emscripten_set_keyup_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerKeyEventCallback(target,userData,useCapture,callbackfunc,3,"keyup",targetThread);var _emscripten_set_main_loop=(func,fps,simulateInfiniteLoop)=>{var browserIterationFunc=getWasmTableEntry(func);setMainLoop(browserIterationFunc,fps,simulateInfiniteLoop)};var fillMouseEventData=(eventStruct,e,target)=>{HEAPF64[eventStruct>>3]=e.timeStamp;var idx=eventStruct>>2;HEAP32[idx+2]=e.screenX;HEAP32[idx+3]=e.screenY;HEAP32[idx+4]=e.clientX;HEAP32[idx+5]=e.clientY;HEAP32[idx+6]=e.ctrlKey;HEAP32[idx+7]=e.shiftKey;HEAP32[idx+8]=e.altKey;HEAP32[idx+9]=e.metaKey;HEAP16[idx*2+20]=e.button;HEAP16[idx*2+21]=e.buttons;HEAP32[idx+11]=e["movementX"];HEAP32[idx+12]=e["movementY"];var rect=getBoundingClientRect(target);HEAP32[idx+13]=e.clientX-rect.left;HEAP32[idx+14]=e.clientY-rect.top};var registerMouseEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.mouseEvent)JSEvents.mouseEvent=_malloc(72);target=findEventTarget(target);var mouseEventHandlerFunc=(e=event)=>{fillMouseEventData(JSEvents.mouseEvent,e,target);if(getWasmTableEntry(callbackfunc)(eventTypeId,JSEvents.mouseEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString!="mousemove"&&eventTypeString!="mouseenter"&&eventTypeString!="mouseleave",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:mouseEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_mousedown_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,5,"mousedown",targetThread);var _emscripten_set_mouseenter_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,33,"mouseenter",targetThread);var _emscripten_set_mouseleave_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,34,"mouseleave",targetThread);var _emscripten_set_mousemove_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,8,"mousemove",targetThread);var _emscripten_set_mouseup_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,6,"mouseup",targetThread);var fillPointerlockChangeEventData=eventStruct=>{var pointerLockElement=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement||document.msPointerLockElement;var isPointerlocked=!!pointerLockElement;HEAP32[eventStruct>>2]=isPointerlocked;var nodeName=JSEvents.getNodeNameForTarget(pointerLockElement);var id=pointerLockElement&&pointerLockElement.id?pointerLockElement.id:"";stringToUTF8(nodeName,eventStruct+4,128);stringToUTF8(id,eventStruct+132,128)};var registerPointerlockChangeEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.pointerlockChangeEvent)JSEvents.pointerlockChangeEvent=_malloc(260);var pointerlockChangeEventHandlerFunc=(e=event)=>{var pointerlockChangeEvent=JSEvents.pointerlockChangeEvent;fillPointerlockChangeEventData(pointerlockChangeEvent);if(getWasmTableEntry(callbackfunc)(eventTypeId,pointerlockChangeEvent,userData))e.preventDefault()};var eventHandler={target:target,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:pointerlockChangeEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_pointerlockchange_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>{if(!document||!document.body||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock){return-1}target=findEventTarget(target);if(!target)return-4;registerPointerlockChangeEventCallback(target,userData,useCapture,callbackfunc,20,"mozpointerlockchange",targetThread);registerPointerlockChangeEventCallback(target,userData,useCapture,callbackfunc,20,"webkitpointerlockchange",targetThread);registerPointerlockChangeEventCallback(target,userData,useCapture,callbackfunc,20,"mspointerlockchange",targetThread);return registerPointerlockChangeEventCallback(target,userData,useCapture,callbackfunc,20,"pointerlockchange",targetThread)};var registerUiEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.uiEvent)JSEvents.uiEvent=_malloc(36);target=findEventTarget(target);var uiEventHandlerFunc=(e=event)=>{if(e.target!=target){return}var b=document.body;if(!b){return}var uiEvent=JSEvents.uiEvent;HEAP32[uiEvent>>2]=e.detail;HEAP32[uiEvent+4>>2]=b.clientWidth;HEAP32[uiEvent+8>>2]=b.clientHeight;HEAP32[uiEvent+12>>2]=innerWidth;HEAP32[uiEvent+16>>2]=innerHeight;HEAP32[uiEvent+20>>2]=outerWidth;HEAP32[uiEvent+24>>2]=outerHeight;HEAP32[uiEvent+28>>2]=pageXOffset;HEAP32[uiEvent+32>>2]=pageYOffset;if(getWasmTableEntry(callbackfunc)(eventTypeId,uiEvent,userData))e.preventDefault()};var eventHandler={target:target,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:uiEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_resize_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerUiEventCallback(target,userData,useCapture,callbackfunc,10,"resize",targetThread);var registerTouchEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.touchEvent)JSEvents.touchEvent=_malloc(1696);target=findEventTarget(target);var touchEventHandlerFunc=e=>{var t,touches={},et=e.touches;for(var i=0;i>3]=e.timeStamp;var idx=touchEvent>>2;HEAP32[idx+3]=e.ctrlKey;HEAP32[idx+4]=e.shiftKey;HEAP32[idx+5]=e.altKey;HEAP32[idx+6]=e.metaKey;idx+=7;var targetRect=getBoundingClientRect(target);var numTouches=0;for(var i in touches){t=touches[i];HEAP32[idx+0]=t.identifier;HEAP32[idx+1]=t.screenX;HEAP32[idx+2]=t.screenY;HEAP32[idx+3]=t.clientX;HEAP32[idx+4]=t.clientY;HEAP32[idx+5]=t.pageX;HEAP32[idx+6]=t.pageY;HEAP32[idx+7]=t.isChanged;HEAP32[idx+8]=t.onTarget;HEAP32[idx+9]=t.clientX-targetRect.left;HEAP32[idx+10]=t.clientY-targetRect.top;idx+=13;if(++numTouches>31){break}}HEAP32[touchEvent+8>>2]=numTouches;if(getWasmTableEntry(callbackfunc)(eventTypeId,touchEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString=="touchstart"||eventTypeString=="touchend",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:touchEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_touchcancel_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerTouchEventCallback(target,userData,useCapture,callbackfunc,25,"touchcancel",targetThread);var _emscripten_set_touchend_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerTouchEventCallback(target,userData,useCapture,callbackfunc,23,"touchend",targetThread);var _emscripten_set_touchmove_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerTouchEventCallback(target,userData,useCapture,callbackfunc,24,"touchmove",targetThread);var _emscripten_set_touchstart_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerTouchEventCallback(target,userData,useCapture,callbackfunc,22,"touchstart",targetThread);var fillVisibilityChangeEventData=eventStruct=>{var visibilityStates=["hidden","visible","prerender","unloaded"];var visibilityState=visibilityStates.indexOf(document.visibilityState);HEAP32[eventStruct>>2]=document.hidden;HEAP32[eventStruct+4>>2]=visibilityState};var registerVisibilityChangeEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.visibilityChangeEvent)JSEvents.visibilityChangeEvent=_malloc(8);var visibilityChangeEventHandlerFunc=(e=event)=>{var visibilityChangeEvent=JSEvents.visibilityChangeEvent;fillVisibilityChangeEventData(visibilityChangeEvent);if(getWasmTableEntry(callbackfunc)(eventTypeId,visibilityChangeEvent,userData))e.preventDefault()};var eventHandler={target:target,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:visibilityChangeEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_visibilitychange_callback_on_thread=(userData,useCapture,callbackfunc,targetThread)=>{if(!specialHTMLTargets[1]){return-4}return registerVisibilityChangeEventCallback(specialHTMLTargets[1],userData,useCapture,callbackfunc,21,"visibilitychange",targetThread)};var registerWheelEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.wheelEvent)JSEvents.wheelEvent=_malloc(104);var wheelHandlerFunc=(e=event)=>{var wheelEvent=JSEvents.wheelEvent;fillMouseEventData(wheelEvent,e,target);HEAPF64[wheelEvent+72>>3]=e["deltaX"];HEAPF64[wheelEvent+80>>3]=e["deltaY"];HEAPF64[wheelEvent+88>>3]=e["deltaZ"];HEAP32[wheelEvent+96>>2]=e["deltaMode"];if(getWasmTableEntry(callbackfunc)(eventTypeId,wheelEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:wheelHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_wheel_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>{target=findEventTarget(target);if(!target)return-4;if(typeof target.onwheel!="undefined"){return registerWheelEventCallback(target,userData,useCapture,callbackfunc,9,"wheel",targetThread)}else{return-1}};var _emscripten_set_window_title=title=>document.title=UTF8ToString(title);var _emscripten_sleep=()=>{throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"};var ENV={};var getExecutableName=()=>thisProgram||"./this.program";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};var stringToAscii=(str,buffer)=>{for(var i=0;i>0]=str.charCodeAt(i)}HEAP8[buffer>>0]=0};var _environ_get=(__environ,environ_buf)=>{var bufSize=0;getEnvStrings().forEach((string,i)=>{var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1});return 0};var _environ_sizes_get=(penviron_count,penviron_buf_size)=>{var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(string=>bufSize+=string.length+1);HEAPU32[penviron_buf_size>>2]=bufSize;return 0};function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doReadv=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var convertI32PairToI53Checked=(lo,hi)=>hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN;function _fd_seek(fd,offset_low,offset_high,whence,newOffset){var offset=convertI32PairToI53Checked(offset_low,offset_high);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doWritev=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!=="undefined"){offset+=curr}}return ret};function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU32[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var GLEW={isLinaroFork:1,extensions:null,error:{0:null,1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null},version:{1:null,2:null,3:null,4:null},errorStringConstantFromCode(error){if(GLEW.isLinaroFork){switch(error){case 4:return"OpenGL ES lib expected, found OpenGL lib";case 5:return"OpenGL lib expected, found OpenGL ES lib";case 6:return"Missing EGL version";case 7:return"EGL 1.1 and up are supported";default:break}}switch(error){case 0:return"No error";case 1:return"Missing GL version";case 2:return"GL 1.1 and up are supported";case 3:return"GLX 1.2 and up are supported";default:return null}},errorString(error){if(!GLEW.error[error]){var string=GLEW.errorStringConstantFromCode(error);if(!string){string="Unknown error";error=8}GLEW.error[error]=stringToNewUTF8(string)}return GLEW.error[error]},versionStringConstantFromCode(name){switch(name){case 1:return"1.10.0";case 2:return"1";case 3:return"10";case 4:return"0";default:return null}},versionString(name){if(!GLEW.version[name]){var string=GLEW.versionStringConstantFromCode(name);if(!string)return 0;GLEW.version[name]=stringToNewUTF8(string)}return GLEW.version[name]},extensionIsSupported(name){if(!GLEW.extensions){GLEW.extensions=GL.getExtensions()}if(GLEW.extensions.includes(name))return 1;return GLEW.extensions.includes("GL_"+name)}};var _glewGetErrorString=error=>GLEW.errorString(error);var _glewInit=()=>0;var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var arraySum=(array,index)=>{var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum};var MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];var addDays=(date,days)=>{var newDate=new Date(date.getTime());while(days>0){var leap=isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)};var _strftime=(s,maxsize,format,tm)=>{var tm_zone=HEAPU32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%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 rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value=="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}return thisDate.getFullYear()}return thisDate.getFullYear()-1}var EXPANSION_RULES_2={"%a":date=>WEEKDAYS[date.tm_wday].substring(0,3),"%A":date=>WEEKDAYS[date.tm_wday],"%b":date=>MONTHS[date.tm_mon].substring(0,3),"%B":date=>MONTHS[date.tm_mon],"%C":date=>{var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":date=>leadingNulls(date.tm_mday,2),"%e":date=>leadingSomething(date.tm_mday,2," "),"%g":date=>getWeekBasedYear(date).toString().substring(2),"%G":date=>getWeekBasedYear(date),"%H":date=>leadingNulls(date.tm_hour,2),"%I":date=>{var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":date=>leadingNulls(date.tm_mday+arraySum(isLeapYear(date.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date.tm_mon-1),3),"%m":date=>leadingNulls(date.tm_mon+1,2),"%M":date=>leadingNulls(date.tm_min,2),"%n":()=>"\n","%p":date=>{if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}return"PM"},"%S":date=>leadingNulls(date.tm_sec,2),"%t":()=>"\t","%u":date=>date.tm_wday||7,"%U":date=>{var days=date.tm_yday+7-date.tm_wday;return leadingNulls(Math.floor(days/7),2)},"%V":date=>{var val=Math.floor((date.tm_yday+7-(date.tm_wday+6)%7)/7);if((date.tm_wday+371-date.tm_yday-2)%7<=2){val++}if(!val){val=52;var dec31=(date.tm_wday+7-date.tm_yday-1)%7;if(dec31==4||dec31==5&&isLeapYear(date.tm_year%400-1)){val++}}else if(val==53){var jan1=(date.tm_wday+371-date.tm_yday)%7;if(jan1!=4&&(jan1!=3||!isLeapYear(date.tm_year)))val=1}return leadingNulls(val,2)},"%w":date=>date.tm_wday,"%W":date=>{var days=date.tm_yday+7-(date.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2)},"%y":date=>(date.tm_year+1900).toString().substring(2),"%Y":date=>date.tm_year+1900,"%z":date=>{var off=date.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":date=>date.tm_zone,"%%":()=>"%"};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1};var _strftime_l=(s,maxsize,format,tm,loc)=>_strftime(s,maxsize,format,tm);var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_unlink"]=FS.unlink;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["requestFullscreen"]=(lockPointer,resizeCanvas)=>Browser.requestFullscreen(lockPointer,resizeCanvas);Module["requestAnimationFrame"]=func=>Browser.requestAnimationFrame(func);Module["setCanvasSize"]=(width,height,noUpdates)=>Browser.setCanvasSize(width,height,noUpdates);Module["pauseMainLoop"]=()=>Browser.mainLoop.pause();Module["resumeMainLoop"]=()=>Browser.mainLoop.resume();Module["getUserMedia"]=()=>Browser.getUserMedia();Module["createContext"]=(canvas,useWebGL,setInModule,webGLContextAttributes)=>Browser.createContext(canvas,useWebGL,setInModule,webGLContextAttributes);var preloadedImages={};var preloadedAudios={};var GLctx;GLImmediate.setupFuncs();Browser.moduleContextCreatedCallbacks.push(()=>GLImmediate.init());GLEmulation.init();for(var i=0;i<32;++i)tempFixedLengthArray.push(new Array(i));var miniTempWebGLFloatBuffersStorage=new Float32Array(288);for(var i=0;i<288;++i){miniTempWebGLFloatBuffers[i]=miniTempWebGLFloatBuffersStorage.subarray(0,i+1)}var miniTempWebGLIntBuffersStorage=new Int32Array(288);for(var i=0;i<288;++i){miniTempWebGLIntBuffers[i]=miniTempWebGLIntBuffersStorage.subarray(0,i+1)}var wasmImports={d:___assert_fail,b:___cxa_throw,fa:___syscall_fcntl64,Sa:___syscall_getcwd,Va:___syscall_getdents64,_a:___syscall_ioctl,Qa:___syscall_lstat64,Pa:___syscall_newfstatat,ga:___syscall_openat,Ra:___syscall_stat64,$a:__emscripten_get_now_is_monotonic,u:_abort,za:_eglBindAPI,Ka:_eglChooseConfig,Ia:_eglCreateContext,Ga:_eglCreateWindowSurface,Ha:_eglDestroyContext,Fa:_eglDestroySurface,Ja:_eglGetConfigAttrib,aa:_eglGetDisplay,xa:_eglGetError,Ma:_eglInitialize,Ea:_eglMakeCurrent,ya:_eglQueryString,Da:_eglSwapBuffers,Ca:_eglSwapInterval,La:_eglTerminate,Aa:_eglWaitGL,Ba:_eglWaitNative,x:_emscripten_asm_const_int,a:_emscripten_asm_const_int_sync_on_main_thread,ia:_emscripten_date_now,ra:_emscripten_exit_fullscreen,va:_emscripten_exit_pointerlock,m:_emscripten_get_device_pixel_ratio,h:_emscripten_get_element_css_size,ba:_emscripten_get_gamepad_status,D:_emscripten_get_now,Na:_emscripten_get_num_gamepads,wa:_emscripten_get_screen_size,Ld:_emscripten_glActiveTexture,_e:_emscripten_glAlphaFunc,na:_emscripten_glAttachShader,Cf:_emscripten_glBegin,Td:_emscripten_glBeginQueryEXT,Jd:_emscripten_glBindAttribLocation,Id:_emscripten_glBindBuffer,Hd:_emscripten_glBindFramebuffer,Ef:_emscripten_glBindProgram,Gd:_emscripten_glBindRenderbuffer,Fd:_emscripten_glBindTexture,de:_emscripten_glBindVertexArrayOES,Ed:_emscripten_glBlendColor,Dd:_emscripten_glBlendEquation,Cd:_emscripten_glBlendEquationSeparate,Bd:_emscripten_glBlendFunc,Ad:_emscripten_glBlendFuncSeparate,zd:_emscripten_glBufferData,yd:_emscripten_glBufferSubData,xd:_emscripten_glCheckFramebufferStatus,wd:_emscripten_glClear,vd:_emscripten_glClearColor,ud:_emscripten_glClearDepthf,td:_emscripten_glClearStencil,Re:_emscripten_glClientActiveTexture,we:_emscripten_glClipPlane,rf:_emscripten_glColor3d,qf:_emscripten_glColor3f,gf:_emscripten_glColor3fv,pf:_emscripten_glColor3ub,ff:_emscripten_glColor3ubv,of:_emscripten_glColor3ui,ef:_emscripten_glColor3uiv,nf:_emscripten_glColor3us,df:_emscripten_glColor3usv,mf:_emscripten_glColor4d,lf:_emscripten_glColor4f,cf:_emscripten_glColor4fv,kf:_emscripten_glColor4ub,bf:_emscripten_glColor4ubv,jf:_emscripten_glColor4ui,hf:_emscripten_glColor4us,sd:_emscripten_glColorMask,Te:_emscripten_glColorPointer,rd:_emscripten_glCompileShader,qd:_emscripten_glCompressedTexImage2D,od:_emscripten_glCompressedTexSubImage2D,nd:_emscripten_glCopyTexImage2D,md:_emscripten_glCopyTexSubImage2D,qa:_emscripten_glCreateProgram,oa:_emscripten_glCreateShader,ld:_emscripten_glCullFace,kd:_emscripten_glDeleteBuffers,jd:_emscripten_glDeleteFramebuffers,la:_emscripten_glDeleteObject,id:_emscripten_glDeleteProgram,Wd:_emscripten_glDeleteQueriesEXT,hd:_emscripten_glDeleteRenderbuffers,gd:_emscripten_glDeleteShader,fd:_emscripten_glDeleteTextures,ce:_emscripten_glDeleteVertexArraysOES,ed:_emscripten_glDepthFunc,dd:_emscripten_glDepthMask,cd:_emscripten_glDepthRangef,ma:_emscripten_glDetachShader,bd:_emscripten_glDisable,We:_emscripten_glDisableClientState,ad:_emscripten_glDisableVertexAttribArray,$c:_emscripten_glDrawArrays,_d:_emscripten_glDrawArraysInstancedANGLE,ve:_emscripten_glDrawBuffer,$d:_emscripten_glDrawBuffersWEBGL,_c:_emscripten_glDrawElements,Zd:_emscripten_glDrawElementsInstancedANGLE,Ye:_emscripten_glDrawRangeElements,Zc:_emscripten_glEnable,Xe:_emscripten_glEnableClientState,Yc:_emscripten_glEnableVertexAttribArray,Bf:_emscripten_glEnd,Sd:_emscripten_glEndQueryEXT,Xc:_emscripten_glFinish,Vc:_emscripten_glFlush,Uc:_emscripten_glFramebufferRenderbuffer,Tc:_emscripten_glFramebufferTexture2D,Sc:_emscripten_glFrontFace,De:_emscripten_glFrustum,Rc:_emscripten_glGenBuffers,Pc:_emscripten_glGenFramebuffers,Xd:_emscripten_glGenQueriesEXT,Oc:_emscripten_glGenRenderbuffers,Nc:_emscripten_glGenTextures,be:_emscripten_glGenVertexArraysOES,Qc:_emscripten_glGenerateMipmap,Mc:_emscripten_glGetActiveAttrib,Kc:_emscripten_glGetActiveUniform,Jc:_emscripten_glGetAttachedShaders,Ic:_emscripten_glGetAttribLocation,Hc:_emscripten_glGetBooleanv,Gc:_emscripten_glGetBufferParameteriv,Fc:_emscripten_glGetError,Ec:_emscripten_glGetFloatv,Dc:_emscripten_glGetFramebufferAttachmentParameteriv,Ff:_emscripten_glGetInfoLog,Cc:_emscripten_glGetIntegerv,ka:_emscripten_glGetObjectParameteriv,Df:_emscripten_glGetPointerv,Ac:_emscripten_glGetProgramInfoLog,Bc:_emscripten_glGetProgramiv,Nd:_emscripten_glGetQueryObjecti64vEXT,Pd:_emscripten_glGetQueryObjectivEXT,Md:_emscripten_glGetQueryObjectui64vEXT,Od:_emscripten_glGetQueryObjectuivEXT,Qd:_emscripten_glGetQueryivEXT,zc:_emscripten_glGetRenderbufferParameteriv,xc:_emscripten_glGetShaderInfoLog,wc:_emscripten_glGetShaderPrecisionFormat,vc:_emscripten_glGetShaderSource,yc:_emscripten_glGetShaderiv,uc:_emscripten_glGetString,ne:_emscripten_glGetTexEnvfv,me:_emscripten_glGetTexEnviv,fe:_emscripten_glGetTexLevelParameteriv,tc:_emscripten_glGetTexParameterfv,sc:_emscripten_glGetTexParameteriv,oc:_emscripten_glGetUniformLocation,rc:_emscripten_glGetUniformfv,pc:_emscripten_glGetUniformiv,lc:_emscripten_glGetVertexAttribPointerv,nc:_emscripten_glGetVertexAttribfv,mc:_emscripten_glGetVertexAttribiv,kc:_emscripten_glHint,jc:_emscripten_glIsBuffer,ic:_emscripten_glIsEnabled,hc:_emscripten_glIsFramebuffer,gc:_emscripten_glIsProgram,Ud:_emscripten_glIsQueryEXT,fc:_emscripten_glIsRenderbuffer,ec:_emscripten_glIsShader,dc:_emscripten_glIsTexture,ae:_emscripten_glIsVertexArrayOES,se:_emscripten_glLightModelf,re:_emscripten_glLightModelfv,te:_emscripten_glLightfv,cc:_emscripten_glLineWidth,bc:_emscripten_glLinkProgram,Ne:_emscripten_glLoadIdentity,Me:_emscripten_glLoadMatrixd,Le:_emscripten_glLoadMatrixf,Je:_emscripten_glLoadTransposeMatrixd,Ke:_emscripten_glLoadTransposeMatrixf,qe:_emscripten_glMaterialfv,Qe:_emscripten_glMatrixMode,Ge:_emscripten_glMultMatrixd,Fe:_emscripten_glMultMatrixf,He:_emscripten_glMultTransposeMatrixd,Ie:_emscripten_glMultTransposeMatrixf,Ze:_emscripten_glNormal3f,Ue:_emscripten_glNormalPointer,Ee:_emscripten_glOrtho,ac:_emscripten_glPixelStorei,$e:_emscripten_glPolygonMode,$b:_emscripten_glPolygonOffset,Oe:_emscripten_glPopMatrix,Pe:_emscripten_glPushMatrix,Rd:_emscripten_glQueryCounterEXT,ue:_emscripten_glReadBuffer,_b:_emscripten_glReadPixels,Zb:_emscripten_glReleaseShaderCompiler,Yb:_emscripten_glRenderbufferStorage,Ce:_emscripten_glRotated,Be:_emscripten_glRotatef,Xb:_emscripten_glSampleCoverage,Ae:_emscripten_glScaled,ze:_emscripten_glScalef,Wb:_emscripten_glScissor,ee:_emscripten_glShadeModel,Vb:_emscripten_glShaderBinary,Ub:_emscripten_glShaderSource,Tb:_emscripten_glStencilFunc,Sb:_emscripten_glStencilFuncSeparate,Rb:_emscripten_glStencilMask,Qb:_emscripten_glStencilMaskSeparate,Pb:_emscripten_glStencilOp,Ob:_emscripten_glStencilOpSeparate,ke:_emscripten_glTexCoord2f,ge:_emscripten_glTexCoord2fv,je:_emscripten_glTexCoord2i,ie:_emscripten_glTexCoord3f,he:_emscripten_glTexCoord4f,Se:_emscripten_glTexCoordPointer,oe:_emscripten_glTexGenfv,pe:_emscripten_glTexGeni,le:_emscripten_glTexImage1D,Nb:_emscripten_glTexImage2D,Mb:_emscripten_glTexParameterf,Lb:_emscripten_glTexParameterfv,Kb:_emscripten_glTexParameteri,Jb:_emscripten_glTexParameteriv,Ib:_emscripten_glTexSubImage2D,ye:_emscripten_glTranslated,xe:_emscripten_glTranslatef,Hb:_emscripten_glUniform1f,Gb:_emscripten_glUniform1fv,Fb:_emscripten_glUniform1i,Eb:_emscripten_glUniform1iv,Cb:_emscripten_glUniform2f,Bb:_emscripten_glUniform2fv,Ab:_emscripten_glUniform2i,zb:_emscripten_glUniform2iv,yb:_emscripten_glUniform3f,xb:_emscripten_glUniform3fv,wb:_emscripten_glUniform3i,vb:_emscripten_glUniform3iv,ub:_emscripten_glUniform4f,tb:_emscripten_glUniform4fv,rb:_emscripten_glUniform4i,qb:_emscripten_glUniform4iv,pb:_emscripten_glUniformMatrix2fv,ob:_emscripten_glUniformMatrix3fv,nb:_emscripten_glUniformMatrix4fv,pa:_emscripten_glUseProgram,mb:_emscripten_glValidateProgram,Af:_emscripten_glVertex2f,uf:_emscripten_glVertex2fv,zf:_emscripten_glVertex2i,yf:_emscripten_glVertex3f,tf:_emscripten_glVertex3fv,xf:_emscripten_glVertex3i,wf:_emscripten_glVertex4f,sf:_emscripten_glVertex4fv,vf:_emscripten_glVertex4i,lb:_emscripten_glVertexAttrib1f,kb:_emscripten_glVertexAttrib1fv,jb:_emscripten_glVertexAttrib2f,ib:_emscripten_glVertexAttrib2fv,gb:_emscripten_glVertexAttrib3f,fb:_emscripten_glVertexAttrib3fv,eb:_emscripten_glVertexAttrib4f,db:_emscripten_glVertexAttrib4fv,Yd:_emscripten_glVertexAttribDivisorANGLE,cb:_emscripten_glVertexAttribPointer,Ve:_emscripten_glVertexPointer,bb:_emscripten_glViewport,C:_emscripten_has_asyncify,ab:_emscripten_memcpy_js,sa:_emscripten_request_fullscreen_strategy,$:_emscripten_request_pointerlock,Ua:_emscripten_resize_heap,ca:_emscripten_sample_gamepad_data,H:_emscripten_set_beforeunload_callback_on_thread,T:_emscripten_set_blur_callback_on_thread,l:_emscripten_set_canvas_element_size,A:_emscripten_set_element_css_size,U:_emscripten_set_focus_callback_on_thread,K:_emscripten_set_fullscreenchange_callback_on_thread,t:_emscripten_set_gamepadconnected_callback_on_thread,s:_emscripten_set_gamepaddisconnected_callback_on_thread,N:_emscripten_set_keydown_callback_on_thread,L:_emscripten_set_keypress_callback_on_thread,M:_emscripten_set_keyup_callback_on_thread,pd:_emscripten_set_main_loop,Z:_emscripten_set_mousedown_callback_on_thread,X:_emscripten_set_mouseenter_callback_on_thread,W:_emscripten_set_mouseleave_callback_on_thread,_:_emscripten_set_mousemove_callback_on_thread,Y:_emscripten_set_mouseup_callback_on_thread,O:_emscripten_set_pointerlockchange_callback_on_thread,J:_emscripten_set_resize_callback_on_thread,P:_emscripten_set_touchcancel_callback_on_thread,R:_emscripten_set_touchend_callback_on_thread,Q:_emscripten_set_touchmove_callback_on_thread,S:_emscripten_set_touchstart_callback_on_thread,I:_emscripten_set_visibilitychange_callback_on_thread,V:_emscripten_set_wheel_callback_on_thread,ta:_emscripten_set_window_title,B:_emscripten_sleep,Wa:_environ_get,Xa:_environ_sizes_get,v:_fd_close,Za:_fd_read,Oa:_fd_seek,Ya:_fd_write,p:_glBindFramebuffer,f:_glBindTexture,j:_glBlendFunc,Lc:_glClear,Kd:_glClearColor,Db:_glColorPointer,ja:_glDeleteFramebuffers,q:_glDeleteTextures,e:_glDisable,k:_glDisableClientState,ea:_glDrawElements,g:_glEnable,w:_glEnableClientState,Vd:_glFramebufferTexture2D,af:_glGenFramebuffers,G:_glGenTextures,hb:_glGetIntegerv,z:_glLightfv,i:_glLoadIdentity,qc:_glLoadMatrixf,r:_glMatrixMode,Wc:_glMultMatrixf,sb:_glNormalPointer,da:_glPopMatrix,ha:_glPushMatrix,ua:_glScalef,E:_glTexCoordPointer,o:_glTexImage2D,c:_glTexParameterf,n:_glTexSubImage2D,F:_glVertexPointer,y:_glViewport,Gf:_glewGetErrorString,Hf:_glewInit,Ta:_strftime_l};var wasmExports=createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports["Jf"])();var _malloc=a0=>(_malloc=wasmExports["Lf"])(a0);var _free=a0=>(_free=wasmExports["free"])(a0);var ___errno_location=()=>(___errno_location=wasmExports["Mf"])();var _RSDK_Initialize=Module["_RSDK_Initialize"]=()=>(_RSDK_Initialize=Module["_RSDK_Initialize"]=wasmExports["Nf"])();var _RSDK_Configure=Module["_RSDK_Configure"]=(a0,a1)=>(_RSDK_Configure=Module["_RSDK_Configure"]=wasmExports["Of"])(a0,a1);var _main=Module["_main"]=(a0,a1)=>(_main=Module["_main"]=wasmExports["Pf"])(a0,a1);var stackSave=()=>(stackSave=wasmExports["Qf"])();var stackRestore=a0=>(stackRestore=wasmExports["Rf"])(a0);var stackAlloc=a0=>(stackAlloc=wasmExports["Sf"])(a0);var ___cxa_increment_exception_refcount=a0=>(___cxa_increment_exception_refcount=wasmExports["__cxa_increment_exception_refcount"])(a0);var ___cxa_is_pointer_type=a0=>(___cxa_is_pointer_type=wasmExports["Tf"])(a0);var dynCall_iiji=Module["dynCall_iiji"]=(a0,a1,a2,a3,a4)=>(dynCall_iiji=Module["dynCall_iiji"]=wasmExports["Uf"])(a0,a1,a2,a3,a4);var dynCall_jiji=Module["dynCall_jiji"]=(a0,a1,a2,a3,a4)=>(dynCall_jiji=Module["dynCall_jiji"]=wasmExports["Vf"])(a0,a1,a2,a3,a4);var dynCall_ji=Module["dynCall_ji"]=(a0,a1)=>(dynCall_ji=Module["dynCall_ji"]=wasmExports["Wf"])(a0,a1);var dynCall_iiiiij=Module["dynCall_iiiiij"]=(a0,a1,a2,a3,a4,a5,a6)=>(dynCall_iiiiij=Module["dynCall_iiiiij"]=wasmExports["Xf"])(a0,a1,a2,a3,a4,a5,a6);var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=(a0,a1,a2,a3,a4,a5,a6,a7,a8)=>(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=wasmExports["Yf"])(a0,a1,a2,a3,a4,a5,a6,a7,a8);var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)=>(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=wasmExports["Zf"])(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9);Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_unlink"]=FS.unlink;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(){var entryFunction=_main;var argc=0;var argv=0;try{var ret=entryFunction(argc,argv);exitJS(ret,true);return ret}catch(e){return handleException(e)}}function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;run(); diff --git a/public/modules/RSDKv4.wasm b/public/modules/RSDKv4.wasm index e5a2713e2fee48ef6854cc27c927f47cd9562485..1f1d2aa565a3ad42db35cc522b148d73d5c05c72 100644 GIT binary patch delta 33757 zcmbrn2V54%_CNg0_TA^%Wr?VOs1Jx8>|!^pCDvHd)EHCMC~BgK-k1t@jSYR&F-BwW zny9F27kgI}doL)q*n54yvkORabN}~#es8!wXUdr~{meOM&g^}8rRA`5Ef-bi!xZuf zN$?Q-cJX-d+ttJ4x0|PM%G-Ql5`+l%`6nI;pwlNFC8dvGkwgu#Pd@dC0H1#9kpVvY z)T0Bm|CCYUI(+Jh0qE$)KL6Acj#wu**4YIKpL$}E*u{-?{nQhRShr7E6Syy2nqRu0 zy9;`_^?miJ$M+6!zILNMUC_&|@Lz818@EJnH}TXC5{-4P5+& zZepX)Jd8+V7qiJ{o;-*(1ucL#-B>dhv$+dexS*wr@|GKW+l{^Rna7tG1>be4z4w_1 z6UenpF2 zJqfXaPVABIuJ4X-ne^1h@^<@n`L_7>%KLqLo%j%Oh`7g>D&P0A+;zr0=4{^7)OWUE1 z^o{Th^bPP0m9Bf&$uB{CxpY#u^~w4q-*3J_`e1#L)KBlL_t9VaUihB-p7}P&8-1(v z4Zc+0dfz(VTHhMqYTxic*O2;!mq;tnkqP`m-vcyx0)O9k&o_Zj^NkTs%438LfwYin zMfb}me8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