diff --git "a/_app/immutable/workers/duckdb-browser-mvp.worker-C3M52Bw4.js" "b/_app/immutable/workers/duckdb-browser-mvp.worker-C3M52Bw4.js" new file mode 100644--- /dev/null +++ "b/_app/immutable/workers/duckdb-browser-mvp.worker-C3M52Bw4.js" @@ -0,0 +1,53 @@ +(function(){"use strict";var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(()=>{var Wl=Object.create,Tn=Object.defineProperty,Vl=Object.getOwnPropertyDescriptor,zl=Object.getOwnPropertyNames,$l=Object.getPrototypeOf,ql=Object.prototype.hasOwnProperty,ga=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ki=(e=>typeof commonjsRequire<"u"?commonjsRequire:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof commonjsRequire<"u"?commonjsRequire:t)[r]}):e)(function(e){if(typeof commonjsRequire<"u")return commonjsRequire.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),fr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pr=(e,t)=>{for(var r in t)Tn(e,r,{get:t[r],enumerable:!0})},Mo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of zl(t))!ql.call(e,a)&&a!==r&&Tn(e,a,{get:()=>t[a],enumerable:!(n=Vl(t,a))||n.enumerable});return e},Po=(e,t,r)=>(r=e!=null?Wl($l(e)):{},Mo(!e||!e.__esModule?Tn(r,"default",{value:e,enumerable:!0}):r,e)),Xl=e=>Mo(Tn({},"__esModule",{value:!0}),e),Ql=function(e,t){this[0]=e,this[1]=t},Mr=e=>{var t=e[ga("asyncIterator")],r=!1,n,a={};return t==null?(t=e[ga("iterator")](),n=o=>a[o]=l=>t[o](l)):(t=t.call(e),n=o=>a[o]=l=>{if(r){if(r=!1,o==="throw")throw l;return l}return r=!0,{done:!1,value:new Ql(new Promise(u=>{var _=t[o](l);if(!(_ instanceof Object))throw TypeError("Object expected");u(_)}),1)}}),a[ga("iterator")]=()=>a,n("next"),"throw"in t?n("throw"):a.throw=o=>{throw o},"return"in t&&n("return"),a},bo=fr(()=>{}),So=fr(()=>{}),kl=fr(()=>{}),wo=fr((e,t)=>{t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Fl=fr((exports,module)=>{var DuckDB=(()=>{var c,_scriptName=typeof document<"u"?(c=document.currentScript)==null?void 0:c.src:void 0;return typeof __filename<"u"&&(_scriptName=_scriptName||__filename),function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer",moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=bo(),nodePath=So();scriptDirectory=__dirname+"/",readBinary=e=>{e=isFileURI(e)?new URL(e):nodePath.normalize(e);var t=fs.readFileSync(e);return t},readAsync=(e,t=!0)=>(e=isFileURI(e)?new URL(e):nodePath.normalize(e),new Promise((r,n)=>{fs.readFile(e,t?void 0:"utf8",(a,o)=>{a?n(a):r(t?o.buffer:o)})})),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=(e,t)=>{throw process.exitCode=e,t}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),_scriptName&&(scriptDirectory=_scriptName),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(e,t){e||abort(t)}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||16777216;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,SOCKFS.root=FS.mount(SOCKFS,{},null),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(e){var t;runDependencies++,(t=Module.monitorRunDependencies)==null||t.call(Module,runDependencies)}function removeRunDependency(e){var t;if(runDependencies--,(t=Module.monitorRunDependencies)==null||t.call(Module,runDependencies),runDependencies==0&&dependenciesFulfilled){var r=dependenciesFulfilled;dependenciesFulfilled=null,r()}}function abort(e){var t;(t=Module.onAbort)==null||t.call(Module,e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw readyPromiseReject(r),r}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function findWasmBinary(){var e="./duckdb-mvp.wasm";return isDataURI(e)?e:locateFile(e)}var wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(e){return wasmBinary?Promise.resolve().then(()=>getBinarySync(e)):readAsync(e).then(t=>new Uint8Array(t),()=>getBinarySync(e))}function instantiateArrayBuffer(e,t,r){return getBinaryPromise(e).then(n=>WebAssembly.instantiate(n,t)).then(r,n=>{err("failed to asynchronously prepare wasm: ".concat(n)),abort(n)})}function instantiateAsync(e,t,r,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(t)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(l){return err("wasm streaming compile failed: ".concat(l)),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(t,r,n)})}):instantiateArrayBuffer(t,r,n)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}function createWasm(){var e=getWasmImports();function t(n,a){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var o=getDylinkMetadata(a);return o.neededDynlibs&&(dynamicLibraries=o.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports),LDSO.init(),loadDylibs(),wasmExports=applySignatureConversions(wasmExports),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency(),wasmExports}addRunDependency();function r(n){t(n.instance,n.module)}if(Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(n){err("Module.instantiateWasm callback failed with error: ".concat(n)),readyPromiseReject(n)}return wasmBinaryFile!=null||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,e,r).catch(readyPromiseReject),{}}var tempDouble,tempI64,ASM_CONSTS={2179464:(e,t)=>{var r=typeof runtime=="object"&&runtime&&typeof runtime.whereToLoad=="function"&&runtime.whereToLoad?runtime.whereToLoad(UTF8ToString(e)):UTF8ToString(t),n=lengthBytesUTF8(r)+1,a=_malloc(n);return stringToUTF8(r,a,n),a},2179830:(e,t)=>{var r=UTF8ToString(e);if(typeof XMLHttpRequest>"u"){let S=kl(),L=So(),T=bo();var n=r.split("/"),a=n.length,o=L.join(S.homedir(),".duckdb/extensions/"+n[a-4]+"/"+n[a-3]+"/"+n[a-2]+"/"),l=L.join(o,n[a-1]);try{if(T.existsSync(o)||T.mkdirSync(o,{recursive:!0}),T.existsSync(l))d=T.readFileSync(l);else{let A=new Int32Array(new SharedArrayBuffer(8));var u=ki("node:worker_threads").Worker,_=new u("const {Worker,isMainThread,parentPort,workerData,} = require('node:worker_threads');var times = 0;var SAB = 23;var Z = 0; async function ZZZ(e) {var x = await fetch(e);var res = await x.arrayBuffer();Atomics.store(SAB, 1, res.byteLength);Atomics.store(SAB, 0, 1);Atomics.notify(SAB, 1);Atomics.notify(SAB, 0);Z = res;};parentPort.on('message', function(event) {if (times == 0) {times++;SAB = event;} else if (times == 1) {times++; ZZZ(event);} else {const a = new Uint8Array(Z);const b = new Uint8Array(event.buffer);var K = Z.byteLength;for (var i = 0; i < K; i++) {b[i] = a[i];}Atomics.notify(event, 0);Atomics.store(SAB, 0, 2);Atomics.notify(SAB, 0);}});",{eval:!0}),d;A[0]=0,A[2]=4,_.postMessage(A),_.postMessage(r),Atomics.wait(A,0,0);let M=new Int32Array(new SharedArrayBuffer(A[1]+3-(A[1]+3)%4));_.postMessage(M),Atomics.wait(A,0,1);var p=new Uint8Array(M.buffer,0,A[1]);d=p,_.terminate(),T.writeFileSync(l,d)}}catch(A){return console.log("Error fetching module",A),0}}else{let S=new XMLHttpRequest;if(S.open("GET",r,!1),S.responseType="arraybuffer",S.send(null),S.status!=200)return 0;d=S.response}for(var f=WebAssembly.validate(d),m=d.byteLength,h=_malloc(m+4),g=new Uint8Array(d),b=0;b{if(!e)return AL.alcErr=40964,1},2182519:e=>{if(!AL.currentCtx)return err("alGetProcAddress() called without a valid context"),1;if(!e)return AL.currentCtx.err=40963,1}};function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit(".concat(e,")"),this.status=e}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(e,t,r)=>{t>>>=0;for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,a));for(var o="";t>10,56320|d&1023)}}return o},getDylinkMetadata=e=>{var t=0,r=0;function n(){return e[t++]}function a(){for(var C=0,F=1;;){var U=e[t++];if(C+=(U&127)*F,F*=128,!(U&128))break}return C}function o(){var C=a();return t+=C,UTF8ArrayToString(e,t-C,C)}function l(C,F){if(C)throw new Error(F)}var u="dylink.0";if(e instanceof WebAssembly.Module){var _=WebAssembly.Module.customSections(e,u);_.length===0&&(u="dylink",_=WebAssembly.Module.customSections(e,u)),l(_.length===0,"need dylink section"),e=new Uint8Array(_[0]),r=e.length}else{var d=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),p=d[0]==1836278016;l(!p,"need to see wasm magic number"),l(e[8]!==0,"need the dylink section to be first"),t=9;var f=a();r=t+f,u=o()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(u=="dylink"){m.memorySize=a(),m.memoryAlign=a(),m.tableSize=a(),m.tableAlign=a();for(var h=a(),g=0;g{var n={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=n,t!=null&&(LDSO.loadedLibsByHandle[t]=n),n},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=2320944,alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},isInternalSym=e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),uleb128Encode=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},sigToWasmTypes=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},n=1;n{var r=e.slice(0,1),n=e.slice(1),a={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),uleb128Encode(n.length,t);for(var o=0;o{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(t),e);var r=[1];generateFuncType(t,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var a=new WebAssembly.Module(new Uint8Array(n)),o=new WebAssembly.Instance(a,{e:{f:e}}),l=o.exports.f;return l},wasmTable=new WebAssembly.Table({initial:42010,element:"anyfunc"}),getWasmTableEntry=e=>wasmTable.get(e),updateTableMap=(e,t)=>{if(functionsInTableMap)for(var r=e;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return wasmTable.length-1},setWasmTableEntry=(e,t)=>wasmTable.set(e,t),addFunction=(e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(o){if(!(o instanceof TypeError))throw o;var a=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,a)}return functionsInTableMap.set(e,n),n},updateGOT=(e,t)=>{for(var r in e)if(!isInternalSym(r)){var n=e[r];r.startsWith("orig$")&&(r=r.split("$")[1],t=!0),GOT[r]||(GOT[r]=new WebAssembly.Global({value:"i32",mutable:!0})),(t||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err("unhandled export type for '".concat(r,"': ").concat(typeof n)))}},relocateExports=(e,t,r)=>{var n={};for(var a in e){var o=e[a];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),n[a]=o}return updateGOT(n,r),n},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},setTempRet0=e=>__emscripten_tempret_set(e),_setTempRet0=setTempRet0;Module._setTempRet0=_setTempRet0;var createDyncallWrapper=e=>{var t=[],r=[0,97,115,109,1,0,0,0];t.push(r);var n=[e[0].replace("j","i"),"i",e.slice(1).replace(/j/g,"ii")].join(""),a=[3];generateFuncType(n,a),generateFuncType(e,a),generateFuncType("vi",a);var o=[1];uleb128Encode(a.length,o),o.push(...a),t.push(o);var l=[2,15,2,1,101,1,116,1,112,0,0,1,101,1,114,0,2];t.push(l);var u=[3,2,1,0];t.push(u);var _=[7,5,1,1,102,0,1];t.push(_);var d=[];e[0]==="j"?d=[1,1,126]:d.push(0);function p(T){d.push(32),uleb128Encode(T,d)}for(var f=1,m=1;m{e=e.replace(/p/g,"i"),"dynCall_"+e in Module||(Module["dynCall_"+e]=createDyncallWrapper(e));var n=Module["dynCall_"+e];return n(t,...r)},dynCall=(e,t,r=[])=>{if(e.includes("j"))return dynCallLegacy(e,t,r);var n=getWasmTableEntry(t)(...r);return e[0]=="p"?n>>>0:n},stackSave=()=>_emscripten_stack_get_current(),stackRestore=e=>__emscripten_stack_restore(e),createInvokeFunction=e=>(t,...r)=>{var n=stackSave();try{return dynCall(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}},resolveGlobalSymbol=(e,t=!1)=>{var r;return t&&"orig$"+e in wasmImports&&(e="orig$"+e),isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")?r=wasmImports[e]=createInvokeFunction(e.split("_")[1]):e.startsWith("__cxa_find_matching_catch_")&&(r=wasmImports[e]=(...n)=>{var a=findMatchingCatch(n);return a}),{sym:r,name:e}},UTF8ToString=(e,t)=>(e>>>=0,e?UTF8ArrayToString(HEAPU8,e,t):""),loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8>>>0];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8>>>0]=1,HEAPU32[handle+12>>>2>>>0]=memoryBase,HEAP32[handle+16>>>2>>>0]=metadata.memorySize,HEAPU32[handle+20>>>2>>>0]=tableBase,HEAP32[handle+24>>>2>>>0]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>>2>>>0],tableBase=HEAPU32[handle+20>>>2>>>0];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub)return wasmImports[t];if(!(t in e)){var r;e[t]=(...n)=>(r||(r=resolveSymbol(t)),r(...n))}return e[t]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func="(".concat(args,") => { ").concat(body," };");ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ").concat(body,";");moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(e=>postInstantiation(e.module,e.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},mergeLibSymbols=(e,t)=>{registerDynCallSymbols(e);for(var[r,n]of Object.entries(e))(a=>{isSymbolDefined(a)||(wasmImports[a]=n)})(r)},asyncLoad=(e,t,r,n)=>{var a=n?"":"al ".concat(e);readAsync(e).then(o=>{t(new Uint8Array(o)),a&&removeRunDependency()},o=>{if(r)r();else throw'Loading data file "'.concat(e,'" failed.')}),a&&addRunDependency()},preloadPlugins=Module.preloadPlugins||[],registerWasmPlugin=()=>{var e={promiseChainEnd:Promise.resolve(),canHandle:t=>!Module.noWasmDecoding&&t.endsWith(".so"),handle:(t,r,n,a)=>{e.promiseChainEnd=e.promiseChainEnd.then(()=>loadWebAssemblyModule(t,{loadAsync:!0,nodelete:!0},r,{})).then(o=>{preloadedWasm[r]=o,n(t)},o=>{err("failed to instantiate wasm: ".concat(r,": ").concat(o)),a()})}};preloadPlugins.push(e)},preloadedWasm={},registerDynCallSymbols=e=>{for(var[t,r]of Object.entries(e))t.startsWith("dynCall_")&&!Module.hasOwnProperty(t)&&(Module[t]=r)};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var a=LDSO.loadedLibsByName[e];if(a)return t.global?a.global||(a.global=!0,mergeLibSymbols(a.exports)):(r&&Object.assign(r,a.exports),registerDynCallSymbols(a.exports)),t.nodelete&&a.refcount!==1/0&&(a.refcount=1/0),a.refcount++,n&&(LDSO.loadedLibsByHandle[n]=a),t.loadAsync?Promise.resolve(!0):!0;a=newDSO(e,n,"loading"),a.refcount=t.nodelete?1/0:1,a.global=t.global;function o(){if(n){var _=HEAPU32[n+28>>>2>>>0],d=HEAPU32[n+32>>>2>>>0];if(_&&d){var p=HEAP8.slice(_,_+d);return t.loadAsync?Promise.resolve(p):p}}var f=locateFile(e);if(t.loadAsync)return new Promise((m,h)=>asyncLoad(f,m,h));if(!readBinary)throw new Error("".concat(f,": file not found, and synchronous loading of external files is not available"));return readBinary(f)}function l(){var _=preloadedWasm[e];return _?t.loadAsync?Promise.resolve(_):_:t.loadAsync?o().then(d=>loadWebAssemblyModule(d,t,e,r,n)):loadWebAssemblyModule(o(),t,e,r,n)}function u(_){a.global?mergeLibSymbols(_):r&&(Object.assign(r,_),registerDynCallSymbols(_)),a.exports=_}return t.loadAsync?l().then(_=>(u(_),!0)):(u(l()),!0)}var reportUndefinedSymbols=()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else if(typeof r=="number")t.value=r;else throw new Error("bad export type for '".concat(e,"': ").concat(typeof r))}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency(),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency()})},noExitRuntime=Module.noExitRuntime||!0;function __ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm(...e){return wasmImports._ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm(...e)}__ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm.stub=!0;var convertI32PairToI53Checked=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function ___assert_fail(e,t,r,n){e>>>=0,t>>>=0,n>>>=0,abort("Assertion failed: ".concat(UTF8ToString(e),", at: ")+[t?UTF8ToString(t):"unknown filename",r,n?UTF8ToString(n):"unknown function"])}___assert_fail.sig="vppip";function ___call_sighandler(e,t){return e>>>=0,getWasmTableEntry(e)(t)}___call_sighandler.sig="vpi";var exceptionCaught=[],uncaughtExceptionCount=0;function ___cxa_begin_catch(e){e>>>=0;var t=new ExceptionInfo(e);return t.get_caught()||(t.set_caught(!0),uncaughtExceptionCount--),t.set_rethrown(!1),exceptionCaught.push(t),___cxa_increment_exception_refcount(e),___cxa_get_exception_ptr(e)}___cxa_begin_catch.sig="pp";function ___cxa_current_primary_exception(){if(!exceptionCaught.length)return 0;var e=exceptionCaught[exceptionCaught.length-1];return ___cxa_increment_exception_refcount(e.excPtr),e.excPtr}___cxa_current_primary_exception.sig="p";var exceptionLast=0,___cxa_end_catch=()=>{_setThrew(0,0);var e=exceptionCaught.pop();___cxa_decrement_exception_refcount(e.excPtr),exceptionLast=0};___cxa_end_catch.sig="v";class ExceptionInfo{constructor(t){this.excPtr=t,this.ptr=t-24}set_type(t){HEAPU32[this.ptr+4>>>2>>>0]=t}get_type(){return HEAPU32[this.ptr+4>>>2>>>0]}set_destructor(t){HEAPU32[this.ptr+8>>>2>>>0]=t}get_destructor(){return HEAPU32[this.ptr+8>>>2>>>0]}set_caught(t){t=t?1:0,HEAP8[this.ptr+12>>>0]=t}get_caught(){return HEAP8[this.ptr+12>>>0]!=0}set_rethrown(t){t=t?1:0,HEAP8[this.ptr+13>>>0]=t}get_rethrown(){return HEAP8[this.ptr+13>>>0]!=0}init(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r)}set_adjusted_ptr(t){HEAPU32[this.ptr+16>>>2>>>0]=t}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>>2>>>0]}}function ___resumeException(e){throw e>>>=0,exceptionLast||(exceptionLast=e),exceptionLast}___resumeException.sig="vp";var findMatchingCatch=e=>{var t=exceptionLast;if(!t)return setTempRet0(0),0;var r=new ExceptionInfo(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return setTempRet0(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(___cxa_can_catch(a,n,o))return setTempRet0(a),t}return setTempRet0(n),t};function ___cxa_find_matching_catch_2(){return findMatchingCatch([])}___cxa_find_matching_catch_2.sig="p";function ___cxa_find_matching_catch_3(e){return e>>>=0,findMatchingCatch([e])}___cxa_find_matching_catch_3.sig="pp";function ___cxa_find_matching_catch_4(e,t){return e>>>=0,t>>>=0,findMatchingCatch([e,t])}___cxa_find_matching_catch_4.sig="ppp";var ___cxa_rethrow=()=>{var e=exceptionCaught.pop();e||abort("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(exceptionCaught.push(e),e.set_rethrown(!0),e.set_caught(!1),uncaughtExceptionCount++),exceptionLast=t,exceptionLast};___cxa_rethrow.sig="v";function ___cxa_rethrow_primary_exception(e){if(e>>>=0,!!e){var t=new ExceptionInfo(e);exceptionCaught.push(t),t.set_rethrown(!0),___cxa_rethrow()}}___cxa_rethrow_primary_exception.sig="vp";function ___cxa_throw(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=new ExceptionInfo(e);throw n.init(t,r),exceptionLast=e,uncaughtExceptionCount++,exceptionLast}___cxa_throw.sig="vppp";var ___cxa_uncaught_exceptions=()=>uncaughtExceptionCount;___cxa_uncaught_exceptions.sig="i";var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=2320944,___stack_low=2255408,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},2320944),PATH={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var a=e[n];a==="."?e.splice(n,1):a===".."?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),r=e.substr(-1)==="/";return e=PATH.normalizeArray(e.split("/").filter(n=>!!n),!t).join("/"),!e&&!t&&(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=PATH.splitPath(e),r=t[0],n=t[1];return!r&&!n?".":(n&&(n=n.substr(0,n.length-1)),r+n)},basename:e=>{if(e==="/")return"/";e=PATH.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>PATH.normalize(e.join("/")),join2:(e,t)=>PATH.normalize(e+"/"+t)},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return n=>crypto.getRandomValues(n);if(ENVIRONMENT_IS_NODE)try{var e=ki("crypto"),t=e.randomFillSync;if(t)return n=>e.randomFillSync(n);var r=e.randomBytes;return n=>(n.set(r(n.byteLength)),n)}catch{}abort("initRandomDevice")},randomFill=e=>(randomFill=initRandomFill())(e),PATH_FS={resolve:(...e)=>{for(var t="",r=!1,n=e.length-1;n>=-1&&!r;n--){var a=n>=0?e[n]:FS.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";t=a+"/"+t,r=PATH.isAbs(a)}return t=PATH.normalizeArray(t.split("/").filter(o=>!!o),!r).join("/"),(r?"/":"")+t||"."},relative:(e,t)=>{e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);function r(d){for(var p=0;p=0&&d[f]==="";f--);return p>f?[]:d.slice(p,f-p+1)}for(var n=r(e.split("/")),a=r(t.split("/")),o=Math.min(n.length,a.length),l=o,u=0;u{for(var t=0,r=0;r=55296&&n<=57343?(t+=4,++r):t+=3}return t},stringToUTF8Array=(e,t,r,n)=>{if(r>>>=0,!(n>0))return 0;for(var a=r,o=r+n-1,l=0;l=55296&&u<=57343){var _=e.charCodeAt(++l);u=65536+((u&1023)<<10)|_&1023}if(u<=127){if(r>=o)break;t[r++>>>0]=u}else if(u<=2047){if(r+1>=o)break;t[r++>>>0]=192|u>>6,t[r++>>>0]=128|u&63}else if(u<=65535){if(r+2>=o)break;t[r++>>>0]=224|u>>12,t[r++>>>0]=128|u>>6&63,t[r++>>>0]=128|u&63}else{if(r+3>=o)break;t[r++>>>0]=240|u>>18,t[r++>>>0]=128|u>>12&63,t[r++>>>0]=128|u>>6&63,t[r++>>>0]=128|u&63}}return t[r>>>0]=0,r-a};function intArrayFromString(e,t,r){var n=lengthBytesUTF8(e)+1,a=new Array(n),o=stringToUTF8Array(e,a,0,a.length);return t&&(a.length=o),a}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var e=null;if(ENVIRONMENT_IS_NODE){var t=256,r=Buffer.alloc(t),n=0,a=process.stdin.fd;try{n=fs.readSync(a,r,0,t)}catch(o){if(o.toString().includes("EOF"))n=0;else throw o}n>0&&(e=r.slice(0,n).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=` +`));if(!e)return null;FS_stdin_getChar_buffer=intArrayFromString(e,!0)}return FS_stdin_getChar_buffer.shift()},TTY={ttys:[],init(){},shutdown(){},register(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,a){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(60);for(var o=0,l=0;l0&&(out(UTF8ArrayToString(e.output,0)),e.output=[])},ioctl_tcgets(e){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(e,t,r){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(err(UTF8ArrayToString(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output,0)),e.output=[])}}},zeroMemory=(e,t)=>(HEAPU8.fill(0,e,e+t),e),mmapAlloc=e=>{e=alignMemory(e,65536);var t=_emscripten_builtin_memalign(65536,e);return t?zeroMemory(t,e):0},MEMFS={ops_table:null,mount(e){return MEMFS.createNode(null,"/",16895,0)},createNode(e,t,r,n){if(FS.isBlkdev(r)||FS.isFIFO(r))throw new FS.ErrnoError(63);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 a=FS.createNode(e,t,r,n);return FS.isDir(a.mode)?(a.node_ops=MEMFS.ops_table.dir.node,a.stream_ops=MEMFS.ops_table.dir.stream,a.contents={}):FS.isFile(a.mode)?(a.node_ops=MEMFS.ops_table.file.node,a.stream_ops=MEMFS.ops_table.file.stream,a.usedBytes=0,a.contents=null):FS.isLink(a.mode)?(a.node_ops=MEMFS.ops_table.link.node,a.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(a.mode)&&(a.node_ops=MEMFS.ops_table.chrdev.node,a.stream_ops=MEMFS.ops_table.chrdev.stream),a.timestamp=Date.now(),e&&(e.contents[t]=a,e.timestamp=a.timestamp),a},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){var n=1048576;t=Math.max(t,r*(r>>0),r!=0&&(t=Math.max(t,256));var a=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(a.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=FS.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.usedBytes:FS.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&MEMFS.resizeFileStorage(e,t.size)},lookup(e,t){throw FS.genericErrors[44]},mknod(e,t,r,n){return MEMFS.createNode(e,t,r,n)},rename(e,t,r){if(FS.isDir(e.mode)){var n;try{n=FS.lookupNode(t,r)}catch{}if(n)for(var a in n.contents)throw new FS.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=FS.lookupNode(e,t);for(var n in r.contents)throw new FS.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var n=MEMFS.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,a){var o=e.node.contents;if(a>=e.node.usedBytes)return 0;var l=Math.min(e.node.usedBytes-a,n);if(l>8&&o.subarray)t.set(o.subarray(a,a+l),r);else for(var u=0;u0||r+t>>0))}return{ptr:o,allocated:l}},msync(e,t,r,n,a){return MEMFS.stream_ops.write(e,t,0,n,r,!1),0}}},FS_createDataFile=(e,t,r,n,a,o)=>{FS.createDataFile(e,t,r,n,a,o)},FS_handledByPreloadPlugin=(e,t,r,n)=>{typeof Browser<"u"&&Browser.init();var a=!1;return preloadPlugins.forEach(o=>{a||o.canHandle(t)&&(o.handle(e,t,r,n),a=!0)}),a},FS_createPreloadedFile=(e,t,r,n,a,o,l,u,_,d)=>{var p=t?PATH_FS.resolve(PATH.join2(e,t)):e;function f(m){function h(g){d==null||d(),u||FS_createDataFile(e,t,g,n,a,_),o==null||o(),removeRunDependency()}FS_handledByPreloadPlugin(m,p,h,()=>{l==null||l(),removeRunDependency()})||h(m)}addRunDependency(),typeof r=="string"?asyncLoad(r,f,l):f(r)},FS_modeStringToFlags=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},r=t[e];if(typeof r>"u")throw new Error("Unknown file open mode: ".concat(e));return r},FS_getMode=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=FS.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(e,t={}){if(e=PATH_FS.resolve(e),!e)return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};if(t=Object.assign(r,t),t.recurse_count>8)throw new FS.ErrnoError(32);for(var n=e.split("/").filter(f=>!!f),a=FS.root,o="/",l=0;l40)throw new FS.ErrnoError(32)}}return{path:o,node:a}},getPath(e){for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?r[r.length-1]!=="/"?"".concat(r,"/").concat(t):r+t:r}t=t?"".concat(e.name,"/").concat(t):e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n>>0)%FS.nameTable.length},hashAddNode(e){var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode(e){var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var r=FS.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=FS.mayLookup(e);if(r)throw new FS.ErrnoError(r);for(var n=FS.hashName(e.id,t),a=FS.nameTable[n];a;a=a.name_next){var o=a.name;if(a.parent.id===e.id&&o===t)return a}return FS.lookup(e,t)},createNode(e,t,r,n){var a=new FS.FSNode(e,t,r,n);return FS.hashAddNode(a),a},destroyNode(e){FS.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return FS.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!FS.isDir(e.mode))return 54;var t=FS.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{var r=FS.lookupNode(e,t);return 20}catch{}return FS.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=FS.lookupNode(e,t)}catch(o){return o.errno}var a=FS.nodePermissions(e,"wx");if(a)return a;if(r){if(!FS.isDir(n.mode))return 54;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return 10}else if(FS.isDir(n.mode))return 31;return 0},mayOpen(e,t){return e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&(FS.flagsToPermissionString(t)!=="r"||t&512)?31:FS.nodePermissions(e,FS.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=FS.MAX_OPEN_FDS;e++)if(!FS.streams[e])return e;throw new FS.ErrnoError(33)},getStreamChecked(e){var t=FS.getStream(e);if(!t)throw new FS.ErrnoError(8);return t},getStream:e=>FS.streams[e],createStream(e,t=-1){return e=Object.assign(new FS.FSStream,e),t==-1&&(t=FS.nextfd()),e.fd=t,FS.streams[t]=e,e},closeStream(e){FS.streams[e]=null},dupStream(e,t=-1){var r,n,a=FS.createStream(e,t);return(n=(r=a.stream_ops)==null?void 0:r.dup)==null||n.call(r,a),a},chrdev_stream_ops:{open(e){var t,r,n=FS.getDevice(e.node.rdev);e.stream_ops=n.stream_ops,(r=(t=e.stream_ops).open)==null||r.call(t,e)},llseek(){throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){FS.devices[e]={stream_ops:t}},getDevice:e=>FS.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push(...n.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err("warning: ".concat(FS.syncFSRequests," FS.syncfs operations in flight at once, probably just doing extra work"));var r=FS.getMounts(FS.root.mount),n=0;function a(l){return FS.syncFSRequests--,t(l)}function o(l){if(l)return o.errored?void 0:(o.errored=!0,a(l));++n>=r.length&&a(null)}r.forEach(l=>{if(!l.type.syncfs)return o(null);l.type.syncfs(l,e,o)})},mount(e,t,r){var n=r==="/",a=!r,o;if(n&&FS.root)throw new FS.ErrnoError(10);if(!n&&!a){var l=FS.lookupPath(r,{follow_mount:!1});if(r=l.path,o=l.node,FS.isMountpoint(o))throw new FS.ErrnoError(10);if(!FS.isDir(o.mode))throw new FS.ErrnoError(54)}var u={type:e,opts:t,mountpoint:r,mounts:[]},_=e.mount(u);return _.mount=u,u.root=_,n?FS.root=_:o&&(o.mounted=u,o.mount&&o.mount.mounts.push(u)),_},unmount(e){var t=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(t.node))throw new FS.ErrnoError(28);var r=t.node,n=r.mounted,a=FS.getMounts(n);Object.keys(FS.nameTable).forEach(l=>{for(var u=FS.nameTable[l];u;){var _=u.name_next;a.includes(u.mount)&&FS.destroyNode(u),u=_}}),r.mounted=null;var o=r.mount.mounts.indexOf(n);r.mount.mounts.splice(o,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,r){var n=FS.lookupPath(e,{parent:!0}),a=n.node,o=PATH.basename(e);if(!o||o==="."||o==="..")throw new FS.ErrnoError(28);var l=FS.mayCreate(a,o);if(l)throw new FS.ErrnoError(l);if(!a.node_ops.mknod)throw new FS.ErrnoError(63);return a.node_ops.mknod(a,o,t,r)},create(e,t){return t=t!==void 0?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)},mkdir(e,t){return t=t!==void 0?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)},mkdirTree(e,t){for(var r=e.split("/"),n="",a=0;a"u"&&(r=t,t=438),t|=8192,FS.mknod(e,t,r)},symlink(e,t){if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var r=FS.lookupPath(t,{parent:!0}),n=r.node;if(!n)throw new FS.ErrnoError(44);var a=PATH.basename(t),o=FS.mayCreate(n,a);if(o)throw new FS.ErrnoError(o);if(!n.node_ops.symlink)throw new FS.ErrnoError(63);return n.node_ops.symlink(n,a,e)},rename(e,t){var r=PATH.dirname(e),n=PATH.dirname(t),a=PATH.basename(e),o=PATH.basename(t),l,u,_;if(l=FS.lookupPath(e,{parent:!0}),u=l.node,l=FS.lookupPath(t,{parent:!0}),_=l.node,!u||!_)throw new FS.ErrnoError(44);if(u.mount!==_.mount)throw new FS.ErrnoError(75);var d=FS.lookupNode(u,a),p=PATH_FS.relative(e,n);if(p.charAt(0)!==".")throw new FS.ErrnoError(28);if(p=PATH_FS.relative(t,r),p.charAt(0)!==".")throw new FS.ErrnoError(55);var f;try{f=FS.lookupNode(_,o)}catch{}if(d!==f){var m=FS.isDir(d.mode),h=FS.mayDelete(u,a,m);if(h)throw new FS.ErrnoError(h);if(h=f?FS.mayDelete(_,o,m):FS.mayCreate(_,o),h)throw new FS.ErrnoError(h);if(!u.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(d)||f&&FS.isMountpoint(f))throw new FS.ErrnoError(10);if(_!==u&&(h=FS.nodePermissions(u,"w"),h))throw new FS.ErrnoError(h);FS.hashRemoveNode(d);try{u.node_ops.rename(d,_,o),d.parent=_}catch(g){throw g}finally{FS.hashAddNode(d)}}},rmdir(e){var t=FS.lookupPath(e,{parent:!0}),r=t.node,n=PATH.basename(e),a=FS.lookupNode(r,n),o=FS.mayDelete(r,n,!0);if(o)throw new FS.ErrnoError(o);if(!r.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(a))throw new FS.ErrnoError(10);r.node_ops.rmdir(r,n),FS.destroyNode(a)},readdir(e){var t=FS.lookupPath(e,{follow:!0}),r=t.node;if(!r.node_ops.readdir)throw new FS.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var t=FS.lookupPath(e,{parent:!0}),r=t.node;if(!r)throw new FS.ErrnoError(44);var n=PATH.basename(e),a=FS.lookupNode(r,n),o=FS.mayDelete(r,n,!1);if(o)throw new FS.ErrnoError(o);if(!r.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(a))throw new FS.ErrnoError(10);r.node_ops.unlink(r,n),FS.destroyNode(a)},readlink(e){var t=FS.lookupPath(e),r=t.node;if(!r)throw new FS.ErrnoError(44);if(!r.node_ops.readlink)throw new FS.ErrnoError(28);return PATH_FS.resolve(FS.getPath(r.parent),r.node_ops.readlink(r))},stat(e,t){var r=FS.lookupPath(e,{follow:!t}),n=r.node;if(!n)throw new FS.ErrnoError(44);if(!n.node_ops.getattr)throw new FS.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return FS.stat(e,!0)},chmod(e,t,r){var n;if(typeof e=="string"){var a=FS.lookupPath(e,{follow:!r});n=a.node}else n=e;if(!n.node_ops.setattr)throw new FS.ErrnoError(63);n.node_ops.setattr(n,{mode:t&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,t){FS.chmod(e,t,!0)},fchmod(e,t){var r=FS.getStreamChecked(e);FS.chmod(r.node,t)},chown(e,t,r,n){var a;if(typeof e=="string"){var o=FS.lookupPath(e,{follow:!n});a=o.node}else a=e;if(!a.node_ops.setattr)throw new FS.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,t,r){FS.chown(e,t,r,!0)},fchown(e,t,r){var n=FS.getStreamChecked(e);FS.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new FS.ErrnoError(28);var r;if(typeof e=="string"){var n=FS.lookupPath(e,{follow:!0});r=n.node}else r=e;if(!r.node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(r.mode))throw new FS.ErrnoError(31);if(!FS.isFile(r.mode))throw new FS.ErrnoError(28);var a=FS.nodePermissions(r,"w");if(a)throw new FS.ErrnoError(a);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=FS.getStreamChecked(e);if(!(r.flags&2097155))throw new FS.ErrnoError(28);FS.truncate(r.node,t)},utime(e,t,r){var n=FS.lookupPath(e,{follow:!0}),a=n.node;a.node_ops.setattr(a,{timestamp:Math.max(t,r)})},open(e,t,r){if(e==="")throw new FS.ErrnoError(44);t=typeof t=="string"?FS_modeStringToFlags(t):t,t&64?(r=typeof r>"u"?438:r,r=r&4095|32768):r=0;var n;if(typeof e=="object")n=e;else{e=PATH.normalize(e);try{var a=FS.lookupPath(e,{follow:!(t&131072)});n=a.node}catch{}}var o=!1;if(t&64)if(n){if(t&128)throw new FS.ErrnoError(20)}else n=FS.mknod(e,r,0),o=!0;if(!n)throw new FS.ErrnoError(44);if(FS.isChrdev(n.mode)&&(t&=-513),t&65536&&!FS.isDir(n.mode))throw new FS.ErrnoError(54);if(!o){var l=FS.mayOpen(n,t);if(l)throw new FS.ErrnoError(l)}t&512&&!o&&FS.truncate(n,0),t&=-131713;var u=FS.createStream({node:n,path:FS.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),Module.logReadFiles&&!(t&1)&&(e in FS.readFiles||(FS.readFiles[e]=1)),u},close(e){if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{FS.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,r){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(r!=0&&r!=1&&r!=2)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,a){if(n<0||a<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if((e.flags&2097155)===1)throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var o=typeof a<"u";if(!o)a=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var l=e.stream_ops.read(e,t,r,n,a);return o||(e.position+=l),l},write(e,t,r,n,a,o){if(n<0||a<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&e.flags&1024&&FS.llseek(e,0,2);var l=typeof a<"u";if(!l)a=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var u=e.stream_ops.write(e,t,r,n,a,o);return l||(e.position+=u),u},allocate(e,t,r){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(t<0||r<=0)throw new FS.ErrnoError(28);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,a){if(n&2&&!(a&2)&&(e.flags&2097155)!==2)throw new FS.ErrnoError(2);if((e.flags&2097155)===1)throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);if(!t)throw new FS.ErrnoError(28);return e.stream_ops.mmap(e,t,r,n,a)},msync(e,t,r,n,a){return e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,a):0},ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error('Invalid encoding type "'.concat(t.encoding,'"'));var r,n=FS.open(e,t.flags),a=FS.stat(e),o=a.size,l=new Uint8Array(o);return FS.read(n,l,0,o,0),t.encoding==="utf8"?r=UTF8ArrayToString(l,0):t.encoding==="binary"&&(r=l),FS.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=FS.open(e,r.flags,r.mode);if(typeof t=="string"){var a=new Uint8Array(lengthBytesUTF8(t)+1),o=stringToUTF8Array(t,a,0,a.length);FS.write(n,a,0,o,void 0,r.canOwn)}else if(ArrayBuffer.isView(t))FS.write(n,t,0,t.byteLength,void 0,r.canOwn);else throw new Error("Unsupported data type");FS.close(n)},cwd:()=>FS.currentPath,chdir(e){var t=FS.lookupPath(e,{follow:!0});if(t.node===null)throw new FS.ErrnoError(44);if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(54);var r=FS.nodePermissions(t.node,"x");if(r)throw new FS.ErrnoError(r);FS.currentPath=t.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:(n,a,o,l,u)=>l}),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 e=new Uint8Array(1024),t=0,r=()=>(t===0&&(t=randomFill(e).byteLength),e[--t]);FS.createDevice("/dev","random",r),FS.createDevice("/dev","urandom",r),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount(){var t=FS.createNode(e,"fd",16895,73);return t.node_ops={lookup(r,n){var a=+n,o=FS.getStreamChecked(a),l={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return l.parent=l,l}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,r){e?FS.createDevice("/dev","stdin",e):FS.symlink("/dev/tty","/dev/stdin"),t?FS.createDevice("/dev","stdout",null,t):FS.symlink("/dev/tty","/dev/stdout"),r?FS.createDevice("/dev","stderr",null,r):FS.symlink("/dev/tty1","/dev/stderr"),FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack=""}),FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS}},init(e,t,r){FS.initialized=!0,e!=null||(e=Module.stdin),t!=null||(t=Module.stdout),r!=null||(r=Module.stderr),FS.createStandardStreams(e,t,r)},quit(){FS.initialized=!1;for(var e=0;ethis.length-1||h<0)){var g=h%this.chunkSize,b=h/this.chunkSize|0;return this.getter(b)[g]}}setDataGetter(h){this.getter=h}cacheLength(){var h=new XMLHttpRequest;if(h.open("HEAD",r,!1),h.send(null),!(h.status>=200&&h.status<300||h.status===304))throw new Error("Couldn't load "+r+". Status: "+h.status);var g=Number(h.getResponseHeader("Content-length")),b,v=(b=h.getResponseHeader("Accept-Ranges"))&&b==="bytes",S=(b=h.getResponseHeader("Content-Encoding"))&&b==="gzip",L=1024*1024;v||(L=g);var T=(M,X)=>{if(M>X)throw new Error("invalid range ("+M+", "+X+") or no bytes requested!");if(X>g-1)throw new Error("only "+g+" bytes available! programmer error!");var x=new XMLHttpRequest;if(x.open("GET",r,!1),g!==L&&x.setRequestHeader("Range","bytes="+M+"-"+X),x.responseType="arraybuffer",x.overrideMimeType&&x.overrideMimeType("text/plain; charset=x-user-defined"),x.send(null),!(x.status>=200&&x.status<300||x.status===304))throw new Error("Couldn't load "+r+". Status: "+x.status);return x.response!==void 0?new Uint8Array(x.response||[]):intArrayFromString(x.responseText||"",!0)},A=this;A.setDataGetter(M=>{var X=M*L,x=(M+1)*L-1;if(x=Math.min(x,g-1),typeof A.chunks[M]>"u"&&(A.chunks[M]=T(X,x)),typeof A.chunks[M]>"u")throw new Error("doXHR failed!");return A.chunks[M]}),(S||!g)&&(L=g=1,g=this.getter(0).length,L=g,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=g,this._chunkSize=L,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var l=new o,u={isDevice:!1,contents:l}}else var u={isDevice:!1,url:r};var _=FS.createFile(e,t,u,n,a);u.contents?_.contents=u.contents:u.url&&(_.contents=null,_.url=u.url),Object.defineProperties(_,{usedBytes:{get:function(){return this.contents.length}}});var d={},p=Object.keys(_.stream_ops);p.forEach(m=>{var h=_.stream_ops[m];d[m]=(...g)=>(FS.forceLoadFile(_),h(...g))});function f(m,h,g,b,v){var S=m.node.contents;if(v>=S.length)return 0;var L=Math.min(S.length-v,b);if(S.slice)for(var T=0;T(FS.forceLoadFile(_),f(m,h,g,b,v)),d.mmap=(m,h,g,b,v)=>{FS.forceLoadFile(_);var S=mmapAlloc(h);if(!S)throw new FS.ErrnoError(48);return f(m,HEAP8,S,h,g),{ptr:S,allocated:!0}},_.stream_ops=d,_}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(PATH.isAbs(t))return t;var n;if(e===-100)n=FS.cwd();else{var a=SYSCALLS.getStreamFromFD(e);n=a.path}if(t.length==0){if(!r)throw new FS.ErrnoError(44);return n}return PATH.join2(n,t)},doStat(e,t,r){var n=e(t);HEAP32[r>>>2>>>0]=n.dev,HEAP32[r+4>>>2>>>0]=n.mode,HEAPU32[r+8>>>2>>>0]=n.nlink,HEAP32[r+12>>>2>>>0]=n.uid,HEAP32[r+16>>>2>>>0]=n.gid,HEAP32[r+20>>>2>>>0]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+24>>>2>>>0]=tempI64[0],HEAP32[r+28>>>2>>>0]=tempI64[1],HEAP32[r+32>>>2>>>0]=4096,HEAP32[r+36>>>2>>>0]=n.blocks;var a=n.atime.getTime(),o=n.mtime.getTime(),l=n.ctime.getTime();return tempI64=[Math.floor(a/1e3)>>>0,(tempDouble=Math.floor(a/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>>2>>>0]=tempI64[0],HEAP32[r+44>>>2>>>0]=tempI64[1],HEAPU32[r+48>>>2>>>0]=a%1e3*1e3*1e3,tempI64=[Math.floor(o/1e3)>>>0,(tempDouble=Math.floor(o/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>>2>>>0]=tempI64[0],HEAP32[r+60>>>2>>>0]=tempI64[1],HEAPU32[r+64>>>2>>>0]=o%1e3*1e3*1e3,tempI64=[Math.floor(l/1e3)>>>0,(tempDouble=Math.floor(l/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>>2>>>0]=tempI64[0],HEAP32[r+76>>>2>>>0]=tempI64[1],HEAPU32[r+80>>>2>>>0]=l%1e3*1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>>2>>>0]=tempI64[0],HEAP32[r+92>>>2>>>0]=tempI64[1],0},doMsync(e,t,r,n,a){if(!FS.isFile(t.node.mode))throw new FS.ErrnoError(43);if(n&2)return 0;var o=HEAPU8.slice(e,e+r);FS.msync(t,o,a,r,n)},getStreamFromFD(e){var t=FS.getStreamChecked(e);return t},varargs:void 0,getStr(e){var t=UTF8ToString(e);return t}};function ___syscall__newselect(e,t,r,n,a){t>>>=0,r>>>=0,n>>>=0,a>>>=0;try{for(var o=0,l=t?HEAP32[t>>>2>>>0]:0,u=t?HEAP32[t+4>>>2>>>0]:0,_=r?HEAP32[r>>>2>>>0]:0,d=r?HEAP32[r+4>>>2>>>0]:0,p=n?HEAP32[n>>>2>>>0]:0,f=n?HEAP32[n+4>>>2>>>0]:0,m=0,h=0,g=0,b=0,v=0,S=0,L=(t?HEAP32[t>>>2>>>0]:0)|(r?HEAP32[r>>>2>>>0]:0)|(n?HEAP32[n>>>2>>>0]:0),T=(t?HEAP32[t+4>>>2>>>0]:0)|(r?HEAP32[r+4>>>2>>>0]:0)|(n?HEAP32[n+4>>>2>>>0]:0),A=function(C,F,U,D){return C<32?F&D:U&D},M=0;M>>2>>>0]:0,k=t?HEAP32[a+4>>>2>>>0]:0;E=(P+k/1e6)*1e3}w=x.stream_ops.poll(x,E)}w&1&&A(M,l,u,X)&&(M<32?m=m|X:h=h|X,o++),w&4&&A(M,_,d,X)&&(M<32?g=g|X:b=b|X,o++),w&2&&A(M,p,f,X)&&(M<32?v=v|X:S=S|X,o++)}}return t&&(HEAP32[t>>>2>>>0]=m,HEAP32[t+4>>>2>>>0]=h),r&&(HEAP32[r>>>2>>>0]=g,HEAP32[r+4>>>2>>>0]=b),n&&(HEAP32[n>>>2>>>0]=v,HEAP32[n+4>>>2>>>0]=S),o}catch(C){if(typeof FS>"u"||C.name!=="ErrnoError")throw C;return-C.errno}}___syscall__newselect.sig="iipppp";var SOCKFS={mount(e){return Module.websocket=Module.websocket&&typeof Module.websocket=="object"?Module.websocket:{},Module.websocket._callbacks={},Module.websocket.on=function(t,r){return typeof r=="function"&&(this._callbacks[t]=r),this},Module.websocket.emit=function(t,r){typeof this._callbacks[t]=="function"&&this._callbacks[t].call(this,r)},FS.createNode(null,"/",16895,0)},createSocket(e,t,r){t&=-526337;var n=t==1;if(n&&r&&r!=6)throw new FS.ErrnoError(66);var a={family:e,type:t,protocol:r,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops},o=SOCKFS.nextname(),l=FS.createNode(SOCKFS.root,o,49152,0);l.sock=a;var u=FS.createStream({path:o,node:l,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return a.stream=u,a},getSocket(e){var t=FS.getStream(e);return!t||!FS.isSocket(t.node.mode)?null:t.node.sock},stream_ops:{poll(e){var t=e.node.sock;return t.sock_ops.poll(t)},ioctl(e,t,r){var n=e.node.sock;return n.sock_ops.ioctl(n,t,r)},read(e,t,r,n,a){var o=e.node.sock,l=o.sock_ops.recvmsg(o,n);return l?(t.set(l.buffer,r),l.buffer.length):0},write(e,t,r,n,a){var o=e.node.sock;return o.sock_ops.sendmsg(o,t,r,n)},close(e){var t=e.node.sock;t.sock_ops.close(t)}},nextname(){return SOCKFS.nextname.current||(SOCKFS.nextname.current=0),"socket["+SOCKFS.nextname.current+++"]"},websocket_sock_ops:{createPeer(e,t,r){var n;if(typeof t=="object"&&(n=t,t=null,r=null),n)if(n._socket)t=n._socket.remoteAddress,r=n._socket.remotePort;else{var a=/ws[s]?:\/\/([^:]+):(\d+)/.exec(n.url);if(!a)throw new Error("WebSocket URL must be in the format ws(s)://address:port");t=a[1],r=parseInt(a[2],10)}else try{var o=Module.websocket&&typeof Module.websocket=="object",l="ws:#".replace("#","//");if(o&&typeof Module.websocket.url=="string"&&(l=Module.websocket.url),l==="ws://"||l==="wss://"){var u=t.split("/");l=l+u[0]+":"+r+"/"+u.slice(1).join("/")}var _="binary";o&&typeof Module.websocket.subprotocol=="string"&&(_=Module.websocket.subprotocol);var d=void 0;_!=="null"&&(_=_.replace(/^ +| +$/g,"").split(/ *, */),d=_),o&&Module.websocket.subprotocol===null&&(_="null",d=void 0);var p;ENVIRONMENT_IS_NODE?p=wo():p=WebSocket,n=new p(l,d),n.binaryType="arraybuffer"}catch{throw new FS.ErrnoError(23)}var f={addr:t,port:r,socket:n,dgram_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(e,f),SOCKFS.websocket_sock_ops.handlePeerEvents(e,f),e.type===2&&typeof e.sport<"u"&&f.dgram_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(e.sport&65280)>>8,e.sport&255])),f},getPeer(e,t,r){return e.peers[t+":"+r]},addPeer(e,t){e.peers[t.addr+":"+t.port]=t},removePeer(e,t){delete e.peers[t.addr+":"+t.port]},handlePeerEvents(e,t){var r=!0,n=function(){Module.websocket.emit("open",e.stream.fd);try{for(var o=t.dgram_send_queue.shift();o;)t.socket.send(o),o=t.dgram_send_queue.shift()}catch{t.socket.close()}};function a(o){if(typeof o=="string"){var l=new TextEncoder;o=l.encode(o)}else{if(assert(o.byteLength!==void 0),o.byteLength==0)return;o=new Uint8Array(o)}var u=r;if(r=!1,u&&o.length===10&&o[0]===255&&o[1]===255&&o[2]===255&&o[3]===255&&o[4]===112&&o[5]===111&&o[6]===114&&o[7]===116){var _=o[8]<<8|o[9];SOCKFS.websocket_sock_ops.removePeer(e,t),t.port=_,SOCKFS.websocket_sock_ops.addPeer(e,t);return}e.recv_queue.push({addr:t.addr,port:t.port,data:o}),Module.websocket.emit("message",e.stream.fd)}ENVIRONMENT_IS_NODE?(t.socket.on("open",n),t.socket.on("message",function(o,l){l&&a(new Uint8Array(o).buffer)}),t.socket.on("close",function(){Module.websocket.emit("close",e.stream.fd)}),t.socket.on("error",function(o){e.error=14,Module.websocket.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(t.socket.onopen=n,t.socket.onclose=function(){Module.websocket.emit("close",e.stream.fd)},t.socket.onmessage=function(o){a(o.data)},t.socket.onerror=function(o){e.error=14,Module.websocket.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})},poll(e){if(e.type===1&&e.server)return e.pending.length?65:0;var t=0,r=e.type===1?SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport):null;return(e.recv_queue.length||!r||r&&r.socket.readyState===r.socket.CLOSING||r&&r.socket.readyState===r.socket.CLOSED)&&(t|=65),(!r||r&&r.socket.readyState===r.socket.OPEN)&&(t|=4),(r&&r.socket.readyState===r.socket.CLOSING||r&&r.socket.readyState===r.socket.CLOSED)&&(t|=16),t},ioctl(e,t,r){switch(t){case 21531:var n=0;return e.recv_queue.length&&(n=e.recv_queue[0].data.length),HEAP32[r>>>2>>>0]=n,0;default:return 28}},close(e){if(e.server){try{e.server.close()}catch{}e.server=null}for(var t=Object.keys(e.peers),r=0;r{var t=SOCKFS.getSocket(e);if(!t)throw new FS.ErrnoError(8);return t},inetPton4=e=>{for(var t=e.split("."),r=0;r<4;r++){var n=Number(t[r]);if(isNaN(n))return null;t[r]=n}return(t[0]|t[1]<<8|t[2]<<16|t[3]<<24)>>>0},jstoi_q=e=>parseInt(e),inetPton6=e=>{var t,r,n,a,o=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,l=[];if(!o.test(e))return null;if(e==="::")return[0,0,0,0,0,0,0,0];for(e.startsWith("::")?e=e.replace("::","Z:"):e=e.replace("::",":Z:"),e.indexOf(".")>0?(e=e.replace(new RegExp("[.]","g"),":"),t=e.split(":"),t[t.length-4]=jstoi_q(t[t.length-4])+jstoi_q(t[t.length-3])*256,t[t.length-3]=jstoi_q(t[t.length-2])+jstoi_q(t[t.length-1])*256,t=t.slice(0,t.length-2)):t=e.split(":"),n=0,a=0,r=0;r{switch(t){case 2:r=inetPton4(r),zeroMemory(e,16),a&&(HEAP32[a>>>2>>>0]=16),HEAP16[e>>>1>>>0]=t,HEAP32[e+4>>>2>>>0]=r,HEAP16[e+2>>>1>>>0]=_htons(n);break;case 10:r=inetPton6(r),zeroMemory(e,28),a&&(HEAP32[a>>>2>>>0]=28),HEAP32[e>>>2>>>0]=t,HEAP32[e+8>>>2>>>0]=r[0],HEAP32[e+12>>>2>>>0]=r[1],HEAP32[e+16>>>2>>>0]=r[2],HEAP32[e+20>>>2>>>0]=r[3],HEAP16[e+2>>>1>>>0]=_htons(n);break;default:return 5}return 0},DNS={address_map:{id:1,addrs:{},names:{}},lookup_name(e){var t=inetPton4(e);if(t!==null||(t=inetPton6(e),t!==null))return e;var r;if(DNS.address_map.addrs[e])r=DNS.address_map.addrs[e];else{var n=DNS.address_map.id++;assert(n<65535,"exceeded max address mappings of 65535"),r="172.29."+(n&255)+"."+(n&65280),DNS.address_map.names[r]=e,DNS.address_map.addrs[e]=r}return r},lookup_addr(e){return DNS.address_map.names[e]?DNS.address_map.names[e]:null}};function ___syscall_accept4(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),u=l.sock_ops.accept(l);if(t)var _=writeSockaddr(t,u.family,DNS.lookup_name(u.daddr),u.dport,r);return u.stream.fd}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_accept4.sig="iippiii";var inetNtop4=e=>(e&255)+"."+(e>>8&255)+"."+(e>>16&255)+"."+(e>>24&255),inetNtop6=e=>{var t="",r=0,n=0,a=0,o=0,l=0,u=0,_=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],d=!0,p="";for(u=0;u<5;u++)if(_[u]!==0){d=!1;break}if(d){if(p=inetNtop4(_[6]|_[7]<<16),_[5]===-1)return t="::ffff:",t+=p,t;if(_[5]===0)return t="::",p==="0.0.0.0"&&(p=""),p==="0.0.0.1"&&(p="1"),t+=p,t}for(r=0;r<8;r++)_[r]===0&&(r-a>1&&(l=0),a=r,l++),l>n&&(n=l,o=r-n+1);for(r=0;r<8;r++){if(n>1&&_[r]===0&&r>=o&&r{var r=HEAP16[e>>>1>>>0],n=_ntohs(HEAPU16[e+2>>>1>>>0]),a;switch(r){case 2:if(t!==16)return{errno:28};a=HEAP32[e+4>>>2>>>0],a=inetNtop4(a);break;case 10:if(t!==28)return{errno:28};a=[HEAP32[e+8>>>2>>>0],HEAP32[e+12>>>2>>>0],HEAP32[e+16>>>2>>>0],HEAP32[e+20>>>2>>>0]],a=inetNtop6(a);break;default:return{errno:5}}return{family:r,addr:a,port:n}},getSocketAddress=(e,t)=>{var r=readSockaddr(e,t);if(r.errno)throw new FS.ErrnoError(r.errno);return r.addr=DNS.lookup_addr(r.addr)||r.addr,r};function ___syscall_bind(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),u=getSocketAddress(t,r);return l.sock_ops.bind(l,u.addr,u.port),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_bind.sig="iippiii";function ___syscall_chdir(e){e>>>=0;try{return e=SYSCALLS.getStr(e),FS.chdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_chdir.sig="ip";function ___syscall_chmod(e,t){e>>>=0;try{return e=SYSCALLS.getStr(e),FS.chmod(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_chmod.sig="ipi";function ___syscall_connect(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),u=getSocketAddress(t,r);return l.sock_ops.connect(l,u.addr,u.port),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_connect.sig="iippiii";function ___syscall_dup(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.dupStream(t).fd}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_dup.sig="ii";function ___syscall_dup3(e,t,r){try{var n=SYSCALLS.getStreamFromFD(e);if(n.fd===t)return-28;if(t<0||t>=FS.MAX_OPEN_FDS)return-8;var a=FS.getStream(t);return a&&FS.close(a),FS.dupStream(n,t).fd}catch(o){if(typeof FS>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}___syscall_dup3.sig="iiii";function ___syscall_faccessat(e,t,r,n){t>>>=0;try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),r&-8)return-28;var a=FS.lookupPath(t,{follow:!0}),o=a.node;if(!o)return-44;var l="";return r&4&&(l+="r"),r&2&&(l+="w"),r&1&&(l+="x"),l&&FS.nodePermissions(o,l)?-2:0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_faccessat.sig="iipii";var ___syscall_fadvise64=(e,t,r,n)=>0;___syscall_fadvise64.sig="iiiiiii";function ___syscall_fallocate(e,t,r,n,a,o){var l=convertI32PairToI53Checked(r,n),u=convertI32PairToI53Checked(a,o);try{if(isNaN(l))return 61;var _=SYSCALLS.getStreamFromFD(e);return FS.allocate(_,l,u),0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_fallocate.sig="iiiiiii";function ___syscall_fchdir(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.chdir(t.path),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_fchdir.sig="ii";function ___syscall_fchmod(e,t){try{return FS.fchmod(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_fchmod.sig="iii";function ___syscall_fchmodat2(e,t,r,n){t>>>=0;try{var a=n&256;return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),FS.chmod(t,r,a),0}catch(o){if(typeof FS>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}___syscall_fchmodat2.sig="iipii";function ___syscall_fchown32(e,t,r){try{return FS.fchown(e,t,r),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_fchown32.sig="iiii";function ___syscall_fchownat(e,t,r,n,a){t>>>=0;try{t=SYSCALLS.getStr(t);var o=a&256;return a=a&-257,t=SYSCALLS.calculateAt(e,t),(o?FS.lchown:FS.chown)(t,r,n),0}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}___syscall_fchownat.sig="iipiii";function syscallGetVarargI(){var e=HEAP32[+SYSCALLS.varargs>>>2>>>0];return SYSCALLS.varargs+=4,e}var syscallGetVarargP=syscallGetVarargI;function ___syscall_fcntl64(e,t,r){r>>>=0,SYSCALLS.varargs=r;try{var n=SYSCALLS.getStreamFromFD(e);switch(t){case 0:{var a=syscallGetVarargI();if(a<0)return-28;for(;FS.streams[a];)a++;var o;return o=FS.dupStream(n,a),o.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var a=syscallGetVarargI();return n.flags|=a,0}case 12:{var a=syscallGetVarargP(),l=0;return HEAP16[a+l>>>1>>>0]=2,0}case 13:case 14:return 0}return-28}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_fcntl64.sig="iiip";function ___syscall_fdatasync(e){try{var t=SYSCALLS.getStreamFromFD(e);return 0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_fdatasync.sig="ii";function ___syscall_fstat64(e,t){t>>>=0;try{var r=SYSCALLS.getStreamFromFD(e);return SYSCALLS.doStat(FS.stat,r.path,t)}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_fstat64.sig="iip";function ___syscall_statfs64(e,t,r){e>>>=0,r>>>=0;try{return e=SYSCALLS.getStr(e),HEAP32[r+4>>>2>>>0]=4096,HEAP32[r+40>>>2>>>0]=4096,HEAP32[r+8>>>2>>>0]=1e6,HEAP32[r+12>>>2>>>0]=5e5,HEAP32[r+16>>>2>>>0]=5e5,HEAP32[r+20>>>2>>>0]=FS.nextInode,HEAP32[r+24>>>2>>>0]=1e6,HEAP32[r+28>>>2>>>0]=42,HEAP32[r+44>>>2>>>0]=2,HEAP32[r+36>>>2>>>0]=255,0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_statfs64.sig="ippp";function ___syscall_fstatfs64(e,t,r){t>>>=0,r>>>=0;try{var n=SYSCALLS.getStreamFromFD(e);return ___syscall_statfs64(0,t,r)}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_fstatfs64.sig="iipp";function ___syscall_ftruncate64(e,t,r){var n=convertI32PairToI53Checked(t,r);try{return isNaN(n)?61:(FS.ftruncate(e,n),0)}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_ftruncate64.sig="iiii";var stringToUTF8=(e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r);function ___syscall_getcwd(e,t){e>>>=0,t>>>=0;try{if(t===0)return-28;var r=FS.cwd(),n=lengthBytesUTF8(r)+1;return t"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_getcwd.sig="ipp";function ___syscall_getdents64(e,t,r){t>>>=0,r>>>=0;try{var n=SYSCALLS.getStreamFromFD(e);n.getdents||(n.getdents=FS.readdir(n.path));for(var a=280,o=0,l=FS.llseek(n,0,1),u=Math.floor(l/a);u>>0,(tempDouble=_,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+o>>>2>>>0]=tempI64[0],HEAP32[t+o+4>>>2>>>0]=tempI64[1],tempI64=[(u+1)*a>>>0,(tempDouble=(u+1)*a,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+o+8>>>2>>>0]=tempI64[0],HEAP32[t+o+12>>>2>>>0]=tempI64[1],HEAP16[t+o+16>>>1>>>0]=280,HEAP8[t+o+18>>>0]=d,stringToUTF8(p,t+o+19,256),o+=a,u+=1}return FS.llseek(n,u*a,0),o}catch(h){if(typeof FS>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}___syscall_getdents64.sig="iipp";function ___syscall_getpeername(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e);if(!l.daddr)return-53;var u=writeSockaddr(t,l.family,DNS.lookup_name(l.daddr),l.dport,r);return 0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_getpeername.sig="iippiii";function ___syscall_getsockname(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),u=writeSockaddr(t,l.family,DNS.lookup_name(l.saddr||"0.0.0.0"),l.sport,r);return 0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_getsockname.sig="iippiii";function ___syscall_getsockopt(e,t,r,n,a,o){n>>>=0,a>>>=0;try{var l=getSocketFromFD(e);return t===1&&r===4?(HEAP32[n>>>2>>>0]=l.error,HEAP32[a>>>2>>>0]=4,l.error=null,0):-50}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_getsockopt.sig="iiiippi";function ___syscall_ioctl(e,t,r){r>>>=0,SYSCALLS.varargs=r;try{var n=SYSCALLS.getStreamFromFD(e);switch(t){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var a=n.tty.ops.ioctl_tcgets(n),o=syscallGetVarargP();HEAP32[o>>>2>>>0]=a.c_iflag||0,HEAP32[o+4>>>2>>>0]=a.c_oflag||0,HEAP32[o+8>>>2>>>0]=a.c_cflag||0,HEAP32[o+12>>>2>>>0]=a.c_lflag||0;for(var l=0;l<32;l++)HEAP8[o+l+17>>>0]=a.c_cc[l]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var o=syscallGetVarargP(),u=HEAP32[o>>>2>>>0],_=HEAP32[o+4>>>2>>>0],d=HEAP32[o+8>>>2>>>0],p=HEAP32[o+12>>>2>>>0],f=[],l=0;l<32;l++)f.push(HEAP8[o+l+17>>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:u,c_oflag:_,c_cflag:d,c_lflag:p,c_cc:f})}return 0}case 21519:{if(!n.tty)return-59;var o=syscallGetVarargP();return HEAP32[o>>>2>>>0]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var o=syscallGetVarargP();return FS.ioctl(n,t,o)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var m=n.tty.ops.ioctl_tiocgwinsz(n.tty),o=syscallGetVarargP();HEAP16[o>>>1>>>0]=m[0],HEAP16[o+2>>>1>>>0]=m[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(h){if(typeof FS>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}___syscall_ioctl.sig="iiip";function ___syscall_listen(e,t){try{var r=getSocketFromFD(e);return r.sock_ops.listen(r,t),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_listen.sig="iiiiiii";function ___syscall_lstat64(e,t){e>>>=0,t>>>=0;try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.lstat,e,t)}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_lstat64.sig="ipp";function ___syscall_mkdirat(e,t,r){t>>>=0;try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),t=PATH.normalize(t),t[t.length-1]==="/"&&(t=t.substr(0,t.length-1)),FS.mkdir(t,r,0),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_mkdirat.sig="iipi";function ___syscall_mknodat(e,t,r,n){t>>>=0;try{switch(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),r&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return FS.mknod(t,r,n),0}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_mknodat.sig="iipii";function ___syscall_newfstatat(e,t,r,n){t>>>=0,r>>>=0;try{t=SYSCALLS.getStr(t);var a=n&256,o=n&4096;return n=n&-6401,t=SYSCALLS.calculateAt(e,t,o),SYSCALLS.doStat(a?FS.lstat:FS.stat,t,r)}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}___syscall_newfstatat.sig="iippi";function ___syscall_openat(e,t,r,n){t>>>=0,n>>>=0,SYSCALLS.varargs=n;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t);var a=n?syscallGetVarargI():0;return FS.open(t,r,a).fd}catch(o){if(typeof FS>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}___syscall_openat.sig="iipip";var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount(e){return FS.createNode(null,"/",16895,0)},createPipe(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=PIPEFS.nextname(),r=PIPEFS.nextname(),n=FS.createNode(PIPEFS.root,t,4096,0),a=FS.createNode(PIPEFS.root,r,4096,0);n.pipe=e,a.pipe=e;var o=FS.createStream({path:t,node:n,flags:0,seekable:!1,stream_ops:PIPEFS.stream_ops});n.stream=o;var l=FS.createStream({path:r,node:a,flags:1,seekable:!1,stream_ops:PIPEFS.stream_ops});return a.stream=l,{readable_fd:o.fd,writable_fd:l.fd}},stream_ops:{poll(e){var t=e.node.pipe;if((e.flags&2097155)===1)return 260;if(t.buckets.length>0)for(var r=0;r0)return 65}return 0},ioctl(e,t,r){return 28},fsync(e){return 28},read(e,t,r,n,a){for(var o=e.node.pipe,l=0,u=0;u=u)return _.buffer.set(l,_.offset),_.offset+=u,u;d>0&&(_.buffer.set(l.subarray(0,d),_.offset),_.offset+=d,l=l.subarray(d,l.byteLength));for(var p=l.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,f=l.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,m=0;m0){var h={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:l.byteLength,roffset:0};o.buckets.push(h),h.buffer.set(l)}return u},close(e){var t=e.node.pipe;t.refcnt--,t.refcnt===0&&(t.buckets=null)}},nextname(){return PIPEFS.nextname.current||(PIPEFS.nextname.current=0),"pipe["+PIPEFS.nextname.current+++"]"}};function ___syscall_pipe(e){e>>>=0;try{if(e==0)throw new FS.ErrnoError(21);var t=PIPEFS.createPipe();return HEAP32[e>>>2>>>0]=t.readable_fd,HEAP32[e+4>>>2>>>0]=t.writable_fd,0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_pipe.sig="ip";function ___syscall_poll(e,t,r){e>>>=0;try{for(var n=0,a=0;a>>2>>>0],u=HEAP16[o+4>>>1>>>0],_=32,d=FS.getStream(l);d&&(_=SYSCALLS.DEFAULT_POLLMASK,d.stream_ops.poll&&(_=d.stream_ops.poll(d,-1))),_&=u|8|16,_&&n++,HEAP16[o+6>>>1>>>0]=_}return n}catch(p){if(typeof FS>"u"||p.name!=="ErrnoError")throw p;return-p.errno}}___syscall_poll.sig="ipii";function ___syscall_readlinkat(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),n<=0)return-28;var a=FS.readlink(t),o=Math.min(n,lengthBytesUTF8(a)),l=HEAP8[r+o>>>0];return stringToUTF8(a,r,n+1),HEAP8[r+o>>>0]=l,o}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_readlinkat.sig="iippp";function ___syscall_recvfrom(e,t,r,n,a,o){t>>>=0,r>>>=0,a>>>=0,o>>>=0;try{var l=getSocketFromFD(e),u=l.sock_ops.recvmsg(l,r);if(!u)return 0;if(a)var _=writeSockaddr(a,l.family,DNS.lookup_name(u.addr),u.port,o);return HEAPU8.set(u.buffer,t>>>0),u.buffer.byteLength}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_recvfrom.sig="iippipp";function ___syscall_recvmsg(e,t,r,n,a,o){t>>>=0;try{for(var l=getSocketFromFD(e),u=HEAPU32[t+8>>>2>>>0],_=HEAP32[t+12>>>2>>>0],d=0,p=0;p<_;p++)d+=HEAP32[u+(8*p+4)>>>2>>>0];var f=l.sock_ops.recvmsg(l,d);if(!f)return 0;var m=HEAPU32[t>>>2>>>0];if(m)var h=writeSockaddr(m,l.family,DNS.lookup_name(f.addr),f.port);for(var g=0,b=f.buffer.byteLength,p=0;b>0&&p<_;p++){var v=HEAPU32[u+(8*p+0)>>>2>>>0],S=HEAP32[u+(8*p+4)>>>2>>>0];if(S){var L=Math.min(S,b),T=f.buffer.subarray(g,g+L);HEAPU8.set(T,v+g>>>0),g+=L,b-=L}}return g}catch(A){if(typeof FS>"u"||A.name!=="ErrnoError")throw A;return-A.errno}}___syscall_recvmsg.sig="iipiiii";function ___syscall_renameat(e,t,r,n){t>>>=0,n>>>=0;try{return t=SYSCALLS.getStr(t),n=SYSCALLS.getStr(n),t=SYSCALLS.calculateAt(e,t),n=SYSCALLS.calculateAt(r,n),FS.rename(t,n),0}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_renameat.sig="iipip";function ___syscall_rmdir(e){e>>>=0;try{return e=SYSCALLS.getStr(e),FS.rmdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_rmdir.sig="ip";function ___syscall_sendmsg(e,t,r,n,a,o){t>>>=0;try{var l=getSocketFromFD(e),u=HEAPU32[t+8>>>2>>>0],_=HEAP32[t+12>>>2>>>0],d,p,f=HEAPU32[t>>>2>>>0],m=HEAP32[t+4>>>2>>>0];if(f){var h=readSockaddr(f,m);if(h.errno)return-h.errno;p=h.port,d=DNS.lookup_addr(h.addr)||h.addr}for(var g=0,b=0;b<_;b++)g+=HEAP32[u+(8*b+4)>>>2>>>0];for(var v=new Uint8Array(g),S=0,b=0;b<_;b++)for(var L=HEAPU32[u+(8*b+0)>>>2>>>0],T=HEAP32[u+(8*b+4)>>>2>>>0],A=0;A>>0];return l.sock_ops.sendmsg(l,v,0,g,d,p)}catch(M){if(typeof FS>"u"||M.name!=="ErrnoError")throw M;return-M.errno}}___syscall_sendmsg.sig="iipippi";function ___syscall_sendto(e,t,r,n,a,o){t>>>=0,r>>>=0,a>>>=0,o>>>=0;try{var l=getSocketFromFD(e);if(!a)return FS.write(l.stream,HEAP8,t,r);var u=getSocketAddress(a,o);return l.sock_ops.sendmsg(l,HEAP8,t,r,u.addr,u.port)}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_sendto.sig="iippipp";function ___syscall_socket(e,t,r){try{var n=SOCKFS.createSocket(e,t,r);return n.stream.fd}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_socket.sig="iiiiiii";function ___syscall_stat64(e,t){e>>>=0,t>>>=0;try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.stat,e,t)}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_stat64.sig="ipp";function ___syscall_symlink(e,t){e>>>=0,t>>>=0;try{return e=SYSCALLS.getStr(e),t=SYSCALLS.getStr(t),FS.symlink(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}___syscall_symlink.sig="ipp";function ___syscall_symlinkat(e,t,r){e>>>=0,r>>>=0;try{return r=SYSCALLS.calculateAt(t,r),FS.symlink(e,r),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_symlinkat.sig="ipip";function ___syscall_truncate64(e,t,r){e>>>=0;var n=convertI32PairToI53Checked(t,r);try{return isNaN(n)?61:(e=SYSCALLS.getStr(e),FS.truncate(e,n),0)}catch(a){if(typeof FS>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}___syscall_truncate64.sig="ipii";function ___syscall_unlinkat(e,t,r){t>>>=0;try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),r===0?FS.unlink(t):r===512?FS.rmdir(t):abort("Invalid flags passed to unlinkat"),0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}___syscall_unlinkat.sig="iipi";var readI53FromI64=e=>HEAPU32[e>>>2>>>0]+HEAP32[e+4>>>2>>>0]*4294967296;function ___syscall_utimensat(e,t,r,n){t>>>=0,r>>>=0;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t,!0);var a=Date.now(),o,l;if(!r)o=a,l=a;else{var u=readI53FromI64(r),_=HEAP32[r+8>>>2>>>0];_==1073741823?o=a:_==1073741822?o=-1:o=u*1e3+_/1e6,r+=16,u=readI53FromI64(r),_=HEAP32[r+8>>>2>>>0],_==1073741823?l=a:_==1073741822?l=-1:l=u*1e3+_/1e6}return(l!=-1||o!=-1)&&FS.utime(t,o,l),0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}___syscall_utimensat.sig="iippi";var ___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=()=>{abort("")};__abort_js.sig="v";var ENV={},stackAlloc=e=>__emscripten_stack_alloc(e),stringToUTF8OnStack=e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},dlSetError=e=>{var t=stackSave(),r=stringToUTF8OnStack(e);___dl_seterr(r,0),stackRestore(t)},dlopenInternal=(e,t)=>{var r=UTF8ToString(e+36),n=HEAP32[e+4>>>2>>>0];r=PATH.normalize(r);var a=!!(n&256),o=a?null:{},l={global:a,nodelete:!!(n&4096),loadAsync:t.loadAsync};if(t.loadAsync)return loadDynamicLibrary(r,l,o,e);try{return loadDynamicLibrary(r,l,o,e)}catch(u){return dlSetError("Could not load dynamic lib: ".concat(r,` +`).concat(u)),0}};function __dlopen_js(e){return e>>>=0,dlopenInternal(e,{loadAsync:!1})}__dlopen_js.sig="pp";function __dlsym_js(e,t,r){e>>>=0,t>>>=0,r>>>=0,t=UTF8ToString(t);var n,a,o=LDSO.loadedLibsByHandle[e];if(!o.exports.hasOwnProperty(t)||o.exports[t].stub)return dlSetError('Tried to lookup unknown symbol "'.concat(t,'" in dynamic lib: ').concat(o.name)),0;a=Object.keys(o.exports).indexOf(t);var l="orig$"+t;if(n=o.exports[l],n?a=Object.keys(o.exports).indexOf(l):n=o.exports[t],typeof n=="function"){var u=getFunctionAddress(n);u?n=u:(n=addFunction(n,n.sig),HEAPU32[r>>>2>>>0]=a)}return n}__dlsym_js.sig="pppp";function __embind_register_bigint(e,t,r,n,a){}__embind_register_bigint.sig="vpppiiii";var embind_init_charCodes=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);embind_charCodes=e},embind_charCodes,readLatin1String=e=>{for(var t="",r=e;HEAPU8[r>>>0];)t+=embind_charCodes[HEAPU8[r++>>>0]];return t},awaitingDependencies={},registeredTypes={},typeDependencies={},BindingError,throwBindingError=e=>{throw new BindingError(e)},InternalError,throwInternalError=e=>{throw new InternalError(e)},whenDependentTypesAreResolved=(e,t,r)=>{e.forEach(u=>typeDependencies[u]=t);function n(u){var _=r(u);_.length!==e.length&&throwInternalError("Mismatched type converter count");for(var d=0;d{registeredTypes.hasOwnProperty(u)?a[_]=registeredTypes[u]:(o.push(u),awaitingDependencies.hasOwnProperty(u)||(awaitingDependencies[u]=[]),awaitingDependencies[u].push(()=>{a[_]=registeredTypes[u],++l,l===o.length&&n(a)}))}),o.length===0&&n(a)};function sharedRegisterType(e,t,r={}){var n=t.name;if(e||throwBindingError('type "'.concat(n,'" must have a positive integer typeid pointer')),registeredTypes.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;throwBindingError("Cannot register type '".concat(n,"' twice"))}if(registeredTypes[e]=t,delete typeDependencies[e],awaitingDependencies.hasOwnProperty(e)){var a=awaitingDependencies[e];delete awaitingDependencies[e],a.forEach(o=>o())}}function registerType(e,t,r={}){return sharedRegisterType(e,t,r)}var GenericWireTypeSize=8;function __embind_register_bool(e,t,r,n){e>>>=0,t>>>=0,t=readLatin1String(t),registerType(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:GenericWireTypeSize,readValueFromPointer:function(a){return this.fromWireType(HEAPU8[a>>>0])},destructorFunction:null})}__embind_register_bool.sig="vppii";var emval_freelist=[],emval_handles=[];function __emval_decref(e){e>>>=0,e>9&&--emval_handles[e+1]===0&&(emval_handles[e]=void 0,emval_freelist.push(e))}__emval_decref.sig="vp";var count_emval_handles=()=>emval_handles.length/2-5-emval_freelist.length,init_emval=()=>{emval_handles.push(0,1,void 0,1,null,1,!0,1,!1,1),Module.count_emval_handles=count_emval_handles},Emval={toValue:e=>(e||throwBindingError("Cannot use deleted val. handle = "+e),emval_handles[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=emval_freelist.pop()||emval_handles.length;return emval_handles[t]=e,emval_handles[t+1]=1,t}}}};function readPointer(e){return this.fromWireType(HEAPU32[e>>>2>>>0])}var EmValType={name:"emscripten::val",fromWireType:e=>{var t=Emval.toValue(e);return __emval_decref(e),t},toWireType:(e,t)=>Emval.toHandle(t),argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:null};function __embind_register_emval(e){return e>>>=0,registerType(e,EmValType)}__embind_register_emval.sig="vp";var embindRepr=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},floatReadValueFromPointer=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(HEAPF32[r>>>2>>>0])};case 8:return function(r){return this.fromWireType(HEAPF64[r>>>3>>>0])};default:throw new TypeError("invalid float width (".concat(t,"): ").concat(e))}},__embind_register_float=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,t=readLatin1String(t),registerType(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:GenericWireTypeSize,readValueFromPointer:floatReadValueFromPointer(t,r),destructorFunction:null})};__embind_register_float.sig="vppp";var integerReadValueFromPointer=(e,t,r)=>{switch(t){case 1:return r?n=>HEAP8[n>>>0]:n=>HEAPU8[n>>>0];case 2:return r?n=>HEAP16[n>>>1>>>0]:n=>HEAPU16[n>>>1>>>0];case 4:return r?n=>HEAP32[n>>>2>>>0]:n=>HEAPU32[n>>>2>>>0];default:throw new TypeError("invalid integer width (".concat(t,"): ").concat(e))}};function __embind_register_integer(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,t=readLatin1String(t);var o=p=>p;if(n===0){var l=32-8*r;o=p=>p<>>l}var u=t.includes("unsigned"),_=(p,f)=>{},d;u?d=function(p,f){return _(f,this.name),f>>>0}:d=function(p,f){return _(f,this.name),f},registerType(e,{name:t,fromWireType:o,toWireType:d,argPackAdvance:GenericWireTypeSize,readValueFromPointer:integerReadValueFromPointer(t,r,n!==0),destructorFunction:null})}__embind_register_integer.sig="vpppii";function __embind_register_memory_view(e,t,r){e>>>=0,r>>>=0;var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(l){var u=HEAPU32[l>>>2>>>0],_=HEAPU32[l+4>>>2>>>0];return new a(HEAP8.buffer,_,u)}r=readLatin1String(r),registerType(e,{name:r,fromWireType:o,argPackAdvance:GenericWireTypeSize,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}__embind_register_memory_view.sig="vpip";function __embind_register_std_string(e,t){e>>>=0,t>>>=0,t=readLatin1String(t);var r=t==="std::string";registerType(e,{name:t,fromWireType(n){var a=HEAPU32[n>>>2>>>0],o=n+4,l;if(r)for(var u=o,_=0;_<=a;++_){var d=o+_;if(_==a||HEAPU8[d>>>0]==0){var p=d-u,f=UTF8ToString(u,p);l===void 0?l=f:(l+="\0",l+=f),u=d+1}}else{for(var m=new Array(a),_=0;_>>0]);l=m.join("")}return _free(n),l},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,l=typeof a=="string";l||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||throwBindingError("Cannot pass non-string to std::string"),r&&l?o=lengthBytesUTF8(a):o=a.length;var u=_malloc(4+o+1),_=u+4;if(HEAPU32[u>>>2>>>0]=o,r&&l)stringToUTF8(a,_,o+1);else if(l)for(var d=0;d255&&(_free(_),throwBindingError("String has UTF-16 code units that do not fit in 8 bits")),HEAPU8[_+d>>>0]=p}else for(var d=0;d>>0]=a[d];return n!==null&&n.push(_free,u),u},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(n){_free(n)}})}__embind_register_std_string.sig="vpp";var UTF16Decoder=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,UTF16ToString=(e,t)=>{for(var r=e,n=r>>1,a=n+t/2;!(n>=a)&&HEAPU16[n>>>0];)++n;if(r=n<<1,r-e>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(e>>>0,r>>>0));for(var o="",l=0;!(l>=t/2);++l){var u=HEAP16[e+l*2>>>1>>>0];if(u==0)break;o+=String.fromCharCode(u)}return o},stringToUTF16=(e,t,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=t,a=r>>1>>>0]=l,t+=2}return HEAP16[t>>>1>>>0]=0,t-n},lengthBytesUTF16=e=>e.length*2,UTF32ToString=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=HEAP32[e+r*4>>>2>>>0];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},stringToUTF32=(e,t,r)=>{if(t>>>=0,r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o=55296&&l<=57343){var u=e.charCodeAt(++o);l=65536+((l&1023)<<10)|u&1023}if(HEAP32[t>>>2>>>0]=l,t+=4,t+4>a)break}return HEAP32[t>>>2>>>0]=0,t-n},lengthBytesUTF32=e=>{for(var t=0,r=0;r=55296&&n<=57343&&++r,t+=4}return t},__embind_register_std_wstring=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,r=readLatin1String(r);var n,a,o,l;t===2?(n=UTF16ToString,a=stringToUTF16,l=lengthBytesUTF16,o=u=>HEAPU16[u>>>1>>>0]):t===4&&(n=UTF32ToString,a=stringToUTF32,l=lengthBytesUTF32,o=u=>HEAPU32[u>>>2>>>0]),registerType(e,{name:r,fromWireType:u=>{for(var _=HEAPU32[u>>>2>>>0],d,p=u+4,f=0;f<=_;++f){var m=u+4+f*t;if(f==_||o(m)==0){var h=m-p,g=n(p,h);d===void 0?d=g:(d+="\0",d+=g),p=m+t}}return _free(u),d},toWireType:(u,_)=>{typeof _!="string"&&throwBindingError("Cannot pass non-string to C++ string type ".concat(r));var d=l(_),p=_malloc(4+d+t);return HEAPU32[p>>>2>>>0]=d/t,a(_,p+4,d+t),u!==null&&u.push(_free,p),p},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(u){_free(u)}})};__embind_register_std_wstring.sig="vppp";var __embind_register_void=function(e,t){e>>>=0,t>>>=0,t=readLatin1String(t),registerType(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})};__embind_register_void.sig="vpp";var handleException=e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{var t;EXITSTATUS=e,keepRuntimeAlive()||((t=Module.onExit)==null||t.call(Module,e),ABORT=!0),quit_(e,new ExitStatus(e))};_proc_exit.sig="vi";var exitJS=(e,t)=>{EXITSTATUS=e,_proc_exit(e)},_exit=exitJS;_exit.sig="vi";var maybeExit=()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},callUserCallback=e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}};function __emscripten_dlopen_js(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;function a(u){var _=UTF8ToString(e+36);dlSetError("'Could not load dynamic lib: ".concat(_,` +`).concat(u)),callUserCallback(()=>getWasmTableEntry(r)(e,n))}function o(){callUserCallback(()=>getWasmTableEntry(t)(e,n))}var l=dlopenInternal(e,{loadAsync:!0});l?l.then(o,a):a()}__emscripten_dlopen_js.sig="vpppp";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=()=>nowIsMonotonic;__emscripten_get_now_is_monotonic.sig="i";var getExecutableName=()=>thisProgram||"./this.program";function __emscripten_get_progname(e,t){e>>>=0,stringToUTF8(getExecutableName(),e,t)}__emscripten_get_progname.sig="vpi";function __emscripten_lookup_name(e){e>>>=0;var t=UTF8ToString(e);return inetPton4(DNS.lookup_name(t))}__emscripten_lookup_name.sig="ip";function __emscripten_memcpy_js(e,t,r){return e>>>=0,t>>>=0,r>>>=0,HEAPU8.copyWithin(e>>>0,t>>>0,t+r>>>0)}__emscripten_memcpy_js.sig="vppp";var __emscripten_runtime_keepalive_clear=()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0};__emscripten_runtime_keepalive_clear.sig="v";function __emscripten_set_offscreencanvas_size(e,t,r){return-1}__emscripten_set_offscreencanvas_size.sig="ipii";function __emscripten_system(e){if(e>>>=0,ENVIRONMENT_IS_NODE){if(!e)return 1;var t=UTF8ToString(e);if(!t.length)return 0;var r=["child_process"].map(ki),n=r.spawnSync(t,[],{shell:!0,stdio:"inherit"}),a=(l,u)=>l<<8|u;if(n.status===null){var o=l=>{switch(l){case"SIGHUP":return 1;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;default:return 2}};return a(0,o(n.signal))}return a(n.status,0)}return e?-52:0}__emscripten_system.sig="ip";var __emscripten_throw_longjmp=()=>{throw 1/0};__emscripten_throw_longjmp.sig="v";function __gmtime_js(e,t,r){var n=convertI32PairToI53Checked(e,t);r>>>=0;var a=new Date(n*1e3);HEAP32[r>>>2>>>0]=a.getUTCSeconds(),HEAP32[r+4>>>2>>>0]=a.getUTCMinutes(),HEAP32[r+8>>>2>>>0]=a.getUTCHours(),HEAP32[r+12>>>2>>>0]=a.getUTCDate(),HEAP32[r+16>>>2>>>0]=a.getUTCMonth(),HEAP32[r+20>>>2>>>0]=a.getUTCFullYear()-1900,HEAP32[r+24>>>2>>>0]=a.getUTCDay();var o=Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0),l=(a.getTime()-o)/(1e3*60*60*24)|0;HEAP32[r+28>>>2>>>0]=l}__gmtime_js.sig="viip";var isLeapYear=e=>e%4===0&&(e%100!==0||e%400===0),MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334],ydayFromDate=e=>{var t=isLeapYear(e.getFullYear()),r=t?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE,n=r[e.getMonth()]+e.getDate()-1;return n};function __localtime_js(e,t,r){var n=convertI32PairToI53Checked(e,t);r>>>=0;var a=new Date(n*1e3);HEAP32[r>>>2>>>0]=a.getSeconds(),HEAP32[r+4>>>2>>>0]=a.getMinutes(),HEAP32[r+8>>>2>>>0]=a.getHours(),HEAP32[r+12>>>2>>>0]=a.getDate(),HEAP32[r+16>>>2>>>0]=a.getMonth(),HEAP32[r+20>>>2>>>0]=a.getFullYear()-1900,HEAP32[r+24>>>2>>>0]=a.getDay();var o=ydayFromDate(a)|0;HEAP32[r+28>>>2>>>0]=o,HEAP32[r+36>>>2>>>0]=-(a.getTimezoneOffset()*60);var l=new Date(a.getFullYear(),0,1),u=new Date(a.getFullYear(),6,1).getTimezoneOffset(),_=l.getTimezoneOffset(),d=(u!=_&&a.getTimezoneOffset()==Math.min(_,u))|0;HEAP32[r+32>>>2>>>0]=d}__localtime_js.sig="viip";var __mktime_js=function(e){e>>>=0;var t=(()=>{var r=new Date(HEAP32[e+20>>>2>>>0]+1900,HEAP32[e+16>>>2>>>0],HEAP32[e+12>>>2>>>0],HEAP32[e+8>>>2>>>0],HEAP32[e+4>>>2>>>0],HEAP32[e>>>2>>>0],0),n=HEAP32[e+32>>>2>>>0],a=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),l=new Date(r.getFullYear(),6,1).getTimezoneOffset(),u=o.getTimezoneOffset(),_=Math.min(u,l);if(n<0)HEAP32[e+32>>>2>>>0]=+(l!=u&&_==a);else if(n>0!=(_==a)){var d=Math.max(u,l),p=n>0?_:d;r.setTime(r.getTime()+(p-a)*6e4)}HEAP32[e+24>>>2>>>0]=r.getDay();var f=ydayFromDate(r)|0;HEAP32[e+28>>>2>>>0]=f,HEAP32[e>>>2>>>0]=r.getSeconds(),HEAP32[e+4>>>2>>>0]=r.getMinutes(),HEAP32[e+8>>>2>>>0]=r.getHours(),HEAP32[e+12>>>2>>>0]=r.getDate(),HEAP32[e+16>>>2>>>0]=r.getMonth(),HEAP32[e+20>>>2>>>0]=r.getYear();var m=r.getTime();return isNaN(m)?-1:m/1e3})();return setTempRet0((tempDouble=t,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)),t>>>0};__mktime_js.sig="ip";function __mmap_js(e,t,r,n,a,o,l,u){e>>>=0;var _=convertI32PairToI53Checked(a,o);l>>>=0,u>>>=0;try{if(isNaN(_))return 61;var d=SYSCALLS.getStreamFromFD(n),p=FS.mmap(d,e,_,t,r),f=p.ptr;return HEAP32[l>>>2>>>0]=p.allocated,HEAPU32[u>>>2>>>0]=f,0}catch(m){if(typeof FS>"u"||m.name!=="ErrnoError")throw m;return-m.errno}}__mmap_js.sig="ipiiiiipp";function __msync_js(e,t,r,n,a,o,l){e>>>=0,t>>>=0;var u=convertI32PairToI53Checked(o,l);try{return isNaN(u)?61:(SYSCALLS.doMsync(e,SYSCALLS.getStreamFromFD(a),t,n,u),0)}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}__msync_js.sig="ippiiiii";function __munmap_js(e,t,r,n,a,o,l){e>>>=0,t>>>=0;var u=convertI32PairToI53Checked(o,l);try{var _=SYSCALLS.getStreamFromFD(a);r&2&&SYSCALLS.doMsync(e,_,t,n,u)}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}__munmap_js.sig="ippiiiii";var timers={},_emscripten_get_now=()=>performance.now();_emscripten_get_now.sig="d";var __setitimer_js=(e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var r=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:r,timeout_ms:t},0};__setitimer_js.sig="iid";var __timegm_js=function(e){e>>>=0;var t=(()=>{var r=Date.UTC(HEAP32[e+20>>>2>>>0]+1900,HEAP32[e+16>>>2>>>0],HEAP32[e+12>>>2>>>0],HEAP32[e+8>>>2>>>0],HEAP32[e+4>>>2>>>0],HEAP32[e>>>2>>>0],0),n=new Date(r);HEAP32[e+24>>>2>>>0]=n.getUTCDay();var a=Date.UTC(n.getUTCFullYear(),0,1,0,0,0,0),o=(n.getTime()-a)/(1e3*60*60*24)|0;return HEAP32[e+28>>>2>>>0]=o,n.getTime()/1e3})();return setTempRet0((tempDouble=t,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)),t>>>0};__timegm_js.sig="ip";var __tzset_js=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=new Date().getFullYear(),o=new Date(a,0,1),l=new Date(a,6,1),u=o.getTimezoneOffset(),_=l.getTimezoneOffset(),d=Math.max(u,_);HEAPU32[e>>>2>>>0]=d*60,HEAP32[t>>>2>>>0]=+(u!=_);var p=h=>{var g=h>=0?"-":"+",b=Math.abs(h),v=String(Math.floor(b/60)).padStart(2,"0"),S=String(b%60).padStart(2,"0");return"UTC".concat(g).concat(v).concat(S)},f=p(u),m=p(_);_{if(MainLoop.timingMode=e,MainLoop.timingValue=t,!MainLoop.func)return 1;if(MainLoop.running||(MainLoop.running=!0),e==0)MainLoop.scheduler=function(){var o=Math.max(0,MainLoop.tickStartTime+t-_emscripten_get_now())|0;setTimeout(MainLoop.runner,o)},MainLoop.method="timeout";else if(e==1)MainLoop.scheduler=function(){MainLoop.requestAnimationFrame(MainLoop.runner)},MainLoop.method="rAF";else if(e==2){if(typeof MainLoop.setImmediate>"u")if(typeof setImmediate>"u"){var r=[],n="setimmediate",a=o=>{(o.data===n||o.data.target===n)&&(o.stopPropagation(),r.shift()())};addEventListener("message",a,!0),MainLoop.setImmediate=o=>{r.push(o),ENVIRONMENT_IS_WORKER?(Module.setImmediates!=null||(Module.setImmediates=[]),Module.setImmediates.push(o),postMessage({target:n})):postMessage(n,"*")}}else MainLoop.setImmediate=setImmediate;MainLoop.scheduler=function(){MainLoop.setImmediate(MainLoop.runner)},MainLoop.method="immediate"}return 0};_emscripten_set_main_loop_timing.sig="iii";var setMainLoop=(e,t,r,n,a)=>{MainLoop.func=e,MainLoop.arg=n;var o=MainLoop.currentlyRunningMainloop;function l(){return o0){var u=MainLoop.queue.shift();if(u.func(u.arg),MainLoop.remainingBlockers){var _=MainLoop.remainingBlockers,d=_%1==0?_-1:Math.floor(_);u.counted?MainLoop.remainingBlockers=d:(d=d+.5,MainLoop.remainingBlockers=(8*_+d)/9)}if(MainLoop.updateStatus(),!l())return;setTimeout(MainLoop.runner,0);return}if(l()){if(MainLoop.currentFrameNumber=MainLoop.currentFrameNumber+1|0,MainLoop.timingMode==1&&MainLoop.timingValue>1&&MainLoop.currentFrameNumber%MainLoop.timingValue!=0){MainLoop.scheduler();return}else MainLoop.timingMode==0&&(MainLoop.tickStartTime=_emscripten_get_now());MainLoop.runIter(e),l()&&MainLoop.scheduler()}}},a||(t&&t>0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),MainLoop.scheduler()),r)throw"unwind"},MainLoop={running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],preMainLoop:[],postMainLoop:[],pause(){MainLoop.scheduler=null,MainLoop.currentlyRunningMainloop++},resume(){MainLoop.currentlyRunningMainloop++;var e=MainLoop.timingMode,t=MainLoop.timingValue,r=MainLoop.func;MainLoop.func=null,setMainLoop(r,0,!1,MainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),MainLoop.scheduler()},updateStatus(){var e,t;if(Module.setStatus){var r=Module.statusMessage||"Please wait...",n=(e=MainLoop.remainingBlockers)!=null?e:0,a=(t=MainLoop.expectedBlockers)!=null?t:0;n?n=MainLoop.nextRAF;)MainLoop.nextRAF+=1e3/60;var r=Math.max(MainLoop.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(e);return}var t=MainLoop.fakeRequestAnimationFrame;t(e)}},AL={QUEUE_INTERVAL:25,QUEUE_LOOKAHEAD:.1,DEVICE_NAME:"Emscripten OpenAL",CAPTURE_DEVICE_NAME:"Emscripten OpenAL capture",ALC_EXTENSIONS:{ALC_SOFT_pause_device:!0,ALC_SOFT_HRTF:!0},AL_EXTENSIONS:{AL_EXT_float32:!0,AL_SOFT_loop_points:!0,AL_SOFT_source_length:!0,AL_EXT_source_distance_model:!0,AL_SOFT_source_spatialize:!0},_alcErr:0,alcErr:0,deviceRefCounts:{},alcStringCache:{},paused:!1,stringCache:{},contexts:{},currentCtx:null,buffers:{0:{id:0,refCount:0,audioBuf:null,frequency:0,bytesPerSample:2,channels:1,length:0}},paramArray:[],_nextId:1,newId:()=>AL.freeIds.length>0?AL.freeIds.pop():AL._nextId++,freeIds:[],scheduleContextAudio:e=>{if(!(MainLoop.timingMode===1&&document.visibilityState!="visible"))for(var t in e.sources)AL.scheduleSourceAudio(e.sources[t])},scheduleSourceAudio:(e,t)=>{if(!(MainLoop.timingMode===1&&document.visibilityState!="visible")&&e.state===4114){for(var r=AL.updateSourceTime(e),n=e.bufStartTime,a=e.bufOffset,o=e.bufsProcessed,l=0;l=e.bufQueue.length)if(e.looping)o%=e.bufQueue.length;else break;var p=e.bufQueue[o%e.bufQueue.length];if(p.length===0){if(d++,d===e.bufQueue.length)break}else{var u=e.context.audioCtx.createBufferSource();u.buffer=p.audioBuf,u.playbackRate.value=e.playbackRate,(p.audioBuf._loopStart||p.audioBuf._loopEnd)&&(u.loopStart=p.audioBuf._loopStart,u.loopEnd=p.audioBuf._loopEnd);var f=0;e.type===4136&&e.looping?(f=Number.POSITIVE_INFINITY,u.loop=!0,p.audioBuf._loopStart&&(u.loopStart=p.audioBuf._loopStart),p.audioBuf._loopEnd&&(u.loopEnd=p.audioBuf._loopEnd)):f=(p.audioBuf.duration-a)/e.playbackRate,u._startOffset=a,u._duration=f,u._skipCount=d,d=0,u.connect(e.gain),typeof u.start<"u"?(n=Math.max(n,e.context.audioCtx.currentTime),u.start(n,a)):typeof u.noteOn<"u"&&(n=Math.max(n,e.context.audioCtx.currentTime),u.noteOn(n)),u._startTime=n,e.audioQueue.push(u),n+=f}a=0,o++}}},updateSourceTime:e=>{var t=e.context.audioCtx.currentTime;if(e.state!==4114)return t;isFinite(e.bufStartTime)||(e.bufStartTime=t-e.bufOffset/e.playbackRate,e.bufOffset=0);for(var r=0;e.audioQueue.length;){var n=e.audioQueue[0];if(e.bufsProcessed+=n._skipCount,r=n._startTime+n._duration,t=e.bufQueue.length&&!e.looping)AL.setSourceState(e,4116);else if(e.type===4136&&e.looping){var a=e.bufQueue[0];if(a.length===0)e.bufOffset=0;else{var o=(t-e.bufStartTime)*e.playbackRate,l=a.audioBuf._loopStart||0,u=a.audioBuf._loopEnd||a.audioBuf.duration;u<=l&&(u=a.audioBuf.duration),o0&&(e.bufStartTime+=Math.floor((t-e.bufStartTime)/_)*_)}for(var d=0;d=e.bufQueue.length)if(e.looping)e.bufsProcessed%=e.bufQueue.length;else{AL.setSourceState(e,4116);break}var a=e.bufQueue[e.bufsProcessed];if(a.length>0){if(r=e.bufStartTime+a.audioBuf.duration/e.playbackRate,t{AL.updateSourceTime(e);for(var t=1;t1&&(e.audioQueue.length=1)},stopSourceAudio:e=>{for(var t=0;t{t===4114?((e.state===4114||e.state==4116)&&(e.bufsProcessed=0,e.bufOffset=0),AL.stopSourceAudio(e),e.state=4114,e.bufStartTime=Number.NEGATIVE_INFINITY,AL.scheduleSourceAudio(e)):t===4115?e.state===4114&&(AL.updateSourceTime(e),AL.stopSourceAudio(e),e.state=4115):t===4116?e.state!==4113&&(e.state=4116,e.bufsProcessed=e.bufQueue.length,e.bufStartTime=Number.NEGATIVE_INFINITY,e.bufOffset=0,AL.stopSourceAudio(e)):t===4113&&e.state!==4113&&(e.state=4113,e.bufsProcessed=0,e.bufStartTime=Number.NEGATIVE_INFINITY,e.bufOffset=0,AL.stopSourceAudio(e))},initSourcePanner:e=>{if(e.type!==4144){for(var t=AL.buffers[0],r=0;r{for(var t in e.sources)AL.updateSourceGlobal(e.sources[t])},updateSourceGlobal:e=>{var t=e.panner;if(t){t.refDistance=e.refDistance,t.maxDistance=e.maxDistance,t.rolloffFactor=e.rolloffFactor,t.panningModel=e.context.hrtf?"HRTF":"equalpower";var r=e.context.sourceDistanceModel?e.distanceModel:e.context.distanceModel;switch(r){case 0:t.distanceModel="inverse",t.refDistance=340282e33;break;case 53249:case 53250:t.distanceModel="inverse";break;case 53251:case 53252:t.distanceModel="linear";break;case 53253:case 53254:t.distanceModel="exponential";break}}},updateListenerSpace:e=>{var t=e.audioCtx.listener;t.positionX?(t.positionX.value=e.listener.position[0],t.positionY.value=e.listener.position[1],t.positionZ.value=e.listener.position[2]):t.setPosition(e.listener.position[0],e.listener.position[1],e.listener.position[2]),t.forwardX?(t.forwardX.value=e.listener.direction[0],t.forwardY.value=e.listener.direction[1],t.forwardZ.value=e.listener.direction[2],t.upX.value=e.listener.up[0],t.upY.value=e.listener.up[1],t.upZ.value=e.listener.up[2]):t.setOrientation(e.listener.direction[0],e.listener.direction[1],e.listener.direction[2],e.listener.up[0],e.listener.up[1],e.listener.up[2]);for(var r in e.sources)AL.updateSourceSpace(e.sources[r])},updateSourceSpace:e=>{if(e.panner){var t=e.panner,r=e.position[0],n=e.position[1],a=e.position[2],o=e.direction[0],l=e.direction[1],u=e.direction[2],_=e.context.listener,d=_.position[0],p=_.position[1],f=_.position[2];if(e.relative){var m=-_.direction[0],h=-_.direction[1],g=-_.direction[2],b=_.up[0],v=_.up[1],S=_.up[2],L=(To,xo,Wn)=>{var Ud=Math.sqrt(To*To+xo*xo+Wn*Wn);return Ud{if(e.state===4114){AL.cancelPendingSourceAudio(e);var t=e.audioQueue[0];if(!t)return;var r;e.type===4136&&e.looping?r=Number.POSITIVE_INFINITY:r=(t.buffer.duration-t._startOffset)/e.playbackRate,t._duration=r,t.playbackRate.value=e.playbackRate,AL.scheduleSourceAudio(e)}},sourceDuration:e=>{for(var t=0,r=0;r{AL.updateSourceTime(e);for(var t=0,r=0;r{var r=e.state==4114;if(r&&AL.setSourceState(e,4113),e.bufQueue[e.bufsProcessed].audioBuf!==null){for(e.bufsProcessed=0;t>e.bufQueue[e.bufsProcessed].audioBuf.duration;)t-=e.bufQueue[e.bufsProcessed].audioBuf.duration,e.bufsProcessed++;e.bufOffset=t}r&&AL.setSourceState(e,4114)},getGlobalParam:(e,t)=>{if(!AL.currentCtx)return null;switch(t){case 49152:return AL.currentCtx.dopplerFactor;case 49155:return AL.currentCtx.speedOfSound;case 53248:return AL.currentCtx.distanceModel;default:return AL.currentCtx.err=40962,null}},setGlobalParam:(e,t,r)=>{if(AL.currentCtx)switch(t){case 49152:if(!Number.isFinite(r)||r<0){AL.currentCtx.err=40963;return}AL.currentCtx.dopplerFactor=r,AL.updateListenerSpace(AL.currentCtx);break;case 49155:if(!Number.isFinite(r)||r<=0){AL.currentCtx.err=40963;return}AL.currentCtx.speedOfSound=r,AL.updateListenerSpace(AL.currentCtx);break;case 53248:switch(r){case 0:case 53249:case 53250:case 53251:case 53252:case 53253:case 53254:AL.currentCtx.distanceModel=r,AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40963;return}break;default:AL.currentCtx.err=40962;return}},getListenerParam:(e,t)=>{if(!AL.currentCtx)return null;switch(t){case 4100:return AL.currentCtx.listener.position;case 4102:return AL.currentCtx.listener.velocity;case 4111:return AL.currentCtx.listener.direction.concat(AL.currentCtx.listener.up);case 4106:return AL.currentCtx.gain.gain.value;default:return AL.currentCtx.err=40962,null}},setListenerParam:(e,t,r)=>{if(AL.currentCtx){if(r===null){AL.currentCtx.err=40962;return}var n=AL.currentCtx.listener;switch(t){case 4100:if(!Number.isFinite(r[0])||!Number.isFinite(r[1])||!Number.isFinite(r[2])){AL.currentCtx.err=40963;return}n.position[0]=r[0],n.position[1]=r[1],n.position[2]=r[2],AL.updateListenerSpace(AL.currentCtx);break;case 4102:if(!Number.isFinite(r[0])||!Number.isFinite(r[1])||!Number.isFinite(r[2])){AL.currentCtx.err=40963;return}n.velocity[0]=r[0],n.velocity[1]=r[1],n.velocity[2]=r[2],AL.updateListenerSpace(AL.currentCtx);break;case 4106:if(!Number.isFinite(r)||r<0){AL.currentCtx.err=40963;return}AL.currentCtx.gain.gain.value=r;break;case 4111:if(!Number.isFinite(r[0])||!Number.isFinite(r[1])||!Number.isFinite(r[2])||!Number.isFinite(r[3])||!Number.isFinite(r[4])||!Number.isFinite(r[5])){AL.currentCtx.err=40963;return}n.direction[0]=r[0],n.direction[1]=r[1],n.direction[2]=r[2],n.up[0]=r[3],n.up[1]=r[4],n.up[2]=r[5],AL.updateListenerSpace(AL.currentCtx);break;default:AL.currentCtx.err=40962;return}}},getBufferParam:(e,t,r)=>{if(AL.currentCtx){var n=AL.buffers[t];if(!n||t===0){AL.currentCtx.err=40961;return}switch(r){case 8193:return n.frequency;case 8194:return n.bytesPerSample*8;case 8195:return n.channels;case 8196:return n.length*n.bytesPerSample*n.channels;case 8213:return n.length===0?[0,0]:[(n.audioBuf._loopStart||0)*n.frequency,(n.audioBuf._loopEnd||n.length)*n.frequency];default:return AL.currentCtx.err=40962,null}}},setBufferParam:(e,t,r,n)=>{if(AL.currentCtx){var a=AL.buffers[t];if(!a||t===0){AL.currentCtx.err=40961;return}if(n===null){AL.currentCtx.err=40962;return}switch(r){case 8196:if(n!==0){AL.currentCtx.err=40963;return}break;case 8213:if(n[0]<0||n[0]>a.length||n[1]<0||n[1]>a.Length||n[0]>=n[1]){AL.currentCtx.err=40963;return}if(a.refCount>0){AL.currentCtx.err=40964;return}a.audioBuf&&(a.audioBuf._loopStart=n[0]/a.frequency,a.audioBuf._loopEnd=n[1]/a.frequency);break;default:AL.currentCtx.err=40962;return}}},getSourceParam:(e,t,r)=>{if(!AL.currentCtx)return null;var n=AL.currentCtx.sources[t];if(!n)return AL.currentCtx.err=40961,null;switch(r){case 514:return n.relative;case 4097:return n.coneInnerAngle;case 4098:return n.coneOuterAngle;case 4099:return n.pitch;case 4100:return n.position;case 4101:return n.direction;case 4102:return n.velocity;case 4103:return n.looping;case 4105:return n.type===4136?n.bufQueue[0].id:0;case 4106:return n.gain.gain.value;case 4109:return n.minGain;case 4110:return n.maxGain;case 4112:return n.state;case 4117:return n.bufQueue.length===1&&n.bufQueue[0].id===0?0:n.bufQueue.length;case 4118:return n.bufQueue.length===1&&n.bufQueue[0].id===0||n.looping?0:n.bufsProcessed;case 4128:return n.refDistance;case 4129:return n.rolloffFactor;case 4130:return n.coneOuterGain;case 4131:return n.maxDistance;case 4132:return AL.sourceTell(n);case 4133:var a=AL.sourceTell(n);return a>0&&(a*=n.bufQueue[0].frequency),a;case 4134:var a=AL.sourceTell(n);return a>0&&(a*=n.bufQueue[0].frequency*n.bufQueue[0].bytesPerSample),a;case 4135:return n.type;case 4628:return n.spatialize;case 8201:for(var o=0,l=0,u=0;u{if(AL.currentCtx){var a=AL.currentCtx.sources[t];if(!a){AL.currentCtx.err=40961;return}if(n===null){AL.currentCtx.err=40962;return}switch(r){case 514:if(n===1)a.relative=!0,AL.updateSourceSpace(a);else if(n===0)a.relative=!1,AL.updateSourceSpace(a);else{AL.currentCtx.err=40963;return}break;case 4097:if(!Number.isFinite(n)){AL.currentCtx.err=40963;return}a.coneInnerAngle=n,a.panner&&(a.panner.coneInnerAngle=n%360);break;case 4098:if(!Number.isFinite(n)){AL.currentCtx.err=40963;return}a.coneOuterAngle=n,a.panner&&(a.panner.coneOuterAngle=n%360);break;case 4099:if(!Number.isFinite(n)||n<=0){AL.currentCtx.err=40963;return}if(a.pitch===n)break;a.pitch=n,AL.updateSourceRate(a);break;case 4100:if(!Number.isFinite(n[0])||!Number.isFinite(n[1])||!Number.isFinite(n[2])){AL.currentCtx.err=40963;return}a.position[0]=n[0],a.position[1]=n[1],a.position[2]=n[2],AL.updateSourceSpace(a);break;case 4101:if(!Number.isFinite(n[0])||!Number.isFinite(n[1])||!Number.isFinite(n[2])){AL.currentCtx.err=40963;return}a.direction[0]=n[0],a.direction[1]=n[1],a.direction[2]=n[2],AL.updateSourceSpace(a);break;case 4102:if(!Number.isFinite(n[0])||!Number.isFinite(n[1])||!Number.isFinite(n[2])){AL.currentCtx.err=40963;return}a.velocity[0]=n[0],a.velocity[1]=n[1],a.velocity[2]=n[2],AL.updateSourceSpace(a);break;case 4103:if(n===1){if(a.looping=!0,AL.updateSourceTime(a),a.type===4136&&a.audioQueue.length>0){var o=a.audioQueue[0];o.loop=!0,o._duration=Number.POSITIVE_INFINITY}}else if(n===0){a.looping=!1;var l=AL.updateSourceTime(a);if(a.type===4136&&a.audioQueue.length>0){var o=a.audioQueue[0];o.loop=!1,o._duration=a.bufQueue[0].audioBuf.duration/a.playbackRate,o._startTime=l-a.bufOffset/a.playbackRate}}else{AL.currentCtx.err=40963;return}break;case 4105:if(a.state===4114||a.state===4115){AL.currentCtx.err=40964;return}if(n===0){for(var u in a.bufQueue)a.bufQueue[u].refCount--;a.bufQueue.length=1,a.bufQueue[0]=AL.buffers[0],a.bufsProcessed=0,a.type=4144}else{var _=AL.buffers[n];if(!_){AL.currentCtx.err=40963;return}for(var u in a.bufQueue)a.bufQueue[u].refCount--;a.bufQueue.length=0,_.refCount++,a.bufQueue=[_],a.bufsProcessed=0,a.type=4136}AL.initSourcePanner(a),AL.scheduleSourceAudio(a);break;case 4106:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.gain.gain.value=n;break;case 4109:if(!Number.isFinite(n)||n<0||n>Math.min(a.maxGain,1)){AL.currentCtx.err=40963;return}a.minGain=n;break;case 4110:if(!Number.isFinite(n)||n1){AL.currentCtx.err=40963;return}a.maxGain=n;break;case 4128:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.refDistance=n,a.panner&&(a.panner.refDistance=n);break;case 4129:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.rolloffFactor=n,a.panner&&(a.panner.rolloffFactor=n);break;case 4130:if(!Number.isFinite(n)||n<0||n>1){AL.currentCtx.err=40963;return}a.coneOuterGain=n,a.panner&&(a.panner.coneOuterGain=n);break;case 4131:if(!Number.isFinite(n)||n<0){AL.currentCtx.err=40963;return}a.maxDistance=n,a.panner&&(a.panner.maxDistance=n);break;case 4132:if(n<0||n>AL.sourceDuration(a)){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4133:var f=AL.sourceDuration(a);if(f>0){var d;for(var p in a.bufQueue)if(p){d=a.bufQueue[p].frequency;break}n/=d}if(n<0||n>f){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4134:var f=AL.sourceDuration(a);if(f>0){var m;for(var p in a.bufQueue)if(p){var _=a.bufQueue[p];m=_.frequency*_.bytesPerSample*_.channels;break}n/=m}if(n<0||n>f){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4628:if(n!==0&&n!==1&&n!==2){AL.currentCtx.err=40963;return}a.spatialize=n,AL.initSourcePanner(a);break;case 8201:case 8202:case 8203:AL.currentCtx.err=40964;break;case 53248:switch(n){case 0:case 53249:case 53250:case 53251:case 53252:case 53253:case 53254:a.distanceModel=n,AL.currentCtx.sourceDistanceModel&&AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40963;return}break;default:AL.currentCtx.err=40962;return}}},captures:{},sharedCaptureAudioCtx:null,requireValidCaptureDevice:(e,t)=>{if(e===0)return AL.alcErr=40961,null;var r=AL.captures[e];if(!r)return AL.alcErr=40961,null;var n=r.mediaStreamError;return n?(AL.alcErr=40961,null):r}},_alBuffer3f=(e,t,r,n,a)=>{AL.setBufferParam("alBuffer3f",e,t,null)};_alBuffer3f.sig="viifff";var _alBuffer3i=(e,t,r,n,a)=>{AL.setBufferParam("alBuffer3i",e,t,null)};_alBuffer3i.sig="viiiii";function _alBufferData(e,t,r,n,a){if(r>>>=0,!!AL.currentCtx){var o=AL.buffers[e];if(!o){AL.currentCtx.err=40963;return}if(a<=0){AL.currentCtx.err=40963;return}var l=null;try{switch(t){case 4352:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(1,n,a);for(var u=l.getChannelData(0),_=0;_>>0]*.0078125-1}o.bytesPerSample=1,o.channels=1,o.length=n;break;case 4353:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(1,n>>1,a);var u=l.getChannelData(0);r>>=1;for(var _=0;_>1;++_)u[_]=HEAP16[r++>>>0]*30517578125e-15}o.bytesPerSample=2,o.channels=1,o.length=n>>1;break;case 4354:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(2,n>>1,a);for(var u=l.getChannelData(0),d=l.getChannelData(1),_=0;_>1;++_)u[_]=HEAPU8[r++>>>0]*.0078125-1,d[_]=HEAPU8[r++>>>0]*.0078125-1}o.bytesPerSample=1,o.channels=2,o.length=n>>1;break;case 4355:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(2,n>>2,a);var u=l.getChannelData(0),d=l.getChannelData(1);r>>=1;for(var _=0;_>2;++_)u[_]=HEAP16[r++>>>0]*30517578125e-15,d[_]=HEAP16[r++>>>0]*30517578125e-15}o.bytesPerSample=2,o.channels=2,o.length=n>>2;break;case 65552:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(1,n>>2,a);var u=l.getChannelData(0);r>>=2;for(var _=0;_>2;++_)u[_]=HEAPF32[r++>>>0]}o.bytesPerSample=4,o.channels=1,o.length=n>>2;break;case 65553:if(n>0){l=AL.currentCtx.audioCtx.createBuffer(2,n>>3,a);var u=l.getChannelData(0),d=l.getChannelData(1);r>>=2;for(var _=0;_>3;++_)u[_]=HEAPF32[r++>>>0],d[_]=HEAPF32[r++>>>0]}o.bytesPerSample=4,o.channels=2,o.length=n>>3;break;default:AL.currentCtx.err=40963;return}o.frequency=a,o.audioBuf=l}catch{AL.currentCtx.err=40963;return}}}_alBufferData.sig="viipii";var _alBufferf=(e,t,r)=>{AL.setBufferParam("alBufferf",e,t,null)};_alBufferf.sig="viif";function _alBufferfv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}AL.setBufferParam("alBufferfv",e,t,null)}}_alBufferfv.sig="viip";var _alBufferi=(e,t,r)=>{AL.setBufferParam("alBufferi",e,t,null)};_alBufferi.sig="viii";function _alBufferiv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}switch(t){case 8213:AL.paramArray[0]=HEAP32[r>>>2>>>0],AL.paramArray[1]=HEAP32[r+4>>>2>>>0],AL.setBufferParam("alBufferiv",e,t,AL.paramArray);break;default:AL.setBufferParam("alBufferiv",e,t,null);break}}}_alBufferiv.sig="viip";function _alDeleteBuffers(e,t){if(t>>>=0,!!AL.currentCtx){for(var r=0;r>>2>>>0];if(n!==0){if(!AL.buffers[n]){AL.currentCtx.err=40961;return}if(AL.buffers[n].refCount){AL.currentCtx.err=40964;return}}}for(var r=0;r>>2>>>0];n!==0&&(AL.deviceRefCounts[AL.buffers[n].deviceId]--,delete AL.buffers[n],AL.freeIds.push(n))}}}_alDeleteBuffers.sig="vip";var _alSourcei=(e,t,r)=>{switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4628:case 8201:case 8202:case 53248:AL.setSourceParam("alSourcei",e,t,r);break;default:AL.setSourceParam("alSourcei",e,t,null);break}};_alSourcei.sig="viii";function _alDeleteSources(e,t){if(t>>>=0,!!AL.currentCtx){for(var r=0;r>>2>>>0];if(!AL.currentCtx.sources[n]){AL.currentCtx.err=40961;return}}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4116),_alSourcei(n,4105,0),delete AL.currentCtx.sources[n],AL.freeIds.push(n)}}}_alDeleteSources.sig="vip";var _alDisable=e=>{if(AL.currentCtx)switch(e){case 512:AL.currentCtx.sourceDistanceModel=!1,AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40962;return}};_alDisable.sig="vi";var _alDistanceModel=e=>{AL.setGlobalParam("alDistanceModel",53248,e)};_alDistanceModel.sig="vi";var _alDopplerFactor=e=>{AL.setGlobalParam("alDopplerFactor",49152,e)};_alDopplerFactor.sig="vf";var _alDopplerVelocity=e=>{if(warnOnce("alDopplerVelocity() is deprecated, and only kept for compatibility with OpenAL 1.0. Use alSpeedOfSound() instead."),!!AL.currentCtx&&e<=0){AL.currentCtx.err=40963;return}};_alDopplerVelocity.sig="vf";var _alEnable=e=>{if(AL.currentCtx)switch(e){case 512:AL.currentCtx.sourceDistanceModel=!0,AL.updateContextGlobal(AL.currentCtx);break;default:AL.currentCtx.err=40962;return}};_alEnable.sig="vi";function _alGenBuffers(e,t){if(t>>>=0,!!AL.currentCtx)for(var r=0;r>>2>>>0]=n.id}}_alGenBuffers.sig="vip";function _alGenSources(e,t){if(t>>>=0,!!AL.currentCtx)for(var r=0;r>>2>>>0]=a.id}}_alGenSources.sig="vip";var _alGetBoolean=e=>{var t=AL.getGlobalParam("alGetBoolean",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t!==0?1:0;default:return AL.currentCtx.err=40962,0}};_alGetBoolean.sig="ii";function _alGetBooleanv(e,t){t>>>=0;var r=AL.getGlobalParam("alGetBooleanv",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAP8[t>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetBooleanv.sig="vip";function _alGetBuffer3f(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var o=AL.getBufferParam("alGetBuffer3f",e,t);if(o!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBuffer3f.sig="viippp";function _alGetBuffer3i(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var o=AL.getBufferParam("alGetBuffer3i",e,t);if(o!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBuffer3i.sig="viippp";function _alGetBufferf(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferf",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBufferf.sig="viip";function _alGetBufferfv(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferfv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetBufferfv.sig="viip";function _alGetBufferi(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferi",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 8193:case 8194:case 8195:case 8196:HEAP32[r>>>2>>>0]=n;break;default:AL.currentCtx.err=40962;return}}}_alGetBufferi.sig="viip";function _alGetBufferiv(e,t,r){r>>>=0;var n=AL.getBufferParam("alGetBufferiv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 8193:case 8194:case 8195:case 8196:HEAP32[r>>>2>>>0]=n;break;case 8213:HEAP32[r>>>2>>>0]=n[0],HEAP32[r+4>>>2>>>0]=n[1];break;default:AL.currentCtx.err=40962;return}}}_alGetBufferiv.sig="viip";var _alGetDouble=e=>{var t=AL.getGlobalParam("alGetDouble",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t;default:return AL.currentCtx.err=40962,0}};_alGetDouble.sig="di";function _alGetDoublev(e,t){t>>>=0;var r=AL.getGlobalParam("alGetDoublev",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAPF64[t>>>3>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetDoublev.sig="vip";function _alGetEnumValue(e){if(e>>>=0,!AL.currentCtx)return 0;if(!e)return AL.currentCtx.err=40963,0;var t=UTF8ToString(e);switch(t){case"AL_BITS":return 8194;case"AL_BUFFER":return 4105;case"AL_BUFFERS_PROCESSED":return 4118;case"AL_BUFFERS_QUEUED":return 4117;case"AL_BYTE_OFFSET":return 4134;case"AL_CHANNELS":return 8195;case"AL_CONE_INNER_ANGLE":return 4097;case"AL_CONE_OUTER_ANGLE":return 4098;case"AL_CONE_OUTER_GAIN":return 4130;case"AL_DIRECTION":return 4101;case"AL_DISTANCE_MODEL":return 53248;case"AL_DOPPLER_FACTOR":return 49152;case"AL_DOPPLER_VELOCITY":return 49153;case"AL_EXPONENT_DISTANCE":return 53253;case"AL_EXPONENT_DISTANCE_CLAMPED":return 53254;case"AL_EXTENSIONS":return 45060;case"AL_FORMAT_MONO16":return 4353;case"AL_FORMAT_MONO8":return 4352;case"AL_FORMAT_STEREO16":return 4355;case"AL_FORMAT_STEREO8":return 4354;case"AL_FREQUENCY":return 8193;case"AL_GAIN":return 4106;case"AL_INITIAL":return 4113;case"AL_INVALID":return-1;case"AL_ILLEGAL_ENUM":case"AL_INVALID_ENUM":return 40962;case"AL_INVALID_NAME":return 40961;case"AL_ILLEGAL_COMMAND":case"AL_INVALID_OPERATION":return 40964;case"AL_INVALID_VALUE":return 40963;case"AL_INVERSE_DISTANCE":return 53249;case"AL_INVERSE_DISTANCE_CLAMPED":return 53250;case"AL_LINEAR_DISTANCE":return 53251;case"AL_LINEAR_DISTANCE_CLAMPED":return 53252;case"AL_LOOPING":return 4103;case"AL_MAX_DISTANCE":return 4131;case"AL_MAX_GAIN":return 4110;case"AL_MIN_GAIN":return 4109;case"AL_NONE":return 0;case"AL_NO_ERROR":return 0;case"AL_ORIENTATION":return 4111;case"AL_OUT_OF_MEMORY":return 40965;case"AL_PAUSED":return 4115;case"AL_PENDING":return 8209;case"AL_PITCH":return 4099;case"AL_PLAYING":return 4114;case"AL_POSITION":return 4100;case"AL_PROCESSED":return 8210;case"AL_REFERENCE_DISTANCE":return 4128;case"AL_RENDERER":return 45059;case"AL_ROLLOFF_FACTOR":return 4129;case"AL_SAMPLE_OFFSET":return 4133;case"AL_SEC_OFFSET":return 4132;case"AL_SIZE":return 8196;case"AL_SOURCE_RELATIVE":return 514;case"AL_SOURCE_STATE":return 4112;case"AL_SOURCE_TYPE":return 4135;case"AL_SPEED_OF_SOUND":return 49155;case"AL_STATIC":return 4136;case"AL_STOPPED":return 4116;case"AL_STREAMING":return 4137;case"AL_UNDETERMINED":return 4144;case"AL_UNUSED":return 8208;case"AL_VELOCITY":return 4102;case"AL_VENDOR":return 45057;case"AL_VERSION":return 45058;case"AL_AUTO_SOFT":return 2;case"AL_SOURCE_DISTANCE_MODEL":return 512;case"AL_SOURCE_SPATIALIZE_SOFT":return 4628;case"AL_LOOP_POINTS_SOFT":return 8213;case"AL_BYTE_LENGTH_SOFT":return 8201;case"AL_SAMPLE_LENGTH_SOFT":return 8202;case"AL_SEC_LENGTH_SOFT":return 8203;case"AL_FORMAT_MONO_FLOAT32":return 65552;case"AL_FORMAT_STEREO_FLOAT32":return 65553;default:return AL.currentCtx.err=40963,0}}_alGetEnumValue.sig="ip";var _alGetError=()=>{if(!AL.currentCtx)return 40964;var e=AL.currentCtx.err;return AL.currentCtx.err=0,e};_alGetError.sig="i";var _alGetFloat=e=>{var t=AL.getGlobalParam("alGetFloat",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t;default:return 0}};_alGetFloat.sig="fi";function _alGetFloatv(e,t){t>>>=0;var r=AL.getGlobalParam("alGetFloatv",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAPF32[t>>>2>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetFloatv.sig="vip";var _alGetInteger=e=>{var t=AL.getGlobalParam("alGetInteger",e);if(t===null)return 0;switch(e){case 49152:case 49155:case 53248:return t;default:return AL.currentCtx.err=40962,0}};_alGetInteger.sig="ii";function _alGetIntegerv(e,t){t>>>=0;var r=AL.getGlobalParam("alGetIntegerv",e);if(!(r===null||!t))switch(e){case 49152:case 49155:case 53248:HEAP32[t>>>2>>>0]=r;break;default:AL.currentCtx.err=40962;return}}_alGetIntegerv.sig="vip";function _alGetListener3f(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;var a=AL.getListenerParam("alGetListener3f",e);if(a!==null){if(!t||!r||!n){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAPF32[t>>>2>>>0]=a[0],HEAPF32[r>>>2>>>0]=a[1],HEAPF32[n>>>2>>>0]=a[2];break;default:AL.currentCtx.err=40962;return}}}_alGetListener3f.sig="vippp";function _alGetListener3i(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;var a=AL.getListenerParam("alGetListener3i",e);if(a!==null){if(!t||!r||!n){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAP32[t>>>2>>>0]=a[0],HEAP32[r>>>2>>>0]=a[1],HEAP32[n>>>2>>>0]=a[2];break;default:AL.currentCtx.err=40962;return}}}_alGetListener3i.sig="vippp";function _alGetListenerf(e,t){t>>>=0;var r=AL.getListenerParam("alGetListenerf",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4106:HEAPF32[t>>>2>>>0]=r;break;default:AL.currentCtx.err=40962;return}}}_alGetListenerf.sig="vip";function _alGetListenerfv(e,t){t>>>=0;var r=AL.getListenerParam("alGetListenerfv",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAPF32[t>>>2>>>0]=r[0],HEAPF32[t+4>>>2>>>0]=r[1],HEAPF32[t+8>>>2>>>0]=r[2];break;case 4111:HEAPF32[t>>>2>>>0]=r[0],HEAPF32[t+4>>>2>>>0]=r[1],HEAPF32[t+8>>>2>>>0]=r[2],HEAPF32[t+12>>>2>>>0]=r[3],HEAPF32[t+16>>>2>>>0]=r[4],HEAPF32[t+20>>>2>>>0]=r[5];break;default:AL.currentCtx.err=40962;return}}}_alGetListenerfv.sig="vip";function _alGetListeneri(e,t){t>>>=0;var r=AL.getListenerParam("alGetListeneri",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}AL.currentCtx.err=40962}}_alGetListeneri.sig="vip";function _alGetListeneriv(e,t){t>>>=0;var r=AL.getListenerParam("alGetListeneriv",e);if(r!==null){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:HEAP32[t>>>2>>>0]=r[0],HEAP32[t+4>>>2>>>0]=r[1],HEAP32[t+8>>>2>>>0]=r[2];break;case 4111:HEAP32[t>>>2>>>0]=r[0],HEAP32[t+4>>>2>>>0]=r[1],HEAP32[t+8>>>2>>>0]=r[2],HEAP32[t+12>>>2>>>0]=r[3],HEAP32[t+16>>>2>>>0]=r[4],HEAP32[t+20>>>2>>>0]=r[5];break;default:AL.currentCtx.err=40962;return}}}_alGetListeneriv.sig="vip";function _alGetSource3f(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var o=AL.getSourceParam("alGetSource3f",e,t);if(o!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}switch(t){case 4100:case 4101:case 4102:HEAPF32[r>>>2>>>0]=o[0],HEAPF32[n>>>2>>>0]=o[1],HEAPF32[a>>>2>>>0]=o[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSource3f.sig="viippp";function _alGetSource3i(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0;var o=AL.getSourceParam("alGetSource3i",e,t);if(o!==null){if(!r||!n||!a){AL.currentCtx.err=40963;return}switch(t){case 4100:case 4101:case 4102:HEAP32[r>>>2>>>0]=o[0],HEAP32[n>>>2>>>0]=o[1],HEAP32[a>>>2>>>0]=o[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSource3i.sig="viippp";function _alGetSourcef(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourcef",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:HEAPF32[r>>>2>>>0]=n;break;default:AL.currentCtx.err=40962;return}}}_alGetSourcef.sig="viip";function _alGetSourcefv(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourcefv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:HEAPF32[r>>>2>>>0]=n[0];break;case 4100:case 4101:case 4102:HEAPF32[r>>>2>>>0]=n[0],HEAPF32[r+4>>>2>>>0]=n[1],HEAPF32[r+8>>>2>>>0]=n[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSourcefv.sig="viip";function _alGetSourcei(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourcei",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4112:case 4117:case 4118:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4135:case 4628:case 8201:case 8202:case 53248:HEAP32[r>>>2>>>0]=n;break;default:AL.currentCtx.err=40962;return}}}_alGetSourcei.sig="viip";function _alGetSourceiv(e,t,r){r>>>=0;var n=AL.getSourceParam("alGetSourceiv",e,t);if(n!==null){if(!r){AL.currentCtx.err=40963;return}switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4112:case 4117:case 4118:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4135:case 4628:case 8201:case 8202:case 53248:HEAP32[r>>>2>>>0]=n;break;case 4100:case 4101:case 4102:HEAP32[r>>>2>>>0]=n[0],HEAP32[r+4>>>2>>>0]=n[1],HEAP32[r+8>>>2>>>0]=n[2];break;default:AL.currentCtx.err=40962;return}}}_alGetSourceiv.sig="viip";var stringToNewUTF8=e=>{var t=lengthBytesUTF8(e)+1,r=_malloc(t);return r&&stringToUTF8(e,r,t),r};function _alGetString(e){if(AL.stringCache[e])return AL.stringCache[e];var t;switch(e){case 0:t="No Error";break;case 40961:t="Invalid Name";break;case 40962:t="Invalid Enum";break;case 40963:t="Invalid Value";break;case 40964:t="Invalid Operation";break;case 40965:t="Out of Memory";break;case 45057:t="Emscripten";break;case 45058:t="1.1";break;case 45059:t="WebAudio";break;case 45060:t=Object.keys(AL.AL_EXTENSIONS).join(" ");break;default:return AL.currentCtx&&(AL.currentCtx.err=40962),0}return t=stringToNewUTF8(t),AL.stringCache[e]=t,t}_alGetString.sig="pi";var _alIsBuffer=e=>!(!AL.currentCtx||e>AL.buffers.length||!AL.buffers[e]);_alIsBuffer.sig="ii";var _alIsEnabled=e=>{if(!AL.currentCtx)return 0;switch(e){case 512:return AL.currentCtx.sourceDistanceModel?0:1;default:return AL.currentCtx.err=40962,0}};_alIsEnabled.sig="ii";function _alIsExtensionPresent(e){e>>>=0;var t=UTF8ToString(e);return AL.AL_EXTENSIONS[t]?1:0}_alIsExtensionPresent.sig="ip";var _alIsSource=e=>!(!AL.currentCtx||!AL.currentCtx.sources[e]);_alIsSource.sig="ii";var _alListener3f=(e,t,r,n)=>{switch(e){case 4100:case 4102:AL.paramArray[0]=t,AL.paramArray[1]=r,AL.paramArray[2]=n,AL.setListenerParam("alListener3f",e,AL.paramArray);break;default:AL.setListenerParam("alListener3f",e,null);break}};_alListener3f.sig="vifff";var _alListener3i=(e,t,r,n)=>{switch(e){case 4100:case 4102:AL.paramArray[0]=t,AL.paramArray[1]=r,AL.paramArray[2]=n,AL.setListenerParam("alListener3i",e,AL.paramArray);break;default:AL.setListenerParam("alListener3i",e,null);break}};_alListener3i.sig="viiii";var _alListenerf=(e,t)=>{switch(e){case 4106:AL.setListenerParam("alListenerf",e,t);break;default:AL.setListenerParam("alListenerf",e,null);break}};_alListenerf.sig="vif";function _alListenerfv(e,t){if(t>>>=0,!!AL.currentCtx){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:AL.paramArray[0]=HEAPF32[t>>>2>>>0],AL.paramArray[1]=HEAPF32[t+4>>>2>>>0],AL.paramArray[2]=HEAPF32[t+8>>>2>>>0],AL.setListenerParam("alListenerfv",e,AL.paramArray);break;case 4111:AL.paramArray[0]=HEAPF32[t>>>2>>>0],AL.paramArray[1]=HEAPF32[t+4>>>2>>>0],AL.paramArray[2]=HEAPF32[t+8>>>2>>>0],AL.paramArray[3]=HEAPF32[t+12>>>2>>>0],AL.paramArray[4]=HEAPF32[t+16>>>2>>>0],AL.paramArray[5]=HEAPF32[t+20>>>2>>>0],AL.setListenerParam("alListenerfv",e,AL.paramArray);break;default:AL.setListenerParam("alListenerfv",e,null);break}}}_alListenerfv.sig="vip";var _alListeneri=(e,t)=>{AL.setListenerParam("alListeneri",e,null)};_alListeneri.sig="vii";function _alListeneriv(e,t){if(t>>>=0,!!AL.currentCtx){if(!t){AL.currentCtx.err=40963;return}switch(e){case 4100:case 4102:AL.paramArray[0]=HEAP32[t>>>2>>>0],AL.paramArray[1]=HEAP32[t+4>>>2>>>0],AL.paramArray[2]=HEAP32[t+8>>>2>>>0],AL.setListenerParam("alListeneriv",e,AL.paramArray);break;case 4111:AL.paramArray[0]=HEAP32[t>>>2>>>0],AL.paramArray[1]=HEAP32[t+4>>>2>>>0],AL.paramArray[2]=HEAP32[t+8>>>2>>>0],AL.paramArray[3]=HEAP32[t+12>>>2>>>0],AL.paramArray[4]=HEAP32[t+16>>>2>>>0],AL.paramArray[5]=HEAP32[t+20>>>2>>>0],AL.setListenerParam("alListeneriv",e,AL.paramArray);break;default:AL.setListenerParam("alListeneriv",e,null);break}}}_alListeneriv.sig="vip";var _alSource3f=(e,t,r,n,a)=>{switch(t){case 4100:case 4101:case 4102:AL.paramArray[0]=r,AL.paramArray[1]=n,AL.paramArray[2]=a,AL.setSourceParam("alSource3f",e,t,AL.paramArray);break;default:AL.setSourceParam("alSource3f",e,t,null);break}};_alSource3f.sig="viifff";var _alSource3i=(e,t,r,n,a)=>{switch(t){case 4100:case 4101:case 4102:AL.paramArray[0]=r,AL.paramArray[1]=n,AL.paramArray[2]=a,AL.setSourceParam("alSource3i",e,t,AL.paramArray);break;default:AL.setSourceParam("alSource3i",e,t,null);break}};_alSource3i.sig="viiiii";var _alSourcePause=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4115)}};_alSourcePause.sig="vi";function _alSourcePausev(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4115)}}}_alSourcePausev.sig="vip";var _alSourcePlay=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4114)}};_alSourcePlay.sig="vi";function _alSourcePlayv(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4114)}}}_alSourcePlayv.sig="vip";function _alSourceQueueBuffers(e,t,r){if(r>>>=0,!!AL.currentCtx){var n=AL.currentCtx.sources[e];if(!n){AL.currentCtx.err=40961;return}if(n.type===4136){AL.currentCtx.err=40964;return}if(t!==0){for(var a=AL.buffers[0],o=0;o>>2>>>0],u=AL.buffers[l];if(!u){AL.currentCtx.err=40961;return}a.id!==0&&(u.frequency!==a.frequency||u.bytesPerSample!==a.bytesPerSample||u.channels!==a.channels)&&(AL.currentCtx.err=40964)}n.bufQueue.length===1&&n.bufQueue[0].id===0&&(n.bufQueue.length=0),n.type=4137;for(var o=0;o>>2>>>0],u=AL.buffers[l];u.refCount++,n.bufQueue.push(u)}n.looping&&AL.cancelPendingSourceAudio(n),AL.initSourcePanner(n),AL.scheduleSourceAudio(n)}}}_alSourceQueueBuffers.sig="viip";var _alSourceRewind=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4116),AL.setSourceState(t,4113)}};_alSourceRewind.sig="vi";function _alSourceRewindv(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4113)}}}_alSourceRewindv.sig="vip";var _alSourceStop=e=>{if(AL.currentCtx){var t=AL.currentCtx.sources[e];if(!t){AL.currentCtx.err=40961;return}AL.setSourceState(t,4116)}};_alSourceStop.sig="vi";function _alSourceStopv(e,t){if(t>>>=0,!!AL.currentCtx){t||(AL.currentCtx.err=40963);for(var r=0;r>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r>>2>>>0];AL.setSourceState(AL.currentCtx.sources[n],4116)}}}_alSourceStopv.sig="vip";function _alSourceUnqueueBuffers(e,t,r){if(r>>>=0,!!AL.currentCtx){var n=AL.currentCtx.sources[e];if(!n){AL.currentCtx.err=40961;return}if(t>(n.bufQueue.length===1&&n.bufQueue[0].id===0?0:n.bufsProcessed)){AL.currentCtx.err=40963;return}if(t!==0){for(var a=0;a>>2>>>0]=o.id,n.bufsProcessed--}n.bufQueue.length===0&&n.bufQueue.push(AL.buffers[0]),AL.initSourcePanner(n),AL.scheduleSourceAudio(n)}}}_alSourceUnqueueBuffers.sig="viip";var _alSourcef=(e,t,r)=>{switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:AL.setSourceParam("alSourcef",e,t,r);break;default:AL.setSourceParam("alSourcef",e,t,null);break}};_alSourcef.sig="viif";function _alSourcefv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}switch(t){case 4097:case 4098:case 4099:case 4106:case 4109:case 4110:case 4128:case 4129:case 4130:case 4131:case 4132:case 4133:case 4134:case 8203:var n=HEAPF32[r>>>2>>>0];AL.setSourceParam("alSourcefv",e,t,n);break;case 4100:case 4101:case 4102:AL.paramArray[0]=HEAPF32[r>>>2>>>0],AL.paramArray[1]=HEAPF32[r+4>>>2>>>0],AL.paramArray[2]=HEAPF32[r+8>>>2>>>0],AL.setSourceParam("alSourcefv",e,t,AL.paramArray);break;default:AL.setSourceParam("alSourcefv",e,t,null);break}}}_alSourcefv.sig="viip";function _alSourceiv(e,t,r){if(r>>>=0,!!AL.currentCtx){if(!r){AL.currentCtx.err=40963;return}switch(t){case 514:case 4097:case 4098:case 4103:case 4105:case 4128:case 4129:case 4131:case 4132:case 4133:case 4134:case 4628:case 8201:case 8202:case 53248:var n=HEAP32[r>>>2>>>0];AL.setSourceParam("alSourceiv",e,t,n);break;case 4100:case 4101:case 4102:AL.paramArray[0]=HEAP32[r>>>2>>>0],AL.paramArray[1]=HEAP32[r+4>>>2>>>0],AL.paramArray[2]=HEAP32[r+8>>>2>>>0],AL.setSourceParam("alSourceiv",e,t,AL.paramArray);break;default:AL.setSourceParam("alSourceiv",e,t,null);break}}}_alSourceiv.sig="viip";var _alSpeedOfSound=e=>{AL.setGlobalParam("alSpeedOfSound",49155,e)};_alSpeedOfSound.sig="vf";var _alcCaptureCloseDevice=function(e){var t,r,n,a;e>>>=0;var o=AL.requireValidCaptureDevice(e,"alcCaptureCloseDevice");return o?(delete AL.captures[e],AL.freeIds.push(e),(t=o.mediaStreamSourceNode)==null||t.disconnect(),(r=o.mergerNode)==null||r.disconnect(),(n=o.splitterNode)==null||n.disconnect(),(a=o.scriptProcessorNode)==null||a.disconnect(),o.mediaStream&&o.mediaStream.getTracks().forEach(l=>l.stop()),delete o.buffers,o.capturedFrameCount=0,o.isCapturing=!1,!0):!1};_alcCaptureCloseDevice.sig="ip";var listenOnce=(e,t,r)=>{e.addEventListener(t,r,{once:!0})},autoResumeAudioContext=(e,t)=>{t||(t=[document,document.getElementById("canvas")]),["keydown","mousedown","touchstart"].forEach(r=>{t.forEach(n=>{n&&listenOnce(n,r,()=>{e.state==="suspended"&&e.resume()})})})};function _alcCaptureOpenDevice(e,t,r,n){var a;e>>>=0;var o=AL.CAPTURE_DEVICE_NAME;if(e!==0&&(o=UTF8ToString(e),o!==AL.CAPTURE_DEVICE_NAME))return AL.alcErr=40965,0;if(n<0)return AL.alcErr=40964,0;navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var l=navigator.getUserMedia||navigator.mediaDevices&&navigator.mediaDevices.getUserMedia;if(!l)return AL.alcErr=40965,0;var u=window.AudioContext||window.webkitAudioContext;if(!AL.sharedCaptureAudioCtx)try{AL.sharedCaptureAudioCtx=new u}catch{return AL.alcErr=40965,0}autoResumeAudioContext(AL.sharedCaptureAudioCtx);var _;switch(r){case 65552:case 4353:case 4352:_=1;break;case 65553:case 4355:case 4354:_=2;break;default:return AL.alcErr=40964,0}function d(A){return new Float32Array(A)}function p(A){return new Int16Array(A)}function f(A){return new Uint8Array(A)}var m,h;switch(r){case 65552:case 65553:m="f32",h=d;break;case 4353:case 4355:m="i16",h=p;break;case 4352:case 4354:m="u8",h=f;break}var g=[];try{for(var b=0;b<_;++b)g[b]=h(n)}catch{return AL.alcErr=40965,0}var v={audioCtx:AL.sharedCaptureAudioCtx,deviceName:o,requestedSampleRate:t,requestedSampleType:m,outputChannelCount:_,inputChannelCount:null,mediaStreamError:null,mediaStreamSourceNode:null,mediaStream:null,mergerNode:null,splitterNode:null,scriptProcessorNode:null,isCapturing:!1,buffers:g,get bufferFrameCapacity(){return g[0].length},capturePlayhead:0,captureReadhead:0,capturedFrameCount:0},S=A=>{v.mediaStreamError=A},L=A=>{v.mediaStreamSourceNode=v.audioCtx.createMediaStreamSource(A),v.mediaStream=A;var M=1;switch(v.mediaStreamSourceNode.channelCountMode){case"max":M=_;break;case"clamped-max":M=Math.min(_,v.mediaStreamSourceNode.channelCount);break;case"explicit":M=v.mediaStreamSourceNode.channelCount;break}v.inputChannelCount=M;var X=512;v.scriptProcessorNode=v.audioCtx.createScriptProcessor(X,M,_),M>_?(v.mergerNode=v.audioCtx.createChannelMerger(M),v.mediaStreamSourceNode.connect(v.mergerNode),v.mergerNode.connect(v.scriptProcessorNode)):M<_?(v.splitterNode=v.audioCtx.createChannelSplitter(_),v.mediaStreamSourceNode.connect(v.splitterNode),v.splitterNode.connect(v.scriptProcessorNode)):v.mediaStreamSourceNode.connect(v.scriptProcessorNode),v.scriptProcessorNode.connect(v.audioCtx.destination),v.scriptProcessorNode.onaudioprocess=x=>{if(v.isCapturing){var w=v,E=x.inputBuffer;switch(r){case 65552:for(var P=E.getChannelData(0),k=0;k>>=0,t>>>=0;var n=AL.requireValidCaptureDevice(e,"alcCaptureSamples");if(!n)return;var a=n.requestedSampleRate,o=n.audioCtx.sampleRate,l=o/a;if(r<0||r>n.capturedFrameCount/l){AL.alcErr=40964;return}function u(T,A){HEAPF32[t+4*T>>>2>>>0]=A}function _(T,A){HEAP16[t+2*T>>>1>>>0]=A}function d(T,A){HEAP8[t+T>>>0]=A}var p;switch(n.requestedSampleType){case"f32":p=u;break;case"i16":p=_;break;case"u8":p=d;break;default:return}if(Math.floor(l)==l)for(var f=0,m=0;m>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureStart");t&&(t.isCapturing||(t.isCapturing=!0,t.capturedFrameCount=0,t.capturePlayhead=0))}_alcCaptureStart.sig="vp";function _alcCaptureStop(e){e>>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureStop");t&&(t.isCapturing=!1)}_alcCaptureStop.sig="vp";function _alcCloseDevice(e){return e>>>=0,!(e in AL.deviceRefCounts)||AL.deviceRefCounts[e]>0?0:(delete AL.deviceRefCounts[e],AL.freeIds.push(e),1)}_alcCloseDevice.sig="ip";function _alcCreateContext(e,t){if(e>>>=0,t>>>=0,!(e in AL.deviceRefCounts))return AL.alcErr=40961,0;var r=null,n=[],a=null;if(t>>=2,t)for(var o=0,l=0;o=HEAP32[t++>>>0],n.push(o),o!==0;)switch(l=HEAP32[t++>>>0],n.push(l),o){case 4103:r||(r={}),r.sampleRate=l;break;case 4112:case 4113:break;case 6546:switch(l){case 0:a=!1;break;case 1:a=!0;break;case 2:break;default:return AL.alcErr=40964,0}break;case 6550:if(l!==0)return AL.alcErr=40964,0;break;default:return AL.alcErr=40964,0}var u=window.AudioContext||window.webkitAudioContext,_=null;try{r?_=new u(r):_=new u}catch(h){return h.name==="NotSupportedError"?AL.alcErr=40964:AL.alcErr=40961,0}autoResumeAudioContext(_),typeof _.createGain>"u"&&(_.createGain=_.createGainNode);var d=_.createGain();d.connect(_.destination);var p={deviceId:e,id:AL.newId(),attrs:n,audioCtx:_,listener:{position:[0,0,0],velocity:[0,0,0],direction:[0,0,0],up:[0,0,0]},sources:[],interval:setInterval(()=>AL.scheduleContextAudio(p),AL.QUEUE_INTERVAL),gain:d,distanceModel:53250,speedOfSound:343.3,dopplerFactor:1,sourceDistanceModel:!1,hrtf:a||!1,_err:0,get err(){return this._err},set err(h){(this._err===0||h===0)&&(this._err=h)}};if(AL.deviceRefCounts[e]++,AL.contexts[p.id]=p,a!==null)for(var f in AL.contexts){var m=AL.contexts[f];m.deviceId===e&&(m.hrtf=a,AL.updateContextGlobal(m))}return p.id}_alcCreateContext.sig="ppp";function _alcDestroyContext(e){e>>>=0;var t=AL.contexts[e];if(AL.currentCtx===t){AL.alcErr=40962;return}AL.contexts[e].interval&&clearInterval(AL.contexts[e].interval),AL.deviceRefCounts[t.deviceId]--,delete AL.contexts[e],AL.freeIds.push(e)}_alcDestroyContext.sig="vp";function _alcGetContextsDevice(e){return e>>>=0,e in AL.contexts?AL.contexts[e].deviceId:0}_alcGetContextsDevice.sig="pp";function _alcGetCurrentContext(){return AL.currentCtx!==null?AL.currentCtx.id:0}_alcGetCurrentContext.sig="p";function _alcGetEnumValue(e,t){if(e>>>=0,t>>>=0,e!==0&&!(e in AL.deviceRefCounts))return 0;if(!t)return AL.alcErr=40964,0;var r=UTF8ToString(t);switch(r){case"ALC_NO_ERROR":return 0;case"ALC_INVALID_DEVICE":return 40961;case"ALC_INVALID_CONTEXT":return 40962;case"ALC_INVALID_ENUM":return 40963;case"ALC_INVALID_VALUE":return 40964;case"ALC_OUT_OF_MEMORY":return 40965;case"ALC_MAJOR_VERSION":return 4096;case"ALC_MINOR_VERSION":return 4097;case"ALC_ATTRIBUTES_SIZE":return 4098;case"ALC_ALL_ATTRIBUTES":return 4099;case"ALC_DEFAULT_DEVICE_SPECIFIER":return 4100;case"ALC_DEVICE_SPECIFIER":return 4101;case"ALC_EXTENSIONS":return 4102;case"ALC_FREQUENCY":return 4103;case"ALC_REFRESH":return 4104;case"ALC_SYNC":return 4105;case"ALC_MONO_SOURCES":return 4112;case"ALC_STEREO_SOURCES":return 4113;case"ALC_CAPTURE_DEVICE_SPECIFIER":return 784;case"ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER":return 785;case"ALC_CAPTURE_SAMPLES":return 786;case"ALC_HRTF_SOFT":return 6546;case"ALC_HRTF_ID_SOFT":return 6550;case"ALC_DONT_CARE_SOFT":return 2;case"ALC_HRTF_STATUS_SOFT":return 6547;case"ALC_NUM_HRTF_SPECIFIERS_SOFT":return 6548;case"ALC_HRTF_SPECIFIER_SOFT":return 6549;case"ALC_HRTF_DISABLED_SOFT":return 0;case"ALC_HRTF_ENABLED_SOFT":return 1;case"ALC_HRTF_DENIED_SOFT":return 2;case"ALC_HRTF_REQUIRED_SOFT":return 3;case"ALC_HRTF_HEADPHONES_DETECTED_SOFT":return 4;case"ALC_HRTF_UNSUPPORTED_FORMAT_SOFT":return 5;default:return AL.alcErr=40964,0}}_alcGetEnumValue.sig="ipp";function _alcGetError(e){var t=AL.alcErr;return AL.alcErr=0,t}_alcGetError.sig="ip";function _alcGetIntegerv(e,t,r,n){if(e>>>=0,n>>>=0,!(r===0||!n))switch(t){case 4096:HEAP32[n>>>2>>>0]=1;break;case 4097:HEAP32[n>>>2>>>0]=1;break;case 4098:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=AL.currentCtx.attrs.length;break;case 4099:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}for(var a=0;a>>2>>>0]=AL.currentCtx.attrs[a];break;case 4103:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=AL.currentCtx.audioCtx.sampleRate;break;case 4112:case 4113:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=2147483647;break;case 6546:case 6547:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}var o=0;for(var l in AL.contexts){var u=AL.contexts[l];u.deviceId===e&&(o=u.hrtf?1:0)}HEAP32[n>>>2>>>0]=o;break;case 6548:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}HEAP32[n>>>2>>>0]=1;break;case 131075:if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.currentCtx){AL.alcErr=40962;return}HEAP32[n>>>2>>>0]=1;case 786:var _=AL.requireValidCaptureDevice(e,"alcGetIntegerv");if(!_)return;var d=_.capturedFrameCount,p=_.requestedSampleRate,f=_.audioCtx.sampleRate,m=Math.floor(d*(p/f));HEAP32[n>>>2>>>0]=m;break;default:AL.alcErr=40963;return}}_alcGetIntegerv.sig="vpiip";function _alcGetString(e,t){if(e>>>=0,AL.alcStringCache[t])return AL.alcStringCache[t];var r;switch(t){case 0:r="No Error";break;case 40961:r="Invalid Device";break;case 40962:r="Invalid Context";break;case 40963:r="Invalid Enum";break;case 40964:r="Invalid Value";break;case 40965:r="Out of Memory";break;case 4100:if(typeof AudioContext<"u"||typeof webkitAudioContext<"u")r=AL.DEVICE_NAME;else return 0;break;case 4101:typeof AudioContext<"u"||typeof webkitAudioContext<"u"?r=AL.DEVICE_NAME+"\0":r="\0";break;case 785:r=AL.CAPTURE_DEVICE_NAME;break;case 784:if(e===0)r=AL.CAPTURE_DEVICE_NAME+"\0";else{var n=AL.requireValidCaptureDevice(e,"alcGetString");if(!n)return 0;r=n.deviceName}break;case 4102:if(!e)return AL.alcErr=40961,0;r=Object.keys(AL.ALC_EXTENSIONS).join(" ");break;default:return AL.alcErr=40963,0}return r=stringToNewUTF8(r),AL.alcStringCache[t]=r,r}_alcGetString.sig="ppi";function _alcIsExtensionPresent(e,t){t>>>=0;var r=UTF8ToString(t);return AL.ALC_EXTENSIONS[r]?1:0}_alcIsExtensionPresent.sig="ipp";function _alcMakeContextCurrent(e){return e>>>=0,e===0?AL.currentCtx=null:AL.currentCtx=AL.contexts[e],1}_alcMakeContextCurrent.sig="ip";function _alcOpenDevice(e){if(e>>>=0,e){var t=UTF8ToString(e);if(t!==AL.DEVICE_NAME)return 0}if(typeof AudioContext<"u"||typeof webkitAudioContext<"u"){var r=AL.newId();return AL.deviceRefCounts[r]=0,r}return 0}_alcOpenDevice.sig="pp";function _alcProcessContext(e){}_alcProcessContext.sig="vp";function _alcSuspendContext(e){}_alcSuspendContext.sig="vp";function _duckdb_web_fs_directory_create(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.createDirectory(Module,e,t)}_duckdb_web_fs_directory_create.sig="vpi";function _duckdb_web_fs_directory_exists(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.checkDirectory(Module,e,t)}_duckdb_web_fs_directory_exists.sig="ipi";function _duckdb_web_fs_directory_list_files(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.listDirectoryEntries(Module,e,t)}_duckdb_web_fs_directory_list_files.sig="ipi";function _duckdb_web_fs_directory_remove(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.removeDirectory(Module,e,t)}_duckdb_web_fs_directory_remove.sig="vpi";function _duckdb_web_fs_file_close(e){return globalThis.DUCKDB_RUNTIME.closeFile(Module,e)}_duckdb_web_fs_file_close.sig="vi";function _duckdb_web_fs_file_exists(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.checkFile(Module,e,t)}_duckdb_web_fs_file_exists.sig="ipi";function _duckdb_web_fs_file_get_last_modified_time(e){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(Module,e)}_duckdb_web_fs_file_get_last_modified_time.sig="ii";function _duckdb_web_fs_file_move(e,t,r,n){return e>>>=0,r>>>=0,globalThis.DUCKDB_RUNTIME.moveFile(Module,e,t,r,n)}_duckdb_web_fs_file_move.sig="vpipi";function _duckdb_web_fs_file_open(e,t){return globalThis.DUCKDB_RUNTIME.openFile(Module,e,t)}_duckdb_web_fs_file_open.sig="pii";function _duckdb_web_fs_file_read(e,t,r,n){return t>>>=0,globalThis.DUCKDB_RUNTIME.readFile(Module,e,t,r,n)}_duckdb_web_fs_file_read.sig="iipid";function _duckdb_web_fs_file_truncate(e,t){return globalThis.DUCKDB_RUNTIME.truncateFile(Module,e,t)}_duckdb_web_fs_file_truncate.sig="vid";function _duckdb_web_fs_file_write(e,t,r,n){return t>>>=0,globalThis.DUCKDB_RUNTIME.writeFile(Module,e,t,r,n)}_duckdb_web_fs_file_write.sig="iipid";function _duckdb_web_fs_get_default_data_protocol(e){return globalThis.DUCKDB_RUNTIME.getDefaultDataProtocol(e)}_duckdb_web_fs_get_default_data_protocol.sig="i";function _duckdb_web_fs_glob(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.glob(Module,e,t)}_duckdb_web_fs_glob.sig="vpi";function _duckdb_web_test_platform_feature(e){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(Module,e)}_duckdb_web_test_platform_feature.sig="ii";function _duckdb_web_udf_scalar_call(e,t,r,n,a,o){return e>>>=0,r>>>=0,a>>>=0,globalThis.DUCKDB_RUNTIME.callScalarUDF(Module,e,t,r,n,a,o)}_duckdb_web_udf_scalar_call.sig="vpipipi";var _emscripten_alcDevicePauseSOFT=e=>{if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(!AL.paused){AL.paused=!0;for(var t in AL.contexts){var r=AL.contexts[t];r.deviceId===e&&(r.audioCtx.suspend(),clearInterval(r.interval),r.interval=null)}}};_emscripten_alcDevicePauseSOFT.sig="vi";var _emscripten_alcDeviceResumeSOFT=e=>{if(!(e in AL.deviceRefCounts)){AL.alcErr=40961;return}if(AL.paused){AL.paused=!1;for(var t in AL.contexts){var r=AL.contexts[t];r.deviceId===e&&(r.interval=setInterval(()=>AL.scheduleContextAudio(r),AL.QUEUE_INTERVAL),r.audioCtx.resume())}}};_emscripten_alcDeviceResumeSOFT.sig="vi";var _emscripten_alcGetStringiSOFT=(e,t,r)=>{if(!(e in AL.deviceRefCounts))return AL.alcErr=40961,0;if(AL.alcStringCache[t])return AL.alcStringCache[t];var n;switch(t){case 6549:if(r===0)n="Web Audio HRTF";else return AL.alcErr=40964,0;break;default:return r!==0?(AL.alcErr=40963,0):_alcGetString(e,t)}return n=stringToNewUTF8(n),AL.alcStringCache[t]=n,n};_emscripten_alcGetStringiSOFT.sig="iiii";var _emscripten_alcResetDeviceSOFT=(e,t)=>{if(!(e in AL.deviceRefCounts))return AL.alcErr=40961,0;var r=null;if(t>>=2,t)for(var n=0,a=0;n=HEAP32[t++>>>0],n!==0;)switch(a=HEAP32[t++>>>0],n){case 6546:a===1?r=!0:a===0&&(r=!1);break}if(r!==null)for(var o in AL.contexts){var l=AL.contexts[o];l.deviceId===e&&(l.hrtf=r,AL.updateContextGlobal(l))}return 1};_emscripten_alcResetDeviceSOFT.sig="iii";var readEmAsmArgsArray=[],readEmAsmArgs=(e,t)=>{readEmAsmArgsArray.length=0;for(var r;r=HEAPU8[e++>>>0];){var n=r!=105;n&=r!=112,t+=n&&t%8?4:0,readEmAsmArgsArray.push(r==112?HEAPU32[t>>>2>>>0]:r==105?HEAP32[t>>>2>>>0]:HEAPF64[t>>>3>>>0]),t+=n?8:4}return readEmAsmArgsArray},runEmAsmFunction=(e,t,r)=>{var n=readEmAsmArgs(t,r);return ASM_CONSTS[e](...n)};function _emscripten_asm_const_int(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runEmAsmFunction(e,t,r)}_emscripten_asm_const_int.sig="ippp";function _emscripten_asm_const_ptr(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runEmAsmFunction(e,t,r)}_emscripten_asm_const_ptr.sig="pppp";function _emscripten_console_error(e){e>>>=0,console.error(UTF8ToString(e))}_emscripten_console_error.sig="vp";function _emscripten_console_log(e){e>>>=0,console.log(UTF8ToString(e))}_emscripten_console_log.sig="vp";function _emscripten_console_trace(e){e>>>=0,console.trace(UTF8ToString(e))}_emscripten_console_trace.sig="vp";function _emscripten_console_warn(e){e>>>=0,console.warn(UTF8ToString(e))}_emscripten_console_warn.sig="vp";var _emscripten_date_now=()=>Date.now();_emscripten_date_now.sig="d";function _emscripten_err(e){return e>>>=0,err(UTF8ToString(e))}_emscripten_err.sig="vp";var getHeapMax=()=>4294901760;function _emscripten_get_heap_max(){return getHeapMax()}_emscripten_get_heap_max.sig="p";var _emscripten_get_now_res=()=>ENVIRONMENT_IS_NODE?1:1e3;_emscripten_get_now_res.sig="d";var GLctx,webgl_enable_ANGLE_instanced_arrays=e=>{var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=(r,n)=>t.vertexAttribDivisorANGLE(r,n),e.drawArraysInstanced=(r,n,a,o)=>t.drawArraysInstancedANGLE(r,n,a,o),e.drawElementsInstanced=(r,n,a,o,l)=>t.drawElementsInstancedANGLE(r,n,a,o,l),1},webgl_enable_OES_vertex_array_object=e=>{var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=()=>t.createVertexArrayOES(),e.deleteVertexArray=r=>t.deleteVertexArrayOES(r),e.bindVertexArray=r=>t.bindVertexArrayOES(r),e.isVertexArray=r=>t.isVertexArrayOES(r),1},webgl_enable_WEBGL_draw_buffers=e=>{var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=(r,n)=>t.drawBuffersWEBGL(r,n),1},webgl_enable_EXT_polygon_offset_clamp=e=>!!(e.extPolygonOffsetClamp=e.getExtension("EXT_polygon_offset_clamp")),webgl_enable_EXT_clip_control=e=>!!(e.extClipControl=e.getExtension("EXT_clip_control")),webgl_enable_WEBGL_polygon_mode=e=>!!(e.webglPolygonMode=e.getExtension("WEBGL_polygon_mode")),webgl_enable_WEBGL_multi_draw=e=>!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")),getEmscriptenSupportedExtensions=e=>{var t=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_clip_control","EXT_color_buffer_half_float","EXT_depth_clamp","EXT_float_blend","EXT_polygon_offset_clamp","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_blend_func_extended","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw","WEBGL_polygon_mode"];return(e.getSupportedExtensions()||[]).filter(r=>t.includes(r))},GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,unpackRowLength:0,recordError:e=>{GL.lastError||(GL.lastError=e)},getNewId:e=>{for(var t=GL.counter++,r=e.length;r{for(var a=0;a>>2>>>0]=l}},getSource:(e,t,r,n)=>{for(var a="",o=0;o>>2>>>0]:void 0;a+=UTF8ToString(HEAPU32[r+o*4>>>2>>>0],l)}return a},createContext:(e,t)=>{if(!e.getContextSafariWebGL2Fixed){let a=function(o,l){var u=e.getContextSafariWebGL2Fixed(o,l);return o=="webgl"==u instanceof WebGLRenderingContext?u:null};e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=a}var r=e.getContext("webgl",t);if(!r)return 0;var n=GL.registerContext(r,t);return n},registerContext:(e,t)=>{var r=GL.getNewId(GL.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),GL.contexts[r]=n,(typeof t.enableExtensionsByDefault>"u"||t.enableExtensionsByDefault)&&GL.initExtensions(n),r},makeContextCurrent:e=>{var t;return GL.currentContext=GL.contexts[e],Module.ctx=GLctx=(t=GL.currentContext)==null?void 0:t.GLctx,!(e&&!GLctx)},getContext:e=>GL.contexts[e],deleteContext:e=>{GL.currentContext===GL.contexts[e]&&(GL.currentContext=null),typeof JSEvents=="object"&&JSEvents.removeAllHandlersOnTarget(GL.contexts[e].GLctx.canvas),GL.contexts[e]&&GL.contexts[e].GLctx.canvas&&(GL.contexts[e].GLctx.canvas.GLctxObject=void 0),GL.contexts[e]=null},initExtensions:e=>{if(e||(e=GL.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;webgl_enable_WEBGL_multi_draw(t),webgl_enable_EXT_polygon_offset_clamp(t),webgl_enable_EXT_clip_control(t),webgl_enable_WEBGL_polygon_mode(t),webgl_enable_ANGLE_instanced_arrays(t),webgl_enable_OES_vertex_array_object(t),webgl_enable_WEBGL_draw_buffers(t),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query"),getEmscriptenSupportedExtensions(t).forEach(r=>{!r.includes("lose_context")&&!r.includes("debug")&&t.getExtension(r)})}}},_glActiveTexture=e=>GLctx.activeTexture(e);_glActiveTexture.sig="vi";var _emscripten_glActiveTexture=_glActiveTexture;_emscripten_glActiveTexture.sig="vi";var _glAttachShader=(e,t)=>{GLctx.attachShader(GL.programs[e],GL.shaders[t])};_glAttachShader.sig="vii";var _emscripten_glAttachShader=_glAttachShader;_emscripten_glAttachShader.sig="vii";var _glBeginQueryEXT=(e,t)=>{GLctx.disjointTimerQueryExt.beginQueryEXT(e,GL.queries[t])};_glBeginQueryEXT.sig="vii";var _emscripten_glBeginQueryEXT=_glBeginQueryEXT;function _glBindAttribLocation(e,t,r){r>>>=0,GLctx.bindAttribLocation(GL.programs[e],t,UTF8ToString(r))}_glBindAttribLocation.sig="viip";var _emscripten_glBindAttribLocation=_glBindAttribLocation;_emscripten_glBindAttribLocation.sig="viip";var _glBindBuffer=(e,t)=>{GLctx.bindBuffer(e,GL.buffers[t])};_glBindBuffer.sig="vii";var _emscripten_glBindBuffer=_glBindBuffer;_emscripten_glBindBuffer.sig="vii";var _glBindFramebuffer=(e,t)=>{GLctx.bindFramebuffer(e,GL.framebuffers[t])};_glBindFramebuffer.sig="vii";var _emscripten_glBindFramebuffer=_glBindFramebuffer;_emscripten_glBindFramebuffer.sig="vii";var _glBindRenderbuffer=(e,t)=>{GLctx.bindRenderbuffer(e,GL.renderbuffers[t])};_glBindRenderbuffer.sig="vii";var _emscripten_glBindRenderbuffer=_glBindRenderbuffer;_emscripten_glBindRenderbuffer.sig="vii";var _glBindTexture=(e,t)=>{GLctx.bindTexture(e,GL.textures[t])};_glBindTexture.sig="vii";var _emscripten_glBindTexture=_glBindTexture;_emscripten_glBindTexture.sig="vii";var _glBindVertexArray=e=>{GLctx.bindVertexArray(GL.vaos[e])};_glBindVertexArray.sig="vi";var _glBindVertexArrayOES=_glBindVertexArray;_glBindVertexArrayOES.sig="vi";var _emscripten_glBindVertexArrayOES=_glBindVertexArrayOES;_emscripten_glBindVertexArrayOES.sig="vi";var _glBlendColor=(e,t,r,n)=>GLctx.blendColor(e,t,r,n);_glBlendColor.sig="vffff";var _emscripten_glBlendColor=_glBlendColor;_emscripten_glBlendColor.sig="vffff";var _glBlendEquation=e=>GLctx.blendEquation(e);_glBlendEquation.sig="vi";var _emscripten_glBlendEquation=_glBlendEquation;_emscripten_glBlendEquation.sig="vi";var _glBlendEquationSeparate=(e,t)=>GLctx.blendEquationSeparate(e,t);_glBlendEquationSeparate.sig="vii";var _emscripten_glBlendEquationSeparate=_glBlendEquationSeparate;_emscripten_glBlendEquationSeparate.sig="vii";var _glBlendFunc=(e,t)=>GLctx.blendFunc(e,t);_glBlendFunc.sig="vii";var _emscripten_glBlendFunc=_glBlendFunc;_emscripten_glBlendFunc.sig="vii";var _glBlendFuncSeparate=(e,t,r,n)=>GLctx.blendFuncSeparate(e,t,r,n);_glBlendFuncSeparate.sig="viiii";var _emscripten_glBlendFuncSeparate=_glBlendFuncSeparate;_emscripten_glBlendFuncSeparate.sig="viiii";function _glBufferData(e,t,r,n){t>>>=0,r>>>=0,GLctx.bufferData(e,r?HEAPU8.subarray(r>>>0,r+t>>>0):t,n)}_glBufferData.sig="vippi";var _emscripten_glBufferData=_glBufferData;_emscripten_glBufferData.sig="vippi";function _glBufferSubData(e,t,r,n){t>>>=0,r>>>=0,n>>>=0,GLctx.bufferSubData(e,t,HEAPU8.subarray(n>>>0,n+r>>>0))}_glBufferSubData.sig="vippp";var _emscripten_glBufferSubData=_glBufferSubData;_emscripten_glBufferSubData.sig="vippp";var _glCheckFramebufferStatus=e=>GLctx.checkFramebufferStatus(e);_glCheckFramebufferStatus.sig="ii";var _emscripten_glCheckFramebufferStatus=_glCheckFramebufferStatus;_emscripten_glCheckFramebufferStatus.sig="ii";var _glClear=e=>GLctx.clear(e);_glClear.sig="vi";var _emscripten_glClear=_glClear;_emscripten_glClear.sig="vi";var _glClearColor=(e,t,r,n)=>GLctx.clearColor(e,t,r,n);_glClearColor.sig="vffff";var _emscripten_glClearColor=_glClearColor;_emscripten_glClearColor.sig="vffff";var _glClearDepthf=e=>GLctx.clearDepth(e);_glClearDepthf.sig="vf";var _emscripten_glClearDepthf=_glClearDepthf;_emscripten_glClearDepthf.sig="vf";var _glClearStencil=e=>GLctx.clearStencil(e);_glClearStencil.sig="vi";var _emscripten_glClearStencil=_glClearStencil;_emscripten_glClearStencil.sig="vi";var _glClipControlEXT=(e,t)=>{GLctx.extClipControl.clipControlEXT(e,t)};_glClipControlEXT.sig="vii";var _emscripten_glClipControlEXT=_glClipControlEXT,_glColorMask=(e,t,r,n)=>{GLctx.colorMask(!!e,!!t,!!r,!!n)};_glColorMask.sig="viiii";var _emscripten_glColorMask=_glColorMask;_emscripten_glColorMask.sig="viiii";var _glCompileShader=e=>{GLctx.compileShader(GL.shaders[e])};_glCompileShader.sig="vi";var _emscripten_glCompileShader=_glCompileShader;_emscripten_glCompileShader.sig="vi";function _glCompressedTexImage2D(e,t,r,n,a,o,l,u){u>>>=0,GLctx.compressedTexImage2D(e,t,r,n,a,o,HEAPU8.subarray(u>>>0,u+l>>>0))}_glCompressedTexImage2D.sig="viiiiiiip";var _emscripten_glCompressedTexImage2D=_glCompressedTexImage2D;_emscripten_glCompressedTexImage2D.sig="viiiiiiip";function _glCompressedTexSubImage2D(e,t,r,n,a,o,l,u,_){_>>>=0,GLctx.compressedTexSubImage2D(e,t,r,n,a,o,l,HEAPU8.subarray(_>>>0,_+u>>>0))}_glCompressedTexSubImage2D.sig="viiiiiiiip";var _emscripten_glCompressedTexSubImage2D=_glCompressedTexSubImage2D;_emscripten_glCompressedTexSubImage2D.sig="viiiiiiiip";var _glCopyTexImage2D=(e,t,r,n,a,o,l,u)=>GLctx.copyTexImage2D(e,t,r,n,a,o,l,u);_glCopyTexImage2D.sig="viiiiiiii";var _emscripten_glCopyTexImage2D=_glCopyTexImage2D;_emscripten_glCopyTexImage2D.sig="viiiiiiii";var _glCopyTexSubImage2D=(e,t,r,n,a,o,l,u)=>GLctx.copyTexSubImage2D(e,t,r,n,a,o,l,u);_glCopyTexSubImage2D.sig="viiiiiiii";var _emscripten_glCopyTexSubImage2D=_glCopyTexSubImage2D;_emscripten_glCopyTexSubImage2D.sig="viiiiiiii";var _glCreateProgram=()=>{var e=GL.getNewId(GL.programs),t=GLctx.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,GL.programs[e]=t,e};_glCreateProgram.sig="i";var _emscripten_glCreateProgram=_glCreateProgram;_emscripten_glCreateProgram.sig="i";var _glCreateShader=e=>{var t=GL.getNewId(GL.shaders);return GL.shaders[t]=GLctx.createShader(e),t};_glCreateShader.sig="ii";var _emscripten_glCreateShader=_glCreateShader;_emscripten_glCreateShader.sig="ii";var _glCullFace=e=>GLctx.cullFace(e);_glCullFace.sig="vi";var _emscripten_glCullFace=_glCullFace;_emscripten_glCullFace.sig="vi";function _glDeleteBuffers(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.buffers[n];a&&(GLctx.deleteBuffer(a),a.name=0,GL.buffers[n]=null)}}_glDeleteBuffers.sig="vip";var _emscripten_glDeleteBuffers=_glDeleteBuffers;_emscripten_glDeleteBuffers.sig="vip";function _glDeleteFramebuffers(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.framebuffers[n];a&&(GLctx.deleteFramebuffer(a),a.name=0,GL.framebuffers[n]=null)}}_glDeleteFramebuffers.sig="vip";var _emscripten_glDeleteFramebuffers=_glDeleteFramebuffers;_emscripten_glDeleteFramebuffers.sig="vip";var _glDeleteProgram=e=>{if(e){var t=GL.programs[e];if(!t){GL.recordError(1281);return}GLctx.deleteProgram(t),t.name=0,GL.programs[e]=null}};_glDeleteProgram.sig="vi";var _emscripten_glDeleteProgram=_glDeleteProgram;_emscripten_glDeleteProgram.sig="vi";function _glDeleteQueriesEXT(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.queries[n];a&&(GLctx.disjointTimerQueryExt.deleteQueryEXT(a),GL.queries[n]=null)}}_glDeleteQueriesEXT.sig="vip";var _emscripten_glDeleteQueriesEXT=_glDeleteQueriesEXT;function _glDeleteRenderbuffers(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.renderbuffers[n];a&&(GLctx.deleteRenderbuffer(a),a.name=0,GL.renderbuffers[n]=null)}}_glDeleteRenderbuffers.sig="vip";var _emscripten_glDeleteRenderbuffers=_glDeleteRenderbuffers;_emscripten_glDeleteRenderbuffers.sig="vip";var _glDeleteShader=e=>{if(e){var t=GL.shaders[e];if(!t){GL.recordError(1281);return}GLctx.deleteShader(t),GL.shaders[e]=null}};_glDeleteShader.sig="vi";var _emscripten_glDeleteShader=_glDeleteShader;_emscripten_glDeleteShader.sig="vi";function _glDeleteTextures(e,t){t>>>=0;for(var r=0;r>>2>>>0],a=GL.textures[n];a&&(GLctx.deleteTexture(a),a.name=0,GL.textures[n]=null)}}_glDeleteTextures.sig="vip";var _emscripten_glDeleteTextures=_glDeleteTextures;_emscripten_glDeleteTextures.sig="vip";function _glDeleteVertexArrays(e,t){t>>>=0;for(var r=0;r>>2>>>0];GLctx.deleteVertexArray(GL.vaos[n]),GL.vaos[n]=null}}_glDeleteVertexArrays.sig="vip";var _glDeleteVertexArraysOES=_glDeleteVertexArrays;_glDeleteVertexArraysOES.sig="vip";var _emscripten_glDeleteVertexArraysOES=_glDeleteVertexArraysOES;_emscripten_glDeleteVertexArraysOES.sig="vip";var _glDepthFunc=e=>GLctx.depthFunc(e);_glDepthFunc.sig="vi";var _emscripten_glDepthFunc=_glDepthFunc;_emscripten_glDepthFunc.sig="vi";var _glDepthMask=e=>{GLctx.depthMask(!!e)};_glDepthMask.sig="vi";var _emscripten_glDepthMask=_glDepthMask;_emscripten_glDepthMask.sig="vi";var _glDepthRangef=(e,t)=>GLctx.depthRange(e,t);_glDepthRangef.sig="vff";var _emscripten_glDepthRangef=_glDepthRangef;_emscripten_glDepthRangef.sig="vff";var _glDetachShader=(e,t)=>{GLctx.detachShader(GL.programs[e],GL.shaders[t])};_glDetachShader.sig="vii";var _emscripten_glDetachShader=_glDetachShader;_emscripten_glDetachShader.sig="vii";var _glDisable=e=>GLctx.disable(e);_glDisable.sig="vi";var _emscripten_glDisable=_glDisable;_emscripten_glDisable.sig="vi";var _glDisableVertexAttribArray=e=>{GLctx.disableVertexAttribArray(e)};_glDisableVertexAttribArray.sig="vi";var _emscripten_glDisableVertexAttribArray=_glDisableVertexAttribArray;_emscripten_glDisableVertexAttribArray.sig="vi";var _glDrawArrays=(e,t,r)=>{GLctx.drawArrays(e,t,r)};_glDrawArrays.sig="viii";var _emscripten_glDrawArrays=_glDrawArrays;_emscripten_glDrawArrays.sig="viii";var _glDrawArraysInstanced=(e,t,r,n)=>{GLctx.drawArraysInstanced(e,t,r,n)};_glDrawArraysInstanced.sig="viiii";var _glDrawArraysInstancedANGLE=_glDrawArraysInstanced,_emscripten_glDrawArraysInstancedANGLE=_glDrawArraysInstancedANGLE,tempFixedLengthArray=[];function _glDrawBuffers(e,t){t>>>=0;for(var r=tempFixedLengthArray[e],n=0;n>>2>>>0];GLctx.drawBuffers(r)}_glDrawBuffers.sig="vip";var _glDrawBuffersWEBGL=_glDrawBuffers,_emscripten_glDrawBuffersWEBGL=_glDrawBuffersWEBGL;function _glDrawElements(e,t,r,n){n>>>=0,GLctx.drawElements(e,t,r,n)}_glDrawElements.sig="viiip";var _emscripten_glDrawElements=_glDrawElements;_emscripten_glDrawElements.sig="viiip";function _glDrawElementsInstanced(e,t,r,n,a){n>>>=0,GLctx.drawElementsInstanced(e,t,r,n,a)}_glDrawElementsInstanced.sig="viiipi";var _glDrawElementsInstancedANGLE=_glDrawElementsInstanced,_emscripten_glDrawElementsInstancedANGLE=_glDrawElementsInstancedANGLE,_glEnable=e=>GLctx.enable(e);_glEnable.sig="vi";var _emscripten_glEnable=_glEnable;_emscripten_glEnable.sig="vi";var _glEnableVertexAttribArray=e=>{GLctx.enableVertexAttribArray(e)};_glEnableVertexAttribArray.sig="vi";var _emscripten_glEnableVertexAttribArray=_glEnableVertexAttribArray;_emscripten_glEnableVertexAttribArray.sig="vi";var _glEndQueryEXT=e=>{GLctx.disjointTimerQueryExt.endQueryEXT(e)};_glEndQueryEXT.sig="vi";var _emscripten_glEndQueryEXT=_glEndQueryEXT,_glFinish=()=>GLctx.finish();_glFinish.sig="v";var _emscripten_glFinish=_glFinish;_emscripten_glFinish.sig="v";var _glFlush=()=>GLctx.flush();_glFlush.sig="v";var _emscripten_glFlush=_glFlush;_emscripten_glFlush.sig="v";var _glFramebufferRenderbuffer=(e,t,r,n)=>{GLctx.framebufferRenderbuffer(e,t,r,GL.renderbuffers[n])};_glFramebufferRenderbuffer.sig="viiii";var _emscripten_glFramebufferRenderbuffer=_glFramebufferRenderbuffer;_emscripten_glFramebufferRenderbuffer.sig="viiii";var _glFramebufferTexture2D=(e,t,r,n,a)=>{GLctx.framebufferTexture2D(e,t,r,GL.textures[n],a)};_glFramebufferTexture2D.sig="viiiii";var _emscripten_glFramebufferTexture2D=_glFramebufferTexture2D;_emscripten_glFramebufferTexture2D.sig="viiiii";var _glFrontFace=e=>GLctx.frontFace(e);_glFrontFace.sig="vi";var _emscripten_glFrontFace=_glFrontFace;_emscripten_glFrontFace.sig="vi";function _glGenBuffers(e,t){t>>>=0,GL.genObject(e,t,"createBuffer",GL.buffers)}_glGenBuffers.sig="vip";var _emscripten_glGenBuffers=_glGenBuffers;_emscripten_glGenBuffers.sig="vip";function _glGenFramebuffers(e,t){t>>>=0,GL.genObject(e,t,"createFramebuffer",GL.framebuffers)}_glGenFramebuffers.sig="vip";var _emscripten_glGenFramebuffers=_glGenFramebuffers;_emscripten_glGenFramebuffers.sig="vip";function _glGenQueriesEXT(e,t){t>>>=0;for(var r=0;r>>2>>>0]=0;return}var a=GL.getNewId(GL.queries);n.name=a,GL.queries[a]=n,HEAP32[t+r*4>>>2>>>0]=a}}_glGenQueriesEXT.sig="vip";var _emscripten_glGenQueriesEXT=_glGenQueriesEXT;function _glGenRenderbuffers(e,t){t>>>=0,GL.genObject(e,t,"createRenderbuffer",GL.renderbuffers)}_glGenRenderbuffers.sig="vip";var _emscripten_glGenRenderbuffers=_glGenRenderbuffers;_emscripten_glGenRenderbuffers.sig="vip";function _glGenTextures(e,t){t>>>=0,GL.genObject(e,t,"createTexture",GL.textures)}_glGenTextures.sig="vip";var _emscripten_glGenTextures=_glGenTextures;_emscripten_glGenTextures.sig="vip";function _glGenVertexArrays(e,t){t>>>=0,GL.genObject(e,t,"createVertexArray",GL.vaos)}_glGenVertexArrays.sig="vip";var _glGenVertexArraysOES=_glGenVertexArrays;_glGenVertexArraysOES.sig="vip";var _emscripten_glGenVertexArraysOES=_glGenVertexArraysOES;_emscripten_glGenVertexArraysOES.sig="vip";var _glGenerateMipmap=e=>GLctx.generateMipmap(e);_glGenerateMipmap.sig="vi";var _emscripten_glGenerateMipmap=_glGenerateMipmap;_emscripten_glGenerateMipmap.sig="vi";var __glGetActiveAttribOrUniform=(e,t,r,n,a,o,l,u)=>{t=GL.programs[t];var _=GLctx[e](t,r);if(_){var d=u&&stringToUTF8(_.name,u,n);a&&(HEAP32[a>>>2>>>0]=d),o&&(HEAP32[o>>>2>>>0]=_.size),l&&(HEAP32[l>>>2>>>0]=_.type)}};function _glGetActiveAttrib(e,t,r,n,a,o,l){n>>>=0,a>>>=0,o>>>=0,l>>>=0,__glGetActiveAttribOrUniform("getActiveAttrib",e,t,r,n,a,o,l)}_glGetActiveAttrib.sig="viiipppp";var _emscripten_glGetActiveAttrib=_glGetActiveAttrib;_emscripten_glGetActiveAttrib.sig="viiipppp";function _glGetActiveUniform(e,t,r,n,a,o,l){n>>>=0,a>>>=0,o>>>=0,l>>>=0,__glGetActiveAttribOrUniform("getActiveUniform",e,t,r,n,a,o,l)}_glGetActiveUniform.sig="viiipppp";var _emscripten_glGetActiveUniform=_glGetActiveUniform;_emscripten_glGetActiveUniform.sig="viiipppp";function _glGetAttachedShaders(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getAttachedShaders(GL.programs[e]),o=a.length;o>t&&(o=t),HEAP32[r>>>2>>>0]=o;for(var l=0;l>>2>>>0]=u}}_glGetAttachedShaders.sig="viipp";var _emscripten_glGetAttachedShaders=_glGetAttachedShaders;_emscripten_glGetAttachedShaders.sig="viipp";function _glGetAttribLocation(e,t){return t>>>=0,GLctx.getAttribLocation(GL.programs[e],UTF8ToString(t))}_glGetAttribLocation.sig="iip";var _emscripten_glGetAttribLocation=_glGetAttribLocation;_emscripten_glGetAttribLocation.sig="iip";var writeI53ToI64=(e,t)=>{HEAPU32[e>>>2>>>0]=t;var r=HEAPU32[e>>>2>>>0];HEAPU32[e+4>>>2>>>0]=(t-r)/4294967296},emscriptenWebGLGet=(e,t,r)=>{if(!t){GL.recordError(1281);return}var n=void 0;switch(e){case 36346:n=1;break;case 36344:r!=0&&r!=1&&GL.recordError(1280);return;case 36345:n=0;break;case 34466:var a=GLctx.getParameter(34467);n=a?a.length:0;break}if(n===void 0){var o=GLctx.getParameter(e);switch(typeof o){case"number":n=o;break;case"boolean":n=o?1:0;break;case"string":GL.recordError(1280);return;case"object":if(o===null)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:{n=0;break}default:{GL.recordError(1280);return}}else if(o instanceof Float32Array||o instanceof Uint32Array||o instanceof Int32Array||o instanceof Array){for(var l=0;l>>2>>>0]=o[l];break;case 2:HEAPF32[t+l*4>>>2>>>0]=o[l];break;case 4:HEAP8[t+l>>>0]=o[l]?1:0;break}return}else try{n=o.name|0}catch(u){GL.recordError(1280),err("GL_INVALID_ENUM in glGet".concat(r,"v: Unknown object returned from WebGL getParameter(").concat(e,")! (error: ").concat(u,")"));return}break;default:GL.recordError(1280),err("GL_INVALID_ENUM in glGet".concat(r,"v: Native code calling glGet").concat(r,"v(").concat(e,") and it returns ").concat(o," of type ").concat(typeof o,"!"));return}}switch(r){case 1:writeI53ToI64(t,n);break;case 0:HEAP32[t>>>2>>>0]=n;break;case 2:HEAPF32[t>>>2>>>0]=n;break;case 4:HEAP8[t>>>0]=n?1:0;break}};function _glGetBooleanv(e,t){return t>>>=0,emscriptenWebGLGet(e,t,4)}_glGetBooleanv.sig="vip";var _emscripten_glGetBooleanv=_glGetBooleanv;_emscripten_glGetBooleanv.sig="vip";function _glGetBufferParameteriv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getBufferParameter(e,t)}_glGetBufferParameteriv.sig="viip";var _emscripten_glGetBufferParameteriv=_glGetBufferParameteriv;_emscripten_glGetBufferParameteriv.sig="viip";var _glGetError=()=>{var e=GLctx.getError()||GL.lastError;return GL.lastError=0,e};_glGetError.sig="i";var _emscripten_glGetError=_glGetError;_emscripten_glGetError.sig="i";function _glGetFloatv(e,t){return t>>>=0,emscriptenWebGLGet(e,t,2)}_glGetFloatv.sig="vip";var _emscripten_glGetFloatv=_glGetFloatv;_emscripten_glGetFloatv.sig="vip";function _glGetFramebufferAttachmentParameteriv(e,t,r,n){n>>>=0;var a=GLctx.getFramebufferAttachmentParameter(e,t,r);(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)&&(a=a.name|0),HEAP32[n>>>2>>>0]=a}_glGetFramebufferAttachmentParameteriv.sig="viiip";var _emscripten_glGetFramebufferAttachmentParameteriv=_glGetFramebufferAttachmentParameteriv;_emscripten_glGetFramebufferAttachmentParameteriv.sig="viiip";function _glGetIntegerv(e,t){return t>>>=0,emscriptenWebGLGet(e,t,0)}_glGetIntegerv.sig="vip";var _emscripten_glGetIntegerv=_glGetIntegerv;_emscripten_glGetIntegerv.sig="vip";function _glGetProgramInfoLog(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getProgramInfoLog(GL.programs[e]);a===null&&(a="(unknown error)");var o=t>0&&n?stringToUTF8(a,n,t):0;r&&(HEAP32[r>>>2>>>0]=o)}_glGetProgramInfoLog.sig="viipp";var _emscripten_glGetProgramInfoLog=_glGetProgramInfoLog;_emscripten_glGetProgramInfoLog.sig="viipp";function _glGetProgramiv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}if(e>=GL.counter){GL.recordError(1281);return}if(e=GL.programs[e],t==35716){var n=GLctx.getProgramInfoLog(e);n===null&&(n="(unknown error)"),HEAP32[r>>>2>>>0]=n.length+1}else if(t==35719){if(!e.maxUniformLength)for(var a=GLctx.getProgramParameter(e,35718),o=0;o>>2>>>0]=e.maxUniformLength}else if(t==35722){if(!e.maxAttributeLength)for(var l=GLctx.getProgramParameter(e,35721),o=0;o>>2>>>0]=e.maxAttributeLength}else if(t==35381){if(!e.maxUniformBlockNameLength)for(var u=GLctx.getProgramParameter(e,35382),o=0;o>>2>>>0]=e.maxUniformBlockNameLength}else HEAP32[r>>>2>>>0]=GLctx.getProgramParameter(e,t)}_glGetProgramiv.sig="viip";var _emscripten_glGetProgramiv=_glGetProgramiv;_emscripten_glGetProgramiv.sig="viip";function _glGetQueryObjecti64vEXT(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}var n=GL.queries[e],a;a=GLctx.disjointTimerQueryExt.getQueryObjectEXT(n,t);var o;typeof a=="boolean"?o=a?1:0:o=a,writeI53ToI64(r,o)}_glGetQueryObjecti64vEXT.sig="viip";var _emscripten_glGetQueryObjecti64vEXT=_glGetQueryObjecti64vEXT;function _glGetQueryObjectivEXT(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}var n=GL.queries[e],a=GLctx.disjointTimerQueryExt.getQueryObjectEXT(n,t),o;typeof a=="boolean"?o=a?1:0:o=a,HEAP32[r>>>2>>>0]=o}_glGetQueryObjectivEXT.sig="viip";var _emscripten_glGetQueryObjectivEXT=_glGetQueryObjectivEXT,_glGetQueryObjectui64vEXT=_glGetQueryObjecti64vEXT,_emscripten_glGetQueryObjectui64vEXT=_glGetQueryObjectui64vEXT,_glGetQueryObjectuivEXT=_glGetQueryObjectivEXT,_emscripten_glGetQueryObjectuivEXT=_glGetQueryObjectuivEXT;function _glGetQueryivEXT(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.disjointTimerQueryExt.getQueryEXT(e,t)}_glGetQueryivEXT.sig="viip";var _emscripten_glGetQueryivEXT=_glGetQueryivEXT;function _glGetRenderbufferParameteriv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getRenderbufferParameter(e,t)}_glGetRenderbufferParameteriv.sig="viip";var _emscripten_glGetRenderbufferParameteriv=_glGetRenderbufferParameteriv;_emscripten_glGetRenderbufferParameteriv.sig="viip";function _glGetShaderInfoLog(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getShaderInfoLog(GL.shaders[e]);a===null&&(a="(unknown error)");var o=t>0&&n?stringToUTF8(a,n,t):0;r&&(HEAP32[r>>>2>>>0]=o)}_glGetShaderInfoLog.sig="viipp";var _emscripten_glGetShaderInfoLog=_glGetShaderInfoLog;_emscripten_glGetShaderInfoLog.sig="viipp";function _glGetShaderPrecisionFormat(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getShaderPrecisionFormat(e,t);HEAP32[r>>>2>>>0]=a.rangeMin,HEAP32[r+4>>>2>>>0]=a.rangeMax,HEAP32[n>>>2>>>0]=a.precision}_glGetShaderPrecisionFormat.sig="viipp";var _emscripten_glGetShaderPrecisionFormat=_glGetShaderPrecisionFormat;_emscripten_glGetShaderPrecisionFormat.sig="viipp";function _glGetShaderSource(e,t,r,n){r>>>=0,n>>>=0;var a=GLctx.getShaderSource(GL.shaders[e]);if(a){var o=t>0&&n?stringToUTF8(a,n,t):0;r&&(HEAP32[r>>>2>>>0]=o)}}_glGetShaderSource.sig="viipp";var _emscripten_glGetShaderSource=_glGetShaderSource;_emscripten_glGetShaderSource.sig="viipp";function _glGetShaderiv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}if(t==35716){var n=GLctx.getShaderInfoLog(GL.shaders[e]);n===null&&(n="(unknown error)");var a=n?n.length+1:0;HEAP32[r>>>2>>>0]=a}else if(t==35720){var o=GLctx.getShaderSource(GL.shaders[e]),l=o?o.length+1:0;HEAP32[r>>>2>>>0]=l}else HEAP32[r>>>2>>>0]=GLctx.getShaderParameter(GL.shaders[e],t)}_glGetShaderiv.sig="viip";var _emscripten_glGetShaderiv=_glGetShaderiv;_emscripten_glGetShaderiv.sig="viip";var webglGetExtensions=function e(){var t=getEmscriptenSupportedExtensions(GLctx);return t=t.concat(t.map(r=>"GL_"+r)),t};function _glGetString(e){var t=GL.stringCache[e];if(!t){switch(e){case 7939:t=stringToNewUTF8(webglGetExtensions().join(" "));break;case 7936:case 7937:case 37445:case 37446:var r=GLctx.getParameter(e);r||GL.recordError(1280),t=r?stringToNewUTF8(r):0;break;case 7938:var n=GLctx.getParameter(7938),a="OpenGL ES 2.0 (".concat(n,")");t=stringToNewUTF8(a);break;case 35724:var o=GLctx.getParameter(35724),l=/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/,u=o.match(l);u!==null&&(u[1].length==3&&(u[1]=u[1]+"0"),o="OpenGL ES GLSL ES ".concat(u[1]," (").concat(o,")")),t=stringToNewUTF8(o);break;default:GL.recordError(1280)}GL.stringCache[e]=t}return t}_glGetString.sig="pi";var _emscripten_glGetString=_glGetString;_emscripten_glGetString.sig="pi";function _glGetTexParameterfv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAPF32[r>>>2>>>0]=GLctx.getTexParameter(e,t)}_glGetTexParameterfv.sig="viip";var _emscripten_glGetTexParameterfv=_glGetTexParameterfv;_emscripten_glGetTexParameterfv.sig="viip";function _glGetTexParameteriv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getTexParameter(e,t)}_glGetTexParameteriv.sig="viip";var _emscripten_glGetTexParameteriv=_glGetTexParameteriv;_emscripten_glGetTexParameteriv.sig="viip";var webglGetLeftBracePos=e=>e.slice(-1)=="]"&&e.lastIndexOf("["),webglPrepareUniformLocationsBeforeFirstUse=e=>{var t=e.uniformLocsById,r=e.uniformSizeAndIdsByName,n,a;if(!t){e.uniformLocsById=t={},e.uniformArrayNamesById={};var o=GLctx.getProgramParameter(e,35718);for(n=0;n0?u.slice(0,d):u,f=e.uniformIdCounter;for(e.uniformIdCounter+=_,r[p]=[_,f],a=0;a<_;++a)t[f]=a,e.uniformArrayNamesById[f++]=p}}};function _glGetUniformLocation(e,t){if(t>>>=0,t=UTF8ToString(t),e=GL.programs[e]){webglPrepareUniformLocationsBeforeFirstUse(e);var r=e.uniformLocsById,n=0,a=t,o=webglGetLeftBracePos(t);o>0&&(n=jstoi_q(t.slice(o+1))>>>0,a=t.slice(0,o));var l=e.uniformSizeAndIdsByName[a];if(l&&n{var t=GLctx.currentProgram;if(t){var r=t.uniformLocsById[e];return typeof r=="number"&&(t.uniformLocsById[e]=r=GLctx.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"[".concat(r,"]"):""))),r}else GL.recordError(1282)},emscriptenWebGLGetUniform=(e,t,r,n)=>{if(!r){GL.recordError(1281);return}e=GL.programs[e],webglPrepareUniformLocationsBeforeFirstUse(e);var a=GLctx.getUniform(e,webglGetUniformLocation(t));if(typeof a=="number"||typeof a=="boolean")switch(n){case 0:HEAP32[r>>>2>>>0]=a;break;case 2:HEAPF32[r>>>2>>>0]=a;break}else for(var o=0;o>>2>>>0]=a[o];break;case 2:HEAPF32[r+o*4>>>2>>>0]=a[o];break}};function _glGetUniformfv(e,t,r){r>>>=0,emscriptenWebGLGetUniform(e,t,r,2)}_glGetUniformfv.sig="viip";var _emscripten_glGetUniformfv=_glGetUniformfv;_emscripten_glGetUniformfv.sig="viip";function _glGetUniformiv(e,t,r){r>>>=0,emscriptenWebGLGetUniform(e,t,r,0)}_glGetUniformiv.sig="viip";var _emscripten_glGetUniformiv=_glGetUniformiv;_emscripten_glGetUniformiv.sig="viip";function _glGetVertexAttribPointerv(e,t,r){if(r>>>=0,!r){GL.recordError(1281);return}HEAP32[r>>>2>>>0]=GLctx.getVertexAttribOffset(e,t)}_glGetVertexAttribPointerv.sig="viip";var _emscripten_glGetVertexAttribPointerv=_glGetVertexAttribPointerv;_emscripten_glGetVertexAttribPointerv.sig="viip";var emscriptenWebGLGetVertexAttrib=(e,t,r,n)=>{if(!r){GL.recordError(1281);return}var a=GLctx.getVertexAttrib(e,t);if(t==34975)HEAP32[r>>>2>>>0]=a&&a.name;else if(typeof a=="number"||typeof a=="boolean")switch(n){case 0:HEAP32[r>>>2>>>0]=a;break;case 2:HEAPF32[r>>>2>>>0]=a;break;case 5:HEAP32[r>>>2>>>0]=Math.fround(a);break}else for(var o=0;o>>2>>>0]=a[o];break;case 2:HEAPF32[r+o*4>>>2>>>0]=a[o];break;case 5:HEAP32[r+o*4>>>2>>>0]=Math.fround(a[o]);break}};function _glGetVertexAttribfv(e,t,r){r>>>=0,emscriptenWebGLGetVertexAttrib(e,t,r,2)}_glGetVertexAttribfv.sig="viip";var _emscripten_glGetVertexAttribfv=_glGetVertexAttribfv;_emscripten_glGetVertexAttribfv.sig="viip";function _glGetVertexAttribiv(e,t,r){r>>>=0,emscriptenWebGLGetVertexAttrib(e,t,r,5)}_glGetVertexAttribiv.sig="viip";var _emscripten_glGetVertexAttribiv=_glGetVertexAttribiv;_emscripten_glGetVertexAttribiv.sig="viip";var _glHint=(e,t)=>GLctx.hint(e,t);_glHint.sig="vii";var _emscripten_glHint=_glHint;_emscripten_glHint.sig="vii";var _glIsBuffer=e=>{var t=GL.buffers[e];return t?GLctx.isBuffer(t):0};_glIsBuffer.sig="ii";var _emscripten_glIsBuffer=_glIsBuffer;_emscripten_glIsBuffer.sig="ii";var _glIsEnabled=e=>GLctx.isEnabled(e);_glIsEnabled.sig="ii";var _emscripten_glIsEnabled=_glIsEnabled;_emscripten_glIsEnabled.sig="ii";var _glIsFramebuffer=e=>{var t=GL.framebuffers[e];return t?GLctx.isFramebuffer(t):0};_glIsFramebuffer.sig="ii";var _emscripten_glIsFramebuffer=_glIsFramebuffer;_emscripten_glIsFramebuffer.sig="ii";var _glIsProgram=e=>(e=GL.programs[e],e?GLctx.isProgram(e):0);_glIsProgram.sig="ii";var _emscripten_glIsProgram=_glIsProgram;_emscripten_glIsProgram.sig="ii";var _glIsQueryEXT=e=>{var t=GL.queries[e];return t?GLctx.disjointTimerQueryExt.isQueryEXT(t):0};_glIsQueryEXT.sig="ii";var _emscripten_glIsQueryEXT=_glIsQueryEXT,_glIsRenderbuffer=e=>{var t=GL.renderbuffers[e];return t?GLctx.isRenderbuffer(t):0};_glIsRenderbuffer.sig="ii";var _emscripten_glIsRenderbuffer=_glIsRenderbuffer;_emscripten_glIsRenderbuffer.sig="ii";var _glIsShader=e=>{var t=GL.shaders[e];return t?GLctx.isShader(t):0};_glIsShader.sig="ii";var _emscripten_glIsShader=_glIsShader;_emscripten_glIsShader.sig="ii";var _glIsTexture=e=>{var t=GL.textures[e];return t?GLctx.isTexture(t):0};_glIsTexture.sig="ii";var _emscripten_glIsTexture=_glIsTexture;_emscripten_glIsTexture.sig="ii";var _glIsVertexArray=e=>{var t=GL.vaos[e];return t?GLctx.isVertexArray(t):0};_glIsVertexArray.sig="ii";var _glIsVertexArrayOES=_glIsVertexArray;_glIsVertexArrayOES.sig="ii";var _emscripten_glIsVertexArrayOES=_glIsVertexArrayOES;_emscripten_glIsVertexArrayOES.sig="ii";var _glLineWidth=e=>GLctx.lineWidth(e);_glLineWidth.sig="vf";var _emscripten_glLineWidth=_glLineWidth;_emscripten_glLineWidth.sig="vf";var _glLinkProgram=e=>{e=GL.programs[e],GLctx.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}};_glLinkProgram.sig="vi";var _emscripten_glLinkProgram=_glLinkProgram;_emscripten_glLinkProgram.sig="vi";var _glPixelStorei=(e,t)=>{e==3317?GL.unpackAlignment=t:e==3314&&(GL.unpackRowLength=t),GLctx.pixelStorei(e,t)};_glPixelStorei.sig="vii";var _emscripten_glPixelStorei=_glPixelStorei;_emscripten_glPixelStorei.sig="vii";var _glPolygonModeWEBGL=(e,t)=>{GLctx.webglPolygonMode.polygonModeWEBGL(e,t)};_glPolygonModeWEBGL.sig="vii";var _emscripten_glPolygonModeWEBGL=_glPolygonModeWEBGL,_glPolygonOffset=(e,t)=>GLctx.polygonOffset(e,t);_glPolygonOffset.sig="vff";var _emscripten_glPolygonOffset=_glPolygonOffset;_emscripten_glPolygonOffset.sig="vff";var _glPolygonOffsetClampEXT=(e,t,r)=>{GLctx.extPolygonOffsetClamp.polygonOffsetClampEXT(e,t,r)};_glPolygonOffsetClampEXT.sig="vfff";var _emscripten_glPolygonOffsetClampEXT=_glPolygonOffsetClampEXT,_glQueryCounterEXT=(e,t)=>{GLctx.disjointTimerQueryExt.queryCounterEXT(GL.queries[e],t)};_glQueryCounterEXT.sig="vii";var _emscripten_glQueryCounterEXT=_glQueryCounterEXT,computeUnpackAlignedImageSize=(e,t,r)=>{function n(l,u){return l+u-1&-u}var a=(GL.unpackRowLength||e)*r,o=n(a,GL.unpackAlignment);return t*o},colorChannelsInGlTextureFormat=e=>{var t={5:3,6:4,8:2,29502:3,29504:4};return t[e-6402]||1},heapObjectForWebGLType=e=>(e-=5120,e==1?HEAPU8:e==4?HEAP32:e==6?HEAPF32:e==5||e==28922?HEAPU32:HEAPU16),toTypedArrayIndex=(e,t)=>e>>>31-Math.clz32(t.BYTES_PER_ELEMENT),emscriptenWebGLGetTexPixelData=(e,t,r,n,a,o)=>{var l=heapObjectForWebGLType(e),u=colorChannelsInGlTextureFormat(t)*l.BYTES_PER_ELEMENT,_=computeUnpackAlignedImageSize(r,n,u);return l.subarray(toTypedArrayIndex(a,l)>>>0,toTypedArrayIndex(a+_,l)>>>0)};function _glReadPixels(e,t,r,n,a,o,l){l>>>=0;var u=emscriptenWebGLGetTexPixelData(o,a,r,n,l);if(!u){GL.recordError(1280);return}GLctx.readPixels(e,t,r,n,a,o,u)}_glReadPixels.sig="viiiiiip";var _emscripten_glReadPixels=_glReadPixels;_emscripten_glReadPixels.sig="viiiiiip";var _glReleaseShaderCompiler=()=>{};_glReleaseShaderCompiler.sig="v";var _emscripten_glReleaseShaderCompiler=_glReleaseShaderCompiler;_emscripten_glReleaseShaderCompiler.sig="v";var _glRenderbufferStorage=(e,t,r,n)=>GLctx.renderbufferStorage(e,t,r,n);_glRenderbufferStorage.sig="viiii";var _emscripten_glRenderbufferStorage=_glRenderbufferStorage;_emscripten_glRenderbufferStorage.sig="viiii";var _glSampleCoverage=(e,t)=>{GLctx.sampleCoverage(e,!!t)};_glSampleCoverage.sig="vfi";var _emscripten_glSampleCoverage=_glSampleCoverage;_emscripten_glSampleCoverage.sig="vfi";var _glScissor=(e,t,r,n)=>GLctx.scissor(e,t,r,n);_glScissor.sig="viiii";var _emscripten_glScissor=_glScissor;_emscripten_glScissor.sig="viiii";function _glShaderBinary(e,t,r,n,a){GL.recordError(1280)}_glShaderBinary.sig="vipipi";var _emscripten_glShaderBinary=_glShaderBinary;_emscripten_glShaderBinary.sig="vipipi";function _glShaderSource(e,t,r,n){r>>>=0,n>>>=0;var a=GL.getSource(e,t,r,n);GLctx.shaderSource(GL.shaders[e],a)}_glShaderSource.sig="viipp";var _emscripten_glShaderSource=_glShaderSource;_emscripten_glShaderSource.sig="viipp";var _glStencilFunc=(e,t,r)=>GLctx.stencilFunc(e,t,r);_glStencilFunc.sig="viii";var _emscripten_glStencilFunc=_glStencilFunc;_emscripten_glStencilFunc.sig="viii";var _glStencilFuncSeparate=(e,t,r,n)=>GLctx.stencilFuncSeparate(e,t,r,n);_glStencilFuncSeparate.sig="viiii";var _emscripten_glStencilFuncSeparate=_glStencilFuncSeparate;_emscripten_glStencilFuncSeparate.sig="viiii";var _glStencilMask=e=>GLctx.stencilMask(e);_glStencilMask.sig="vi";var _emscripten_glStencilMask=_glStencilMask;_emscripten_glStencilMask.sig="vi";var _glStencilMaskSeparate=(e,t)=>GLctx.stencilMaskSeparate(e,t);_glStencilMaskSeparate.sig="vii";var _emscripten_glStencilMaskSeparate=_glStencilMaskSeparate;_emscripten_glStencilMaskSeparate.sig="vii";var _glStencilOp=(e,t,r)=>GLctx.stencilOp(e,t,r);_glStencilOp.sig="viii";var _emscripten_glStencilOp=_glStencilOp;_emscripten_glStencilOp.sig="viii";var _glStencilOpSeparate=(e,t,r,n)=>GLctx.stencilOpSeparate(e,t,r,n);_glStencilOpSeparate.sig="viiii";var _emscripten_glStencilOpSeparate=_glStencilOpSeparate;_emscripten_glStencilOpSeparate.sig="viiii";function _glTexImage2D(e,t,r,n,a,o,l,u,_){_>>>=0;var d=_?emscriptenWebGLGetTexPixelData(u,l,n,a,_):null;GLctx.texImage2D(e,t,r,n,a,o,l,u,d)}_glTexImage2D.sig="viiiiiiiip";var _emscripten_glTexImage2D=_glTexImage2D;_emscripten_glTexImage2D.sig="viiiiiiiip";var _glTexParameterf=(e,t,r)=>GLctx.texParameterf(e,t,r);_glTexParameterf.sig="viif";var _emscripten_glTexParameterf=_glTexParameterf;_emscripten_glTexParameterf.sig="viif";function _glTexParameterfv(e,t,r){r>>>=0;var n=HEAPF32[r>>>2>>>0];GLctx.texParameterf(e,t,n)}_glTexParameterfv.sig="viip";var _emscripten_glTexParameterfv=_glTexParameterfv;_emscripten_glTexParameterfv.sig="viip";var _glTexParameteri=(e,t,r)=>GLctx.texParameteri(e,t,r);_glTexParameteri.sig="viii";var _emscripten_glTexParameteri=_glTexParameteri;_emscripten_glTexParameteri.sig="viii";function _glTexParameteriv(e,t,r){r>>>=0;var n=HEAP32[r>>>2>>>0];GLctx.texParameteri(e,t,n)}_glTexParameteriv.sig="viip";var _emscripten_glTexParameteriv=_glTexParameteriv;_emscripten_glTexParameteriv.sig="viip";function _glTexSubImage2D(e,t,r,n,a,o,l,u,_){_>>>=0;var d=_?emscriptenWebGLGetTexPixelData(u,l,a,o,_):null;GLctx.texSubImage2D(e,t,r,n,a,o,l,u,d)}_glTexSubImage2D.sig="viiiiiiiip";var _emscripten_glTexSubImage2D=_glTexSubImage2D;_emscripten_glTexSubImage2D.sig="viiiiiiiip";var _glUniform1f=(e,t)=>{GLctx.uniform1f(webglGetUniformLocation(e),t)};_glUniform1f.sig="vif";var _emscripten_glUniform1f=_glUniform1f;_emscripten_glUniform1f.sig="vif";var miniTempWebGLFloatBuffers=[];function _glUniform1fv(e,t,r){if(r>>>=0,t<=288)for(var a=miniTempWebGLFloatBuffers[t],n=0;n>>2>>>0];else var a=HEAPF32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1fv(webglGetUniformLocation(e),a)}_glUniform1fv.sig="viip";var _emscripten_glUniform1fv=_glUniform1fv;_emscripten_glUniform1fv.sig="viip";var _glUniform1i=(e,t)=>{GLctx.uniform1i(webglGetUniformLocation(e),t)};_glUniform1i.sig="vii";var _emscripten_glUniform1i=_glUniform1i;_emscripten_glUniform1i.sig="vii";var miniTempWebGLIntBuffers=[];function _glUniform1iv(e,t,r){if(r>>>=0,t<=288)for(var a=miniTempWebGLIntBuffers[t],n=0;n>>2>>>0];else var a=HEAP32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1iv(webglGetUniformLocation(e),a)}_glUniform1iv.sig="viip";var _emscripten_glUniform1iv=_glUniform1iv;_emscripten_glUniform1iv.sig="viip";var _glUniform2f=(e,t,r)=>{GLctx.uniform2f(webglGetUniformLocation(e),t,r)};_glUniform2f.sig="viff";var _emscripten_glUniform2f=_glUniform2f;_emscripten_glUniform2f.sig="viff";function _glUniform2fv(e,t,r){if(r>>>=0,t<=144){t*=2;for(var a=miniTempWebGLFloatBuffers[t],n=0;n>>2>>>0],a[n+1]=HEAPF32[r+(4*n+4)>>>2>>>0]}else var a=HEAPF32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2fv(webglGetUniformLocation(e),a)}_glUniform2fv.sig="viip";var _emscripten_glUniform2fv=_glUniform2fv;_emscripten_glUniform2fv.sig="viip";var _glUniform2i=(e,t,r)=>{GLctx.uniform2i(webglGetUniformLocation(e),t,r)};_glUniform2i.sig="viii";var _emscripten_glUniform2i=_glUniform2i;_emscripten_glUniform2i.sig="viii";function _glUniform2iv(e,t,r){if(r>>>=0,t<=144){t*=2;for(var a=miniTempWebGLIntBuffers[t],n=0;n>>2>>>0],a[n+1]=HEAP32[r+(4*n+4)>>>2>>>0]}else var a=HEAP32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2iv(webglGetUniformLocation(e),a)}_glUniform2iv.sig="viip";var _emscripten_glUniform2iv=_glUniform2iv;_emscripten_glUniform2iv.sig="viip";var _glUniform3f=(e,t,r,n)=>{GLctx.uniform3f(webglGetUniformLocation(e),t,r,n)};_glUniform3f.sig="vifff";var _emscripten_glUniform3f=_glUniform3f;_emscripten_glUniform3f.sig="vifff";function _glUniform3fv(e,t,r){if(r>>>=0,t<=96){t*=3;for(var a=miniTempWebGLFloatBuffers[t],n=0;n>>2>>>0],a[n+1]=HEAPF32[r+(4*n+4)>>>2>>>0],a[n+2]=HEAPF32[r+(4*n+8)>>>2>>>0]}else var a=HEAPF32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3fv(webglGetUniformLocation(e),a)}_glUniform3fv.sig="viip";var _emscripten_glUniform3fv=_glUniform3fv;_emscripten_glUniform3fv.sig="viip";var _glUniform3i=(e,t,r,n)=>{GLctx.uniform3i(webglGetUniformLocation(e),t,r,n)};_glUniform3i.sig="viiii";var _emscripten_glUniform3i=_glUniform3i;_emscripten_glUniform3i.sig="viiii";function _glUniform3iv(e,t,r){if(r>>>=0,t<=96){t*=3;for(var a=miniTempWebGLIntBuffers[t],n=0;n>>2>>>0],a[n+1]=HEAP32[r+(4*n+4)>>>2>>>0],a[n+2]=HEAP32[r+(4*n+8)>>>2>>>0]}else var a=HEAP32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3iv(webglGetUniformLocation(e),a)}_glUniform3iv.sig="viip";var _emscripten_glUniform3iv=_glUniform3iv;_emscripten_glUniform3iv.sig="viip";var _glUniform4f=(e,t,r,n,a)=>{GLctx.uniform4f(webglGetUniformLocation(e),t,r,n,a)};_glUniform4f.sig="viffff";var _emscripten_glUniform4f=_glUniform4f;_emscripten_glUniform4f.sig="viffff";function _glUniform4fv(e,t,r){if(r>>>=0,t<=72){var l=miniTempWebGLFloatBuffers[4*t],n=HEAPF32;r=r>>>2,t*=4;for(var a=0;a>>0],l[a+1]=n[o+1>>>0],l[a+2]=n[o+2>>>0],l[a+3]=n[o+3>>>0]}}else var l=HEAPF32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4fv(webglGetUniformLocation(e),l)}_glUniform4fv.sig="viip";var _emscripten_glUniform4fv=_glUniform4fv;_emscripten_glUniform4fv.sig="viip";var _glUniform4i=(e,t,r,n,a)=>{GLctx.uniform4i(webglGetUniformLocation(e),t,r,n,a)};_glUniform4i.sig="viiiii";var _emscripten_glUniform4i=_glUniform4i;_emscripten_glUniform4i.sig="viiiii";function _glUniform4iv(e,t,r){if(r>>>=0,t<=72){t*=4;for(var a=miniTempWebGLIntBuffers[t],n=0;n>>2>>>0],a[n+1]=HEAP32[r+(4*n+4)>>>2>>>0],a[n+2]=HEAP32[r+(4*n+8)>>>2>>>0],a[n+3]=HEAP32[r+(4*n+12)>>>2>>>0]}else var a=HEAP32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4iv(webglGetUniformLocation(e),a)}_glUniform4iv.sig="viip";var _emscripten_glUniform4iv=_glUniform4iv;_emscripten_glUniform4iv.sig="viip";function _glUniformMatrix2fv(e,t,r,n){if(n>>>=0,t<=72){t*=4;for(var o=miniTempWebGLFloatBuffers[t],a=0;a>>2>>>0],o[a+1]=HEAPF32[n+(4*a+4)>>>2>>>0],o[a+2]=HEAPF32[n+(4*a+8)>>>2>>>0],o[a+3]=HEAPF32[n+(4*a+12)>>>2>>>0]}else var o=HEAPF32.subarray(n>>>2>>>0,n+t*16>>>2>>>0);GLctx.uniformMatrix2fv(webglGetUniformLocation(e),!!r,o)}_glUniformMatrix2fv.sig="viiip";var _emscripten_glUniformMatrix2fv=_glUniformMatrix2fv;_emscripten_glUniformMatrix2fv.sig="viiip";function _glUniformMatrix3fv(e,t,r,n){if(n>>>=0,t<=32){t*=9;for(var o=miniTempWebGLFloatBuffers[t],a=0;a>>2>>>0],o[a+1]=HEAPF32[n+(4*a+4)>>>2>>>0],o[a+2]=HEAPF32[n+(4*a+8)>>>2>>>0],o[a+3]=HEAPF32[n+(4*a+12)>>>2>>>0],o[a+4]=HEAPF32[n+(4*a+16)>>>2>>>0],o[a+5]=HEAPF32[n+(4*a+20)>>>2>>>0],o[a+6]=HEAPF32[n+(4*a+24)>>>2>>>0],o[a+7]=HEAPF32[n+(4*a+28)>>>2>>>0],o[a+8]=HEAPF32[n+(4*a+32)>>>2>>>0]}else var o=HEAPF32.subarray(n>>>2>>>0,n+t*36>>>2>>>0);GLctx.uniformMatrix3fv(webglGetUniformLocation(e),!!r,o)}_glUniformMatrix3fv.sig="viiip";var _emscripten_glUniformMatrix3fv=_glUniformMatrix3fv;_emscripten_glUniformMatrix3fv.sig="viiip";function _glUniformMatrix4fv(e,t,r,n){if(n>>>=0,t<=18){var u=miniTempWebGLFloatBuffers[16*t],a=HEAPF32;n=n>>>2,t*=16;for(var o=0;o>>0],u[o+1]=a[l+1>>>0],u[o+2]=a[l+2>>>0],u[o+3]=a[l+3>>>0],u[o+4]=a[l+4>>>0],u[o+5]=a[l+5>>>0],u[o+6]=a[l+6>>>0],u[o+7]=a[l+7>>>0],u[o+8]=a[l+8>>>0],u[o+9]=a[l+9>>>0],u[o+10]=a[l+10>>>0],u[o+11]=a[l+11>>>0],u[o+12]=a[l+12>>>0],u[o+13]=a[l+13>>>0],u[o+14]=a[l+14>>>0],u[o+15]=a[l+15>>>0]}}else var u=HEAPF32.subarray(n>>>2>>>0,n+t*64>>>2>>>0);GLctx.uniformMatrix4fv(webglGetUniformLocation(e),!!r,u)}_glUniformMatrix4fv.sig="viiip";var _emscripten_glUniformMatrix4fv=_glUniformMatrix4fv;_emscripten_glUniformMatrix4fv.sig="viiip";var _glUseProgram=e=>{e=GL.programs[e],GLctx.useProgram(e),GLctx.currentProgram=e};_glUseProgram.sig="vi";var _emscripten_glUseProgram=_glUseProgram;_emscripten_glUseProgram.sig="vi";var _glValidateProgram=e=>{GLctx.validateProgram(GL.programs[e])};_glValidateProgram.sig="vi";var _emscripten_glValidateProgram=_glValidateProgram;_emscripten_glValidateProgram.sig="vi";var _glVertexAttrib1f=(e,t)=>GLctx.vertexAttrib1f(e,t);_glVertexAttrib1f.sig="vif";var _emscripten_glVertexAttrib1f=_glVertexAttrib1f;_emscripten_glVertexAttrib1f.sig="vif";function _glVertexAttrib1fv(e,t){t>>>=0,GLctx.vertexAttrib1f(e,HEAPF32[t>>>2])}_glVertexAttrib1fv.sig="vip";var _emscripten_glVertexAttrib1fv=_glVertexAttrib1fv;_emscripten_glVertexAttrib1fv.sig="vip";var _glVertexAttrib2f=(e,t,r)=>GLctx.vertexAttrib2f(e,t,r);_glVertexAttrib2f.sig="viff";var _emscripten_glVertexAttrib2f=_glVertexAttrib2f;_emscripten_glVertexAttrib2f.sig="viff";function _glVertexAttrib2fv(e,t){t>>>=0,GLctx.vertexAttrib2f(e,HEAPF32[t>>>2],HEAPF32[t+4>>>2])}_glVertexAttrib2fv.sig="vip";var _emscripten_glVertexAttrib2fv=_glVertexAttrib2fv;_emscripten_glVertexAttrib2fv.sig="vip";var _glVertexAttrib3f=(e,t,r,n)=>GLctx.vertexAttrib3f(e,t,r,n);_glVertexAttrib3f.sig="vifff";var _emscripten_glVertexAttrib3f=_glVertexAttrib3f;_emscripten_glVertexAttrib3f.sig="vifff";function _glVertexAttrib3fv(e,t){t>>>=0,GLctx.vertexAttrib3f(e,HEAPF32[t>>>2],HEAPF32[t+4>>>2],HEAPF32[t+8>>>2])}_glVertexAttrib3fv.sig="vip";var _emscripten_glVertexAttrib3fv=_glVertexAttrib3fv;_emscripten_glVertexAttrib3fv.sig="vip";var _glVertexAttrib4f=(e,t,r,n,a)=>GLctx.vertexAttrib4f(e,t,r,n,a);_glVertexAttrib4f.sig="viffff";var _emscripten_glVertexAttrib4f=_glVertexAttrib4f;_emscripten_glVertexAttrib4f.sig="viffff";function _glVertexAttrib4fv(e,t){t>>>=0,GLctx.vertexAttrib4f(e,HEAPF32[t>>>2],HEAPF32[t+4>>>2],HEAPF32[t+8>>>2],HEAPF32[t+12>>>2])}_glVertexAttrib4fv.sig="vip";var _emscripten_glVertexAttrib4fv=_glVertexAttrib4fv;_emscripten_glVertexAttrib4fv.sig="vip";var _glVertexAttribDivisor=(e,t)=>{GLctx.vertexAttribDivisor(e,t)};_glVertexAttribDivisor.sig="vii";var _glVertexAttribDivisorANGLE=_glVertexAttribDivisor,_emscripten_glVertexAttribDivisorANGLE=_glVertexAttribDivisorANGLE;function _glVertexAttribPointer(e,t,r,n,a,o){o>>>=0,GLctx.vertexAttribPointer(e,t,r,!!n,a,o)}_glVertexAttribPointer.sig="viiiiip";var _emscripten_glVertexAttribPointer=_glVertexAttribPointer;_emscripten_glVertexAttribPointer.sig="viiiiip";var _glViewport=(e,t,r,n)=>GLctx.viewport(e,t,r,n);_glViewport.sig="viiii";var _emscripten_glViewport=_glViewport;_emscripten_glViewport.sig="viiii";function _emscripten_out(e){return e>>>=0,out(UTF8ToString(e))}_emscripten_out.sig="vp";class HandleAllocator{constructor(){this.allocated=[void 0],this.freelist=[]}get(t){return this.allocated[t]}has(t){return this.allocated[t]!==void 0}allocate(t){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=t,r}free(t){this.allocated[t]=void 0,this.freelist.push(t)}}var promiseMap=new HandleAllocator,makePromise=()=>{var e={};return e.promise=new Promise((t,r)=>{e.reject=r,e.resolve=t}),e.id=promiseMap.allocate(e),e};function _emscripten_promise_create(){return makePromise().id}_emscripten_promise_create.sig="p";function _emscripten_promise_destroy(e){e>>>=0,promiseMap.free(e)}_emscripten_promise_destroy.sig="vp";var getPromise=e=>promiseMap.get(e).promise;function _emscripten_promise_resolve(e,t,r){e>>>=0,r>>>=0;var n=promiseMap.get(e);switch(t){case 0:n.resolve(r);return;case 1:n.resolve(getPromise(r));return;case 2:n.resolve(getPromise(r)),_emscripten_promise_destroy(r);return;case 3:n.reject(r);return}}_emscripten_promise_resolve.sig="vpip";var growMemory=e=>{var t=wasmMemory.buffer,r=(e-t.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}};function _emscripten_resize_heap(e){e>>>=0;var t=HEAPU8.length,r=getHeapMax();if(e>r)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,a),65536)),l=growMemory(o);if(l)return!0}return!1}_emscripten_resize_heap.sig="ip";function _emscripten_wget_data(e,t,r,n){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_wget_data"}_emscripten_wget_data.sig="vpppp";var getEnvStrings=()=>{if(!getEnvStrings.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:getExecutableName()};for(var r in ENV)ENV[r]===void 0?delete t[r]:t[r]=ENV[r];var n=[];for(var r in t)n.push("".concat(r,"=").concat(t[r]));getEnvStrings.strings=n}return getEnvStrings.strings},stringToAscii=(e,t)=>{for(var r=0;r>>0]=e.charCodeAt(r);HEAP8[t>>>0]=0},_environ_get=function(e,t){e>>>=0,t>>>=0;var r=0;return getEnvStrings().forEach((n,a)=>{var o=t+r;HEAPU32[e+a*4>>>2>>>0]=o,stringToAscii(n,o),r+=n.length+1}),0};_environ_get.sig="ipp";var _environ_sizes_get=function(e,t){e>>>=0,t>>>=0;var r=getEnvStrings();HEAPU32[e>>>2>>>0]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),HEAPU32[t>>>2>>>0]=n,0};_environ_sizes_get.sig="ipp";function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.close(t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return r.errno}}_fd_close.sig="ii";function _fd_fdstat_get(e,t){t>>>=0;try{var r=0,n=0,a=0,o=SYSCALLS.getStreamFromFD(e),l=o.tty?2:FS.isDir(o.mode)?3:FS.isLink(o.mode)?7:4;return HEAP8[t>>>0]=l,HEAP16[t+2>>>1>>>0]=a,tempI64=[r>>>0,(tempDouble=r,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+8>>>2>>>0]=tempI64[0],HEAP32[t+12>>>2>>>0]=tempI64[1],tempI64=[n>>>0,(tempDouble=n,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+16>>>2>>>0]=tempI64[0],HEAP32[t+20>>>2>>>0]=tempI64[1],0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return u.errno}}_fd_fdstat_get.sig="iip";var doReadv=(e,t,r,n)=>{for(var a=0,o=0;o>>2>>>0],u=HEAPU32[t+4>>>2>>>0];t+=8;var _=FS.read(e,HEAP8,l,u,n);if(_<0)return-1;if(a+=_,_>>=0,r>>>=0;var l=convertI32PairToI53Checked(n,a);o>>>=0;try{if(isNaN(l))return 61;var u=SYSCALLS.getStreamFromFD(e),_=doReadv(u,t,r,l);return HEAPU32[o>>>2>>>0]=_,0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return d.errno}}_fd_pread.sig="iippiip";var doWritev=(e,t,r,n)=>{for(var a=0,o=0;o>>2>>>0],u=HEAPU32[t+4>>>2>>>0];t+=8;var _=FS.write(e,HEAP8,l,u,n);if(_<0)return-1;if(a+=_,_>>=0,r>>>=0;var l=convertI32PairToI53Checked(n,a);o>>>=0;try{if(isNaN(l))return 61;var u=SYSCALLS.getStreamFromFD(e),_=doWritev(u,t,r,l);return HEAPU32[o>>>2>>>0]=_,0}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return d.errno}}_fd_pwrite.sig="iippiip";function _fd_read(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;try{var a=SYSCALLS.getStreamFromFD(e),o=doReadv(a,t,r);return HEAPU32[n>>>2>>>0]=o,0}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return l.errno}}_fd_read.sig="iippp";function _fd_seek(e,t,r,n,a){var o=convertI32PairToI53Checked(t,r);a>>>=0;try{if(isNaN(o))return 61;var l=SYSCALLS.getStreamFromFD(e);return FS.llseek(l,o,n),tempI64=[l.position>>>0,(tempDouble=l.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[a>>>2>>>0]=tempI64[0],HEAP32[a+4>>>2>>>0]=tempI64[1],l.getdents&&o===0&&n===0&&(l.getdents=null),0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return u.errno}}_fd_seek.sig="iiiiip";function _fd_sync(e){var t;try{var r=SYSCALLS.getStreamFromFD(e);return(t=r.stream_ops)!=null&&t.fsync?r.stream_ops.fsync(r):0}catch(n){if(typeof FS>"u"||n.name!=="ErrnoError")throw n;return n.errno}}_fd_sync.sig="ii";function _fd_write(e,t,r,n){t>>>=0,r>>>=0,n>>>=0;try{var a=SYSCALLS.getStreamFromFD(e),o=doWritev(a,t,r);return HEAPU32[n>>>2>>>0]=o,0}catch(l){if(typeof FS>"u"||l.name!=="ErrnoError")throw l;return l.errno}}_fd_write.sig="iippp";function _getaddrinfo(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=0,o=0,l=0,u=0,_=0,d=0,p;function f(m,h,g,b,v,S){var L,T,A,M;return T=m===10?28:16,v=m===10?inetNtop6(v):inetNtop4(v),L=_malloc(T),M=writeSockaddr(L,m,v,S),assert(!M),A=_malloc(32),HEAP32[A+4>>>2>>>0]=m,HEAP32[A+8>>>2>>>0]=h,HEAP32[A+12>>>2>>>0]=g,HEAPU32[A+24>>>2>>>0]=b,HEAPU32[A+20>>>2>>>0]=L,m===10?HEAP32[A+16>>>2>>>0]=28:HEAP32[A+16>>>2>>>0]=16,HEAP32[A+28>>>2>>>0]=0,A}if(r&&(l=HEAP32[r>>>2>>>0],u=HEAP32[r+4>>>2>>>0],_=HEAP32[r+8>>>2>>>0],d=HEAP32[r+12>>>2>>>0]),_&&!d&&(d=_===2?17:6),!_&&d&&(_=d===17?2:1),d===0&&(d=6),_===0&&(_=1),!e&&!t)return-2;if(l&-1088||r!==0&&HEAP32[r>>>2>>>0]&2&&!e)return-1;if(l&32)return-2;if(_!==0&&_!==1&&_!==2)return-7;if(u!==0&&u!==2&&u!==10)return-6;if(t&&(t=UTF8ToString(t),o=parseInt(t,10),isNaN(o)))return l&1024?-2:-8;if(!e)return u===0&&(u=2),l&1||(u===2?a=_htonl(2130706433):a=[0,0,0,1]),p=f(u,_,d,null,a,o),HEAPU32[n>>>2>>>0]=p,0;if(e=UTF8ToString(e),a=inetPton4(e),a!==null)if(u===0||u===2)u=2;else if(u===10&&l&8)a=[0,0,_htonl(65535),a],u=10;else return-2;else if(a=inetPton6(e),a!==null)if(u===0||u===10)u=10;else return-2;return a!=null?(p=f(u,_,d,e,a,o),HEAPU32[n>>>2>>>0]=p,0):l&4?-2:(e=DNS.lookup_name(e),a=inetPton4(e),u===0?u=2:u===10&&(a=[0,0,_htonl(65535),a]),p=f(u,_,d,null,a,o),HEAPU32[n>>>2>>>0]=p,0)}_getaddrinfo.sig="ipppp";function _getentropy(e,t){return e>>>=0,t>>>=0,randomFill(HEAPU8.subarray(e>>>0,e+t>>>0)),0}_getentropy.sig="ipp";function _getnameinfo(e,t,r,n,a,o,l){e>>>=0,r>>>=0,a>>>=0;var u=readSockaddr(e,t);if(u.errno)return-6;var _=u.port,d=u.addr,p=!1;if(r&&n){var f;if(l&1||!(f=DNS.lookup_addr(d))){if(l&8)return-2}else d=f;var m=stringToUTF8(d,r,n);m+1>=n&&(p=!0)}if(a&&o){_=""+_;var m=stringToUTF8(_,a,o);m+1>=o&&(p=!0)}return p?-12:0}_getnameinfo.sig="ipipipii";function _llvm_eh_typeid_for(e){return e>>>=0,e}_llvm_eh_typeid_for.sig="vp";function _pthread_kill(...e){return wasmImports.pthread_kill(...e)}_pthread_kill.stub=!0;var arraySum=(e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r},MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31],addDays=(e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=isLeapYear(r.getFullYear()),a=r.getMonth(),o=(n?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[a];if(t>o-r.getDate())t-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+t),r}return r};function _strptime(e,t,r){e>>>=0,t>>>=0,r>>>=0;for(var n=UTF8ToString(t),a="\\!@#$^&*()+=-[]/{}|:<>?,.",o=0,l=a.length;ou[Q]||I).replace(/%(.)/g,(I,Q)=>{let oe=_[Q];return oe?(m.push(Q),"(".concat(oe,")")):Q}).replace(/\s+/g,"\\s*"),g=new RegExp("^"+h,"i").exec(UTF8ToString(e));function b(){function I(Q,oe,we){return typeof Q!="number"||isNaN(Q)?oe:Q>=oe?Q<=we?Q:we:oe}return{year:I(HEAP32[r+20>>>2>>>0]+1900,1970,9999),month:I(HEAP32[r+16>>>2>>>0],0,11),day:I(HEAP32[r+12>>>2>>>0],1,31),hour:I(HEAP32[r+8>>>2>>>0],0,23),min:I(HEAP32[r+4>>>2>>>0],0,59),sec:I(HEAP32[r>>>2>>>0],0,59),gmtoff:0}}if(g){var v=b(),S,L=I=>{var Q=m.indexOf(I);if(Q>=0)return g[Q+1]};if((S=L("S"))&&(v.sec=jstoi_q(S)),(S=L("M"))&&(v.min=jstoi_q(S)),S=L("H"))v.hour=jstoi_q(S);else if(S=L("I")){var T=jstoi_q(S);(S=L("p"))&&(T+=S.toUpperCase()[0]==="P"?12:0),v.hour=T}if(S=L("Y"))v.year=jstoi_q(S);else if(S=L("y")){var A=jstoi_q(S);(S=L("C"))?A+=jstoi_q(S)*100:A+=A<69?2e3:1900,v.year=A}if((S=L("m"))?v.month=jstoi_q(S)-1:(S=L("b"))&&(v.month=d[S.substring(0,3).toUpperCase()]||0),S=L("d"))v.day=jstoi_q(S);else if(S=L("j"))for(var M=jstoi_q(S),X=isLeapYear(v.year),x=0;x<12;++x){var w=arraySum(X?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,x-1);M<=w+(X?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[x]&&(v.day=M-w)}else if(S=L("a")){var E=S.substring(0,3).toUpperCase();if(S=L("U")){var P=p[E],k=jstoi_q(S),C=new Date(v.year,0,1),F;C.getDay()===0?F=addDays(C,P+7*(k-1)):F=addDays(C,7-C.getDay()+P+7*(k-1)),v.day=F.getDate(),v.month=F.getMonth()}else if(S=L("W")){var P=f[E],k=jstoi_q(S),C=new Date(v.year,0,1),F;C.getDay()===1?F=addDays(C,P+7*(k-1)):F=addDays(C,7-C.getDay()+1+P+7*(k-1)),v.day=F.getDate(),v.month=F.getMonth()}}if(S=L("z"))if(S.toLowerCase()==="z")v.gmtoff=0;else{var U=S.match(/^((?:\-|\+)\d\d):?(\d\d)?/);v.gmtoff=U[1]*3600,U[2]&&(v.gmtoff+=v.gmtoff>0?U[2]*60:-U[2]*60)}var D=new Date(v.year,v.month,v.day,v.hour,v.min,v.sec,0);return HEAP32[r>>>2>>>0]=D.getSeconds(),HEAP32[r+4>>>2>>>0]=D.getMinutes(),HEAP32[r+8>>>2>>>0]=D.getHours(),HEAP32[r+12>>>2>>>0]=D.getDate(),HEAP32[r+16>>>2>>>0]=D.getMonth(),HEAP32[r+20>>>2>>>0]=D.getFullYear()-1900,HEAP32[r+24>>>2>>>0]=D.getDay(),HEAP32[r+28>>>2>>>0]=arraySum(isLeapYear(D.getFullYear())?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,D.getMonth()-1)+D.getDate()-1,HEAP32[r+32>>>2>>>0]=0,HEAP32[r+36>>>2>>>0]=v.gmtoff,e+intArrayFromString(g[0]).length-1}return 0}_strptime.sig="pppp";var getCFunc=e=>{var t=Module["_"+e];return t},writeArrayToMemory=(e,t)=>{HEAP8.set(e,t>>>0)},ccall=(e,t,r,n,a)=>{var o={string:g=>{var b=0;return g!=null&&g!==0&&(b=stringToUTF8OnStack(g)),b},array:g=>{var b=stackAlloc(g.length);return writeArrayToMemory(g,b),b}};function l(g){return t==="string"?UTF8ToString(g):t==="boolean"?!!g:g}var u=getCFunc(e),_=[],d=0;if(n)for(var p=0;p(e>>>0)+t*4294967296,convertU32PairToI53=(e,t)=>(e>>>0)+(t>>>0)*4294967296,getTempRet0=e=>__emscripten_tempret_get(),_stackAlloc=stackAlloc,_stackSave=stackSave,_stackRestore=stackSave,_getTempRet0=getTempRet0;Module._getTempRet0=_getTempRet0;function _emscripten_notify_memory_growth(e){updateMemoryViews()}_emscripten_notify_memory_growth.sig="vp";var Protocols={list:[],map:{}},_setprotoent=e=>{function t(o,l,u){var _=_malloc(o.length+1);stringToAscii(o,_);for(var d=0,p=u.length,f=_malloc((p+1)*4),m=0;m>>2>>>0]=g}HEAPU32[f+d>>>2>>>0]=0;var b=_malloc(12);return HEAPU32[b>>>2>>>0]=_,HEAPU32[b+4>>>2>>>0]=f,HEAP32[b+8>>>2>>>0]=l,b}var r=Protocols.list,n=Protocols.map;if(r.length===0){var a=t("tcp",6,["TCP"]);r.push(a),n.tcp=n[6]=a,a=t("udp",17,["UDP"]),r.push(a),n.udp=n[17]=a}_setprotoent.index=0};_setprotoent.sig="vi";var _endprotoent=()=>{};_endprotoent.sig="v";function _getprotoent(e){if(_setprotoent.index===Protocols.list.length)return 0;var t=Protocols.list[_setprotoent.index++];return t}_getprotoent.sig="p";function _getprotobyname(e){e>>>=0,e=UTF8ToString(e),_setprotoent();var t=Protocols.map[e];return t}_getprotobyname.sig="pp";function _getprotobynumber(e){_setprotoent();var t=Protocols.map[e];return t}_getprotobynumber.sig="pi";function _emscripten_run_script(ptr){ptr>>>=0,eval(UTF8ToString(ptr))}_emscripten_run_script.sig="vp";function _emscripten_run_script_int(ptr){return ptr>>>=0,eval(UTF8ToString(ptr))|0}_emscripten_run_script_int.sig="ip";function _emscripten_run_script_string(ptr){ptr>>>=0;var s=eval(UTF8ToString(ptr));if(s==null)return 0;s+="";var me=_emscripten_run_script_string,len=lengthBytesUTF8(s);return(!me.bufferSize||me.bufferSizeMath.random();_emscripten_random.sig="f";var warnOnce=e=>{warnOnce.shown||(warnOnce.shown={}),warnOnce.shown[e]||(warnOnce.shown[e]=1,ENVIRONMENT_IS_NODE&&(e="warning: "+e),err(e))};function jsStackTrace(){return new Error().stack.toString()}function getCallstack(e){var t=jsStackTrace(),r=t.lastIndexOf("_emscripten_log"),n=t.lastIndexOf("_emscripten_get_callstack"),a=t.indexOf(` +`,Math.max(r,n))+1;t=t.slice(a),e&8&&typeof emscripten_source_map>"u"&&(warnOnce('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),e^=8,e|=16);var o=t.split(` +`);t="";var l=new RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"),u=new RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"),_=new RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)");for(var d in o){var p=o[d],f="",m="",h=0,g=0,b=_.exec(p);if(b&&b.length==5)f=b[1],m=b[2],h=b[3],g=b[4];else if(b=l.exec(p)||u.exec(p),b&&b.length>=4)f=b[1],m=b[2],h=b[3],g=b[4]|0;else{t+=p+` +`;continue}var v=!1;if(e&8){var S=emscripten_source_map.originalPositionFor({line:h,column:g});v=S==null?void 0:S.source,v&&(e&64&&(S.source=S.source.substring(S.source.replace(/\\/g,"/").lastIndexOf("/")+1)),t+=" at ".concat(f," (").concat(S.source,":").concat(S.line,":").concat(S.column,`) +`))}(e&16||!v)&&(e&64&&(m=m.substring(m.replace(/\\/g,"/").lastIndexOf("/")+1)),t+=(v?" = ".concat(f):" at ".concat(f))+" (".concat(m,":").concat(h,":").concat(g,`) +`))}return t=t.replace(/\s+$/,""),t}var emscriptenLog=(e,t)=>{e&24&&(t=t.replace(/\s+$/,""),t+=(t.length>0?` +`:"")+getCallstack(e)),e&1?e&4?console.error(t):e&2?console.warn(t):e&512?console.info(t):e&256?console.debug(t):console.log(t):e&6?err(t):out(t)},reallyNegative=e=>e<0||e===0&&1/e===-1/0,reSign=(e,t)=>{if(e<=0)return e;var r=t<=32?Math.abs(1<=r&&(t<=32||e>r)&&(e=-2*r+e),e},unSign=(e,t)=>e>=0?e:t<=32?2*Math.abs(1<{for(var t=e;HEAPU8[t>>>0];)++t;return t-e},formatString=(e,t)=>{var r=e,n=t;function a(_e,Z){return(Z==="double"||Z==="i64")&&_e&7&&(_e+=4),_e}function o(_e){var Z;return n=a(n,_e),_e==="double"?(Z=HEAPF64[n>>>3>>>0],n+=8):_e=="i64"?(Z=[HEAP32[n>>>2>>>0],HEAP32[n+4>>>2>>>0]],n+=8):(_e="i32",Z=HEAP32[n>>>2>>>0],n+=4),Z}for(var l=[],u,_,d;;){var p=r;if(u=HEAP8[r>>>0],u===0)break;if(_=HEAP8[r+1>>>0],u==37){var f=!1,m=!1,h=!1,g=!1,b=!1;e:for(;;){switch(_){case 43:f=!0;break;case 45:m=!0;break;case 35:h=!0;break;case 48:if(g)break e;g=!0;break;case 32:b=!0;break;default:break e}r++,_=HEAP8[r+1>>>0]}var v=0;if(_==42)v=o("i32"),r++,_=HEAP8[r+1>>>0];else for(;_>=48&&_<=57;)v=v*10+(_-48),r++,_=HEAP8[r+1>>>0];var S=!1,L=-1;if(_==46){if(L=0,S=!0,r++,_=HEAP8[r+1>>>0],_==42)L=o("i32"),r++;else for(;;){var T=HEAP8[r+1>>>0];if(T<48||T>57)break;L=L*10+(T-48),r++}_=HEAP8[r+1>>>0]}L<0&&(L=6,S=!1);var A;switch(String.fromCharCode(_)){case"h":var M=HEAP8[r+2>>>0];M==104?(r++,A=1):A=2;break;case"l":var M=HEAP8[r+2>>>0];M==108?(r++,A=8):A=4;break;case"L":case"q":case"j":A=8;break;case"z":case"t":case"I":A=4;break;default:A=null}switch(A&&r++,_=HEAP8[r+1>>>0],String.fromCharCode(_)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var X=_==100||_==105;A=A||4,d=o("i"+A*8);var x;if(A==8&&(d=_==117?convertU32PairToI53(d[0],d[1]):convertI32PairToI53(d[0],d[1])),A<=4){var w=Math.pow(256,A)-1;d=(X?reSign:unSign)(d&w,A*8)}var E=Math.abs(d),P="";if(_==100||_==105)x=reSign(d,8*A).toString(10);else if(_==117)x=unSign(d,8*A).toString(10),d=Math.abs(d);else if(_==111)x=(h?"0":"")+E.toString(8);else if(_==120||_==88){if(P=h&&d!=0?"0x":"",d<0){d=-d,x=(E-1).toString(16);for(var k=[],C=0;C=0&&(f?P="+"+P:b&&(P=" "+P)),x.charAt(0)=="-"&&(P="-"+P,x=x.substr(1));P.length+x.lengthl.push(_e.charCodeAt(0)));break}case"f":case"F":case"e":case"E":case"g":case"G":{d=o("double");var x;if(isNaN(d))x="nan",g=!1;else if(!isFinite(d))x=(d<0?"-":"")+"inf",g=!1;else{var F=!1,U=Math.min(L,20);if(_==103||_==71){F=!0,L=L||1;var D=parseInt(d.toExponential(U).split("e")[1],10);L>D&&D>=-4?(_=(_==103?"f":"F").charCodeAt(0),L-=D+1):(_=(_==103?"e":"E").charCodeAt(0),L--),U=Math.min(L,20)}_==101||_==69?(x=d.toExponential(U),/[eE][-+]\d$/.test(x)&&(x=x.slice(0,-1)+"0"+x.slice(-1))):(_==102||_==70)&&(x=d.toFixed(U),d===0&&reallyNegative(d)&&(x="-"+x));var I=x.split("e");if(F&&!h)for(;I[0].length>1&&I[0].includes(".")&&(I[0].slice(-1)=="0"||I[0].slice(-1)==".");)I[0]=I[0].slice(0,-1);else for(h&&x.indexOf(".")==-1&&(I[0]+=".");L>U++;)I[0]+="0";x=I[0]+(I.length>1?"e"+I[1]:""),_==69&&(x=x.toUpperCase()),d>=0&&(f?x="+"+x:b&&(x=" "+x))}for(;x.lengthl.push(Z.charCodeAt(0)));break}case"s":{var Q=o("i8*"),oe=Q?strLen(Q):6;if(S&&(oe=Math.min(oe,L)),!m)for(;oe>>0]);else l=l.concat(intArrayFromString("(null)".substr(0,oe),!0));if(m)for(;oe0;)l.push(32);m||l.push(o("i8"));break}case"n":{var we=o("i32*");HEAP32[we>>>2>>>0]=l.length;break}case"%":{l.push(u);break}default:for(var C=p;C>>0])}r+=2}else l.push(u),r+=1}return l};function _emscripten_log(e,t,r){t>>>=0,r>>>=0;var n=formatString(t,r),a=UTF8ArrayToString(n,0);emscriptenLog(e,a)}_emscripten_log.sig="vipp";function _emscripten_get_compiler_setting(e){throw"You must build with -sRETAIN_COMPILER_SETTINGS for getCompilerSetting or emscripten_get_compiler_setting to work"}_emscripten_get_compiler_setting.sig="pp";var _emscripten_has_asyncify=()=>0;_emscripten_has_asyncify.sig="i";function _emscripten_debugger(){debugger}_emscripten_debugger.sig="v";function _emscripten_print_double(e,t,r){t>>>=0;var n=e+"";return t?stringToUTF8(n,t,r):lengthBytesUTF8(n)}_emscripten_print_double.sig="idpi";function _emscripten_asm_const_double(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runEmAsmFunction(e,t,r)}_emscripten_asm_const_double.sig="dppp";var runMainThreadEmAsm=(e,t,r,n)=>{var a=readEmAsmArgs(t,r);return ASM_CONSTS[e](...a)};function _emscripten_asm_const_int_sync_on_main_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runMainThreadEmAsm(e,t,r)}_emscripten_asm_const_int_sync_on_main_thread.sig="ippp";function _emscripten_asm_const_ptr_sync_on_main_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runMainThreadEmAsm(e,t,r)}_emscripten_asm_const_ptr_sync_on_main_thread.sig="pppp";var _emscripten_asm_const_double_sync_on_main_thread=_emscripten_asm_const_int_sync_on_main_thread;_emscripten_asm_const_double_sync_on_main_thread.sig="dppp";function _emscripten_asm_const_async_on_main_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,runMainThreadEmAsm(e,t,r)}_emscripten_asm_const_async_on_main_thread.sig="vppp";function __Unwind_Backtrace(e,t){e>>>=0,t>>>=0;for(var r=getCallstack(),n=r.split(` +`),a=0;a>>=0,err("Warning: _Unwind_RaiseException is not correctly implemented"),___cxa_throw(e,0,0)}__Unwind_RaiseException.sig="ip";function __Unwind_DeleteException(e){err("TODO: Unwind_DeleteException")}__Unwind_DeleteException.sig="vp";var getDynCaller=(e,t)=>(...r)=>dynCall(e,t,r),_emscripten_exit_with_live_runtime=()=>{throw"unwind"};_emscripten_exit_with_live_runtime.sig="v";var _emscripten_force_exit=e=>{__emscripten_runtime_keepalive_clear(),_exit(e)};_emscripten_force_exit.sig="vi";function _emscripten_outn(e,t){return e>>>=0,t>>>=0,out(UTF8ToString(e,t))}_emscripten_outn.sig="vpp";function _emscripten_errn(e,t){return e>>>=0,t>>>=0,err(UTF8ToString(e,t))}_emscripten_errn.sig="vpp";var _emscripten_throw_number=e=>{throw e};_emscripten_throw_number.sig="vd";function _emscripten_throw_string(e){throw e>>>=0,UTF8ToString(e)}_emscripten_throw_string.sig="vp";var runtimeKeepalivePush=()=>{runtimeKeepaliveCounter+=1};runtimeKeepalivePush.sig="v";var runtimeKeepalivePop=()=>{runtimeKeepaliveCounter-=1};runtimeKeepalivePop.sig="v";var _emscripten_runtime_keepalive_push=runtimeKeepalivePush;_emscripten_runtime_keepalive_push.sig="v";var _emscripten_runtime_keepalive_pop=runtimeKeepalivePop;_emscripten_runtime_keepalive_pop.sig="v";var _emscripten_runtime_keepalive_check=keepRuntimeAlive;_emscripten_runtime_keepalive_check.sig="i";var ___global_base=1024;function __emscripten_fs_load_embedded_files(e){e>>>=0;do{var t=HEAPU32[e>>>2>>>0];e+=4;var r=HEAPU32[e>>>2>>>0];e+=4;var n=HEAPU32[e>>>2>>>0];e+=4;var a=UTF8ToString(t);FS.createPath("/",PATH.dirname(a),!0,!0),FS.createDataFile(a,null,HEAP8.subarray(n>>>0,n+r>>>0),!0,!0,!0)}while(HEAPU32[e>>>2>>>0])}__emscripten_fs_load_embedded_files.sig="vp";var POINTER_SIZE=4,_emscripten_math_cbrt=Math.cbrt;_emscripten_math_cbrt.sig="dd";var _emscripten_math_pow=Math.pow;_emscripten_math_pow.sig="ddd";var _emscripten_math_random=Math.random;_emscripten_math_random.sig="d";var _emscripten_math_sign=Math.sign;_emscripten_math_sign.sig="dd";var _emscripten_math_sqrt=Math.sqrt;_emscripten_math_sqrt.sig="dd";var _emscripten_math_exp=Math.exp;_emscripten_math_exp.sig="dd";var _emscripten_math_expm1=Math.expm1;_emscripten_math_expm1.sig="dd";var _emscripten_math_fmod=(e,t)=>e%t;_emscripten_math_fmod.sig="ddd";var _emscripten_math_log=Math.log;_emscripten_math_log.sig="dd";var _emscripten_math_log1p=Math.log1p;_emscripten_math_log1p.sig="dd";var _emscripten_math_log10=Math.log10;_emscripten_math_log10.sig="dd";var _emscripten_math_log2=Math.log2;_emscripten_math_log2.sig="dd";var _emscripten_math_round=Math.round;_emscripten_math_round.sig="dd";var _emscripten_math_acos=Math.acos;_emscripten_math_acos.sig="dd";var _emscripten_math_acosh=Math.acosh;_emscripten_math_acosh.sig="dd";var _emscripten_math_asin=Math.asin;_emscripten_math_asin.sig="dd";var _emscripten_math_asinh=Math.asinh;_emscripten_math_asinh.sig="dd";var _emscripten_math_atan=Math.atan;_emscripten_math_atan.sig="dd";var _emscripten_math_atanh=Math.atanh;_emscripten_math_atanh.sig="dd";var _emscripten_math_atan2=Math.atan2;_emscripten_math_atan2.sig="ddd";var _emscripten_math_cos=Math.cos;_emscripten_math_cos.sig="dd";var _emscripten_math_cosh=Math.cosh;_emscripten_math_cosh.sig="dd";function _emscripten_math_hypot(e,t){t>>>=0;for(var r=[],n=0;n>>3>>>0]);return Math.hypot(...r)}_emscripten_math_hypot.sig="dip";var _emscripten_math_sin=Math.sin;_emscripten_math_sin.sig="dd";var _emscripten_math_sinh=Math.sinh;_emscripten_math_sinh.sig="dd";var _emscripten_math_tan=Math.tan;_emscripten_math_tan.sig="dd";var _emscripten_math_tanh=Math.tanh;_emscripten_math_tanh.sig="dd";var JSEvents={removeAllEventListeners(){for(;JSEvents.eventHandlers.length;)JSEvents._removeHandler(JSEvents.eventHandlers.length-1);JSEvents.deferredCalls=[]},inEventHandler:0,deferredCalls:[],deferCall(e,t,r){function n(o,l){if(o.length!=l.length)return!1;for(var u in o)if(o[u]!=l[u])return!1;return!0}for(var a of JSEvents.deferredCalls)if(a.targetFunction==e&&n(a.argsList,r))return;JSEvents.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),JSEvents.deferredCalls.sort((o,l)=>o.precedencet.targetFunction!=e)},canPerformEventHandlerRequests(){return navigator.userActivation?navigator.userActivation.isActive:JSEvents.inEventHandler&&JSEvents.currentEventHandler.allowsDeferredCalls},runDeferredCalls(){if(JSEvents.canPerformEventHandlerRequests()){var e=JSEvents.deferredCalls;JSEvents.deferredCalls=[];for(var t of e)t.targetFunction(...t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:(e,t)=>{for(var r=0;re>2?UTF8ToString(e):e,specialHTMLTargets=[0,typeof document<"u"?document:0,typeof window<"u"?window:0],findEventTarget=e=>{e=maybeCStringToJsString(e);var t=specialHTMLTargets[e]||(typeof document<"u"?document.querySelector(e):void 0);return t},registerKeyEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.keyEvent||(JSEvents.keyEvent=_malloc(160));var u=d=>{var p=JSEvents.keyEvent;HEAPF64[p>>>3>>>0]=d.timeStamp;var f=p>>>2;HEAP32[f+2>>>0]=d.location,HEAP8[p+12>>>0]=d.ctrlKey,HEAP8[p+13>>>0]=d.shiftKey,HEAP8[p+14>>>0]=d.altKey,HEAP8[p+15>>>0]=d.metaKey,HEAP8[p+16>>>0]=d.repeat,HEAP32[f+5>>>0]=d.charCode,HEAP32[f+6>>>0]=d.keyCode,HEAP32[f+7>>>0]=d.which,stringToUTF8(d.key||"",p+32,32),stringToUTF8(d.code||"",p+64,32),stringToUTF8(d.char||"",p+96,32),stringToUTF8(d.locale||"",p+128,32),getWasmTableEntry(n)(a,p,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)},findCanvasEventTarget=findEventTarget;function _emscripten_set_keypress_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerKeyEventCallback(e,t,r,n,1,"keypress")}_emscripten_set_keypress_callback_on_thread.sig="ippipp";function _emscripten_set_keydown_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerKeyEventCallback(e,t,r,n,2,"keydown")}_emscripten_set_keydown_callback_on_thread.sig="ippipp";function _emscripten_set_keyup_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerKeyEventCallback(e,t,r,n,3,"keyup")}_emscripten_set_keyup_callback_on_thread.sig="ippipp";var getBoundingClientRect=e=>specialHTMLTargets.indexOf(e)<0?e.getBoundingClientRect():{left:0,top:0},fillMouseEventData=(e,t,r)=>{HEAPF64[e>>>3>>>0]=t.timeStamp;var n=e>>>2;HEAP32[n+2>>>0]=t.screenX,HEAP32[n+3>>>0]=t.screenY,HEAP32[n+4>>>0]=t.clientX,HEAP32[n+5>>>0]=t.clientY,HEAP8[e+24>>>0]=t.ctrlKey,HEAP8[e+25>>>0]=t.shiftKey,HEAP8[e+26>>>0]=t.altKey,HEAP8[e+27>>>0]=t.metaKey,HEAP16[n*2+14>>>0]=t.button,HEAP16[n*2+15>>>0]=t.buttons,HEAP32[n+8>>>0]=t.movementX,HEAP32[n+9>>>0]=t.movementY;var a=getBoundingClientRect(r);HEAP32[n+10>>>0]=t.clientX-(a.left|0),HEAP32[n+11>>>0]=t.clientY-(a.top|0)},registerMouseEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.mouseEvent||(JSEvents.mouseEvent=_malloc(64)),e=findEventTarget(e);var u=(d=event)=>{fillMouseEventData(JSEvents.mouseEvent,d,e),getWasmTableEntry(n)(a,JSEvents.mouseEvent,t)&&d.preventDefault()},_={target:e,allowsDeferredCalls:o!="mousemove"&&o!="mouseenter"&&o!="mouseleave",eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_click_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerMouseEventCallback(e,t,r,n,4,"click")}_emscripten_set_click_callback_on_thread.sig="ippipp";function _emscripten_set_mousedown_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerMouseEventCallback(e,t,r,n,5,"mousedown")}_emscripten_set_mousedown_callback_on_thread.sig="ippipp";function _emscripten_set_mouseup_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerMouseEventCallback(e,t,r,n,6,"mouseup")}_emscripten_set_mouseup_callback_on_thread.sig="ippipp";function _emscripten_set_dblclick_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerMouseEventCallback(e,t,r,n,7,"dblclick")}_emscripten_set_dblclick_callback_on_thread.sig="ippipp";function _emscripten_set_mousemove_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerMouseEventCallback(e,t,r,n,8,"mousemove")}_emscripten_set_mousemove_callback_on_thread.sig="ippipp";function _emscripten_set_mouseenter_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerMouseEventCallback(e,t,r,n,33,"mouseenter")}_emscripten_set_mouseenter_callback_on_thread.sig="ippipp";function _emscripten_set_mouseleave_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerMouseEventCallback(e,t,r,n,34,"mouseleave")}_emscripten_set_mouseleave_callback_on_thread.sig="ippipp";function _emscripten_set_mouseover_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerMouseEventCallback(e,t,r,n,35,"mouseover")}_emscripten_set_mouseover_callback_on_thread.sig="ippipp";function _emscripten_set_mouseout_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerMouseEventCallback(e,t,r,n,36,"mouseout")}_emscripten_set_mouseout_callback_on_thread.sig="ippipp";function _emscripten_get_mouse_status(e){return e>>>=0,JSEvents.mouseEvent?(HEAP8.set(HEAP8.subarray(JSEvents.mouseEvent>>>0,JSEvents.mouseEvent+64>>>0),e>>>0),0):-7}_emscripten_get_mouse_status.sig="ip";var registerWheelEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.wheelEvent||(JSEvents.wheelEvent=_malloc(96));var u=(d=event)=>{var p=JSEvents.wheelEvent;fillMouseEventData(p,d,e),HEAPF64[p+64>>>3>>>0]=d.deltaX,HEAPF64[p+72>>>3>>>0]=d.deltaY,HEAPF64[p+80>>>3>>>0]=d.deltaZ,HEAP32[p+88>>>2>>>0]=d.deltaMode,getWasmTableEntry(n)(a,p,t)&&d.preventDefault()},_={target:e,allowsDeferredCalls:!0,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_wheel_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,e=findEventTarget(e),e?typeof e.onwheel<"u"?registerWheelEventCallback(e,t,r,n,9,"wheel"):-1:-4}_emscripten_set_wheel_callback_on_thread.sig="ippipp";var registerUiEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.uiEvent||(JSEvents.uiEvent=_malloc(36)),e=findEventTarget(e);var u=(d=event)=>{if(d.target==e){var p=document.body;if(p){var f=JSEvents.uiEvent;HEAP32[f>>>2>>>0]=0,HEAP32[f+4>>>2>>>0]=p.clientWidth,HEAP32[f+8>>>2>>>0]=p.clientHeight,HEAP32[f+12>>>2>>>0]=innerWidth,HEAP32[f+16>>>2>>>0]=innerHeight,HEAP32[f+20>>>2>>>0]=outerWidth,HEAP32[f+24>>>2>>>0]=outerHeight,HEAP32[f+28>>>2>>>0]=pageXOffset|0,HEAP32[f+32>>>2>>>0]=pageYOffset|0,getWasmTableEntry(n)(a,f,t)&&d.preventDefault()}}},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_resize_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerUiEventCallback(e,t,r,n,10,"resize")}_emscripten_set_resize_callback_on_thread.sig="ippipp";function _emscripten_set_scroll_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerUiEventCallback(e,t,r,n,11,"scroll")}_emscripten_set_scroll_callback_on_thread.sig="ippipp";var registerFocusEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.focusEvent||(JSEvents.focusEvent=_malloc(256));var u=(d=event)=>{var p=JSEvents.getNodeNameForTarget(d.target),f=d.target.id?d.target.id:"",m=JSEvents.focusEvent;stringToUTF8(p,m+0,128),stringToUTF8(f,m+128,128),getWasmTableEntry(n)(a,m,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_blur_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerFocusEventCallback(e,t,r,n,12,"blur")}_emscripten_set_blur_callback_on_thread.sig="ippipp";function _emscripten_set_focus_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerFocusEventCallback(e,t,r,n,13,"focus")}_emscripten_set_focus_callback_on_thread.sig="ippipp";function _emscripten_set_focusin_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerFocusEventCallback(e,t,r,n,14,"focusin")}_emscripten_set_focusin_callback_on_thread.sig="ippipp";function _emscripten_set_focusout_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerFocusEventCallback(e,t,r,n,15,"focusout")}_emscripten_set_focusout_callback_on_thread.sig="ippipp";var fillDeviceOrientationEventData=(e,t,r)=>{HEAPF64[e>>>3>>>0]=t.alpha,HEAPF64[e+8>>>3>>>0]=t.beta,HEAPF64[e+16>>>3>>>0]=t.gamma,HEAP8[e+24>>>0]=t.absolute},registerDeviceOrientationEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.deviceOrientationEvent||(JSEvents.deviceOrientationEvent=_malloc(32));var u=(d=event)=>{fillDeviceOrientationEventData(JSEvents.deviceOrientationEvent,d),getWasmTableEntry(n)(a,JSEvents.deviceOrientationEvent,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_deviceorientation_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,registerDeviceOrientationEventCallback(2,e,t,r,16,"deviceorientation")}_emscripten_set_deviceorientation_callback_on_thread.sig="ipipp";function _emscripten_get_deviceorientation_status(e){return e>>>=0,JSEvents.deviceOrientationEvent?(HEAP32.set(HEAP32.subarray(JSEvents.deviceOrientationEvent>>>0,32),e>>>0),0):-7}_emscripten_get_deviceorientation_status.sig="ip";var fillDeviceMotionEventData=(e,t,r)=>{var n=t.acceleration,a=t.accelerationIncludingGravity,o=t.rotationRate;n=n||{},a=a||{},o=o||{},HEAPF64[e>>>3>>>0]=n.x,HEAPF64[e+8>>>3>>>0]=n.y,HEAPF64[e+16>>>3>>>0]=n.z,HEAPF64[e+24>>>3>>>0]=a.x,HEAPF64[e+32>>>3>>>0]=a.y,HEAPF64[e+40>>>3>>>0]=a.z,HEAPF64[e+48>>>3>>>0]=o.alpha,HEAPF64[e+56>>>3>>>0]=o.beta,HEAPF64[e+64>>>3>>>0]=o.gamma},registerDeviceMotionEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.deviceMotionEvent||(JSEvents.deviceMotionEvent=_malloc(80));var u=(d=event)=>{fillDeviceMotionEventData(JSEvents.deviceMotionEvent,d),getWasmTableEntry(n)(a,JSEvents.deviceMotionEvent,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_devicemotion_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,registerDeviceMotionEventCallback(2,e,t,r,17,"devicemotion")}_emscripten_set_devicemotion_callback_on_thread.sig="ipipp";function _emscripten_get_devicemotion_status(e){return e>>>=0,JSEvents.deviceMotionEvent?(HEAP32.set(HEAP32.subarray(JSEvents.deviceMotionEvent>>>0,80),e>>>0),0):-7}_emscripten_get_devicemotion_status.sig="ip";var screenOrientation=()=>{if(window.screen)return screen.orientation||screen.mozOrientation||screen.webkitOrientation},fillOrientationChangeEventData=e=>{var t=["portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"],r=["portrait","portrait","landscape","landscape"],n=0,a=0,o=screenOrientation();typeof o=="object"?(n=t.indexOf(o.type),n<0&&(n=r.indexOf(o.type)),n>=0&&(n=1<>>2>>>0]=n,HEAP32[e+4>>>2>>>0]=a},registerOrientationChangeEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.orientationChangeEvent||(JSEvents.orientationChangeEvent=_malloc(8));var u=(d=event)=>{var p=JSEvents.orientationChangeEvent;fillOrientationChangeEventData(p),getWasmTableEntry(n)(a,p,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_orientationchange_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,!window.screen||!screen.orientation?-1:registerOrientationChangeEventCallback(screen.orientation,e,t,r,18,"change")}_emscripten_set_orientationchange_callback_on_thread.sig="ipipp";function _emscripten_get_orientation_status(e){return e>>>=0,!screenOrientation()&&typeof orientation>"u"?-1:(fillOrientationChangeEventData(e),0)}_emscripten_get_orientation_status.sig="ip";var _emscripten_lock_orientation=e=>{var t=[];e&1&&t.push("portrait-primary"),e&2&&t.push("portrait-secondary"),e&4&&t.push("landscape-primary"),e&8&&t.push("landscape-secondary");var r;if(screen.lockOrientation)r=screen.lockOrientation(t);else if(screen.mozLockOrientation)r=screen.mozLockOrientation(t);else if(screen.webkitLockOrientation)r=screen.webkitLockOrientation(t);else return-1;return r?0:-6};_emscripten_lock_orientation.sig="ii";var _emscripten_unlock_orientation=()=>{if(screen.unlockOrientation)screen.unlockOrientation();else if(screen.mozUnlockOrientation)screen.mozUnlockOrientation();else if(screen.webkitUnlockOrientation)screen.webkitUnlockOrientation();else return-1;return 0};_emscripten_unlock_orientation.sig="i";var fillFullscreenChangeEventData=e=>{var t=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement,r=!!t;HEAP8[e>>>0]=r,HEAP8[e+1>>>0]=JSEvents.fullscreenEnabled();var n=r?t:JSEvents.previousFullscreenElement,a=JSEvents.getNodeNameForTarget(n),o=(n==null?void 0:n.id)||"";stringToUTF8(a,e+2,128),stringToUTF8(o,e+130,128),HEAP32[e+260>>>2>>>0]=n?n.clientWidth:0,HEAP32[e+264>>>2>>>0]=n?n.clientHeight:0,HEAP32[e+268>>>2>>>0]=screen.width,HEAP32[e+272>>>2>>>0]=screen.height,r&&(JSEvents.previousFullscreenElement=t)},registerFullscreenChangeEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.fullscreenChangeEvent||(JSEvents.fullscreenChangeEvent=_malloc(276));var u=(d=event)=>{var p=JSEvents.fullscreenChangeEvent;fillFullscreenChangeEventData(p),getWasmTableEntry(n)(a,p,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_fullscreenchange_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,JSEvents.fullscreenEnabled()?(e=findEventTarget(e),e?(registerFullscreenChangeEventCallback(e,t,r,n,19,"webkitfullscreenchange"),registerFullscreenChangeEventCallback(e,t,r,n,19,"fullscreenchange")):-4):-1}_emscripten_set_fullscreenchange_callback_on_thread.sig="ippipp";function _emscripten_get_fullscreen_status(e){return e>>>=0,JSEvents.fullscreenEnabled()?(fillFullscreenChangeEventData(e),0):-1}_emscripten_get_fullscreen_status.sig="ip";function _emscripten_get_canvas_element_size(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=findCanvasEventTarget(e);if(!n)return-4;HEAP32[t>>>2>>>0]=n.width,HEAP32[r>>>2>>>0]=n.height}_emscripten_get_canvas_element_size.sig="ippp";var getCanvasElementSize=e=>{var t=stackSave(),r=stackAlloc(8),n=r+4,a=stringToUTF8OnStack(e.id);_emscripten_get_canvas_element_size(a,r,n);var o=[HEAP32[r>>>2>>>0],HEAP32[n>>>2>>>0]];return stackRestore(t),o};function _emscripten_set_canvas_element_size(e,t,r){e>>>=0;var n=findCanvasEventTarget(e);return n?(n.width=t,n.height=r,0):-4}_emscripten_set_canvas_element_size.sig="ipii";var setCanvasElementSize=(e,t,r)=>{if(!e.controlTransferredOffscreen)e.width=t,e.height=r;else{var n=stackSave(),a=stringToUTF8OnStack(e.id);_emscripten_set_canvas_element_size(a,t,r),stackRestore(n)}},registerRestoreOldStyle=e=>{var t=getCanvasElementSize(e),r=t[0],n=t[1],a=e.style.width,o=e.style.height,l=e.style.backgroundColor,u=document.body.style.backgroundColor,_=e.style.paddingLeft,d=e.style.paddingRight,p=e.style.paddingTop,f=e.style.paddingBottom,m=e.style.marginLeft,h=e.style.marginRight,g=e.style.marginTop,b=e.style.marginBottom,v=document.body.style.margin,S=document.documentElement.style.overflow,L=document.body.scroll,T=e.style.imageRendering;function A(){var M=document.fullscreenElement||document.webkitFullscreenElement;M||(document.removeEventListener("fullscreenchange",A),document.removeEventListener("webkitfullscreenchange",A),setCanvasElementSize(e,r,n),e.style.width=a,e.style.height=o,e.style.backgroundColor=l,u||(document.body.style.backgroundColor="white"),document.body.style.backgroundColor=u,e.style.paddingLeft=_,e.style.paddingRight=d,e.style.paddingTop=p,e.style.paddingBottom=f,e.style.marginLeft=m,e.style.marginRight=h,e.style.marginTop=g,e.style.marginBottom=b,document.body.style.margin=v,document.documentElement.style.overflow=S,document.body.scroll=L,e.style.imageRendering=T,e.GLctxObject&&e.GLctxObject.GLctx.viewport(0,0,r,n),currentFullscreenStrategy.canvasResizedCallback&&getWasmTableEntry(currentFullscreenStrategy.canvasResizedCallback)(37,0,currentFullscreenStrategy.canvasResizedCallbackUserData))}return document.addEventListener("fullscreenchange",A),document.addEventListener("webkitfullscreenchange",A),A},setLetterbox=(e,t,r)=>{e.style.paddingLeft=e.style.paddingRight=r+"px",e.style.paddingTop=e.style.paddingBottom=t+"px"},JSEvents_resizeCanvasForFullscreen=(e,t)=>{var r,n,a=registerRestoreOldStyle(e),o=t.softFullscreen?innerWidth:screen.width,l=t.softFullscreen?innerHeight:screen.height,u=getBoundingClientRect(e),_=u.width,d=u.height,p=getCanvasElementSize(e),f=p[0],m=p[1];if(t.scaleMode==3)setLetterbox(e,(l-d)/2,(o-_)/2),o=_,l=d;else if(t.scaleMode==2)if(o*m{if((t.scaleMode!=0||t.canvasResolutionScaleMode!=0)&&JSEvents_resizeCanvasForFullscreen(e,t),e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else return JSEvents.fullscreenEnabled()?-3:-1;return currentFullscreenStrategy=t,t.canvasResizedCallback&&getWasmTableEntry(t.canvasResizedCallback)(37,0,t.canvasResizedCallbackUserData),0},hideEverythingExceptGivenElement=e=>{for(var t=e,r=t.parentNode,n=[];t!=document.body;){for(var a=r.children,o=0;o{for(var t of e)t.node.style.display=t.displayState},currentFullscreenStrategy={},restoreOldWindowedStyle=null,softFullscreenResizeWebGLRenderTarget=()=>{var e=devicePixelRatio,t=currentFullscreenStrategy.canvasResolutionScaleMode==2,r=currentFullscreenStrategy.scaleMode==2,n=currentFullscreenStrategy.canvasResolutionScaleMode!=0,a=currentFullscreenStrategy.scaleMode==3,o=t?Math.round(innerWidth*e):innerWidth,l=t?Math.round(innerHeight*e):innerHeight,u=o,_=l,d=currentFullscreenStrategy.target,p=getCanvasElementSize(d),f=p[0],m=p[1],h;if(r&&(u*mf*_&&(u=_*f/m|0),h=(l-_)/2|0),n&&(setCanvasElementSize(d,u,_),d.GLctxObject&&d.GLctxObject.GLctx.viewport(0,0,u,_)),t&&(h/=e,u/=e,_/=e,u=Math.round(u*1e4)/1e4,_=Math.round(_*1e4)/1e4,h=Math.round(h*1e4)/1e4),a){var g=(innerHeight-jstoi_q(d.style.height))/2,b=(innerWidth-jstoi_q(d.style.width))/2;setLetterbox(d,g,b)}else{d.style.width=u+"px",d.style.height=_+"px";var b=(innerWidth-u)/2;setLetterbox(d,h,b)}!a&¤tFullscreenStrategy.canvasResizedCallback&&getWasmTableEntry(currentFullscreenStrategy.canvasResizedCallback)(37,0,currentFullscreenStrategy.canvasResizedCallbackUserData)},doRequestFullscreen=(e,t)=>JSEvents.fullscreenEnabled()?(e=findEventTarget(e),e?!e.requestFullscreen&&!e.webkitRequestFullscreen?-3:JSEvents.canPerformEventHandlerRequests()?JSEvents_requestFullscreen(e,t):t.deferUntilInEventHandler?(JSEvents.deferCall(JSEvents_requestFullscreen,1,[e,t]),1):-2:-4):-1;function _emscripten_request_fullscreen(e,t){e>>>=0;var r={scaleMode:0,canvasResolutionScaleMode:0,filteringMode:0,deferUntilInEventHandler:t,canvasResizedCallbackTargetThread:2};return doRequestFullscreen(e,r)}_emscripten_request_fullscreen.sig="ipi";function _emscripten_request_fullscreen_strategy(e,t,r){e>>>=0,r>>>=0;var n={scaleMode:HEAP32[r>>>2>>>0],canvasResolutionScaleMode:HEAP32[r+4>>>2>>>0],filteringMode:HEAP32[r+8>>>2>>>0],deferUntilInEventHandler:t,canvasResizedCallback:HEAP32[r+12>>>2>>>0],canvasResizedCallbackUserData:HEAP32[r+16>>>2>>>0]};return doRequestFullscreen(e,n)}_emscripten_request_fullscreen_strategy.sig="ipip";function _emscripten_enter_soft_fullscreen(e,t){if(e>>>=0,t>>>=0,e=findEventTarget(e),!e)return-4;var r={scaleMode:HEAP32[t>>>2>>>0],canvasResolutionScaleMode:HEAP32[t+4>>>2>>>0],filteringMode:HEAP32[t+8>>>2>>>0],canvasResizedCallback:HEAP32[t+12>>>2>>>0],canvasResizedCallbackUserData:HEAP32[t+16>>>2>>>0],target:e,softFullscreen:!0},n=JSEvents_resizeCanvasForFullscreen(e,r);document.documentElement.style.overflow="hidden",document.body.scroll="no",document.body.style.margin="0px";var a=hideEverythingExceptGivenElement(e);function o(){n(),restoreHiddenElements(a),removeEventListener("resize",softFullscreenResizeWebGLRenderTarget),r.canvasResizedCallback&&getWasmTableEntry(r.canvasResizedCallback)(37,0,r.canvasResizedCallbackUserData),currentFullscreenStrategy=0}return restoreOldWindowedStyle=o,currentFullscreenStrategy=r,addEventListener("resize",softFullscreenResizeWebGLRenderTarget),r.canvasResizedCallback&&getWasmTableEntry(r.canvasResizedCallback)(37,0,r.canvasResizedCallbackUserData),0}_emscripten_enter_soft_fullscreen.sig="ipp";var _emscripten_exit_soft_fullscreen=()=>(restoreOldWindowedStyle==null||restoreOldWindowedStyle(),restoreOldWindowedStyle=null,0);_emscripten_exit_soft_fullscreen.sig="i";var _emscripten_exit_fullscreen=()=>{if(!JSEvents.fullscreenEnabled())return-1;JSEvents.removeDeferredCalls(JSEvents_requestFullscreen);var e=specialHTMLTargets[1];if(e.exitFullscreen)e.fullscreenElement&&e.exitFullscreen();else if(e.webkitExitFullscreen)e.webkitFullscreenElement&&e.webkitExitFullscreen();else return-1;return 0};_emscripten_exit_fullscreen.sig="i";var fillPointerlockChangeEventData=e=>{var t=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement||document.msPointerLockElement,r=!!t;HEAP8[e>>>0]=r;var n=JSEvents.getNodeNameForTarget(t),a=(t==null?void 0:t.id)||"";stringToUTF8(n,e+1,128),stringToUTF8(a,e+129,128)},registerPointerlockChangeEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.pointerlockChangeEvent||(JSEvents.pointerlockChangeEvent=_malloc(257));var u=(d=event)=>{var p=JSEvents.pointerlockChangeEvent;fillPointerlockChangeEventData(p),getWasmTableEntry(n)(a,p,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_pointerlockchange_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,!document||!document.body||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock?-1:(e=findEventTarget(e),e?(registerPointerlockChangeEventCallback(e,t,r,n,20,"mozpointerlockchange"),registerPointerlockChangeEventCallback(e,t,r,n,20,"webkitpointerlockchange"),registerPointerlockChangeEventCallback(e,t,r,n,20,"mspointerlockchange"),registerPointerlockChangeEventCallback(e,t,r,n,20,"pointerlockchange")):-4)}_emscripten_set_pointerlockchange_callback_on_thread.sig="ippipp";var registerPointerlockErrorEventCallback=(e,t,r,n,a,o,l)=>{var u=(d=event)=>{getWasmTableEntry(n)(a,0,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_pointerlockerror_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,!document||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock?-1:(e=findEventTarget(e),e?(registerPointerlockErrorEventCallback(e,t,r,n,38,"mozpointerlockerror"),registerPointerlockErrorEventCallback(e,t,r,n,38,"webkitpointerlockerror"),registerPointerlockErrorEventCallback(e,t,r,n,38,"mspointerlockerror"),registerPointerlockErrorEventCallback(e,t,r,n,38,"pointerlockerror")):-4)}_emscripten_set_pointerlockerror_callback_on_thread.sig="ippipp";function _emscripten_get_pointerlock_status(e){return e>>>=0,e&&fillPointerlockChangeEventData(e),!document.body||!document.body.requestPointerLock&&!document.body.mozRequestPointerLock&&!document.body.webkitRequestPointerLock&&!document.body.msRequestPointerLock?-1:0}_emscripten_get_pointerlock_status.sig="ip";var requestPointerLock=e=>{if(e.requestPointerLock)e.requestPointerLock();else return document.body.requestPointerLock?-3:-1;return 0};function _emscripten_request_pointerlock(e,t){return e>>>=0,e=findEventTarget(e),e?e.requestPointerLock?JSEvents.canPerformEventHandlerRequests()?requestPointerLock(e):t?(JSEvents.deferCall(requestPointerLock,2,[e]),1):-2:-1:-4}_emscripten_request_pointerlock.sig="ipi";var _emscripten_exit_pointerlock=()=>{if(JSEvents.removeDeferredCalls(requestPointerLock),document.exitPointerLock)document.exitPointerLock();else return-1;return 0};_emscripten_exit_pointerlock.sig="i";var _emscripten_vibrate=e=>navigator.vibrate?(navigator.vibrate(e),0):-1;_emscripten_vibrate.sig="ii";function _emscripten_vibrate_pattern(e,t){if(e>>>=0,!navigator.vibrate)return-1;for(var r=[],n=0;n>>2>>>0];r.push(a)}return navigator.vibrate(r),0}_emscripten_vibrate_pattern.sig="ipi";var fillVisibilityChangeEventData=e=>{var t=["hidden","visible","prerender","unloaded"],r=t.indexOf(document.visibilityState);HEAP8[e>>>0]=document.hidden,HEAP32[e+4>>>2>>>0]=r},registerVisibilityChangeEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.visibilityChangeEvent||(JSEvents.visibilityChangeEvent=_malloc(8));var u=(d=event)=>{var p=JSEvents.visibilityChangeEvent;fillVisibilityChangeEventData(p),getWasmTableEntry(n)(a,p,t)&&d.preventDefault()},_={target:e,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_visibilitychange_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,specialHTMLTargets[1]?registerVisibilityChangeEventCallback(specialHTMLTargets[1],e,t,r,21,"visibilitychange"):-4}_emscripten_set_visibilitychange_callback_on_thread.sig="ipipp";function _emscripten_get_visibility_status(e){return e>>>=0,typeof document.visibilityState>"u"&&typeof document.hidden>"u"?-1:(fillVisibilityChangeEventData(e),0)}_emscripten_get_visibility_status.sig="ip";var registerTouchEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.touchEvent||(JSEvents.touchEvent=_malloc(1552)),e=findEventTarget(e);var u=d=>{var p={},f=d.touches;for(let S of f)S.isChanged=S.onTarget=0,p[S.identifier]=S;for(let S of d.changedTouches)S.isChanged=1,p[S.identifier]=S;for(let S of d.targetTouches)p[S.identifier].onTarget=1;var m=JSEvents.touchEvent;HEAPF64[m>>>3>>>0]=d.timeStamp,HEAP8[m+12>>>0]=d.ctrlKey,HEAP8[m+13>>>0]=d.shiftKey,HEAP8[m+14>>>0]=d.altKey,HEAP8[m+15>>>0]=d.metaKey;var h=m+16,g=getBoundingClientRect(e),b=0;for(let S of Object.values(p)){var v=h>>>2;if(HEAP32[v+0>>>0]=S.identifier,HEAP32[v+1>>>0]=S.screenX,HEAP32[v+2>>>0]=S.screenY,HEAP32[v+3>>>0]=S.clientX,HEAP32[v+4>>>0]=S.clientY,HEAP32[v+5>>>0]=S.pageX,HEAP32[v+6>>>0]=S.pageY,HEAP8[h+28>>>0]=S.isChanged,HEAP8[h+29>>>0]=S.onTarget,HEAP32[v+8>>>0]=S.clientX-(g.left|0),HEAP32[v+9>>>0]=S.clientY-(g.top|0),h+=48,++b>31)break}HEAP32[m+8>>>2>>>0]=b,getWasmTableEntry(n)(a,m,t)&&d.preventDefault()},_={target:e,allowsDeferredCalls:o=="touchstart"||o=="touchend",eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_touchstart_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerTouchEventCallback(e,t,r,n,22,"touchstart")}_emscripten_set_touchstart_callback_on_thread.sig="ippipp";function _emscripten_set_touchend_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerTouchEventCallback(e,t,r,n,23,"touchend")}_emscripten_set_touchend_callback_on_thread.sig="ippipp";function _emscripten_set_touchmove_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerTouchEventCallback(e,t,r,n,24,"touchmove")}_emscripten_set_touchmove_callback_on_thread.sig="ippipp";function _emscripten_set_touchcancel_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerTouchEventCallback(e,t,r,n,25,"touchcancel")}_emscripten_set_touchcancel_callback_on_thread.sig="ippipp";var fillGamepadEventData=(e,t)=>{HEAPF64[e>>>3>>>0]=t.timestamp;for(var r=0;r>>3>>>0]=t.axes[r];for(var r=0;r>>3>>>0]=t.buttons[r].value:HEAPF64[e+r*8+528>>>3>>>0]=t.buttons[r];for(var r=0;r>>0]=t.buttons[r].pressed:HEAP8[e+r+1040>>>0]=t.buttons[r]==1;HEAP8[e+1104>>>0]=t.connected,HEAP32[e+1108>>>2>>>0]=t.index,HEAP32[e+8>>>2>>>0]=t.axes.length,HEAP32[e+12>>>2>>>0]=t.buttons.length,stringToUTF8(t.id,e+1112,64),stringToUTF8(t.mapping,e+1176,64)},registerGamepadEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.gamepadEvent||(JSEvents.gamepadEvent=_malloc(1240));var u=(d=event)=>{var p=JSEvents.gamepadEvent;fillGamepadEventData(p,d.gamepad),getWasmTableEntry(n)(a,p,t)&&d.preventDefault()},_={target:findEventTarget(e),allowsDeferredCalls:!0,eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)},_emscripten_sample_gamepad_data=()=>{try{if(navigator.getGamepads)return(JSEvents.lastGamepadState=navigator.getGamepads())?0:-1}catch{navigator.getGamepads=null}return-1};_emscripten_sample_gamepad_data.sig="i";function _emscripten_set_gamepadconnected_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,_emscripten_sample_gamepad_data()?-1:registerGamepadEventCallback(2,e,t,r,26,"gamepadconnected")}_emscripten_set_gamepadconnected_callback_on_thread.sig="ipipp";function _emscripten_set_gamepaddisconnected_callback_on_thread(e,t,r,n){return e>>>=0,r>>>=0,_emscripten_sample_gamepad_data()?-1:registerGamepadEventCallback(2,e,t,r,27,"gamepaddisconnected")}_emscripten_set_gamepaddisconnected_callback_on_thread.sig="ipipp";var _emscripten_get_num_gamepads=()=>JSEvents.lastGamepadState.length;_emscripten_get_num_gamepads.sig="i";function _emscripten_get_gamepad_status(e,t){return t>>>=0,e<0||e>=JSEvents.lastGamepadState.length?-5:JSEvents.lastGamepadState[e]?(fillGamepadEventData(t,JSEvents.lastGamepadState[e]),0):-7}_emscripten_get_gamepad_status.sig="iip";var registerBeforeUnloadEventCallback=(e,t,r,n,a,o)=>{var l=(_=event)=>{var d=getWasmTableEntry(n)(a,0,t);if(d&&(d=UTF8ToString(d)),d)return _.preventDefault(),_.returnValue=d,d},u={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:l,useCapture:r};return JSEvents.registerOrRemoveHandler(u)};function _emscripten_set_beforeunload_callback_on_thread(e,t,r){return e>>>=0,t>>>=0,r>>>=0,typeof onbeforeunload>"u"?-1:r!==1?-5:registerBeforeUnloadEventCallback(2,e,!0,t,28,"beforeunload")}_emscripten_set_beforeunload_callback_on_thread.sig="ippp";var fillBatteryEventData=(e,t)=>{HEAPF64[e>>>3>>>0]=t.chargingTime,HEAPF64[e+8>>>3>>>0]=t.dischargingTime,HEAPF64[e+16>>>3>>>0]=t.level,HEAP8[e+24>>>0]=t.charging},battery=()=>navigator.battery||navigator.mozBattery||navigator.webkitBattery,registerBatteryEventCallback=(e,t,r,n,a,o,l)=>{JSEvents.batteryEvent||(JSEvents.batteryEvent=_malloc(32));var u=(d=event)=>{var p=JSEvents.batteryEvent;fillBatteryEventData(p,battery()),getWasmTableEntry(n)(a,p,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};return JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_batterychargingchange_callback_on_thread(e,t,r){return e>>>=0,t>>>=0,battery()?registerBatteryEventCallback(battery(),e,!0,t,29,"chargingchange"):-1}_emscripten_set_batterychargingchange_callback_on_thread.sig="ippp";function _emscripten_set_batterylevelchange_callback_on_thread(e,t,r){return e>>>=0,t>>>=0,battery()?registerBatteryEventCallback(battery(),e,!0,t,30,"levelchange"):-1}_emscripten_set_batterylevelchange_callback_on_thread.sig="ippp";function _emscripten_get_battery_status(e){return e>>>=0,battery()?(fillBatteryEventData(e,battery()),0):-1}_emscripten_get_battery_status.sig="ip";function _emscripten_set_element_css_size(e,t,r){return e>>>=0,e=findEventTarget(e),e?(e.style.width=t+"px",e.style.height=r+"px",0):-4}_emscripten_set_element_css_size.sig="ipdd";function _emscripten_get_element_css_size(e,t,r){if(e>>>=0,t>>>=0,r>>>=0,e=findEventTarget(e),!e)return-4;var n=getBoundingClientRect(e);return HEAPF64[t>>>3>>>0]=n.width,HEAPF64[r>>>3>>>0]=n.height,0}_emscripten_get_element_css_size.sig="ippp";var _emscripten_html5_remove_all_event_listeners=()=>JSEvents.removeAllEventListeners();_emscripten_html5_remove_all_event_listeners.sig="v";var _emscripten_request_animation_frame=function(e,t){return e>>>=0,t>>>=0,requestAnimationFrame(r=>getWasmTableEntry(e)(r,t))};_emscripten_request_animation_frame.sig="ipp";var _emscripten_cancel_animation_frame=e=>cancelAnimationFrame(e);_emscripten_cancel_animation_frame.sig="vi";function _emscripten_request_animation_frame_loop(e,t){e>>>=0,t>>>=0;function r(n){getWasmTableEntry(e)(n,t)&&requestAnimationFrame(r)}return requestAnimationFrame(r)}_emscripten_request_animation_frame_loop.sig="vpp";var _emscripten_performance_now=()=>performance.now();_emscripten_performance_now.sig="d";var _emscripten_get_device_pixel_ratio=()=>typeof devicePixelRatio=="number"&&devicePixelRatio||1;_emscripten_get_device_pixel_ratio.sig="d";function _emscripten_get_callstack(e,t,r){t>>>=0;var n=getCallstack(e);if(!t||r<=0)return lengthBytesUTF8(n)+1;var a=stringToUTF8(n,t,r);return a+1}_emscripten_get_callstack.sig="iipi";var convertFrameToPC=e=>(abort("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0);function _emscripten_return_address(e){var t=jsStackTrace().split(` +`);return t[0]=="Error"&&t.shift(),t[e+3],convertFrameToPC()}_emscripten_return_address.sig="pi";var UNWIND_CACHE={},saveInUnwindCache=e=>{e.forEach(t=>{convertFrameToPC()})};function _emscripten_stack_snapshot(){var e=jsStackTrace().split(` +`);return e[0]=="Error"&&e.shift(),saveInUnwindCache(e),UNWIND_CACHE.last_addr=convertFrameToPC(e[3]),UNWIND_CACHE.last_stack=e,UNWIND_CACHE.last_addr}_emscripten_stack_snapshot.sig="p";function _emscripten_stack_unwind_buffer(e,t,r){e>>>=0,t>>>=0;var n;UNWIND_CACHE.last_addr==e?n=UNWIND_CACHE.last_stack:(n=jsStackTrace().split(` +`),n[0]=="Error"&&n.shift(),saveInUnwindCache(n));for(var a=3;n[a]&&convertFrameToPC(n[a])!=e;)++a;for(var o=0;o>>2>>>0]=convertFrameToPC(n[o+a]);return o}_emscripten_stack_unwind_buffer.sig="ippi";function _emscripten_pc_get_function(e){return abort("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}_emscripten_pc_get_function.sig="pp";var convertPCtoSourceLocation=e=>{if(UNWIND_CACHE.last_get_source_pc==e)return UNWIND_CACHE.last_source;var t,r;if(!r){var n=UNWIND_CACHE[e];if(!n)return null;(t=/\((.*):(\d+):(\d+)\)$/.exec(n))?r={file:t[1],line:t[2],column:t[3]}:(t=/@(.*):(\d+):(\d+)/.exec(n))&&(r={file:t[1],line:t[2],column:t[3]})}return UNWIND_CACHE.last_get_source_pc=e,UNWIND_CACHE.last_source=r,r};function _emscripten_pc_get_file(e){e>>>=0;var t=convertPCtoSourceLocation(e);return t?(_emscripten_pc_get_file.ret&&_free(_emscripten_pc_get_file.ret),_emscripten_pc_get_file.ret=stringToNewUTF8(t.file),_emscripten_pc_get_file.ret):0}_emscripten_pc_get_file.sig="pp";function _emscripten_pc_get_line(e){e>>>=0;var t=convertPCtoSourceLocation(e);return t?t.line:0}_emscripten_pc_get_line.sig="ip";function _emscripten_pc_get_column(e){e>>>=0;var t=convertPCtoSourceLocation(e);return t&&t.column||0}_emscripten_pc_get_column.sig="ip";var _sched_yield=()=>0;Module._sched_yield=_sched_yield,_sched_yield.sig="i";function _random_get(e,t){e>>>=0,t>>>=0;try{return _getentropy(e,t),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return r.errno}}_random_get.sig="ipp";var checkWasiClock=e=>e==0||e==1||e==2||e==3;function _clock_time_get(e,t,r,n){if(n>>>=0,!checkWasiClock(e))return 28;var a;e===0?a=Date.now():a=_emscripten_get_now();var o=Math.round(a*1e3*1e3);return HEAP32[n>>>2>>>0]=o>>>0,HEAP32[n+4>>>2>>>0]=o/Math.pow(2,32)>>>0,0}_clock_time_get.sig="iiiip";function _clock_res_get(e,t){if(t>>>=0,!checkWasiClock(e))return 28;var r;return e===0?r=1e6:r=_emscripten_get_now_res(),HEAP32[t>>>2>>>0]=r>>>0,HEAP32[t+4>>>2>>>0]=r/Math.pow(2,32)>>>0,0}_clock_res_get.sig="iip";var _emscripten_unwind_to_js_event_loop=()=>{throw"unwind"};_emscripten_unwind_to_js_event_loop.sig="v";var safeSetTimeout=(e,t)=>setTimeout(()=>{callUserCallback(e)},t),setImmediateWrapped=e=>{setImmediateWrapped.mapping||(setImmediateWrapped.mapping=[]);var t=setImmediateWrapped.mapping.length;return setImmediateWrapped.mapping[t]=setImmediate(()=>{setImmediateWrapped.mapping[t]=void 0,e()}),t},clearImmediateWrapped=e=>{clearImmediate(setImmediateWrapped.mapping[e]),setImmediateWrapped.mapping[e]=void 0},_emscripten_set_immediate=function(e,t){return e>>>=0,t>>>=0,emSetImmediate(()=>{callUserCallback(()=>getWasmTableEntry(e)(t))})};_emscripten_set_immediate.sig="ipp";var _emscripten_clear_immediate=e=>{emClearImmediate(e)};_emscripten_clear_immediate.sig="vi";var _emscripten_set_immediate_loop=function(e,t){e>>>=0,t>>>=0;function r(){callUserCallback(()=>{getWasmTableEntry(e)(t)&&emSetImmediate(r)})}emSetImmediate(r)};_emscripten_set_immediate_loop.sig="vpp";var _emscripten_set_timeout=function(e,t,r){return e>>>=0,r>>>=0,safeSetTimeout(()=>getWasmTableEntry(e)(r),t)};_emscripten_set_timeout.sig="ipdp";var _emscripten_clear_timeout=clearTimeout;_emscripten_clear_timeout.sig="vi";var _emscripten_set_timeout_loop=function(e,t,r){e>>>=0,r>>>=0;function n(){var a=_emscripten_get_now(),o=a+t;callUserCallback(()=>{getWasmTableEntry(e)(a,r)&&setTimeout(n,o-_emscripten_get_now())})}return setTimeout(n,0)};_emscripten_set_timeout_loop.sig="vpdp";var _emscripten_set_interval=function(e,t,r){return e>>>=0,r>>>=0,setInterval(()=>{callUserCallback(()=>getWasmTableEntry(e)(r))},t)};_emscripten_set_interval.sig="ipdp";var _emscripten_clear_interval=e=>{clearInterval(e)};_emscripten_clear_interval.sig="vi";var registerPostMainLoop=e=>{typeof MainLoop<"u"&&MainLoop.postMainLoop.push(e)};function _emscripten_get_main_loop_timing(e,t){e>>>=0,t>>>=0,e&&(HEAP32[e>>>2>>>0]=MainLoop.timingMode),t&&(HEAP32[t>>>2>>>0]=MainLoop.timingValue)}_emscripten_get_main_loop_timing.sig="vpp";function _emscripten_set_main_loop(e,t,r){e>>>=0;var n=getWasmTableEntry(e);setMainLoop(n,t,r)}_emscripten_set_main_loop.sig="vpii";var _emscripten_set_main_loop_arg=function(e,t,r,n){e>>>=0,t>>>=0;var a=()=>getWasmTableEntry(e)(t);setMainLoop(a,r,n,t)};_emscripten_set_main_loop_arg.sig="vppii";var _emscripten_cancel_main_loop=()=>{MainLoop.pause(),MainLoop.func=null};_emscripten_cancel_main_loop.sig="v";var _emscripten_pause_main_loop=()=>{MainLoop.pause()};_emscripten_pause_main_loop.sig="v";var _emscripten_resume_main_loop=()=>{MainLoop.resume()};_emscripten_resume_main_loop.sig="v";var __emscripten_push_main_loop_blocker=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,MainLoop.queue.push({func:()=>{getWasmTableEntry(e)(t)},name:UTF8ToString(r),counted:!0}),MainLoop.updateStatus()};__emscripten_push_main_loop_blocker.sig="vppp";var __emscripten_push_uncounted_main_loop_blocker=function(e,t,r){e>>>=0,t>>>=0,r>>>=0,MainLoop.queue.push({func:()=>{getWasmTableEntry(e)(t)},name:UTF8ToString(r),counted:!1}),MainLoop.updateStatus()};__emscripten_push_uncounted_main_loop_blocker.sig="vppp";var _emscripten_set_main_loop_expected_blockers=e=>{MainLoop.expectedBlockers=e,MainLoop.remainingBlockers=e,MainLoop.updateStatus()};_emscripten_set_main_loop_expected_blockers.sig="vi";var idsToPromises=(e,t)=>{for(var r=[],n=0;n>>2>>>0];r[n]=getPromise(a)}return r},makePromiseCallback=(e,t)=>r=>{var n=stackSave(),a=stackAlloc(POINTER_SIZE);HEAPU32[a>>>2>>>0]=0;try{var o=getWasmTableEntry(e)(a,t,r),l=HEAPU32[a>>>2>>>0]}catch(_){throw typeof _!="number"?0:_}finally{stackRestore(n)}switch(o){case 0:return l;case 1:return getPromise(l);case 2:var u=getPromise(l);return _emscripten_promise_destroy(l),u;case 3:throw l}};function _emscripten_promise_then(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=getPromise(e),o=promiseMap.allocate({promise:a.then(makePromiseCallback(t,n),makePromiseCallback(r,n))});return o}_emscripten_promise_then.sig="ppppp";var _emscripten_promise_all=function(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=idsToPromises(e,r),a=promiseMap.allocate({promise:Promise.all(n).then(o=>{if(t)for(var l=0;l>>2>>>0]=u}return t})});return a};_emscripten_promise_all.sig="pppp";var setPromiseResult=(e,t,r)=>{var n=t?0:3;HEAP32[e>>>2>>>0]=n,HEAPU32[e+4>>>2>>>0]=r},_emscripten_promise_all_settled=function(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=idsToPromises(e,r),a=promiseMap.allocate({promise:Promise.allSettled(n).then(o=>{if(t)for(var l=t,u=0;u>>=0,t>>>=0,r>>>=0;var n=idsToPromises(e,r),a=promiseMap.allocate({promise:Promise.any(n).catch(o=>{if(t)for(var l=0;l>>2>>>0]=o.errors[l];throw t})});return a};_emscripten_promise_any.sig="pppp";function _emscripten_promise_race(e,t){e>>>=0,t>>>=0;var r=idsToPromises(e,t),n=promiseMap.allocate({promise:Promise.race(r)});return n}_emscripten_promise_race.sig="ppp";function _emscripten_promise_await(e,t){abort("emscripten_promise_await is only available with ASYNCIFY")}_emscripten_promise_await.sig="vpp";function ___cxa_call_unexpected(e){return abort("Unexpected exception thrown, this is not properly supported - aborting")}___cxa_call_unexpected.sig="vp";var Browser={useWebGL:!1,isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(Browser.initted)return;Browser.initted=!0;var e={};e.canHandle=function(a){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp|webp)$/i.test(a)},e.handle=function(a,o,l,u){var _=new Blob([a],{type:Browser.getMimetype(o)});_.size!==a.length&&(_=new Blob([new Uint8Array(a).buffer],{type:Browser.getMimetype(o)}));var d=URL.createObjectURL(_),p=new Image;p.onload=()=>{var f=document.createElement("canvas");f.width=p.width,f.height=p.height;var m=f.getContext("2d");m.drawImage(p,0,0),preloadedImages[o]=f,URL.revokeObjectURL(d),l==null||l(a)},p.onerror=f=>{err("Image ".concat(d," could not be decoded")),u==null||u()},p.src=d},preloadPlugins.push(e);var t={};t.canHandle=function(a){return!Module.noAudioDecoding&&a.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},t.handle=function(a,o,l,u){var _=!1;function d(h){_||(_=!0,preloadedAudios[o]=h,l==null||l(a))}var p=new Blob([a],{type:Browser.getMimetype(o)}),f=URL.createObjectURL(p),m=new Audio;m.addEventListener("canplaythrough",()=>d(m),!1),m.onerror=function(h){if(_)return;err("warning: browser could not fully decode audio ".concat(o,", trying slower base64 approach"));function g(b){for(var v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S="=",L="",T=0,A=0,M=0;M=6;){var X=T>>A-6&63;A-=6,L+=v[X]}return A==2?(L+=v[(T&3)<<4],L+=S+S):A==4&&(L+=v[(T&15)<<2],L+=S),L}m.src="data:audio/x-"+o.substr(-3)+";base64,"+g(a),d(m)},m.src=f,safeSetTimeout(()=>{d(m)},1e4)},preloadPlugins.push(t);function r(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}var n=Module.canvas;n&&(n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock||(()=>{}),n.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),n.exitPointerLock=n.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",r,!1),document.addEventListener("mozpointerlockchange",r,!1),document.addEventListener("webkitpointerlockchange",r,!1),document.addEventListener("mspointerlockchange",r,!1),Module.elementPointerLock&&n.addEventListener("click",a=>{!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),a.preventDefault())},!1))},createContext(e,t,r,n){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var a,o;if(t){var l={antialias:!1,alpha:!1,majorVersion:1};if(n)for(var u in n)l[u]=n[u];typeof GL<"u"&&(o=GL.createContext(e,l),o&&(a=GL.getContext(o).GLctx))}else a=e.getContext("2d");return a?(r&&(Module.ctx=a,t&&GL.makeContextCurrent(o),Browser.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach(_=>_()),Browser.init()),a):null},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){Browser.lockPointer=e,Browser.resizeCanvas=t,typeof Browser.lockPointer>"u"&&(Browser.lockPointer=!0),typeof Browser.resizeCanvas>"u"&&(Browser.resizeCanvas=!1);var r=Module.canvas;function n(){var o,l;Browser.isFullscreen=!1;var u=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===u?(r.exitFullscreen=Browser.exitFullscreen,Browser.lockPointer&&r.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas?Browser.setFullscreenCanvasSize():Browser.updateCanvasDimensions(r)):(u.parentNode.insertBefore(r,u),u.parentNode.removeChild(u),Browser.resizeCanvas?Browser.setWindowedCanvasSize():Browser.updateCanvasDimensions(r)),(o=Module.onFullScreen)==null||o.call(Module,Browser.isFullscreen),(l=Module.onFullscreen)==null||l.call(Module,Browser.isFullscreen)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");r.parentNode.insertBefore(a,r),a.appendChild(r),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?()=>a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(a.webkitRequestFullScreen?()=>a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),a.requestFullscreen()},exitFullscreen(){if(!Browser.isFullscreen)return!1;var e=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{});return e.apply(document,[]),!0},safeSetTimeout(e,t){return safeSetTimeout(e,t)},getMimetype(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseCoords(e,t){var r=Module.canvas.getBoundingClientRect(),n=Module.canvas.width,a=Module.canvas.height,o=typeof window.scrollX<"u"?window.scrollX:window.pageXOffset,l=typeof window.scrollY<"u"?window.scrollY:window.pageYOffset,u=e-(o+r.left),_=t-(l+r.top);return u=u*(n/r.width),_=_*(a/r.height),{x:u,y:_}},setMouseCoords(e,t){let{x:r,y:n}=Browser.calculateMouseCoords(e,t);Browser.mouseMovementX=r-Browser.mouseX,Browser.mouseMovementY=n-Browser.mouseY,Browser.mouseX=r,Browser.mouseY=n},calculateMouseEvent(e){if(Browser.pointerLock)e.type!="mousemove"&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY;else{if(e.type==="touchstart"||e.type==="touchend"||e.type==="touchmove"){var t=e.touch;if(t===void 0)return;var r=Browser.calculateMouseCoords(t.pageX,t.pageY);if(e.type==="touchstart")Browser.lastTouches[t.identifier]=r,Browser.touches[t.identifier]=r;else if(e.type==="touchend"||e.type==="touchmove"){var n=Browser.touches[t.identifier];n||(n=r),Browser.lastTouches[t.identifier]=n,Browser.touches[t.identifier]=r}return}Browser.setMouseCoords(e.pageX,e.pageY)}},resizeListeners:[],updateResizeListeners(){var e=Module.canvas;Browser.resizeListeners.forEach(t=>t(e.width,e.height))},setCanvasSize(e,t,r){var n=Module.canvas;Browser.updateCanvasDimensions(n,e,t),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL<"u"){var e=HEAPU32[SDL.screen>>>2>>>0];e=e|8388608,HEAP32[SDL.screen>>>2>>>0]=e}Browser.updateCanvasDimensions(Module.canvas),Browser.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL<"u"){var e=HEAPU32[SDL.screen>>>2>>>0];e=e&-8388609,HEAP32[SDL.screen>>>2>>>0]=e}Browser.updateCanvasDimensions(Module.canvas),Browser.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,a=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(n/a>>=0,t>>>=0,r>>>=0;var n=UTF8ToString(e),a=FS.analyzePath(n);return a.exists?(FS.createPreloadedFile(PATH.dirname(n),PATH.basename(n),new Uint8Array(a.object.contents),!0,!0,()=>{t&&getWasmTableEntry(t)(e)},()=>{r&&getWasmTableEntry(r)(e)},!0),0):-1};_emscripten_run_preload_plugins.sig="ippp";var Browser_asyncPrepareDataCounter=0,_emscripten_run_preload_plugins_data=function(e,t,r,n,a,o){e>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0;var l=UTF8ToString(r),u="prepare_data_"+Browser_asyncPrepareDataCounter+++"."+l,_=stringToNewUTF8(u);FS.createPreloadedFile("/",u,HEAPU8.subarray(e>>>0,e+t>>>0),!0,!0,()=>{a&&getWasmTableEntry(a)(n,_)},()=>{o&&getWasmTableEntry(o)(n)},!0)};_emscripten_run_preload_plugins_data.sig="vpipppp";var _emscripten_async_run_script=function(e,t){e>>>=0,safeSetTimeout(()=>_emscripten_run_script(e),t)};_emscripten_async_run_script.sig="vpi";var _emscripten_async_load_script=function(url,onload,onerror){url>>>=0,onload>>>=0,onerror>>>=0,url=UTF8ToString(url);var loadDone=()=>{if(onload){var e=()=>callUserCallback(getWasmTableEntry(onload));runDependencies>0?dependenciesFulfilled=e:e()}},loadError=()=>{onerror&&callUserCallback(getWasmTableEntry(onerror))};if(ENVIRONMENT_IS_NODE){readAsync(url,!1).then(data=>{eval(data),loadDone()},loadError);return}var script=document.createElement("script");script.onload=loadDone,script.onerror=loadError,script.src=url,document.body.appendChild(script)};_emscripten_async_load_script.sig="vppp";var safeRequestAnimationFrame=e=>MainLoop.requestAnimationFrame(()=>{callUserCallback(e)});function _emscripten_async_call(e,t,r){e>>>=0,t>>>=0;function n(){getWasmTableEntry(e)(t)}r>=0||ENVIRONMENT_IS_NODE?safeSetTimeout(n,r):safeRequestAnimationFrame(n)}_emscripten_async_call.sig="vppi";function _emscripten_get_window_title(){var e=256;return _emscripten_get_window_title.buffer||(_emscripten_get_window_title.buffer=_malloc(e)),stringToUTF8(document.title,_emscripten_get_window_title.buffer,e),_emscripten_get_window_title.buffer}_emscripten_get_window_title.sig="p";function _emscripten_set_window_title(e){return e>>>=0,document.title=UTF8ToString(e)}_emscripten_set_window_title.sig="vp";function _emscripten_get_screen_size(e,t){e>>>=0,t>>>=0,HEAP32[e>>>2>>>0]=screen.width,HEAP32[t>>>2>>>0]=screen.height}_emscripten_get_screen_size.sig="vpp";var _emscripten_hide_mouse=()=>{for(var e=document.styleSheets[0],t=e.cssRules,r=0;r{Browser.setCanvasSize(e,t)};_emscripten_set_canvas_size.sig="vii";function _emscripten_get_canvas_size(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=Module.canvas;HEAP32[e>>>2>>>0]=n.width,HEAP32[t>>>2>>>0]=n.height,HEAP32[r>>>2>>>0]=Browser.isFullscreen?1:0}_emscripten_get_canvas_size.sig="vppp";function _emscripten_create_worker(e){e>>>=0,e=UTF8ToString(e);var t=Browser.workers.length,r={worker:new Worker(e),callbacks:[],awaited:0,buffer:0,bufferSize:0};return r.worker.onmessage=function(n){if(!ABORT){var a=Browser.workers[t];if(a){var o=n.data.callbackId,l=a.callbacks[o];if(l){n.data.finalResponse&&(a.awaited--,a.callbacks[o]=null);var u=n.data.data;u?(u.byteLength||(u=new Uint8Array(u)),(!a.buffer||a.bufferSize>>0),l.func(a.buffer,u.length,l.arg)):l.func(0,0,l.arg)}}}},Browser.workers.push(r),t}_emscripten_create_worker.sig="ip";var _emscripten_destroy_worker=e=>{var t=Browser.workers[e];t.worker.terminate(),t.buffer&&_free(t.buffer),Browser.workers[e]=null};_emscripten_destroy_worker.sig="vi";function _emscripten_call_worker(e,t,r,n,a,o){t>>>=0,r>>>=0,a>>>=0,o>>>=0,t=UTF8ToString(t);var l=Browser.workers[e],u=-1;a&&(u=l.callbacks.length,l.callbacks.push({func:getWasmTableEntry(a),arg:o}),l.awaited++);var _={funcName:t,callbackId:u,data:r?new Uint8Array(HEAPU8.subarray(r>>>0,r+n>>>0)):0};r?l.worker.postMessage(_,[_.data.buffer]):l.worker.postMessage(_)}_emscripten_call_worker.sig="vippipp";var _emscripten_get_worker_queue_size=e=>{var t=Browser.workers[e];return t?t.awaited:-1};_emscripten_get_worker_queue_size.sig="ii";var getPreloadedImageData=(e,t,r)=>{e=PATH_FS.resolve(e);var n=preloadedImages[e];if(!n)return 0;var a=n.getContext("2d"),o=a.getImageData(0,0,n.width,n.height),l=_malloc(n.width*n.height*4);return HEAPU8.set(o.data,l>>>0),HEAP32[t>>>2>>>0]=n.width,HEAP32[r>>>2>>>0]=n.height,l};function _emscripten_get_preloaded_image_data(e,t,r){return e>>>=0,t>>>=0,r>>>=0,getPreloadedImageData(UTF8ToString(e),t,r)}_emscripten_get_preloaded_image_data.sig="pppp";function _emscripten_get_preloaded_image_data_from_FILE(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=_fileno(e),a=FS.getStream(n);return a?getPreloadedImageData(a.path,t,r):0}_emscripten_get_preloaded_image_data_from_FILE.sig="pppp";var wget={wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle(){var e=wget.nextWgetRequestHandle;return wget.nextWgetRequestHandle++,e}},FS_mkdirTree=(e,t)=>FS.mkdirTree(e,t),FS_unlink=e=>FS.unlink(e),_emscripten_async_wget=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=UTF8ToString(e),o=UTF8ToString(t);o=PATH_FS.resolve(o);function l(_){_&&callUserCallback(()=>{var d=stackSave();getWasmTableEntry(_)(stringToUTF8OnStack(o)),stackRestore(d)})}var u=PATH.dirname(o);FS_createPreloadedFile(u,PATH.basename(o),a,!0,!0,()=>l(r),()=>l(n),!1,!1,()=>{try{FS_unlink(o)}catch{}FS_mkdirTree(u)})};_emscripten_async_wget.sig="vpppp";var _emscripten_async_wget_data=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0,asyncLoad(UTF8ToString(e),a=>{callUserCallback(()=>{var o=_malloc(a.length);HEAPU8.set(a,o>>>0),getWasmTableEntry(r)(t,o,a.length),_free(o)})},()=>{n&&callUserCallback(()=>{getWasmTableEntry(n)(t)})},!0)};_emscripten_async_wget_data.sig="vpppp";var _emscripten_async_wget2=function(e,t,r,n,a,o,l,u){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0;var _=UTF8ToString(e),d=UTF8ToString(t);d=PATH_FS.resolve(d);var p=UTF8ToString(r),f=UTF8ToString(n),m=d.lastIndexOf("/"),h=new XMLHttpRequest;h.open(p,_,!0),h.responseType="arraybuffer";var g=wget.getNextWgetRequestHandle(),b=PATH.dirname(d);return h.onload=v=>{if(h.status>=200&&h.status<300){try{FS.unlink(d)}catch{}if(FS.mkdirTree(b),FS.createDataFile(d.substr(0,m),d.substr(m+1),new Uint8Array(h.response),!0,!0,!1),o){var S=stackSave();getWasmTableEntry(o)(g,a,stringToUTF8OnStack(d)),stackRestore(S)}}else l&&getWasmTableEntry(l)(g,a,h.status);delete wget.wgetRequests[g]},h.onerror=v=>{l&&getWasmTableEntry(l)(g,a,h.status),delete wget.wgetRequests[g]},h.onprogress=v=>{if(v.lengthComputable||v.lengthComputable===void 0&&v.total!=0){var S=v.loaded/v.total*100;u&&getWasmTableEntry(u)(g,a,S)}},h.onabort=v=>{delete wget.wgetRequests[g]},p=="POST"?(h.setRequestHeader("Content-type","application/x-www-form-urlencoded"),h.send(f)):h.send(null),wget.wgetRequests[g]=h,g};_emscripten_async_wget2.sig="ipppppppp";function _emscripten_async_wget2_data(e,t,r,n,a,o,l,u){e>>>=0,t>>>=0,r>>>=0,n>>>=0,o>>>=0,l>>>=0,u>>>=0;var _=UTF8ToString(e),d=UTF8ToString(t),p=UTF8ToString(r),f=new XMLHttpRequest;f.open(d,_,!0),f.responseType="arraybuffer";var m=wget.getNextWgetRequestHandle();function h(){if(l){var g=stackSave(),b=0;f.statusText&&(b=stringToUTF8OnStack(f.statusText)),getWasmTableEntry(l)(m,n,f.status,b),stackRestore(g)}}return f.onload=g=>{if(f.status>=200&&f.status<300||f.status===0&&_.substr(0,4).toLowerCase()!="http"){var b=new Uint8Array(f.response),v=_malloc(b.length);HEAPU8.set(b,v>>>0),o&&getWasmTableEntry(o)(m,n,v,b.length),a&&_free(v)}else h();delete wget.wgetRequests[m]},f.onerror=g=>{h(),delete wget.wgetRequests[m]},f.onprogress=g=>{u&&getWasmTableEntry(u)(m,n,g.loaded,g.lengthComputable||g.lengthComputable===void 0?g.total:0)},f.onabort=g=>{delete wget.wgetRequests[m]},d=="POST"?(f.setRequestHeader("Content-type","application/x-www-form-urlencoded"),f.send(p)):f.send(null),wget.wgetRequests[m]=f,m}_emscripten_async_wget2_data.sig="ippppippp";var _emscripten_async_wget2_abort=e=>{var t=wget.wgetRequests[e];t==null||t.abort()};_emscripten_async_wget2_abort.sig="vi";function ___asctime_r(e,t){e>>>=0,t>>>=0;var r={tm_sec:HEAP32[e>>>2>>>0],tm_min:HEAP32[e+4>>>2>>>0],tm_hour:HEAP32[e+8>>>2>>>0],tm_mday:HEAP32[e+12>>>2>>>0],tm_mon:HEAP32[e+16>>>2>>>0],tm_year:HEAP32[e+20>>>2>>>0],tm_wday:HEAP32[e+24>>>2>>>0]},n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o=n[r.tm_wday]+" "+a[r.tm_mon]+(r.tm_mday<10?" ":" ")+r.tm_mday+(r.tm_hour<10?" 0":" ")+r.tm_hour+(r.tm_min<10?":0":":")+r.tm_min+(r.tm_sec<10?":0":":")+r.tm_sec+" "+(1900+r.tm_year)+` +`;return stringToUTF8(o,t,26),t}___asctime_r.sig="ppp";function _strptime_l(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,_strptime(e,t,r)}_strptime_l.sig="ppppp";function ___syscall_shutdown(e,t){try{return getSocketFromFD(e),-52}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}Module.___syscall_shutdown=___syscall_shutdown,___syscall_shutdown.sig="iiiiiii";function __dlsym_catchup_js(e,t){e>>>=0;var r=LDSO.loadedLibsByHandle[e],n=r.exports,a=Object.keys(n)[t],o=n[a],l=addFunction(o,o.sig);return l}__dlsym_catchup_js.sig="ppi",FS.createPath,FS.createDevice,FS.readFile,FS.createLazyFile;var _setNetworkCallback=(e,t,r)=>{function n(a){try{if(e==="error"){var o=stackSave(),l=stringToUTF8OnStack(a[2]);getWasmTableEntry(r)(a[0],a[1],l,t),stackRestore(o)}else getWasmTableEntry(r)(a,t)}catch(u){if(!(u instanceof ExitStatus))throw u&&typeof u=="object"&&u.stack&&err("exception thrown: "+[u,u.stack]),u}}Module.websocket.on(e,r?n:null)};function _emscripten_set_socket_error_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("error",e,t)}_emscripten_set_socket_error_callback.sig="vpp";function _emscripten_set_socket_open_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("open",e,t)}_emscripten_set_socket_open_callback.sig="vpp";function _emscripten_set_socket_listen_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("listen",e,t)}_emscripten_set_socket_listen_callback.sig="vpp";function _emscripten_set_socket_connection_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("connection",e,t)}_emscripten_set_socket_connection_callback.sig="vpp";function _emscripten_set_socket_message_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("message",e,t)}_emscripten_set_socket_message_callback.sig="vpp";function _emscripten_set_socket_close_callback(e,t){e>>>=0,t>>>=0,_setNetworkCallback("close",e,t)}_emscripten_set_socket_close_callback.sig="vpp";function _emscripten_webgl_enable_ANGLE_instanced_arrays(e){return e>>>=0,webgl_enable_ANGLE_instanced_arrays(GL.contexts[e].GLctx)}_emscripten_webgl_enable_ANGLE_instanced_arrays.sig="ip";function _emscripten_webgl_enable_OES_vertex_array_object(e){return e>>>=0,webgl_enable_OES_vertex_array_object(GL.contexts[e].GLctx)}_emscripten_webgl_enable_OES_vertex_array_object.sig="ip";function _emscripten_webgl_enable_WEBGL_draw_buffers(e){return e>>>=0,webgl_enable_WEBGL_draw_buffers(GL.contexts[e].GLctx)}_emscripten_webgl_enable_WEBGL_draw_buffers.sig="ip";function _emscripten_webgl_enable_WEBGL_multi_draw(e){return e>>>=0,webgl_enable_WEBGL_multi_draw(GL.contexts[e].GLctx)}_emscripten_webgl_enable_WEBGL_multi_draw.sig="ip";function _emscripten_webgl_enable_EXT_polygon_offset_clamp(e){return e>>>=0,webgl_enable_EXT_polygon_offset_clamp(GL.contexts[e].GLctx)}_emscripten_webgl_enable_EXT_polygon_offset_clamp.sig="ip";function _emscripten_webgl_enable_EXT_clip_control(e){return e>>>=0,webgl_enable_EXT_clip_control(GL.contexts[e].GLctx)}_emscripten_webgl_enable_EXT_clip_control.sig="ip";function _emscripten_webgl_enable_WEBGL_polygon_mode(e){return e>>>=0,webgl_enable_WEBGL_polygon_mode(GL.contexts[e].GLctx)}_emscripten_webgl_enable_WEBGL_polygon_mode.sig="ip";function _glVertexPointer(e,t,r,n){throw"Legacy GL function (glVertexPointer) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."}_glVertexPointer.sig="viiip";var _glMatrixMode=()=>{throw"Legacy GL function (glMatrixMode) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."};_glMatrixMode.sig="vi";var _glBegin=()=>{throw"Legacy GL function (glBegin) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."};_glBegin.sig="vi";var _glLoadIdentity=()=>{throw"Legacy GL function (glLoadIdentity) called. If you want legacy GL emulation, you need to compile with -sLEGACY_GL_EMULATION to enable legacy GL emulation."};_glLoadIdentity.sig="v";var _glVertexAttribDivisorNV=_glVertexAttribDivisor,_glDrawArraysInstancedNV=_glDrawArraysInstanced,_glDrawElementsInstancedNV=_glDrawElementsInstanced,_glVertexAttribDivisorEXT=_glVertexAttribDivisor,_glDrawArraysInstancedEXT=_glDrawArraysInstanced,_glDrawElementsInstancedEXT=_glDrawElementsInstanced,_glVertexAttribDivisorARB=_glVertexAttribDivisor,_glDrawArraysInstancedARB=_glDrawArraysInstanced,_glDrawElementsInstancedARB=_glDrawElementsInstanced,_glDrawBuffersEXT=_glDrawBuffers;function _glMultiDrawArraysWEBGL(e,t,r,n){t>>>=0,r>>>=0,GLctx.multiDrawWebgl.multiDrawArraysWEBGL(e,HEAP32,t>>>2,HEAP32,r>>>2,n)}_glMultiDrawArraysWEBGL.sig="vippi";var _glMultiDrawArrays=_glMultiDrawArraysWEBGL;_glMultiDrawArrays.sig="vippi";var _glMultiDrawArraysANGLE=_glMultiDrawArraysWEBGL;function _glMultiDrawArraysInstancedWEBGL(e,t,r,n,a){t>>>=0,r>>>=0,n>>>=0,GLctx.multiDrawWebgl.multiDrawArraysInstancedWEBGL(e,HEAP32,t>>>2,HEAP32,r>>>2,HEAP32,n>>>2,a)}_glMultiDrawArraysInstancedWEBGL.sig="vipppi";var _glMultiDrawArraysInstancedANGLE=_glMultiDrawArraysInstancedWEBGL;function _glMultiDrawElementsWEBGL(e,t,r,n,a){t>>>=0,n>>>=0,GLctx.multiDrawWebgl.multiDrawElementsWEBGL(e,HEAP32,t>>>2,r,HEAP32,n>>>2,a)}_glMultiDrawElementsWEBGL.sig="vipipi";var _glMultiDrawElements=_glMultiDrawElementsWEBGL;_glMultiDrawElements.sig="vipipi";var _glMultiDrawElementsANGLE=_glMultiDrawElementsWEBGL;function _glMultiDrawElementsInstancedWEBGL(e,t,r,n,a,o){t>>>=0,n>>>=0,a>>>=0,GLctx.multiDrawWebgl.multiDrawElementsInstancedWEBGL(e,HEAP32,t>>>2,r,HEAP32,n>>>2,HEAP32,a>>>2,o)}_glMultiDrawElementsInstancedWEBGL.sig="vipippi";var _glMultiDrawElementsInstancedANGLE=_glMultiDrawElementsInstancedWEBGL,_glClearDepth=e=>GLctx.clearDepth(e);_glClearDepth.sig="vd";var _glDepthRange=(e,t)=>GLctx.depthRange(e,t);_glDepthRange.sig="vdd";var _emscripten_glGenVertexArrays=_glGenVertexArrays;_emscripten_glGenVertexArrays.sig="vip";var _emscripten_glDeleteVertexArrays=_glDeleteVertexArrays;_emscripten_glDeleteVertexArrays.sig="vip";var _emscripten_glBindVertexArray=_glBindVertexArray;_emscripten_glBindVertexArray.sig="vi";var _emscripten_glIsVertexArray=_glIsVertexArray;_emscripten_glIsVertexArray.sig="ii";var _emscripten_glVertexPointer=_glVertexPointer;_emscripten_glVertexPointer.sig="viiip";var _emscripten_glMatrixMode=_glMatrixMode;_emscripten_glMatrixMode.sig="vi";var _emscripten_glBegin=_glBegin;_emscripten_glBegin.sig="vi";var _emscripten_glLoadIdentity=_glLoadIdentity;_emscripten_glLoadIdentity.sig="v";var _emscripten_glVertexAttribDivisor=_glVertexAttribDivisor;_emscripten_glVertexAttribDivisor.sig="vii";var _emscripten_glDrawArraysInstanced=_glDrawArraysInstanced;_emscripten_glDrawArraysInstanced.sig="viiii";var _emscripten_glDrawElementsInstanced=_glDrawElementsInstanced;_emscripten_glDrawElementsInstanced.sig="viiipi";var _emscripten_glVertexAttribDivisorNV=_glVertexAttribDivisorNV,_emscripten_glDrawArraysInstancedNV=_glDrawArraysInstancedNV,_emscripten_glDrawElementsInstancedNV=_glDrawElementsInstancedNV,_emscripten_glVertexAttribDivisorEXT=_glVertexAttribDivisorEXT,_emscripten_glDrawArraysInstancedEXT=_glDrawArraysInstancedEXT,_emscripten_glDrawElementsInstancedEXT=_glDrawElementsInstancedEXT,_emscripten_glVertexAttribDivisorARB=_glVertexAttribDivisorARB,_emscripten_glDrawArraysInstancedARB=_glDrawArraysInstancedARB,_emscripten_glDrawElementsInstancedARB=_glDrawElementsInstancedARB,_emscripten_glDrawBuffers=_glDrawBuffers;_emscripten_glDrawBuffers.sig="vip";var _emscripten_glDrawBuffersEXT=_glDrawBuffersEXT,_emscripten_glMultiDrawArrays=_glMultiDrawArrays;_emscripten_glMultiDrawArrays.sig="vippi";var _emscripten_glMultiDrawArraysANGLE=_glMultiDrawArraysANGLE,_emscripten_glMultiDrawArraysWEBGL=_glMultiDrawArraysWEBGL,_emscripten_glMultiDrawArraysInstancedANGLE=_glMultiDrawArraysInstancedANGLE,_emscripten_glMultiDrawArraysInstancedWEBGL=_glMultiDrawArraysInstancedWEBGL,_emscripten_glMultiDrawElements=_glMultiDrawElements;_emscripten_glMultiDrawElements.sig="vipipi";var _emscripten_glMultiDrawElementsANGLE=_glMultiDrawElementsANGLE,_emscripten_glMultiDrawElementsWEBGL=_glMultiDrawElementsWEBGL,_emscripten_glMultiDrawElementsInstancedANGLE=_glMultiDrawElementsInstancedANGLE,_emscripten_glMultiDrawElementsInstancedWEBGL=_glMultiDrawElementsInstancedWEBGL,_emscripten_glClearDepth=_glClearDepth;_emscripten_glClearDepth.sig="vd";var _emscripten_glDepthRange=_glDepthRange;_emscripten_glDepthRange.sig="vdd";var writeGLArray=(e,t,r,n)=>{var a=e.length,o=r>>2;for(var u=0;u>>0]=e[u];return a},webglPowerPreferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(e,t){e>>>=0,t>>>=0;var r=t>>>2,n=HEAP32[r+2>>>0],a={alpha:!!HEAP8[t+0>>>0],depth:!!HEAP8[t+1>>>0],stencil:!!HEAP8[t+2>>>0],antialias:!!HEAP8[t+3>>>0],premultipliedAlpha:!!HEAP8[t+4>>>0],preserveDrawingBuffer:!!HEAP8[t+5>>>0],powerPreference:webglPowerPreferences[n],failIfMajorPerformanceCaveat:!!HEAP8[t+12>>>0],majorVersion:HEAP32[r+4>>>0],minorVersion:HEAP32[r+5>>>0],enableExtensionsByDefault:HEAP8[t+24>>>0],explicitSwapControl:HEAP8[t+25>>>0],proxyContextToMainThread:HEAP32[r+7>>>0],renderViaOffscreenBackBuffer:HEAP8[t+32>>>0]},o=findCanvasEventTarget(e);if(!o||a.explicitSwapControl)return 0;var l=GL.createContext(o,a);return l}_emscripten_webgl_do_create_context.sig="ppp";var _emscripten_webgl_create_context=_emscripten_webgl_do_create_context;_emscripten_webgl_create_context.sig="ppp";function _emscripten_webgl_do_get_current_context(){return GL.currentContext?GL.currentContext.handle:0}_emscripten_webgl_do_get_current_context.sig="p";var _emscripten_webgl_get_current_context=_emscripten_webgl_do_get_current_context;_emscripten_webgl_get_current_context.sig="p";var _emscripten_webgl_do_commit_frame=()=>!GL.currentContext||!GL.currentContext.GLctx||!GL.currentContext.attributes.explicitSwapControl?-3:0;_emscripten_webgl_do_commit_frame.sig="i";var _emscripten_webgl_commit_frame=_emscripten_webgl_do_commit_frame;_emscripten_webgl_commit_frame.sig="i";function _emscripten_webgl_make_context_current(e){e>>>=0;var t=GL.makeContextCurrent(e);return t?0:-5}_emscripten_webgl_make_context_current.sig="ip";function _emscripten_webgl_get_drawing_buffer_size(e,t,r){e>>>=0,t>>>=0,r>>>=0;var n=GL.getContext(e);return!n||!n.GLctx||!t||!r?-5:(HEAP32[t>>>2>>>0]=n.GLctx.drawingBufferWidth,HEAP32[r>>>2>>>0]=n.GLctx.drawingBufferHeight,0)}_emscripten_webgl_get_drawing_buffer_size.sig="ippp";function _emscripten_webgl_get_context_attributes(e,t){if(e>>>=0,t>>>=0,!t)return-5;if(e=GL.contexts[e],!e)return-3;var r=e.GLctx;if(!r)return-3;r=r.getContextAttributes(),HEAP8[t>>>0]=r.alpha,HEAP8[t+1>>>0]=r.depth,HEAP8[t+2>>>0]=r.stencil,HEAP8[t+3>>>0]=r.antialias,HEAP8[t+4>>>0]=r.premultipliedAlpha,HEAP8[t+5>>>0]=r.preserveDrawingBuffer;var n=r.powerPreference&&webglPowerPreferences.indexOf(r.powerPreference);return HEAP32[t+8>>>2>>>0]=n,HEAP8[t+12>>>0]=r.failIfMajorPerformanceCaveat,HEAP32[t+16>>>2>>>0]=e.version,HEAP32[t+20>>>2>>>0]=0,HEAP8[t+24>>>0]=e.attributes.enableExtensionsByDefault,0}_emscripten_webgl_get_context_attributes.sig="ipp";function _emscripten_webgl_destroy_context(e){e>>>=0,GL.currentContext==e&&(GL.currentContext=0),GL.deleteContext(e)}_emscripten_webgl_destroy_context.sig="ip";function _emscripten_webgl_enable_extension(e,t){e>>>=0,t>>>=0;var r=GL.getContext(e),n=UTF8ToString(t);n.startsWith("GL_")&&(n=n.substr(3)),n=="ANGLE_instanced_arrays"&&webgl_enable_ANGLE_instanced_arrays(GLctx),n=="OES_vertex_array_object"&&webgl_enable_OES_vertex_array_object(GLctx),n=="WEBGL_draw_buffers"&&webgl_enable_WEBGL_draw_buffers(GLctx),n=="WEBGL_multi_draw"&&webgl_enable_WEBGL_multi_draw(GLctx),n=="EXT_polygon_offset_clamp"&&webgl_enable_EXT_polygon_offset_clamp(GLctx),n=="EXT_clip_control"&&webgl_enable_EXT_clip_control(GLctx),n=="WEBGL_polygon_mode"&&webgl_enable_WEBGL_polygon_mode(GLctx);var a=r.GLctx.getExtension(n);return!!a}_emscripten_webgl_enable_extension.sig="ipp";var _emscripten_supports_offscreencanvas=()=>0;_emscripten_supports_offscreencanvas.sig="i";var registerWebGlEventCallback=(e,t,r,n,a,o,l)=>{var u=(d=event)=>{getWasmTableEntry(n)(a,0,t)&&d.preventDefault()},_={target:findEventTarget(e),eventTypeString:o,callbackfunc:n,handlerFunc:u,useCapture:r};JSEvents.registerOrRemoveHandler(_)};function _emscripten_set_webglcontextlost_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerWebGlEventCallback(e,t,r,n,31,"webglcontextlost"),0}_emscripten_set_webglcontextlost_callback_on_thread.sig="ippipp";function _emscripten_set_webglcontextrestored_callback_on_thread(e,t,r,n,a){return e>>>=0,t>>>=0,n>>>=0,registerWebGlEventCallback(e,t,r,n,32,"webglcontextrestored"),0}_emscripten_set_webglcontextrestored_callback_on_thread.sig="ippipp";function _emscripten_is_webgl_context_lost(e){return e>>>=0,!GL.contexts[e]||GL.contexts[e].GLctx.isContextLost()}_emscripten_is_webgl_context_lost.sig="ip";function _emscripten_webgl_get_supported_extensions(){return stringToNewUTF8(GLctx.getSupportedExtensions().join(" "))}_emscripten_webgl_get_supported_extensions.sig="p";var _emscripten_webgl_get_program_parameter_d=(e,t)=>GLctx.getProgramParameter(GL.programs[e],t);_emscripten_webgl_get_program_parameter_d.sig="dii";function _emscripten_webgl_get_program_info_log_utf8(e){return stringToNewUTF8(GLctx.getProgramInfoLog(GL.programs[e]))}_emscripten_webgl_get_program_info_log_utf8.sig="pi";var _emscripten_webgl_get_shader_parameter_d=(e,t)=>GLctx.getShaderParameter(GL.shaders[e],t);_emscripten_webgl_get_shader_parameter_d.sig="dii";function _emscripten_webgl_get_shader_info_log_utf8(e){return stringToNewUTF8(GLctx.getShaderInfoLog(GL.shaders[e]))}_emscripten_webgl_get_shader_info_log_utf8.sig="pi";function _emscripten_webgl_get_shader_source_utf8(e){return stringToNewUTF8(GLctx.getShaderSource(GL.shaders[e]))}_emscripten_webgl_get_shader_source_utf8.sig="pi";var _emscripten_webgl_get_vertex_attrib_d=(e,t)=>GLctx.getVertexAttrib(e,t);_emscripten_webgl_get_vertex_attrib_d.sig="dii";var _emscripten_webgl_get_vertex_attrib_o=(e,t)=>{var r=GLctx.getVertexAttrib(e,t);return r==null?void 0:r.name};_emscripten_webgl_get_vertex_attrib_o.sig="iii";function _emscripten_webgl_get_vertex_attrib_v(e,t,r,n,a){return r>>>=0,writeGLArray(GLctx.getVertexAttrib(e,t),r,n,a)}_emscripten_webgl_get_vertex_attrib_v.sig="iiipii";var _emscripten_webgl_get_uniform_d=(e,t)=>GLctx.getUniform(GL.programs[e],webglGetUniformLocation(t));_emscripten_webgl_get_uniform_d.sig="dii";function _emscripten_webgl_get_uniform_v(e,t,r,n,a){return r>>>=0,writeGLArray(GLctx.getUniform(GL.programs[e],webglGetUniformLocation(t)),r,n,a)}_emscripten_webgl_get_uniform_v.sig="iiipii";function _emscripten_webgl_get_parameter_v(e,t,r,n){return t>>>=0,writeGLArray(GLctx.getParameter(e),t,r,n)}_emscripten_webgl_get_parameter_v.sig="iipii";var _emscripten_webgl_get_parameter_d=e=>GLctx.getParameter(e);_emscripten_webgl_get_parameter_d.sig="di";var _emscripten_webgl_get_parameter_o=e=>{var t=GLctx.getParameter(e);return t==null?void 0:t.name};_emscripten_webgl_get_parameter_o.sig="ii";function _emscripten_webgl_get_parameter_utf8(e){return stringToNewUTF8(GLctx.getParameter(e))}_emscripten_webgl_get_parameter_utf8.sig="pi";function _emscripten_webgl_get_parameter_i64v(e,t){return t>>>=0,writeI53ToI64(t,GLctx.getParameter(e))}_emscripten_webgl_get_parameter_i64v.sig="vip";var _glutPostRedisplay=()=>{GLUT.displayFunc&&!GLUT.requestedAnimationFrame&&(GLUT.requestedAnimationFrame=!0,MainLoop.requestAnimationFrame(()=>{GLUT.requestedAnimationFrame=!1,MainLoop.runIter(()=>getWasmTableEntry(GLUT.displayFunc)())}))};_glutPostRedisplay.sig="v";var GLUT={initTime:null,idleFunc:null,displayFunc:null,keyboardFunc:null,keyboardUpFunc:null,specialFunc:null,specialUpFunc:null,reshapeFunc:null,motionFunc:null,passiveMotionFunc:null,mouseFunc:null,buttons:0,modifiers:0,initWindowWidth:256,initWindowHeight:256,initDisplayMode:18,windowX:0,windowY:0,windowWidth:0,windowHeight:0,requestedAnimationFrame:!1,saveModifiers:e=>{GLUT.modifiers=0,e.shiftKey&&(GLUT.modifiers+=1),e.ctrlKey&&(GLUT.modifiers+=2),e.altKey&&(GLUT.modifiers+=4)},onMousemove:e=>{var t=Browser.mouseX,r=Browser.mouseY;Browser.calculateMouseEvent(e);var n=Browser.mouseX,a=Browser.mouseY;n==t&&a==r||(GLUT.buttons==0&&e.target==Module.canvas&&GLUT.passiveMotionFunc?(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.passiveMotionFunc)(t,r)):GLUT.buttons!=0&&GLUT.motionFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.motionFunc)(t,r)))},getSpecialKey:e=>{var t=null;switch(e){case 8:t=120;break;case 46:t=111;break;case 112:t=1;break;case 113:t=2;break;case 114:t=3;break;case 115:t=4;break;case 116:t=5;break;case 117:t=6;break;case 118:t=7;break;case 119:t=8;break;case 120:t=9;break;case 121:t=10;break;case 122:t=11;break;case 123:t=12;break;case 37:t=100;break;case 38:t=101;break;case 39:t=102;break;case 40:t=103;break;case 33:t=104;break;case 34:t=105;break;case 36:t=106;break;case 35:t=107;break;case 45:t=108;break;case 16:case 5:t=112;break;case 6:t=113;break;case 17:case 3:t=114;break;case 4:t=115;break;case 18:case 2:t=116;break;case 1:t=117;break}return t},getASCIIKey:e=>{if(e.ctrlKey||e.altKey||e.metaKey)return null;var t=e.keyCode;if(48<=t&&t<=57)return t;if(65<=t&&t<=90)return e.shiftKey?t:t+32;if(96<=t&&t<=105)return t-48;if(106<=t&&t<=111)return t-106+42;switch(t){case 9:case 13:case 27:case 32:case 61:return t}var r=e.shiftKey;switch(t){case 186:return r?58:59;case 187:return r?43:61;case 188:return r?60:44;case 189:return r?95:45;case 190:return r?62:46;case 191:return r?63:47;case 219:return r?123:91;case 220:return r?124:47;case 221:return r?125:93;case 222:return r?34:39}return null},onKeydown:e=>{if(GLUT.specialFunc||GLUT.keyboardFunc){var t=GLUT.getSpecialKey(e.keyCode);t!==null?GLUT.specialFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.specialFunc)(t,Browser.mouseX,Browser.mouseY)):(t=GLUT.getASCIIKey(e),t!==null&&GLUT.keyboardFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.keyboardFunc)(t,Browser.mouseX,Browser.mouseY)))}},onKeyup:e=>{if(GLUT.specialUpFunc||GLUT.keyboardUpFunc){var t=GLUT.getSpecialKey(e.keyCode);t!==null?GLUT.specialUpFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.specialUpFunc)(t,Browser.mouseX,Browser.mouseY)):(t=GLUT.getASCIIKey(e),t!==null&&GLUT.keyboardUpFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.keyboardUpFunc)(t,Browser.mouseX,Browser.mouseY)))}},touchHandler:e=>{if(e.target==Module.canvas){var t=e.changedTouches,r=t[0],n="";switch(e.type){case"touchstart":n="mousedown";break;case"touchmove":n="mousemove";break;case"touchend":n="mouseup";break;default:return}var a=document.createEvent("MouseEvent");a.initMouseEvent(n,!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),r.target.dispatchEvent(a),e.preventDefault()}},onMouseButtonDown:e=>{if(Browser.calculateMouseEvent(e),GLUT.buttons|=1<{Browser.calculateMouseEvent(e),GLUT.buttons&=~(1<{Browser.calculateMouseEvent(e);var t=-Browser.getMouseWheelDelta(e);t=t==0?0:t>0?Math.max(t,1):Math.min(t,-1);var r=3;t<0&&(r=4),GLUT.mouseFunc&&(e.preventDefault(),GLUT.saveModifiers(e),getWasmTableEntry(GLUT.mouseFunc)(r,0,Browser.mouseX,Browser.mouseY))},onFullscreenEventChange:e=>{var t,r;document.fullscreen||document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen?(t=screen.width,r=screen.height):(t=GLUT.windowWidth,r=GLUT.windowHeight,document.removeEventListener("fullscreenchange",GLUT.onFullscreenEventChange,!0),document.removeEventListener("mozfullscreenchange",GLUT.onFullscreenEventChange,!0),document.removeEventListener("webkitfullscreenchange",GLUT.onFullscreenEventChange,!0)),Browser.setCanvasSize(t,r,!0),GLUT.reshapeFunc&&getWasmTableEntry(GLUT.reshapeFunc)(t,r),_glutPostRedisplay()}},_glutGetModifiers=()=>GLUT.modifiers;_glutGetModifiers.sig="i";function _glutInit(e,t){GLUT.initTime=Date.now();var r="ontouchstart"in document.documentElement;r&&(window.addEventListener("touchmove",GLUT.touchHandler,!0),window.addEventListener("touchstart",GLUT.touchHandler,!0),window.addEventListener("touchend",GLUT.touchHandler,!0)),window.addEventListener("keydown",GLUT.onKeydown,!0),window.addEventListener("keyup",GLUT.onKeyup,!0),window.addEventListener("mousemove",GLUT.onMousemove,!0),window.addEventListener("mousedown",GLUT.onMouseButtonDown,!0),window.addEventListener("mouseup",GLUT.onMouseButtonUp,!0),window.addEventListener("mousewheel",GLUT.onMouseWheel,!0),window.addEventListener("DOMMouseScroll",GLUT.onMouseWheel,!0),Browser.resizeListeners.push((n,a)=>{GLUT.reshapeFunc&&getWasmTableEntry(GLUT.reshapeFunc)(n,a)})}_glutInit.sig="vpp";var _glutInitWindowSize=(e,t)=>{Browser.setCanvasSize(GLUT.initWindowWidth=e,GLUT.initWindowHeight=t)};_glutInitWindowSize.sig="vii";var _glutInitWindowPosition=(e,t)=>{};_glutInitWindowPosition.sig="vii";var _glutGet=e=>{switch(e){case 100:return 0;case 101:return 0;case 102:return Module.canvas.width;case 103:return Module.canvas.height;case 200:return Module.canvas.width;case 201:return Module.canvas.height;case 500:return 0;case 501:return 0;case 502:return GLUT.initWindowWidth;case 503:return GLUT.initWindowHeight;case 700:var t=Date.now();return t-GLUT.initTime;case 105:return Module.ctx.getContextAttributes().stencil?8:0;case 106:return Module.ctx.getContextAttributes().depth?8:0;case 110:return Module.ctx.getContextAttributes().alpha?8:0;case 120:return Module.ctx.getContextAttributes().antialias?1:0;default:throw"glutGet("+e+") not implemented yet"}};_glutGet.sig="ii";function _glutIdleFunc(e){e>>>=0;function t(){GLUT.idleFunc&&(getWasmTableEntry(GLUT.idleFunc)(),safeSetTimeout(t,4))}GLUT.idleFunc||safeSetTimeout(t,0),GLUT.idleFunc=e}_glutIdleFunc.sig="vp";var _glutTimerFunc=function(e,t,r){return t>>>=0,safeSetTimeout(()=>getWasmTableEntry(t)(r),e)};_glutTimerFunc.sig="vipi";function _glutDisplayFunc(e){e>>>=0,GLUT.displayFunc=e}_glutDisplayFunc.sig="vp";function _glutKeyboardFunc(e){e>>>=0,GLUT.keyboardFunc=e}_glutKeyboardFunc.sig="vp";function _glutKeyboardUpFunc(e){e>>>=0,GLUT.keyboardUpFunc=e}_glutKeyboardUpFunc.sig="vp";function _glutSpecialFunc(e){e>>>=0,GLUT.specialFunc=e}_glutSpecialFunc.sig="vp";function _glutSpecialUpFunc(e){e>>>=0,GLUT.specialUpFunc=e}_glutSpecialUpFunc.sig="vp";function _glutReshapeFunc(e){e>>>=0,GLUT.reshapeFunc=e}_glutReshapeFunc.sig="vp";function _glutMotionFunc(e){e>>>=0,GLUT.motionFunc=e}_glutMotionFunc.sig="vp";function _glutPassiveMotionFunc(e){e>>>=0,GLUT.passiveMotionFunc=e}_glutPassiveMotionFunc.sig="vp";function _glutMouseFunc(e){e>>>=0,GLUT.mouseFunc=e}_glutMouseFunc.sig="vp";var _glutSetCursor=e=>{var t="auto";switch(e){case 0:break;case 1:break;case 2:t="pointer";break;case 3:break;case 4:t="help";break;case 5:break;case 6:break;case 7:t="wait";break;case 8:t="text";break;case 9:case 102:t="crosshair";break;case 10:t="ns-resize";break;case 11:t="ew-resize";break;case 12:t="n-resize";break;case 13:t="s-resize";break;case 14:t="w-resize";break;case 15:t="e-resize";break;case 16:t="nw-resize";break;case 17:t="ne-resize";break;case 18:t="se-resize";break;case 19:t="sw-resize";break;case 100:break;case 101:t="none";break;default:throw"glutSetCursor: Unknown cursor type: "+e}Module.canvas.style.cursor=t};_glutSetCursor.sig="vi";function _glutCreateWindow(e){var t={antialias:(GLUT.initDisplayMode&128)!=0,depth:(GLUT.initDisplayMode&16)!=0,stencil:(GLUT.initDisplayMode&32)!=0,alpha:(GLUT.initDisplayMode&8)!=0};return Module.ctx=Browser.createContext(Module.canvas,!0,!0,t),Module.ctx?1:0}_glutCreateWindow.sig="ip";var _glutDestroyWindow=e=>(delete Module.ctx,1);_glutDestroyWindow.sig="vi";var _glutReshapeWindow=(e,t)=>{Browser.exitFullscreen(),Browser.setCanvasSize(e,t,!0),GLUT.reshapeFunc&&getWasmTableEntry(GLUT.reshapeFunc)(e,t),_glutPostRedisplay()};_glutReshapeWindow.sig="vii";var _glutPositionWindow=(e,t)=>{Browser.exitFullscreen(),_glutPostRedisplay()};_glutPositionWindow.sig="vii";var _glutFullScreen=()=>{GLUT.windowX=0,GLUT.windowY=0,GLUT.windowWidth=Module.canvas.width,GLUT.windowHeight=Module.canvas.height,document.addEventListener("fullscreenchange",GLUT.onFullscreenEventChange,!0),document.addEventListener("mozfullscreenchange",GLUT.onFullscreenEventChange,!0),document.addEventListener("webkitfullscreenchange",GLUT.onFullscreenEventChange,!0),Browser.requestFullscreen(!1,!1)};_glutFullScreen.sig="v";var _glutInitDisplayMode=e=>GLUT.initDisplayMode=e;_glutInitDisplayMode.sig="vi";var _glutSwapBuffers=()=>{};_glutSwapBuffers.sig="v";var _glutMainLoop=()=>{throw _glutReshapeWindow(Module.canvas.width,Module.canvas.height),_glutPostRedisplay(),"unwind"};_glutMainLoop.sig="v";function _XOpenDisplay(e){return 1}_XOpenDisplay.sig="pp";function _XCreateWindow(e,t,r,n,a,o,l,u,_,d,p,f){return Browser.setCanvasSize(a,o),2}_XCreateWindow.sig="pppiiiiiiippp";function _XChangeWindowAttributes(e,t,r,n){}_XChangeWindowAttributes.sig="ipppp";function _XSetWMHints(e,t,r){}_XSetWMHints.sig="ippp";function _XMapWindow(e,t){}_XMapWindow.sig="ipp";function _XStoreName(e,t,r){}_XStoreName.sig="ippp";function _XInternAtom(e,t,r){return 0}_XInternAtom.sig="pppi";function _XSendEvent(e,t,r,n,a){}_XSendEvent.sig="ippipp";function _XPending(e){return 0}_XPending.sig="ip";var EGL={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode(e){EGL.errorCode=e},chooseConfig(e,t,r,n,a){if(e!=62e3)return EGL.setErrorCode(12296),0;if(t)for(;;){var o=HEAP32[t>>>2>>>0];if(o==12321){var l=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.alpha=l>0}else if(o==12325){var u=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.depth=u>0}else if(o==12326){var _=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.stencil=_>0}else if(o==12337){var d=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.antialias=d>0}else if(o==12338){var d=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.antialias=d==1}else if(o==12544){var p=HEAP32[t+4>>>2>>>0];EGL.contextAttributes.lowLatency=p!=12547}else if(o==12344)break;t+=8}return(!r||!n)&&!a?(EGL.setErrorCode(12300),0):(a&&(HEAP32[a>>>2>>>0]=1),r&&n>0&&(HEAPU32[r>>>2>>>0]=62002),EGL.setErrorCode(12288),1)}};function _eglGetDisplay(e){return e>>>=0,EGL.setErrorCode(12288),e!=0&&e!=1?0:62e3}_eglGetDisplay.sig="pp";function _eglInitialize(e,t,r){return e>>>=0,t>>>=0,r>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):(t&&(HEAP32[t>>>2>>>0]=1),r&&(HEAP32[r>>>2>>>0]=4),EGL.defaultDisplayInitialized=!0,EGL.setErrorCode(12288),1)}_eglInitialize.sig="ippp";function _eglTerminate(e){return e>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):(EGL.currentContext=0,EGL.currentReadSurface=0,EGL.currentDrawSurface=0,EGL.defaultDisplayInitialized=!1,EGL.setErrorCode(12288),1)}_eglTerminate.sig="ip";function _eglGetConfigs(e,t,r,n){return e>>>=0,t>>>=0,n>>>=0,EGL.chooseConfig(e,0,t,r,n)}_eglGetConfigs.sig="ippip";function _eglChooseConfig(e,t,r,n,a){return e>>>=0,t>>>=0,r>>>=0,a>>>=0,EGL.chooseConfig(e,t,r,n,a)}_eglChooseConfig.sig="ipppip";function _eglGetConfigAttrib(e,t,r,n){if(e>>>=0,t>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(t!=62002)return EGL.setErrorCode(12293),0;if(!n)return EGL.setErrorCode(12300),0;switch(EGL.setErrorCode(12288),r){case 12320:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.alpha?32:24,1;case 12321:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.alpha?8:0,1;case 12322:return HEAP32[n>>>2>>>0]=8,1;case 12323:return HEAP32[n>>>2>>>0]=8,1;case 12324:return HEAP32[n>>>2>>>0]=8,1;case 12325:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.depth?24:0,1;case 12326:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.stencil?8:0,1;case 12327:return HEAP32[n>>>2>>>0]=12344,1;case 12328:return HEAP32[n>>>2>>>0]=62002,1;case 12329:return HEAP32[n>>>2>>>0]=0,1;case 12330:return HEAP32[n>>>2>>>0]=4096,1;case 12331:return HEAP32[n>>>2>>>0]=16777216,1;case 12332:return HEAP32[n>>>2>>>0]=4096,1;case 12333:return HEAP32[n>>>2>>>0]=0,1;case 12334:return HEAP32[n>>>2>>>0]=0,1;case 12335:return HEAP32[n>>>2>>>0]=12344,1;case 12337:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.antialias?4:0,1;case 12338:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.antialias?1:0,1;case 12339:return HEAP32[n>>>2>>>0]=4,1;case 12340:return HEAP32[n>>>2>>>0]=12344,1;case 12341:case 12342:case 12343:return HEAP32[n>>>2>>>0]=-1,1;case 12345:case 12346:return HEAP32[n>>>2>>>0]=0,1;case 12347:return HEAP32[n>>>2>>>0]=0,1;case 12348:return HEAP32[n>>>2>>>0]=1,1;case 12349:case 12350:return HEAP32[n>>>2>>>0]=0,1;case 12351:return HEAP32[n>>>2>>>0]=12430,1;case 12352:return HEAP32[n>>>2>>>0]=4,1;case 12354:return HEAP32[n>>>2>>>0]=0,1;default:return EGL.setErrorCode(12292),0}}_eglGetConfigAttrib.sig="ippip";function _eglCreateWindowSurface(e,t,r,n){return e>>>=0,t>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):t!=62002?(EGL.setErrorCode(12293),0):(EGL.setErrorCode(12288),62006)}_eglCreateWindowSurface.sig="pppip";function _eglDestroySurface(e,t){return e>>>=0,t>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):t!=62006?(EGL.setErrorCode(12301),1):(EGL.currentReadSurface==t&&(EGL.currentReadSurface=0),EGL.currentDrawSurface==t&&(EGL.currentDrawSurface=0),EGL.setErrorCode(12288),1)}_eglDestroySurface.sig="ipp";function _eglCreateContext(e,t,r,n){if(e>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;for(var a=1;;){var o=HEAP32[n>>>2>>>0];if(o==12440)a=HEAP32[n+4>>>2>>>0];else{if(o==12344)break;return EGL.setErrorCode(12292),0}n+=8}return a!=2?(EGL.setErrorCode(12293),0):(EGL.contextAttributes.majorVersion=a-1,EGL.contextAttributes.minorVersion=0,EGL.context=GL.createContext(Module.canvas,EGL.contextAttributes),EGL.context!=0?(EGL.setErrorCode(12288),GL.makeContextCurrent(EGL.context),Browser.useWebGL=!0,Browser.moduleContextCreatedCallbacks.forEach(l=>l()),GL.makeContextCurrent(null),62004):(EGL.setErrorCode(12297),0))}_eglCreateContext.sig="ppppp";function _eglDestroyContext(e,t){return e>>>=0,t>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):t!=62004?(EGL.setErrorCode(12294),0):(GL.deleteContext(EGL.context),EGL.setErrorCode(12288),EGL.currentContext==t&&(EGL.currentContext=0),1)}_eglDestroyContext.sig="ipp";function _eglQuerySurface(e,t,r,n){if(e>>>=0,t>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(t!=62006)return EGL.setErrorCode(12301),0;if(!n)return EGL.setErrorCode(12300),0;switch(EGL.setErrorCode(12288),r){case 12328:return HEAP32[n>>>2>>>0]=62002,1;case 12376:return 1;case 12375:return HEAP32[n>>>2>>>0]=Module.canvas.width,1;case 12374:return HEAP32[n>>>2>>>0]=Module.canvas.height,1;case 12432:return HEAP32[n>>>2>>>0]=-1,1;case 12433:return HEAP32[n>>>2>>>0]=-1,1;case 12434:return HEAP32[n>>>2>>>0]=-1,1;case 12422:return HEAP32[n>>>2>>>0]=12420,1;case 12441:return HEAP32[n>>>2>>>0]=12442,1;case 12435:return HEAP32[n>>>2>>>0]=12437,1;case 12416:case 12417:case 12418:case 12419:return 1;default:return EGL.setErrorCode(12292),0}}_eglQuerySurface.sig="ippip";function _eglQueryContext(e,t,r,n){if(e>>>=0,t>>>=0,n>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(t!=62004)return EGL.setErrorCode(12294),0;if(!n)return EGL.setErrorCode(12300),0;switch(EGL.setErrorCode(12288),r){case 12328:return HEAP32[n>>>2>>>0]=62002,1;case 12439:return HEAP32[n>>>2>>>0]=12448,1;case 12440:return HEAP32[n>>>2>>>0]=EGL.contextAttributes.majorVersion+1,1;case 12422:return HEAP32[n>>>2>>>0]=12420,1;default:return EGL.setErrorCode(12292),0}}_eglQueryContext.sig="ippip";var _eglGetError=()=>EGL.errorCode;_eglGetError.sig="i";function _eglQueryString(e,t){if(e>>>=0,e!=62e3)return EGL.setErrorCode(12296),0;if(EGL.setErrorCode(12288),EGL.stringCache[t])return EGL.stringCache[t];var r;switch(t){case 12371:r=stringToNewUTF8("Emscripten");break;case 12372:r=stringToNewUTF8("1.4 Emscripten EGL");break;case 12373:r=stringToNewUTF8("");break;case 12429:r=stringToNewUTF8("OpenGL_ES");break;default:return EGL.setErrorCode(12300),0}return EGL.stringCache[t]=r,r}_eglQueryString.sig="ppi";var _eglBindAPI=e=>e==12448?(EGL.setErrorCode(12288),1):(EGL.setErrorCode(12300),0);_eglBindAPI.sig="ii";var _eglQueryAPI=()=>(EGL.setErrorCode(12288),12448);_eglQueryAPI.sig="i";var _eglWaitClient=()=>(EGL.setErrorCode(12288),1);_eglWaitClient.sig="i";var _eglWaitNative=e=>(EGL.setErrorCode(12288),1);_eglWaitNative.sig="ii";var _eglWaitGL=_eglWaitClient;_eglWaitGL.sig="i";function _eglSwapInterval(e,t){return e>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):(t==0?_emscripten_set_main_loop_timing(0,0):_emscripten_set_main_loop_timing(1,t),EGL.setErrorCode(12288),1)}_eglSwapInterval.sig="ipi";function _eglMakeCurrent(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,e!=62e3?(EGL.setErrorCode(12296),0):n!=0&&n!=62004?(EGL.setErrorCode(12294),0):r!=0&&r!=62006||t!=0&&t!=62006?(EGL.setErrorCode(12301),0):(GL.makeContextCurrent(n?EGL.context:null),EGL.currentContext=n,EGL.currentDrawSurface=t,EGL.currentReadSurface=r,EGL.setErrorCode(12288),1)}_eglMakeCurrent.sig="ipppp";function _eglGetCurrentContext(){return EGL.currentContext}_eglGetCurrentContext.sig="p";function _eglGetCurrentSurface(e){return e==12378?EGL.currentReadSurface:e==12377?EGL.currentDrawSurface:(EGL.setErrorCode(12300),0)}_eglGetCurrentSurface.sig="pi";function _eglGetCurrentDisplay(){return EGL.currentContext?62e3:0}_eglGetCurrentDisplay.sig="p";function _eglSwapBuffers(e,t){if(!EGL.defaultDisplayInitialized)EGL.setErrorCode(12289);else if(!Module.ctx)EGL.setErrorCode(12290);else if(Module.ctx.isContextLost())EGL.setErrorCode(12302);else return EGL.setErrorCode(12288),1;return 0}_eglSwapBuffers.sig="ipp";var _eglReleaseThread=()=>(EGL.currentContext=0,EGL.currentReadSurface=0,EGL.currentDrawSurface=0,EGL.setErrorCode(12288),1);_eglReleaseThread.sig="i";function _uuid_clear(e){return e>>>=0,zeroMemory(e,16)}_uuid_clear.sig="vp";function _uuid_compare(e,t){return e>>>=0,t>>>=0,_memcmp(e,t,16)}_uuid_compare.sig="ipp";function _uuid_copy(e,t){return e>>>=0,t>>>=0,_memcpy(e,t,16)}_uuid_copy.sig="vpp";function _uuid_generate(e){e>>>=0;var t=null;if(ENVIRONMENT_IS_NODE)try{var r=ki("crypto").randomBytes;t=r(16)}catch{}else ENVIRONMENT_IS_WEB&&typeof window.crypto<"u"&&typeof window.crypto.getRandomValues<"u"&&(t=new Uint8Array(16),window.crypto.getRandomValues(t));if(!t){t=new Array(16);for(var n=new Date().getTime(),a=0;a<16;a++){var o=(n+Math.random()*256)%256|0;n=n/256|0,t[a]=o}}t[6]=t[6]&15|64,t[8]=t[8]&63|128,writeArrayToMemory(t,e)}_uuid_generate.sig="vp";function _uuid_is_null(e){e>>>=0;for(var t=0;t<4;t++,e=e+4|0){var r=HEAP32[e>>>2>>>0];if(r)return 0}return 1}_uuid_is_null.sig="ip";function _uuid_parse(e,t){if(e>>>=0,t>>>=0,e=UTF8ToString(e),e.length===36){var r=0,n=new Array(16);return e.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){r<16&&(n[r++]=parseInt(a,16))}),r<16?-1:(writeArrayToMemory(n,t),0)}return-1}_uuid_parse.sig="ipp";function _uuid_unparse(e,t,r){e>>>=0,t>>>=0;var n=0,a="xxxx-xx-xx-xx-xxxxxx".replace(/[x]/g,function(o){var l=r?HEAPU8[e+n>>>0].toString(16).toUpperCase():HEAPU8[e+n>>>0].toString(16);return l=l.length===1?"0"+l:l,n++,l});stringToUTF8(a,t,37)}_uuid_unparse.sig="vpp";function _uuid_unparse_lower(e,t){e>>>=0,t>>>=0,_uuid_unparse(e,t)}_uuid_unparse_lower.sig="vpp";function _uuid_unparse_upper(e,t){e>>>=0,t>>>=0,_uuid_unparse(e,t,!0)}_uuid_unparse_upper.sig="vpp";function _uuid_type(e){return 4}_uuid_type.sig="ip";function _uuid_variant(e){return 1}_uuid_variant.sig="ip";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(e){switch(e){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"}switch(e){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(e){if(!GLEW.error[e]){var t=GLEW.errorStringConstantFromCode(e);t||(t="Unknown error",e=8),GLEW.error[e]=stringToNewUTF8(t)}return GLEW.error[e]},versionStringConstantFromCode(e){switch(e){case 1:return"1.10.0";case 2:return"1";case 3:return"10";case 4:return"0";default:return null}},versionString(e){if(!GLEW.version[e]){var t=GLEW.versionStringConstantFromCode(e);if(!t)return 0;GLEW.version[e]=stringToNewUTF8(t)}return GLEW.version[e]},extensionIsSupported(e){return GLEW.extensions||(GLEW.extensions=webglGetExtensions()),GLEW.extensions.includes(e)?1:GLEW.extensions.includes("GL_"+e)}},_glewInit=()=>0;_glewInit.sig="i";function _glewIsSupported(e){e>>>=0;for(var t=UTF8ToString(e).split(" "),r=0;r>>=0,GLEW.extensionIsSupported(UTF8ToString(e))}_glewGetExtension.sig="ip";function _glewGetErrorString(e){return GLEW.errorString(e)}_glewGetErrorString.sig="pi";function _glewGetString(e){return GLEW.versionString(e)}_glewGetString.sig="pi";var IDBStore={indexedDB(){if(typeof indexedDB<"u")return indexedDB;var e=null;return typeof window=="object"&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),assert(e,"IDBStore used, but indexedDB not supported"),e},DB_VERSION:22,DB_STORE_NAME:"FILE_DATA",dbs:{},blobs:[0],getDB(e,t){var r=IDBStore.dbs[e];if(r)return t(null,r);var n;try{n=IDBStore.indexedDB().open(e,IDBStore.DB_VERSION)}catch(a){return t(a)}n.onupgradeneeded=a=>{var o=a.target.result,l=a.target.transaction;o.objectStoreNames.contains(IDBStore.DB_STORE_NAME)?l.objectStore(IDBStore.DB_STORE_NAME):o.createObjectStore(IDBStore.DB_STORE_NAME)},n.onsuccess=()=>{r=n.result,IDBStore.dbs[e]=r,t(null,r)},n.onerror=function(a){t(a.target.error||"unknown error"),a.preventDefault()}},getStore(e,t,r){IDBStore.getDB(e,(n,a)=>{if(n)return r(n);var o=a.transaction([IDBStore.DB_STORE_NAME],t);o.onerror=u=>{r(u.target.error||"unknown error"),u.preventDefault()};var l=o.objectStore(IDBStore.DB_STORE_NAME);r(null,l)})},getFile(e,t,r){IDBStore.getStore(e,"readonly",(n,a)=>{if(n)return r(n);var o=a.get(t);o.onsuccess=l=>{var u=l.target.result;return u?r(null,u):r("file ".concat(t," not found"))},o.onerror=r})},setFile(e,t,r,n){IDBStore.getStore(e,"readwrite",(a,o)=>{if(a)return n(a);var l=o.put(r,t);l.onsuccess=u=>n(),l.onerror=n})},deleteFile(e,t,r){IDBStore.getStore(e,"readwrite",(n,a)=>{if(n)return r(n);var o=a.delete(t);o.onsuccess=l=>r(),o.onerror=r})},existsFile(e,t,r){IDBStore.getStore(e,"readonly",(n,a)=>{if(n)return r(n);var o=a.count(t);o.onsuccess=l=>r(null,l.target.result>0),o.onerror=r})},clearStore(e,t){IDBStore.getStore(e,"readwrite",(r,n)=>{if(r)return t(r);var a=n.clear();a.onsuccess=o=>t(),a.onerror=t})}},_emscripten_idb_async_load=function(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,IDBStore.getFile(UTF8ToString(e),UTF8ToString(t),(o,l)=>{callUserCallback(()=>{if(o){a&&getWasmTableEntry(a)(r);return}var u=_malloc(l.length);HEAPU8.set(l,u>>>0),getWasmTableEntry(n)(r,u,l.length),_free(u)})})};_emscripten_idb_async_load.sig="vppppp";var _emscripten_idb_async_store=function(e,t,r,n,a,o,l){e>>>=0,t>>>=0,r>>>=0,a>>>=0,o>>>=0,l>>>=0,IDBStore.setFile(UTF8ToString(e),UTF8ToString(t),new Uint8Array(HEAPU8.subarray(r>>>0,r+n>>>0)),u=>{callUserCallback(()=>{if(u){l&&getWasmTableEntry(l)(a);return}o&&getWasmTableEntry(o)(a)})})};_emscripten_idb_async_store.sig="vpppippp";var _emscripten_idb_async_delete=function(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,IDBStore.deleteFile(UTF8ToString(e),UTF8ToString(t),o=>{callUserCallback(()=>{if(o){a&&getWasmTableEntry(a)(r);return}n&&getWasmTableEntry(n)(r)})})};_emscripten_idb_async_delete.sig="vppppp";var _emscripten_idb_async_exists=function(e,t,r,n,a){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,IDBStore.existsFile(UTF8ToString(e),UTF8ToString(t),(o,l)=>{callUserCallback(()=>{if(o){a&&getWasmTableEntry(a)(r);return}n&&getWasmTableEntry(n)(r,l)})})};_emscripten_idb_async_exists.sig="vppppp";var _emscripten_idb_async_clear=function(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0,IDBStore.clearStore(UTF8ToString(e),a=>{callUserCallback(()=>{if(a){n&&getWasmTableEntry(n)(t);return}r&&getWasmTableEntry(r)(t)})})};_emscripten_idb_async_clear.sig="vpppp";function _emscripten_idb_load(e,t,r,n,a){throw"Please compile your program with async support in order to use synchronous operations like emscripten_idb_load, etc."}_emscripten_idb_load.sig="vppppp";function _emscripten_idb_store(e,t,r,n,a){throw"Please compile your program with async support in order to use synchronous operations like emscripten_idb_store, etc."}_emscripten_idb_store.sig="vpppip";function _emscripten_idb_delete(e,t,r){throw"Please compile your program with async support in order to use synchronous operations like emscripten_idb_delete, etc."}_emscripten_idb_delete.sig="vppp";function _emscripten_idb_exists(e,t,r,n){throw"Please compile your program with async support in order to use synchronous operations like emscripten_idb_exists, etc."}_emscripten_idb_exists.sig="vpppp";function _emscripten_idb_clear(e,t){throw"Please compile your program with async support in order to use synchronous operations like emscripten_idb_clear, etc."}_emscripten_idb_clear.sig="vpp";var _emscripten_sleep=()=>{throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"};_emscripten_sleep.sig="vi";function _emscripten_wget(e,t){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_wget"}Module._emscripten_wget=_emscripten_wget,_emscripten_wget.sig="ipp";function _emscripten_scan_registers(e){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_scan_registers"}_emscripten_scan_registers.sig="vp";function _emscripten_fiber_swap(e,t){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_fiber_swap"}_emscripten_fiber_swap.sig="vpp";var _SDL_GetTicks=()=>Date.now()-SDL.startTime|0;_SDL_GetTicks.sig="i";function _SDL_LockSurface(e){e>>>=0;var t=SDL.surfaces[e];if(t.locked++,t.locked>1||(t.buffer||(t.buffer=_malloc(t.width*t.height*4),HEAPU32[e+20>>>2>>>0]=t.buffer),HEAPU32[e+20>>>2>>>0]=t.buffer,e==SDL.screen&&Module.screenIsReadOnly&&t.image))return 0;if(t.image=t.ctx.getImageData(0,0,t.width,t.height),e==SDL.screen&&SDL.defaults.opaqueFrontBuffer)for(var r=t.image.data,n=r.length,a=0;a>>0)}return 0}_SDL_LockSurface.sig="ip";var SDL={defaults:{width:320,height:200,copyOnLock:!0,discardOnLock:!1,opaqueFrontBuffer:!0},version:null,surfaces:{},canvasPool:[],events:[],fonts:[null],audios:[null],rwops:[null],music:{audio:null,volume:1},mixerFrequency:22050,mixerFormat:32784,mixerNumChannels:2,mixerChunkSize:1024,channelMinimumNumber:0,GL:!1,glAttributes:{0:3,1:3,2:2,3:0,4:0,5:1,6:16,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:1,16:0,17:0,18:0},keyboardState:null,keyboardMap:{},canRequestFullscreen:!1,isRequestingFullscreen:!1,textInput:!1,unicode:!1,ttfContext:null,audio:null,startTime:null,initFlags:0,buttonState:0,modState:0,DOMButtons:[0,0,0],DOMEventToSDLEvent:{},TOUCH_DEFAULT_ID:0,eventHandler:null,eventHandlerContext:null,eventHandlerTemp:0,keyCodes:{16:1249,17:1248,18:1250,20:1081,33:1099,34:1102,35:1101,36:1098,37:1104,38:1106,39:1103,40:1105,44:316,45:1097,46:127,91:1251,93:1125,96:1122,97:1113,98:1114,99:1115,100:1116,101:1117,102:1118,103:1119,104:1120,105:1121,106:1109,107:1111,109:1110,110:1123,111:1108,112:1082,113:1083,114:1084,115:1085,116:1086,117:1087,118:1088,119:1089,120:1090,121:1091,122:1092,123:1093,124:1128,125:1129,126:1130,127:1131,128:1132,129:1133,130:1134,131:1135,132:1136,133:1137,134:1138,135:1139,144:1107,160:94,161:33,162:34,163:35,164:36,165:37,166:38,167:95,168:40,169:41,170:42,171:43,172:124,173:45,174:123,175:125,176:126,181:127,182:129,183:128,188:44,190:46,191:47,192:96,219:91,220:92,221:93,222:39,224:1251},scanCodes:{8:42,9:43,13:40,27:41,32:44,35:204,39:53,44:54,46:55,47:56,48:39,49:30,50:31,51:32,52:33,53:34,54:35,55:36,56:37,57:38,58:203,59:51,61:46,91:47,92:49,93:48,96:52,97:4,98:5,99:6,100:7,101:8,102:9,103:10,104:11,105:12,106:13,107:14,108:15,109:16,110:17,111:18,112:19,113:20,114:21,115:22,116:23,117:24,118:25,119:26,120:27,121:28,122:29,127:76,305:224,308:226,316:70},loadRect(e){return{x:HEAP32[e>>>2>>>0],y:HEAP32[e+4>>>2>>>0],w:HEAP32[e+8>>>2>>>0],h:HEAP32[e+12>>>2>>>0]}},updateRect(e,t){HEAP32[e>>>2>>>0]=t.x,HEAP32[e+4>>>2>>>0]=t.y,HEAP32[e+8>>>2>>>0]=t.w,HEAP32[e+12>>>2>>>0]=t.h},intersectionOfRects(e,t){var r=Math.max(e.x,t.x),n=Math.max(e.y,t.y),a=Math.min(e.x+e.w,t.x+t.w),o=Math.min(e.y+e.h,t.y+t.h);return{x:r,y:n,w:Math.max(r,a)-r,h:Math.max(n,o)-n}},checkPixelFormat(e){},loadColorToCSSRGB(e){var t=HEAP32[e>>>2>>>0];return"rgb("+(t&255)+","+(t>>8&255)+","+(t>>16&255)+")"},loadColorToCSSRGBA(e){var t=HEAP32[e>>>2>>>0];return"rgba("+(t&255)+","+(t>>8&255)+","+(t>>16&255)+","+(t>>24&255)/255+")"},translateColorToCSSRGBA:e=>"rgba("+(e&255)+","+(e>>8&255)+","+(e>>16&255)+","+(e>>>24)/255+")",translateRGBAToCSSRGBA:(e,t,r,n)=>"rgba("+(e&255)+","+(t&255)+","+(r&255)+","+(n&255)/255+")",translateRGBAToColor:(e,t,r,n)=>e|t<<8|r<<16|n<<24,makeSurface(e,t,r,n,a,o,l,u,_){var d=r&1,p=r&2097152,f=r&67108864,m=_malloc(60),h=_malloc(44),g=p?1:4,b=0;!d&&!f&&(b=_malloc(e*t*4)),HEAP32[m>>>2>>>0]=r,HEAPU32[m+4>>>2>>>0]=h,HEAP32[m+8>>>2>>>0]=e,HEAP32[m+12>>>2>>>0]=t,HEAP32[m+16>>>2>>>0]=e*g,HEAPU32[m+20>>>2>>>0]=b,HEAP32[m+36>>>2>>>0]=0,HEAP32[m+40>>>2>>>0]=0,HEAP32[m+44>>>2>>>0]=Module.canvas.width,HEAP32[m+48>>>2>>>0]=Module.canvas.height,HEAP32[m+56>>>2>>>0]=1,HEAP32[h>>>2>>>0]=-2042224636,HEAP32[h+4>>>2>>>0]=0,HEAP8[h+8>>>0]=g*8,HEAP8[h+9>>>0]=g,HEAP32[h+12>>>2>>>0]=o||255,HEAP32[h+16>>>2>>>0]=l||65280,HEAP32[h+20>>>2>>>0]=u||16711680,HEAP32[h+24>>>2>>>0]=_||4278190080,SDL.GL=SDL.GL||f;var v;n?v=Module.canvas:(SDL.canvasPool.length>0?v=SDL.canvasPool.pop():v=document.createElement("canvas"),v.width=e,v.height=t);var S={antialias:SDL.glAttributes[13]!=0&&SDL.glAttributes[14]>1,depth:SDL.glAttributes[6]>0,stencil:SDL.glAttributes[7]>0,alpha:SDL.glAttributes[3]>0},L=Browser.createContext(v,f,n,S);return SDL.surfaces[m]={width:e,height:t,canvas:v,ctx:L,surf:m,buffer:b,pixelFormat:h,alpha:255,flags:r,locked:0,usePageCanvas:n,source:a,isFlagSet:T=>r&T},m},copyIndexedColorData(e,t,r,n,a){if(e.colors){var o=Module.canvas.width,l=Module.canvas.height,u=t||0,_=r||0,d=(n||o-u)+u,p=(a||l-_)+_,f=e.buffer;e.image.data32||(e.image.data32=new Uint32Array(e.image.data.buffer));for(var m=e.image.data32,h=e.colors32,g=_;g>>0]]}},freeSurface(e){var t=e+56,r=HEAP32[t>>>2>>>0];if(r>1){HEAP32[t>>>2>>>0]=r-1;return}var n=SDL.surfaces[e];!n.usePageCanvas&&n.canvas&&SDL.canvasPool.push(n.canvas),n.buffer&&_free(n.buffer),_free(n.pixelFormat),_free(e),SDL.surfaces[e]=null,e===SDL.screen&&(SDL.screen=null)},blitSurface(e,t,r,n,a){var o=SDL.surfaces[e],l=SDL.surfaces[r],u,_;if(t?u=SDL.loadRect(t):u={x:0,y:0,w:o.width,h:o.height},n?_=SDL.loadRect(n):_={x:0,y:0,w:o.width,h:o.height},l.clipRect){var d=!a||u.w===0?1:u.w/_.w,p=!a||u.h===0?1:u.h/_.h;_=SDL.intersectionOfRects(l.clipRect,_),u.w=_.w*d,u.h=_.h*p,n&&SDL.updateRect(n,_)}var f,m;if(a?(f=_.w,m=_.h):(f=u.w,m=u.h),u.w===0||u.h===0||f===0||m===0)return 0;var h=l.ctx.globalAlpha;return l.ctx.globalAlpha=o.alpha/255,l.ctx.drawImage(o.canvas,u.x,u.y,u.w,u.h,_.x,_.y,f,m),l.ctx.globalAlpha=h,r!=SDL.screen&&(warnOnce("WARNING: copying canvas data to memory for compatibility"),_SDL_LockSurface(r),l.locked--),0},downFingers:{},savedKeydown:null,receiveEvent(e){function t(){for(var p in SDL.keyboardMap)SDL.events.push({type:"keyup",keyCode:SDL.keyboardMap[p]})}switch(e.type){case"touchstart":case"touchmove":{e.preventDefault();var r=[];if(e.type==="touchstart")for(var n=0;n0?Math.max(_,1):Math.min(_,-1);var d=_>0?3:4;SDL.events.push({type:"mousedown",button:d,pageX:e.pageX,pageY:e.pageY}),SDL.events.push({type:"mouseup",button:d,pageX:e.pageX,pageY:e.pageY}),SDL.events.push({type:"wheel",deltaX:0,deltaY:_}),e.preventDefault();break;case"mousemove":if(SDL.DOMButtons[0]===1&&SDL.events.push({type:"touchmove",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),Browser.pointerLock&&("mozMovementX"in e&&(e.movementX=e.mozMovementX,e.movementY=e.mozMovementY),e.movementX==0&&e.movementY==0)){e.preventDefault();return}case"keydown":case"keyup":case"keypress":case"mousedown":case"mouseup":if((e.type!=="keydown"||!SDL.unicode&&!SDL.textInput||e.keyCode===8||e.keyCode===9)&&e.preventDefault(),e.type=="mousedown")SDL.DOMButtons[e.button]=1,SDL.events.push({type:"touchstart",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}});else if(e.type=="mouseup"){if(!SDL.DOMButtons[e.button])return;SDL.events.push({type:"touchend",touch:{identifier:0,deviceID:-1,pageX:e.pageX,pageY:e.pageY}}),SDL.DOMButtons[e.button]=0}e.type==="keydown"||e.type==="mousedown"?SDL.canRequestFullscreen=!0:(e.type==="keyup"||e.type==="mouseup")&&(SDL.isRequestingFullscreen&&(Module.requestFullscreen(!0,!0),SDL.isRequestingFullscreen=!1),SDL.canRequestFullscreen=!1),e.type==="keypress"&&SDL.savedKeydown?(SDL.savedKeydown.keypressCharCode=e.charCode,SDL.savedKeydown=null):e.type==="keydown"&&(SDL.savedKeydown=e),(e.type!=="keypress"||SDL.textInput)&&SDL.events.push(e);break;case"mouseout":for(var n=0;n<3;n++)SDL.DOMButtons[n]&&(SDL.events.push({type:"mouseup",button:n,pageX:e.pageX,pageY:e.pageY}),SDL.DOMButtons[n]=0);e.preventDefault();break;case"focus":SDL.events.push(e),e.preventDefault();break;case"blur":SDL.events.push(e),t(),e.preventDefault();break;case"visibilitychange":SDL.events.push({type:"visibilitychange",visible:!document.hidden}),t(),e.preventDefault();break;case"unload":MainLoop.runner&&(SDL.events.push(e),MainLoop.runner());return;case"resize":SDL.events.push(e),e.preventDefault&&e.preventDefault();break}SDL.events.length>=1e4&&(err("SDL event queue full, dropping events"),SDL.events=SDL.events.slice(0,1e4)),SDL.flushEventsToHandler()},lookupKeyCodeForEvent(e){var t=e.keyCode;return t>=65&&t<=90?t+=32:(t=SDL.keyCodes[e.keyCode]||e.keyCode,e.location===2&&t>=1248&&t<=1251&&(t+=4)),t},handleEvent(e){if(!e.handled)switch(e.handled=!0,e.type){case"touchstart":case"touchend":case"touchmove":{Browser.calculateMouseEvent(e);break}case"keydown":case"keyup":{var t=e.type==="keydown",r=SDL.lookupKeyCodeForEvent(e);HEAP8[SDL.keyboardState+r>>>0]=t,SDL.modState=(HEAP8[SDL.keyboardState+1248>>>0]?64:0)|(HEAP8[SDL.keyboardState+1249>>>0]?1:0)|(HEAP8[SDL.keyboardState+1250>>>0]?256:0)|(HEAP8[SDL.keyboardState+1252>>>0]?128:0)|(HEAP8[SDL.keyboardState+1253>>>0]?2:0)|(HEAP8[SDL.keyboardState+1254>>>0]?512:0),t?SDL.keyboardMap[r]=e.keyCode:delete SDL.keyboardMap[r];break}case"mousedown":case"mouseup":e.type=="mousedown"?SDL.buttonState|=1<0;)if(SDL.makeCEvent(SDL.events.shift(),e)!==!1)return 1;return 0}return SDL.events.length>0},makeCEvent(e,t){if(typeof e=="number"){_memcpy(t,e,28),_free(e);return}switch(SDL.handleEvent(e),e.type){case"keydown":case"keyup":{var r=e.type==="keydown",n=SDL.lookupKeyCodeForEvent(e),a;n>=1024?a=n-1024:a=SDL.scanCodes[n]||n,HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP8[t+8>>>0]=r?1:0,HEAP8[t+9>>>0]=0,HEAP32[t+12>>>2>>>0]=a,HEAP32[t+16>>>2>>>0]=n,HEAP16[t+20>>>1>>>0]=SDL.modState,HEAP32[t+24>>>2>>>0]=e.keypressCharCode||n;break}case"keypress":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type];for(var o=intArrayFromString(String.fromCharCode(e.charCode)),l=0;l>>0]=o[l];break}case"mousedown":case"mouseup":case"mousemove":{if(e.type!="mousemove"){var r=e.type==="mousedown";HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP32[t+8>>>2>>>0]=0,HEAP32[t+12>>>2>>>0]=0,HEAP8[t+16>>>0]=e.button+1,HEAP8[t+17>>>0]=r?1:0,HEAP32[t+20>>>2>>>0]=Browser.mouseX,HEAP32[t+24>>>2>>>0]=Browser.mouseY}else HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP32[t+8>>>2>>>0]=0,HEAP32[t+12>>>2>>>0]=0,HEAP32[t+16>>>2>>>0]=SDL.buttonState,HEAP32[t+20>>>2>>>0]=Browser.mouseX,HEAP32[t+24>>>2>>>0]=Browser.mouseY,HEAP32[t+28>>>2>>>0]=Browser.mouseMovementX,HEAP32[t+32>>>2>>>0]=Browser.mouseMovementY;break}case"wheel":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+16>>>2>>>0]=e.deltaX,HEAP32[t+20>>>2>>>0]=e.deltaY;break}case"touchstart":case"touchend":case"touchmove":{var u=e.touch;if(!Browser.touches[u.identifier])break;var _=Module.canvas.width,d=Module.canvas.height,p=Browser.touches[u.identifier].x/_,f=Browser.touches[u.identifier].y/d,m=Browser.lastTouches[u.identifier].x/_,h=Browser.lastTouches[u.identifier].y/d,g=p-m,b=f-h;if(u.deviceID===void 0&&(u.deviceID=SDL.TOUCH_DEFAULT_ID),g===0&&b===0&&e.type==="touchmove")return!1;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=_SDL_GetTicks(),tempI64=[u.deviceID>>>0,(tempDouble=u.deviceID,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+8>>>2>>>0]=tempI64[0],HEAP32[t+12>>>2>>>0]=tempI64[1],tempI64=[u.identifier>>>0,(tempDouble=u.identifier,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+16>>>2>>>0]=tempI64[0],HEAP32[t+20>>>2>>>0]=tempI64[1],HEAPF32[t+24>>>2>>>0]=p,HEAPF32[t+28>>>2>>>0]=f,HEAPF32[t+32>>>2>>>0]=g,HEAPF32[t+36>>>2>>>0]=b,u.force!==void 0?HEAPF32[t+40>>>2>>>0]=u.force:HEAPF32[t+40>>>2>>>0]=e.type=="touchend"?0:1;break}case"unload":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type];break}case"resize":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=e.w,HEAP32[t+8>>>2>>>0]=e.h;break}case"joystick_button_up":case"joystick_button_down":{var v=e.type==="joystick_button_up"?0:1;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP8[t+4>>>0]=e.index,HEAP8[t+5>>>0]=e.button,HEAP8[t+6>>>0]=v;break}case"joystick_axis_motion":{HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP8[t+4>>>0]=e.index,HEAP8[t+5>>>0]=e.axis,HEAP32[t+8>>>2>>>0]=SDL.joystickAxisValueConversion(e.value);break}case"focus":{var S=12;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP8[t+8>>>0]=S;break}case"blur":{var L=13;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP8[t+8>>>0]=L;break}case"visibilitychange":{var T=1,A=2,M=e.visible?T:A;HEAP32[t>>>2>>>0]=SDL.DOMEventToSDLEvent[e.type],HEAP32[t+4>>>2>>>0]=0,HEAP8[t+8>>>0]=M;break}default:throw"Unhandled SDL event: "+e.type}},makeFontString(e,t){return t.charAt(0)!="'"&&t.charAt(0)!='"'&&(t='"'+t+'"'),e+"px "+t+", serif"},estimateTextWidth(e,t){var r=e.size,n=SDL.makeFontString(r,e.name),a=SDL.ttfContext;a.font=n;var o=a.measureText(t).width|0;return o},allocateChannels(e){if(!(SDL.numChannels&&SDL.numChannels>=e&&e!=0)){SDL.numChannels=e,SDL.channels=[];for(var t=0;t{e.paused||SDL.playWebAudio(e)});return}e.webAudioNode=SDL.audioContext.createBufferSource(),e.webAudioNode.buffer=t.decodedBuffer,e.webAudioNode.loop=e.loop,e.webAudioNode.onended=e.onended,e.webAudioPannerNode=SDL.audioContext.createPanner(),e.webAudioPannerNode.setPosition(0,0,-.5),e.webAudioPannerNode.panningModel="equalpower",e.webAudioGainNode=SDL.audioContext.createGain(),e.webAudioGainNode.gain.value=e.volume,e.webAudioNode.connect(e.webAudioPannerNode),e.webAudioPannerNode.connect(e.webAudioGainNode),e.webAudioGainNode.connect(SDL.audioContext.destination),e.webAudioNode.start(0,e.currentPosition),e.startTime=SDL.audioContext.currentTime-e.currentPosition}catch(r){err("playWebAudio failed: ".concat(r))}},pauseWebAudio(e){if(e){if(e.webAudioNode)try{e.currentPosition=(SDL.audioContext.currentTime-e.startTime)%e.resource.webAudio.decodedBuffer.duration,e.webAudioNode.onended=void 0,e.webAudioNode.stop(0),e.webAudioNode=void 0}catch(t){err("pauseWebAudio failed: ".concat(t))}e.paused=!0}},openAudioContext(){SDL.audioContext||(typeof AudioContext<"u"?SDL.audioContext=new AudioContext:typeof webkitAudioContext<"u"&&(SDL.audioContext=new webkitAudioContext))},webAudioAvailable:()=>!!SDL.audioContext,fillWebAudioBufferFromHeap(e,t,r){for(var n=SDL.audio,a=n.channels,o=0;o>>1>>>0]/32768;else if(n.format==8)for(var u=0;u>>0];l[u]=(_>=0?_-128:_+128)/128}else if(n.format==33056)for(var u=0;u>>2>>>0];else throw"Invalid SDL audio format "+n.format+"!"}},joystickEventState:1,lastJoystickState:{},joystickNamePool:{},recordJoystickState(e,t){for(var r=new Array(t.buttons.length),n=0;n0},queryJoysticks(){for(var e in SDL.lastJoystickState){var t=SDL.getGamepad(e-1),r=SDL.lastJoystickState[e];if(typeof t>"u"||t===null)return;if(typeof t.timestamp!="number"||t.timestamp!=r.timestamp||!t.timestamp){var n;for(n=0;ne&&e>=0?t[e]:null}};function _SDL_Linked_Version(){return SDL.version===null&&(SDL.version=_malloc(3),HEAP8[SDL.version>>>0]=1,HEAP8[SDL.version+1>>>0]=3,HEAP8[SDL.version+2>>>0]=0),SDL.version}_SDL_Linked_Version.sig="p";var _SDL_Init=e=>{if(SDL.startTime=Date.now(),SDL.initFlags=e,!Module.doNotCaptureKeyboard){var t=Module.keyboardListeningElement||document;t.addEventListener("keydown",SDL.receiveEvent),t.addEventListener("keyup",SDL.receiveEvent),t.addEventListener("keypress",SDL.receiveEvent),window.addEventListener("focus",SDL.receiveEvent),window.addEventListener("blur",SDL.receiveEvent),document.addEventListener("visibilitychange",SDL.receiveEvent)}return window.addEventListener("unload",SDL.receiveEvent),SDL.keyboardState=_calloc(65536,1),SDL.DOMEventToSDLEvent.keydown=768,SDL.DOMEventToSDLEvent.keyup=769,SDL.DOMEventToSDLEvent.keypress=771,SDL.DOMEventToSDLEvent.mousedown=1025,SDL.DOMEventToSDLEvent.mouseup=1026,SDL.DOMEventToSDLEvent.mousemove=1024,SDL.DOMEventToSDLEvent.wheel=1027,SDL.DOMEventToSDLEvent.touchstart=1792,SDL.DOMEventToSDLEvent.touchend=1793,SDL.DOMEventToSDLEvent.touchmove=1794,SDL.DOMEventToSDLEvent.unload=256,SDL.DOMEventToSDLEvent.resize=28673,SDL.DOMEventToSDLEvent.visibilitychange=512,SDL.DOMEventToSDLEvent.focus=512,SDL.DOMEventToSDLEvent.blur=512,SDL.DOMEventToSDLEvent.joystick_axis_motion=1536,SDL.DOMEventToSDLEvent.joystick_button_down=1539,SDL.DOMEventToSDLEvent.joystick_button_up=1540,0};_SDL_Init.sig="ii";var _SDL_WasInit=e=>(SDL.startTime===null&&_SDL_Init(0),1);_SDL_WasInit.sig="ii";function _SDL_GetVideoInfo(){var e=_calloc(20,1);return HEAP32[e+12>>>2>>>0]=Module.canvas.width,HEAP32[e+16>>>2>>>0]=Module.canvas.height,e}_SDL_GetVideoInfo.sig="p";function _SDL_ListModes(e,t){return-1}_SDL_ListModes.sig="ppi";var _SDL_VideoModeOK=(e,t,r,n)=>r;_SDL_VideoModeOK.sig="iiiii";function _SDL_VideoDriverName(e,t){if(e>>>=0,SDL.startTime===null)return 0;var r=[101,109,115,99,114,105,112,116,101,110,95,115,100,108,95,100,114,105,118,101,114],n=0,a=r.length;for(t<=a&&(a=t-1);n>>0]=o,n++}return HEAP8[e+n>>>0]=0,e}_SDL_VideoDriverName.sig="ppi";var _SDL_AudioDriverName=_SDL_VideoDriverName;_SDL_AudioDriverName.sig="ppi";var _SDL_SetVideoMode=function(e,t,r,n){["touchstart","touchend","touchmove","mousedown","mouseup","mousemove","mousewheel","wheel","mouseout","DOMMouseScroll"].forEach(o=>Module.canvas.addEventListener(o,SDL.receiveEvent,!0));var a=Module.canvas;return e==0&&t==0&&(e=a.width,t=a.height),SDL.addedResizeListener||(SDL.addedResizeListener=!0,Browser.resizeListeners.push((o,l)=>{SDL.settingVideoMode||SDL.receiveEvent({type:"resize",w:o,h:l})})),SDL.settingVideoMode=!0,Browser.setCanvasSize(e,t),SDL.settingVideoMode=!1,SDL.screen&&(SDL.freeSurface(SDL.screen),assert(!SDL.screen)),SDL.GL&&(n=n|67108864),SDL.screen=SDL.makeSurface(e,t,n,!0,"screen"),SDL.screen};_SDL_SetVideoMode.sig="piiii";function _SDL_GetVideoSurface(){return SDL.screen}_SDL_GetVideoSurface.sig="p";var _SDL_AudioQuit=()=>{for(var e=0;eout("SDL_VideoQuit called (and ignored)");_SDL_VideoQuit.sig="v";var _SDL_QuitSubSystem=e=>out("SDL_QuitSubSystem called (and ignored)");_SDL_QuitSubSystem.sig="vi";var _SDL_Quit=()=>{_SDL_AudioQuit(),out("SDL_Quit called (and ignored)")};_SDL_Quit.sig="v";function _SDL_UnlockSurface(e){e>>>=0,assert(!SDL.GL);var t=SDL.surfaces[e];if(!(!t.locked||--t.locked>0)){if(t.isFlagSet(2097152))SDL.copyIndexedColorData(t);else if(t.colors)for(var r=Module.canvas.width,n=Module.canvas.height,a=t.buffer,o=t.image.data,l=t.colors,u=0;u>>0]*4,f=_+d*4;o[f]=l[p],o[f+1]=l[p+1],o[f+2]=l[p+2]}a+=r*3}else{var o=t.image.data,m=t.buffer;assert(m%4==0,"Invalid buffer offset: "+m);var h=m>>>2,g=0,b=e==SDL.screen,v;if(typeof CanvasPixelArray<"u"&&o instanceof CanvasPixelArray)for(v=o.length;g>>0];o[g]=p&255,o[g+1]=p>>8&255,o[g+2]=p>>16&255,o[g+3]=b?255:p>>24&255,h++,g+=4}else{var S=new Uint32Array(o.buffer);if(b&&SDL.defaults.opaqueFrontBuffer){v=S.length,S.set(HEAP32.subarray(h>>>0,h+v>>>0));var L=new Uint8Array(o.buffer),T=3,A=T+4*v;if(v%8==0)for(;T>>0,h+S.length>>>0))}}t.ctx.putImageData(t.image,0,0)}}_SDL_UnlockSurface.sig="vp";function _SDL_Flip(e){}_SDL_Flip.sig="ip";function _SDL_UpdateRect(e,t,r,n,a){}_SDL_UpdateRect.sig="vpiiii";function _SDL_UpdateRects(e,t,r){}_SDL_UpdateRects.sig="vpip";var _SDL_Delay=e=>{ENVIRONMENT_IS_WORKER||abort("SDL_Delay called on the main thread! Potential infinite loop, quitting. (consider building with async support like ASYNCIFY)")};_SDL_Delay.sig="vi";function _SDL_WM_SetCaption(e,t){e>>>=0,t>>>=0,e&&_emscripten_set_window_title(e),t&&(t=UTF8ToString(t))}_SDL_WM_SetCaption.sig="vpp";var _SDL_EnableKeyRepeat=(e,t)=>{};_SDL_EnableKeyRepeat.sig="iii";function _SDL_GetKeyboardState(e){return e>>>=0,e&&(HEAP32[e>>>2>>>0]=65536),SDL.keyboardState}_SDL_GetKeyboardState.sig="pp";var _SDL_GetKeyState=()=>_SDL_GetKeyboardState(0);function _SDL_GetKeyName(e){return SDL.keyName||(SDL.keyName=stringToNewUTF8("unknown key")),SDL.keyName}_SDL_GetKeyName.sig="pi";var _SDL_GetModState=()=>SDL.modState;_SDL_GetModState.sig="i";function _SDL_GetMouseState(e,t){return e>>>=0,t>>>=0,e&&(HEAP32[e>>>2>>>0]=Browser.mouseX),t&&(HEAP32[t>>>2>>>0]=Browser.mouseY),SDL.buttonState}_SDL_GetMouseState.sig="ipp";var _SDL_WarpMouse=(e,t)=>{};_SDL_WarpMouse.sig="vii";var _SDL_ShowCursor=e=>{switch(e){case 0:return Browser.isFullscreen?(Module.canvas.requestPointerLock(),0):1;case 1:return Module.canvas.exitPointerLock(),1;case-1:return!Browser.pointerLock;default:err("SDL_ShowCursor called with unknown toggle parameter value: ".concat(e));break}};_SDL_ShowCursor.sig="ii";function _SDL_GetError(){return SDL.errorMessage||(SDL.errorMessage=stringToNewUTF8("unknown SDL-emscripten error")),SDL.errorMessage}_SDL_GetError.sig="p";function _SDL_SetError(e,t){}_SDL_SetError.sig="vpp";function _SDL_CreateRGBSurface(e,t,r,n,a,o,l,u){return SDL.makeSurface(t,r,e,!1,"CreateRGBSurface",a,o,l,u)}_SDL_CreateRGBSurface.sig="piiiiiiii";function _SDL_CreateRGBSurfaceFrom(e,t,r,n,a,o,l,u,_){e>>>=0;var d=SDL.makeSurface(t,r,0,!1,"CreateRGBSurfaceFrom",o,l,u,_);if(n!==32)return err("TODO: Partially unimplemented SDL_CreateRGBSurfaceFrom called!"),d;for(var p=SDL.surfaces[d],f=p.ctx.createImageData(t,r),m=t*4,h=0;h>>0];return p.ctx.putImageData(f,0,0),d}_SDL_CreateRGBSurfaceFrom.sig="ppiiiiiiii";function _SDL_ConvertSurface(e,t,r){e>>>=0;var n=SDL.surfaces[e],a=SDL.makeSurface(n.width,n.height,n.flags,!1,"copy:"+n.source),o=SDL.surfaces[a];return o.ctx.globalCompositeOperation="copy",o.ctx.drawImage(n.canvas,0,0),o.ctx.globalCompositeOperation=n.ctx.globalCompositeOperation,a}_SDL_ConvertSurface.sig="pppi";function _SDL_DisplayFormatAlpha(e){return e>>>=0,_SDL_ConvertSurface(e)}_SDL_DisplayFormatAlpha.sig="pp";function _SDL_FreeSurface(e){e>>>=0,e&&SDL.freeSurface(e)}_SDL_FreeSurface.sig="vp";function _SDL_UpperBlit(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,SDL.blitSurface(e,t,r,n,!1)}_SDL_UpperBlit.sig="ipppp";function _SDL_UpperBlitScaled(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,SDL.blitSurface(e,t,r,n,!0)}_SDL_UpperBlitScaled.sig="ipppp";var _SDL_LowerBlit=_SDL_UpperBlit;_SDL_LowerBlit.sig="ipppp";var _SDL_LowerBlitScaled=_SDL_UpperBlitScaled;_SDL_LowerBlitScaled.sig="ipppp";function _SDL_GetClipRect(e,t){e>>>=0,t>>>=0,assert(t);var r=SDL.surfaces[e],n=r.clipRect||{x:0,y:0,w:r.width,h:r.height};SDL.updateRect(t,n)}_SDL_GetClipRect.sig="vpp";function _SDL_SetClipRect(e,t){e>>>=0,t>>>=0;var r=SDL.surfaces[e];t?r.clipRect=SDL.intersectionOfRects({x:0,y:0,w:r.width,h:r.height},SDL.loadRect(t)):delete r.clipRect}_SDL_SetClipRect.sig="ipp";function _SDL_FillRect(e,t,r){e>>>=0,t>>>=0;var n=SDL.surfaces[e];assert(!n.locked),n.isFlagSet(2097152)&&(r=n.colors32[r]);var a=t?SDL.loadRect(t):{x:0,y:0,w:n.width,h:n.height};return n.clipRect&&(a=SDL.intersectionOfRects(n.clipRect,a),t&&SDL.updateRect(t,a)),n.ctx.save(),n.ctx.fillStyle=SDL.translateColorToCSSRGBA(r),n.ctx.fillRect(a.x,a.y,a.w,a.h),n.ctx.restore(),0}_SDL_FillRect.sig="ippi";function _zoomSurface(e,t,r,n){e>>>=0;var a=SDL.surfaces[e],o=a.width*t,l=a.height*r,u=SDL.makeSurface(Math.abs(o),Math.abs(l),a.flags,!1,"zoomSurface"),_=SDL.surfaces[u];return t>=0&&r>=0?_.ctx.drawImage(a.canvas,0,0,o,l):(_.ctx.save(),_.ctx.scale(t<0?-1:1,r<0?-1:1),_.ctx.drawImage(a.canvas,o<0?o:0,l<0?l:0,Math.abs(o),Math.abs(l)),_.ctx.restore()),u}_zoomSurface.sig="ppddi";function _rotozoomSurface(e,t,r,n){if(e>>>=0,t%360===0)return _zoomSurface(e,r,r);var a=SDL.surfaces[e],o=a.width*r,l=a.height*r,u=Math.ceil(Math.sqrt(Math.pow(o,2)+Math.pow(l,2))),_=SDL.makeSurface(u,u,a.flags,!1,"rotozoomSurface"),d=SDL.surfaces[_];return d.ctx.translate(u/2,u/2),d.ctx.rotate(-t*Math.PI/180),d.ctx.drawImage(a.canvas,-o/2,-l/2,o,l),_}_rotozoomSurface.sig="ppddi";function _SDL_SetAlpha(e,t,r){e>>>=0;var n=SDL.surfaces[e];n.alpha=r,t&65536||(n.alpha=255)}_SDL_SetAlpha.sig="ipii";function _SDL_SetColorKey(e,t,r){return warnOnce("SDL_SetColorKey is a no-op for performance reasons"),0}_SDL_SetColorKey.sig="ipii";function _SDL_PollEvent(e){return e>>>=0,SDL.pollEvent(e)}_SDL_PollEvent.sig="ip";function _SDL_PushEvent(e){e>>>=0;var t=_malloc(28);return _memcpy(t,e,28),SDL.events.push(t),0}_SDL_PushEvent.sig="ip";function _SDL_PeepEvents(e,t,r,n,a){switch(e>>>=0,r){case 2:{assert(t==1);for(var o=0,l=0;oSDL.events.forEach(SDL.handleEvent);_SDL_PumpEvents.sig="v";function _emscripten_SDL_SetEventHandler(e,t){e>>>=0,t>>>=0,SDL.eventHandler=e,SDL.eventHandlerContext=t,SDL.eventHandlerTemp||(SDL.eventHandlerTemp=_malloc(28))}_emscripten_SDL_SetEventHandler.sig="vpp";function _SDL_SetColors(e,t,r,n){e>>>=0,t>>>=0;var a=SDL.surfaces[e];if(!a.colors){var o=new ArrayBuffer(1024);a.colors=new Uint8Array(o),a.colors32=new Uint32Array(o)}for(var l=0;l>>0],a.colors[u+1]=HEAPU8[t+(l*4+1)>>>0],a.colors[u+2]=HEAPU8[t+(l*4+2)>>>0],a.colors[u+3]=255}return 1}_SDL_SetColors.sig="ippii";function _SDL_SetPalette(e,t,r,n,a){return e>>>=0,r>>>=0,_SDL_SetColors(e,r,n,a)}_SDL_SetPalette.sig="ipipii";function _SDL_MapRGB(e,t,r,n){return t&255|(r&255)<<8|(n&255)<<16|4278190080}_SDL_MapRGB.sig="ipiii";function _SDL_MapRGBA(e,t,r,n,a){return t&255|(r&255)<<8|(n&255)<<16|(a&255)<<24}_SDL_MapRGBA.sig="ipiiii";function _SDL_GetRGB(e,t,r,n,a){r>>>=0,n>>>=0,a>>>=0,r&&(HEAP8[r>>>0]=e&255),n&&(HEAP8[n>>>0]=e>>8&255),a&&(HEAP8[a>>>0]=e>>16&255)}_SDL_GetRGB.sig="vipppp";function _SDL_GetRGBA(e,t,r,n,a,o){r>>>=0,n>>>=0,a>>>=0,o>>>=0,r&&(HEAP8[r>>>0]=e&255),n&&(HEAP8[n>>>0]=e>>8&255),a&&(HEAP8[a>>>0]=e>>16&255),o&&(HEAP8[o>>>0]=e>>24&255)}_SDL_GetRGBA.sig="vippppp";var _SDL_GetAppState=()=>{var e=0;return Browser.pointerLock&&(e|=1),document.hasFocus()&&(e|=2),e|=4,e};_SDL_GetAppState.sig="i";var _SDL_WM_GrabInput=()=>{};_SDL_WM_GrabInput.sig="ii";function _SDL_WM_ToggleFullScreen(e){return Browser.exitFullscreen()?1:SDL.canRequestFullscreen?(SDL.isRequestingFullscreen=!0,1):0}_SDL_WM_ToggleFullScreen.sig="ip";var _IMG_Init=e=>e;_IMG_Init.sig="ii";function _SDL_FreeRW(e){for(e>>>=0,SDL.rwops[e]=null;SDL.rwops.length>0&&SDL.rwops[SDL.rwops.length-1]===null;)SDL.rwops.pop()}_SDL_FreeRW.sig="vp";var _IMG_Load_RW=function(e,t){e>>>=0;var r=stackSave();try{var n=()=>{stackRestore(r),l&&t&&_SDL_FreeRW(e)},a=A=>{var M=n;n=()=>{M(),A()}},o=(A,M)=>{var X=stackAlloc(4),x=stackAlloc(4),w=stackAlloc(4),E=Module["_"+A](...M,X,x,w,0);return E?(a(()=>Module._stbi_image_free(E)),{rawData:!0,data:E,width:HEAP32[X>>>2>>>0],height:HEAP32[x>>>2>>>0],size:HEAP32[X>>>2>>>0]*HEAP32[x>>>2>>>0]*HEAP32[w>>>2>>>0],bpp:HEAP32[w>>>2>>>0]}):null},l=SDL.rwops[e];if(l===void 0)return 0;var u,_=l.filename;if(_===void 0)return warnOnce("Only file names that have been preloaded are supported for IMG_Load_RW. Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js), or package files with --use-preload-plugins"),0;if(!u)if(_=PATH_FS.resolve(_),u=preloadedImages[_],u)Module.freePreloadedMediaOnUse&&(preloadedImages[_]=null);else return u===null&&err("Trying to reuse preloaded image, but freePreloadedMediaOnUse is set!"),warnOnce("Cannot find preloaded image "+_),warnOnce("Cannot find preloaded image "+_+". Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js), or package files with --use-preload-plugins"),0;var d=SDL.makeSurface(u.width,u.height,0,!1,"load:"+_),p=SDL.surfaces[d];if(p.ctx.globalCompositeOperation="copy",!u.rawData)p.ctx.drawImage(u,0,0,u.width,u.height,0,0,u.width,u.height);else{var f=p.ctx.getImageData(0,0,p.width,p.height);if(u.bpp==4)f.data.set(HEAPU8.subarray(u.data>>>0,u.data+u.size>>>0));else if(u.bpp==3)for(var m=u.size/3,h=f.data,g=u.data,b=0,v=0;v>>0],h[b++]=HEAPU8[g++>>>0],h[b++]=HEAPU8[g++>>>0],h[b++]=255;else if(u.bpp==2)for(var m=u.size,h=f.data,g=u.data,b=0,v=0;v>>0],L=HEAPU8[g++>>>0];h[b++]=S,h[b++]=S,h[b++]=S,h[b++]=L}else if(u.bpp==1)for(var m=u.size,h=f.data,g=u.data,b=0,v=0;v>>0];h[b++]=T,h[b++]=T,h[b++]=T,h[b++]=255}else return err("cannot handle bpp ".concat(u.bpp)),0;p.ctx.putImageData(f,0,0)}return p.ctx.globalCompositeOperation="source-over",_SDL_LockSurface(d),p.locked--,SDL.GL&&(p.canvas=p.ctx=null),d}finally{n()}};_IMG_Load_RW.sig="ppi";var _SDL_LoadBMP_RW=_IMG_Load_RW;_SDL_LoadBMP_RW.sig="ppi";function _SDL_RWFromFile(e,t){e>>>=0;var r=SDL.rwops.length,n=UTF8ToString(e);return SDL.rwops.push({filename:n,mimetype:Browser.getMimetype(n)}),r}_SDL_RWFromFile.sig="ppp";function _IMG_Load(e){e>>>=0;var t=_SDL_RWFromFile(e),r=_IMG_Load_RW(t,1);return r}_IMG_Load.sig="pp";var _IMG_Quit=()=>out("IMG_Quit called (and ignored)");_IMG_Quit.sig="v";function _SDL_OpenAudio(e,t){e>>>=0,t>>>=0;try{if(SDL.audio={freq:HEAPU32[e>>>2>>>0],format:HEAPU16[e+4>>>1>>>0],channels:HEAPU8[e+6>>>0],samples:HEAPU16[e+8>>>1>>>0],callback:HEAPU32[e+16>>>2>>>0],userdata:HEAPU32[e+20>>>2>>>0],paused:!0,timer:null},SDL.audio.format==8)SDL.audio.silence=128;else if(SDL.audio.format==32784)SDL.audio.silence=0;else if(SDL.audio.format==33056)SDL.audio.silence=0;else throw"Invalid SDL audio format "+SDL.audio.format+"!";if(SDL.audio.freq<=0)throw"Unsupported sound frequency "+SDL.audio.freq+"!";if(SDL.audio.freq<=22050)SDL.audio.freq=22050;else if(SDL.audio.freq<=32e3)SDL.audio.freq=32e3;else if(SDL.audio.freq<=44100)SDL.audio.freq=44100;else if(SDL.audio.freq<=48e3)SDL.audio.freq=48e3;else if(SDL.audio.freq<=96e3)SDL.audio.freq=96e3;else throw"Unsupported sound frequency ".concat(SDL.audio.freq,"!");if(SDL.audio.channels==0)SDL.audio.channels=1;else{if(SDL.audio.channels<0||SDL.audio.channels>32)throw"Unsupported number of audio channels for SDL audio: ".concat(SDL.audio.channels,"!");SDL.audio.channels!=1&&SDL.audio.channels!=2&&out("Warning: Using untested number of audio channels ".concat(SDL.audio.channels))}if(SDL.audio.samples<128||SDL.audio.samples>524288)throw"Unsupported audio callback buffer size ".concat(SDL.audio.samples,"!");if(SDL.audio.samples&SDL.audio.samples-1)throw"Audio callback buffer size ".concat(SDL.audio.samples," must be a power-of-two!");var r=SDL.audio.samples*SDL.audio.channels;if(SDL.audio.format==8)SDL.audio.bytesPerSample=1;else if(SDL.audio.format==32784)SDL.audio.bytesPerSample=2;else if(SDL.audio.format==33056)SDL.audio.bytesPerSample=4;else throw"Invalid SDL audio format ".concat(SDL.audio.format,"!");if(SDL.audio.bufferSize=r*SDL.audio.bytesPerSample,SDL.audio.bufferDurationSecs=SDL.audio.bufferSize/SDL.audio.bytesPerSample/SDL.audio.channels/SDL.audio.freq,SDL.audio.bufferingDelay=.05,SDL.audio.buffer=_malloc(SDL.audio.bufferSize),SDL.audio.numSimultaneouslyQueuedBuffers=Module.SDL_numSimultaneouslyQueuedBuffers||5,SDL.audio.queueNewAudioData=()=>{if(SDL.audio)for(var n=0;n=SDL.audio.bufferingDelay+SDL.audio.bufferDurationSecs*SDL.audio.numSimultaneouslyQueuedBuffers)return;getWasmTableEntry(SDL.audio.callback)(SDL.audio.userdata,SDL.audio.buffer,SDL.audio.bufferSize),SDL.audio.pushAudio(SDL.audio.buffer,SDL.audio.bufferSize)}},SDL.audio.caller=()=>{if(SDL.audio){--SDL.audio.numAudioTimersPending,SDL.audio.queueNewAudioData();var n=SDL.audio.nextPlayTime-SDL.audioContext.currentTime,a=SDL.audio.bufferDurationSecs/2;SDL.audio.numAudioTimersPending{try{if(SDL.audio.paused)return;var o=a/SDL.audio.bytesPerSample,l=o/SDL.audio.channels;if(l!=SDL.audio.samples)throw"Received mismatching audio buffer size!";var u=SDL.audioContext.createBufferSource(),_=SDL.audioContext.createBuffer(SDL.audio.channels,l,SDL.audio.freq);u.connect(SDL.audioContext.destination),SDL.fillWebAudioBufferFromHeap(n,l,_),u.buffer=_;var d=SDL.audioContext.currentTime,p=Math.max(d+SDL.audio.bufferingDelay,SDL.audio.nextPlayTime);typeof u.start<"u"?u.start(p):typeof u.noteOn<"u"&&u.noteOn(p),SDL.audio.nextPlayTime=p+SDL.audio.bufferDurationSecs}catch(f){err("Web Audio API error playing back audio: ".concat(f.toString()))}},t&&(HEAP32[t>>>2>>>0]=SDL.audio.freq,HEAP16[t+4>>>1>>>0]=SDL.audio.format,HEAP8[t+6>>>0]=SDL.audio.channels,HEAP8[t+7>>>0]=SDL.audio.silence,HEAP16[t+8>>>1>>>0]=SDL.audio.samples,HEAPU32[t+16>>>2>>>0]=SDL.audio.callback,HEAPU32[t+20>>>2>>>0]=SDL.audio.userdata),SDL.allocateChannels(32)}catch(n){err('Initializing SDL audio threw an exception: "'.concat(n.toString(),'"! Continuing without audio')),SDL.audio=null,SDL.allocateChannels(0),t&&(HEAP32[t>>>2>>>0]=0,HEAP16[t+4>>>1>>>0]=0,HEAP8[t+6>>>0]=0,HEAP8[t+7>>>0]=0,HEAP16[t+8>>>1>>>0]=0,HEAPU32[t+16>>>2>>>0]=0,HEAPU32[t+20>>>2>>>0]=0)}return SDL.audio?0:-1}_SDL_OpenAudio.sig="ipp";var _SDL_PauseAudio=e=>{SDL.audio&&(e?SDL.audio.timer!==void 0&&(clearTimeout(SDL.audio.timer),SDL.audio.numAudioTimersPending=0,SDL.audio.timer=void 0):SDL.audio.timer||(SDL.audio.numAudioTimersPending=1,SDL.audio.timer=safeSetTimeout(SDL.audio.caller,1)),SDL.audio.paused=e)};_SDL_PauseAudio.sig="vi";var _SDL_CloseAudio=()=>{SDL.audio&&(SDL.audio.callbackRemover&&(SDL.audio.callbackRemover(),SDL.audio.callbackRemover=null),_SDL_PauseAudio(1),_free(SDL.audio.buffer),SDL.audio=null,SDL.allocateChannels(0))};_SDL_CloseAudio.sig="v";var _SDL_LockAudio=()=>{};_SDL_LockAudio.sig="v";var _SDL_UnlockAudio=()=>{};_SDL_UnlockAudio.sig="v";function _SDL_CreateMutex(){return 0}_SDL_CreateMutex.sig="p";function _SDL_mutexP(e){return 0}_SDL_mutexP.sig="ip";function _SDL_mutexV(e){return 0}_SDL_mutexV.sig="ip";function _SDL_DestroyMutex(e){}_SDL_DestroyMutex.sig="vp";function _SDL_CreateCond(){return 0}_SDL_CreateCond.sig="p";function _SDL_CondSignal(e){}_SDL_CondSignal.sig="ip";function _SDL_CondWait(e,t){}_SDL_CondWait.sig="ipp";function _SDL_DestroyCond(e){}_SDL_DestroyCond.sig="vp";var _SDL_StartTextInput=()=>{SDL.textInput=!0};_SDL_StartTextInput.sig="v";var _SDL_StopTextInput=()=>{SDL.textInput=!1};_SDL_StopTextInput.sig="v";var _Mix_Init=e=>e?8:0;_Mix_Init.sig="ii";var _Mix_Quit=()=>{};_Mix_Quit.sig="v";var _Mix_OpenAudio=(e,t,r,n)=>(SDL.openAudioContext(),autoResumeAudioContext(SDL.audioContext),SDL.allocateChannels(32),SDL.mixerFrequency=e,SDL.mixerFormat=t,SDL.mixerNumChannels=r,SDL.mixerChunkSize=n,0);_Mix_OpenAudio.sig="iiiii";var _Mix_CloseAudio=_SDL_CloseAudio;_Mix_CloseAudio.sig="v";var _Mix_AllocateChannels=e=>(SDL.allocateChannels(e),e);_Mix_AllocateChannels.sig="ii";function _Mix_ChannelFinished(e){e>>>=0,SDL.channelFinished=e}_Mix_ChannelFinished.sig="vp";var _Mix_Volume=(e,t)=>{if(e==-1){for(var r=0;r(t/=255,r/=255,SDL.setPannerPosition(SDL.channels[e],r-t,0,.1),1);_Mix_SetPanning.sig="iiii";function _Mix_LoadWAV_RW(e,t){e>>>=0;var r=SDL.rwops[e];if(r===void 0)return 0;var n="",a,o,l;if(r.filename!==void 0){n=PATH_FS.resolve(r.filename);var u=preloadedAudios[n];if(!u){u===null&&err("Trying to reuse preloaded audio, but freePreloadedMediaOnUse is set!"),Module.noAudioDecoding||warnOnce("Cannot find preloaded audio "+n);try{l=FS.readFile(n)}catch{return err("Couldn't find file for: ".concat(n)),0}}Module.freePreloadedMediaOnUse&&(preloadedAudios[n]=null),a=u}else if(r.bytes!==void 0)SDL.webAudioAvailable()?l=HEAPU8.buffer.slice(r.bytes,r.bytes+r.count):l=HEAPU8.subarray(r.bytes>>>0,r.bytes+r.count>>>0);else return 0;var _=l&&(l.buffer||l),d=Module.SDL_canPlayWithWebAudio===void 0||Module.SDL_canPlayWithWebAudio(n,_);if(l!==void 0&&SDL.webAudioAvailable()&&d){a=void 0,o={},o.onDecodeComplete=[];var p=g=>{o.decodedBuffer=g,o.onDecodeComplete.forEach(b=>b()),o.onDecodeComplete=void 0};SDL.audioContext.decodeAudioData(_,p)}else if(a===void 0&&l){var f=new Blob([l],{type:r.mimetype}),m=URL.createObjectURL(f);a=new Audio,a.src=m,a.mozAudioChannelType="content"}var h=SDL.audios.length;return SDL.audios.push({source:n,audio:a,webAudio:o}),h}_Mix_LoadWAV_RW.sig="ppi";function _Mix_LoadWAV(e){e>>>=0;var t=_SDL_RWFromFile(e),r=_Mix_LoadWAV_RW(t);return _SDL_FreeRW(t),r}_Mix_LoadWAV.sig="pp";function _Mix_QuickLoad_RAW(e,t){e>>>=0;for(var r,n,a=t>>1,o=new Float32Array(a),l=0;l>>1>>>0]/32768;SDL.webAudioAvailable()?(n={},n.decodedBuffer=o):(r=new Audio,r.mozAudioChannelType="content",r.numChannels=SDL.mixerNumChannels,r.frequency=SDL.mixerFrequency);var u=SDL.audios.length;return SDL.audios.push({source:"",audio:r,webAudio:n,buffer:o}),u}_Mix_QuickLoad_RAW.sig="ppi";function _Mix_FreeChunk(e){e>>>=0,SDL.audios[e]=null}_Mix_FreeChunk.sig="vp";var _Mix_ReserveChannels=e=>{SDL.channelMinimumNumber=e};_Mix_ReserveChannels.sig="ii";function _Mix_PlayChannelTimed(e,t,r,n){t>>>=0,assert(n==-1);var a=SDL.audios[t];if(!a||!a.audio&&!a.webAudio)return-1;if(e==-1){for(var o=SDL.channelMinimumNumber;o0;_Mix_FadingChannel.sig="ii";var _Mix_HaltChannel=e=>{function t(n){var a=SDL.channels[n];a.audio&&(a.audio.pause(),a.audio=null),SDL.channelFinished&&getWasmTableEntry(SDL.channelFinished)(n)}if(e!=-1)t(e);else for(var r=0;r{var e=SDL.music.audio;return e&&(e.src=e.src,e.currentPosition=0,e.pause()),SDL.music.audio=null,SDL.hookMusicFinished&&getWasmTableEntry(SDL.hookMusicFinished)(),0};_Mix_HaltMusic.sig="i";function _Mix_HookMusicFinished(e){e>>>=0,SDL.hookMusicFinished=e,SDL.music.audio&&(SDL.music.audio.onended=_Mix_HaltMusic)}_Mix_HookMusicFinished.sig="vp";var _Mix_VolumeMusic=e=>SDL.setGetVolume(SDL.music,e);_Mix_VolumeMusic.sig="ii";function _Mix_LoadMUS_RW(e){return e>>>=0,_Mix_LoadWAV_RW(e)}_Mix_LoadMUS_RW.sig="pp";function _Mix_LoadMUS(e){e>>>=0;var t=_SDL_RWFromFile(e),r=_Mix_LoadMUS_RW(t);return _SDL_FreeRW(t),r}_Mix_LoadMUS.sig="pp";var _Mix_FreeMusic=_Mix_FreeChunk;_Mix_FreeMusic.sig="vp";function _Mix_PlayMusic(e,t){e>>>=0,SDL.music.audio&&(SDL.music.audio.paused||err("Music is already playing. ".concat(SDL.music.source)),SDL.music.audio.pause());var r=SDL.audios[e],n;return r.webAudio?(n={},n.resource=r,n.paused=!1,n.currentPosition=0,n.play=function(){SDL.playWebAudio(this)},n.pause=function(){SDL.pauseWebAudio(this)}):r.audio&&(n=r.audio),n.onended=function(){SDL.music.audio==this&&_Mix_HaltMusic()},n.loop=t!=0&&t!=1,n.volume=SDL.music.volume,SDL.music.audio=n,n.play(),0}_Mix_PlayMusic.sig="ipi";var _Mix_PauseMusic=()=>{var e=SDL.music.audio;e==null||e.pause()};_Mix_PauseMusic.sig="v";var _Mix_ResumeMusic=()=>{var e=SDL.music.audio;e==null||e.play()};_Mix_ResumeMusic.sig="v";var _Mix_FadeInMusicPos=_Mix_PlayMusic;_Mix_FadeInMusicPos.sig="ipiid";var _Mix_FadeOutMusic=_Mix_HaltMusic;_Mix_FadeOutMusic.sig="ii";var _Mix_PlayingMusic=()=>SDL.music.audio&&!SDL.music.audio.paused?1:0;_Mix_PlayingMusic.sig="i";var _Mix_Playing=e=>{if(e===-1){for(var t=0,r=0;r{if(e===-1){for(var t=0;t{var t;if(e===-1){for(var r=0,n=0;n{var e;return(e=SDL.music.audio)!=null&&e.paused?1:0};_Mix_PausedMusic.sig="i";var _Mix_Resume=e=>{if(e===-1){for(var t=0;t{try{var e=new OffscreenCanvas(0,0);if(SDL.ttfContext=e.getContext("2d"),typeof SDL.ttfContext.measureText!="function")throw"bad context"}catch{var t=document.createElement("canvas");SDL.ttfContext=t.getContext("2d")}return 0};_TTF_Init.sig="i";function _TTF_OpenFont(e,t){e>>>=0,e=PATH.normalize(UTF8ToString(e));var r=SDL.fonts.length;return SDL.fonts.push({name:e,size:t}),r}_TTF_OpenFont.sig="ppi";function _TTF_CloseFont(e){e>>>=0,SDL.fonts[e]=null}_TTF_CloseFont.sig="vp";function _TTF_RenderText_Solid(e,t,r){e>>>=0,t>>>=0,r>>>=0,t=UTF8ToString(t)||" ";var n=SDL.fonts[e],a=SDL.estimateTextWidth(n,t),o=n.size;r=SDL.loadColorToCSSRGB(r);var l=SDL.makeFontString(o,n.name),u=SDL.makeSurface(a,o,0,!1,"text:"+t),_=SDL.surfaces[u];return _.ctx.save(),_.ctx.fillStyle=r,_.ctx.font=l,_.ctx.textBaseline="bottom",_.ctx.fillText(t,0,o|0),_.ctx.restore(),u}_TTF_RenderText_Solid.sig="pppp";var _TTF_RenderText_Blended=_TTF_RenderText_Solid;_TTF_RenderText_Blended.sig="pppp";var _TTF_RenderText_Shaded=_TTF_RenderText_Solid;_TTF_RenderText_Shaded.sig="ppppp";var _TTF_RenderUTF8_Solid=_TTF_RenderText_Solid;_TTF_RenderUTF8_Solid.sig="pppp";function _TTF_SizeText(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,n>>>=0;var a=SDL.fonts[e];return r&&(HEAP32[r>>>2>>>0]=SDL.estimateTextWidth(a,UTF8ToString(t))),n&&(HEAP32[n>>>2>>>0]=a.size),0}_TTF_SizeText.sig="ipppp";var _TTF_SizeUTF8=_TTF_SizeText;_TTF_SizeUTF8.sig="ipppp";function _TTF_GlyphMetrics(e,t,r,n,a,o,l){e>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0;var u=SDL.fonts[e],_=SDL.estimateTextWidth(u,String.fromCharCode(t));l&&(HEAP32[l>>>2>>>0]=_),r&&(HEAP32[r>>>2>>>0]=0),n&&(HEAP32[n>>>2>>>0]=_),a&&(HEAP32[a>>>2>>>0]=0),o&&(HEAP32[o>>>2>>>0]=u.size)}_TTF_GlyphMetrics.sig="ipippppp";function _TTF_FontAscent(e){e>>>=0;var t=SDL.fonts[e];return t.size*.98|0}_TTF_FontAscent.sig="ip";function _TTF_FontDescent(e){e>>>=0;var t=SDL.fonts[e];return t.size*.02|0}_TTF_FontDescent.sig="ip";function _TTF_FontHeight(e){e>>>=0;var t=SDL.fonts[e];return t.size}_TTF_FontHeight.sig="ip";var _TTF_FontLineSkip=_TTF_FontHeight;_TTF_FontLineSkip.sig="ip";var _TTF_Quit=()=>out("TTF_Quit called (and ignored)");_TTF_Quit.sig="v";var SDL_gfx={drawRectangle:(e,t,r,n,a,o,l)=>{t=t<<16>>16,r=r<<16>>16,n=n<<16>>16,a=a<<16>>16;var u=SDL.surfaces[e];assert(!u.locked);var _=t{t=t<<16>>16,r=r<<16>>16,n=n<<16>>16,a=a<<16>>16;var l=SDL.surfaces[e];assert(!l.locked),l.ctx.save(),l.ctx.strokeStyle=o,l.ctx.beginPath(),l.ctx.moveTo(t,r),l.ctx.lineTo(n,a),l.ctx.stroke(),l.ctx.restore()},drawEllipse:(e,t,r,n,a,o,l)=>{t=t<<16>>16,r=r<<16>>16,n=n<<16>>16,a=a<<16>>16;var u=SDL.surfaces[e];assert(!u.locked),u.ctx.save(),u.ctx.beginPath(),u.ctx.translate(t,r),u.ctx.scale(n,a),u.ctx.arc(0,0,1,0,2*Math.PI),u.ctx.restore(),u.ctx.save(),u.ctx[o+"Style"]=l,u.ctx[o](),u.ctx.restore()},translateColorToCSSRGBA:e=>"rgba(".concat(e>>>24,",").concat(e>>16&255,",").concat(e>>8&255,",").concat(e&255,")")};function _boxColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"fill",SDL_gfx.translateColorToCSSRGBA(o))}_boxColor.sig="ipiiiii";function _boxRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"fill",SDL.translateRGBAToCSSRGBA(o,l,u,_))}_boxRGBA.sig="ipiiiiiiii";function _rectangleColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"stroke",SDL_gfx.translateColorToCSSRGBA(o))}_rectangleColor.sig="ipiiiii";function _rectangleRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawRectangle(e,t,r,n,a,"stroke",SDL.translateRGBAToCSSRGBA(o,l,u,_))}_rectangleRGBA.sig="ipiiiiiiii";function _ellipseColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"stroke",SDL_gfx.translateColorToCSSRGBA(o))}_ellipseColor.sig="ipiiiii";function _ellipseRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"stroke",SDL.translateRGBAToCSSRGBA(o,l,u,_))}_ellipseRGBA.sig="ipiiiiiiii";function _filledEllipseColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"fill",SDL_gfx.translateColorToCSSRGBA(o))}_filledEllipseColor.sig="ipiiiii";function _filledEllipseRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawEllipse(e,t,r,n,a,"fill",SDL.translateRGBAToCSSRGBA(o,l,u,_))}_filledEllipseRGBA.sig="ipiiiiiiii";function _lineColor(e,t,r,n,a,o){return e>>>=0,SDL_gfx.drawLine(e,t,r,n,a,SDL_gfx.translateColorToCSSRGBA(o))}_lineColor.sig="ipiiiii";function _lineRGBA(e,t,r,n,a,o,l,u,_){return e>>>=0,SDL_gfx.drawLine(e,t,r,n,a,SDL.translateRGBAToCSSRGBA(o,l,u,_))}_lineRGBA.sig="ipiiiiiiii";function _pixelRGBA(e,t,r,n,a,o,l){return e>>>=0,_boxRGBA(e,t,r,t,r,n,a,o,l)}_pixelRGBA.sig="ipiiiiii";var _SDL_GL_SetAttribute=(e,t)=>{e in SDL.glAttributes||abort("Unknown SDL GL attribute ("+e+"). Please check if your SDL version is supported."),SDL.glAttributes[e]=t};_SDL_GL_SetAttribute.sig="iii";function _SDL_GL_GetAttribute(e,t){return t>>>=0,e in SDL.glAttributes||abort("Unknown SDL GL attribute ("+e+"). Please check if your SDL version is supported."),t&&(HEAP32[t>>>2>>>0]=SDL.glAttributes[e]),0}_SDL_GL_GetAttribute.sig="iip";var _SDL_GL_SwapBuffers=()=>{var e;(e=Browser.doSwapBuffers)==null||e.call(Browser)};_SDL_GL_SwapBuffers.sig="v";function _SDL_GL_ExtensionSupported(e){return e>>>=0,Module.ctx.getExtension(e)|0}_SDL_GL_ExtensionSupported.sig="ip";function _SDL_DestroyWindow(e){}_SDL_DestroyWindow.sig="vp";function _SDL_DestroyRenderer(e){}_SDL_DestroyRenderer.sig="vp";function _SDL_GetWindowFlags(e){return Browser.isFullscreen?1:0}_SDL_GetWindowFlags.sig="ip";function _SDL_GL_SwapWindow(e){}_SDL_GL_SwapWindow.sig="vp";function _SDL_GL_MakeCurrent(e,t){}_SDL_GL_MakeCurrent.sig="ipp";function _SDL_GL_DeleteContext(e){}_SDL_GL_DeleteContext.sig="vp";var _SDL_GL_GetSwapInterval=()=>MainLoop.timingMode==1?MainLoop.timingValue:0;_SDL_GL_GetSwapInterval.sig="i";var _SDL_GL_SetSwapInterval=e=>{_emscripten_set_main_loop_timing(1,e)};_SDL_GL_SetSwapInterval.sig="ii";function _SDL_SetWindowTitle(e,t){t>>>=0,t&&(document.title=UTF8ToString(t))}_SDL_SetWindowTitle.sig="vpp";function _SDL_GetWindowSize(e,t,r){t>>>=0,r>>>=0;var n=Module.canvas.width,a=Module.canvas.height;t&&(HEAP32[t>>>2>>>0]=n),r&&(HEAP32[r>>>2>>>0]=a)}_SDL_GetWindowSize.sig="vppp";function _SDL_LogSetOutputFunction(e,t){}_SDL_LogSetOutputFunction.sig="vpp";function _SDL_SetWindowFullscreen(e,t){return Browser.isFullscreen?(Module.canvas.exitFullscreen(),1):0}_SDL_SetWindowFullscreen.sig="ipi";var _SDL_ClearError=()=>{};_SDL_ClearError.sig="v";var _SDL_SetGamma=(e,t,r)=>-1;_SDL_SetGamma.sig="ifff";function _SDL_SetGammaRamp(e,t,r){return-1}_SDL_SetGammaRamp.sig="ippp";var _SDL_NumJoysticks=()=>{for(var e=0,t=SDL.getGamepads(),r=0;rSDL.lastJoystickState.hasOwnProperty(e+1)?1:0;_SDL_JoystickOpened.sig="ii";function _SDL_JoystickIndex(e){return e>>>=0,e-1}_SDL_JoystickIndex.sig="ip";function _SDL_JoystickNumAxes(e){e>>>=0;var t=SDL.getGamepad(e-1);return t?t.axes.length:0}_SDL_JoystickNumAxes.sig="ip";function _SDL_JoystickNumBalls(e){return 0}_SDL_JoystickNumBalls.sig="ip";function _SDL_JoystickNumHats(e){return 0}_SDL_JoystickNumHats.sig="ip";function _SDL_JoystickNumButtons(e){e>>>=0;var t=SDL.getGamepad(e-1);return t?t.buttons.length:0}_SDL_JoystickNumButtons.sig="ip";var _SDL_JoystickUpdate=()=>SDL.queryJoysticks();_SDL_JoystickUpdate.sig="v";var _SDL_JoystickEventState=e=>e<0?SDL.joystickEventState:SDL.joystickEventState=e;_SDL_JoystickEventState.sig="ii";function _SDL_JoystickGetAxis(e,t){e>>>=0;var r=SDL.getGamepad(e-1);return r&&r.axes.length>t?SDL.joystickAxisValueConversion(r.axes[t]):0}_SDL_JoystickGetAxis.sig="ipi";function _SDL_JoystickGetHat(e,t){return 0}_SDL_JoystickGetHat.sig="ipi";function _SDL_JoystickGetBall(e,t,r,n){return-1}_SDL_JoystickGetBall.sig="ipipp";function _SDL_JoystickGetButton(e,t){e>>>=0;var r=SDL.getGamepad(e-1);return r&&r.buttons.length>t&&SDL.getJoystickButtonState(r.buttons[t])?1:0}_SDL_JoystickGetButton.sig="ipi";function _SDL_JoystickClose(e){e>>>=0,delete SDL.lastJoystickState[e]}_SDL_JoystickClose.sig="vp";var _SDL_InitSubSystem=e=>0;_SDL_InitSubSystem.sig="ii";function _SDL_RWFromConstMem(e,t){e>>>=0;var r=SDL.rwops.length;return SDL.rwops.push({bytes:e,count:t}),r}_SDL_RWFromConstMem.sig="ppi";var _SDL_RWFromMem=_SDL_RWFromConstMem;_SDL_RWFromMem.sig="ppi";var _SDL_GetNumAudioDrivers=()=>1;_SDL_GetNumAudioDrivers.sig="i";function _SDL_GetCurrentAudioDriver(){return stringToNewUTF8("Emscripten Audio")}_SDL_GetCurrentAudioDriver.sig="p";var _SDL_GetScancodeFromKey=e=>SDL.scanCodes[e];_SDL_GetScancodeFromKey.sig="ii";function _SDL_GetAudioDriver(e){return _SDL_GetCurrentAudioDriver()}_SDL_GetAudioDriver.sig="pi";var _SDL_EnableUNICODE=e=>{var t=SDL.unicode||0;return SDL.unicode=e,t};_SDL_EnableUNICODE.sig="ii";var _SDL_AddTimer=function(e,t,r){return t>>>=0,r>>>=0,safeSetTimeout(()=>getWasmTableEntry(t)(e,r),e)};_SDL_AddTimer.sig="iipp";var _SDL_RemoveTimer=e=>(clearTimeout(e),!0);_SDL_RemoveTimer.sig="ii";function _SDL_CreateThread(e,t,r,n){throw"SDL threads cannot be supported in the web platform because they assume shared state. See emscripten_create_worker etc. for a message-passing concurrency model that does let you run code in another thread."}_SDL_CreateThread.sig="ppp";function _SDL_WaitThread(e,t){throw"SDL_WaitThread"}_SDL_WaitThread.sig="vpp";function _SDL_GetThreadID(e){throw"SDL_GetThreadID"}_SDL_GetThreadID.sig="pp";function _SDL_ThreadID(){return 0}_SDL_ThreadID.sig="p";function _SDL_AllocRW(){throw"SDL_AllocRW: TODO"}_SDL_AllocRW.sig="p";function _SDL_CondBroadcast(e){throw"SDL_CondBroadcast: TODO"}_SDL_CondBroadcast.sig="ip";function _SDL_CondWaitTimeout(e,t,r){throw"SDL_CondWaitTimeout: TODO"}_SDL_CondWaitTimeout.sig="ippi";var _SDL_WM_IconifyWindow=()=>{throw"SDL_WM_IconifyWindow TODO"};_SDL_WM_IconifyWindow.sig="i";function _Mix_SetPostMix(e,t){return warnOnce("Mix_SetPostMix: TODO")}_Mix_SetPostMix.sig="vpp";function _Mix_VolumeChunk(e,t){throw"Mix_VolumeChunk: TODO"}_Mix_VolumeChunk.sig="ipi";var _Mix_SetPosition=(e,t,r)=>{throw"Mix_SetPosition: TODO"};_Mix_SetPosition.sig="iiii";function _Mix_QuerySpec(e,t,r){throw"Mix_QuerySpec: TODO"}_Mix_QuerySpec.sig="ippp";function _Mix_FadeInChannelTimed(e,t,r,n,a){throw"Mix_FadeInChannelTimed"}_Mix_FadeInChannelTimed.sig="iipiii";var _Mix_FadeOutChannel=()=>{throw"Mix_FadeOutChannel"};_Mix_FadeOutChannel.sig="iii";function _Mix_Linked_Version(){throw"Mix_Linked_Version: TODO"}_Mix_Linked_Version.sig="p";function _SDL_SaveBMP_RW(e,t,r){throw"SDL_SaveBMP_RW: TODO"}_SDL_SaveBMP_RW.sig="ippi";function _SDL_WM_SetIcon(e,t){}_SDL_WM_SetIcon.sig="vpp";var _SDL_HasRDTSC=()=>0;_SDL_HasRDTSC.sig="i";var _SDL_HasMMX=()=>0;_SDL_HasMMX.sig="i";var _SDL_HasMMXExt=()=>0;_SDL_HasMMXExt.sig="i";var _SDL_Has3DNow=()=>0;_SDL_Has3DNow.sig="i";var _SDL_Has3DNowExt=()=>0;_SDL_Has3DNowExt.sig="i";var _SDL_HasSSE=()=>0;_SDL_HasSSE.sig="i";var _SDL_HasSSE2=()=>0;_SDL_HasSSE2.sig="i";var _SDL_HasAltiVec=()=>0;_SDL_HasAltiVec.sig="i";var _emscripten_is_main_browser_thread=()=>!ENVIRONMENT_IS_WORKER,tupleRegistrations={},structRegistrations={},getTypeName=e=>{var t=___getTypeName(e),r=readLatin1String(t);return _free(t),r},getFunctionName=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},heap32VectorToArray=(e,t)=>{for(var r=[],n=0;n>>2>>>0]);return r},requireRegisteredType=(e,t)=>{var r=registeredTypes[e];return r===void 0&&throwBindingError("".concat(t," has unknown type ").concat(getTypeName(e))),r};function usesDestructorStack(e){for(var t=1;tObject.defineProperty(t,"name",{value:e}),extendError=(e,t)=>{var r=createNamedFunction(t,function(n){this.name=t,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` +`+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:"".concat(this.name,": ").concat(this.message)},r},UnboundTypeError,PureVirtualError,EmValOptionalType=Object.assign({optional:!0},EmValType),registeredInstances={},getInheritedInstanceCount=()=>Object.keys(registeredInstances).length,getLiveInheritedInstances=()=>{var e=[];for(var t in registeredInstances)registeredInstances.hasOwnProperty(t)&&e.push(registeredInstances[t]);return e},deletionQueue=[],flushPendingDeletes=()=>{for(;deletionQueue.length;){var e=deletionQueue.pop();e.$$.deleteScheduled=!1,e.delete()}},delayFunction,setDelayFunction=e=>{delayFunction=e,deletionQueue.length&&delayFunction&&delayFunction(flushPendingDeletes)},init_embind=()=>{Module.getInheritedInstanceCount=getInheritedInstanceCount,Module.getLiveInheritedInstances=getLiveInheritedInstances,Module.flushPendingDeletes=flushPendingDeletes,Module.setDelayFunction=setDelayFunction},throwUnboundTypeError=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!registeredTypes[o]){if(typeDependencies[o]){typeDependencies[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new UnboundTypeError("".concat(e,": ")+r.map(getTypeName).join([", "]))},ensureOverloadTable=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(...a){return e[t].overloadTable.hasOwnProperty(a.length)||throwBindingError("Function '".concat(r,"' called with an invalid number of arguments (").concat(a.length,") - expects one of (").concat(e[t].overloadTable,")!")),e[t].overloadTable[a.length].apply(this,a)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},exposePublicSymbol=(e,t,r)=>{Module.hasOwnProperty(e)?((r===void 0||Module[e].overloadTable!==void 0&&Module[e].overloadTable[r]!==void 0)&&throwBindingError("Cannot register public name '".concat(e,"' twice")),ensureOverloadTable(Module,e,e),Module.hasOwnProperty(r)&&throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (".concat(r,")!")),Module[e].overloadTable[r]=t):(Module[e]=t,r!==void 0&&(Module[e].numArguments=r))},replacePublicSymbol=(e,t,r)=>{Module.hasOwnProperty(e)||throwInternalError("Replacing nonexistent public symbol"),Module[e].overloadTable!==void 0&&r!==void 0?Module[e].overloadTable[r]=t:(Module[e]=t,Module[e].argCount=r)},getBasestPointer=(e,t)=>{for(t===void 0&&throwBindingError("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},registerInheritedInstance=(e,t,r)=>{t=getBasestPointer(e,t),registeredInstances.hasOwnProperty(t)?throwBindingError("Tried to register registered instance: ".concat(t)):registeredInstances[t]=r},unregisterInheritedInstance=(e,t)=>{t=getBasestPointer(e,t),registeredInstances.hasOwnProperty(t)?delete registeredInstances[t]:throwBindingError("Tried to unregister unregistered instance: ".concat(t))},getInheritedInstance=(e,t)=>(t=getBasestPointer(e,t),registeredInstances[t]),registeredPointers={},enumReadValueFromPointer=(e,t,r)=>{switch(t){case 1:return r?function(n){return this.fromWireType(HEAP8[n>>>0])}:function(n){return this.fromWireType(HEAPU8[n>>>0])};case 2:return r?function(n){return this.fromWireType(HEAP16[n>>>1>>>0])}:function(n){return this.fromWireType(HEAPU16[n>>>1>>>0])};case 4:return r?function(n){return this.fromWireType(HEAP32[n>>>2>>>0])}:function(n){return this.fromWireType(HEAPU32[n>>>2>>>0])};default:throw new TypeError("invalid integer width (".concat(t,"): ").concat(e))}};function __embind_register_user_type(e,t){e>>>=0,__embind_register_emval(e)}__embind_register_user_type.sig="vpp";function __embind_register_optional(e,t){e>>>=0,registerType(e,EmValOptionalType)}__embind_register_optional.sig="vpp";var runDestructors=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function newFunc(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type ".concat(typeof e," which is not a function"));var r=createNamedFunction(e.name||"unknownFunctionName",function(){});r.prototype=e.prototype;var n=new r,a=e.apply(n,t);return a instanceof Object?a:n}function craftInvokerFunction(e,t,r,n,a,o){var l=t.length;l<2&&throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=t[1]!==null&&r!==null,_=usesDestructorStack(t),d=t[0].name!=="void",p=l-2,f=[e,throwBindingError,n,a,runDestructors,t[0],t[1]],m=0;m{e=readLatin1String(e);function r(){return e.includes("j")||e.includes("p")?getDynCaller(e,t):getWasmTableEntry(t)}var n=r();return typeof n!="function"&&throwBindingError("unknown function pointer with signature ".concat(e,": ").concat(t)),n};function __embind_register_function(e,t,r,n,a,o,l,u){e>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0;var _=heap32VectorToArray(t,r);e=readLatin1String(e),e=getFunctionName(e),a=embind__requireFunction(n,a),exposePublicSymbol(e,function(){throwUnboundTypeError("Cannot call ".concat(e," due to unbound types"),_)},t-1),whenDependentTypesAreResolved([],_,d=>{var p=[d[0],null].concat(d.slice(1));return replacePublicSymbol(e,craftInvokerFunction(e,p,null,a,o,l),t-1),[]})}__embind_register_function.sig="vpippppii";function __embind_register_value_array(e,t,r,n,a,o){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,tupleRegistrations[e]={name:readLatin1String(t),rawConstructor:embind__requireFunction(r,n),rawDestructor:embind__requireFunction(a,o),elements:[]}}__embind_register_value_array.sig="vpppppp";function __embind_register_value_array_element(e,t,r,n,a,o,l,u,_){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,tupleRegistrations[e].elements.push({getterReturnType:t,getter:embind__requireFunction(r,n),getterContext:a,setterArgumentType:o,setter:embind__requireFunction(l,u),setterContext:_})}__embind_register_value_array_element.sig="vppppppppp";var __embind_finalize_value_array=function(e){e>>>=0;var t=tupleRegistrations[e];delete tupleRegistrations[e];var r=t.elements,n=r.length,a=r.map(u=>u.getterReturnType).concat(r.map(u=>u.setterArgumentType)),o=t.rawConstructor,l=t.rawDestructor;whenDependentTypesAreResolved([e],a,u=>(r.forEach((_,d)=>{var p=u[d],f=_.getter,m=_.getterContext,h=u[d+n],g=_.setter,b=_.setterContext;_.read=v=>p.fromWireType(f(m,v)),_.write=(v,S)=>{var L=[];g(b,v,h.toWireType(L,S)),runDestructors(L)}}),[{name:t.name,fromWireType:_=>{for(var d=new Array(n),p=0;p{if(n!==d.length)throw new TypeError("Incorrect number of tuple elements for ".concat(t.name,": expected=").concat(n,", actual=").concat(d.length));for(var p=o(),f=0;f>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,structRegistrations[e]={name:readLatin1String(t),rawConstructor:embind__requireFunction(r,n),rawDestructor:embind__requireFunction(a,o),fields:[]}}__embind_register_value_object.sig="vpppppp";function __embind_register_value_object_field(e,t,r,n,a,o,l,u,_,d){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,d>>>=0,structRegistrations[e].fields.push({fieldName:readLatin1String(t),getterReturnType:r,getter:embind__requireFunction(n,a),getterContext:o,setterArgumentType:l,setter:embind__requireFunction(u,_),setterContext:d})}__embind_register_value_object_field.sig="vpppppppppp";var __embind_finalize_value_object=function(e){e>>>=0;var t=structRegistrations[e];delete structRegistrations[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(l=>l.getterReturnType).concat(a.map(l=>l.setterArgumentType));whenDependentTypesAreResolved([e],o,l=>{var u={};return a.forEach((_,d)=>{var p=_.fieldName,f=l[d],m=_.getter,h=_.getterContext,g=l[d+a.length],b=_.setter,v=_.setterContext;u[p]={read:S=>f.fromWireType(m(h,S)),write:(S,L)=>{var T=[];b(v,S,g.toWireType(T,L)),runDestructors(T)}}}),[{name:t.name,fromWireType:_=>{var d={};for(var p in u)d[p]=u[p].read(_);return n(_),d},toWireType:(_,d)=>{for(var p in u)if(!(p in d))throw new TypeError('Missing field: "'.concat(p,'"'));var f=r();for(p in u)u[p].write(f,d[p]);return _!==null&&_.push(n,f),f},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:n}]})};__embind_finalize_value_object.sig="vp";var upcastPointer=(e,t,r)=>{for(;t!==r;)t.upcast||throwBindingError("Expected null or instance of ".concat(r.name,", got an instance of ").concat(t.name)),e=t.upcast(e),t=t.baseClass;return e};function genericPointerToWireType(e,t){var r;if(t===null)return this.isReference&&throwBindingError("null is not a valid ".concat(this.name)),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&throwBindingError('Cannot pass "'.concat(embindRepr(t),'" as a ').concat(this.name)),t.$$.ptr||throwBindingError("Cannot pass deleted object as a pointer of type ".concat(this.name)),!this.isConst&&t.$$.ptrType.isConst&&throwBindingError("Cannot convert argument of type ".concat(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name," to parameter type ").concat(this.name));var n=t.$$.ptrType.registeredClass;if(r=upcastPointer(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&throwBindingError("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:throwBindingError("Cannot convert argument of type ".concat(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name," to parameter type ").concat(this.name));break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,Emval.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:throwBindingError("Unsupporting sharing policy")}return r}function constNoSmartPtrRawPointerToWireType(e,t){if(t===null)return this.isReference&&throwBindingError("null is not a valid ".concat(this.name)),0;t.$$||throwBindingError('Cannot pass "'.concat(embindRepr(t),'" as a ').concat(this.name)),t.$$.ptr||throwBindingError("Cannot pass deleted object as a pointer of type ".concat(this.name));var r=t.$$.ptrType.registeredClass,n=upcastPointer(t.$$.ptr,r,this.registeredClass);return n}function nonConstNoSmartPtrRawPointerToWireType(e,t){if(t===null)return this.isReference&&throwBindingError("null is not a valid ".concat(this.name)),0;t.$$||throwBindingError('Cannot pass "'.concat(embindRepr(t),'" as a ').concat(this.name)),t.$$.ptr||throwBindingError("Cannot pass deleted object as a pointer of type ".concat(this.name)),t.$$.ptrType.isConst&&throwBindingError("Cannot convert argument of type ".concat(t.$$.ptrType.name," to parameter type ").concat(this.name));var r=t.$$.ptrType.registeredClass,n=upcastPointer(t.$$.ptr,r,this.registeredClass);return n}function RegisteredPointer(e,t,r,n,a,o,l,u,_,d,p){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=l,this.rawGetPointee=u,this.rawConstructor=_,this.rawShare=d,this.rawDestructor=p,!a&&t.baseClass===void 0?n?(this.toWireType=constNoSmartPtrRawPointerToWireType,this.destructorFunction=null):(this.toWireType=nonConstNoSmartPtrRawPointerToWireType,this.destructorFunction=null):this.toWireType=genericPointerToWireType}var downcastPointer=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=downcastPointer(e,t,r.baseClass);return n===null?null:r.downcast(n)},finalizationRegistry=!1,detachFinalizer=e=>{},runDestructor=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},releaseClassHandle=e=>{e.count.value-=1;var t=e.count.value===0;t&&runDestructor(e)},attachFinalizer=e=>typeof FinalizationRegistry>"u"?(attachFinalizer=t=>t,e):(finalizationRegistry=new FinalizationRegistry(t=>{releaseClassHandle(t.$$)}),attachFinalizer=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};finalizationRegistry.register(t,a,t)}return t},detachFinalizer=t=>finalizationRegistry.unregister(t),attachFinalizer(e)),makeClassHandle=(e,t)=>{(!t.ptrType||!t.ptr)&&throwInternalError("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&throwInternalError("Both smartPtrType and smartPtr must be specified"),t.count={value:1},attachFinalizer(Object.create(e,{$$:{value:t,writable:!0}}))};function RegisteredPointer_fromWireType(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=getInheritedInstance(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),l=registeredPointers[o];if(!l)return a.call(this);var u;this.isConst?u=l.constPointerType:u=l.pointerType;var _=downcastPointer(t,this.registeredClass,u.registeredClass);return _===null?a.call(this):this.isSmartPointer?makeClassHandle(u.registeredClass.instancePrototype,{ptrType:u,ptr:_,smartPtrType:this,smartPtr:e}):makeClassHandle(u.registeredClass.instancePrototype,{ptrType:u,ptr:_})}var init_RegisteredPointer=()=>{Object.assign(RegisteredPointer.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)==null||t.call(this,e)},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,fromWireType:RegisteredPointer_fromWireType})};function ClassHandle(){}var shallowCopyInternalPointer=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),throwInstanceAlreadyDeleted=e=>{function t(r){return r.$$.ptrType.registeredClass.name}throwBindingError(t(e)+" instance already deleted")},init_ClassHandle=()=>{Object.assign(ClassHandle.prototype,{isAliasOf(e){if(!(this instanceof ClassHandle)||!(e instanceof ClassHandle))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return t===n&&r===a},clone(){if(this.$$.ptr||throwInstanceAlreadyDeleted(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||throwInstanceAlreadyDeleted(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&throwBindingError("Object already scheduled for deletion"),detachFinalizer(this),releaseClassHandle(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||throwInstanceAlreadyDeleted(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&throwBindingError("Object already scheduled for deletion"),deletionQueue.push(this),deletionQueue.length===1&&delayFunction&&delayFunction(flushPendingDeletes),this.$$.deleteScheduled=!0,this}})};function RegisteredClass(e,t,r,n,a,o,l,u){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=l,this.downcast=u,this.pureVirtualFunctions=[]}var char_0=48,char_9=57,makeLegalFunctionName=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=char_0&&t<=char_9?"_".concat(e):e};function __embind_register_class(e,t,r,n,a,o,l,u,_,d,p,f,m){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,d>>>=0,p>>>=0,f>>>=0,m>>>=0,p=readLatin1String(p),o=embind__requireFunction(a,o),u&&(u=embind__requireFunction(l,u)),d&&(d=embind__requireFunction(_,d)),m=embind__requireFunction(f,m);var h=makeLegalFunctionName(p);exposePublicSymbol(h,function(){throwUnboundTypeError("Cannot construct ".concat(p," due to unbound types"),[n])}),whenDependentTypesAreResolved([e,t,r],n?[n]:[],g=>{var b;g=g[0];var v,S;n?(v=g.registeredClass,S=v.instancePrototype):S=ClassHandle.prototype;var L=createNamedFunction(p,function(...w){if(Object.getPrototypeOf(this)!==T)throw new BindingError("Use 'new' to construct "+p);if(A.constructor_body===void 0)throw new BindingError(p+" has no accessible constructor");var E=A.constructor_body[w.length];if(E===void 0)throw new BindingError("Tried to invoke ctor of ".concat(p," with invalid number of parameters (").concat(w.length,") - expected (").concat(Object.keys(A.constructor_body).toString(),") parameters instead!"));return E.apply(this,w)}),T=Object.create(S,{constructor:{value:L}});L.prototype=T;var A=new RegisteredClass(p,L,T,m,v,o,u,d);A.baseClass&&((b=A.baseClass).__derivedClasses!=null||(b.__derivedClasses=[]),A.baseClass.__derivedClasses.push(A));var M=new RegisteredPointer(p,A,!0,!1,!1),X=new RegisteredPointer(p+"*",A,!1,!1,!1),x=new RegisteredPointer(p+" const*",A,!1,!0,!1);return registeredPointers[e]={pointerType:X,constPointerType:x},replacePublicSymbol(h,L),[M,X,x]})}__embind_register_class.sig="vppppppppppppp";var __embind_register_class_constructor=function(e,t,r,n,a,o){e>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0;var l=heap32VectorToArray(t,r);a=embind__requireFunction(n,a),whenDependentTypesAreResolved([],[e],u=>{u=u[0];var _="constructor ".concat(u.name);if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[t-1]!==void 0)throw new BindingError("Cannot register multiple constructors with identical number of parameters (".concat(t-1,") for class '").concat(u.name,"'! Overload resolution is currently only performed using the parameter count, not actual type info!"));return u.registeredClass.constructor_body[t-1]=()=>{throwUnboundTypeError("Cannot construct ".concat(u.name," due to unbound types"),l)},whenDependentTypesAreResolved([],l,d=>(d.splice(1,0,null),u.registeredClass.constructor_body[t-1]=craftInvokerFunction(_,d,null,a,o),[])),[]})};__embind_register_class_constructor.sig="vpipppp";var validateThis=(e,t,r)=>(e instanceof Object||throwBindingError("".concat(r,' with invalid "this": ').concat(e)),e instanceof t.registeredClass.constructor||throwBindingError("".concat(r,' incompatible with "this" of type ').concat(e.constructor.name)),e.$$.ptr||throwBindingError("cannot call emscripten binding method ".concat(r," on deleted object")),upcastPointer(e.$$.ptr,e.$$.ptrType.registeredClass,t.registeredClass)),__embind_register_class_function=function(e,t,r,n,a,o,l,u,_,d){e>>>=0,t>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0;var p=heap32VectorToArray(r,n);t=readLatin1String(t),t=getFunctionName(t),o=embind__requireFunction(a,o),whenDependentTypesAreResolved([],[e],f=>{f=f[0];var m="".concat(f.name,".").concat(t);t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&f.registeredClass.pureVirtualFunctions.push(t);function h(){throwUnboundTypeError("Cannot call ".concat(m," due to unbound types"),p)}var g=f.registeredClass.instancePrototype,b=g[t];return b===void 0||b.overloadTable===void 0&&b.className!==f.name&&b.argCount===r-2?(h.argCount=r-2,h.className=f.name,g[t]=h):(ensureOverloadTable(g,t,m),g[t].overloadTable[r-2]=h),whenDependentTypesAreResolved([],p,v=>{var S=craftInvokerFunction(m,v,f,o,l,_);return g[t].overloadTable===void 0?(S.argCount=r-2,g[t]=S):g[t].overloadTable[r-2]=S,[]}),[]})};__embind_register_class_function.sig="vppippppiii";var __embind_register_class_property=function(e,t,r,n,a,o,l,u,_,d){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,d>>>=0,t=readLatin1String(t),a=embind__requireFunction(n,a),whenDependentTypesAreResolved([],[e],p=>{p=p[0];var f="".concat(p.name,".").concat(t),m={get(){throwUnboundTypeError("Cannot access ".concat(f," due to unbound types"),[r,l])},enumerable:!0,configurable:!0};return _?m.set=()=>throwUnboundTypeError("Cannot access ".concat(f," due to unbound types"),[r,l]):m.set=h=>throwBindingError(f+" is a read-only property"),Object.defineProperty(p.registeredClass.instancePrototype,t,m),whenDependentTypesAreResolved([],_?[r,l]:[r],h=>{var g=h[0],b={get(){var S=validateThis(this,p,f+" getter");return g.fromWireType(a(o,S))},enumerable:!0};if(_){_=embind__requireFunction(u,_);var v=h[1];b.set=function(S){var L=validateThis(this,p,f+" setter"),T=[];_(d,L,v.toWireType(T,S)),runDestructors(T)}}return Object.defineProperty(p.registeredClass.instancePrototype,t,b),[]}),[]})};__embind_register_class_property.sig="vpppppppppp";var __embind_register_class_class_function=function(e,t,r,n,a,o,l,u,_){e>>>=0,t>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0;var d=heap32VectorToArray(r,n);t=readLatin1String(t),t=getFunctionName(t),o=embind__requireFunction(a,o),whenDependentTypesAreResolved([],[e],p=>{p=p[0];var f="".concat(p.name,".").concat(t);function m(){throwUnboundTypeError("Cannot call ".concat(f," due to unbound types"),d)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var h=p.registeredClass.constructor;return h[t]===void 0?(m.argCount=r-1,h[t]=m):(ensureOverloadTable(h,t,f),h[t].overloadTable[r-1]=m),whenDependentTypesAreResolved([],d,g=>{var b=[g[0],null].concat(g.slice(1)),v=craftInvokerFunction(f,b,null,o,l,u);if(h[t].overloadTable===void 0?(v.argCount=r-1,h[t]=v):h[t].overloadTable[r-1]=v,p.registeredClass.__derivedClasses)for(let S of p.registeredClass.__derivedClasses)S.constructor.hasOwnProperty(t)||(S.constructor[t]=v);return[]}),[]})};__embind_register_class_class_function.sig="vppippppii";var __embind_register_class_class_property=function(e,t,r,n,a,o,l,u){e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,t=readLatin1String(t),o=embind__requireFunction(a,o),whenDependentTypesAreResolved([],[e],_=>{_=_[0];var d="".concat(_.name,".").concat(t),p={get(){throwUnboundTypeError("Cannot access ".concat(d," due to unbound types"),[r])},enumerable:!0,configurable:!0};return u?p.set=()=>{throwUnboundTypeError("Cannot access ".concat(d," due to unbound types"),[r])}:p.set=f=>{throwBindingError("".concat(d," is a read-only property"))},Object.defineProperty(_.registeredClass.constructor,t,p),whenDependentTypesAreResolved([],[r],f=>{f=f[0];var m={get(){return f.fromWireType(o(n))},enumerable:!0};return u&&(u=embind__requireFunction(l,u),m.set=h=>{var g=[];u(n,f.toWireType(g,h)),runDestructors(g)}),Object.defineProperty(_.registeredClass.constructor,t,m),[]}),[]})};__embind_register_class_class_property.sig="vpppppppp";function __embind_create_inheriting_constructor(e,t,r){e>>>=0,t>>>=0,r>>>=0,e=readLatin1String(e),t=requireRegisteredType(t,"wrapper"),r=Emval.toValue(r);var n=t.registeredClass,a=n.instancePrototype,o=n.baseClass,l=o.instancePrototype,u=n.baseClass.constructor,_=createNamedFunction(e,function(...d){n.baseClass.pureVirtualFunctions.forEach((function(p){if(this[p]===l[p])throw new PureVirtualError("Pure virtual function ".concat(p," must be implemented in JavaScript"))}).bind(this)),Object.defineProperty(this,"__parent",{value:a}),this.__construct(...d)});return a.__construct=function(...d){this===a&&throwBindingError("Pass correct 'this' to __construct");var p=u.implement(this,...d);detachFinalizer(p);var f=p.$$;p.notifyOnDestruction(),f.preservePointerOnDelete=!0,Object.defineProperties(this,{$$:{value:f}}),attachFinalizer(this),registerInheritedInstance(n,f.ptr,this)},a.__destruct=function(){this===a&&throwBindingError("Pass correct 'this' to __destruct"),detachFinalizer(this),unregisterInheritedInstance(n,this.$$.ptr)},_.prototype=Object.create(a),Object.assign(_.prototype,r),Emval.toHandle(_)}__embind_create_inheriting_constructor.sig="pppp";var __embind_register_smart_ptr=function(e,t,r,n,a,o,l,u,_,d,p,f){e>>>=0,t>>>=0,r>>>=0,a>>>=0,o>>>=0,l>>>=0,u>>>=0,_>>>=0,d>>>=0,p>>>=0,f>>>=0,r=readLatin1String(r),o=embind__requireFunction(a,o),u=embind__requireFunction(l,u),d=embind__requireFunction(_,d),f=embind__requireFunction(p,f),whenDependentTypesAreResolved([e],[t],m=>{m=m[0];var h=new RegisteredPointer(r,m.registeredClass,!1,!1,!0,m,n,o,u,d,f);return[h]})};__embind_register_smart_ptr.sig="vpppipppppppp";function __embind_register_enum(e,t,r,n){e>>>=0,t>>>=0,r>>>=0,t=readLatin1String(t);function a(){}a.values={},registerType(e,{name:t,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,l)=>l.value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:enumReadValueFromPointer(t,r,n),destructorFunction:null}),exposePublicSymbol(t,a)}__embind_register_enum.sig="vpppi";function __embind_register_enum_value(e,t,r){e>>>=0,t>>>=0;var n=requireRegisteredType(e,"enum");t=readLatin1String(t);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:createNamedFunction("".concat(n.name,"_").concat(t),function(){})}});a.values[r]=o,a[t]=o}__embind_register_enum_value.sig="vppi";var __embind_register_constant=function(e,t,r){e>>>=0,t>>>=0,e=readLatin1String(e),whenDependentTypesAreResolved([],[t],n=>(n=n[0],Module[e]=n.fromWireType(r),[]))};__embind_register_constant.sig="vppd";var emval_symbols={};function __emval_register_symbol(e){e>>>=0,emval_symbols[e]=readLatin1String(e)}__emval_register_symbol.sig="vp";var getStringOrSymbol=e=>{var t=emval_symbols[e];return t===void 0?readLatin1String(e):t};function __emval_incref(e){e>>>=0,e>9&&(emval_handles[e+1]+=1)}__emval_incref.sig="vp";function __emval_run_destructors(e){e>>>=0;var t=Emval.toValue(e);runDestructors(t),__emval_decref(e)}__emval_run_destructors.sig="vp";function __emval_new_array(){return Emval.toHandle([])}__emval_new_array.sig="p";function __emval_new_array_from_memory_view(e){e>>>=0,e=Emval.toValue(e);for(var t=new Array(e.length),r=0;r>>=0,Emval.toHandle(getStringOrSymbol(e))}__emval_new_cstring.sig="pp";function __emval_new_u8string(e){return e>>>=0,Emval.toHandle(UTF8ToString(e))}__emval_new_u8string.sig="pp";function __emval_new_u16string(e){return e>>>=0,Emval.toHandle(UTF16ToString(e))}__emval_new_u16string.sig="pp";function __emval_take_value(e,t){e>>>=0,t>>>=0,e=requireRegisteredType(e,"_emval_take_value");var r=e.readValueFromPointer(t);return Emval.toHandle(r)}__emval_take_value.sig="ppp";var emval_get_global=()=>typeof globalThis=="object"?globalThis:function(){return Function}()("return this")();function __emval_get_global(e){return e>>>=0,e===0?Emval.toHandle(emval_get_global()):(e=getStringOrSymbol(e),Emval.toHandle(emval_get_global()[e]))}__emval_get_global.sig="pp";function __emval_get_module_property(e){return e>>>=0,e=getStringOrSymbol(e),Emval.toHandle(Module[e])}__emval_get_module_property.sig="pp";function __emval_get_property(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),Emval.toHandle(e[t])}__emval_get_property.sig="ppp";function __emval_set_property(e,t,r){e>>>=0,t>>>=0,r>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),r=Emval.toValue(r),e[t]=r}__emval_set_property.sig="vppp";var emval_returnValue=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(HEAPU32[t>>>2>>>0]=Emval.toHandle(n)),a};function __emval_as(e,t,r){return e>>>=0,t>>>=0,r>>>=0,e=Emval.toValue(e),t=requireRegisteredType(t,"emval::as"),emval_returnValue(t,r,e)}__emval_as.sig="dppp";function __emval_as_int64(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=requireRegisteredType(t,"emval::as"),t.toWireType(null,e)}__emval_as_int64.sig="ipp";function __emval_as_uint64(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=requireRegisteredType(t,"emval::as"),t.toWireType(null,e)}__emval_as_uint64.sig="ipp";function __emval_equals(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e==t}__emval_equals.sig="ipp";function __emval_strictly_equals(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e===t}__emval_strictly_equals.sig="ipp";function __emval_greater_than(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e>t}__emval_greater_than.sig="ipp";function __emval_less_than(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e>>=0,e=Emval.toValue(e),!e}__emval_not.sig="ip";var emval_methodCallers=[];function __emval_call(e,t,r,n){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,e=emval_methodCallers[e],t=Emval.toValue(t),e(null,t,r,n)}__emval_call.sig="dpppp";var emval_lookupTypes=(e,t)=>{for(var r=new Array(e),n=0;n>>2>>>0],"parameter "+n);return r},emval_addMethodCaller=e=>{var t=emval_methodCallers.length;return emval_methodCallers.push(e),t};function __emval_get_method_caller(e,t,r){t>>>=0;var n=emval_lookupTypes(e,t),a=n.shift();e--;var o=`return function (obj, func, destructorsRef, args) { +`,l=0,u=[];r===0&&u.push("obj");for(var _=["retType"],d=[a],p=0;pg.name).join(", "),") => ").concat(a.name,">");return emval_addMethodCaller(createNamedFunction(h,m))}__emval_get_method_caller.sig="pipi";function __emval_call_method(e,t,r,n,a){return e>>>=0,t>>>=0,r>>>=0,n>>>=0,a>>>=0,e=emval_methodCallers[e],t=Emval.toValue(t),r=getStringOrSymbol(r),e(t,t[r],n,a)}__emval_call_method.sig="dppppp";function __emval_typeof(e){return e>>>=0,e=Emval.toValue(e),Emval.toHandle(typeof e)}__emval_typeof.sig="pp";function __emval_instanceof(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e instanceof t}__emval_instanceof.sig="ipp";function __emval_is_number(e){return e>>>=0,e=Emval.toValue(e),typeof e=="number"}__emval_is_number.sig="ip";function __emval_is_string(e){return e>>>=0,e=Emval.toValue(e),typeof e=="string"}__emval_is_string.sig="ip";function __emval_in(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),e in t}__emval_in.sig="ipp";function __emval_delete(e,t){return e>>>=0,t>>>=0,e=Emval.toValue(e),t=Emval.toValue(t),delete e[t]}__emval_delete.sig="ipp";function __emval_throw(e){throw e>>>=0,e=Emval.toValue(e),e}__emval_throw.sig="ip";function __emval_iter_begin(e){return e>>>=0,e=Emval.toValue(e),Emval.toHandle(e[Symbol.iterator]())}__emval_iter_begin.sig="pp";function __emval_iter_next(e){e>>>=0,e=Emval.toValue(e);var t=e.next();return t.done?0:Emval.toHandle(t.value)}__emval_iter_next.sig="pp";var __emval_coro_suspend=function(e,t){e>>>=0,t>>>=0,Emval.toValue(e).then(r=>{__emval_coro_resume(t,Emval.toHandle(r))})};__emval_coro_suspend.sig="vpp";var __emval_coro_make_promise=function(e,t){return e>>>=0,t>>>=0,Emval.toHandle(new Promise((r,n)=>{let a=()=>{try{___cxa_rethrow()}catch(o){n(o)}};HEAPU32[e>>>2>>>0]=Emval.toHandle(r),HEAPU32[t>>>2>>>0]=Emval.toHandle(a)}))};__emval_coro_make_promise.sig="ppp";function _duckdb_web_fs_file_sync(e){return globalThis.DUCKDB_RUNTIME.syncFile(Module,e)}_duckdb_web_fs_file_sync.sig="vi";function _duckdb_web_fs_file_remove(e,t){return globalThis.DUCKDB_RUNTIME.removeFile(Module,e,t)}registerWasmPlugin(),FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit(),embind_init_charCodes(),BindingError=Module.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},InternalError=Module.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},init_emval(),Module.requestAnimationFrame=MainLoop.requestAnimationFrame,Module.pauseMainLoop=MainLoop.pause,Module.resumeMainLoop=MainLoop.resume,MainLoop.init();for(var i=0;i<32;++i)tempFixedLengthArray.push(new Array(i));for(var miniTempWebGLFloatBuffersStorage=new Float32Array(288),i=0;i<=288;++i)miniTempWebGLFloatBuffers[i]=miniTempWebGLFloatBuffersStorage.subarray(0,i);for(var miniTempWebGLIntBuffersStorage=new Int32Array(288),i=0;i<=288;++i)miniTempWebGLIntBuffers[i]=miniTempWebGLIntBuffersStorage.subarray(0,i);var emSetImmediate,emClearImmediate;if(typeof setImmediate<"u")emSetImmediate=setImmediateWrapped,emClearImmediate=clearImmediateWrapped;else if(typeof addEventListener=="function"){var __setImmediate_id_counter=0,__setImmediate_queue=[],__setImmediate_message_id="_si",__setImmediate_cb=e=>{e.data===__setImmediate_message_id&&(e.stopPropagation(),__setImmediate_queue.shift()(),++__setImmediate_id_counter)};addEventListener("message",__setImmediate_cb,!0),emSetImmediate=e=>(postMessage(__setImmediate_message_id,"*"),__setImmediate_id_counter+__setImmediate_queue.push(e)-1),emClearImmediate=e=>{var t=e-__setImmediate_id_counter;t>=0&&t<__setImmediate_queue.length&&(__setImmediate_queue[t]=()=>{})}}Module.requestFullscreen=Browser.requestFullscreen,Module.setCanvasSize=Browser.setCanvasSize,Module.getUserMedia=Browser.getUserMedia,Module.createContext=Browser.createContext;var preloadedImages={},preloadedAudios={};registerPostMainLoop(()=>{var e,t;return(t=(e=SDL.audio)==null?void 0:e.queueNewAudioData)==null?void 0:t.call(e)}),UnboundTypeError=Module.UnboundTypeError=extendError(Error,"UnboundTypeError"),PureVirtualError=Module.PureVirtualError=extendError(Error,"PureVirtualError"),init_embind(),init_RegisteredPointer(),init_ClassHandle();var wasmImports={IMG_Init:_IMG_Init,IMG_Load:_IMG_Load,IMG_Load_RW:_IMG_Load_RW,IMG_Quit:_IMG_Quit,Mix_AllocateChannels:_Mix_AllocateChannels,Mix_ChannelFinished:_Mix_ChannelFinished,Mix_CloseAudio:_Mix_CloseAudio,Mix_FadeInChannelTimed:_Mix_FadeInChannelTimed,Mix_FadeInMusicPos:_Mix_FadeInMusicPos,Mix_FadeOutChannel:_Mix_FadeOutChannel,Mix_FadeOutMusic:_Mix_FadeOutMusic,Mix_FadingChannel:_Mix_FadingChannel,Mix_FreeChunk:_Mix_FreeChunk,Mix_FreeMusic:_Mix_FreeMusic,Mix_HaltChannel:_Mix_HaltChannel,Mix_HaltMusic:_Mix_HaltMusic,Mix_HookMusicFinished:_Mix_HookMusicFinished,Mix_Init:_Mix_Init,Mix_Linked_Version:_Mix_Linked_Version,Mix_LoadMUS:_Mix_LoadMUS,Mix_LoadMUS_RW:_Mix_LoadMUS_RW,Mix_LoadWAV:_Mix_LoadWAV,Mix_LoadWAV_RW:_Mix_LoadWAV_RW,Mix_OpenAudio:_Mix_OpenAudio,Mix_Pause:_Mix_Pause,Mix_PauseMusic:_Mix_PauseMusic,Mix_Paused:_Mix_Paused,Mix_PausedMusic:_Mix_PausedMusic,Mix_PlayChannelTimed:_Mix_PlayChannelTimed,Mix_PlayMusic:_Mix_PlayMusic,Mix_Playing:_Mix_Playing,Mix_PlayingMusic:_Mix_PlayingMusic,Mix_QuerySpec:_Mix_QuerySpec,Mix_QuickLoad_RAW:_Mix_QuickLoad_RAW,Mix_Quit:_Mix_Quit,Mix_ReserveChannels:_Mix_ReserveChannels,Mix_Resume:_Mix_Resume,Mix_ResumeMusic:_Mix_ResumeMusic,Mix_SetPanning:_Mix_SetPanning,Mix_SetPosition:_Mix_SetPosition,Mix_SetPostMix:_Mix_SetPostMix,Mix_Volume:_Mix_Volume,Mix_VolumeChunk:_Mix_VolumeChunk,Mix_VolumeMusic:_Mix_VolumeMusic,SDL_AddTimer:_SDL_AddTimer,SDL_AllocRW:_SDL_AllocRW,SDL_AudioDriverName:_SDL_AudioDriverName,SDL_AudioQuit:_SDL_AudioQuit,SDL_ClearError:_SDL_ClearError,SDL_CloseAudio:_SDL_CloseAudio,SDL_CondBroadcast:_SDL_CondBroadcast,SDL_CondSignal:_SDL_CondSignal,SDL_CondWait:_SDL_CondWait,SDL_CondWaitTimeout:_SDL_CondWaitTimeout,SDL_ConvertSurface:_SDL_ConvertSurface,SDL_CreateCond:_SDL_CreateCond,SDL_CreateMutex:_SDL_CreateMutex,SDL_CreateRGBSurface:_SDL_CreateRGBSurface,SDL_CreateRGBSurfaceFrom:_SDL_CreateRGBSurfaceFrom,SDL_CreateThread:_SDL_CreateThread,SDL_Delay:_SDL_Delay,SDL_DestroyCond:_SDL_DestroyCond,SDL_DestroyMutex:_SDL_DestroyMutex,SDL_DestroyRenderer:_SDL_DestroyRenderer,SDL_DestroyWindow:_SDL_DestroyWindow,SDL_DisplayFormatAlpha:_SDL_DisplayFormatAlpha,SDL_EnableKeyRepeat:_SDL_EnableKeyRepeat,SDL_EnableUNICODE:_SDL_EnableUNICODE,SDL_FillRect:_SDL_FillRect,SDL_Flip:_SDL_Flip,SDL_FreeRW:_SDL_FreeRW,SDL_FreeSurface:_SDL_FreeSurface,SDL_GL_DeleteContext:_SDL_GL_DeleteContext,SDL_GL_ExtensionSupported:_SDL_GL_ExtensionSupported,SDL_GL_GetAttribute:_SDL_GL_GetAttribute,SDL_GL_GetSwapInterval:_SDL_GL_GetSwapInterval,SDL_GL_MakeCurrent:_SDL_GL_MakeCurrent,SDL_GL_SetAttribute:_SDL_GL_SetAttribute,SDL_GL_SetSwapInterval:_SDL_GL_SetSwapInterval,SDL_GL_SwapBuffers:_SDL_GL_SwapBuffers,SDL_GL_SwapWindow:_SDL_GL_SwapWindow,SDL_GetAppState:_SDL_GetAppState,SDL_GetAudioDriver:_SDL_GetAudioDriver,SDL_GetClipRect:_SDL_GetClipRect,SDL_GetCurrentAudioDriver:_SDL_GetCurrentAudioDriver,SDL_GetError:_SDL_GetError,SDL_GetKeyName:_SDL_GetKeyName,SDL_GetKeyState:_SDL_GetKeyState,SDL_GetKeyboardState:_SDL_GetKeyboardState,SDL_GetModState:_SDL_GetModState,SDL_GetMouseState:_SDL_GetMouseState,SDL_GetNumAudioDrivers:_SDL_GetNumAudioDrivers,SDL_GetRGB:_SDL_GetRGB,SDL_GetRGBA:_SDL_GetRGBA,SDL_GetScancodeFromKey:_SDL_GetScancodeFromKey,SDL_GetThreadID:_SDL_GetThreadID,SDL_GetTicks:_SDL_GetTicks,SDL_GetVideoInfo:_SDL_GetVideoInfo,SDL_GetVideoSurface:_SDL_GetVideoSurface,SDL_GetWindowFlags:_SDL_GetWindowFlags,SDL_GetWindowSize:_SDL_GetWindowSize,SDL_Has3DNow:_SDL_Has3DNow,SDL_Has3DNowExt:_SDL_Has3DNowExt,SDL_HasAltiVec:_SDL_HasAltiVec,SDL_HasMMX:_SDL_HasMMX,SDL_HasMMXExt:_SDL_HasMMXExt,SDL_HasRDTSC:_SDL_HasRDTSC,SDL_HasSSE:_SDL_HasSSE,SDL_HasSSE2:_SDL_HasSSE2,SDL_Init:_SDL_Init,SDL_InitSubSystem:_SDL_InitSubSystem,SDL_JoystickClose:_SDL_JoystickClose,SDL_JoystickEventState:_SDL_JoystickEventState,SDL_JoystickGetAxis:_SDL_JoystickGetAxis,SDL_JoystickGetBall:_SDL_JoystickGetBall,SDL_JoystickGetButton:_SDL_JoystickGetButton,SDL_JoystickGetHat:_SDL_JoystickGetHat,SDL_JoystickIndex:_SDL_JoystickIndex,SDL_JoystickName:_SDL_JoystickName,SDL_JoystickNumAxes:_SDL_JoystickNumAxes,SDL_JoystickNumBalls:_SDL_JoystickNumBalls,SDL_JoystickNumButtons:_SDL_JoystickNumButtons,SDL_JoystickNumHats:_SDL_JoystickNumHats,SDL_JoystickOpen:_SDL_JoystickOpen,SDL_JoystickOpened:_SDL_JoystickOpened,SDL_JoystickUpdate:_SDL_JoystickUpdate,SDL_Linked_Version:_SDL_Linked_Version,SDL_ListModes:_SDL_ListModes,SDL_LoadBMP_RW:_SDL_LoadBMP_RW,SDL_LockAudio:_SDL_LockAudio,SDL_LockSurface:_SDL_LockSurface,SDL_LogSetOutputFunction:_SDL_LogSetOutputFunction,SDL_LowerBlit:_SDL_LowerBlit,SDL_LowerBlitScaled:_SDL_LowerBlitScaled,SDL_MapRGB:_SDL_MapRGB,SDL_MapRGBA:_SDL_MapRGBA,SDL_NumJoysticks:_SDL_NumJoysticks,SDL_OpenAudio:_SDL_OpenAudio,SDL_PauseAudio:_SDL_PauseAudio,SDL_PeepEvents:_SDL_PeepEvents,SDL_PollEvent:_SDL_PollEvent,SDL_PumpEvents:_SDL_PumpEvents,SDL_PushEvent:_SDL_PushEvent,SDL_Quit:_SDL_Quit,SDL_QuitSubSystem:_SDL_QuitSubSystem,SDL_RWFromConstMem:_SDL_RWFromConstMem,SDL_RWFromFile:_SDL_RWFromFile,SDL_RWFromMem:_SDL_RWFromMem,SDL_RemoveTimer:_SDL_RemoveTimer,SDL_SaveBMP_RW:_SDL_SaveBMP_RW,SDL_SetAlpha:_SDL_SetAlpha,SDL_SetClipRect:_SDL_SetClipRect,SDL_SetColorKey:_SDL_SetColorKey,SDL_SetColors:_SDL_SetColors,SDL_SetError:_SDL_SetError,SDL_SetGamma:_SDL_SetGamma,SDL_SetGammaRamp:_SDL_SetGammaRamp,SDL_SetPalette:_SDL_SetPalette,SDL_SetVideoMode:_SDL_SetVideoMode,SDL_SetWindowFullscreen:_SDL_SetWindowFullscreen,SDL_SetWindowTitle:_SDL_SetWindowTitle,SDL_ShowCursor:_SDL_ShowCursor,SDL_StartTextInput:_SDL_StartTextInput,SDL_StopTextInput:_SDL_StopTextInput,SDL_ThreadID:_SDL_ThreadID,SDL_UnlockAudio:_SDL_UnlockAudio,SDL_UnlockSurface:_SDL_UnlockSurface,SDL_UpdateRect:_SDL_UpdateRect,SDL_UpdateRects:_SDL_UpdateRects,SDL_UpperBlit:_SDL_UpperBlit,SDL_UpperBlitScaled:_SDL_UpperBlitScaled,SDL_VideoDriverName:_SDL_VideoDriverName,SDL_VideoModeOK:_SDL_VideoModeOK,SDL_VideoQuit:_SDL_VideoQuit,SDL_WM_GrabInput:_SDL_WM_GrabInput,SDL_WM_IconifyWindow:_SDL_WM_IconifyWindow,SDL_WM_SetCaption:_SDL_WM_SetCaption,SDL_WM_SetIcon:_SDL_WM_SetIcon,SDL_WM_ToggleFullScreen:_SDL_WM_ToggleFullScreen,SDL_WaitThread:_SDL_WaitThread,SDL_WarpMouse:_SDL_WarpMouse,SDL_WasInit:_SDL_WasInit,SDL_mutexP:_SDL_mutexP,SDL_mutexV:_SDL_mutexV,TTF_CloseFont:_TTF_CloseFont,TTF_FontAscent:_TTF_FontAscent,TTF_FontDescent:_TTF_FontDescent,TTF_FontHeight:_TTF_FontHeight,TTF_FontLineSkip:_TTF_FontLineSkip,TTF_GlyphMetrics:_TTF_GlyphMetrics,TTF_Init:_TTF_Init,TTF_OpenFont:_TTF_OpenFont,TTF_Quit:_TTF_Quit,TTF_RenderText_Blended:_TTF_RenderText_Blended,TTF_RenderText_Shaded:_TTF_RenderText_Shaded,TTF_RenderText_Solid:_TTF_RenderText_Solid,TTF_RenderUTF8_Solid:_TTF_RenderUTF8_Solid,TTF_SizeText:_TTF_SizeText,TTF_SizeUTF8:_TTF_SizeUTF8,XChangeWindowAttributes:_XChangeWindowAttributes,XCreateWindow:_XCreateWindow,XInternAtom:_XInternAtom,XMapWindow:_XMapWindow,XOpenDisplay:_XOpenDisplay,XPending:_XPending,XSendEvent:_XSendEvent,XSetWMHints:_XSetWMHints,XStoreName:_XStoreName,_Unwind_Backtrace:__Unwind_Backtrace,_Unwind_DeleteException:__Unwind_DeleteException,_Unwind_FindEnclosingFunction:__Unwind_FindEnclosingFunction,_Unwind_GetIPInfo:__Unwind_GetIPInfo,_Unwind_RaiseException:__Unwind_RaiseException,_ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm:__ZN18duckdb_skiplistlib9skip_list19_throw_exceeds_sizeEm,__asctime_r:___asctime_r,__assert_fail:___assert_fail,__call_sighandler:___call_sighandler,__cxa_begin_catch:___cxa_begin_catch,__cxa_call_unexpected:___cxa_call_unexpected,__cxa_current_primary_exception:___cxa_current_primary_exception,__cxa_end_catch:___cxa_end_catch,__cxa_find_matching_catch_2:___cxa_find_matching_catch_2,__cxa_find_matching_catch_3:___cxa_find_matching_catch_3,__cxa_find_matching_catch_4:___cxa_find_matching_catch_4,__cxa_rethrow:___cxa_rethrow,__cxa_rethrow_primary_exception:___cxa_rethrow_primary_exception,__cxa_throw:___cxa_throw,__cxa_uncaught_exceptions:___cxa_uncaught_exceptions,__global_base:___global_base,__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__resumeException:___resumeException,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__syscall__newselect:___syscall__newselect,__syscall_accept4:___syscall_accept4,__syscall_bind:___syscall_bind,__syscall_chdir:___syscall_chdir,__syscall_chmod:___syscall_chmod,__syscall_connect:___syscall_connect,__syscall_dup:___syscall_dup,__syscall_dup3:___syscall_dup3,__syscall_faccessat:___syscall_faccessat,__syscall_fadvise64:___syscall_fadvise64,__syscall_fallocate:___syscall_fallocate,__syscall_fchdir:___syscall_fchdir,__syscall_fchmod:___syscall_fchmod,__syscall_fchmodat2:___syscall_fchmodat2,__syscall_fchown32:___syscall_fchown32,__syscall_fchownat:___syscall_fchownat,__syscall_fcntl64:___syscall_fcntl64,__syscall_fdatasync:___syscall_fdatasync,__syscall_fstat64:___syscall_fstat64,__syscall_fstatfs64:___syscall_fstatfs64,__syscall_ftruncate64:___syscall_ftruncate64,__syscall_getcwd:___syscall_getcwd,__syscall_getdents64:___syscall_getdents64,__syscall_getpeername:___syscall_getpeername,__syscall_getsockname:___syscall_getsockname,__syscall_getsockopt:___syscall_getsockopt,__syscall_ioctl:___syscall_ioctl,__syscall_listen:___syscall_listen,__syscall_lstat64:___syscall_lstat64,__syscall_mkdirat:___syscall_mkdirat,__syscall_mknodat:___syscall_mknodat,__syscall_newfstatat:___syscall_newfstatat,__syscall_openat:___syscall_openat,__syscall_pipe:___syscall_pipe,__syscall_poll:___syscall_poll,__syscall_readlinkat:___syscall_readlinkat,__syscall_recvfrom:___syscall_recvfrom,__syscall_recvmsg:___syscall_recvmsg,__syscall_renameat:___syscall_renameat,__syscall_rmdir:___syscall_rmdir,__syscall_sendmsg:___syscall_sendmsg,__syscall_sendto:___syscall_sendto,__syscall_socket:___syscall_socket,__syscall_stat64:___syscall_stat64,__syscall_statfs64:___syscall_statfs64,__syscall_symlink:___syscall_symlink,__syscall_symlinkat:___syscall_symlinkat,__syscall_truncate64:___syscall_truncate64,__syscall_unlinkat:___syscall_unlinkat,__syscall_utimensat:___syscall_utimensat,__table_base:___table_base,_abort_js:__abort_js,_dlopen_js:__dlopen_js,_dlsym_catchup_js:__dlsym_catchup_js,_dlsym_js:__dlsym_js,_embind_create_inheriting_constructor:__embind_create_inheriting_constructor,_embind_finalize_value_array:__embind_finalize_value_array,_embind_finalize_value_object:__embind_finalize_value_object,_embind_register_bigint:__embind_register_bigint,_embind_register_bool:__embind_register_bool,_embind_register_class:__embind_register_class,_embind_register_class_class_function:__embind_register_class_class_function,_embind_register_class_class_property:__embind_register_class_class_property,_embind_register_class_constructor:__embind_register_class_constructor,_embind_register_class_function:__embind_register_class_function,_embind_register_class_property:__embind_register_class_property,_embind_register_constant:__embind_register_constant,_embind_register_emval:__embind_register_emval,_embind_register_enum:__embind_register_enum,_embind_register_enum_value:__embind_register_enum_value,_embind_register_float:__embind_register_float,_embind_register_function:__embind_register_function,_embind_register_integer:__embind_register_integer,_embind_register_memory_view:__embind_register_memory_view,_embind_register_optional:__embind_register_optional,_embind_register_smart_ptr:__embind_register_smart_ptr,_embind_register_std_string:__embind_register_std_string,_embind_register_std_wstring:__embind_register_std_wstring,_embind_register_user_type:__embind_register_user_type,_embind_register_value_array:__embind_register_value_array,_embind_register_value_array_element:__embind_register_value_array_element,_embind_register_value_object:__embind_register_value_object,_embind_register_value_object_field:__embind_register_value_object_field,_embind_register_void:__embind_register_void,_emscripten_dlopen_js:__emscripten_dlopen_js,_emscripten_fs_load_embedded_files:__emscripten_fs_load_embedded_files,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_get_progname:__emscripten_get_progname,_emscripten_lookup_name:__emscripten_lookup_name,_emscripten_memcpy_js:__emscripten_memcpy_js,_emscripten_push_main_loop_blocker:__emscripten_push_main_loop_blocker,_emscripten_push_uncounted_main_loop_blocker:__emscripten_push_uncounted_main_loop_blocker,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_set_offscreencanvas_size:__emscripten_set_offscreencanvas_size,_emscripten_system:__emscripten_system,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_emval_as:__emval_as,_emval_as_int64:__emval_as_int64,_emval_as_uint64:__emval_as_uint64,_emval_call:__emval_call,_emval_call_method:__emval_call_method,_emval_coro_make_promise:__emval_coro_make_promise,_emval_coro_suspend:__emval_coro_suspend,_emval_decref:__emval_decref,_emval_delete:__emval_delete,_emval_equals:__emval_equals,_emval_get_global:__emval_get_global,_emval_get_method_caller:__emval_get_method_caller,_emval_get_module_property:__emval_get_module_property,_emval_get_property:__emval_get_property,_emval_greater_than:__emval_greater_than,_emval_in:__emval_in,_emval_incref:__emval_incref,_emval_instanceof:__emval_instanceof,_emval_is_number:__emval_is_number,_emval_is_string:__emval_is_string,_emval_iter_begin:__emval_iter_begin,_emval_iter_next:__emval_iter_next,_emval_less_than:__emval_less_than,_emval_new_array:__emval_new_array,_emval_new_array_from_memory_view:__emval_new_array_from_memory_view,_emval_new_cstring:__emval_new_cstring,_emval_new_object:__emval_new_object,_emval_new_u16string:__emval_new_u16string,_emval_new_u8string:__emval_new_u8string,_emval_not:__emval_not,_emval_register_symbol:__emval_register_symbol,_emval_run_destructors:__emval_run_destructors,_emval_set_property:__emval_set_property,_emval_strictly_equals:__emval_strictly_equals,_emval_take_value:__emval_take_value,_emval_throw:__emval_throw,_emval_typeof:__emval_typeof,_glGetActiveAttribOrUniform:__glGetActiveAttribOrUniform,_gmtime_js:__gmtime_js,_localtime_js:__localtime_js,_mktime_js:__mktime_js,_mmap_js:__mmap_js,_msync_js:__msync_js,_munmap_js:__munmap_js,_setitimer_js:__setitimer_js,_timegm_js:__timegm_js,_tzset_js:__tzset_js,alBuffer3f:_alBuffer3f,alBuffer3i:_alBuffer3i,alBufferData:_alBufferData,alBufferf:_alBufferf,alBufferfv:_alBufferfv,alBufferi:_alBufferi,alBufferiv:_alBufferiv,alDeleteBuffers:_alDeleteBuffers,alDeleteSources:_alDeleteSources,alDisable:_alDisable,alDistanceModel:_alDistanceModel,alDopplerFactor:_alDopplerFactor,alDopplerVelocity:_alDopplerVelocity,alEnable:_alEnable,alGenBuffers:_alGenBuffers,alGenSources:_alGenSources,alGetBoolean:_alGetBoolean,alGetBooleanv:_alGetBooleanv,alGetBuffer3f:_alGetBuffer3f,alGetBuffer3i:_alGetBuffer3i,alGetBufferf:_alGetBufferf,alGetBufferfv:_alGetBufferfv,alGetBufferi:_alGetBufferi,alGetBufferiv:_alGetBufferiv,alGetDouble:_alGetDouble,alGetDoublev:_alGetDoublev,alGetEnumValue:_alGetEnumValue,alGetError:_alGetError,alGetFloat:_alGetFloat,alGetFloatv:_alGetFloatv,alGetInteger:_alGetInteger,alGetIntegerv:_alGetIntegerv,alGetListener3f:_alGetListener3f,alGetListener3i:_alGetListener3i,alGetListenerf:_alGetListenerf,alGetListenerfv:_alGetListenerfv,alGetListeneri:_alGetListeneri,alGetListeneriv:_alGetListeneriv,alGetSource3f:_alGetSource3f,alGetSource3i:_alGetSource3i,alGetSourcef:_alGetSourcef,alGetSourcefv:_alGetSourcefv,alGetSourcei:_alGetSourcei,alGetSourceiv:_alGetSourceiv,alGetString:_alGetString,alIsBuffer:_alIsBuffer,alIsEnabled:_alIsEnabled,alIsExtensionPresent:_alIsExtensionPresent,alIsSource:_alIsSource,alListener3f:_alListener3f,alListener3i:_alListener3i,alListenerf:_alListenerf,alListenerfv:_alListenerfv,alListeneri:_alListeneri,alListeneriv:_alListeneriv,alSource3f:_alSource3f,alSource3i:_alSource3i,alSourcePause:_alSourcePause,alSourcePausev:_alSourcePausev,alSourcePlay:_alSourcePlay,alSourcePlayv:_alSourcePlayv,alSourceQueueBuffers:_alSourceQueueBuffers,alSourceRewind:_alSourceRewind,alSourceRewindv:_alSourceRewindv,alSourceStop:_alSourceStop,alSourceStopv:_alSourceStopv,alSourceUnqueueBuffers:_alSourceUnqueueBuffers,alSourcef:_alSourcef,alSourcefv:_alSourcefv,alSourcei:_alSourcei,alSourceiv:_alSourceiv,alSpeedOfSound:_alSpeedOfSound,alcCaptureCloseDevice:_alcCaptureCloseDevice,alcCaptureOpenDevice:_alcCaptureOpenDevice,alcCaptureSamples:_alcCaptureSamples,alcCaptureStart:_alcCaptureStart,alcCaptureStop:_alcCaptureStop,alcCloseDevice:_alcCloseDevice,alcCreateContext:_alcCreateContext,alcDestroyContext:_alcDestroyContext,alcGetContextsDevice:_alcGetContextsDevice,alcGetCurrentContext:_alcGetCurrentContext,alcGetEnumValue:_alcGetEnumValue,alcGetError:_alcGetError,alcGetIntegerv:_alcGetIntegerv,alcGetString:_alcGetString,alcIsExtensionPresent:_alcIsExtensionPresent,alcMakeContextCurrent:_alcMakeContextCurrent,alcOpenDevice:_alcOpenDevice,alcProcessContext:_alcProcessContext,alcSuspendContext:_alcSuspendContext,boxColor:_boxColor,boxRGBA:_boxRGBA,clock_res_get:_clock_res_get,clock_time_get:_clock_time_get,duckdb_web_fs_directory_create:_duckdb_web_fs_directory_create,duckdb_web_fs_directory_exists:_duckdb_web_fs_directory_exists,duckdb_web_fs_directory_list_files:_duckdb_web_fs_directory_list_files,duckdb_web_fs_directory_remove:_duckdb_web_fs_directory_remove,duckdb_web_fs_file_close:_duckdb_web_fs_file_close,duckdb_web_fs_file_exists:_duckdb_web_fs_file_exists,duckdb_web_fs_file_get_last_modified_time:_duckdb_web_fs_file_get_last_modified_time,duckdb_web_fs_file_move:_duckdb_web_fs_file_move,duckdb_web_fs_file_open:_duckdb_web_fs_file_open,duckdb_web_fs_file_read:_duckdb_web_fs_file_read,duckdb_web_fs_file_remove:_duckdb_web_fs_file_remove,duckdb_web_fs_file_sync:_duckdb_web_fs_file_sync,duckdb_web_fs_file_truncate:_duckdb_web_fs_file_truncate,duckdb_web_fs_file_write:_duckdb_web_fs_file_write,duckdb_web_fs_get_default_data_protocol:_duckdb_web_fs_get_default_data_protocol,duckdb_web_fs_glob:_duckdb_web_fs_glob,duckdb_web_test_platform_feature:_duckdb_web_test_platform_feature,duckdb_web_udf_scalar_call:_duckdb_web_udf_scalar_call,eglBindAPI:_eglBindAPI,eglChooseConfig:_eglChooseConfig,eglCreateContext:_eglCreateContext,eglCreateWindowSurface:_eglCreateWindowSurface,eglDestroyContext:_eglDestroyContext,eglDestroySurface:_eglDestroySurface,eglGetConfigAttrib:_eglGetConfigAttrib,eglGetConfigs:_eglGetConfigs,eglGetCurrentContext:_eglGetCurrentContext,eglGetCurrentDisplay:_eglGetCurrentDisplay,eglGetCurrentSurface:_eglGetCurrentSurface,eglGetDisplay:_eglGetDisplay,eglGetError:_eglGetError,eglInitialize:_eglInitialize,eglMakeCurrent:_eglMakeCurrent,eglQueryAPI:_eglQueryAPI,eglQueryContext:_eglQueryContext,eglQueryString:_eglQueryString,eglQuerySurface:_eglQuerySurface,eglReleaseThread:_eglReleaseThread,eglSwapBuffers:_eglSwapBuffers,eglSwapInterval:_eglSwapInterval,eglTerminate:_eglTerminate,eglWaitClient:_eglWaitClient,eglWaitGL:_eglWaitGL,eglWaitNative:_eglWaitNative,ellipseColor:_ellipseColor,ellipseRGBA:_ellipseRGBA,emscripten_SDL_SetEventHandler:_emscripten_SDL_SetEventHandler,emscripten_alcDevicePauseSOFT:_emscripten_alcDevicePauseSOFT,emscripten_alcDeviceResumeSOFT:_emscripten_alcDeviceResumeSOFT,emscripten_alcGetStringiSOFT:_emscripten_alcGetStringiSOFT,emscripten_alcResetDeviceSOFT:_emscripten_alcResetDeviceSOFT,emscripten_asm_const_async_on_main_thread:_emscripten_asm_const_async_on_main_thread,emscripten_asm_const_double:_emscripten_asm_const_double,emscripten_asm_const_double_sync_on_main_thread:_emscripten_asm_const_double_sync_on_main_thread,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_asm_const_int_sync_on_main_thread:_emscripten_asm_const_int_sync_on_main_thread,emscripten_asm_const_ptr:_emscripten_asm_const_ptr,emscripten_asm_const_ptr_sync_on_main_thread:_emscripten_asm_const_ptr_sync_on_main_thread,emscripten_async_call:_emscripten_async_call,emscripten_async_load_script:_emscripten_async_load_script,emscripten_async_run_script:_emscripten_async_run_script,emscripten_async_wget:_emscripten_async_wget,emscripten_async_wget2:_emscripten_async_wget2,emscripten_async_wget2_abort:_emscripten_async_wget2_abort,emscripten_async_wget2_data:_emscripten_async_wget2_data,emscripten_async_wget_data:_emscripten_async_wget_data,emscripten_call_worker:_emscripten_call_worker,emscripten_cancel_animation_frame:_emscripten_cancel_animation_frame,emscripten_cancel_main_loop:_emscripten_cancel_main_loop,emscripten_clear_immediate:_emscripten_clear_immediate,emscripten_clear_interval:_emscripten_clear_interval,emscripten_clear_timeout:_emscripten_clear_timeout,emscripten_console_error:_emscripten_console_error,emscripten_console_log:_emscripten_console_log,emscripten_console_trace:_emscripten_console_trace,emscripten_console_warn:_emscripten_console_warn,emscripten_create_worker:_emscripten_create_worker,emscripten_date_now:_emscripten_date_now,emscripten_debugger:_emscripten_debugger,emscripten_destroy_worker:_emscripten_destroy_worker,emscripten_enter_soft_fullscreen:_emscripten_enter_soft_fullscreen,emscripten_err:_emscripten_err,emscripten_errn:_emscripten_errn,emscripten_exit_fullscreen:_emscripten_exit_fullscreen,emscripten_exit_pointerlock:_emscripten_exit_pointerlock,emscripten_exit_soft_fullscreen:_emscripten_exit_soft_fullscreen,emscripten_exit_with_live_runtime:_emscripten_exit_with_live_runtime,emscripten_fiber_swap:_emscripten_fiber_swap,emscripten_force_exit:_emscripten_force_exit,emscripten_get_battery_status:_emscripten_get_battery_status,emscripten_get_callstack:_emscripten_get_callstack,emscripten_get_canvas_element_size:_emscripten_get_canvas_element_size,emscripten_get_canvas_size:_emscripten_get_canvas_size,emscripten_get_compiler_setting:_emscripten_get_compiler_setting,emscripten_get_device_pixel_ratio:_emscripten_get_device_pixel_ratio,emscripten_get_devicemotion_status:_emscripten_get_devicemotion_status,emscripten_get_deviceorientation_status:_emscripten_get_deviceorientation_status,emscripten_get_element_css_size:_emscripten_get_element_css_size,emscripten_get_fullscreen_status:_emscripten_get_fullscreen_status,emscripten_get_gamepad_status:_emscripten_get_gamepad_status,emscripten_get_heap_max:_emscripten_get_heap_max,emscripten_get_main_loop_timing:_emscripten_get_main_loop_timing,emscripten_get_mouse_status:_emscripten_get_mouse_status,emscripten_get_now:_emscripten_get_now,emscripten_get_now_res:_emscripten_get_now_res,emscripten_get_num_gamepads:_emscripten_get_num_gamepads,emscripten_get_orientation_status:_emscripten_get_orientation_status,emscripten_get_pointerlock_status:_emscripten_get_pointerlock_status,emscripten_get_preloaded_image_data:_emscripten_get_preloaded_image_data,emscripten_get_preloaded_image_data_from_FILE:_emscripten_get_preloaded_image_data_from_FILE,emscripten_get_screen_size:_emscripten_get_screen_size,emscripten_get_visibility_status:_emscripten_get_visibility_status,emscripten_get_window_title:_emscripten_get_window_title,emscripten_get_worker_queue_size:_emscripten_get_worker_queue_size,emscripten_glActiveTexture:_emscripten_glActiveTexture,emscripten_glAttachShader:_emscripten_glAttachShader,emscripten_glBegin:_emscripten_glBegin,emscripten_glBeginQueryEXT:_emscripten_glBeginQueryEXT,emscripten_glBindAttribLocation:_emscripten_glBindAttribLocation,emscripten_glBindBuffer:_emscripten_glBindBuffer,emscripten_glBindFramebuffer:_emscripten_glBindFramebuffer,emscripten_glBindRenderbuffer:_emscripten_glBindRenderbuffer,emscripten_glBindTexture:_emscripten_glBindTexture,emscripten_glBindVertexArray:_emscripten_glBindVertexArray,emscripten_glBindVertexArrayOES:_emscripten_glBindVertexArrayOES,emscripten_glBlendColor:_emscripten_glBlendColor,emscripten_glBlendEquation:_emscripten_glBlendEquation,emscripten_glBlendEquationSeparate:_emscripten_glBlendEquationSeparate,emscripten_glBlendFunc:_emscripten_glBlendFunc,emscripten_glBlendFuncSeparate:_emscripten_glBlendFuncSeparate,emscripten_glBufferData:_emscripten_glBufferData,emscripten_glBufferSubData:_emscripten_glBufferSubData,emscripten_glCheckFramebufferStatus:_emscripten_glCheckFramebufferStatus,emscripten_glClear:_emscripten_glClear,emscripten_glClearColor:_emscripten_glClearColor,emscripten_glClearDepth:_emscripten_glClearDepth,emscripten_glClearDepthf:_emscripten_glClearDepthf,emscripten_glClearStencil:_emscripten_glClearStencil,emscripten_glClipControlEXT:_emscripten_glClipControlEXT,emscripten_glColorMask:_emscripten_glColorMask,emscripten_glCompileShader:_emscripten_glCompileShader,emscripten_glCompressedTexImage2D:_emscripten_glCompressedTexImage2D,emscripten_glCompressedTexSubImage2D:_emscripten_glCompressedTexSubImage2D,emscripten_glCopyTexImage2D:_emscripten_glCopyTexImage2D,emscripten_glCopyTexSubImage2D:_emscripten_glCopyTexSubImage2D,emscripten_glCreateProgram:_emscripten_glCreateProgram,emscripten_glCreateShader:_emscripten_glCreateShader,emscripten_glCullFace:_emscripten_glCullFace,emscripten_glDeleteBuffers:_emscripten_glDeleteBuffers,emscripten_glDeleteFramebuffers:_emscripten_glDeleteFramebuffers,emscripten_glDeleteProgram:_emscripten_glDeleteProgram,emscripten_glDeleteQueriesEXT:_emscripten_glDeleteQueriesEXT,emscripten_glDeleteRenderbuffers:_emscripten_glDeleteRenderbuffers,emscripten_glDeleteShader:_emscripten_glDeleteShader,emscripten_glDeleteTextures:_emscripten_glDeleteTextures,emscripten_glDeleteVertexArrays:_emscripten_glDeleteVertexArrays,emscripten_glDeleteVertexArraysOES:_emscripten_glDeleteVertexArraysOES,emscripten_glDepthFunc:_emscripten_glDepthFunc,emscripten_glDepthMask:_emscripten_glDepthMask,emscripten_glDepthRange:_emscripten_glDepthRange,emscripten_glDepthRangef:_emscripten_glDepthRangef,emscripten_glDetachShader:_emscripten_glDetachShader,emscripten_glDisable:_emscripten_glDisable,emscripten_glDisableVertexAttribArray:_emscripten_glDisableVertexAttribArray,emscripten_glDrawArrays:_emscripten_glDrawArrays,emscripten_glDrawArraysInstanced:_emscripten_glDrawArraysInstanced,emscripten_glDrawArraysInstancedANGLE:_emscripten_glDrawArraysInstancedANGLE,emscripten_glDrawArraysInstancedARB:_emscripten_glDrawArraysInstancedARB,emscripten_glDrawArraysInstancedEXT:_emscripten_glDrawArraysInstancedEXT,emscripten_glDrawArraysInstancedNV:_emscripten_glDrawArraysInstancedNV,emscripten_glDrawBuffers:_emscripten_glDrawBuffers,emscripten_glDrawBuffersEXT:_emscripten_glDrawBuffersEXT,emscripten_glDrawBuffersWEBGL:_emscripten_glDrawBuffersWEBGL,emscripten_glDrawElements:_emscripten_glDrawElements,emscripten_glDrawElementsInstanced:_emscripten_glDrawElementsInstanced,emscripten_glDrawElementsInstancedANGLE:_emscripten_glDrawElementsInstancedANGLE,emscripten_glDrawElementsInstancedARB:_emscripten_glDrawElementsInstancedARB,emscripten_glDrawElementsInstancedEXT:_emscripten_glDrawElementsInstancedEXT,emscripten_glDrawElementsInstancedNV:_emscripten_glDrawElementsInstancedNV,emscripten_glEnable:_emscripten_glEnable,emscripten_glEnableVertexAttribArray:_emscripten_glEnableVertexAttribArray,emscripten_glEndQueryEXT:_emscripten_glEndQueryEXT,emscripten_glFinish:_emscripten_glFinish,emscripten_glFlush:_emscripten_glFlush,emscripten_glFramebufferRenderbuffer:_emscripten_glFramebufferRenderbuffer,emscripten_glFramebufferTexture2D:_emscripten_glFramebufferTexture2D,emscripten_glFrontFace:_emscripten_glFrontFace,emscripten_glGenBuffers:_emscripten_glGenBuffers,emscripten_glGenFramebuffers:_emscripten_glGenFramebuffers,emscripten_glGenQueriesEXT:_emscripten_glGenQueriesEXT,emscripten_glGenRenderbuffers:_emscripten_glGenRenderbuffers,emscripten_glGenTextures:_emscripten_glGenTextures,emscripten_glGenVertexArrays:_emscripten_glGenVertexArrays,emscripten_glGenVertexArraysOES:_emscripten_glGenVertexArraysOES,emscripten_glGenerateMipmap:_emscripten_glGenerateMipmap,emscripten_glGetActiveAttrib:_emscripten_glGetActiveAttrib,emscripten_glGetActiveUniform:_emscripten_glGetActiveUniform,emscripten_glGetAttachedShaders:_emscripten_glGetAttachedShaders,emscripten_glGetAttribLocation:_emscripten_glGetAttribLocation,emscripten_glGetBooleanv:_emscripten_glGetBooleanv,emscripten_glGetBufferParameteriv:_emscripten_glGetBufferParameteriv,emscripten_glGetError:_emscripten_glGetError,emscripten_glGetFloatv:_emscripten_glGetFloatv,emscripten_glGetFramebufferAttachmentParameteriv:_emscripten_glGetFramebufferAttachmentParameteriv,emscripten_glGetIntegerv:_emscripten_glGetIntegerv,emscripten_glGetProgramInfoLog:_emscripten_glGetProgramInfoLog,emscripten_glGetProgramiv:_emscripten_glGetProgramiv,emscripten_glGetQueryObjecti64vEXT:_emscripten_glGetQueryObjecti64vEXT,emscripten_glGetQueryObjectivEXT:_emscripten_glGetQueryObjectivEXT,emscripten_glGetQueryObjectui64vEXT:_emscripten_glGetQueryObjectui64vEXT,emscripten_glGetQueryObjectuivEXT:_emscripten_glGetQueryObjectuivEXT,emscripten_glGetQueryivEXT:_emscripten_glGetQueryivEXT,emscripten_glGetRenderbufferParameteriv:_emscripten_glGetRenderbufferParameteriv,emscripten_glGetShaderInfoLog:_emscripten_glGetShaderInfoLog,emscripten_glGetShaderPrecisionFormat:_emscripten_glGetShaderPrecisionFormat,emscripten_glGetShaderSource:_emscripten_glGetShaderSource,emscripten_glGetShaderiv:_emscripten_glGetShaderiv,emscripten_glGetString:_emscripten_glGetString,emscripten_glGetTexParameterfv:_emscripten_glGetTexParameterfv,emscripten_glGetTexParameteriv:_emscripten_glGetTexParameteriv,emscripten_glGetUniformLocation:_emscripten_glGetUniformLocation,emscripten_glGetUniformfv:_emscripten_glGetUniformfv,emscripten_glGetUniformiv:_emscripten_glGetUniformiv,emscripten_glGetVertexAttribPointerv:_emscripten_glGetVertexAttribPointerv,emscripten_glGetVertexAttribfv:_emscripten_glGetVertexAttribfv,emscripten_glGetVertexAttribiv:_emscripten_glGetVertexAttribiv,emscripten_glHint:_emscripten_glHint,emscripten_glIsBuffer:_emscripten_glIsBuffer,emscripten_glIsEnabled:_emscripten_glIsEnabled,emscripten_glIsFramebuffer:_emscripten_glIsFramebuffer,emscripten_glIsProgram:_emscripten_glIsProgram,emscripten_glIsQueryEXT:_emscripten_glIsQueryEXT,emscripten_glIsRenderbuffer:_emscripten_glIsRenderbuffer,emscripten_glIsShader:_emscripten_glIsShader,emscripten_glIsTexture:_emscripten_glIsTexture,emscripten_glIsVertexArray:_emscripten_glIsVertexArray,emscripten_glIsVertexArrayOES:_emscripten_glIsVertexArrayOES,emscripten_glLineWidth:_emscripten_glLineWidth,emscripten_glLinkProgram:_emscripten_glLinkProgram,emscripten_glLoadIdentity:_emscripten_glLoadIdentity,emscripten_glMatrixMode:_emscripten_glMatrixMode,emscripten_glMultiDrawArrays:_emscripten_glMultiDrawArrays,emscripten_glMultiDrawArraysANGLE:_emscripten_glMultiDrawArraysANGLE,emscripten_glMultiDrawArraysInstancedANGLE:_emscripten_glMultiDrawArraysInstancedANGLE,emscripten_glMultiDrawArraysInstancedWEBGL:_emscripten_glMultiDrawArraysInstancedWEBGL,emscripten_glMultiDrawArraysWEBGL:_emscripten_glMultiDrawArraysWEBGL,emscripten_glMultiDrawElements:_emscripten_glMultiDrawElements,emscripten_glMultiDrawElementsANGLE:_emscripten_glMultiDrawElementsANGLE,emscripten_glMultiDrawElementsInstancedANGLE:_emscripten_glMultiDrawElementsInstancedANGLE,emscripten_glMultiDrawElementsInstancedWEBGL:_emscripten_glMultiDrawElementsInstancedWEBGL,emscripten_glMultiDrawElementsWEBGL:_emscripten_glMultiDrawElementsWEBGL,emscripten_glPixelStorei:_emscripten_glPixelStorei,emscripten_glPolygonModeWEBGL:_emscripten_glPolygonModeWEBGL,emscripten_glPolygonOffset:_emscripten_glPolygonOffset,emscripten_glPolygonOffsetClampEXT:_emscripten_glPolygonOffsetClampEXT,emscripten_glQueryCounterEXT:_emscripten_glQueryCounterEXT,emscripten_glReadPixels:_emscripten_glReadPixels,emscripten_glReleaseShaderCompiler:_emscripten_glReleaseShaderCompiler,emscripten_glRenderbufferStorage:_emscripten_glRenderbufferStorage,emscripten_glSampleCoverage:_emscripten_glSampleCoverage,emscripten_glScissor:_emscripten_glScissor,emscripten_glShaderBinary:_emscripten_glShaderBinary,emscripten_glShaderSource:_emscripten_glShaderSource,emscripten_glStencilFunc:_emscripten_glStencilFunc,emscripten_glStencilFuncSeparate:_emscripten_glStencilFuncSeparate,emscripten_glStencilMask:_emscripten_glStencilMask,emscripten_glStencilMaskSeparate:_emscripten_glStencilMaskSeparate,emscripten_glStencilOp:_emscripten_glStencilOp,emscripten_glStencilOpSeparate:_emscripten_glStencilOpSeparate,emscripten_glTexImage2D:_emscripten_glTexImage2D,emscripten_glTexParameterf:_emscripten_glTexParameterf,emscripten_glTexParameterfv:_emscripten_glTexParameterfv,emscripten_glTexParameteri:_emscripten_glTexParameteri,emscripten_glTexParameteriv:_emscripten_glTexParameteriv,emscripten_glTexSubImage2D:_emscripten_glTexSubImage2D,emscripten_glUniform1f:_emscripten_glUniform1f,emscripten_glUniform1fv:_emscripten_glUniform1fv,emscripten_glUniform1i:_emscripten_glUniform1i,emscripten_glUniform1iv:_emscripten_glUniform1iv,emscripten_glUniform2f:_emscripten_glUniform2f,emscripten_glUniform2fv:_emscripten_glUniform2fv,emscripten_glUniform2i:_emscripten_glUniform2i,emscripten_glUniform2iv:_emscripten_glUniform2iv,emscripten_glUniform3f:_emscripten_glUniform3f,emscripten_glUniform3fv:_emscripten_glUniform3fv,emscripten_glUniform3i:_emscripten_glUniform3i,emscripten_glUniform3iv:_emscripten_glUniform3iv,emscripten_glUniform4f:_emscripten_glUniform4f,emscripten_glUniform4fv:_emscripten_glUniform4fv,emscripten_glUniform4i:_emscripten_glUniform4i,emscripten_glUniform4iv:_emscripten_glUniform4iv,emscripten_glUniformMatrix2fv:_emscripten_glUniformMatrix2fv,emscripten_glUniformMatrix3fv:_emscripten_glUniformMatrix3fv,emscripten_glUniformMatrix4fv:_emscripten_glUniformMatrix4fv,emscripten_glUseProgram:_emscripten_glUseProgram,emscripten_glValidateProgram:_emscripten_glValidateProgram,emscripten_glVertexAttrib1f:_emscripten_glVertexAttrib1f,emscripten_glVertexAttrib1fv:_emscripten_glVertexAttrib1fv,emscripten_glVertexAttrib2f:_emscripten_glVertexAttrib2f,emscripten_glVertexAttrib2fv:_emscripten_glVertexAttrib2fv,emscripten_glVertexAttrib3f:_emscripten_glVertexAttrib3f,emscripten_glVertexAttrib3fv:_emscripten_glVertexAttrib3fv,emscripten_glVertexAttrib4f:_emscripten_glVertexAttrib4f,emscripten_glVertexAttrib4fv:_emscripten_glVertexAttrib4fv,emscripten_glVertexAttribDivisor:_emscripten_glVertexAttribDivisor,emscripten_glVertexAttribDivisorANGLE:_emscripten_glVertexAttribDivisorANGLE,emscripten_glVertexAttribDivisorARB:_emscripten_glVertexAttribDivisorARB,emscripten_glVertexAttribDivisorEXT:_emscripten_glVertexAttribDivisorEXT,emscripten_glVertexAttribDivisorNV:_emscripten_glVertexAttribDivisorNV,emscripten_glVertexAttribPointer:_emscripten_glVertexAttribPointer,emscripten_glVertexPointer:_emscripten_glVertexPointer,emscripten_glViewport:_emscripten_glViewport,emscripten_has_asyncify:_emscripten_has_asyncify,emscripten_hide_mouse:_emscripten_hide_mouse,emscripten_html5_remove_all_event_listeners:_emscripten_html5_remove_all_event_listeners,emscripten_idb_async_clear:_emscripten_idb_async_clear,emscripten_idb_async_delete:_emscripten_idb_async_delete,emscripten_idb_async_exists:_emscripten_idb_async_exists,emscripten_idb_async_load:_emscripten_idb_async_load,emscripten_idb_async_store:_emscripten_idb_async_store,emscripten_idb_clear:_emscripten_idb_clear,emscripten_idb_delete:_emscripten_idb_delete,emscripten_idb_exists:_emscripten_idb_exists,emscripten_idb_load:_emscripten_idb_load,emscripten_idb_store:_emscripten_idb_store,emscripten_is_main_browser_thread:_emscripten_is_main_browser_thread,emscripten_is_webgl_context_lost:_emscripten_is_webgl_context_lost,emscripten_lock_orientation:_emscripten_lock_orientation,emscripten_log:_emscripten_log,emscripten_math_acos:_emscripten_math_acos,emscripten_math_acosh:_emscripten_math_acosh,emscripten_math_asin:_emscripten_math_asin,emscripten_math_asinh:_emscripten_math_asinh,emscripten_math_atan:_emscripten_math_atan,emscripten_math_atan2:_emscripten_math_atan2,emscripten_math_atanh:_emscripten_math_atanh,emscripten_math_cbrt:_emscripten_math_cbrt,emscripten_math_cos:_emscripten_math_cos,emscripten_math_cosh:_emscripten_math_cosh,emscripten_math_exp:_emscripten_math_exp,emscripten_math_expm1:_emscripten_math_expm1,emscripten_math_fmod:_emscripten_math_fmod,emscripten_math_hypot:_emscripten_math_hypot,emscripten_math_log:_emscripten_math_log,emscripten_math_log10:_emscripten_math_log10,emscripten_math_log1p:_emscripten_math_log1p,emscripten_math_log2:_emscripten_math_log2,emscripten_math_pow:_emscripten_math_pow,emscripten_math_random:_emscripten_math_random,emscripten_math_round:_emscripten_math_round,emscripten_math_sign:_emscripten_math_sign,emscripten_math_sin:_emscripten_math_sin,emscripten_math_sinh:_emscripten_math_sinh,emscripten_math_sqrt:_emscripten_math_sqrt,emscripten_math_tan:_emscripten_math_tan,emscripten_math_tanh:_emscripten_math_tanh,emscripten_notify_memory_growth:_emscripten_notify_memory_growth,emscripten_out:_emscripten_out,emscripten_outn:_emscripten_outn,emscripten_pause_main_loop:_emscripten_pause_main_loop,emscripten_pc_get_column:_emscripten_pc_get_column,emscripten_pc_get_file:_emscripten_pc_get_file,emscripten_pc_get_function:_emscripten_pc_get_function,emscripten_pc_get_line:_emscripten_pc_get_line,emscripten_performance_now:_emscripten_performance_now,emscripten_print_double:_emscripten_print_double,emscripten_promise_all:_emscripten_promise_all,emscripten_promise_all_settled:_emscripten_promise_all_settled,emscripten_promise_any:_emscripten_promise_any,emscripten_promise_await:_emscripten_promise_await,emscripten_promise_create:_emscripten_promise_create,emscripten_promise_destroy:_emscripten_promise_destroy,emscripten_promise_race:_emscripten_promise_race,emscripten_promise_resolve:_emscripten_promise_resolve,emscripten_promise_then:_emscripten_promise_then,emscripten_random:_emscripten_random,emscripten_request_animation_frame:_emscripten_request_animation_frame,emscripten_request_animation_frame_loop:_emscripten_request_animation_frame_loop,emscripten_request_fullscreen:_emscripten_request_fullscreen,emscripten_request_fullscreen_strategy:_emscripten_request_fullscreen_strategy,emscripten_request_pointerlock:_emscripten_request_pointerlock,emscripten_resize_heap:_emscripten_resize_heap,emscripten_resume_main_loop:_emscripten_resume_main_loop,emscripten_return_address:_emscripten_return_address,emscripten_run_preload_plugins:_emscripten_run_preload_plugins,emscripten_run_preload_plugins_data:_emscripten_run_preload_plugins_data,emscripten_run_script:_emscripten_run_script,emscripten_run_script_int:_emscripten_run_script_int,emscripten_run_script_string:_emscripten_run_script_string,emscripten_runtime_keepalive_check:_emscripten_runtime_keepalive_check,emscripten_runtime_keepalive_pop:_emscripten_runtime_keepalive_pop,emscripten_runtime_keepalive_push:_emscripten_runtime_keepalive_push,emscripten_sample_gamepad_data:_emscripten_sample_gamepad_data,emscripten_scan_registers:_emscripten_scan_registers,emscripten_set_batterychargingchange_callback_on_thread:_emscripten_set_batterychargingchange_callback_on_thread,emscripten_set_batterylevelchange_callback_on_thread:_emscripten_set_batterylevelchange_callback_on_thread,emscripten_set_beforeunload_callback_on_thread:_emscripten_set_beforeunload_callback_on_thread,emscripten_set_blur_callback_on_thread:_emscripten_set_blur_callback_on_thread,emscripten_set_canvas_element_size:_emscripten_set_canvas_element_size,emscripten_set_canvas_size:_emscripten_set_canvas_size,emscripten_set_click_callback_on_thread:_emscripten_set_click_callback_on_thread,emscripten_set_dblclick_callback_on_thread:_emscripten_set_dblclick_callback_on_thread,emscripten_set_devicemotion_callback_on_thread:_emscripten_set_devicemotion_callback_on_thread,emscripten_set_deviceorientation_callback_on_thread:_emscripten_set_deviceorientation_callback_on_thread,emscripten_set_element_css_size:_emscripten_set_element_css_size,emscripten_set_focus_callback_on_thread:_emscripten_set_focus_callback_on_thread,emscripten_set_focusin_callback_on_thread:_emscripten_set_focusin_callback_on_thread,emscripten_set_focusout_callback_on_thread:_emscripten_set_focusout_callback_on_thread,emscripten_set_fullscreenchange_callback_on_thread:_emscripten_set_fullscreenchange_callback_on_thread,emscripten_set_gamepadconnected_callback_on_thread:_emscripten_set_gamepadconnected_callback_on_thread,emscripten_set_gamepaddisconnected_callback_on_thread:_emscripten_set_gamepaddisconnected_callback_on_thread,emscripten_set_immediate:_emscripten_set_immediate,emscripten_set_immediate_loop:_emscripten_set_immediate_loop,emscripten_set_interval:_emscripten_set_interval,emscripten_set_keydown_callback_on_thread:_emscripten_set_keydown_callback_on_thread,emscripten_set_keypress_callback_on_thread:_emscripten_set_keypress_callback_on_thread,emscripten_set_keyup_callback_on_thread:_emscripten_set_keyup_callback_on_thread,emscripten_set_main_loop:_emscripten_set_main_loop,emscripten_set_main_loop_arg:_emscripten_set_main_loop_arg,emscripten_set_main_loop_expected_blockers:_emscripten_set_main_loop_expected_blockers,emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,emscripten_set_mousedown_callback_on_thread:_emscripten_set_mousedown_callback_on_thread,emscripten_set_mouseenter_callback_on_thread:_emscripten_set_mouseenter_callback_on_thread,emscripten_set_mouseleave_callback_on_thread:_emscripten_set_mouseleave_callback_on_thread,emscripten_set_mousemove_callback_on_thread:_emscripten_set_mousemove_callback_on_thread,emscripten_set_mouseout_callback_on_thread:_emscripten_set_mouseout_callback_on_thread,emscripten_set_mouseover_callback_on_thread:_emscripten_set_mouseover_callback_on_thread,emscripten_set_mouseup_callback_on_thread:_emscripten_set_mouseup_callback_on_thread,emscripten_set_orientationchange_callback_on_thread:_emscripten_set_orientationchange_callback_on_thread,emscripten_set_pointerlockchange_callback_on_thread:_emscripten_set_pointerlockchange_callback_on_thread,emscripten_set_pointerlockerror_callback_on_thread:_emscripten_set_pointerlockerror_callback_on_thread,emscripten_set_resize_callback_on_thread:_emscripten_set_resize_callback_on_thread,emscripten_set_scroll_callback_on_thread:_emscripten_set_scroll_callback_on_thread,emscripten_set_socket_close_callback:_emscripten_set_socket_close_callback,emscripten_set_socket_connection_callback:_emscripten_set_socket_connection_callback,emscripten_set_socket_error_callback:_emscripten_set_socket_error_callback,emscripten_set_socket_listen_callback:_emscripten_set_socket_listen_callback,emscripten_set_socket_message_callback:_emscripten_set_socket_message_callback,emscripten_set_socket_open_callback:_emscripten_set_socket_open_callback,emscripten_set_timeout:_emscripten_set_timeout,emscripten_set_timeout_loop:_emscripten_set_timeout_loop,emscripten_set_touchcancel_callback_on_thread:_emscripten_set_touchcancel_callback_on_thread,emscripten_set_touchend_callback_on_thread:_emscripten_set_touchend_callback_on_thread,emscripten_set_touchmove_callback_on_thread:_emscripten_set_touchmove_callback_on_thread,emscripten_set_touchstart_callback_on_thread:_emscripten_set_touchstart_callback_on_thread,emscripten_set_visibilitychange_callback_on_thread:_emscripten_set_visibilitychange_callback_on_thread,emscripten_set_webglcontextlost_callback_on_thread:_emscripten_set_webglcontextlost_callback_on_thread,emscripten_set_webglcontextrestored_callback_on_thread:_emscripten_set_webglcontextrestored_callback_on_thread,emscripten_set_wheel_callback_on_thread:_emscripten_set_wheel_callback_on_thread,emscripten_set_window_title:_emscripten_set_window_title,emscripten_sleep:_emscripten_sleep,emscripten_stack_snapshot:_emscripten_stack_snapshot,emscripten_stack_unwind_buffer:_emscripten_stack_unwind_buffer,emscripten_supports_offscreencanvas:_emscripten_supports_offscreencanvas,emscripten_throw_number:_emscripten_throw_number,emscripten_throw_string:_emscripten_throw_string,emscripten_unlock_orientation:_emscripten_unlock_orientation,emscripten_unwind_to_js_event_loop:_emscripten_unwind_to_js_event_loop,emscripten_vibrate:_emscripten_vibrate,emscripten_vibrate_pattern:_emscripten_vibrate_pattern,emscripten_webgl_commit_frame:_emscripten_webgl_commit_frame,emscripten_webgl_create_context:_emscripten_webgl_create_context,emscripten_webgl_destroy_context:_emscripten_webgl_destroy_context,emscripten_webgl_do_commit_frame:_emscripten_webgl_do_commit_frame,emscripten_webgl_do_create_context:_emscripten_webgl_do_create_context,emscripten_webgl_do_get_current_context:_emscripten_webgl_do_get_current_context,emscripten_webgl_enable_ANGLE_instanced_arrays:_emscripten_webgl_enable_ANGLE_instanced_arrays,emscripten_webgl_enable_EXT_clip_control:_emscripten_webgl_enable_EXT_clip_control,emscripten_webgl_enable_EXT_polygon_offset_clamp:_emscripten_webgl_enable_EXT_polygon_offset_clamp,emscripten_webgl_enable_OES_vertex_array_object:_emscripten_webgl_enable_OES_vertex_array_object,emscripten_webgl_enable_WEBGL_draw_buffers:_emscripten_webgl_enable_WEBGL_draw_buffers,emscripten_webgl_enable_WEBGL_multi_draw:_emscripten_webgl_enable_WEBGL_multi_draw,emscripten_webgl_enable_WEBGL_polygon_mode:_emscripten_webgl_enable_WEBGL_polygon_mode,emscripten_webgl_enable_extension:_emscripten_webgl_enable_extension,emscripten_webgl_get_context_attributes:_emscripten_webgl_get_context_attributes,emscripten_webgl_get_current_context:_emscripten_webgl_get_current_context,emscripten_webgl_get_drawing_buffer_size:_emscripten_webgl_get_drawing_buffer_size,emscripten_webgl_get_parameter_d:_emscripten_webgl_get_parameter_d,emscripten_webgl_get_parameter_i64v:_emscripten_webgl_get_parameter_i64v,emscripten_webgl_get_parameter_o:_emscripten_webgl_get_parameter_o,emscripten_webgl_get_parameter_utf8:_emscripten_webgl_get_parameter_utf8,emscripten_webgl_get_parameter_v:_emscripten_webgl_get_parameter_v,emscripten_webgl_get_program_info_log_utf8:_emscripten_webgl_get_program_info_log_utf8,emscripten_webgl_get_program_parameter_d:_emscripten_webgl_get_program_parameter_d,emscripten_webgl_get_shader_info_log_utf8:_emscripten_webgl_get_shader_info_log_utf8,emscripten_webgl_get_shader_parameter_d:_emscripten_webgl_get_shader_parameter_d,emscripten_webgl_get_shader_source_utf8:_emscripten_webgl_get_shader_source_utf8,emscripten_webgl_get_supported_extensions:_emscripten_webgl_get_supported_extensions,emscripten_webgl_get_uniform_d:_emscripten_webgl_get_uniform_d,emscripten_webgl_get_uniform_v:_emscripten_webgl_get_uniform_v,emscripten_webgl_get_vertex_attrib_d:_emscripten_webgl_get_vertex_attrib_d,emscripten_webgl_get_vertex_attrib_o:_emscripten_webgl_get_vertex_attrib_o,emscripten_webgl_get_vertex_attrib_v:_emscripten_webgl_get_vertex_attrib_v,emscripten_webgl_make_context_current:_emscripten_webgl_make_context_current,emscripten_wget_data:_emscripten_wget_data,endprotoent:_endprotoent,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_fdstat_get:_fd_fdstat_get,fd_pread:_fd_pread,fd_pwrite:_fd_pwrite,fd_read:_fd_read,fd_seek:_fd_seek,fd_sync:_fd_sync,fd_write:_fd_write,filledEllipseColor:_filledEllipseColor,filledEllipseRGBA:_filledEllipseRGBA,getaddrinfo:_getaddrinfo,getentropy:_getentropy,getnameinfo:_getnameinfo,getprotobyname:_getprotobyname,getprotobynumber:_getprotobynumber,getprotoent:_getprotoent,glActiveTexture:_glActiveTexture,glAttachShader:_glAttachShader,glBegin:_glBegin,glBeginQueryEXT:_glBeginQueryEXT,glBindAttribLocation:_glBindAttribLocation,glBindBuffer:_glBindBuffer,glBindFramebuffer:_glBindFramebuffer,glBindRenderbuffer:_glBindRenderbuffer,glBindTexture:_glBindTexture,glBindVertexArray:_glBindVertexArray,glBindVertexArrayOES:_glBindVertexArrayOES,glBlendColor:_glBlendColor,glBlendEquation:_glBlendEquation,glBlendEquationSeparate:_glBlendEquationSeparate,glBlendFunc:_glBlendFunc,glBlendFuncSeparate:_glBlendFuncSeparate,glBufferData:_glBufferData,glBufferSubData:_glBufferSubData,glCheckFramebufferStatus:_glCheckFramebufferStatus,glClear:_glClear,glClearColor:_glClearColor,glClearDepth:_glClearDepth,glClearDepthf:_glClearDepthf,glClearStencil:_glClearStencil,glClipControlEXT:_glClipControlEXT,glColorMask:_glColorMask,glCompileShader:_glCompileShader,glCompressedTexImage2D:_glCompressedTexImage2D,glCompressedTexSubImage2D:_glCompressedTexSubImage2D,glCopyTexImage2D:_glCopyTexImage2D,glCopyTexSubImage2D:_glCopyTexSubImage2D,glCreateProgram:_glCreateProgram,glCreateShader:_glCreateShader,glCullFace:_glCullFace,glDeleteBuffers:_glDeleteBuffers,glDeleteFramebuffers:_glDeleteFramebuffers,glDeleteProgram:_glDeleteProgram,glDeleteQueriesEXT:_glDeleteQueriesEXT,glDeleteRenderbuffers:_glDeleteRenderbuffers,glDeleteShader:_glDeleteShader,glDeleteTextures:_glDeleteTextures,glDeleteVertexArrays:_glDeleteVertexArrays,glDeleteVertexArraysOES:_glDeleteVertexArraysOES,glDepthFunc:_glDepthFunc,glDepthMask:_glDepthMask,glDepthRange:_glDepthRange,glDepthRangef:_glDepthRangef,glDetachShader:_glDetachShader,glDisable:_glDisable,glDisableVertexAttribArray:_glDisableVertexAttribArray,glDrawArrays:_glDrawArrays,glDrawArraysInstanced:_glDrawArraysInstanced,glDrawArraysInstancedANGLE:_glDrawArraysInstancedANGLE,glDrawArraysInstancedARB:_glDrawArraysInstancedARB,glDrawArraysInstancedEXT:_glDrawArraysInstancedEXT,glDrawArraysInstancedNV:_glDrawArraysInstancedNV,glDrawBuffers:_glDrawBuffers,glDrawBuffersEXT:_glDrawBuffersEXT,glDrawBuffersWEBGL:_glDrawBuffersWEBGL,glDrawElements:_glDrawElements,glDrawElementsInstanced:_glDrawElementsInstanced,glDrawElementsInstancedANGLE:_glDrawElementsInstancedANGLE,glDrawElementsInstancedARB:_glDrawElementsInstancedARB,glDrawElementsInstancedEXT:_glDrawElementsInstancedEXT,glDrawElementsInstancedNV:_glDrawElementsInstancedNV,glEnable:_glEnable,glEnableVertexAttribArray:_glEnableVertexAttribArray,glEndQueryEXT:_glEndQueryEXT,glFinish:_glFinish,glFlush:_glFlush,glFramebufferRenderbuffer:_glFramebufferRenderbuffer,glFramebufferTexture2D:_glFramebufferTexture2D,glFrontFace:_glFrontFace,glGenBuffers:_glGenBuffers,glGenFramebuffers:_glGenFramebuffers,glGenQueriesEXT:_glGenQueriesEXT,glGenRenderbuffers:_glGenRenderbuffers,glGenTextures:_glGenTextures,glGenVertexArrays:_glGenVertexArrays,glGenVertexArraysOES:_glGenVertexArraysOES,glGenerateMipmap:_glGenerateMipmap,glGetActiveAttrib:_glGetActiveAttrib,glGetActiveUniform:_glGetActiveUniform,glGetAttachedShaders:_glGetAttachedShaders,glGetAttribLocation:_glGetAttribLocation,glGetBooleanv:_glGetBooleanv,glGetBufferParameteriv:_glGetBufferParameteriv,glGetError:_glGetError,glGetFloatv:_glGetFloatv,glGetFramebufferAttachmentParameteriv:_glGetFramebufferAttachmentParameteriv,glGetIntegerv:_glGetIntegerv,glGetProgramInfoLog:_glGetProgramInfoLog,glGetProgramiv:_glGetProgramiv,glGetQueryObjecti64vEXT:_glGetQueryObjecti64vEXT,glGetQueryObjectivEXT:_glGetQueryObjectivEXT,glGetQueryObjectui64vEXT:_glGetQueryObjectui64vEXT,glGetQueryObjectuivEXT:_glGetQueryObjectuivEXT,glGetQueryivEXT:_glGetQueryivEXT,glGetRenderbufferParameteriv:_glGetRenderbufferParameteriv,glGetShaderInfoLog:_glGetShaderInfoLog,glGetShaderPrecisionFormat:_glGetShaderPrecisionFormat,glGetShaderSource:_glGetShaderSource,glGetShaderiv:_glGetShaderiv,glGetString:_glGetString,glGetTexParameterfv:_glGetTexParameterfv,glGetTexParameteriv:_glGetTexParameteriv,glGetUniformLocation:_glGetUniformLocation,glGetUniformfv:_glGetUniformfv,glGetUniformiv:_glGetUniformiv,glGetVertexAttribPointerv:_glGetVertexAttribPointerv,glGetVertexAttribfv:_glGetVertexAttribfv,glGetVertexAttribiv:_glGetVertexAttribiv,glHint:_glHint,glIsBuffer:_glIsBuffer,glIsEnabled:_glIsEnabled,glIsFramebuffer:_glIsFramebuffer,glIsProgram:_glIsProgram,glIsQueryEXT:_glIsQueryEXT,glIsRenderbuffer:_glIsRenderbuffer,glIsShader:_glIsShader,glIsTexture:_glIsTexture,glIsVertexArray:_glIsVertexArray,glIsVertexArrayOES:_glIsVertexArrayOES,glLineWidth:_glLineWidth,glLinkProgram:_glLinkProgram,glLoadIdentity:_glLoadIdentity,glMatrixMode:_glMatrixMode,glMultiDrawArrays:_glMultiDrawArrays,glMultiDrawArraysANGLE:_glMultiDrawArraysANGLE,glMultiDrawArraysInstancedANGLE:_glMultiDrawArraysInstancedANGLE,glMultiDrawArraysInstancedWEBGL:_glMultiDrawArraysInstancedWEBGL,glMultiDrawArraysWEBGL:_glMultiDrawArraysWEBGL,glMultiDrawElements:_glMultiDrawElements,glMultiDrawElementsANGLE:_glMultiDrawElementsANGLE,glMultiDrawElementsInstancedANGLE:_glMultiDrawElementsInstancedANGLE,glMultiDrawElementsInstancedWEBGL:_glMultiDrawElementsInstancedWEBGL,glMultiDrawElementsWEBGL:_glMultiDrawElementsWEBGL,glPixelStorei:_glPixelStorei,glPolygonModeWEBGL:_glPolygonModeWEBGL,glPolygonOffset:_glPolygonOffset,glPolygonOffsetClampEXT:_glPolygonOffsetClampEXT,glQueryCounterEXT:_glQueryCounterEXT,glReadPixels:_glReadPixels,glReleaseShaderCompiler:_glReleaseShaderCompiler,glRenderbufferStorage:_glRenderbufferStorage,glSampleCoverage:_glSampleCoverage,glScissor:_glScissor,glShaderBinary:_glShaderBinary,glShaderSource:_glShaderSource,glStencilFunc:_glStencilFunc,glStencilFuncSeparate:_glStencilFuncSeparate,glStencilMask:_glStencilMask,glStencilMaskSeparate:_glStencilMaskSeparate,glStencilOp:_glStencilOp,glStencilOpSeparate:_glStencilOpSeparate,glTexImage2D:_glTexImage2D,glTexParameterf:_glTexParameterf,glTexParameterfv:_glTexParameterfv,glTexParameteri:_glTexParameteri,glTexParameteriv:_glTexParameteriv,glTexSubImage2D:_glTexSubImage2D,glUniform1f:_glUniform1f,glUniform1fv:_glUniform1fv,glUniform1i:_glUniform1i,glUniform1iv:_glUniform1iv,glUniform2f:_glUniform2f,glUniform2fv:_glUniform2fv,glUniform2i:_glUniform2i,glUniform2iv:_glUniform2iv,glUniform3f:_glUniform3f,glUniform3fv:_glUniform3fv,glUniform3i:_glUniform3i,glUniform3iv:_glUniform3iv,glUniform4f:_glUniform4f,glUniform4fv:_glUniform4fv,glUniform4i:_glUniform4i,glUniform4iv:_glUniform4iv,glUniformMatrix2fv:_glUniformMatrix2fv,glUniformMatrix3fv:_glUniformMatrix3fv,glUniformMatrix4fv:_glUniformMatrix4fv,glUseProgram:_glUseProgram,glValidateProgram:_glValidateProgram,glVertexAttrib1f:_glVertexAttrib1f,glVertexAttrib1fv:_glVertexAttrib1fv,glVertexAttrib2f:_glVertexAttrib2f,glVertexAttrib2fv:_glVertexAttrib2fv,glVertexAttrib3f:_glVertexAttrib3f,glVertexAttrib3fv:_glVertexAttrib3fv,glVertexAttrib4f:_glVertexAttrib4f,glVertexAttrib4fv:_glVertexAttrib4fv,glVertexAttribDivisor:_glVertexAttribDivisor,glVertexAttribDivisorANGLE:_glVertexAttribDivisorANGLE,glVertexAttribDivisorARB:_glVertexAttribDivisorARB,glVertexAttribDivisorEXT:_glVertexAttribDivisorEXT,glVertexAttribDivisorNV:_glVertexAttribDivisorNV,glVertexAttribPointer:_glVertexAttribPointer,glVertexPointer:_glVertexPointer,glViewport:_glViewport,glewGetErrorString:_glewGetErrorString,glewGetExtension:_glewGetExtension,glewGetString:_glewGetString,glewInit:_glewInit,glewIsSupported:_glewIsSupported,glutCreateWindow:_glutCreateWindow,glutDestroyWindow:_glutDestroyWindow,glutDisplayFunc:_glutDisplayFunc,glutFullScreen:_glutFullScreen,glutGet:_glutGet,glutGetModifiers:_glutGetModifiers,glutIdleFunc:_glutIdleFunc,glutInit:_glutInit,glutInitDisplayMode:_glutInitDisplayMode,glutInitWindowPosition:_glutInitWindowPosition,glutInitWindowSize:_glutInitWindowSize,glutKeyboardFunc:_glutKeyboardFunc,glutKeyboardUpFunc:_glutKeyboardUpFunc,glutMainLoop:_glutMainLoop,glutMotionFunc:_glutMotionFunc,glutMouseFunc:_glutMouseFunc,glutPassiveMotionFunc:_glutPassiveMotionFunc,glutPositionWindow:_glutPositionWindow,glutPostRedisplay:_glutPostRedisplay,glutReshapeFunc:_glutReshapeFunc,glutReshapeWindow:_glutReshapeWindow,glutSetCursor:_glutSetCursor,glutSpecialFunc:_glutSpecialFunc,glutSpecialUpFunc:_glutSpecialUpFunc,glutSwapBuffers:_glutSwapBuffers,glutTimerFunc:_glutTimerFunc,invoke_dd,invoke_di,invoke_dii,invoke_diii,invoke_diiid,invoke_diiii,invoke_diiiid,invoke_diiiiid,invoke_diiji,invoke_dij,invoke_dijjjj,invoke_dijjjjij,invoke_dj,invoke_ff,invoke_fi,invoke_fiii,invoke_fiiii,invoke_fiiji,invoke_fijjjj,invoke_fijjjjij,invoke_i,invoke_id,invoke_idd,invoke_idi,invoke_idii,invoke_idiii,invoke_idiiii,invoke_if,invoke_iff,invoke_ifi,invoke_ifii,invoke_ii,invoke_iid,invoke_iidi,invoke_iidii,invoke_iidiii,invoke_iidiiii,invoke_iidj,invoke_iif,invoke_iifii,invoke_iii,invoke_iiid,invoke_iiidi,invoke_iiidj,invoke_iiii,invoke_iiiid,invoke_iiiidjj,invoke_iiiii,invoke_iiiiid,invoke_iiiiii,invoke_iiiiiid,invoke_iiiiiii,invoke_iiiiiiii,invoke_iiiiiiiii,invoke_iiiiiiiiii,invoke_iiiiiiiiiii,invoke_iiiiiiiiiiii,invoke_iiiiiiiiiiiii,invoke_iiiiiiiiiiiiii,invoke_iiiiiiiiiiiiiiiii,invoke_iiiiiiiiiiiiiiiiii,invoke_iiiiiiiiiijii,invoke_iiiiiiiiiijiiiiiii,invoke_iiiiiiiiiji,invoke_iiiiiiiij,invoke_iiiiiiij,invoke_iiiiiiiji,invoke_iiiiiiijii,invoke_iiiiiiijj,invoke_iiiiiiijjjjjjii,invoke_iiiiiij,invoke_iiiiiiji,invoke_iiiiiijji,invoke_iiiiiijjiiiiiii,invoke_iiiiiijjiijjji,invoke_iiiiij,invoke_iiiiiji,invoke_iiiiijii,invoke_iiiiijiii,invoke_iiiiijiiii,invoke_iiiiijij,invoke_iiiiijj,invoke_iiiij,invoke_iiiiji,invoke_iiiijii,invoke_iiiijiii,invoke_iiiijiijjiii,invoke_iiiijj,invoke_iiiijji,invoke_iiiijjii,invoke_iiiijjiii,invoke_iiiijjj,invoke_iiiijjjj,invoke_iiij,invoke_iiiji,invoke_iiijii,invoke_iiijiii,invoke_iiijiiiii,invoke_iiijiiiij,invoke_iiijiiiijj,invoke_iiijiiij,invoke_iiijiiiji,invoke_iiijiiijj,invoke_iiijiij,invoke_iiijiijj,invoke_iiijij,invoke_iiijijj,invoke_iiijj,invoke_iiijji,invoke_iiijjii,invoke_iiijjiii,invoke_iiijjijj,invoke_iiijjijjiii,invoke_iiijjj,invoke_iiijjji,invoke_iiijjjj,invoke_iij,invoke_iiji,invoke_iijii,invoke_iijiii,invoke_iijiiii,invoke_iijiiiiiij,invoke_iijiiijj,invoke_iijiiji,invoke_iijiijj,invoke_iijij,invoke_iijiji,invoke_iijj,invoke_iijji,invoke_iijjii,invoke_iijjiii,invoke_iijjiiiii,invoke_iijjj,invoke_iijjjj,invoke_ij,invoke_iji,invoke_ijii,invoke_ijji,invoke_ijjiii,invoke_ijjj,invoke_j,invoke_jd,invoke_jf,invoke_ji,invoke_jii,invoke_jiii,invoke_jiiii,invoke_jiiiii,invoke_jiiiiii,invoke_jiiiiiii,invoke_jiiiiijiiii,invoke_jiiiij,invoke_jiiiiji,invoke_jiiiijii,invoke_jiiiijiiii,invoke_jiiiijiiiii,invoke_jiiij,invoke_jiiiji,invoke_jiiijii,invoke_jiiijiii,invoke_jiiijiijiii,invoke_jiiijj,invoke_jiiijjj,invoke_jiij,invoke_jiiji,invoke_jiijiiii,invoke_jiijj,invoke_jiijjjii,invoke_jij,invoke_jiji,invoke_jijij,invoke_jijj,invoke_jijjij,invoke_jijjjj,invoke_jj,invoke_jji,invoke_jjj,invoke_jjjd,invoke_jjjji,invoke_v,invoke_vi,invoke_vid,invoke_viddddi,invoke_vidi,invoke_vidii,invoke_vif,invoke_vifi,invoke_vifii,invoke_vii,invoke_viid,invoke_viiddji,invoke_viif,invoke_viii,invoke_viiid,invoke_viiidi,invoke_viiidii,invoke_viiifi,invoke_viiii,invoke_viiiii,invoke_viiiiii,invoke_viiiiiii,invoke_viiiiiiii,invoke_viiiiiiiii,invoke_viiiiiiiiii,invoke_viiiiiiiiiii,invoke_viiiiiiiiiiii,invoke_viiiiiiiiiiiii,invoke_viiiiiiiiiiiiiii,invoke_viiiiiiij,invoke_viiiiiiijjjji,invoke_viiiiiij,invoke_viiiiiijii,invoke_viiiiij,invoke_viiiiiji,invoke_viiiiijii,invoke_viiiiijiii,invoke_viiiiijiiii,invoke_viiiiijiijii,invoke_viiiiijj,invoke_viiiiijjii,invoke_viiiiijjji,invoke_viiiij,invoke_viiiiji,invoke_viiiijii,invoke_viiiijiii,invoke_viiiijiiii,invoke_viiiijiiiii,invoke_viiiijiiiiiiii,invoke_viiiijiijjii,invoke_viiiijijji,invoke_viiiijijjj,invoke_viiiijj,invoke_viiiijji,invoke_viiiijjij,invoke_viiij,invoke_viiijd,invoke_viiiji,invoke_viiijii,invoke_viiijiii,invoke_viiijiiii,invoke_viiijiiiijjj,invoke_viiijiiijii,invoke_viiijiij,invoke_viiijij,invoke_viiijijij,invoke_viiijijj,invoke_viiijijjj,invoke_viiijj,invoke_viiijji,invoke_viiijjii,invoke_viiijjiii,invoke_viiijjij,invoke_viiijjijj,invoke_viiijjj,invoke_viiijjjj,invoke_viij,invoke_viijd,invoke_viiji,invoke_viijii,invoke_viijiii,invoke_viijiiii,invoke_viijiiiii,invoke_viijiiiiii,invoke_viijiiiij,invoke_viijiiij,invoke_viijiiijj,invoke_viijiij,invoke_viijiiji,invoke_viijiijj,invoke_viijiijji,invoke_viijij,invoke_viijiji,invoke_viijijiiii,invoke_viijijiiiijjj,invoke_viijijj,invoke_viijj,invoke_viijji,invoke_viijjii,invoke_viijjj,invoke_viijjji,invoke_viijjjji,invoke_vij,invoke_viji,invoke_vijii,invoke_vijiii,invoke_vijiiii,invoke_vijiiiii,invoke_vijiiiiii,invoke_vijiiiiji,invoke_vijiiiji,invoke_vijiij,invoke_vijiji,invoke_vijijiiiijjj,invoke_vijijiij,invoke_vijijj,invoke_vijijjji,invoke_vijj,invoke_vijji,invoke_vijjiii,invoke_vijjij,invoke_vijjj,invoke_vijjji,invoke_vijjjiiji,invoke_vijjjj,invoke_vj,invoke_vji,invoke_vjii,invoke_vjiii,invoke_vjiiii,invoke_vjiiij,invoke_vjjii,invoke_vjjijij,lineColor:_lineColor,lineRGBA:_lineRGBA,llvm_eh_typeid_for:_llvm_eh_typeid_for,memory:wasmMemory,pixelRGBA:_pixelRGBA,proc_exit:_proc_exit,pthread_kill:_pthread_kill,random_get:_random_get,rectangleColor:_rectangleColor,rectangleRGBA:_rectangleRGBA,rotozoomSurface:_rotozoomSurface,setNetworkCallback:_setNetworkCallback,setprotoent:_setprotoent,stackAlloc:_stackAlloc,stackRestore:_stackRestore,stackSave:_stackSave,strptime:_strptime,strptime_l:_strptime_l,uuid_clear:_uuid_clear,uuid_compare:_uuid_compare,uuid_copy:_uuid_copy,uuid_generate:_uuid_generate,uuid_is_null:_uuid_is_null,uuid_parse:_uuid_parse,uuid_type:_uuid_type,uuid_unparse:_uuid_unparse,uuid_unparse_lower:_uuid_unparse_lower,uuid_unparse_upper:_uuid_unparse_upper,uuid_variant:_uuid_variant,zoomSurface:_zoomSurface},wasmExports=createWasm(),__emval_coro_resume=(e,t)=>(__emval_coro_resume=wasmExports._emval_coro_resume)(e,t);Module._main=(e,t)=>(Module._main=wasmExports.main)(e,t),Module._duckdb_web_fs_glob_add_path=e=>(Module._duckdb_web_fs_glob_add_path=wasmExports.duckdb_web_fs_glob_add_path)(e),Module._duckdb_web_clear_response=()=>(Module._duckdb_web_clear_response=wasmExports.duckdb_web_clear_response)(),Module._duckdb_web_fail_with=e=>(Module._duckdb_web_fail_with=wasmExports.duckdb_web_fail_with)(e),Module._duckdb_web_reset=e=>(Module._duckdb_web_reset=wasmExports.duckdb_web_reset)(e),Module._duckdb_web_connect=()=>(Module._duckdb_web_connect=wasmExports.duckdb_web_connect)(),Module._duckdb_web_disconnect=e=>(Module._duckdb_web_disconnect=wasmExports.duckdb_web_disconnect)(e),Module._duckdb_web_flush_files=()=>(Module._duckdb_web_flush_files=wasmExports.duckdb_web_flush_files)(),Module._duckdb_web_flush_file=e=>(Module._duckdb_web_flush_file=wasmExports.duckdb_web_flush_file)(e),Module._duckdb_web_open=(e,t)=>(Module._duckdb_web_open=wasmExports.duckdb_web_open)(e,t),Module._duckdb_web_get_global_file_info=(e,t)=>(Module._duckdb_web_get_global_file_info=wasmExports.duckdb_web_get_global_file_info)(e,t),Module._duckdb_web_collect_file_stats=(e,t,r)=>(Module._duckdb_web_collect_file_stats=wasmExports.duckdb_web_collect_file_stats)(e,t,r),Module._duckdb_web_export_file_stats=(e,t)=>(Module._duckdb_web_export_file_stats=wasmExports.duckdb_web_export_file_stats)(e,t),Module._duckdb_web_fs_drop_file=(e,t)=>(Module._duckdb_web_fs_drop_file=wasmExports.duckdb_web_fs_drop_file)(e,t),Module._duckdb_web_fs_drop_files=e=>(Module._duckdb_web_fs_drop_files=wasmExports.duckdb_web_fs_drop_files)(e),Module._duckdb_web_fs_glob_file_infos=(e,t)=>(Module._duckdb_web_fs_glob_file_infos=wasmExports.duckdb_web_fs_glob_file_infos)(e,t),Module._duckdb_web_fs_get_file_info_by_id=(e,t,r)=>(Module._duckdb_web_fs_get_file_info_by_id=wasmExports.duckdb_web_fs_get_file_info_by_id)(e,t,r),Module._duckdb_web_fs_get_file_info_by_name=(e,t,r)=>(Module._duckdb_web_fs_get_file_info_by_name=wasmExports.duckdb_web_fs_get_file_info_by_name)(e,t,r),Module._duckdb_web_fs_register_file_url=(e,t,r,n,a)=>(Module._duckdb_web_fs_register_file_url=wasmExports.duckdb_web_fs_register_file_url)(e,t,r,n,a),Module._duckdb_web_fs_register_file_buffer=(e,t,r,n)=>(Module._duckdb_web_fs_register_file_buffer=wasmExports.duckdb_web_fs_register_file_buffer)(e,t,r,n),Module._duckdb_web_copy_file_to_buffer=(e,t)=>(Module._duckdb_web_copy_file_to_buffer=wasmExports.duckdb_web_copy_file_to_buffer)(e,t),Module._duckdb_web_copy_file_to_path=(e,t,r)=>(Module._duckdb_web_copy_file_to_path=wasmExports.duckdb_web_copy_file_to_path)(e,t,r),Module._duckdb_web_get_version=e=>(Module._duckdb_web_get_version=wasmExports.duckdb_web_get_version)(e),Module._duckdb_web_get_feature_flags=()=>(Module._duckdb_web_get_feature_flags=wasmExports.duckdb_web_get_feature_flags)(),Module._duckdb_web_tokenize=(e,t)=>(Module._duckdb_web_tokenize=wasmExports.duckdb_web_tokenize)(e,t),Module._duckdb_web_udf_scalar_create=(e,t,r)=>(Module._duckdb_web_udf_scalar_create=wasmExports.duckdb_web_udf_scalar_create)(e,t,r),Module._duckdb_web_prepared_create=(e,t,r)=>(Module._duckdb_web_prepared_create=wasmExports.duckdb_web_prepared_create)(e,t,r),Module._duckdb_web_prepared_close=(e,t,r)=>(Module._duckdb_web_prepared_close=wasmExports.duckdb_web_prepared_close)(e,t,r),Module._duckdb_web_prepared_run=(e,t,r,n)=>(Module._duckdb_web_prepared_run=wasmExports.duckdb_web_prepared_run)(e,t,r,n),Module._duckdb_web_prepared_send=(e,t,r,n)=>(Module._duckdb_web_prepared_send=wasmExports.duckdb_web_prepared_send)(e,t,r,n),Module._duckdb_web_query_run=(e,t,r)=>(Module._duckdb_web_query_run=wasmExports.duckdb_web_query_run)(e,t,r),Module._duckdb_web_query_run_buffer=(e,t,r,n)=>(Module._duckdb_web_query_run_buffer=wasmExports.duckdb_web_query_run_buffer)(e,t,r,n),Module._duckdb_web_pending_query_start=(e,t,r)=>(Module._duckdb_web_pending_query_start=wasmExports.duckdb_web_pending_query_start)(e,t,r),Module._duckdb_web_pending_query_poll=(e,t,r)=>(Module._duckdb_web_pending_query_poll=wasmExports.duckdb_web_pending_query_poll)(e,t,r),Module._duckdb_web_pending_query_cancel=(e,t)=>(Module._duckdb_web_pending_query_cancel=wasmExports.duckdb_web_pending_query_cancel)(e,t),Module._duckdb_web_query_fetch_results=(e,t)=>(Module._duckdb_web_query_fetch_results=wasmExports.duckdb_web_query_fetch_results)(e,t),Module._duckdb_web_get_tablenames=(e,t,r)=>(Module._duckdb_web_get_tablenames=wasmExports.duckdb_web_get_tablenames)(e,t,r),Module._duckdb_web_insert_arrow_from_ipc_stream=(e,t,r,n,a)=>(Module._duckdb_web_insert_arrow_from_ipc_stream=wasmExports.duckdb_web_insert_arrow_from_ipc_stream)(e,t,r,n,a),Module._duckdb_web_insert_csv_from_path=(e,t,r,n)=>(Module._duckdb_web_insert_csv_from_path=wasmExports.duckdb_web_insert_csv_from_path)(e,t,r,n),Module._duckdb_web_insert_json_from_path=(e,t,r,n)=>(Module._duckdb_web_insert_json_from_path=wasmExports.duckdb_web_insert_json_from_path)(e,t,r,n);var ___dl_seterr=(e,t)=>(___dl_seterr=wasmExports.__dl_seterr)(e,t),__emscripten_timeout=(e,t)=>(__emscripten_timeout=wasmExports._emscripten_timeout)(e,t),_malloc=Module._malloc=e=>(_malloc=Module._malloc=wasmExports.malloc)(e),_free=Module._free=e=>(_free=Module._free=wasmExports.free)(e),_calloc=Module._calloc=(e,t)=>(_calloc=Module._calloc=wasmExports.calloc)(e,t),_emscripten_builtin_memalign=(e,t)=>(_emscripten_builtin_memalign=wasmExports.emscripten_builtin_memalign)(e,t),__emscripten_tempret_set=e=>(__emscripten_tempret_set=wasmExports._emscripten_tempret_set)(e),__emscripten_tempret_get=()=>(__emscripten_tempret_get=wasmExports._emscripten_tempret_get)(),__emscripten_stack_restore=e=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(e),__emscripten_stack_alloc=e=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(e),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)();function invoke_ii(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_vii(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viii(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiii(e,t,r,n,a){var o=stackSave();try{getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iii(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viiiiii(e,t,r,n,a,o,l){var u=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_dii(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viiiiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_iiiii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiiii(e,t,r,n,a,o){var l=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiiiiii(e,t,r,n,a,o,l){var u=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiiiiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_v(e){var t=stackSave();try{getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}function invoke_iiiiiiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiii(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viif(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viid(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iid(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_diiii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiiiiid(e,t,r,n,a,o,l){var u=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_di(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_id(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_vid(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_vif(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_iiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiiiiiiii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiid(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiid(e,t,r,n,a){var o=stackSave();try{getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiiiiiiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S){var L=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S)}catch(T){if(stackRestore(L),T!==T+0)throw T;_setThrew(1,0)}}function invoke_iidii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiiiiiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v){var S=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v)}catch(L){if(stackRestore(S),L!==L+0)throw L;_setThrew(1,0)}}function invoke_fi(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_vifi(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_vidi(e,t,r,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_ff(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_dd(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_iiiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h){var g=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p,f,m,h)}catch(b){if(stackRestore(g),b!==b+0)throw b;_setThrew(1,0)}}function invoke_iiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_viddddi(e,t,r,n,a,o,l){var u=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_diiiiid(e,t,r,n,a,o,l){var u=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiid(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_idiii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiidi(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiidii(e,t,r,n,a,o,l){var u=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h){var g=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p,f,m,h)}catch(b){if(stackRestore(g),b!==b+0)throw b;_setThrew(1,0)}}function invoke_viiiiiiiii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iff(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_idd(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_diiiid(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_if(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_ifii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_idii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_ifi(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_idi(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_idiiii(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_diii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_diiid(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iifii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iidiii(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iidiiii(e,t,r,n,a,o,l){var u=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iidi(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_vifii(e,t,r,n,a){var o=stackSave();try{getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_vidii(e,t,r,n,a){var o=stackSave();try{getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iif(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_fiiii(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiifi(e,t,r,n,a,o){var l=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiidi(e,t,r,n,a,o){var l=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiiiid(e,t,r,n,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_fiii(e,t,r,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b){var v=stackSave();try{getWasmTableEntry(e)(t,r,n,a,o,l,u,_,d,p,f,m,h,g,b)}catch(S){if(stackRestore(v),S!==S+0)throw S;_setThrew(1,0)}}function invoke_viji(e,t,r,n,a){var o=stackSave();try{Module.dynCall_viji(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_ji(e,t){var r=stackSave();try{return Module.dynCall_ji(e,t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_viijii(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viijii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iij(e,t,r,n){var a=stackSave();try{return Module.dynCall_iij(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iiijiijj(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iiijiijj(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viij(e,t,r,n,a){var o=stackSave();try{Module.dynCall_viij(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiijj(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iiijj(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiijj(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiijj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_jii(e,t,r){var n=stackSave();try{return Module.dynCall_jii(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_vij(e,t,r,n){var a=stackSave();try{Module.dynCall_vij(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iiijii(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iiijii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiij(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_iiij(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiij(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_viiij(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiji(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_viiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viijijj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viijijj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viijiijj(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_viijiijj(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiij(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iiiij(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viijiii(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viijiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iiiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiji(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_iiji(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_jiiij(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jiiij(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiiji(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viiiji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_jj(e,t,r){var n=stackSave();try{return Module.dynCall_jj(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_iijji(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iijji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiij(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iiiiij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiijjj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiijjj(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiijjj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viiijjj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiiij(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiiiiij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_jiiiii(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jiiiii(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iijiii(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iijiii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_dij(e,t,r,n){var a=stackSave();try{return Module.dynCall_dij(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iijii(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iijii(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_vijji(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_vijji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiijj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiiijj(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiiij(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viiiij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiijii(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiijii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiijii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiiijii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiiijii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiiijii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jij(e,t,r,n){var a=stackSave();try{return Module.dynCall_jij(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_iiiijj(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiiijj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiiijii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiiijii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iijiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iijiiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijiii(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_vijiii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iijjiiiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iijjiiiii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiijjiii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiijjiii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiijjii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiijjii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiii(e,t,r,n){var a=stackSave();try{return Module.dynCall_jiii(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_vjjii(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_vjjii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiiiijii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viiiiijii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiiiij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiiiiij(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiiijj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiiijj(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_vijiiiiii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_vijiiiiii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_vijiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vijiiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijiiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijiiiii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iijjiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iijjiii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_ij(e,t,r){var n=stackSave();try{return Module.dynCall_ij(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_vijj(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_vijj(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiiiji(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iiiiji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_ijji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_ijji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viijd(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_viijd(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiijd(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viiijd(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiiiiji(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiiiiiiji(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiiji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiiiiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vj(e,t,r){var n=stackSave();try{Module.dynCall_vj(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viiiiiij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiiiiij(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiiijiiiii(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viiiijiiiii(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiiijiiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_viiiijiiii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_vijii(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_vijii(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_dj(e,t,r){var n=stackSave();try{return Module.dynCall_dj(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}function invoke_viijji(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viijji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viijj(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_viijj(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_viiiiijiiii(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viiiiijiiii(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viijiiiii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viijiiiii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_vijiji(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vijiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijjij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijjij(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jijij(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jijij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_ijjj(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_ijjj(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_jjjd(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jjjd(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_vjii(e,t,r,n,a){var o=stackSave();try{Module.dynCall_vjii(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_vjiiii(e,t,r,n,a,o,l){var u=stackSave();try{Module.dynCall_vjiiii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_jiiii(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_jiiii(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiiiijiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_viiiiijiii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiijiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g){var b=stackSave();try{Module.dynCall_viiiijiiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g)}catch(v){if(stackRestore(b),v!==v+0)throw v;_setThrew(1,0)}}function invoke_jjj(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_jjj(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_jjjji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jjjji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viijij(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viijij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iijjjj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iijjjj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viijjj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijjj(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viijiiiiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_viijiiiiii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_j(e){var t=stackSave();try{return Module.dynCall_j(e)}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}function invoke_jji(e,t,r,n){var a=stackSave();try{return Module.dynCall_jji(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_fijjjj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_fijjjj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_dijjjj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_dijjjj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_fijjjjij(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{return Module.dynCall_fijjjjij(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_dijjjjij(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{return Module.dynCall_dijjjjij(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_jiiiij(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jiiiij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_ijjiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_ijjiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiiiiijii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iiiiiiijii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_jiiji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jiiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_fiiji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_fiiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_diiji(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_diiji(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viijjji(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viijjji(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiddji(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiddji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iji(e,t,r,n){var a=stackSave();try{return Module.dynCall_iji(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiiijijjj(e,t,r,n,a,o,l,u,_,d,p,f,m,h){var g=stackSave();try{Module.dynCall_viiiijijjj(e,t,r,n,a,o,l,u,_,d,p,f,m,h)}catch(b){if(stackRestore(g),b!==b+0)throw b;_setThrew(1,0)}}function invoke_viiiiij(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiiiij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiiiji(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_viiiiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iijiji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iijiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijjji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijjji(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_vjiiij(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vjiiij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viijjjji(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viijjjji(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijijj(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_viiijijj(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiijijij(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viiijijij(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiijij(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiij(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_jiij(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_viiiiiji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiiiiji(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiijiii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiiiijiii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiiiiii(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jiiiiii(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiijiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiijiii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiiiiiij(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viiiiiiij(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiijiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiijiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiiiiiiij(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiiiiiiij(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iijj(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iijj(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiijjij(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_viiijjij(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_vijijiij(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_vijijiij(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viijiiiij(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_viijiiiij(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiijiiiijjj(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b){var v=stackSave();try{Module.dynCall_viiijiiiijjj(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b)}catch(S){if(stackRestore(v),S!==S+0)throw S;_setThrew(1,0)}}function invoke_viijijiiiijjj(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S){var L=stackSave();try{Module.dynCall_viijijiiiijjj(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S)}catch(T){if(stackRestore(L),T!==T+0)throw T;_setThrew(1,0)}}function invoke_viiijiij(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viiijiij(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiiijiijiii(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{return Module.dynCall_jiiijiijiii(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_viijijiiii(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viijijiiii(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jiiijiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_jiiijiii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiiijii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jiiijii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iijjj(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iijjj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiijji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiijji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijijiiiijjj(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v){var S=stackSave();try{Module.dynCall_vijijiiiijjj(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v)}catch(L){if(stackRestore(S),L!==L+0)throw L;_setThrew(1,0)}}function invoke_viiiiijj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viiiiijj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiiiiji(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jiiiiji(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiiijijji(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{Module.dynCall_viiiijijji(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_viiiijjij(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viiiijjij(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijiiii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viiijiiii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiijiiijii(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{Module.dynCall_viiijiiijii(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_vijjj(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vijjj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_vijijj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijijj(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viiijjjj(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viiijjjj(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jd(e,t){var r=stackSave();try{return Module.dynCall_jd(e,t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_jf(e,t){var r=stackSave();try{return Module.dynCall_jf(e,t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}function invoke_viiiiijjii(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viiiiijjii(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiiiiijii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_viiiiiijii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiiiiijjjji(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v){var S=stackSave();try{Module.dynCall_viiiiiiijjjji(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v)}catch(L){if(stackRestore(S),L!==L+0)throw L;_setThrew(1,0)}}function invoke_vji(e,t,r,n){var a=stackSave();try{Module.dynCall_vji(e,t,r,n)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}function invoke_viiijjiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_viiijjiii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_jiijj(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jiijj(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_jiiiiijiiii(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{return Module.dynCall_jiiiiijiiii(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jiiiijii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_jiiiijii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiijiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_jiijiiii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viijjii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijjii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiijjiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iiiijjiii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiijijj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiijijj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiiiji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiiiiji(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiijjjj(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{return Module.dynCall_iiiijjjj(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_iiijiij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiijiij(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iijiiiiiij(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{return Module.dynCall_iijiiiiiij(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viijiijji(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viijiijji(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiiijiijjii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g){var b=stackSave();try{Module.dynCall_viiiijiijjii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g)}catch(v){if(stackRestore(b),v!==v+0)throw v;_setThrew(1,0)}}function invoke_viijiiji(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viijiiji(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiiijjiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v){var S=stackSave();try{return Module.dynCall_iiiiiijjiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v)}catch(L){if(stackRestore(S),L!==L+0)throw L;_setThrew(1,0)}}function invoke_iiiiijiiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iiiiijiiii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiijiijjiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g){var b=stackSave();try{return Module.dynCall_iiiijiijjiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g)}catch(v){if(stackRestore(b),v!==v+0)throw v;_setThrew(1,0)}}function invoke_iiidj(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_iiidj(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_iiiiiiiiiijii(e,t,r,n,a,o,l,u,_,d,p,f,m,h){var g=stackSave();try{return Module.dynCall_iiiiiiiiiijii(e,t,r,n,a,o,l,u,_,d,p,f,m,h)}catch(b){if(stackRestore(g),b!==b+0)throw b;_setThrew(1,0)}}function invoke_iiiiiiijj(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iiiiiiijj(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiijji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiijji(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiiijjj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_jiiijjj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiijij(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiiiijij(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jiiiiiii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jiiiiiii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiijiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiijiii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiiiijji(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iiiiiijji(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiiiiiiiiijiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S,L){var T=stackSave();try{return Module.dynCall_iiiiiiiiiijiiiiiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S,L)}catch(A){if(stackRestore(T),A!==A+0)throw A;_setThrew(1,0)}}function invoke_iiiidjj(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iiiidjj(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiiijjj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiiijjj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiiiiiiiiji(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{return Module.dynCall_iiiiiiiiiji(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_iiijiiiij(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iiijiiiij(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiijiiij(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiijiiij(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iijjii(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iijjii(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_viiijji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viiijji(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_jiiiijiiii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_jiiiijiiii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_jiiiijiiiii(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{return Module.dynCall_jiiiijiiiii(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jiijjjii(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_jiijjjii(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiijji(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viiiijji(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_ijii(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_ijii(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_iiiiiiijjjjjjii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S,L,T,A){var M=stackSave();try{return Module.dynCall_iiiiiiijjjjjjii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S,L,T,A)}catch(X){if(stackRestore(M),X!==X+0)throw X;_setThrew(1,0)}}function invoke_iiijjijj(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{return Module.dynCall_iiijjijj(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijjijj(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{Module.dynCall_viiijjijj(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_iijij(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_iijij(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_vjiii(e,t,r,n,a,o){var l=stackSave();try{Module.dynCall_vjiii(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_jiiijj(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_jiiijj(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iiijij(e,t,r,n,a,o,l,u){var _=stackSave();try{return Module.dynCall_iiijij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_iidj(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_iidj(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function invoke_vjjijij(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_vjjijij(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_jiiiji(e,t,r,n,a,o,l){var u=stackSave();try{return Module.dynCall_jiiiji(e,t,r,n,a,o,l)}catch(_){if(stackRestore(u),_!==_+0)throw _;_setThrew(1,0)}}function invoke_iiiiiijjiijjji(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S,L){var T=stackSave();try{return Module.dynCall_iiiiiijjiijjji(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g,b,v,S,L)}catch(A){if(stackRestore(T),A!==A+0)throw A;_setThrew(1,0)}}function invoke_iiijjijjiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g){var b=stackSave();try{return Module.dynCall_iiijjijjiii(e,t,r,n,a,o,l,u,_,d,p,f,m,h,g)}catch(v){if(stackRestore(b),v!==v+0)throw v;_setThrew(1,0)}}function invoke_iiiijjii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiiijjii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiijjii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viiijjii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiijjjj(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iiijjjj(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viijiiij(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viijiiij(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_vijiiiji(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_vijiiiji(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_jijjij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_jijjij(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_viijiij(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijiij(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiijiiiji(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iiijiiiji(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iijiiji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{return Module.dynCall_iijiiji(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iijiijj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iijiijj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_vijjjj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_vijjjj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viiiiijiijii(e,t,r,n,a,o,l,u,_,d,p,f,m,h){var g=stackSave();try{Module.dynCall_viiiiijiijii(e,t,r,n,a,o,l,u,_,d,p,f,m,h)}catch(b){if(stackRestore(g),b!==b+0)throw b;_setThrew(1,0)}}function invoke_jijj(e,t,r,n,a,o){var l=stackSave();try{return Module.dynCall_jijj(e,t,r,n,a,o)}catch(u){if(stackRestore(l),u!==u+0)throw u;_setThrew(1,0)}}function invoke_viiiiijjji(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{Module.dynCall_viiiiijjji(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_iiijiiijj(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{return Module.dynCall_iiijiiijj(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_viiijijjj(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{Module.dynCall_viiijijjj(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_vijijjji(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_vijijjji(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_vijiij(e,t,r,n,a,o,l,u){var _=stackSave();try{Module.dynCall_vijiij(e,t,r,n,a,o,l,u)}catch(d){if(stackRestore(_),d!==d+0)throw d;_setThrew(1,0)}}function invoke_jijjjj(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_jijjjj(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_iiijiiiijj(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{return Module.dynCall_iiijiiiijj(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_iijiiijj(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{return Module.dynCall_iijiiijj(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_iiijiiiii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiijiiiii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_vijjjiiji(e,t,r,n,a,o,l,u,_,d,p,f,m){var h=stackSave();try{Module.dynCall_vijjjiiji(e,t,r,n,a,o,l,u,_,d,p,f,m)}catch(g){if(stackRestore(h),g!==g+0)throw g;_setThrew(1,0)}}function invoke_viijiji(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijiji(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_vijiiiiji(e,t,r,n,a,o,l,u,_,d,p){var f=stackSave();try{Module.dynCall_vijiiiiji(e,t,r,n,a,o,l,u,_,d,p)}catch(m){if(stackRestore(f),m!==m+0)throw m;_setThrew(1,0)}}function invoke_viiiijiii(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{Module.dynCall_viiiijiii(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viijiiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_viijiiii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_vijjiii(e,t,r,n,a,o,l,u,_){var d=stackSave();try{Module.dynCall_vijjiii(e,t,r,n,a,o,l,u,_)}catch(p){if(stackRestore(d),p!==p+0)throw p;_setThrew(1,0)}}function invoke_iiijjji(e,t,r,n,a,o,l,u,_,d){var p=stackSave();try{return Module.dynCall_iiijjji(e,t,r,n,a,o,l,u,_,d)}catch(f){if(stackRestore(p),f!==f+0)throw f;_setThrew(1,0)}}function invoke_viijiiijj(e,t,r,n,a,o,l,u,_,d,p,f){var m=stackSave();try{Module.dynCall_viijiiijj(e,t,r,n,a,o,l,u,_,d,p,f)}catch(h){if(stackRestore(m),h!==h+0)throw h;_setThrew(1,0)}}function invoke_jiji(e,t,r,n,a){var o=stackSave();try{return Module.dynCall_jiji(e,t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}function applySignatureConversions(e){e=Object.assign({},e);var t=u=>_=>u(_)>>>0,r=u=>()=>u()>>>0,n=u=>(_,d,p)=>u(_,d,p)>>>0,a=u=>(_,d)=>u(_,d)>>>0,o=u=>_=>u(_)>>>0,l=u=>_=>u(_)>>>0;return e.__getTypeName=t(e.__getTypeName),e.pthread_self=r(e.pthread_self),e.memcpy=n(e.memcpy),e.malloc=t(e.malloc),e.calloc=a(e.calloc),e.__errno_location=r(e.__errno_location),e.strerror=o(e.strerror),e.emscripten_builtin_malloc=t(e.emscripten_builtin_malloc),e.emscripten_stack_get_base=r(e.emscripten_stack_get_base),e.emscripten_stack_get_end=r(e.emscripten_stack_get_end),e.emscripten_builtin_memalign=a(e.emscripten_builtin_memalign),e.emscripten_stack_get_current=r(e.emscripten_stack_get_current),e.emscripten_main_runtime_thread_id=r(e.emscripten_main_runtime_thread_id),e.sbrk=l(e.sbrk),e.memalign=a(e.memalign),e.emscripten_builtin_calloc=a(e.emscripten_builtin_calloc),e._emscripten_stack_alloc=t(e._emscripten_stack_alloc),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}Module.stackSave=stackSave,Module.stackRestore=stackRestore,Module.stackAlloc=stackAlloc,Module.ccall=ccall;var calledRun;dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)};function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc((r+1)*4),a=n;e.forEach(l=>{HEAPU32[a>>>2>>>0]=stringToUTF8OnStack(l),a+=4}),HEAPU32[a>>>2>>>0]=0;try{var o=t(r,n);return exitJS(o,!0),o}catch(l){return handleException(l)}}}function run(e=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function t(){var r;calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),readyPromiseResolve(Module),(r=Module.onRuntimeInitialized)==null||r.call(Module),shouldRunNow&&callMain(e),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),run(),moduleRtn=readyPromise,moduleRtn}})();typeof exports=="object"&&typeof module=="object"&&(module.exports=DuckDB)}),Rl=fr(()=>{}),Gl=fr(()=>{}),Ul=fr((e,t)=>{(function(){var r="input is invalid type",n=typeof window=="object",a=n?window:{};a.JS_SHA256_NO_WINDOW&&(n=!1);var o=!n&&typeof self=="object",l=!a.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;l?a=commonjsGlobal:o&&(a=self);var u=!a.JS_SHA256_NO_COMMON_JS&&typeof t=="object"&&t.exports,_=!1,d=!a.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),f=[-2147483648,8388608,32768,128],m=[24,16,8,0],h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=["hex","array","digest","arrayBuffer"],b=[];(a.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(w){return Object.prototype.toString.call(w)==="[object Array]"}),d&&(a.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(w){return typeof w=="object"&&w.buffer&&w.buffer.constructor===ArrayBuffer});var v=function(w,E){return function(P){return new M(E,!0).update(P)[w]()}},S=function(w){var E=v("hex",w);l&&(E=L(E,w)),E.create=function(){return new M(w)},E.update=function(C){return E.create().update(C)};for(var P=0;P>>2]|=w[C]<>>2]|=k<>>2]|=(192|k>>>6)<>>2]|=(128|k&63)<=57344?(D[F>>>2]|=(224|k>>>12)<>>2]|=(128|k>>>6&63)<>>2]|=(128|k&63)<>>2]|=(240|k>>>18)<>>2]|=(128|k>>>12&63)<>>2]|=(128|k>>>6&63)<>>2]|=(128|k&63)<=64?(this.block=D[16],this.start=F-64,this.hash(),this.hashed=!0):this.start=F}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},M.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var w=this.blocks,E=this.lastByteIndex;w[16]=this.block,w[E>>>2]|=f[E&3],this.block=w[16],E>=56&&(this.hashed||this.hash(),w[0]=this.block,w[16]=w[1]=w[2]=w[3]=w[4]=w[5]=w[6]=w[7]=w[8]=w[9]=w[10]=w[11]=w[12]=w[13]=w[14]=w[15]=0),w[14]=this.hBytes<<3|this.bytes>>>29,w[15]=this.bytes<<3,this.hash()}},M.prototype.hash=function(){var w=this.h0,E=this.h1,P=this.h2,k=this.h3,C=this.h4,F=this.h5,U=this.h6,D=this.h7,I=this.blocks,Q,oe,we,_e,Z,Ie,ke,pt,To,xo,Wn;for(Q=16;Q<64;++Q)Z=I[Q-15],oe=(Z>>>7|Z<<25)^(Z>>>18|Z<<14)^Z>>>3,Z=I[Q-2],we=(Z>>>17|Z<<15)^(Z>>>19|Z<<13)^Z>>>10,I[Q]=I[Q-16]+oe+I[Q-7]+we<<0;for(Wn=E&P,Q=0;Q<64;Q+=4)this.first?(this.is224?(pt=300032,Z=I[0]-1413257819,D=Z-150054599<<0,k=Z+24177077<<0):(pt=704751109,Z=I[0]-210244248,D=Z-1521486534<<0,k=Z+143694565<<0),this.first=!1):(oe=(w>>>2|w<<30)^(w>>>13|w<<19)^(w>>>22|w<<10),we=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),pt=w&E,_e=pt^w&P^Wn,ke=C&F^~C&U,Z=D+we+ke+h[Q]+I[Q],Ie=oe+_e,D=k+Z<<0,k=Z+Ie<<0),oe=(k>>>2|k<<30)^(k>>>13|k<<19)^(k>>>22|k<<10),we=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),To=k&w,_e=To^k&E^pt,ke=D&C^~D&F,Z=U+we+ke+h[Q+1]+I[Q+1],Ie=oe+_e,U=P+Z<<0,P=Z+Ie<<0,oe=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),we=(U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7),xo=P&k,_e=xo^P&w^To,ke=U&D^~U&C,Z=F+we+ke+h[Q+2]+I[Q+2],Ie=oe+_e,F=E+Z<<0,E=Z+Ie<<0,oe=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),we=(F>>>6|F<<26)^(F>>>11|F<<21)^(F>>>25|F<<7),Wn=E&P,_e=Wn^E&k^xo,ke=F&U^~F&D,Z=C+we+ke+h[Q+3]+I[Q+3],Ie=oe+_e,C=w+Z<<0,w=Z+Ie<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+w<<0,this.h1=this.h1+E<<0,this.h2=this.h2+P<<0,this.h3=this.h3+k<<0,this.h4=this.h4+C<<0,this.h5=this.h5+F<<0,this.h6=this.h6+U<<0,this.h7=this.h7+D<<0},M.prototype.hex=function(){this.finalize();var w=this.h0,E=this.h1,P=this.h2,k=this.h3,C=this.h4,F=this.h5,U=this.h6,D=this.h7,I=p[w>>>28&15]+p[w>>>24&15]+p[w>>>20&15]+p[w>>>16&15]+p[w>>>12&15]+p[w>>>8&15]+p[w>>>4&15]+p[w&15]+p[E>>>28&15]+p[E>>>24&15]+p[E>>>20&15]+p[E>>>16&15]+p[E>>>12&15]+p[E>>>8&15]+p[E>>>4&15]+p[E&15]+p[P>>>28&15]+p[P>>>24&15]+p[P>>>20&15]+p[P>>>16&15]+p[P>>>12&15]+p[P>>>8&15]+p[P>>>4&15]+p[P&15]+p[k>>>28&15]+p[k>>>24&15]+p[k>>>20&15]+p[k>>>16&15]+p[k>>>12&15]+p[k>>>8&15]+p[k>>>4&15]+p[k&15]+p[C>>>28&15]+p[C>>>24&15]+p[C>>>20&15]+p[C>>>16&15]+p[C>>>12&15]+p[C>>>8&15]+p[C>>>4&15]+p[C&15]+p[F>>>28&15]+p[F>>>24&15]+p[F>>>20&15]+p[F>>>16&15]+p[F>>>12&15]+p[F>>>8&15]+p[F>>>4&15]+p[F&15]+p[U>>>28&15]+p[U>>>24&15]+p[U>>>20&15]+p[U>>>16&15]+p[U>>>12&15]+p[U>>>8&15]+p[U>>>4&15]+p[U&15];return this.is224||(I+=p[D>>>28&15]+p[D>>>24&15]+p[D>>>20&15]+p[D>>>16&15]+p[D>>>12&15]+p[D>>>8&15]+p[D>>>4&15]+p[D&15]),I},M.prototype.toString=M.prototype.hex,M.prototype.digest=function(){this.finalize();var w=this.h0,E=this.h1,P=this.h2,k=this.h3,C=this.h4,F=this.h5,U=this.h6,D=this.h7,I=[w>>>24&255,w>>>16&255,w>>>8&255,w&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255,F>>>24&255,F>>>16&255,F>>>8&255,F&255,U>>>24&255,U>>>16&255,U>>>8&255,U&255];return this.is224||I.push(D>>>24&255,D>>>16&255,D>>>8&255,D&255),I},M.prototype.array=M.prototype.digest,M.prototype.arrayBuffer=function(){this.finalize();var w=new ArrayBuffer(this.is224?28:32),E=new DataView(w);return E.setUint32(0,this.h0),E.setUint32(4,this.h1),E.setUint32(8,this.h2),E.setUint32(12,this.h3),E.setUint32(16,this.h4),E.setUint32(20,this.h5),E.setUint32(24,this.h6),this.is224||E.setUint32(28,this.h7),w};function X(w,E,P){var k,C=typeof w;if(C==="string"){var F=[],U=w.length,D=0,I;for(k=0;k>>6,F[D++]=128|I&63):I<55296||I>=57344?(F[D++]=224|I>>>12,F[D++]=128|I>>>6&63,F[D++]=128|I&63):(I=65536+((I&1023)<<10|w.charCodeAt(++k)&1023),F[D++]=240|I>>>18,F[D++]=128|I>>>12&63,F[D++]=128|I>>>6&63,F[D++]=128|I&63);w=F}else if(C==="object"){if(w===null)throw new Error(r);if(d&&w.constructor===ArrayBuffer)w=new Uint8Array(w);else if(!Array.isArray(w)&&(!d||!ArrayBuffer.isView(w)))throw new Error(r)}else throw new Error(r);w.length>64&&(w=new M(E,!0).update(w).array());var Q=[],oe=[];for(k=0;k<64;++k){var we=w[k]||0;Q[k]=92^we,oe[k]=54^we}M.call(this,E,P),this.update(oe),this.oKeyPad=Q,this.inner=!0,this.sharedMemory=P}X.prototype=new M,X.prototype.finalize=function(){if(M.prototype.finalize.call(this),this.inner){this.inner=!1;var w=this.array();M.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(w),M.prototype.finalize.call(this)}};var x=S();x.sha256=x,x.sha224=S(!0),x.sha256.hmac=A(),x.sha224.hmac=A(!0),u?t.exports=x:(a.sha256=x.sha256,a.sha224=x.sha224)})()}),wd={};pr(wd,{registerWorker:()=>Nl});function Bo(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ee(e){return this instanceof ee?(this.v=e,this):new ee(e)}function Qe(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),a,o=[];return a={},l("next"),l("throw"),l("return"),a[Symbol.asyncIterator]=function(){return this},a;function l(m){n[m]&&(a[m]=function(h){return new Promise(function(g,b){o.push([m,h,g,b])>1||u(m,h)})})}function u(m,h){try{_(n[m](h))}catch(g){f(o[0][3],g)}}function _(m){m.value instanceof ee?Promise.resolve(m.value.v).then(d,p):f(o[0][2],m)}function d(m){u("next",m)}function p(m){u("throw",m)}function f(m,h){m(h),o.shift(),o.length&&u(o[0][0],o[0][1])}}function ei(e){var t,r;return t={},n("next"),n("throw",function(a){throw a}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(a,o){t[a]=e[a]?function(l){return(r=!r)?{value:ee(e[a](l)),done:!1}:o?o(l):l}:o}}function ut(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Io=="function"?Io(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(l){return new Promise(function(u,_){l=e[o](l),a(u,_,l.done,l.value)})}}function a(o,l,u,_){Promise.resolve(_).then(function(d){o({value:d,done:u})},l)}}var Ea={};pr(Ea,{compareArrayLike:()=>wa,joinUint8Arrays:()=>Ye,memcpy:()=>xi,rebaseValueOffsets:()=>Rn,toArrayBufferView:()=>re,toArrayBufferViewAsyncIterator:()=>ft,toArrayBufferViewIterator:()=>xt,toBigInt64Array:()=>Bn,toBigUint64Array:()=>nu,toFloat32Array:()=>su,toFloat32ArrayAsyncIterator:()=>Su,toFloat32ArrayIterator:()=>fu,toFloat64Array:()=>au,toFloat64ArrayAsyncIterator:()=>wu,toFloat64ArrayIterator:()=>pu,toInt16Array:()=>tu,toInt16ArrayAsyncIterator:()=>gu,toInt16ArrayIterator:()=>lu,toInt32Array:()=>Pr,toInt32ArrayAsyncIterator:()=>vu,toInt32ArrayIterator:()=>uu,toInt8Array:()=>eu,toInt8ArrayAsyncIterator:()=>hu,toInt8ArrayIterator:()=>cu,toUint16Array:()=>ru,toUint16ArrayAsyncIterator:()=>yu,toUint16ArrayIterator:()=>_u,toUint32Array:()=>iu,toUint32ArrayAsyncIterator:()=>bu,toUint32ArrayIterator:()=>du,toUint8Array:()=>z,toUint8ArrayAsyncIterator:()=>Sa,toUint8ArrayIterator:()=>ba,toUint8ClampedArray:()=>ou,toUint8ClampedArrayAsyncIterator:()=>Eu,toUint8ClampedArrayIterator:()=>mu});var Yl=new TextDecoder("utf-8"),Ti=e=>Yl.decode(e),Jl=new TextEncoder,Ft=e=>Jl.encode(e),Kl=e=>typeof e=="number",Ro=e=>typeof e=="boolean",xe=e=>typeof e=="function",Oe=e=>e!=null&&Object(e)===e,_t=e=>Oe(e)&&xe(e.then),dt=e=>Oe(e)&&xe(e[Symbol.iterator]),rt=e=>Oe(e)&&xe(e[Symbol.asyncIterator]),Fn=e=>Oe(e)&&Oe(e.schema),xn=e=>Oe(e)&&"done"in e&&"value"in e,Cn=e=>Oe(e)&&xe(e.stat)&&Kl(e.fd),Mn=e=>Oe(e)&&Fi(e.body),Pn=e=>"_getDOMStream"in e&&"_getNodeStream"in e,Go=e=>Oe(e)&&xe(e.abort)&&xe(e.getWriter)&&!Pn(e),Fi=e=>Oe(e)&&xe(e.cancel)&&xe(e.getReader)&&!Pn(e),Uo=e=>Oe(e)&&xe(e.end)&&xe(e.write)&&Ro(e.writable)&&!Pn(e),In=e=>Oe(e)&&xe(e.read)&&xe(e.pipe)&&Ro(e.readable)&&!Pn(e),jo=e=>Oe(e)&&xe(e.clear)&&xe(e.bytes)&&xe(e.position)&&xe(e.setPosition)&&xe(e.capacity)&&xe(e.getBufferIdentifier)&&xe(e.createLong),ya=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Zl(e){let t=e[0]?[e[0]]:[],r,n,a,o;for(let l,u,_=0,d=0,p=e.length;++_p+f.byteLength,0),a,o,l,u=0,_=-1,d=Math.min(t||Number.POSITIVE_INFINITY,n);for(let p=r.length;++_re(Int8Array,e),tu=e=>re(Int16Array,e),Pr=e=>re(Int32Array,e),Bn=e=>re(BigInt64Array,e),z=e=>re(Uint8Array,e),ru=e=>re(Uint16Array,e),iu=e=>re(Uint32Array,e),nu=e=>re(BigUint64Array,e),su=e=>re(Float32Array,e),au=e=>re(Float64Array,e),ou=e=>re(Uint8ClampedArray,e),va=e=>(e.next(),e);function*xt(e,t){let r=function*(a){yield a},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ya?r(t):dt(t)?t:r(t);return yield*Mr(va(function*(a){let o=null;do o=a.next(yield re(e,o));while(!o.done)}(n[Symbol.iterator]()))),new e}var cu=e=>xt(Int8Array,e),lu=e=>xt(Int16Array,e),uu=e=>xt(Int32Array,e),ba=e=>xt(Uint8Array,e),_u=e=>xt(Uint16Array,e),du=e=>xt(Uint32Array,e),fu=e=>xt(Float32Array,e),pu=e=>xt(Float64Array,e),mu=e=>xt(Uint8ClampedArray,e);function ft(e,t){return Qe(this,arguments,function*(){if(_t(t))return yield ee(yield ee(yield*Mr(ei(ut(ft(e,yield ee(t)))))));let r=function(o){return Qe(this,arguments,function*(){yield yield ee(yield ee(o))})},n=function(o){return Qe(this,arguments,function*(){yield ee(yield*Mr(ei(ut(va(function*(l){let u=null;do u=l.next(yield u==null?void 0:u.value);while(!u.done)}(o[Symbol.iterator]()))))))})},a=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ya?r(t):dt(t)?n(t):rt(t)?t:r(t);return yield ee(yield*Mr(ei(ut(va(function(o){return Qe(this,arguments,function*(){let l=null;do l=yield ee(o.next(yield yield ee(re(e,l))));while(!l.done)})}(a[Symbol.asyncIterator]())))))),yield ee(new e)})}var hu=e=>ft(Int8Array,e),gu=e=>ft(Int16Array,e),vu=e=>ft(Int32Array,e),Sa=e=>ft(Uint8Array,e),yu=e=>ft(Uint16Array,e),bu=e=>ft(Uint32Array,e),Su=e=>ft(Float32Array,e),wu=e=>ft(Float64Array,e),Eu=e=>ft(Uint8ClampedArray,e);function Rn(e,t,r){if(e!==0){r=r.slice(0,t);for(let n=-1,a=r.length;++n0)do if(e[r]!==t[r])return!1;while(++r(e.next(),e);function*Lu(e){let t,r=!1,n=[],a,o,l,u=0;function _(){return o==="peek"?Ye(n,l)[0]:([a,n,u]=Ye(n,l),a)}({cmd:o,size:l}=(yield null)||{cmd:"read",size:0});let d=ba(e)[Symbol.iterator]();try{do if({done:t,value:a}=Number.isNaN(l-u)?d.next():d.next(l-u),!t&&a.byteLength>0&&(n.push(a),u+=a.byteLength),t||l<=u)do({cmd:o,size:l}=yield _());while(l0&&(n.push(a),u+=a.byteLength),t||l<=u)do({cmd:o,size:l}=yield yield ee(_()));while(l0&&(n.push(z(a)),u+=a.byteLength),t||l<=u)do({cmd:o,size:l}=yield yield ee(_()));while(l{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return B(this,void 0,void 0,function*(){let{reader:t,source:r}=this;t&&(yield t.cancel(e).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(e){return B(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=yield this.reader.read();return!t.done&&(t.value=z(t)),t})}},La=(e,t)=>{let r=a=>n([t,a]),n;return[t,r,new Promise(a=>(n=a)&&e.once(t,r))]};function ku(e){return Qe(this,arguments,function*(){let t=[],r="error",n=!1,a=null,o,l,u=0,_=[],d;function p(){return o==="peek"?Ye(_,l)[0]:([d,_,u]=Ye(_,l),d)}if({cmd:o,size:l}=(yield yield ee(null))||{cmd:"read",size:0},e.isTTY)return yield yield ee(new Uint8Array(0)),yield ee(null);try{t[0]=La(e,"end"),t[1]=La(e,"error");do{if(t[2]=La(e,"readable"),[r,a]=yield ee(Promise.race(t.map(m=>m[2]))),r==="error")break;if((n=r==="end")||(Number.isFinite(l-u)?(d=z(e.read(l-u)),d.byteLength0&&(_.push(d),u+=d.byteLength)),n||l<=u)do({cmd:o,size:l}=yield yield ee(p()));while(l{for(let[v,S]of m)e.off(v,S);try{let v=e.destroy;v&&v.call(e,h),h=void 0}catch(v){h=v||h}finally{h!=null?b(h):g()}})}})}var ue;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(ue||(ue={}));var he;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(he||(he={}));var pe;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(pe||(pe={}));var Ae;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Ae||(Ae={}));var G;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(G||(G={}));var Ce;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ce||(Ce={}));var Ct=new Int32Array(2),Un=new Float32Array(Ct.buffer),jn=new Float64Array(Ct.buffer),ti=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,Ci;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(Ci||(Ci={}));var Je=class Hd{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Hd(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}writeUint16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeInt32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeUint32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeInt64(t,r){this.writeInt32(t,Number(BigInt.asIntN(32,r))),this.writeInt32(t+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(t,r){this.writeUint32(t,Number(BigInt.asUintN(32,r))),this.writeUint32(t+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(t,r){Un[0]=r,this.writeInt32(t,Ct[0])}writeFloat64(t,r){jn[0]=r,this.writeInt32(t,Ct[ti?0:1]),this.writeInt32(t+4,Ct[ti?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);let n=~(this.bb.capacity()-this.space+r)+1&t-1;for(;this.space=0&&this.vtable[r]==0;r--);let n=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?t-this.vtable[r]:0);let a=2;this.addInt16(t-this.object_start);let o=(n+a)*2;this.addInt16(o);let l=0,u=this.space;e:for(r=0;r=0;l--)this.writeInt8(o.charCodeAt(l))}this.prep(this.minalign,4+a),this.addOffset(t),a&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,r){this.finish(t,r,!0)}requiredField(t,r){let n=this.bb.capacity()-t,a=n-this.bb.readInt32(n);if(!(r=0;n--)t.addInt32(r[n]);return t.endVector()}static startTypeIdsVector(t,r){t.startVector(4,r,4)}static endUnion(t){return t.endObject()}static createUnion(t,r,n){return Jn.startUnion(t),Jn.addMode(t,r),Jn.addTypeIds(t,n),Jn.endUnion(t)}},Ni=class Td{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8(t,r){return(r||new Td).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,r){return t.setPosition(t.position()+4),(r||new Td).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return Td.startUtf8(t),Td.endUtf8(t)}},ge;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded"})(ge||(ge={}));var je=class xd{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsField(t,r){return(r||new xd).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,r){return t.setPosition(t.position()+4),(r||new xd).__init(t.readInt32(t.position())+t.position(),t)}name(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):ge.NONE}type(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(t,this.bb_pos+r):null}dictionary(t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Mt).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(t,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new xd).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new Me).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,r){t.addFieldOffset(0,r,0)}static addNullable(t,r){t.addFieldInt8(1,+r,0)}static addTypeType(t,r){t.addFieldInt8(2,r,ge.NONE)}static addType(t,r){t.addFieldOffset(3,r,0)}static addDictionary(t,r){t.addFieldOffset(4,r,0)}static addChildren(t,r){t.addFieldOffset(5,r,0)}static createChildrenVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startChildrenVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(6,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endField(t){return t.endObject()}},Ve=class dr{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsSchema(t,r){return(r||new dr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,r){return t.setPosition(t.position()+4),(r||new dr).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):mr.Little}fields(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new je).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Me).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,r){t.addFieldInt16(0,r,mr.Little)}static addFields(t,r){t.addFieldOffset(1,r,0)}static createFieldsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startFieldsVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(2,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static addFeatures(t,r){t.addFieldOffset(3,r,0)}static createFeaturesVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startFeaturesVector(t,r){t.startVector(8,r,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,r){t.finish(r)}static finishSizePrefixedSchemaBuffer(t,r){t.finish(r,void 0,!0)}static createSchema(t,r,n,a,o){return dr.startSchema(t),dr.addEndianness(t,r),dr.addFields(t,n),dr.addCustomMetadata(t,a),dr.addFeatures(t,o),dr.endSchema(t)}},ne;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(ne||(ne={}));var y;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond"})(y||(y={}));var nt;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(nt||(nt={}));var za={};pr(za,{clampRange:()=>$i,createElementComparator:()=>Dr,wrapIndex:()=>Br});var Da={};pr(Da,{valueToString:()=>gt});function gt(e){if(e===null)return"null";if(e===void 0)return"undefined";switch(typeof e){case"number":return"".concat(e);case"bigint":return"".concat(e);case"string":return'"'.concat(e,'"')}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?"[".concat([...e].map(t=>gt(t)),"]"):"[".concat(e,"]"):ArrayBuffer.isView(e)?"[".concat(e,"]"):JSON.stringify(e,(t,r)=>typeof r=="bigint"?"".concat(r):r)}var xa={};pr(xa,{BN:()=>Vi,bigNumToBigInt:()=>Ho,bigNumToNumber:()=>Fa,bigNumToString:()=>ai,isArrowBigNumSymbol:()=>Oo});function ae(e){if(typeof e=="bigint"&&(eNumber.MAX_SAFE_INTEGER))throw new TypeError("".concat(e," is not safe to convert to a number."));return Number(e)}function ka(e,t){return ae(e/t)+ae(e%t)/ae(t)}var Oo=Symbol.for("isArrowBigNum");function vt(e,...t){return t.length===0?Object.setPrototypeOf(re(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}vt.prototype[Oo]=!0,vt.prototype.toJSON=function(){return'"'.concat(ai(this),'"')},vt.prototype.valueOf=function(e){return Fa(this,e)},vt.prototype.toString=function(){return ai(this)},vt.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return Fa(this);case"string":return ai(this);case"default":return Ho(this)}return ai(this)};function ni(...e){return vt.apply(this,e)}function si(...e){return vt.apply(this,e)}function Wi(...e){return vt.apply(this,e)}Object.setPrototypeOf(ni.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(si.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(Wi.prototype,Object.create(Uint32Array.prototype)),Object.assign(ni.prototype,vt.prototype,{constructor:ni,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(si.prototype,vt.prototype,{constructor:si,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(Wi.prototype,vt.prototype,{constructor:Wi,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var Tu=BigInt(4294967296)*BigInt(4294967296),Fu=Tu-BigInt(1);function Fa(e,t){let{buffer:r,byteOffset:n,byteLength:a,signed:o}=e,l=new BigUint64Array(r,n,a/8),u=o&&l.at(-1)&BigInt(1)<=0)return Ta(e);t=t.slice();let r=1;for(let a=0;a(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]="DataType"))(R.prototype);var He=class extends R{constructor(){super(y.Null)}toString(){return"Null"}};Wo=Symbol.toStringTag,He[Wo]=(e=>e[Symbol.toStringTag]="Null")(He.prototype);var Pe=class extends R{constructor(e,t){super(y.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}};Vo=Symbol.toStringTag,Pe[Vo]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(Pe.prototype);var It=class extends Pe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}};Object.defineProperty(It.prototype,"ArrayType",{value:Int32Array});var st=class extends R{constructor(e){super(y.Float),this.precision=e}get ArrayType(){switch(this.precision){case pe.HALF:return Uint16Array;case pe.SINGLE:return Float32Array;case pe.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}};zo=Symbol.toStringTag,st[zo]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(st.prototype);var Wt=class extends R{constructor(){super(y.Binary)}toString(){return"Binary"}};$o=Symbol.toStringTag,Wt[$o]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Wt.prototype);var Vt=class extends R{constructor(){super(y.LargeBinary)}toString(){return"LargeBinary"}};qo=Symbol.toStringTag,Vt[qo]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(Vt.prototype);var zt=class extends R{constructor(){super(y.Utf8)}toString(){return"Utf8"}};Xo=Symbol.toStringTag,zt[Xo]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(zt.prototype);var $t=class extends R{constructor(){super(y.LargeUtf8)}toString(){return"LargeUtf8"}};Qo=Symbol.toStringTag,$t[Qo]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))($t.prototype);var qt=class extends R{constructor(){super(y.Bool)}toString(){return"Bool"}};Yo=Symbol.toStringTag,qt[Yo]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(qt.prototype);var Xt=class extends R{constructor(e,t,r=128){super(y.Decimal),this.scale=e,this.precision=t,this.bitWidth=r}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}};Jo=Symbol.toStringTag,Xt[Jo]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Xt.prototype);var Qt=class extends R{constructor(e){super(y.Date),this.unit=e}toString(){return"Date".concat((this.unit+1)*32,"<").concat(Ae[this.unit],">")}get ArrayType(){return this.unit===Ae.DAY?Int32Array:BigInt64Array}};Ko=Symbol.toStringTag,Qt[Ko]=(e=>(e.unit=null,e[Symbol.toStringTag]="Date"))(Qt.prototype);var Yt=class extends R{constructor(e,t){super(y.Time),this.unit=e,this.bitWidth=t}toString(){return"Time".concat(this.bitWidth,"<").concat(G[this.unit],">")}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}};Zo=Symbol.toStringTag,Yt[Zo]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Yt.prototype);var Jt=class extends R{constructor(e,t){super(y.Timestamp),this.unit=e,this.timezone=t}toString(){return"Timestamp<".concat(G[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}};ec=Symbol.toStringTag,Jt[ec]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Timestamp"))(Jt.prototype);var Kt=class extends R{constructor(e){super(y.Interval),this.unit=e}toString(){return"Interval<".concat(Ce[this.unit],">")}};tc=Symbol.toStringTag,Kt[tc]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(Kt.prototype);var Zt=class extends R{constructor(e){super(y.Duration),this.unit=e}toString(){return"Duration<".concat(G[this.unit],">")}};rc=Symbol.toStringTag,Zt[rc]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(Zt.prototype);var yt=class extends R{constructor(e){super(y.List),this.children=[e]}toString(){return"List<".concat(this.valueType,">")}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};ic=Symbol.toStringTag,yt[ic]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(yt.prototype);var ve=class extends R{constructor(e){super(y.Struct),this.children=e}toString(){return"Struct<{".concat(this.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};nc=Symbol.toStringTag,ve[nc]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(ve.prototype);var bt=class extends R{constructor(e,t,r){super(y.Union),this.mode=e,this.children=r,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((n,a,o)=>(n[a]=o)&&n||n,Object.create(null))}toString(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map(e=>"".concat(e.type)).join(" | "),">")}};sc=Symbol.toStringTag,bt[sc]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(bt.prototype);var er=class extends R{constructor(e){super(y.FixedSizeBinary),this.byteWidth=e}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}};ac=Symbol.toStringTag,er[ac]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(er.prototype);var St=class extends R{constructor(e,t){super(y.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}};oc=Symbol.toStringTag,St[oc]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(St.prototype);var wt=class extends R{constructor(e,t=!1){var r,n,a;if(super(y.Map),this.children=[e],this.keysSorted=t,e&&(e.name="entries",!((r=e==null?void 0:e.type)===null||r===void 0)&&r.children)){let o=(n=e==null?void 0:e.type)===null||n===void 0?void 0:n.children[0];o&&(o.name="key");let l=(a=e==null?void 0:e.type)===null||a===void 0?void 0:a.children[1];l&&(l.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return"Map<{".concat(this.children[0].type.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};cc=Symbol.toStringTag,wt[cc]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(wt.prototype);var xu=(e=>()=>++e)(-1),Ze=class extends R{constructor(e,t,r,n){super(y.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=n||!1,this.id=r==null?xu():ae(r)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return"Dictionary<".concat(this.indices,", ").concat(this.dictionary,">")}};lc=Symbol.toStringTag,Ze[lc]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(Ze.prototype);function et(e){let t=e;switch(e.typeId){case y.Decimal:return e.bitWidth/32;case y.Interval:return 1+t.unit;case y.FixedSizeList:return t.listSize;case y.FixedSizeBinary:return t.byteWidth;default:return 1}}var j=class{visitMany(e,...t){return e.map((r,n)=>this.visit(r,...t.map(a=>a[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Cu(this,e,t)}getVisitFnByTypeId(e,t=!0){return oi(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function Cu(e,t,r=!0){return typeof t=="number"?oi(e,t,r):typeof t=="string"&&t in y?oi(e,y[t],r):t&&t instanceof R?oi(e,uc(t),r):t!=null&&t.type&&t.type instanceof R?oi(e,uc(t.type),r):oi(e,y.NONE,r)}function oi(e,t,r=!0){let n=null;switch(t){case y.Null:n=e.visitNull;break;case y.Bool:n=e.visitBool;break;case y.Int:n=e.visitInt;break;case y.Int8:n=e.visitInt8||e.visitInt;break;case y.Int16:n=e.visitInt16||e.visitInt;break;case y.Int32:n=e.visitInt32||e.visitInt;break;case y.Int64:n=e.visitInt64||e.visitInt;break;case y.Uint8:n=e.visitUint8||e.visitInt;break;case y.Uint16:n=e.visitUint16||e.visitInt;break;case y.Uint32:n=e.visitUint32||e.visitInt;break;case y.Uint64:n=e.visitUint64||e.visitInt;break;case y.Float:n=e.visitFloat;break;case y.Float16:n=e.visitFloat16||e.visitFloat;break;case y.Float32:n=e.visitFloat32||e.visitFloat;break;case y.Float64:n=e.visitFloat64||e.visitFloat;break;case y.Utf8:n=e.visitUtf8;break;case y.LargeUtf8:n=e.visitLargeUtf8;break;case y.Binary:n=e.visitBinary;break;case y.LargeBinary:n=e.visitLargeBinary;break;case y.FixedSizeBinary:n=e.visitFixedSizeBinary;break;case y.Date:n=e.visitDate;break;case y.DateDay:n=e.visitDateDay||e.visitDate;break;case y.DateMillisecond:n=e.visitDateMillisecond||e.visitDate;break;case y.Timestamp:n=e.visitTimestamp;break;case y.TimestampSecond:n=e.visitTimestampSecond||e.visitTimestamp;break;case y.TimestampMillisecond:n=e.visitTimestampMillisecond||e.visitTimestamp;break;case y.TimestampMicrosecond:n=e.visitTimestampMicrosecond||e.visitTimestamp;break;case y.TimestampNanosecond:n=e.visitTimestampNanosecond||e.visitTimestamp;break;case y.Time:n=e.visitTime;break;case y.TimeSecond:n=e.visitTimeSecond||e.visitTime;break;case y.TimeMillisecond:n=e.visitTimeMillisecond||e.visitTime;break;case y.TimeMicrosecond:n=e.visitTimeMicrosecond||e.visitTime;break;case y.TimeNanosecond:n=e.visitTimeNanosecond||e.visitTime;break;case y.Decimal:n=e.visitDecimal;break;case y.List:n=e.visitList;break;case y.Struct:n=e.visitStruct;break;case y.Union:n=e.visitUnion;break;case y.DenseUnion:n=e.visitDenseUnion||e.visitUnion;break;case y.SparseUnion:n=e.visitSparseUnion||e.visitUnion;break;case y.Dictionary:n=e.visitDictionary;break;case y.Interval:n=e.visitInterval;break;case y.IntervalDayTime:n=e.visitIntervalDayTime||e.visitInterval;break;case y.IntervalYearMonth:n=e.visitIntervalYearMonth||e.visitInterval;break;case y.Duration:n=e.visitDuration;break;case y.DurationSecond:n=e.visitDurationSecond||e.visitDuration;break;case y.DurationMillisecond:n=e.visitDurationMillisecond||e.visitDuration;break;case y.DurationMicrosecond:n=e.visitDurationMicrosecond||e.visitDuration;break;case y.DurationNanosecond:n=e.visitDurationNanosecond||e.visitDuration;break;case y.FixedSizeList:n=e.visitFixedSizeList;break;case y.Map:n=e.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error("Unrecognized type '".concat(y[t],"'"))}function uc(e){switch(e.typeId){case y.Null:return y.Null;case y.Int:{let{bitWidth:t,isSigned:r}=e;switch(t){case 8:return r?y.Int8:y.Uint8;case 16:return r?y.Int16:y.Uint16;case 32:return r?y.Int32:y.Uint32;case 64:return r?y.Int64:y.Uint64}return y.Int}case y.Float:switch(e.precision){case pe.HALF:return y.Float16;case pe.SINGLE:return y.Float32;case pe.DOUBLE:return y.Float64}return y.Float;case y.Binary:return y.Binary;case y.LargeBinary:return y.LargeBinary;case y.Utf8:return y.Utf8;case y.LargeUtf8:return y.LargeUtf8;case y.Bool:return y.Bool;case y.Decimal:return y.Decimal;case y.Time:switch(e.unit){case G.SECOND:return y.TimeSecond;case G.MILLISECOND:return y.TimeMillisecond;case G.MICROSECOND:return y.TimeMicrosecond;case G.NANOSECOND:return y.TimeNanosecond}return y.Time;case y.Timestamp:switch(e.unit){case G.SECOND:return y.TimestampSecond;case G.MILLISECOND:return y.TimestampMillisecond;case G.MICROSECOND:return y.TimestampMicrosecond;case G.NANOSECOND:return y.TimestampNanosecond}return y.Timestamp;case y.Date:switch(e.unit){case Ae.DAY:return y.DateDay;case Ae.MILLISECOND:return y.DateMillisecond}return y.Date;case y.Interval:switch(e.unit){case Ce.DAY_TIME:return y.IntervalDayTime;case Ce.YEAR_MONTH:return y.IntervalYearMonth}return y.Interval;case y.Duration:switch(e.unit){case G.SECOND:return y.DurationSecond;case G.MILLISECOND:return y.DurationMillisecond;case G.MICROSECOND:return y.DurationMicrosecond;case G.NANOSECOND:return y.DurationNanosecond}return y.Duration;case y.Map:return y.Map;case y.List:return y.List;case y.Struct:return y.Struct;case y.Union:switch(e.mode){case he.Dense:return y.DenseUnion;case he.Sparse:return y.SparseUnion}return y.Union;case y.FixedSizeBinary:return y.FixedSizeBinary;case y.FixedSizeList:return y.FixedSizeList;case y.Dictionary:return y.Dictionary}throw new Error("Unrecognized type '".concat(y[e.typeId],"'"))}j.prototype.visitInt8=null,j.prototype.visitInt16=null,j.prototype.visitInt32=null,j.prototype.visitInt64=null,j.prototype.visitUint8=null,j.prototype.visitUint16=null,j.prototype.visitUint32=null,j.prototype.visitUint64=null,j.prototype.visitFloat16=null,j.prototype.visitFloat32=null,j.prototype.visitFloat64=null,j.prototype.visitDateDay=null,j.prototype.visitDateMillisecond=null,j.prototype.visitTimestampSecond=null,j.prototype.visitTimestampMillisecond=null,j.prototype.visitTimestampMicrosecond=null,j.prototype.visitTimestampNanosecond=null,j.prototype.visitTimeSecond=null,j.prototype.visitTimeMillisecond=null,j.prototype.visitTimeMicrosecond=null,j.prototype.visitTimeNanosecond=null,j.prototype.visitDenseUnion=null,j.prototype.visitSparseUnion=null,j.prototype.visitIntervalDayTime=null,j.prototype.visitIntervalYearMonth=null,j.prototype.visitDuration=null,j.prototype.visitDurationSecond=null,j.prototype.visitDurationMillisecond=null,j.prototype.visitDurationMicrosecond=null,j.prototype.visitDurationNanosecond=null;var Ca={};pr(Ca,{float64ToUint16:()=>zi,uint16ToFloat64:()=>Kn});var _c=new Float64Array(1),ci=new Uint32Array(_c.buffer);function Kn(e){let t=(e&31744)>>10,r=(e&1023)/1024,n=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,t-15)*(1+r)}function zi(e){if(e!==e)return 32256;_c[0]=e;let t=(ci[1]&2147483648)>>16&65535,r=ci[1]&2146435072,n=0;return r>=1089470464?ci[0]>0?r=31744:(r=(r&2080374784)>>16,n=(ci[1]&1048575)>>10):r<=1056964608?(n=1048576+(ci[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(ci[1]&1048575)+512>>10),t|r|n&65535}var V=class extends j{};function Y(e){return(t,r,n)=>{if(t.setValid(r,n!=null))return e(t,r,n)}}var Mu=(e,t,r)=>{e[t]=Math.floor(r/864e5)},dc=(e,t,r,n)=>{if(r+1{let a=e+r;n?t[a>>3]|=1<>3]&=~(1<{e[t]=r},Ma=({values:e},t,r)=>{e[t]=r},fc=({values:e},t,r)=>{e[t]=zi(r)},Iu=(e,t,r)=>{switch(e.type.precision){case pe.HALF:return fc(e,t,r);case pe.SINGLE:case pe.DOUBLE:return Ma(e,t,r)}},Zn=({values:e},t,r)=>{Mu(e,t,r.valueOf())},es=({values:e},t,r)=>{e[t]=BigInt(r)},Pa=({stride:e,values:t},r,n)=>{t.set(n.subarray(0,e),e*r)},pc=({values:e,valueOffsets:t},r,n)=>dc(e,t,r,n),mc=({values:e,valueOffsets:t},r,n)=>dc(e,t,r,Ft(n)),Ia=(e,t,r)=>{e.type.unit===Ae.DAY?Zn(e,t,r):es(e,t,r)},ts=({values:e},t,r)=>{e[t]=BigInt(r/1e3)},rs=({values:e},t,r)=>{e[t]=BigInt(r)},is=({values:e},t,r)=>{e[t]=BigInt(r*1e3)},ns=({values:e},t,r)=>{e[t]=BigInt(r*1e6)},Ba=(e,t,r)=>{switch(e.type.unit){case G.SECOND:return ts(e,t,r);case G.MILLISECOND:return rs(e,t,r);case G.MICROSECOND:return is(e,t,r);case G.NANOSECOND:return ns(e,t,r)}},ss=({values:e},t,r)=>{e[t]=r},as=({values:e},t,r)=>{e[t]=r},os=({values:e},t,r)=>{e[t]=r},cs=({values:e},t,r)=>{e[t]=r},Ra=(e,t,r)=>{switch(e.type.unit){case G.SECOND:return ss(e,t,r);case G.MILLISECOND:return as(e,t,r);case G.MICROSECOND:return os(e,t,r);case G.NANOSECOND:return cs(e,t,r)}},Ga=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},Bu=(e,t,r)=>{let n=e.children[0],a=e.valueOffsets,o=Re.getVisitFn(n);if(Array.isArray(r))for(let l=-1,u=a[t],_=a[t+1];u<_;)o(n,u++,r[++l]);else for(let l=-1,u=a[t],_=a[t+1];u<_;)o(n,u++,r.get(++l))},Ru=(e,t,r)=>{let n=e.children[0],{valueOffsets:a}=e,o=Re.getVisitFn(n),{[t]:l,[t+1]:u}=a,_=r instanceof Map?r.entries():Object.entries(r);for(let d of _)if(o(n,l,d),++l>=u)break},Gu=(e,t)=>(r,n,a,o)=>n&&r(n,e,t[o]),Uu=(e,t)=>(r,n,a,o)=>n&&r(n,e,t.get(o)),ju=(e,t)=>(r,n,a,o)=>n&&r(n,e,t.get(a.name)),Ou=(e,t)=>(r,n,a,o)=>n&&r(n,e,t[a.name]),Hu=(e,t,r)=>{let n=e.type.children.map(o=>Re.getVisitFn(o.type)),a=r instanceof Map?ju(t,r):r instanceof se?Uu(t,r):Array.isArray(r)?Gu(t,r):Ou(t,r);e.type.children.forEach((o,l)=>a(n[l],e.children[l],o,l))},Nu=(e,t,r)=>{e.type.mode===he.Dense?hc(e,t,r):gc(e,t,r)},hc=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],a=e.children[n];Re.visit(a,e.valueOffsets[t],r)},gc=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],a=e.children[n];Re.visit(a,t,r)},Wu=(e,t,r)=>{var n;(n=e.dictionary)===null||n===void 0||n.set(e.values[t],r)},Ua=(e,t,r)=>{e.type.unit===Ce.DAY_TIME?ls(e,t,r):us(e,t,r)},ls=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},us=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},_s=({values:e},t,r)=>{e[t]=r},ds=({values:e},t,r)=>{e[t]=r},ps=({values:e},t,r)=>{e[t]=r},ms=({values:e},t,r)=>{e[t]=r},ja=(e,t,r)=>{switch(e.type.unit){case G.SECOND:return _s(e,t,r);case G.MILLISECOND:return ds(e,t,r);case G.MICROSECOND:return ps(e,t,r);case G.NANOSECOND:return ms(e,t,r)}},Vu=(e,t,r)=>{let{stride:n}=e,a=e.children[0],o=Re.getVisitFn(a);if(Array.isArray(r))for(let l=-1,u=t*n;++l"".concat(gt(e),": ").concat(gt(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Oa(this[Et],this[li])}},Oa=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return et.name)}has(e,t){return e[Et].type.children.findIndex(r=>r.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[Et].type.children.findIndex(r=>r.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let r=e[Et].type.children.findIndex(n=>n.name===t);if(r!==-1){let n=Te.visit(e[Et].children[r],e[li]);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[Et].type.children.findIndex(a=>a.name===t);return n!==-1?(Re.visit(e[Et].children[n],e[li],r),Reflect.set(e,t,r)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,r):!1}},O=class extends j{};function $(e){return(t,r)=>t.getValid(r)?e(t,r):null}var zu=(e,t)=>864e5*e[t],$u=(e,t)=>null,vc=(e,t,r)=>{if(r+1>=t.length)return null;let n=ae(t[r]),a=ae(t[r+1]);return e.subarray(n,a)},qu=({offset:e,values:t},r)=>{let n=e+r;return(t[n>>3]&1<zu(e,t),bc=({values:e},t)=>ae(e[t]),Lr=({stride:e,values:t},r)=>t[e*r],Xu=({stride:e,values:t},r)=>Kn(t[e*r]),Sc=({values:e},t)=>e[t],Qu=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),wc=({values:e,valueOffsets:t},r)=>vc(e,t,r),Ec=({values:e,valueOffsets:t},r)=>{let n=vc(e,t,r);return n!==null?Ti(n):null},Yu=({values:e},t)=>e[t],Ju=({type:e,values:t},r)=>e.precision!==pe.HALF?t[r]:Kn(t[r]),Ku=(e,t)=>e.type.unit===Ae.DAY?yc(e,t):bc(e,t),Lc=({values:e},t)=>1e3*ae(e[t]),Ac=({values:e},t)=>ae(e[t]),Dc=({values:e},t)=>ka(e[t],BigInt(1e3)),kc=({values:e},t)=>ka(e[t],BigInt(1e6)),Zu=(e,t)=>{switch(e.type.unit){case G.SECOND:return Lc(e,t);case G.MILLISECOND:return Ac(e,t);case G.MICROSECOND:return Dc(e,t);case G.NANOSECOND:return kc(e,t)}},Tc=({values:e},t)=>e[t],Fc=({values:e},t)=>e[t],xc=({values:e},t)=>e[t],Cc=({values:e},t)=>e[t],e_=(e,t)=>{switch(e.type.unit){case G.SECOND:return Tc(e,t);case G.MILLISECOND:return Fc(e,t);case G.MICROSECOND:return xc(e,t);case G.NANOSECOND:return Cc(e,t)}},t_=({values:e,stride:t},r)=>Vi.decimal(e.subarray(t*r,t*(r+1))),r_=(e,t)=>{let{valueOffsets:r,stride:n,children:a}=e,{[t*n]:o,[t*n+1]:l}=r,u=a[0].slice(o,l-o);return new se([u])},i_=(e,t)=>{let{valueOffsets:r,children:n}=e,{[t]:a,[t+1]:o}=r,l=n[0];return new Bt(l.slice(a,o-a))},n_=(e,t)=>new Er(e,t),s_=(e,t)=>e.type.mode===he.Dense?Mc(e,t):Pc(e,t),Mc=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return Te.visit(n,e.valueOffsets[t])},Pc=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return Te.visit(n,t)},a_=(e,t)=>{var r;return(r=e.dictionary)===null||r===void 0?void 0:r.get(e.values[t])},o_=(e,t)=>e.type.unit===Ce.DAY_TIME?Ic(e,t):Bc(e,t),Ic=({values:e},t)=>e.subarray(2*t,2*(t+1)),Bc=({values:e},t)=>{let r=e[t],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},Rc=({values:e},t)=>e[t],Gc=({values:e},t)=>e[t],Uc=({values:e},t)=>e[t],jc=({values:e},t)=>e[t],c_=(e,t)=>{switch(e.type.unit){case G.SECOND:return Rc(e,t);case G.MILLISECOND:return Gc(e,t);case G.MICROSECOND:return Uc(e,t);case G.NANOSECOND:return jc(e,t)}},l_=(e,t)=>{let{stride:r,children:n}=e,a=n[0].slice(t*r,r);return new se([a])};O.prototype.visitNull=$($u),O.prototype.visitBool=$(qu),O.prototype.visitInt=$(Yu),O.prototype.visitInt8=$(Lr),O.prototype.visitInt16=$(Lr),O.prototype.visitInt32=$(Lr),O.prototype.visitInt64=$(Sc),O.prototype.visitUint8=$(Lr),O.prototype.visitUint16=$(Lr),O.prototype.visitUint32=$(Lr),O.prototype.visitUint64=$(Sc),O.prototype.visitFloat=$(Ju),O.prototype.visitFloat16=$(Xu),O.prototype.visitFloat32=$(Lr),O.prototype.visitFloat64=$(Lr),O.prototype.visitUtf8=$(Ec),O.prototype.visitLargeUtf8=$(Ec),O.prototype.visitBinary=$(wc),O.prototype.visitLargeBinary=$(wc),O.prototype.visitFixedSizeBinary=$(Qu),O.prototype.visitDate=$(Ku),O.prototype.visitDateDay=$(yc),O.prototype.visitDateMillisecond=$(bc),O.prototype.visitTimestamp=$(Zu),O.prototype.visitTimestampSecond=$(Lc),O.prototype.visitTimestampMillisecond=$(Ac),O.prototype.visitTimestampMicrosecond=$(Dc),O.prototype.visitTimestampNanosecond=$(kc),O.prototype.visitTime=$(e_),O.prototype.visitTimeSecond=$(Tc),O.prototype.visitTimeMillisecond=$(Fc),O.prototype.visitTimeMicrosecond=$(xc),O.prototype.visitTimeNanosecond=$(Cc),O.prototype.visitDecimal=$(t_),O.prototype.visitList=$(r_),O.prototype.visitStruct=$(n_),O.prototype.visitUnion=$(s_),O.prototype.visitDenseUnion=$(Mc),O.prototype.visitSparseUnion=$(Pc),O.prototype.visitDictionary=$(a_),O.prototype.visitInterval=$(o_),O.prototype.visitIntervalDayTime=$(Ic),O.prototype.visitIntervalYearMonth=$(Bc),O.prototype.visitDuration=$(c_),O.prototype.visitDurationSecond=$(Rc),O.prototype.visitDurationMillisecond=$(Gc),O.prototype.visitDurationMicrosecond=$(Uc),O.prototype.visitDurationNanosecond=$(jc),O.prototype.visitFixedSizeList=$(l_),O.prototype.visitMap=$(i_);var Te=new O,Ar=Symbol.for("keys"),_i=Symbol.for("vals"),ui=Symbol.for("kKeysAsStrings"),Na=Symbol.for("_kKeysAsStrings"),Bt=class{constructor(e){return this[Ar]=new se([e.children[0]]).memoize(),this[_i]=e.children[1],new Proxy(this,new Va)}get[ui](){return this[Na]||(this[Na]=Array.from(this[Ar].toArray(),String))}[Symbol.iterator](){return new Wa(this[Ar],this[_i])}get size(){return this[Ar].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Ar],t=this[_i],r={};for(let n=-1,a=e.length;++n"".concat(gt(e),": ").concat(gt(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Wa=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),Te.visit(this.vals,e)]})}},Va=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[ui]}has(e,t){return e[ui].includes(t)}getOwnPropertyDescriptor(e,t){if(e[ui].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let r=e[ui].indexOf(t);if(r!==-1){let n=Te.visit(Reflect.get(e,_i),r);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[ui].indexOf(t);return n!==-1?(Re.visit(Reflect.get(e,_i),n,r),Reflect.set(e,t,r)):Reflect.has(e,t)?Reflect.set(e,t,r):!1}};Object.defineProperties(Bt.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ar]:{writable:!0,enumerable:!1,configurable:!1,value:null},[_i]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Na]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Oc;function $i(e,t,r,n){let{length:a=0}=e,o=typeof t!="number"?0:t,l=typeof r!="number"?a:r;return o<0&&(o=(o%a+a)%a),l<0&&(l=(l%a+a)%a),la&&(l=a),n?n(e,o,l):[o,l]}var Br=(e,t)=>e<0?t+e:e,Hc=e=>e!==e;function Dr(e){if(typeof e!="object"||e===null)return Hc(e)?Hc:t=>t===e;if(e instanceof Date){let t=e.valueOf();return r=>r instanceof Date?r.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?wa(e,t):!1:e instanceof Map?__(e):Array.isArray(e)?u_(e):e instanceof se?d_(e):f_(e,!0)}function u_(e){let t=[];for(let r=-1,n=e.length;++r!1;let n=[];for(let a=-1,o=r.length;++a{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return p_(e,r);case Map:return Nc(e,r,r.keys());case Bt:case Er:case Object:case void 0:return Nc(e,r,t||Object.keys(r))}return r instanceof se?m_(e,r):!1}}function p_(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++nRr,getBit:()=>Wc,getBool:()=>vs,packBools:()=>Ur,popcnt_array:()=>Vc,popcnt_bit_range:()=>qi,popcnt_uint32:()=>gs,setBool:()=>h_,truncateBitmap:()=>Gr});function vs(e,t,r,n){return(r&1<>n}function h_(e,t,r){return r?!!(e[t>>3]|=1<>3]&=~(1<0||r.byteLength>3):Ur(new Rr(r,e,t,null,vs)).subarray(0,n)),a}return r}function Ur(e){let t=[],r=0,n=0,a=0;for(let l of e)l&&(a|=1<0)&&(t[r++]=a);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var Rr=class{constructor(e,t,r,n,a){this.bytes=e,this.length=r,this.context=n,this.get=a,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,a=t+(t%8===0?0:8-t%8);return qi(e,t,a)+qi(e,n,r)+Vc(e,a>>3,n-a>>3)}function Vc(e,t,r){let n=0,a=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),l=r===void 0?e.byteLength:a+r;for(;l-a>=4;)n+=gs(o.getUint32(a)),a+=4;for(;l-a>=2;)n+=gs(o.getUint16(a)),a+=2;for(;l-a>=1;)n+=gs(o.getUint8(a)),a+=1;return n}function gs(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var g_=-1,le=class jd{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return R.isSparseUnion(t)?this.children.some(r=>r.nullable):R.isDenseUnion(t)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:r,values:n,nullBitmap:a,typeIds:o}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),a&&(t+=a.byteLength),o&&(t+=o.byteLength),this.children.reduce((l,u)=>l+u.byteLength,t)}get nullCount(){if(R.isUnion(this.type))return this.children.reduce((n,a)=>n+a.nullCount,0);let t=this._nullCount,r;return t<=g_&&(r=this.nullBitmap)&&(this._nullCount=t=r.length===0?0:this.length-qi(r,this.offset,this.offset+this.length)),t}constructor(t,r,n,a,o,l=[],u){this.type=t,this.children=l,this.dictionary=u,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(a||0,-1));let _;o instanceof jd?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=et(t),o&&((_=o[0])&&(this.valueOffsets=_),(_=o[1])&&(this.values=_),(_=o[2])&&(this.nullBitmap=_),(_=o[3])&&(this.typeIds=_)))}getValid(t){let{type:r}=this;if(R.isUnion(r)){let n=r,a=this.children[n.typeIdToChildIndex[this.typeIds[t]]],o=n.mode===he.Dense?this.valueOffsets[t]:t;return a.getValid(o)}if(this.nullable&&this.nullCount>0){let n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!o||o.byteLength<=p)&&(o=new Uint8Array((l+u+63&-64)>>3).fill(255),this.nullCount>0?(o.set(Gr(l,u,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let f=o[p];n=(f&d)!==0,o[p]=r?f|d:f&~d}return n!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(t=this.type,r=this.offset,n=this.length,a=this._nullCount,o=this,l=this.children){return new jd(t,r,n,a,o,l,this.dictionary)}slice(t,r){let{stride:n,typeId:a,children:o}=this,l=+(this._nullCount===0)-1,u=a===16?n:1,_=this._sliceBuffers(t,r,n,a);return this.clone(this.type,this.offset+t,r,l,_,o.length===0||this.valueOffsets?o:this._sliceChildren(o,u*t,u*r))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===y.Null)return this.clone(this.type,0,t,0);let{length:r,nullCount:n}=this,a=new Uint8Array((t+63&-64)>>3).fill(255,0,r>>3);a[r>>3]=(1<0&&a.set(Gr(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[nt.VALIDITY]=a,this.clone(this.type,0,t,n+(t-r),o)}_sliceBuffers(t,r,n,a){let o,{buffers:l}=this;return(o=l[nt.TYPE])&&(l[nt.TYPE]=o.subarray(t,t+r)),(o=l[nt.OFFSET])&&(l[nt.OFFSET]=o.subarray(t,t+r+1))||(o=l[nt.DATA])&&(l[nt.DATA]=a===6?o:o.subarray(n*t,n*(t+r))),l}_sliceChildren(t,r,n){return t.map(a=>a.slice(r,n))}};le.prototype.children=Object.freeze([]);var qa=class Fd extends j{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:r,["offset"]:n=0,["length"]:a=0}=t;return new le(r,n,a,a)}visitBool(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length>>3,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitInt(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitFloat(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitUtf8(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.data),o=z(t.nullBitmap),l=Pr(t.valueOffsets),{["length"]:u=l.length-1,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new le(r,n,u,_,[l,a,o])}visitLargeUtf8(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.data),o=z(t.nullBitmap),l=Bn(t.valueOffsets),{["length"]:u=l.length-1,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new le(r,n,u,_,[l,a,o])}visitBinary(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.data),o=z(t.nullBitmap),l=Pr(t.valueOffsets),{["length"]:u=l.length-1,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new le(r,n,u,_,[l,a,o])}visitLargeBinary(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.data),o=z(t.nullBitmap),l=Bn(t.valueOffsets),{["length"]:u=l.length-1,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new le(r,n,u,_,[l,a,o])}visitFixedSizeBinary(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length/et(r),["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitDate(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length/et(r),["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitTimestamp(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length/et(r),["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitTime(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length/et(r),["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitDecimal(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length/et(r),["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitList(t){let{["type"]:r,["offset"]:n=0,["child"]:a}=t,o=z(t.nullBitmap),l=Pr(t.valueOffsets),{["length"]:u=l.length-1,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new le(r,n,u,_,[l,void 0,o],[a])}visitStruct(t){let{["type"]:r,["offset"]:n=0,["children"]:a=[]}=t,o=z(t.nullBitmap),{length:l=a.reduce((_,{length:d})=>Math.max(_,d),0),nullCount:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,void 0,o],a)}visitUnion(t){let{["type"]:r,["offset"]:n=0,["children"]:a=[]}=t,o=re(r.ArrayType,t.typeIds),{["length"]:l=o.length,["nullCount"]:u=-1}=t;if(R.isSparseUnion(r))return new le(r,n,l,u,[void 0,void 0,void 0,o],a);let _=Pr(t.valueOffsets);return new le(r,n,l,u,[_,void 0,void 0,o],a)}visitDictionary(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.indices.ArrayType,t.data),{["dictionary"]:l=new se([new Fd().visit({type:r.dictionary})])}=t,{["length"]:u=o.length,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new le(r,n,u,_,[void 0,o,a],[],l)}visitInterval(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length/et(r),["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitDuration(t){let{["type"]:r,["offset"]:n=0}=t,a=z(t.nullBitmap),o=re(r.ArrayType,t.data),{["length"]:l=o.length,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,o,a])}visitFixedSizeList(t){let{["type"]:r,["offset"]:n=0,["child"]:a=new Fd().visit({type:r.valueType})}=t,o=z(t.nullBitmap),{["length"]:l=a.length/et(r),["nullCount"]:u=t.nullBitmap?-1:0}=t;return new le(r,n,l,u,[void 0,void 0,o],[a])}visitMap(t){let{["type"]:r,["offset"]:n=0,["child"]:a=new Fd().visit({type:r.childType})}=t,o=z(t.nullBitmap),l=Pr(t.valueOffsets),{["length"]:u=l.length-1,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new le(r,n,u,_,[l,void 0,o],[a])}},v_=new qa;function J(e){return v_.visit(e)}var Xi=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function ys(e){return e.reduce((t,r)=>t+r.nullCount,0)}function bs(e){return e.reduce((t,r,n)=>(t[n+1]=t[n]+r.length,t),new Uint32Array(e.length+1))}function Ss(e,t,r,n){let a=[];for(let o=-1,l=e.length;++o=n)break;if(r>=_+d)continue;if(_>=r&&_+d<=n){a.push(u);continue}let p=Math.max(0,r-_),f=Math.min(n-_,d);a.push(u.slice(p,f-p))}return a.length===0&&a.push(e[0].slice(0,0)),a}function Xa(e,t,r,n){let a=0,o=0,l=t.length-1;do{if(a>=l-1)return r0?0:-1}function b_(e,t){let{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let n=0;for(let a of new Rr(r,e.offset+(t||0),e.length,r,vs)){if(!a)return n;++n}return-1}function K(e,t,r){if(t===void 0)return-1;if(t===null)switch(e.typeId){case y.Union:break;case y.Dictionary:break;default:return b_(e,r)}let n=Te.getVisitFn(e),a=Dr(t);for(let o=(r||0)-1,l=e.length;++o{let a=e.data[n];return a.values.subarray(0,a.length)[Symbol.iterator]()});let r=0;return new Xi(e.data.length,n=>{let a=e.data[n].length,o=e.slice(r,r+a);return r+=a,new Qa(o)})}var Qa=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexu.data):t;if(o.length===0||o.some(u=>!(u instanceof le)))throw new TypeError("Vector constructor expects an Array of Data instances.");let l=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:u,set:_,indexOf:d}=Xc[l.typeId],p=o[0];this.isValid=f=>Qi(p,f),this.get=f=>u(p,f),this.set=(f,m)=>_(p,f,m),this.indexOf=f=>d(p,f),this._offsets=[0,p.length];break}default:Object.setPrototypeOf(this,Qc[l.typeId]),this._offsets=bs(o);break}this.data=o,this.type=l,this.stride=et(l),this.numChildren=(a=(n=l.children)===null||n===void 0?void 0:n.length)!==null&&a!==void 0?a:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,r)=>t+r.byteLength,0)}get nullable(){return zc(this.data)}get nullCount(){return ys(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}get VectorName(){return"".concat(y[this.type.typeId],"Vector")}isValid(t){return!1}get(t){return null}at(t){return this.get(Br(t,this.length))}set(t,r){}indexOf(t,r){return-1}includes(t,r){return this.indexOf(t,r)>-1}[Symbol.iterator](){return fi.visit(this)}concat(...t){return new Qn(this.data.concat(t.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(t,r){return new Qn($i(this,t,r,({data:n,_offsets:a},o,l)=>Ss(n,a,o,l)))}toJSON(){return[...this]}toArray(){let{type:t,data:r,length:n,stride:a,ArrayType:o}=this;switch(t.typeId){case y.Int:case y.Float:case y.Decimal:case y.Time:case y.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,n*a);default:return r.reduce((l,{values:u,length:_})=>(l.array.set(u.subarray(0,_*a),l.offset),l.offset+=_*a,l),{array:new o(n*a),offset:0}).array}}return[...this]}toString(){return"[".concat([...this].join(","),"]")}getChild(t){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&tr[t])):null}get isMemoized(){return R.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(R.isDictionary(this.type)){let t=new Ls(this.data[0].dictionary),r=this.data.map(n=>{let a=n.clone();return a.dictionary=t,a});return new Qn(r)}return new Ls(this)}unmemoize(){if(R.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let a=n.clone();return a.dictionary=t,a});return new Qn(r)}return this}};qc=Symbol.toStringTag,se[qc]=(e=>{e.type=R.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(y).map(r=>y[r]).filter(r=>typeof r=="number"&&r!==y.NONE);for(let r of t){let n=Te.getVisitFnByTypeId(r),a=Re.getVisitFnByTypeId(r),o=jr.getVisitFnByTypeId(r);Xc[r]={get:n,set:a,indexOf:o},Qc[r]=Object.create(e,{isValid:{value:di(Qi)},get:{value:di(Te.getVisitFnByTypeId(r))},set:{value:ws(Re.getVisitFnByTypeId(r))},indexOf:{value:Es(jr.getVisitFnByTypeId(r))}})}return"Vector"})(se.prototype);var Ls=class Wd extends se{constructor(t){super(t.data);let r=this.get,n=this.set,a=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(l){let u=o[l];if(u!==void 0)return u;let _=r.call(this,l);return o[l]=_,_}}),Object.defineProperty(this,"set",{value(l,u){n.call(this,l,u),o[l]=u}}),Object.defineProperty(this,"slice",{value:(l,u)=>new Wd(a.call(this,l,u))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new se(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Yc(e){if(!e||e.length<=0)return function(n){return!0};let t="",r=e.filter(n=>n===n);return r.length>0&&(t=` + switch (x) {`.concat(r.map(n=>` + case `.concat(S_(n),":")).join(""),` + return false; + }`)),e.length!==r.length&&(t=`if (x !== x) return false; +`.concat(t)),new Function("x","".concat(t,` +return true;`))}function S_(e){return typeof e!="bigint"?gt(e):"".concat(gt(e),"n")}function Ya(e,t){let r=Math.ceil(e)*t-1;return(r-r%64+64||64)/t}function Jc(e,t=0){return e.length>=t?e.subarray(0,t):xi(new e.constructor(t),e,0)}var Lt=class{constructor(e,t=0,r=1){this.length=Math.ceil(t/r),this.buffer=new e(this.length),this.stride=r,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,r=this.length*t,n=this.buffer.length;r>=n&&this._resize(n===0?Ya(r*1,this.BYTES_PER_ELEMENT):Ya(r*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=Ya(e*this.stride,this.BYTES_PER_ELEMENT);let t=Jc(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=Jc(this.buffer,e)}},rr=class extends Lt{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}},pi=class extends rr{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:r}=this.reserve(e-this.length+1),n=e>>3,a=e%8,o=r[n]>>a&1;return t?o===0&&(r[n]|=1<=0&&n.fill(n[r],r,e),n[e]=n[e-1]+t,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}},Se=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=et(e),this._nulls=new pi,t&&t.length>0&&(this._isValid=Yc(t))}toVector(){return new se([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:t,_values:r,_nulls:n,_typeIds:a,children:o}=this;return t&&(e+=t.byteLength),r&&(e+=r.byteLength),n&&(e+=n.byteLength),a&&(e+=a.byteLength),o.reduce((l,u)=>l+u.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((t,r)=>t+r.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t="".concat(this.numChildren)){throw new Error('Cannot append children to non-nested type "'.concat(this.type,'"'))}getChildAt(e){return this.children[e]||null}flush(){let e,t,r,n,{type:a,length:o,nullCount:l,_typeIds:u,_offsets:_,_values:d,_nulls:p}=this;(t=u==null?void 0:u.flush(o))?n=_==null?void 0:_.flush(o):(n=_==null?void 0:_.flush(o))?e=d==null?void 0:d.flush(_.last()):e=d==null?void 0:d.flush(o),l>0&&(r=p==null?void 0:p.flush(o));let f=this.children.map(m=>m.flush());return this.clear(),J({type:a,length:o,nullCount:l,children:f,child:f[0],data:e,typeIds:t,nullBitmap:r,valueOffsets:n})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,t,r,n;this.length=0,(e=this._nulls)===null||e===void 0||e.clear(),(t=this._values)===null||t===void 0||t.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(n=this._typeIds)===null||n===void 0||n.clear();for(let a of this.children)a.clear();return this}};Se.prototype.length=1,Se.prototype.stride=1,Se.prototype.children=null,Se.prototype.finished=!1,Se.prototype.nullValues=null,Se.prototype._isValid=()=>!0;var Fe=class extends Se{constructor(e){super(e),this._values=new rr(this.ArrayType,0,this.stride)}setValue(e,t){let r=this._values;return r.reserve(e-r.length+1),super.setValue(e,t)}},ze=class extends Se{constructor(e){super(e),this._pendingLength=0,this._offsets=new mi(e.type)}setValue(e,t){let r=this._pending||(this._pending=new Map),n=r.get(e);n&&(this._pendingLength-=n.length),this._pendingLength+=t instanceof Bt?t[Ar].length:t.length,r.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}},Or=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,r,n){return e.prep(8,24),e.writeInt64(BigInt(n??0)),e.pad(4),e.writeInt32(r),e.writeInt64(BigInt(t??0)),e.offset()}},tt=class Bd{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFooter(t,r){return(r||new Bd).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,r){return t.setPosition(t.position()+4),(r||new Bd).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ue.V1}schema(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Ve).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Or).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new Or).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Me).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,ue.V1)}static addSchema(t,r){t.addFieldOffset(1,r,0)}static addDictionaries(t,r){t.addFieldOffset(2,r,0)}static startDictionariesVector(t,r){t.startVector(24,r,8)}static addRecordBatches(t,r){t.addFieldOffset(3,r,0)}static startRecordBatchesVector(t,r){t.startVector(24,r,8)}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,r){t.finish(r)}static finishSizePrefixedFooterBuffer(t,r){t.finish(r,void 0,!0)}},de=class $n{constructor(t=[],r,n,a=ue.V5){this.fields=t||[],this.metadata=r||new Map,n||(n=Ja(this.fields)),this.dictionaries=n,this.metadataVersion=a}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return"Schema<{ ".concat(this.fields.map((t,r)=>"".concat(r,": ").concat(t)).join(", ")," }>")}select(t){let r=new Set(t),n=this.fields.filter(a=>r.has(a.name));return new $n(n,this.metadata)}selectAt(t){let r=t.map(n=>this.fields[n]).filter(Boolean);return new $n(r,this.metadata)}assign(...t){let r=t[0]instanceof $n?t[0]:Array.isArray(t[0])?new $n(t[0]):new $n(t),n=[...this.fields],a=As(As(new Map,this.metadata),r.metadata),o=r.fields.filter(u=>{let _=n.findIndex(d=>d.name===u.name);return~_?(n[_]=u.clone({metadata:As(As(new Map,n[_].metadata),u.metadata)}))&&!1:!0}),l=Ja(o,new Map);return new $n([...n,...o],a,new Map([...this.dictionaries,...l]))}};de.prototype.fields=null,de.prototype.metadata=null,de.prototype.dictionaries=null;var ie=class Rd{static new(...t){let[r,n,a,o]=t;return t[0]&&typeof t[0]=="object"&&({name:r}=t[0],n===void 0&&(n=t[0].type),a===void 0&&(a=t[0].nullable),o===void 0&&(o=t[0].metadata)),new Rd("".concat(r),n,a,o)}constructor(t,r,n=!1,a){this.name=t,this.type=r,this.nullable=n,this.metadata=a||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return"".concat(this.name,": ").concat(this.type)}clone(...t){let[r,n,a,o]=t;return!t[0]||typeof t[0]!="object"?[r=this.name,n=this.type,a=this.nullable,o=this.metadata]=t:{name:r=this.name,type:n=this.type,nullable:a=this.nullable,metadata:o=this.metadata}=t[0],Rd.new(r,n,a,o)}};ie.prototype.type=null,ie.prototype.name=null,ie.prototype.nullable=null,ie.prototype.metadata=null;function As(e,t){return new Map([...e||new Map,...t||new Map])}function Ja(e,t=new Map){for(let r=-1,n=e.length;++r0&&Ja(a.children,t)}return t}var w_=Ir,E_=Je,ir=class{static decode(e){e=new E_(z(e));let t=tt.getRootAsFooter(e),r=de.decode(t.schema(),new Map,t.version());return new Ka(r,t)}static encode(e){let t=new w_,r=de.encode(t,e.schema);tt.startRecordBatchesVector(t,e.numRecordBatches);for(let o of[...e.recordBatches()].slice().reverse())nr.encode(t,o);let n=t.endVector();tt.startDictionariesVector(t,e.numDictionaries);for(let o of[...e.dictionaryBatches()].slice().reverse())nr.encode(t,o);let a=t.endVector();return tt.startFooter(t),tt.addSchema(t,r),tt.addVersion(t,ue.V5),tt.addRecordBatches(t,n),tt.addDictionaries(t,a),tt.finishFooterBuffer(t,tt.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=ue.V5,r,n){this.schema=e,this.version=t,r&&(this._recordBatches=r),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let e,t=-1,r=this.numRecordBatches;++t=0&&e=0&&e=0&&e=0&&ethis._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(ye);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Be.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Be.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return B(this,void 0,void 0,function*(){return yield this.abort(e),ye})}return(e){return B(this,void 0,void 0,function*(){return yield this.close(),ye})}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,r)=>{this.resolvers.push({resolve:t,reject:r})}):Promise.resolve(ye)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}},Rt=class extends Ds{write(e){if((e=z(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Ti(this.toUint8Array(!0)):this.toUint8Array(!1).then(Ti)}toUint8Array(e=!1){return e?Ye(this._values)[0]:B(this,void 0,void 0,function*(){var t,r,n,a;let o=[],l=0;try{for(var u=!0,_=ut(this),d;d=yield _.next(),t=d.done,!t;u=!0){a=d.value,u=!1;let p=a;o.push(p),l+=p.byteLength}}catch(p){r={error:p}}finally{try{!u&&!t&&(n=_.return)&&(yield n.call(_))}finally{if(r)throw r.error}}return Ye(o,l)[0]})}},Gt=class{constructor(e){e&&(this.source=new Za(Be.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},at=class zd{constructor(t){t instanceof zd?this.source=t.source:t instanceof Rt?this.source=new sr(Be.fromAsyncIterable(t)):In(t)?this.source=new sr(Be.fromNodeStream(t)):Fi(t)?this.source=new sr(Be.fromDOMStream(t)):Mn(t)?this.source=new sr(Be.fromDOMStream(t.body)):dt(t)?this.source=new sr(Be.fromIterable(t)):_t(t)?this.source=new sr(Be.fromAsyncIterable(t)):rt(t)&&(this.source=new sr(Be.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Za=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||ye)}return(e){return Object.create(this.source.return&&this.source.return(e)||ye)}},sr=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return B(this,arguments,void 0,function*(t,r="read"){return yield this.source.next({cmd:r,size:t})})}throw(e){return B(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||ye;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return B(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||ye;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},Ji=class extends Gt{constructor(e,t){super(),this.position=0,this.buffer=z(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:r}=this.readAt(e,4);return new DataView(t,r).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),eKi,Int128:()=>Zi,Int64:()=>ar,Uint64:()=>Le});function hi(e){return e<0&&(e=4294967295+e+1),"0x".concat(e.toString(16))}var gi=8,eo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Ki=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),n=t[3]*r[3];this.buffer[0]=n&65535;let a=n>>>16;return n=t[2]*r[3],a+=n,n=t[3]*r[2]>>>0,a+=n,this.buffer[0]+=a<<16,this.buffer[1]=a>>>0>>16,this.buffer[1]+=t[1]*r[3]+t[2]*r[2]+t[3]*r[1],this.buffer[1]+=t[0]*r[3]+t[1]*r[2]+t[2]*r[1]+t[3]*r[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,r[2]=this.buffer[2]+t.buffer[2]>>>0,r[1]=this.buffer[1]+t.buffer[1]>>>0,r[0]=this.buffer[0]+t.buffer[0]>>>0,r[0]>>0&&++r[1],r[1]>>0&&++r[2],r[2]>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return"".concat(hi(this.buffer[3])," ").concat(hi(this.buffer[2])," ").concat(hi(this.buffer[1])," ").concat(hi(this.buffer[0]))}static multiply(t,r){return new On(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new On(new Uint32Array(t.buffer)).plus(r)}static from(t,r=new Uint32Array(4)){return On.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(4)){return On.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(4)){let n=t.startsWith("-"),a=t.length,o=new On(r);for(let l=n?1:0;l0&&this.readData(e,r)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+t)}readDictionary(e){return this.dictionaries.get(e.id)}},ks=class extends en{constructor(e,t,r,n,a){super(new Uint8Array(0),t,r,n,a),this.sources=e}readNullBitmap(e,t,{offset:r}=this.nextBufferRange()){return t<=0?new Uint8Array(0):Ur(this.sources[r])}readOffsets(e,{offset:t}=this.nextBufferRange()){return re(Uint8Array,re(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return re(Uint8Array,re(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:r}=this;return R.isTimestamp(e)||(R.isInt(e)||R.isTime(e))&&e.bitWidth===64||R.isDuration(e)||R.isDate(e)&&e.unit===Ae.MILLISECOND?re(Uint8Array,ar.convertArray(r[t])):R.isDecimal(e)?re(Uint8Array,Zi.convertArray(r[t])):R.isBinary(e)||R.isLargeBinary(e)||R.isFixedSizeBinary(e)?L_(r[t]):R.isBool(e)?Ur(r[t]):R.isUtf8(e)||R.isLargeUtf8(e)?Ft(r[t].join("")):re(Uint8Array,re(e.ArrayType,r[t].map(n=>+n)))}};function L_(e){let t=e.join(""),r=new Uint8Array(t.length/2);for(let n=0;n>1]=Number.parseInt(t.slice(n,n+2),16);return r}var vi=class extends ze{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,z(t))}_flushPending(e,t){let r=this._offsets,n=this._values.reserve(t).buffer,a=0;for(let[o,l]of e)if(l===void 0)r.set(o,0);else{let u=l.length;n.set(l,a),r.set(o,u),a+=u}}},yi=class extends ze{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,z(t))}_flushPending(e,t){let r=this._offsets,n=this._values.reserve(t).buffer,a=0;for(let[o,l]of e)if(l===void 0)r.set(o,BigInt(0));else{let u=l.length;n.set(l,a),r.set(o,BigInt(u)),a+=u}}},Ts=class extends Se{constructor(e){super(e),this._values=new pi}setValue(e,t){this._values.set(e,+t)}},Nr=class extends Fe{};Nr.prototype._setValue=Ia;var tn=class extends Nr{};tn.prototype._setValue=Zn;var rn=class extends Nr{};rn.prototype._setValue=es;var nn=class extends Fe{};nn.prototype._setValue=Ga;var Fs=class extends Se{constructor({type:e,nullValues:t,dictionaryHashFunction:r}){super({type:new Ze(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Wr({type:this.type.indices,nullValues:t}),this.dictionary=Wr({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,t){let r=this.indices;return t=r.setValid(e,t),this.length=r.length,t}setValue(e,t){let r=this._keysToIndices,n=this.valueToKey(t),a=r[n];return a===void 0&&(r[n]=a=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,a)}flush(){let e=this.type,t=this._dictionary,r=this.dictionary.toVector(),n=this.indices.flush().clone(e);return n.dictionary=t?t.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:"".concat(e)}},sn=class extends Fe{};sn.prototype._setValue=Pa;var xs=class extends Se{setValue(e,t){let[r]=this.children,n=e*this.stride;for(let a=-1,o=t.length;++a0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(e);return this.type=new St(this.type.listSize,new ie(t,e.type,!0)),r}},Vr=class extends Fe{setValue(e,t){this._values.set(e,t)}},Cs=class extends Vr{setValue(e,t){super.setValue(e,zi(t))}},Ms=class extends Vr{},Ps=class extends Vr{},zr=class extends Fe{};zr.prototype._setValue=Ua;var an=class extends zr{};an.prototype._setValue=ls;var on=class extends zr{};on.prototype._setValue=us;var or=class extends Fe{};or.prototype._setValue=ja;var cn=class extends or{};cn.prototype._setValue=_s;var ln=class extends or{};ln.prototype._setValue=ds;var un=class extends or{};un.prototype._setValue=ps;var _n=class extends or{};_n.prototype._setValue=ms;var ot=class extends Fe{setValue(e,t){this._values.set(e,t)}},Is=class extends ot{},Bs=class extends ot{},Rs=class extends ot{},Gs=class extends ot{},Us=class extends ot{},js=class extends ot{},Os=class extends ot{},Hs=class extends ot{},Ns=class extends ze{constructor(e){super(e),this._offsets=new mi(e.type)}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new yt(new ie(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[r]=this.children;for(let[n,a]of e)if(typeof a>"u")t.set(n,0);else{let o=a,l=o.length,u=t.set(n,l).buffer[n];for(let _=-1;++_0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new wt(new ie(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,[r]=this.children;for(let[n,a]of e)if(a===void 0)t.set(n,0);else{let{[n]:o,[n+1]:l}=t.set(n,a.size).buffer;for(let u of a.entries())if(r.set(o,u),++o>=l)break}}},Vs=class extends Se{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}},zs=class extends Se{setValue(e,t){let{children:r,type:n}=this;switch(Array.isArray(t)||t.constructor){case!0:return n.children.forEach((a,o)=>r[o].set(e,t[o]));case Map:return n.children.forEach((a,o)=>r[o].set(e,t.get(a.name)));default:return n.children.forEach((a,o)=>r[o].set(e,t[a.name]))}}setValid(e,t){return super.setValid(e,t)||this.children.forEach(r=>r.setValid(e,t)),t}addChild(e,t="".concat(this.numChildren)){let r=this.children.push(e);return this.type=new ve([...this.type.children,new ie(t,e.type,!0)]),r}},cr=class extends Fe{};cr.prototype._setValue=Ba;var dn=class extends cr{};dn.prototype._setValue=ts;var fn=class extends cr{};fn.prototype._setValue=rs;var pn=class extends cr{};pn.prototype._setValue=is;var mn=class extends cr{};mn.prototype._setValue=ns;var lr=class extends Fe{};lr.prototype._setValue=Ra;var hn=class extends lr{};hn.prototype._setValue=ss;var gn=class extends lr{};gn.prototype._setValue=as;var vn=class extends lr{};vn.prototype._setValue=os;var yn=class extends lr{};yn.prototype._setValue=cs;var bi=class extends Se{constructor(e){super(e),this._typeIds=new rr(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,r){return r===void 0&&(r=this._valueToChildTypeId(this,t,e)),this.setValue(e,t,r),this}setValue(e,t,r){this._typeIds.set(e,r);let n=this.type.typeIdToChildIndex[r],a=this.children[n];a==null||a.set(e,t)}addChild(e,t="".concat(this.children.length)){let r=this.children.push(e),{type:{children:n,mode:a,typeIds:o}}=this,l=[...n,new ie(t,e.type)];return this.type=new bt(a,[...o,r],l),r}_valueToChildTypeId(e,t,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},$s=class extends bi{},qs=class extends bi{constructor(e){super(e),this._offsets=new rr(Int32Array)}setValue(e,t,r){let n=this._typeIds.set(e,r).buffer[e],a=this.getChildAt(this.type.typeIdToChildIndex[n]),o=this._offsets.set(e,a.length).buffer[e];a==null||a.set(o,t)}},bn=class extends ze{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Ft(t))}_flushPending(e,t){}};bn.prototype._flushPending=vi.prototype._flushPending;var Sn=class extends ze{constructor(e){super(e),this._values=new Lt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Ft(t))}_flushPending(e,t){}};Sn.prototype._flushPending=yi.prototype._flushPending;var ro=class extends j{visitNull(){return Vs}visitBool(){return Ts}visitInt(){return ot}visitInt8(){return Is}visitInt16(){return Bs}visitInt32(){return Rs}visitInt64(){return Gs}visitUint8(){return Us}visitUint16(){return js}visitUint32(){return Os}visitUint64(){return Hs}visitFloat(){return Vr}visitFloat16(){return Cs}visitFloat32(){return Ms}visitFloat64(){return Ps}visitUtf8(){return bn}visitLargeUtf8(){return Sn}visitBinary(){return vi}visitLargeBinary(){return yi}visitFixedSizeBinary(){return sn}visitDate(){return Nr}visitDateDay(){return tn}visitDateMillisecond(){return rn}visitTimestamp(){return cr}visitTimestampSecond(){return dn}visitTimestampMillisecond(){return fn}visitTimestampMicrosecond(){return pn}visitTimestampNanosecond(){return mn}visitTime(){return lr}visitTimeSecond(){return hn}visitTimeMillisecond(){return gn}visitTimeMicrosecond(){return vn}visitTimeNanosecond(){return yn}visitDecimal(){return nn}visitList(){return Ns}visitStruct(){return zs}visitUnion(){return bi}visitDenseUnion(){return qs}visitSparseUnion(){return $s}visitDictionary(){return Fs}visitInterval(){return zr}visitIntervalDayTime(){return an}visitIntervalYearMonth(){return on}visitDuration(){return or}visitDurationSecond(){return cn}visitDurationMillisecond(){return ln}visitDurationMicrosecond(){return un}visitDurationNanosecond(){return _n}visitFixedSizeList(){return xs}visitMap(){return Ws}},Kc=new ro,W=class extends j{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((r,n)=>this.compareFields(r,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function Ne(e,t){return t instanceof e.constructor}function $r(e,t){return e===t||Ne(e,t)}function ur(e,t){return e===t||Ne(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Xs(e,t){return e===t||Ne(e,t)&&e.precision===t.precision}function A_(e,t){return e===t||Ne(e,t)&&e.byteWidth===t.byteWidth}function io(e,t){return e===t||Ne(e,t)&&e.unit===t.unit}function wn(e,t){return e===t||Ne(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function En(e,t){return e===t||Ne(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function D_(e,t){return e===t||Ne(e,t)&&e.children.length===t.children.length&&Ut.compareManyFields(e.children,t.children)}function k_(e,t){return e===t||Ne(e,t)&&e.children.length===t.children.length&&Ut.compareManyFields(e.children,t.children)}function no(e,t){return e===t||Ne(e,t)&&e.mode===t.mode&&e.typeIds.every((r,n)=>r===t.typeIds[n])&&Ut.compareManyFields(e.children,t.children)}function T_(e,t){return e===t||Ne(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Ut.visit(e.indices,t.indices)&&Ut.visit(e.dictionary,t.dictionary)}function so(e,t){return e===t||Ne(e,t)&&e.unit===t.unit}function Ln(e,t){return e===t||Ne(e,t)&&e.unit===t.unit}function F_(e,t){return e===t||Ne(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Ut.compareManyFields(e.children,t.children)}function x_(e,t){return e===t||Ne(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Ut.compareManyFields(e.children,t.children)}W.prototype.visitNull=$r,W.prototype.visitBool=$r,W.prototype.visitInt=ur,W.prototype.visitInt8=ur,W.prototype.visitInt16=ur,W.prototype.visitInt32=ur,W.prototype.visitInt64=ur,W.prototype.visitUint8=ur,W.prototype.visitUint16=ur,W.prototype.visitUint32=ur,W.prototype.visitUint64=ur,W.prototype.visitFloat=Xs,W.prototype.visitFloat16=Xs,W.prototype.visitFloat32=Xs,W.prototype.visitFloat64=Xs,W.prototype.visitUtf8=$r,W.prototype.visitLargeUtf8=$r,W.prototype.visitBinary=$r,W.prototype.visitLargeBinary=$r,W.prototype.visitFixedSizeBinary=A_,W.prototype.visitDate=io,W.prototype.visitDateDay=io,W.prototype.visitDateMillisecond=io,W.prototype.visitTimestamp=wn,W.prototype.visitTimestampSecond=wn,W.prototype.visitTimestampMillisecond=wn,W.prototype.visitTimestampMicrosecond=wn,W.prototype.visitTimestampNanosecond=wn,W.prototype.visitTime=En,W.prototype.visitTimeSecond=En,W.prototype.visitTimeMillisecond=En,W.prototype.visitTimeMicrosecond=En,W.prototype.visitTimeNanosecond=En,W.prototype.visitDecimal=$r,W.prototype.visitList=D_,W.prototype.visitStruct=k_,W.prototype.visitUnion=no,W.prototype.visitDenseUnion=no,W.prototype.visitSparseUnion=no,W.prototype.visitDictionary=T_,W.prototype.visitInterval=so,W.prototype.visitIntervalDayTime=so,W.prototype.visitIntervalYearMonth=so,W.prototype.visitDuration=Ln,W.prototype.visitDurationSecond=Ln,W.prototype.visitDurationMillisecond=Ln,W.prototype.visitDurationMicrosecond=Ln,W.prototype.visitDurationNanosecond=Ln,W.prototype.visitFixedSizeList=F_,W.prototype.visitMap=x_;var Ut=new W;function qr(e,t){return Ut.compareSchemas(e,t)}function Zc(e,t){return Ut.compareFields(e,t)}function el(e,t){return Ut.visit(e,t)}function Wr(e){let t=e.type,r=new(Kc.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let n=e.children||[],a={nullValues:e.nullValues},o=Array.isArray(n)?(l,u)=>n[u]||a:({name:l})=>n[l]||a;for(let[l,u]of t.children.entries()){let{type:_}=u,d=o(u,l);r.children.push(Wr(Object.assign(Object.assign({},d),{type:_})))}}return r}function Qs(e,t){return C_(e,t.map(r=>r.data.concat()))}function C_(e,t){let r=[...e.fields],n=[],a={numBatches:t.reduce((f,m)=>Math.max(f,m.length),0)},o=0,l=0,u=-1,_=t.length,d,p=[];for(;a.numBatches-- >0;){for(l=Number.POSITIVE_INFINITY,u=-1;++u<_;)p[u]=d=t[u].shift(),l=Math.min(l,d?d.length:l);Number.isFinite(l)&&(p=M_(r,l,p,t,a),l>0&&(n[o++]=J({type:new ve(r),length:l,nullCount:0,children:p.slice()})))}return[e=e.assign(r),n.map(f=>new De(e,f))]}function M_(e,t,r,n,a){var o;let l=(t+63&-64)>>3;for(let u=-1,_=n.length;++u<_;){let d=r[u],p=d==null?void 0:d.length;if(p>=t)p===t?r[u]=d:(r[u]=d.slice(0,t),a.numBatches=Math.max(a.numBatches,n[u].unshift(d.slice(t,p-t))));else{let f=e[u];e[u]=f.clone({nullable:!0}),r[u]=(o=d==null?void 0:d._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:J({type:f.type,length:t,nullCount:t,nullBitmap:new Uint8Array(l)})}}return r}var tl,We=class ha{constructor(...t){var r,n;if(t.length===0)return this.batches=[],this.schema=new de([]),this._offsets=[0],this;let a,o;t[0]instanceof de&&(a=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let l=_=>{if(_){if(_ instanceof De)return[_];if(_ instanceof ha)return _.batches;if(_ instanceof le){if(_.type instanceof ve)return[new De(new de(_.type.children),_)]}else{if(Array.isArray(_))return _.flatMap(d=>l(d));if(typeof _[Symbol.iterator]=="function")return[..._].flatMap(d=>l(d));if(typeof _=="object"){let d=Object.keys(_),p=d.map(h=>new se([_[h]])),f=a??new de(d.map((h,g)=>new ie(String(h),p[g].type,p[g].nullable))),[,m]=Qs(f,p);return m.length===0?[new De(_)]:m}}}return[]},u=t.flatMap(_=>l(_));if(a=(n=a??((r=u[0])===null||r===void 0?void 0:r.schema))!==null&&n!==void 0?n:new de([]),!(a instanceof de))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let _ of u){if(!(_ instanceof De))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!qr(a,_.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=a,this.batches=u,this._offsets=o??bs(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,r)=>t+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=ys(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(Br(t,this.numRows))}set(t,r){}indexOf(t,r){return-1}[Symbol.iterator](){return this.batches.length>0?fi.visit(new se(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ + `.concat(this.toArray().join(`, + `),` +]`)}concat(...t){let r=this.schema,n=this.data.concat(t.flatMap(({data:a})=>a));return new ha(r,n.map(a=>new De(r,a)))}slice(t,r){let n=this.schema;[t,r]=$i({length:this.numRows},t,r);let a=Ss(this.data,this._offsets,t,r);return new ha(n,a.map(o=>new De(n,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===t))}getChildAt(t){if(t>-1&&tn.children[t]);if(r.length===0){let{type:n}=this.schema.fields[t],a=J({type:n,length:0,nullCount:0});r.push(a._changeLengthAndBackfillNullBitmap(this.numRows))}return new se(r)}return null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(a=>a.name===t),r)}setChildAt(t,r){let n=this.schema,a=[...this.batches];if(t>-1&&tthis.getChildAt(d));[o[t],u[t]]=[l,r],[n,a]=Qs(n,u)}return new ha(n,a)}select(t){let r=this.schema.fields.reduce((n,a,o)=>n.set(a.name,o),new Map);return this.selectAt(t.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(t){let r=this.schema.selectAt(t),n=this.batches.map(a=>a.selectAt(t));return new ha(r,n)}assign(t){let r=this.schema.fields,[n,a]=t.schema.fields.reduce((u,_,d)=>{let[p,f]=u,m=r.findIndex(h=>h.name===_.name);return~m?f[m]=d:p.push(d),u},[[],[]]),o=this.schema.assign(t.schema),l=[...r.map((u,_)=>[_,a[_]]).map(([u,_])=>_===void 0?this.getChildAt(u):t.getChildAt(_)),...n.map(u=>t.getChildAt(u))].filter(Boolean);return new ha(...Qs(o,l))}};tl=Symbol.toStringTag,We[tl]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=di(Qi),e.get=di(Te.getVisitFn(y.Struct)),e.set=ws(Re.getVisitFn(y.Struct)),e.indexOf=Es(jr.getVisitFn(y.Struct)),"Table"))(We.prototype);var il,De=class Dd{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof de))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=J({nullCount:0,type:new ve(this.schema.fields),children:this.schema.fields.map(r=>J({type:r.type,nullCount:0}))})]=t,!(this.data instanceof le))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=rl(this.schema,this.data.children);break}case 1:{let[r]=t,{fields:n,children:a,length:o}=Object.keys(r).reduce((_,d,p)=>(_.children[p]=r[d],_.length=Math.max(_.length,r[d].length),_.fields[p]=ie.new({name:d,type:r[d].type,nullable:!0}),_),{length:0,fields:new Array,children:new Array}),l=new de(n),u=J({type:new ve(n),length:o,children:a,nullCount:0});[this.schema,this.data]=rl(l,u.children,o);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=nl(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return Te.visit(this.data,t)}at(t){return this.get(Br(t,this.numRows))}set(t,r){return Re.visit(this.data,t,r)}indexOf(t,r){return jr.visit(this.data,t,r)}[Symbol.iterator](){return fi.visit(new se([this.data]))}toArray(){return[...this]}concat(...t){return new We(this.schema,[this,...t])}slice(t,r){let[n]=new se([this.data]).slice(t,r).data;return new Dd(this.schema,n)}getChild(t){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&ta.name===t),r)}setChildAt(t,r){let n=this.schema,a=this.data;if(t>-1&&tu.name===o);~l&&(a[l]=this.data.children[l])}return new Dd(r,J({type:n,length:this.numRows,children:a}))}selectAt(t){let r=this.schema.selectAt(t),n=t.map(o=>this.data.children[o]).filter(Boolean),a=J({type:new ve(r.fields),length:this.numRows,children:n});return new Dd(r,a)}};il=Symbol.toStringTag,De[il]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(De.prototype);function rl(e,t,r=t.reduce((n,a)=>Math.max(n,a.length),0)){var n;let a=[...e.fields],o=[...t],l=(r+63&-64)>>3;for(let[u,_]of e.fields.entries()){let d=t[u];(!d||d.length!==r)&&(a[u]=_.clone({nullable:!0}),o[u]=(n=d==null?void 0:d._changeLengthAndBackfillNullBitmap(r))!==null&&n!==void 0?n:J({type:_.type,length:r,nullCount:r,nullBitmap:new Uint8Array(l)}))}return[e.assign(a),J({type:new ve(a),length:r,children:o})]}function nl(e,t,r=new Map){var n,a;if(((n=e==null?void 0:e.length)!==null&&n!==void 0?n:0)>0&&(e==null?void 0:e.length)===(t==null?void 0:t.length))for(let o=-1,l=e.length;++oJ({type:n.type})),r=J({type:new ve(e.fields),nullCount:0,children:t});super(e,r)}},At=class it{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMessage(t,r){return(r||new it).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,r){return t.setPosition(t.position()+4),(r||new it).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ue.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):ne.NONE}header(t){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(t,this.bb_pos+r):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Me).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,ue.V1)}static addHeaderType(t,r){t.addFieldInt8(1,r,ne.NONE)}static addHeader(t,r){t.addFieldOffset(2,r,0)}static addBodyLength(t,r){t.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,r){t.finish(r)}static finishSizePrefixedMessageBuffer(t,r){t.finish(r,void 0,!0)}static createMessage(t,r,n,a,o,l){return it.startMessage(t),it.addVersion(t,r),it.addHeaderType(t,n),it.addHeader(t,a),it.addBodyLength(t,o),it.addCustomMetadata(t,l),it.endMessage(t)}},ao=class extends j{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Oi.startNull(t),Oi.endNull(t)}visitInt(e,t){return mt.startInt(t),mt.addBitWidth(t,e.bitWidth),mt.addIsSigned(t,e.isSigned),mt.endInt(t)}visitFloat(e,t){return br.startFloatingPoint(t),br.addPrecision(t,e.precision),br.endFloatingPoint(t)}visitBinary(e,t){return Bi.startBinary(t),Bi.endBinary(t)}visitLargeBinary(e,t){return Gi.startLargeBinary(t),Gi.endLargeBinary(t)}visitBool(e,t){return Ri.startBool(t),Ri.endBool(t)}visitUtf8(e,t){return Ni.startUtf8(t),Ni.endUtf8(t)}visitLargeUtf8(e,t){return Ui.startLargeUtf8(t),Ui.endLargeUtf8(t)}visitDecimal(e,t){return Pt.startDecimal(t),Pt.addScale(t,e.scale),Pt.addPrecision(t,e.precision),Pt.addBitWidth(t,e.bitWidth),Pt.endDecimal(t)}visitDate(e,t){return hr.startDate(t),hr.addUnit(t,e.unit),hr.endDate(t)}visitTime(e,t){return Ht.startTime(t),Ht.addUnit(t,e.unit),Ht.addBitWidth(t,e.bitWidth),Ht.endTime(t)}visitTimestamp(e,t){let r=e.timezone&&t.createString(e.timezone)||void 0;return Nt.startTimestamp(t),Nt.addUnit(t,e.unit),r!==void 0&&Nt.addTimezone(t,r),Nt.endTimestamp(t)}visitInterval(e,t){return Sr.startInterval(t),Sr.addUnit(t,e.unit),Sr.endInterval(t)}visitDuration(e,t){return gr.startDuration(t),gr.addUnit(t,e.unit),gr.endDuration(t)}visitList(e,t){return ji.startList(t),ji.endList(t)}visitStruct(e,t){return Hi.startStruct_(t),Hi.endStruct_(t)}visitUnion(e,t){ht.startTypeIdsVector(t,e.typeIds.length);let r=ht.createTypeIdsVector(t,e.typeIds);return ht.startUnion(t),ht.addMode(t,e.mode),ht.addTypeIds(t,r),ht.endUnion(t)}visitDictionary(e,t){let r=this.visit(e.indices,t);return Mt.startDictionaryEncoding(t),Mt.addId(t,BigInt(e.id)),Mt.addIsOrdered(t,e.isOrdered),r!==void 0&&Mt.addIndexType(t,r),Mt.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return vr.startFixedSizeBinary(t),vr.addByteWidth(t,e.byteWidth),vr.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return yr.startFixedSizeList(t),yr.addListSize(t,e.listSize),yr.endFixedSizeList(t)}visitMap(e,t){return wr.startMap(t),wr.addKeysSorted(t,e.keysSorted),wr.endMap(t)}},Ys=new ao;function cl(e,t=new Map){return new de(I_(e,t),Js(e.metadata),t)}function oo(e){return new Ge(e.count,ul(e.columns),_l(e.columns))}function ll(e){return new qe(oo(e.data),e.id,e.isDelta)}function I_(e,t){return(e.fields||[]).filter(Boolean).map(r=>ie.fromJSON(r,t))}function sl(e,t){return(e.children||[]).filter(Boolean).map(r=>ie.fromJSON(r,t))}function ul(e){return(e||[]).reduce((t,r)=>[...t,new ct(r.count,B_(r.VALIDITY)),...ul(r.children)],[])}function _l(e,t=[]){for(let r=-1,n=(e||[]).length;++rt+ +(r===0),0)}function dl(e,t){let r,n,a,o,l,u;return!t||!(o=e.dictionary)?(l=ol(e,sl(e,t)),a=new ie(e.name,l,e.nullable,Js(e.metadata))):t.has(r=o.id)?(n=(n=o.indexType)?al(n):new It,u=new Ze(t.get(r),n,r,o.isOrdered),a=new ie(e.name,u,e.nullable,Js(e.metadata))):(n=(n=o.indexType)?al(n):new It,t.set(r,l=ol(e,sl(e,t))),u=new Ze(l,n,r,o.isOrdered),a=new ie(e.name,u,e.nullable,Js(e.metadata))),a||null}function Js(e=[]){return new Map(e.map(({key:t,value:r})=>[t,r]))}function al(e){return new Pe(e.isSigned,e.bitWidth)}function ol(e,t){let r=e.type.name;switch(r){case"NONE":return new He;case"null":return new He;case"binary":return new Wt;case"largebinary":return new Vt;case"utf8":return new zt;case"largeutf8":return new $t;case"bool":return new qt;case"list":return new yt((t||[])[0]);case"struct":return new ve(t||[]);case"struct_":return new ve(t||[])}switch(r){case"int":{let n=e.type;return new Pe(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=e.type;return new st(pe[n.precision])}case"decimal":{let n=e.type;return new Xt(n.scale,n.precision,n.bitWidth)}case"date":{let n=e.type;return new Qt(Ae[n.unit])}case"time":{let n=e.type;return new Yt(G[n.unit],n.bitWidth)}case"timestamp":{let n=e.type;return new Jt(G[n.unit],n.timezone)}case"interval":{let n=e.type;return new Kt(Ce[n.unit])}case"duration":{let n=e.type;return new Zt(G[n.unit])}case"union":{let n=e.type,[a,...o]=(n.mode+"").toLowerCase(),l=a.toUpperCase()+o.join("");return new bt(he[l],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=e.type;return new er(n.byteWidth)}case"fixedsizelist":{let n=e.type;return new St(n.listSize,(t||[])[0])}case"map":{let n=e.type;return new wt((t||[])[0],n.keysSorted)}}throw new Error('Unrecognized type: "'.concat(r,'"'))}var R_=Ir,G_=Je,Xe=class dd{static fromJSON(t,r){let n=new dd(0,ue.V5,r);return n._createHeader=U_(t,r),n}static decode(t){t=new G_(z(t));let r=At.getRootAsMessage(t),n=r.bodyLength(),a=r.version(),o=r.headerType(),l=new dd(n,a,o);return l._createHeader=j_(r,o),l}static encode(t){let r=new R_,n=-1;return t.isSchema()?n=de.encode(r,t.header()):t.isRecordBatch()?n=Ge.encode(r,t.header()):t.isDictionaryBatch()&&(n=qe.encode(r,t.header())),At.startMessage(r),At.addVersion(r,ue.V5),At.addHeader(r,n),At.addHeaderType(r,t.headerType),At.addBodyLength(r,BigInt(t.bodyLength)),At.finishMessageBuffer(r,At.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof de)return new dd(0,ue.V5,ne.Schema,t);if(t instanceof Ge)return new dd(r,ue.V5,ne.RecordBatch,t);if(t instanceof qe)return new dd(r,ue.V5,ne.DictionaryBatch,t);throw new Error("Unrecognized Message header: ".concat(t))}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===ne.Schema}isRecordBatch(){return this.headerType===ne.RecordBatch}isDictionaryBatch(){return this.headerType===ne.DictionaryBatch}constructor(t,r,n,a){this._version=r,this._headerType=n,this.body=new Uint8Array(0),a&&(this._createHeader=()=>a),this._bodyLength=ae(t)}},Ge=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,r){this._nodes=t,this._buffers=r,this._length=ae(e)}},qe=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,r=!1){this._data=e,this._isDelta=r,this._id=ae(t)}},$e=class{constructor(e,t){this.offset=ae(e),this.length=ae(t)}},ct=class{constructor(e,t){this.length=ae(e),this.nullCount=ae(t)}};function U_(e,t){return()=>{switch(t){case ne.Schema:return de.fromJSON(e);case ne.RecordBatch:return Ge.fromJSON(e);case ne.DictionaryBatch:return qe.fromJSON(e)}throw new Error("Unrecognized Message type: { name: ".concat(ne[t],", type: ").concat(t," }"))}}function j_(e,t){return()=>{switch(t){case ne.Schema:return de.decode(e.header(new Ve),new Map,e.version());case ne.RecordBatch:return Ge.decode(e.header(new Ke),e.version());case ne.DictionaryBatch:return qe.decode(e.header(new Ot),e.version())}throw new Error("Unrecognized Message type: { name: ".concat(ne[t],", type: ").concat(t," }"))}}ie.encode=Y_,ie.decode=X_,ie.fromJSON=dl,de.encode=Q_,de.decode=O_,de.fromJSON=cl,Ge.encode=J_,Ge.decode=H_,Ge.fromJSON=oo,qe.encode=K_,qe.decode=N_,qe.fromJSON=ll,ct.encode=Z_,ct.decode=V_,$e.encode=ed,$e.decode=W_;function O_(e,t=new Map,r=ue.V5){let n=q_(e,t);return new de(n,Ks(e),t,r)}function H_(e,t=ue.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new Ge(e.length(),z_(e),$_(e,t))}function N_(e,t=ue.V5){return new qe(Ge.decode(e.data(),t),e.id(),e.isDelta())}function W_(e){return new $e(e.offset(),e.length())}function V_(e){return new ct(e.length(),e.nullCount())}function z_(e){let t=[];for(let r,n=-1,a=-1,o=e.nodesLength();++nie.encode(e,o));Ve.startFieldsVector(e,r.length);let n=Ve.createFieldsVector(e,r),a=t.metadata&&t.metadata.size>0?Ve.createCustomMetadataVector(e,[...t.metadata].map(([o,l])=>{let u=e.createString("".concat(o)),_=e.createString("".concat(l));return Me.startKeyValue(e),Me.addKey(e,u),Me.addValue(e,_),Me.endKeyValue(e)})):-1;return Ve.startSchema(e),Ve.addFields(e,n),Ve.addEndianness(e,td?mr.Little:mr.Big),a!==-1&&Ve.addCustomMetadata(e,a),Ve.endSchema(e)}function Y_(e,t){let r=-1,n=-1,a=-1,o=t.type,l=t.typeId;R.isDictionary(o)?(l=o.dictionary.typeId,a=Ys.visit(o,e),n=Ys.visit(o.dictionary,e)):n=Ys.visit(o,e);let u=(o.children||[]).map(p=>ie.encode(e,p)),_=je.createChildrenVector(e,u),d=t.metadata&&t.metadata.size>0?je.createCustomMetadataVector(e,[...t.metadata].map(([p,f])=>{let m=e.createString("".concat(p)),h=e.createString("".concat(f));return Me.startKeyValue(e),Me.addKey(e,m),Me.addValue(e,h),Me.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),je.startField(e),je.addType(e,n),je.addTypeType(e,l),je.addChildren(e,_),je.addNullable(e,!!t.nullable),r!==-1&&je.addName(e,r),a!==-1&&je.addDictionary(e,a),d!==-1&&je.addCustomMetadata(e,d),je.endField(e)}function J_(e,t){let r=t.nodes||[],n=t.buffers||[];Ke.startNodesVector(e,r.length);for(let l of r.slice().reverse())ct.encode(e,l);let a=e.endVector();Ke.startBuffersVector(e,n.length);for(let l of n.slice().reverse())$e.encode(e,l);let o=e.endVector();return Ke.startRecordBatch(e),Ke.addLength(e,BigInt(t.length)),Ke.addNodes(e,a),Ke.addBuffers(e,o),Ke.endRecordBatch(e)}function K_(e,t){let r=Ge.encode(e,t.data);return Ot.startDictionaryBatch(e),Ot.addId(e,BigInt(t.id)),Ot.addIsDelta(e,t.isDelta),Ot.addData(e,r),Ot.endDictionaryBatch(e)}function Z_(e,t){return ii.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function ed(e,t){return ri.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var td=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),lo=e=>"Expected ".concat(ne[e]," Message in stream, but was null or length 0."),uo=e=>"Header pointer of flatbuffer-encoded ".concat(ne[e]," Message is null or length 0."),hl=(e,t)=>"Expected to read ".concat(e," metadata bytes, but only read ").concat(t,"."),gl=(e,t)=>"Expected to read ".concat(e," bytes for message body, but only read ").concat(t,"."),Si=class{constructor(e){this.source=e instanceof Gt?e:new Gt(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?ye:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(lo(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=z(this.source.read(e));if(t.byteLength[...n,...a.VALIDITY&&[a.VALIDITY]||[],...a.TYPE_ID&&[a.TYPE_ID]||[],...a.OFFSET&&[a.OFFSET]||[],...a.DATA&&[a.DATA]||[],...t(a.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(lo(e));return t.value}readSchema(){let e=ne.Schema,t=this.readMessage(e),r=t==null?void 0:t.header();if(!t||!r)throw new Error(uo(e));return r}},Zs=4,co="ARROW1",wi=new Uint8Array(co.length);for(let e=0;ethis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Be.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Be.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof Cd?t:Fn(t)?id(t):Cn(t)?ad(t):_t(t)?B(this,void 0,void 0,function*(){return yield Cd.from(yield t)}):Mn(t)||Fi(t)||In(t)||rt(t)?sd(new at(t)):nd(new Gt(t))}static readAll(t){return t instanceof Cd?t.isSync()?yl(t):bl(t):Fn(t)||ArrayBuffer.isView(t)||dt(t)||xn(t)?yl(t):bl(t)}},jt=class extends Ue{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Qe(this,arguments,function*(){yield ee(yield*Mr(ei(ut(this[Symbol.iterator]()))))})}},Tr=class extends Ue{constructor(e){super(e),this._impl=e}readAll(){return B(this,void 0,void 0,function*(){var e,t,r,n;let a=new Array;try{for(var o=!0,l=ut(this),u;u=yield l.next(),e=u.done,!e;o=!0){n=u.value,o=!1;let _=n;a.push(_)}}catch(_){t={error:_}}finally{try{!o&&!e&&(r=l.return)&&(yield r.call(l))}finally{if(t)throw t.error}}return a})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Fr=class extends jt{constructor(e){super(e),this._impl=e}},kn=class extends Tr{constructor(e){super(e),this._impl=e}},ta=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let r=this._loadVectors(e,t,this.schema.fields),n=J({type:new ve(this.schema.fields),length:e.length,children:r});return new De(this.schema,n)}_loadDictionaryBatch(e,t){let{id:r,isDelta:n}=e,{dictionaries:a,schema:o}=this,l=a.get(r),u=o.dictionaries.get(r),_=this._loadVectors(e.data,t,[u]);return(l&&n?l.concat(new se(_)):new se(_)).memoize()}_loadVectors(e,t,r){return new en(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},Li=class extends ta{constructor(e,t){super(t),this._reader=Fn(e)?new Dn(this._handle=e):new Si(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=Sl(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):ye}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):ye}next(){if(this.closed)return ye;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let r=e.header(),n=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let r=e.header(),n=t.readMessageBody(e.bodyLength),a=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Xr(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Ai=class extends ta{constructor(e,t){super(t),this._reader=new An(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return B(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return B(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Sl(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):ye})}return(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):ye})}next(){return B(this,void 0,void 0,function*(){if(this.closed)return ye;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let r=e.header(),n=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let r=e.header(),n=yield t.readMessageBody(e.bodyLength),a=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Xr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},ra=class extends Li{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof Ji?e:new Ji(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let r=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(r&&this._handle.seek(r.offset)){let n=this._reader.readMessage(ne.RecordBatch);if(n!=null&&n.isRecordBatch()){let a=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(a,o)}}return null}_readDictionaryBatch(e){var t;let r=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(r&&this._handle.seek(r.offset)){let n=this._reader.readMessage(ne.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let a=n.header(),o=this._reader.readMessageBody(n.bodyLength),l=this._loadDictionaryBatch(a,o);this.dictionaries.set(a.id,l)}}}_readFooter(){let{_handle:e}=this,t=e.size-_o,r=e.readInt32(t),n=e.readAt(t-r,r);return ir.decode(n)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return B(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return B(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let r=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(ne.RecordBatch);if(n!=null&&n.isRecordBatch()){let a=n.header(),o=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(a,o)}}return null})}_readDictionaryBatch(e){return B(this,void 0,void 0,function*(){var t;let r=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(ne.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let a=n.header(),o=yield this._reader.readMessageBody(n.bodyLength),l=this._loadDictionaryBatch(a,o);this.dictionaries.set(a.id,l)}}})}_readFooter(){return B(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-_o,r=yield e.readInt32(t),n=yield e.readAt(t-r,r);return ir.decode(n)})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?ea(t)?new Fr(new ra(e.read())):new jt(new Li(e)):new jt(new Li(function*(){}()))}function sd(e){return B(this,void 0,void 0,function*(){let t=yield e.peek(Ei+7&-8);return t&&t.byteLength>=4?ea(t)?new Fr(new ra(yield e.read())):new Tr(new Ai(e)):new Tr(new Ai(function(){return Qe(this,arguments,function*(){})}()))})}function ad(e){return B(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),r=new kr(e,t);return t>=vl&&ea(yield r.readAt(0,Ei+7&-8))?new kn(new fo(r)):new Tr(new Ai(r))})}var Ee=class qd extends j{static assemble(...t){let r=a=>a.flatMap(o=>Array.isArray(o)?r(o):o instanceof De?o.data.children:o.data),n=new qd;return n.visitMany(r(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof se)return this.visitMany(t.data),this;let{type:r}=t;if(!R.isDictionary(r)){let{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(R.isUnion(r))this.nodes.push(new ct(n,0));else{let{nullCount:a}=t;R.isNull(r)||Dt.call(this,a<=0?new Uint8Array(0):Gr(t.offset,n,t.nullBitmap)),this.nodes.push(new ct(n,a))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function Dt(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new $e(this._byteLength,t)),this._byteLength+=t,this}function od(e){var t;let{type:r,length:n,typeIds:a,valueOffsets:o}=e;if(Dt.call(this,a),r.mode===he.Sparse)return mo.call(this,e);if(r.mode===he.Dense){if(e.offset<=0)return Dt.call(this,o),mo.call(this,e);{let l=new Int32Array(n),u=Object.create(null),_=Object.create(null);for(let d,p,f=-1;++f{let f=r.typeIds[p],m=u[f],h=_[f];return d.slice(m,Math.min(n,h))}))}}return this}function cd(e){let t;return e.nullCount>=e.length?Dt.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?Dt.call(this,Gr(e.offset,e.length,t)):Dt.call(this,Ur(e.values))}function _r(e){return Dt.call(this,e.values.subarray(0,e.length*e.stride))}function ia(e){let{length:t,values:r,valueOffsets:n}=e,a=ae(n[0]),o=ae(n[t]),l=Math.min(o-a,r.byteLength-a);return Dt.call(this,Rn(-a,t+1,n)),Dt.call(this,r.subarray(a,a+l)),this}function ho(e){let{length:t,valueOffsets:r}=e;if(r){let{[0]:n,[t]:a}=r;return Dt.call(this,Rn(-n,t+1,r)),this.visit(e.children[0].slice(n,a-n))}return this.visit(e.children[0])}function mo(e){return this.visitMany(e.type.children.map((t,r)=>e.children[r]).filter(Boolean))[0]}Ee.prototype.visitBool=cd,Ee.prototype.visitInt=_r,Ee.prototype.visitFloat=_r,Ee.prototype.visitUtf8=ia,Ee.prototype.visitLargeUtf8=ia,Ee.prototype.visitBinary=ia,Ee.prototype.visitLargeBinary=ia,Ee.prototype.visitFixedSizeBinary=_r,Ee.prototype.visitDate=_r,Ee.prototype.visitTimestamp=_r,Ee.prototype.visitTime=_r,Ee.prototype.visitDecimal=_r,Ee.prototype.visitList=ho,Ee.prototype.visitStruct=mo,Ee.prototype.visitUnion=od,Ee.prototype.visitInterval=_r,Ee.prototype.visitDuration=_r,Ee.prototype.visitFixedSizeList=ho,Ee.prototype.visitMap=ho;var Qr=class extends Hr{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}constructor(e){super(),this._position=0,this._started=!1,this._sink=new Rt,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Oe(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return _t(e)?e.then(t=>this.writeAll(t)):rt(e)?vo(this,e):go(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof Rt?this._sink=e:(this._sink=new Rt,e&&Go(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&Uo(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!qr(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof We&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof De&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!qr(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof De?e instanceof Xr||this._writeRecordBatch(e):e instanceof We?this.writeAll(e.batches):dt(e)&&this.writeAll(e)}_writeMessage(e,t=8){let r=t-1,n=Xe.encode(e),a=n.byteLength,o=this._writeLegacyIpcFormat?4:8,l=a+o+r&~r,u=l-a-o;return e.headerType===ne.RecordBatch?this._recordBatchBlocks.push(new nr(l,e.bodyLength,this._position)):e.headerType===ne.DictionaryBatch&&this._dictionaryBlocks.push(new nr(l,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(l-o)),a>0&&this._write(n),this._writePadding(u)}_write(e){if(this._started){let t=z(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Xe.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(wi)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:r,bufferRegions:n,buffers:a}=Ee.assemble(e),o=new Ge(e.numRows,r,n),l=Xe.from(o,t);return this._writeDictionaries(e)._writeMessage(l)._writeBodyBuffers(a)}_writeDictionaryBatch(e,t,r=!1){let{byteLength:n,nodes:a,bufferRegions:o,buffers:l}=Ee.assemble(new se([e])),u=new Ge(e.length,a,o),_=new qe(u,t,r),d=Xe.from(_,n);return this._writeMessage(d)._writeBodyBuffers(l)}_writeBodyBuffers(e){let t,r,n;for(let a=-1,o=e.length;++a0&&(this._write(t),(n=(r+7&-8)-r)>0&&this._writePadding(n));return this}_writeDictionaries(e){var t,r;for(let[n,a]of e.dictionaries){let o=(t=a==null?void 0:a.data)!==null&&t!==void 0?t:[],l=this._seenDictionaries.get(n),u=(r=this._dictionaryDeltaOffsets.get(n))!==null&&r!==void 0?r:0;if(!l||l.data[0]!==o[0])for(let[_,d]of o.entries())this._writeDictionaryBatch(d,n,_>0);else if(un.writeAll(a)):rt(t)?vo(n,t):go(n,t)}},Jr=class Xd extends Qr{static writeAll(t){let r=new Xd;return _t(t)?t.then(n=>r.writeAll(n)):rt(t)?vo(r,t):go(r,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,r,n=!1){if(!n&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,r,n)}_writeFooter(t){let r=ir.encode(new ir(t,ue.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}};function go(e,t){let r=t;t instanceof We&&(r=t.batches,e.reset(void 0,t.schema));for(let n of r)e.write(n);return e.finish()}function vo(e,t){return B(this,void 0,void 0,function*(){var r,n,a,o,l,u,_;try{for(r=!0,n=ut(t);a=yield n.next(),o=a.done,!o;r=!0){_=a.value,r=!1;let d=_;e.write(d)}}catch(d){l={error:d}}finally{try{!r&&!o&&(u=n.return)&&(yield u.call(n))}finally{if(l)throw l.error}}return e.finish()})}function wl(e,t){if(rt(e))return ud(e,t);if(dt(e))return ld(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function ld(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,a=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(l){o(l,r||(r=e[Symbol.iterator]()))},pull(l){r?o(l,r):l.close()},cancel(){(r!=null&&r.return&&r.return()||!0)&&(r=null)}}),Object.assign({highWaterMark:n?a:void 0},t));function o(l,u){let _,d=null,p=l.desiredSize||null;for(;!(d=u.next(n?p:null)).done;)if(ArrayBuffer.isView(d.value)&&(_=z(d.value))&&(p!=null&&n&&(p=p-_.byteLength+1),d.value=_),l.enqueue(d.value),p!=null&&--p<=0)return;l.close()}}function ud(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,a=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(l){return B(this,void 0,void 0,function*(){yield o(l,r||(r=e[Symbol.asyncIterator]()))})},pull(l){return B(this,void 0,void 0,function*(){r?yield o(l,r):l.close()})},cancel(){return B(this,void 0,void 0,function*(){(r!=null&&r.return&&(yield r.return())||!0)&&(r=null)})}}),Object.assign({highWaterMark:n?a:void 0},t));function o(l,u){return B(this,void 0,void 0,function*(){let _,d=null,p=l.desiredSize||null;for(;!(d=yield u.next(n?p:null)).done;)if(ArrayBuffer.isView(d.value)&&(_=z(d.value))&&(p!=null&&n&&(p=p-_.byteLength+1),d.value=_),l.enqueue(d.value),p!=null&&--p<=0)return;l.close()})}}function Al(e){return new yo(e)}var yo=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:r,["queueingStrategy"]:n="count"}=e,a=Bo(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Wr(a),this._getSize=n!=="bytes"?El:Ll;let{["highWaterMark"]:o=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:l=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:u=>{this._maybeFlush(this._builder,this._controller=u)},start:u=>{this._maybeFlush(this._builder,this._controller=u)}},{highWaterMark:o,size:n!=="bytes"?El:Ll}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:l,size:u=>this._writeValueAndReturnChunkSize(u)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!=null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t==null?e.close():e.enqueue(t)}},El=e=>{var t;return(t=e==null?void 0:e.length)!==null&&t!==void 0?t:0},Ll=e=>{var t;return(t=e==null?void 0:e.byteLength)!==null&&t!==void 0?t:0};function na(e,t){let r=new Rt,n=null,a=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield r.close()})},start(u){return B(this,void 0,void 0,function*(){yield l(u,n||(n=yield o()))})},pull(u){return B(this,void 0,void 0,function*(){n?yield l(u,n):u.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:a};function o(){return B(this,void 0,void 0,function*(){return yield(yield Ue.from(r)).open(t)})}function l(u,_){return B(this,void 0,void 0,function*(){let d=u.desiredSize,p=null;for(;!(p=yield _.next()).done;)if(u.enqueue(p.value),d!=null&&--d<=0)return;u.close()})}}function sa(e,t){let r=new this(e),n=new at(r),a=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield n.cancel()})},pull(l){return B(this,void 0,void 0,function*(){yield o(l)})},start(l){return B(this,void 0,void 0,function*(){yield o(l)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(r,e),readable:a};function o(l){return B(this,void 0,void 0,function*(){let u=null,_=l.desiredSize;for(;u=yield n.read(_||null);)if(l.enqueue(u),_!=null&&(_-=u.byteLength)<=0)return;l.close()})}}function aa(e,t="stream"){return(t==="stream"?Yr:Jr).writeAll(e).toUint8Array(!0)}Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},xa),to),$a),Ca),Ea),za),Da),{compareSchemas:qr,compareFields:Zc,compareTypes:el}),Be.toDOMStream=wl,Se.throughDOM=Al,Ue.throughDOM=na,Fr.throughDOM=na,jt.throughDOM=na,Qr.throughDOM=sa,Jr.throughDOM=sa,Yr.throughDOM=sa;function Di(e){switch(e.typeId){case y.Binary:return{sqlType:"binary"};case y.Bool:return{sqlType:"bool"};case y.Date:return{sqlType:"date"};case y.DateDay:return{sqlType:"date32[d]"};case y.DateMillisecond:return{sqlType:"date64[ms]"};case y.Decimal:{let t=e;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case y.Float:return{sqlType:"float"};case y.Float16:return{sqlType:"float16"};case y.Float32:return{sqlType:"float32"};case y.Float64:return{sqlType:"float64"};case y.Int:return{sqlType:"int32"};case y.Int16:return{sqlType:"int16"};case y.Int32:return{sqlType:"int32"};case y.Int64:return{sqlType:"int64"};case y.Uint16:return{sqlType:"uint16"};case y.Uint32:return{sqlType:"uint32"};case y.Uint64:return{sqlType:"uint64"};case y.Uint8:return{sqlType:"uint8"};case y.IntervalDayTime:return{sqlType:"interval[dt]"};case y.IntervalYearMonth:return{sqlType:"interval[m]"};case y.List:return{sqlType:"list",valueType:Di(e.valueType)};case y.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:e.byteWidth};case y.Null:return{sqlType:"null"};case y.Utf8:return{sqlType:"utf8"};case y.Struct:return{sqlType:"struct",fields:e.children.map(t=>oa(t.name,t.type))};case y.Map:{let t=e;return{sqlType:"map",keyType:Di(t.keyType),valueType:Di(t.valueType)}}case y.Time:return{sqlType:"time[s]"};case y.TimeMicrosecond:return{sqlType:"time[us]"};case y.TimeMillisecond:return{sqlType:"time[ms]"};case y.TimeNanosecond:return{sqlType:"time[ns]"};case y.TimeSecond:return{sqlType:"time[s]"};case y.Timestamp:return{sqlType:"timestamp",timezone:e.timezone||void 0};case y.TimestampSecond:return{sqlType:"timestamp[s]",timezone:e.timezone||void 0};case y.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:e.timezone||void 0};case y.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:e.timezone||void 0};case y.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(e.toString()))}function oa(e,t){let r=Di(t);return r.name=e,r}var ca=class{constructor(){this._bindings=null,this._nextMessageId=0}log(e){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:"LOG",data:e},[])}sendOK(e){this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"OK",data:null},[])}failWith(e,t){let r={name:t.name,message:t.message,stack:t.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"ERROR",data:r},[])}async onMessage(e){switch(e.type){case"PING":this.sendOK(e);return;case"INSTANTIATE":this._bindings!=null&&this.failWith(e,new Error("duckdb already initialized"));try{this._bindings=await this.instantiate(e.data[0],e.data[1],t=>{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"INSTANTIATE_PROGRESS",data:t},[])}),this.sendOK(e)}catch(t){console.log(t),this._bindings=null,this.failWith(e,t)}return}if(!this._bindings)return this.failWith(e,new Error("duckdb is not initialized"));try{switch(e.type){case"GET_VERSION":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"VERSION_STRING",data:this._bindings.getVersion()},[]);break;case"GET_FEATURE_FLAGS":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FEATURE_FLAGS",data:this._bindings.getFeatureFlags()},[]);break;case"RESET":this._bindings.reset(),this.sendOK(e);break;case"OPEN":this._bindings.open(e.data),this.sendOK(e);break;case"DROP_FILE":this._bindings.dropFile(e.data),this.sendOK(e);break;case"DROP_FILES":this._bindings.dropFiles(),this.sendOK(e);break;case"FLUSH_FILES":this._bindings.flushFiles(),this.sendOK(e);break;case"CONNECT":{let t=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"CONNECTION_INFO",data:t.useUnsafe((r,n)=>n)},[]);break}case"DISCONNECT":this._bindings.disconnect(e.data),this.sendOK(e);break;case"CREATE_PREPARED":{let t=this._bindings.createPrepared(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"PREPARED_STATEMENT_ID",data:t},[]);break}case"CLOSE_PREPARED":{this._bindings.closePrepared(e.data[0],e.data[1]),this.sendOK(e);break}case"RUN_PREPARED":{let t=this._bindings.runPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"RUN_QUERY":{let t=this._bindings.runQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"SEND_PREPARED":{let t=this._bindings.sendPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER",data:t},[t.buffer]);break}case"START_PENDING_QUERY":{let t=this._bindings.startPendingQuery(e.data[0],e.data[1]),r=[];t&&r.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},r);break}case"POLL_PENDING_QUERY":{let t=this._bindings.pollPendingQuery(e.data),r=[];t&&r.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},r);break}case"CANCEL_PENDING_QUERY":{let t=this._bindings.cancelPendingQuery(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"SUCCESS",data:t},[]);break}case"FETCH_QUERY_RESULTS":{let t=this._bindings.fetchQueryResults(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_CHUNK",data:t},[t.buffer]);break}case"GET_TABLE_NAMES":{let t=this._bindings.getTableNames(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"TABLE_NAMES",data:t},[]);break}case"GLOB_FILE_INFOS":{let t=this._bindings.globFiles(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_INFOS",data:t},[]);break}case"REGISTER_FILE_URL":this._bindings.registerFileURL(e.data[0],e.data[1],e.data[2],e.data[3]),this.sendOK(e);break;case"REGISTER_FILE_BUFFER":this._bindings.registerFileBuffer(e.data[0],e.data[1]),this.sendOK(e);break;case"REGISTER_FILE_HANDLE":this._bindings.registerFileHandle(e.data[0],e.data[1],e.data[2],e.data[3]),this.sendOK(e);break;case"COPY_FILE_TO_PATH":this._bindings.copyFileToPath(e.data[0],e.data[1]),this.sendOK(e);break;case"COPY_FILE_TO_BUFFER":{let t=this._bindings.copyFileToBuffer(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_BUFFER",data:t},[]);break}case"COLLECT_FILE_STATISTICS":this._bindings.collectFileStatistics(e.data[0],e.data[1]),this.sendOK(e);break;case"EXPORT_FILE_STATISTICS":{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_STATISTICS",data:this._bindings.exportFileStatistics(e.data)},[]);break}case"INSERT_ARROW_FROM_IPC_STREAM":{this._bindings.insertArrowFromIPCStream(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_CSV_FROM_PATH":{this._bindings.insertCSVFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_JSON_FROM_PATH":{this._bindings.insertJSONFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"TOKENIZE":{let t=this._bindings.tokenize(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"SCRIPT_TOKENS",data:t},[]);break}}}catch(t){return console.log(t),this.failWith(e,t)}}},Bl=Po(Fl()),la=class{constructor(e,t){this._bindings=e,this._conn=t}close(){this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}query(e){let t=this._bindings.runQuery(this._conn,e),r=Ue.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new We(r)}async send(e){let t=this._bindings.startPendingQuery(this._conn,e);for(;t==null;)t=await new Promise((a,o)=>{try{a(this._bindings.pollPendingQuery(this._conn))}catch(l){console.log(l),o(l)}});let r=new ua(this._bindings,this._conn,t),n=Ue.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}cancelSent(){return this._bindings.cancelPendingQuery(this._conn)}getTableNames(e){return this._bindings.getTableNames(this._conn,e)}prepare(e){let t=this._bindings.createPrepared(this._conn,e);return new Eo(this._bindings,this._conn,t)}createScalarFunction(e,t,r){this._bindings.createScalarFunction(this._conn,e,t,r)}insertArrowTable(e,t){let r=aa(e,"stream");this.insertArrowFromIPCStream(r,t)}insertArrowFromIPCStream(e,t){this._bindings.insertArrowFromIPCStream(this._conn,e,t)}insertCSVFromPath(e,t){this._bindings.insertCSVFromPath(this._conn,e,t)}insertJSONFromPath(e,t){this._bindings.insertJSONFromPath(this._conn,e,t)}},ua=class{constructor(e,t,r){this.bindings=e,this.conn=t,this.header=r,this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e=this.bindings.fetchQueryResults(this.conn);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},Eo=class{constructor(e,t,r){this.bindings=e,this.connectionId=t,this.statementId=r}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let t=this.bindings.runPrepared(this.connectionId,this.statementId,e),r=Ue.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new We(r)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),r=new ua(this.bindings,this.connectionId,t),n=Ue.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}},Ml=new TextEncoder,xl=new TextDecoder("utf-8");function Lo(e,t,r){let n=Ml.encode(r),a=e._malloc(n.byteLength),o=e.HEAPU8.subarray(a,a+n.byteLength);o.set(n),e.HEAPF64[(t>>3)+0]=1,e.HEAPF64[(t>>3)+1]=a,e.HEAPF64[(t>>3)+2]=o.byteLength}function Do(e){switch(e){case"UINT8":case"INT8":return 1;case"INT32":case"FLOAT":return 4;case"INT64":case"UINT64":case"DOUBLE":case"VARCHAR":return 8;default:return 0}}function Ao(e,t,r,n){let a=e.HEAPU8.subarray(t,t+n*Do(r));switch(r){case"UINT8":return new Uint8Array(a.buffer,a.byteOffset,n);case"INT8":return new Int8Array(a.buffer,a.byteOffset,n);case"INT32":return new Int32Array(a.buffer,a.byteOffset,n);case"FLOAT":return new Float32Array(a.buffer,a.byteOffset,n);case"DOUBLE":return new Float64Array(a.buffer,a.byteOffset,n);case"VARCHAR":return new Float64Array(a.buffer,a.byteOffset,n);default:return new Array(0)}}function Cl(e,t,r){let n=e.HEAPU8.subarray(t,t+r);return new Uint8Array(n.buffer,n.byteOffset,r)}function _a(e,t,r){let n=e.HEAPU8.subarray(t,t+r*8);return new Float64Array(n.buffer,n.byteOffset,r)}function Pl(e,t,r,n,a,o,l,u){try{let _=e._udfFunctions.get(n);if(!_){Lo(t,r,"Unknown UDF with id: "+n);return}let d=xl.decode(t.HEAPU8.subarray(a,a+o)),p=JSON.parse(d),f=_a(t,l,u/8),m=E=>{var P;let k=null;switch(E.validityBuffer!==void 0&&(k=Cl(t,f[E.validityBuffer],p.rows)),E.physicalType){case"VARCHAR":{if(E.dataBuffer===null||E.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(E.lengthBuffer===null||E.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let C=Ao(t,f[E.dataBuffer],E.physicalType,p.rows),F=[],U=_a(t,f[E.lengthBuffer],p.rows);for(let D=0;DF[D]}case"STRUCT":{let C={},F=[];for(let U=0;U<(((P=E.children)==null?void 0:P.length)||0);++U){let D=E.children[U],I=m(D);F.push(Q=>{C[D.name]=I(Q)})}return k!=null?U=>{if(!k[U])return null;for(let D of F)D(U);return C}:U=>{for(let D of F)D(U);return C}}default:{if(E.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+E.physicalType);let C=Ao(t,f[E.dataBuffer],E.physicalType,p.rows);return k!=null?F=>k[F]?C[F]:null:F=>C[F]}}},h=[];for(let E=0;E>3)+0]=0,t.HEAPF64[(r>>3)+1]=x,t.HEAPF64[(r>>3)+2]=0}catch(_){Lo(t,r,_.toString())}}function hd(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var gd=hd();function lt(e,t){console.error("FAIL WITH: ".concat(t)),e.ccall("duckdb_web_fail_with",null,["string"],[t])}function Kr(e,t,r){let n=e.HEAPU8.subarray(t,t+r),a=new Uint8Array(new ArrayBuffer(n.byteLength));return a.set(n),a}function te(e,t,r){return gd(e.HEAPU8.subarray(t,t+r))}function fe(e,t,r,n){let a=e.stackSave(),o=e.stackAlloc(3*8);r.unshift("number"),n.unshift(o),e.ccall(t,null,r,n);let l=e.HEAPF64[(o>>3)+0],u=e.HEAPF64[(o>>3)+1],_=e.HEAPF64[(o>>3)+2];return e.stackRestore(a),[l,u,_]}function be(e){e.ccall("duckdb_web_clear_response",null,[],[])}var da=class{constructor(e){let t=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),r=new Uint8Array(new ArrayBuffer(e.byteLength));r.set(e.subarray(7*8)),this.totalFileReadsCold=t[0],this.totalFileReadsAhead=t[1],this.totalFileReadsCached=t[2],this.totalFileWrites=t[3],this.totalPageAccesses=t[4],this.totalPageLoads=t[5],this.blockSize=t[6],this.blockStats=r}getBlockStats(e,t){return t=t||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},t.file_writes=this.blockStats[e*3+0]&15,t.file_reads_cold=this.blockStats[e*3+0]>>4,t.file_reads_ahead=this.blockStats[e*3+1]&15,t.file_reads_cached=this.blockStats[e*3+1]>>4,t.page_accesses=this.blockStats[e*3+1]&15,t.page_loads=this.blockStats[e*3+1]>>4,t}},Il=new TextEncoder,fa=class{constructor(e,t){this._instance=null,this._initPromise=null,this._initPromiseResolver=()=>{},this.onInstantiationProgress=[],this._logger=e,this._runtime=t,this._nextUDFId=1}get logger(){return this._logger}get mod(){return this._instance}get pthread(){return this.mod.PThread||null}async instantiate(e=t=>{}){return this._instance!=null?this:(this._initPromise!=null&&(this.onInstantiationProgress.push(e),await this._initPromise),this._initPromise=new Promise(t=>{this._initPromiseResolver=t}),this.onInstantiationProgress=[e],this._instance=await this.instantiateImpl({print:console.log.bind(console),printErr:console.log.bind(console),onRuntimeInitialized:this._initPromiseResolver}),await this._initPromise,this._initPromise=null,this.onInstantiationProgress=this.onInstantiationProgress.filter(t=>t!=e),globalThis.DUCKDB_BINDINGS=this,this)}open(e){let[t,r,n]=fe(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==0)throw new Error(te(this.mod,r,n));be(this.mod)}reset(){let[e,t,r]=fe(this.mod,"duckdb_web_reset",[],[]);if(e!==0)throw new Error(te(this.mod,t,r));be(this.mod)}getVersion(){let[e,t,r]=fe(this.mod,"duckdb_web_get_version",[],[]);if(e!==0)throw new Error(te(this.mod,t,r));let n=te(this.mod,t,r);return be(this.mod),n}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,r,n]=fe(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=te(this.mod,r,n);return be(this.mod),JSON.parse(a)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new la(this,e)}disconnect(e){if(this.mod.ccall("duckdb_web_disconnect",null,["number"],[e]),this.pthread)for(let t of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])t.postMessage({cmd:"dropUDFFunctions",connectionId:e})}runQuery(e,t){let r=Il.encode(t),n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[a,o,l]=fe(this.mod,"duckdb_web_query_run_buffer",["number","number","number"],[e,n,r.length]);if(a!==0)throw new Error(te(this.mod,o,l));let u=Kr(this.mod,o,l);return be(this.mod),this.mod._free(n),u}startPendingQuery(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_pending_query_start",["number","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));if(n==0)return null;let o=Kr(this.mod,n,a);return be(this.mod),o}pollPendingQuery(e){let[t,r,n]=fe(this.mod,"duckdb_web_pending_query_poll",["number"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));if(r==0)return null;let a=Kr(this.mod,r,n);return be(this.mod),a}cancelPendingQuery(e){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[e])}fetchQueryResults(e){let[t,r,n]=fe(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=Kr(this.mod,r,n);return be(this.mod),a}getTableNames(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_get_tablenames",["number","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));let o=te(this.mod,n,a);return be(this.mod),JSON.parse(o)}createScalarFunction(e,t,r,n){let a={functionId:this._nextUDFId,name:t,returnType:Di(r)},o={functionId:a.functionId,connectionId:e,name:t,returnType:r,func:n};this._nextUDFId+=1;let[l,u,_]=fe(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[e,JSON.stringify(a)]);if(l!==0)throw new Error(te(this.mod,u,_));if(be(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(o.functionId,o),this.pthread)for(let d of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])d.postMessage({cmd:"registerUDFFunction",udf:o})}createPrepared(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));return be(this.mod),n}closePrepared(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));be(this.mod)}runPrepared(e,t,r){let[n,a,o]=fe(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(te(this.mod,a,o));let l=Kr(this.mod,a,o);return be(this.mod),l}sendPrepared(e,t,r){let[n,a,o]=fe(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(te(this.mod,a,o));let l=Kr(this.mod,a,o);return be(this.mod),l}insertArrowFromIPCStream(e,t,r){if(t.length==0)return;let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let a=r?JSON.stringify(r):"",[o,l,u]=fe(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,n,t.length,a]);if(o!==0)throw new Error(te(this.mod,l,u))}insertCSVFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let _ in r.columns)r.columnsFlat.push(oa(_,r.columns[_]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[o,l,u]=fe(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,a]);if(o!==0)throw new Error(te(this.mod,l,u))}insertJSONFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let _ in r.columns)r.columnsFlat.push(oa(_,r.columns[_]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[o,l,u]=fe(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,a]);if(o!==0)throw new Error(te(this.mod,l,u))}globFiles(e){let[t,r,n]=fe(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=te(this.mod,r,n);be(this.mod);let o=JSON.parse(a);return o??[]}registerFileURL(e,t,r,n=!1){t===void 0&&(t=e);let[a,o,l]=fe(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t,r,n]);if(a!==0)throw new Error(te(this.mod,o,l));be(this.mod)}registerFileText(e,t){let r=Il.encode(t);this.registerFileBuffer(e,r)}registerFileBuffer(e,t){let r=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(r,r+t.length).set(t);let[n,a,o]=fe(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,r,t.length]);if(n!==0)throw new Error(te(this.mod,a,o));be(this.mod)}registerFileHandle(e,t,r,n){let[a,o,l]=fe(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[e,e,r,n]);if(a!==0)throw new Error(te(this.mod,o,l));if(be(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),this.pthread){for(let u of this.pthread.runningWorkers)u.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:t});for(let u of this.pthread.unusedWorkers)u.postMessage({cmd:"dropFileHandle",fileName:e})}}dropFile(e){let[t,r,n]=fe(this.mod,"duckdb_web_fs_drop_file",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));be(this.mod)}dropFiles(){let[e,t,r]=fe(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==0)throw new Error(te(this.mod,t,r));be(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a));be(this.mod)}copyFileToBuffer(e){let[t,r,n]=fe(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));let a=this.mod.HEAPU8.subarray(r,r+n),o=new Uint8Array(a.length);return o.set(a),be(this.mod),o}collectFileStatistics(e,t){let[r,n,a]=fe(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(r!==0)throw new Error(te(this.mod,n,a))}exportFileStatistics(e){let[t,r,n]=fe(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==0)throw new Error(te(this.mod,r,n));return new da(this.mod.HEAPU8.subarray(r,r+n))}},pa=class extends fa{constructor(e,t,r,n){super(e,t),this.mainModuleURL=r,this.pthreadWorkerURL=n}locateFile(e,t){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error("WASM instantiation requested unexpected file: prefix=".concat(t," path=").concat(e))}instantiateWasm(e,t){globalThis.DUCKDB_RUNTIME=this._runtime;let r=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"){let n=(async()=>{var a;let o=new Request(this.mainModuleURL),l=await fetch(o),u=l.headers.get("content-length"),_=u&&parseInt(u,10)||0,d=new Date,p={startedAt:d,updatedAt:d,bytesTotal:_||0,bytesLoaded:0},f={transform(h,g){p.bytesLoaded+=h.byteLength;let b=new Date;if(b.getTime()-p.updatedAt.getTime()<20){p.updatedAt=b,g.enqueue(h);return}for(let v of r)v(p);g.enqueue(h)}},m=new TransformStream(f);return new Response((a=l.body)==null?void 0:a.pipeThrough(m),l)})();WebAssembly.instantiateStreaming(n,e).then(a=>{t(a.instance,a.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let n=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(n),e).then(a=>{t(a.instance,a.module)})}else if(typeof XMLHttpRequest=="function"){let n=new XMLHttpRequest,a=this.mainModuleURL,o=new Date,l={startedAt:o,updatedAt:o,bytesTotal:0,bytesLoaded:0};n.open("GET",a),n.responseType="arraybuffer",n.onerror=u=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+u}),new Error(u.toString())},n.onprogress=u=>{l.bytesTotal=u.total,l.bytesLoaded=u.loaded;let _=new Date;if(_.getTime()-l.updatedAt.getTime()<20){l.updatedAt=_;return}for(let d of r)d(l)},n.onload=()=>{WebAssembly.instantiate(n.response,e).then(u=>{t(u.instance,u.module)}).catch(u=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+u}),new Error(u)})},n.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let n=new Request(this.mainModuleURL),a=await(await fetch(n)).arrayBuffer();WebAssembly.instantiate(a,e).then(o=>{t(o.instance,o.module)})})();return[]}},ma=class extends pa{constructor(e,t,r,n=null){super(e,t,r,n)}instantiateImpl(e){return(0,Bl.default)({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}},xr=Po(Ul()),jl=function(e,t,r){var n;if((n=e==null?void 0:e.endpoint)!=null&&n.startsWith("http")){let a="".concat(e==null?void 0:e.endpoint),o=a.indexOf("://")+3;return a.substring(o)}else return e!=null&&e.endpoint?"".concat(r,".").concat(e==null?void 0:e.endpoint):"".concat(r,".s3.amazonaws.com")};function vd(e,t,r){var n,a,o,l;let u=Ol(t),_=u.path;return Hl(e)&&(_="/".concat(u.bucket).concat(_)),{url:_,query:"",host:jl(e,t,u.bucket),region:(n=e==null?void 0:e.region)!=null?n:"",service:"s3",method:r,accessKeyId:(a=e==null?void 0:e.accessKeyId)!=null?a:"",secretAccessKey:(o=e==null?void 0:e.secretAccessKey)!=null?o:"",sessionToken:(l=e==null?void 0:e.sessionToken)!=null?l:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function yd(e,t=!1){let r="0123456789ABCDEF",n="";for(let a=0;a="A"&&o<="Z"||o>="a"&&o<="z"||o>="0"&&o<="9"||o=="_"||o=="-"||o=="~"||o=="."?n+=o:o=="/"?t?n+="%2F":n+=o:(n+="%",n+=r[o.charCodeAt(0)>>4],n+=r[o.charCodeAt(0)&15])}return n}function bd(e,t=null){var r;let n=(r=t==null?void 0:t.contentHash)!=null?r:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",a=new Map;a.set("x-amz-date",e.datetimeNow),a.set("x-amz-content-sha256",n),e.sessionToken&&a.set("x-amz-security-token",e.sessionToken);let o="";t!=null&&t.contentType&&(o+="content-type;"),o+="host;x-amz-content-sha256;x-amz-date",e.sessionToken&&(o+=";x-amz-security-token");let l=e.method+` +`+yd(e.url)+` +`+e.query;t!=null&&t.contentType&&(l+=` +content-type:`+(t==null?void 0:t.contentType)),l+=` +host:`+e.host+` +x-amz-content-sha256:`+n+` +x-amz-date:`+e.datetimeNow,e.sessionToken&&e.sessionToken.length>0&&(l+=` +x-amz-security-token:`+e.sessionToken),l+=` + +`+o+` +`+n;let u=(0,xr.sha256)(l),_=`AWS4-HMAC-SHA256 +`+e.datetimeNow+` +`+e.dateNow+"/"+e.region+"/"+e.service+`/aws4_request +`+u,d="AWS4"+e.secretAccessKey,p=xr.sha256.hmac.arrayBuffer(d,e.dateNow),f=xr.sha256.hmac.arrayBuffer(p,e.region),m=xr.sha256.hmac.arrayBuffer(f,e.service),h=xr.sha256.hmac.arrayBuffer(m,"aws4_request"),g=xr.sha256.hmac(h,_);return a.set("Authorization","AWS4-HMAC-SHA256 Credential="+e.accessKeyId+"/"+e.dateNow+"/"+e.region+"/"+e.service+"/aws4_request, SignedHeaders="+o+", Signature="+g),a}var Sd=function(e,t,r,n=null,a=null){let o=vd(e,t,r),l={contentType:n,contentHash:a?xr.sha256.hex(a):null};return bd(o,l)};function kt(e,t,r,n,a=null,o=null){(t!=null&&t.accessKeyId||t!=null&&t.sessionToken)&&(Sd(t,r,n,a,o).forEach((l,u)=>{e.setRequestHeader(u,l)}),a&&e.setRequestHeader("content-type",a))}function Ol(e){if(e.indexOf("s3://")!=0)throw new Error("URL needs to start with s3://");let t=e.indexOf("/",5);if(t==-1)throw new Error("URL needs to contain a '/' after the host");let r=e.substring(5,t);if(!r)throw new Error("URL needs to contain a bucket name");let n=e.substring(t);if(!n)throw new Error("URL needs to contain key");return{bucket:r,path:n}}function Hl(e){var t;return!!((t=e==null?void 0:e.endpoint)!=null&&t.startsWith("http"))}function Tt(e,t){let r=Ol(t);return Hl(e)?"".concat(e==null?void 0:e.endpoint,"/").concat(r.bucket)+r.path:"https://"+jl(e,t,r.bucket)+r.path}var ce={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,getFileInfo(e,t){try{let r=ce._fileInfoCache.get(t),[n,a,o]=fe(e,"duckdb_web_fs_get_file_info_by_id",["number","number"],[t,(r==null?void 0:r.cacheEpoch)||0]);if(n!==0)return null;if(o===0)return r;let l=te(e,a,o);be(e);try{let u=JSON.parse(l);if(u==null)return null;let _={...u,blob:null};return ce._fileInfoCache.set(t,_),_}catch(u){return console.warn(u),null}}catch(r){return console.log(r),null}},getGlobalFileInfo(e){var t;try{let[r,n,a]=fe(e,"duckdb_web_get_global_file_info",["number"],[((t=ce._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(r!==0)return null;if(a===0)return ce._globalFileInfo;let o=te(e,n,a);be(e);let l=JSON.parse(o);return l==null?null:(ce._globalFileInfo={...l,blob:null},ce._globalFileInfo)}catch(r){return console.log(r),null}},testPlatformFeature:(e,t)=>{switch(t){case 1:return typeof BigInt64Array<"u";default:return console.warn("test for unknown feature: ".concat(t)),!1}},getDefaultDataProtocol(e){return 2},openFile:(e,t,r)=>{var n,a;try{ce._fileInfoCache.delete(t);let o=ce.getFileInfo(e,t);switch(o==null?void 0:o.dataProtocol){case 4:case 5:{if(r&1&&r&2)throw new Error("Opening file ".concat(o.fileName," failed: cannot open file with both read and write flags set"));if(r&32)throw new Error("Opening file ".concat(o.fileName," failed: appending to HTTP/S3 files is not supported"));if(r&2){let _=new XMLHttpRequest;if(o.dataProtocol==5?(_.open("HEAD",Tt(o.s3Config,o.dataUrl),!1),kt(_,o.s3Config,o.dataUrl,"HEAD")):_.open("HEAD",o.dataUrl,!1),_.send(null),_.status!=200&&_.status!=404)throw new Error("Opening file ".concat(o.fileName," failed: Unexpected return status from server (").concat(_.status,")"));if(_.status==404&&!(r&8||r&16))throw new Error("Opening file ".concat(o.fileName," failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag."));let d=e._malloc(1),p=new Uint8Array;e.HEAPU8.set(p,d);let f=e._malloc(2*8);return e.HEAPF64[(f>>3)+0]=1,e.HEAPF64[(f>>3)+1]=d,f}else if(!(r&1))throw new Error("Opening file ".concat(o.fileName," failed: unsupported file flags: ").concat(r));let l=null,u=null;if(o.reliableHeadRequests||!o.allowFullHttpReads)try{let _=new XMLHttpRequest;if(o.dataProtocol==5?(_.open("HEAD",Tt(o.s3Config,o.dataUrl),!1),kt(_,o.s3Config,o.dataUrl,"HEAD")):_.open("HEAD",o.dataUrl,!1),_.setRequestHeader("Range","bytes=0-"),_.send(null),l=_.getResponseHeader("Content-Length"),l!==null&&_.status==206){let d=e._malloc(16);return e.HEAPF64[(d>>3)+0]=+l,e.HEAPF64[(d>>3)+1]=0,d}}catch(_){u=_,console.warn("HEAD request with range header failed: ".concat(_))}if(o.allowFullHttpReads){{let d=new XMLHttpRequest;o.dataProtocol==5?(d.open("GET",Tt(o.s3Config,o.dataUrl),!1),kt(d,o.s3Config,o.dataUrl,"GET")):d.open("GET",o.dataUrl,!1),d.responseType="arraybuffer",d.setRequestHeader("Range","bytes=0-0"),d.send(null);let p=(n=d.getResponseHeader("Content-Range"))==null?void 0:n.split("/")[1],f=d.getResponseHeader("Content-Length"),m=null;if(p!==void 0)m=p;else if(!o.reliableHeadRequests){let h=new XMLHttpRequest;o.dataProtocol==5?(h.open("HEAD",Tt(o.s3Config,o.dataUrl),!1),kt(h,o.s3Config,o.dataUrl,"HEAD")):h.open("HEAD",o.dataUrl,!1),h.setRequestHeader("Range","bytes=0-"),h.send(null),l=h.getResponseHeader("Content-Length"),l!==null&&+l>1&&(m=l)}if(d.status==206&&f!==null&&+f==1&&m!==null){let h=e._malloc(16);return e.HEAPF64[(h>>3)+0]=+m,e.HEAPF64[(h>>3)+1]=0,h}if(d.status==200&&f!==null&&l!==null&&+f==+l){console.warn("fall back to full HTTP read for: ".concat(o.dataUrl));let h=e._malloc(d.response.byteLength),g=new Uint8Array(d.response,0,d.response.byteLength);e.HEAPU8.set(g,h);let b=e._malloc(2*8);return e.HEAPF64[(b>>3)+0]=d.response.byteLength,e.HEAPF64[(b>>3)+1]=h,b}}console.warn("falling back to full HTTP read for: ".concat(o.dataUrl));let _=new XMLHttpRequest;if(o.dataProtocol==5?(_.open("GET",Tt(o.s3Config,o.dataUrl),!1),kt(_,o.s3Config,o.dataUrl,"GET")):_.open("GET",o.dataUrl,!1),_.responseType="arraybuffer",_.send(null),_.status==200){let d=e._malloc(_.response.byteLength),p=new Uint8Array(_.response,0,_.response.byteLength);e.HEAPU8.set(p,d);let f=e._malloc(2*8);return e.HEAPF64[(f>>3)+0]=_.response.byteLength,e.HEAPF64[(f>>3)+1]=d,f}}if(u!=null)throw new Error("Reading file ".concat(o.fileName," failed with error: ").concat(u));return 0}case 2:{let l=(a=ce._files)==null?void 0:a.get(o.fileName);if(l){let d=e._malloc(16);return e.HEAPF64[(d>>3)+0]=l.size,e.HEAPF64[(d>>3)+1]=0,d}console.warn("Buffering missing file: ".concat(o.fileName));let u=e._malloc(2*8),_=e._malloc(1);return e.HEAPF64[(u>>3)+0]=1,e.HEAPF64[(u>>3)+1]=_,u}}}catch(o){console.error(o.toString()),lt(e,o.toString())}return 0},glob:(e,t,r)=>{var n;try{let a=te(e,t,r);if(a.startsWith("http")||a.startsWith("s3://")){let o=new XMLHttpRequest;if(a.startsWith("s3://")){let l=ce.getGlobalFileInfo(e);o.open("HEAD",Tt(l==null?void 0:l.s3Config,a),!1),kt(o,l==null?void 0:l.s3Config,a,"HEAD")}else o.open("HEAD",a,!1);if(o.send(null),o.status!=200&&o.status!==206){if(!((n=ce.getGlobalFileInfo(e))!=null&&n.allowFullHttpReads))return lt(e,"HEAD request failed: ".concat(a,", with full http reads are disabled")),0;let l=new XMLHttpRequest;if(a.startsWith("s3://")){let _=ce.getGlobalFileInfo(e);l.open("GET",Tt(_==null?void 0:_.s3Config,a),!1),kt(l,_==null?void 0:_.s3Config,a,"HEAD")}else l.open("GET",a,!1);if(l.setRequestHeader("Range","bytes=0-0"),l.send(null),l.status!=200&&l.status!==206)return lt(e,"HEAD and GET requests failed: ".concat(a)),0;let u=l.getResponseHeader("Content-Length");u&&+u>1&&console.warn("Range request for ".concat(a," did not return a partial response: ").concat(l.status,' "').concat(l.statusText,'"'))}e.ccall("duckdb_web_fs_glob_add_path",null,["string"],[a])}}catch(a){return console.log(a),lt(e,a.toString()),0}},checkFile:(e,t,r)=>{try{let n=te(e,t,r);if(n.startsWith("http")||n.startsWith("s3://")){let a=new XMLHttpRequest;if(n.startsWith("s3://")){let o=ce.getGlobalFileInfo(e);a.open("HEAD",Tt(o==null?void 0:o.s3Config,n),!1),kt(a,o==null?void 0:o.s3Config,n,"HEAD")}else a.open("HEAD",n,!1);return a.send(null),a.status==206||a.status==200}}catch(n){return console.log(n),!1}return!1},syncFile:(e,t)=>{},closeFile:(e,t)=>{var r;let n=ce.getFileInfo(e,t);switch(ce._fileInfoCache.delete(t),n==null?void 0:n.dataProtocol){case 0:case 4:case 5:break;case 1:case 2:return;case 3:{let a=(r=ce._files)==null?void 0:r.get(n.fileName);if(!a)throw new Error("No OPFS access handle registered with name: ".concat(n.fileName));return a.flush()}}},truncateFile:(e,t,r)=>{var n;let a=ce.getFileInfo(e,t);switch(a==null?void 0:a.dataProtocol){case 4:lt(e,"Cannot truncate a http file");return;case 5:lt(e,"Cannot truncate an s3 file");return;case 0:case 1:case 2:lt(e,"truncateFile not implemented");return;case 3:{let o=(n=ce._files)==null?void 0:n.get(a.fileName);if(!o)throw new Error("No OPFS access handle registered with name: ".concat(a.fileName));return o.truncate(r)}}return 0},readFile(e,t,r,n,a){var o,l;if(n==0)return 0;try{let u=ce.getFileInfo(e,t);switch(u==null?void 0:u.dataProtocol){case 4:case 5:{if(!u.dataUrl)throw new Error("Missing data URL for file ".concat(t));try{let _=new XMLHttpRequest;if(u.dataProtocol==5?(_.open("GET",Tt(u==null?void 0:u.s3Config,u.dataUrl),!1),kt(_,u==null?void 0:u.s3Config,u.dataUrl,"GET")):_.open("GET",u.dataUrl,!1),_.responseType="arraybuffer",_.setRequestHeader("Range","bytes=".concat(a,"-").concat(a+n-1)),_.send(null),_.status==206||_.status==200&&n==_.response.byteLength&&a==0){let d=new Uint8Array(_.response,0,Math.min(_.response.byteLength,n));return e.HEAPU8.set(d,r),d.byteLength}else if(_.status==200){console.warn("Range request for ".concat(u.dataUrl," did not return a partial response: ").concat(_.status,' "').concat(_.statusText,'"'));let d=new Uint8Array(_.response,a,Math.min(_.response.byteLength-a,n));return e.HEAPU8.set(d,r),d.byteLength}else throw new Error("Range request for ".concat(u.dataUrl," did returned non-success status: ").concat(_.status,' "').concat(_.statusText,'"'))}catch(_){throw console.log(_),new Error("Range request for ".concat(u.dataUrl," failed with error: ").concat(_,'"'))}}case 2:{let _=(o=ce._files)==null?void 0:o.get(u.fileName);if(!_)throw new Error("No HTML5 file registered with name: ".concat(u.fileName));let d=_.slice(a,a+n),p=new Uint8Array(new FileReaderSync().readAsArrayBuffer(d));return e.HEAPU8.set(p,r),p.byteLength}case 3:{let _=(l=ce._files)==null?void 0:l.get(u.fileName);if(!_)throw new Error("No OPFS access handle registered with name: ".concat(u.fileName));let d=e.HEAPU8.subarray(r,r+n);return _.read(d,{at:a})}}return 0}catch(u){return console.log(u),lt(e,u.toString()),0}},writeFile:(e,t,r,n,a)=>{var o;let l=ce.getFileInfo(e,t);switch(l==null?void 0:l.dataProtocol){case 4:return lt(e,"Cannot write to HTTP file"),0;case 5:{let u=e.HEAPU8.subarray(r,r+n),_=new XMLHttpRequest;return _.open("PUT",Tt(l==null?void 0:l.s3Config,l.dataUrl),!1),kt(_,l==null?void 0:l.s3Config,l.dataUrl,"PUT","",u),_.send(u),_.status!==200?(lt(e,"Failed writing file: HTTP "+_.status),0):n}case 2:return lt(e,"cannot write using the html5 file reader api"),0;case 3:{let u=(o=ce._files)==null?void 0:o.get(l.fileName);if(!u)throw new Error("No OPFS access handle registered with name: ".concat(l.fileName));let _=e.HEAPU8.subarray(r,r+n);return u.write(_,{at:a})}}return 0},getLastFileModificationTime:(e,t)=>{var r;let n=ce.getFileInfo(e,t);switch(n==null?void 0:n.dataProtocol){case 2:{if(!((r=ce._files)!=null&&r.get(n.fileName)))throw Error("No handle available for file: ".concat(n.fileName));return 0}case 4:case 5:return new Date().getTime()}return 0},checkDirectory:(e,t,r)=>{let n=te(e,t,r);return console.log("checkDirectory: ".concat(n)),!1},createDirectory:(e,t,r)=>{let n=te(e,t,r);console.log("createDirectory: ".concat(n))},removeDirectory:(e,t,r)=>{let n=te(e,t,r);console.log("removeDirectory: ".concat(n))},listDirectoryEntries:(e,t,r)=>{let n=te(e,t,r);return console.log("listDirectoryEntries: ".concat(n)),!1},moveFile:(e,t,r,n,a)=>{var o,l;let u=te(e,t,r),_=te(e,n,a),d=(o=ce._files)==null?void 0:o.get(u);d!==void 0&&(ce._files.delete(d),ce._files.set(_,d));for(let[p,f]of((l=ce._fileInfoCache)==null?void 0:l.entries())||[])if(f.dataUrl==u){ce._fileInfoCache.delete(p);break}return!0},removeFile:(e,t,r)=>{},callScalarUDF:(e,t,r,n,a,o,l)=>{Pl(ce,e,t,r,n,a,o,l)}},ko=class extends ca{postMessage(e,t){globalThis.postMessage(e,t)}async instantiate(e,t,r){return await new ma(this,ce,e,t).instantiate(r)}};function Nl(){let e=new ko;globalThis.onmessage=async t=>{await e.onMessage(t.data)}}return Nl(),Xl(wd)})()})();