@duckdb/duckdb-wasm 1.29.1-dev157.0 → 1.29.1-dev159.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var duckdb=(()=>{var zc=Object.create;var Tn=Object.defineProperty;var $c=Object.getOwnPropertyDescriptor;var qc=Object.getOwnPropertyNames;var Qc=Object.getPrototypeOf,Yc=Object.prototype.hasOwnProperty;var ga=(s,e)=>(e=Symbol[s])?e:Symbol.for("Symbol."+s);var Kc=(s,e,t)=>e in s?Tn(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Ti=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var dr=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),fr=(s,e)=>{for(var t in e)Tn(s,t,{get:e[t],enumerable:!0})},ko=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qc(e))!Yc.call(s,n)&&n!==t&&Tn(s,n,{get:()=>e[n],enumerable:!(r=$c(e,n))||r.enumerable});return s};var Bo=(s,e,t)=>(t=s!=null?zc(Qc(s)):{},ko(e||!s||!s.__esModule?Tn(t,"default",{value:s,enumerable:!0}):t,s)),Xc=s=>ko(Tn({},"__esModule",{value:!0}),s);var $e=(s,e,t)=>(Kc(s,typeof e!="symbol"?e+"":e,t),t);var Zc=function(s,e){this[0]=s,this[1]=e};var Mr=s=>{var e=s[ga("asyncIterator")],t=!1,r,n={};return e==null?(e=s[ga("iterator")](),r=a=>n[a]=o=>e[a](o)):(e=e.call(s),r=a=>n[a]=o=>{if(t){if(t=!1,a==="throw")throw o;return o}return t=!0,{done:!1,value:new Zc(new Promise(l=>{var c=e[a](o);if(!(c instanceof Object))throw TypeError("Object expected");l(c)}),1)}}),n[ga("iterator")]=()=>n,r("next"),"throw"in e?r("throw"):n.throw=a=>{throw a},"return"in e&&r("return"),n};var Eo=dr(()=>{});var Fo=dr(()=>{});var Bc=dr(()=>{});var xo=dr((xS,Pc)=>{"use strict";Pc.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var Cc=dr((exports,module)=>{"use strict";var DuckDB=(()=>{var s;var _scriptName=typeof document<"u"?(s=document.currentScript)==null?void 0:s.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 WorkerGlobalScope<"u",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=Eo(),nodePath=Fo();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,TTY.init(),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,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){var t;runDependencies++,(t=Module.monitorRunDependencies)==null||t.call(Module,runDependencies)}function removeRunDependency(e){var r;if(runDependencies--,(r=Module.monitorRunDependencies)==null||r.call(Module,runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){var r;(r=Module.onAbort)==null||r.call(Module,e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.",runtimeInitialized&&___trap();var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject(t),t}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function findWasmBinary(){var e="./duckdb-eh.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,"main"),LDSO.init(),loadDylibs(),wasmExports=applySignatureConversions(wasmExports),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}addRunDependency("wasm-instantiate");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={2259128:(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},2259494:(e,t)=>{var r=UTF8ToString(e);if(typeof XMLHttpRequest>"u"){let P=Bc(),k=Fo(),C=Eo();var n=r.split("/"),a=n.length,o=k.join(P.homedir(),".duckdb/extensions/"+n[a-4]+"/"+n[a-3]+"/"+n[a-2]+"/"),l=k.join(o,n[a-1]);try{if(C.existsSync(o)||C.mkdirSync(o,{recursive:!0}),C.existsSync(l))_=C.readFileSync(l);else{let x=new Int32Array(new SharedArrayBuffer(8));var c=Ti("node:worker_threads").Worker,u=new c("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}),_;x[0]=0,x[2]=4,u.postMessage(x),u.postMessage(r),Atomics.wait(x,0,0);let g=new Int32Array(new SharedArrayBuffer(x[1]+3-(x[1]+3)%4));u.postMessage(g),Atomics.wait(x,0,1);var d=new Uint8Array(g.buffer,0,x[1]);_=d,u.terminate(),C.writeFileSync(l,_)}}catch(x){return console.log("Error fetching module",x),0}}else{let P=new XMLHttpRequest;if(P.open("GET",r,!1),P.responseType="arraybuffer",P.send(null),P.status!=200)return 0;_=P.response}for(var m=WebAssembly.validate(_),p=_.byteLength,h=_malloc(p+4),S=new Uint8Array(_),w=0;w<p;w++)Module.HEAPU8[w+h+4]=S[w];var L=new Uint8Array(4);return L[0]=p%256,p-=L[0],p/=256,L[1]=p%256,p-=L[1],p/=256,L[2]=p%256,p-=L[2],p/=256,L[3]=p%256,p-=L[3],p/=256,Module.HEAPU8.set(L,h),FS.writeFile(UTF8ToString(t),new Uint8Array(_)),h},2262135:e=>{if(!e)return AL.alcErr=40964,1},2262183:e=>{if(!AL.currentCtx)return err("alGetProcAddress() called without a valid context"),1;if(!e)return AL.currentCtx.err=40963,1}};class ExitStatus{constructor(t){$e(this,"name","ExitStatus");this.message="Program terminated with exit(".concat(t,")"),this.status=t}}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=0,r=NaN)=>{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<a;){var l=e[t++];if(!(l&128)){o+=String.fromCharCode(l);continue}var c=e[t++]&63;if((l&224)==192){o+=String.fromCharCode((l&31)<<6|c);continue}var u=e[t++]&63;if((l&240)==224?l=(l&15)<<12|c<<6|u:l=(l&7)<<18|c<<12|u<<6|e[t++]&63,l<65536)o+=String.fromCharCode(l);else{var _=l-65536;o+=String.fromCharCode(55296|_>>10,56320|_&1023)}}return o},getDylinkMetadata=e=>{var t=0,r=0;function n(){return e[t++]}function a(){for(var I=0,O=1;;){var ie=e[t++];if(I+=(ie&127)*O,O*=128,!(ie&128))break}return I}function o(){var I=a();return t+=I,UTF8ArrayToString(e,t-I,I)}function l(I,O){if(I)throw new Error(O)}var c="dylink.0";if(e instanceof WebAssembly.Module){var u=WebAssembly.Module.customSections(e,c);u.length===0&&(c="dylink",u=WebAssembly.Module.customSections(e,c)),l(u.length===0,"need dylink section"),e=new Uint8Array(u[0]),r=e.length}else{var _=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),d=_[0]==1836278016;l(!d,"need to see wasm magic number"),l(e[8]!==0,"need the dylink section to be first"),t=9;var m=a();r=t+m,c=o()}var p={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(c=="dylink"){p.memorySize=a(),p.memoryAlign=a(),p.tableSize=a(),p.tableAlign=a();for(var h=a(),S=0;S<h;++S){var w=o();p.neededDynlibs.push(w)}}else{l(c!=="dylink.0");for(var L=1,P=2,k=3,C=4,x=256,g=3,A=1;t<r;){var F=n(),y=a();if(F===L)p.memorySize=a(),p.memoryAlign=a(),p.tableSize=a(),p.tableAlign=a();else if(F===P)for(var h=a(),S=0;S<h;++S)w=o(),p.neededDynlibs.push(w);else if(F===k)for(var E=a();E--;){var b=o(),T=a();T&x&&p.tlsExports.add(b)}else if(F===C)for(var E=a();E--;){var v=o(),b=o(),T=a();(T&g)==A&&p.weakImports.add(b)}else t+=y}}return p},newDSO=(e,t,r)=>{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=2397456,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<e.length;++n)r.parameters.push(t[e[n]]);return r},generateFuncType=(e,t)=>{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<n.length;++o)t.push(a[n[o]]);r=="v"?t.push(0):t.push(1,a[r])},convertJsFunctionToWasm=(e,t)=>{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:22915,element:"anyfunc"}),getWasmTableEntry=e=>wasmTable.get(e),updateTableMap=(e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r)}},functionsInTableMap,getFunctionAddress=e=>(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)},resolveGlobalSymbol=(e,t=!1)=>{var r;return t&&"orig$"+e in wasmImports&&(e="orig$"+e),isSymbolDefined(e)&&(r=wasmImports[e]),{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){if(t.startsWith("invoke_"))return createDyncallWrapper(t.substring(7));switch(t){case"__memory_base":return memoryBase;case"getTempRet0":return getTempRet0;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<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}}var func="(".concat(jsArgs,") => ").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))(o=>{isSymbolDefined(o)||(wasmImports[o]=n)})(r)},asyncLoad=(e,t,r,n)=>{var a=n?"":"al ".concat(e);readAsync(e).then(o=>{t(new Uint8Array(o)),a&&removeRunDependency(a)},o=>{if(r)r();else throw'Loading data file "'.concat(e,'" failed.')}),a&&addRunDependency(a)},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,e)):(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 u=HEAPU32[n+28>>>2>>>0],_=HEAPU32[n+32>>>2>>>0];if(u&&_){var d=HEAP8.slice(u,u+_);return t.loadAsync?Promise.resolve(d):d}}var m=locateFile(e);if(t.loadAsync)return new Promise((p,h)=>asyncLoad(m,p,h));if(!readBinary)throw new Error("".concat(m,": file not found, and synchronous loading of external files is not available"));return readBinary(m)}function l(){var u=preloadedWasm[e];return u?t.loadAsync?Promise.resolve(u):u:t.loadAsync?o().then(_=>loadWebAssemblyModule(_,t,e,r,n)):loadWebAssemblyModule(o(),t,e,r,n)}function c(u){a.global?mergeLibSymbols(u,e):r&&(Object.assign(r,u),registerDynCallSymbols(u)),a.exports=u}return t.loadAsync?l().then(u=>(c(u),!0)):(c(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("loadDylibs"),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},noExitRuntime=Module.noExitRuntime||!0,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";var ___c_longjmp=new WebAssembly.Tag({parameters:["i32"]});function ___call_sighandler(e,t){return e>>>=0,getWasmTableEntry(e)(t)}___call_sighandler.sig="vpi";var ___cpp_exception=new WebAssembly.Tag({parameters:["i32"]}),___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=2397456,___stack_low=2331920,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},2397456),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=Ti("crypto"),t=e.randomFillSync;if(t)return n=>e.randomFillSync(n);var r=e.randomBytes;return n=>(n.set(r(n.byteLength)),n)}catch(n){}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(_){for(var d=0;d<_.length&&_[d]==="";d++);for(var m=_.length-1;m>=0&&_[m]==="";m--);return d>m?[]:_.slice(d,m-d+1)}for(var n=r(e.split("/")),a=r(t.split("/")),o=Math.min(n.length,a.length),l=o,c=0;c<o;c++)if(n[c]!==a[c]){l=c;break}for(var u=[],c=l;c<n.length;c++)u.push("..");return u=u.concat(a.slice(l)),u.join("/")}},FS_stdin_getChar_buffer=[],lengthBytesUTF8=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=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<e.length;++l){var c=e.charCodeAt(l);if(c>=55296&&c<=57343){var u=e.charCodeAt(++l);c=65536+((c&1023)<<10)|u&1023}if(c<=127){if(r>=o)break;t[r++>>>0]=c}else if(c<=2047){if(r+1>=o)break;t[r++>>>0]=192|c>>6,t[r++>>>0]=128|c&63}else if(c<=65535){if(r+2>=o)break;t[r++>>>0]=224|c>>12,t[r++>>>0]=128|c>>6&63,t[r++>>>0]=128|c&63}else{if(r+3>=o)break;t[r++>>>0]=240|c>>18,t[r++>>>0]=128|c>>12&63,t[r++>>>0]=128|c>>6&63,t[r++>>>0]=128|c&63}}return t[r>>>0]=0,r-a};function intArrayFromString(e,t,r){var n=r>0?r: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+="\n"));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;l<n;l++){var c;try{c=e.tty.ops.get_char(e.tty)}catch(u){throw new FS.ErrnoError(29)}if(c===void 0&&o===0)throw new FS.ErrnoError(6);if(c==null)break;o++,t[r+l]=c}return o&&(e.node.timestamp=Date.now()),o},write(e,t,r,n,a){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(60);try{for(var o=0;o<n;o++)e.tty.ops.put_char(e.tty,t[r+o])}catch(l){throw new FS.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char(e){return FS_stdin_getChar()},put_char(e,t){t===null||t===10?(out(UTF8ArrayToString(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output)),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)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output)),e.output=[])}}},zeroMemory=(e,t)=>{HEAPU8.fill(0,e,e+t)},mmapAlloc=e=>{e=alignMemory(e,65536);var t=_emscripten_builtin_memalign(65536,e);return t&&zeroMemory(t,e),t},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=1024*1024;t=Math.max(t,r*(r<n?2:1.125)>>>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(o){}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 c=0;c<l;c++)t[r+c]=o[a+c];return l},write(e,t,r,n,a,o){if(t.buffer===HEAP8.buffer&&(o=!1),!n)return 0;var l=e.node;if(l.timestamp=Date.now(),t.subarray&&(!l.contents||l.contents.subarray)){if(o)return l.contents=t.subarray(r,r+n),l.usedBytes=n,n;if(l.usedBytes===0&&a===0)return l.contents=t.slice(r,r+n),l.usedBytes=n,n;if(a+n<=l.usedBytes)return l.contents.set(t.subarray(r,r+n),a),n}if(MEMFS.expandFileStorage(l,a+n),l.contents.subarray&&t.subarray)l.contents.set(t.subarray(r,r+n),a);else for(var c=0;c<n;c++)l.contents[a+c]=t[r+c];return l.usedBytes=Math.max(l.usedBytes,a+n),n},llseek(e,t,r){var n=t;if(r===1?n+=e.position:r===2&&FS.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new FS.ErrnoError(28);return n},allocate(e,t,r){MEMFS.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,a){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var o,l,c=e.node.contents;if(!(a&2)&&c&&c.buffer===HEAP8.buffer)l=!1,o=c.byteOffset;else{if(l=!0,o=mmapAlloc(t),!o)throw new FS.ErrnoError(48);c&&((r>0||r+t<c.length)&&(c.subarray?c=c.subarray(r,r+t):c=Array.prototype.slice.call(c,r,r+t)),HEAP8.set(c,o>>>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,c,u,_)=>{var d=t?PATH_FS.resolve(PATH.join2(e,t)):e,m="cp ".concat(d);function p(h){function S(w){_==null||_(),c||FS_createDataFile(e,t,w,n,a,u),o==null||o(),removeRunDependency(m)}FS_handledByPreloadPlugin(h,d,S,()=>{l==null||l(),removeRunDependency(m)})||S(h)}addRunDependency(m),typeof r=="string"?asyncLoad(r,p,l):p(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){$e(this,"name","ErrnoError");this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){$e(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(this,"node_ops",{});$e(this,"stream_ops",{});$e(this,"readMode",365);$e(this,"writeMode",146);$e(this,"mounted",null);e||(e=this),this.parent=e,this.mount=e.mount,this.id=FS.nextInode++,this.name=t,this.mode=r,this.rdev=n}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(m=>!!m),a=FS.root,o="/",l=0;l<n.length;l++){var c=l===n.length-1;if(c&&t.parent)break;if(a=FS.lookupNode(a,n[l]),o=PATH.join2(o,n[l]),FS.isMountpoint(a)&&(!c||c&&t.follow_mount)&&(a=a.mounted.root),!c||t.follow)for(var u=0;FS.isLink(a.mode);){var _=FS.readlink(o);o=PATH_FS.resolve(PATH.dirname(o),_);var d=FS.lookupPath(o,{recurse_count:t.recurse_count+1});if(a=d.node,u++>40)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<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>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(n){}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 n,a;var r=FS.createStream(e,t);return(a=(n=r.stream_ops)==null?void 0:n.dup)==null||a.call(n,r),r},chrdev_stream_ops:{open(e){var r,n;var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,(n=(r=e.stream_ops).open)==null||n.call(r,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 c={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(c);return u.mount=c,c.root=u,n?FS.root=u:o&&(o.mounted=c,o.mount&&o.mount.mounts.push(c)),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 c=FS.nameTable[l];c;){var u=c.name_next;a.includes(c.mount)&&FS.destroyNode(c),c=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<r.length;++a)if(r[a]){n+="/"+r[a];try{FS.mkdir(n,t)}catch(o){if(o.errno!=20)throw o}}},mkdev(e,t,r){return typeof r>"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,c,u;if(l=FS.lookupPath(e,{parent:!0}),c=l.node,l=FS.lookupPath(t,{parent:!0}),u=l.node,!c||!u)throw new FS.ErrnoError(44);if(c.mount!==u.mount)throw new FS.ErrnoError(75);var _=FS.lookupNode(c,a),d=PATH_FS.relative(e,n);if(d.charAt(0)!==".")throw new FS.ErrnoError(28);if(d=PATH_FS.relative(t,r),d.charAt(0)!==".")throw new FS.ErrnoError(55);var m;try{m=FS.lookupNode(u,o)}catch(S){}if(_!==m){var p=FS.isDir(_.mode),h=FS.mayDelete(c,a,p);if(h)throw new FS.ErrnoError(h);if(h=m?FS.mayDelete(u,o,p):FS.mayCreate(u,o),h)throw new FS.ErrnoError(h);if(!c.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(_)||m&&FS.isMountpoint(m))throw new FS.ErrnoError(10);if(u!==c&&(h=FS.nodePermissions(c,"w"),h))throw new FS.ErrnoError(h);FS.hashRemoveNode(_);try{c.node_ops.rename(_,u,o),_.parent=u}catch(S){throw S}finally{FS.hashAddNode(_)}}},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(u){}}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 c=FS.createStream({node:n,path:FS.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return c.stream_ops.open&&c.stream_ops.open(c),Module.logReadFiles&&!(t&1)&&(e in FS.readFiles||(FS.readFiles[e]=1)),c},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 c=e.stream_ops.write(e,t,r,n,a,o);return l||(e.position+=c),c},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):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,c)=>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");var n=FS.open("/dev/stdin",0),a=FS.open("/dev/stdout",1),o=FS.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack="<generic error, no 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,_fflush(0);for(var e=0;e<FS.streams.length;e++){var t=FS.streams[e];t&&FS.close(t)}},findObject(e,t){var r=FS.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{var r=FS.lookupPath(e,{follow:!t});e=r.path}catch(a){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=FS.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=PATH.basename(e),r=FS.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot=r.path==="/"}catch(a){n.error=a.errno}return n},createPath(e,t,r,n){e=typeof e=="string"?e:FS.getPath(e);for(var a=t.split("/").reverse();a.length;){var o=a.pop();if(o){var l=PATH.join2(e,o);try{FS.mkdir(l)}catch(c){}e=l}}return l},createFile(e,t,r,n,a){var o=PATH.join2(typeof e=="string"?e:FS.getPath(e),t),l=FS_getMode(n,a);return FS.create(o,l)},createDataFile(e,t,r,n,a,o){var l=t;e&&(e=typeof e=="string"?e:FS.getPath(e),l=t?PATH.join2(e,t):e);var c=FS_getMode(n,a),u=FS.create(l,c);if(r){if(typeof r=="string"){for(var _=new Array(r.length),d=0,m=r.length;d<m;++d)_[d]=r.charCodeAt(d);r=_}FS.chmod(u,c|146);var p=FS.open(u,577);FS.write(p,r,0,r.length,0,o),FS.close(p),FS.chmod(u,c)}},createDevice(e,t,r,n){var c,u;var a=PATH.join2(typeof e=="string"?e:FS.getPath(e),t),o=FS_getMode(!!r,!!n);(u=(c=FS.createDevice).major)!=null||(c.major=64);var l=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(l,{open(_){_.seekable=!1},close(_){var d;(d=n==null?void 0:n.buffer)!=null&&d.length&&n(10)},read(_,d,m,p,h){for(var S=0,w=0;w<p;w++){var L;try{L=r()}catch(P){throw new FS.ErrnoError(29)}if(L===void 0&&S===0)throw new FS.ErrnoError(6);if(L==null)break;S++,d[m+w]=L}return S&&(_.node.timestamp=Date.now()),S},write(_,d,m,p,h){for(var S=0;S<p;S++)try{n(d[m+S])}catch(w){throw new FS.ErrnoError(29)}return p&&(_.node.timestamp=Date.now()),S}}),FS.mkdev(a,o,l)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=readBinary(e.url),e.usedBytes=e.contents.length}catch(t){throw new FS.ErrnoError(29)}},createLazyFile(e,t,r,n,a){class o{constructor(){$e(this,"lengthKnown",!1);$e(this,"chunks",[])}get(h){if(!(h>this.length-1||h<0)){var S=h%this.chunkSize,w=h/this.chunkSize|0;return this.getter(w)[S]}}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 S=Number(h.getResponseHeader("Content-length")),w,L=(w=h.getResponseHeader("Accept-Ranges"))&&w==="bytes",P=(w=h.getResponseHeader("Content-Encoding"))&&w==="gzip",k=1024*1024;L||(k=S);var C=(g,A)=>{if(g>A)throw new Error("invalid range ("+g+", "+A+") or no bytes requested!");if(A>S-1)throw new Error("only "+S+" bytes available! programmer error!");var F=new XMLHttpRequest;if(F.open("GET",r,!1),S!==k&&F.setRequestHeader("Range","bytes="+g+"-"+A),F.responseType="arraybuffer",F.overrideMimeType&&F.overrideMimeType("text/plain; charset=x-user-defined"),F.send(null),!(F.status>=200&&F.status<300||F.status===304))throw new Error("Couldn't load "+r+". Status: "+F.status);return F.response!==void 0?new Uint8Array(F.response||[]):intArrayFromString(F.responseText||"",!0)},x=this;x.setDataGetter(g=>{var A=g*k,F=(g+1)*k-1;if(F=Math.min(F,S-1),typeof x.chunks[g]>"u"&&(x.chunks[g]=C(A,F)),typeof x.chunks[g]>"u")throw new Error("doXHR failed!");return x.chunks[g]}),(P||!S)&&(k=S=1,S=this.getter(0).length,k=S,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=S,this._chunkSize=k,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,c={isDevice:!1,contents:l}}else var c={isDevice:!1,url:r};var u=FS.createFile(e,t,c,n,a);c.contents?u.contents=c.contents:c.url&&(u.contents=null,u.url=c.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var _={},d=Object.keys(u.stream_ops);d.forEach(p=>{var h=u.stream_ops[p];_[p]=(...S)=>(FS.forceLoadFile(u),h(...S))});function m(p,h,S,w,L){var P=p.node.contents;if(L>=P.length)return 0;var k=Math.min(P.length-L,w);if(P.slice)for(var C=0;C<k;C++)h[S+C]=P[L+C];else for(var C=0;C<k;C++)h[S+C]=P.get(L+C);return k}return _.read=(p,h,S,w,L)=>(FS.forceLoadFile(u),m(p,h,S,w,L)),_.mmap=(p,h,S,w,L)=>{FS.forceLoadFile(u);var P=mmapAlloc(h);if(!P)throw new FS.ErrnoError(48);return m(p,HEAP8,P,h,S),{ptr:P,allocated:!0}},u.stream_ops=_,u}},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}},___syscall__newselect=function(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,c=t?HEAP32[t+4>>>2>>>0]:0,u=r?HEAP32[r>>>2>>>0]:0,_=r?HEAP32[r+4>>>2>>>0]:0,d=n?HEAP32[n>>>2>>>0]:0,m=n?HEAP32[n+4>>>2>>>0]:0,p=0,h=0,S=0,w=0,L=0,P=0,k=(t?HEAP32[t>>>2>>>0]:0)|(r?HEAP32[r>>>2>>>0]:0)|(n?HEAP32[n>>>2>>>0]:0),C=(t?HEAP32[t+4>>>2>>>0]:0)|(r?HEAP32[r+4>>>2>>>0]:0)|(n?HEAP32[n+4>>>2>>>0]:0),x=(v,I,O,ie)=>v<32?I&ie:O&ie,g=0;g<e;g++){var A=1<<g%32;if(x(g,k,C,A)){var F=SYSCALLS.getStreamFromFD(g),y=SYSCALLS.DEFAULT_POLLMASK;if(F.stream_ops.poll){var E=-1;if(a){var b=t?HEAP32[a>>>2>>>0]:0,T=t?HEAP32[a+4>>>2>>>0]:0;E=(b+T/1e6)*1e3}y=F.stream_ops.poll(F,E)}y&1&&x(g,l,c,A)&&(g<32?p=p|A:h=h|A,o++),y&4&&x(g,u,_,A)&&(g<32?S=S|A:w=w|A,o++),y&2&&x(g,d,m,A)&&(g<32?L=L|A:P=P|A,o++)}}return t&&(HEAP32[t>>>2>>>0]=p,HEAP32[t+4>>>2>>>0]=h),r&&(HEAP32[r>>>2>>>0]=S,HEAP32[r+4>>>2>>>0]=w),n&&(HEAP32[n>>>2>>>0]=L,HEAP32[n+4>>>2>>>0]=P),o}catch(v){if(typeof FS>"u"||v.name!=="ErrnoError")throw v;return-v.errno}};___syscall__newselect.sig="iipppp";var SOCKFS={websocketArgs:{},callbacks:{},on(e,t){SOCKFS.callbacks[e]=t},emit(e,t){var r,n;(n=(r=SOCKFS.callbacks)[e])==null||n.call(r,t)},mount(e){var t;return SOCKFS.websocketArgs=Module.websocket||{},((t=Module.websocket)!=null?t:Module.websocket={}).on=SOCKFS.on,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 c=FS.createStream({path:o,node:l,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return a.stream=c,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="ws:#".replace("#","//"),l="binary",c=void 0;if(SOCKFS.websocketArgs.url&&(o=SOCKFS.websocketArgs.url),SOCKFS.websocketArgs.subprotocol?l=SOCKFS.websocketArgs.subprotocol:SOCKFS.websocketArgs.subprotocol===null&&(l="null"),o==="ws://"||o==="wss://"){var u=t.split("/");o=o+u[0]+":"+r+"/"+u.slice(1).join("/")}l!=="null"&&(l=l.replace(/^ +| +$/g,"").split(/ *, */),c=l);var _;ENVIRONMENT_IS_NODE?_=xo():_=WebSocket,n=new _(o,c),n.binaryType="arraybuffer"}catch(m){throw new FS.ErrnoError(23)}var d={addr:t,port:r,socket:n,msg_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(e,d),SOCKFS.websocket_sock_ops.handlePeerEvents(e,d),e.type===2&&typeof e.sport<"u"&&d.msg_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(e.sport&65280)>>8,e.sport&255])),d},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(){e.connecting=!1,SOCKFS.emit("open",e.stream.fd);try{for(var o=t.msg_send_queue.shift();o;)t.socket.send(o),o=t.msg_send_queue.shift()}catch(l){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 c=r;if(r=!1,c&&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 u=o[8]<<8|o[9];SOCKFS.websocket_sock_ops.removePeer(e,t),t.port=u,SOCKFS.websocket_sock_ops.addPeer(e,t);return}e.recv_queue.push({addr:t.addr,port:t.port,data:o}),SOCKFS.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(){SOCKFS.emit("close",e.stream.fd)}),t.socket.on("error",function(o){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(t.socket.onopen=n,t.socket.onclose=function(){SOCKFS.emit("close",e.stream.fd)},t.socket.onmessage=function(l){a(l.data)},t.socket.onerror=function(o){e.error=14,SOCKFS.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)&&(e.connecting?t|=4: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(a){}e.server=null}for(var t=Object.keys(e.peers),r=0;r<t.length;r++){var n=e.peers[t[r]];try{n.socket.close()}catch(a){}SOCKFS.websocket_sock_ops.removePeer(e,n)}return 0},bind(e,t,r){if(typeof e.saddr<"u"||typeof e.sport<"u")throw new FS.ErrnoError(28);if(e.saddr=t,e.sport=r,e.type===2){e.server&&(e.server.close(),e.server=null);try{e.sock_ops.listen(e,0)}catch(n){if(n.name!=="ErrnoError"||n.errno!==138)throw n}}},connect(e,t,r){if(e.server)throw new FS.ErrnoError(138);if(typeof e.daddr<"u"&&typeof e.dport<"u"){var n=SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(n)throw n.socket.readyState===n.socket.CONNECTING?new FS.ErrnoError(7):new FS.ErrnoError(30)}var a=SOCKFS.websocket_sock_ops.createPeer(e,t,r);e.daddr=a.addr,e.dport=a.port,e.connecting=!0},listen(e,t){if(!ENVIRONMENT_IS_NODE)throw new FS.ErrnoError(138);if(e.server)throw new FS.ErrnoError(28);var r=xo().Server,n=e.saddr;e.server=new r({host:n,port:e.sport}),SOCKFS.emit("listen",e.stream.fd),e.server.on("connection",function(a){if(e.type===1){var o=SOCKFS.createSocket(e.family,e.type,e.protocol),l=SOCKFS.websocket_sock_ops.createPeer(o,a);o.daddr=l.addr,o.dport=l.port,e.pending.push(o),SOCKFS.emit("connection",o.stream.fd)}else SOCKFS.websocket_sock_ops.createPeer(e,a),SOCKFS.emit("connection",e.stream.fd)}),e.server.on("close",function(){SOCKFS.emit("close",e.stream.fd),e.server=null}),e.server.on("error",function(a){e.error=23,SOCKFS.emit("error",[e.stream.fd,e.error,"EHOSTUNREACH: Host is unreachable"])})},accept(e){if(!e.server||!e.pending.length)throw new FS.ErrnoError(28);var t=e.pending.shift();return t.stream.flags=e.stream.flags,t},getname(e,t){var r,n;if(t){if(e.daddr===void 0||e.dport===void 0)throw new FS.ErrnoError(53);r=e.daddr,n=e.dport}else r=e.saddr||0,n=e.sport||0;return{addr:r,port:n}},sendmsg(e,t,r,n,a,o){if(e.type===2){if((a===void 0||o===void 0)&&(a=e.daddr,o=e.dport),a===void 0||o===void 0)throw new FS.ErrnoError(17)}else a=e.daddr,o=e.dport;var l=SOCKFS.websocket_sock_ops.getPeer(e,a,o);if(e.type===1&&(!l||l.socket.readyState===l.socket.CLOSING||l.socket.readyState===l.socket.CLOSED))throw new FS.ErrnoError(53);ArrayBuffer.isView(t)&&(r+=t.byteOffset,t=t.buffer);var c;if(c=t.slice(r,r+n),!l||l.socket.readyState!==l.socket.OPEN)return e.type===2&&(!l||l.socket.readyState===l.socket.CLOSING||l.socket.readyState===l.socket.CLOSED)&&(l=SOCKFS.websocket_sock_ops.createPeer(e,a,o)),l.msg_send_queue.push(c),n;try{return l.socket.send(c),n}catch(u){throw new FS.ErrnoError(28)}},recvmsg(e,t){if(e.type===1&&e.server)throw new FS.ErrnoError(53);var r=e.recv_queue.shift();if(!r){if(e.type===1){var n=SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(!n)throw new FS.ErrnoError(53);if(n.socket.readyState===n.socket.CLOSING||n.socket.readyState===n.socket.CLOSED)return null;throw new FS.ErrnoError(6)}throw new FS.ErrnoError(6)}var a=r.data.byteLength||r.data.length,o=r.data.byteOffset||0,l=r.data.buffer||r.data,c=Math.min(t,a),u={buffer:new Uint8Array(l,o,c),addr:r.addr,port:r.port};if(e.type===1&&c<a){var _=a-c;r.data=new Uint8Array(l,o+c,_),e.recv_queue.unshift(r)}return u}}},getSocketFromFD=e=>{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<t.length;r++)if(typeof t[r]=="string")if(t[r]==="Z"){for(a=0;a<8-t.length+1;a++)l[r+a]=0;n=a-1}else l[r+n]=_htons(parseInt(t[r],16));else l[r+n]=t[r];return[l[1]<<16|l[0],l[3]<<16|l[2],l[5]<<16|l[4],l[7]<<16|l[6]]},writeSockaddr=(e,t,r,n,a)=>{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),c=l.sock_ops.accept(l);if(t)var u=writeSockaddr(t,c.family,DNS.lookup_name(c.daddr),c.dport,r);return c.stream.fd}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.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,c=0,u=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],_=!0,d="";for(c=0;c<5;c++)if(u[c]!==0){_=!1;break}if(_){if(d=inetNtop4(u[6]|u[7]<<16),u[5]===-1)return t="::ffff:",t+=d,t;if(u[5]===0)return t="::",d==="0.0.0.0"&&(d=""),d==="0.0.0.1"&&(d="1"),t+=d,t}for(r=0;r<8;r++)u[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&&u[r]===0&&r>=o&&r<o+n){r===o&&(t+=":",o===0&&(t+=":"));continue}t+=Number(_ntohs(u[r]&65535)).toString(16),t+=r<7?":":""}return t},readSockaddr=(e,t)=>{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),c=getSocketAddress(t,r);return l.sock_ops.bind(l,c.addr,c.port),0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.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),c=getSocketAddress(t,r);return l.sock_ops.connect(l,c.addr,c.port),0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.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),c=convertI32PairToI53Checked(a,o);try{if(isNaN(l))return 61;var u=SYSCALLS.getStreamFromFD(e);return FS.allocate(u,l,c),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.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";var syscallGetVarargI=()=>{var e=HEAP32[+SYSCALLS.varargs>>>2>>>0];return SYSCALLS.varargs+=4,e},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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.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,t>>>=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<n?-68:(stringToUTF8(r,e,t),n)}catch(a){if(typeof FS>"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),c=Math.floor(l/a);c<n.getdents.length&&o+a<=r;){var u,_,d=n.getdents[c];if(d===".")u=n.node.id,_=4;else if(d===".."){var m=FS.lookupPath(n.path,{parent:!0});u=m.node.id,_=4}else{var p=FS.lookupNode(n.node,d);u=p.id,_=FS.isChrdev(p.mode)?2:FS.isDir(p.mode)?4:FS.isLink(p.mode)?10:8}tempI64=[u>>>0,(tempDouble=u,+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=[(c+1)*a>>>0,(tempDouble=(c+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]=_,stringToUTF8(d,t+o+19,256),o+=a,c+=1}return FS.llseek(n,c*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 c=writeSockaddr(t,l.family,DNS.lookup_name(l.daddr),l.dport,r);return 0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_getpeername.sig="iippiii";function ___syscall_getsockname(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),c=writeSockaddr(t,l.family,DNS.lookup_name(l.saddr||"0.0.0.0"),l.sport,r);return 0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.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(),c=HEAP32[o>>>2>>>0],u=HEAP32[o+4>>>2>>>0],_=HEAP32[o+8>>>2>>>0],d=HEAP32[o+12>>>2>>>0],m=[],l=0;l<32;l++)m.push(HEAP8[o+l+17>>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:c,c_oflag:u,c_cflag:_,c_lflag:d,c_cc:m})}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 p=n.tty.ops.ioctl_tiocgwinsz(n.tty),o=syscallGetVarargP();HEAP16[o>>>1>>>0]=p[0],HEAP16[o+2>>>1>>>0]=p[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;r<t.buckets.length;r++){var n=t.buckets[r];if(n.offset-n.roffset>0)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,c=0;c<o.buckets.length;c++){var u=o.buckets[c];l+=u.offset-u.roffset}var _=t.subarray(r,r+n);if(n<=0)return 0;if(l==0)throw new FS.ErrnoError(6);for(var d=Math.min(l,n),m=d,p=0,c=0;c<o.buckets.length;c++){var h=o.buckets[c],S=h.offset-h.roffset;if(d<=S){var w=h.buffer.subarray(h.roffset,h.offset);d<S?(w=w.subarray(0,d),h.roffset+=d):p++,_.set(w);break}else{var w=h.buffer.subarray(h.roffset,h.offset);_.set(w),_=_.subarray(w.byteLength),d-=w.byteLength,p++}}return p&&p==o.buckets.length&&(p--,o.buckets[p].offset=0,o.buckets[p].roffset=0),o.buckets.splice(0,p),m},write(e,t,r,n,a){var o=e.node.pipe,l=t.subarray(r,r+n),c=l.byteLength;if(c<=0)return 0;var u=null;o.buckets.length==0?(u={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0},o.buckets.push(u)):u=o.buckets[o.buckets.length-1],assert(u.offset<=PIPEFS.BUCKET_BUFFER_SIZE);var _=PIPEFS.BUCKET_BUFFER_SIZE-u.offset;if(_>=c)return u.buffer.set(l,u.offset),u.offset+=c,c;_>0&&(u.buffer.set(l.subarray(0,_),u.offset),u.offset+=_,l=l.subarray(_,l.byteLength));for(var d=l.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,m=l.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,p=0;p<d;p++){var h={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:PIPEFS.BUCKET_BUFFER_SIZE,roffset:0};o.buckets.push(h),h.buffer.set(l.subarray(0,PIPEFS.BUCKET_BUFFER_SIZE)),l=l.subarray(PIPEFS.BUCKET_BUFFER_SIZE,l.byteLength)}if(m>0){var h={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:l.byteLength,roffset:0};o.buckets.push(h),h.buffer.set(l)}return c},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<t;a++){var o=e+8*a,l=HEAP32[o>>>2>>>0],c=HEAP16[o+4>>>1>>>0],u=32,_=FS.getStream(l);_&&(u=SYSCALLS.DEFAULT_POLLMASK,_.stream_ops.poll&&(u=_.stream_ops.poll(_,-1))),u&=c|8|16,u&&n++,HEAP16[o+6>>>1>>>0]=u}return n}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.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),c=l.sock_ops.recvmsg(l,r);if(!c)return 0;if(a)var u=writeSockaddr(a,l.family,DNS.lookup_name(c.addr),c.port,o);return HEAPU8.set(c.buffer,t>>>0),c.buffer.byteLength}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_recvfrom.sig="iippipp";function ___syscall_recvmsg(e,t,r,n,a,o){t>>>=0;try{for(var l=getSocketFromFD(e),c=HEAPU32[t+8>>>2>>>0],u=HEAP32[t+12>>>2>>>0],_=0,d=0;d<u;d++)_+=HEAP32[c+(8*d+4)>>>2>>>0];var m=l.sock_ops.recvmsg(l,_);if(!m)return 0;var p=HEAPU32[t>>>2>>>0];if(p)var h=writeSockaddr(p,l.family,DNS.lookup_name(m.addr),m.port);for(var S=0,w=m.buffer.byteLength,d=0;w>0&&d<u;d++){var L=HEAPU32[c+(8*d+0)>>>2>>>0],P=HEAP32[c+(8*d+4)>>>2>>>0];if(P){var k=Math.min(P,w),C=m.buffer.subarray(S,S+k);HEAPU8.set(C,L+S>>>0),S+=k,w-=k}}return S}catch(x){if(typeof FS>"u"||x.name!=="ErrnoError")throw x;return-x.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,n>>>=0,a>>>=0;try{var l=getSocketFromFD(e),c=HEAPU32[t+8>>>2>>>0],u=HEAP32[t+12>>>2>>>0],_,d,m=HEAPU32[t>>>2>>>0],p=HEAP32[t+4>>>2>>>0];if(m){var h=getSocketAddress(m,p);d=h.port,_=h.addr}for(var S=0,w=0;w<u;w++)S+=HEAP32[c+(8*w+4)>>>2>>>0];for(var L=new Uint8Array(S),P=0,w=0;w<u;w++)for(var k=HEAPU32[c+(8*w+0)>>>2>>>0],C=HEAP32[c+(8*w+4)>>>2>>>0],x=0;x<C;x++)L[P++]=HEAP8[k+x>>>0];return l.sock_ops.sendmsg(l,L,0,S,_,d)}catch(g){if(typeof FS>"u"||g.name!=="ErrnoError")throw g;return-g.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 c=getSocketAddress(a,o);return l.sock_ops.sendmsg(l,HEAP8,t,r,c.addr,c.port)}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.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 c=readI53FromI64(r),u=HEAP32[r+8>>>2>>>0];u==1073741823?o=a:u==1073741822?o=-1:o=c*1e3+u/1e6,r+=16,c=readI53FromI64(r),u=HEAP32[r+8>>>2>>>0],u==1073741823?l=a:u==1073741822?l=-1:l=c*1e3+u/1e6}return(l!=-1||o!=-1)&&FS.utime(t,o,l),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.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},stackSave=()=>_emscripten_stack_get_current(),stackRestore=e=>__emscripten_stack_restore(e),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(c){return dlSetError("Could not load dynamic lib: ".concat(r,"\n").concat(c)),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 c=getFunctionAddress(n);c?n=c:(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){e>>>=0,t>>>=0,r>>>=0}__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;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 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),a===-1&&(a=4294967295);var o=d=>d;if(n===0){var l=32-8*r;o=d=>d<<l>>>l}var c=t.includes("unsigned"),u=(d,m)=>{},_;c?_=function(d,m){return u(m,this.name),m>>>0}:_=function(d,m){return u(m,this.name),m},registerType(e,{name:t,fromWireType:o,toWireType:_,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 c=HEAPU32[l>>>2>>>0],u=HEAPU32[l+4>>>2>>>0];return new a(HEAP8.buffer,u,c)}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 c=o,u=0;u<=a;++u){var _=o+u;if(u==a||HEAPU8[_>>>0]==0){var d=_-c,m=UTF8ToString(c,d);l===void 0?l=m:(l+="\0",l+=m),c=_+1}}else{for(var p=new Array(a),u=0;u<a;++u)p[u]=String.fromCharCode(HEAPU8[o+u>>>0]);l=p.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 c=_malloc(4+o+1),u=c+4;if(HEAPU32[c>>>2>>>0]=o,r&&l)stringToUTF8(a,u,o+1);else if(l)for(var _=0;_<o;++_){var d=a.charCodeAt(_);d>255&&(_free(u),throwBindingError("String has UTF-16 code units that do not fit in 8 bits")),HEAPU8[u+_>>>0]=d}else for(var _=0;_<o;++_)HEAPU8[u+_>>>0]=a[_];return n!==null&&n.push(_free,c),c},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 c=HEAP16[e+l*2>>>1>>>0];if(c==0)break;o+=String.fromCharCode(c)}return o},stringToUTF16=(e,t,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=t,a=r<e.length*2?r/2:e.length,o=0;o<a;++o){var l=e.charCodeAt(o);HEAP16[t>>>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<e.length;++o){var l=e.charCodeAt(o);if(l>=55296&&l<=57343){var c=e.charCodeAt(++o);l=65536+((l&1023)<<10)|c&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<e.length;++r){var n=e.charCodeAt(r);n>=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=c=>HEAPU16[c>>>1>>>0]):t===4&&(n=UTF32ToString,a=stringToUTF32,l=lengthBytesUTF32,o=c=>HEAPU32[c>>>2>>>0]),registerType(e,{name:r,fromWireType:c=>{for(var u=HEAPU32[c>>>2>>>0],_,d=c+4,m=0;m<=u;++m){var p=c+4+m*t;if(m==u||o(p)==0){var h=p-d,S=n(d,h);_===void 0?_=S:(_+="\0",_+=S),d=p+t}}return _free(c),_},toWireType:(c,u)=>{typeof u!="string"&&throwBindingError("Cannot pass non-string to C++ string type ".concat(r));var _=l(u),d=_malloc(4+_+t);return HEAPU32[d>>>2>>>0]=_/t,a(u,d+4,_+t),c!==null&&c.push(_free,d),d},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(c){_free(c)}})};__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(c){var u=UTF8ToString(e+36);dlSetError("'Could not load dynamic lib: ".concat(u,"\n").concat(c)),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";var __emscripten_runtime_keepalive_clear=()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0};__emscripten_runtime_keepalive_clear.sig="v";function __emscripten_set_offscreencanvas_size(e,t,r){return e>>>=0,-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(Ti),n=r.spawnSync(t,[],{shell:!0,stdio:"inherit"}),a=(l,c)=>l<<8|c;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 emval_symbols={},getStringOrSymbol=e=>{var t=emval_symbols[e];return t===void 0?readLatin1String(e):t},emval_methodCallers=[];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";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";var emval_addMethodCaller=e=>{var t=emval_methodCallers.length;return emval_methodCallers.push(e),t},getTypeName=e=>{var t=___getTypeName(e),r=readLatin1String(t);return _free(t),r},requireRegisteredType=(e,t)=>{var r=registeredTypes[e];return r===void 0&&throwBindingError("".concat(t," has unknown type ").concat(getTypeName(e))),r},emval_lookupTypes=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=requireRegisteredType(HEAPU32[t+n*4>>>2>>>0],"parameter "+n);return r},createNamedFunction=(e,t)=>Object.defineProperty(t,"name",{value:e}),reflectConstruct=Reflect.construct,emval_returnValue=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(HEAPU32[t>>>2>>>0]=Emval.toHandle(n)),a};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 __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) {\n",l=0,c=[];r===0&&c.push("obj");for(var u=["retType"],_=[a],d=0;d<e;++d)c.push("arg"+d),u.push("argType"+d),_.push(n[d]),o+=" var arg".concat(d," = argType").concat(d,".readValueFromPointer(args").concat(l?"+"+l:"",");\n"),l+=n[d].argPackAdvance;var m=r===1?"new func":"func.call";o+=" var rv = ".concat(m,"(").concat(c.join(", "),");\n"),a.isVoid||(u.push("emval_returnValue"),_.push(emval_returnValue),o+=" return emval_returnValue(retType, destructorsRef, rv);\n"),o+="};\n",u.push(o);var p=newFunc(Function,u)(..._),h="methodCaller<(".concat(n.map(S=>S.name).join(", "),") => ").concat(a.name,">");return emval_addMethodCaller(createNamedFunction(h,p))}__emval_get_method_caller.sig="pipi";var runDestructors=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function __emval_run_destructors(e){e>>>=0;var t=Emval.toValue(e);runDestructors(t),__emval_decref(e)}__emval_run_destructors.sig="vp";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),c=new Date(a.getFullYear(),6,1).getTimezoneOffset(),u=l.getTimezoneOffset(),_=(c!=u&&a.getTimezoneOffset()==Math.min(u,c))|0;HEAP32[r+32>>>2>>>0]=_}__localtime_js.sig="viip";var setTempRet0=e=>__emscripten_tempret_set(e),_setTempRet0=setTempRet0;Module._setTempRet0=_setTempRet0;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(),c=o.getTimezoneOffset(),u=Math.min(c,l);if(n<0)HEAP32[e+32>>>2>>>0]=+(l!=c&&u==a);else if(n>0!=(u==a)){var _=Math.max(c,l),d=n>0?u:_;r.setTime(r.getTime()+(d-a)*6e4)}HEAP32[e+24>>>2>>>0]=r.getDay();var m=ydayFromDate(r)|0;HEAP32[e+28>>>2>>>0]=m,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 p=r.getTime();return isNaN(p)?-1:p/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,c){e>>>=0;var u=convertI32PairToI53Checked(a,o);l>>>=0,c>>>=0;try{if(isNaN(u))return 61;var _=SYSCALLS.getStreamFromFD(n),d=FS.mmap(_,e,u,t,r),m=d.ptr;return HEAP32[l>>>2>>>0]=d.allocated,HEAPU32[c>>>2>>>0]=m,0}catch(p){if(typeof FS>"u"||p.name!=="ErrnoError")throw p;return-p.errno}}__mmap_js.sig="ipiiiiipp";function __msync_js(e,t,r,n,a,o,l){e>>>=0,t>>>=0;var c=convertI32PairToI53Checked(o,l);try{return isNaN(c)?61:(SYSCALLS.doMsync(e,SYSCALLS.getStreamFromFD(a),t,n,c),0)}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}__msync_js.sig="ippiiiii";function __munmap_js(e,t,r,n,a,o,l){e>>>=0,t>>>=0;var c=convertI32PairToI53Checked(o,l);try{var u=SYSCALLS.getStreamFromFD(a);r&2&&SYSCALLS.doMsync(e,u,t,n,c)}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.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),c=o.getTimezoneOffset(),u=l.getTimezoneOffset(),_=Math.max(c,u);HEAPU32[e>>>2>>>0]=_*60,HEAP32[t>>>2>>>0]=+(c!=u);var d=h=>{var S=h>=0?"-":"+",w=Math.abs(h),L=String(Math.floor(w/60)).padStart(2,"0"),P=String(w%60).padStart(2,"0");return"UTC".concat(S).concat(L).concat(P)},m=d(c),p=d(u);u<c?(stringToUTF8(m,r,17),stringToUTF8(p,n,17)):(stringToUTF8(m,n,17),stringToUTF8(p,r,17))};__tzset_js.sig="vpppp";var _emscripten_set_main_loop_timing=(e,t)=>{if(MainLoop.timingMode=e,MainLoop.timingValue=t,!MainLoop.func)return 1;if(MainLoop.running||(MainLoop.running=!0),e==0)MainLoop.scheduler=function(){var l=Math.max(0,MainLoop.tickStartTime+t-_emscripten_get_now())|0;setTimeout(MainLoop.runner,l)},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=>{var l;r.push(o),ENVIRONMENT_IS_WORKER?((l=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 o<MainLoop.currentlyRunningMainloop?(maybeExit(),!1):!0}if(MainLoop.running=!1,MainLoop.runner=function(){if(!ABORT){if(MainLoop.queue.length>0){var u=Date.now(),_=MainLoop.queue.shift();if(_.func(_.arg),MainLoop.remainingBlockers){var d=MainLoop.remainingBlockers,m=d%1==0?d-1:Math.floor(d);_.counted?MainLoop.remainingBlockers=m:(m=m+.5,MainLoop.remainingBlockers=(8*d+m)/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 n,a;if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=(n=MainLoop.remainingBlockers)!=null?n:0,r=(a=MainLoop.expectedBlockers)!=null?a:0;t?t<r?Module.setStatus("{message} ({expected - remaining}/{expected})"):Module.setStatus(e):Module.setStatus("")}},init(){Module.preMainLoop&&MainLoop.preMainLoop.push(Module.preMainLoop),Module.postMainLoop&&MainLoop.postMainLoop.push(Module.postMainLoop)},runIter(e){if(!ABORT){for(var t of MainLoop.preMainLoop)if(t()===!1)return;callUserCallback(e);for(var r of MainLoop.postMainLoop)r()}},nextRAF:0,fakeRequestAnimationFrame(e){var t=Date.now();if(MainLoop.nextRAF===0)MainLoop.nextRAF=t+1e3/60;else for(;t+2>=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.audioQueue.length;l++){var c=e.audioQueue[l];n=c._startTime+c._duration,a=0,o+=c._skipCount+1}t||(t=AL.QUEUE_LOOKAHEAD);for(var u=r+t,_=0;n<u;){if(o>=e.bufQueue.length)if(e.looping)o%=e.bufQueue.length;else break;var d=e.bufQueue[o%e.bufQueue.length];if(d.length===0){if(_++,_===e.bufQueue.length)break}else{var c=e.context.audioCtx.createBufferSource();c.buffer=d.audioBuf,c.playbackRate.value=e.playbackRate,(d.audioBuf._loopStart||d.audioBuf._loopEnd)&&(c.loopStart=d.audioBuf._loopStart,c.loopEnd=d.audioBuf._loopEnd);var m=0;e.type===4136&&e.looping?(m=Number.POSITIVE_INFINITY,c.loop=!0,d.audioBuf._loopStart&&(c.loopStart=d.audioBuf._loopStart),d.audioBuf._loopEnd&&(c.loopEnd=d.audioBuf._loopEnd)):m=(d.audioBuf.duration-a)/e.playbackRate,c._startOffset=a,c._duration=m,c._skipCount=_,_=0,c.connect(e.gain),typeof c.start<"u"?(n=Math.max(n,e.context.audioCtx.currentTime),c.start(n,a)):typeof c.noteOn<"u"&&(n=Math.max(n,e.context.audioCtx.currentTime),c.noteOn(n)),c._startTime=n,e.audioQueue.push(c),n+=m}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<r)break;e.audioQueue.shift(),e.bufStartTime=r,e.bufOffset=0,e.bufsProcessed++}if(e.bufsProcessed>=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,c=a.audioBuf._loopEnd||a.audioBuf.duration;c<=l&&(c=a.audioBuf.duration),o<c?e.bufOffset=o:e.bufOffset=l+(o-l)%(c-l)}}else if(e.audioQueue[0])e.bufOffset=(t-e.audioQueue[0]._startTime)*e.playbackRate;else{if(e.type!==4136&&e.looping){var u=AL.sourceDuration(e)/e.playbackRate;u>0&&(e.bufStartTime+=Math.floor((t-e.bufStartTime)/u)*u)}for(var _=0;_<e.bufQueue.length;_++){if(e.bufsProcessed>=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<r){e.bufOffset=(t-e.bufStartTime)*e.playbackRate;break}e.bufStartTime=r}e.bufOffset=0,e.bufsProcessed++}}return t},cancelPendingSourceAudio:e=>{AL.updateSourceTime(e);for(var t=1;t<e.audioQueue.length;t++){var r=e.audioQueue[t];r.stop()}e.audioQueue.length>1&&(e.audioQueue.length=1)},stopSourceAudio:e=>{for(var t=0;t<e.audioQueue.length;t++)e.audioQueue[t].stop();e.audioQueue.length=0},setSourceState:(e,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<e.bufQueue.length;r++)if(e.bufQueue[r].id!==0){t=e.bufQueue[r];break}if(e.spatialize===1||e.spatialize===2&&t.channels===1){if(e.panner)return;e.panner=e.context.audioCtx.createPanner(),AL.updateSourceGlobal(e),AL.updateSourceSpace(e),e.panner.connect(e.context.gain),e.gain.disconnect(),e.gain.connect(e.panner)}else{if(!e.panner)return;e.panner.disconnect(),e.gain.disconnect(),e.gain.connect(e.context.gain),e.panner=null}}},updateContextGlobal:e=>{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],c=e.direction[2],u=e.context.listener,_=u.position[0],d=u.position[1],m=u.position[2];if(e.relative){var p=-u.direction[0],h=-u.direction[1],S=-u.direction[2],w=u.up[0],L=u.up[1],P=u.up[2],k=(To,Io,Do)=>{var Mo=Math.sqrt(To*To+Io*Io+Do*Do);return Mo<Number.EPSILON?0:1/Mo},C=k(p,h,S);p*=C,h*=C,S*=C,C=k(w,L,P),w*=C,L*=C,P*=C;var x=L*S-P*h,g=P*p-w*S,A=w*h-L*p;C=k(x,g,A),x*=C,g*=C,A*=C,w=h*A-S*g,L=S*x-p*A,P=p*g-h*x;var F=o,y=l,E=c;o=F*x+y*w+E*p,l=F*g+y*L+E*h,c=F*A+y*P+E*S,F=r,y=n,E=a,r=F*x+y*w+E*p,n=F*g+y*L+E*h,a=F*A+y*P+E*S,r+=_,n+=d,a+=m}t.positionX?(r!=t.positionX.value&&(t.positionX.value=r),n!=t.positionY.value&&(t.positionY.value=n),a!=t.positionZ.value&&(t.positionZ.value=a)):t.setPosition(r,n,a),t.orientationX?(o!=t.orientationX.value&&(t.orientationX.value=o),l!=t.orientationY.value&&(t.orientationY.value=l),c!=t.orientationZ.value&&(t.orientationZ.value=c)):t.setOrientation(o,l,c);var b=e.dopplerShift,T=e.velocity[0],v=e.velocity[1],I=e.velocity[2],O=u.velocity[0],ie=u.velocity[1],we=u.velocity[2];if(r===_&&n===d&&a===m||T===O&&v===ie&&I===we)e.dopplerShift=1;else{var je=e.context.speedOfSound,ne=e.context.dopplerFactor,We=_-r,ze=d-n,Lt=m-a,Zr=Math.sqrt(We*We+ze*ze+Lt*Lt),Dr=(We*O+ze*ie+Lt*we)/Zr,_r=(We*T+ze*v+Lt*I)/Zr;Dr=Math.min(Dr,je/ne),_r=Math.min(_r,je/ne),e.dopplerShift=(je-ne*Dr)/(je-ne*_r)}e.dopplerShift!==b&&AL.updateSourceRate(e)}},updateSourceRate:e=>{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<e.bufQueue.length;r++){var n=e.bufQueue[r].audioBuf;t+=n?n.duration:0}return t},sourceTell:e=>{AL.updateSourceTime(e);for(var t=0,r=0;r<e.bufsProcessed;r++)e.bufQueue[r].audioBuf&&(t+=e.bufQueue[r].audioBuf.duration);return t+=e.bufOffset,t},sourceSeek:(e,t)=>{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 c=0,o=0,l=0;l<n.bufQueue.length;l++)c+=n.bufQueue[l].length,n.bufQueue[l].id!==0&&(o=n.bufQueue[l].bytesPerSample*n.bufQueue[l].channels);return c*o;case 8202:for(var c=0,l=0;l<n.bufQueue.length;l++)c+=n.bufQueue[l].length;return c;case 8203:return AL.sourceDuration(n);case 53248:return n.distanceModel;default:return AL.currentCtx.err=40962,null}},setSourceParam:(e,t,r,n)=>{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 c in a.bufQueue)a.bufQueue[c].refCount--;a.bufQueue.length=1,a.bufQueue[0]=AL.buffers[0],a.bufsProcessed=0,a.type=4144}else{var u=AL.buffers[n];if(!u){AL.currentCtx.err=40963;return}for(var c in a.bufQueue)a.bufQueue[c].refCount--;a.bufQueue.length=0,u.refCount++,a.bufQueue=[u],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)||n<Math.max(0,a.minGain)||n>1){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 m=AL.sourceDuration(a);if(m>0){var _;for(var d in a.bufQueue)if(d){_=a.bufQueue[d].frequency;break}n/=_}if(n<0||n>m){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4134:var m=AL.sourceDuration(a);if(m>0){var p;for(var d in a.bufQueue)if(d){var u=a.bufQueue[d];p=u.frequency*u.bytesPerSample*u.channels;break}n/=p}if(n<0||n>m){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 c=l.getChannelData(0),u=0;u<n;++u)c[u]=HEAPU8[r++>>>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 c=l.getChannelData(0);r>>=1;for(var u=0;u<n>>1;++u)c[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 c=l.getChannelData(0),_=l.getChannelData(1),u=0;u<n>>1;++u)c[u]=HEAPU8[r++>>>0]*.0078125-1,_[u]=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 c=l.getChannelData(0),_=l.getChannelData(1);r>>=1;for(var u=0;u<n>>2;++u)c[u]=HEAP16[r++>>>0]*30517578125e-15,_[u]=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 c=l.getChannelData(0);r>>=2;for(var u=0;u<n>>2;++u)c[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 c=l.getChannelData(0),_=l.getChannelData(1);r>>=2;for(var u=0;u<n>>3;++u)c[u]=HEAPF32[r++>>>0],_[u]=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(d){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<e;++r){var n=HEAP32[t+r*4>>>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<e;++r){var n=HEAP32[t+r*4>>>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<e;++r){var n=HEAP32[t+r*4>>>2>>>0];if(!AL.currentCtx.sources[n]){AL.currentCtx.err=40961;return}}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<e;++r){var n={deviceId:AL.currentCtx.deviceId,id:AL.newId(),refCount:0,audioBuf:null,frequency:0,bytesPerSample:2,channels:1,length:0};AL.deviceRefCounts[n.deviceId]++,AL.buffers[n.id]=n,HEAP32[t+r*4>>>2>>>0]=n.id}}_alGenBuffers.sig="vip";function _alGenSources(e,t){if(t>>>=0,!!AL.currentCtx)for(var r=0;r<e;++r){var n=AL.currentCtx.audioCtx.createGain();n.connect(AL.currentCtx.gain);var a={context:AL.currentCtx,id:AL.newId(),type:4144,state:4113,bufQueue:[AL.buffers[0]],audioQueue:[],looping:!1,pitch:1,dopplerShift:1,gain:n,minGain:0,maxGain:1,panner:null,bufsProcessed:0,bufStartTime:Number.NEGATIVE_INFINITY,bufOffset:0,relative:!1,refDistance:1,maxDistance:340282e33,rolloffFactor:1,position:[0,0,0],velocity:[0,0,0],direction:[0,0,0],coneOuterGain:0,coneInnerAngle:360,coneOuterAngle:360,distanceModel:53250,spatialize:2,get playbackRate(){return this.pitch*this.dopplerShift}};AL.currentCtx.sources[a.id]=a,HEAP32[t+r*4>>>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<e;++r)if(!AL.currentCtx.sources[HEAP32[t+r*4>>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<e;++r)if(!AL.currentCtx.sources[HEAP32[t+r*4>>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<n.bufQueue.length;o++)if(n.bufQueue[o].id!==0){a=n.bufQueue[o];break}for(var o=0;o<t;++o){var l=HEAP32[r+o*4>>>2>>>0],c=AL.buffers[l];if(!c){AL.currentCtx.err=40961;return}a.id!==0&&(c.frequency!==a.frequency||c.bytesPerSample!==a.bytesPerSample||c.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<t;++o){var l=HEAP32[r+o*4>>>2>>>0],c=AL.buffers[l];c.refCount++,n.bufQueue.push(c)}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<e;++r)if(!AL.currentCtx.sources[HEAP32[t+r*4>>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<e;++r)if(!AL.currentCtx.sources[HEAP32[t+r*4>>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<t;a++){var o=n.bufQueue.shift();o.refCount--,HEAP32[r+a*4>>>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 r,n,a,o;e>>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureCloseDevice");return t?(delete AL.captures[e],AL.freeIds.push(e),(r=t.mediaStreamSourceNode)==null||r.disconnect(),(n=t.mergerNode)==null||n.disconnect(),(a=t.splitterNode)==null||a.disconnect(),(o=t.scriptProcessorNode)==null||o.disconnect(),t.mediaStream&&t.mediaStream.getTracks().forEach(l=>l.stop()),delete t.buffers,t.capturedFrameCount=0,t.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 C;e>>>=0;var a=AL.CAPTURE_DEVICE_NAME;if(e!==0&&(a=UTF8ToString(e),a!==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 o=navigator.getUserMedia||navigator.mediaDevices&&navigator.mediaDevices.getUserMedia;if(!o)return AL.alcErr=40965,0;var l=window.AudioContext||window.webkitAudioContext;if(!AL.sharedCaptureAudioCtx)try{AL.sharedCaptureAudioCtx=new l}catch(x){return AL.alcErr=40965,0}autoResumeAudioContext(AL.sharedCaptureAudioCtx);var c;switch(r){case 65552:case 4353:case 4352:c=1;break;case 65553:case 4355:case 4354:c=2;break;default:return AL.alcErr=40964,0}function u(x){return new Float32Array(x)}function _(x){return new Int16Array(x)}function d(x){return new Uint8Array(x)}var m,p;switch(r){case 65552:case 65553:m="f32",p=u;break;case 4353:case 4355:m="i16",p=_;break;case 4352:case 4354:m="u8",p=d;break}var h=[];try{for(var S=0;S<c;++S)h[S]=p(n)}catch(x){return AL.alcErr=40965,0}var w={audioCtx:AL.sharedCaptureAudioCtx,deviceName:a,requestedSampleRate:t,requestedSampleType:m,outputChannelCount:c,inputChannelCount:null,mediaStreamError:null,mediaStreamSourceNode:null,mediaStream:null,mergerNode:null,splitterNode:null,scriptProcessorNode:null,isCapturing:!1,buffers:h,get bufferFrameCapacity(){return h[0].length},capturePlayhead:0,captureReadhead:0,capturedFrameCount:0},L=x=>{w.mediaStreamError=x},P=x=>{w.mediaStreamSourceNode=w.audioCtx.createMediaStreamSource(x),w.mediaStream=x;var g=1;switch(w.mediaStreamSourceNode.channelCountMode){case"max":g=c;break;case"clamped-max":g=Math.min(c,w.mediaStreamSourceNode.channelCount);break;case"explicit":g=w.mediaStreamSourceNode.channelCount;break}w.inputChannelCount=g;var A=512;w.scriptProcessorNode=w.audioCtx.createScriptProcessor(A,g,c),g>c?(w.mergerNode=w.audioCtx.createChannelMerger(g),w.mediaStreamSourceNode.connect(w.mergerNode),w.mergerNode.connect(w.scriptProcessorNode)):g<c?(w.splitterNode=w.audioCtx.createChannelSplitter(c),w.mediaStreamSourceNode.connect(w.splitterNode),w.splitterNode.connect(w.scriptProcessorNode)):w.mediaStreamSourceNode.connect(w.scriptProcessorNode),w.scriptProcessorNode.connect(w.audioCtx.destination),w.scriptProcessorNode.onaudioprocess=F=>{if(w.isCapturing){var y=w,E=F.inputBuffer;switch(r){case 65552:for(var v=E.getChannelData(0),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=v[b]}break;case 65553:for(var v=E.getChannelData(0),I=E.getChannelData(1),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=v[b],y.buffers[1][T]=I[b]}break;case 4353:for(var v=E.getChannelData(0),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=v[b]*32767}break;case 4355:for(var v=E.getChannelData(0),I=E.getChannelData(1),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=v[b]*32767,y.buffers[1][T]=I[b]*32767}break;case 4352:for(var v=E.getChannelData(0),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=(v[b]+1)*127}break;case 4354:for(var v=E.getChannelData(0),I=E.getChannelData(1),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=(v[b]+1)*127,y.buffers[1][T]=(I[b]+1)*127}break}y.capturePlayhead+=E.length,y.capturePlayhead%=y.bufferFrameCapacity,y.capturedFrameCount+=E.length,y.capturedFrameCount=Math.min(y.capturedFrameCount,y.bufferFrameCapacity)}}};(C=navigator.mediaDevices)!=null&&C.getUserMedia?navigator.mediaDevices.getUserMedia({audio:!0}).then(P).catch(L):navigator.getUserMedia({audio:!0},P,L);var k=AL.newId();return AL.captures[k]=w,k}_alcCaptureOpenDevice.sig="ppiii";function _alcCaptureSamples(e,t,r){e>>>=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 c(C,x){HEAPF32[t+4*C>>>2>>>0]=x}function u(C,x){HEAP16[t+2*C>>>1>>>0]=x}function _(C,x){HEAP8[t+C>>>0]=x}var d;switch(n.requestedSampleType){case"f32":d=c;break;case"i16":d=u;break;case"u8":d=_;break;default:return}if(Math.floor(l)==l)for(var m=0,p=0;p<r;++p){for(var h=0;h<n.buffers.length;++h,++m)d(m,n.buffers[h][n.captureReadhead]);n.captureReadhead=(l+n.captureReadhead)%n.bufferFrameCapacity}else for(var m=0,p=0;p<r;++p){for(var S=Math.floor(n.captureReadhead),w=Math.ceil(n.captureReadhead),L=n.captureReadhead-S,h=0;h<n.buffers.length;++h,++m){var P=n.buffers[h][S],k=n.buffers[h][w];d(m,(1-L)*P+L*k)}n.captureReadhead=(n.captureReadhead+l)%n.bufferFrameCapacity}n.capturedFrameCount=0}_alcCaptureSamples.sig="vppi";function _alcCaptureStart(e){e>>>=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 c=window.AudioContext||window.webkitAudioContext,u=null;try{r?u=new c(r):u=new c}catch(h){return h.name==="NotSupportedError"?AL.alcErr=40964:AL.alcErr=40961,0}autoResumeAudioContext(u),typeof u.createGain>"u"&&(u.createGain=u.createGainNode);var _=u.createGain();_.connect(u.destination);var d={deviceId:e,id:AL.newId(),attrs:n,audioCtx:u,listener:{position:[0,0,0],velocity:[0,0,0],direction:[0,0,0],up:[0,0,0]},sources:[],interval:setInterval(()=>AL.scheduleContextAudio(d),AL.QUEUE_INTERVAL),gain:_,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[d.id]=d,a!==null)for(var m in AL.contexts){var p=AL.contexts[m];p.deviceId===e&&(p.hrtf=a,AL.updateContextGlobal(p))}return d.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){e>>>=0;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<AL.currentCtx.attrs.length;a++)HEAP32[n+a*4>>>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 c=AL.contexts[l];c.deviceId===e&&(o=c.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 u=AL.requireValidCaptureDevice(e,"alcGetIntegerv");if(!u)return;var _=u.capturedFrameCount,d=u.requestedSampleRate,m=u.audioCtx.sampleRate,p=Math.floor(_*(d/m));HEAP32[n>>>2>>>0]=p;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){e>>>=0,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){e>>>=0}_alcProcessContext.sig="vp";function _alcSuspendContext(e){e>>>=0}_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_drop_file(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.dropFile(Module,e,t)}_duckdb_web_fs_file_drop_file.sig="vpi";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<t;r++)e[r]=null;return t},genObject:(e,t,r,n)=>{for(var a=0;a<e;a++){var o=GLctx[r](),l=o&&GL.getNewId(n);o?(o.name=l,n[l]=o):GL.recordError(1282),HEAP32[t+a*4>>>2>>>0]=l}},getSource:(e,t,r,n)=>{for(var a="",o=0;o<t;++o){var l=n?HEAPU32[n+o*4>>>2>>>0]:void 0;a+=UTF8ToString(HEAPU32[r+o*4>>>2>>>0],l)}return a},createContext:(e,t)=>{if(!e.getContextSafariWebGL2Fixed){let o=function(l,c){var u=e.getContextSafariWebGL2Fixed(l,c);return l=="webgl"==u instanceof WebGLRenderingContext?u:null};var a=o;e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=o}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,c){c>>>=0,GLctx.compressedTexImage2D(e,t,r,n,a,o,HEAPU8.subarray(c>>>0,c+l>>>0))}_glCompressedTexImage2D.sig="viiiiiiip";var _emscripten_glCompressedTexImage2D=_glCompressedTexImage2D;_emscripten_glCompressedTexImage2D.sig="viiiiiiip";function _glCompressedTexSubImage2D(e,t,r,n,a,o,l,c,u){u>>>=0,GLctx.compressedTexSubImage2D(e,t,r,n,a,o,l,HEAPU8.subarray(u>>>0,u+c>>>0))}_glCompressedTexSubImage2D.sig="viiiiiiiip";var _emscripten_glCompressedTexSubImage2D=_glCompressedTexSubImage2D;_emscripten_glCompressedTexSubImage2D.sig="viiiiiiiip";var _glCopyTexImage2D=(e,t,r,n,a,o,l,c)=>GLctx.copyTexImage2D(e,t,r,n,a,o,l,c);_glCopyTexImage2D.sig="viiiiiiii";var _emscripten_glCopyTexImage2D=_glCopyTexImage2D;_emscripten_glCopyTexImage2D.sig="viiiiiiii";var _glCopyTexSubImage2D=(e,t,r,n,a,o,l,c)=>GLctx.copyTexSubImage2D(e,t,r,n,a,o,l,c);_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<e;r++){var n=HEAP32[t+r*4>>>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<e;++r){var n=HEAP32[t+r*4>>>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<e;r++){var n=HEAP32[t+r*4>>>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<e;r++){var n=HEAP32[t+r*4>>>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<e;r++){var n=HEAP32[t+r*4>>>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<e;r++){var n=HEAP32[t+r*4>>>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<e;n++)r[n]=HEAP32[t+n*4>>>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<e;r++){var n=GLctx.disjointTimerQueryExt.createQueryEXT();if(!n){for(GL.recordError(1282);r<e;)HEAP32[t+r++*4>>>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,c)=>{t=GL.programs[t];var u=GLctx[e](t,r);if(u){var _=c&&stringToUTF8(u.name,c,n);a&&(HEAP32[a>>>2>>>0]=_),o&&(HEAP32[o>>>2>>>0]=u.size),l&&(HEAP32[l>>>2>>>0]=u.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<o;++l){var c=GL.shaders.indexOf(a[l]);HEAP32[n+l*4>>>2>>>0]=c}}_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<o.length;++l)switch(r){case 0:HEAP32[t+l*4>>>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(c){GL.recordError(1280),err("GL_INVALID_ENUM in glGet".concat(r,"v: Unknown object returned from WebGL getParameter(").concat(e,")! (error: ").concat(c,")"));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<a;++o)e.maxUniformLength=Math.max(e.maxUniformLength,GLctx.getActiveUniform(e,o).name.length+1);HEAP32[r>>>2>>>0]=e.maxUniformLength}else if(t==35722){if(!e.maxAttributeLength)for(var l=GLctx.getProgramParameter(e,35721),o=0;o<l;++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,GLctx.getActiveAttrib(e,o).name.length+1);HEAP32[r>>>2>>>0]=e.maxAttributeLength}else if(t==35381){if(!e.maxUniformBlockNameLength)for(var c=GLctx.getProgramParameter(e,35382),o=0;o<c;++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,GLctx.getActiveUniformBlockName(e,o).length+1);HEAP32[r>>>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]?)(?:$| .*)/,c=o.match(l);c!==null&&(c[1].length==3&&(c[1]=c[1]+"0"),o="OpenGL ES GLSL ES ".concat(c[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;n<o;++n){var l=GLctx.getActiveUniform(e,n),c=l.name,u=l.size,_=webglGetLeftBracePos(c),d=_>0?c.slice(0,_):c,m=e.uniformIdCounter;for(e.uniformIdCounter+=u,r[d]=[u,m],a=0;a<u;++a)t[m]=a,e.uniformArrayNamesById[m++]=d}}};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<l[0]&&(n+=l[1],r[n]=r[n]||GLctx.getUniformLocation(e,t)))return n}else GL.recordError(1281);return-1}_glGetUniformLocation.sig="iip";var _emscripten_glGetUniformLocation=_glGetUniformLocation;_emscripten_glGetUniformLocation.sig="iip";var webglGetUniformLocation=e=>{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<a.length;o++)switch(n){case 0:HEAP32[r+o*4>>>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<a.length;o++)switch(n){case 0:HEAP32[r+o*4>>>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,c){return l+c-1&-c}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),c=colorChannelsInGlTextureFormat(t)*l.BYTES_PER_ELEMENT,u=computeUnpackAlignedImageSize(r,n,c);return l.subarray(toTypedArrayIndex(a,l)>>>0,toTypedArrayIndex(a+u,l)>>>0)};function _glReadPixels(e,t,r,n,a,o,l){l>>>=0;var c=emscriptenWebGLGetTexPixelData(o,a,r,n,l,a);if(!c){GL.recordError(1280);return}GLctx.readPixels(e,t,r,n,a,o,c)}_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){t>>>=0,n>>>=0,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,c,u){u>>>=0;var _=u?emscriptenWebGLGetTexPixelData(c,l,n,a,u,r):null;GLctx.texImage2D(e,t,r,n,a,o,l,c,_)}_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,c,u){u>>>=0;var _=u?emscriptenWebGLGetTexPixelData(c,l,a,o,u,0):null;GLctx.texSubImage2D(e,t,r,n,a,o,l,c,_)}_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 n=miniTempWebGLFloatBuffers[t],a=0;a<t;++a)n[a]=HEAPF32[r+4*a>>>2>>>0];else var n=HEAPF32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1fv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLIntBuffers[t],a=0;a<t;++a)n[a]=HEAP32[r+4*a>>>2>>>0];else var n=HEAP32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1iv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLFloatBuffers[t],a=0;a<t;a+=2)n[a]=HEAPF32[r+4*a>>>2>>>0],n[a+1]=HEAPF32[r+(4*a+4)>>>2>>>0]}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2fv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLIntBuffers[t],a=0;a<t;a+=2)n[a]=HEAP32[r+4*a>>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2iv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLFloatBuffers[t],a=0;a<t;a+=3)n[a]=HEAPF32[r+4*a>>>2>>>0],n[a+1]=HEAPF32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAPF32[r+(4*a+8)>>>2>>>0]}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3fv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLIntBuffers[t],a=0;a<t;a+=3)n[a]=HEAP32[r+4*a>>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAP32[r+(4*a+8)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3iv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLFloatBuffers[4*t],a=HEAPF32;r=r>>>2,t*=4;for(var o=0;o<t;o+=4){var l=r+o;n[o]=a[l>>>0],n[o+1]=a[l+1>>>0],n[o+2]=a[l+2>>>0],n[o+3]=a[l+3>>>0]}}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4fv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLIntBuffers[t],a=0;a<t;a+=4)n[a]=HEAP32[r+4*a>>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAP32[r+(4*a+8)>>>2>>>0],n[a+3]=HEAP32[r+(4*a+12)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4iv(webglGetUniformLocation(e),n)}_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 a=miniTempWebGLFloatBuffers[t],o=0;o<t;o+=4)a[o]=HEAPF32[n+4*o>>>2>>>0],a[o+1]=HEAPF32[n+(4*o+4)>>>2>>>0],a[o+2]=HEAPF32[n+(4*o+8)>>>2>>>0],a[o+3]=HEAPF32[n+(4*o+12)>>>2>>>0]}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*16>>>2>>>0);GLctx.uniformMatrix2fv(webglGetUniformLocation(e),!!r,a)}_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 a=miniTempWebGLFloatBuffers[t],o=0;o<t;o+=9)a[o]=HEAPF32[n+4*o>>>2>>>0],a[o+1]=HEAPF32[n+(4*o+4)>>>2>>>0],a[o+2]=HEAPF32[n+(4*o+8)>>>2>>>0],a[o+3]=HEAPF32[n+(4*o+12)>>>2>>>0],a[o+4]=HEAPF32[n+(4*o+16)>>>2>>>0],a[o+5]=HEAPF32[n+(4*o+20)>>>2>>>0],a[o+6]=HEAPF32[n+(4*o+24)>>>2>>>0],a[o+7]=HEAPF32[n+(4*o+28)>>>2>>>0],a[o+8]=HEAPF32[n+(4*o+32)>>>2>>>0]}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*36>>>2>>>0);GLctx.uniformMatrix3fv(webglGetUniformLocation(e),!!r,a)}_glUniformMatrix3fv.sig="viiip";var _emscripten_glUniformMatrix3fv=_glUniformMatrix3fv;_emscripten_glUniformMatrix3fv.sig="viiip";function _glUniformMatrix4fv(e,t,r,n){if(n>>>=0,t<=18){var a=miniTempWebGLFloatBuffers[16*t],o=HEAPF32;n=n>>>2,t*=16;for(var l=0;l<t;l+=16){var c=n+l;a[l]=o[c>>>0],a[l+1]=o[c+1>>>0],a[l+2]=o[c+2>>>0],a[l+3]=o[c+3>>>0],a[l+4]=o[c+4>>>0],a[l+5]=o[c+5>>>0],a[l+6]=o[c+6>>>0],a[l+7]=o[c+7>>>0],a[l+8]=o[c+8>>>0],a[l+9]=o[c+9>>>0],a[l+10]=o[c+10>>>0],a[l+11]=o[c+11>>>0],a[l+12]=o[c+12>>>0],a[l+13]=o[c+13>>>0],a[l+14]=o[c+14>>>0],a[l+15]=o[c+15>>>0]}}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*64>>>2>>>0);GLctx.uniformMatrix4fv(webglGetUniformLocation(e),!!r,a)}_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(){$e(this,"allocated",[void 0]);$e(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|0;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch(n){}};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";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<e.length;++r)HEAP8[t++>>>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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return c.errno}}_fd_fdstat_get.sig="iip";var doReadv=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var l=HEAPU32[t>>>2>>>0],c=HEAPU32[t+4>>>2>>>0];t+=8;var u=FS.read(e,HEAP8,l,c,n);if(u<0)return-1;if(a+=u,u<c)break;typeof n<"u"&&(n+=u)}return a};function _fd_pread(e,t,r,n,a,o){t>>>=0,r>>>=0;var l=convertI32PairToI53Checked(n,a);o>>>=0;try{if(isNaN(l))return 61;var c=SYSCALLS.getStreamFromFD(e),u=doReadv(c,t,r,l);return HEAPU32[o>>>2>>>0]=u,0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return _.errno}}_fd_pread.sig="iippiip";var doWritev=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var l=HEAPU32[t>>>2>>>0],c=HEAPU32[t+4>>>2>>>0];t+=8;var u=FS.write(e,HEAP8,l,c,n);if(u<0)return-1;if(a+=u,u<c)break;typeof n<"u"&&(n+=u)}return a};function _fd_pwrite(e,t,r,n,a,o){t>>>=0,r>>>=0;var l=convertI32PairToI53Checked(n,a);o>>>=0;try{if(isNaN(l))return 61;var c=SYSCALLS.getStreamFromFD(e),u=doWritev(c,t,r,l);return HEAPU32[o>>>2>>>0]=u,0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return _.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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return c.errno}}_fd_seek.sig="iiiiip";function _fd_sync(e){var r;try{var t=SYSCALLS.getStreamFromFD(e);return(r=t.stream_ops)!=null&&r.fsync?t.stream_ops.fsync(t):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,c=0,u=0,_=0,d;function m(p,h,S,w,L,P){var k,C,x,g;return C=p===10?28:16,L=p===10?inetNtop6(L):inetNtop4(L),k=_malloc(C),g=writeSockaddr(k,p,L,P),assert(!g),x=_malloc(32),HEAP32[x+4>>>2>>>0]=p,HEAP32[x+8>>>2>>>0]=h,HEAP32[x+12>>>2>>>0]=S,HEAPU32[x+24>>>2>>>0]=w,HEAPU32[x+20>>>2>>>0]=k,p===10?HEAP32[x+16>>>2>>>0]=28:HEAP32[x+16>>>2>>>0]=16,HEAP32[x+28>>>2>>>0]=0,x}if(r&&(l=HEAP32[r>>>2>>>0],c=HEAP32[r+4>>>2>>>0],u=HEAP32[r+8>>>2>>>0],_=HEAP32[r+12>>>2>>>0]),u&&!_&&(_=u===2?17:6),!u&&_&&(u=_===17?2:1),_===0&&(_=6),u===0&&(u=1),!e&&!t)return-2;if(l&-1088||r!==0&&HEAP32[r>>>2>>>0]&2&&!e)return-1;if(l&32)return-2;if(u!==0&&u!==1&&u!==2)return-7;if(c!==0&&c!==2&&c!==10)return-6;if(t&&(t=UTF8ToString(t),o=parseInt(t,10),isNaN(o)))return l&1024?-2:-8;if(!e)return c===0&&(c=2),l&1||(c===2?a=_htonl(2130706433):a=[0,0,0,_htonl(1)]),d=m(c,u,_,null,a,o),HEAPU32[n>>>2>>>0]=d,0;if(e=UTF8ToString(e),a=inetPton4(e),a!==null)if(c===0||c===2)c=2;else if(c===10&&l&8)a=[0,0,_htonl(65535),a],c=10;else return-2;else if(a=inetPton6(e),a!==null)if(c===0||c===10)c=10;else return-2;return a!=null?(d=m(c,u,_,e,a,o),HEAPU32[n>>>2>>>0]=d,0):l&4?-2:(e=DNS.lookup_name(e),a=inetPton4(e),c===0?c=2:c===10&&(a=[0,0,_htonl(65535),a]),d=m(c,u,_,null,a,o),HEAPU32[n>>>2>>>0]=d,0)}_getaddrinfo.sig="ipppp";function _getnameinfo(e,t,r,n,a,o,l){e>>>=0,r>>>=0,a>>>=0;var c=readSockaddr(e,t);if(c.errno)return-6;var u=c.port,_=c.addr,d=!1;if(r&&n){var m;if(l&1||!(m=DNS.lookup_addr(_))){if(l&8)return-2}else _=m;var p=stringToUTF8(_,r,n);p+1>=n&&(d=!0)}if(a&&o){u=""+u;var p=stringToUTF8(u,a,o);p+1>=o&&(d=!0)}return d?-12:0}_getnameinfo.sig="ipipipii";function _random_get(e,t){e>>>=0,t>>>=0;try{return randomFill(HEAPU8.subarray(e>>>0,e+t>>>0)),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return r.errno}}_random_get.sig="ipp";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:S=>{var w=0;return S!=null&&S!==0&&(w=stringToUTF8OnStack(S)),w},array:S=>{var w=stackAlloc(S.length);return writeArrayToMemory(S,w),w}};function l(S){return t==="string"?UTF8ToString(S):t==="boolean"?!!S:S}var c=getCFunc(e),u=[],_=0;if(n)for(var d=0;d<n.length;d++){var m=o[r[d]];m?(_===0&&(_=stackSave()),u[d]=m(n[d])):u[d]=n[d]}var p=c(...u);function h(S){return _!==0&&stackRestore(_),l(S)}return p=h(p),p},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 c=[3,2,1,0];t.push(c);var u=[7,5,1,1,102,0,1];t.push(u);var _=[];e[0]==="j"?_=[1,1,126]:_.push(0);function d(C){_.push(32),uleb128Encode(C,_)}for(var m=1,p=1;p<e.length;p++)e[p]=="j"?(d(m+1),_.push(173,66,32,134),d(m),_.push(172,132),m+=2):(d(m),m++);_.push(32,0,17,1,0),e[0]==="j"&&(_.push(34),uleb128Encode(m,_),_.push(66,32,136,167,16,0),d(m),_.push(167)),_.push(11);var h=[1];uleb128Encode(_.length,h),h.push(..._);var S=[10];uleb128Encode(h.length,S),S.push(...h),t.push(S);var w=new Uint8Array([].concat.apply([],t)),L=new WebAssembly.Module(w),P=new WebAssembly.Instance(L,{e:{t:wasmTable,r:setTempRet0}}),k=P.exports.f;return k},getTempRet0=e=>__emscripten_tempret_get();registerWasmPlugin(),FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit(),embind_init_charCodes(),BindingError=Module.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},InternalError=Module.InternalError=class extends Error{constructor(t){super(t),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 wasmImports={__assert_fail:___assert_fail,__c_longjmp:___c_longjmp,__call_sighandler:___call_sighandler,__cpp_exception:___cpp_exception,__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__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_js:__dlsym_js,_embind_register_bigint:__embind_register_bigint,_embind_register_bool:__embind_register_bool,_embind_register_emval:__embind_register_emval,_embind_register_float:__embind_register_float,_embind_register_integer:__embind_register_integer,_embind_register_memory_view:__embind_register_memory_view,_embind_register_std_string:__embind_register_std_string,_embind_register_std_wstring:__embind_register_std_wstring,_embind_register_void:__embind_register_void,_emscripten_dlopen_js:__emscripten_dlopen_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_get_progname:__emscripten_get_progname,_emscripten_lookup_name:__emscripten_lookup_name,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_set_offscreencanvas_size:__emscripten_set_offscreencanvas_size,_emscripten_system:__emscripten_system,_emval_call_method:__emval_call_method,_emval_decref:__emval_decref,_emval_get_global:__emval_get_global,_emval_get_method_caller:__emval_get_method_caller,_emval_run_destructors:__emval_run_destructors,_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,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_drop_file:_duckdb_web_fs_file_drop_file,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_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,emscripten_alcDevicePauseSOFT:_emscripten_alcDevicePauseSOFT,emscripten_alcDeviceResumeSOFT:_emscripten_alcDeviceResumeSOFT,emscripten_alcGetStringiSOFT:_emscripten_alcGetStringiSOFT,emscripten_alcResetDeviceSOFT:_emscripten_alcResetDeviceSOFT,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_asm_const_ptr:_emscripten_asm_const_ptr,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_date_now:_emscripten_date_now,emscripten_err:_emscripten_err,emscripten_get_heap_max:_emscripten_get_heap_max,emscripten_get_now:_emscripten_get_now,emscripten_get_now_res:_emscripten_get_now_res,emscripten_glActiveTexture:_emscripten_glActiveTexture,emscripten_glAttachShader:_emscripten_glAttachShader,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_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_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_glDeleteVertexArraysOES:_emscripten_glDeleteVertexArraysOES,emscripten_glDepthFunc:_emscripten_glDepthFunc,emscripten_glDepthMask:_emscripten_glDepthMask,emscripten_glDepthRangef:_emscripten_glDepthRangef,emscripten_glDetachShader:_emscripten_glDetachShader,emscripten_glDisable:_emscripten_glDisable,emscripten_glDisableVertexAttribArray:_emscripten_glDisableVertexAttribArray,emscripten_glDrawArrays:_emscripten_glDrawArrays,emscripten_glDrawArraysInstancedANGLE:_emscripten_glDrawArraysInstancedANGLE,emscripten_glDrawBuffersWEBGL:_emscripten_glDrawBuffersWEBGL,emscripten_glDrawElements:_emscripten_glDrawElements,emscripten_glDrawElementsInstancedANGLE:_emscripten_glDrawElementsInstancedANGLE,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_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_glIsVertexArrayOES:_emscripten_glIsVertexArrayOES,emscripten_glLineWidth:_emscripten_glLineWidth,emscripten_glLinkProgram:_emscripten_glLinkProgram,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_glVertexAttribDivisorANGLE:_emscripten_glVertexAttribDivisorANGLE,emscripten_glVertexAttribPointer:_emscripten_glVertexAttribPointer,emscripten_glViewport:_emscripten_glViewport,emscripten_out:_emscripten_out,emscripten_promise_create:_emscripten_promise_create,emscripten_promise_destroy:_emscripten_promise_destroy,emscripten_promise_resolve:_emscripten_promise_resolve,emscripten_resize_heap:_emscripten_resize_heap,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,getaddrinfo:_getaddrinfo,getnameinfo:_getnameinfo,memory:wasmMemory,proc_exit:_proc_exit,random_get:_random_get},wasmExports=createWasm(),__embind_initialize_bindings=Module.__embind_initialize_bindings=()=>(__embind_initialize_bindings=Module.__embind_initialize_bindings=wasmExports._embind_initialize_bindings)(),__embind_register_bindings=Module.__embind_register_bindings=e=>(__embind_register_bindings=Module.__embind_register_bindings=wasmExports._embind_register_bindings)(e),__emval_coro_resume=Module.__emval_coro_resume=(e,t)=>(__emval_coro_resume=Module.__emval_coro_resume=wasmExports._emval_coro_resume)(e,t),_main=Module._main=(e,t)=>(_main=Module._main=wasmExports.main)(e,t),_duckdb_web_fs_glob_add_path=Module._duckdb_web_fs_glob_add_path=e=>(_duckdb_web_fs_glob_add_path=Module._duckdb_web_fs_glob_add_path=wasmExports.duckdb_web_fs_glob_add_path)(e),_duckdb_web_clear_response=Module._duckdb_web_clear_response=()=>(_duckdb_web_clear_response=Module._duckdb_web_clear_response=wasmExports.duckdb_web_clear_response)(),_duckdb_web_fail_with=Module._duckdb_web_fail_with=e=>(_duckdb_web_fail_with=Module._duckdb_web_fail_with=wasmExports.duckdb_web_fail_with)(e),_duckdb_web_reset=Module._duckdb_web_reset=e=>(_duckdb_web_reset=Module._duckdb_web_reset=wasmExports.duckdb_web_reset)(e),_duckdb_web_connect=Module._duckdb_web_connect=()=>(_duckdb_web_connect=Module._duckdb_web_connect=wasmExports.duckdb_web_connect)(),_duckdb_web_disconnect=Module._duckdb_web_disconnect=e=>(_duckdb_web_disconnect=Module._duckdb_web_disconnect=wasmExports.duckdb_web_disconnect)(e),_duckdb_web_access_buffer=Module._duckdb_web_access_buffer=(e,t)=>(_duckdb_web_access_buffer=Module._duckdb_web_access_buffer=wasmExports.duckdb_web_access_buffer)(e,t),_duckdb_web_flush_files=Module._duckdb_web_flush_files=()=>(_duckdb_web_flush_files=Module._duckdb_web_flush_files=wasmExports.duckdb_web_flush_files)(),_duckdb_web_flush_file=Module._duckdb_web_flush_file=e=>(_duckdb_web_flush_file=Module._duckdb_web_flush_file=wasmExports.duckdb_web_flush_file)(e),_duckdb_web_open=Module._duckdb_web_open=(e,t)=>(_duckdb_web_open=Module._duckdb_web_open=wasmExports.duckdb_web_open)(e,t),_duckdb_web_get_global_file_info=Module._duckdb_web_get_global_file_info=(e,t)=>(_duckdb_web_get_global_file_info=Module._duckdb_web_get_global_file_info=wasmExports.duckdb_web_get_global_file_info)(e,t),_duckdb_web_collect_file_stats=Module._duckdb_web_collect_file_stats=(e,t,r)=>(_duckdb_web_collect_file_stats=Module._duckdb_web_collect_file_stats=wasmExports.duckdb_web_collect_file_stats)(e,t,r),_duckdb_web_export_file_stats=Module._duckdb_web_export_file_stats=(e,t)=>(_duckdb_web_export_file_stats=Module._duckdb_web_export_file_stats=wasmExports.duckdb_web_export_file_stats)(e,t),_duckdb_web_fs_drop_file=Module._duckdb_web_fs_drop_file=(e,t)=>(_duckdb_web_fs_drop_file=Module._duckdb_web_fs_drop_file=wasmExports.duckdb_web_fs_drop_file)(e,t),_duckdb_web_fs_drop_files=Module._duckdb_web_fs_drop_files=e=>(_duckdb_web_fs_drop_files=Module._duckdb_web_fs_drop_files=wasmExports.duckdb_web_fs_drop_files)(e),_duckdb_web_fs_glob_file_infos=Module._duckdb_web_fs_glob_file_infos=(e,t)=>(_duckdb_web_fs_glob_file_infos=Module._duckdb_web_fs_glob_file_infos=wasmExports.duckdb_web_fs_glob_file_infos)(e,t),_duckdb_web_fs_get_file_info_by_id=Module._duckdb_web_fs_get_file_info_by_id=(e,t,r)=>(_duckdb_web_fs_get_file_info_by_id=Module._duckdb_web_fs_get_file_info_by_id=wasmExports.duckdb_web_fs_get_file_info_by_id)(e,t,r),_duckdb_web_fs_get_file_info_by_name=Module._duckdb_web_fs_get_file_info_by_name=(e,t,r)=>(_duckdb_web_fs_get_file_info_by_name=Module._duckdb_web_fs_get_file_info_by_name=wasmExports.duckdb_web_fs_get_file_info_by_name)(e,t,r),_duckdb_web_fs_register_file_url=Module._duckdb_web_fs_register_file_url=(e,t,r,n,a)=>(_duckdb_web_fs_register_file_url=Module._duckdb_web_fs_register_file_url=wasmExports.duckdb_web_fs_register_file_url)(e,t,r,n,a),_duckdb_web_fs_register_file_buffer=Module._duckdb_web_fs_register_file_buffer=(e,t,r,n)=>(_duckdb_web_fs_register_file_buffer=Module._duckdb_web_fs_register_file_buffer=wasmExports.duckdb_web_fs_register_file_buffer)(e,t,r,n),_duckdb_web_copy_file_to_buffer=Module._duckdb_web_copy_file_to_buffer=(e,t)=>(_duckdb_web_copy_file_to_buffer=Module._duckdb_web_copy_file_to_buffer=wasmExports.duckdb_web_copy_file_to_buffer)(e,t),_duckdb_web_copy_file_to_path=Module._duckdb_web_copy_file_to_path=(e,t,r)=>(_duckdb_web_copy_file_to_path=Module._duckdb_web_copy_file_to_path=wasmExports.duckdb_web_copy_file_to_path)(e,t,r),_duckdb_web_get_version=Module._duckdb_web_get_version=e=>(_duckdb_web_get_version=Module._duckdb_web_get_version=wasmExports.duckdb_web_get_version)(e),_duckdb_web_get_feature_flags=Module._duckdb_web_get_feature_flags=()=>(_duckdb_web_get_feature_flags=Module._duckdb_web_get_feature_flags=wasmExports.duckdb_web_get_feature_flags)(),_duckdb_web_tokenize=Module._duckdb_web_tokenize=(e,t)=>(_duckdb_web_tokenize=Module._duckdb_web_tokenize=wasmExports.duckdb_web_tokenize)(e,t),_duckdb_web_tokenize_buffer=Module._duckdb_web_tokenize_buffer=(e,t,r)=>(_duckdb_web_tokenize_buffer=Module._duckdb_web_tokenize_buffer=wasmExports.duckdb_web_tokenize_buffer)(e,t,r),_duckdb_web_udf_scalar_create=Module._duckdb_web_udf_scalar_create=(e,t,r)=>(_duckdb_web_udf_scalar_create=Module._duckdb_web_udf_scalar_create=wasmExports.duckdb_web_udf_scalar_create)(e,t,r),_duckdb_web_prepared_create=Module._duckdb_web_prepared_create=(e,t,r)=>(_duckdb_web_prepared_create=Module._duckdb_web_prepared_create=wasmExports.duckdb_web_prepared_create)(e,t,r),_duckdb_web_prepared_create_buffer=Module._duckdb_web_prepared_create_buffer=(e,t,r,n)=>(_duckdb_web_prepared_create_buffer=Module._duckdb_web_prepared_create_buffer=wasmExports.duckdb_web_prepared_create_buffer)(e,t,r,n),_duckdb_web_prepared_close=Module._duckdb_web_prepared_close=(e,t,r)=>(_duckdb_web_prepared_close=Module._duckdb_web_prepared_close=wasmExports.duckdb_web_prepared_close)(e,t,r),_duckdb_web_prepared_run=Module._duckdb_web_prepared_run=(e,t,r,n)=>(_duckdb_web_prepared_run=Module._duckdb_web_prepared_run=wasmExports.duckdb_web_prepared_run)(e,t,r,n),_duckdb_web_prepared_send=Module._duckdb_web_prepared_send=(e,t,r,n)=>(_duckdb_web_prepared_send=Module._duckdb_web_prepared_send=wasmExports.duckdb_web_prepared_send)(e,t,r,n),_duckdb_web_query_run=Module._duckdb_web_query_run=(e,t,r)=>(_duckdb_web_query_run=Module._duckdb_web_query_run=wasmExports.duckdb_web_query_run)(e,t,r),_duckdb_web_query_run_buffer=Module._duckdb_web_query_run_buffer=(e,t,r,n)=>(_duckdb_web_query_run_buffer=Module._duckdb_web_query_run_buffer=wasmExports.duckdb_web_query_run_buffer)(e,t,r,n),_duckdb_web_pending_query_start=Module._duckdb_web_pending_query_start=(e,t,r,n)=>(_duckdb_web_pending_query_start=Module._duckdb_web_pending_query_start=wasmExports.duckdb_web_pending_query_start)(e,t,r,n),_duckdb_web_pending_query_start_buffer=Module._duckdb_web_pending_query_start_buffer=(e,t,r,n,a)=>(_duckdb_web_pending_query_start_buffer=Module._duckdb_web_pending_query_start_buffer=wasmExports.duckdb_web_pending_query_start_buffer)(e,t,r,n,a),_duckdb_web_pending_query_poll=Module._duckdb_web_pending_query_poll=(e,t,r)=>(_duckdb_web_pending_query_poll=Module._duckdb_web_pending_query_poll=wasmExports.duckdb_web_pending_query_poll)(e,t,r),_duckdb_web_pending_query_cancel=Module._duckdb_web_pending_query_cancel=(e,t)=>(_duckdb_web_pending_query_cancel=Module._duckdb_web_pending_query_cancel=wasmExports.duckdb_web_pending_query_cancel)(e,t),_duckdb_web_query_fetch_results=Module._duckdb_web_query_fetch_results=(e,t)=>(_duckdb_web_query_fetch_results=Module._duckdb_web_query_fetch_results=wasmExports.duckdb_web_query_fetch_results)(e,t),_duckdb_web_get_tablenames=Module._duckdb_web_get_tablenames=(e,t,r)=>(_duckdb_web_get_tablenames=Module._duckdb_web_get_tablenames=wasmExports.duckdb_web_get_tablenames)(e,t,r),_duckdb_web_get_tablenames_buffer=Module._duckdb_web_get_tablenames_buffer=(e,t,r,n)=>(_duckdb_web_get_tablenames_buffer=Module._duckdb_web_get_tablenames_buffer=wasmExports.duckdb_web_get_tablenames_buffer)(e,t,r,n),_duckdb_web_insert_arrow_from_ipc_stream=Module._duckdb_web_insert_arrow_from_ipc_stream=(e,t,r,n,a)=>(_duckdb_web_insert_arrow_from_ipc_stream=Module._duckdb_web_insert_arrow_from_ipc_stream=wasmExports.duckdb_web_insert_arrow_from_ipc_stream)(e,t,r,n,a),_duckdb_web_insert_csv_from_path=Module._duckdb_web_insert_csv_from_path=(e,t,r,n)=>(_duckdb_web_insert_csv_from_path=Module._duckdb_web_insert_csv_from_path=wasmExports.duckdb_web_insert_csv_from_path)(e,t,r,n),_duckdb_web_insert_json_from_path=Module._duckdb_web_insert_json_from_path=(e,t,r,n)=>(_duckdb_web_insert_json_from_path=Module._duckdb_web_insert_json_from_path=wasmExports.duckdb_web_insert_json_from_path)(e,t,r,n),_emscripten_GetProcAddress=Module._emscripten_GetProcAddress=e=>(_emscripten_GetProcAddress=Module._emscripten_GetProcAddress=wasmExports.emscripten_GetProcAddress)(e),_emscripten_webgl_get_proc_address=Module._emscripten_webgl_get_proc_address=e=>(_emscripten_webgl_get_proc_address=Module._emscripten_webgl_get_proc_address=wasmExports.emscripten_webgl_get_proc_address)(e),_emscripten_webgl_init_context_attributes=Module._emscripten_webgl_init_context_attributes=e=>(_emscripten_webgl_init_context_attributes=Module._emscripten_webgl_init_context_attributes=wasmExports.emscripten_webgl_init_context_attributes)(e),_emscripten_webgl1_get_proc_address=Module._emscripten_webgl1_get_proc_address=e=>(_emscripten_webgl1_get_proc_address=Module._emscripten_webgl1_get_proc_address=wasmExports.emscripten_webgl1_get_proc_address)(e),__emscripten_run_callback_on_thread=Module.__emscripten_run_callback_on_thread=(e,t,r,n,a)=>(__emscripten_run_callback_on_thread=Module.__emscripten_run_callback_on_thread=wasmExports._emscripten_run_callback_on_thread)(e,t,r,n,a),_emscripten_compute_dom_pk_code=Module._emscripten_compute_dom_pk_code=e=>(_emscripten_compute_dom_pk_code=Module._emscripten_compute_dom_pk_code=wasmExports.emscripten_compute_dom_pk_code)(e),_emscripten_dom_pk_code_to_string=Module._emscripten_dom_pk_code_to_string=e=>(_emscripten_dom_pk_code_to_string=Module._emscripten_dom_pk_code_to_string=wasmExports.emscripten_dom_pk_code_to_string)(e),_emscripten_dom_vk_to_string=Module._emscripten_dom_vk_to_string=e=>(_emscripten_dom_vk_to_string=Module._emscripten_dom_vk_to_string=wasmExports.emscripten_dom_vk_to_string)(e),__emscripten_set_offscreencanvas_size_on_thread=Module.__emscripten_set_offscreencanvas_size_on_thread=(e,t,r,n)=>(__emscripten_set_offscreencanvas_size_on_thread=Module.__emscripten_set_offscreencanvas_size_on_thread=wasmExports._emscripten_set_offscreencanvas_size_on_thread)(e,t,r,n),_emscripten_builtin_memcpy=Module._emscripten_builtin_memcpy=(e,t,r)=>(_emscripten_builtin_memcpy=Module._emscripten_builtin_memcpy=wasmExports.emscripten_builtin_memcpy)(e,t,r),_emscripten_builtin_memset=Module._emscripten_builtin_memset=(e,t,r)=>(_emscripten_builtin_memset=Module._emscripten_builtin_memset=wasmExports.emscripten_builtin_memset)(e,t,r),___dl_seterr=Module.___dl_seterr=(e,t)=>(___dl_seterr=Module.___dl_seterr=wasmExports.__dl_seterr)(e,t),_emscripten_dlopen=Module._emscripten_dlopen=(e,t,r,n,a)=>(_emscripten_dlopen=Module._emscripten_dlopen=wasmExports.emscripten_dlopen)(e,t,r,n,a),_emscripten_dlopen_promise=Module._emscripten_dlopen_promise=(e,t)=>(_emscripten_dlopen_promise=Module._emscripten_dlopen_promise=wasmExports.emscripten_dlopen_promise)(e,t),_emscripten_console_logf=Module._emscripten_console_logf=(e,t)=>(_emscripten_console_logf=Module._emscripten_console_logf=wasmExports.emscripten_console_logf)(e,t),_emscripten_console_errorf=Module._emscripten_console_errorf=(e,t)=>(_emscripten_console_errorf=Module._emscripten_console_errorf=wasmExports.emscripten_console_errorf)(e,t),_emscripten_console_warnf=Module._emscripten_console_warnf=(e,t)=>(_emscripten_console_warnf=Module._emscripten_console_warnf=wasmExports.emscripten_console_warnf)(e,t),_emscripten_console_tracef=Module._emscripten_console_tracef=(e,t)=>(_emscripten_console_tracef=Module._emscripten_console_tracef=wasmExports.emscripten_console_tracef)(e,t),_emscripten_outf=Module._emscripten_outf=(e,t)=>(_emscripten_outf=Module._emscripten_outf=wasmExports.emscripten_outf)(e,t),_emscripten_errf=Module._emscripten_errf=(e,t)=>(_emscripten_errf=Module._emscripten_errf=wasmExports.emscripten_errf)(e,t),_emscripten_fiber_init=Module._emscripten_fiber_init=(e,t,r,n,a,o,l)=>(_emscripten_fiber_init=Module._emscripten_fiber_init=wasmExports.emscripten_fiber_init)(e,t,r,n,a,o,l),_emscripten_fiber_init_from_current_context=Module._emscripten_fiber_init_from_current_context=(e,t,r)=>(_emscripten_fiber_init_from_current_context=Module._emscripten_fiber_init_from_current_context=wasmExports.emscripten_fiber_init_from_current_context)(e,t,r),_emscripten_get_heap_size=Module._emscripten_get_heap_size=()=>(_emscripten_get_heap_size=Module._emscripten_get_heap_size=wasmExports.emscripten_get_heap_size)(),_emscripten_scan_stack=Module._emscripten_scan_stack=e=>(_emscripten_scan_stack=Module._emscripten_scan_stack=wasmExports.emscripten_scan_stack)(e),_freelocale=Module._freelocale=e=>(_freelocale=Module._freelocale=wasmExports.freelocale)(e),_freeifaddrs=Module._freeifaddrs=e=>(_freeifaddrs=Module._freeifaddrs=wasmExports.freeifaddrs)(e),_emscripten_has_threading_support=Module._emscripten_has_threading_support=()=>(_emscripten_has_threading_support=Module._emscripten_has_threading_support=wasmExports.emscripten_has_threading_support)(),_emscripten_num_logical_cores=Module._emscripten_num_logical_cores=()=>(_emscripten_num_logical_cores=Module._emscripten_num_logical_cores=wasmExports.emscripten_num_logical_cores)(),_emscripten_futex_wait=Module._emscripten_futex_wait=(e,t,r)=>(_emscripten_futex_wait=Module._emscripten_futex_wait=wasmExports.emscripten_futex_wait)(e,t,r),_emscripten_futex_wake=Module._emscripten_futex_wake=(e,t)=>(_emscripten_futex_wake=Module._emscripten_futex_wake=wasmExports.emscripten_futex_wake)(e,t),_emscripten_is_main_runtime_thread=Module._emscripten_is_main_runtime_thread=()=>(_emscripten_is_main_runtime_thread=Module._emscripten_is_main_runtime_thread=wasmExports.emscripten_is_main_runtime_thread)(),_emscripten_main_thread_process_queued_calls=Module._emscripten_main_thread_process_queued_calls=()=>(_emscripten_main_thread_process_queued_calls=Module._emscripten_main_thread_process_queued_calls=wasmExports.emscripten_main_thread_process_queued_calls)(),_emscripten_current_thread_process_queued_calls=Module._emscripten_current_thread_process_queued_calls=()=>(_emscripten_current_thread_process_queued_calls=Module._emscripten_current_thread_process_queued_calls=wasmExports.emscripten_current_thread_process_queued_calls)(),__emscripten_yield=Module.__emscripten_yield=e=>(__emscripten_yield=Module.__emscripten_yield=wasmExports._emscripten_yield)(e),__emscripten_check_timers=Module.__emscripten_check_timers=e=>(__emscripten_check_timers=Module.__emscripten_check_timers=wasmExports._emscripten_check_timers)(e),_pthread_mutex_init=Module._pthread_mutex_init=(e,t)=>(_pthread_mutex_init=Module._pthread_mutex_init=wasmExports.pthread_mutex_init)(e,t),_pthread_mutex_destroy=Module._pthread_mutex_destroy=e=>(_pthread_mutex_destroy=Module._pthread_mutex_destroy=wasmExports.pthread_mutex_destroy)(e),_pthread_mutex_consistent=Module._pthread_mutex_consistent=e=>(_pthread_mutex_consistent=Module._pthread_mutex_consistent=wasmExports.pthread_mutex_consistent)(e),_pthread_barrier_init=Module._pthread_barrier_init=(e,t,r)=>(_pthread_barrier_init=Module._pthread_barrier_init=wasmExports.pthread_barrier_init)(e,t,r),_pthread_barrier_destroy=Module._pthread_barrier_destroy=e=>(_pthread_barrier_destroy=Module._pthread_barrier_destroy=wasmExports.pthread_barrier_destroy)(e),_pthread_barrier_wait=Module._pthread_barrier_wait=e=>(_pthread_barrier_wait=Module._pthread_barrier_wait=wasmExports.pthread_barrier_wait)(e),_pthread_getspecific=Module._pthread_getspecific=e=>(_pthread_getspecific=Module._pthread_getspecific=wasmExports.pthread_getspecific)(e),_pthread_setspecific=Module._pthread_setspecific=(e,t)=>(_pthread_setspecific=Module._pthread_setspecific=wasmExports.pthread_setspecific)(e,t),_pthread_cond_wait=Module._pthread_cond_wait=(e,t)=>(_pthread_cond_wait=Module._pthread_cond_wait=wasmExports.pthread_cond_wait)(e,t),_pthread_cond_signal=Module._pthread_cond_signal=e=>(_pthread_cond_signal=Module._pthread_cond_signal=wasmExports.pthread_cond_signal)(e),_pthread_cond_broadcast=Module._pthread_cond_broadcast=e=>(_pthread_cond_broadcast=Module._pthread_cond_broadcast=wasmExports.pthread_cond_broadcast)(e),_pthread_cond_init=Module._pthread_cond_init=(e,t)=>(_pthread_cond_init=Module._pthread_cond_init=wasmExports.pthread_cond_init)(e,t),_pthread_cond_destroy=Module._pthread_cond_destroy=e=>(_pthread_cond_destroy=Module._pthread_cond_destroy=wasmExports.pthread_cond_destroy)(e),_pthread_atfork=Module._pthread_atfork=(e,t,r)=>(_pthread_atfork=Module._pthread_atfork=wasmExports.pthread_atfork)(e,t,r),_pthread_cancel=Module._pthread_cancel=e=>(_pthread_cancel=Module._pthread_cancel=wasmExports.pthread_cancel)(e),_pthread_testcancel=Module._pthread_testcancel=()=>(_pthread_testcancel=Module._pthread_testcancel=wasmExports.pthread_testcancel)(),_pthread_equal=Module._pthread_equal=(e,t)=>(_pthread_equal=Module._pthread_equal=wasmExports.pthread_equal)(e,t),_pthread_mutexattr_init=Module._pthread_mutexattr_init=e=>(_pthread_mutexattr_init=Module._pthread_mutexattr_init=wasmExports.pthread_mutexattr_init)(e),_pthread_mutexattr_setprotocol=Module._pthread_mutexattr_setprotocol=(e,t)=>(_pthread_mutexattr_setprotocol=Module._pthread_mutexattr_setprotocol=wasmExports.pthread_mutexattr_setprotocol)(e,t),_pthread_mutexattr_settype=Module._pthread_mutexattr_settype=(e,t)=>(_pthread_mutexattr_settype=Module._pthread_mutexattr_settype=wasmExports.pthread_mutexattr_settype)(e,t),_pthread_mutexattr_destroy=Module._pthread_mutexattr_destroy=e=>(_pthread_mutexattr_destroy=Module._pthread_mutexattr_destroy=wasmExports.pthread_mutexattr_destroy)(e),_pthread_mutexattr_setpshared=Module._pthread_mutexattr_setpshared=(e,t)=>(_pthread_mutexattr_setpshared=Module._pthread_mutexattr_setpshared=wasmExports.pthread_mutexattr_setpshared)(e,t),_pthread_condattr_init=Module._pthread_condattr_init=e=>(_pthread_condattr_init=Module._pthread_condattr_init=wasmExports.pthread_condattr_init)(e),_pthread_condattr_destroy=Module._pthread_condattr_destroy=e=>(_pthread_condattr_destroy=Module._pthread_condattr_destroy=wasmExports.pthread_condattr_destroy)(e),_pthread_condattr_setclock=Module._pthread_condattr_setclock=(e,t)=>(_pthread_condattr_setclock=Module._pthread_condattr_setclock=wasmExports.pthread_condattr_setclock)(e,t),_pthread_condattr_setpshared=Module._pthread_condattr_setpshared=(e,t)=>(_pthread_condattr_setpshared=Module._pthread_condattr_setpshared=wasmExports.pthread_condattr_setpshared)(e,t),_pthread_getattr_np=Module._pthread_getattr_np=(e,t)=>(_pthread_getattr_np=Module._pthread_getattr_np=wasmExports.pthread_getattr_np)(e,t),_pthread_setcancelstate=Module._pthread_setcancelstate=(e,t)=>(_pthread_setcancelstate=Module._pthread_setcancelstate=wasmExports.pthread_setcancelstate)(e,t),_pthread_setcanceltype=Module._pthread_setcanceltype=(e,t)=>(_pthread_setcanceltype=Module._pthread_setcanceltype=wasmExports.pthread_setcanceltype)(e,t),_pthread_rwlock_init=Module._pthread_rwlock_init=(e,t)=>(_pthread_rwlock_init=Module._pthread_rwlock_init=wasmExports.pthread_rwlock_init)(e,t),_pthread_rwlock_destroy=Module._pthread_rwlock_destroy=e=>(_pthread_rwlock_destroy=Module._pthread_rwlock_destroy=wasmExports.pthread_rwlock_destroy)(e),_pthread_rwlock_rdlock=Module._pthread_rwlock_rdlock=e=>(_pthread_rwlock_rdlock=Module._pthread_rwlock_rdlock=wasmExports.pthread_rwlock_rdlock)(e),_pthread_rwlock_tryrdlock=Module._pthread_rwlock_tryrdlock=e=>(_pthread_rwlock_tryrdlock=Module._pthread_rwlock_tryrdlock=wasmExports.pthread_rwlock_tryrdlock)(e),_pthread_rwlock_timedrdlock=Module._pthread_rwlock_timedrdlock=(e,t)=>(_pthread_rwlock_timedrdlock=Module._pthread_rwlock_timedrdlock=wasmExports.pthread_rwlock_timedrdlock)(e,t),_pthread_rwlock_wrlock=Module._pthread_rwlock_wrlock=e=>(_pthread_rwlock_wrlock=Module._pthread_rwlock_wrlock=wasmExports.pthread_rwlock_wrlock)(e),_pthread_rwlock_trywrlock=Module._pthread_rwlock_trywrlock=e=>(_pthread_rwlock_trywrlock=Module._pthread_rwlock_trywrlock=wasmExports.pthread_rwlock_trywrlock)(e),_pthread_rwlock_timedwrlock=Module._pthread_rwlock_timedwrlock=(e,t)=>(_pthread_rwlock_timedwrlock=Module._pthread_rwlock_timedwrlock=wasmExports.pthread_rwlock_timedwrlock)(e,t),_pthread_rwlock_unlock=Module._pthread_rwlock_unlock=e=>(_pthread_rwlock_unlock=Module._pthread_rwlock_unlock=wasmExports.pthread_rwlock_unlock)(e),_pthread_rwlockattr_init=Module._pthread_rwlockattr_init=e=>(_pthread_rwlockattr_init=Module._pthread_rwlockattr_init=wasmExports.pthread_rwlockattr_init)(e),_pthread_rwlockattr_destroy=Module._pthread_rwlockattr_destroy=e=>(_pthread_rwlockattr_destroy=Module._pthread_rwlockattr_destroy=wasmExports.pthread_rwlockattr_destroy)(e),_pthread_rwlockattr_setpshared=Module._pthread_rwlockattr_setpshared=(e,t)=>(_pthread_rwlockattr_setpshared=Module._pthread_rwlockattr_setpshared=wasmExports.pthread_rwlockattr_setpshared)(e,t),_pthread_spin_init=Module._pthread_spin_init=(e,t)=>(_pthread_spin_init=Module._pthread_spin_init=wasmExports.pthread_spin_init)(e,t),_pthread_spin_destroy=Module._pthread_spin_destroy=e=>(_pthread_spin_destroy=Module._pthread_spin_destroy=wasmExports.pthread_spin_destroy)(e),_pthread_spin_lock=Module._pthread_spin_lock=e=>(_pthread_spin_lock=Module._pthread_spin_lock=wasmExports.pthread_spin_lock)(e),_pthread_spin_trylock=Module._pthread_spin_trylock=e=>(_pthread_spin_trylock=Module._pthread_spin_trylock=wasmExports.pthread_spin_trylock)(e),_pthread_spin_unlock=Module._pthread_spin_unlock=e=>(_pthread_spin_unlock=Module._pthread_spin_unlock=wasmExports.pthread_spin_unlock)(e),_emscripten_thread_sleep=Module._emscripten_thread_sleep=e=>(_emscripten_thread_sleep=Module._emscripten_thread_sleep=wasmExports.emscripten_thread_sleep)(e),_pthread_mutex_lock=Module._pthread_mutex_lock=e=>(_pthread_mutex_lock=Module._pthread_mutex_lock=wasmExports.pthread_mutex_lock)(e),_pthread_mutex_unlock=Module._pthread_mutex_unlock=e=>(_pthread_mutex_unlock=Module._pthread_mutex_unlock=wasmExports.pthread_mutex_unlock)(e),_pthread_mutex_trylock=Module._pthread_mutex_trylock=e=>(_pthread_mutex_trylock=Module._pthread_mutex_trylock=wasmExports.pthread_mutex_trylock)(e),_pthread_mutex_timedlock=Module._pthread_mutex_timedlock=(e,t)=>(_pthread_mutex_timedlock=Module._pthread_mutex_timedlock=wasmExports.pthread_mutex_timedlock)(e,t),_emscripten_builtin_pthread_create=Module._emscripten_builtin_pthread_create=(e,t,r,n)=>(_emscripten_builtin_pthread_create=Module._emscripten_builtin_pthread_create=wasmExports.emscripten_builtin_pthread_create)(e,t,r,n),_pthread_create=Module._pthread_create=(e,t,r,n)=>(_pthread_create=Module._pthread_create=wasmExports.pthread_create)(e,t,r,n),_emscripten_builtin_pthread_join=Module._emscripten_builtin_pthread_join=(e,t)=>(_emscripten_builtin_pthread_join=Module._emscripten_builtin_pthread_join=wasmExports.emscripten_builtin_pthread_join)(e,t),_pthread_join=Module._pthread_join=(e,t)=>(_pthread_join=Module._pthread_join=wasmExports.pthread_join)(e,t),_pthread_key_delete=Module._pthread_key_delete=e=>(_pthread_key_delete=Module._pthread_key_delete=wasmExports.pthread_key_delete)(e),_pthread_key_create=Module._pthread_key_create=(e,t)=>(_pthread_key_create=Module._pthread_key_create=wasmExports.pthread_key_create)(e,t),_pthread_once=Module._pthread_once=(e,t)=>(_pthread_once=Module._pthread_once=wasmExports.pthread_once)(e,t),_pthread_cond_timedwait=Module._pthread_cond_timedwait=(e,t,r)=>(_pthread_cond_timedwait=Module._pthread_cond_timedwait=wasmExports.pthread_cond_timedwait)(e,t,r),_emscripten_builtin_pthread_exit=Module._emscripten_builtin_pthread_exit=e=>(_emscripten_builtin_pthread_exit=Module._emscripten_builtin_pthread_exit=wasmExports.emscripten_builtin_pthread_exit)(e),_pthread_exit=Module._pthread_exit=e=>(_pthread_exit=Module._pthread_exit=wasmExports.pthread_exit)(e),_emscripten_builtin_pthread_detach=Module._emscripten_builtin_pthread_detach=e=>(_emscripten_builtin_pthread_detach=Module._emscripten_builtin_pthread_detach=wasmExports.emscripten_builtin_pthread_detach)(e),_pthread_detach=Module._pthread_detach=e=>(_pthread_detach=Module._pthread_detach=wasmExports.pthread_detach)(e),_emscripten_builtin_mmap=Module._emscripten_builtin_mmap=(e,t,r,n,a,o,l)=>(_emscripten_builtin_mmap=Module._emscripten_builtin_mmap=wasmExports.emscripten_builtin_mmap)(e,t,r,n,a,o,l),_emscripten_builtin_munmap=Module._emscripten_builtin_munmap=(e,t)=>(_emscripten_builtin_munmap=Module._emscripten_builtin_munmap=wasmExports.emscripten_builtin_munmap)(e,t),_em_proxying_queue_create=Module._em_proxying_queue_create=()=>(_em_proxying_queue_create=Module._em_proxying_queue_create=wasmExports.em_proxying_queue_create)(),_em_proxying_queue_destroy=Module._em_proxying_queue_destroy=e=>(_em_proxying_queue_destroy=Module._em_proxying_queue_destroy=wasmExports.em_proxying_queue_destroy)(e),_emscripten_proxy_get_system_queue=Module._emscripten_proxy_get_system_queue=()=>(_emscripten_proxy_get_system_queue=Module._emscripten_proxy_get_system_queue=wasmExports.emscripten_proxy_get_system_queue)(),_emscripten_proxy_execute_queue=Module._emscripten_proxy_execute_queue=e=>(_emscripten_proxy_execute_queue=Module._emscripten_proxy_execute_queue=wasmExports.emscripten_proxy_execute_queue)(e),_emscripten_proxy_finish=Module._emscripten_proxy_finish=e=>(_emscripten_proxy_finish=Module._emscripten_proxy_finish=wasmExports.emscripten_proxy_finish)(e),_emscripten_proxy_async=Module._emscripten_proxy_async=(e,t,r,n)=>(_emscripten_proxy_async=Module._emscripten_proxy_async=wasmExports.emscripten_proxy_async)(e,t,r,n),_emscripten_proxy_sync=Module._emscripten_proxy_sync=(e,t,r,n)=>(_emscripten_proxy_sync=Module._emscripten_proxy_sync=wasmExports.emscripten_proxy_sync)(e,t,r,n),_emscripten_proxy_sync_with_ctx=Module._emscripten_proxy_sync_with_ctx=(e,t,r,n)=>(_emscripten_proxy_sync_with_ctx=Module._emscripten_proxy_sync_with_ctx=wasmExports.emscripten_proxy_sync_with_ctx)(e,t,r,n),_pthread_attr_destroy=Module._pthread_attr_destroy=e=>(_pthread_attr_destroy=Module._pthread_attr_destroy=wasmExports.pthread_attr_destroy)(e),_pthread_attr_getdetachstate=Module._pthread_attr_getdetachstate=(e,t)=>(_pthread_attr_getdetachstate=Module._pthread_attr_getdetachstate=wasmExports.pthread_attr_getdetachstate)(e,t),_pthread_attr_getguardsize=Module._pthread_attr_getguardsize=(e,t)=>(_pthread_attr_getguardsize=Module._pthread_attr_getguardsize=wasmExports.pthread_attr_getguardsize)(e,t),_pthread_attr_getinheritsched=Module._pthread_attr_getinheritsched=(e,t)=>(_pthread_attr_getinheritsched=Module._pthread_attr_getinheritsched=wasmExports.pthread_attr_getinheritsched)(e,t),_pthread_attr_getschedparam=Module._pthread_attr_getschedparam=(e,t)=>(_pthread_attr_getschedparam=Module._pthread_attr_getschedparam=wasmExports.pthread_attr_getschedparam)(e,t),_pthread_attr_getschedpolicy=Module._pthread_attr_getschedpolicy=(e,t)=>(_pthread_attr_getschedpolicy=Module._pthread_attr_getschedpolicy=wasmExports.pthread_attr_getschedpolicy)(e,t),_pthread_attr_getscope=Module._pthread_attr_getscope=(e,t)=>(_pthread_attr_getscope=Module._pthread_attr_getscope=wasmExports.pthread_attr_getscope)(e,t),_pthread_attr_getstack=Module._pthread_attr_getstack=(e,t,r)=>(_pthread_attr_getstack=Module._pthread_attr_getstack=wasmExports.pthread_attr_getstack)(e,t,r),_pthread_attr_getstacksize=Module._pthread_attr_getstacksize=(e,t)=>(_pthread_attr_getstacksize=Module._pthread_attr_getstacksize=wasmExports.pthread_attr_getstacksize)(e,t),_pthread_barrierattr_getpshared=Module._pthread_barrierattr_getpshared=(e,t)=>(_pthread_barrierattr_getpshared=Module._pthread_barrierattr_getpshared=wasmExports.pthread_barrierattr_getpshared)(e,t),_pthread_condattr_getclock=Module._pthread_condattr_getclock=(e,t)=>(_pthread_condattr_getclock=Module._pthread_condattr_getclock=wasmExports.pthread_condattr_getclock)(e,t),_pthread_condattr_getpshared=Module._pthread_condattr_getpshared=(e,t)=>(_pthread_condattr_getpshared=Module._pthread_condattr_getpshared=wasmExports.pthread_condattr_getpshared)(e,t),_pthread_mutexattr_getprotocol=Module._pthread_mutexattr_getprotocol=(e,t)=>(_pthread_mutexattr_getprotocol=Module._pthread_mutexattr_getprotocol=wasmExports.pthread_mutexattr_getprotocol)(e,t),_pthread_mutexattr_getpshared=Module._pthread_mutexattr_getpshared=(e,t)=>(_pthread_mutexattr_getpshared=Module._pthread_mutexattr_getpshared=wasmExports.pthread_mutexattr_getpshared)(e,t),_pthread_mutexattr_getrobust=Module._pthread_mutexattr_getrobust=(e,t)=>(_pthread_mutexattr_getrobust=Module._pthread_mutexattr_getrobust=wasmExports.pthread_mutexattr_getrobust)(e,t),_pthread_mutexattr_gettype=Module._pthread_mutexattr_gettype=(e,t)=>(_pthread_mutexattr_gettype=Module._pthread_mutexattr_gettype=wasmExports.pthread_mutexattr_gettype)(e,t),_pthread_rwlockattr_getpshared=Module._pthread_rwlockattr_getpshared=(e,t)=>(_pthread_rwlockattr_getpshared=Module._pthread_rwlockattr_getpshared=wasmExports.pthread_rwlockattr_getpshared)(e,t),_pthread_attr_init=Module._pthread_attr_init=e=>(_pthread_attr_init=Module._pthread_attr_init=wasmExports.pthread_attr_init)(e),_pthread_attr_setdetachstate=Module._pthread_attr_setdetachstate=(e,t)=>(_pthread_attr_setdetachstate=Module._pthread_attr_setdetachstate=wasmExports.pthread_attr_setdetachstate)(e,t),_pthread_attr_setguardsize=Module._pthread_attr_setguardsize=(e,t)=>(_pthread_attr_setguardsize=Module._pthread_attr_setguardsize=wasmExports.pthread_attr_setguardsize)(e,t),_pthread_attr_setinheritsched=Module._pthread_attr_setinheritsched=(e,t)=>(_pthread_attr_setinheritsched=Module._pthread_attr_setinheritsched=wasmExports.pthread_attr_setinheritsched)(e,t),_pthread_attr_setschedparam=Module._pthread_attr_setschedparam=(e,t)=>(_pthread_attr_setschedparam=Module._pthread_attr_setschedparam=wasmExports.pthread_attr_setschedparam)(e,t),_pthread_attr_setschedpolicy=Module._pthread_attr_setschedpolicy=(e,t)=>(_pthread_attr_setschedpolicy=Module._pthread_attr_setschedpolicy=wasmExports.pthread_attr_setschedpolicy)(e,t),_pthread_attr_setscope=Module._pthread_attr_setscope=(e,t)=>(_pthread_attr_setscope=Module._pthread_attr_setscope=wasmExports.pthread_attr_setscope)(e,t),_pthread_attr_setstack=Module._pthread_attr_setstack=(e,t,r)=>(_pthread_attr_setstack=Module._pthread_attr_setstack=wasmExports.pthread_attr_setstack)(e,t,r),_pthread_attr_setstacksize=Module._pthread_attr_setstacksize=(e,t)=>(_pthread_attr_setstacksize=Module._pthread_attr_setstacksize=wasmExports.pthread_attr_setstacksize)(e,t),_pthread_getconcurrency=Module._pthread_getconcurrency=()=>(_pthread_getconcurrency=Module._pthread_getconcurrency=wasmExports.pthread_getconcurrency)(),_pthread_getcpuclockid=Module._pthread_getcpuclockid=(e,t)=>(_pthread_getcpuclockid=Module._pthread_getcpuclockid=wasmExports.pthread_getcpuclockid)(e,t),_pthread_getschedparam=Module._pthread_getschedparam=(e,t,r)=>(_pthread_getschedparam=Module._pthread_getschedparam=wasmExports.pthread_getschedparam)(e,t,r),_pthread_self=Module._pthread_self=()=>(_pthread_self=Module._pthread_self=wasmExports.pthread_self)(),_emscripten_main_runtime_thread_id=Module._emscripten_main_runtime_thread_id=()=>(_emscripten_main_runtime_thread_id=Module._emscripten_main_runtime_thread_id=wasmExports.emscripten_main_runtime_thread_id)(),_pthread_setconcurrency=Module._pthread_setconcurrency=e=>(_pthread_setconcurrency=Module._pthread_setconcurrency=wasmExports.pthread_setconcurrency)(e),_pthread_setschedprio=Module._pthread_setschedprio=(e,t)=>(_pthread_setschedprio=Module._pthread_setschedprio=wasmExports.pthread_setschedprio)(e,t),_pthread_sigmask=Module._pthread_sigmask=(e,t,r)=>(_pthread_sigmask=Module._pthread_sigmask=wasmExports.pthread_sigmask)(e,t,r),__emscripten_timeout=Module.__emscripten_timeout=(e,t)=>(__emscripten_timeout=Module.__emscripten_timeout=wasmExports._emscripten_timeout)(e,t),_emscripten_set_thread_name=Module._emscripten_set_thread_name=(e,t)=>(_emscripten_set_thread_name=Module._emscripten_set_thread_name=wasmExports.emscripten_set_thread_name)(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),_malloc_trim=Module._malloc_trim=e=>(_malloc_trim=Module._malloc_trim=wasmExports.malloc_trim)(e),_malloc_usable_size=Module._malloc_usable_size=e=>(_malloc_usable_size=Module._malloc_usable_size=wasmExports.malloc_usable_size)(e),_malloc_footprint=Module._malloc_footprint=()=>(_malloc_footprint=Module._malloc_footprint=wasmExports.malloc_footprint)(),_malloc_max_footprint=Module._malloc_max_footprint=()=>(_malloc_max_footprint=Module._malloc_max_footprint=wasmExports.malloc_max_footprint)(),_malloc_footprint_limit=Module._malloc_footprint_limit=()=>(_malloc_footprint_limit=Module._malloc_footprint_limit=wasmExports.malloc_footprint_limit)(),_malloc_set_footprint_limit=Module._malloc_set_footprint_limit=e=>(_malloc_set_footprint_limit=Module._malloc_set_footprint_limit=wasmExports.malloc_set_footprint_limit)(e),_emscripten_builtin_malloc=Module._emscripten_builtin_malloc=e=>(_emscripten_builtin_malloc=Module._emscripten_builtin_malloc=wasmExports.emscripten_builtin_malloc)(e),_emscripten_builtin_calloc=Module._emscripten_builtin_calloc=(e,t)=>(_emscripten_builtin_calloc=Module._emscripten_builtin_calloc=wasmExports.emscripten_builtin_calloc)(e,t),_emscripten_builtin_free=Module._emscripten_builtin_free=e=>(_emscripten_builtin_free=Module._emscripten_builtin_free=wasmExports.emscripten_builtin_free)(e),_emscripten_builtin_memalign=Module._emscripten_builtin_memalign=(e,t)=>(_emscripten_builtin_memalign=Module._emscripten_builtin_memalign=wasmExports.emscripten_builtin_memalign)(e,t),_emscripten_get_sbrk_ptr=Module._emscripten_get_sbrk_ptr=()=>(_emscripten_get_sbrk_ptr=Module._emscripten_get_sbrk_ptr=wasmExports.emscripten_get_sbrk_ptr)(),__emscripten_tempret_set=Module.__emscripten_tempret_set=e=>(__emscripten_tempret_set=Module.__emscripten_tempret_set=wasmExports._emscripten_tempret_set)(e),__emscripten_tempret_get=Module.__emscripten_tempret_get=()=>(__emscripten_tempret_get=Module.__emscripten_tempret_get=wasmExports._emscripten_tempret_get)(),_emscripten_stack_init=Module._emscripten_stack_init=()=>(_emscripten_stack_init=Module._emscripten_stack_init=wasmExports.emscripten_stack_init)(),_emscripten_stack_set_limits=Module._emscripten_stack_set_limits=(e,t)=>(_emscripten_stack_set_limits=Module._emscripten_stack_set_limits=wasmExports.emscripten_stack_set_limits)(e,t),_emscripten_stack_get_free=Module._emscripten_stack_get_free=()=>(_emscripten_stack_get_free=Module._emscripten_stack_get_free=wasmExports.emscripten_stack_get_free)(),_emscripten_stack_get_base=Module._emscripten_stack_get_base=()=>(_emscripten_stack_get_base=Module._emscripten_stack_get_base=wasmExports.emscripten_stack_get_base)(),_emscripten_stack_get_end=Module._emscripten_stack_get_end=()=>(_emscripten_stack_get_end=Module._emscripten_stack_get_end=wasmExports.emscripten_stack_get_end)(),__emscripten_stack_restore=Module.__emscripten_stack_restore=e=>(__emscripten_stack_restore=Module.__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(e),__emscripten_stack_alloc=Module.__emscripten_stack_alloc=e=>(__emscripten_stack_alloc=Module.__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(e),_emscripten_stack_get_current=Module._emscripten_stack_get_current=()=>(_emscripten_stack_get_current=Module._emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),_freeaddrinfo=Module._freeaddrinfo=e=>(_freeaddrinfo=Module._freeaddrinfo=wasmExports.freeaddrinfo)(e),__ZTVNSt3__217__owns_two_statesIcEE=Module.__ZTVNSt3__217__owns_two_statesIcEE=2241e3,__ZTSNSt3__214default_deleteIN5arrow14NumericBuilderINS1_10UInt16TypeEEEEE=Module.__ZTSNSt3__214default_deleteIN5arrow14NumericBuilderINS1_10UInt16TypeEEEEE=1646e3,__ZTINSt3__220__shared_ptr_emplaceIN5arrow8ListTypeENS_9allocatorIS2_EEEE=Module.__ZTINSt3__220__shared_ptr_emplaceIN5arrow8ListTypeENS_9allocatorIS2_EEEE=2065e3,__ZTVN6duckdb13DynamicFilterE=Module.__ZTVN6duckdb13DynamicFilterE=2116e3,__ZTVN6duckdb17NotNullConstraintE=Module.__ZTVN6duckdb17NotNullConstraintE=2187e3,__ZTIN6duckdb21WindowLeadLagExecutorE=Module.__ZTIN6duckdb21WindowLeadLagExecutorE=2156e3,__ZN17duckdb_fast_float15powers_templateIvE17power_of_five_128E=Module.__ZN17duckdb_fast_float15powers_templateIvE17power_of_five_128E=1038e3,__ZTVN6duckdb16JSONTreeRendererE=Module.__ZTVN6duckdb16JSONTreeRendererE=2066e3,__ZTVN6duckdb18InMemoryLogStorageE=Module.__ZTVN6duckdb18InMemoryLogStorageE=2067e3,__ZTIN6duckdb16LocalSourceStateE=Module.__ZTIN6duckdb16LocalSourceStateE=2165e3,__ZTIN6duckdb19CTableLocalInitDataE=Module.__ZTIN6duckdb19CTableLocalInitDataE=2198e3,__ZTIN14duckdb_httplib6detail10compressorE=Module.__ZTIN14duckdb_httplib6detail10compressorE=2112e3,__ZTIN6duckdb20WriteParquetRelationE=Module.__ZTIN6duckdb20WriteParquetRelationE=2197e3,__ZTVN6duckdb23MaterializedQueryResultE=Module.__ZTVN6duckdb23MaterializedQueryResultE=2202e3,__ZN6duckdb14ChimpConstants11Compression22LEADING_REPRESENTATIONE=Module.__ZN6duckdb14ChimpConstants11Compression22LEADING_REPRESENTATIONE=1084e3,__ZTIN6duckdb7roaring33CompressedArrayContainerScanStateILb1EEE=Module.__ZTIN6duckdb7roaring33CompressedArrayContainerScanStateILb1EEE=2173e3,__ZTSN6duckdb23BitpackingCompressStateIyLb1ExEE=Module.__ZTSN6duckdb23BitpackingCompressStateIyLb1ExEE=971e3,__ZTIN6duckdb29StandardColumnCheckpointStateE=Module.__ZTIN6duckdb29StandardColumnCheckpointStateE=2149e3,__ZTINSt3__216__non_trivial_ifILb1ENS_9allocatorIwEEEE=Module.__ZTINSt3__216__non_trivial_ifILb1ENS_9allocatorIwEEEE=2082e3,__ZTVN5arrow19BaseListViewBuilderINS_12ListViewTypeEEE=Module.__ZTVN5arrow19BaseListViewBuilderINS_12ListViewTypeEEE=2023e3,__ZTIN5arrow8internal20ArrayBuilderExtraOpsINS_14NumericBuilderINS_10Date32TypeEEEiEE=Module.__ZTIN5arrow8internal20ArrayBuilderExtraOpsINS_14NumericBuilderINS_10Date32TypeEEEiEE=2022e3,__ZTSNSt3__220__shared_ptr_emplaceIN5arrow14ListViewScalarENS_9allocatorIS2_EEEE=Module.__ZTSNSt3__220__shared_ptr_emplaceIN5arrow14ListViewScalarENS_9allocatorIS2_EEEE=535e3,__ZTVNSt3__220__shared_ptr_emplaceIN5arrow14SparseCSCIndexENS_9allocatorIS2_EEEE=Module.__ZTVNSt3__220__shared_ptr_emplaceIN5arrow14SparseCSCIndexENS_9allocatorIS2_EEEE=2028e3,__ZTSNSt3__220__shared_ptr_emplaceIN5arrow10DoubleTypeENS_9allocatorIS2_EEEE=Module.__ZTSNSt3__220__shared_ptr_emplaceIN5arrow10DoubleTypeENS_9allocatorIS2_EEEE=564e3,__ZTVNSt3__210__function6__funcIZN5arrow17MakeFormatterImpl5VisitERKNS2_9UnionTypeEE9DenseImplNS_9allocatorIS7_EEFvRKNS2_5ArrayExPNS_13basic_ostreamIcNS_11char_traitsIcEEEEEEE=Module.__ZTVNSt3__210__function6__funcIZN5arrow17MakeFormatterImpl5VisitERKNS2_9UnionTypeEE9DenseImplNS_9allocatorIS7_EEFvRKNS2_5ArrayExPNS_13basic_ostreamIcNS_11char_traitsIcEEEEEEE=2059e3,__ZTIN5arrow22DefaultValueComparatorINS_16LargeBinaryArrayEEE=Module.__ZTIN5arrow22DefaultValueComparatorINS_16LargeBinaryArrayEEE=2056e3,__ZTSN5arrow7compute12RoundOptionsE=Module.__ZTSN5arrow7compute12RoundOptionsE=475e3,__ZTCN5arrow2io22CompressedOutputStreamE0_NS0_12OutputStreamE=Module.__ZTCN5arrow2io22CompressedOutputStreamE0_NS0_12OutputStreamE=2224e3,__ZTTN5arrow2io18BufferOutputStreamE=Module.__ZTTN5arrow2io18BufferOutputStreamE=2004e3,_uriConstParentW=Module._uriConstParentW=2248e3,__ZNSt3__28ios_base6eofbitE=Module.__ZNSt3__28ios_base6eofbitE=423e3,__ZNSt3__25wclogE=Module.__ZNSt3__25wclogE=227e4,__ZTIa=Module.__ZTIa=1991e3,__ZTIN10__cxxabiv121__vmi_class_type_infoE=Module.__ZTIN10__cxxabiv121__vmi_class_type_infoE=1992e3;function applySignatureConversions(e){e=Object.assign({},e);var t=c=>u=>c(u)>>>0,r=c=>(u,_,d)=>c(u,_,d)>>>0,n=c=>()=>c()>>>0,a=c=>u=>c(u)>>>0,o=c=>(u,_)=>c(u,_)>>>0,l=c=>u=>c(u)>>>0;return e.__getTypeName=t(e.__getTypeName),e.memcpy=r(e.memcpy),e.__errno_location=n(e.__errno_location),e.pthread_self=n(e.pthread_self),e.emscripten_main_runtime_thread_id=n(e.emscripten_main_runtime_thread_id),e.strerror=a(e.strerror),e.malloc=t(e.malloc),e.calloc=o(e.calloc),e.memalign=o(e.memalign),e.emscripten_builtin_malloc=t(e.emscripten_builtin_malloc),e.emscripten_builtin_calloc=o(e.emscripten_builtin_calloc),e.emscripten_builtin_memalign=o(e.emscripten_builtin_memalign),e.sbrk=l(e.sbrk),e.emscripten_stack_get_base=n(e.emscripten_stack_get_base),e.emscripten_stack_get_end=n(e.emscripten_stack_get_end),e._emscripten_stack_alloc=t(e._emscripten_stack_alloc),e.emscripten_stack_get_current=n(e.emscripten_stack_get_current),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}Module.stackSave=stackSave,Module.stackRestore=stackRestore,Module.stackAlloc=stackAlloc,Module.getTempRet0=getTempRet0,Module.setTempRet0=setTempRet0,Module.ccall=ccall,Module.createDyncallWrapper=createDyncallWrapper;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:typeof define=="function"&&define.amd&&define([],()=>DuckDB)});var Oc=dr(()=>{});var Nc=dr(()=>{});var Rc=dr((HS,ha)=>{(function(){"use strict";var s="input is invalid type",e=typeof window=="object",t=e?window:{};t.JS_SHA256_NO_WINDOW&&(e=!1);var r=!e&&typeof self=="object",n=!t.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?t=global:r&&(t=self);var a=!t.JS_SHA256_NO_COMMON_JS&&typeof ha=="object"&&ha.exports,o=typeof define=="function"&&define.amd,l=!t.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],_=[24,16,8,0],d=[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],m=["hex","array","digest","arrayBuffer"],p=[];(t.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(g){return Object.prototype.toString.call(g)==="[object Array]"}),l&&(t.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(g){return typeof g=="object"&&g.buffer&&g.buffer.constructor===ArrayBuffer});var h=function(g,A){return function(F){return new k(A,!0).update(F)[g]()}},S=function(g){var A=h("hex",g);n&&(A=w(A,g)),A.create=function(){return new k(g)},A.update=function(E){return A.create().update(E)};for(var F=0;F<m.length;++F){var y=m[F];A[y]=h(y,g)}return A},w=function(g,A){var F=Oc(),y=Nc().Buffer,E=A?"sha224":"sha256",b;y.from&&!t.JS_SHA256_NO_BUFFER_FROM?b=y.from:b=function(v){return new y(v)};var T=function(v){if(typeof v=="string")return F.createHash(E).update(v,"utf8").digest("hex");if(v==null)throw new Error(s);return v.constructor===ArrayBuffer&&(v=new Uint8Array(v)),Array.isArray(v)||ArrayBuffer.isView(v)||v.constructor===y?F.createHash(E).update(b(v)).digest("hex"):g(v)};return T},L=function(g,A){return function(F,y){return new C(F,A,!0).update(y)[g]()}},P=function(g){var A=L("hex",g);A.create=function(E){return new C(E,g)},A.update=function(E,b){return A.create(E).update(b)};for(var F=0;F<m.length;++F){var y=m[F];A[y]=L(y,g)}return A};function k(g,A){A?(p[0]=p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0,this.blocks=p):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=g}k.prototype.update=function(g){if(!this.finalized){var A,F=typeof g;if(F!=="string"){if(F==="object"){if(g===null)throw new Error(s);if(l&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!l||!ArrayBuffer.isView(g)))throw new Error(s)}else throw new Error(s);A=!0}for(var y,E=0,b,T=g.length,v=this.blocks;E<T;){if(this.hashed&&(this.hashed=!1,v[0]=this.block,this.block=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0),A)for(b=this.start;E<T&&b<64;++E)v[b>>>2]|=g[E]<<_[b++&3];else for(b=this.start;E<T&&b<64;++E)y=g.charCodeAt(E),y<128?v[b>>>2]|=y<<_[b++&3]:y<2048?(v[b>>>2]|=(192|y>>>6)<<_[b++&3],v[b>>>2]|=(128|y&63)<<_[b++&3]):y<55296||y>=57344?(v[b>>>2]|=(224|y>>>12)<<_[b++&3],v[b>>>2]|=(128|y>>>6&63)<<_[b++&3],v[b>>>2]|=(128|y&63)<<_[b++&3]):(y=65536+((y&1023)<<10|g.charCodeAt(++E)&1023),v[b>>>2]|=(240|y>>>18)<<_[b++&3],v[b>>>2]|=(128|y>>>12&63)<<_[b++&3],v[b>>>2]|=(128|y>>>6&63)<<_[b++&3],v[b>>>2]|=(128|y&63)<<_[b++&3]);this.lastByteIndex=b,this.bytes+=b-this.start,b>=64?(this.block=v[16],this.start=b-64,this.hash(),this.hashed=!0):this.start=b}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var g=this.blocks,A=this.lastByteIndex;g[16]=this.block,g[A>>>2]|=u[A&3],this.block=g[16],A>=56&&(this.hashed||this.hash(),g[0]=this.block,g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0),g[14]=this.hBytes<<3|this.bytes>>>29,g[15]=this.bytes<<3,this.hash()}},k.prototype.hash=function(){var g=this.h0,A=this.h1,F=this.h2,y=this.h3,E=this.h4,b=this.h5,T=this.h6,v=this.h7,I=this.blocks,O,ie,we,je,ne,We,ze,Lt,Zr,Dr,_r;for(O=16;O<64;++O)ne=I[O-15],ie=(ne>>>7|ne<<25)^(ne>>>18|ne<<14)^ne>>>3,ne=I[O-2],we=(ne>>>17|ne<<15)^(ne>>>19|ne<<13)^ne>>>10,I[O]=I[O-16]+ie+I[O-7]+we<<0;for(_r=A&F,O=0;O<64;O+=4)this.first?(this.is224?(Lt=300032,ne=I[0]-1413257819,v=ne-150054599<<0,y=ne+24177077<<0):(Lt=704751109,ne=I[0]-210244248,v=ne-1521486534<<0,y=ne+143694565<<0),this.first=!1):(ie=(g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10),we=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),Lt=g&A,je=Lt^g&F^_r,ze=E&b^~E&T,ne=v+we+ze+d[O]+I[O],We=ie+je,v=y+ne<<0,y=ne+We<<0),ie=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),we=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),Zr=y&g,je=Zr^y&A^Lt,ze=v&E^~v&b,ne=T+we+ze+d[O+1]+I[O+1],We=ie+je,T=F+ne<<0,F=ne+We<<0,ie=(F>>>2|F<<30)^(F>>>13|F<<19)^(F>>>22|F<<10),we=(T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7),Dr=F&y,je=Dr^F&g^Zr,ze=T&v^~T&E,ne=b+we+ze+d[O+2]+I[O+2],We=ie+je,b=A+ne<<0,A=ne+We<<0,ie=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),we=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),_r=A&F,je=_r^A&y^Dr,ze=b&T^~b&v,ne=E+we+ze+d[O+3]+I[O+3],We=ie+je,E=g+ne<<0,g=ne+We<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+g<<0,this.h1=this.h1+A<<0,this.h2=this.h2+F<<0,this.h3=this.h3+y<<0,this.h4=this.h4+E<<0,this.h5=this.h5+b<<0,this.h6=this.h6+T<<0,this.h7=this.h7+v<<0},k.prototype.hex=function(){this.finalize();var g=this.h0,A=this.h1,F=this.h2,y=this.h3,E=this.h4,b=this.h5,T=this.h6,v=this.h7,I=c[g>>>28&15]+c[g>>>24&15]+c[g>>>20&15]+c[g>>>16&15]+c[g>>>12&15]+c[g>>>8&15]+c[g>>>4&15]+c[g&15]+c[A>>>28&15]+c[A>>>24&15]+c[A>>>20&15]+c[A>>>16&15]+c[A>>>12&15]+c[A>>>8&15]+c[A>>>4&15]+c[A&15]+c[F>>>28&15]+c[F>>>24&15]+c[F>>>20&15]+c[F>>>16&15]+c[F>>>12&15]+c[F>>>8&15]+c[F>>>4&15]+c[F&15]+c[y>>>28&15]+c[y>>>24&15]+c[y>>>20&15]+c[y>>>16&15]+c[y>>>12&15]+c[y>>>8&15]+c[y>>>4&15]+c[y&15]+c[E>>>28&15]+c[E>>>24&15]+c[E>>>20&15]+c[E>>>16&15]+c[E>>>12&15]+c[E>>>8&15]+c[E>>>4&15]+c[E&15]+c[b>>>28&15]+c[b>>>24&15]+c[b>>>20&15]+c[b>>>16&15]+c[b>>>12&15]+c[b>>>8&15]+c[b>>>4&15]+c[b&15]+c[T>>>28&15]+c[T>>>24&15]+c[T>>>20&15]+c[T>>>16&15]+c[T>>>12&15]+c[T>>>8&15]+c[T>>>4&15]+c[T&15];return this.is224||(I+=c[v>>>28&15]+c[v>>>24&15]+c[v>>>20&15]+c[v>>>16&15]+c[v>>>12&15]+c[v>>>8&15]+c[v>>>4&15]+c[v&15]),I},k.prototype.toString=k.prototype.hex,k.prototype.digest=function(){this.finalize();var g=this.h0,A=this.h1,F=this.h2,y=this.h3,E=this.h4,b=this.h5,T=this.h6,v=this.h7,I=[g>>>24&255,g>>>16&255,g>>>8&255,g&255,A>>>24&255,A>>>16&255,A>>>8&255,A&255,F>>>24&255,F>>>16&255,F>>>8&255,F&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255,T>>>24&255,T>>>16&255,T>>>8&255,T&255];return this.is224||I.push(v>>>24&255,v>>>16&255,v>>>8&255,v&255),I},k.prototype.array=k.prototype.digest,k.prototype.arrayBuffer=function(){this.finalize();var g=new ArrayBuffer(this.is224?28:32),A=new DataView(g);return A.setUint32(0,this.h0),A.setUint32(4,this.h1),A.setUint32(8,this.h2),A.setUint32(12,this.h3),A.setUint32(16,this.h4),A.setUint32(20,this.h5),A.setUint32(24,this.h6),this.is224||A.setUint32(28,this.h7),g};function C(g,A,F){var y,E=typeof g;if(E==="string"){var b=[],T=g.length,v=0,I;for(y=0;y<T;++y)I=g.charCodeAt(y),I<128?b[v++]=I:I<2048?(b[v++]=192|I>>>6,b[v++]=128|I&63):I<55296||I>=57344?(b[v++]=224|I>>>12,b[v++]=128|I>>>6&63,b[v++]=128|I&63):(I=65536+((I&1023)<<10|g.charCodeAt(++y)&1023),b[v++]=240|I>>>18,b[v++]=128|I>>>12&63,b[v++]=128|I>>>6&63,b[v++]=128|I&63);g=b}else if(E==="object"){if(g===null)throw new Error(s);if(l&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!l||!ArrayBuffer.isView(g)))throw new Error(s)}else throw new Error(s);g.length>64&&(g=new k(A,!0).update(g).array());var O=[],ie=[];for(y=0;y<64;++y){var we=g[y]||0;O[y]=92^we,ie[y]=54^we}k.call(this,A,F),this.update(ie),this.oKeyPad=O,this.inner=!0,this.sharedMemory=F}C.prototype=new k,C.prototype.finalize=function(){if(k.prototype.finalize.call(this),this.inner){this.inner=!1;var g=this.array();k.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(g),k.prototype.finalize.call(this)}};var x=S();x.sha256=x,x.sha224=S(!0),x.sha256.hmac=P(),x.sha224.hmac=P(!0),a?ha.exports=x:(t.sha256=x.sha256,t.sha224=x.sha224,o&&define(function(){return x}))})()});var Ld={};fr(Ld,{registerWorker:()=>Wc});function Co(s,e){var t={};for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(s);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(s,r[n])&&(t[r[n]]=s[r[n]]);return t}function D(s,e,t,r){function n(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(_){try{u(r.next(_))}catch(d){o(d)}}function c(_){try{u(r.throw(_))}catch(d){o(d)}}function u(_){_.done?a(_.value):n(_.value).then(l,c)}u((r=r.apply(s,e||[])).next())})}function Po(s){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&s[e],r=0;if(t)return t.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&r>=s.length&&(s=void 0),{value:s&&s[r++],done:!s}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Z(s){return this instanceof Z?(this.v=s,this):new Z(s)}function qe(s,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(s,e||[]),n,a=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(m){r[m]&&(n[m]=function(p){return new Promise(function(h,S){a.push([m,p,h,S])>1||l(m,p)})})}function l(m,p){try{c(r[m](p))}catch(h){d(a[0][3],h)}}function c(m){m.value instanceof Z?Promise.resolve(m.value.v).then(u,_):d(a[0][2],m)}function u(m){l("next",m)}function _(m){l("throw",m)}function d(m,p){m(p),a.shift(),a.length&&l(a[0][0],a[0][1])}}function Jr(s){var e,t;return e={},r("next"),r("throw",function(n){throw n}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(n,a){e[n]=s[n]?function(o){return(t=!t)?{value:Z(s[n](o)),done:!1}:a?a(o):o}:a}}function lt(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=s[Symbol.asyncIterator],t;return e?e.call(s):(s=typeof Po=="function"?Po(s):s[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(a){t[a]=s[a]&&function(o){return new Promise(function(l,c){o=s[a](o),n(l,c,o.done,o.value)})}}function n(a,o,l,c){Promise.resolve(c).then(function(u){a({value:u,done:l})},o)}}var Aa={};fr(Aa,{compareArrayLike:()=>wa,joinUint8Arrays:()=>Qe,memcpy:()=>Mn,rebaseValueOffsets:()=>Ui,toArrayBufferView:()=>J,toArrayBufferViewAsyncIterator:()=>_t,toArrayBufferViewIterator:()=>It,toBigInt64Array:()=>Ci,toBigUint64Array:()=>ou,toFloat32Array:()=>lu,toFloat32ArrayAsyncIterator:()=>Eu,toFloat32ArrayIterator:()=>hu,toFloat64Array:()=>cu,toFloat64ArrayAsyncIterator:()=>Fu,toFloat64ArrayIterator:()=>gu,toInt16Array:()=>iu,toInt16ArrayAsyncIterator:()=>vu,toInt16ArrayIterator:()=>du,toInt32Array:()=>kr,toInt32ArrayAsyncIterator:()=>Su,toInt32ArrayIterator:()=>fu,toInt8Array:()=>nu,toInt8ArrayAsyncIterator:()=>bu,toInt8ArrayIterator:()=>_u,toUint16Array:()=>su,toUint16ArrayAsyncIterator:()=>wu,toUint16ArrayIterator:()=>pu,toUint32Array:()=>au,toUint32ArrayAsyncIterator:()=>Au,toUint32ArrayIterator:()=>mu,toUint8Array:()=>W,toUint8ArrayAsyncIterator:()=>Sa,toUint8ArrayIterator:()=>va,toUint8ClampedArray:()=>uu,toUint8ClampedArrayAsyncIterator:()=>xu,toUint8ClampedArrayIterator:()=>yu});var Jc=new TextDecoder("utf-8"),In=s=>Jc.decode(s),eu=new TextEncoder,Tt=s=>eu.encode(s);var tu=s=>typeof s=="number",Uo=s=>typeof s=="boolean",Fe=s=>typeof s=="function",Pe=s=>s!=null&&Object(s)===s,ct=s=>Pe(s)&&Fe(s.then);var ut=s=>Pe(s)&&Fe(s[Symbol.iterator]),tt=s=>Pe(s)&&Fe(s[Symbol.asyncIterator]),Ii=s=>Pe(s)&&Pe(s.schema);var Di=s=>Pe(s)&&"done"in s&&"value"in s;var Mi=s=>Pe(s)&&Fe(s.stat)&&tu(s.fd);var ki=s=>Pe(s)&&Dn(s.body),Bi=s=>"_getDOMStream"in s&&"_getNodeStream"in s,Oo=s=>Pe(s)&&Fe(s.abort)&&Fe(s.getWriter)&&!Bi(s),Dn=s=>Pe(s)&&Fe(s.cancel)&&Fe(s.getReader)&&!Bi(s),No=s=>Pe(s)&&Fe(s.end)&&Fe(s.write)&&Uo(s.writable)&&!Bi(s),Pi=s=>Pe(s)&&Fe(s.read)&&Fe(s.pipe)&&Uo(s.readable)&&!Bi(s),Ro=s=>Pe(s)&&Fe(s.clear)&&Fe(s.bytes)&&Fe(s.position)&&Fe(s.setPosition)&&Fe(s.capacity)&&Fe(s.getBufferIdentifier)&&Fe(s.createLong);var ba=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function ru(s){let e=s[0]?[s[0]]:[],t,r,n,a;for(let o,l,c=0,u=0,_=s.length;++c<_;){if(o=e[u],l=s[c],!o||!l||o.buffer!==l.buffer||l.byteOffset<o.byteOffset){l&&(e[++u]=l);continue}if({byteOffset:t,byteLength:n}=o,{byteOffset:r,byteLength:a}=l,t+n<r||r+a<t){l&&(e[++u]=l);continue}e[u]=new Uint8Array(o.buffer,t,r-t+a)}return e}function Mn(s,e,t=0,r=e.byteLength){let n=s.byteLength,a=new Uint8Array(s.buffer,s.byteOffset,n),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(r,n));return a.set(o,t),s}function Qe(s,e){let t=ru(s),r=t.reduce((_,d)=>_+d.byteLength,0),n,a,o,l=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,r);for(let _=t.length;++c<_;){if(n=t[c],a=n.subarray(0,Math.min(n.length,u-l)),u<=l+a.length){a.length<n.length?t[c]=n.subarray(a.length):a.length===n.length&&c++,o?Mn(o,a,l):o=a;break}Mn(o||(o=new Uint8Array(u)),a,l),l+=a.length}return[o||new Uint8Array(0),t.slice(c),r-(o?o.byteLength:0)]}function J(s,e){let t=Di(e)?e.value:e;return t instanceof s?s===Uint8Array?new s(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=Tt(t)),t instanceof ArrayBuffer?new s(t):t instanceof ba?new s(t):Ro(t)?J(s,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new s(0):new s(t.buffer,t.byteOffset,t.byteLength/s.BYTES_PER_ELEMENT):s.from(t)):new s(0)}var nu=s=>J(Int8Array,s),iu=s=>J(Int16Array,s),kr=s=>J(Int32Array,s),Ci=s=>J(BigInt64Array,s),W=s=>J(Uint8Array,s),su=s=>J(Uint16Array,s),au=s=>J(Uint32Array,s),ou=s=>J(BigUint64Array,s),lu=s=>J(Float32Array,s),cu=s=>J(Float64Array,s),uu=s=>J(Uint8ClampedArray,s),ya=s=>(s.next(),s);function*It(s,e){let t=function*(n){yield n},r=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ba?t(e):ut(e)?e:t(e);return yield*Mr(ya(function*(n){let a=null;do a=n.next(yield J(s,a));while(!a.done)}(r[Symbol.iterator]()))),new s}var _u=s=>It(Int8Array,s),du=s=>It(Int16Array,s),fu=s=>It(Int32Array,s),va=s=>It(Uint8Array,s),pu=s=>It(Uint16Array,s),mu=s=>It(Uint32Array,s),hu=s=>It(Float32Array,s),gu=s=>It(Float64Array,s),yu=s=>It(Uint8ClampedArray,s);function _t(s,e){return qe(this,arguments,function*(){if(ct(e))return yield Z(yield Z(yield*Mr(Jr(lt(_t(s,yield Z(e)))))));let r=function(o){return qe(this,arguments,function*(){yield yield Z(yield Z(o))})},n=function(o){return qe(this,arguments,function*(){yield Z(yield*Mr(Jr(lt(ya(function*(l){let c=null;do c=l.next(yield c==null?void 0:c.value);while(!c.done)}(o[Symbol.iterator]()))))))})},a=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ba?r(e):ut(e)?n(e):tt(e)?e:r(e);return yield Z(yield*Mr(Jr(lt(ya(function(o){return qe(this,arguments,function*(){let l=null;do l=yield Z(o.next(yield yield Z(J(s,l))));while(!l.done)})}(a[Symbol.asyncIterator]())))))),yield Z(new s)})}var bu=s=>_t(Int8Array,s),vu=s=>_t(Int16Array,s),Su=s=>_t(Int32Array,s),Sa=s=>_t(Uint8Array,s),wu=s=>_t(Uint16Array,s),Au=s=>_t(Uint32Array,s),Eu=s=>_t(Float32Array,s),Fu=s=>_t(Float64Array,s),xu=s=>_t(Uint8ClampedArray,s);function Ui(s,e,t){if(s!==0){t=t.slice(0,e);for(let r=-1,n=t.length;++r<n;)t[r]+=s}return t.subarray(0,e)}function wa(s,e){let t=0,r=s.length;if(r!==e.length)return!1;if(r>0)do if(s[t]!==e[t])return!1;while(++t<r);return!0}var Ie={fromIterable(s){return Oi(Lu(s))},fromAsyncIterable(s){return Oi(Tu(s))},fromDOMStream(s){return Oi(Iu(s))},fromNodeStream(s){return Oi(Du(s))},toDOMStream(s,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(s,e){throw new Error('"toNodeStream" not available in this environment')}},Oi=s=>(s.next(),s);function*Lu(s){let e,t=!1,r=[],n,a,o,l=0;function c(){return a==="peek"?Qe(r,o)[0]:([n,r,l]=Qe(r,o),n)}({cmd:a,size:o}=(yield null)||{cmd:"read",size:0});let u=va(s)[Symbol.iterator]();try{do if({done:e,value:n}=Number.isNaN(o-l)?u.next():u.next(o-l),!e&&n.byteLength>0&&(r.push(n),l+=n.byteLength),e||o<=l)do({cmd:a,size:o}=yield c());while(o<l);while(!e)}catch(_){(t=!0)&&typeof u.throw=="function"&&u.throw(_)}finally{t===!1&&typeof u.return=="function"&&u.return(null)}return null}function Tu(s){return qe(this,arguments,function*(){let t,r=!1,n=[],a,o,l,c=0;function u(){return o==="peek"?Qe(n,l)[0]:([a,n,c]=Qe(n,l),a)}({cmd:o,size:l}=(yield yield Z(null))||{cmd:"read",size:0});let _=Sa(s)[Symbol.asyncIterator]();try{do if({done:t,value:a}=Number.isNaN(l-c)?yield Z(_.next()):yield Z(_.next(l-c)),!t&&a.byteLength>0&&(n.push(a),c+=a.byteLength),t||l<=c)do({cmd:o,size:l}=yield yield Z(u()));while(l<c);while(!t)}catch(d){(r=!0)&&typeof _.throw=="function"&&(yield Z(_.throw(d)))}finally{r===!1&&typeof _.return=="function"&&(yield Z(_.return(new Uint8Array(0))))}return yield Z(null)})}function Iu(s){return qe(this,arguments,function*(){let t=!1,r=!1,n=[],a,o,l,c=0;function u(){return o==="peek"?Qe(n,l)[0]:([a,n,c]=Qe(n,l),a)}({cmd:o,size:l}=(yield yield Z(null))||{cmd:"read",size:0});let _=new Fa(s);try{do if({done:t,value:a}=Number.isNaN(l-c)?yield Z(_.read()):yield Z(_.read(l-c)),!t&&a.byteLength>0&&(n.push(W(a)),c+=a.byteLength),t||l<=c)do({cmd:o,size:l}=yield yield Z(u()));while(l<c);while(!t)}catch(d){(r=!0)&&(yield Z(_.cancel(d)))}finally{r===!1?yield Z(_.cancel()):s.locked&&_.releaseLock()}return yield Z(null)})}var Fa=class{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return D(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 D(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=W(t)),t})}},Ea=(s,e)=>{let t=n=>r([e,n]),r;return[e,t,new Promise(n=>(r=n)&&s.once(e,t))]};function Du(s){return qe(this,arguments,function*(){let t=[],r="error",n=!1,a=null,o,l,c=0,u=[],_;function d(){return o==="peek"?Qe(u,l)[0]:([_,u,c]=Qe(u,l),_)}if({cmd:o,size:l}=(yield yield Z(null))||{cmd:"read",size:0},s.isTTY)return yield yield Z(new Uint8Array(0)),yield Z(null);try{t[0]=Ea(s,"end"),t[1]=Ea(s,"error");do{if(t[2]=Ea(s,"readable"),[r,a]=yield Z(Promise.race(t.map(p=>p[2]))),r==="error")break;if((n=r==="end")||(Number.isFinite(l-c)?(_=W(s.read(l-c)),_.byteLength<l-c&&(_=W(s.read()))):_=W(s.read()),_.byteLength>0&&(u.push(_),c+=_.byteLength)),n||l<=c)do({cmd:o,size:l}=yield yield Z(d()));while(l<c)}while(!n)}finally{yield Z(m(t,r==="error"?a:null))}return yield Z(null);function m(p,h){return _=u=null,new Promise((S,w)=>{for(let[L,P]of p)s.off(L,P);try{let L=s.destroy;L&&L.call(s,h),h=void 0}catch(L){h=L||h}finally{h!=null?w(h):S()}})}})}var oe;(function(s){s[s.V1=0]="V1",s[s.V2=1]="V2",s[s.V3=2]="V3",s[s.V4=3]="V4",s[s.V5=4]="V5"})(oe||(oe={}));var de;(function(s){s[s.Sparse=0]="Sparse",s[s.Dense=1]="Dense"})(de||(de={}));var _e;(function(s){s[s.HALF=0]="HALF",s[s.SINGLE=1]="SINGLE",s[s.DOUBLE=2]="DOUBLE"})(_e||(_e={}));var ve;(function(s){s[s.DAY=0]="DAY",s[s.MILLISECOND=1]="MILLISECOND"})(ve||(ve={}));var B;(function(s){s[s.SECOND=0]="SECOND",s[s.MILLISECOND=1]="MILLISECOND",s[s.MICROSECOND=2]="MICROSECOND",s[s.NANOSECOND=3]="NANOSECOND"})(B||(B={}));var xe;(function(s){s[s.YEAR_MONTH=0]="YEAR_MONTH",s[s.DAY_TIME=1]="DAY_TIME",s[s.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(xe||(xe={}));var Dt=new Int32Array(2),Ni=new Float32Array(Dt.buffer),Ri=new Float64Array(Dt.buffer),en=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var kn;(function(s){s[s.UTF8_BYTES=1]="UTF8_BYTES",s[s.UTF16_STRING=2]="UTF16_STRING"})(kn||(kn={}));var Ye=class s{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new s(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Dt[0]=this.readInt32(e),Ni[0]}readFloat64(e){return Dt[en?0:1]=this.readInt32(e),Dt[en?1:0]=this.readInt32(e+4),Ri[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Ni[0]=t,this.writeInt32(e,Dt[0])}writeFloat64(e,t){Ri[0]=t,this.writeInt32(e,Dt[en?0:1]),this.writeInt32(e+4,Dt[en?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<4;t++)e+=String.fromCharCode(this.readInt8(this.position_+4+t));return e}__offset(e,t){let r=e-this.readInt32(e);return t<this.readInt16(r)?this.readInt16(r+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);let r=this.readInt32(e);e+=4;let n=this.bytes_.subarray(e,e+r);return t===kn.UTF8_BYTES?n:this.text_decoder_.decode(n)}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let t=0;t<4;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+4+t))return!1;return!0}createScalarList(e,t){let r=[];for(let n=0;n<t;++n){let a=e(n);a!==null&&r.push(a)}return r}createObjList(e,t){let r=[];for(let n=0;n<t;++n){let a=e(n);a!==null&&r.push(a.unpack())}return r}};var Br=class s{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let t;e?t=e:t=1024,this.bb=Ye.allocate(t),this.space=t}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);let r=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<r+e+t;){let n=this.bb.capacity();this.bb=s.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,r){(this.force_defaults||t!=r)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,r){(this.force_defaults||t!=r)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,r){(this.force_defaults||t!=r)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,r){(this.force_defaults||t!==r)&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,r){(this.force_defaults||t!=r)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,r){(this.force_defaults||t!=r)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,r){(this.force_defaults||t!=r)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,r){t!=r&&(this.nested(t),this.slot(e))}nested(e){if(e!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let r=t<<1,n=Ye.allocate(r);return n.setPosition(r-t),n.bytes().set(e.bytes(),r-t),n}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let e=this.offset(),t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);let r=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);let n=2;this.addInt16(e-this.object_start);let a=(r+n)*2;this.addInt16(a);let o=0,l=this.space;e:for(t=0;t<this.vtables.length;t++){let c=this.bb.capacity()-this.vtables[t];if(a==this.bb.readInt16(c)){for(let u=2;u<a;u+=2)if(this.bb.readInt16(l+u)!=this.bb.readInt16(c+u))continue e;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,r){let n=r?4:0;if(t){let a=t;if(this.prep(this.minalign,8+n),a.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=3;o>=0;o--)this.writeInt8(a.charCodeAt(o))}this.prep(this.minalign,4+n),this.addOffset(e),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let r=this.bb.capacity()-e,n=r-this.bb.readInt32(r);if(!(t<this.bb.readInt16(n)&&this.bb.readInt16(n+t)!=0))throw new TypeError("FlatBuffers: field "+t+" must be set")}startVector(e,t,r){this.notNested(),this.vector_num_elems=t,this.prep(4,e*t),this.prep(r,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(e==null)return 0;let t;return e instanceof Uint8Array?t=e:t=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let t=[];for(let r=0;r<e.length;++r){let n=e[r];if(n!==null)t.push(this.createObjectOffset(n));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}};var Bn;(function(s){s[s.BUFFER=0]="BUFFER"})(Bn||(Bn={}));var Pn;(function(s){s[s.LZ4_FRAME=0]="LZ4_FRAME",s[s.ZSTD=1]="ZSTD"})(Pn||(Pn={}));var Hi=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Pn.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):Bn.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,Pn.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,Bn.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,r){return s.startBodyCompression(e),s.addCodec(e,t),s.addMethod(e,r),s.endBodyCompression(e)}};var tn=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)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,r){return e.prep(8,16),e.writeInt64(BigInt(r!=null?r:0)),e.writeInt64(BigInt(t!=null?t:0)),e.offset()}};var rn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,r){return e.prep(8,16),e.writeInt64(BigInt(r!=null?r:0)),e.writeInt64(BigInt(t!=null?t:0)),e.offset()}};var Ke=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new rn).__init(this.bb.__vector(this.bb_pos+r)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new tn).__init(this.bb.__vector(this.bb_pos+r)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new Hi).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}static startRecordBatch(e){e.startObject(4)}static addLength(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static endRecordBatch(e){return e.endObject()}};var Rt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Ke).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}};var pr;(function(s){s[s.Little=0]="Little",s[s.Big=1]="Big"})(pr||(pr={}));var Cn;(function(s){s[s.DenseArray=0]="DenseArray"})(Cn||(Cn={}));var ft=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,r){return s.startInt(e),s.addBitWidth(e,t),s.addIsSigned(e,r),s.endInt(e)}};var Mt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new ft).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Cn.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,Cn.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}};var Le=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,r){return s.startKeyValue(e),s.addKey(e,t),s.addValue(e,r),s.endKeyValue(e)}};var Un=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return s.startBinary(e),s.endBinary(e)}};var On=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return s.startBool(e),s.endBool(e)}};var mr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ve.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ve.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return s.startDate(e),s.addUnit(e,t),s.endDate(e)}};var kt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,r,n){return s.startDecimal(e),s.addPrecision(e,t),s.addScale(e,r),s.addBitWidth(e,n),s.endDecimal(e)}};var hr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):B.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,B.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return s.startDuration(e),s.addUnit(e,t),s.endDuration(e)}};var gr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return s.startFixedSizeBinary(e),s.addByteWidth(e,t),s.endFixedSizeBinary(e)}};var yr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return s.startFixedSizeList(e),s.addListSize(e,t),s.endFixedSizeList(e)}};var br=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):_e.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,_e.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return s.startFloatingPoint(e),s.addPrecision(e,t),s.endFloatingPoint(e)}};var vr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):xe.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,xe.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return s.startInterval(e),s.addUnit(e,t),s.endInterval(e)}};var Nn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return s.startLargeBinary(e),s.endLargeBinary(e)}};var Rn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return s.startLargeUtf8(e),s.endLargeUtf8(e)}};var Gn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return s.startList(e),s.endList(e)}};var Sr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return s.startMap(e),s.addKeysSorted(e,t),s.endMap(e)}};var Hn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return s.startNull(e),s.endNull(e)}};var Vn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return s.startStruct_(e),s.endStruct_(e)}};var Gt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):B.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,B.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,r){return s.startTime(e),s.addUnit(e,t),s.addBitWidth(e,r),s.endTime(e)}};var Ht=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):B.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,B.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,r){return s.startTimestamp(e),s.addUnit(e,t),s.addTimezone(e,r),s.endTimestamp(e)}};var pt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):de.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,de.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addInt32(t[r]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,r){return s.startUnion(e),s.addMode(e,t),s.addTypeIds(e,r),s.endUnion(e)}};var jn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return s.startUtf8(e),s.endUtf8(e)}};var fe;(function(s){s[s.NONE=0]="NONE",s[s.Null=1]="Null",s[s.Int=2]="Int",s[s.FloatingPoint=3]="FloatingPoint",s[s.Binary=4]="Binary",s[s.Utf8=5]="Utf8",s[s.Bool=6]="Bool",s[s.Decimal=7]="Decimal",s[s.Date=8]="Date",s[s.Time=9]="Time",s[s.Timestamp=10]="Timestamp",s[s.Interval=11]="Interval",s[s.List=12]="List",s[s.Struct_=13]="Struct_",s[s.Union=14]="Union",s[s.FixedSizeBinary=15]="FixedSizeBinary",s[s.FixedSizeList=16]="FixedSizeList",s[s.Map=17]="Map",s[s.Duration=18]="Duration",s[s.LargeBinary=19]="LargeBinary",s[s.LargeUtf8=20]="LargeUtf8",s[s.LargeList=21]="LargeList",s[s.RunEndEncoded=22]="RunEndEncoded"})(fe||(fe={}));var Be=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):fe.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Mt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let r=this.bb.__offset(this.bb_pos,14);return r?(t||new s).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,16);return r?(t||new Le).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,fe.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}};var Ne=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):pr.Little}fields(e,t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new Le).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,pr.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addInt64(t[r]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(e,t,r,n,a){return s.startSchema(e),s.addEndianness(e,t),s.addFields(e,r),s.addCustomMetadata(e,n),s.addFeatures(e,a),s.endSchema(e)}};var te;(function(s){s[s.NONE=0]="NONE",s[s.Schema=1]="Schema",s[s.DictionaryBatch=2]="DictionaryBatch",s[s.RecordBatch=3]="RecordBatch",s[s.Tensor=4]="Tensor",s[s.SparseTensor=5]="SparseTensor"})(te||(te={}));var f;(function(s){s[s.NONE=0]="NONE",s[s.Null=1]="Null",s[s.Int=2]="Int",s[s.Float=3]="Float",s[s.Binary=4]="Binary",s[s.Utf8=5]="Utf8",s[s.Bool=6]="Bool",s[s.Decimal=7]="Decimal",s[s.Date=8]="Date",s[s.Time=9]="Time",s[s.Timestamp=10]="Timestamp",s[s.Interval=11]="Interval",s[s.List=12]="List",s[s.Struct=13]="Struct",s[s.Union=14]="Union",s[s.FixedSizeBinary=15]="FixedSizeBinary",s[s.FixedSizeList=16]="FixedSizeList",s[s.Map=17]="Map",s[s.Duration=18]="Duration",s[s.LargeBinary=19]="LargeBinary",s[s.LargeUtf8=20]="LargeUtf8",s[s.Dictionary=-1]="Dictionary",s[s.Int8=-2]="Int8",s[s.Int16=-3]="Int16",s[s.Int32=-4]="Int32",s[s.Int64=-5]="Int64",s[s.Uint8=-6]="Uint8",s[s.Uint16=-7]="Uint16",s[s.Uint32=-8]="Uint32",s[s.Uint64=-9]="Uint64",s[s.Float16=-10]="Float16",s[s.Float32=-11]="Float32",s[s.Float64=-12]="Float64",s[s.DateDay=-13]="DateDay",s[s.DateMillisecond=-14]="DateMillisecond",s[s.TimestampSecond=-15]="TimestampSecond",s[s.TimestampMillisecond=-16]="TimestampMillisecond",s[s.TimestampMicrosecond=-17]="TimestampMicrosecond",s[s.TimestampNanosecond=-18]="TimestampNanosecond",s[s.TimeSecond=-19]="TimeSecond",s[s.TimeMillisecond=-20]="TimeMillisecond",s[s.TimeMicrosecond=-21]="TimeMicrosecond",s[s.TimeNanosecond=-22]="TimeNanosecond",s[s.DenseUnion=-23]="DenseUnion",s[s.SparseUnion=-24]="SparseUnion",s[s.IntervalDayTime=-25]="IntervalDayTime",s[s.IntervalYearMonth=-26]="IntervalYearMonth",s[s.DurationSecond=-27]="DurationSecond",s[s.DurationMillisecond=-28]="DurationMillisecond",s[s.DurationMicrosecond=-29]="DurationMicrosecond",s[s.DurationNanosecond=-30]="DurationNanosecond"})(f||(f={}));var nt;(function(s){s[s.OFFSET=0]="OFFSET",s[s.DATA=1]="DATA",s[s.VALIDITY=2]="VALIDITY",s[s.TYPE=3]="TYPE"})(nt||(nt={}));var za={};fr(za,{clampRange:()=>qn,createElementComparator:()=>Fr,wrapIndex:()=>Pr});var xa={};fr(xa,{valueToString:()=>mt});function mt(s){if(s===null)return"null";if(s===void 0)return"undefined";switch(typeof s){case"number":return"".concat(s);case"bigint":return"".concat(s);case"string":return'"'.concat(s,'"')}return typeof s[Symbol.toPrimitive]=="function"?s[Symbol.toPrimitive]("string"):ArrayBuffer.isView(s)?s instanceof BigInt64Array||s instanceof BigUint64Array?"[".concat([...s].map(e=>mt(e)),"]"):"[".concat(s,"]"):ArrayBuffer.isView(s)?"[".concat(s,"]"):JSON.stringify(s,(e,t)=>typeof t=="bigint"?"".concat(t):t)}var Da={};fr(Da,{BN:()=>zn,bigNumToBigInt:()=>Ho,bigNumToNumber:()=>Ia,bigNumToString:()=>an,isArrowBigNumSymbol:()=>Go});function se(s){if(typeof s=="bigint"&&(s<Number.MIN_SAFE_INTEGER||s>Number.MAX_SAFE_INTEGER))throw new TypeError("".concat(s," is not safe to convert to a number."));return Number(s)}function La(s,e){return se(s/e)+se(s%e)/se(e)}var Go=Symbol.for("isArrowBigNum");function ht(s,...e){return e.length===0?Object.setPrototypeOf(J(this.TypedArray,s),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(s,...e),this.constructor.prototype)}ht.prototype[Go]=!0;ht.prototype.toJSON=function(){return'"'.concat(an(this),'"')};ht.prototype.valueOf=function(s){return Ia(this,s)};ht.prototype.toString=function(){return an(this)};ht.prototype[Symbol.toPrimitive]=function(s="default"){switch(s){case"number":return Ia(this);case"string":return an(this);case"default":return Ho(this)}return an(this)};function nn(...s){return ht.apply(this,s)}function sn(...s){return ht.apply(this,s)}function Wn(...s){return ht.apply(this,s)}Object.setPrototypeOf(nn.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(sn.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Wn.prototype,Object.create(Uint32Array.prototype));Object.assign(nn.prototype,ht.prototype,{constructor:nn,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(sn.prototype,ht.prototype,{constructor:sn,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Wn.prototype,ht.prototype,{constructor:Wn,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var Mu=BigInt(4294967296)*BigInt(4294967296),ku=Mu-BigInt(1);function Ia(s,e){let{buffer:t,byteOffset:r,byteLength:n,signed:a}=s,o=new BigUint64Array(t,r,n/8),l=a&&o.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(l){for(let _ of o)c|=(_^ku)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let _ of o)c|=_*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"){let _=BigInt(Math.pow(10,e)),d=c/_,m=c%_;return se(d)+se(m)/se(_)}return se(c)}function an(s){if(s.byteLength===8){let a=new s.BigIntArray(s.buffer,s.byteOffset,1);return"".concat(a[0])}if(!s.signed)return Ta(s);let e=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return Ta(s);e=e.slice();let r=1;for(let a=0;a<e.length;a++){let o=e[a],l=~o+r;e[a]=l,r&=o===0?1:0}let n=Ta(e);return"-".concat(n)}function Ho(s){return s.byteLength===8?new s.BigIntArray(s.buffer,s.byteOffset,1)[0]:an(s)}function Ta(s){let e="",t=new Uint32Array(2),r=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2),n=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),a=-1,o=r.length-1;do{for(t[0]=r[a=0];a<o;)r[a++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+r[a];r[a]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e="".concat(t[0]).concat(e)}while(n[0]||n[1]||n[2]||n[3]);return e!=null?e:"0"}var zn=class s{static new(e,t){switch(t){case!0:return new nn(e);case!1:return new sn(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new nn(e)}return e.byteLength===16?new Wn(e):new sn(e)}static signed(e){return new nn(e)}static unsigned(e){return new sn(e)}static decimal(e){return new Wn(e)}constructor(e,t){return s.new(e,t)}};var Vo,jo,Wo,zo,$o,qo,Qo,Yo,Ko,Xo,Zo,Jo,el,tl,rl,nl,il,sl,al,ol,ll,cl,M=class s{static isNull(e){return(e==null?void 0:e.typeId)===f.Null}static isInt(e){return(e==null?void 0:e.typeId)===f.Int}static isFloat(e){return(e==null?void 0:e.typeId)===f.Float}static isBinary(e){return(e==null?void 0:e.typeId)===f.Binary}static isLargeBinary(e){return(e==null?void 0:e.typeId)===f.LargeBinary}static isUtf8(e){return(e==null?void 0:e.typeId)===f.Utf8}static isLargeUtf8(e){return(e==null?void 0:e.typeId)===f.LargeUtf8}static isBool(e){return(e==null?void 0:e.typeId)===f.Bool}static isDecimal(e){return(e==null?void 0:e.typeId)===f.Decimal}static isDate(e){return(e==null?void 0:e.typeId)===f.Date}static isTime(e){return(e==null?void 0:e.typeId)===f.Time}static isTimestamp(e){return(e==null?void 0:e.typeId)===f.Timestamp}static isInterval(e){return(e==null?void 0:e.typeId)===f.Interval}static isDuration(e){return(e==null?void 0:e.typeId)===f.Duration}static isList(e){return(e==null?void 0:e.typeId)===f.List}static isStruct(e){return(e==null?void 0:e.typeId)===f.Struct}static isUnion(e){return(e==null?void 0:e.typeId)===f.Union}static isFixedSizeBinary(e){return(e==null?void 0:e.typeId)===f.FixedSizeBinary}static isFixedSizeList(e){return(e==null?void 0:e.typeId)===f.FixedSizeList}static isMap(e){return(e==null?void 0:e.typeId)===f.Map}static isDictionary(e){return(e==null?void 0:e.typeId)===f.Dictionary}static isDenseUnion(e){return s.isUnion(e)&&e.mode===de.Dense}static isSparseUnion(e){return s.isUnion(e)&&e.mode===de.Sparse}constructor(e){this.typeId=e}};Vo=Symbol.toStringTag;M[Vo]=(s=>(s.children=null,s.ArrayType=Array,s.OffsetArrayType=Int32Array,s[Symbol.toStringTag]="DataType"))(M.prototype);var Ce=class extends M{constructor(){super(f.Null)}toString(){return"Null"}};jo=Symbol.toStringTag;Ce[jo]=(s=>s[Symbol.toStringTag]="Null")(Ce.prototype);var Te=class extends M{constructor(e,t){super(f.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)}};Wo=Symbol.toStringTag;Te[Wo]=(s=>(s.isSigned=null,s.bitWidth=null,s[Symbol.toStringTag]="Int"))(Te.prototype);var Vi=class extends Te{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},ji=class extends Te{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Bt=class extends Te{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Wi=class extends Te{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},zi=class extends Te{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},$i=class extends Te{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},qi=class extends Te{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Qi=class extends Te{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Vi.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(ji.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Bt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Wi.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(zi.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty($i.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(qi.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Qi.prototype,"ArrayType",{value:BigUint64Array});var it=class extends M{constructor(e){super(f.Float),this.precision=e}get ArrayType(){switch(this.precision){case _e.HALF:return Uint16Array;case _e.SINGLE:return Float32Array;case _e.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}};zo=Symbol.toStringTag;it[zo]=(s=>(s.precision=null,s[Symbol.toStringTag]="Float"))(it.prototype);var Yi=class extends it{constructor(){super(_e.HALF)}},Ki=class extends it{constructor(){super(_e.SINGLE)}},Xi=class extends it{constructor(){super(_e.DOUBLE)}};Object.defineProperty(Yi.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ki.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Xi.prototype,"ArrayType",{value:Float64Array});var Vt=class extends M{constructor(){super(f.Binary)}toString(){return"Binary"}};$o=Symbol.toStringTag;Vt[$o]=(s=>(s.ArrayType=Uint8Array,s[Symbol.toStringTag]="Binary"))(Vt.prototype);var jt=class extends M{constructor(){super(f.LargeBinary)}toString(){return"LargeBinary"}};qo=Symbol.toStringTag;jt[qo]=(s=>(s.ArrayType=Uint8Array,s.OffsetArrayType=BigInt64Array,s[Symbol.toStringTag]="LargeBinary"))(jt.prototype);var Wt=class extends M{constructor(){super(f.Utf8)}toString(){return"Utf8"}};Qo=Symbol.toStringTag;Wt[Qo]=(s=>(s.ArrayType=Uint8Array,s[Symbol.toStringTag]="Utf8"))(Wt.prototype);var zt=class extends M{constructor(){super(f.LargeUtf8)}toString(){return"LargeUtf8"}};Yo=Symbol.toStringTag;zt[Yo]=(s=>(s.ArrayType=Uint8Array,s.OffsetArrayType=BigInt64Array,s[Symbol.toStringTag]="LargeUtf8"))(zt.prototype);var $t=class extends M{constructor(){super(f.Bool)}toString(){return"Bool"}};Ko=Symbol.toStringTag;$t[Ko]=(s=>(s.ArrayType=Uint8Array,s[Symbol.toStringTag]="Bool"))($t.prototype);var qt=class extends M{constructor(e,t,r=128){super(f.Decimal),this.scale=e,this.precision=t,this.bitWidth=r}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}};Xo=Symbol.toStringTag;qt[Xo]=(s=>(s.scale=null,s.precision=null,s.ArrayType=Uint32Array,s[Symbol.toStringTag]="Decimal"))(qt.prototype);var Qt=class extends M{constructor(e){super(f.Date),this.unit=e}toString(){return"Date".concat((this.unit+1)*32,"<").concat(ve[this.unit],">")}get ArrayType(){return this.unit===ve.DAY?Int32Array:BigInt64Array}};Zo=Symbol.toStringTag;Qt[Zo]=(s=>(s.unit=null,s[Symbol.toStringTag]="Date"))(Qt.prototype);var Yt=class extends M{constructor(e,t){super(f.Time),this.unit=e,this.bitWidth=t}toString(){return"Time".concat(this.bitWidth,"<").concat(B[this.unit],">")}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}};Jo=Symbol.toStringTag;Yt[Jo]=(s=>(s.unit=null,s.bitWidth=null,s[Symbol.toStringTag]="Time"))(Yt.prototype);var Kt=class extends M{constructor(e,t){super(f.Timestamp),this.unit=e,this.timezone=t}toString(){return"Timestamp<".concat(B[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}};el=Symbol.toStringTag;Kt[el]=(s=>(s.unit=null,s.timezone=null,s.ArrayType=BigInt64Array,s[Symbol.toStringTag]="Timestamp"))(Kt.prototype);var Xt=class extends M{constructor(e){super(f.Interval),this.unit=e}toString(){return"Interval<".concat(xe[this.unit],">")}};tl=Symbol.toStringTag;Xt[tl]=(s=>(s.unit=null,s.ArrayType=Int32Array,s[Symbol.toStringTag]="Interval"))(Xt.prototype);var Zt=class extends M{constructor(e){super(f.Duration),this.unit=e}toString(){return"Duration<".concat(B[this.unit],">")}};rl=Symbol.toStringTag;Zt[rl]=(s=>(s.unit=null,s.ArrayType=BigInt64Array,s[Symbol.toStringTag]="Duration"))(Zt.prototype);var gt=class extends M{constructor(e){super(f.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}};nl=Symbol.toStringTag;gt[nl]=(s=>(s.children=null,s[Symbol.toStringTag]="List"))(gt.prototype);var me=class extends M{constructor(e){super(f.Struct),this.children=e}toString(){return"Struct<{".concat(this.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};il=Symbol.toStringTag;me[il]=(s=>(s.children=null,s[Symbol.toStringTag]="Struct"))(me.prototype);var yt=class extends M{constructor(e,t,r){super(f.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(" | "),">")}};sl=Symbol.toStringTag;yt[sl]=(s=>(s.mode=null,s.typeIds=null,s.children=null,s.typeIdToChildIndex=null,s.ArrayType=Int8Array,s[Symbol.toStringTag]="Union"))(yt.prototype);var Jt=class extends M{constructor(e){super(f.FixedSizeBinary),this.byteWidth=e}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}};al=Symbol.toStringTag;Jt[al]=(s=>(s.byteWidth=null,s.ArrayType=Uint8Array,s[Symbol.toStringTag]="FixedSizeBinary"))(Jt.prototype);var bt=class extends M{constructor(e,t){super(f.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,">")}};ol=Symbol.toStringTag;bt[ol]=(s=>(s.children=null,s.listSize=null,s[Symbol.toStringTag]="FixedSizeList"))(bt.prototype);var vt=class extends M{constructor(e,t=!1){var r,n,a;if(super(f.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(", "),"}>")}};ll=Symbol.toStringTag;vt[ll]=(s=>(s.children=null,s.keysSorted=null,s[Symbol.toStringTag]="Map_"))(vt.prototype);var Bu=(s=>()=>++s)(-1),Xe=class extends M{constructor(e,t,r,n){super(f.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=n||!1,this.id=r==null?Bu():se(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,">")}};cl=Symbol.toStringTag;Xe[cl]=(s=>(s.id=null,s.indices=null,s.isOrdered=null,s.dictionary=null,s[Symbol.toStringTag]="Dictionary"))(Xe.prototype);function Ze(s){let e=s;switch(s.typeId){case f.Decimal:return s.bitWidth/32;case f.Interval:return 1+e.unit;case f.FixedSizeList:return e.listSize;case f.FixedSizeBinary:return e.byteWidth;default:return 1}}var N=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 Pu(this,e,t)}getVisitFnByTypeId(e,t=!0){return on(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 Pu(s,e,t=!0){return typeof e=="number"?on(s,e,t):typeof e=="string"&&e in f?on(s,f[e],t):e&&e instanceof M?on(s,ul(e),t):e!=null&&e.type&&e.type instanceof M?on(s,ul(e.type),t):on(s,f.NONE,t)}function on(s,e,t=!0){let r=null;switch(e){case f.Null:r=s.visitNull;break;case f.Bool:r=s.visitBool;break;case f.Int:r=s.visitInt;break;case f.Int8:r=s.visitInt8||s.visitInt;break;case f.Int16:r=s.visitInt16||s.visitInt;break;case f.Int32:r=s.visitInt32||s.visitInt;break;case f.Int64:r=s.visitInt64||s.visitInt;break;case f.Uint8:r=s.visitUint8||s.visitInt;break;case f.Uint16:r=s.visitUint16||s.visitInt;break;case f.Uint32:r=s.visitUint32||s.visitInt;break;case f.Uint64:r=s.visitUint64||s.visitInt;break;case f.Float:r=s.visitFloat;break;case f.Float16:r=s.visitFloat16||s.visitFloat;break;case f.Float32:r=s.visitFloat32||s.visitFloat;break;case f.Float64:r=s.visitFloat64||s.visitFloat;break;case f.Utf8:r=s.visitUtf8;break;case f.LargeUtf8:r=s.visitLargeUtf8;break;case f.Binary:r=s.visitBinary;break;case f.LargeBinary:r=s.visitLargeBinary;break;case f.FixedSizeBinary:r=s.visitFixedSizeBinary;break;case f.Date:r=s.visitDate;break;case f.DateDay:r=s.visitDateDay||s.visitDate;break;case f.DateMillisecond:r=s.visitDateMillisecond||s.visitDate;break;case f.Timestamp:r=s.visitTimestamp;break;case f.TimestampSecond:r=s.visitTimestampSecond||s.visitTimestamp;break;case f.TimestampMillisecond:r=s.visitTimestampMillisecond||s.visitTimestamp;break;case f.TimestampMicrosecond:r=s.visitTimestampMicrosecond||s.visitTimestamp;break;case f.TimestampNanosecond:r=s.visitTimestampNanosecond||s.visitTimestamp;break;case f.Time:r=s.visitTime;break;case f.TimeSecond:r=s.visitTimeSecond||s.visitTime;break;case f.TimeMillisecond:r=s.visitTimeMillisecond||s.visitTime;break;case f.TimeMicrosecond:r=s.visitTimeMicrosecond||s.visitTime;break;case f.TimeNanosecond:r=s.visitTimeNanosecond||s.visitTime;break;case f.Decimal:r=s.visitDecimal;break;case f.List:r=s.visitList;break;case f.Struct:r=s.visitStruct;break;case f.Union:r=s.visitUnion;break;case f.DenseUnion:r=s.visitDenseUnion||s.visitUnion;break;case f.SparseUnion:r=s.visitSparseUnion||s.visitUnion;break;case f.Dictionary:r=s.visitDictionary;break;case f.Interval:r=s.visitInterval;break;case f.IntervalDayTime:r=s.visitIntervalDayTime||s.visitInterval;break;case f.IntervalYearMonth:r=s.visitIntervalYearMonth||s.visitInterval;break;case f.Duration:r=s.visitDuration;break;case f.DurationSecond:r=s.visitDurationSecond||s.visitDuration;break;case f.DurationMillisecond:r=s.visitDurationMillisecond||s.visitDuration;break;case f.DurationMicrosecond:r=s.visitDurationMicrosecond||s.visitDuration;break;case f.DurationNanosecond:r=s.visitDurationNanosecond||s.visitDuration;break;case f.FixedSizeList:r=s.visitFixedSizeList;break;case f.Map:r=s.visitMap;break}if(typeof r=="function")return r;if(!t)return()=>null;throw new Error("Unrecognized type '".concat(f[e],"'"))}function ul(s){switch(s.typeId){case f.Null:return f.Null;case f.Int:{let{bitWidth:e,isSigned:t}=s;switch(e){case 8:return t?f.Int8:f.Uint8;case 16:return t?f.Int16:f.Uint16;case 32:return t?f.Int32:f.Uint32;case 64:return t?f.Int64:f.Uint64}return f.Int}case f.Float:switch(s.precision){case _e.HALF:return f.Float16;case _e.SINGLE:return f.Float32;case _e.DOUBLE:return f.Float64}return f.Float;case f.Binary:return f.Binary;case f.LargeBinary:return f.LargeBinary;case f.Utf8:return f.Utf8;case f.LargeUtf8:return f.LargeUtf8;case f.Bool:return f.Bool;case f.Decimal:return f.Decimal;case f.Time:switch(s.unit){case B.SECOND:return f.TimeSecond;case B.MILLISECOND:return f.TimeMillisecond;case B.MICROSECOND:return f.TimeMicrosecond;case B.NANOSECOND:return f.TimeNanosecond}return f.Time;case f.Timestamp:switch(s.unit){case B.SECOND:return f.TimestampSecond;case B.MILLISECOND:return f.TimestampMillisecond;case B.MICROSECOND:return f.TimestampMicrosecond;case B.NANOSECOND:return f.TimestampNanosecond}return f.Timestamp;case f.Date:switch(s.unit){case ve.DAY:return f.DateDay;case ve.MILLISECOND:return f.DateMillisecond}return f.Date;case f.Interval:switch(s.unit){case xe.DAY_TIME:return f.IntervalDayTime;case xe.YEAR_MONTH:return f.IntervalYearMonth}return f.Interval;case f.Duration:switch(s.unit){case B.SECOND:return f.DurationSecond;case B.MILLISECOND:return f.DurationMillisecond;case B.MICROSECOND:return f.DurationMicrosecond;case B.NANOSECOND:return f.DurationNanosecond}return f.Duration;case f.Map:return f.Map;case f.List:return f.List;case f.Struct:return f.Struct;case f.Union:switch(s.mode){case de.Dense:return f.DenseUnion;case de.Sparse:return f.SparseUnion}return f.Union;case f.FixedSizeBinary:return f.FixedSizeBinary;case f.FixedSizeList:return f.FixedSizeList;case f.Dictionary:return f.Dictionary}throw new Error("Unrecognized type '".concat(f[s.typeId],"'"))}N.prototype.visitInt8=null;N.prototype.visitInt16=null;N.prototype.visitInt32=null;N.prototype.visitInt64=null;N.prototype.visitUint8=null;N.prototype.visitUint16=null;N.prototype.visitUint32=null;N.prototype.visitUint64=null;N.prototype.visitFloat16=null;N.prototype.visitFloat32=null;N.prototype.visitFloat64=null;N.prototype.visitDateDay=null;N.prototype.visitDateMillisecond=null;N.prototype.visitTimestampSecond=null;N.prototype.visitTimestampMillisecond=null;N.prototype.visitTimestampMicrosecond=null;N.prototype.visitTimestampNanosecond=null;N.prototype.visitTimeSecond=null;N.prototype.visitTimeMillisecond=null;N.prototype.visitTimeMicrosecond=null;N.prototype.visitTimeNanosecond=null;N.prototype.visitDenseUnion=null;N.prototype.visitSparseUnion=null;N.prototype.visitIntervalDayTime=null;N.prototype.visitIntervalYearMonth=null;N.prototype.visitDuration=null;N.prototype.visitDurationSecond=null;N.prototype.visitDurationMillisecond=null;N.prototype.visitDurationMicrosecond=null;N.prototype.visitDurationNanosecond=null;var Ma={};fr(Ma,{float64ToUint16:()=>$n,uint16ToFloat64:()=>Zi});var _l=new Float64Array(1),ln=new Uint32Array(_l.buffer);function Zi(s){let e=(s&31744)>>10,t=(s&1023)/1024,r=Math.pow(-1,(s&32768)>>15);switch(e){case 31:return r*(t?Number.NaN:1/0);case 0:return r*(t?6103515625e-14*t:0)}return r*Math.pow(2,e-15)*(1+t)}function $n(s){if(s!==s)return 32256;_l[0]=s;let e=(ln[1]&2147483648)>>16&65535,t=ln[1]&2146435072,r=0;return t>=1089470464?ln[0]>0?t=31744:(t=(t&2080374784)>>16,r=(ln[1]&1048575)>>10):t<=1056964608?(r=1048576+(ln[1]&1048575),r=1048576+(r<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,r=(ln[1]&1048575)+512>>10),e|t|r&65535}var j=class extends N{};function Q(s){return(e,t,r)=>{if(e.setValid(t,r!=null))return s(e,t,r)}}var Cu=(s,e,t)=>{s[e]=Math.floor(t/864e5)},dl=(s,e,t,r)=>{if(t+1<e.length){let n=se(e[t]),a=se(e[t+1]);s.set(r.subarray(0,a-n),n)}},Uu=({offset:s,values:e},t,r)=>{let n=s+t;r?e[n>>3]|=1<<n%8:e[n>>3]&=~(1<<n%8)},er=({values:s},e,t)=>{s[e]=t},ka=({values:s},e,t)=>{s[e]=t},fl=({values:s},e,t)=>{s[e]=$n(t)},Ou=(s,e,t)=>{switch(s.type.precision){case _e.HALF:return fl(s,e,t);case _e.SINGLE:case _e.DOUBLE:return ka(s,e,t)}},Ji=({values:s},e,t)=>{Cu(s,e,t.valueOf())},es=({values:s},e,t)=>{s[e]=BigInt(t)},Ba=({stride:s,values:e},t,r)=>{e.set(r.subarray(0,s),s*t)},pl=({values:s,valueOffsets:e},t,r)=>dl(s,e,t,r),ml=({values:s,valueOffsets:e},t,r)=>dl(s,e,t,Tt(r)),Pa=(s,e,t)=>{s.type.unit===ve.DAY?Ji(s,e,t):es(s,e,t)},ts=({values:s},e,t)=>{s[e]=BigInt(t/1e3)},rs=({values:s},e,t)=>{s[e]=BigInt(t)},ns=({values:s},e,t)=>{s[e]=BigInt(t*1e3)},is=({values:s},e,t)=>{s[e]=BigInt(t*1e6)},Ca=(s,e,t)=>{switch(s.type.unit){case B.SECOND:return ts(s,e,t);case B.MILLISECOND:return rs(s,e,t);case B.MICROSECOND:return ns(s,e,t);case B.NANOSECOND:return is(s,e,t)}},ss=({values:s},e,t)=>{s[e]=t},as=({values:s},e,t)=>{s[e]=t},os=({values:s},e,t)=>{s[e]=t},ls=({values:s},e,t)=>{s[e]=t},Ua=(s,e,t)=>{switch(s.type.unit){case B.SECOND:return ss(s,e,t);case B.MILLISECOND:return as(s,e,t);case B.MICROSECOND:return os(s,e,t);case B.NANOSECOND:return ls(s,e,t)}},Oa=({values:s,stride:e},t,r)=>{s.set(r.subarray(0,e),e*t)},Nu=(s,e,t)=>{let r=s.children[0],n=s.valueOffsets,a=De.getVisitFn(r);if(Array.isArray(t))for(let o=-1,l=n[e],c=n[e+1];l<c;)a(r,l++,t[++o]);else for(let o=-1,l=n[e],c=n[e+1];l<c;)a(r,l++,t.get(++o))},Ru=(s,e,t)=>{let r=s.children[0],{valueOffsets:n}=s,a=De.getVisitFn(r),{[e]:o,[e+1]:l}=n,c=t instanceof Map?t.entries():Object.entries(t);for(let u of c)if(a(r,o,u),++o>=l)break},Gu=(s,e)=>(t,r,n,a)=>r&&t(r,s,e[a]),Hu=(s,e)=>(t,r,n,a)=>r&&t(r,s,e.get(a)),Vu=(s,e)=>(t,r,n,a)=>r&&t(r,s,e.get(n.name)),ju=(s,e)=>(t,r,n,a)=>r&&t(r,s,e[n.name]),Wu=(s,e,t)=>{let r=s.type.children.map(a=>De.getVisitFn(a.type)),n=t instanceof Map?Vu(e,t):t instanceof re?Hu(e,t):Array.isArray(t)?Gu(e,t):ju(e,t);s.type.children.forEach((a,o)=>n(r[o],s.children[o],a,o))},zu=(s,e,t)=>{s.type.mode===de.Dense?hl(s,e,t):gl(s,e,t)},hl=(s,e,t)=>{let r=s.type.typeIdToChildIndex[s.typeIds[e]],n=s.children[r];De.visit(n,s.valueOffsets[e],t)},gl=(s,e,t)=>{let r=s.type.typeIdToChildIndex[s.typeIds[e]],n=s.children[r];De.visit(n,e,t)},$u=(s,e,t)=>{var r;(r=s.dictionary)===null||r===void 0||r.set(s.values[e],t)},Na=(s,e,t)=>{s.type.unit===xe.DAY_TIME?cs(s,e,t):us(s,e,t)},cs=({values:s},e,t)=>{s.set(t.subarray(0,2),2*e)},us=({values:s},e,t)=>{s[e]=t[0]*12+t[1]%12},_s=({values:s},e,t)=>{s[e]=t},ds=({values:s},e,t)=>{s[e]=t},ps=({values:s},e,t)=>{s[e]=t},ms=({values:s},e,t)=>{s[e]=t},Ra=(s,e,t)=>{switch(s.type.unit){case B.SECOND:return _s(s,e,t);case B.MILLISECOND:return ds(s,e,t);case B.MICROSECOND:return ps(s,e,t);case B.NANOSECOND:return ms(s,e,t)}},qu=(s,e,t)=>{let{stride:r}=s,n=s.children[0],a=De.getVisitFn(n);if(Array.isArray(t))for(let o=-1,l=e*r;++o<r;)a(n,l+o,t[o]);else for(let o=-1,l=e*r;++o<r;)a(n,l+o,t.get(o))};j.prototype.visitBool=Q(Uu);j.prototype.visitInt=Q(er);j.prototype.visitInt8=Q(er);j.prototype.visitInt16=Q(er);j.prototype.visitInt32=Q(er);j.prototype.visitInt64=Q(er);j.prototype.visitUint8=Q(er);j.prototype.visitUint16=Q(er);j.prototype.visitUint32=Q(er);j.prototype.visitUint64=Q(er);j.prototype.visitFloat=Q(Ou);j.prototype.visitFloat16=Q(fl);j.prototype.visitFloat32=Q(ka);j.prototype.visitFloat64=Q(ka);j.prototype.visitUtf8=Q(ml);j.prototype.visitLargeUtf8=Q(ml);j.prototype.visitBinary=Q(pl);j.prototype.visitLargeBinary=Q(pl);j.prototype.visitFixedSizeBinary=Q(Ba);j.prototype.visitDate=Q(Pa);j.prototype.visitDateDay=Q(Ji);j.prototype.visitDateMillisecond=Q(es);j.prototype.visitTimestamp=Q(Ca);j.prototype.visitTimestampSecond=Q(ts);j.prototype.visitTimestampMillisecond=Q(rs);j.prototype.visitTimestampMicrosecond=Q(ns);j.prototype.visitTimestampNanosecond=Q(is);j.prototype.visitTime=Q(Ua);j.prototype.visitTimeSecond=Q(ss);j.prototype.visitTimeMillisecond=Q(as);j.prototype.visitTimeMicrosecond=Q(os);j.prototype.visitTimeNanosecond=Q(ls);j.prototype.visitDecimal=Q(Oa);j.prototype.visitList=Q(Nu);j.prototype.visitStruct=Q(Wu);j.prototype.visitUnion=Q(zu);j.prototype.visitDenseUnion=Q(hl);j.prototype.visitSparseUnion=Q(gl);j.prototype.visitDictionary=Q($u);j.prototype.visitInterval=Q(Na);j.prototype.visitIntervalDayTime=Q(cs);j.prototype.visitIntervalYearMonth=Q(us);j.prototype.visitDuration=Q(Ra);j.prototype.visitDurationSecond=Q(_s);j.prototype.visitDurationMillisecond=Q(ds);j.prototype.visitDurationMicrosecond=Q(ps);j.prototype.visitDurationNanosecond=Q(ms);j.prototype.visitFixedSizeList=Q(qu);j.prototype.visitMap=Q(Ru);var De=new j;var St=Symbol.for("parent"),cn=Symbol.for("rowIndex"),wr=class{constructor(e,t){return this[St]=e,this[cn]=t,new Proxy(this,new Ha)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[cn],t=this[St],r=t.type.children,n={};for(let a=-1,o=r.length;++a<o;)n[r[a].name]=Ae.visit(t.children[a],e);return n}toString(){return"{".concat([...this].map(([e,t])=>"".concat(mt(e),": ").concat(mt(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Ga(this[St],this[cn])}},Ga=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 e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,Ae.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(wr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[St]:{writable:!0,enumerable:!1,configurable:!1,value:null},[cn]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Ha=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[St].type.children.map(t=>t.name)}has(e,t){return e[St].type.children.findIndex(r=>r.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[St].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[St].type.children.findIndex(n=>n.name===t);if(r!==-1){let n=Ae.visit(e[St].children[r],e[cn]);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[St].type.children.findIndex(a=>a.name===t);return n!==-1?(De.visit(e[St].children[n],e[cn],r),Reflect.set(e,t,r)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,r):!1}};var R=class extends N{};function z(s){return(e,t)=>e.getValid(t)?s(e,t):null}var Qu=(s,e)=>864e5*s[e],Yu=(s,e)=>null,yl=(s,e,t)=>{if(t+1>=e.length)return null;let r=se(e[t]),n=se(e[t+1]);return s.subarray(r,n)},Ku=({offset:s,values:e},t)=>{let r=s+t;return(e[r>>3]&1<<r%8)!==0},bl=({values:s},e)=>Qu(s,e),vl=({values:s},e)=>se(s[e]),Ar=({stride:s,values:e},t)=>e[s*t],Xu=({stride:s,values:e},t)=>Zi(e[s*t]),Sl=({values:s},e)=>s[e],Zu=({stride:s,values:e},t)=>e.subarray(s*t,s*(t+1)),wl=({values:s,valueOffsets:e},t)=>yl(s,e,t),Al=({values:s,valueOffsets:e},t)=>{let r=yl(s,e,t);return r!==null?In(r):null},Ju=({values:s},e)=>s[e],e_=({type:s,values:e},t)=>s.precision!==_e.HALF?e[t]:Zi(e[t]),t_=(s,e)=>s.type.unit===ve.DAY?bl(s,e):vl(s,e),El=({values:s},e)=>1e3*se(s[e]),Fl=({values:s},e)=>se(s[e]),xl=({values:s},e)=>La(s[e],BigInt(1e3)),Ll=({values:s},e)=>La(s[e],BigInt(1e6)),r_=(s,e)=>{switch(s.type.unit){case B.SECOND:return El(s,e);case B.MILLISECOND:return Fl(s,e);case B.MICROSECOND:return xl(s,e);case B.NANOSECOND:return Ll(s,e)}},Tl=({values:s},e)=>s[e],Il=({values:s},e)=>s[e],Dl=({values:s},e)=>s[e],Ml=({values:s},e)=>s[e],n_=(s,e)=>{switch(s.type.unit){case B.SECOND:return Tl(s,e);case B.MILLISECOND:return Il(s,e);case B.MICROSECOND:return Dl(s,e);case B.NANOSECOND:return Ml(s,e)}},i_=({values:s,stride:e},t)=>zn.decimal(s.subarray(e*t,e*(t+1))),s_=(s,e)=>{let{valueOffsets:t,stride:r,children:n}=s,{[e*r]:a,[e*r+1]:o}=t,c=n[0].slice(a,o-a);return new re([c])},a_=(s,e)=>{let{valueOffsets:t,children:r}=s,{[e]:n,[e+1]:a}=t,o=r[0];return new Pt(o.slice(n,a-n))},o_=(s,e)=>new wr(s,e),l_=(s,e)=>s.type.mode===de.Dense?kl(s,e):Bl(s,e),kl=(s,e)=>{let t=s.type.typeIdToChildIndex[s.typeIds[e]],r=s.children[t];return Ae.visit(r,s.valueOffsets[e])},Bl=(s,e)=>{let t=s.type.typeIdToChildIndex[s.typeIds[e]],r=s.children[t];return Ae.visit(r,e)},c_=(s,e)=>{var t;return(t=s.dictionary)===null||t===void 0?void 0:t.get(s.values[e])},u_=(s,e)=>s.type.unit===xe.DAY_TIME?Pl(s,e):Cl(s,e),Pl=({values:s},e)=>s.subarray(2*e,2*(e+1)),Cl=({values:s},e)=>{let t=s[e],r=new Int32Array(2);return r[0]=Math.trunc(t/12),r[1]=Math.trunc(t%12),r},Ul=({values:s},e)=>s[e],Ol=({values:s},e)=>s[e],Nl=({values:s},e)=>s[e],Rl=({values:s},e)=>s[e],__=(s,e)=>{switch(s.type.unit){case B.SECOND:return Ul(s,e);case B.MILLISECOND:return Ol(s,e);case B.MICROSECOND:return Nl(s,e);case B.NANOSECOND:return Rl(s,e)}},d_=(s,e)=>{let{stride:t,children:r}=s,a=r[0].slice(e*t,t);return new re([a])};R.prototype.visitNull=z(Yu);R.prototype.visitBool=z(Ku);R.prototype.visitInt=z(Ju);R.prototype.visitInt8=z(Ar);R.prototype.visitInt16=z(Ar);R.prototype.visitInt32=z(Ar);R.prototype.visitInt64=z(Sl);R.prototype.visitUint8=z(Ar);R.prototype.visitUint16=z(Ar);R.prototype.visitUint32=z(Ar);R.prototype.visitUint64=z(Sl);R.prototype.visitFloat=z(e_);R.prototype.visitFloat16=z(Xu);R.prototype.visitFloat32=z(Ar);R.prototype.visitFloat64=z(Ar);R.prototype.visitUtf8=z(Al);R.prototype.visitLargeUtf8=z(Al);R.prototype.visitBinary=z(wl);R.prototype.visitLargeBinary=z(wl);R.prototype.visitFixedSizeBinary=z(Zu);R.prototype.visitDate=z(t_);R.prototype.visitDateDay=z(bl);R.prototype.visitDateMillisecond=z(vl);R.prototype.visitTimestamp=z(r_);R.prototype.visitTimestampSecond=z(El);R.prototype.visitTimestampMillisecond=z(Fl);R.prototype.visitTimestampMicrosecond=z(xl);R.prototype.visitTimestampNanosecond=z(Ll);R.prototype.visitTime=z(n_);R.prototype.visitTimeSecond=z(Tl);R.prototype.visitTimeMillisecond=z(Il);R.prototype.visitTimeMicrosecond=z(Dl);R.prototype.visitTimeNanosecond=z(Ml);R.prototype.visitDecimal=z(i_);R.prototype.visitList=z(s_);R.prototype.visitStruct=z(o_);R.prototype.visitUnion=z(l_);R.prototype.visitDenseUnion=z(kl);R.prototype.visitSparseUnion=z(Bl);R.prototype.visitDictionary=z(c_);R.prototype.visitInterval=z(u_);R.prototype.visitIntervalDayTime=z(Pl);R.prototype.visitIntervalYearMonth=z(Cl);R.prototype.visitDuration=z(__);R.prototype.visitDurationSecond=z(Ul);R.prototype.visitDurationMillisecond=z(Ol);R.prototype.visitDurationMicrosecond=z(Nl);R.prototype.visitDurationNanosecond=z(Rl);R.prototype.visitFixedSizeList=z(d_);R.prototype.visitMap=z(a_);var Ae=new R;var Er=Symbol.for("keys"),_n=Symbol.for("vals"),un=Symbol.for("kKeysAsStrings"),Va=Symbol.for("_kKeysAsStrings"),Pt=class{constructor(e){return this[Er]=new re([e.children[0]]).memoize(),this[_n]=e.children[1],new Proxy(this,new Wa)}get[un](){return this[Va]||(this[Va]=Array.from(this[Er].toArray(),String))}[Symbol.iterator](){return new ja(this[Er],this[_n])}get size(){return this[Er].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Er],t=this[_n],r={};for(let n=-1,a=e.length;++n<a;)r[e.get(n)]=Ae.visit(t,n);return r}toString(){return"{".concat([...this].map(([e,t])=>"".concat(mt(e),": ").concat(mt(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},ja=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),Ae.visit(this.vals,e)]})}},Wa=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[un]}has(e,t){return e[un].includes(t)}getOwnPropertyDescriptor(e,t){if(e[un].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let r=e[un].indexOf(t);if(r!==-1){let n=Ae.visit(Reflect.get(e,_n),r);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[un].indexOf(t);return n!==-1?(De.visit(Reflect.get(e,_n),n,r),Reflect.set(e,t,r)):Reflect.has(e,t)?Reflect.set(e,t,r):!1}};Object.defineProperties(Pt.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Er]:{writable:!0,enumerable:!1,configurable:!1,value:null},[_n]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Va]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Gl;function qn(s,e,t,r){let{length:n=0}=s,a=typeof e!="number"?0:e,o=typeof t!="number"?n:t;return a<0&&(a=(a%n+n)%n),o<0&&(o=(o%n+n)%n),o<a&&(Gl=a,a=o,o=Gl),o>n&&(o=n),r?r(s,a,o):[a,o]}var Pr=(s,e)=>s<0?e+s:s,Hl=s=>s!==s;function Fr(s){if(typeof s!=="object"||s===null)return Hl(s)?Hl:t=>t===s;if(s instanceof Date){let t=s.valueOf();return r=>r instanceof Date?r.valueOf()===t:!1}return ArrayBuffer.isView(s)?t=>t?wa(s,t):!1:s instanceof Map?p_(s):Array.isArray(s)?f_(s):s instanceof re?m_(s):h_(s,!0)}function f_(s){let e=[];for(let t=-1,r=s.length;++t<r;)e[t]=Fr(s[t]);return hs(e)}function p_(s){let e=-1,t=[];for(let r of s.values())t[++e]=Fr(r);return hs(t)}function m_(s){let e=[];for(let t=-1,r=s.length;++t<r;)e[t]=Fr(s.get(t));return hs(e)}function h_(s,e=!1){let t=Object.keys(s);if(!e&&t.length===0)return()=>!1;let r=[];for(let n=-1,a=t.length;++n<a;)r[n]=Fr(s[t[n]]);return hs(r,t)}function hs(s,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return g_(s,t);case Map:return Vl(s,t,t.keys());case Pt:case wr:case Object:case void 0:return Vl(s,t,e||Object.keys(t))}return t instanceof re?y_(s,t):!1}}function g_(s,e){let t=s.length;if(e.length!==t)return!1;for(let r=-1;++r<t;)if(!s[r](e[r]))return!1;return!0}function y_(s,e){let t=s.length;if(e.length!==t)return!1;for(let r=-1;++r<t;)if(!s[r](e.get(r)))return!1;return!0}function Vl(s,e,t){let r=t[Symbol.iterator](),n=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),a=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),o=0,l=s.length,c=a.next(),u=r.next(),_=n.next();for(;o<l&&!u.done&&!_.done&&!c.done&&!(u.value!==_.value||!s[o](c.value));++o,u=r.next(),_=n.next(),c=a.next());return o===l&&u.done&&_.done&&c.done?!0:(r.return&&r.return(),n.return&&n.return(),a.return&&a.return(),!1)}var $a={};fr($a,{BitIterator:()=>Cr,getBit:()=>jl,getBool:()=>ys,packBools:()=>Or,popcnt_array:()=>Wl,popcnt_bit_range:()=>Qn,popcnt_uint32:()=>gs,setBool:()=>b_,truncateBitmap:()=>Ur});function ys(s,e,t,r){return(t&1<<r)!==0}function jl(s,e,t,r){return(t&1<<r)>>r}function b_(s,e,t){return t?!!(s[e>>3]|=1<<e%8)||!0:!(s[e>>3]&=~(1<<e%8))&&!1}function Ur(s,e,t){let r=t.byteLength+7&-8;if(s>0||t.byteLength<r){let n=new Uint8Array(r);return n.set(s%8===0?t.subarray(s>>3):Or(new Cr(t,s,e,null,ys)).subarray(0,r)),n}return t}function Or(s){let e=[],t=0,r=0,n=0;for(let o of s)o&&(n|=1<<r),++r===8&&(e[t++]=n,n=r=0);(t===0||r>0)&&(e[t++]=n);let a=new Uint8Array(e.length+7&-8);return a.set(e),a}var Cr=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<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}};function Qn(s,e,t){if(t-e<=0)return 0;if(t-e<8){let a=0;for(let o of new Cr(s,e,t-e,s,jl))a+=o;return a}let r=t>>3<<3,n=e+(e%8===0?0:8-e%8);return Qn(s,e,n)+Qn(s,r,t)+Wl(s,n>>3,r-n>>3)}function Wl(s,e,t){let r=0,n=Math.trunc(e),a=new DataView(s.buffer,s.byteOffset,s.byteLength),o=t===void 0?s.byteLength:n+t;for(;o-n>=4;)r+=gs(a.getUint32(n)),n+=4;for(;o-n>=2;)r+=gs(a.getUint16(n)),n+=2;for(;o-n>=1;)r+=gs(a.getUint8(n)),n+=1;return r}function gs(s){let e=Math.trunc(s);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var v_=-1,ae=class s{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:e}=this;return M.isSparseUnion(e)?this.children.some(t=>t.nullable):M.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:r,nullBitmap:n,typeIds:a}=this;return t&&(e+=t.byteLength),r&&(e+=r.byteLength),n&&(e+=n.byteLength),a&&(e+=a.byteLength),this.children.reduce((o,l)=>o+l.byteLength,e)}get nullCount(){if(M.isUnion(this.type))return this.children.reduce((r,n)=>r+n.nullCount,0);let e=this._nullCount,t;return e<=v_&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-Qn(t,this.offset,this.offset+this.length)),e}constructor(e,t,r,n,a,o=[],l){this.type=e,this.children=o,this.dictionary=l,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let c;a instanceof s?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=Ze(e),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(M.isUnion(t)){let r=t,n=this.children[r.typeIdToChildIndex[this.typeIds[e]]],a=r.mode===de.Dense?this.valueOffsets[e]:e;return n.getValid(a)}if(this.nullable&&this.nullCount>0){let r=this.offset+e;return(this.nullBitmap[r>>3]&1<<r%8)!==0}return!0}setValid(e,t){let r,{type:n}=this;if(M.isUnion(n)){let a=n,o=this.children[a.typeIdToChildIndex[this.typeIds[e]]],l=a.mode===de.Dense?this.valueOffsets[e]:e;r=o.getValid(l),o.setValid(l,t)}else{let{nullBitmap:a}=this,{offset:o,length:l}=this,c=o+e,u=1<<c%8,_=c>>3;(!a||a.byteLength<=_)&&(a=new Uint8Array((o+l+63&-64)>>3).fill(255),this.nullCount>0?(a.set(Ur(o,l,this.nullBitmap),0),Object.assign(this,{nullBitmap:a})):Object.assign(this,{nullBitmap:a,_nullCount:0}));let d=a[_];r=(d&u)!==0,a[_]=t?d|u:d&~u}return r!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,r=this.length,n=this._nullCount,a=this,o=this.children){return new s(e,t,r,n,a,o,this.dictionary)}slice(e,t){let{stride:r,typeId:n,children:a}=this,o=+(this._nullCount===0)-1,l=n===16?r:1,c=this._sliceBuffers(e,t,r,n);return this.clone(this.type,this.offset+e,t,o,c,a.length===0||this.valueOffsets?a:this._sliceChildren(a,l*e,l*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===f.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:r}=this,n=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);n[t>>3]=(1<<t-(t&-8))-1,r>0&&n.set(Ur(this.offset,t,this.nullBitmap),0);let a=this.buffers;return a[nt.VALIDITY]=n,this.clone(this.type,0,e,r+(e-t),a)}_sliceBuffers(e,t,r,n){let a,{buffers:o}=this;return(a=o[nt.TYPE])&&(o[nt.TYPE]=a.subarray(e,e+t)),(a=o[nt.OFFSET])&&(o[nt.OFFSET]=a.subarray(e,e+t+1))||(a=o[nt.DATA])&&(o[nt.DATA]=n===6?a:a.subarray(r*e,r*(e+t))),o}_sliceChildren(e,t,r){return e.map(n=>n.slice(t,r))}};ae.prototype.children=Object.freeze([]);var qa=class s extends N{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:t,["offset"]:r=0,["length"]:n=0}=e;return new ae(t,r,n,n)}visitBool(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length>>3,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitInt(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitFloat(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitUtf8(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.data),a=W(e.nullBitmap),o=kr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,n,a])}visitLargeUtf8(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.data),a=W(e.nullBitmap),o=Ci(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,n,a])}visitBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.data),a=W(e.nullBitmap),o=kr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,n,a])}visitLargeBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.data),a=W(e.nullBitmap),o=Ci(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,n,a])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitDate(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitTimestamp(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitTime(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitDecimal(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitList(e){let{["type"]:t,["offset"]:r=0,["child"]:n}=e,a=W(e.nullBitmap),o=kr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,void 0,a],[n])}visitStruct(e){let{["type"]:t,["offset"]:r=0,["children"]:n=[]}=e,a=W(e.nullBitmap),{length:o=n.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,void 0,a],n)}visitUnion(e){let{["type"]:t,["offset"]:r=0,["children"]:n=[]}=e,a=J(t.ArrayType,e.typeIds),{["length"]:o=a.length,["nullCount"]:l=-1}=e;if(M.isSparseUnion(t))return new ae(t,r,o,l,[void 0,void 0,void 0,a],n);let c=kr(e.valueOffsets);return new ae(t,r,o,l,[c,void 0,void 0,a],n)}visitDictionary(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.indices.ArrayType,e.data),{["dictionary"]:o=new re([new s().visit({type:t.dictionary})])}=e,{["length"]:l=a.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[void 0,a,n],[],o)}visitInterval(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitDuration(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitFixedSizeList(e){let{["type"]:t,["offset"]:r=0,["child"]:n=new s().visit({type:t.valueType})}=e,a=W(e.nullBitmap),{["length"]:o=n.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,void 0,a],[n])}visitMap(e){let{["type"]:t,["offset"]:r=0,["child"]:n=new s().visit({type:t.childType})}=e,a=W(e.nullBitmap),o=kr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,void 0,a],[n])}},S_=new qa;function Y(s){return S_.visit(s)}var Yn=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}};function zl(s){return s.some(e=>e.nullable)}function bs(s){return s.reduce((e,t)=>e+t.nullCount,0)}function vs(s){return s.reduce((e,t,r)=>(e[r+1]=e[r]+t.length,e),new Uint32Array(s.length+1))}function Ss(s,e,t,r){let n=[];for(let a=-1,o=s.length;++a<o;){let l=s[a],c=e[a],{length:u}=l;if(c>=r)break;if(t>=c+u)continue;if(c>=t&&c+u<=r){n.push(l);continue}let _=Math.max(0,t-c),d=Math.min(r-c,u);n.push(l.slice(_,d-_))}return n.length===0&&n.push(s[0].slice(0,0)),n}function Qa(s,e,t,r){let n=0,a=0,o=e.length-1;do{if(n>=o-1)return t<e[o]?r(s,n,t-e[n]):null;a=n+Math.trunc((o-n)*.5),t<e[a]?o=a:n=a}while(n<o)}function Kn(s,e){return s.getValid(e)}function dn(s){function e(t,r,n){return s(t[r],n)}return function(t){let r=this.data;return Qa(r,this._offsets,t,e)}}function ws(s){let e;function t(r,n,a){return s(r[n],a,e)}return function(r,n){let a=this.data;e=n;let o=Qa(a,this._offsets,r,t);return e=void 0,o}}function As(s){let e;function t(r,n,a){let o=a,l=0,c=0;for(let u=n-1,_=r.length;++u<_;){let d=r[u];if(~(l=s(d,e,o)))return c+l;o=0,c+=d.length}return-1}return function(r,n){e=r;let a=this.data,o=typeof n!="number"?t(a,0,0):Qa(a,this._offsets,n,t);return e=void 0,o}}var G=class extends N{};function w_(s,e){return e===null&&s.length>0?0:-1}function A_(s,e){let{nullBitmap:t}=s;if(!t||s.nullCount<=0)return-1;let r=0;for(let n of new Cr(t,s.offset+(e||0),s.length,t,ys)){if(!n)return r;++r}return-1}function K(s,e,t){if(e===void 0)return-1;if(e===null)switch(s.typeId){case f.Union:break;case f.Dictionary:break;default:return A_(s,t)}let r=Ae.getVisitFn(s),n=Fr(e);for(let a=(t||0)-1,o=s.length;++a<o;)if(n(r(s,a)))return a;return-1}function $l(s,e,t){let r=Ae.getVisitFn(s),n=Fr(e);for(let a=(t||0)-1,o=s.length;++a<o;)if(n(r(s,a)))return a;return-1}G.prototype.visitNull=w_;G.prototype.visitBool=K;G.prototype.visitInt=K;G.prototype.visitInt8=K;G.prototype.visitInt16=K;G.prototype.visitInt32=K;G.prototype.visitInt64=K;G.prototype.visitUint8=K;G.prototype.visitUint16=K;G.prototype.visitUint32=K;G.prototype.visitUint64=K;G.prototype.visitFloat=K;G.prototype.visitFloat16=K;G.prototype.visitFloat32=K;G.prototype.visitFloat64=K;G.prototype.visitUtf8=K;G.prototype.visitLargeUtf8=K;G.prototype.visitBinary=K;G.prototype.visitLargeBinary=K;G.prototype.visitFixedSizeBinary=K;G.prototype.visitDate=K;G.prototype.visitDateDay=K;G.prototype.visitDateMillisecond=K;G.prototype.visitTimestamp=K;G.prototype.visitTimestampSecond=K;G.prototype.visitTimestampMillisecond=K;G.prototype.visitTimestampMicrosecond=K;G.prototype.visitTimestampNanosecond=K;G.prototype.visitTime=K;G.prototype.visitTimeSecond=K;G.prototype.visitTimeMillisecond=K;G.prototype.visitTimeMicrosecond=K;G.prototype.visitTimeNanosecond=K;G.prototype.visitDecimal=K;G.prototype.visitList=K;G.prototype.visitStruct=K;G.prototype.visitUnion=K;G.prototype.visitDenseUnion=$l;G.prototype.visitSparseUnion=$l;G.prototype.visitDictionary=K;G.prototype.visitInterval=K;G.prototype.visitIntervalDayTime=K;G.prototype.visitIntervalYearMonth=K;G.prototype.visitDuration=K;G.prototype.visitDurationSecond=K;G.prototype.visitDurationMillisecond=K;G.prototype.visitDurationMicrosecond=K;G.prototype.visitDurationNanosecond=K;G.prototype.visitFixedSizeList=K;G.prototype.visitMap=K;var Nr=new G;var H=class extends N{};function $(s){let{type:e}=s;if(s.nullCount===0&&s.stride===1&&(M.isInt(e)&&e.bitWidth!==64||M.isTime(e)&&e.bitWidth!==64||M.isFloat(e)&&e.precision!==_e.HALF))return new Yn(s.data.length,r=>{let n=s.data[r];return n.values.subarray(0,n.length)[Symbol.iterator]()});let t=0;return new Yn(s.data.length,r=>{let a=s.data[r].length,o=s.slice(t,t+a);return t+=a,new Ya(o)})}var Ya=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};H.prototype.visitNull=$;H.prototype.visitBool=$;H.prototype.visitInt=$;H.prototype.visitInt8=$;H.prototype.visitInt16=$;H.prototype.visitInt32=$;H.prototype.visitInt64=$;H.prototype.visitUint8=$;H.prototype.visitUint16=$;H.prototype.visitUint32=$;H.prototype.visitUint64=$;H.prototype.visitFloat=$;H.prototype.visitFloat16=$;H.prototype.visitFloat32=$;H.prototype.visitFloat64=$;H.prototype.visitUtf8=$;H.prototype.visitLargeUtf8=$;H.prototype.visitBinary=$;H.prototype.visitLargeBinary=$;H.prototype.visitFixedSizeBinary=$;H.prototype.visitDate=$;H.prototype.visitDateDay=$;H.prototype.visitDateMillisecond=$;H.prototype.visitTimestamp=$;H.prototype.visitTimestampSecond=$;H.prototype.visitTimestampMillisecond=$;H.prototype.visitTimestampMicrosecond=$;H.prototype.visitTimestampNanosecond=$;H.prototype.visitTime=$;H.prototype.visitTimeSecond=$;H.prototype.visitTimeMillisecond=$;H.prototype.visitTimeMicrosecond=$;H.prototype.visitTimeNanosecond=$;H.prototype.visitDecimal=$;H.prototype.visitList=$;H.prototype.visitStruct=$;H.prototype.visitUnion=$;H.prototype.visitDenseUnion=$;H.prototype.visitSparseUnion=$;H.prototype.visitDictionary=$;H.prototype.visitInterval=$;H.prototype.visitIntervalDayTime=$;H.prototype.visitIntervalYearMonth=$;H.prototype.visitDuration=$;H.prototype.visitDurationSecond=$;H.prototype.visitDurationMillisecond=$;H.prototype.visitDurationMicrosecond=$;H.prototype.visitDurationNanosecond=$;H.prototype.visitFixedSizeList=$;H.prototype.visitMap=$;var fn=new H;var ql,Ql={},Yl={},re=class s{constructor(e){var t,r,n;let a=e[0]instanceof s?e.flatMap(l=>l.data):e;if(a.length===0||a.some(l=>!(l instanceof ae)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(t=a[0])===null||t===void 0?void 0:t.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:l,set:c,indexOf:u}=Ql[o.typeId],_=a[0];this.isValid=d=>Kn(_,d),this.get=d=>l(_,d),this.set=(d,m)=>c(_,d,m),this.indexOf=d=>u(_,d),this._offsets=[0,_.length];break}default:Object.setPrototypeOf(this,Yl[o.typeId]),this._offsets=vs(a);break}this.data=a,this.type=o,this.stride=Ze(o),this.numChildren=(n=(r=o.children)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return zl(this.data)}get nullCount(){return bs(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}get VectorName(){return"".concat(f[this.type.typeId],"Vector")}isValid(e){return!1}get(e){return null}at(e){return this.get(Pr(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return fn.visit(this)}concat(...e){return new s(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new s(qn(this,e,t,({data:r,_offsets:n},a,o)=>Ss(r,n,a,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:r,stride:n,ArrayType:a}=this;switch(e.typeId){case f.Int:case f.Float:case f.Decimal:case f.Time:case f.Timestamp:switch(t.length){case 0:return new a;case 1:return t[0].values.subarray(0,r*n);default:return t.reduce((o,{values:l,length:c})=>(o.array.set(l.subarray(0,c*n),o.offset),o.offset+=c*n,o),{array:new a(r*n),offset:0}).array}}return[...this]}toString(){return"[".concat([...this].join(","),"]")}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(r=>r.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new s(this.data.map(({children:t})=>t[e])):null}get isMemoized(){return M.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(M.isDictionary(this.type)){let e=new Es(this.data[0].dictionary),t=this.data.map(r=>{let n=r.clone();return n.dictionary=e,n});return new s(t)}return new Es(this)}unmemoize(){if(M.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),t=this.data.map(r=>{let n=r.clone();return n.dictionary=e,n});return new s(t)}return this}};ql=Symbol.toStringTag;re[ql]=(s=>{s.type=M.prototype,s.data=[],s.length=0,s.stride=1,s.numChildren=0,s._offsets=new Uint32Array([0]),s[Symbol.isConcatSpreadable]=!0;let e=Object.keys(f).map(t=>f[t]).filter(t=>typeof t=="number"&&t!==f.NONE);for(let t of e){let r=Ae.getVisitFnByTypeId(t),n=De.getVisitFnByTypeId(t),a=Nr.getVisitFnByTypeId(t);Ql[t]={get:r,set:n,indexOf:a},Yl[t]=Object.create(s,{isValid:{value:dn(Kn)},get:{value:dn(Ae.getVisitFnByTypeId(t))},set:{value:ws(De.getVisitFnByTypeId(t))},indexOf:{value:As(Nr.getVisitFnByTypeId(t))}})}return"Vector"})(re.prototype);var Es=class s extends re{constructor(e){super(e.data);let t=this.get,r=this.set,n=this.slice,a=new Array(this.length);Object.defineProperty(this,"get",{value(o){let l=a[o];if(l!==void 0)return l;let c=t.call(this,o);return a[o]=c,c}}),Object.defineProperty(this,"set",{value(o,l){r.call(this,o,l),a[o]=l}}),Object.defineProperty(this,"slice",{value:(o,l)=>new s(n.call(this,o,l))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new re(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Kl(s){if(!s||s.length<=0)return function(n){return!0};let e="",t=s.filter(r=>r===r);return t.length>0&&(e="\n switch (x) {".concat(t.map(r=>"\n case ".concat(E_(r),":")).join(""),"\n return false;\n }")),s.length!==t.length&&(e="if (x !== x) return false;\n".concat(e)),new Function("x","".concat(e,"\nreturn true;"))}function E_(s){return typeof s!="bigint"?mt(s):"".concat(mt(s),"n")}function Ka(s,e){let t=Math.ceil(s)*e-1;return(t-t%64+64||64)/e}function Xl(s,e=0){return s.length>=e?s.subarray(0,e):Mn(new s.constructor(e),s,0)}var wt=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?Ka(r*1,this.BYTES_PER_ELEMENT):Ka(r*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=Ka(e*this.stride,this.BYTES_PER_ELEMENT);let t=Xl(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=Xl(this.buffer,e)}},tr=class extends wt{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}},pn=class extends tr{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<<a,++this.numValid):o===1&&(r[n]&=~(1<<a),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},mn=class extends tr{constructor(e){super(e.OffsetArrayType,1,1)}append(e){return this.set(this.length-1,e)}set(e,t){let r=this.length-1,n=this.reserve(e-r+1).buffer;return r<e++&&r>=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)}};var ge=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=Ze(e),this._nulls=new pn,t&&t.length>0&&(this._isValid=Kl(t))}toVector(){return new re([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,c)=>l+c.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:c,_offsets:u,_values:_,_nulls:d}=this;(t=c==null?void 0:c.flush(o))?n=u==null?void 0:u.flush(o):(n=u==null?void 0:u.flush(o))?e=_==null?void 0:_.flush(u.last()):e=_==null?void 0:_.flush(o),l>0&&(r=d==null?void 0:d.flush(o));let m=this.children.map(p=>p.flush());return this.clear(),Y({type:a,length:o,nullCount:l,children:m,child:m[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}};ge.prototype.length=1;ge.prototype.stride=1;ge.prototype.children=null;ge.prototype.finished=!1;ge.prototype.nullValues=null;ge.prototype._isValid=()=>!0;var Ee=class extends ge{constructor(e){super(e),this._values=new tr(this.ArrayType,0,this.stride)}setValue(e,t){let r=this._values;return r.reserve(e-r.length+1),super.setValue(e,t)}},Re=class extends ge{constructor(e){super(e),this._pendingLength=0,this._offsets=new mn(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 Pt?t[Er].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}};var Rr=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!=null?n:0)),e.pad(4),e.writeInt32(r),e.writeInt64(BigInt(t!=null?t:0)),e.offset()}};var Je=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):oe.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Ne).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new Rr).__init(this.bb.__vector(this.bb_pos+r)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let r=this.bb.__offset(this.bb_pos,10);return r?(t||new Rr).__init(this.bb.__vector(this.bb_pos+r)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Le).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,oe.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}};var ce=class s{constructor(e=[],t,r,n=oe.V5){this.fields=e||[],this.metadata=t||new Map,r||(r=Xa(this.fields)),this.dictionaries=r,this.metadataVersion=n}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return"Schema<{ ".concat(this.fields.map((e,t)=>"".concat(t,": ").concat(e)).join(", ")," }>")}select(e){let t=new Set(e),r=this.fields.filter(n=>t.has(n.name));return new s(r,this.metadata)}selectAt(e){let t=e.map(r=>this.fields[r]).filter(Boolean);return new s(t,this.metadata)}assign(...e){let t=e[0]instanceof s?e[0]:Array.isArray(e[0])?new s(e[0]):new s(e),r=[...this.fields],n=Fs(Fs(new Map,this.metadata),t.metadata),a=t.fields.filter(l=>{let c=r.findIndex(u=>u.name===l.name);return~c?(r[c]=l.clone({metadata:Fs(Fs(new Map,r[c].metadata),l.metadata)}))&&!1:!0}),o=Xa(a,new Map);return new s([...r,...a],n,new Map([...this.dictionaries,...o]))}};ce.prototype.fields=null;ce.prototype.metadata=null;ce.prototype.dictionaries=null;var ee=class s{static new(...e){let[t,r,n,a]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],r===void 0&&(r=e[0].type),n===void 0&&(n=e[0].nullable),a===void 0&&(a=e[0].metadata)),new s("".concat(t),r,n,a)}constructor(e,t,r=!1,n){this.name=e,this.type=t,this.nullable=r,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return"".concat(this.name,": ").concat(this.type)}clone(...e){let[t,r,n,a]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,r=this.type,n=this.nullable,a=this.metadata]=e:{name:t=this.name,type:r=this.type,nullable:n=this.nullable,metadata:a=this.metadata}=e[0],s.new(t,r,n,a)}};ee.prototype.type=null;ee.prototype.name=null;ee.prototype.nullable=null;ee.prototype.metadata=null;function Fs(s,e){return new Map([...s||new Map,...e||new Map])}function Xa(s,e=new Map){for(let t=-1,r=s.length;++t<r;){let a=s[t].type;if(M.isDictionary(a)){if(!e.has(a.id))e.set(a.id,a.dictionary);else if(e.get(a.id)!==a.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}a.children&&a.children.length>0&&Xa(a.children,e)}return e}var F_=Br,x_=Ye,rr=class{static decode(e){e=new x_(W(e));let t=Je.getRootAsFooter(e),r=ce.decode(t.schema(),new Map,t.version());return new Za(r,t)}static encode(e){let t=new F_,r=ce.encode(t,e.schema);Je.startRecordBatchesVector(t,e.numRecordBatches);for(let o of[...e.recordBatches()].slice().reverse())nr.encode(t,o);let n=t.endVector();Je.startDictionariesVector(t,e.numDictionaries);for(let o of[...e.dictionaryBatches()].slice().reverse())nr.encode(t,o);let a=t.endVector();return Je.startFooter(t),Je.addSchema(t,r),Je.addVersion(t,oe.V5),Je.addRecordBatches(t,n),Je.addDictionaries(t,a),Je.finishFooterBuffer(t,Je.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=oe.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<r;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,r=this.numDictionaries;++t<r;)(e=this.getDictionaryBatch(t))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}};var Za=class extends rr{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,t){super(e,t.version()),this._footer=t}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let t=this._footer.recordBatches(e);if(t)return nr.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return nr.decode(t)}return null}},nr=class s{static decode(e){return new s(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:r}=t,n=BigInt(t.offset),a=BigInt(t.bodyLength);return Rr.createBlock(e,n,r,a)}constructor(e,t,r){this.metaDataLength=e,this.offset=se(r),this.bodyLength=se(t)}};var he=Object.freeze({done:!0,value:void 0}),Xn=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Gr=class{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},xs=class extends Gr{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return D(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(he);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Ie.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Ie.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return D(this,void 0,void 0,function*(){return yield this.abort(e),he})}return(e){return D(this,void 0,void 0,function*(){return yield this.close(),he})}read(e){return D(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return D(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(he)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var Ct=class extends xs{write(e){if((e=W(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?In(this.toUint8Array(!0)):this.toUint8Array(!1).then(In)}toUint8Array(e=!1){return e?Qe(this._values)[0]:D(this,void 0,void 0,function*(){var t,r,n,a;let o=[],l=0;try{for(var c=!0,u=lt(this),_;_=yield u.next(),t=_.done,!t;c=!0){a=_.value,c=!1;let d=a;o.push(d),l+=d.byteLength}}catch(d){r={error:d}}finally{try{!c&&!t&&(n=u.return)&&(yield n.call(u))}finally{if(r)throw r.error}}return Qe(o,l)[0]})}},Ut=class{constructor(e){e&&(this.source=new Ja(Ie.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)}},st=class s{constructor(e){e instanceof s?this.source=e.source:e instanceof Ct?this.source=new ir(Ie.fromAsyncIterable(e)):Pi(e)?this.source=new ir(Ie.fromNodeStream(e)):Dn(e)?this.source=new ir(Ie.fromDOMStream(e)):ki(e)?this.source=new ir(Ie.fromDOMStream(e.body)):ut(e)?this.source=new ir(Ie.fromIterable(e)):ct(e)?this.source=new ir(Ie.fromAsyncIterable(e)):tt(e)&&(this.source=new ir(Ie.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Ja=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)||he)}return(e){return Object.create(this.source.return&&this.source.return(e)||he)}},ir=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return D(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return D(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return D(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return D(this,arguments,void 0,function*(t,r="read"){return yield this.source.next({cmd:r,size:t})})}throw(e){return D(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||he;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return D(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||he;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}};var Zn=class extends Ut{constructor(e,t){super(),this.position=0,this.buffer=W(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),e<this.size}read(e){let{buffer:t,size:r,position:n}=this;return t&&n<r?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(r,n+Math.min(r-n,e)),t.subarray(n,this.position)):null}readAt(e,t){let r=this.buffer,n=Math.min(this.size,e+t);return r?r.subarray(e,n):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}},xr=class extends st{constructor(e,t){super(),this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=D(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return D(this,void 0,void 0,function*(){let{buffer:t,byteOffset:r}=yield this.readAt(e,4);return new DataView(t,r).getInt32(0,!0)})}seek(e){return D(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return D(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:t,size:r,position:n}=this;if(t&&n<r){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let a=n,o=0,l=0,c=Math.min(r,a+Math.min(r-a,e)),u=new Uint8Array(Math.max(0,(this.position=c)-a));for(;(a+=l)<c&&(o+=l)<u.byteLength;)({bytesRead:l}=yield t.read(u,o,u.byteLength-o,a));return u}return null})}readAt(e,t){return D(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n}=this;if(r&&e+t<n){let a=Math.min(n,e+t),o=new Uint8Array(a-e);return(yield r.read(o,0,t,e)).buffer}return new Uint8Array(t)})}close(){return D(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return D(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return D(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}};var to={};fr(to,{BaseInt64:()=>Jn,Int128:()=>ei,Int64:()=>sr,Uint64:()=>be});function hn(s){return s<0&&(s=4294967295+s+1),"0x".concat(s.toString(16))}var gn=8,eo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Jn=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<n?65536:0,this.buffer[1]+=a>>>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<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return"".concat(hn(this.buffer[1])," ").concat(hn(this.buffer[0]))}},be=class s extends Jn{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return s.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return s.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let r=e.length,n=new s(t);for(let a=0;a<r;){let o=gn<r-a?gn:r-a,l=new s(new Uint32Array([Number.parseInt(e.slice(a,a+o),10),0])),c=new s(new Uint32Array([eo[o],0]));n.times(c),n.plus(l),a+=o}return n}static convertArray(e){let t=new Uint32Array(e.length*2);for(let r=-1,n=e.length;++r<n;)s.from(e[r],new Uint32Array(t.buffer,t.byteOffset+2*r*4,2));return t}static multiply(e,t){return new s(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new s(new Uint32Array(e.buffer)).plus(t)}},sr=class s extends Jn{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let t=this.buffer[1]<<0,r=e.buffer[1]<<0;return t<r||t===r&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return s.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return s.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let r=e.startsWith("-"),n=e.length,a=new s(t);for(let o=r?1:0;o<n;){let l=gn<n-o?gn:n-o,c=new s(new Uint32Array([Number.parseInt(e.slice(o,o+l),10),0])),u=new s(new Uint32Array([eo[l],0]));a.times(u),a.plus(c),o+=l}return r?a.negate():a}static convertArray(e){let t=new Uint32Array(e.length*2);for(let r=-1,n=e.length;++r<n;)s.from(e[r],new Uint32Array(t.buffer,t.byteOffset+2*r*4,2));return t}static multiply(e,t){return new s(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new s(new Uint32Array(e.buffer)).plus(t)}},ei=class s{constructor(e){this.buffer=e}high(){return new sr(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new sr(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let t=new be(new Uint32Array([this.buffer[3],0])),r=new be(new Uint32Array([this.buffer[2],0])),n=new be(new Uint32Array([this.buffer[1],0])),a=new be(new Uint32Array([this.buffer[0],0])),o=new be(new Uint32Array([e.buffer[3],0])),l=new be(new Uint32Array([e.buffer[2],0])),c=new be(new Uint32Array([e.buffer[1],0])),u=new be(new Uint32Array([e.buffer[0],0])),_=be.multiply(a,u);this.buffer[0]=_.low();let d=new be(new Uint32Array([_.high(),0]));return _=be.multiply(n,u),d.plus(_),_=be.multiply(a,c),d.plus(_),this.buffer[1]=d.low(),this.buffer[3]=d.lessThan(_)?1:0,this.buffer[2]=d.high(),new be(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(be.multiply(r,u)).plus(be.multiply(n,c)).plus(be.multiply(a,l)),this.buffer[3]+=be.multiply(t,u).plus(be.multiply(r,c)).plus(be.multiply(n,l)).plus(be.multiply(a,o)).low(),this}plus(e){let t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return"".concat(hn(this.buffer[3])," ").concat(hn(this.buffer[2])," ").concat(hn(this.buffer[1])," ").concat(hn(this.buffer[0]))}static multiply(e,t){return new s(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new s(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return s.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return s.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let r=e.startsWith("-"),n=e.length,a=new s(t);for(let o=r?1:0;o<n;){let l=gn<n-o?gn:n-o,c=new s(new Uint32Array([Number.parseInt(e.slice(o,o+l),10),0,0,0])),u=new s(new Uint32Array([eo[l],0,0,0]));a.times(u),a.plus(c),o+=l}return r?a.negate():a}static convertArray(e){let t=new Uint32Array(e.length*4);for(let r=-1,n=e.length;++r<n;)s.from(e[r],new Uint32Array(t.buffer,t.byteOffset+4*4*r,4));return t}};var ti=class extends N{constructor(e,t,r,n,a=oe.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=e,this.nodes=t,this.buffers=r,this.dictionaries=n,this.metadataVersion=a}visit(e){return super.visit(e instanceof ee?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return Y({type:e,length:t})}visitBool(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitInt(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitFloat(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitUtf8(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinary(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitFixedSizeBinary(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitDate(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitTimestamp(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitTime(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitDecimal(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitList(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),children:this.visitMany(e.children)})}visitUnion(e,{length:t,nullCount:r}=this.nextFieldNode()){return this.metadataVersion<oe.V5&&this.readNullBitmap(e,r),e.mode===de.Sparse?this.visitSparseUnion(e,{length:t,nullCount:r}):this.visitDenseUnion(e,{length:t,nullCount:r})}visitDenseUnion(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitDuration(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitFixedSizeList(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),child:this.visit(e.children[0])})}visitMap(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,t,r=this.nextBufferRange()){return t>0&&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)}},Ls=class extends ti{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):Or(this.sources[r])}readOffsets(e,{offset:t}=this.nextBufferRange()){return J(Uint8Array,J(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return J(Uint8Array,J(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:r}=this;return M.isTimestamp(e)?J(Uint8Array,sr.convertArray(r[t])):(M.isInt(e)||M.isTime(e))&&e.bitWidth===64||M.isDuration(e)?J(Uint8Array,sr.convertArray(r[t])):M.isDate(e)&&e.unit===ve.MILLISECOND?J(Uint8Array,sr.convertArray(r[t])):M.isDecimal(e)?J(Uint8Array,ei.convertArray(r[t])):M.isBinary(e)||M.isLargeBinary(e)||M.isFixedSizeBinary(e)?L_(r[t]):M.isBool(e)?Or(r[t]):M.isUtf8(e)||M.isLargeUtf8(e)?Tt(r[t].join("")):J(Uint8Array,J(e.ArrayType,r[t].map(n=>+n)))}};function L_(s){let e=s.join(""),t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r>>1]=Number.parseInt(e.slice(r,r+2),16);return t}var yn=class extends Re{constructor(e){super(e),this._values=new wt(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,W(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 c=l.length;n.set(l,a),r.set(o,c),a+=c}}};var bn=class extends Re{constructor(e){super(e),this._values=new wt(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,W(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 c=l.length;n.set(l,a),r.set(o,BigInt(c)),a+=c}}};var Ts=class extends ge{constructor(e){super(e),this._values=new pn}setValue(e,t){this._values.set(e,+t)}};var Hr=class extends Ee{};Hr.prototype._setValue=Pa;var ri=class extends Hr{};ri.prototype._setValue=Ji;var ni=class extends Hr{};ni.prototype._setValue=es;var ii=class extends Ee{};ii.prototype._setValue=Oa;var Is=class extends ge{constructor({type:e,nullValues:t,dictionaryHashFunction:r}){super({type:new Xe(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Vr({type:this.type.indices,nullValues:t}),this.dictionary=Vr({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)}};var si=class extends Ee{};si.prototype._setValue=Ba;var Ds=class extends ge{setValue(e,t){let[r]=this.children,n=e*this.stride;for(let a=-1,o=t.length;++a<o;)r.set(n+a,t[a])}addChild(e,t="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(e);return this.type=new bt(this.type.listSize,new ee(t,e.type,!0)),r}};var jr=class extends Ee{setValue(e,t){this._values.set(e,t)}},Ms=class extends jr{setValue(e,t){super.setValue(e,$n(t))}},ks=class extends jr{},Bs=class extends jr{};var Wr=class extends Ee{};Wr.prototype._setValue=Na;var ai=class extends Wr{};ai.prototype._setValue=cs;var oi=class extends Wr{};oi.prototype._setValue=us;var ar=class extends Ee{};ar.prototype._setValue=Ra;var li=class extends ar{};li.prototype._setValue=_s;var ci=class extends ar{};ci.prototype._setValue=ds;var ui=class extends ar{};ui.prototype._setValue=ps;var _i=class extends ar{};_i.prototype._setValue=ms;var at=class extends Ee{setValue(e,t){this._values.set(e,t)}},Ps=class extends at{},Cs=class extends at{},Us=class extends at{},Os=class extends at{},Ns=class extends at{},Rs=class extends at{},Gs=class extends at{},Hs=class extends at{};var Vs=class extends Re{constructor(e){super(e),this._offsets=new mn(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 gt(new ee(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,c=t.set(n,l).buffer[n];for(let u=-1;++u<l;)r.set(c+u,o[u])}}};var js=class extends Re{set(e,t){return super.set(e,t)}setValue(e,t){let r=t instanceof Map?t:new Map(Object.entries(t)),n=this._pending||(this._pending=new Map),a=n.get(e);a&&(this._pendingLength-=a.size),this._pendingLength+=r.size,n.set(e,r)}addChild(e,t="".concat(this.numChildren)){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new vt(new ee(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 c of a.entries())if(r.set(o,c),++o>=l)break}}};var Ws=class extends ge{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}};var zs=class extends ge{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 me([...this.type.children,new ee(t,e.type,!0)]),r}};var or=class extends Ee{};or.prototype._setValue=Ca;var di=class extends or{};di.prototype._setValue=ts;var fi=class extends or{};fi.prototype._setValue=rs;var pi=class extends or{};pi.prototype._setValue=ns;var mi=class extends or{};mi.prototype._setValue=is;var lr=class extends Ee{};lr.prototype._setValue=Ua;var hi=class extends lr{};hi.prototype._setValue=ss;var gi=class extends lr{};gi.prototype._setValue=as;var yi=class extends lr{};yi.prototype._setValue=os;var bi=class extends lr{};bi.prototype._setValue=ls;var vn=class extends ge{constructor(e){super(e),this._typeIds=new tr(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 ee(t,e.type)];return this.type=new yt(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 vn{},qs=class extends vn{constructor(e){super(e),this._offsets=new tr(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)}};var vi=class extends Re{constructor(e){super(e),this._values=new wt(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,Tt(t))}_flushPending(e,t){}};vi.prototype._flushPending=yn.prototype._flushPending;var Si=class extends Re{constructor(e){super(e),this._values=new wt(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,Tt(t))}_flushPending(e,t){}};Si.prototype._flushPending=bn.prototype._flushPending;var ro=class extends N{visitNull(){return Ws}visitBool(){return Ts}visitInt(){return at}visitInt8(){return Ps}visitInt16(){return Cs}visitInt32(){return Us}visitInt64(){return Os}visitUint8(){return Ns}visitUint16(){return Rs}visitUint32(){return Gs}visitUint64(){return Hs}visitFloat(){return jr}visitFloat16(){return Ms}visitFloat32(){return ks}visitFloat64(){return Bs}visitUtf8(){return vi}visitLargeUtf8(){return Si}visitBinary(){return yn}visitLargeBinary(){return bn}visitFixedSizeBinary(){return si}visitDate(){return Hr}visitDateDay(){return ri}visitDateMillisecond(){return ni}visitTimestamp(){return or}visitTimestampSecond(){return di}visitTimestampMillisecond(){return fi}visitTimestampMicrosecond(){return pi}visitTimestampNanosecond(){return mi}visitTime(){return lr}visitTimeSecond(){return hi}visitTimeMillisecond(){return gi}visitTimeMicrosecond(){return yi}visitTimeNanosecond(){return bi}visitDecimal(){return ii}visitList(){return Vs}visitStruct(){return zs}visitUnion(){return vn}visitDenseUnion(){return qs}visitSparseUnion(){return $s}visitDictionary(){return Is}visitInterval(){return Wr}visitIntervalDayTime(){return ai}visitIntervalYearMonth(){return oi}visitDuration(){return ar}visitDurationSecond(){return li}visitDurationMillisecond(){return ci}visitDurationMicrosecond(){return ui}visitDurationNanosecond(){return _i}visitFixedSizeList(){return Ds}visitMap(){return js}},Zl=new ro;var V=class extends N{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 Ue(s,e){return e instanceof s.constructor}function zr(s,e){return s===e||Ue(s,e)}function cr(s,e){return s===e||Ue(s,e)&&s.bitWidth===e.bitWidth&&s.isSigned===e.isSigned}function Qs(s,e){return s===e||Ue(s,e)&&s.precision===e.precision}function T_(s,e){return s===e||Ue(s,e)&&s.byteWidth===e.byteWidth}function no(s,e){return s===e||Ue(s,e)&&s.unit===e.unit}function wi(s,e){return s===e||Ue(s,e)&&s.unit===e.unit&&s.timezone===e.timezone}function Ai(s,e){return s===e||Ue(s,e)&&s.unit===e.unit&&s.bitWidth===e.bitWidth}function I_(s,e){return s===e||Ue(s,e)&&s.children.length===e.children.length&&Ot.compareManyFields(s.children,e.children)}function D_(s,e){return s===e||Ue(s,e)&&s.children.length===e.children.length&&Ot.compareManyFields(s.children,e.children)}function io(s,e){return s===e||Ue(s,e)&&s.mode===e.mode&&s.typeIds.every((t,r)=>t===e.typeIds[r])&&Ot.compareManyFields(s.children,e.children)}function M_(s,e){return s===e||Ue(s,e)&&s.id===e.id&&s.isOrdered===e.isOrdered&&Ot.visit(s.indices,e.indices)&&Ot.visit(s.dictionary,e.dictionary)}function so(s,e){return s===e||Ue(s,e)&&s.unit===e.unit}function Ei(s,e){return s===e||Ue(s,e)&&s.unit===e.unit}function k_(s,e){return s===e||Ue(s,e)&&s.listSize===e.listSize&&s.children.length===e.children.length&&Ot.compareManyFields(s.children,e.children)}function B_(s,e){return s===e||Ue(s,e)&&s.keysSorted===e.keysSorted&&s.children.length===e.children.length&&Ot.compareManyFields(s.children,e.children)}V.prototype.visitNull=zr;V.prototype.visitBool=zr;V.prototype.visitInt=cr;V.prototype.visitInt8=cr;V.prototype.visitInt16=cr;V.prototype.visitInt32=cr;V.prototype.visitInt64=cr;V.prototype.visitUint8=cr;V.prototype.visitUint16=cr;V.prototype.visitUint32=cr;V.prototype.visitUint64=cr;V.prototype.visitFloat=Qs;V.prototype.visitFloat16=Qs;V.prototype.visitFloat32=Qs;V.prototype.visitFloat64=Qs;V.prototype.visitUtf8=zr;V.prototype.visitLargeUtf8=zr;V.prototype.visitBinary=zr;V.prototype.visitLargeBinary=zr;V.prototype.visitFixedSizeBinary=T_;V.prototype.visitDate=no;V.prototype.visitDateDay=no;V.prototype.visitDateMillisecond=no;V.prototype.visitTimestamp=wi;V.prototype.visitTimestampSecond=wi;V.prototype.visitTimestampMillisecond=wi;V.prototype.visitTimestampMicrosecond=wi;V.prototype.visitTimestampNanosecond=wi;V.prototype.visitTime=Ai;V.prototype.visitTimeSecond=Ai;V.prototype.visitTimeMillisecond=Ai;V.prototype.visitTimeMicrosecond=Ai;V.prototype.visitTimeNanosecond=Ai;V.prototype.visitDecimal=zr;V.prototype.visitList=I_;V.prototype.visitStruct=D_;V.prototype.visitUnion=io;V.prototype.visitDenseUnion=io;V.prototype.visitSparseUnion=io;V.prototype.visitDictionary=M_;V.prototype.visitInterval=so;V.prototype.visitIntervalDayTime=so;V.prototype.visitIntervalYearMonth=so;V.prototype.visitDuration=Ei;V.prototype.visitDurationSecond=Ei;V.prototype.visitDurationMillisecond=Ei;V.prototype.visitDurationMicrosecond=Ei;V.prototype.visitDurationNanosecond=Ei;V.prototype.visitFixedSizeList=k_;V.prototype.visitMap=B_;var Ot=new V;function $r(s,e){return Ot.compareSchemas(s,e)}function Jl(s,e){return Ot.compareFields(s,e)}function ec(s,e){return Ot.visit(s,e)}function Vr(s){let e=s.type,t=new(Zl.getVisitFn(e)())(s);if(e.children&&e.children.length>0){let r=s.children||[],n={nullValues:s.nullValues},a=Array.isArray(r)?(o,l)=>r[l]||n:({name:o})=>r[o]||n;for(let[o,l]of e.children.entries()){let{type:c}=l,u=a(l,o);t.children.push(Vr(Object.assign(Object.assign({},u),{type:c})))}}return t}function Ys(s,e){return P_(s,e.map(t=>t.data.concat()))}function P_(s,e){let t=[...s.fields],r=[],n={numBatches:e.reduce((d,m)=>Math.max(d,m.length),0)},a=0,o=0,l=-1,c=e.length,u,_=[];for(;n.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,l=-1;++l<c;)_[l]=u=e[l].shift(),o=Math.min(o,u?u.length:o);Number.isFinite(o)&&(_=C_(t,o,_,e,n),o>0&&(r[a++]=Y({type:new me(t),length:o,nullCount:0,children:_.slice()})))}return[s=s.assign(t),r.map(d=>new Se(s,d))]}function C_(s,e,t,r,n){var a;let o=(e+63&-64)>>3;for(let l=-1,c=r.length;++l<c;){let u=t[l],_=u==null?void 0:u.length;if(_>=e)_===e?t[l]=u:(t[l]=u.slice(0,e),n.numBatches=Math.max(n.numBatches,r[l].unshift(u.slice(e,_-e))));else{let d=s[l];s[l]=d.clone({nullable:!0}),t[l]=(a=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&a!==void 0?a:Y({type:d.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)})}}return t}var tc,Oe=class s{constructor(...e){var t,r;if(e.length===0)return this.batches=[],this.schema=new ce([]),this._offsets=[0],this;let n,a;e[0]instanceof ce&&(n=e.shift()),e.at(-1)instanceof Uint32Array&&(a=e.pop());let o=c=>{if(c){if(c instanceof Se)return[c];if(c instanceof s)return c.batches;if(c instanceof ae){if(c.type instanceof me)return[new Se(new ce(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(u=>o(u));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(u=>o(u));if(typeof c=="object"){let u=Object.keys(c),_=u.map(p=>new re([c[p]])),d=n!=null?n:new ce(u.map((p,h)=>new ee(String(p),_[h].type,_[h].nullable))),[,m]=Ys(d,_);return m.length===0?[new Se(c)]:m}}}return[]},l=e.flatMap(c=>o(c));if(n=(r=n!=null?n:(t=l[0])===null||t===void 0?void 0:t.schema)!==null&&r!==void 0?r:new ce([]),!(n instanceof ce))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of l){if(!(c instanceof Se))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!$r(n,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=l,this._offsets=a!=null?a:vs(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=bs(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Pr(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?fn.visit(new re(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return"[\n ".concat(this.toArray().join(",\n "),"\n]")}concat(...e){let t=this.schema,r=this.data.concat(e.flatMap(({data:n})=>n));return new s(t,r.map(n=>new Se(t,n)))}slice(e,t){let r=this.schema;[e,t]=qn({length:this.numRows},e,t);let n=Ss(this.data,this._offsets,e,t);return new s(r,n.map(a=>new Se(r,a)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let t=this.data.map(r=>r.children[e]);if(t.length===0){let{type:r}=this.schema.fields[e],n=Y({type:r,length:0,nullCount:0});t.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new re(t)}return null}setChild(e,t){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===e),t)}setChildAt(e,t){let r=this.schema,n=[...this.batches];if(e>-1&&e<this.numCols){t||(t=new re([Y({type:new Ce,length:this.numRows})]));let a=r.fields.slice(),o=a[e].clone({type:t.type}),l=this.schema.fields.map((c,u)=>this.getChildAt(u));[a[e],l[e]]=[o,t],[r,n]=Ys(r,l)}return new s(r,n)}select(e){let t=this.schema.fields.reduce((r,n,a)=>r.set(n.name,a),new Map);return this.selectAt(e.map(r=>t.get(r)).filter(r=>r>-1))}selectAt(e){let t=this.schema.selectAt(e),r=this.batches.map(n=>n.selectAt(e));return new s(t,r)}assign(e){let t=this.schema.fields,[r,n]=e.schema.fields.reduce((l,c,u)=>{let[_,d]=l,m=t.findIndex(p=>p.name===c.name);return~m?d[m]=u:_.push(u),l},[[],[]]),a=this.schema.assign(e.schema),o=[...t.map((l,c)=>[c,n[c]]).map(([l,c])=>c===void 0?this.getChildAt(l):e.getChildAt(c)),...r.map(l=>e.getChildAt(l))].filter(Boolean);return new s(...Ys(a,o))}};tc=Symbol.toStringTag;Oe[tc]=(s=>(s.schema=null,s.batches=[],s._offsets=new Uint32Array([0]),s._nullCount=-1,s[Symbol.isConcatSpreadable]=!0,s.isValid=dn(Kn),s.get=dn(Ae.getVisitFn(f.Struct)),s.set=ws(De.getVisitFn(f.Struct)),s.indexOf=As(Nr.getVisitFn(f.Struct)),"Table"))(Oe.prototype);var nc,Se=class s{constructor(...e){switch(e.length){case 2:{if([this.schema]=e,!(this.schema instanceof ce))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Y({nullCount:0,type:new me(this.schema.fields),children:this.schema.fields.map(t=>Y({type:t.type,nullCount:0}))})]=e,!(this.data instanceof ae))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=rc(this.schema,this.data.children);break}case 1:{let[t]=e,{fields:r,children:n,length:a}=Object.keys(t).reduce((c,u,_)=>(c.children[_]=t[u],c.length=Math.max(c.length,t[u].length),c.fields[_]=ee.new({name:u,type:t[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new ce(r),l=Y({type:new me(r),length:a,children:n,nullCount:0});[this.schema,this.data]=rc(o,l.children,a);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=ic(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(e){return this.data.getValid(e)}get(e){return Ae.visit(this.data,e)}at(e){return this.get(Pr(e,this.numRows))}set(e,t){return De.visit(this.data,e,t)}indexOf(e,t){return Nr.visit(this.data,e,t)}[Symbol.iterator](){return fn.visit(new re([this.data]))}toArray(){return[...this]}concat(...e){return new Oe(this.schema,[this,...e])}slice(e,t){let[r]=new re([this.data]).slice(e,t).data;return new s(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(r=>r.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new re([this.data.children[e]]):null}setChild(e,t){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===e),t)}setChildAt(e,t){let r=this.schema,n=this.data;if(e>-1&&e<this.numCols){t||(t=new re([Y({type:new Ce,length:this.numRows})]));let a=r.fields.slice(),o=n.children.slice(),l=a[e].clone({type:t.type});[a[e],o[e]]=[l,t.data[0]],r=new ce(a,new Map(this.schema.metadata)),n=Y({type:new me(a),children:o})}return new s(r,n)}select(e){let t=this.schema.select(e),r=new me(t.fields),n=[];for(let a of e){let o=this.schema.fields.findIndex(l=>l.name===a);~o&&(n[o]=this.data.children[o])}return new s(t,Y({type:r,length:this.numRows,children:n}))}selectAt(e){let t=this.schema.selectAt(e),r=e.map(a=>this.data.children[a]).filter(Boolean),n=Y({type:new me(t.fields),length:this.numRows,children:r});return new s(t,n)}};nc=Symbol.toStringTag;Se[nc]=(s=>(s._nullCount=-1,s[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Se.prototype);function rc(s,e,t=e.reduce((r,n)=>Math.max(r,n.length),0)){var r;let n=[...s.fields],a=[...e],o=(t+63&-64)>>3;for(let[l,c]of s.fields.entries()){let u=e[l];(!u||u.length!==t)&&(n[l]=c.clone({nullable:!0}),a[l]=(r=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&r!==void 0?r:Y({type:c.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)}))}return[s.assign(n),Y({type:new me(n),length:t,children:a})]}function ic(s,e,t=new Map){var r,n;if(((r=s==null?void 0:s.length)!==null&&r!==void 0?r:0)>0&&(s==null?void 0:s.length)===(e==null?void 0:e.length))for(let a=-1,o=s.length;++a<o;){let{type:l}=s[a],c=e[a];for(let u of[c,...((n=c==null?void 0:c.dictionary)===null||n===void 0?void 0:n.data)||[]])ic(l.children,u==null?void 0:u.children,t);if(M.isDictionary(l)){let{id:u}=l;if(!t.has(u))c!=null&&c.dictionary&&t.set(u,c.dictionary);else if(t.get(u)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return t}var qr=class extends Se{constructor(e){let t=e.fields.map(n=>Y({type:n.type})),r=Y({type:new me(e.fields),nullCount:0,children:t});super(e,r)}};var At=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):oe.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):te.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Le).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,oe.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,te.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt("0"))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,r,n,a,o){return s.startMessage(e),s.addVersion(e,t),s.addHeaderType(e,r),s.addHeader(e,n),s.addBodyLength(e,a),s.addCustomMetadata(e,o),s.endMessage(e)}};var ao=class extends N{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Hn.startNull(t),Hn.endNull(t)}visitInt(e,t){return ft.startInt(t),ft.addBitWidth(t,e.bitWidth),ft.addIsSigned(t,e.isSigned),ft.endInt(t)}visitFloat(e,t){return br.startFloatingPoint(t),br.addPrecision(t,e.precision),br.endFloatingPoint(t)}visitBinary(e,t){return Un.startBinary(t),Un.endBinary(t)}visitLargeBinary(e,t){return Nn.startLargeBinary(t),Nn.endLargeBinary(t)}visitBool(e,t){return On.startBool(t),On.endBool(t)}visitUtf8(e,t){return jn.startUtf8(t),jn.endUtf8(t)}visitLargeUtf8(e,t){return Rn.startLargeUtf8(t),Rn.endLargeUtf8(t)}visitDecimal(e,t){return kt.startDecimal(t),kt.addScale(t,e.scale),kt.addPrecision(t,e.precision),kt.addBitWidth(t,e.bitWidth),kt.endDecimal(t)}visitDate(e,t){return mr.startDate(t),mr.addUnit(t,e.unit),mr.endDate(t)}visitTime(e,t){return Gt.startTime(t),Gt.addUnit(t,e.unit),Gt.addBitWidth(t,e.bitWidth),Gt.endTime(t)}visitTimestamp(e,t){let r=e.timezone&&t.createString(e.timezone)||void 0;return Ht.startTimestamp(t),Ht.addUnit(t,e.unit),r!==void 0&&Ht.addTimezone(t,r),Ht.endTimestamp(t)}visitInterval(e,t){return vr.startInterval(t),vr.addUnit(t,e.unit),vr.endInterval(t)}visitDuration(e,t){return hr.startDuration(t),hr.addUnit(t,e.unit),hr.endDuration(t)}visitList(e,t){return Gn.startList(t),Gn.endList(t)}visitStruct(e,t){return Vn.startStruct_(t),Vn.endStruct_(t)}visitUnion(e,t){pt.startTypeIdsVector(t,e.typeIds.length);let r=pt.createTypeIdsVector(t,e.typeIds);return pt.startUnion(t),pt.addMode(t,e.mode),pt.addTypeIds(t,r),pt.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 gr.startFixedSizeBinary(t),gr.addByteWidth(t,e.byteWidth),gr.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return yr.startFixedSizeList(t),yr.addListSize(t,e.listSize),yr.endFixedSizeList(t)}visitMap(e,t){return Sr.startMap(t),Sr.addKeysSorted(t,e.keysSorted),Sr.endMap(t)}},Ks=new ao;function lc(s,e=new Map){return new ce(O_(s,e),Xs(s.metadata),e)}function oo(s){return new Me(s.count,uc(s.columns),_c(s.columns))}function cc(s){return new He(oo(s.data),s.id,s.isDelta)}function O_(s,e){return(s.fields||[]).filter(Boolean).map(t=>ee.fromJSON(t,e))}function sc(s,e){return(s.children||[]).filter(Boolean).map(t=>ee.fromJSON(t,e))}function uc(s){return(s||[]).reduce((e,t)=>[...e,new ot(t.count,N_(t.VALIDITY)),...uc(t.children)],[])}function _c(s,e=[]){for(let t=-1,r=(s||[]).length;++t<r;){let n=s[t];n.VALIDITY&&e.push(new Ge(e.length,n.VALIDITY.length)),n.TYPE_ID&&e.push(new Ge(e.length,n.TYPE_ID.length)),n.OFFSET&&e.push(new Ge(e.length,n.OFFSET.length)),n.DATA&&e.push(new Ge(e.length,n.DATA.length)),e=_c(n.children,e)}return e}function N_(s){return(s||[]).reduce((e,t)=>e+ +(t===0),0)}function dc(s,e){let t,r,n,a,o,l;return!e||!(a=s.dictionary)?(o=oc(s,sc(s,e)),n=new ee(s.name,o,s.nullable,Xs(s.metadata))):e.has(t=a.id)?(r=(r=a.indexType)?ac(r):new Bt,l=new Xe(e.get(t),r,t,a.isOrdered),n=new ee(s.name,l,s.nullable,Xs(s.metadata))):(r=(r=a.indexType)?ac(r):new Bt,e.set(t,o=oc(s,sc(s,e))),l=new Xe(o,r,t,a.isOrdered),n=new ee(s.name,l,s.nullable,Xs(s.metadata))),n||null}function Xs(s=[]){return new Map(s.map(({key:e,value:t})=>[e,t]))}function ac(s){return new Te(s.isSigned,s.bitWidth)}function oc(s,e){let t=s.type.name;switch(t){case"NONE":return new Ce;case"null":return new Ce;case"binary":return new Vt;case"largebinary":return new jt;case"utf8":return new Wt;case"largeutf8":return new zt;case"bool":return new $t;case"list":return new gt((e||[])[0]);case"struct":return new me(e||[]);case"struct_":return new me(e||[])}switch(t){case"int":{let r=s.type;return new Te(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=s.type;return new it(_e[r.precision])}case"decimal":{let r=s.type;return new qt(r.scale,r.precision,r.bitWidth)}case"date":{let r=s.type;return new Qt(ve[r.unit])}case"time":{let r=s.type;return new Yt(B[r.unit],r.bitWidth)}case"timestamp":{let r=s.type;return new Kt(B[r.unit],r.timezone)}case"interval":{let r=s.type;return new Xt(xe[r.unit])}case"duration":{let r=s.type;return new Zt(B[r.unit])}case"union":{let r=s.type,[n,...a]=(r.mode+"").toLowerCase(),o=n.toUpperCase()+a.join("");return new yt(de[o],r.typeIds||[],e||[])}case"fixedsizebinary":{let r=s.type;return new Jt(r.byteWidth)}case"fixedsizelist":{let r=s.type;return new bt(r.listSize,(e||[])[0])}case"map":{let r=s.type;return new vt((e||[])[0],r.keysSorted)}}throw new Error('Unrecognized type: "'.concat(t,'"'))}var R_=Br,G_=Ye,Ve=class s{static fromJSON(e,t){let r=new s(0,oe.V5,t);return r._createHeader=H_(e,t),r}static decode(e){e=new G_(W(e));let t=At.getRootAsMessage(e),r=t.bodyLength(),n=t.version(),a=t.headerType(),o=new s(r,n,a);return o._createHeader=V_(t,a),o}static encode(e){let t=new R_,r=-1;return e.isSchema()?r=ce.encode(t,e.header()):e.isRecordBatch()?r=Me.encode(t,e.header()):e.isDictionaryBatch()&&(r=He.encode(t,e.header())),At.startMessage(t),At.addVersion(t,oe.V5),At.addHeader(t,r),At.addHeaderType(t,e.headerType),At.addBodyLength(t,BigInt(e.bodyLength)),At.finishMessageBuffer(t,At.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof ce)return new s(0,oe.V5,te.Schema,e);if(e instanceof Me)return new s(t,oe.V5,te.RecordBatch,e);if(e instanceof He)return new s(t,oe.V5,te.DictionaryBatch,e);throw new Error("Unrecognized Message header: ".concat(e))}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===te.Schema}isRecordBatch(){return this.headerType===te.RecordBatch}isDictionaryBatch(){return this.headerType===te.DictionaryBatch}constructor(e,t,r,n){this._version=t,this._headerType=r,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=se(e)}},Me=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=se(e)}},He=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=se(t)}},Ge=class{constructor(e,t){this.offset=se(e),this.length=se(t)}},ot=class{constructor(e,t){this.length=se(e),this.nullCount=se(t)}};function H_(s,e){return()=>{switch(e){case te.Schema:return ce.fromJSON(s);case te.RecordBatch:return Me.fromJSON(s);case te.DictionaryBatch:return He.fromJSON(s)}throw new Error("Unrecognized Message type: { name: ".concat(te[e],", type: ").concat(e," }"))}}function V_(s,e){return()=>{switch(e){case te.Schema:return ce.decode(s.header(new Ne),new Map,s.version());case te.RecordBatch:return Me.decode(s.header(new Ke),s.version());case te.DictionaryBatch:return He.decode(s.header(new Rt),s.version())}throw new Error("Unrecognized Message type: { name: ".concat(te[e],", type: ").concat(e," }"))}}ee.encode=J_;ee.decode=X_;ee.fromJSON=dc;ce.encode=Z_;ce.decode=j_;ce.fromJSON=lc;Me.encode=ed;Me.decode=W_;Me.fromJSON=oo;He.encode=td;He.decode=z_;He.fromJSON=cc;ot.encode=rd;ot.decode=q_;Ge.encode=nd;Ge.decode=$_;function j_(s,e=new Map,t=oe.V5){let r=K_(s,e);return new ce(r,Zs(s),e,t)}function W_(s,e=oe.V5){if(s.compression()!==null)throw new Error("Record batch compression not implemented");return new Me(s.length(),Q_(s),Y_(s,e))}function z_(s,e=oe.V5){return new He(Me.decode(s.data(),e),s.id(),s.isDelta())}function $_(s){return new Ge(s.offset(),s.length())}function q_(s){return new ot(s.length(),s.nullCount())}function Q_(s){let e=[];for(let t,r=-1,n=-1,a=s.nodesLength();++r<a;)(t=s.nodes(r))&&(e[++n]=ot.decode(t));return e}function Y_(s,e){let t=[];for(let r,n=-1,a=-1,o=s.buffersLength();++n<o;)(r=s.buffers(n))&&(e<oe.V4&&(r.bb_pos+=8*(n+1)),t[++a]=Ge.decode(r));return t}function K_(s,e){let t=[];for(let r,n=-1,a=-1,o=s.fieldsLength();++n<o;)(r=s.fields(n))&&(t[++a]=ee.decode(r,e));return t}function fc(s,e){let t=[];for(let r,n=-1,a=-1,o=s.childrenLength();++n<o;)(r=s.children(n))&&(t[++a]=ee.decode(r,e));return t}function X_(s,e){let t,r,n,a,o,l;return!e||!(l=s.dictionary())?(n=mc(s,fc(s,e)),r=new ee(s.name(),n,s.nullable(),Zs(s))):e.has(t=se(l.id()))?(a=(a=l.indexType())?pc(a):new Bt,o=new Xe(e.get(t),a,t,l.isOrdered()),r=new ee(s.name(),o,s.nullable(),Zs(s))):(a=(a=l.indexType())?pc(a):new Bt,e.set(t,n=mc(s,fc(s,e))),o=new Xe(n,a,t,l.isOrdered()),r=new ee(s.name(),o,s.nullable(),Zs(s))),r||null}function Zs(s){let e=new Map;if(s)for(let t,r,n=-1,a=Math.trunc(s.customMetadataLength());++n<a;)(t=s.customMetadata(n))&&(r=t.key())!=null&&e.set(r,t.value());return e}function pc(s){return new Te(s.isSigned(),s.bitWidth())}function mc(s,e){let t=s.typeType();switch(t){case fe.NONE:return new Ce;case fe.Null:return new Ce;case fe.Binary:return new Vt;case fe.LargeBinary:return new jt;case fe.Utf8:return new Wt;case fe.LargeUtf8:return new zt;case fe.Bool:return new $t;case fe.List:return new gt((e||[])[0]);case fe.Struct_:return new me(e||[])}switch(t){case fe.Int:{let r=s.type(new ft);return new Te(r.isSigned(),r.bitWidth())}case fe.FloatingPoint:{let r=s.type(new br);return new it(r.precision())}case fe.Decimal:{let r=s.type(new kt);return new qt(r.scale(),r.precision(),r.bitWidth())}case fe.Date:{let r=s.type(new mr);return new Qt(r.unit())}case fe.Time:{let r=s.type(new Gt);return new Yt(r.unit(),r.bitWidth())}case fe.Timestamp:{let r=s.type(new Ht);return new Kt(r.unit(),r.timezone())}case fe.Interval:{let r=s.type(new vr);return new Xt(r.unit())}case fe.Duration:{let r=s.type(new hr);return new Zt(r.unit())}case fe.Union:{let r=s.type(new pt);return new yt(r.mode(),r.typeIdsArray()||[],e||[])}case fe.FixedSizeBinary:{let r=s.type(new gr);return new Jt(r.byteWidth())}case fe.FixedSizeList:{let r=s.type(new yr);return new bt(r.listSize(),(e||[])[0])}case fe.Map:{let r=s.type(new Sr);return new vt((e||[])[0],r.keysSorted())}}throw new Error('Unrecognized type: "'.concat(fe[t],'" (').concat(t,")"))}function Z_(s,e){let t=e.fields.map(a=>ee.encode(s,a));Ne.startFieldsVector(s,t.length);let r=Ne.createFieldsVector(s,t),n=e.metadata&&e.metadata.size>0?Ne.createCustomMetadataVector(s,[...e.metadata].map(([a,o])=>{let l=s.createString("".concat(a)),c=s.createString("".concat(o));return Le.startKeyValue(s),Le.addKey(s,l),Le.addValue(s,c),Le.endKeyValue(s)})):-1;return Ne.startSchema(s),Ne.addFields(s,r),Ne.addEndianness(s,id?pr.Little:pr.Big),n!==-1&&Ne.addCustomMetadata(s,n),Ne.endSchema(s)}function J_(s,e){let t=-1,r=-1,n=-1,a=e.type,o=e.typeId;M.isDictionary(a)?(o=a.dictionary.typeId,n=Ks.visit(a,s),r=Ks.visit(a.dictionary,s)):r=Ks.visit(a,s);let l=(a.children||[]).map(_=>ee.encode(s,_)),c=Be.createChildrenVector(s,l),u=e.metadata&&e.metadata.size>0?Be.createCustomMetadataVector(s,[...e.metadata].map(([_,d])=>{let m=s.createString("".concat(_)),p=s.createString("".concat(d));return Le.startKeyValue(s),Le.addKey(s,m),Le.addValue(s,p),Le.endKeyValue(s)})):-1;return e.name&&(t=s.createString(e.name)),Be.startField(s),Be.addType(s,r),Be.addTypeType(s,o),Be.addChildren(s,c),Be.addNullable(s,!!e.nullable),t!==-1&&Be.addName(s,t),n!==-1&&Be.addDictionary(s,n),u!==-1&&Be.addCustomMetadata(s,u),Be.endField(s)}function ed(s,e){let t=e.nodes||[],r=e.buffers||[];Ke.startNodesVector(s,t.length);for(let o of t.slice().reverse())ot.encode(s,o);let n=s.endVector();Ke.startBuffersVector(s,r.length);for(let o of r.slice().reverse())Ge.encode(s,o);let a=s.endVector();return Ke.startRecordBatch(s),Ke.addLength(s,BigInt(e.length)),Ke.addNodes(s,n),Ke.addBuffers(s,a),Ke.endRecordBatch(s)}function td(s,e){let t=Me.encode(s,e.data);return Rt.startDictionaryBatch(s),Rt.addId(s,BigInt(e.id)),Rt.addIsDelta(s,e.isDelta),Rt.addData(s,t),Rt.endDictionaryBatch(s)}function rd(s,e){return rn.createFieldNode(s,BigInt(e.length),BigInt(e.nullCount))}function nd(s,e){return tn.createBuffer(s,BigInt(e.offset),BigInt(e.length))}var id=(()=>{let s=new ArrayBuffer(2);return new DataView(s).setInt16(0,256,!0),new Int16Array(s)[0]===256})();var co=s=>"Expected ".concat(te[s]," Message in stream, but was null or length 0."),uo=s=>"Header pointer of flatbuffer-encoded ".concat(te[s]," Message is null or length 0."),hc=(s,e)=>"Expected to read ".concat(s," metadata bytes, but only read ").concat(e,"."),gc=(s,e)=>"Expected to read ".concat(s," bytes for message body, but only read ").concat(e,"."),Sn=class{constructor(e){this.source=e instanceof Ut?e:new Ut(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?he:e.value===-1&&(e=this.readMetadataLength()).done?he:(e=this.readMetadata(e.value)).done?he: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(co(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=W(this.source.read(e));if(t.byteLength<e)throw new Error(gc(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=te.Schema,r=this.readMessage(t),n=r==null?void 0:r.header();if(e&&!n)throw new Error(uo(t));return n}readMetadataLength(){let e=this.source.read(Js),t=e&&new Ye(e),r=(t==null?void 0:t.readInt32(0))||0;return{done:r===0,value:r}}readMetadata(e){let t=this.source.read(e);if(!t)return he;if(t.byteLength<e)throw new Error(hc(e,t.byteLength));return{done:!1,value:Ve.decode(t)}}},Fi=class{constructor(e,t){this.source=e instanceof st?e:Mi(e)?new xr(e,t):new st(e)}[Symbol.asyncIterator](){return this}next(){return D(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?he:e.value===-1&&(e=yield this.readMetadataLength()).done?he:(e=yield this.readMetadata(e.value)).done?he:e})}throw(e){return D(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return D(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return D(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(co(e));return t.value})}readMessageBody(e){return D(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let t=W(yield this.source.read(e));if(t.byteLength<e)throw new Error(gc(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(){return D(this,arguments,void 0,function*(e=!1){let t=te.Schema,r=yield this.readMessage(t),n=r==null?void 0:r.header();if(e&&!n)throw new Error(uo(t));return n})}readMetadataLength(){return D(this,void 0,void 0,function*(){let e=yield this.source.read(Js),t=e&&new Ye(e),r=(t==null?void 0:t.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(e){return D(this,void 0,void 0,function*(){let t=yield this.source.read(e);if(!t)return he;if(t.byteLength<e)throw new Error(hc(e,t.byteLength));return{done:!1,value:Ve.decode(t)}})}},xi=class extends Sn{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Xn?e:new Xn(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Ve.fromJSON(e.schema,te.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let t=e.dictionaries[this._dictionaryIndex++];return this._body=t.data.columns,{done:!1,value:Ve.fromJSON(t,te.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let t=e.batches[this._batchIndex++];return this._body=t.columns,{done:!1,value:Ve.fromJSON(t,te.RecordBatch)}}return this._body=[],he}readMessageBody(e){return t(this._body);function t(r){return(r||[]).reduce((n,a)=>[...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(co(e));return t.value}readSchema(){let e=te.Schema,t=this.readMessage(e),r=t==null?void 0:t.header();if(!t||!r)throw new Error(uo(e));return r}},Js=4,lo="ARROW1",wn=new Uint8Array(lo.length);for(let s=0;s<lo.length;s+=1)wn[s]=lo.codePointAt(s);function ea(s,e=0){for(let t=-1,r=wn.length;++t<r;)if(wn[t]!==s[e+t])return!1;return!0}var An=wn.length,_o=An+Js,yc=An*2+Js;var ke=class s extends Gr{constructor(e){super(),this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let t=this._impl.open(e);return ct(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Ie.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Ie.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}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')}static from(e){return e instanceof s?e:Ii(e)?ad(e):Mi(e)?cd(e):ct(e)?D(this,void 0,void 0,function*(){return yield s.from(yield e)}):ki(e)||Dn(e)||Pi(e)||tt(e)?ld(new st(e)):od(new Ut(e))}static readAll(e){return e instanceof s?e.isSync()?bc(e):vc(e):Ii(e)||ArrayBuffer.isView(e)||ut(e)||Di(e)?bc(e):vc(e)}},Nt=class extends ke{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 Z(yield*Mr(Jr(lt(this[Symbol.iterator]()))))})}},Lr=class extends ke{constructor(e){super(e),this._impl=e}readAll(){return D(this,void 0,void 0,function*(){var e,t,r,n;let a=new Array;try{for(var o=!0,l=lt(this),c;c=yield l.next(),e=c.done,!e;o=!0){n=c.value,o=!1;let u=n;a.push(u)}}catch(u){t={error:u}}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]()}},Tr=class extends Nt{constructor(e){super(e),this._impl=e}},Li=class extends Lr{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=Y({type:new me(this.schema.fields),length:e.length,children:r});return new Se(this.schema,n)}_loadDictionaryBatch(e,t){let{id:r,isDelta:n}=e,{dictionaries:a,schema:o}=this,l=a.get(r),c=o.dictionaries.get(r),u=this._loadVectors(e.data,t,[c]);return(l&&n?l.concat(new re(u)):new re(u)).memoize()}_loadVectors(e,t,r){return new ti(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},En=class extends ta{constructor(e,t){super(t),this._reader=Ii(e)?new xi(this._handle=e):new Sn(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=Sc(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):he}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):he}next(){if(this.closed)return he;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 qr(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Fn=class extends ta{constructor(e,t){super(t),this._reader=new Fi(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return D(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 D(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Sc(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return D(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):he})}return(e){return D(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):he})}next(){return D(this,void 0,void 0,function*(){if(this.closed)return he;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 qr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return D(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},ra=class extends En{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 Zn?e:new Zn(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(te.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(te.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 rr.decode(n)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(this._recordBatchIndex);if(r&&this._handle.seek(r.offset))return this._reader.readMessage(e)}return null}},fo=class extends Fn{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){let r=typeof t[0]!="number"?t.shift():void 0,n=t[0]instanceof Map?t.shift():void 0;super(e instanceof xr?e:new xr(e,r),n)}isFile(){return!0}isAsync(){return!0}open(e){let t=Object.create(null,{open:{get:()=>super.open}});return D(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 D(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(te.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 D(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(te.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 D(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 rr.decode(n)})}_readNextMessageAndValidate(e){return D(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}},po=class extends En{constructor(e,t){super(e,t)}_loadVectors(e,t,r){return new Ls(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function Sc(s,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:s.autoDestroy}function*bc(s){let e=ke.from(s);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function vc(s){return qe(this,arguments,function*(){let t=yield Z(ke.from(s));try{if(!(yield Z(t.open({autoDestroy:!1}))).closed)do yield yield Z(t);while(!(yield Z(t.reset().open())).closed)}finally{yield Z(t.cancel())}})}function ad(s){return new Nt(new po(s))}function od(s){let e=s.peek(An+7&-8);return e&&e.byteLength>=4?ea(e)?new Tr(new ra(s.read())):new Nt(new En(s)):new Nt(new En(function*(){}()))}function ld(s){return D(this,void 0,void 0,function*(){let e=yield s.peek(An+7&-8);return e&&e.byteLength>=4?ea(e)?new Tr(new ra(yield s.read())):new Lr(new Fn(s)):new Lr(new Fn(function(){return qe(this,arguments,function*(){})}()))})}function cd(s){return D(this,void 0,void 0,function*(){let{size:e}=yield s.stat(),t=new xr(s,e);return e>=yc&&ea(yield t.readAt(0,An+7&-8))?new Li(new fo(t)):new Lr(new Fn(t))})}var ye=class s extends N{static assemble(...e){let t=n=>n.flatMap(a=>Array.isArray(a)?t(a):a instanceof Se?a.data.children:a.data),r=new s;return r.visitMany(t(e)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof re)return this.visitMany(e.data),this;let{type:t}=e;if(!M.isDictionary(t)){let{length:r}=e;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(M.isUnion(t))this.nodes.push(new ot(r,0));else{let{nullCount:n}=e;M.isNull(t)||Et.call(this,n<=0?new Uint8Array(0):Ur(e.offset,r,e.nullBitmap)),this.nodes.push(new ot(r,n))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function Et(s){let e=s.byteLength+7&-8;return this.buffers.push(s),this.bufferRegions.push(new Ge(this._byteLength,e)),this._byteLength+=e,this}function ud(s){var e;let{type:t,length:r,typeIds:n,valueOffsets:a}=s;if(Et.call(this,n),t.mode===de.Sparse)return mo.call(this,s);if(t.mode===de.Dense){if(s.offset<=0)return Et.call(this,a),mo.call(this,s);{let o=new Int32Array(r),l=Object.create(null),c=Object.create(null);for(let u,_,d=-1;++d<r;)(u=n[d])!==void 0&&((_=l[u])===void 0&&(_=l[u]=a[d]),o[d]=a[d]-_,c[u]=((e=c[u])!==null&&e!==void 0?e:0)+1);Et.call(this,o),this.visitMany(s.children.map((u,_)=>{let d=t.typeIds[_],m=l[d],p=c[d];return u.slice(m,Math.min(r,p))}))}}return this}function _d(s){let e;return s.nullCount>=s.length?Et.call(this,new Uint8Array(0)):(e=s.values)instanceof Uint8Array?Et.call(this,Ur(s.offset,s.length,e)):Et.call(this,Or(s.values))}function ur(s){return Et.call(this,s.values.subarray(0,s.length*s.stride))}function na(s){let{length:e,values:t,valueOffsets:r}=s,n=se(r[0]),a=se(r[e]),o=Math.min(a-n,t.byteLength-n);return Et.call(this,Ui(-n,e+1,r)),Et.call(this,t.subarray(n,n+o)),this}function ho(s){let{length:e,valueOffsets:t}=s;if(t){let{[0]:r,[e]:n}=t;return Et.call(this,Ui(-r,e+1,t)),this.visit(s.children[0].slice(r,n-r))}return this.visit(s.children[0])}function mo(s){return this.visitMany(s.type.children.map((e,t)=>s.children[t]).filter(Boolean))[0]}ye.prototype.visitBool=_d;ye.prototype.visitInt=ur;ye.prototype.visitFloat=ur;ye.prototype.visitUtf8=na;ye.prototype.visitLargeUtf8=na;ye.prototype.visitBinary=na;ye.prototype.visitLargeBinary=na;ye.prototype.visitFixedSizeBinary=ur;ye.prototype.visitDate=ur;ye.prototype.visitTimestamp=ur;ye.prototype.visitTime=ur;ye.prototype.visitDecimal=ur;ye.prototype.visitList=ho;ye.prototype.visitStruct=mo;ye.prototype.visitUnion=ud;ye.prototype.visitInterval=ur;ye.prototype.visitDuration=ur;ye.prototype.visitFixedSizeList=ho;ye.prototype.visitMap=ho;var Qr=class extends Gr{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 Ct,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Pe(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 ct(e)?e.then(t=>this.writeAll(t)):tt(e)?yo(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 Ct?this._sink=e:(this._sink=new Ct,e&&Oo(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&No(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||!$r(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 Oe&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof Se&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!$r(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof Se?e instanceof qr||this._writeRecordBatch(e):e instanceof Oe?this.writeAll(e.batches):ut(e)&&this.writeAll(e)}_writeMessage(e,t=8){let r=t-1,n=Ve.encode(e),a=n.byteLength,o=this._writeLegacyIpcFormat?4:8,l=a+o+r&~r,c=l-a-o;return e.headerType===te.RecordBatch?this._recordBatchBlocks.push(new nr(l,e.bodyLength,this._position)):e.headerType===te.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(c)}_write(e){if(this._started){let t=W(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Ve.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(wn)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:r,bufferRegions:n,buffers:a}=ye.assemble(e),o=new Me(e.numRows,r,n),l=Ve.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}=ye.assemble(new re([e])),c=new Me(e.length,a,o),u=new He(c,t,r),_=Ve.from(u,n);return this._writeMessage(_)._writeBodyBuffers(l)}_writeBodyBuffers(e){let t,r,n;for(let a=-1,o=e.length;++a<o;)(t=e[a])&&(r=t.byteLength)>0&&(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),c=(r=this._dictionaryDeltaOffsets.get(n))!==null&&r!==void 0?r:0;if(!l||l.data[0]!==o[0])for(let[u,_]of o.entries())this._writeDictionaryBatch(_,n,u>0);else if(c<o.length)for(let u of o.slice(c))this._writeDictionaryBatch(u,n,!0);this._seenDictionaries.set(n,a),this._dictionaryDeltaOffsets.set(n,o.length)}return this}},Yr=class s extends Qr{static writeAll(e,t){let r=new s(t);return ct(e)?e.then(n=>r.writeAll(n)):tt(e)?yo(r,e):go(r,e)}},Kr=class s extends Qr{static writeAll(e){let t=new s;return ct(e)?e.then(r=>t.writeAll(r)):tt(e)?yo(t,e):go(t,e)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,r=!1){if(!r&&this._seenDictionaries.has(t))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,t,r)}_writeFooter(e){let t=rr.encode(new rr(e,oe.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function go(s,e){let t=e;e instanceof Oe&&(t=e.batches,s.reset(void 0,e.schema));for(let r of t)s.write(r);return s.finish()}function yo(s,e){return D(this,void 0,void 0,function*(){var t,r,n,a,o,l,c;try{for(t=!0,r=lt(e);n=yield r.next(),a=n.done,!a;t=!0){c=n.value,t=!1;let u=c;s.write(u)}}catch(u){o={error:u}}finally{try{!t&&!a&&(l=r.return)&&(yield l.call(r))}finally{if(o)throw o.error}}return s.finish()})}function wc(s,e){if(tt(s))return fd(s,e);if(ut(s))return dd(s,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function dd(s,e){let t=null,r=(e==null?void 0:e.type)==="bytes"||!1,n=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){a(o,t||(t=s[Symbol.iterator]()))},pull(o){t?a(o,t):o.close()},cancel(){(t!=null&&t.return&&t.return()||!0)&&(t=null)}}),Object.assign({highWaterMark:r?n:void 0},e));function a(o,l){let c,u=null,_=o.desiredSize||null;for(;!(u=l.next(r?_:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=W(u.value))&&(_!=null&&r&&(_=_-c.byteLength+1),u.value=c),o.enqueue(u.value),_!=null&&--_<=0)return;o.close()}}function fd(s,e){let t=null,r=(e==null?void 0:e.type)==="bytes"||!1,n=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return D(this,void 0,void 0,function*(){yield a(o,t||(t=s[Symbol.asyncIterator]()))})},pull(o){return D(this,void 0,void 0,function*(){t?yield a(o,t):o.close()})},cancel(){return D(this,void 0,void 0,function*(){(t!=null&&t.return&&(yield t.return())||!0)&&(t=null)})}}),Object.assign({highWaterMark:r?n:void 0},e));function a(o,l){return D(this,void 0,void 0,function*(){let c,u=null,_=o.desiredSize||null;for(;!(u=yield l.next(r?_:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=W(u.value))&&(_!=null&&r&&(_=_-c.byteLength+1),u.value=c),o.enqueue(u.value),_!=null&&--_<=0)return;o.close()})}}function Fc(s){return new bo(s)}var bo=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:r,["queueingStrategy"]:n="count"}=e,a=Co(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Vr(a),this._getSize=n!=="bytes"?Ac:Ec;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:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:n!=="bytes"?Ac:Ec}),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:c=>this._writeValueAndReturnChunkSize(c)})}_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)}},Ac=s=>{var e;return(e=s==null?void 0:s.length)!==null&&e!==void 0?e:0},Ec=s=>{var e;return(e=s==null?void 0:s.byteLength)!==null&&e!==void 0?e:0};function ia(s,e){let t=new Ct,r=null,n=new ReadableStream({cancel(){return D(this,void 0,void 0,function*(){yield t.close()})},start(l){return D(this,void 0,void 0,function*(){yield o(l,r||(r=yield a()))})},pull(l){return D(this,void 0,void 0,function*(){r?yield o(l,r):l.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},s)),readable:n};function a(){return D(this,void 0,void 0,function*(){return yield(yield ke.from(t)).open(e)})}function o(l,c){return D(this,void 0,void 0,function*(){let u=l.desiredSize,_=null;for(;!(_=yield c.next()).done;)if(l.enqueue(_.value),u!=null&&--u<=0)return;l.close()})}}function sa(s,e){let t=new this(s),r=new st(t),n=new ReadableStream({cancel(){return D(this,void 0,void 0,function*(){yield r.cancel()})},pull(o){return D(this,void 0,void 0,function*(){yield a(o)})},start(o){return D(this,void 0,void 0,function*(){yield a(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,s),readable:n};function a(o){return D(this,void 0,void 0,function*(){let l=null,c=o.desiredSize;for(;l=yield r.read(c||null);)if(o.enqueue(l),c!=null&&(c-=l.byteLength)<=0)return;o.close()})}}function aa(s,e="stream"){return(e==="stream"?Yr:Kr).writeAll(s).toUint8Array(!0)}var gd=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Da),to),$a),Ma),Aa),za),xa),{compareSchemas:$r,compareFields:Jl,compareTypes:ec});Ie.toDOMStream=wc;ge.throughDOM=Fc;ke.throughDOM=ia;Tr.throughDOM=ia;Nt.throughDOM=ia;Qr.throughDOM=sa;Kr.throughDOM=sa;Yr.throughDOM=sa;function xn(s){switch(s.typeId){case f.Binary:return{sqlType:"binary"};case f.Bool:return{sqlType:"bool"};case f.Date:return{sqlType:"date"};case f.DateDay:return{sqlType:"date32[d]"};case f.DateMillisecond:return{sqlType:"date64[ms]"};case f.Decimal:{let e=s;return{sqlType:"decimal",precision:e.precision,scale:e.scale}}case f.Float:return{sqlType:"float"};case f.Float16:return{sqlType:"float16"};case f.Float32:return{sqlType:"float32"};case f.Float64:return{sqlType:"float64"};case f.Int:return{sqlType:"int32"};case f.Int16:return{sqlType:"int16"};case f.Int32:return{sqlType:"int32"};case f.Int64:return{sqlType:"int64"};case f.Uint16:return{sqlType:"uint16"};case f.Uint32:return{sqlType:"uint32"};case f.Uint64:return{sqlType:"uint64"};case f.Uint8:return{sqlType:"uint8"};case f.IntervalDayTime:return{sqlType:"interval[dt]"};case f.IntervalYearMonth:return{sqlType:"interval[m]"};case f.List:return{sqlType:"list",valueType:xn(s.valueType)};case f.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:s.byteWidth};case f.Null:return{sqlType:"null"};case f.Utf8:return{sqlType:"utf8"};case f.Struct:return{sqlType:"struct",fields:s.children.map(t=>oa(t.name,t.type))};case f.Map:{let e=s;return{sqlType:"map",keyType:xn(e.keyType),valueType:xn(e.valueType)}}case f.Time:return{sqlType:"time[s]"};case f.TimeMicrosecond:return{sqlType:"time[us]"};case f.TimeMillisecond:return{sqlType:"time[ms]"};case f.TimeNanosecond:return{sqlType:"time[ns]"};case f.TimeSecond:return{sqlType:"time[s]"};case f.Timestamp:return{sqlType:"timestamp",timezone:s.timezone||void 0};case f.TimestampSecond:return{sqlType:"timestamp[s]",timezone:s.timezone||void 0};case f.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:s.timezone||void 0};case f.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:s.timezone||void 0};case f.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:s.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(s.toString()))}function oa(s,e){let t=xn(e);return t.name=s,t}var 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=ke.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new Oe(r)}async send(e,t=!1){let r=this._bindings.startPendingQuery(this._conn,e,t);for(;r==null;)r=await new Promise((o,l)=>{try{o(this._bindings.pollPendingQuery(this._conn))}catch(c){console.log(c),c.message.includes("worker is not set!")?l(new Error("Worker has been terminated")):l(c)}});let n=new ca(this._bindings,this._conn,r),a=ke.from(n);return console.assert(a.isSync()),console.assert(a.isStream()),a}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 vo(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)}},ca=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=null;do e=this.bindings.fetchQueryResults(this.conn);while(e==null);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},vo=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=ke.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new Oe(r)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),r=new ca(this.bindings,this.connectionId,t),n=ke.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}};function Lc(s){return s<=255}function Tc(s){return s===256}var Mc=new TextEncoder,Ic=new TextDecoder("utf-8");function So(s,e,t){let r=Mc.encode(t),n=s._malloc(r.byteLength),a=s.HEAPU8.subarray(n,n+r.byteLength);a.set(r),s.HEAPF64[(e>>3)+0]=1,s.HEAPF64[(e>>3)+1]=n,s.HEAPF64[(e>>3)+2]=a.byteLength}function Ao(s){switch(s){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 wo(s,e,t,r){let n=s.HEAPU8.subarray(e,e+r*Ao(t));switch(t){case"UINT8":return new Uint8Array(n.buffer,n.byteOffset,r);case"INT8":return new Int8Array(n.buffer,n.byteOffset,r);case"INT32":return new Int32Array(n.buffer,n.byteOffset,r);case"FLOAT":return new Float32Array(n.buffer,n.byteOffset,r);case"DOUBLE":return new Float64Array(n.buffer,n.byteOffset,r);case"VARCHAR":return new Float64Array(n.buffer,n.byteOffset,r);default:return new Array(0)}}function Dc(s,e,t){let r=s.HEAPU8.subarray(e,e+t);return new Uint8Array(r.buffer,r.byteOffset,t)}function ua(s,e,t){let r=s.HEAPU8.subarray(e,e+t*8);return new Float64Array(r.buffer,r.byteOffset,t)}function kc(s,e,t,r,n,a,o,l){try{let c=s._udfFunctions.get(r);if(!c){So(e,t,"Unknown UDF with id: "+r);return}let u=Ic.decode(e.HEAPU8.subarray(n,n+a)),_=JSON.parse(u),d=ua(e,o,l/8),m=y=>{var b;let E=null;switch(y.validityBuffer!==void 0&&(E=Dc(e,d[y.validityBuffer],_.rows)),y.physicalType){case"VARCHAR":{if(y.dataBuffer===null||y.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(y.lengthBuffer===null||y.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let T=wo(e,d[y.dataBuffer],y.physicalType,_.rows),v=[],I=ua(e,d[y.lengthBuffer],_.rows);for(let O=0;O<_.rows;++O){if(E!=null&&!E[O]){v.push(null);continue}let ie=e.HEAPU8.subarray(T[O],T[O]+I[O]),we=Ic.decode(ie);v.push(we)}return O=>v[O]}case"STRUCT":{let T={},v=[];for(let I=0;I<(((b=y.children)==null?void 0:b.length)||0);++I){let O=y.children[I],ie=m(O);v.push(we=>{T[O.name]=ie(we)})}return E!=null?I=>{if(!E[I])return null;for(let O of v)O(I);return T}:I=>{for(let O of v)O(I);return T}}default:{if(y.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+y.physicalType);let T=wo(e,d[y.dataBuffer],y.physicalType,_.rows);return E!=null?v=>E[v]?T[v]:null:v=>T[v]}}},p=[];for(let y=0;y<_.args.length;++y)p.push(m(_.args[y]));let h=_.rows*Ao(_.ret.physicalType),S=e._malloc(h),w=wo(e,S,_.ret.physicalType,_.rows),L=e._malloc(_.rows),P=Dc(e,L,_.rows);if(w.length==0||P.length==0){So(e,t,"Can't create physical arrays for result");return}let k=w;_.ret.physicalType=="VARCHAR"&&(k=new Array(_.rows));let C=[];for(let y=0;y<_.args.length;++y)C.push(null);for(let y=0;y<_.rows;++y){for(let b=0;b<_.args.length;++b)C[b]=p[b](y);let E=c.func(...C);k[y]=E,P[y]=E==null?0:1}let x=0;switch(_.ret.physicalType){case"VARCHAR":{let y=new Array(0);x=e._malloc(_.rows*Ao("DOUBLE"));let E=ua(e,x,_.rows),b=0;for(let O=0;O<_.rows;++O){let ie=Mc.encode(k[O]||"");y.push(ie),E[O]=ie.length,b+=ie.length}let T=e._malloc(b),v=e.HEAPU8.subarray(T,T+b),I=0;for(let O=0;O<_.rows;++O){w[O]=I;let ie=y[O];v.subarray(I,I+ie.length).set(ie),I+=ie.length}}}let g=3*8,A=e._malloc(g),F=ua(e,A,3);F[0]=S,F[1]=L,F[2]=x,e.HEAPF64[(t>>3)+0]=0,e.HEAPF64[(t>>3)+1]=A,e.HEAPF64[(t>>3)+2]=0}catch(c){So(e,t,c.toString())}}function bd(){let s=new TextDecoder;return e=>(typeof SharedArrayBuffer<"u"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),s.decode(e))}var vd=bd();function et(s,e){console.error("FAIL WITH: ".concat(e)),s.ccall("duckdb_web_fail_with",null,["string"],[e])}function Xr(s,e,t){let r=s.HEAPU8.subarray(e,e+t),n=new Uint8Array(new ArrayBuffer(r.byteLength));return n.set(r),n}function X(s,e,t){return vd(s.HEAPU8.subarray(e,e+t))}function ue(s,e,t,r){let n=s.stackSave(),a=s.stackAlloc(3*8);t.unshift("number"),r.unshift(a),s.ccall(e,null,t,r);let o=s.HEAPF64[(a>>3)+0],l=s.HEAPF64[(a>>3)+1],c=s.HEAPF64[(a>>3)+2];return s.stackRestore(n),[o,l,c]}function pe(s){s.ccall("duckdb_web_clear_response",null,[],[])}var _a=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}};var Ln=new TextEncoder;var da=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]=ue(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==0)throw new Error(X(this.mod,r,n));pe(this.mod)}reset(){let[e,t,r]=ue(this.mod,"duckdb_web_reset",[],[]);if(e!==0)throw new Error(X(this.mod,t,r));pe(this.mod)}getVersion(){let[e,t,r]=ue(this.mod,"duckdb_web_get_version",[],[]);if(e!==0)throw new Error(X(this.mod,t,r));let n=X(this.mod,t,r);return pe(this.mod),n}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let t=Ln.encode(e),r=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(r,r+t.length).set(t);let[a,o,l]=ue(this.mod,"duckdb_web_tokenize_buffer",["number","number"],[r,t.length]);if(this.mod._free(r),a!==0)throw new Error(X(this.mod,o,l));let c=X(this.mod,o,l);return pe(this.mod),JSON.parse(c)}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=Ln.encode(t),n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[o,l,c]=ue(this.mod,"duckdb_web_query_run_buffer",["number","number","number"],[e,n,r.length]);if(this.mod._free(n),o!==0)throw new Error(X(this.mod,l,c));let u=Xr(this.mod,l,c);return pe(this.mod),u}startPendingQuery(e,t,r=!1){let n=Ln.encode(t),a=this.mod._malloc(n.length);this.mod.HEAPU8.subarray(a,a+n.length).set(n);let[l,c,u]=ue(this.mod,"duckdb_web_pending_query_start_buffer",["number","number","number","boolean"],[e,a,n.length,r]);if(this.mod._free(a),l!==0)throw new Error(X(this.mod,c,u));if(c==0)return null;let _=Xr(this.mod,c,u);return pe(this.mod),_}pollPendingQuery(e){let[t,r,n]=ue(this.mod,"duckdb_web_pending_query_poll",["number"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));if(r==0)return null;let a=Xr(this.mod,r,n);return pe(this.mod),a}cancelPendingQuery(e){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[e])}fetchQueryResults(e){let[t,r,n]=ue(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(Tc(t))return pe(this.mod),null;if(!Lc(t))throw new Error("Unexpected StatusCode from duckdb_web_query_fetch_results ("+t+") and with self reported error as"+X(this.mod,r,n));if(t!==0)throw new Error(X(this.mod,r,n));let a=Xr(this.mod,r,n);return pe(this.mod),a}getTableNames(e,t){let r=Ln.encode(t),n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[o,l,c]=ue(this.mod,"duckdb_web_get_tablenames_buffer",["number","number","number"],[e,n,r.length]);if(this.mod._free(n),o!==0)throw new Error(X(this.mod,l,c));let u=X(this.mod,l,c);return pe(this.mod),JSON.parse(u)}createScalarFunction(e,t,r,n){let a={functionId:this._nextUDFId,name:t,returnType:xn(r)},o={functionId:a.functionId,connectionId:e,name:t,returnType:r,func:n};this._nextUDFId+=1;let[l,c,u]=ue(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[e,JSON.stringify(a)]);if(l!==0)throw new Error(X(this.mod,c,u));if(pe(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(o.functionId,o),this.pthread)for(let _ of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])_.postMessage({cmd:"registerUDFFunction",udf:o})}createPrepared(e,t){let r=Ln.encode(t),n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[o,l,c]=ue(this.mod,"duckdb_web_prepared_create_buffer",["number","number","number"],[e,n,r.length]);if(this.mod._free(n),o!==0)throw new Error(X(this.mod,l,c));return pe(this.mod),l}closePrepared(e,t){let[r,n,a]=ue(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(r!==0)throw new Error(X(this.mod,n,a));pe(this.mod)}runPrepared(e,t,r){let[n,a,o]=ue(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(X(this.mod,a,o));let l=Xr(this.mod,a,o);return pe(this.mod),l}sendPrepared(e,t,r){let[n,a,o]=ue(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(X(this.mod,a,o));let l=Xr(this.mod,a,o);return pe(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 o=r?JSON.stringify(r):"",[l,c,u]=ue(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,n,t.length,o]);if(l!==0)throw new Error(X(this.mod,c,u))}insertCSVFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let u in r.columns)r.columnsFlat.push(oa(u,r.columns[u]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[o,l,c]=ue(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,a]);if(o!==0)throw new Error(X(this.mod,l,c))}insertJSONFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let u in r.columns)r.columnsFlat.push(oa(u,r.columns[u]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[o,l,c]=ue(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,a]);if(o!==0)throw new Error(X(this.mod,l,c))}globFiles(e){let[t,r,n]=ue(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));let a=X(this.mod,r,n);pe(this.mod);let o=JSON.parse(a);return o==null?[]:o}registerFileURL(e,t,r,n=!1){t===void 0&&(t=e);let[a,o,l]=ue(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t,r,n]);if(a!==0)throw new Error(X(this.mod,o,l));pe(this.mod)}registerFileText(e,t){let r=Ln.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[a,o,l]=ue(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,r,t.length]);if(a!==0)throw new Error(X(this.mod,o,l));pe(this.mod)}async prepareFileHandle(e,t){if(t===3&&this._runtime.prepareFileHandles){let r=await this._runtime.prepareFileHandles([e],3);for(let n of r){let{handle:a,path:o,fromCached:l}=n;!l&&a.getSize()&&await this.registerFileHandleAsync(o,a,3,!0)}return}throw new Error("prepareFileHandle: unsupported protocol ".concat(t))}async prepareDBFileHandle(e,t){if(t===3&&this._runtime.prepareDBFileHandle){let r=await this._runtime.prepareDBFileHandle(e,3);for(let n of r){let{handle:a,path:o,fromCached:l}=n;!l&&a.getSize()&&await this.registerFileHandleAsync(o,a,3,!0)}return}throw new Error("prepareDBFileHandle: unsupported protocol ".concat(t))}async prepareFileHandleAsync(e,t,r,n){if(r===3&&!(t instanceof FileSystemSyncAccessHandle)){if(t instanceof FileSystemFileHandle){let a=t;try{t=await a.createSyncAccessHandle()}catch(o){throw new Error(o.message+":"+e)}}else if(e!=null)try{t=await(await(await navigator.storage.getDirectory()).getFileHandle(e)).createSyncAccessHandle()}catch(a){throw new Error(a.message+":"+e)}}return t}async registerFileHandleAsync(e,t,r,n){let a=await this.prepareFileHandleAsync(e,t,r,n);this.registerFileHandle(e,a,r,n)}registerFileHandle(e,t,r,n){var c;let[a,o,l]=ue(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[e,e,r,n]);if(a!==0)throw new Error(X(this.mod,o,l));if(pe(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),(c=globalThis.DUCKDB_RUNTIME._preparedHandles)!=null&&c[e]&&delete globalThis.DUCKDB_RUNTIME._preparedHandles[e],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]=ue(this.mod,"duckdb_web_fs_drop_file",["string"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));pe(this.mod)}dropFiles(){let[e,t,r]=ue(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==0)throw new Error(X(this.mod,t,r));pe(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[r,n,a]=ue(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(r!==0)throw new Error(X(this.mod,n,a));pe(this.mod)}copyFileToBuffer(e){let[t,r,n]=ue(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));let a=this.mod.HEAPU8.subarray(r,r+n),o=new Uint8Array(a.length);return o.set(a),pe(this.mod),o}registerOPFSFileName(e){if(e.startsWith("opfs://"))return this.prepareFileHandle(e,3);throw new Error("Not an OPFS file name: "+e)}collectFileStatistics(e,t){let[r,n,a]=ue(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(r!==0)throw new Error(X(this.mod,n,a))}exportFileStatistics(e){let[t,r,n]=ue(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));return new _a(this.mod.HEAPU8.subarray(r,r+n))}};var fa=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;default:break}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":{let t=e.data.path;t!=null&&t.startsWith("opfs://")&&(await this._bindings.prepareDBFileHandle(t,3),e.data.useDirectIO=!0),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],e.data[2]),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),r=t?[t.buffer]:[];this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_CHUNK",data:t},r);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":await this._bindings.registerFileHandleAsync(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"REGISTER_OPFS_FILE_NAME":this._bindings.registerOPFSFileName(e.data[0]),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)}}};var Uc=Bo(Cc());var pa=class extends da{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 a=(async()=>{var h;let o=new Request(this.mainModuleURL),l=await fetch(o),c=l.headers.get("content-length"),u=c&&parseInt(c,10)||0,_=new Date,d={startedAt:_,updatedAt:_,bytesTotal:u||0,bytesLoaded:0},m={transform(S,w){d.bytesLoaded+=S.byteLength;let L=new Date;if(L.getTime()-d.updatedAt.getTime()<20){d.updatedAt=L,w.enqueue(S);return}for(let P of r)P(d);w.enqueue(S)}},p=new TransformStream(m);return new Response((h=l.body)==null?void 0:h.pipeThrough(p),l)})();WebAssembly.instantiateStreaming(a,e).then(o=>{t(o.instance,o.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=c=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+c}),new Error(c.toString())},n.onprogress=c=>{l.bytesTotal=c.total,l.bytesLoaded=c.loaded;let u=new Date;if(u.getTime()-l.updatedAt.getTime()<20){l.updatedAt=u;return}for(let _ of r)_(l)},n.onload=()=>{WebAssembly.instantiate(n.response,e).then(c=>{t(c.instance,c.module)}).catch(c=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+c}),new Error(c)})},n.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let a=new Request(this.mainModuleURL),l=await(await fetch(a)).arrayBuffer();WebAssembly.instantiate(l,e).then(c=>{t(c.instance,c.module)})})();return[]}};var ma=class extends pa{constructor(e,t,r,n=null){super(e,t,r,n)}instantiateImpl(e){return(0,Uc.default)({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var Ir=Bo(Rc()),Gc=function(s,e,t){var r;if((r=s==null?void 0:s.endpoint)!=null&&r.startsWith("http")){let n="".concat(s==null?void 0:s.endpoint),a=n.indexOf("://")+3;return n.substring(a)}else return s!=null&&s.endpoint?"".concat(t,".").concat(s==null?void 0:s.endpoint):"".concat(t,".s3.amazonaws.com")};function wd(s,e,t){var a,o,l,c;let r=Hc(e),n=r.path;return Vc(s)&&(n="/".concat(r.bucket).concat(n)),{url:n,query:"",host:Gc(s,e,r.bucket),region:(a=s==null?void 0:s.region)!=null?a:"",service:"s3",method:t,accessKeyId:(o=s==null?void 0:s.accessKeyId)!=null?o:"",secretAccessKey:(l=s==null?void 0:s.secretAccessKey)!=null?l:"",sessionToken:(c=s==null?void 0:s.sessionToken)!=null?c:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function Ad(s,e=!1){let t="0123456789ABCDEF",r="";for(let n=0;n<s.length;n++){let a=s[n];a>="A"&&a<="Z"||a>="a"&&a<="z"||a>="0"&&a<="9"||a=="_"||a=="-"||a=="~"||a=="."?r+=a:a=="/"?e?r+="%2F":r+=a:(r+="%",r+=t[a.charCodeAt(0)>>4],r+=t[a.charCodeAt(0)&15])}return r}function Ed(s,e=null){var h;let t=(h=e==null?void 0:e.contentHash)!=null?h:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=new Map;r.set("x-amz-date",s.datetimeNow),r.set("x-amz-content-sha256",t),s.sessionToken&&r.set("x-amz-security-token",s.sessionToken);let n="";e!=null&&e.contentType&&(n+="content-type;"),n+="host;x-amz-content-sha256;x-amz-date",s.sessionToken&&(n+=";x-amz-security-token");let a=s.method+"\n"+Ad(s.url)+"\n"+s.query;e!=null&&e.contentType&&(a+="\ncontent-type:"+(e==null?void 0:e.contentType)),a+="\nhost:"+s.host+"\nx-amz-content-sha256:"+t+"\nx-amz-date:"+s.datetimeNow,s.sessionToken&&s.sessionToken.length>0&&(a+="\nx-amz-security-token:"+s.sessionToken),a+="\n\n"+n+"\n"+t;let o=(0,Ir.sha256)(a),l="AWS4-HMAC-SHA256\n"+s.datetimeNow+"\n"+s.dateNow+"/"+s.region+"/"+s.service+"/aws4_request\n"+o,c="AWS4"+s.secretAccessKey,u=Ir.sha256.hmac.arrayBuffer(c,s.dateNow),_=Ir.sha256.hmac.arrayBuffer(u,s.region),d=Ir.sha256.hmac.arrayBuffer(_,s.service),m=Ir.sha256.hmac.arrayBuffer(d,"aws4_request"),p=Ir.sha256.hmac(m,l);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+s.accessKeyId+"/"+s.dateNow+"/"+s.region+"/"+s.service+"/aws4_request, SignedHeaders="+n+", Signature="+p),r}var Fd=function(s,e,t,r=null,n=null){let a=wd(s,e,t),o={contentType:r,contentHash:n?Ir.sha256.hex(n):null};return Ed(a,o)};function Ft(s,e,t,r,n=null,a=null){(e!=null&&e.accessKeyId||e!=null&&e.sessionToken)&&(Fd(e,t,r,n,a).forEach((l,c)=>{s.setRequestHeader(c,l)}),n&&s.setRequestHeader("content-type",n))}function Hc(s){if(s.indexOf("s3://")!=0)throw new Error("URL needs to start with s3://");let e=s.indexOf("/",5);if(e==-1)throw new Error("URL needs to contain a '/' after the host");let t=s.substring(5,e);if(!t)throw new Error("URL needs to contain a bucket name");let r=s.substring(e);if(!r)throw new Error("URL needs to contain key");return{bucket:t,path:r}}function Vc(s){var e;return!!((e=s==null?void 0:s.endpoint)!=null&&e.startsWith("http"))}function xt(s,e){let t=Hc(e);return Vc(s)?"".concat(s==null?void 0:s.endpoint,"/").concat(t.bucket)+t.path:"https://"+Gc(s,e,t.bucket)+t.path}var xd=7,jc=/\/|\\/,q={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,_preparedHandles:{},_opfsRoot:null,getFileInfo(s,e){try{let t=q._fileInfoCache.get(e),[r,n,a]=ue(s,"duckdb_web_fs_get_file_info_by_id",["number","number"],[e,(t==null?void 0:t.cacheEpoch)||0]);if(r!==0)return null;if(a===0)return t;let o=X(s,n,a);pe(s);try{let l=JSON.parse(o);if(l==null)return null;let c={...l,blob:null};return q._fileInfoCache.set(e,c),!q._files.has(c.fileName)&&q._preparedHandles[c.fileName]&&(q._files.set(c.fileName,q._preparedHandles[c.fileName]),delete q._preparedHandles[c.fileName]),c}catch(l){return console.warn(l),null}}catch(t){return console.log(t),null}},getGlobalFileInfo(s){var e;try{let[t,r,n]=ue(s,"duckdb_web_get_global_file_info",["number"],[((e=q._globalFileInfo)==null?void 0:e.cacheEpoch)||0]);if(t!==0)return null;if(n===0)return q._globalFileInfo;let a=X(s,r,n);pe(s);let o=JSON.parse(a);return o==null?null:(q._globalFileInfo={...o,blob:null},q._globalFileInfo)}catch(t){return console.log(t),null}},async assignOPFSRoot(){q._opfsRoot||(q._opfsRoot=await navigator.storage.getDirectory())},async prepareFileHandles(s,e){if(e===3){await q.assignOPFSRoot();let t=async n=>{if(q._files.has(n))return{path:n,handle:q._files.get(n),fromCached:!0};let o=q._opfsRoot,l=n.slice(xd),c=l;if(jc.test(l)){let _=l.split(jc);if(c=_.pop(),!c)throw new Error("Invalid path ".concat(n));for(let d of _)o=await o.getDirectoryHandle(d,{create:!0})}let u=await o.getFileHandle(c,{create:!1}).catch(_=>{if((_==null?void 0:_.name)==="NotFoundError")return console.debug("File ".concat(n," does not exists yet, creating...")),o.getFileHandle(c,{create:!0});throw _});try{let _=await u.createSyncAccessHandle();return q._preparedHandles[n]=_,{path:n,handle:_,fromCached:!1}}catch(_){throw new Error(_.message+":"+name)}},r=[];for(let n of s){let a=await t(n);r.push(a)}return r}throw new Error("Unsupported protocol ".concat(e," for paths ").concat(s," with protocol ").concat(e))},async prepareDBFileHandle(s,e){if(e===3&&this.prepareFileHandles){let t=[s,"".concat(s,".wal")];return this.prepareFileHandles(t,e)}throw new Error("Unsupported protocol ".concat(e," for path ").concat(s," with protocol ").concat(e))},testPlatformFeature:(s,e)=>{switch(e){case 1:return typeof BigInt64Array<"u";default:return console.warn("test for unknown feature: ".concat(e)),!1}},getDefaultDataProtocol(s){return 2},openFile:(s,e,t)=>{var r,n,a;try{q._fileInfoCache.delete(e);let o=q.getFileInfo(s,e);switch(o==null?void 0:o.dataProtocol){case 4:case 5:{if(t&1&&t&2)throw new Error("Opening file ".concat(o.fileName," failed: cannot open file with both read and write flags set"));if(t&32)throw new Error("Opening file ".concat(o.fileName," failed: appending to HTTP/S3 files is not supported"));if(t&2){let u=new XMLHttpRequest;if(o.dataProtocol==5?(u.open("HEAD",xt(o.s3Config,o.dataUrl),!1),Ft(u,o.s3Config,o.dataUrl,"HEAD")):u.open("HEAD",o.dataUrl,!1),u.send(null),u.status!=200&&u.status!=404)throw new Error("Opening file ".concat(o.fileName," failed: Unexpected return status from server (").concat(u.status,")"));if(u.status==404&&!(t&8||t&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 _=s._malloc(1),d=new Uint8Array;s.HEAPU8.set(d,_);let m=s._malloc(2*8);return s.HEAPF64[(m>>3)+0]=1,s.HEAPF64[(m>>3)+1]=_,m}else if(!(t&1))throw new Error("Opening file ".concat(o.fileName," failed: unsupported file flags: ").concat(t));let l=null,c=null;if(o.reliableHeadRequests||!o.allowFullHttpReads)try{let u=new XMLHttpRequest;if(o.dataProtocol==5?(u.open("HEAD",xt(o.s3Config,o.dataUrl),!1),Ft(u,o.s3Config,o.dataUrl,"HEAD")):u.open("HEAD",o.dataUrl,!1),u.setRequestHeader("Range","bytes=0-"),u.send(null),l=u.getResponseHeader("Content-Length"),l!==null&&u.status==206){let _=s._malloc(16);return s.HEAPF64[(_>>3)+0]=+l,s.HEAPF64[(_>>3)+1]=0,_}}catch(u){c=u,console.warn("HEAD request with range header failed: ".concat(u))}if(o.allowFullHttpReads){{let _=new XMLHttpRequest;o.dataProtocol==5?(_.open("GET",xt(o.s3Config,o.dataUrl),!1),Ft(_,o.s3Config,o.dataUrl,"GET")):_.open("GET",o.dataUrl,!1),_.responseType="arraybuffer",_.setRequestHeader("Range","bytes=0-0"),_.send(null);let d=(r=_.getResponseHeader("Content-Range"))==null?void 0:r.split("/")[1],m=_.getResponseHeader("Content-Length"),p=null;if(d!==void 0)p=d;else if(!o.reliableHeadRequests){let h=new XMLHttpRequest;o.dataProtocol==5?(h.open("HEAD",xt(o.s3Config,o.dataUrl),!1),Ft(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&&(p=l)}if(_.status==206&&m!==null&&+m==1&&p!==null){let h=s._malloc(16);return s.HEAPF64[(h>>3)+0]=+p,s.HEAPF64[(h>>3)+1]=0,h}if(_.status==200&&m!==null&&l!==null&&+m==+l){console.warn("fall back to full HTTP read for: ".concat(o.dataUrl));let h=s._malloc(_.response.byteLength),S=new Uint8Array(_.response,0,_.response.byteLength);s.HEAPU8.set(S,h);let w=s._malloc(2*8);return s.HEAPF64[(w>>3)+0]=_.response.byteLength,s.HEAPF64[(w>>3)+1]=h,w}}console.warn("falling back to full HTTP read for: ".concat(o.dataUrl));let u=new XMLHttpRequest;if(o.dataProtocol==5?(u.open("GET",xt(o.s3Config,o.dataUrl),!1),Ft(u,o.s3Config,o.dataUrl,"GET")):u.open("GET",o.dataUrl,!1),u.responseType="arraybuffer",u.send(null),u.status==200){let _=s._malloc(u.response.byteLength),d=new Uint8Array(u.response,0,u.response.byteLength);s.HEAPU8.set(d,_);let m=s._malloc(2*8);return s.HEAPF64[(m>>3)+0]=u.response.byteLength,s.HEAPF64[(m>>3)+1]=_,m}}if(c!=null)throw new Error("Reading file ".concat(o.fileName," failed with error: ").concat(c));return 0}case 2:{let l=(n=q._files)==null?void 0:n.get(o.fileName);if(l){let _=s._malloc(16);return s.HEAPF64[(_>>3)+0]=l.size,s.HEAPF64[(_>>3)+1]=0,_}console.warn("Buffering missing file: ".concat(o.fileName));let c=s._malloc(2*8),u=s._malloc(1);return s.HEAPF64[(c>>3)+0]=1,s.HEAPF64[(c>>3)+1]=u,c}case 3:{let l=(a=q._files)==null?void 0:a.get(o.fileName);if(!l)throw new Error("No OPFS access handle registered with name: ".concat(o.fileName));t&16&&l.truncate(0);let c=s._malloc(2*8),u=l.getSize();return s.HEAPF64[(c>>3)+0]=u,s.HEAPF64[(c>>3)+1]=0,c}}}catch(o){console.error(o.toString()),et(s,o.toString())}return 0},glob:(s,e,t)=>{var r;try{let n=X(s,e,t);if(n.startsWith("http")||n.startsWith("s3://")){let a=new XMLHttpRequest;if(n.startsWith("s3://")){let o=q.getGlobalFileInfo(s);a.open("HEAD",xt(o==null?void 0:o.s3Config,n),!1),Ft(a,o==null?void 0:o.s3Config,n,"HEAD")}else a.open("HEAD",n,!1);if(a.send(null),a.status!=200&&a.status!==206){if(!((r=q.getGlobalFileInfo(s))!=null&&r.allowFullHttpReads))return et(s,"HEAD request failed: ".concat(n,", with full http reads are disabled")),0;let o=new XMLHttpRequest;if(n.startsWith("s3://")){let c=q.getGlobalFileInfo(s);o.open("GET",xt(c==null?void 0:c.s3Config,n),!1),Ft(o,c==null?void 0:c.s3Config,n,"HEAD")}else o.open("GET",n,!1);if(o.setRequestHeader("Range","bytes=0-0"),o.send(null),o.status!=200&&o.status!==206)return et(s,"HEAD and GET requests failed: ".concat(n)),0;let l=o.getResponseHeader("Content-Length");l&&+l>1&&console.warn("Range request for ".concat(n," did not return a partial response: ").concat(o.status,' "').concat(o.statusText,'"'))}s.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}else for(let[a]of q._files.entries()||[])a.startsWith(n)&&s.ccall("duckdb_web_fs_glob_add_path",null,["string"],[a])}catch(n){return console.log(n),et(s,n.toString()),0}},checkFile:(s,e,t)=>{try{let r=X(s,e,t);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let a=q.getGlobalFileInfo(s);n.open("HEAD",xt(a==null?void 0:a.s3Config,r),!1),Ft(n,a==null?void 0:a.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);return n.send(null),n.status==206||n.status==200}else return q._files.has(r)}catch(r){return console.log(r),!1}return!1},syncFile:(s,e)=>{},closeFile:(s,e)=>{var r;let t=q.getFileInfo(s,e);q._fileInfoCache.delete(e);try{switch(t==null?void 0:t.dataProtocol){case 0:case 4:case 5:break;case 1:case 2:return;case 3:{let n=(r=q._files)==null?void 0:r.get(t.fileName);if(!n)throw new Error("No OPFS access handle registered with name: ".concat(t.fileName));return n.flush()}}}catch(n){console.log(n),et(s,n.toString())}},dropFile:(s,e,t)=>{var a;let r=X(s,e,t),n=(a=q._files)==null?void 0:a.get(r);if(n){if(q._files.delete(r),n instanceof FileSystemSyncAccessHandle)try{n.flush(),n.close()}catch(o){throw new Error("Cannot drop file with name: ".concat(r))}n instanceof Blob}},truncateFile:(s,e,t)=>{var n;let r=q.getFileInfo(s,e);switch(r==null?void 0:r.dataProtocol){case 4:et(s,"Cannot truncate a http file");return;case 5:et(s,"Cannot truncate an s3 file");return;case 0:case 1:case 2:et(s,"truncateFile not implemented");return;case 3:{let a=(n=q._files)==null?void 0:n.get(r.fileName);if(!a)throw new Error("No OPFS access handle registered with name: ".concat(r.fileName));return a.truncate(t)}}return 0},readFile(s,e,t,r,n){var a;if(r==0)return 0;try{let o=q.getFileInfo(s,e);switch(o==null?void 0:o.dataProtocol){case 4:case 5:{if(!o.dataUrl)throw new Error("Missing data URL for file ".concat(e));try{let l=new XMLHttpRequest;if(o.dataProtocol==5?(l.open("GET",xt(o==null?void 0:o.s3Config,o.dataUrl),!1),Ft(l,o==null?void 0:o.s3Config,o.dataUrl,"GET")):l.open("GET",o.dataUrl,!1),l.responseType="arraybuffer",l.setRequestHeader("Range","bytes=".concat(n,"-").concat(n+r-1)),l.send(null),l.status==206||l.status==200&&r==l.response.byteLength&&n==0){let c=new Uint8Array(l.response,0,Math.min(l.response.byteLength,r));return s.HEAPU8.set(c,t),c.byteLength}else if(l.status==200){console.warn("Range request for ".concat(o.dataUrl," did not return a partial response: ").concat(l.status,' "').concat(l.statusText,'"'));let c=new Uint8Array(l.response,n,Math.min(l.response.byteLength-n,r));return s.HEAPU8.set(c,t),c.byteLength}else throw new Error("Range request for ".concat(o.dataUrl," did returned non-success status: ").concat(l.status,' "').concat(l.statusText,'"'))}catch(l){throw console.log(l),new Error("Range request for ".concat(o.dataUrl," failed with error: ").concat(l,'"'))}}case 2:{let l=(a=q._files)==null?void 0:a.get(o.fileName);if(!l)throw new Error("No HTML5 file registered with name: ".concat(o.fileName));let c=l.slice(n,n+r),u=new Uint8Array(new FileReaderSync().readAsArrayBuffer(c));return s.HEAPU8.set(u,t),u.byteLength}case 3:{let l=q._files.get(o.fileName);if(!l)throw new Error("No OPFS access handle registered with name: ".concat(o.fileName));let c=s.HEAPU8.subarray(t,t+r);return l.read(c,{at:n})}}return 0}catch(o){return console.log(o),et(s,o.toString()),0}},writeFile:(s,e,t,r,n)=>{var o;let a=q.getFileInfo(s,e);switch(a==null?void 0:a.dataProtocol){case 4:return et(s,"Cannot write to HTTP file"),0;case 5:{let l=s.HEAPU8.subarray(t,t+r),c=new XMLHttpRequest;return c.open("PUT",xt(a==null?void 0:a.s3Config,a.dataUrl),!1),Ft(c,a==null?void 0:a.s3Config,a.dataUrl,"PUT","",l),c.send(l),c.status!==200?(et(s,"Failed writing file: HTTP "+c.status),0):r}case 2:return et(s,"cannot write using the html5 file reader api"),0;case 3:{let l=(o=q._files)==null?void 0:o.get(a.fileName);if(!l)throw new Error("No OPFS access handle registered with name: ".concat(a.fileName));let c=s.HEAPU8.subarray(t,t+r);return l.write(c,{at:n})}}return 0},getLastFileModificationTime:(s,e)=>{var r;let t=q.getFileInfo(s,e);switch(t==null?void 0:t.dataProtocol){case 2:{if(!((r=q._files)==null?void 0:r.get(t.fileName)))throw Error("No handle available for file: ".concat(t.fileName));return 0}case 4:case 5:return new Date().getTime()}return 0},progressUpdate:(s,e,t)=>{postMessage&&postMessage({requestId:0,type:"PROGRESS_UPDATE",data:{status:s?"completed":"in-progress",percentage:e,repetitions:t}})},checkDirectory:(s,e,t)=>{let r=X(s,e,t);return console.log("checkDirectory: ".concat(r)),!1},createDirectory:(s,e,t)=>{let r=X(s,e,t);console.log("createDirectory: ".concat(r))},removeDirectory:(s,e,t)=>{let r=X(s,e,t);console.log("removeDirectory: ".concat(r))},listDirectoryEntries:(s,e,t)=>{let r=X(s,e,t);return console.log("listDirectoryEntries: ".concat(r)),!1},moveFile:(s,e,t,r,n)=>{var c,u;let a=X(s,e,t),o=X(s,r,n),l=(c=q._files)==null?void 0:c.get(a);l!==void 0&&(q._files.delete(l),q._files.set(o,l));for(let[_,d]of((u=q._fileInfoCache)==null?void 0:u.entries())||[])if(d.dataUrl==a){q._fileInfoCache.delete(_);break}return!0},removeFile:(s,e,t)=>{},callScalarUDF:(s,e,t,r,n,a,o)=>{kc(q,s,e,t,r,n,a,o)}};var Lo=class extends fa{postMessage(e,t){globalThis.postMessage(e,t)}async instantiate(e,t,r){return await new ma(this,q,e,t).instantiate(r)}};function Wc(){let s=new Lo;globalThis.onmessage=async e=>{await s.onMessage(e.data)}}Wc();return Xc(Ld);})();
1
+ "use strict";var duckdb=(()=>{var zc=Object.create;var Tn=Object.defineProperty;var $c=Object.getOwnPropertyDescriptor;var qc=Object.getOwnPropertyNames;var Qc=Object.getPrototypeOf,Yc=Object.prototype.hasOwnProperty;var ga=(s,e)=>(e=Symbol[s])?e:Symbol.for("Symbol."+s);var Kc=(s,e,t)=>e in s?Tn(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Ti=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var dr=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),fr=(s,e)=>{for(var t in e)Tn(s,t,{get:e[t],enumerable:!0})},ko=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qc(e))!Yc.call(s,n)&&n!==t&&Tn(s,n,{get:()=>e[n],enumerable:!(r=$c(e,n))||r.enumerable});return s};var Bo=(s,e,t)=>(t=s!=null?zc(Qc(s)):{},ko(e||!s||!s.__esModule?Tn(t,"default",{value:s,enumerable:!0}):t,s)),Xc=s=>ko(Tn({},"__esModule",{value:!0}),s);var $e=(s,e,t)=>(Kc(s,typeof e!="symbol"?e+"":e,t),t);var Zc=function(s,e){this[0]=s,this[1]=e};var Mr=s=>{var e=s[ga("asyncIterator")],t=!1,r,n={};return e==null?(e=s[ga("iterator")](),r=a=>n[a]=o=>e[a](o)):(e=e.call(s),r=a=>n[a]=o=>{if(t){if(t=!1,a==="throw")throw o;return o}return t=!0,{done:!1,value:new Zc(new Promise(l=>{var c=e[a](o);if(!(c instanceof Object))throw TypeError("Object expected");l(c)}),1)}}),n[ga("iterator")]=()=>n,r("next"),"throw"in e?r("throw"):n.throw=a=>{throw a},"return"in e&&r("return"),n};var Eo=dr(()=>{});var Fo=dr(()=>{});var Bc=dr(()=>{});var xo=dr((xS,Pc)=>{"use strict";Pc.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var Cc=dr((exports,module)=>{"use strict";var DuckDB=(()=>{var s;var _scriptName=typeof document<"u"?(s=document.currentScript)==null?void 0:s.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 WorkerGlobalScope<"u",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=Eo(),nodePath=Fo();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,TTY.init(),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,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){var t;runDependencies++,(t=Module.monitorRunDependencies)==null||t.call(Module,runDependencies)}function removeRunDependency(e){var r;if(runDependencies--,(r=Module.monitorRunDependencies)==null||r.call(Module,runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){var r;(r=Module.onAbort)==null||r.call(Module,e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.",runtimeInitialized&&___trap();var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject(t),t}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function findWasmBinary(){var e="./duckdb-eh.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,"main"),LDSO.init(),loadDylibs(),wasmExports=applySignatureConversions(wasmExports),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}addRunDependency("wasm-instantiate");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={2259128:(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},2259494:(e,t)=>{var r=UTF8ToString(e);if(typeof XMLHttpRequest>"u"){let P=Bc(),k=Fo(),C=Eo();var n=r.split("/"),a=n.length,o=k.join(P.homedir(),".duckdb/extensions/"+n[a-4]+"/"+n[a-3]+"/"+n[a-2]+"/"),l=k.join(o,n[a-1]);try{if(C.existsSync(o)||C.mkdirSync(o,{recursive:!0}),C.existsSync(l))_=C.readFileSync(l);else{let x=new Int32Array(new SharedArrayBuffer(8));var c=Ti("node:worker_threads").Worker,u=new c("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}),_;x[0]=0,x[2]=4,u.postMessage(x),u.postMessage(r),Atomics.wait(x,0,0);let g=new Int32Array(new SharedArrayBuffer(x[1]+3-(x[1]+3)%4));u.postMessage(g),Atomics.wait(x,0,1);var d=new Uint8Array(g.buffer,0,x[1]);_=d,u.terminate(),C.writeFileSync(l,_)}}catch(x){return console.log("Error fetching module",x),0}}else{let P=new XMLHttpRequest;if(P.open("GET",r,!1),P.responseType="arraybuffer",P.send(null),P.status!=200)return 0;_=P.response}for(var m=WebAssembly.validate(_),p=_.byteLength,h=_malloc(p+4),S=new Uint8Array(_),w=0;w<p;w++)Module.HEAPU8[w+h+4]=S[w];var L=new Uint8Array(4);return L[0]=p%256,p-=L[0],p/=256,L[1]=p%256,p-=L[1],p/=256,L[2]=p%256,p-=L[2],p/=256,L[3]=p%256,p-=L[3],p/=256,Module.HEAPU8.set(L,h),FS.writeFile(UTF8ToString(t),new Uint8Array(_)),h},2262135:e=>{if(!e)return AL.alcErr=40964,1},2262183:e=>{if(!AL.currentCtx)return err("alGetProcAddress() called without a valid context"),1;if(!e)return AL.currentCtx.err=40963,1}};class ExitStatus{constructor(t){$e(this,"name","ExitStatus");this.message="Program terminated with exit(".concat(t,")"),this.status=t}}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=0,r=NaN)=>{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<a;){var l=e[t++];if(!(l&128)){o+=String.fromCharCode(l);continue}var c=e[t++]&63;if((l&224)==192){o+=String.fromCharCode((l&31)<<6|c);continue}var u=e[t++]&63;if((l&240)==224?l=(l&15)<<12|c<<6|u:l=(l&7)<<18|c<<12|u<<6|e[t++]&63,l<65536)o+=String.fromCharCode(l);else{var _=l-65536;o+=String.fromCharCode(55296|_>>10,56320|_&1023)}}return o},getDylinkMetadata=e=>{var t=0,r=0;function n(){return e[t++]}function a(){for(var I=0,O=1;;){var ie=e[t++];if(I+=(ie&127)*O,O*=128,!(ie&128))break}return I}function o(){var I=a();return t+=I,UTF8ArrayToString(e,t-I,I)}function l(I,O){if(I)throw new Error(O)}var c="dylink.0";if(e instanceof WebAssembly.Module){var u=WebAssembly.Module.customSections(e,c);u.length===0&&(c="dylink",u=WebAssembly.Module.customSections(e,c)),l(u.length===0,"need dylink section"),e=new Uint8Array(u[0]),r=e.length}else{var _=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),d=_[0]==1836278016;l(!d,"need to see wasm magic number"),l(e[8]!==0,"need the dylink section to be first"),t=9;var m=a();r=t+m,c=o()}var p={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(c=="dylink"){p.memorySize=a(),p.memoryAlign=a(),p.tableSize=a(),p.tableAlign=a();for(var h=a(),S=0;S<h;++S){var w=o();p.neededDynlibs.push(w)}}else{l(c!=="dylink.0");for(var L=1,P=2,k=3,C=4,x=256,g=3,A=1;t<r;){var F=n(),y=a();if(F===L)p.memorySize=a(),p.memoryAlign=a(),p.tableSize=a(),p.tableAlign=a();else if(F===P)for(var h=a(),S=0;S<h;++S)w=o(),p.neededDynlibs.push(w);else if(F===k)for(var E=a();E--;){var b=o(),T=a();T&x&&p.tlsExports.add(b)}else if(F===C)for(var E=a();E--;){var v=o(),b=o(),T=a();(T&g)==A&&p.weakImports.add(b)}else t+=y}}return p},newDSO=(e,t,r)=>{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=2397456,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<e.length;++n)r.parameters.push(t[e[n]]);return r},generateFuncType=(e,t)=>{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<n.length;++o)t.push(a[n[o]]);r=="v"?t.push(0):t.push(1,a[r])},convertJsFunctionToWasm=(e,t)=>{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:22915,element:"anyfunc"}),getWasmTableEntry=e=>wasmTable.get(e),updateTableMap=(e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r)}},functionsInTableMap,getFunctionAddress=e=>(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)},resolveGlobalSymbol=(e,t=!1)=>{var r;return t&&"orig$"+e in wasmImports&&(e="orig$"+e),isSymbolDefined(e)&&(r=wasmImports[e]),{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){if(t.startsWith("invoke_"))return createDyncallWrapper(t.substring(7));switch(t){case"__memory_base":return memoryBase;case"getTempRet0":return getTempRet0;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<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}}var func="(".concat(jsArgs,") => ").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))(o=>{isSymbolDefined(o)||(wasmImports[o]=n)})(r)},asyncLoad=(e,t,r,n)=>{var a=n?"":"al ".concat(e);readAsync(e).then(o=>{t(new Uint8Array(o)),a&&removeRunDependency(a)},o=>{if(r)r();else throw'Loading data file "'.concat(e,'" failed.')}),a&&addRunDependency(a)},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,e)):(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 u=HEAPU32[n+28>>>2>>>0],_=HEAPU32[n+32>>>2>>>0];if(u&&_){var d=HEAP8.slice(u,u+_);return t.loadAsync?Promise.resolve(d):d}}var m=locateFile(e);if(t.loadAsync)return new Promise((p,h)=>asyncLoad(m,p,h));if(!readBinary)throw new Error("".concat(m,": file not found, and synchronous loading of external files is not available"));return readBinary(m)}function l(){var u=preloadedWasm[e];return u?t.loadAsync?Promise.resolve(u):u:t.loadAsync?o().then(_=>loadWebAssemblyModule(_,t,e,r,n)):loadWebAssemblyModule(o(),t,e,r,n)}function c(u){a.global?mergeLibSymbols(u,e):r&&(Object.assign(r,u),registerDynCallSymbols(u)),a.exports=u}return t.loadAsync?l().then(u=>(c(u),!0)):(c(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("loadDylibs"),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},noExitRuntime=Module.noExitRuntime||!0,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";var ___c_longjmp=new WebAssembly.Tag({parameters:["i32"]});function ___call_sighandler(e,t){return e>>>=0,getWasmTableEntry(e)(t)}___call_sighandler.sig="vpi";var ___cpp_exception=new WebAssembly.Tag({parameters:["i32"]}),___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=2397456,___stack_low=2331920,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},2397456),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=Ti("crypto"),t=e.randomFillSync;if(t)return n=>e.randomFillSync(n);var r=e.randomBytes;return n=>(n.set(r(n.byteLength)),n)}catch(n){}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(_){for(var d=0;d<_.length&&_[d]==="";d++);for(var m=_.length-1;m>=0&&_[m]==="";m--);return d>m?[]:_.slice(d,m-d+1)}for(var n=r(e.split("/")),a=r(t.split("/")),o=Math.min(n.length,a.length),l=o,c=0;c<o;c++)if(n[c]!==a[c]){l=c;break}for(var u=[],c=l;c<n.length;c++)u.push("..");return u=u.concat(a.slice(l)),u.join("/")}},FS_stdin_getChar_buffer=[],lengthBytesUTF8=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=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<e.length;++l){var c=e.charCodeAt(l);if(c>=55296&&c<=57343){var u=e.charCodeAt(++l);c=65536+((c&1023)<<10)|u&1023}if(c<=127){if(r>=o)break;t[r++>>>0]=c}else if(c<=2047){if(r+1>=o)break;t[r++>>>0]=192|c>>6,t[r++>>>0]=128|c&63}else if(c<=65535){if(r+2>=o)break;t[r++>>>0]=224|c>>12,t[r++>>>0]=128|c>>6&63,t[r++>>>0]=128|c&63}else{if(r+3>=o)break;t[r++>>>0]=240|c>>18,t[r++>>>0]=128|c>>12&63,t[r++>>>0]=128|c>>6&63,t[r++>>>0]=128|c&63}}return t[r>>>0]=0,r-a};function intArrayFromString(e,t,r){var n=r>0?r: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+="\n"));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;l<n;l++){var c;try{c=e.tty.ops.get_char(e.tty)}catch(u){throw new FS.ErrnoError(29)}if(c===void 0&&o===0)throw new FS.ErrnoError(6);if(c==null)break;o++,t[r+l]=c}return o&&(e.node.timestamp=Date.now()),o},write(e,t,r,n,a){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(60);try{for(var o=0;o<n;o++)e.tty.ops.put_char(e.tty,t[r+o])}catch(l){throw new FS.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char(e){return FS_stdin_getChar()},put_char(e,t){t===null||t===10?(out(UTF8ArrayToString(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output)),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)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output)),e.output=[])}}},zeroMemory=(e,t)=>{HEAPU8.fill(0,e,e+t)},mmapAlloc=e=>{e=alignMemory(e,65536);var t=_emscripten_builtin_memalign(65536,e);return t&&zeroMemory(t,e),t},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=1024*1024;t=Math.max(t,r*(r<n?2:1.125)>>>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(o){}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 c=0;c<l;c++)t[r+c]=o[a+c];return l},write(e,t,r,n,a,o){if(t.buffer===HEAP8.buffer&&(o=!1),!n)return 0;var l=e.node;if(l.timestamp=Date.now(),t.subarray&&(!l.contents||l.contents.subarray)){if(o)return l.contents=t.subarray(r,r+n),l.usedBytes=n,n;if(l.usedBytes===0&&a===0)return l.contents=t.slice(r,r+n),l.usedBytes=n,n;if(a+n<=l.usedBytes)return l.contents.set(t.subarray(r,r+n),a),n}if(MEMFS.expandFileStorage(l,a+n),l.contents.subarray&&t.subarray)l.contents.set(t.subarray(r,r+n),a);else for(var c=0;c<n;c++)l.contents[a+c]=t[r+c];return l.usedBytes=Math.max(l.usedBytes,a+n),n},llseek(e,t,r){var n=t;if(r===1?n+=e.position:r===2&&FS.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new FS.ErrnoError(28);return n},allocate(e,t,r){MEMFS.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,a){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var o,l,c=e.node.contents;if(!(a&2)&&c&&c.buffer===HEAP8.buffer)l=!1,o=c.byteOffset;else{if(l=!0,o=mmapAlloc(t),!o)throw new FS.ErrnoError(48);c&&((r>0||r+t<c.length)&&(c.subarray?c=c.subarray(r,r+t):c=Array.prototype.slice.call(c,r,r+t)),HEAP8.set(c,o>>>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,c,u,_)=>{var d=t?PATH_FS.resolve(PATH.join2(e,t)):e,m="cp ".concat(d);function p(h){function S(w){_==null||_(),c||FS_createDataFile(e,t,w,n,a,u),o==null||o(),removeRunDependency(m)}FS_handledByPreloadPlugin(h,d,S,()=>{l==null||l(),removeRunDependency(m)})||S(h)}addRunDependency(m),typeof r=="string"?asyncLoad(r,p,l):p(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){$e(this,"name","ErrnoError");this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){$e(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(this,"node_ops",{});$e(this,"stream_ops",{});$e(this,"readMode",365);$e(this,"writeMode",146);$e(this,"mounted",null);e||(e=this),this.parent=e,this.mount=e.mount,this.id=FS.nextInode++,this.name=t,this.mode=r,this.rdev=n}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(m=>!!m),a=FS.root,o="/",l=0;l<n.length;l++){var c=l===n.length-1;if(c&&t.parent)break;if(a=FS.lookupNode(a,n[l]),o=PATH.join2(o,n[l]),FS.isMountpoint(a)&&(!c||c&&t.follow_mount)&&(a=a.mounted.root),!c||t.follow)for(var u=0;FS.isLink(a.mode);){var _=FS.readlink(o);o=PATH_FS.resolve(PATH.dirname(o),_);var d=FS.lookupPath(o,{recurse_count:t.recurse_count+1});if(a=d.node,u++>40)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<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>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(n){}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 n,a;var r=FS.createStream(e,t);return(a=(n=r.stream_ops)==null?void 0:n.dup)==null||a.call(n,r),r},chrdev_stream_ops:{open(e){var r,n;var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,(n=(r=e.stream_ops).open)==null||n.call(r,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 c={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(c);return u.mount=c,c.root=u,n?FS.root=u:o&&(o.mounted=c,o.mount&&o.mount.mounts.push(c)),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 c=FS.nameTable[l];c;){var u=c.name_next;a.includes(c.mount)&&FS.destroyNode(c),c=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<r.length;++a)if(r[a]){n+="/"+r[a];try{FS.mkdir(n,t)}catch(o){if(o.errno!=20)throw o}}},mkdev(e,t,r){return typeof r>"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,c,u;if(l=FS.lookupPath(e,{parent:!0}),c=l.node,l=FS.lookupPath(t,{parent:!0}),u=l.node,!c||!u)throw new FS.ErrnoError(44);if(c.mount!==u.mount)throw new FS.ErrnoError(75);var _=FS.lookupNode(c,a),d=PATH_FS.relative(e,n);if(d.charAt(0)!==".")throw new FS.ErrnoError(28);if(d=PATH_FS.relative(t,r),d.charAt(0)!==".")throw new FS.ErrnoError(55);var m;try{m=FS.lookupNode(u,o)}catch(S){}if(_!==m){var p=FS.isDir(_.mode),h=FS.mayDelete(c,a,p);if(h)throw new FS.ErrnoError(h);if(h=m?FS.mayDelete(u,o,p):FS.mayCreate(u,o),h)throw new FS.ErrnoError(h);if(!c.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(_)||m&&FS.isMountpoint(m))throw new FS.ErrnoError(10);if(u!==c&&(h=FS.nodePermissions(c,"w"),h))throw new FS.ErrnoError(h);FS.hashRemoveNode(_);try{c.node_ops.rename(_,u,o),_.parent=u}catch(S){throw S}finally{FS.hashAddNode(_)}}},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(u){}}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 c=FS.createStream({node:n,path:FS.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return c.stream_ops.open&&c.stream_ops.open(c),Module.logReadFiles&&!(t&1)&&(e in FS.readFiles||(FS.readFiles[e]=1)),c},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 c=e.stream_ops.write(e,t,r,n,a,o);return l||(e.position+=c),c},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):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,c)=>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");var n=FS.open("/dev/stdin",0),a=FS.open("/dev/stdout",1),o=FS.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack="<generic error, no 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,_fflush(0);for(var e=0;e<FS.streams.length;e++){var t=FS.streams[e];t&&FS.close(t)}},findObject(e,t){var r=FS.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{var r=FS.lookupPath(e,{follow:!t});e=r.path}catch(a){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=FS.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=PATH.basename(e),r=FS.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot=r.path==="/"}catch(a){n.error=a.errno}return n},createPath(e,t,r,n){e=typeof e=="string"?e:FS.getPath(e);for(var a=t.split("/").reverse();a.length;){var o=a.pop();if(o){var l=PATH.join2(e,o);try{FS.mkdir(l)}catch(c){}e=l}}return l},createFile(e,t,r,n,a){var o=PATH.join2(typeof e=="string"?e:FS.getPath(e),t),l=FS_getMode(n,a);return FS.create(o,l)},createDataFile(e,t,r,n,a,o){var l=t;e&&(e=typeof e=="string"?e:FS.getPath(e),l=t?PATH.join2(e,t):e);var c=FS_getMode(n,a),u=FS.create(l,c);if(r){if(typeof r=="string"){for(var _=new Array(r.length),d=0,m=r.length;d<m;++d)_[d]=r.charCodeAt(d);r=_}FS.chmod(u,c|146);var p=FS.open(u,577);FS.write(p,r,0,r.length,0,o),FS.close(p),FS.chmod(u,c)}},createDevice(e,t,r,n){var c,u;var a=PATH.join2(typeof e=="string"?e:FS.getPath(e),t),o=FS_getMode(!!r,!!n);(u=(c=FS.createDevice).major)!=null||(c.major=64);var l=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(l,{open(_){_.seekable=!1},close(_){var d;(d=n==null?void 0:n.buffer)!=null&&d.length&&n(10)},read(_,d,m,p,h){for(var S=0,w=0;w<p;w++){var L;try{L=r()}catch(P){throw new FS.ErrnoError(29)}if(L===void 0&&S===0)throw new FS.ErrnoError(6);if(L==null)break;S++,d[m+w]=L}return S&&(_.node.timestamp=Date.now()),S},write(_,d,m,p,h){for(var S=0;S<p;S++)try{n(d[m+S])}catch(w){throw new FS.ErrnoError(29)}return p&&(_.node.timestamp=Date.now()),S}}),FS.mkdev(a,o,l)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=readBinary(e.url),e.usedBytes=e.contents.length}catch(t){throw new FS.ErrnoError(29)}},createLazyFile(e,t,r,n,a){class o{constructor(){$e(this,"lengthKnown",!1);$e(this,"chunks",[])}get(h){if(!(h>this.length-1||h<0)){var S=h%this.chunkSize,w=h/this.chunkSize|0;return this.getter(w)[S]}}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 S=Number(h.getResponseHeader("Content-length")),w,L=(w=h.getResponseHeader("Accept-Ranges"))&&w==="bytes",P=(w=h.getResponseHeader("Content-Encoding"))&&w==="gzip",k=1024*1024;L||(k=S);var C=(g,A)=>{if(g>A)throw new Error("invalid range ("+g+", "+A+") or no bytes requested!");if(A>S-1)throw new Error("only "+S+" bytes available! programmer error!");var F=new XMLHttpRequest;if(F.open("GET",r,!1),S!==k&&F.setRequestHeader("Range","bytes="+g+"-"+A),F.responseType="arraybuffer",F.overrideMimeType&&F.overrideMimeType("text/plain; charset=x-user-defined"),F.send(null),!(F.status>=200&&F.status<300||F.status===304))throw new Error("Couldn't load "+r+". Status: "+F.status);return F.response!==void 0?new Uint8Array(F.response||[]):intArrayFromString(F.responseText||"",!0)},x=this;x.setDataGetter(g=>{var A=g*k,F=(g+1)*k-1;if(F=Math.min(F,S-1),typeof x.chunks[g]>"u"&&(x.chunks[g]=C(A,F)),typeof x.chunks[g]>"u")throw new Error("doXHR failed!");return x.chunks[g]}),(P||!S)&&(k=S=1,S=this.getter(0).length,k=S,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=S,this._chunkSize=k,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,c={isDevice:!1,contents:l}}else var c={isDevice:!1,url:r};var u=FS.createFile(e,t,c,n,a);c.contents?u.contents=c.contents:c.url&&(u.contents=null,u.url=c.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var _={},d=Object.keys(u.stream_ops);d.forEach(p=>{var h=u.stream_ops[p];_[p]=(...S)=>(FS.forceLoadFile(u),h(...S))});function m(p,h,S,w,L){var P=p.node.contents;if(L>=P.length)return 0;var k=Math.min(P.length-L,w);if(P.slice)for(var C=0;C<k;C++)h[S+C]=P[L+C];else for(var C=0;C<k;C++)h[S+C]=P.get(L+C);return k}return _.read=(p,h,S,w,L)=>(FS.forceLoadFile(u),m(p,h,S,w,L)),_.mmap=(p,h,S,w,L)=>{FS.forceLoadFile(u);var P=mmapAlloc(h);if(!P)throw new FS.ErrnoError(48);return m(p,HEAP8,P,h,S),{ptr:P,allocated:!0}},u.stream_ops=_,u}},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}},___syscall__newselect=function(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,c=t?HEAP32[t+4>>>2>>>0]:0,u=r?HEAP32[r>>>2>>>0]:0,_=r?HEAP32[r+4>>>2>>>0]:0,d=n?HEAP32[n>>>2>>>0]:0,m=n?HEAP32[n+4>>>2>>>0]:0,p=0,h=0,S=0,w=0,L=0,P=0,k=(t?HEAP32[t>>>2>>>0]:0)|(r?HEAP32[r>>>2>>>0]:0)|(n?HEAP32[n>>>2>>>0]:0),C=(t?HEAP32[t+4>>>2>>>0]:0)|(r?HEAP32[r+4>>>2>>>0]:0)|(n?HEAP32[n+4>>>2>>>0]:0),x=(v,I,O,ie)=>v<32?I&ie:O&ie,g=0;g<e;g++){var A=1<<g%32;if(x(g,k,C,A)){var F=SYSCALLS.getStreamFromFD(g),y=SYSCALLS.DEFAULT_POLLMASK;if(F.stream_ops.poll){var E=-1;if(a){var b=t?HEAP32[a>>>2>>>0]:0,T=t?HEAP32[a+4>>>2>>>0]:0;E=(b+T/1e6)*1e3}y=F.stream_ops.poll(F,E)}y&1&&x(g,l,c,A)&&(g<32?p=p|A:h=h|A,o++),y&4&&x(g,u,_,A)&&(g<32?S=S|A:w=w|A,o++),y&2&&x(g,d,m,A)&&(g<32?L=L|A:P=P|A,o++)}}return t&&(HEAP32[t>>>2>>>0]=p,HEAP32[t+4>>>2>>>0]=h),r&&(HEAP32[r>>>2>>>0]=S,HEAP32[r+4>>>2>>>0]=w),n&&(HEAP32[n>>>2>>>0]=L,HEAP32[n+4>>>2>>>0]=P),o}catch(v){if(typeof FS>"u"||v.name!=="ErrnoError")throw v;return-v.errno}};___syscall__newselect.sig="iipppp";var SOCKFS={websocketArgs:{},callbacks:{},on(e,t){SOCKFS.callbacks[e]=t},emit(e,t){var r,n;(n=(r=SOCKFS.callbacks)[e])==null||n.call(r,t)},mount(e){var t;return SOCKFS.websocketArgs=Module.websocket||{},((t=Module.websocket)!=null?t:Module.websocket={}).on=SOCKFS.on,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 c=FS.createStream({path:o,node:l,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return a.stream=c,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="ws:#".replace("#","//"),l="binary",c=void 0;if(SOCKFS.websocketArgs.url&&(o=SOCKFS.websocketArgs.url),SOCKFS.websocketArgs.subprotocol?l=SOCKFS.websocketArgs.subprotocol:SOCKFS.websocketArgs.subprotocol===null&&(l="null"),o==="ws://"||o==="wss://"){var u=t.split("/");o=o+u[0]+":"+r+"/"+u.slice(1).join("/")}l!=="null"&&(l=l.replace(/^ +| +$/g,"").split(/ *, */),c=l);var _;ENVIRONMENT_IS_NODE?_=xo():_=WebSocket,n=new _(o,c),n.binaryType="arraybuffer"}catch(m){throw new FS.ErrnoError(23)}var d={addr:t,port:r,socket:n,msg_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(e,d),SOCKFS.websocket_sock_ops.handlePeerEvents(e,d),e.type===2&&typeof e.sport<"u"&&d.msg_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(e.sport&65280)>>8,e.sport&255])),d},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(){e.connecting=!1,SOCKFS.emit("open",e.stream.fd);try{for(var o=t.msg_send_queue.shift();o;)t.socket.send(o),o=t.msg_send_queue.shift()}catch(l){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 c=r;if(r=!1,c&&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 u=o[8]<<8|o[9];SOCKFS.websocket_sock_ops.removePeer(e,t),t.port=u,SOCKFS.websocket_sock_ops.addPeer(e,t);return}e.recv_queue.push({addr:t.addr,port:t.port,data:o}),SOCKFS.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(){SOCKFS.emit("close",e.stream.fd)}),t.socket.on("error",function(o){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(t.socket.onopen=n,t.socket.onclose=function(){SOCKFS.emit("close",e.stream.fd)},t.socket.onmessage=function(l){a(l.data)},t.socket.onerror=function(o){e.error=14,SOCKFS.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)&&(e.connecting?t|=4: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(a){}e.server=null}for(var t=Object.keys(e.peers),r=0;r<t.length;r++){var n=e.peers[t[r]];try{n.socket.close()}catch(a){}SOCKFS.websocket_sock_ops.removePeer(e,n)}return 0},bind(e,t,r){if(typeof e.saddr<"u"||typeof e.sport<"u")throw new FS.ErrnoError(28);if(e.saddr=t,e.sport=r,e.type===2){e.server&&(e.server.close(),e.server=null);try{e.sock_ops.listen(e,0)}catch(n){if(n.name!=="ErrnoError"||n.errno!==138)throw n}}},connect(e,t,r){if(e.server)throw new FS.ErrnoError(138);if(typeof e.daddr<"u"&&typeof e.dport<"u"){var n=SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(n)throw n.socket.readyState===n.socket.CONNECTING?new FS.ErrnoError(7):new FS.ErrnoError(30)}var a=SOCKFS.websocket_sock_ops.createPeer(e,t,r);e.daddr=a.addr,e.dport=a.port,e.connecting=!0},listen(e,t){if(!ENVIRONMENT_IS_NODE)throw new FS.ErrnoError(138);if(e.server)throw new FS.ErrnoError(28);var r=xo().Server,n=e.saddr;e.server=new r({host:n,port:e.sport}),SOCKFS.emit("listen",e.stream.fd),e.server.on("connection",function(a){if(e.type===1){var o=SOCKFS.createSocket(e.family,e.type,e.protocol),l=SOCKFS.websocket_sock_ops.createPeer(o,a);o.daddr=l.addr,o.dport=l.port,e.pending.push(o),SOCKFS.emit("connection",o.stream.fd)}else SOCKFS.websocket_sock_ops.createPeer(e,a),SOCKFS.emit("connection",e.stream.fd)}),e.server.on("close",function(){SOCKFS.emit("close",e.stream.fd),e.server=null}),e.server.on("error",function(a){e.error=23,SOCKFS.emit("error",[e.stream.fd,e.error,"EHOSTUNREACH: Host is unreachable"])})},accept(e){if(!e.server||!e.pending.length)throw new FS.ErrnoError(28);var t=e.pending.shift();return t.stream.flags=e.stream.flags,t},getname(e,t){var r,n;if(t){if(e.daddr===void 0||e.dport===void 0)throw new FS.ErrnoError(53);r=e.daddr,n=e.dport}else r=e.saddr||0,n=e.sport||0;return{addr:r,port:n}},sendmsg(e,t,r,n,a,o){if(e.type===2){if((a===void 0||o===void 0)&&(a=e.daddr,o=e.dport),a===void 0||o===void 0)throw new FS.ErrnoError(17)}else a=e.daddr,o=e.dport;var l=SOCKFS.websocket_sock_ops.getPeer(e,a,o);if(e.type===1&&(!l||l.socket.readyState===l.socket.CLOSING||l.socket.readyState===l.socket.CLOSED))throw new FS.ErrnoError(53);ArrayBuffer.isView(t)&&(r+=t.byteOffset,t=t.buffer);var c;if(c=t.slice(r,r+n),!l||l.socket.readyState!==l.socket.OPEN)return e.type===2&&(!l||l.socket.readyState===l.socket.CLOSING||l.socket.readyState===l.socket.CLOSED)&&(l=SOCKFS.websocket_sock_ops.createPeer(e,a,o)),l.msg_send_queue.push(c),n;try{return l.socket.send(c),n}catch(u){throw new FS.ErrnoError(28)}},recvmsg(e,t){if(e.type===1&&e.server)throw new FS.ErrnoError(53);var r=e.recv_queue.shift();if(!r){if(e.type===1){var n=SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(!n)throw new FS.ErrnoError(53);if(n.socket.readyState===n.socket.CLOSING||n.socket.readyState===n.socket.CLOSED)return null;throw new FS.ErrnoError(6)}throw new FS.ErrnoError(6)}var a=r.data.byteLength||r.data.length,o=r.data.byteOffset||0,l=r.data.buffer||r.data,c=Math.min(t,a),u={buffer:new Uint8Array(l,o,c),addr:r.addr,port:r.port};if(e.type===1&&c<a){var _=a-c;r.data=new Uint8Array(l,o+c,_),e.recv_queue.unshift(r)}return u}}},getSocketFromFD=e=>{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<t.length;r++)if(typeof t[r]=="string")if(t[r]==="Z"){for(a=0;a<8-t.length+1;a++)l[r+a]=0;n=a-1}else l[r+n]=_htons(parseInt(t[r],16));else l[r+n]=t[r];return[l[1]<<16|l[0],l[3]<<16|l[2],l[5]<<16|l[4],l[7]<<16|l[6]]},writeSockaddr=(e,t,r,n,a)=>{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),c=l.sock_ops.accept(l);if(t)var u=writeSockaddr(t,c.family,DNS.lookup_name(c.daddr),c.dport,r);return c.stream.fd}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.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,c=0,u=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],_=!0,d="";for(c=0;c<5;c++)if(u[c]!==0){_=!1;break}if(_){if(d=inetNtop4(u[6]|u[7]<<16),u[5]===-1)return t="::ffff:",t+=d,t;if(u[5]===0)return t="::",d==="0.0.0.0"&&(d=""),d==="0.0.0.1"&&(d="1"),t+=d,t}for(r=0;r<8;r++)u[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&&u[r]===0&&r>=o&&r<o+n){r===o&&(t+=":",o===0&&(t+=":"));continue}t+=Number(_ntohs(u[r]&65535)).toString(16),t+=r<7?":":""}return t},readSockaddr=(e,t)=>{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),c=getSocketAddress(t,r);return l.sock_ops.bind(l,c.addr,c.port),0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.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),c=getSocketAddress(t,r);return l.sock_ops.connect(l,c.addr,c.port),0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.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),c=convertI32PairToI53Checked(a,o);try{if(isNaN(l))return 61;var u=SYSCALLS.getStreamFromFD(e);return FS.allocate(u,l,c),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.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";var syscallGetVarargI=()=>{var e=HEAP32[+SYSCALLS.varargs>>>2>>>0];return SYSCALLS.varargs+=4,e},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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.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,t>>>=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<n?-68:(stringToUTF8(r,e,t),n)}catch(a){if(typeof FS>"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),c=Math.floor(l/a);c<n.getdents.length&&o+a<=r;){var u,_,d=n.getdents[c];if(d===".")u=n.node.id,_=4;else if(d===".."){var m=FS.lookupPath(n.path,{parent:!0});u=m.node.id,_=4}else{var p=FS.lookupNode(n.node,d);u=p.id,_=FS.isChrdev(p.mode)?2:FS.isDir(p.mode)?4:FS.isLink(p.mode)?10:8}tempI64=[u>>>0,(tempDouble=u,+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=[(c+1)*a>>>0,(tempDouble=(c+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]=_,stringToUTF8(d,t+o+19,256),o+=a,c+=1}return FS.llseek(n,c*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 c=writeSockaddr(t,l.family,DNS.lookup_name(l.daddr),l.dport,r);return 0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}___syscall_getpeername.sig="iippiii";function ___syscall_getsockname(e,t,r,n,a,o){t>>>=0,r>>>=0;try{var l=getSocketFromFD(e),c=writeSockaddr(t,l.family,DNS.lookup_name(l.saddr||"0.0.0.0"),l.sport,r);return 0}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.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(),c=HEAP32[o>>>2>>>0],u=HEAP32[o+4>>>2>>>0],_=HEAP32[o+8>>>2>>>0],d=HEAP32[o+12>>>2>>>0],m=[],l=0;l<32;l++)m.push(HEAP8[o+l+17>>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:c,c_oflag:u,c_cflag:_,c_lflag:d,c_cc:m})}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 p=n.tty.ops.ioctl_tiocgwinsz(n.tty),o=syscallGetVarargP();HEAP16[o>>>1>>>0]=p[0],HEAP16[o+2>>>1>>>0]=p[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;r<t.buckets.length;r++){var n=t.buckets[r];if(n.offset-n.roffset>0)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,c=0;c<o.buckets.length;c++){var u=o.buckets[c];l+=u.offset-u.roffset}var _=t.subarray(r,r+n);if(n<=0)return 0;if(l==0)throw new FS.ErrnoError(6);for(var d=Math.min(l,n),m=d,p=0,c=0;c<o.buckets.length;c++){var h=o.buckets[c],S=h.offset-h.roffset;if(d<=S){var w=h.buffer.subarray(h.roffset,h.offset);d<S?(w=w.subarray(0,d),h.roffset+=d):p++,_.set(w);break}else{var w=h.buffer.subarray(h.roffset,h.offset);_.set(w),_=_.subarray(w.byteLength),d-=w.byteLength,p++}}return p&&p==o.buckets.length&&(p--,o.buckets[p].offset=0,o.buckets[p].roffset=0),o.buckets.splice(0,p),m},write(e,t,r,n,a){var o=e.node.pipe,l=t.subarray(r,r+n),c=l.byteLength;if(c<=0)return 0;var u=null;o.buckets.length==0?(u={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0},o.buckets.push(u)):u=o.buckets[o.buckets.length-1],assert(u.offset<=PIPEFS.BUCKET_BUFFER_SIZE);var _=PIPEFS.BUCKET_BUFFER_SIZE-u.offset;if(_>=c)return u.buffer.set(l,u.offset),u.offset+=c,c;_>0&&(u.buffer.set(l.subarray(0,_),u.offset),u.offset+=_,l=l.subarray(_,l.byteLength));for(var d=l.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,m=l.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,p=0;p<d;p++){var h={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:PIPEFS.BUCKET_BUFFER_SIZE,roffset:0};o.buckets.push(h),h.buffer.set(l.subarray(0,PIPEFS.BUCKET_BUFFER_SIZE)),l=l.subarray(PIPEFS.BUCKET_BUFFER_SIZE,l.byteLength)}if(m>0){var h={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:l.byteLength,roffset:0};o.buckets.push(h),h.buffer.set(l)}return c},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<t;a++){var o=e+8*a,l=HEAP32[o>>>2>>>0],c=HEAP16[o+4>>>1>>>0],u=32,_=FS.getStream(l);_&&(u=SYSCALLS.DEFAULT_POLLMASK,_.stream_ops.poll&&(u=_.stream_ops.poll(_,-1))),u&=c|8|16,u&&n++,HEAP16[o+6>>>1>>>0]=u}return n}catch(d){if(typeof FS>"u"||d.name!=="ErrnoError")throw d;return-d.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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return-c.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),c=l.sock_ops.recvmsg(l,r);if(!c)return 0;if(a)var u=writeSockaddr(a,l.family,DNS.lookup_name(c.addr),c.port,o);return HEAPU8.set(c.buffer,t>>>0),c.buffer.byteLength}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.errno}}___syscall_recvfrom.sig="iippipp";function ___syscall_recvmsg(e,t,r,n,a,o){t>>>=0;try{for(var l=getSocketFromFD(e),c=HEAPU32[t+8>>>2>>>0],u=HEAP32[t+12>>>2>>>0],_=0,d=0;d<u;d++)_+=HEAP32[c+(8*d+4)>>>2>>>0];var m=l.sock_ops.recvmsg(l,_);if(!m)return 0;var p=HEAPU32[t>>>2>>>0];if(p)var h=writeSockaddr(p,l.family,DNS.lookup_name(m.addr),m.port);for(var S=0,w=m.buffer.byteLength,d=0;w>0&&d<u;d++){var L=HEAPU32[c+(8*d+0)>>>2>>>0],P=HEAP32[c+(8*d+4)>>>2>>>0];if(P){var k=Math.min(P,w),C=m.buffer.subarray(S,S+k);HEAPU8.set(C,L+S>>>0),S+=k,w-=k}}return S}catch(x){if(typeof FS>"u"||x.name!=="ErrnoError")throw x;return-x.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,n>>>=0,a>>>=0;try{var l=getSocketFromFD(e),c=HEAPU32[t+8>>>2>>>0],u=HEAP32[t+12>>>2>>>0],_,d,m=HEAPU32[t>>>2>>>0],p=HEAP32[t+4>>>2>>>0];if(m){var h=getSocketAddress(m,p);d=h.port,_=h.addr}for(var S=0,w=0;w<u;w++)S+=HEAP32[c+(8*w+4)>>>2>>>0];for(var L=new Uint8Array(S),P=0,w=0;w<u;w++)for(var k=HEAPU32[c+(8*w+0)>>>2>>>0],C=HEAP32[c+(8*w+4)>>>2>>>0],x=0;x<C;x++)L[P++]=HEAP8[k+x>>>0];return l.sock_ops.sendmsg(l,L,0,S,_,d)}catch(g){if(typeof FS>"u"||g.name!=="ErrnoError")throw g;return-g.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 c=getSocketAddress(a,o);return l.sock_ops.sendmsg(l,HEAP8,t,r,c.addr,c.port)}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.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 c=readI53FromI64(r),u=HEAP32[r+8>>>2>>>0];u==1073741823?o=a:u==1073741822?o=-1:o=c*1e3+u/1e6,r+=16,c=readI53FromI64(r),u=HEAP32[r+8>>>2>>>0],u==1073741823?l=a:u==1073741822?l=-1:l=c*1e3+u/1e6}return(l!=-1||o!=-1)&&FS.utime(t,o,l),0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.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},stackSave=()=>_emscripten_stack_get_current(),stackRestore=e=>__emscripten_stack_restore(e),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(c){return dlSetError("Could not load dynamic lib: ".concat(r,"\n").concat(c)),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 c=getFunctionAddress(n);c?n=c:(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){e>>>=0,t>>>=0,r>>>=0}__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;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 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),a===-1&&(a=4294967295);var o=d=>d;if(n===0){var l=32-8*r;o=d=>d<<l>>>l}var c=t.includes("unsigned"),u=(d,m)=>{},_;c?_=function(d,m){return u(m,this.name),m>>>0}:_=function(d,m){return u(m,this.name),m},registerType(e,{name:t,fromWireType:o,toWireType:_,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 c=HEAPU32[l>>>2>>>0],u=HEAPU32[l+4>>>2>>>0];return new a(HEAP8.buffer,u,c)}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 c=o,u=0;u<=a;++u){var _=o+u;if(u==a||HEAPU8[_>>>0]==0){var d=_-c,m=UTF8ToString(c,d);l===void 0?l=m:(l+="\0",l+=m),c=_+1}}else{for(var p=new Array(a),u=0;u<a;++u)p[u]=String.fromCharCode(HEAPU8[o+u>>>0]);l=p.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 c=_malloc(4+o+1),u=c+4;if(HEAPU32[c>>>2>>>0]=o,r&&l)stringToUTF8(a,u,o+1);else if(l)for(var _=0;_<o;++_){var d=a.charCodeAt(_);d>255&&(_free(u),throwBindingError("String has UTF-16 code units that do not fit in 8 bits")),HEAPU8[u+_>>>0]=d}else for(var _=0;_<o;++_)HEAPU8[u+_>>>0]=a[_];return n!==null&&n.push(_free,c),c},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 c=HEAP16[e+l*2>>>1>>>0];if(c==0)break;o+=String.fromCharCode(c)}return o},stringToUTF16=(e,t,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=t,a=r<e.length*2?r/2:e.length,o=0;o<a;++o){var l=e.charCodeAt(o);HEAP16[t>>>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<e.length;++o){var l=e.charCodeAt(o);if(l>=55296&&l<=57343){var c=e.charCodeAt(++o);l=65536+((l&1023)<<10)|c&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<e.length;++r){var n=e.charCodeAt(r);n>=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=c=>HEAPU16[c>>>1>>>0]):t===4&&(n=UTF32ToString,a=stringToUTF32,l=lengthBytesUTF32,o=c=>HEAPU32[c>>>2>>>0]),registerType(e,{name:r,fromWireType:c=>{for(var u=HEAPU32[c>>>2>>>0],_,d=c+4,m=0;m<=u;++m){var p=c+4+m*t;if(m==u||o(p)==0){var h=p-d,S=n(d,h);_===void 0?_=S:(_+="\0",_+=S),d=p+t}}return _free(c),_},toWireType:(c,u)=>{typeof u!="string"&&throwBindingError("Cannot pass non-string to C++ string type ".concat(r));var _=l(u),d=_malloc(4+_+t);return HEAPU32[d>>>2>>>0]=_/t,a(u,d+4,_+t),c!==null&&c.push(_free,d),d},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(c){_free(c)}})};__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(c){var u=UTF8ToString(e+36);dlSetError("'Could not load dynamic lib: ".concat(u,"\n").concat(c)),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";var __emscripten_runtime_keepalive_clear=()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0};__emscripten_runtime_keepalive_clear.sig="v";function __emscripten_set_offscreencanvas_size(e,t,r){return e>>>=0,-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(Ti),n=r.spawnSync(t,[],{shell:!0,stdio:"inherit"}),a=(l,c)=>l<<8|c;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 emval_symbols={},getStringOrSymbol=e=>{var t=emval_symbols[e];return t===void 0?readLatin1String(e):t},emval_methodCallers=[];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";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";var emval_addMethodCaller=e=>{var t=emval_methodCallers.length;return emval_methodCallers.push(e),t},getTypeName=e=>{var t=___getTypeName(e),r=readLatin1String(t);return _free(t),r},requireRegisteredType=(e,t)=>{var r=registeredTypes[e];return r===void 0&&throwBindingError("".concat(t," has unknown type ").concat(getTypeName(e))),r},emval_lookupTypes=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=requireRegisteredType(HEAPU32[t+n*4>>>2>>>0],"parameter "+n);return r},createNamedFunction=(e,t)=>Object.defineProperty(t,"name",{value:e}),reflectConstruct=Reflect.construct,emval_returnValue=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(HEAPU32[t>>>2>>>0]=Emval.toHandle(n)),a};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 __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) {\n",l=0,c=[];r===0&&c.push("obj");for(var u=["retType"],_=[a],d=0;d<e;++d)c.push("arg"+d),u.push("argType"+d),_.push(n[d]),o+=" var arg".concat(d," = argType").concat(d,".readValueFromPointer(args").concat(l?"+"+l:"",");\n"),l+=n[d].argPackAdvance;var m=r===1?"new func":"func.call";o+=" var rv = ".concat(m,"(").concat(c.join(", "),");\n"),a.isVoid||(u.push("emval_returnValue"),_.push(emval_returnValue),o+=" return emval_returnValue(retType, destructorsRef, rv);\n"),o+="};\n",u.push(o);var p=newFunc(Function,u)(..._),h="methodCaller<(".concat(n.map(S=>S.name).join(", "),") => ").concat(a.name,">");return emval_addMethodCaller(createNamedFunction(h,p))}__emval_get_method_caller.sig="pipi";var runDestructors=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function __emval_run_destructors(e){e>>>=0;var t=Emval.toValue(e);runDestructors(t),__emval_decref(e)}__emval_run_destructors.sig="vp";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),c=new Date(a.getFullYear(),6,1).getTimezoneOffset(),u=l.getTimezoneOffset(),_=(c!=u&&a.getTimezoneOffset()==Math.min(u,c))|0;HEAP32[r+32>>>2>>>0]=_}__localtime_js.sig="viip";var setTempRet0=e=>__emscripten_tempret_set(e),_setTempRet0=setTempRet0;Module._setTempRet0=_setTempRet0;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(),c=o.getTimezoneOffset(),u=Math.min(c,l);if(n<0)HEAP32[e+32>>>2>>>0]=+(l!=c&&u==a);else if(n>0!=(u==a)){var _=Math.max(c,l),d=n>0?u:_;r.setTime(r.getTime()+(d-a)*6e4)}HEAP32[e+24>>>2>>>0]=r.getDay();var m=ydayFromDate(r)|0;HEAP32[e+28>>>2>>>0]=m,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 p=r.getTime();return isNaN(p)?-1:p/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,c){e>>>=0;var u=convertI32PairToI53Checked(a,o);l>>>=0,c>>>=0;try{if(isNaN(u))return 61;var _=SYSCALLS.getStreamFromFD(n),d=FS.mmap(_,e,u,t,r),m=d.ptr;return HEAP32[l>>>2>>>0]=d.allocated,HEAPU32[c>>>2>>>0]=m,0}catch(p){if(typeof FS>"u"||p.name!=="ErrnoError")throw p;return-p.errno}}__mmap_js.sig="ipiiiiipp";function __msync_js(e,t,r,n,a,o,l){e>>>=0,t>>>=0;var c=convertI32PairToI53Checked(o,l);try{return isNaN(c)?61:(SYSCALLS.doMsync(e,SYSCALLS.getStreamFromFD(a),t,n,c),0)}catch(u){if(typeof FS>"u"||u.name!=="ErrnoError")throw u;return-u.errno}}__msync_js.sig="ippiiiii";function __munmap_js(e,t,r,n,a,o,l){e>>>=0,t>>>=0;var c=convertI32PairToI53Checked(o,l);try{var u=SYSCALLS.getStreamFromFD(a);r&2&&SYSCALLS.doMsync(e,u,t,n,c)}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return-_.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),c=o.getTimezoneOffset(),u=l.getTimezoneOffset(),_=Math.max(c,u);HEAPU32[e>>>2>>>0]=_*60,HEAP32[t>>>2>>>0]=+(c!=u);var d=h=>{var S=h>=0?"-":"+",w=Math.abs(h),L=String(Math.floor(w/60)).padStart(2,"0"),P=String(w%60).padStart(2,"0");return"UTC".concat(S).concat(L).concat(P)},m=d(c),p=d(u);u<c?(stringToUTF8(m,r,17),stringToUTF8(p,n,17)):(stringToUTF8(m,n,17),stringToUTF8(p,r,17))};__tzset_js.sig="vpppp";var _emscripten_set_main_loop_timing=(e,t)=>{if(MainLoop.timingMode=e,MainLoop.timingValue=t,!MainLoop.func)return 1;if(MainLoop.running||(MainLoop.running=!0),e==0)MainLoop.scheduler=function(){var l=Math.max(0,MainLoop.tickStartTime+t-_emscripten_get_now())|0;setTimeout(MainLoop.runner,l)},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=>{var l;r.push(o),ENVIRONMENT_IS_WORKER?((l=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 o<MainLoop.currentlyRunningMainloop?(maybeExit(),!1):!0}if(MainLoop.running=!1,MainLoop.runner=function(){if(!ABORT){if(MainLoop.queue.length>0){var u=Date.now(),_=MainLoop.queue.shift();if(_.func(_.arg),MainLoop.remainingBlockers){var d=MainLoop.remainingBlockers,m=d%1==0?d-1:Math.floor(d);_.counted?MainLoop.remainingBlockers=m:(m=m+.5,MainLoop.remainingBlockers=(8*d+m)/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 n,a;if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=(n=MainLoop.remainingBlockers)!=null?n:0,r=(a=MainLoop.expectedBlockers)!=null?a:0;t?t<r?Module.setStatus("{message} ({expected - remaining}/{expected})"):Module.setStatus(e):Module.setStatus("")}},init(){Module.preMainLoop&&MainLoop.preMainLoop.push(Module.preMainLoop),Module.postMainLoop&&MainLoop.postMainLoop.push(Module.postMainLoop)},runIter(e){if(!ABORT){for(var t of MainLoop.preMainLoop)if(t()===!1)return;callUserCallback(e);for(var r of MainLoop.postMainLoop)r()}},nextRAF:0,fakeRequestAnimationFrame(e){var t=Date.now();if(MainLoop.nextRAF===0)MainLoop.nextRAF=t+1e3/60;else for(;t+2>=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.audioQueue.length;l++){var c=e.audioQueue[l];n=c._startTime+c._duration,a=0,o+=c._skipCount+1}t||(t=AL.QUEUE_LOOKAHEAD);for(var u=r+t,_=0;n<u;){if(o>=e.bufQueue.length)if(e.looping)o%=e.bufQueue.length;else break;var d=e.bufQueue[o%e.bufQueue.length];if(d.length===0){if(_++,_===e.bufQueue.length)break}else{var c=e.context.audioCtx.createBufferSource();c.buffer=d.audioBuf,c.playbackRate.value=e.playbackRate,(d.audioBuf._loopStart||d.audioBuf._loopEnd)&&(c.loopStart=d.audioBuf._loopStart,c.loopEnd=d.audioBuf._loopEnd);var m=0;e.type===4136&&e.looping?(m=Number.POSITIVE_INFINITY,c.loop=!0,d.audioBuf._loopStart&&(c.loopStart=d.audioBuf._loopStart),d.audioBuf._loopEnd&&(c.loopEnd=d.audioBuf._loopEnd)):m=(d.audioBuf.duration-a)/e.playbackRate,c._startOffset=a,c._duration=m,c._skipCount=_,_=0,c.connect(e.gain),typeof c.start<"u"?(n=Math.max(n,e.context.audioCtx.currentTime),c.start(n,a)):typeof c.noteOn<"u"&&(n=Math.max(n,e.context.audioCtx.currentTime),c.noteOn(n)),c._startTime=n,e.audioQueue.push(c),n+=m}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<r)break;e.audioQueue.shift(),e.bufStartTime=r,e.bufOffset=0,e.bufsProcessed++}if(e.bufsProcessed>=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,c=a.audioBuf._loopEnd||a.audioBuf.duration;c<=l&&(c=a.audioBuf.duration),o<c?e.bufOffset=o:e.bufOffset=l+(o-l)%(c-l)}}else if(e.audioQueue[0])e.bufOffset=(t-e.audioQueue[0]._startTime)*e.playbackRate;else{if(e.type!==4136&&e.looping){var u=AL.sourceDuration(e)/e.playbackRate;u>0&&(e.bufStartTime+=Math.floor((t-e.bufStartTime)/u)*u)}for(var _=0;_<e.bufQueue.length;_++){if(e.bufsProcessed>=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<r){e.bufOffset=(t-e.bufStartTime)*e.playbackRate;break}e.bufStartTime=r}e.bufOffset=0,e.bufsProcessed++}}return t},cancelPendingSourceAudio:e=>{AL.updateSourceTime(e);for(var t=1;t<e.audioQueue.length;t++){var r=e.audioQueue[t];r.stop()}e.audioQueue.length>1&&(e.audioQueue.length=1)},stopSourceAudio:e=>{for(var t=0;t<e.audioQueue.length;t++)e.audioQueue[t].stop();e.audioQueue.length=0},setSourceState:(e,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<e.bufQueue.length;r++)if(e.bufQueue[r].id!==0){t=e.bufQueue[r];break}if(e.spatialize===1||e.spatialize===2&&t.channels===1){if(e.panner)return;e.panner=e.context.audioCtx.createPanner(),AL.updateSourceGlobal(e),AL.updateSourceSpace(e),e.panner.connect(e.context.gain),e.gain.disconnect(),e.gain.connect(e.panner)}else{if(!e.panner)return;e.panner.disconnect(),e.gain.disconnect(),e.gain.connect(e.context.gain),e.panner=null}}},updateContextGlobal:e=>{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],c=e.direction[2],u=e.context.listener,_=u.position[0],d=u.position[1],m=u.position[2];if(e.relative){var p=-u.direction[0],h=-u.direction[1],S=-u.direction[2],w=u.up[0],L=u.up[1],P=u.up[2],k=(To,Io,Do)=>{var Mo=Math.sqrt(To*To+Io*Io+Do*Do);return Mo<Number.EPSILON?0:1/Mo},C=k(p,h,S);p*=C,h*=C,S*=C,C=k(w,L,P),w*=C,L*=C,P*=C;var x=L*S-P*h,g=P*p-w*S,A=w*h-L*p;C=k(x,g,A),x*=C,g*=C,A*=C,w=h*A-S*g,L=S*x-p*A,P=p*g-h*x;var F=o,y=l,E=c;o=F*x+y*w+E*p,l=F*g+y*L+E*h,c=F*A+y*P+E*S,F=r,y=n,E=a,r=F*x+y*w+E*p,n=F*g+y*L+E*h,a=F*A+y*P+E*S,r+=_,n+=d,a+=m}t.positionX?(r!=t.positionX.value&&(t.positionX.value=r),n!=t.positionY.value&&(t.positionY.value=n),a!=t.positionZ.value&&(t.positionZ.value=a)):t.setPosition(r,n,a),t.orientationX?(o!=t.orientationX.value&&(t.orientationX.value=o),l!=t.orientationY.value&&(t.orientationY.value=l),c!=t.orientationZ.value&&(t.orientationZ.value=c)):t.setOrientation(o,l,c);var b=e.dopplerShift,T=e.velocity[0],v=e.velocity[1],I=e.velocity[2],O=u.velocity[0],ie=u.velocity[1],we=u.velocity[2];if(r===_&&n===d&&a===m||T===O&&v===ie&&I===we)e.dopplerShift=1;else{var je=e.context.speedOfSound,ne=e.context.dopplerFactor,We=_-r,ze=d-n,Lt=m-a,Zr=Math.sqrt(We*We+ze*ze+Lt*Lt),Dr=(We*O+ze*ie+Lt*we)/Zr,_r=(We*T+ze*v+Lt*I)/Zr;Dr=Math.min(Dr,je/ne),_r=Math.min(_r,je/ne),e.dopplerShift=(je-ne*Dr)/(je-ne*_r)}e.dopplerShift!==b&&AL.updateSourceRate(e)}},updateSourceRate:e=>{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<e.bufQueue.length;r++){var n=e.bufQueue[r].audioBuf;t+=n?n.duration:0}return t},sourceTell:e=>{AL.updateSourceTime(e);for(var t=0,r=0;r<e.bufsProcessed;r++)e.bufQueue[r].audioBuf&&(t+=e.bufQueue[r].audioBuf.duration);return t+=e.bufOffset,t},sourceSeek:(e,t)=>{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 c=0,o=0,l=0;l<n.bufQueue.length;l++)c+=n.bufQueue[l].length,n.bufQueue[l].id!==0&&(o=n.bufQueue[l].bytesPerSample*n.bufQueue[l].channels);return c*o;case 8202:for(var c=0,l=0;l<n.bufQueue.length;l++)c+=n.bufQueue[l].length;return c;case 8203:return AL.sourceDuration(n);case 53248:return n.distanceModel;default:return AL.currentCtx.err=40962,null}},setSourceParam:(e,t,r,n)=>{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 c in a.bufQueue)a.bufQueue[c].refCount--;a.bufQueue.length=1,a.bufQueue[0]=AL.buffers[0],a.bufsProcessed=0,a.type=4144}else{var u=AL.buffers[n];if(!u){AL.currentCtx.err=40963;return}for(var c in a.bufQueue)a.bufQueue[c].refCount--;a.bufQueue.length=0,u.refCount++,a.bufQueue=[u],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)||n<Math.max(0,a.minGain)||n>1){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 m=AL.sourceDuration(a);if(m>0){var _;for(var d in a.bufQueue)if(d){_=a.bufQueue[d].frequency;break}n/=_}if(n<0||n>m){AL.currentCtx.err=40963;return}AL.sourceSeek(a,n);break;case 4134:var m=AL.sourceDuration(a);if(m>0){var p;for(var d in a.bufQueue)if(d){var u=a.bufQueue[d];p=u.frequency*u.bytesPerSample*u.channels;break}n/=p}if(n<0||n>m){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 c=l.getChannelData(0),u=0;u<n;++u)c[u]=HEAPU8[r++>>>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 c=l.getChannelData(0);r>>=1;for(var u=0;u<n>>1;++u)c[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 c=l.getChannelData(0),_=l.getChannelData(1),u=0;u<n>>1;++u)c[u]=HEAPU8[r++>>>0]*.0078125-1,_[u]=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 c=l.getChannelData(0),_=l.getChannelData(1);r>>=1;for(var u=0;u<n>>2;++u)c[u]=HEAP16[r++>>>0]*30517578125e-15,_[u]=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 c=l.getChannelData(0);r>>=2;for(var u=0;u<n>>2;++u)c[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 c=l.getChannelData(0),_=l.getChannelData(1);r>>=2;for(var u=0;u<n>>3;++u)c[u]=HEAPF32[r++>>>0],_[u]=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(d){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<e;++r){var n=HEAP32[t+r*4>>>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<e;++r){var n=HEAP32[t+r*4>>>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<e;++r){var n=HEAP32[t+r*4>>>2>>>0];if(!AL.currentCtx.sources[n]){AL.currentCtx.err=40961;return}}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<e;++r){var n={deviceId:AL.currentCtx.deviceId,id:AL.newId(),refCount:0,audioBuf:null,frequency:0,bytesPerSample:2,channels:1,length:0};AL.deviceRefCounts[n.deviceId]++,AL.buffers[n.id]=n,HEAP32[t+r*4>>>2>>>0]=n.id}}_alGenBuffers.sig="vip";function _alGenSources(e,t){if(t>>>=0,!!AL.currentCtx)for(var r=0;r<e;++r){var n=AL.currentCtx.audioCtx.createGain();n.connect(AL.currentCtx.gain);var a={context:AL.currentCtx,id:AL.newId(),type:4144,state:4113,bufQueue:[AL.buffers[0]],audioQueue:[],looping:!1,pitch:1,dopplerShift:1,gain:n,minGain:0,maxGain:1,panner:null,bufsProcessed:0,bufStartTime:Number.NEGATIVE_INFINITY,bufOffset:0,relative:!1,refDistance:1,maxDistance:340282e33,rolloffFactor:1,position:[0,0,0],velocity:[0,0,0],direction:[0,0,0],coneOuterGain:0,coneInnerAngle:360,coneOuterAngle:360,distanceModel:53250,spatialize:2,get playbackRate(){return this.pitch*this.dopplerShift}};AL.currentCtx.sources[a.id]=a,HEAP32[t+r*4>>>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<e;++r)if(!AL.currentCtx.sources[HEAP32[t+r*4>>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<e;++r)if(!AL.currentCtx.sources[HEAP32[t+r*4>>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<n.bufQueue.length;o++)if(n.bufQueue[o].id!==0){a=n.bufQueue[o];break}for(var o=0;o<t;++o){var l=HEAP32[r+o*4>>>2>>>0],c=AL.buffers[l];if(!c){AL.currentCtx.err=40961;return}a.id!==0&&(c.frequency!==a.frequency||c.bytesPerSample!==a.bytesPerSample||c.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<t;++o){var l=HEAP32[r+o*4>>>2>>>0],c=AL.buffers[l];c.refCount++,n.bufQueue.push(c)}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<e;++r)if(!AL.currentCtx.sources[HEAP32[t+r*4>>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<e;++r)if(!AL.currentCtx.sources[HEAP32[t+r*4>>>2>>>0]]){AL.currentCtx.err=40961;return}for(var r=0;r<e;++r){var n=HEAP32[t+r*4>>>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<t;a++){var o=n.bufQueue.shift();o.refCount--,HEAP32[r+a*4>>>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 r,n,a,o;e>>>=0;var t=AL.requireValidCaptureDevice(e,"alcCaptureCloseDevice");return t?(delete AL.captures[e],AL.freeIds.push(e),(r=t.mediaStreamSourceNode)==null||r.disconnect(),(n=t.mergerNode)==null||n.disconnect(),(a=t.splitterNode)==null||a.disconnect(),(o=t.scriptProcessorNode)==null||o.disconnect(),t.mediaStream&&t.mediaStream.getTracks().forEach(l=>l.stop()),delete t.buffers,t.capturedFrameCount=0,t.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 C;e>>>=0;var a=AL.CAPTURE_DEVICE_NAME;if(e!==0&&(a=UTF8ToString(e),a!==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 o=navigator.getUserMedia||navigator.mediaDevices&&navigator.mediaDevices.getUserMedia;if(!o)return AL.alcErr=40965,0;var l=window.AudioContext||window.webkitAudioContext;if(!AL.sharedCaptureAudioCtx)try{AL.sharedCaptureAudioCtx=new l}catch(x){return AL.alcErr=40965,0}autoResumeAudioContext(AL.sharedCaptureAudioCtx);var c;switch(r){case 65552:case 4353:case 4352:c=1;break;case 65553:case 4355:case 4354:c=2;break;default:return AL.alcErr=40964,0}function u(x){return new Float32Array(x)}function _(x){return new Int16Array(x)}function d(x){return new Uint8Array(x)}var m,p;switch(r){case 65552:case 65553:m="f32",p=u;break;case 4353:case 4355:m="i16",p=_;break;case 4352:case 4354:m="u8",p=d;break}var h=[];try{for(var S=0;S<c;++S)h[S]=p(n)}catch(x){return AL.alcErr=40965,0}var w={audioCtx:AL.sharedCaptureAudioCtx,deviceName:a,requestedSampleRate:t,requestedSampleType:m,outputChannelCount:c,inputChannelCount:null,mediaStreamError:null,mediaStreamSourceNode:null,mediaStream:null,mergerNode:null,splitterNode:null,scriptProcessorNode:null,isCapturing:!1,buffers:h,get bufferFrameCapacity(){return h[0].length},capturePlayhead:0,captureReadhead:0,capturedFrameCount:0},L=x=>{w.mediaStreamError=x},P=x=>{w.mediaStreamSourceNode=w.audioCtx.createMediaStreamSource(x),w.mediaStream=x;var g=1;switch(w.mediaStreamSourceNode.channelCountMode){case"max":g=c;break;case"clamped-max":g=Math.min(c,w.mediaStreamSourceNode.channelCount);break;case"explicit":g=w.mediaStreamSourceNode.channelCount;break}w.inputChannelCount=g;var A=512;w.scriptProcessorNode=w.audioCtx.createScriptProcessor(A,g,c),g>c?(w.mergerNode=w.audioCtx.createChannelMerger(g),w.mediaStreamSourceNode.connect(w.mergerNode),w.mergerNode.connect(w.scriptProcessorNode)):g<c?(w.splitterNode=w.audioCtx.createChannelSplitter(c),w.mediaStreamSourceNode.connect(w.splitterNode),w.splitterNode.connect(w.scriptProcessorNode)):w.mediaStreamSourceNode.connect(w.scriptProcessorNode),w.scriptProcessorNode.connect(w.audioCtx.destination),w.scriptProcessorNode.onaudioprocess=F=>{if(w.isCapturing){var y=w,E=F.inputBuffer;switch(r){case 65552:for(var v=E.getChannelData(0),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=v[b]}break;case 65553:for(var v=E.getChannelData(0),I=E.getChannelData(1),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=v[b],y.buffers[1][T]=I[b]}break;case 4353:for(var v=E.getChannelData(0),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=v[b]*32767}break;case 4355:for(var v=E.getChannelData(0),I=E.getChannelData(1),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=v[b]*32767,y.buffers[1][T]=I[b]*32767}break;case 4352:for(var v=E.getChannelData(0),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=(v[b]+1)*127}break;case 4354:for(var v=E.getChannelData(0),I=E.getChannelData(1),b=0;b<E.length;++b){var T=(y.capturePlayhead+b)%y.bufferFrameCapacity;y.buffers[0][T]=(v[b]+1)*127,y.buffers[1][T]=(I[b]+1)*127}break}y.capturePlayhead+=E.length,y.capturePlayhead%=y.bufferFrameCapacity,y.capturedFrameCount+=E.length,y.capturedFrameCount=Math.min(y.capturedFrameCount,y.bufferFrameCapacity)}}};(C=navigator.mediaDevices)!=null&&C.getUserMedia?navigator.mediaDevices.getUserMedia({audio:!0}).then(P).catch(L):navigator.getUserMedia({audio:!0},P,L);var k=AL.newId();return AL.captures[k]=w,k}_alcCaptureOpenDevice.sig="ppiii";function _alcCaptureSamples(e,t,r){e>>>=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 c(C,x){HEAPF32[t+4*C>>>2>>>0]=x}function u(C,x){HEAP16[t+2*C>>>1>>>0]=x}function _(C,x){HEAP8[t+C>>>0]=x}var d;switch(n.requestedSampleType){case"f32":d=c;break;case"i16":d=u;break;case"u8":d=_;break;default:return}if(Math.floor(l)==l)for(var m=0,p=0;p<r;++p){for(var h=0;h<n.buffers.length;++h,++m)d(m,n.buffers[h][n.captureReadhead]);n.captureReadhead=(l+n.captureReadhead)%n.bufferFrameCapacity}else for(var m=0,p=0;p<r;++p){for(var S=Math.floor(n.captureReadhead),w=Math.ceil(n.captureReadhead),L=n.captureReadhead-S,h=0;h<n.buffers.length;++h,++m){var P=n.buffers[h][S],k=n.buffers[h][w];d(m,(1-L)*P+L*k)}n.captureReadhead=(n.captureReadhead+l)%n.bufferFrameCapacity}n.capturedFrameCount=0}_alcCaptureSamples.sig="vppi";function _alcCaptureStart(e){e>>>=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 c=window.AudioContext||window.webkitAudioContext,u=null;try{r?u=new c(r):u=new c}catch(h){return h.name==="NotSupportedError"?AL.alcErr=40964:AL.alcErr=40961,0}autoResumeAudioContext(u),typeof u.createGain>"u"&&(u.createGain=u.createGainNode);var _=u.createGain();_.connect(u.destination);var d={deviceId:e,id:AL.newId(),attrs:n,audioCtx:u,listener:{position:[0,0,0],velocity:[0,0,0],direction:[0,0,0],up:[0,0,0]},sources:[],interval:setInterval(()=>AL.scheduleContextAudio(d),AL.QUEUE_INTERVAL),gain:_,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[d.id]=d,a!==null)for(var m in AL.contexts){var p=AL.contexts[m];p.deviceId===e&&(p.hrtf=a,AL.updateContextGlobal(p))}return d.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){e>>>=0;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<AL.currentCtx.attrs.length;a++)HEAP32[n+a*4>>>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 c=AL.contexts[l];c.deviceId===e&&(o=c.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 u=AL.requireValidCaptureDevice(e,"alcGetIntegerv");if(!u)return;var _=u.capturedFrameCount,d=u.requestedSampleRate,m=u.audioCtx.sampleRate,p=Math.floor(_*(d/m));HEAP32[n>>>2>>>0]=p;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){e>>>=0,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){e>>>=0}_alcProcessContext.sig="vp";function _alcSuspendContext(e){e>>>=0}_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_drop_file(e,t){return e>>>=0,globalThis.DUCKDB_RUNTIME.dropFile(Module,e,t)}_duckdb_web_fs_file_drop_file.sig="vpi";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<t;r++)e[r]=null;return t},genObject:(e,t,r,n)=>{for(var a=0;a<e;a++){var o=GLctx[r](),l=o&&GL.getNewId(n);o?(o.name=l,n[l]=o):GL.recordError(1282),HEAP32[t+a*4>>>2>>>0]=l}},getSource:(e,t,r,n)=>{for(var a="",o=0;o<t;++o){var l=n?HEAPU32[n+o*4>>>2>>>0]:void 0;a+=UTF8ToString(HEAPU32[r+o*4>>>2>>>0],l)}return a},createContext:(e,t)=>{if(!e.getContextSafariWebGL2Fixed){let o=function(l,c){var u=e.getContextSafariWebGL2Fixed(l,c);return l=="webgl"==u instanceof WebGLRenderingContext?u:null};var a=o;e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=o}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,c){c>>>=0,GLctx.compressedTexImage2D(e,t,r,n,a,o,HEAPU8.subarray(c>>>0,c+l>>>0))}_glCompressedTexImage2D.sig="viiiiiiip";var _emscripten_glCompressedTexImage2D=_glCompressedTexImage2D;_emscripten_glCompressedTexImage2D.sig="viiiiiiip";function _glCompressedTexSubImage2D(e,t,r,n,a,o,l,c,u){u>>>=0,GLctx.compressedTexSubImage2D(e,t,r,n,a,o,l,HEAPU8.subarray(u>>>0,u+c>>>0))}_glCompressedTexSubImage2D.sig="viiiiiiiip";var _emscripten_glCompressedTexSubImage2D=_glCompressedTexSubImage2D;_emscripten_glCompressedTexSubImage2D.sig="viiiiiiiip";var _glCopyTexImage2D=(e,t,r,n,a,o,l,c)=>GLctx.copyTexImage2D(e,t,r,n,a,o,l,c);_glCopyTexImage2D.sig="viiiiiiii";var _emscripten_glCopyTexImage2D=_glCopyTexImage2D;_emscripten_glCopyTexImage2D.sig="viiiiiiii";var _glCopyTexSubImage2D=(e,t,r,n,a,o,l,c)=>GLctx.copyTexSubImage2D(e,t,r,n,a,o,l,c);_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<e;r++){var n=HEAP32[t+r*4>>>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<e;++r){var n=HEAP32[t+r*4>>>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<e;r++){var n=HEAP32[t+r*4>>>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<e;r++){var n=HEAP32[t+r*4>>>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<e;r++){var n=HEAP32[t+r*4>>>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<e;r++){var n=HEAP32[t+r*4>>>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<e;n++)r[n]=HEAP32[t+n*4>>>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<e;r++){var n=GLctx.disjointTimerQueryExt.createQueryEXT();if(!n){for(GL.recordError(1282);r<e;)HEAP32[t+r++*4>>>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,c)=>{t=GL.programs[t];var u=GLctx[e](t,r);if(u){var _=c&&stringToUTF8(u.name,c,n);a&&(HEAP32[a>>>2>>>0]=_),o&&(HEAP32[o>>>2>>>0]=u.size),l&&(HEAP32[l>>>2>>>0]=u.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<o;++l){var c=GL.shaders.indexOf(a[l]);HEAP32[n+l*4>>>2>>>0]=c}}_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<o.length;++l)switch(r){case 0:HEAP32[t+l*4>>>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(c){GL.recordError(1280),err("GL_INVALID_ENUM in glGet".concat(r,"v: Unknown object returned from WebGL getParameter(").concat(e,")! (error: ").concat(c,")"));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<a;++o)e.maxUniformLength=Math.max(e.maxUniformLength,GLctx.getActiveUniform(e,o).name.length+1);HEAP32[r>>>2>>>0]=e.maxUniformLength}else if(t==35722){if(!e.maxAttributeLength)for(var l=GLctx.getProgramParameter(e,35721),o=0;o<l;++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,GLctx.getActiveAttrib(e,o).name.length+1);HEAP32[r>>>2>>>0]=e.maxAttributeLength}else if(t==35381){if(!e.maxUniformBlockNameLength)for(var c=GLctx.getProgramParameter(e,35382),o=0;o<c;++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,GLctx.getActiveUniformBlockName(e,o).length+1);HEAP32[r>>>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]?)(?:$| .*)/,c=o.match(l);c!==null&&(c[1].length==3&&(c[1]=c[1]+"0"),o="OpenGL ES GLSL ES ".concat(c[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;n<o;++n){var l=GLctx.getActiveUniform(e,n),c=l.name,u=l.size,_=webglGetLeftBracePos(c),d=_>0?c.slice(0,_):c,m=e.uniformIdCounter;for(e.uniformIdCounter+=u,r[d]=[u,m],a=0;a<u;++a)t[m]=a,e.uniformArrayNamesById[m++]=d}}};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<l[0]&&(n+=l[1],r[n]=r[n]||GLctx.getUniformLocation(e,t)))return n}else GL.recordError(1281);return-1}_glGetUniformLocation.sig="iip";var _emscripten_glGetUniformLocation=_glGetUniformLocation;_emscripten_glGetUniformLocation.sig="iip";var webglGetUniformLocation=e=>{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<a.length;o++)switch(n){case 0:HEAP32[r+o*4>>>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<a.length;o++)switch(n){case 0:HEAP32[r+o*4>>>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,c){return l+c-1&-c}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),c=colorChannelsInGlTextureFormat(t)*l.BYTES_PER_ELEMENT,u=computeUnpackAlignedImageSize(r,n,c);return l.subarray(toTypedArrayIndex(a,l)>>>0,toTypedArrayIndex(a+u,l)>>>0)};function _glReadPixels(e,t,r,n,a,o,l){l>>>=0;var c=emscriptenWebGLGetTexPixelData(o,a,r,n,l,a);if(!c){GL.recordError(1280);return}GLctx.readPixels(e,t,r,n,a,o,c)}_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){t>>>=0,n>>>=0,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,c,u){u>>>=0;var _=u?emscriptenWebGLGetTexPixelData(c,l,n,a,u,r):null;GLctx.texImage2D(e,t,r,n,a,o,l,c,_)}_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,c,u){u>>>=0;var _=u?emscriptenWebGLGetTexPixelData(c,l,a,o,u,0):null;GLctx.texSubImage2D(e,t,r,n,a,o,l,c,_)}_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 n=miniTempWebGLFloatBuffers[t],a=0;a<t;++a)n[a]=HEAPF32[r+4*a>>>2>>>0];else var n=HEAPF32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1fv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLIntBuffers[t],a=0;a<t;++a)n[a]=HEAP32[r+4*a>>>2>>>0];else var n=HEAP32.subarray(r>>>2>>>0,r+t*4>>>2>>>0);GLctx.uniform1iv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLFloatBuffers[t],a=0;a<t;a+=2)n[a]=HEAPF32[r+4*a>>>2>>>0],n[a+1]=HEAPF32[r+(4*a+4)>>>2>>>0]}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2fv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLIntBuffers[t],a=0;a<t;a+=2)n[a]=HEAP32[r+4*a>>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*8>>>2>>>0);GLctx.uniform2iv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLFloatBuffers[t],a=0;a<t;a+=3)n[a]=HEAPF32[r+4*a>>>2>>>0],n[a+1]=HEAPF32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAPF32[r+(4*a+8)>>>2>>>0]}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3fv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLIntBuffers[t],a=0;a<t;a+=3)n[a]=HEAP32[r+4*a>>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAP32[r+(4*a+8)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*12>>>2>>>0);GLctx.uniform3iv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLFloatBuffers[4*t],a=HEAPF32;r=r>>>2,t*=4;for(var o=0;o<t;o+=4){var l=r+o;n[o]=a[l>>>0],n[o+1]=a[l+1>>>0],n[o+2]=a[l+2>>>0],n[o+3]=a[l+3>>>0]}}else var n=HEAPF32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4fv(webglGetUniformLocation(e),n)}_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 n=miniTempWebGLIntBuffers[t],a=0;a<t;a+=4)n[a]=HEAP32[r+4*a>>>2>>>0],n[a+1]=HEAP32[r+(4*a+4)>>>2>>>0],n[a+2]=HEAP32[r+(4*a+8)>>>2>>>0],n[a+3]=HEAP32[r+(4*a+12)>>>2>>>0]}else var n=HEAP32.subarray(r>>>2>>>0,r+t*16>>>2>>>0);GLctx.uniform4iv(webglGetUniformLocation(e),n)}_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 a=miniTempWebGLFloatBuffers[t],o=0;o<t;o+=4)a[o]=HEAPF32[n+4*o>>>2>>>0],a[o+1]=HEAPF32[n+(4*o+4)>>>2>>>0],a[o+2]=HEAPF32[n+(4*o+8)>>>2>>>0],a[o+3]=HEAPF32[n+(4*o+12)>>>2>>>0]}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*16>>>2>>>0);GLctx.uniformMatrix2fv(webglGetUniformLocation(e),!!r,a)}_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 a=miniTempWebGLFloatBuffers[t],o=0;o<t;o+=9)a[o]=HEAPF32[n+4*o>>>2>>>0],a[o+1]=HEAPF32[n+(4*o+4)>>>2>>>0],a[o+2]=HEAPF32[n+(4*o+8)>>>2>>>0],a[o+3]=HEAPF32[n+(4*o+12)>>>2>>>0],a[o+4]=HEAPF32[n+(4*o+16)>>>2>>>0],a[o+5]=HEAPF32[n+(4*o+20)>>>2>>>0],a[o+6]=HEAPF32[n+(4*o+24)>>>2>>>0],a[o+7]=HEAPF32[n+(4*o+28)>>>2>>>0],a[o+8]=HEAPF32[n+(4*o+32)>>>2>>>0]}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*36>>>2>>>0);GLctx.uniformMatrix3fv(webglGetUniformLocation(e),!!r,a)}_glUniformMatrix3fv.sig="viiip";var _emscripten_glUniformMatrix3fv=_glUniformMatrix3fv;_emscripten_glUniformMatrix3fv.sig="viiip";function _glUniformMatrix4fv(e,t,r,n){if(n>>>=0,t<=18){var a=miniTempWebGLFloatBuffers[16*t],o=HEAPF32;n=n>>>2,t*=16;for(var l=0;l<t;l+=16){var c=n+l;a[l]=o[c>>>0],a[l+1]=o[c+1>>>0],a[l+2]=o[c+2>>>0],a[l+3]=o[c+3>>>0],a[l+4]=o[c+4>>>0],a[l+5]=o[c+5>>>0],a[l+6]=o[c+6>>>0],a[l+7]=o[c+7>>>0],a[l+8]=o[c+8>>>0],a[l+9]=o[c+9>>>0],a[l+10]=o[c+10>>>0],a[l+11]=o[c+11>>>0],a[l+12]=o[c+12>>>0],a[l+13]=o[c+13>>>0],a[l+14]=o[c+14>>>0],a[l+15]=o[c+15>>>0]}}else var a=HEAPF32.subarray(n>>>2>>>0,n+t*64>>>2>>>0);GLctx.uniformMatrix4fv(webglGetUniformLocation(e),!!r,a)}_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(){$e(this,"allocated",[void 0]);$e(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|0;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch(n){}};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";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<e.length;++r)HEAP8[t++>>>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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return c.errno}}_fd_fdstat_get.sig="iip";var doReadv=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var l=HEAPU32[t>>>2>>>0],c=HEAPU32[t+4>>>2>>>0];t+=8;var u=FS.read(e,HEAP8,l,c,n);if(u<0)return-1;if(a+=u,u<c)break;typeof n<"u"&&(n+=u)}return a};function _fd_pread(e,t,r,n,a,o){t>>>=0,r>>>=0;var l=convertI32PairToI53Checked(n,a);o>>>=0;try{if(isNaN(l))return 61;var c=SYSCALLS.getStreamFromFD(e),u=doReadv(c,t,r,l);return HEAPU32[o>>>2>>>0]=u,0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return _.errno}}_fd_pread.sig="iippiip";var doWritev=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var l=HEAPU32[t>>>2>>>0],c=HEAPU32[t+4>>>2>>>0];t+=8;var u=FS.write(e,HEAP8,l,c,n);if(u<0)return-1;if(a+=u,u<c)break;typeof n<"u"&&(n+=u)}return a};function _fd_pwrite(e,t,r,n,a,o){t>>>=0,r>>>=0;var l=convertI32PairToI53Checked(n,a);o>>>=0;try{if(isNaN(l))return 61;var c=SYSCALLS.getStreamFromFD(e),u=doWritev(c,t,r,l);return HEAPU32[o>>>2>>>0]=u,0}catch(_){if(typeof FS>"u"||_.name!=="ErrnoError")throw _;return _.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(c){if(typeof FS>"u"||c.name!=="ErrnoError")throw c;return c.errno}}_fd_seek.sig="iiiiip";function _fd_sync(e){var r;try{var t=SYSCALLS.getStreamFromFD(e);return(r=t.stream_ops)!=null&&r.fsync?t.stream_ops.fsync(t):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,c=0,u=0,_=0,d;function m(p,h,S,w,L,P){var k,C,x,g;return C=p===10?28:16,L=p===10?inetNtop6(L):inetNtop4(L),k=_malloc(C),g=writeSockaddr(k,p,L,P),assert(!g),x=_malloc(32),HEAP32[x+4>>>2>>>0]=p,HEAP32[x+8>>>2>>>0]=h,HEAP32[x+12>>>2>>>0]=S,HEAPU32[x+24>>>2>>>0]=w,HEAPU32[x+20>>>2>>>0]=k,p===10?HEAP32[x+16>>>2>>>0]=28:HEAP32[x+16>>>2>>>0]=16,HEAP32[x+28>>>2>>>0]=0,x}if(r&&(l=HEAP32[r>>>2>>>0],c=HEAP32[r+4>>>2>>>0],u=HEAP32[r+8>>>2>>>0],_=HEAP32[r+12>>>2>>>0]),u&&!_&&(_=u===2?17:6),!u&&_&&(u=_===17?2:1),_===0&&(_=6),u===0&&(u=1),!e&&!t)return-2;if(l&-1088||r!==0&&HEAP32[r>>>2>>>0]&2&&!e)return-1;if(l&32)return-2;if(u!==0&&u!==1&&u!==2)return-7;if(c!==0&&c!==2&&c!==10)return-6;if(t&&(t=UTF8ToString(t),o=parseInt(t,10),isNaN(o)))return l&1024?-2:-8;if(!e)return c===0&&(c=2),l&1||(c===2?a=_htonl(2130706433):a=[0,0,0,_htonl(1)]),d=m(c,u,_,null,a,o),HEAPU32[n>>>2>>>0]=d,0;if(e=UTF8ToString(e),a=inetPton4(e),a!==null)if(c===0||c===2)c=2;else if(c===10&&l&8)a=[0,0,_htonl(65535),a],c=10;else return-2;else if(a=inetPton6(e),a!==null)if(c===0||c===10)c=10;else return-2;return a!=null?(d=m(c,u,_,e,a,o),HEAPU32[n>>>2>>>0]=d,0):l&4?-2:(e=DNS.lookup_name(e),a=inetPton4(e),c===0?c=2:c===10&&(a=[0,0,_htonl(65535),a]),d=m(c,u,_,null,a,o),HEAPU32[n>>>2>>>0]=d,0)}_getaddrinfo.sig="ipppp";function _getnameinfo(e,t,r,n,a,o,l){e>>>=0,r>>>=0,a>>>=0;var c=readSockaddr(e,t);if(c.errno)return-6;var u=c.port,_=c.addr,d=!1;if(r&&n){var m;if(l&1||!(m=DNS.lookup_addr(_))){if(l&8)return-2}else _=m;var p=stringToUTF8(_,r,n);p+1>=n&&(d=!0)}if(a&&o){u=""+u;var p=stringToUTF8(u,a,o);p+1>=o&&(d=!0)}return d?-12:0}_getnameinfo.sig="ipipipii";function _random_get(e,t){e>>>=0,t>>>=0;try{return randomFill(HEAPU8.subarray(e>>>0,e+t>>>0)),0}catch(r){if(typeof FS>"u"||r.name!=="ErrnoError")throw r;return r.errno}}_random_get.sig="ipp";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:S=>{var w=0;return S!=null&&S!==0&&(w=stringToUTF8OnStack(S)),w},array:S=>{var w=stackAlloc(S.length);return writeArrayToMemory(S,w),w}};function l(S){return t==="string"?UTF8ToString(S):t==="boolean"?!!S:S}var c=getCFunc(e),u=[],_=0;if(n)for(var d=0;d<n.length;d++){var m=o[r[d]];m?(_===0&&(_=stackSave()),u[d]=m(n[d])):u[d]=n[d]}var p=c(...u);function h(S){return _!==0&&stackRestore(_),l(S)}return p=h(p),p},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 c=[3,2,1,0];t.push(c);var u=[7,5,1,1,102,0,1];t.push(u);var _=[];e[0]==="j"?_=[1,1,126]:_.push(0);function d(C){_.push(32),uleb128Encode(C,_)}for(var m=1,p=1;p<e.length;p++)e[p]=="j"?(d(m+1),_.push(173,66,32,134),d(m),_.push(172,132),m+=2):(d(m),m++);_.push(32,0,17,1,0),e[0]==="j"&&(_.push(34),uleb128Encode(m,_),_.push(66,32,136,167,16,0),d(m),_.push(167)),_.push(11);var h=[1];uleb128Encode(_.length,h),h.push(..._);var S=[10];uleb128Encode(h.length,S),S.push(...h),t.push(S);var w=new Uint8Array([].concat.apply([],t)),L=new WebAssembly.Module(w),P=new WebAssembly.Instance(L,{e:{t:wasmTable,r:setTempRet0}}),k=P.exports.f;return k},getTempRet0=e=>__emscripten_tempret_get();registerWasmPlugin(),FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit(),embind_init_charCodes(),BindingError=Module.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},InternalError=Module.InternalError=class extends Error{constructor(t){super(t),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 wasmImports={__assert_fail:___assert_fail,__c_longjmp:___c_longjmp,__call_sighandler:___call_sighandler,__cpp_exception:___cpp_exception,__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__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_js:__dlsym_js,_embind_register_bigint:__embind_register_bigint,_embind_register_bool:__embind_register_bool,_embind_register_emval:__embind_register_emval,_embind_register_float:__embind_register_float,_embind_register_integer:__embind_register_integer,_embind_register_memory_view:__embind_register_memory_view,_embind_register_std_string:__embind_register_std_string,_embind_register_std_wstring:__embind_register_std_wstring,_embind_register_void:__embind_register_void,_emscripten_dlopen_js:__emscripten_dlopen_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_get_progname:__emscripten_get_progname,_emscripten_lookup_name:__emscripten_lookup_name,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_set_offscreencanvas_size:__emscripten_set_offscreencanvas_size,_emscripten_system:__emscripten_system,_emval_call_method:__emval_call_method,_emval_decref:__emval_decref,_emval_get_global:__emval_get_global,_emval_get_method_caller:__emval_get_method_caller,_emval_run_destructors:__emval_run_destructors,_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,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_drop_file:_duckdb_web_fs_file_drop_file,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_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,emscripten_alcDevicePauseSOFT:_emscripten_alcDevicePauseSOFT,emscripten_alcDeviceResumeSOFT:_emscripten_alcDeviceResumeSOFT,emscripten_alcGetStringiSOFT:_emscripten_alcGetStringiSOFT,emscripten_alcResetDeviceSOFT:_emscripten_alcResetDeviceSOFT,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_asm_const_ptr:_emscripten_asm_const_ptr,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_date_now:_emscripten_date_now,emscripten_err:_emscripten_err,emscripten_get_heap_max:_emscripten_get_heap_max,emscripten_get_now:_emscripten_get_now,emscripten_get_now_res:_emscripten_get_now_res,emscripten_glActiveTexture:_emscripten_glActiveTexture,emscripten_glAttachShader:_emscripten_glAttachShader,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_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_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_glDeleteVertexArraysOES:_emscripten_glDeleteVertexArraysOES,emscripten_glDepthFunc:_emscripten_glDepthFunc,emscripten_glDepthMask:_emscripten_glDepthMask,emscripten_glDepthRangef:_emscripten_glDepthRangef,emscripten_glDetachShader:_emscripten_glDetachShader,emscripten_glDisable:_emscripten_glDisable,emscripten_glDisableVertexAttribArray:_emscripten_glDisableVertexAttribArray,emscripten_glDrawArrays:_emscripten_glDrawArrays,emscripten_glDrawArraysInstancedANGLE:_emscripten_glDrawArraysInstancedANGLE,emscripten_glDrawBuffersWEBGL:_emscripten_glDrawBuffersWEBGL,emscripten_glDrawElements:_emscripten_glDrawElements,emscripten_glDrawElementsInstancedANGLE:_emscripten_glDrawElementsInstancedANGLE,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_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_glIsVertexArrayOES:_emscripten_glIsVertexArrayOES,emscripten_glLineWidth:_emscripten_glLineWidth,emscripten_glLinkProgram:_emscripten_glLinkProgram,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_glVertexAttribDivisorANGLE:_emscripten_glVertexAttribDivisorANGLE,emscripten_glVertexAttribPointer:_emscripten_glVertexAttribPointer,emscripten_glViewport:_emscripten_glViewport,emscripten_out:_emscripten_out,emscripten_promise_create:_emscripten_promise_create,emscripten_promise_destroy:_emscripten_promise_destroy,emscripten_promise_resolve:_emscripten_promise_resolve,emscripten_resize_heap:_emscripten_resize_heap,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,getaddrinfo:_getaddrinfo,getnameinfo:_getnameinfo,memory:wasmMemory,proc_exit:_proc_exit,random_get:_random_get},wasmExports=createWasm(),__embind_initialize_bindings=Module.__embind_initialize_bindings=()=>(__embind_initialize_bindings=Module.__embind_initialize_bindings=wasmExports._embind_initialize_bindings)(),__embind_register_bindings=Module.__embind_register_bindings=e=>(__embind_register_bindings=Module.__embind_register_bindings=wasmExports._embind_register_bindings)(e),__emval_coro_resume=Module.__emval_coro_resume=(e,t)=>(__emval_coro_resume=Module.__emval_coro_resume=wasmExports._emval_coro_resume)(e,t),_main=Module._main=(e,t)=>(_main=Module._main=wasmExports.main)(e,t),_duckdb_web_fs_glob_add_path=Module._duckdb_web_fs_glob_add_path=e=>(_duckdb_web_fs_glob_add_path=Module._duckdb_web_fs_glob_add_path=wasmExports.duckdb_web_fs_glob_add_path)(e),_duckdb_web_clear_response=Module._duckdb_web_clear_response=()=>(_duckdb_web_clear_response=Module._duckdb_web_clear_response=wasmExports.duckdb_web_clear_response)(),_duckdb_web_fail_with=Module._duckdb_web_fail_with=e=>(_duckdb_web_fail_with=Module._duckdb_web_fail_with=wasmExports.duckdb_web_fail_with)(e),_duckdb_web_reset=Module._duckdb_web_reset=e=>(_duckdb_web_reset=Module._duckdb_web_reset=wasmExports.duckdb_web_reset)(e),_duckdb_web_connect=Module._duckdb_web_connect=()=>(_duckdb_web_connect=Module._duckdb_web_connect=wasmExports.duckdb_web_connect)(),_duckdb_web_disconnect=Module._duckdb_web_disconnect=e=>(_duckdb_web_disconnect=Module._duckdb_web_disconnect=wasmExports.duckdb_web_disconnect)(e),_duckdb_web_access_buffer=Module._duckdb_web_access_buffer=(e,t)=>(_duckdb_web_access_buffer=Module._duckdb_web_access_buffer=wasmExports.duckdb_web_access_buffer)(e,t),_duckdb_web_flush_files=Module._duckdb_web_flush_files=()=>(_duckdb_web_flush_files=Module._duckdb_web_flush_files=wasmExports.duckdb_web_flush_files)(),_duckdb_web_flush_file=Module._duckdb_web_flush_file=e=>(_duckdb_web_flush_file=Module._duckdb_web_flush_file=wasmExports.duckdb_web_flush_file)(e),_duckdb_web_open=Module._duckdb_web_open=(e,t)=>(_duckdb_web_open=Module._duckdb_web_open=wasmExports.duckdb_web_open)(e,t),_duckdb_web_get_global_file_info=Module._duckdb_web_get_global_file_info=(e,t)=>(_duckdb_web_get_global_file_info=Module._duckdb_web_get_global_file_info=wasmExports.duckdb_web_get_global_file_info)(e,t),_duckdb_web_collect_file_stats=Module._duckdb_web_collect_file_stats=(e,t,r)=>(_duckdb_web_collect_file_stats=Module._duckdb_web_collect_file_stats=wasmExports.duckdb_web_collect_file_stats)(e,t,r),_duckdb_web_export_file_stats=Module._duckdb_web_export_file_stats=(e,t)=>(_duckdb_web_export_file_stats=Module._duckdb_web_export_file_stats=wasmExports.duckdb_web_export_file_stats)(e,t),_duckdb_web_fs_drop_file=Module._duckdb_web_fs_drop_file=(e,t)=>(_duckdb_web_fs_drop_file=Module._duckdb_web_fs_drop_file=wasmExports.duckdb_web_fs_drop_file)(e,t),_duckdb_web_fs_drop_files=Module._duckdb_web_fs_drop_files=e=>(_duckdb_web_fs_drop_files=Module._duckdb_web_fs_drop_files=wasmExports.duckdb_web_fs_drop_files)(e),_duckdb_web_fs_glob_file_infos=Module._duckdb_web_fs_glob_file_infos=(e,t)=>(_duckdb_web_fs_glob_file_infos=Module._duckdb_web_fs_glob_file_infos=wasmExports.duckdb_web_fs_glob_file_infos)(e,t),_duckdb_web_fs_get_file_info_by_id=Module._duckdb_web_fs_get_file_info_by_id=(e,t,r)=>(_duckdb_web_fs_get_file_info_by_id=Module._duckdb_web_fs_get_file_info_by_id=wasmExports.duckdb_web_fs_get_file_info_by_id)(e,t,r),_duckdb_web_fs_get_file_info_by_name=Module._duckdb_web_fs_get_file_info_by_name=(e,t,r)=>(_duckdb_web_fs_get_file_info_by_name=Module._duckdb_web_fs_get_file_info_by_name=wasmExports.duckdb_web_fs_get_file_info_by_name)(e,t,r),_duckdb_web_fs_register_file_url=Module._duckdb_web_fs_register_file_url=(e,t,r,n,a)=>(_duckdb_web_fs_register_file_url=Module._duckdb_web_fs_register_file_url=wasmExports.duckdb_web_fs_register_file_url)(e,t,r,n,a),_duckdb_web_fs_register_file_buffer=Module._duckdb_web_fs_register_file_buffer=(e,t,r,n)=>(_duckdb_web_fs_register_file_buffer=Module._duckdb_web_fs_register_file_buffer=wasmExports.duckdb_web_fs_register_file_buffer)(e,t,r,n),_duckdb_web_copy_file_to_buffer=Module._duckdb_web_copy_file_to_buffer=(e,t)=>(_duckdb_web_copy_file_to_buffer=Module._duckdb_web_copy_file_to_buffer=wasmExports.duckdb_web_copy_file_to_buffer)(e,t),_duckdb_web_copy_file_to_path=Module._duckdb_web_copy_file_to_path=(e,t,r)=>(_duckdb_web_copy_file_to_path=Module._duckdb_web_copy_file_to_path=wasmExports.duckdb_web_copy_file_to_path)(e,t,r),_duckdb_web_get_version=Module._duckdb_web_get_version=e=>(_duckdb_web_get_version=Module._duckdb_web_get_version=wasmExports.duckdb_web_get_version)(e),_duckdb_web_get_feature_flags=Module._duckdb_web_get_feature_flags=()=>(_duckdb_web_get_feature_flags=Module._duckdb_web_get_feature_flags=wasmExports.duckdb_web_get_feature_flags)(),_duckdb_web_tokenize=Module._duckdb_web_tokenize=(e,t)=>(_duckdb_web_tokenize=Module._duckdb_web_tokenize=wasmExports.duckdb_web_tokenize)(e,t),_duckdb_web_tokenize_buffer=Module._duckdb_web_tokenize_buffer=(e,t,r)=>(_duckdb_web_tokenize_buffer=Module._duckdb_web_tokenize_buffer=wasmExports.duckdb_web_tokenize_buffer)(e,t,r),_duckdb_web_udf_scalar_create=Module._duckdb_web_udf_scalar_create=(e,t,r)=>(_duckdb_web_udf_scalar_create=Module._duckdb_web_udf_scalar_create=wasmExports.duckdb_web_udf_scalar_create)(e,t,r),_duckdb_web_prepared_create=Module._duckdb_web_prepared_create=(e,t,r)=>(_duckdb_web_prepared_create=Module._duckdb_web_prepared_create=wasmExports.duckdb_web_prepared_create)(e,t,r),_duckdb_web_prepared_create_buffer=Module._duckdb_web_prepared_create_buffer=(e,t,r,n)=>(_duckdb_web_prepared_create_buffer=Module._duckdb_web_prepared_create_buffer=wasmExports.duckdb_web_prepared_create_buffer)(e,t,r,n),_duckdb_web_prepared_close=Module._duckdb_web_prepared_close=(e,t,r)=>(_duckdb_web_prepared_close=Module._duckdb_web_prepared_close=wasmExports.duckdb_web_prepared_close)(e,t,r),_duckdb_web_prepared_run=Module._duckdb_web_prepared_run=(e,t,r,n)=>(_duckdb_web_prepared_run=Module._duckdb_web_prepared_run=wasmExports.duckdb_web_prepared_run)(e,t,r,n),_duckdb_web_prepared_send=Module._duckdb_web_prepared_send=(e,t,r,n)=>(_duckdb_web_prepared_send=Module._duckdb_web_prepared_send=wasmExports.duckdb_web_prepared_send)(e,t,r,n),_duckdb_web_query_run=Module._duckdb_web_query_run=(e,t,r)=>(_duckdb_web_query_run=Module._duckdb_web_query_run=wasmExports.duckdb_web_query_run)(e,t,r),_duckdb_web_query_run_buffer=Module._duckdb_web_query_run_buffer=(e,t,r,n)=>(_duckdb_web_query_run_buffer=Module._duckdb_web_query_run_buffer=wasmExports.duckdb_web_query_run_buffer)(e,t,r,n),_duckdb_web_pending_query_start=Module._duckdb_web_pending_query_start=(e,t,r,n)=>(_duckdb_web_pending_query_start=Module._duckdb_web_pending_query_start=wasmExports.duckdb_web_pending_query_start)(e,t,r,n),_duckdb_web_pending_query_start_buffer=Module._duckdb_web_pending_query_start_buffer=(e,t,r,n,a)=>(_duckdb_web_pending_query_start_buffer=Module._duckdb_web_pending_query_start_buffer=wasmExports.duckdb_web_pending_query_start_buffer)(e,t,r,n,a),_duckdb_web_pending_query_poll=Module._duckdb_web_pending_query_poll=(e,t,r)=>(_duckdb_web_pending_query_poll=Module._duckdb_web_pending_query_poll=wasmExports.duckdb_web_pending_query_poll)(e,t,r),_duckdb_web_pending_query_cancel=Module._duckdb_web_pending_query_cancel=(e,t)=>(_duckdb_web_pending_query_cancel=Module._duckdb_web_pending_query_cancel=wasmExports.duckdb_web_pending_query_cancel)(e,t),_duckdb_web_query_fetch_results=Module._duckdb_web_query_fetch_results=(e,t)=>(_duckdb_web_query_fetch_results=Module._duckdb_web_query_fetch_results=wasmExports.duckdb_web_query_fetch_results)(e,t),_duckdb_web_get_tablenames=Module._duckdb_web_get_tablenames=(e,t,r)=>(_duckdb_web_get_tablenames=Module._duckdb_web_get_tablenames=wasmExports.duckdb_web_get_tablenames)(e,t,r),_duckdb_web_get_tablenames_buffer=Module._duckdb_web_get_tablenames_buffer=(e,t,r,n)=>(_duckdb_web_get_tablenames_buffer=Module._duckdb_web_get_tablenames_buffer=wasmExports.duckdb_web_get_tablenames_buffer)(e,t,r,n),_duckdb_web_insert_arrow_from_ipc_stream=Module._duckdb_web_insert_arrow_from_ipc_stream=(e,t,r,n,a)=>(_duckdb_web_insert_arrow_from_ipc_stream=Module._duckdb_web_insert_arrow_from_ipc_stream=wasmExports.duckdb_web_insert_arrow_from_ipc_stream)(e,t,r,n,a),_duckdb_web_insert_csv_from_path=Module._duckdb_web_insert_csv_from_path=(e,t,r,n)=>(_duckdb_web_insert_csv_from_path=Module._duckdb_web_insert_csv_from_path=wasmExports.duckdb_web_insert_csv_from_path)(e,t,r,n),_duckdb_web_insert_json_from_path=Module._duckdb_web_insert_json_from_path=(e,t,r,n)=>(_duckdb_web_insert_json_from_path=Module._duckdb_web_insert_json_from_path=wasmExports.duckdb_web_insert_json_from_path)(e,t,r,n),_emscripten_GetProcAddress=Module._emscripten_GetProcAddress=e=>(_emscripten_GetProcAddress=Module._emscripten_GetProcAddress=wasmExports.emscripten_GetProcAddress)(e),_emscripten_webgl_get_proc_address=Module._emscripten_webgl_get_proc_address=e=>(_emscripten_webgl_get_proc_address=Module._emscripten_webgl_get_proc_address=wasmExports.emscripten_webgl_get_proc_address)(e),_emscripten_webgl_init_context_attributes=Module._emscripten_webgl_init_context_attributes=e=>(_emscripten_webgl_init_context_attributes=Module._emscripten_webgl_init_context_attributes=wasmExports.emscripten_webgl_init_context_attributes)(e),_emscripten_webgl1_get_proc_address=Module._emscripten_webgl1_get_proc_address=e=>(_emscripten_webgl1_get_proc_address=Module._emscripten_webgl1_get_proc_address=wasmExports.emscripten_webgl1_get_proc_address)(e),__emscripten_run_callback_on_thread=Module.__emscripten_run_callback_on_thread=(e,t,r,n,a)=>(__emscripten_run_callback_on_thread=Module.__emscripten_run_callback_on_thread=wasmExports._emscripten_run_callback_on_thread)(e,t,r,n,a),_emscripten_compute_dom_pk_code=Module._emscripten_compute_dom_pk_code=e=>(_emscripten_compute_dom_pk_code=Module._emscripten_compute_dom_pk_code=wasmExports.emscripten_compute_dom_pk_code)(e),_emscripten_dom_pk_code_to_string=Module._emscripten_dom_pk_code_to_string=e=>(_emscripten_dom_pk_code_to_string=Module._emscripten_dom_pk_code_to_string=wasmExports.emscripten_dom_pk_code_to_string)(e),_emscripten_dom_vk_to_string=Module._emscripten_dom_vk_to_string=e=>(_emscripten_dom_vk_to_string=Module._emscripten_dom_vk_to_string=wasmExports.emscripten_dom_vk_to_string)(e),__emscripten_set_offscreencanvas_size_on_thread=Module.__emscripten_set_offscreencanvas_size_on_thread=(e,t,r,n)=>(__emscripten_set_offscreencanvas_size_on_thread=Module.__emscripten_set_offscreencanvas_size_on_thread=wasmExports._emscripten_set_offscreencanvas_size_on_thread)(e,t,r,n),_emscripten_builtin_memcpy=Module._emscripten_builtin_memcpy=(e,t,r)=>(_emscripten_builtin_memcpy=Module._emscripten_builtin_memcpy=wasmExports.emscripten_builtin_memcpy)(e,t,r),_emscripten_builtin_memset=Module._emscripten_builtin_memset=(e,t,r)=>(_emscripten_builtin_memset=Module._emscripten_builtin_memset=wasmExports.emscripten_builtin_memset)(e,t,r),___dl_seterr=Module.___dl_seterr=(e,t)=>(___dl_seterr=Module.___dl_seterr=wasmExports.__dl_seterr)(e,t),_emscripten_dlopen=Module._emscripten_dlopen=(e,t,r,n,a)=>(_emscripten_dlopen=Module._emscripten_dlopen=wasmExports.emscripten_dlopen)(e,t,r,n,a),_emscripten_dlopen_promise=Module._emscripten_dlopen_promise=(e,t)=>(_emscripten_dlopen_promise=Module._emscripten_dlopen_promise=wasmExports.emscripten_dlopen_promise)(e,t),_emscripten_console_logf=Module._emscripten_console_logf=(e,t)=>(_emscripten_console_logf=Module._emscripten_console_logf=wasmExports.emscripten_console_logf)(e,t),_emscripten_console_errorf=Module._emscripten_console_errorf=(e,t)=>(_emscripten_console_errorf=Module._emscripten_console_errorf=wasmExports.emscripten_console_errorf)(e,t),_emscripten_console_warnf=Module._emscripten_console_warnf=(e,t)=>(_emscripten_console_warnf=Module._emscripten_console_warnf=wasmExports.emscripten_console_warnf)(e,t),_emscripten_console_tracef=Module._emscripten_console_tracef=(e,t)=>(_emscripten_console_tracef=Module._emscripten_console_tracef=wasmExports.emscripten_console_tracef)(e,t),_emscripten_outf=Module._emscripten_outf=(e,t)=>(_emscripten_outf=Module._emscripten_outf=wasmExports.emscripten_outf)(e,t),_emscripten_errf=Module._emscripten_errf=(e,t)=>(_emscripten_errf=Module._emscripten_errf=wasmExports.emscripten_errf)(e,t),_emscripten_fiber_init=Module._emscripten_fiber_init=(e,t,r,n,a,o,l)=>(_emscripten_fiber_init=Module._emscripten_fiber_init=wasmExports.emscripten_fiber_init)(e,t,r,n,a,o,l),_emscripten_fiber_init_from_current_context=Module._emscripten_fiber_init_from_current_context=(e,t,r)=>(_emscripten_fiber_init_from_current_context=Module._emscripten_fiber_init_from_current_context=wasmExports.emscripten_fiber_init_from_current_context)(e,t,r),_emscripten_get_heap_size=Module._emscripten_get_heap_size=()=>(_emscripten_get_heap_size=Module._emscripten_get_heap_size=wasmExports.emscripten_get_heap_size)(),_emscripten_scan_stack=Module._emscripten_scan_stack=e=>(_emscripten_scan_stack=Module._emscripten_scan_stack=wasmExports.emscripten_scan_stack)(e),_freelocale=Module._freelocale=e=>(_freelocale=Module._freelocale=wasmExports.freelocale)(e),_freeifaddrs=Module._freeifaddrs=e=>(_freeifaddrs=Module._freeifaddrs=wasmExports.freeifaddrs)(e),_emscripten_has_threading_support=Module._emscripten_has_threading_support=()=>(_emscripten_has_threading_support=Module._emscripten_has_threading_support=wasmExports.emscripten_has_threading_support)(),_emscripten_num_logical_cores=Module._emscripten_num_logical_cores=()=>(_emscripten_num_logical_cores=Module._emscripten_num_logical_cores=wasmExports.emscripten_num_logical_cores)(),_emscripten_futex_wait=Module._emscripten_futex_wait=(e,t,r)=>(_emscripten_futex_wait=Module._emscripten_futex_wait=wasmExports.emscripten_futex_wait)(e,t,r),_emscripten_futex_wake=Module._emscripten_futex_wake=(e,t)=>(_emscripten_futex_wake=Module._emscripten_futex_wake=wasmExports.emscripten_futex_wake)(e,t),_emscripten_is_main_runtime_thread=Module._emscripten_is_main_runtime_thread=()=>(_emscripten_is_main_runtime_thread=Module._emscripten_is_main_runtime_thread=wasmExports.emscripten_is_main_runtime_thread)(),_emscripten_main_thread_process_queued_calls=Module._emscripten_main_thread_process_queued_calls=()=>(_emscripten_main_thread_process_queued_calls=Module._emscripten_main_thread_process_queued_calls=wasmExports.emscripten_main_thread_process_queued_calls)(),_emscripten_current_thread_process_queued_calls=Module._emscripten_current_thread_process_queued_calls=()=>(_emscripten_current_thread_process_queued_calls=Module._emscripten_current_thread_process_queued_calls=wasmExports.emscripten_current_thread_process_queued_calls)(),__emscripten_yield=Module.__emscripten_yield=e=>(__emscripten_yield=Module.__emscripten_yield=wasmExports._emscripten_yield)(e),__emscripten_check_timers=Module.__emscripten_check_timers=e=>(__emscripten_check_timers=Module.__emscripten_check_timers=wasmExports._emscripten_check_timers)(e),_pthread_mutex_init=Module._pthread_mutex_init=(e,t)=>(_pthread_mutex_init=Module._pthread_mutex_init=wasmExports.pthread_mutex_init)(e,t),_pthread_mutex_destroy=Module._pthread_mutex_destroy=e=>(_pthread_mutex_destroy=Module._pthread_mutex_destroy=wasmExports.pthread_mutex_destroy)(e),_pthread_mutex_consistent=Module._pthread_mutex_consistent=e=>(_pthread_mutex_consistent=Module._pthread_mutex_consistent=wasmExports.pthread_mutex_consistent)(e),_pthread_barrier_init=Module._pthread_barrier_init=(e,t,r)=>(_pthread_barrier_init=Module._pthread_barrier_init=wasmExports.pthread_barrier_init)(e,t,r),_pthread_barrier_destroy=Module._pthread_barrier_destroy=e=>(_pthread_barrier_destroy=Module._pthread_barrier_destroy=wasmExports.pthread_barrier_destroy)(e),_pthread_barrier_wait=Module._pthread_barrier_wait=e=>(_pthread_barrier_wait=Module._pthread_barrier_wait=wasmExports.pthread_barrier_wait)(e),_pthread_getspecific=Module._pthread_getspecific=e=>(_pthread_getspecific=Module._pthread_getspecific=wasmExports.pthread_getspecific)(e),_pthread_setspecific=Module._pthread_setspecific=(e,t)=>(_pthread_setspecific=Module._pthread_setspecific=wasmExports.pthread_setspecific)(e,t),_pthread_cond_wait=Module._pthread_cond_wait=(e,t)=>(_pthread_cond_wait=Module._pthread_cond_wait=wasmExports.pthread_cond_wait)(e,t),_pthread_cond_signal=Module._pthread_cond_signal=e=>(_pthread_cond_signal=Module._pthread_cond_signal=wasmExports.pthread_cond_signal)(e),_pthread_cond_broadcast=Module._pthread_cond_broadcast=e=>(_pthread_cond_broadcast=Module._pthread_cond_broadcast=wasmExports.pthread_cond_broadcast)(e),_pthread_cond_init=Module._pthread_cond_init=(e,t)=>(_pthread_cond_init=Module._pthread_cond_init=wasmExports.pthread_cond_init)(e,t),_pthread_cond_destroy=Module._pthread_cond_destroy=e=>(_pthread_cond_destroy=Module._pthread_cond_destroy=wasmExports.pthread_cond_destroy)(e),_pthread_atfork=Module._pthread_atfork=(e,t,r)=>(_pthread_atfork=Module._pthread_atfork=wasmExports.pthread_atfork)(e,t,r),_pthread_cancel=Module._pthread_cancel=e=>(_pthread_cancel=Module._pthread_cancel=wasmExports.pthread_cancel)(e),_pthread_testcancel=Module._pthread_testcancel=()=>(_pthread_testcancel=Module._pthread_testcancel=wasmExports.pthread_testcancel)(),_pthread_equal=Module._pthread_equal=(e,t)=>(_pthread_equal=Module._pthread_equal=wasmExports.pthread_equal)(e,t),_pthread_mutexattr_init=Module._pthread_mutexattr_init=e=>(_pthread_mutexattr_init=Module._pthread_mutexattr_init=wasmExports.pthread_mutexattr_init)(e),_pthread_mutexattr_setprotocol=Module._pthread_mutexattr_setprotocol=(e,t)=>(_pthread_mutexattr_setprotocol=Module._pthread_mutexattr_setprotocol=wasmExports.pthread_mutexattr_setprotocol)(e,t),_pthread_mutexattr_settype=Module._pthread_mutexattr_settype=(e,t)=>(_pthread_mutexattr_settype=Module._pthread_mutexattr_settype=wasmExports.pthread_mutexattr_settype)(e,t),_pthread_mutexattr_destroy=Module._pthread_mutexattr_destroy=e=>(_pthread_mutexattr_destroy=Module._pthread_mutexattr_destroy=wasmExports.pthread_mutexattr_destroy)(e),_pthread_mutexattr_setpshared=Module._pthread_mutexattr_setpshared=(e,t)=>(_pthread_mutexattr_setpshared=Module._pthread_mutexattr_setpshared=wasmExports.pthread_mutexattr_setpshared)(e,t),_pthread_condattr_init=Module._pthread_condattr_init=e=>(_pthread_condattr_init=Module._pthread_condattr_init=wasmExports.pthread_condattr_init)(e),_pthread_condattr_destroy=Module._pthread_condattr_destroy=e=>(_pthread_condattr_destroy=Module._pthread_condattr_destroy=wasmExports.pthread_condattr_destroy)(e),_pthread_condattr_setclock=Module._pthread_condattr_setclock=(e,t)=>(_pthread_condattr_setclock=Module._pthread_condattr_setclock=wasmExports.pthread_condattr_setclock)(e,t),_pthread_condattr_setpshared=Module._pthread_condattr_setpshared=(e,t)=>(_pthread_condattr_setpshared=Module._pthread_condattr_setpshared=wasmExports.pthread_condattr_setpshared)(e,t),_pthread_getattr_np=Module._pthread_getattr_np=(e,t)=>(_pthread_getattr_np=Module._pthread_getattr_np=wasmExports.pthread_getattr_np)(e,t),_pthread_setcancelstate=Module._pthread_setcancelstate=(e,t)=>(_pthread_setcancelstate=Module._pthread_setcancelstate=wasmExports.pthread_setcancelstate)(e,t),_pthread_setcanceltype=Module._pthread_setcanceltype=(e,t)=>(_pthread_setcanceltype=Module._pthread_setcanceltype=wasmExports.pthread_setcanceltype)(e,t),_pthread_rwlock_init=Module._pthread_rwlock_init=(e,t)=>(_pthread_rwlock_init=Module._pthread_rwlock_init=wasmExports.pthread_rwlock_init)(e,t),_pthread_rwlock_destroy=Module._pthread_rwlock_destroy=e=>(_pthread_rwlock_destroy=Module._pthread_rwlock_destroy=wasmExports.pthread_rwlock_destroy)(e),_pthread_rwlock_rdlock=Module._pthread_rwlock_rdlock=e=>(_pthread_rwlock_rdlock=Module._pthread_rwlock_rdlock=wasmExports.pthread_rwlock_rdlock)(e),_pthread_rwlock_tryrdlock=Module._pthread_rwlock_tryrdlock=e=>(_pthread_rwlock_tryrdlock=Module._pthread_rwlock_tryrdlock=wasmExports.pthread_rwlock_tryrdlock)(e),_pthread_rwlock_timedrdlock=Module._pthread_rwlock_timedrdlock=(e,t)=>(_pthread_rwlock_timedrdlock=Module._pthread_rwlock_timedrdlock=wasmExports.pthread_rwlock_timedrdlock)(e,t),_pthread_rwlock_wrlock=Module._pthread_rwlock_wrlock=e=>(_pthread_rwlock_wrlock=Module._pthread_rwlock_wrlock=wasmExports.pthread_rwlock_wrlock)(e),_pthread_rwlock_trywrlock=Module._pthread_rwlock_trywrlock=e=>(_pthread_rwlock_trywrlock=Module._pthread_rwlock_trywrlock=wasmExports.pthread_rwlock_trywrlock)(e),_pthread_rwlock_timedwrlock=Module._pthread_rwlock_timedwrlock=(e,t)=>(_pthread_rwlock_timedwrlock=Module._pthread_rwlock_timedwrlock=wasmExports.pthread_rwlock_timedwrlock)(e,t),_pthread_rwlock_unlock=Module._pthread_rwlock_unlock=e=>(_pthread_rwlock_unlock=Module._pthread_rwlock_unlock=wasmExports.pthread_rwlock_unlock)(e),_pthread_rwlockattr_init=Module._pthread_rwlockattr_init=e=>(_pthread_rwlockattr_init=Module._pthread_rwlockattr_init=wasmExports.pthread_rwlockattr_init)(e),_pthread_rwlockattr_destroy=Module._pthread_rwlockattr_destroy=e=>(_pthread_rwlockattr_destroy=Module._pthread_rwlockattr_destroy=wasmExports.pthread_rwlockattr_destroy)(e),_pthread_rwlockattr_setpshared=Module._pthread_rwlockattr_setpshared=(e,t)=>(_pthread_rwlockattr_setpshared=Module._pthread_rwlockattr_setpshared=wasmExports.pthread_rwlockattr_setpshared)(e,t),_pthread_spin_init=Module._pthread_spin_init=(e,t)=>(_pthread_spin_init=Module._pthread_spin_init=wasmExports.pthread_spin_init)(e,t),_pthread_spin_destroy=Module._pthread_spin_destroy=e=>(_pthread_spin_destroy=Module._pthread_spin_destroy=wasmExports.pthread_spin_destroy)(e),_pthread_spin_lock=Module._pthread_spin_lock=e=>(_pthread_spin_lock=Module._pthread_spin_lock=wasmExports.pthread_spin_lock)(e),_pthread_spin_trylock=Module._pthread_spin_trylock=e=>(_pthread_spin_trylock=Module._pthread_spin_trylock=wasmExports.pthread_spin_trylock)(e),_pthread_spin_unlock=Module._pthread_spin_unlock=e=>(_pthread_spin_unlock=Module._pthread_spin_unlock=wasmExports.pthread_spin_unlock)(e),_emscripten_thread_sleep=Module._emscripten_thread_sleep=e=>(_emscripten_thread_sleep=Module._emscripten_thread_sleep=wasmExports.emscripten_thread_sleep)(e),_pthread_mutex_lock=Module._pthread_mutex_lock=e=>(_pthread_mutex_lock=Module._pthread_mutex_lock=wasmExports.pthread_mutex_lock)(e),_pthread_mutex_unlock=Module._pthread_mutex_unlock=e=>(_pthread_mutex_unlock=Module._pthread_mutex_unlock=wasmExports.pthread_mutex_unlock)(e),_pthread_mutex_trylock=Module._pthread_mutex_trylock=e=>(_pthread_mutex_trylock=Module._pthread_mutex_trylock=wasmExports.pthread_mutex_trylock)(e),_pthread_mutex_timedlock=Module._pthread_mutex_timedlock=(e,t)=>(_pthread_mutex_timedlock=Module._pthread_mutex_timedlock=wasmExports.pthread_mutex_timedlock)(e,t),_emscripten_builtin_pthread_create=Module._emscripten_builtin_pthread_create=(e,t,r,n)=>(_emscripten_builtin_pthread_create=Module._emscripten_builtin_pthread_create=wasmExports.emscripten_builtin_pthread_create)(e,t,r,n),_pthread_create=Module._pthread_create=(e,t,r,n)=>(_pthread_create=Module._pthread_create=wasmExports.pthread_create)(e,t,r,n),_emscripten_builtin_pthread_join=Module._emscripten_builtin_pthread_join=(e,t)=>(_emscripten_builtin_pthread_join=Module._emscripten_builtin_pthread_join=wasmExports.emscripten_builtin_pthread_join)(e,t),_pthread_join=Module._pthread_join=(e,t)=>(_pthread_join=Module._pthread_join=wasmExports.pthread_join)(e,t),_pthread_key_delete=Module._pthread_key_delete=e=>(_pthread_key_delete=Module._pthread_key_delete=wasmExports.pthread_key_delete)(e),_pthread_key_create=Module._pthread_key_create=(e,t)=>(_pthread_key_create=Module._pthread_key_create=wasmExports.pthread_key_create)(e,t),_pthread_once=Module._pthread_once=(e,t)=>(_pthread_once=Module._pthread_once=wasmExports.pthread_once)(e,t),_pthread_cond_timedwait=Module._pthread_cond_timedwait=(e,t,r)=>(_pthread_cond_timedwait=Module._pthread_cond_timedwait=wasmExports.pthread_cond_timedwait)(e,t,r),_emscripten_builtin_pthread_exit=Module._emscripten_builtin_pthread_exit=e=>(_emscripten_builtin_pthread_exit=Module._emscripten_builtin_pthread_exit=wasmExports.emscripten_builtin_pthread_exit)(e),_pthread_exit=Module._pthread_exit=e=>(_pthread_exit=Module._pthread_exit=wasmExports.pthread_exit)(e),_emscripten_builtin_pthread_detach=Module._emscripten_builtin_pthread_detach=e=>(_emscripten_builtin_pthread_detach=Module._emscripten_builtin_pthread_detach=wasmExports.emscripten_builtin_pthread_detach)(e),_pthread_detach=Module._pthread_detach=e=>(_pthread_detach=Module._pthread_detach=wasmExports.pthread_detach)(e),_emscripten_builtin_mmap=Module._emscripten_builtin_mmap=(e,t,r,n,a,o,l)=>(_emscripten_builtin_mmap=Module._emscripten_builtin_mmap=wasmExports.emscripten_builtin_mmap)(e,t,r,n,a,o,l),_emscripten_builtin_munmap=Module._emscripten_builtin_munmap=(e,t)=>(_emscripten_builtin_munmap=Module._emscripten_builtin_munmap=wasmExports.emscripten_builtin_munmap)(e,t),_em_proxying_queue_create=Module._em_proxying_queue_create=()=>(_em_proxying_queue_create=Module._em_proxying_queue_create=wasmExports.em_proxying_queue_create)(),_em_proxying_queue_destroy=Module._em_proxying_queue_destroy=e=>(_em_proxying_queue_destroy=Module._em_proxying_queue_destroy=wasmExports.em_proxying_queue_destroy)(e),_emscripten_proxy_get_system_queue=Module._emscripten_proxy_get_system_queue=()=>(_emscripten_proxy_get_system_queue=Module._emscripten_proxy_get_system_queue=wasmExports.emscripten_proxy_get_system_queue)(),_emscripten_proxy_execute_queue=Module._emscripten_proxy_execute_queue=e=>(_emscripten_proxy_execute_queue=Module._emscripten_proxy_execute_queue=wasmExports.emscripten_proxy_execute_queue)(e),_emscripten_proxy_finish=Module._emscripten_proxy_finish=e=>(_emscripten_proxy_finish=Module._emscripten_proxy_finish=wasmExports.emscripten_proxy_finish)(e),_emscripten_proxy_async=Module._emscripten_proxy_async=(e,t,r,n)=>(_emscripten_proxy_async=Module._emscripten_proxy_async=wasmExports.emscripten_proxy_async)(e,t,r,n),_emscripten_proxy_sync=Module._emscripten_proxy_sync=(e,t,r,n)=>(_emscripten_proxy_sync=Module._emscripten_proxy_sync=wasmExports.emscripten_proxy_sync)(e,t,r,n),_emscripten_proxy_sync_with_ctx=Module._emscripten_proxy_sync_with_ctx=(e,t,r,n)=>(_emscripten_proxy_sync_with_ctx=Module._emscripten_proxy_sync_with_ctx=wasmExports.emscripten_proxy_sync_with_ctx)(e,t,r,n),_pthread_attr_destroy=Module._pthread_attr_destroy=e=>(_pthread_attr_destroy=Module._pthread_attr_destroy=wasmExports.pthread_attr_destroy)(e),_pthread_attr_getdetachstate=Module._pthread_attr_getdetachstate=(e,t)=>(_pthread_attr_getdetachstate=Module._pthread_attr_getdetachstate=wasmExports.pthread_attr_getdetachstate)(e,t),_pthread_attr_getguardsize=Module._pthread_attr_getguardsize=(e,t)=>(_pthread_attr_getguardsize=Module._pthread_attr_getguardsize=wasmExports.pthread_attr_getguardsize)(e,t),_pthread_attr_getinheritsched=Module._pthread_attr_getinheritsched=(e,t)=>(_pthread_attr_getinheritsched=Module._pthread_attr_getinheritsched=wasmExports.pthread_attr_getinheritsched)(e,t),_pthread_attr_getschedparam=Module._pthread_attr_getschedparam=(e,t)=>(_pthread_attr_getschedparam=Module._pthread_attr_getschedparam=wasmExports.pthread_attr_getschedparam)(e,t),_pthread_attr_getschedpolicy=Module._pthread_attr_getschedpolicy=(e,t)=>(_pthread_attr_getschedpolicy=Module._pthread_attr_getschedpolicy=wasmExports.pthread_attr_getschedpolicy)(e,t),_pthread_attr_getscope=Module._pthread_attr_getscope=(e,t)=>(_pthread_attr_getscope=Module._pthread_attr_getscope=wasmExports.pthread_attr_getscope)(e,t),_pthread_attr_getstack=Module._pthread_attr_getstack=(e,t,r)=>(_pthread_attr_getstack=Module._pthread_attr_getstack=wasmExports.pthread_attr_getstack)(e,t,r),_pthread_attr_getstacksize=Module._pthread_attr_getstacksize=(e,t)=>(_pthread_attr_getstacksize=Module._pthread_attr_getstacksize=wasmExports.pthread_attr_getstacksize)(e,t),_pthread_barrierattr_getpshared=Module._pthread_barrierattr_getpshared=(e,t)=>(_pthread_barrierattr_getpshared=Module._pthread_barrierattr_getpshared=wasmExports.pthread_barrierattr_getpshared)(e,t),_pthread_condattr_getclock=Module._pthread_condattr_getclock=(e,t)=>(_pthread_condattr_getclock=Module._pthread_condattr_getclock=wasmExports.pthread_condattr_getclock)(e,t),_pthread_condattr_getpshared=Module._pthread_condattr_getpshared=(e,t)=>(_pthread_condattr_getpshared=Module._pthread_condattr_getpshared=wasmExports.pthread_condattr_getpshared)(e,t),_pthread_mutexattr_getprotocol=Module._pthread_mutexattr_getprotocol=(e,t)=>(_pthread_mutexattr_getprotocol=Module._pthread_mutexattr_getprotocol=wasmExports.pthread_mutexattr_getprotocol)(e,t),_pthread_mutexattr_getpshared=Module._pthread_mutexattr_getpshared=(e,t)=>(_pthread_mutexattr_getpshared=Module._pthread_mutexattr_getpshared=wasmExports.pthread_mutexattr_getpshared)(e,t),_pthread_mutexattr_getrobust=Module._pthread_mutexattr_getrobust=(e,t)=>(_pthread_mutexattr_getrobust=Module._pthread_mutexattr_getrobust=wasmExports.pthread_mutexattr_getrobust)(e,t),_pthread_mutexattr_gettype=Module._pthread_mutexattr_gettype=(e,t)=>(_pthread_mutexattr_gettype=Module._pthread_mutexattr_gettype=wasmExports.pthread_mutexattr_gettype)(e,t),_pthread_rwlockattr_getpshared=Module._pthread_rwlockattr_getpshared=(e,t)=>(_pthread_rwlockattr_getpshared=Module._pthread_rwlockattr_getpshared=wasmExports.pthread_rwlockattr_getpshared)(e,t),_pthread_attr_init=Module._pthread_attr_init=e=>(_pthread_attr_init=Module._pthread_attr_init=wasmExports.pthread_attr_init)(e),_pthread_attr_setdetachstate=Module._pthread_attr_setdetachstate=(e,t)=>(_pthread_attr_setdetachstate=Module._pthread_attr_setdetachstate=wasmExports.pthread_attr_setdetachstate)(e,t),_pthread_attr_setguardsize=Module._pthread_attr_setguardsize=(e,t)=>(_pthread_attr_setguardsize=Module._pthread_attr_setguardsize=wasmExports.pthread_attr_setguardsize)(e,t),_pthread_attr_setinheritsched=Module._pthread_attr_setinheritsched=(e,t)=>(_pthread_attr_setinheritsched=Module._pthread_attr_setinheritsched=wasmExports.pthread_attr_setinheritsched)(e,t),_pthread_attr_setschedparam=Module._pthread_attr_setschedparam=(e,t)=>(_pthread_attr_setschedparam=Module._pthread_attr_setschedparam=wasmExports.pthread_attr_setschedparam)(e,t),_pthread_attr_setschedpolicy=Module._pthread_attr_setschedpolicy=(e,t)=>(_pthread_attr_setschedpolicy=Module._pthread_attr_setschedpolicy=wasmExports.pthread_attr_setschedpolicy)(e,t),_pthread_attr_setscope=Module._pthread_attr_setscope=(e,t)=>(_pthread_attr_setscope=Module._pthread_attr_setscope=wasmExports.pthread_attr_setscope)(e,t),_pthread_attr_setstack=Module._pthread_attr_setstack=(e,t,r)=>(_pthread_attr_setstack=Module._pthread_attr_setstack=wasmExports.pthread_attr_setstack)(e,t,r),_pthread_attr_setstacksize=Module._pthread_attr_setstacksize=(e,t)=>(_pthread_attr_setstacksize=Module._pthread_attr_setstacksize=wasmExports.pthread_attr_setstacksize)(e,t),_pthread_getconcurrency=Module._pthread_getconcurrency=()=>(_pthread_getconcurrency=Module._pthread_getconcurrency=wasmExports.pthread_getconcurrency)(),_pthread_getcpuclockid=Module._pthread_getcpuclockid=(e,t)=>(_pthread_getcpuclockid=Module._pthread_getcpuclockid=wasmExports.pthread_getcpuclockid)(e,t),_pthread_getschedparam=Module._pthread_getschedparam=(e,t,r)=>(_pthread_getschedparam=Module._pthread_getschedparam=wasmExports.pthread_getschedparam)(e,t,r),_pthread_self=Module._pthread_self=()=>(_pthread_self=Module._pthread_self=wasmExports.pthread_self)(),_emscripten_main_runtime_thread_id=Module._emscripten_main_runtime_thread_id=()=>(_emscripten_main_runtime_thread_id=Module._emscripten_main_runtime_thread_id=wasmExports.emscripten_main_runtime_thread_id)(),_pthread_setconcurrency=Module._pthread_setconcurrency=e=>(_pthread_setconcurrency=Module._pthread_setconcurrency=wasmExports.pthread_setconcurrency)(e),_pthread_setschedprio=Module._pthread_setschedprio=(e,t)=>(_pthread_setschedprio=Module._pthread_setschedprio=wasmExports.pthread_setschedprio)(e,t),_pthread_sigmask=Module._pthread_sigmask=(e,t,r)=>(_pthread_sigmask=Module._pthread_sigmask=wasmExports.pthread_sigmask)(e,t,r),__emscripten_timeout=Module.__emscripten_timeout=(e,t)=>(__emscripten_timeout=Module.__emscripten_timeout=wasmExports._emscripten_timeout)(e,t),_emscripten_set_thread_name=Module._emscripten_set_thread_name=(e,t)=>(_emscripten_set_thread_name=Module._emscripten_set_thread_name=wasmExports.emscripten_set_thread_name)(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),_malloc_trim=Module._malloc_trim=e=>(_malloc_trim=Module._malloc_trim=wasmExports.malloc_trim)(e),_malloc_usable_size=Module._malloc_usable_size=e=>(_malloc_usable_size=Module._malloc_usable_size=wasmExports.malloc_usable_size)(e),_malloc_footprint=Module._malloc_footprint=()=>(_malloc_footprint=Module._malloc_footprint=wasmExports.malloc_footprint)(),_malloc_max_footprint=Module._malloc_max_footprint=()=>(_malloc_max_footprint=Module._malloc_max_footprint=wasmExports.malloc_max_footprint)(),_malloc_footprint_limit=Module._malloc_footprint_limit=()=>(_malloc_footprint_limit=Module._malloc_footprint_limit=wasmExports.malloc_footprint_limit)(),_malloc_set_footprint_limit=Module._malloc_set_footprint_limit=e=>(_malloc_set_footprint_limit=Module._malloc_set_footprint_limit=wasmExports.malloc_set_footprint_limit)(e),_emscripten_builtin_malloc=Module._emscripten_builtin_malloc=e=>(_emscripten_builtin_malloc=Module._emscripten_builtin_malloc=wasmExports.emscripten_builtin_malloc)(e),_emscripten_builtin_calloc=Module._emscripten_builtin_calloc=(e,t)=>(_emscripten_builtin_calloc=Module._emscripten_builtin_calloc=wasmExports.emscripten_builtin_calloc)(e,t),_emscripten_builtin_free=Module._emscripten_builtin_free=e=>(_emscripten_builtin_free=Module._emscripten_builtin_free=wasmExports.emscripten_builtin_free)(e),_emscripten_builtin_memalign=Module._emscripten_builtin_memalign=(e,t)=>(_emscripten_builtin_memalign=Module._emscripten_builtin_memalign=wasmExports.emscripten_builtin_memalign)(e,t),_emscripten_get_sbrk_ptr=Module._emscripten_get_sbrk_ptr=()=>(_emscripten_get_sbrk_ptr=Module._emscripten_get_sbrk_ptr=wasmExports.emscripten_get_sbrk_ptr)(),__emscripten_tempret_set=Module.__emscripten_tempret_set=e=>(__emscripten_tempret_set=Module.__emscripten_tempret_set=wasmExports._emscripten_tempret_set)(e),__emscripten_tempret_get=Module.__emscripten_tempret_get=()=>(__emscripten_tempret_get=Module.__emscripten_tempret_get=wasmExports._emscripten_tempret_get)(),_emscripten_stack_init=Module._emscripten_stack_init=()=>(_emscripten_stack_init=Module._emscripten_stack_init=wasmExports.emscripten_stack_init)(),_emscripten_stack_set_limits=Module._emscripten_stack_set_limits=(e,t)=>(_emscripten_stack_set_limits=Module._emscripten_stack_set_limits=wasmExports.emscripten_stack_set_limits)(e,t),_emscripten_stack_get_free=Module._emscripten_stack_get_free=()=>(_emscripten_stack_get_free=Module._emscripten_stack_get_free=wasmExports.emscripten_stack_get_free)(),_emscripten_stack_get_base=Module._emscripten_stack_get_base=()=>(_emscripten_stack_get_base=Module._emscripten_stack_get_base=wasmExports.emscripten_stack_get_base)(),_emscripten_stack_get_end=Module._emscripten_stack_get_end=()=>(_emscripten_stack_get_end=Module._emscripten_stack_get_end=wasmExports.emscripten_stack_get_end)(),__emscripten_stack_restore=Module.__emscripten_stack_restore=e=>(__emscripten_stack_restore=Module.__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(e),__emscripten_stack_alloc=Module.__emscripten_stack_alloc=e=>(__emscripten_stack_alloc=Module.__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(e),_emscripten_stack_get_current=Module._emscripten_stack_get_current=()=>(_emscripten_stack_get_current=Module._emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),_freeaddrinfo=Module._freeaddrinfo=e=>(_freeaddrinfo=Module._freeaddrinfo=wasmExports.freeaddrinfo)(e),__ZTVNSt3__217__owns_two_statesIcEE=Module.__ZTVNSt3__217__owns_two_statesIcEE=2241e3,__ZTSNSt3__214default_deleteIN5arrow14NumericBuilderINS1_10UInt16TypeEEEEE=Module.__ZTSNSt3__214default_deleteIN5arrow14NumericBuilderINS1_10UInt16TypeEEEEE=1646e3,__ZTINSt3__220__shared_ptr_emplaceIN5arrow8ListTypeENS_9allocatorIS2_EEEE=Module.__ZTINSt3__220__shared_ptr_emplaceIN5arrow8ListTypeENS_9allocatorIS2_EEEE=2065e3,__ZTVN6duckdb13DynamicFilterE=Module.__ZTVN6duckdb13DynamicFilterE=2116e3,__ZTVN6duckdb17NotNullConstraintE=Module.__ZTVN6duckdb17NotNullConstraintE=2187e3,__ZTIN6duckdb21WindowLeadLagExecutorE=Module.__ZTIN6duckdb21WindowLeadLagExecutorE=2156e3,__ZN17duckdb_fast_float15powers_templateIvE17power_of_five_128E=Module.__ZN17duckdb_fast_float15powers_templateIvE17power_of_five_128E=1038e3,__ZTVN6duckdb16JSONTreeRendererE=Module.__ZTVN6duckdb16JSONTreeRendererE=2066e3,__ZTVN6duckdb18InMemoryLogStorageE=Module.__ZTVN6duckdb18InMemoryLogStorageE=2067e3,__ZTIN6duckdb16LocalSourceStateE=Module.__ZTIN6duckdb16LocalSourceStateE=2165e3,__ZTIN6duckdb19CTableLocalInitDataE=Module.__ZTIN6duckdb19CTableLocalInitDataE=2198e3,__ZTIN14duckdb_httplib6detail10compressorE=Module.__ZTIN14duckdb_httplib6detail10compressorE=2112e3,__ZTIN6duckdb20WriteParquetRelationE=Module.__ZTIN6duckdb20WriteParquetRelationE=2197e3,__ZTVN6duckdb23MaterializedQueryResultE=Module.__ZTVN6duckdb23MaterializedQueryResultE=2202e3,__ZN6duckdb14ChimpConstants11Compression22LEADING_REPRESENTATIONE=Module.__ZN6duckdb14ChimpConstants11Compression22LEADING_REPRESENTATIONE=1084e3,__ZTIN6duckdb7roaring33CompressedArrayContainerScanStateILb1EEE=Module.__ZTIN6duckdb7roaring33CompressedArrayContainerScanStateILb1EEE=2173e3,__ZTSN6duckdb23BitpackingCompressStateIyLb1ExEE=Module.__ZTSN6duckdb23BitpackingCompressStateIyLb1ExEE=971e3,__ZTIN6duckdb29StandardColumnCheckpointStateE=Module.__ZTIN6duckdb29StandardColumnCheckpointStateE=2149e3,__ZTINSt3__216__non_trivial_ifILb1ENS_9allocatorIwEEEE=Module.__ZTINSt3__216__non_trivial_ifILb1ENS_9allocatorIwEEEE=2082e3,__ZTVN5arrow19BaseListViewBuilderINS_12ListViewTypeEEE=Module.__ZTVN5arrow19BaseListViewBuilderINS_12ListViewTypeEEE=2023e3,__ZTIN5arrow8internal20ArrayBuilderExtraOpsINS_14NumericBuilderINS_10Date32TypeEEEiEE=Module.__ZTIN5arrow8internal20ArrayBuilderExtraOpsINS_14NumericBuilderINS_10Date32TypeEEEiEE=2022e3,__ZTSNSt3__220__shared_ptr_emplaceIN5arrow14ListViewScalarENS_9allocatorIS2_EEEE=Module.__ZTSNSt3__220__shared_ptr_emplaceIN5arrow14ListViewScalarENS_9allocatorIS2_EEEE=535e3,__ZTVNSt3__220__shared_ptr_emplaceIN5arrow14SparseCSCIndexENS_9allocatorIS2_EEEE=Module.__ZTVNSt3__220__shared_ptr_emplaceIN5arrow14SparseCSCIndexENS_9allocatorIS2_EEEE=2028e3,__ZTSNSt3__220__shared_ptr_emplaceIN5arrow10DoubleTypeENS_9allocatorIS2_EEEE=Module.__ZTSNSt3__220__shared_ptr_emplaceIN5arrow10DoubleTypeENS_9allocatorIS2_EEEE=564e3,__ZTVNSt3__210__function6__funcIZN5arrow17MakeFormatterImpl5VisitERKNS2_9UnionTypeEE9DenseImplNS_9allocatorIS7_EEFvRKNS2_5ArrayExPNS_13basic_ostreamIcNS_11char_traitsIcEEEEEEE=Module.__ZTVNSt3__210__function6__funcIZN5arrow17MakeFormatterImpl5VisitERKNS2_9UnionTypeEE9DenseImplNS_9allocatorIS7_EEFvRKNS2_5ArrayExPNS_13basic_ostreamIcNS_11char_traitsIcEEEEEEE=2059e3,__ZTIN5arrow22DefaultValueComparatorINS_16LargeBinaryArrayEEE=Module.__ZTIN5arrow22DefaultValueComparatorINS_16LargeBinaryArrayEEE=2056e3,__ZTSN5arrow7compute12RoundOptionsE=Module.__ZTSN5arrow7compute12RoundOptionsE=475e3,__ZTCN5arrow2io22CompressedOutputStreamE0_NS0_12OutputStreamE=Module.__ZTCN5arrow2io22CompressedOutputStreamE0_NS0_12OutputStreamE=2224e3,__ZTTN5arrow2io18BufferOutputStreamE=Module.__ZTTN5arrow2io18BufferOutputStreamE=2004e3,_uriConstParentW=Module._uriConstParentW=2248e3,__ZNSt3__28ios_base6eofbitE=Module.__ZNSt3__28ios_base6eofbitE=423e3,__ZNSt3__25wclogE=Module.__ZNSt3__25wclogE=227e4,__ZTIa=Module.__ZTIa=1991e3,__ZTIN10__cxxabiv121__vmi_class_type_infoE=Module.__ZTIN10__cxxabiv121__vmi_class_type_infoE=1992e3;function applySignatureConversions(e){e=Object.assign({},e);var t=c=>u=>c(u)>>>0,r=c=>(u,_,d)=>c(u,_,d)>>>0,n=c=>()=>c()>>>0,a=c=>u=>c(u)>>>0,o=c=>(u,_)=>c(u,_)>>>0,l=c=>u=>c(u)>>>0;return e.__getTypeName=t(e.__getTypeName),e.memcpy=r(e.memcpy),e.__errno_location=n(e.__errno_location),e.pthread_self=n(e.pthread_self),e.emscripten_main_runtime_thread_id=n(e.emscripten_main_runtime_thread_id),e.strerror=a(e.strerror),e.malloc=t(e.malloc),e.calloc=o(e.calloc),e.memalign=o(e.memalign),e.emscripten_builtin_malloc=t(e.emscripten_builtin_malloc),e.emscripten_builtin_calloc=o(e.emscripten_builtin_calloc),e.emscripten_builtin_memalign=o(e.emscripten_builtin_memalign),e.sbrk=l(e.sbrk),e.emscripten_stack_get_base=n(e.emscripten_stack_get_base),e.emscripten_stack_get_end=n(e.emscripten_stack_get_end),e._emscripten_stack_alloc=t(e._emscripten_stack_alloc),e.emscripten_stack_get_current=n(e.emscripten_stack_get_current),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}Module.stackSave=stackSave,Module.stackRestore=stackRestore,Module.stackAlloc=stackAlloc,Module.getTempRet0=getTempRet0,Module.setTempRet0=setTempRet0,Module.ccall=ccall,Module.createDyncallWrapper=createDyncallWrapper;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:typeof define=="function"&&define.amd&&define([],()=>DuckDB)});var Oc=dr(()=>{});var Nc=dr(()=>{});var Rc=dr((HS,ha)=>{(function(){"use strict";var s="input is invalid type",e=typeof window=="object",t=e?window:{};t.JS_SHA256_NO_WINDOW&&(e=!1);var r=!e&&typeof self=="object",n=!t.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?t=global:r&&(t=self);var a=!t.JS_SHA256_NO_COMMON_JS&&typeof ha=="object"&&ha.exports,o=typeof define=="function"&&define.amd,l=!t.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],_=[24,16,8,0],d=[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],m=["hex","array","digest","arrayBuffer"],p=[];(t.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(g){return Object.prototype.toString.call(g)==="[object Array]"}),l&&(t.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(g){return typeof g=="object"&&g.buffer&&g.buffer.constructor===ArrayBuffer});var h=function(g,A){return function(F){return new k(A,!0).update(F)[g]()}},S=function(g){var A=h("hex",g);n&&(A=w(A,g)),A.create=function(){return new k(g)},A.update=function(E){return A.create().update(E)};for(var F=0;F<m.length;++F){var y=m[F];A[y]=h(y,g)}return A},w=function(g,A){var F=Oc(),y=Nc().Buffer,E=A?"sha224":"sha256",b;y.from&&!t.JS_SHA256_NO_BUFFER_FROM?b=y.from:b=function(v){return new y(v)};var T=function(v){if(typeof v=="string")return F.createHash(E).update(v,"utf8").digest("hex");if(v==null)throw new Error(s);return v.constructor===ArrayBuffer&&(v=new Uint8Array(v)),Array.isArray(v)||ArrayBuffer.isView(v)||v.constructor===y?F.createHash(E).update(b(v)).digest("hex"):g(v)};return T},L=function(g,A){return function(F,y){return new C(F,A,!0).update(y)[g]()}},P=function(g){var A=L("hex",g);A.create=function(E){return new C(E,g)},A.update=function(E,b){return A.create(E).update(b)};for(var F=0;F<m.length;++F){var y=m[F];A[y]=L(y,g)}return A};function k(g,A){A?(p[0]=p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0,this.blocks=p):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=g}k.prototype.update=function(g){if(!this.finalized){var A,F=typeof g;if(F!=="string"){if(F==="object"){if(g===null)throw new Error(s);if(l&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!l||!ArrayBuffer.isView(g)))throw new Error(s)}else throw new Error(s);A=!0}for(var y,E=0,b,T=g.length,v=this.blocks;E<T;){if(this.hashed&&(this.hashed=!1,v[0]=this.block,this.block=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0),A)for(b=this.start;E<T&&b<64;++E)v[b>>>2]|=g[E]<<_[b++&3];else for(b=this.start;E<T&&b<64;++E)y=g.charCodeAt(E),y<128?v[b>>>2]|=y<<_[b++&3]:y<2048?(v[b>>>2]|=(192|y>>>6)<<_[b++&3],v[b>>>2]|=(128|y&63)<<_[b++&3]):y<55296||y>=57344?(v[b>>>2]|=(224|y>>>12)<<_[b++&3],v[b>>>2]|=(128|y>>>6&63)<<_[b++&3],v[b>>>2]|=(128|y&63)<<_[b++&3]):(y=65536+((y&1023)<<10|g.charCodeAt(++E)&1023),v[b>>>2]|=(240|y>>>18)<<_[b++&3],v[b>>>2]|=(128|y>>>12&63)<<_[b++&3],v[b>>>2]|=(128|y>>>6&63)<<_[b++&3],v[b>>>2]|=(128|y&63)<<_[b++&3]);this.lastByteIndex=b,this.bytes+=b-this.start,b>=64?(this.block=v[16],this.start=b-64,this.hash(),this.hashed=!0):this.start=b}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var g=this.blocks,A=this.lastByteIndex;g[16]=this.block,g[A>>>2]|=u[A&3],this.block=g[16],A>=56&&(this.hashed||this.hash(),g[0]=this.block,g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0),g[14]=this.hBytes<<3|this.bytes>>>29,g[15]=this.bytes<<3,this.hash()}},k.prototype.hash=function(){var g=this.h0,A=this.h1,F=this.h2,y=this.h3,E=this.h4,b=this.h5,T=this.h6,v=this.h7,I=this.blocks,O,ie,we,je,ne,We,ze,Lt,Zr,Dr,_r;for(O=16;O<64;++O)ne=I[O-15],ie=(ne>>>7|ne<<25)^(ne>>>18|ne<<14)^ne>>>3,ne=I[O-2],we=(ne>>>17|ne<<15)^(ne>>>19|ne<<13)^ne>>>10,I[O]=I[O-16]+ie+I[O-7]+we<<0;for(_r=A&F,O=0;O<64;O+=4)this.first?(this.is224?(Lt=300032,ne=I[0]-1413257819,v=ne-150054599<<0,y=ne+24177077<<0):(Lt=704751109,ne=I[0]-210244248,v=ne-1521486534<<0,y=ne+143694565<<0),this.first=!1):(ie=(g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10),we=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),Lt=g&A,je=Lt^g&F^_r,ze=E&b^~E&T,ne=v+we+ze+d[O]+I[O],We=ie+je,v=y+ne<<0,y=ne+We<<0),ie=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),we=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),Zr=y&g,je=Zr^y&A^Lt,ze=v&E^~v&b,ne=T+we+ze+d[O+1]+I[O+1],We=ie+je,T=F+ne<<0,F=ne+We<<0,ie=(F>>>2|F<<30)^(F>>>13|F<<19)^(F>>>22|F<<10),we=(T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7),Dr=F&y,je=Dr^F&g^Zr,ze=T&v^~T&E,ne=b+we+ze+d[O+2]+I[O+2],We=ie+je,b=A+ne<<0,A=ne+We<<0,ie=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),we=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),_r=A&F,je=_r^A&y^Dr,ze=b&T^~b&v,ne=E+we+ze+d[O+3]+I[O+3],We=ie+je,E=g+ne<<0,g=ne+We<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+g<<0,this.h1=this.h1+A<<0,this.h2=this.h2+F<<0,this.h3=this.h3+y<<0,this.h4=this.h4+E<<0,this.h5=this.h5+b<<0,this.h6=this.h6+T<<0,this.h7=this.h7+v<<0},k.prototype.hex=function(){this.finalize();var g=this.h0,A=this.h1,F=this.h2,y=this.h3,E=this.h4,b=this.h5,T=this.h6,v=this.h7,I=c[g>>>28&15]+c[g>>>24&15]+c[g>>>20&15]+c[g>>>16&15]+c[g>>>12&15]+c[g>>>8&15]+c[g>>>4&15]+c[g&15]+c[A>>>28&15]+c[A>>>24&15]+c[A>>>20&15]+c[A>>>16&15]+c[A>>>12&15]+c[A>>>8&15]+c[A>>>4&15]+c[A&15]+c[F>>>28&15]+c[F>>>24&15]+c[F>>>20&15]+c[F>>>16&15]+c[F>>>12&15]+c[F>>>8&15]+c[F>>>4&15]+c[F&15]+c[y>>>28&15]+c[y>>>24&15]+c[y>>>20&15]+c[y>>>16&15]+c[y>>>12&15]+c[y>>>8&15]+c[y>>>4&15]+c[y&15]+c[E>>>28&15]+c[E>>>24&15]+c[E>>>20&15]+c[E>>>16&15]+c[E>>>12&15]+c[E>>>8&15]+c[E>>>4&15]+c[E&15]+c[b>>>28&15]+c[b>>>24&15]+c[b>>>20&15]+c[b>>>16&15]+c[b>>>12&15]+c[b>>>8&15]+c[b>>>4&15]+c[b&15]+c[T>>>28&15]+c[T>>>24&15]+c[T>>>20&15]+c[T>>>16&15]+c[T>>>12&15]+c[T>>>8&15]+c[T>>>4&15]+c[T&15];return this.is224||(I+=c[v>>>28&15]+c[v>>>24&15]+c[v>>>20&15]+c[v>>>16&15]+c[v>>>12&15]+c[v>>>8&15]+c[v>>>4&15]+c[v&15]),I},k.prototype.toString=k.prototype.hex,k.prototype.digest=function(){this.finalize();var g=this.h0,A=this.h1,F=this.h2,y=this.h3,E=this.h4,b=this.h5,T=this.h6,v=this.h7,I=[g>>>24&255,g>>>16&255,g>>>8&255,g&255,A>>>24&255,A>>>16&255,A>>>8&255,A&255,F>>>24&255,F>>>16&255,F>>>8&255,F&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255,T>>>24&255,T>>>16&255,T>>>8&255,T&255];return this.is224||I.push(v>>>24&255,v>>>16&255,v>>>8&255,v&255),I},k.prototype.array=k.prototype.digest,k.prototype.arrayBuffer=function(){this.finalize();var g=new ArrayBuffer(this.is224?28:32),A=new DataView(g);return A.setUint32(0,this.h0),A.setUint32(4,this.h1),A.setUint32(8,this.h2),A.setUint32(12,this.h3),A.setUint32(16,this.h4),A.setUint32(20,this.h5),A.setUint32(24,this.h6),this.is224||A.setUint32(28,this.h7),g};function C(g,A,F){var y,E=typeof g;if(E==="string"){var b=[],T=g.length,v=0,I;for(y=0;y<T;++y)I=g.charCodeAt(y),I<128?b[v++]=I:I<2048?(b[v++]=192|I>>>6,b[v++]=128|I&63):I<55296||I>=57344?(b[v++]=224|I>>>12,b[v++]=128|I>>>6&63,b[v++]=128|I&63):(I=65536+((I&1023)<<10|g.charCodeAt(++y)&1023),b[v++]=240|I>>>18,b[v++]=128|I>>>12&63,b[v++]=128|I>>>6&63,b[v++]=128|I&63);g=b}else if(E==="object"){if(g===null)throw new Error(s);if(l&&g.constructor===ArrayBuffer)g=new Uint8Array(g);else if(!Array.isArray(g)&&(!l||!ArrayBuffer.isView(g)))throw new Error(s)}else throw new Error(s);g.length>64&&(g=new k(A,!0).update(g).array());var O=[],ie=[];for(y=0;y<64;++y){var we=g[y]||0;O[y]=92^we,ie[y]=54^we}k.call(this,A,F),this.update(ie),this.oKeyPad=O,this.inner=!0,this.sharedMemory=F}C.prototype=new k,C.prototype.finalize=function(){if(k.prototype.finalize.call(this),this.inner){this.inner=!1;var g=this.array();k.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(g),k.prototype.finalize.call(this)}};var x=S();x.sha256=x,x.sha224=S(!0),x.sha256.hmac=P(),x.sha224.hmac=P(!0),a?ha.exports=x:(t.sha256=x.sha256,t.sha224=x.sha224,o&&define(function(){return x}))})()});var Ld={};fr(Ld,{registerWorker:()=>Wc});function Co(s,e){var t={};for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(s);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(s,r[n])&&(t[r[n]]=s[r[n]]);return t}function D(s,e,t,r){function n(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(_){try{u(r.next(_))}catch(d){o(d)}}function c(_){try{u(r.throw(_))}catch(d){o(d)}}function u(_){_.done?a(_.value):n(_.value).then(l,c)}u((r=r.apply(s,e||[])).next())})}function Po(s){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&s[e],r=0;if(t)return t.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&r>=s.length&&(s=void 0),{value:s&&s[r++],done:!s}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Z(s){return this instanceof Z?(this.v=s,this):new Z(s)}function qe(s,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(s,e||[]),n,a=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(m){r[m]&&(n[m]=function(p){return new Promise(function(h,S){a.push([m,p,h,S])>1||l(m,p)})})}function l(m,p){try{c(r[m](p))}catch(h){d(a[0][3],h)}}function c(m){m.value instanceof Z?Promise.resolve(m.value.v).then(u,_):d(a[0][2],m)}function u(m){l("next",m)}function _(m){l("throw",m)}function d(m,p){m(p),a.shift(),a.length&&l(a[0][0],a[0][1])}}function Jr(s){var e,t;return e={},r("next"),r("throw",function(n){throw n}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(n,a){e[n]=s[n]?function(o){return(t=!t)?{value:Z(s[n](o)),done:!1}:a?a(o):o}:a}}function ot(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=s[Symbol.asyncIterator],t;return e?e.call(s):(s=typeof Po=="function"?Po(s):s[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(a){t[a]=s[a]&&function(o){return new Promise(function(l,c){o=s[a](o),n(l,c,o.done,o.value)})}}function n(a,o,l,c){Promise.resolve(c).then(function(u){a({value:u,done:l})},o)}}var Aa={};fr(Aa,{compareArrayLike:()=>wa,joinUint8Arrays:()=>Qe,memcpy:()=>Mn,rebaseValueOffsets:()=>Ui,toArrayBufferView:()=>J,toArrayBufferViewAsyncIterator:()=>ut,toArrayBufferViewIterator:()=>It,toBigInt64Array:()=>Ci,toBigUint64Array:()=>ou,toFloat32Array:()=>lu,toFloat32ArrayAsyncIterator:()=>Eu,toFloat32ArrayIterator:()=>hu,toFloat64Array:()=>cu,toFloat64ArrayAsyncIterator:()=>Fu,toFloat64ArrayIterator:()=>gu,toInt16Array:()=>iu,toInt16ArrayAsyncIterator:()=>vu,toInt16ArrayIterator:()=>du,toInt32Array:()=>kr,toInt32ArrayAsyncIterator:()=>Su,toInt32ArrayIterator:()=>fu,toInt8Array:()=>nu,toInt8ArrayAsyncIterator:()=>bu,toInt8ArrayIterator:()=>_u,toUint16Array:()=>su,toUint16ArrayAsyncIterator:()=>wu,toUint16ArrayIterator:()=>pu,toUint32Array:()=>au,toUint32ArrayAsyncIterator:()=>Au,toUint32ArrayIterator:()=>mu,toUint8Array:()=>W,toUint8ArrayAsyncIterator:()=>Sa,toUint8ArrayIterator:()=>va,toUint8ClampedArray:()=>uu,toUint8ClampedArrayAsyncIterator:()=>xu,toUint8ClampedArrayIterator:()=>yu});var Jc=new TextDecoder("utf-8"),In=s=>Jc.decode(s),eu=new TextEncoder,Tt=s=>eu.encode(s);var tu=s=>typeof s=="number",Uo=s=>typeof s=="boolean",Fe=s=>typeof s=="function",Pe=s=>s!=null&&Object(s)===s,lt=s=>Pe(s)&&Fe(s.then);var ct=s=>Pe(s)&&Fe(s[Symbol.iterator]),et=s=>Pe(s)&&Fe(s[Symbol.asyncIterator]),Ii=s=>Pe(s)&&Pe(s.schema);var Di=s=>Pe(s)&&"done"in s&&"value"in s;var Mi=s=>Pe(s)&&Fe(s.stat)&&tu(s.fd);var ki=s=>Pe(s)&&Dn(s.body),Bi=s=>"_getDOMStream"in s&&"_getNodeStream"in s,Oo=s=>Pe(s)&&Fe(s.abort)&&Fe(s.getWriter)&&!Bi(s),Dn=s=>Pe(s)&&Fe(s.cancel)&&Fe(s.getReader)&&!Bi(s),No=s=>Pe(s)&&Fe(s.end)&&Fe(s.write)&&Uo(s.writable)&&!Bi(s),Pi=s=>Pe(s)&&Fe(s.read)&&Fe(s.pipe)&&Uo(s.readable)&&!Bi(s),Ro=s=>Pe(s)&&Fe(s.clear)&&Fe(s.bytes)&&Fe(s.position)&&Fe(s.setPosition)&&Fe(s.capacity)&&Fe(s.getBufferIdentifier)&&Fe(s.createLong);var ba=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function ru(s){let e=s[0]?[s[0]]:[],t,r,n,a;for(let o,l,c=0,u=0,_=s.length;++c<_;){if(o=e[u],l=s[c],!o||!l||o.buffer!==l.buffer||l.byteOffset<o.byteOffset){l&&(e[++u]=l);continue}if({byteOffset:t,byteLength:n}=o,{byteOffset:r,byteLength:a}=l,t+n<r||r+a<t){l&&(e[++u]=l);continue}e[u]=new Uint8Array(o.buffer,t,r-t+a)}return e}function Mn(s,e,t=0,r=e.byteLength){let n=s.byteLength,a=new Uint8Array(s.buffer,s.byteOffset,n),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(r,n));return a.set(o,t),s}function Qe(s,e){let t=ru(s),r=t.reduce((_,d)=>_+d.byteLength,0),n,a,o,l=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,r);for(let _=t.length;++c<_;){if(n=t[c],a=n.subarray(0,Math.min(n.length,u-l)),u<=l+a.length){a.length<n.length?t[c]=n.subarray(a.length):a.length===n.length&&c++,o?Mn(o,a,l):o=a;break}Mn(o||(o=new Uint8Array(u)),a,l),l+=a.length}return[o||new Uint8Array(0),t.slice(c),r-(o?o.byteLength:0)]}function J(s,e){let t=Di(e)?e.value:e;return t instanceof s?s===Uint8Array?new s(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=Tt(t)),t instanceof ArrayBuffer?new s(t):t instanceof ba?new s(t):Ro(t)?J(s,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new s(0):new s(t.buffer,t.byteOffset,t.byteLength/s.BYTES_PER_ELEMENT):s.from(t)):new s(0)}var nu=s=>J(Int8Array,s),iu=s=>J(Int16Array,s),kr=s=>J(Int32Array,s),Ci=s=>J(BigInt64Array,s),W=s=>J(Uint8Array,s),su=s=>J(Uint16Array,s),au=s=>J(Uint32Array,s),ou=s=>J(BigUint64Array,s),lu=s=>J(Float32Array,s),cu=s=>J(Float64Array,s),uu=s=>J(Uint8ClampedArray,s),ya=s=>(s.next(),s);function*It(s,e){let t=function*(n){yield n},r=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ba?t(e):ct(e)?e:t(e);return yield*Mr(ya(function*(n){let a=null;do a=n.next(yield J(s,a));while(!a.done)}(r[Symbol.iterator]()))),new s}var _u=s=>It(Int8Array,s),du=s=>It(Int16Array,s),fu=s=>It(Int32Array,s),va=s=>It(Uint8Array,s),pu=s=>It(Uint16Array,s),mu=s=>It(Uint32Array,s),hu=s=>It(Float32Array,s),gu=s=>It(Float64Array,s),yu=s=>It(Uint8ClampedArray,s);function ut(s,e){return qe(this,arguments,function*(){if(lt(e))return yield Z(yield Z(yield*Mr(Jr(ot(ut(s,yield Z(e)))))));let r=function(o){return qe(this,arguments,function*(){yield yield Z(yield Z(o))})},n=function(o){return qe(this,arguments,function*(){yield Z(yield*Mr(Jr(ot(ya(function*(l){let c=null;do c=l.next(yield c==null?void 0:c.value);while(!c.done)}(o[Symbol.iterator]()))))))})},a=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ba?r(e):ct(e)?n(e):et(e)?e:r(e);return yield Z(yield*Mr(Jr(ot(ya(function(o){return qe(this,arguments,function*(){let l=null;do l=yield Z(o.next(yield yield Z(J(s,l))));while(!l.done)})}(a[Symbol.asyncIterator]())))))),yield Z(new s)})}var bu=s=>ut(Int8Array,s),vu=s=>ut(Int16Array,s),Su=s=>ut(Int32Array,s),Sa=s=>ut(Uint8Array,s),wu=s=>ut(Uint16Array,s),Au=s=>ut(Uint32Array,s),Eu=s=>ut(Float32Array,s),Fu=s=>ut(Float64Array,s),xu=s=>ut(Uint8ClampedArray,s);function Ui(s,e,t){if(s!==0){t=t.slice(0,e);for(let r=-1,n=t.length;++r<n;)t[r]+=s}return t.subarray(0,e)}function wa(s,e){let t=0,r=s.length;if(r!==e.length)return!1;if(r>0)do if(s[t]!==e[t])return!1;while(++t<r);return!0}var Ie={fromIterable(s){return Oi(Lu(s))},fromAsyncIterable(s){return Oi(Tu(s))},fromDOMStream(s){return Oi(Iu(s))},fromNodeStream(s){return Oi(Du(s))},toDOMStream(s,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(s,e){throw new Error('"toNodeStream" not available in this environment')}},Oi=s=>(s.next(),s);function*Lu(s){let e,t=!1,r=[],n,a,o,l=0;function c(){return a==="peek"?Qe(r,o)[0]:([n,r,l]=Qe(r,o),n)}({cmd:a,size:o}=(yield null)||{cmd:"read",size:0});let u=va(s)[Symbol.iterator]();try{do if({done:e,value:n}=Number.isNaN(o-l)?u.next():u.next(o-l),!e&&n.byteLength>0&&(r.push(n),l+=n.byteLength),e||o<=l)do({cmd:a,size:o}=yield c());while(o<l);while(!e)}catch(_){(t=!0)&&typeof u.throw=="function"&&u.throw(_)}finally{t===!1&&typeof u.return=="function"&&u.return(null)}return null}function Tu(s){return qe(this,arguments,function*(){let t,r=!1,n=[],a,o,l,c=0;function u(){return o==="peek"?Qe(n,l)[0]:([a,n,c]=Qe(n,l),a)}({cmd:o,size:l}=(yield yield Z(null))||{cmd:"read",size:0});let _=Sa(s)[Symbol.asyncIterator]();try{do if({done:t,value:a}=Number.isNaN(l-c)?yield Z(_.next()):yield Z(_.next(l-c)),!t&&a.byteLength>0&&(n.push(a),c+=a.byteLength),t||l<=c)do({cmd:o,size:l}=yield yield Z(u()));while(l<c);while(!t)}catch(d){(r=!0)&&typeof _.throw=="function"&&(yield Z(_.throw(d)))}finally{r===!1&&typeof _.return=="function"&&(yield Z(_.return(new Uint8Array(0))))}return yield Z(null)})}function Iu(s){return qe(this,arguments,function*(){let t=!1,r=!1,n=[],a,o,l,c=0;function u(){return o==="peek"?Qe(n,l)[0]:([a,n,c]=Qe(n,l),a)}({cmd:o,size:l}=(yield yield Z(null))||{cmd:"read",size:0});let _=new Fa(s);try{do if({done:t,value:a}=Number.isNaN(l-c)?yield Z(_.read()):yield Z(_.read(l-c)),!t&&a.byteLength>0&&(n.push(W(a)),c+=a.byteLength),t||l<=c)do({cmd:o,size:l}=yield yield Z(u()));while(l<c);while(!t)}catch(d){(r=!0)&&(yield Z(_.cancel(d)))}finally{r===!1?yield Z(_.cancel()):s.locked&&_.releaseLock()}return yield Z(null)})}var Fa=class{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return D(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 D(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=W(t)),t})}},Ea=(s,e)=>{let t=n=>r([e,n]),r;return[e,t,new Promise(n=>(r=n)&&s.once(e,t))]};function Du(s){return qe(this,arguments,function*(){let t=[],r="error",n=!1,a=null,o,l,c=0,u=[],_;function d(){return o==="peek"?Qe(u,l)[0]:([_,u,c]=Qe(u,l),_)}if({cmd:o,size:l}=(yield yield Z(null))||{cmd:"read",size:0},s.isTTY)return yield yield Z(new Uint8Array(0)),yield Z(null);try{t[0]=Ea(s,"end"),t[1]=Ea(s,"error");do{if(t[2]=Ea(s,"readable"),[r,a]=yield Z(Promise.race(t.map(p=>p[2]))),r==="error")break;if((n=r==="end")||(Number.isFinite(l-c)?(_=W(s.read(l-c)),_.byteLength<l-c&&(_=W(s.read()))):_=W(s.read()),_.byteLength>0&&(u.push(_),c+=_.byteLength)),n||l<=c)do({cmd:o,size:l}=yield yield Z(d()));while(l<c)}while(!n)}finally{yield Z(m(t,r==="error"?a:null))}return yield Z(null);function m(p,h){return _=u=null,new Promise((S,w)=>{for(let[L,P]of p)s.off(L,P);try{let L=s.destroy;L&&L.call(s,h),h=void 0}catch(L){h=L||h}finally{h!=null?w(h):S()}})}})}var oe;(function(s){s[s.V1=0]="V1",s[s.V2=1]="V2",s[s.V3=2]="V3",s[s.V4=3]="V4",s[s.V5=4]="V5"})(oe||(oe={}));var de;(function(s){s[s.Sparse=0]="Sparse",s[s.Dense=1]="Dense"})(de||(de={}));var _e;(function(s){s[s.HALF=0]="HALF",s[s.SINGLE=1]="SINGLE",s[s.DOUBLE=2]="DOUBLE"})(_e||(_e={}));var ve;(function(s){s[s.DAY=0]="DAY",s[s.MILLISECOND=1]="MILLISECOND"})(ve||(ve={}));var B;(function(s){s[s.SECOND=0]="SECOND",s[s.MILLISECOND=1]="MILLISECOND",s[s.MICROSECOND=2]="MICROSECOND",s[s.NANOSECOND=3]="NANOSECOND"})(B||(B={}));var xe;(function(s){s[s.YEAR_MONTH=0]="YEAR_MONTH",s[s.DAY_TIME=1]="DAY_TIME",s[s.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(xe||(xe={}));var Dt=new Int32Array(2),Ni=new Float32Array(Dt.buffer),Ri=new Float64Array(Dt.buffer),en=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var kn;(function(s){s[s.UTF8_BYTES=1]="UTF8_BYTES",s[s.UTF16_STRING=2]="UTF16_STRING"})(kn||(kn={}));var Ye=class s{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new s(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Dt[0]=this.readInt32(e),Ni[0]}readFloat64(e){return Dt[en?0:1]=this.readInt32(e),Dt[en?1:0]=this.readInt32(e+4),Ri[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Ni[0]=t,this.writeInt32(e,Dt[0])}writeFloat64(e,t){Ri[0]=t,this.writeInt32(e,Dt[en?0:1]),this.writeInt32(e+4,Dt[en?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<4;t++)e+=String.fromCharCode(this.readInt8(this.position_+4+t));return e}__offset(e,t){let r=e-this.readInt32(e);return t<this.readInt16(r)?this.readInt16(r+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);let r=this.readInt32(e);e+=4;let n=this.bytes_.subarray(e,e+r);return t===kn.UTF8_BYTES?n:this.text_decoder_.decode(n)}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let t=0;t<4;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+4+t))return!1;return!0}createScalarList(e,t){let r=[];for(let n=0;n<t;++n){let a=e(n);a!==null&&r.push(a)}return r}createObjList(e,t){let r=[];for(let n=0;n<t;++n){let a=e(n);a!==null&&r.push(a.unpack())}return r}};var Br=class s{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let t;e?t=e:t=1024,this.bb=Ye.allocate(t),this.space=t}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);let r=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<r+e+t;){let n=this.bb.capacity();this.bb=s.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,r){(this.force_defaults||t!=r)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,r){(this.force_defaults||t!=r)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,r){(this.force_defaults||t!=r)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,r){(this.force_defaults||t!==r)&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,r){(this.force_defaults||t!=r)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,r){(this.force_defaults||t!=r)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,r){(this.force_defaults||t!=r)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,r){t!=r&&(this.nested(t),this.slot(e))}nested(e){if(e!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let r=t<<1,n=Ye.allocate(r);return n.setPosition(r-t),n.bytes().set(e.bytes(),r-t),n}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let e=this.offset(),t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);let r=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);let n=2;this.addInt16(e-this.object_start);let a=(r+n)*2;this.addInt16(a);let o=0,l=this.space;e:for(t=0;t<this.vtables.length;t++){let c=this.bb.capacity()-this.vtables[t];if(a==this.bb.readInt16(c)){for(let u=2;u<a;u+=2)if(this.bb.readInt16(l+u)!=this.bb.readInt16(c+u))continue e;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,r){let n=r?4:0;if(t){let a=t;if(this.prep(this.minalign,8+n),a.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=3;o>=0;o--)this.writeInt8(a.charCodeAt(o))}this.prep(this.minalign,4+n),this.addOffset(e),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let r=this.bb.capacity()-e,n=r-this.bb.readInt32(r);if(!(t<this.bb.readInt16(n)&&this.bb.readInt16(n+t)!=0))throw new TypeError("FlatBuffers: field "+t+" must be set")}startVector(e,t,r){this.notNested(),this.vector_num_elems=t,this.prep(4,e*t),this.prep(r,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(e==null)return 0;let t;return e instanceof Uint8Array?t=e:t=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let t=[];for(let r=0;r<e.length;++r){let n=e[r];if(n!==null)t.push(this.createObjectOffset(n));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}};var Bn;(function(s){s[s.BUFFER=0]="BUFFER"})(Bn||(Bn={}));var Pn;(function(s){s[s.LZ4_FRAME=0]="LZ4_FRAME",s[s.ZSTD=1]="ZSTD"})(Pn||(Pn={}));var Hi=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Pn.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):Bn.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,Pn.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,Bn.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,r){return s.startBodyCompression(e),s.addCodec(e,t),s.addMethod(e,r),s.endBodyCompression(e)}};var tn=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)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,r){return e.prep(8,16),e.writeInt64(BigInt(r!=null?r:0)),e.writeInt64(BigInt(t!=null?t:0)),e.offset()}};var rn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,r){return e.prep(8,16),e.writeInt64(BigInt(r!=null?r:0)),e.writeInt64(BigInt(t!=null?t:0)),e.offset()}};var Ke=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new rn).__init(this.bb.__vector(this.bb_pos+r)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new tn).__init(this.bb.__vector(this.bb_pos+r)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new Hi).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}static startRecordBatch(e){e.startObject(4)}static addLength(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static endRecordBatch(e){return e.endObject()}};var Rt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Ke).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}};var pr;(function(s){s[s.Little=0]="Little",s[s.Big=1]="Big"})(pr||(pr={}));var Cn;(function(s){s[s.DenseArray=0]="DenseArray"})(Cn||(Cn={}));var dt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,r){return s.startInt(e),s.addBitWidth(e,t),s.addIsSigned(e,r),s.endInt(e)}};var Mt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new dt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Cn.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,Cn.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}};var Le=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,r){return s.startKeyValue(e),s.addKey(e,t),s.addValue(e,r),s.endKeyValue(e)}};var Un=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return s.startBinary(e),s.endBinary(e)}};var On=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return s.startBool(e),s.endBool(e)}};var mr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ve.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ve.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return s.startDate(e),s.addUnit(e,t),s.endDate(e)}};var kt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,r,n){return s.startDecimal(e),s.addPrecision(e,t),s.addScale(e,r),s.addBitWidth(e,n),s.endDecimal(e)}};var hr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):B.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,B.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return s.startDuration(e),s.addUnit(e,t),s.endDuration(e)}};var gr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return s.startFixedSizeBinary(e),s.addByteWidth(e,t),s.endFixedSizeBinary(e)}};var yr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return s.startFixedSizeList(e),s.addListSize(e,t),s.endFixedSizeList(e)}};var br=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):_e.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,_e.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return s.startFloatingPoint(e),s.addPrecision(e,t),s.endFloatingPoint(e)}};var vr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):xe.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,xe.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return s.startInterval(e),s.addUnit(e,t),s.endInterval(e)}};var Nn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return s.startLargeBinary(e),s.endLargeBinary(e)}};var Rn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return s.startLargeUtf8(e),s.endLargeUtf8(e)}};var Gn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return s.startList(e),s.endList(e)}};var Sr=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return s.startMap(e),s.addKeysSorted(e,t),s.endMap(e)}};var Hn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return s.startNull(e),s.endNull(e)}};var Vn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return s.startStruct_(e),s.endStruct_(e)}};var Gt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):B.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,B.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,r){return s.startTime(e),s.addUnit(e,t),s.addBitWidth(e,r),s.endTime(e)}};var Ht=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):B.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,B.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,r){return s.startTimestamp(e),s.addUnit(e,t),s.addTimezone(e,r),s.endTimestamp(e)}};var ft=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):de.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,de.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addInt32(t[r]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,r){return s.startUnion(e),s.addMode(e,t),s.addTypeIds(e,r),s.endUnion(e)}};var jn=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return s.startUtf8(e),s.endUtf8(e)}};var fe;(function(s){s[s.NONE=0]="NONE",s[s.Null=1]="Null",s[s.Int=2]="Int",s[s.FloatingPoint=3]="FloatingPoint",s[s.Binary=4]="Binary",s[s.Utf8=5]="Utf8",s[s.Bool=6]="Bool",s[s.Decimal=7]="Decimal",s[s.Date=8]="Date",s[s.Time=9]="Time",s[s.Timestamp=10]="Timestamp",s[s.Interval=11]="Interval",s[s.List=12]="List",s[s.Struct_=13]="Struct_",s[s.Union=14]="Union",s[s.FixedSizeBinary=15]="FixedSizeBinary",s[s.FixedSizeList=16]="FixedSizeList",s[s.Map=17]="Map",s[s.Duration=18]="Duration",s[s.LargeBinary=19]="LargeBinary",s[s.LargeUtf8=20]="LargeUtf8",s[s.LargeList=21]="LargeList",s[s.RunEndEncoded=22]="RunEndEncoded"})(fe||(fe={}));var Be=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):fe.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Mt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let r=this.bb.__offset(this.bb_pos,14);return r?(t||new s).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,16);return r?(t||new Le).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,fe.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}};var Ne=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):pr.Little}fields(e,t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new Le).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,pr.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addInt64(t[r]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(e,t,r,n,a){return s.startSchema(e),s.addEndianness(e,t),s.addFields(e,r),s.addCustomMetadata(e,n),s.addFeatures(e,a),s.endSchema(e)}};var te;(function(s){s[s.NONE=0]="NONE",s[s.Schema=1]="Schema",s[s.DictionaryBatch=2]="DictionaryBatch",s[s.RecordBatch=3]="RecordBatch",s[s.Tensor=4]="Tensor",s[s.SparseTensor=5]="SparseTensor"})(te||(te={}));var f;(function(s){s[s.NONE=0]="NONE",s[s.Null=1]="Null",s[s.Int=2]="Int",s[s.Float=3]="Float",s[s.Binary=4]="Binary",s[s.Utf8=5]="Utf8",s[s.Bool=6]="Bool",s[s.Decimal=7]="Decimal",s[s.Date=8]="Date",s[s.Time=9]="Time",s[s.Timestamp=10]="Timestamp",s[s.Interval=11]="Interval",s[s.List=12]="List",s[s.Struct=13]="Struct",s[s.Union=14]="Union",s[s.FixedSizeBinary=15]="FixedSizeBinary",s[s.FixedSizeList=16]="FixedSizeList",s[s.Map=17]="Map",s[s.Duration=18]="Duration",s[s.LargeBinary=19]="LargeBinary",s[s.LargeUtf8=20]="LargeUtf8",s[s.Dictionary=-1]="Dictionary",s[s.Int8=-2]="Int8",s[s.Int16=-3]="Int16",s[s.Int32=-4]="Int32",s[s.Int64=-5]="Int64",s[s.Uint8=-6]="Uint8",s[s.Uint16=-7]="Uint16",s[s.Uint32=-8]="Uint32",s[s.Uint64=-9]="Uint64",s[s.Float16=-10]="Float16",s[s.Float32=-11]="Float32",s[s.Float64=-12]="Float64",s[s.DateDay=-13]="DateDay",s[s.DateMillisecond=-14]="DateMillisecond",s[s.TimestampSecond=-15]="TimestampSecond",s[s.TimestampMillisecond=-16]="TimestampMillisecond",s[s.TimestampMicrosecond=-17]="TimestampMicrosecond",s[s.TimestampNanosecond=-18]="TimestampNanosecond",s[s.TimeSecond=-19]="TimeSecond",s[s.TimeMillisecond=-20]="TimeMillisecond",s[s.TimeMicrosecond=-21]="TimeMicrosecond",s[s.TimeNanosecond=-22]="TimeNanosecond",s[s.DenseUnion=-23]="DenseUnion",s[s.SparseUnion=-24]="SparseUnion",s[s.IntervalDayTime=-25]="IntervalDayTime",s[s.IntervalYearMonth=-26]="IntervalYearMonth",s[s.DurationSecond=-27]="DurationSecond",s[s.DurationMillisecond=-28]="DurationMillisecond",s[s.DurationMicrosecond=-29]="DurationMicrosecond",s[s.DurationNanosecond=-30]="DurationNanosecond"})(f||(f={}));var rt;(function(s){s[s.OFFSET=0]="OFFSET",s[s.DATA=1]="DATA",s[s.VALIDITY=2]="VALIDITY",s[s.TYPE=3]="TYPE"})(rt||(rt={}));var za={};fr(za,{clampRange:()=>qn,createElementComparator:()=>Fr,wrapIndex:()=>Pr});var xa={};fr(xa,{valueToString:()=>pt});function pt(s){if(s===null)return"null";if(s===void 0)return"undefined";switch(typeof s){case"number":return"".concat(s);case"bigint":return"".concat(s);case"string":return'"'.concat(s,'"')}return typeof s[Symbol.toPrimitive]=="function"?s[Symbol.toPrimitive]("string"):ArrayBuffer.isView(s)?s instanceof BigInt64Array||s instanceof BigUint64Array?"[".concat([...s].map(e=>pt(e)),"]"):"[".concat(s,"]"):ArrayBuffer.isView(s)?"[".concat(s,"]"):JSON.stringify(s,(e,t)=>typeof t=="bigint"?"".concat(t):t)}var Da={};fr(Da,{BN:()=>zn,bigNumToBigInt:()=>Ho,bigNumToNumber:()=>Ia,bigNumToString:()=>an,isArrowBigNumSymbol:()=>Go});function se(s){if(typeof s=="bigint"&&(s<Number.MIN_SAFE_INTEGER||s>Number.MAX_SAFE_INTEGER))throw new TypeError("".concat(s," is not safe to convert to a number."));return Number(s)}function La(s,e){return se(s/e)+se(s%e)/se(e)}var Go=Symbol.for("isArrowBigNum");function mt(s,...e){return e.length===0?Object.setPrototypeOf(J(this.TypedArray,s),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(s,...e),this.constructor.prototype)}mt.prototype[Go]=!0;mt.prototype.toJSON=function(){return'"'.concat(an(this),'"')};mt.prototype.valueOf=function(s){return Ia(this,s)};mt.prototype.toString=function(){return an(this)};mt.prototype[Symbol.toPrimitive]=function(s="default"){switch(s){case"number":return Ia(this);case"string":return an(this);case"default":return Ho(this)}return an(this)};function nn(...s){return mt.apply(this,s)}function sn(...s){return mt.apply(this,s)}function Wn(...s){return mt.apply(this,s)}Object.setPrototypeOf(nn.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(sn.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Wn.prototype,Object.create(Uint32Array.prototype));Object.assign(nn.prototype,mt.prototype,{constructor:nn,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(sn.prototype,mt.prototype,{constructor:sn,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Wn.prototype,mt.prototype,{constructor:Wn,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var Mu=BigInt(4294967296)*BigInt(4294967296),ku=Mu-BigInt(1);function Ia(s,e){let{buffer:t,byteOffset:r,byteLength:n,signed:a}=s,o=new BigUint64Array(t,r,n/8),l=a&&o.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(l){for(let _ of o)c|=(_^ku)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let _ of o)c|=_*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"){let _=BigInt(Math.pow(10,e)),d=c/_,m=c%_;return se(d)+se(m)/se(_)}return se(c)}function an(s){if(s.byteLength===8){let a=new s.BigIntArray(s.buffer,s.byteOffset,1);return"".concat(a[0])}if(!s.signed)return Ta(s);let e=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return Ta(s);e=e.slice();let r=1;for(let a=0;a<e.length;a++){let o=e[a],l=~o+r;e[a]=l,r&=o===0?1:0}let n=Ta(e);return"-".concat(n)}function Ho(s){return s.byteLength===8?new s.BigIntArray(s.buffer,s.byteOffset,1)[0]:an(s)}function Ta(s){let e="",t=new Uint32Array(2),r=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2),n=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),a=-1,o=r.length-1;do{for(t[0]=r[a=0];a<o;)r[a++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+r[a];r[a]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e="".concat(t[0]).concat(e)}while(n[0]||n[1]||n[2]||n[3]);return e!=null?e:"0"}var zn=class s{static new(e,t){switch(t){case!0:return new nn(e);case!1:return new sn(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new nn(e)}return e.byteLength===16?new Wn(e):new sn(e)}static signed(e){return new nn(e)}static unsigned(e){return new sn(e)}static decimal(e){return new Wn(e)}constructor(e,t){return s.new(e,t)}};var Vo,jo,Wo,zo,$o,qo,Qo,Yo,Ko,Xo,Zo,Jo,el,tl,rl,nl,il,sl,al,ol,ll,cl,M=class s{static isNull(e){return(e==null?void 0:e.typeId)===f.Null}static isInt(e){return(e==null?void 0:e.typeId)===f.Int}static isFloat(e){return(e==null?void 0:e.typeId)===f.Float}static isBinary(e){return(e==null?void 0:e.typeId)===f.Binary}static isLargeBinary(e){return(e==null?void 0:e.typeId)===f.LargeBinary}static isUtf8(e){return(e==null?void 0:e.typeId)===f.Utf8}static isLargeUtf8(e){return(e==null?void 0:e.typeId)===f.LargeUtf8}static isBool(e){return(e==null?void 0:e.typeId)===f.Bool}static isDecimal(e){return(e==null?void 0:e.typeId)===f.Decimal}static isDate(e){return(e==null?void 0:e.typeId)===f.Date}static isTime(e){return(e==null?void 0:e.typeId)===f.Time}static isTimestamp(e){return(e==null?void 0:e.typeId)===f.Timestamp}static isInterval(e){return(e==null?void 0:e.typeId)===f.Interval}static isDuration(e){return(e==null?void 0:e.typeId)===f.Duration}static isList(e){return(e==null?void 0:e.typeId)===f.List}static isStruct(e){return(e==null?void 0:e.typeId)===f.Struct}static isUnion(e){return(e==null?void 0:e.typeId)===f.Union}static isFixedSizeBinary(e){return(e==null?void 0:e.typeId)===f.FixedSizeBinary}static isFixedSizeList(e){return(e==null?void 0:e.typeId)===f.FixedSizeList}static isMap(e){return(e==null?void 0:e.typeId)===f.Map}static isDictionary(e){return(e==null?void 0:e.typeId)===f.Dictionary}static isDenseUnion(e){return s.isUnion(e)&&e.mode===de.Dense}static isSparseUnion(e){return s.isUnion(e)&&e.mode===de.Sparse}constructor(e){this.typeId=e}};Vo=Symbol.toStringTag;M[Vo]=(s=>(s.children=null,s.ArrayType=Array,s.OffsetArrayType=Int32Array,s[Symbol.toStringTag]="DataType"))(M.prototype);var Ce=class extends M{constructor(){super(f.Null)}toString(){return"Null"}};jo=Symbol.toStringTag;Ce[jo]=(s=>s[Symbol.toStringTag]="Null")(Ce.prototype);var Te=class extends M{constructor(e,t){super(f.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)}};Wo=Symbol.toStringTag;Te[Wo]=(s=>(s.isSigned=null,s.bitWidth=null,s[Symbol.toStringTag]="Int"))(Te.prototype);var Vi=class extends Te{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},ji=class extends Te{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Bt=class extends Te{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Wi=class extends Te{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},zi=class extends Te{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},$i=class extends Te{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},qi=class extends Te{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Qi=class extends Te{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Vi.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(ji.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Bt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Wi.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(zi.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty($i.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(qi.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Qi.prototype,"ArrayType",{value:BigUint64Array});var nt=class extends M{constructor(e){super(f.Float),this.precision=e}get ArrayType(){switch(this.precision){case _e.HALF:return Uint16Array;case _e.SINGLE:return Float32Array;case _e.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}};zo=Symbol.toStringTag;nt[zo]=(s=>(s.precision=null,s[Symbol.toStringTag]="Float"))(nt.prototype);var Yi=class extends nt{constructor(){super(_e.HALF)}},Ki=class extends nt{constructor(){super(_e.SINGLE)}},Xi=class extends nt{constructor(){super(_e.DOUBLE)}};Object.defineProperty(Yi.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ki.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Xi.prototype,"ArrayType",{value:Float64Array});var Vt=class extends M{constructor(){super(f.Binary)}toString(){return"Binary"}};$o=Symbol.toStringTag;Vt[$o]=(s=>(s.ArrayType=Uint8Array,s[Symbol.toStringTag]="Binary"))(Vt.prototype);var jt=class extends M{constructor(){super(f.LargeBinary)}toString(){return"LargeBinary"}};qo=Symbol.toStringTag;jt[qo]=(s=>(s.ArrayType=Uint8Array,s.OffsetArrayType=BigInt64Array,s[Symbol.toStringTag]="LargeBinary"))(jt.prototype);var Wt=class extends M{constructor(){super(f.Utf8)}toString(){return"Utf8"}};Qo=Symbol.toStringTag;Wt[Qo]=(s=>(s.ArrayType=Uint8Array,s[Symbol.toStringTag]="Utf8"))(Wt.prototype);var zt=class extends M{constructor(){super(f.LargeUtf8)}toString(){return"LargeUtf8"}};Yo=Symbol.toStringTag;zt[Yo]=(s=>(s.ArrayType=Uint8Array,s.OffsetArrayType=BigInt64Array,s[Symbol.toStringTag]="LargeUtf8"))(zt.prototype);var $t=class extends M{constructor(){super(f.Bool)}toString(){return"Bool"}};Ko=Symbol.toStringTag;$t[Ko]=(s=>(s.ArrayType=Uint8Array,s[Symbol.toStringTag]="Bool"))($t.prototype);var qt=class extends M{constructor(e,t,r=128){super(f.Decimal),this.scale=e,this.precision=t,this.bitWidth=r}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}};Xo=Symbol.toStringTag;qt[Xo]=(s=>(s.scale=null,s.precision=null,s.ArrayType=Uint32Array,s[Symbol.toStringTag]="Decimal"))(qt.prototype);var Qt=class extends M{constructor(e){super(f.Date),this.unit=e}toString(){return"Date".concat((this.unit+1)*32,"<").concat(ve[this.unit],">")}get ArrayType(){return this.unit===ve.DAY?Int32Array:BigInt64Array}};Zo=Symbol.toStringTag;Qt[Zo]=(s=>(s.unit=null,s[Symbol.toStringTag]="Date"))(Qt.prototype);var Yt=class extends M{constructor(e,t){super(f.Time),this.unit=e,this.bitWidth=t}toString(){return"Time".concat(this.bitWidth,"<").concat(B[this.unit],">")}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}};Jo=Symbol.toStringTag;Yt[Jo]=(s=>(s.unit=null,s.bitWidth=null,s[Symbol.toStringTag]="Time"))(Yt.prototype);var Kt=class extends M{constructor(e,t){super(f.Timestamp),this.unit=e,this.timezone=t}toString(){return"Timestamp<".concat(B[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}};el=Symbol.toStringTag;Kt[el]=(s=>(s.unit=null,s.timezone=null,s.ArrayType=BigInt64Array,s[Symbol.toStringTag]="Timestamp"))(Kt.prototype);var Xt=class extends M{constructor(e){super(f.Interval),this.unit=e}toString(){return"Interval<".concat(xe[this.unit],">")}};tl=Symbol.toStringTag;Xt[tl]=(s=>(s.unit=null,s.ArrayType=Int32Array,s[Symbol.toStringTag]="Interval"))(Xt.prototype);var Zt=class extends M{constructor(e){super(f.Duration),this.unit=e}toString(){return"Duration<".concat(B[this.unit],">")}};rl=Symbol.toStringTag;Zt[rl]=(s=>(s.unit=null,s.ArrayType=BigInt64Array,s[Symbol.toStringTag]="Duration"))(Zt.prototype);var ht=class extends M{constructor(e){super(f.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}};nl=Symbol.toStringTag;ht[nl]=(s=>(s.children=null,s[Symbol.toStringTag]="List"))(ht.prototype);var me=class extends M{constructor(e){super(f.Struct),this.children=e}toString(){return"Struct<{".concat(this.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};il=Symbol.toStringTag;me[il]=(s=>(s.children=null,s[Symbol.toStringTag]="Struct"))(me.prototype);var gt=class extends M{constructor(e,t,r){super(f.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(" | "),">")}};sl=Symbol.toStringTag;gt[sl]=(s=>(s.mode=null,s.typeIds=null,s.children=null,s.typeIdToChildIndex=null,s.ArrayType=Int8Array,s[Symbol.toStringTag]="Union"))(gt.prototype);var Jt=class extends M{constructor(e){super(f.FixedSizeBinary),this.byteWidth=e}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}};al=Symbol.toStringTag;Jt[al]=(s=>(s.byteWidth=null,s.ArrayType=Uint8Array,s[Symbol.toStringTag]="FixedSizeBinary"))(Jt.prototype);var yt=class extends M{constructor(e,t){super(f.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,">")}};ol=Symbol.toStringTag;yt[ol]=(s=>(s.children=null,s.listSize=null,s[Symbol.toStringTag]="FixedSizeList"))(yt.prototype);var bt=class extends M{constructor(e,t=!1){var r,n,a;if(super(f.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(", "),"}>")}};ll=Symbol.toStringTag;bt[ll]=(s=>(s.children=null,s.keysSorted=null,s[Symbol.toStringTag]="Map_"))(bt.prototype);var Bu=(s=>()=>++s)(-1),Xe=class extends M{constructor(e,t,r,n){super(f.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=n||!1,this.id=r==null?Bu():se(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,">")}};cl=Symbol.toStringTag;Xe[cl]=(s=>(s.id=null,s.indices=null,s.isOrdered=null,s.dictionary=null,s[Symbol.toStringTag]="Dictionary"))(Xe.prototype);function Ze(s){let e=s;switch(s.typeId){case f.Decimal:return s.bitWidth/32;case f.Interval:return 1+e.unit;case f.FixedSizeList:return e.listSize;case f.FixedSizeBinary:return e.byteWidth;default:return 1}}var N=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 Pu(this,e,t)}getVisitFnByTypeId(e,t=!0){return on(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 Pu(s,e,t=!0){return typeof e=="number"?on(s,e,t):typeof e=="string"&&e in f?on(s,f[e],t):e&&e instanceof M?on(s,ul(e),t):e!=null&&e.type&&e.type instanceof M?on(s,ul(e.type),t):on(s,f.NONE,t)}function on(s,e,t=!0){let r=null;switch(e){case f.Null:r=s.visitNull;break;case f.Bool:r=s.visitBool;break;case f.Int:r=s.visitInt;break;case f.Int8:r=s.visitInt8||s.visitInt;break;case f.Int16:r=s.visitInt16||s.visitInt;break;case f.Int32:r=s.visitInt32||s.visitInt;break;case f.Int64:r=s.visitInt64||s.visitInt;break;case f.Uint8:r=s.visitUint8||s.visitInt;break;case f.Uint16:r=s.visitUint16||s.visitInt;break;case f.Uint32:r=s.visitUint32||s.visitInt;break;case f.Uint64:r=s.visitUint64||s.visitInt;break;case f.Float:r=s.visitFloat;break;case f.Float16:r=s.visitFloat16||s.visitFloat;break;case f.Float32:r=s.visitFloat32||s.visitFloat;break;case f.Float64:r=s.visitFloat64||s.visitFloat;break;case f.Utf8:r=s.visitUtf8;break;case f.LargeUtf8:r=s.visitLargeUtf8;break;case f.Binary:r=s.visitBinary;break;case f.LargeBinary:r=s.visitLargeBinary;break;case f.FixedSizeBinary:r=s.visitFixedSizeBinary;break;case f.Date:r=s.visitDate;break;case f.DateDay:r=s.visitDateDay||s.visitDate;break;case f.DateMillisecond:r=s.visitDateMillisecond||s.visitDate;break;case f.Timestamp:r=s.visitTimestamp;break;case f.TimestampSecond:r=s.visitTimestampSecond||s.visitTimestamp;break;case f.TimestampMillisecond:r=s.visitTimestampMillisecond||s.visitTimestamp;break;case f.TimestampMicrosecond:r=s.visitTimestampMicrosecond||s.visitTimestamp;break;case f.TimestampNanosecond:r=s.visitTimestampNanosecond||s.visitTimestamp;break;case f.Time:r=s.visitTime;break;case f.TimeSecond:r=s.visitTimeSecond||s.visitTime;break;case f.TimeMillisecond:r=s.visitTimeMillisecond||s.visitTime;break;case f.TimeMicrosecond:r=s.visitTimeMicrosecond||s.visitTime;break;case f.TimeNanosecond:r=s.visitTimeNanosecond||s.visitTime;break;case f.Decimal:r=s.visitDecimal;break;case f.List:r=s.visitList;break;case f.Struct:r=s.visitStruct;break;case f.Union:r=s.visitUnion;break;case f.DenseUnion:r=s.visitDenseUnion||s.visitUnion;break;case f.SparseUnion:r=s.visitSparseUnion||s.visitUnion;break;case f.Dictionary:r=s.visitDictionary;break;case f.Interval:r=s.visitInterval;break;case f.IntervalDayTime:r=s.visitIntervalDayTime||s.visitInterval;break;case f.IntervalYearMonth:r=s.visitIntervalYearMonth||s.visitInterval;break;case f.Duration:r=s.visitDuration;break;case f.DurationSecond:r=s.visitDurationSecond||s.visitDuration;break;case f.DurationMillisecond:r=s.visitDurationMillisecond||s.visitDuration;break;case f.DurationMicrosecond:r=s.visitDurationMicrosecond||s.visitDuration;break;case f.DurationNanosecond:r=s.visitDurationNanosecond||s.visitDuration;break;case f.FixedSizeList:r=s.visitFixedSizeList;break;case f.Map:r=s.visitMap;break}if(typeof r=="function")return r;if(!t)return()=>null;throw new Error("Unrecognized type '".concat(f[e],"'"))}function ul(s){switch(s.typeId){case f.Null:return f.Null;case f.Int:{let{bitWidth:e,isSigned:t}=s;switch(e){case 8:return t?f.Int8:f.Uint8;case 16:return t?f.Int16:f.Uint16;case 32:return t?f.Int32:f.Uint32;case 64:return t?f.Int64:f.Uint64}return f.Int}case f.Float:switch(s.precision){case _e.HALF:return f.Float16;case _e.SINGLE:return f.Float32;case _e.DOUBLE:return f.Float64}return f.Float;case f.Binary:return f.Binary;case f.LargeBinary:return f.LargeBinary;case f.Utf8:return f.Utf8;case f.LargeUtf8:return f.LargeUtf8;case f.Bool:return f.Bool;case f.Decimal:return f.Decimal;case f.Time:switch(s.unit){case B.SECOND:return f.TimeSecond;case B.MILLISECOND:return f.TimeMillisecond;case B.MICROSECOND:return f.TimeMicrosecond;case B.NANOSECOND:return f.TimeNanosecond}return f.Time;case f.Timestamp:switch(s.unit){case B.SECOND:return f.TimestampSecond;case B.MILLISECOND:return f.TimestampMillisecond;case B.MICROSECOND:return f.TimestampMicrosecond;case B.NANOSECOND:return f.TimestampNanosecond}return f.Timestamp;case f.Date:switch(s.unit){case ve.DAY:return f.DateDay;case ve.MILLISECOND:return f.DateMillisecond}return f.Date;case f.Interval:switch(s.unit){case xe.DAY_TIME:return f.IntervalDayTime;case xe.YEAR_MONTH:return f.IntervalYearMonth}return f.Interval;case f.Duration:switch(s.unit){case B.SECOND:return f.DurationSecond;case B.MILLISECOND:return f.DurationMillisecond;case B.MICROSECOND:return f.DurationMicrosecond;case B.NANOSECOND:return f.DurationNanosecond}return f.Duration;case f.Map:return f.Map;case f.List:return f.List;case f.Struct:return f.Struct;case f.Union:switch(s.mode){case de.Dense:return f.DenseUnion;case de.Sparse:return f.SparseUnion}return f.Union;case f.FixedSizeBinary:return f.FixedSizeBinary;case f.FixedSizeList:return f.FixedSizeList;case f.Dictionary:return f.Dictionary}throw new Error("Unrecognized type '".concat(f[s.typeId],"'"))}N.prototype.visitInt8=null;N.prototype.visitInt16=null;N.prototype.visitInt32=null;N.prototype.visitInt64=null;N.prototype.visitUint8=null;N.prototype.visitUint16=null;N.prototype.visitUint32=null;N.prototype.visitUint64=null;N.prototype.visitFloat16=null;N.prototype.visitFloat32=null;N.prototype.visitFloat64=null;N.prototype.visitDateDay=null;N.prototype.visitDateMillisecond=null;N.prototype.visitTimestampSecond=null;N.prototype.visitTimestampMillisecond=null;N.prototype.visitTimestampMicrosecond=null;N.prototype.visitTimestampNanosecond=null;N.prototype.visitTimeSecond=null;N.prototype.visitTimeMillisecond=null;N.prototype.visitTimeMicrosecond=null;N.prototype.visitTimeNanosecond=null;N.prototype.visitDenseUnion=null;N.prototype.visitSparseUnion=null;N.prototype.visitIntervalDayTime=null;N.prototype.visitIntervalYearMonth=null;N.prototype.visitDuration=null;N.prototype.visitDurationSecond=null;N.prototype.visitDurationMillisecond=null;N.prototype.visitDurationMicrosecond=null;N.prototype.visitDurationNanosecond=null;var Ma={};fr(Ma,{float64ToUint16:()=>$n,uint16ToFloat64:()=>Zi});var _l=new Float64Array(1),ln=new Uint32Array(_l.buffer);function Zi(s){let e=(s&31744)>>10,t=(s&1023)/1024,r=Math.pow(-1,(s&32768)>>15);switch(e){case 31:return r*(t?Number.NaN:1/0);case 0:return r*(t?6103515625e-14*t:0)}return r*Math.pow(2,e-15)*(1+t)}function $n(s){if(s!==s)return 32256;_l[0]=s;let e=(ln[1]&2147483648)>>16&65535,t=ln[1]&2146435072,r=0;return t>=1089470464?ln[0]>0?t=31744:(t=(t&2080374784)>>16,r=(ln[1]&1048575)>>10):t<=1056964608?(r=1048576+(ln[1]&1048575),r=1048576+(r<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,r=(ln[1]&1048575)+512>>10),e|t|r&65535}var j=class extends N{};function Q(s){return(e,t,r)=>{if(e.setValid(t,r!=null))return s(e,t,r)}}var Cu=(s,e,t)=>{s[e]=Math.floor(t/864e5)},dl=(s,e,t,r)=>{if(t+1<e.length){let n=se(e[t]),a=se(e[t+1]);s.set(r.subarray(0,a-n),n)}},Uu=({offset:s,values:e},t,r)=>{let n=s+t;r?e[n>>3]|=1<<n%8:e[n>>3]&=~(1<<n%8)},er=({values:s},e,t)=>{s[e]=t},ka=({values:s},e,t)=>{s[e]=t},fl=({values:s},e,t)=>{s[e]=$n(t)},Ou=(s,e,t)=>{switch(s.type.precision){case _e.HALF:return fl(s,e,t);case _e.SINGLE:case _e.DOUBLE:return ka(s,e,t)}},Ji=({values:s},e,t)=>{Cu(s,e,t.valueOf())},es=({values:s},e,t)=>{s[e]=BigInt(t)},Ba=({stride:s,values:e},t,r)=>{e.set(r.subarray(0,s),s*t)},pl=({values:s,valueOffsets:e},t,r)=>dl(s,e,t,r),ml=({values:s,valueOffsets:e},t,r)=>dl(s,e,t,Tt(r)),Pa=(s,e,t)=>{s.type.unit===ve.DAY?Ji(s,e,t):es(s,e,t)},ts=({values:s},e,t)=>{s[e]=BigInt(t/1e3)},rs=({values:s},e,t)=>{s[e]=BigInt(t)},ns=({values:s},e,t)=>{s[e]=BigInt(t*1e3)},is=({values:s},e,t)=>{s[e]=BigInt(t*1e6)},Ca=(s,e,t)=>{switch(s.type.unit){case B.SECOND:return ts(s,e,t);case B.MILLISECOND:return rs(s,e,t);case B.MICROSECOND:return ns(s,e,t);case B.NANOSECOND:return is(s,e,t)}},ss=({values:s},e,t)=>{s[e]=t},as=({values:s},e,t)=>{s[e]=t},os=({values:s},e,t)=>{s[e]=t},ls=({values:s},e,t)=>{s[e]=t},Ua=(s,e,t)=>{switch(s.type.unit){case B.SECOND:return ss(s,e,t);case B.MILLISECOND:return as(s,e,t);case B.MICROSECOND:return os(s,e,t);case B.NANOSECOND:return ls(s,e,t)}},Oa=({values:s,stride:e},t,r)=>{s.set(r.subarray(0,e),e*t)},Nu=(s,e,t)=>{let r=s.children[0],n=s.valueOffsets,a=De.getVisitFn(r);if(Array.isArray(t))for(let o=-1,l=n[e],c=n[e+1];l<c;)a(r,l++,t[++o]);else for(let o=-1,l=n[e],c=n[e+1];l<c;)a(r,l++,t.get(++o))},Ru=(s,e,t)=>{let r=s.children[0],{valueOffsets:n}=s,a=De.getVisitFn(r),{[e]:o,[e+1]:l}=n,c=t instanceof Map?t.entries():Object.entries(t);for(let u of c)if(a(r,o,u),++o>=l)break},Gu=(s,e)=>(t,r,n,a)=>r&&t(r,s,e[a]),Hu=(s,e)=>(t,r,n,a)=>r&&t(r,s,e.get(a)),Vu=(s,e)=>(t,r,n,a)=>r&&t(r,s,e.get(n.name)),ju=(s,e)=>(t,r,n,a)=>r&&t(r,s,e[n.name]),Wu=(s,e,t)=>{let r=s.type.children.map(a=>De.getVisitFn(a.type)),n=t instanceof Map?Vu(e,t):t instanceof re?Hu(e,t):Array.isArray(t)?Gu(e,t):ju(e,t);s.type.children.forEach((a,o)=>n(r[o],s.children[o],a,o))},zu=(s,e,t)=>{s.type.mode===de.Dense?hl(s,e,t):gl(s,e,t)},hl=(s,e,t)=>{let r=s.type.typeIdToChildIndex[s.typeIds[e]],n=s.children[r];De.visit(n,s.valueOffsets[e],t)},gl=(s,e,t)=>{let r=s.type.typeIdToChildIndex[s.typeIds[e]],n=s.children[r];De.visit(n,e,t)},$u=(s,e,t)=>{var r;(r=s.dictionary)===null||r===void 0||r.set(s.values[e],t)},Na=(s,e,t)=>{s.type.unit===xe.DAY_TIME?cs(s,e,t):us(s,e,t)},cs=({values:s},e,t)=>{s.set(t.subarray(0,2),2*e)},us=({values:s},e,t)=>{s[e]=t[0]*12+t[1]%12},_s=({values:s},e,t)=>{s[e]=t},ds=({values:s},e,t)=>{s[e]=t},ps=({values:s},e,t)=>{s[e]=t},ms=({values:s},e,t)=>{s[e]=t},Ra=(s,e,t)=>{switch(s.type.unit){case B.SECOND:return _s(s,e,t);case B.MILLISECOND:return ds(s,e,t);case B.MICROSECOND:return ps(s,e,t);case B.NANOSECOND:return ms(s,e,t)}},qu=(s,e,t)=>{let{stride:r}=s,n=s.children[0],a=De.getVisitFn(n);if(Array.isArray(t))for(let o=-1,l=e*r;++o<r;)a(n,l+o,t[o]);else for(let o=-1,l=e*r;++o<r;)a(n,l+o,t.get(o))};j.prototype.visitBool=Q(Uu);j.prototype.visitInt=Q(er);j.prototype.visitInt8=Q(er);j.prototype.visitInt16=Q(er);j.prototype.visitInt32=Q(er);j.prototype.visitInt64=Q(er);j.prototype.visitUint8=Q(er);j.prototype.visitUint16=Q(er);j.prototype.visitUint32=Q(er);j.prototype.visitUint64=Q(er);j.prototype.visitFloat=Q(Ou);j.prototype.visitFloat16=Q(fl);j.prototype.visitFloat32=Q(ka);j.prototype.visitFloat64=Q(ka);j.prototype.visitUtf8=Q(ml);j.prototype.visitLargeUtf8=Q(ml);j.prototype.visitBinary=Q(pl);j.prototype.visitLargeBinary=Q(pl);j.prototype.visitFixedSizeBinary=Q(Ba);j.prototype.visitDate=Q(Pa);j.prototype.visitDateDay=Q(Ji);j.prototype.visitDateMillisecond=Q(es);j.prototype.visitTimestamp=Q(Ca);j.prototype.visitTimestampSecond=Q(ts);j.prototype.visitTimestampMillisecond=Q(rs);j.prototype.visitTimestampMicrosecond=Q(ns);j.prototype.visitTimestampNanosecond=Q(is);j.prototype.visitTime=Q(Ua);j.prototype.visitTimeSecond=Q(ss);j.prototype.visitTimeMillisecond=Q(as);j.prototype.visitTimeMicrosecond=Q(os);j.prototype.visitTimeNanosecond=Q(ls);j.prototype.visitDecimal=Q(Oa);j.prototype.visitList=Q(Nu);j.prototype.visitStruct=Q(Wu);j.prototype.visitUnion=Q(zu);j.prototype.visitDenseUnion=Q(hl);j.prototype.visitSparseUnion=Q(gl);j.prototype.visitDictionary=Q($u);j.prototype.visitInterval=Q(Na);j.prototype.visitIntervalDayTime=Q(cs);j.prototype.visitIntervalYearMonth=Q(us);j.prototype.visitDuration=Q(Ra);j.prototype.visitDurationSecond=Q(_s);j.prototype.visitDurationMillisecond=Q(ds);j.prototype.visitDurationMicrosecond=Q(ps);j.prototype.visitDurationNanosecond=Q(ms);j.prototype.visitFixedSizeList=Q(qu);j.prototype.visitMap=Q(Ru);var De=new j;var vt=Symbol.for("parent"),cn=Symbol.for("rowIndex"),wr=class{constructor(e,t){return this[vt]=e,this[cn]=t,new Proxy(this,new Ha)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[cn],t=this[vt],r=t.type.children,n={};for(let a=-1,o=r.length;++a<o;)n[r[a].name]=Ae.visit(t.children[a],e);return n}toString(){return"{".concat([...this].map(([e,t])=>"".concat(pt(e),": ").concat(pt(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Ga(this[vt],this[cn])}},Ga=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 e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,Ae.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(wr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[vt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[cn]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Ha=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[vt].type.children.map(t=>t.name)}has(e,t){return e[vt].type.children.findIndex(r=>r.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[vt].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[vt].type.children.findIndex(n=>n.name===t);if(r!==-1){let n=Ae.visit(e[vt].children[r],e[cn]);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[vt].type.children.findIndex(a=>a.name===t);return n!==-1?(De.visit(e[vt].children[n],e[cn],r),Reflect.set(e,t,r)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,r):!1}};var R=class extends N{};function z(s){return(e,t)=>e.getValid(t)?s(e,t):null}var Qu=(s,e)=>864e5*s[e],Yu=(s,e)=>null,yl=(s,e,t)=>{if(t+1>=e.length)return null;let r=se(e[t]),n=se(e[t+1]);return s.subarray(r,n)},Ku=({offset:s,values:e},t)=>{let r=s+t;return(e[r>>3]&1<<r%8)!==0},bl=({values:s},e)=>Qu(s,e),vl=({values:s},e)=>se(s[e]),Ar=({stride:s,values:e},t)=>e[s*t],Xu=({stride:s,values:e},t)=>Zi(e[s*t]),Sl=({values:s},e)=>s[e],Zu=({stride:s,values:e},t)=>e.subarray(s*t,s*(t+1)),wl=({values:s,valueOffsets:e},t)=>yl(s,e,t),Al=({values:s,valueOffsets:e},t)=>{let r=yl(s,e,t);return r!==null?In(r):null},Ju=({values:s},e)=>s[e],e_=({type:s,values:e},t)=>s.precision!==_e.HALF?e[t]:Zi(e[t]),t_=(s,e)=>s.type.unit===ve.DAY?bl(s,e):vl(s,e),El=({values:s},e)=>1e3*se(s[e]),Fl=({values:s},e)=>se(s[e]),xl=({values:s},e)=>La(s[e],BigInt(1e3)),Ll=({values:s},e)=>La(s[e],BigInt(1e6)),r_=(s,e)=>{switch(s.type.unit){case B.SECOND:return El(s,e);case B.MILLISECOND:return Fl(s,e);case B.MICROSECOND:return xl(s,e);case B.NANOSECOND:return Ll(s,e)}},Tl=({values:s},e)=>s[e],Il=({values:s},e)=>s[e],Dl=({values:s},e)=>s[e],Ml=({values:s},e)=>s[e],n_=(s,e)=>{switch(s.type.unit){case B.SECOND:return Tl(s,e);case B.MILLISECOND:return Il(s,e);case B.MICROSECOND:return Dl(s,e);case B.NANOSECOND:return Ml(s,e)}},i_=({values:s,stride:e},t)=>zn.decimal(s.subarray(e*t,e*(t+1))),s_=(s,e)=>{let{valueOffsets:t,stride:r,children:n}=s,{[e*r]:a,[e*r+1]:o}=t,c=n[0].slice(a,o-a);return new re([c])},a_=(s,e)=>{let{valueOffsets:t,children:r}=s,{[e]:n,[e+1]:a}=t,o=r[0];return new Pt(o.slice(n,a-n))},o_=(s,e)=>new wr(s,e),l_=(s,e)=>s.type.mode===de.Dense?kl(s,e):Bl(s,e),kl=(s,e)=>{let t=s.type.typeIdToChildIndex[s.typeIds[e]],r=s.children[t];return Ae.visit(r,s.valueOffsets[e])},Bl=(s,e)=>{let t=s.type.typeIdToChildIndex[s.typeIds[e]],r=s.children[t];return Ae.visit(r,e)},c_=(s,e)=>{var t;return(t=s.dictionary)===null||t===void 0?void 0:t.get(s.values[e])},u_=(s,e)=>s.type.unit===xe.DAY_TIME?Pl(s,e):Cl(s,e),Pl=({values:s},e)=>s.subarray(2*e,2*(e+1)),Cl=({values:s},e)=>{let t=s[e],r=new Int32Array(2);return r[0]=Math.trunc(t/12),r[1]=Math.trunc(t%12),r},Ul=({values:s},e)=>s[e],Ol=({values:s},e)=>s[e],Nl=({values:s},e)=>s[e],Rl=({values:s},e)=>s[e],__=(s,e)=>{switch(s.type.unit){case B.SECOND:return Ul(s,e);case B.MILLISECOND:return Ol(s,e);case B.MICROSECOND:return Nl(s,e);case B.NANOSECOND:return Rl(s,e)}},d_=(s,e)=>{let{stride:t,children:r}=s,a=r[0].slice(e*t,t);return new re([a])};R.prototype.visitNull=z(Yu);R.prototype.visitBool=z(Ku);R.prototype.visitInt=z(Ju);R.prototype.visitInt8=z(Ar);R.prototype.visitInt16=z(Ar);R.prototype.visitInt32=z(Ar);R.prototype.visitInt64=z(Sl);R.prototype.visitUint8=z(Ar);R.prototype.visitUint16=z(Ar);R.prototype.visitUint32=z(Ar);R.prototype.visitUint64=z(Sl);R.prototype.visitFloat=z(e_);R.prototype.visitFloat16=z(Xu);R.prototype.visitFloat32=z(Ar);R.prototype.visitFloat64=z(Ar);R.prototype.visitUtf8=z(Al);R.prototype.visitLargeUtf8=z(Al);R.prototype.visitBinary=z(wl);R.prototype.visitLargeBinary=z(wl);R.prototype.visitFixedSizeBinary=z(Zu);R.prototype.visitDate=z(t_);R.prototype.visitDateDay=z(bl);R.prototype.visitDateMillisecond=z(vl);R.prototype.visitTimestamp=z(r_);R.prototype.visitTimestampSecond=z(El);R.prototype.visitTimestampMillisecond=z(Fl);R.prototype.visitTimestampMicrosecond=z(xl);R.prototype.visitTimestampNanosecond=z(Ll);R.prototype.visitTime=z(n_);R.prototype.visitTimeSecond=z(Tl);R.prototype.visitTimeMillisecond=z(Il);R.prototype.visitTimeMicrosecond=z(Dl);R.prototype.visitTimeNanosecond=z(Ml);R.prototype.visitDecimal=z(i_);R.prototype.visitList=z(s_);R.prototype.visitStruct=z(o_);R.prototype.visitUnion=z(l_);R.prototype.visitDenseUnion=z(kl);R.prototype.visitSparseUnion=z(Bl);R.prototype.visitDictionary=z(c_);R.prototype.visitInterval=z(u_);R.prototype.visitIntervalDayTime=z(Pl);R.prototype.visitIntervalYearMonth=z(Cl);R.prototype.visitDuration=z(__);R.prototype.visitDurationSecond=z(Ul);R.prototype.visitDurationMillisecond=z(Ol);R.prototype.visitDurationMicrosecond=z(Nl);R.prototype.visitDurationNanosecond=z(Rl);R.prototype.visitFixedSizeList=z(d_);R.prototype.visitMap=z(a_);var Ae=new R;var Er=Symbol.for("keys"),_n=Symbol.for("vals"),un=Symbol.for("kKeysAsStrings"),Va=Symbol.for("_kKeysAsStrings"),Pt=class{constructor(e){return this[Er]=new re([e.children[0]]).memoize(),this[_n]=e.children[1],new Proxy(this,new Wa)}get[un](){return this[Va]||(this[Va]=Array.from(this[Er].toArray(),String))}[Symbol.iterator](){return new ja(this[Er],this[_n])}get size(){return this[Er].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Er],t=this[_n],r={};for(let n=-1,a=e.length;++n<a;)r[e.get(n)]=Ae.visit(t,n);return r}toString(){return"{".concat([...this].map(([e,t])=>"".concat(pt(e),": ").concat(pt(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},ja=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),Ae.visit(this.vals,e)]})}},Wa=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[un]}has(e,t){return e[un].includes(t)}getOwnPropertyDescriptor(e,t){if(e[un].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let r=e[un].indexOf(t);if(r!==-1){let n=Ae.visit(Reflect.get(e,_n),r);return Reflect.set(e,t,n),n}}set(e,t,r){let n=e[un].indexOf(t);return n!==-1?(De.visit(Reflect.get(e,_n),n,r),Reflect.set(e,t,r)):Reflect.has(e,t)?Reflect.set(e,t,r):!1}};Object.defineProperties(Pt.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Er]:{writable:!0,enumerable:!1,configurable:!1,value:null},[_n]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Va]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Gl;function qn(s,e,t,r){let{length:n=0}=s,a=typeof e!="number"?0:e,o=typeof t!="number"?n:t;return a<0&&(a=(a%n+n)%n),o<0&&(o=(o%n+n)%n),o<a&&(Gl=a,a=o,o=Gl),o>n&&(o=n),r?r(s,a,o):[a,o]}var Pr=(s,e)=>s<0?e+s:s,Hl=s=>s!==s;function Fr(s){if(typeof s!=="object"||s===null)return Hl(s)?Hl:t=>t===s;if(s instanceof Date){let t=s.valueOf();return r=>r instanceof Date?r.valueOf()===t:!1}return ArrayBuffer.isView(s)?t=>t?wa(s,t):!1:s instanceof Map?p_(s):Array.isArray(s)?f_(s):s instanceof re?m_(s):h_(s,!0)}function f_(s){let e=[];for(let t=-1,r=s.length;++t<r;)e[t]=Fr(s[t]);return hs(e)}function p_(s){let e=-1,t=[];for(let r of s.values())t[++e]=Fr(r);return hs(t)}function m_(s){let e=[];for(let t=-1,r=s.length;++t<r;)e[t]=Fr(s.get(t));return hs(e)}function h_(s,e=!1){let t=Object.keys(s);if(!e&&t.length===0)return()=>!1;let r=[];for(let n=-1,a=t.length;++n<a;)r[n]=Fr(s[t[n]]);return hs(r,t)}function hs(s,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return g_(s,t);case Map:return Vl(s,t,t.keys());case Pt:case wr:case Object:case void 0:return Vl(s,t,e||Object.keys(t))}return t instanceof re?y_(s,t):!1}}function g_(s,e){let t=s.length;if(e.length!==t)return!1;for(let r=-1;++r<t;)if(!s[r](e[r]))return!1;return!0}function y_(s,e){let t=s.length;if(e.length!==t)return!1;for(let r=-1;++r<t;)if(!s[r](e.get(r)))return!1;return!0}function Vl(s,e,t){let r=t[Symbol.iterator](),n=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),a=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),o=0,l=s.length,c=a.next(),u=r.next(),_=n.next();for(;o<l&&!u.done&&!_.done&&!c.done&&!(u.value!==_.value||!s[o](c.value));++o,u=r.next(),_=n.next(),c=a.next());return o===l&&u.done&&_.done&&c.done?!0:(r.return&&r.return(),n.return&&n.return(),a.return&&a.return(),!1)}var $a={};fr($a,{BitIterator:()=>Cr,getBit:()=>jl,getBool:()=>ys,packBools:()=>Or,popcnt_array:()=>Wl,popcnt_bit_range:()=>Qn,popcnt_uint32:()=>gs,setBool:()=>b_,truncateBitmap:()=>Ur});function ys(s,e,t,r){return(t&1<<r)!==0}function jl(s,e,t,r){return(t&1<<r)>>r}function b_(s,e,t){return t?!!(s[e>>3]|=1<<e%8)||!0:!(s[e>>3]&=~(1<<e%8))&&!1}function Ur(s,e,t){let r=t.byteLength+7&-8;if(s>0||t.byteLength<r){let n=new Uint8Array(r);return n.set(s%8===0?t.subarray(s>>3):Or(new Cr(t,s,e,null,ys)).subarray(0,r)),n}return t}function Or(s){let e=[],t=0,r=0,n=0;for(let o of s)o&&(n|=1<<r),++r===8&&(e[t++]=n,n=r=0);(t===0||r>0)&&(e[t++]=n);let a=new Uint8Array(e.length+7&-8);return a.set(e),a}var Cr=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<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}};function Qn(s,e,t){if(t-e<=0)return 0;if(t-e<8){let a=0;for(let o of new Cr(s,e,t-e,s,jl))a+=o;return a}let r=t>>3<<3,n=e+(e%8===0?0:8-e%8);return Qn(s,e,n)+Qn(s,r,t)+Wl(s,n>>3,r-n>>3)}function Wl(s,e,t){let r=0,n=Math.trunc(e),a=new DataView(s.buffer,s.byteOffset,s.byteLength),o=t===void 0?s.byteLength:n+t;for(;o-n>=4;)r+=gs(a.getUint32(n)),n+=4;for(;o-n>=2;)r+=gs(a.getUint16(n)),n+=2;for(;o-n>=1;)r+=gs(a.getUint8(n)),n+=1;return r}function gs(s){let e=Math.trunc(s);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var v_=-1,ae=class s{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:e}=this;return M.isSparseUnion(e)?this.children.some(t=>t.nullable):M.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:r,nullBitmap:n,typeIds:a}=this;return t&&(e+=t.byteLength),r&&(e+=r.byteLength),n&&(e+=n.byteLength),a&&(e+=a.byteLength),this.children.reduce((o,l)=>o+l.byteLength,e)}get nullCount(){if(M.isUnion(this.type))return this.children.reduce((r,n)=>r+n.nullCount,0);let e=this._nullCount,t;return e<=v_&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-Qn(t,this.offset,this.offset+this.length)),e}constructor(e,t,r,n,a,o=[],l){this.type=e,this.children=o,this.dictionary=l,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let c;a instanceof s?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=Ze(e),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(M.isUnion(t)){let r=t,n=this.children[r.typeIdToChildIndex[this.typeIds[e]]],a=r.mode===de.Dense?this.valueOffsets[e]:e;return n.getValid(a)}if(this.nullable&&this.nullCount>0){let r=this.offset+e;return(this.nullBitmap[r>>3]&1<<r%8)!==0}return!0}setValid(e,t){let r,{type:n}=this;if(M.isUnion(n)){let a=n,o=this.children[a.typeIdToChildIndex[this.typeIds[e]]],l=a.mode===de.Dense?this.valueOffsets[e]:e;r=o.getValid(l),o.setValid(l,t)}else{let{nullBitmap:a}=this,{offset:o,length:l}=this,c=o+e,u=1<<c%8,_=c>>3;(!a||a.byteLength<=_)&&(a=new Uint8Array((o+l+63&-64)>>3).fill(255),this.nullCount>0?(a.set(Ur(o,l,this.nullBitmap),0),Object.assign(this,{nullBitmap:a})):Object.assign(this,{nullBitmap:a,_nullCount:0}));let d=a[_];r=(d&u)!==0,a[_]=t?d|u:d&~u}return r!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,r=this.length,n=this._nullCount,a=this,o=this.children){return new s(e,t,r,n,a,o,this.dictionary)}slice(e,t){let{stride:r,typeId:n,children:a}=this,o=+(this._nullCount===0)-1,l=n===16?r:1,c=this._sliceBuffers(e,t,r,n);return this.clone(this.type,this.offset+e,t,o,c,a.length===0||this.valueOffsets?a:this._sliceChildren(a,l*e,l*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===f.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:r}=this,n=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);n[t>>3]=(1<<t-(t&-8))-1,r>0&&n.set(Ur(this.offset,t,this.nullBitmap),0);let a=this.buffers;return a[rt.VALIDITY]=n,this.clone(this.type,0,e,r+(e-t),a)}_sliceBuffers(e,t,r,n){let a,{buffers:o}=this;return(a=o[rt.TYPE])&&(o[rt.TYPE]=a.subarray(e,e+t)),(a=o[rt.OFFSET])&&(o[rt.OFFSET]=a.subarray(e,e+t+1))||(a=o[rt.DATA])&&(o[rt.DATA]=n===6?a:a.subarray(r*e,r*(e+t))),o}_sliceChildren(e,t,r){return e.map(n=>n.slice(t,r))}};ae.prototype.children=Object.freeze([]);var qa=class s extends N{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:t,["offset"]:r=0,["length"]:n=0}=e;return new ae(t,r,n,n)}visitBool(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length>>3,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitInt(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitFloat(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitUtf8(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.data),a=W(e.nullBitmap),o=kr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,n,a])}visitLargeUtf8(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.data),a=W(e.nullBitmap),o=Ci(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,n,a])}visitBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.data),a=W(e.nullBitmap),o=kr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,n,a])}visitLargeBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.data),a=W(e.nullBitmap),o=Ci(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,n,a])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitDate(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitTimestamp(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitTime(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitDecimal(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitList(e){let{["type"]:t,["offset"]:r=0,["child"]:n}=e,a=W(e.nullBitmap),o=kr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,void 0,a],[n])}visitStruct(e){let{["type"]:t,["offset"]:r=0,["children"]:n=[]}=e,a=W(e.nullBitmap),{length:o=n.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,void 0,a],n)}visitUnion(e){let{["type"]:t,["offset"]:r=0,["children"]:n=[]}=e,a=J(t.ArrayType,e.typeIds),{["length"]:o=a.length,["nullCount"]:l=-1}=e;if(M.isSparseUnion(t))return new ae(t,r,o,l,[void 0,void 0,void 0,a],n);let c=kr(e.valueOffsets);return new ae(t,r,o,l,[c,void 0,void 0,a],n)}visitDictionary(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.indices.ArrayType,e.data),{["dictionary"]:o=new re([new s().visit({type:t.dictionary})])}=e,{["length"]:l=a.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[void 0,a,n],[],o)}visitInterval(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitDuration(e){let{["type"]:t,["offset"]:r=0}=e,n=W(e.nullBitmap),a=J(t.ArrayType,e.data),{["length"]:o=a.length,["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,a,n])}visitFixedSizeList(e){let{["type"]:t,["offset"]:r=0,["child"]:n=new s().visit({type:t.valueType})}=e,a=W(e.nullBitmap),{["length"]:o=n.length/Ze(t),["nullCount"]:l=e.nullBitmap?-1:0}=e;return new ae(t,r,o,l,[void 0,void 0,a],[n])}visitMap(e){let{["type"]:t,["offset"]:r=0,["child"]:n=new s().visit({type:t.childType})}=e,a=W(e.nullBitmap),o=kr(e.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ae(t,r,l,c,[o,void 0,a],[n])}},S_=new qa;function Y(s){return S_.visit(s)}var Yn=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}};function zl(s){return s.some(e=>e.nullable)}function bs(s){return s.reduce((e,t)=>e+t.nullCount,0)}function vs(s){return s.reduce((e,t,r)=>(e[r+1]=e[r]+t.length,e),new Uint32Array(s.length+1))}function Ss(s,e,t,r){let n=[];for(let a=-1,o=s.length;++a<o;){let l=s[a],c=e[a],{length:u}=l;if(c>=r)break;if(t>=c+u)continue;if(c>=t&&c+u<=r){n.push(l);continue}let _=Math.max(0,t-c),d=Math.min(r-c,u);n.push(l.slice(_,d-_))}return n.length===0&&n.push(s[0].slice(0,0)),n}function Qa(s,e,t,r){let n=0,a=0,o=e.length-1;do{if(n>=o-1)return t<e[o]?r(s,n,t-e[n]):null;a=n+Math.trunc((o-n)*.5),t<e[a]?o=a:n=a}while(n<o)}function Kn(s,e){return s.getValid(e)}function dn(s){function e(t,r,n){return s(t[r],n)}return function(t){let r=this.data;return Qa(r,this._offsets,t,e)}}function ws(s){let e;function t(r,n,a){return s(r[n],a,e)}return function(r,n){let a=this.data;e=n;let o=Qa(a,this._offsets,r,t);return e=void 0,o}}function As(s){let e;function t(r,n,a){let o=a,l=0,c=0;for(let u=n-1,_=r.length;++u<_;){let d=r[u];if(~(l=s(d,e,o)))return c+l;o=0,c+=d.length}return-1}return function(r,n){e=r;let a=this.data,o=typeof n!="number"?t(a,0,0):Qa(a,this._offsets,n,t);return e=void 0,o}}var G=class extends N{};function w_(s,e){return e===null&&s.length>0?0:-1}function A_(s,e){let{nullBitmap:t}=s;if(!t||s.nullCount<=0)return-1;let r=0;for(let n of new Cr(t,s.offset+(e||0),s.length,t,ys)){if(!n)return r;++r}return-1}function K(s,e,t){if(e===void 0)return-1;if(e===null)switch(s.typeId){case f.Union:break;case f.Dictionary:break;default:return A_(s,t)}let r=Ae.getVisitFn(s),n=Fr(e);for(let a=(t||0)-1,o=s.length;++a<o;)if(n(r(s,a)))return a;return-1}function $l(s,e,t){let r=Ae.getVisitFn(s),n=Fr(e);for(let a=(t||0)-1,o=s.length;++a<o;)if(n(r(s,a)))return a;return-1}G.prototype.visitNull=w_;G.prototype.visitBool=K;G.prototype.visitInt=K;G.prototype.visitInt8=K;G.prototype.visitInt16=K;G.prototype.visitInt32=K;G.prototype.visitInt64=K;G.prototype.visitUint8=K;G.prototype.visitUint16=K;G.prototype.visitUint32=K;G.prototype.visitUint64=K;G.prototype.visitFloat=K;G.prototype.visitFloat16=K;G.prototype.visitFloat32=K;G.prototype.visitFloat64=K;G.prototype.visitUtf8=K;G.prototype.visitLargeUtf8=K;G.prototype.visitBinary=K;G.prototype.visitLargeBinary=K;G.prototype.visitFixedSizeBinary=K;G.prototype.visitDate=K;G.prototype.visitDateDay=K;G.prototype.visitDateMillisecond=K;G.prototype.visitTimestamp=K;G.prototype.visitTimestampSecond=K;G.prototype.visitTimestampMillisecond=K;G.prototype.visitTimestampMicrosecond=K;G.prototype.visitTimestampNanosecond=K;G.prototype.visitTime=K;G.prototype.visitTimeSecond=K;G.prototype.visitTimeMillisecond=K;G.prototype.visitTimeMicrosecond=K;G.prototype.visitTimeNanosecond=K;G.prototype.visitDecimal=K;G.prototype.visitList=K;G.prototype.visitStruct=K;G.prototype.visitUnion=K;G.prototype.visitDenseUnion=$l;G.prototype.visitSparseUnion=$l;G.prototype.visitDictionary=K;G.prototype.visitInterval=K;G.prototype.visitIntervalDayTime=K;G.prototype.visitIntervalYearMonth=K;G.prototype.visitDuration=K;G.prototype.visitDurationSecond=K;G.prototype.visitDurationMillisecond=K;G.prototype.visitDurationMicrosecond=K;G.prototype.visitDurationNanosecond=K;G.prototype.visitFixedSizeList=K;G.prototype.visitMap=K;var Nr=new G;var H=class extends N{};function $(s){let{type:e}=s;if(s.nullCount===0&&s.stride===1&&(M.isInt(e)&&e.bitWidth!==64||M.isTime(e)&&e.bitWidth!==64||M.isFloat(e)&&e.precision!==_e.HALF))return new Yn(s.data.length,r=>{let n=s.data[r];return n.values.subarray(0,n.length)[Symbol.iterator]()});let t=0;return new Yn(s.data.length,r=>{let a=s.data[r].length,o=s.slice(t,t+a);return t+=a,new Ya(o)})}var Ya=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};H.prototype.visitNull=$;H.prototype.visitBool=$;H.prototype.visitInt=$;H.prototype.visitInt8=$;H.prototype.visitInt16=$;H.prototype.visitInt32=$;H.prototype.visitInt64=$;H.prototype.visitUint8=$;H.prototype.visitUint16=$;H.prototype.visitUint32=$;H.prototype.visitUint64=$;H.prototype.visitFloat=$;H.prototype.visitFloat16=$;H.prototype.visitFloat32=$;H.prototype.visitFloat64=$;H.prototype.visitUtf8=$;H.prototype.visitLargeUtf8=$;H.prototype.visitBinary=$;H.prototype.visitLargeBinary=$;H.prototype.visitFixedSizeBinary=$;H.prototype.visitDate=$;H.prototype.visitDateDay=$;H.prototype.visitDateMillisecond=$;H.prototype.visitTimestamp=$;H.prototype.visitTimestampSecond=$;H.prototype.visitTimestampMillisecond=$;H.prototype.visitTimestampMicrosecond=$;H.prototype.visitTimestampNanosecond=$;H.prototype.visitTime=$;H.prototype.visitTimeSecond=$;H.prototype.visitTimeMillisecond=$;H.prototype.visitTimeMicrosecond=$;H.prototype.visitTimeNanosecond=$;H.prototype.visitDecimal=$;H.prototype.visitList=$;H.prototype.visitStruct=$;H.prototype.visitUnion=$;H.prototype.visitDenseUnion=$;H.prototype.visitSparseUnion=$;H.prototype.visitDictionary=$;H.prototype.visitInterval=$;H.prototype.visitIntervalDayTime=$;H.prototype.visitIntervalYearMonth=$;H.prototype.visitDuration=$;H.prototype.visitDurationSecond=$;H.prototype.visitDurationMillisecond=$;H.prototype.visitDurationMicrosecond=$;H.prototype.visitDurationNanosecond=$;H.prototype.visitFixedSizeList=$;H.prototype.visitMap=$;var fn=new H;var ql,Ql={},Yl={},re=class s{constructor(e){var t,r,n;let a=e[0]instanceof s?e.flatMap(l=>l.data):e;if(a.length===0||a.some(l=>!(l instanceof ae)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(t=a[0])===null||t===void 0?void 0:t.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:l,set:c,indexOf:u}=Ql[o.typeId],_=a[0];this.isValid=d=>Kn(_,d),this.get=d=>l(_,d),this.set=(d,m)=>c(_,d,m),this.indexOf=d=>u(_,d),this._offsets=[0,_.length];break}default:Object.setPrototypeOf(this,Yl[o.typeId]),this._offsets=vs(a);break}this.data=a,this.type=o,this.stride=Ze(o),this.numChildren=(n=(r=o.children)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return zl(this.data)}get nullCount(){return bs(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}get VectorName(){return"".concat(f[this.type.typeId],"Vector")}isValid(e){return!1}get(e){return null}at(e){return this.get(Pr(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return fn.visit(this)}concat(...e){return new s(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new s(qn(this,e,t,({data:r,_offsets:n},a,o)=>Ss(r,n,a,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:r,stride:n,ArrayType:a}=this;switch(e.typeId){case f.Int:case f.Float:case f.Decimal:case f.Time:case f.Timestamp:switch(t.length){case 0:return new a;case 1:return t[0].values.subarray(0,r*n);default:return t.reduce((o,{values:l,length:c})=>(o.array.set(l.subarray(0,c*n),o.offset),o.offset+=c*n,o),{array:new a(r*n),offset:0}).array}}return[...this]}toString(){return"[".concat([...this].join(","),"]")}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(r=>r.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new s(this.data.map(({children:t})=>t[e])):null}get isMemoized(){return M.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(M.isDictionary(this.type)){let e=new Es(this.data[0].dictionary),t=this.data.map(r=>{let n=r.clone();return n.dictionary=e,n});return new s(t)}return new Es(this)}unmemoize(){if(M.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),t=this.data.map(r=>{let n=r.clone();return n.dictionary=e,n});return new s(t)}return this}};ql=Symbol.toStringTag;re[ql]=(s=>{s.type=M.prototype,s.data=[],s.length=0,s.stride=1,s.numChildren=0,s._offsets=new Uint32Array([0]),s[Symbol.isConcatSpreadable]=!0;let e=Object.keys(f).map(t=>f[t]).filter(t=>typeof t=="number"&&t!==f.NONE);for(let t of e){let r=Ae.getVisitFnByTypeId(t),n=De.getVisitFnByTypeId(t),a=Nr.getVisitFnByTypeId(t);Ql[t]={get:r,set:n,indexOf:a},Yl[t]=Object.create(s,{isValid:{value:dn(Kn)},get:{value:dn(Ae.getVisitFnByTypeId(t))},set:{value:ws(De.getVisitFnByTypeId(t))},indexOf:{value:As(Nr.getVisitFnByTypeId(t))}})}return"Vector"})(re.prototype);var Es=class s extends re{constructor(e){super(e.data);let t=this.get,r=this.set,n=this.slice,a=new Array(this.length);Object.defineProperty(this,"get",{value(o){let l=a[o];if(l!==void 0)return l;let c=t.call(this,o);return a[o]=c,c}}),Object.defineProperty(this,"set",{value(o,l){r.call(this,o,l),a[o]=l}}),Object.defineProperty(this,"slice",{value:(o,l)=>new s(n.call(this,o,l))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new re(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Kl(s){if(!s||s.length<=0)return function(n){return!0};let e="",t=s.filter(r=>r===r);return t.length>0&&(e="\n switch (x) {".concat(t.map(r=>"\n case ".concat(E_(r),":")).join(""),"\n return false;\n }")),s.length!==t.length&&(e="if (x !== x) return false;\n".concat(e)),new Function("x","".concat(e,"\nreturn true;"))}function E_(s){return typeof s!="bigint"?pt(s):"".concat(pt(s),"n")}function Ka(s,e){let t=Math.ceil(s)*e-1;return(t-t%64+64||64)/e}function Xl(s,e=0){return s.length>=e?s.subarray(0,e):Mn(new s.constructor(e),s,0)}var St=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?Ka(r*1,this.BYTES_PER_ELEMENT):Ka(r*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=Ka(e*this.stride,this.BYTES_PER_ELEMENT);let t=Xl(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=Xl(this.buffer,e)}},tr=class extends St{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}},pn=class extends tr{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<<a,++this.numValid):o===1&&(r[n]&=~(1<<a),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},mn=class extends tr{constructor(e){super(e.OffsetArrayType,1,1)}append(e){return this.set(this.length-1,e)}set(e,t){let r=this.length-1,n=this.reserve(e-r+1).buffer;return r<e++&&r>=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)}};var ge=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=Ze(e),this._nulls=new pn,t&&t.length>0&&(this._isValid=Kl(t))}toVector(){return new re([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,c)=>l+c.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:c,_offsets:u,_values:_,_nulls:d}=this;(t=c==null?void 0:c.flush(o))?n=u==null?void 0:u.flush(o):(n=u==null?void 0:u.flush(o))?e=_==null?void 0:_.flush(u.last()):e=_==null?void 0:_.flush(o),l>0&&(r=d==null?void 0:d.flush(o));let m=this.children.map(p=>p.flush());return this.clear(),Y({type:a,length:o,nullCount:l,children:m,child:m[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}};ge.prototype.length=1;ge.prototype.stride=1;ge.prototype.children=null;ge.prototype.finished=!1;ge.prototype.nullValues=null;ge.prototype._isValid=()=>!0;var Ee=class extends ge{constructor(e){super(e),this._values=new tr(this.ArrayType,0,this.stride)}setValue(e,t){let r=this._values;return r.reserve(e-r.length+1),super.setValue(e,t)}},Re=class extends ge{constructor(e){super(e),this._pendingLength=0,this._offsets=new mn(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 Pt?t[Er].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}};var Rr=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!=null?n:0)),e.pad(4),e.writeInt32(r),e.writeInt64(BigInt(t!=null?t:0)),e.offset()}};var Je=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):oe.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Ne).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let r=this.bb.__offset(this.bb_pos,8);return r?(t||new Rr).__init(this.bb.__vector(this.bb_pos+r)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let r=this.bb.__offset(this.bb_pos,10);return r?(t||new Rr).__init(this.bb.__vector(this.bb_pos+r)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Le).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,oe.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}};var ce=class s{constructor(e=[],t,r,n=oe.V5){this.fields=e||[],this.metadata=t||new Map,r||(r=Xa(this.fields)),this.dictionaries=r,this.metadataVersion=n}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return"Schema<{ ".concat(this.fields.map((e,t)=>"".concat(t,": ").concat(e)).join(", ")," }>")}select(e){let t=new Set(e),r=this.fields.filter(n=>t.has(n.name));return new s(r,this.metadata)}selectAt(e){let t=e.map(r=>this.fields[r]).filter(Boolean);return new s(t,this.metadata)}assign(...e){let t=e[0]instanceof s?e[0]:Array.isArray(e[0])?new s(e[0]):new s(e),r=[...this.fields],n=Fs(Fs(new Map,this.metadata),t.metadata),a=t.fields.filter(l=>{let c=r.findIndex(u=>u.name===l.name);return~c?(r[c]=l.clone({metadata:Fs(Fs(new Map,r[c].metadata),l.metadata)}))&&!1:!0}),o=Xa(a,new Map);return new s([...r,...a],n,new Map([...this.dictionaries,...o]))}};ce.prototype.fields=null;ce.prototype.metadata=null;ce.prototype.dictionaries=null;var ee=class s{static new(...e){let[t,r,n,a]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],r===void 0&&(r=e[0].type),n===void 0&&(n=e[0].nullable),a===void 0&&(a=e[0].metadata)),new s("".concat(t),r,n,a)}constructor(e,t,r=!1,n){this.name=e,this.type=t,this.nullable=r,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return"".concat(this.name,": ").concat(this.type)}clone(...e){let[t,r,n,a]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,r=this.type,n=this.nullable,a=this.metadata]=e:{name:t=this.name,type:r=this.type,nullable:n=this.nullable,metadata:a=this.metadata}=e[0],s.new(t,r,n,a)}};ee.prototype.type=null;ee.prototype.name=null;ee.prototype.nullable=null;ee.prototype.metadata=null;function Fs(s,e){return new Map([...s||new Map,...e||new Map])}function Xa(s,e=new Map){for(let t=-1,r=s.length;++t<r;){let a=s[t].type;if(M.isDictionary(a)){if(!e.has(a.id))e.set(a.id,a.dictionary);else if(e.get(a.id)!==a.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}a.children&&a.children.length>0&&Xa(a.children,e)}return e}var F_=Br,x_=Ye,rr=class{static decode(e){e=new x_(W(e));let t=Je.getRootAsFooter(e),r=ce.decode(t.schema(),new Map,t.version());return new Za(r,t)}static encode(e){let t=new F_,r=ce.encode(t,e.schema);Je.startRecordBatchesVector(t,e.numRecordBatches);for(let o of[...e.recordBatches()].slice().reverse())nr.encode(t,o);let n=t.endVector();Je.startDictionariesVector(t,e.numDictionaries);for(let o of[...e.dictionaryBatches()].slice().reverse())nr.encode(t,o);let a=t.endVector();return Je.startFooter(t),Je.addSchema(t,r),Je.addVersion(t,oe.V5),Je.addRecordBatches(t,n),Je.addDictionaries(t,a),Je.finishFooterBuffer(t,Je.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=oe.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<r;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,r=this.numDictionaries;++t<r;)(e=this.getDictionaryBatch(t))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}};var Za=class extends rr{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,t){super(e,t.version()),this._footer=t}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let t=this._footer.recordBatches(e);if(t)return nr.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return nr.decode(t)}return null}},nr=class s{static decode(e){return new s(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:r}=t,n=BigInt(t.offset),a=BigInt(t.bodyLength);return Rr.createBlock(e,n,r,a)}constructor(e,t,r){this.metaDataLength=e,this.offset=se(r),this.bodyLength=se(t)}};var he=Object.freeze({done:!0,value:void 0}),Xn=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Gr=class{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},xs=class extends Gr{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return D(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(he);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Ie.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Ie.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return D(this,void 0,void 0,function*(){return yield this.abort(e),he})}return(e){return D(this,void 0,void 0,function*(){return yield this.close(),he})}read(e){return D(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return D(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(he)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var Ct=class extends xs{write(e){if((e=W(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?In(this.toUint8Array(!0)):this.toUint8Array(!1).then(In)}toUint8Array(e=!1){return e?Qe(this._values)[0]:D(this,void 0,void 0,function*(){var t,r,n,a;let o=[],l=0;try{for(var c=!0,u=ot(this),_;_=yield u.next(),t=_.done,!t;c=!0){a=_.value,c=!1;let d=a;o.push(d),l+=d.byteLength}}catch(d){r={error:d}}finally{try{!c&&!t&&(n=u.return)&&(yield n.call(u))}finally{if(r)throw r.error}}return Qe(o,l)[0]})}},Ut=class{constructor(e){e&&(this.source=new Ja(Ie.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)}},it=class s{constructor(e){e instanceof s?this.source=e.source:e instanceof Ct?this.source=new ir(Ie.fromAsyncIterable(e)):Pi(e)?this.source=new ir(Ie.fromNodeStream(e)):Dn(e)?this.source=new ir(Ie.fromDOMStream(e)):ki(e)?this.source=new ir(Ie.fromDOMStream(e.body)):ct(e)?this.source=new ir(Ie.fromIterable(e)):lt(e)?this.source=new ir(Ie.fromAsyncIterable(e)):et(e)&&(this.source=new ir(Ie.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Ja=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)||he)}return(e){return Object.create(this.source.return&&this.source.return(e)||he)}},ir=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return D(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return D(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return D(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return D(this,arguments,void 0,function*(t,r="read"){return yield this.source.next({cmd:r,size:t})})}throw(e){return D(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||he;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return D(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||he;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}};var Zn=class extends Ut{constructor(e,t){super(),this.position=0,this.buffer=W(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),e<this.size}read(e){let{buffer:t,size:r,position:n}=this;return t&&n<r?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(r,n+Math.min(r-n,e)),t.subarray(n,this.position)):null}readAt(e,t){let r=this.buffer,n=Math.min(this.size,e+t);return r?r.subarray(e,n):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}},xr=class extends it{constructor(e,t){super(),this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=D(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return D(this,void 0,void 0,function*(){let{buffer:t,byteOffset:r}=yield this.readAt(e,4);return new DataView(t,r).getInt32(0,!0)})}seek(e){return D(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return D(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:t,size:r,position:n}=this;if(t&&n<r){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let a=n,o=0,l=0,c=Math.min(r,a+Math.min(r-a,e)),u=new Uint8Array(Math.max(0,(this.position=c)-a));for(;(a+=l)<c&&(o+=l)<u.byteLength;)({bytesRead:l}=yield t.read(u,o,u.byteLength-o,a));return u}return null})}readAt(e,t){return D(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n}=this;if(r&&e+t<n){let a=Math.min(n,e+t),o=new Uint8Array(a-e);return(yield r.read(o,0,t,e)).buffer}return new Uint8Array(t)})}close(){return D(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return D(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return D(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}};var to={};fr(to,{BaseInt64:()=>Jn,Int128:()=>ei,Int64:()=>sr,Uint64:()=>be});function hn(s){return s<0&&(s=4294967295+s+1),"0x".concat(s.toString(16))}var gn=8,eo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Jn=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<n?65536:0,this.buffer[1]+=a>>>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<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return"".concat(hn(this.buffer[1])," ").concat(hn(this.buffer[0]))}},be=class s extends Jn{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return s.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return s.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let r=e.length,n=new s(t);for(let a=0;a<r;){let o=gn<r-a?gn:r-a,l=new s(new Uint32Array([Number.parseInt(e.slice(a,a+o),10),0])),c=new s(new Uint32Array([eo[o],0]));n.times(c),n.plus(l),a+=o}return n}static convertArray(e){let t=new Uint32Array(e.length*2);for(let r=-1,n=e.length;++r<n;)s.from(e[r],new Uint32Array(t.buffer,t.byteOffset+2*r*4,2));return t}static multiply(e,t){return new s(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new s(new Uint32Array(e.buffer)).plus(t)}},sr=class s extends Jn{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let t=this.buffer[1]<<0,r=e.buffer[1]<<0;return t<r||t===r&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return s.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return s.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let r=e.startsWith("-"),n=e.length,a=new s(t);for(let o=r?1:0;o<n;){let l=gn<n-o?gn:n-o,c=new s(new Uint32Array([Number.parseInt(e.slice(o,o+l),10),0])),u=new s(new Uint32Array([eo[l],0]));a.times(u),a.plus(c),o+=l}return r?a.negate():a}static convertArray(e){let t=new Uint32Array(e.length*2);for(let r=-1,n=e.length;++r<n;)s.from(e[r],new Uint32Array(t.buffer,t.byteOffset+2*r*4,2));return t}static multiply(e,t){return new s(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new s(new Uint32Array(e.buffer)).plus(t)}},ei=class s{constructor(e){this.buffer=e}high(){return new sr(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new sr(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let t=new be(new Uint32Array([this.buffer[3],0])),r=new be(new Uint32Array([this.buffer[2],0])),n=new be(new Uint32Array([this.buffer[1],0])),a=new be(new Uint32Array([this.buffer[0],0])),o=new be(new Uint32Array([e.buffer[3],0])),l=new be(new Uint32Array([e.buffer[2],0])),c=new be(new Uint32Array([e.buffer[1],0])),u=new be(new Uint32Array([e.buffer[0],0])),_=be.multiply(a,u);this.buffer[0]=_.low();let d=new be(new Uint32Array([_.high(),0]));return _=be.multiply(n,u),d.plus(_),_=be.multiply(a,c),d.plus(_),this.buffer[1]=d.low(),this.buffer[3]=d.lessThan(_)?1:0,this.buffer[2]=d.high(),new be(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(be.multiply(r,u)).plus(be.multiply(n,c)).plus(be.multiply(a,l)),this.buffer[3]+=be.multiply(t,u).plus(be.multiply(r,c)).plus(be.multiply(n,l)).plus(be.multiply(a,o)).low(),this}plus(e){let t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return"".concat(hn(this.buffer[3])," ").concat(hn(this.buffer[2])," ").concat(hn(this.buffer[1])," ").concat(hn(this.buffer[0]))}static multiply(e,t){return new s(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new s(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return s.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return s.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let r=e.startsWith("-"),n=e.length,a=new s(t);for(let o=r?1:0;o<n;){let l=gn<n-o?gn:n-o,c=new s(new Uint32Array([Number.parseInt(e.slice(o,o+l),10),0,0,0])),u=new s(new Uint32Array([eo[l],0,0,0]));a.times(u),a.plus(c),o+=l}return r?a.negate():a}static convertArray(e){let t=new Uint32Array(e.length*4);for(let r=-1,n=e.length;++r<n;)s.from(e[r],new Uint32Array(t.buffer,t.byteOffset+4*4*r,4));return t}};var ti=class extends N{constructor(e,t,r,n,a=oe.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=e,this.nodes=t,this.buffers=r,this.dictionaries=n,this.metadataVersion=a}visit(e){return super.visit(e instanceof ee?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return Y({type:e,length:t})}visitBool(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitInt(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitFloat(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitUtf8(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinary(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitFixedSizeBinary(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitDate(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitTimestamp(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitTime(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitDecimal(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitList(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),children:this.visitMany(e.children)})}visitUnion(e,{length:t,nullCount:r}=this.nextFieldNode()){return this.metadataVersion<oe.V5&&this.readNullBitmap(e,r),e.mode===de.Sparse?this.visitSparseUnion(e,{length:t,nullCount:r}):this.visitDenseUnion(e,{length:t,nullCount:r})}visitDenseUnion(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitDuration(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),data:this.readData(e)})}visitFixedSizeList(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),child:this.visit(e.children[0])})}visitMap(e,{length:t,nullCount:r}=this.nextFieldNode()){return Y({type:e,length:t,nullCount:r,nullBitmap:this.readNullBitmap(e,r),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,t,r=this.nextBufferRange()){return t>0&&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)}},Ls=class extends ti{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):Or(this.sources[r])}readOffsets(e,{offset:t}=this.nextBufferRange()){return J(Uint8Array,J(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return J(Uint8Array,J(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:r}=this;return M.isTimestamp(e)?J(Uint8Array,sr.convertArray(r[t])):(M.isInt(e)||M.isTime(e))&&e.bitWidth===64||M.isDuration(e)?J(Uint8Array,sr.convertArray(r[t])):M.isDate(e)&&e.unit===ve.MILLISECOND?J(Uint8Array,sr.convertArray(r[t])):M.isDecimal(e)?J(Uint8Array,ei.convertArray(r[t])):M.isBinary(e)||M.isLargeBinary(e)||M.isFixedSizeBinary(e)?L_(r[t]):M.isBool(e)?Or(r[t]):M.isUtf8(e)||M.isLargeUtf8(e)?Tt(r[t].join("")):J(Uint8Array,J(e.ArrayType,r[t].map(n=>+n)))}};function L_(s){let e=s.join(""),t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r>>1]=Number.parseInt(e.slice(r,r+2),16);return t}var yn=class extends Re{constructor(e){super(e),this._values=new St(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,W(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 c=l.length;n.set(l,a),r.set(o,c),a+=c}}};var bn=class extends Re{constructor(e){super(e),this._values=new St(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,W(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 c=l.length;n.set(l,a),r.set(o,BigInt(c)),a+=c}}};var Ts=class extends ge{constructor(e){super(e),this._values=new pn}setValue(e,t){this._values.set(e,+t)}};var Hr=class extends Ee{};Hr.prototype._setValue=Pa;var ri=class extends Hr{};ri.prototype._setValue=Ji;var ni=class extends Hr{};ni.prototype._setValue=es;var ii=class extends Ee{};ii.prototype._setValue=Oa;var Is=class extends ge{constructor({type:e,nullValues:t,dictionaryHashFunction:r}){super({type:new Xe(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Vr({type:this.type.indices,nullValues:t}),this.dictionary=Vr({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)}};var si=class extends Ee{};si.prototype._setValue=Ba;var Ds=class extends ge{setValue(e,t){let[r]=this.children,n=e*this.stride;for(let a=-1,o=t.length;++a<o;)r.set(n+a,t[a])}addChild(e,t="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(e);return this.type=new yt(this.type.listSize,new ee(t,e.type,!0)),r}};var jr=class extends Ee{setValue(e,t){this._values.set(e,t)}},Ms=class extends jr{setValue(e,t){super.setValue(e,$n(t))}},ks=class extends jr{},Bs=class extends jr{};var Wr=class extends Ee{};Wr.prototype._setValue=Na;var ai=class extends Wr{};ai.prototype._setValue=cs;var oi=class extends Wr{};oi.prototype._setValue=us;var ar=class extends Ee{};ar.prototype._setValue=Ra;var li=class extends ar{};li.prototype._setValue=_s;var ci=class extends ar{};ci.prototype._setValue=ds;var ui=class extends ar{};ui.prototype._setValue=ps;var _i=class extends ar{};_i.prototype._setValue=ms;var st=class extends Ee{setValue(e,t){this._values.set(e,t)}},Ps=class extends st{},Cs=class extends st{},Us=class extends st{},Os=class extends st{},Ns=class extends st{},Rs=class extends st{},Gs=class extends st{},Hs=class extends st{};var Vs=class extends Re{constructor(e){super(e),this._offsets=new mn(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 ht(new ee(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,c=t.set(n,l).buffer[n];for(let u=-1;++u<l;)r.set(c+u,o[u])}}};var js=class extends Re{set(e,t){return super.set(e,t)}setValue(e,t){let r=t instanceof Map?t:new Map(Object.entries(t)),n=this._pending||(this._pending=new Map),a=n.get(e);a&&(this._pendingLength-=a.size),this._pendingLength+=r.size,n.set(e,r)}addChild(e,t="".concat(this.numChildren)){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new bt(new ee(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 c of a.entries())if(r.set(o,c),++o>=l)break}}};var Ws=class extends ge{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}};var zs=class extends ge{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 me([...this.type.children,new ee(t,e.type,!0)]),r}};var or=class extends Ee{};or.prototype._setValue=Ca;var di=class extends or{};di.prototype._setValue=ts;var fi=class extends or{};fi.prototype._setValue=rs;var pi=class extends or{};pi.prototype._setValue=ns;var mi=class extends or{};mi.prototype._setValue=is;var lr=class extends Ee{};lr.prototype._setValue=Ua;var hi=class extends lr{};hi.prototype._setValue=ss;var gi=class extends lr{};gi.prototype._setValue=as;var yi=class extends lr{};yi.prototype._setValue=os;var bi=class extends lr{};bi.prototype._setValue=ls;var vn=class extends ge{constructor(e){super(e),this._typeIds=new tr(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 ee(t,e.type)];return this.type=new gt(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 vn{},qs=class extends vn{constructor(e){super(e),this._offsets=new tr(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)}};var vi=class extends Re{constructor(e){super(e),this._values=new St(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,Tt(t))}_flushPending(e,t){}};vi.prototype._flushPending=yn.prototype._flushPending;var Si=class extends Re{constructor(e){super(e),this._values=new St(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,Tt(t))}_flushPending(e,t){}};Si.prototype._flushPending=bn.prototype._flushPending;var ro=class extends N{visitNull(){return Ws}visitBool(){return Ts}visitInt(){return st}visitInt8(){return Ps}visitInt16(){return Cs}visitInt32(){return Us}visitInt64(){return Os}visitUint8(){return Ns}visitUint16(){return Rs}visitUint32(){return Gs}visitUint64(){return Hs}visitFloat(){return jr}visitFloat16(){return Ms}visitFloat32(){return ks}visitFloat64(){return Bs}visitUtf8(){return vi}visitLargeUtf8(){return Si}visitBinary(){return yn}visitLargeBinary(){return bn}visitFixedSizeBinary(){return si}visitDate(){return Hr}visitDateDay(){return ri}visitDateMillisecond(){return ni}visitTimestamp(){return or}visitTimestampSecond(){return di}visitTimestampMillisecond(){return fi}visitTimestampMicrosecond(){return pi}visitTimestampNanosecond(){return mi}visitTime(){return lr}visitTimeSecond(){return hi}visitTimeMillisecond(){return gi}visitTimeMicrosecond(){return yi}visitTimeNanosecond(){return bi}visitDecimal(){return ii}visitList(){return Vs}visitStruct(){return zs}visitUnion(){return vn}visitDenseUnion(){return qs}visitSparseUnion(){return $s}visitDictionary(){return Is}visitInterval(){return Wr}visitIntervalDayTime(){return ai}visitIntervalYearMonth(){return oi}visitDuration(){return ar}visitDurationSecond(){return li}visitDurationMillisecond(){return ci}visitDurationMicrosecond(){return ui}visitDurationNanosecond(){return _i}visitFixedSizeList(){return Ds}visitMap(){return js}},Zl=new ro;var V=class extends N{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 Ue(s,e){return e instanceof s.constructor}function zr(s,e){return s===e||Ue(s,e)}function cr(s,e){return s===e||Ue(s,e)&&s.bitWidth===e.bitWidth&&s.isSigned===e.isSigned}function Qs(s,e){return s===e||Ue(s,e)&&s.precision===e.precision}function T_(s,e){return s===e||Ue(s,e)&&s.byteWidth===e.byteWidth}function no(s,e){return s===e||Ue(s,e)&&s.unit===e.unit}function wi(s,e){return s===e||Ue(s,e)&&s.unit===e.unit&&s.timezone===e.timezone}function Ai(s,e){return s===e||Ue(s,e)&&s.unit===e.unit&&s.bitWidth===e.bitWidth}function I_(s,e){return s===e||Ue(s,e)&&s.children.length===e.children.length&&Ot.compareManyFields(s.children,e.children)}function D_(s,e){return s===e||Ue(s,e)&&s.children.length===e.children.length&&Ot.compareManyFields(s.children,e.children)}function io(s,e){return s===e||Ue(s,e)&&s.mode===e.mode&&s.typeIds.every((t,r)=>t===e.typeIds[r])&&Ot.compareManyFields(s.children,e.children)}function M_(s,e){return s===e||Ue(s,e)&&s.id===e.id&&s.isOrdered===e.isOrdered&&Ot.visit(s.indices,e.indices)&&Ot.visit(s.dictionary,e.dictionary)}function so(s,e){return s===e||Ue(s,e)&&s.unit===e.unit}function Ei(s,e){return s===e||Ue(s,e)&&s.unit===e.unit}function k_(s,e){return s===e||Ue(s,e)&&s.listSize===e.listSize&&s.children.length===e.children.length&&Ot.compareManyFields(s.children,e.children)}function B_(s,e){return s===e||Ue(s,e)&&s.keysSorted===e.keysSorted&&s.children.length===e.children.length&&Ot.compareManyFields(s.children,e.children)}V.prototype.visitNull=zr;V.prototype.visitBool=zr;V.prototype.visitInt=cr;V.prototype.visitInt8=cr;V.prototype.visitInt16=cr;V.prototype.visitInt32=cr;V.prototype.visitInt64=cr;V.prototype.visitUint8=cr;V.prototype.visitUint16=cr;V.prototype.visitUint32=cr;V.prototype.visitUint64=cr;V.prototype.visitFloat=Qs;V.prototype.visitFloat16=Qs;V.prototype.visitFloat32=Qs;V.prototype.visitFloat64=Qs;V.prototype.visitUtf8=zr;V.prototype.visitLargeUtf8=zr;V.prototype.visitBinary=zr;V.prototype.visitLargeBinary=zr;V.prototype.visitFixedSizeBinary=T_;V.prototype.visitDate=no;V.prototype.visitDateDay=no;V.prototype.visitDateMillisecond=no;V.prototype.visitTimestamp=wi;V.prototype.visitTimestampSecond=wi;V.prototype.visitTimestampMillisecond=wi;V.prototype.visitTimestampMicrosecond=wi;V.prototype.visitTimestampNanosecond=wi;V.prototype.visitTime=Ai;V.prototype.visitTimeSecond=Ai;V.prototype.visitTimeMillisecond=Ai;V.prototype.visitTimeMicrosecond=Ai;V.prototype.visitTimeNanosecond=Ai;V.prototype.visitDecimal=zr;V.prototype.visitList=I_;V.prototype.visitStruct=D_;V.prototype.visitUnion=io;V.prototype.visitDenseUnion=io;V.prototype.visitSparseUnion=io;V.prototype.visitDictionary=M_;V.prototype.visitInterval=so;V.prototype.visitIntervalDayTime=so;V.prototype.visitIntervalYearMonth=so;V.prototype.visitDuration=Ei;V.prototype.visitDurationSecond=Ei;V.prototype.visitDurationMillisecond=Ei;V.prototype.visitDurationMicrosecond=Ei;V.prototype.visitDurationNanosecond=Ei;V.prototype.visitFixedSizeList=k_;V.prototype.visitMap=B_;var Ot=new V;function $r(s,e){return Ot.compareSchemas(s,e)}function Jl(s,e){return Ot.compareFields(s,e)}function ec(s,e){return Ot.visit(s,e)}function Vr(s){let e=s.type,t=new(Zl.getVisitFn(e)())(s);if(e.children&&e.children.length>0){let r=s.children||[],n={nullValues:s.nullValues},a=Array.isArray(r)?(o,l)=>r[l]||n:({name:o})=>r[o]||n;for(let[o,l]of e.children.entries()){let{type:c}=l,u=a(l,o);t.children.push(Vr(Object.assign(Object.assign({},u),{type:c})))}}return t}function Ys(s,e){return P_(s,e.map(t=>t.data.concat()))}function P_(s,e){let t=[...s.fields],r=[],n={numBatches:e.reduce((d,m)=>Math.max(d,m.length),0)},a=0,o=0,l=-1,c=e.length,u,_=[];for(;n.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,l=-1;++l<c;)_[l]=u=e[l].shift(),o=Math.min(o,u?u.length:o);Number.isFinite(o)&&(_=C_(t,o,_,e,n),o>0&&(r[a++]=Y({type:new me(t),length:o,nullCount:0,children:_.slice()})))}return[s=s.assign(t),r.map(d=>new Se(s,d))]}function C_(s,e,t,r,n){var a;let o=(e+63&-64)>>3;for(let l=-1,c=r.length;++l<c;){let u=t[l],_=u==null?void 0:u.length;if(_>=e)_===e?t[l]=u:(t[l]=u.slice(0,e),n.numBatches=Math.max(n.numBatches,r[l].unshift(u.slice(e,_-e))));else{let d=s[l];s[l]=d.clone({nullable:!0}),t[l]=(a=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&a!==void 0?a:Y({type:d.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)})}}return t}var tc,Oe=class s{constructor(...e){var t,r;if(e.length===0)return this.batches=[],this.schema=new ce([]),this._offsets=[0],this;let n,a;e[0]instanceof ce&&(n=e.shift()),e.at(-1)instanceof Uint32Array&&(a=e.pop());let o=c=>{if(c){if(c instanceof Se)return[c];if(c instanceof s)return c.batches;if(c instanceof ae){if(c.type instanceof me)return[new Se(new ce(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(u=>o(u));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(u=>o(u));if(typeof c=="object"){let u=Object.keys(c),_=u.map(p=>new re([c[p]])),d=n!=null?n:new ce(u.map((p,h)=>new ee(String(p),_[h].type,_[h].nullable))),[,m]=Ys(d,_);return m.length===0?[new Se(c)]:m}}}return[]},l=e.flatMap(c=>o(c));if(n=(r=n!=null?n:(t=l[0])===null||t===void 0?void 0:t.schema)!==null&&r!==void 0?r:new ce([]),!(n instanceof ce))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of l){if(!(c instanceof Se))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!$r(n,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=l,this._offsets=a!=null?a:vs(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=bs(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Pr(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?fn.visit(new re(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return"[\n ".concat(this.toArray().join(",\n "),"\n]")}concat(...e){let t=this.schema,r=this.data.concat(e.flatMap(({data:n})=>n));return new s(t,r.map(n=>new Se(t,n)))}slice(e,t){let r=this.schema;[e,t]=qn({length:this.numRows},e,t);let n=Ss(this.data,this._offsets,e,t);return new s(r,n.map(a=>new Se(r,a)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let t=this.data.map(r=>r.children[e]);if(t.length===0){let{type:r}=this.schema.fields[e],n=Y({type:r,length:0,nullCount:0});t.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new re(t)}return null}setChild(e,t){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===e),t)}setChildAt(e,t){let r=this.schema,n=[...this.batches];if(e>-1&&e<this.numCols){t||(t=new re([Y({type:new Ce,length:this.numRows})]));let a=r.fields.slice(),o=a[e].clone({type:t.type}),l=this.schema.fields.map((c,u)=>this.getChildAt(u));[a[e],l[e]]=[o,t],[r,n]=Ys(r,l)}return new s(r,n)}select(e){let t=this.schema.fields.reduce((r,n,a)=>r.set(n.name,a),new Map);return this.selectAt(e.map(r=>t.get(r)).filter(r=>r>-1))}selectAt(e){let t=this.schema.selectAt(e),r=this.batches.map(n=>n.selectAt(e));return new s(t,r)}assign(e){let t=this.schema.fields,[r,n]=e.schema.fields.reduce((l,c,u)=>{let[_,d]=l,m=t.findIndex(p=>p.name===c.name);return~m?d[m]=u:_.push(u),l},[[],[]]),a=this.schema.assign(e.schema),o=[...t.map((l,c)=>[c,n[c]]).map(([l,c])=>c===void 0?this.getChildAt(l):e.getChildAt(c)),...r.map(l=>e.getChildAt(l))].filter(Boolean);return new s(...Ys(a,o))}};tc=Symbol.toStringTag;Oe[tc]=(s=>(s.schema=null,s.batches=[],s._offsets=new Uint32Array([0]),s._nullCount=-1,s[Symbol.isConcatSpreadable]=!0,s.isValid=dn(Kn),s.get=dn(Ae.getVisitFn(f.Struct)),s.set=ws(De.getVisitFn(f.Struct)),s.indexOf=As(Nr.getVisitFn(f.Struct)),"Table"))(Oe.prototype);var nc,Se=class s{constructor(...e){switch(e.length){case 2:{if([this.schema]=e,!(this.schema instanceof ce))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Y({nullCount:0,type:new me(this.schema.fields),children:this.schema.fields.map(t=>Y({type:t.type,nullCount:0}))})]=e,!(this.data instanceof ae))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=rc(this.schema,this.data.children);break}case 1:{let[t]=e,{fields:r,children:n,length:a}=Object.keys(t).reduce((c,u,_)=>(c.children[_]=t[u],c.length=Math.max(c.length,t[u].length),c.fields[_]=ee.new({name:u,type:t[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new ce(r),l=Y({type:new me(r),length:a,children:n,nullCount:0});[this.schema,this.data]=rc(o,l.children,a);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=ic(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(e){return this.data.getValid(e)}get(e){return Ae.visit(this.data,e)}at(e){return this.get(Pr(e,this.numRows))}set(e,t){return De.visit(this.data,e,t)}indexOf(e,t){return Nr.visit(this.data,e,t)}[Symbol.iterator](){return fn.visit(new re([this.data]))}toArray(){return[...this]}concat(...e){return new Oe(this.schema,[this,...e])}slice(e,t){let[r]=new re([this.data]).slice(e,t).data;return new s(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(r=>r.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new re([this.data.children[e]]):null}setChild(e,t){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===e),t)}setChildAt(e,t){let r=this.schema,n=this.data;if(e>-1&&e<this.numCols){t||(t=new re([Y({type:new Ce,length:this.numRows})]));let a=r.fields.slice(),o=n.children.slice(),l=a[e].clone({type:t.type});[a[e],o[e]]=[l,t.data[0]],r=new ce(a,new Map(this.schema.metadata)),n=Y({type:new me(a),children:o})}return new s(r,n)}select(e){let t=this.schema.select(e),r=new me(t.fields),n=[];for(let a of e){let o=this.schema.fields.findIndex(l=>l.name===a);~o&&(n[o]=this.data.children[o])}return new s(t,Y({type:r,length:this.numRows,children:n}))}selectAt(e){let t=this.schema.selectAt(e),r=e.map(a=>this.data.children[a]).filter(Boolean),n=Y({type:new me(t.fields),length:this.numRows,children:r});return new s(t,n)}};nc=Symbol.toStringTag;Se[nc]=(s=>(s._nullCount=-1,s[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Se.prototype);function rc(s,e,t=e.reduce((r,n)=>Math.max(r,n.length),0)){var r;let n=[...s.fields],a=[...e],o=(t+63&-64)>>3;for(let[l,c]of s.fields.entries()){let u=e[l];(!u||u.length!==t)&&(n[l]=c.clone({nullable:!0}),a[l]=(r=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&r!==void 0?r:Y({type:c.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)}))}return[s.assign(n),Y({type:new me(n),length:t,children:a})]}function ic(s,e,t=new Map){var r,n;if(((r=s==null?void 0:s.length)!==null&&r!==void 0?r:0)>0&&(s==null?void 0:s.length)===(e==null?void 0:e.length))for(let a=-1,o=s.length;++a<o;){let{type:l}=s[a],c=e[a];for(let u of[c,...((n=c==null?void 0:c.dictionary)===null||n===void 0?void 0:n.data)||[]])ic(l.children,u==null?void 0:u.children,t);if(M.isDictionary(l)){let{id:u}=l;if(!t.has(u))c!=null&&c.dictionary&&t.set(u,c.dictionary);else if(t.get(u)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return t}var qr=class extends Se{constructor(e){let t=e.fields.map(n=>Y({type:n.type})),r=Y({type:new me(e.fields),nullCount:0,children:t});super(e,r)}};var wt=class s{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new s).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+4),(t||new s).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):oe.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):te.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new Le).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,oe.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,te.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt("0"))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,r,n,a,o){return s.startMessage(e),s.addVersion(e,t),s.addHeaderType(e,r),s.addHeader(e,n),s.addBodyLength(e,a),s.addCustomMetadata(e,o),s.endMessage(e)}};var ao=class extends N{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Hn.startNull(t),Hn.endNull(t)}visitInt(e,t){return dt.startInt(t),dt.addBitWidth(t,e.bitWidth),dt.addIsSigned(t,e.isSigned),dt.endInt(t)}visitFloat(e,t){return br.startFloatingPoint(t),br.addPrecision(t,e.precision),br.endFloatingPoint(t)}visitBinary(e,t){return Un.startBinary(t),Un.endBinary(t)}visitLargeBinary(e,t){return Nn.startLargeBinary(t),Nn.endLargeBinary(t)}visitBool(e,t){return On.startBool(t),On.endBool(t)}visitUtf8(e,t){return jn.startUtf8(t),jn.endUtf8(t)}visitLargeUtf8(e,t){return Rn.startLargeUtf8(t),Rn.endLargeUtf8(t)}visitDecimal(e,t){return kt.startDecimal(t),kt.addScale(t,e.scale),kt.addPrecision(t,e.precision),kt.addBitWidth(t,e.bitWidth),kt.endDecimal(t)}visitDate(e,t){return mr.startDate(t),mr.addUnit(t,e.unit),mr.endDate(t)}visitTime(e,t){return Gt.startTime(t),Gt.addUnit(t,e.unit),Gt.addBitWidth(t,e.bitWidth),Gt.endTime(t)}visitTimestamp(e,t){let r=e.timezone&&t.createString(e.timezone)||void 0;return Ht.startTimestamp(t),Ht.addUnit(t,e.unit),r!==void 0&&Ht.addTimezone(t,r),Ht.endTimestamp(t)}visitInterval(e,t){return vr.startInterval(t),vr.addUnit(t,e.unit),vr.endInterval(t)}visitDuration(e,t){return hr.startDuration(t),hr.addUnit(t,e.unit),hr.endDuration(t)}visitList(e,t){return Gn.startList(t),Gn.endList(t)}visitStruct(e,t){return Vn.startStruct_(t),Vn.endStruct_(t)}visitUnion(e,t){ft.startTypeIdsVector(t,e.typeIds.length);let r=ft.createTypeIdsVector(t,e.typeIds);return ft.startUnion(t),ft.addMode(t,e.mode),ft.addTypeIds(t,r),ft.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 gr.startFixedSizeBinary(t),gr.addByteWidth(t,e.byteWidth),gr.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return yr.startFixedSizeList(t),yr.addListSize(t,e.listSize),yr.endFixedSizeList(t)}visitMap(e,t){return Sr.startMap(t),Sr.addKeysSorted(t,e.keysSorted),Sr.endMap(t)}},Ks=new ao;function lc(s,e=new Map){return new ce(O_(s,e),Xs(s.metadata),e)}function oo(s){return new Me(s.count,uc(s.columns),_c(s.columns))}function cc(s){return new He(oo(s.data),s.id,s.isDelta)}function O_(s,e){return(s.fields||[]).filter(Boolean).map(t=>ee.fromJSON(t,e))}function sc(s,e){return(s.children||[]).filter(Boolean).map(t=>ee.fromJSON(t,e))}function uc(s){return(s||[]).reduce((e,t)=>[...e,new at(t.count,N_(t.VALIDITY)),...uc(t.children)],[])}function _c(s,e=[]){for(let t=-1,r=(s||[]).length;++t<r;){let n=s[t];n.VALIDITY&&e.push(new Ge(e.length,n.VALIDITY.length)),n.TYPE_ID&&e.push(new Ge(e.length,n.TYPE_ID.length)),n.OFFSET&&e.push(new Ge(e.length,n.OFFSET.length)),n.DATA&&e.push(new Ge(e.length,n.DATA.length)),e=_c(n.children,e)}return e}function N_(s){return(s||[]).reduce((e,t)=>e+ +(t===0),0)}function dc(s,e){let t,r,n,a,o,l;return!e||!(a=s.dictionary)?(o=oc(s,sc(s,e)),n=new ee(s.name,o,s.nullable,Xs(s.metadata))):e.has(t=a.id)?(r=(r=a.indexType)?ac(r):new Bt,l=new Xe(e.get(t),r,t,a.isOrdered),n=new ee(s.name,l,s.nullable,Xs(s.metadata))):(r=(r=a.indexType)?ac(r):new Bt,e.set(t,o=oc(s,sc(s,e))),l=new Xe(o,r,t,a.isOrdered),n=new ee(s.name,l,s.nullable,Xs(s.metadata))),n||null}function Xs(s=[]){return new Map(s.map(({key:e,value:t})=>[e,t]))}function ac(s){return new Te(s.isSigned,s.bitWidth)}function oc(s,e){let t=s.type.name;switch(t){case"NONE":return new Ce;case"null":return new Ce;case"binary":return new Vt;case"largebinary":return new jt;case"utf8":return new Wt;case"largeutf8":return new zt;case"bool":return new $t;case"list":return new ht((e||[])[0]);case"struct":return new me(e||[]);case"struct_":return new me(e||[])}switch(t){case"int":{let r=s.type;return new Te(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=s.type;return new nt(_e[r.precision])}case"decimal":{let r=s.type;return new qt(r.scale,r.precision,r.bitWidth)}case"date":{let r=s.type;return new Qt(ve[r.unit])}case"time":{let r=s.type;return new Yt(B[r.unit],r.bitWidth)}case"timestamp":{let r=s.type;return new Kt(B[r.unit],r.timezone)}case"interval":{let r=s.type;return new Xt(xe[r.unit])}case"duration":{let r=s.type;return new Zt(B[r.unit])}case"union":{let r=s.type,[n,...a]=(r.mode+"").toLowerCase(),o=n.toUpperCase()+a.join("");return new gt(de[o],r.typeIds||[],e||[])}case"fixedsizebinary":{let r=s.type;return new Jt(r.byteWidth)}case"fixedsizelist":{let r=s.type;return new yt(r.listSize,(e||[])[0])}case"map":{let r=s.type;return new bt((e||[])[0],r.keysSorted)}}throw new Error('Unrecognized type: "'.concat(t,'"'))}var R_=Br,G_=Ye,Ve=class s{static fromJSON(e,t){let r=new s(0,oe.V5,t);return r._createHeader=H_(e,t),r}static decode(e){e=new G_(W(e));let t=wt.getRootAsMessage(e),r=t.bodyLength(),n=t.version(),a=t.headerType(),o=new s(r,n,a);return o._createHeader=V_(t,a),o}static encode(e){let t=new R_,r=-1;return e.isSchema()?r=ce.encode(t,e.header()):e.isRecordBatch()?r=Me.encode(t,e.header()):e.isDictionaryBatch()&&(r=He.encode(t,e.header())),wt.startMessage(t),wt.addVersion(t,oe.V5),wt.addHeader(t,r),wt.addHeaderType(t,e.headerType),wt.addBodyLength(t,BigInt(e.bodyLength)),wt.finishMessageBuffer(t,wt.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof ce)return new s(0,oe.V5,te.Schema,e);if(e instanceof Me)return new s(t,oe.V5,te.RecordBatch,e);if(e instanceof He)return new s(t,oe.V5,te.DictionaryBatch,e);throw new Error("Unrecognized Message header: ".concat(e))}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===te.Schema}isRecordBatch(){return this.headerType===te.RecordBatch}isDictionaryBatch(){return this.headerType===te.DictionaryBatch}constructor(e,t,r,n){this._version=t,this._headerType=r,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=se(e)}},Me=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=se(e)}},He=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=se(t)}},Ge=class{constructor(e,t){this.offset=se(e),this.length=se(t)}},at=class{constructor(e,t){this.length=se(e),this.nullCount=se(t)}};function H_(s,e){return()=>{switch(e){case te.Schema:return ce.fromJSON(s);case te.RecordBatch:return Me.fromJSON(s);case te.DictionaryBatch:return He.fromJSON(s)}throw new Error("Unrecognized Message type: { name: ".concat(te[e],", type: ").concat(e," }"))}}function V_(s,e){return()=>{switch(e){case te.Schema:return ce.decode(s.header(new Ne),new Map,s.version());case te.RecordBatch:return Me.decode(s.header(new Ke),s.version());case te.DictionaryBatch:return He.decode(s.header(new Rt),s.version())}throw new Error("Unrecognized Message type: { name: ".concat(te[e],", type: ").concat(e," }"))}}ee.encode=J_;ee.decode=X_;ee.fromJSON=dc;ce.encode=Z_;ce.decode=j_;ce.fromJSON=lc;Me.encode=ed;Me.decode=W_;Me.fromJSON=oo;He.encode=td;He.decode=z_;He.fromJSON=cc;at.encode=rd;at.decode=q_;Ge.encode=nd;Ge.decode=$_;function j_(s,e=new Map,t=oe.V5){let r=K_(s,e);return new ce(r,Zs(s),e,t)}function W_(s,e=oe.V5){if(s.compression()!==null)throw new Error("Record batch compression not implemented");return new Me(s.length(),Q_(s),Y_(s,e))}function z_(s,e=oe.V5){return new He(Me.decode(s.data(),e),s.id(),s.isDelta())}function $_(s){return new Ge(s.offset(),s.length())}function q_(s){return new at(s.length(),s.nullCount())}function Q_(s){let e=[];for(let t,r=-1,n=-1,a=s.nodesLength();++r<a;)(t=s.nodes(r))&&(e[++n]=at.decode(t));return e}function Y_(s,e){let t=[];for(let r,n=-1,a=-1,o=s.buffersLength();++n<o;)(r=s.buffers(n))&&(e<oe.V4&&(r.bb_pos+=8*(n+1)),t[++a]=Ge.decode(r));return t}function K_(s,e){let t=[];for(let r,n=-1,a=-1,o=s.fieldsLength();++n<o;)(r=s.fields(n))&&(t[++a]=ee.decode(r,e));return t}function fc(s,e){let t=[];for(let r,n=-1,a=-1,o=s.childrenLength();++n<o;)(r=s.children(n))&&(t[++a]=ee.decode(r,e));return t}function X_(s,e){let t,r,n,a,o,l;return!e||!(l=s.dictionary())?(n=mc(s,fc(s,e)),r=new ee(s.name(),n,s.nullable(),Zs(s))):e.has(t=se(l.id()))?(a=(a=l.indexType())?pc(a):new Bt,o=new Xe(e.get(t),a,t,l.isOrdered()),r=new ee(s.name(),o,s.nullable(),Zs(s))):(a=(a=l.indexType())?pc(a):new Bt,e.set(t,n=mc(s,fc(s,e))),o=new Xe(n,a,t,l.isOrdered()),r=new ee(s.name(),o,s.nullable(),Zs(s))),r||null}function Zs(s){let e=new Map;if(s)for(let t,r,n=-1,a=Math.trunc(s.customMetadataLength());++n<a;)(t=s.customMetadata(n))&&(r=t.key())!=null&&e.set(r,t.value());return e}function pc(s){return new Te(s.isSigned(),s.bitWidth())}function mc(s,e){let t=s.typeType();switch(t){case fe.NONE:return new Ce;case fe.Null:return new Ce;case fe.Binary:return new Vt;case fe.LargeBinary:return new jt;case fe.Utf8:return new Wt;case fe.LargeUtf8:return new zt;case fe.Bool:return new $t;case fe.List:return new ht((e||[])[0]);case fe.Struct_:return new me(e||[])}switch(t){case fe.Int:{let r=s.type(new dt);return new Te(r.isSigned(),r.bitWidth())}case fe.FloatingPoint:{let r=s.type(new br);return new nt(r.precision())}case fe.Decimal:{let r=s.type(new kt);return new qt(r.scale(),r.precision(),r.bitWidth())}case fe.Date:{let r=s.type(new mr);return new Qt(r.unit())}case fe.Time:{let r=s.type(new Gt);return new Yt(r.unit(),r.bitWidth())}case fe.Timestamp:{let r=s.type(new Ht);return new Kt(r.unit(),r.timezone())}case fe.Interval:{let r=s.type(new vr);return new Xt(r.unit())}case fe.Duration:{let r=s.type(new hr);return new Zt(r.unit())}case fe.Union:{let r=s.type(new ft);return new gt(r.mode(),r.typeIdsArray()||[],e||[])}case fe.FixedSizeBinary:{let r=s.type(new gr);return new Jt(r.byteWidth())}case fe.FixedSizeList:{let r=s.type(new yr);return new yt(r.listSize(),(e||[])[0])}case fe.Map:{let r=s.type(new Sr);return new bt((e||[])[0],r.keysSorted())}}throw new Error('Unrecognized type: "'.concat(fe[t],'" (').concat(t,")"))}function Z_(s,e){let t=e.fields.map(a=>ee.encode(s,a));Ne.startFieldsVector(s,t.length);let r=Ne.createFieldsVector(s,t),n=e.metadata&&e.metadata.size>0?Ne.createCustomMetadataVector(s,[...e.metadata].map(([a,o])=>{let l=s.createString("".concat(a)),c=s.createString("".concat(o));return Le.startKeyValue(s),Le.addKey(s,l),Le.addValue(s,c),Le.endKeyValue(s)})):-1;return Ne.startSchema(s),Ne.addFields(s,r),Ne.addEndianness(s,id?pr.Little:pr.Big),n!==-1&&Ne.addCustomMetadata(s,n),Ne.endSchema(s)}function J_(s,e){let t=-1,r=-1,n=-1,a=e.type,o=e.typeId;M.isDictionary(a)?(o=a.dictionary.typeId,n=Ks.visit(a,s),r=Ks.visit(a.dictionary,s)):r=Ks.visit(a,s);let l=(a.children||[]).map(_=>ee.encode(s,_)),c=Be.createChildrenVector(s,l),u=e.metadata&&e.metadata.size>0?Be.createCustomMetadataVector(s,[...e.metadata].map(([_,d])=>{let m=s.createString("".concat(_)),p=s.createString("".concat(d));return Le.startKeyValue(s),Le.addKey(s,m),Le.addValue(s,p),Le.endKeyValue(s)})):-1;return e.name&&(t=s.createString(e.name)),Be.startField(s),Be.addType(s,r),Be.addTypeType(s,o),Be.addChildren(s,c),Be.addNullable(s,!!e.nullable),t!==-1&&Be.addName(s,t),n!==-1&&Be.addDictionary(s,n),u!==-1&&Be.addCustomMetadata(s,u),Be.endField(s)}function ed(s,e){let t=e.nodes||[],r=e.buffers||[];Ke.startNodesVector(s,t.length);for(let o of t.slice().reverse())at.encode(s,o);let n=s.endVector();Ke.startBuffersVector(s,r.length);for(let o of r.slice().reverse())Ge.encode(s,o);let a=s.endVector();return Ke.startRecordBatch(s),Ke.addLength(s,BigInt(e.length)),Ke.addNodes(s,n),Ke.addBuffers(s,a),Ke.endRecordBatch(s)}function td(s,e){let t=Me.encode(s,e.data);return Rt.startDictionaryBatch(s),Rt.addId(s,BigInt(e.id)),Rt.addIsDelta(s,e.isDelta),Rt.addData(s,t),Rt.endDictionaryBatch(s)}function rd(s,e){return rn.createFieldNode(s,BigInt(e.length),BigInt(e.nullCount))}function nd(s,e){return tn.createBuffer(s,BigInt(e.offset),BigInt(e.length))}var id=(()=>{let s=new ArrayBuffer(2);return new DataView(s).setInt16(0,256,!0),new Int16Array(s)[0]===256})();var co=s=>"Expected ".concat(te[s]," Message in stream, but was null or length 0."),uo=s=>"Header pointer of flatbuffer-encoded ".concat(te[s]," Message is null or length 0."),hc=(s,e)=>"Expected to read ".concat(s," metadata bytes, but only read ").concat(e,"."),gc=(s,e)=>"Expected to read ".concat(s," bytes for message body, but only read ").concat(e,"."),Sn=class{constructor(e){this.source=e instanceof Ut?e:new Ut(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?he:e.value===-1&&(e=this.readMetadataLength()).done?he:(e=this.readMetadata(e.value)).done?he: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(co(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=W(this.source.read(e));if(t.byteLength<e)throw new Error(gc(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=te.Schema,r=this.readMessage(t),n=r==null?void 0:r.header();if(e&&!n)throw new Error(uo(t));return n}readMetadataLength(){let e=this.source.read(Js),t=e&&new Ye(e),r=(t==null?void 0:t.readInt32(0))||0;return{done:r===0,value:r}}readMetadata(e){let t=this.source.read(e);if(!t)return he;if(t.byteLength<e)throw new Error(hc(e,t.byteLength));return{done:!1,value:Ve.decode(t)}}},Fi=class{constructor(e,t){this.source=e instanceof it?e:Mi(e)?new xr(e,t):new it(e)}[Symbol.asyncIterator](){return this}next(){return D(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?he:e.value===-1&&(e=yield this.readMetadataLength()).done?he:(e=yield this.readMetadata(e.value)).done?he:e})}throw(e){return D(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return D(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return D(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(co(e));return t.value})}readMessageBody(e){return D(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let t=W(yield this.source.read(e));if(t.byteLength<e)throw new Error(gc(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(){return D(this,arguments,void 0,function*(e=!1){let t=te.Schema,r=yield this.readMessage(t),n=r==null?void 0:r.header();if(e&&!n)throw new Error(uo(t));return n})}readMetadataLength(){return D(this,void 0,void 0,function*(){let e=yield this.source.read(Js),t=e&&new Ye(e),r=(t==null?void 0:t.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(e){return D(this,void 0,void 0,function*(){let t=yield this.source.read(e);if(!t)return he;if(t.byteLength<e)throw new Error(hc(e,t.byteLength));return{done:!1,value:Ve.decode(t)}})}},xi=class extends Sn{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Xn?e:new Xn(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Ve.fromJSON(e.schema,te.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let t=e.dictionaries[this._dictionaryIndex++];return this._body=t.data.columns,{done:!1,value:Ve.fromJSON(t,te.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let t=e.batches[this._batchIndex++];return this._body=t.columns,{done:!1,value:Ve.fromJSON(t,te.RecordBatch)}}return this._body=[],he}readMessageBody(e){return t(this._body);function t(r){return(r||[]).reduce((n,a)=>[...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(co(e));return t.value}readSchema(){let e=te.Schema,t=this.readMessage(e),r=t==null?void 0:t.header();if(!t||!r)throw new Error(uo(e));return r}},Js=4,lo="ARROW1",wn=new Uint8Array(lo.length);for(let s=0;s<lo.length;s+=1)wn[s]=lo.codePointAt(s);function ea(s,e=0){for(let t=-1,r=wn.length;++t<r;)if(wn[t]!==s[e+t])return!1;return!0}var An=wn.length,_o=An+Js,yc=An*2+Js;var ke=class s extends Gr{constructor(e){super(),this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let t=this._impl.open(e);return lt(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Ie.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Ie.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}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')}static from(e){return e instanceof s?e:Ii(e)?ad(e):Mi(e)?cd(e):lt(e)?D(this,void 0,void 0,function*(){return yield s.from(yield e)}):ki(e)||Dn(e)||Pi(e)||et(e)?ld(new it(e)):od(new Ut(e))}static readAll(e){return e instanceof s?e.isSync()?bc(e):vc(e):Ii(e)||ArrayBuffer.isView(e)||ct(e)||Di(e)?bc(e):vc(e)}},Nt=class extends ke{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 Z(yield*Mr(Jr(ot(this[Symbol.iterator]()))))})}},Lr=class extends ke{constructor(e){super(e),this._impl=e}readAll(){return D(this,void 0,void 0,function*(){var e,t,r,n;let a=new Array;try{for(var o=!0,l=ot(this),c;c=yield l.next(),e=c.done,!e;o=!0){n=c.value,o=!1;let u=n;a.push(u)}}catch(u){t={error:u}}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]()}},Tr=class extends Nt{constructor(e){super(e),this._impl=e}},Li=class extends Lr{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=Y({type:new me(this.schema.fields),length:e.length,children:r});return new Se(this.schema,n)}_loadDictionaryBatch(e,t){let{id:r,isDelta:n}=e,{dictionaries:a,schema:o}=this,l=a.get(r),c=o.dictionaries.get(r),u=this._loadVectors(e.data,t,[c]);return(l&&n?l.concat(new re(u)):new re(u)).memoize()}_loadVectors(e,t,r){return new ti(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},En=class extends ta{constructor(e,t){super(t),this._reader=Ii(e)?new xi(this._handle=e):new Sn(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=Sc(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):he}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):he}next(){if(this.closed)return he;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 qr(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Fn=class extends ta{constructor(e,t){super(t),this._reader=new Fi(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return D(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 D(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Sc(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return D(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):he})}return(e){return D(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):he})}next(){return D(this,void 0,void 0,function*(){if(this.closed)return he;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 qr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return D(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},ra=class extends En{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 Zn?e:new Zn(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(te.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(te.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 rr.decode(n)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(this._recordBatchIndex);if(r&&this._handle.seek(r.offset))return this._reader.readMessage(e)}return null}},fo=class extends Fn{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){let r=typeof t[0]!="number"?t.shift():void 0,n=t[0]instanceof Map?t.shift():void 0;super(e instanceof xr?e:new xr(e,r),n)}isFile(){return!0}isAsync(){return!0}open(e){let t=Object.create(null,{open:{get:()=>super.open}});return D(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 D(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(te.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 D(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(te.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 D(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 rr.decode(n)})}_readNextMessageAndValidate(e){return D(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}},po=class extends En{constructor(e,t){super(e,t)}_loadVectors(e,t,r){return new Ls(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function Sc(s,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:s.autoDestroy}function*bc(s){let e=ke.from(s);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function vc(s){return qe(this,arguments,function*(){let t=yield Z(ke.from(s));try{if(!(yield Z(t.open({autoDestroy:!1}))).closed)do yield yield Z(t);while(!(yield Z(t.reset().open())).closed)}finally{yield Z(t.cancel())}})}function ad(s){return new Nt(new po(s))}function od(s){let e=s.peek(An+7&-8);return e&&e.byteLength>=4?ea(e)?new Tr(new ra(s.read())):new Nt(new En(s)):new Nt(new En(function*(){}()))}function ld(s){return D(this,void 0,void 0,function*(){let e=yield s.peek(An+7&-8);return e&&e.byteLength>=4?ea(e)?new Tr(new ra(yield s.read())):new Lr(new Fn(s)):new Lr(new Fn(function(){return qe(this,arguments,function*(){})}()))})}function cd(s){return D(this,void 0,void 0,function*(){let{size:e}=yield s.stat(),t=new xr(s,e);return e>=yc&&ea(yield t.readAt(0,An+7&-8))?new Li(new fo(t)):new Lr(new Fn(t))})}var ye=class s extends N{static assemble(...e){let t=n=>n.flatMap(a=>Array.isArray(a)?t(a):a instanceof Se?a.data.children:a.data),r=new s;return r.visitMany(t(e)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof re)return this.visitMany(e.data),this;let{type:t}=e;if(!M.isDictionary(t)){let{length:r}=e;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(M.isUnion(t))this.nodes.push(new at(r,0));else{let{nullCount:n}=e;M.isNull(t)||At.call(this,n<=0?new Uint8Array(0):Ur(e.offset,r,e.nullBitmap)),this.nodes.push(new at(r,n))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function At(s){let e=s.byteLength+7&-8;return this.buffers.push(s),this.bufferRegions.push(new Ge(this._byteLength,e)),this._byteLength+=e,this}function ud(s){var e;let{type:t,length:r,typeIds:n,valueOffsets:a}=s;if(At.call(this,n),t.mode===de.Sparse)return mo.call(this,s);if(t.mode===de.Dense){if(s.offset<=0)return At.call(this,a),mo.call(this,s);{let o=new Int32Array(r),l=Object.create(null),c=Object.create(null);for(let u,_,d=-1;++d<r;)(u=n[d])!==void 0&&((_=l[u])===void 0&&(_=l[u]=a[d]),o[d]=a[d]-_,c[u]=((e=c[u])!==null&&e!==void 0?e:0)+1);At.call(this,o),this.visitMany(s.children.map((u,_)=>{let d=t.typeIds[_],m=l[d],p=c[d];return u.slice(m,Math.min(r,p))}))}}return this}function _d(s){let e;return s.nullCount>=s.length?At.call(this,new Uint8Array(0)):(e=s.values)instanceof Uint8Array?At.call(this,Ur(s.offset,s.length,e)):At.call(this,Or(s.values))}function ur(s){return At.call(this,s.values.subarray(0,s.length*s.stride))}function na(s){let{length:e,values:t,valueOffsets:r}=s,n=se(r[0]),a=se(r[e]),o=Math.min(a-n,t.byteLength-n);return At.call(this,Ui(-n,e+1,r)),At.call(this,t.subarray(n,n+o)),this}function ho(s){let{length:e,valueOffsets:t}=s;if(t){let{[0]:r,[e]:n}=t;return At.call(this,Ui(-r,e+1,t)),this.visit(s.children[0].slice(r,n-r))}return this.visit(s.children[0])}function mo(s){return this.visitMany(s.type.children.map((e,t)=>s.children[t]).filter(Boolean))[0]}ye.prototype.visitBool=_d;ye.prototype.visitInt=ur;ye.prototype.visitFloat=ur;ye.prototype.visitUtf8=na;ye.prototype.visitLargeUtf8=na;ye.prototype.visitBinary=na;ye.prototype.visitLargeBinary=na;ye.prototype.visitFixedSizeBinary=ur;ye.prototype.visitDate=ur;ye.prototype.visitTimestamp=ur;ye.prototype.visitTime=ur;ye.prototype.visitDecimal=ur;ye.prototype.visitList=ho;ye.prototype.visitStruct=mo;ye.prototype.visitUnion=ud;ye.prototype.visitInterval=ur;ye.prototype.visitDuration=ur;ye.prototype.visitFixedSizeList=ho;ye.prototype.visitMap=ho;var Qr=class extends Gr{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 Ct,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Pe(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 lt(e)?e.then(t=>this.writeAll(t)):et(e)?yo(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 Ct?this._sink=e:(this._sink=new Ct,e&&Oo(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&No(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||!$r(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 Oe&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof Se&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!$r(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof Se?e instanceof qr||this._writeRecordBatch(e):e instanceof Oe?this.writeAll(e.batches):ct(e)&&this.writeAll(e)}_writeMessage(e,t=8){let r=t-1,n=Ve.encode(e),a=n.byteLength,o=this._writeLegacyIpcFormat?4:8,l=a+o+r&~r,c=l-a-o;return e.headerType===te.RecordBatch?this._recordBatchBlocks.push(new nr(l,e.bodyLength,this._position)):e.headerType===te.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(c)}_write(e){if(this._started){let t=W(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Ve.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(wn)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:r,bufferRegions:n,buffers:a}=ye.assemble(e),o=new Me(e.numRows,r,n),l=Ve.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}=ye.assemble(new re([e])),c=new Me(e.length,a,o),u=new He(c,t,r),_=Ve.from(u,n);return this._writeMessage(_)._writeBodyBuffers(l)}_writeBodyBuffers(e){let t,r,n;for(let a=-1,o=e.length;++a<o;)(t=e[a])&&(r=t.byteLength)>0&&(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),c=(r=this._dictionaryDeltaOffsets.get(n))!==null&&r!==void 0?r:0;if(!l||l.data[0]!==o[0])for(let[u,_]of o.entries())this._writeDictionaryBatch(_,n,u>0);else if(c<o.length)for(let u of o.slice(c))this._writeDictionaryBatch(u,n,!0);this._seenDictionaries.set(n,a),this._dictionaryDeltaOffsets.set(n,o.length)}return this}},Yr=class s extends Qr{static writeAll(e,t){let r=new s(t);return lt(e)?e.then(n=>r.writeAll(n)):et(e)?yo(r,e):go(r,e)}},Kr=class s extends Qr{static writeAll(e){let t=new s;return lt(e)?e.then(r=>t.writeAll(r)):et(e)?yo(t,e):go(t,e)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,r=!1){if(!r&&this._seenDictionaries.has(t))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,t,r)}_writeFooter(e){let t=rr.encode(new rr(e,oe.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function go(s,e){let t=e;e instanceof Oe&&(t=e.batches,s.reset(void 0,e.schema));for(let r of t)s.write(r);return s.finish()}function yo(s,e){return D(this,void 0,void 0,function*(){var t,r,n,a,o,l,c;try{for(t=!0,r=ot(e);n=yield r.next(),a=n.done,!a;t=!0){c=n.value,t=!1;let u=c;s.write(u)}}catch(u){o={error:u}}finally{try{!t&&!a&&(l=r.return)&&(yield l.call(r))}finally{if(o)throw o.error}}return s.finish()})}function wc(s,e){if(et(s))return fd(s,e);if(ct(s))return dd(s,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function dd(s,e){let t=null,r=(e==null?void 0:e.type)==="bytes"||!1,n=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){a(o,t||(t=s[Symbol.iterator]()))},pull(o){t?a(o,t):o.close()},cancel(){(t!=null&&t.return&&t.return()||!0)&&(t=null)}}),Object.assign({highWaterMark:r?n:void 0},e));function a(o,l){let c,u=null,_=o.desiredSize||null;for(;!(u=l.next(r?_:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=W(u.value))&&(_!=null&&r&&(_=_-c.byteLength+1),u.value=c),o.enqueue(u.value),_!=null&&--_<=0)return;o.close()}}function fd(s,e){let t=null,r=(e==null?void 0:e.type)==="bytes"||!1,n=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return D(this,void 0,void 0,function*(){yield a(o,t||(t=s[Symbol.asyncIterator]()))})},pull(o){return D(this,void 0,void 0,function*(){t?yield a(o,t):o.close()})},cancel(){return D(this,void 0,void 0,function*(){(t!=null&&t.return&&(yield t.return())||!0)&&(t=null)})}}),Object.assign({highWaterMark:r?n:void 0},e));function a(o,l){return D(this,void 0,void 0,function*(){let c,u=null,_=o.desiredSize||null;for(;!(u=yield l.next(r?_:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=W(u.value))&&(_!=null&&r&&(_=_-c.byteLength+1),u.value=c),o.enqueue(u.value),_!=null&&--_<=0)return;o.close()})}}function Fc(s){return new bo(s)}var bo=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:r,["queueingStrategy"]:n="count"}=e,a=Co(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Vr(a),this._getSize=n!=="bytes"?Ac:Ec;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:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:n!=="bytes"?Ac:Ec}),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:c=>this._writeValueAndReturnChunkSize(c)})}_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)}},Ac=s=>{var e;return(e=s==null?void 0:s.length)!==null&&e!==void 0?e:0},Ec=s=>{var e;return(e=s==null?void 0:s.byteLength)!==null&&e!==void 0?e:0};function ia(s,e){let t=new Ct,r=null,n=new ReadableStream({cancel(){return D(this,void 0,void 0,function*(){yield t.close()})},start(l){return D(this,void 0,void 0,function*(){yield o(l,r||(r=yield a()))})},pull(l){return D(this,void 0,void 0,function*(){r?yield o(l,r):l.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},s)),readable:n};function a(){return D(this,void 0,void 0,function*(){return yield(yield ke.from(t)).open(e)})}function o(l,c){return D(this,void 0,void 0,function*(){let u=l.desiredSize,_=null;for(;!(_=yield c.next()).done;)if(l.enqueue(_.value),u!=null&&--u<=0)return;l.close()})}}function sa(s,e){let t=new this(s),r=new it(t),n=new ReadableStream({cancel(){return D(this,void 0,void 0,function*(){yield r.cancel()})},pull(o){return D(this,void 0,void 0,function*(){yield a(o)})},start(o){return D(this,void 0,void 0,function*(){yield a(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,s),readable:n};function a(o){return D(this,void 0,void 0,function*(){let l=null,c=o.desiredSize;for(;l=yield r.read(c||null);)if(o.enqueue(l),c!=null&&(c-=l.byteLength)<=0)return;o.close()})}}function aa(s,e="stream"){return(e==="stream"?Yr:Kr).writeAll(s).toUint8Array(!0)}var gd=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Da),to),$a),Ma),Aa),za),xa),{compareSchemas:$r,compareFields:Jl,compareTypes:ec});Ie.toDOMStream=wc;ge.throughDOM=Fc;ke.throughDOM=ia;Tr.throughDOM=ia;Nt.throughDOM=ia;Qr.throughDOM=sa;Kr.throughDOM=sa;Yr.throughDOM=sa;function xn(s){switch(s.typeId){case f.Binary:return{sqlType:"binary"};case f.Bool:return{sqlType:"bool"};case f.Date:return{sqlType:"date"};case f.DateDay:return{sqlType:"date32[d]"};case f.DateMillisecond:return{sqlType:"date64[ms]"};case f.Decimal:{let e=s;return{sqlType:"decimal",precision:e.precision,scale:e.scale}}case f.Float:return{sqlType:"float"};case f.Float16:return{sqlType:"float16"};case f.Float32:return{sqlType:"float32"};case f.Float64:return{sqlType:"float64"};case f.Int:return{sqlType:"int32"};case f.Int16:return{sqlType:"int16"};case f.Int32:return{sqlType:"int32"};case f.Int64:return{sqlType:"int64"};case f.Uint16:return{sqlType:"uint16"};case f.Uint32:return{sqlType:"uint32"};case f.Uint64:return{sqlType:"uint64"};case f.Uint8:return{sqlType:"uint8"};case f.IntervalDayTime:return{sqlType:"interval[dt]"};case f.IntervalYearMonth:return{sqlType:"interval[m]"};case f.List:return{sqlType:"list",valueType:xn(s.valueType)};case f.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:s.byteWidth};case f.Null:return{sqlType:"null"};case f.Utf8:return{sqlType:"utf8"};case f.Struct:return{sqlType:"struct",fields:s.children.map(t=>oa(t.name,t.type))};case f.Map:{let e=s;return{sqlType:"map",keyType:xn(e.keyType),valueType:xn(e.valueType)}}case f.Time:return{sqlType:"time[s]"};case f.TimeMicrosecond:return{sqlType:"time[us]"};case f.TimeMillisecond:return{sqlType:"time[ms]"};case f.TimeNanosecond:return{sqlType:"time[ns]"};case f.TimeSecond:return{sqlType:"time[s]"};case f.Timestamp:return{sqlType:"timestamp",timezone:s.timezone||void 0};case f.TimestampSecond:return{sqlType:"timestamp[s]",timezone:s.timezone||void 0};case f.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:s.timezone||void 0};case f.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:s.timezone||void 0};case f.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:s.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(s.toString()))}function oa(s,e){let t=xn(e);return t.name=s,t}var 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=ke.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new Oe(r)}async send(e,t=!1){let r=this._bindings.startPendingQuery(this._conn,e,t);for(;r==null;)r=await new Promise((o,l)=>{try{o(this._bindings.pollPendingQuery(this._conn))}catch(c){console.log(c),c.message.includes("worker is not set!")?l(new Error("Worker has been terminated")):l(c)}});let n=new ca(this._bindings,this._conn,r),a=ke.from(n);return console.assert(a.isSync()),console.assert(a.isStream()),a}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 vo(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)}},ca=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=null;do e=this.bindings.fetchQueryResults(this.conn);while(e==null);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},vo=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=ke.from(t);return console.assert(r.isSync()),console.assert(r.isFile()),new Oe(r)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),r=new ca(this.bindings,this.connectionId,t),n=ke.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}};function Lc(s){return s<=255}function Tc(s){return s===256}var Mc=new TextEncoder,Ic=new TextDecoder("utf-8");function So(s,e,t){let r=Mc.encode(t),n=s._malloc(r.byteLength),a=s.HEAPU8.subarray(n,n+r.byteLength);a.set(r),s.HEAPF64[(e>>3)+0]=1,s.HEAPF64[(e>>3)+1]=n,s.HEAPF64[(e>>3)+2]=a.byteLength}function Ao(s){switch(s){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 wo(s,e,t,r){let n=s.HEAPU8.subarray(e,e+r*Ao(t));switch(t){case"UINT8":return new Uint8Array(n.buffer,n.byteOffset,r);case"INT8":return new Int8Array(n.buffer,n.byteOffset,r);case"INT32":return new Int32Array(n.buffer,n.byteOffset,r);case"FLOAT":return new Float32Array(n.buffer,n.byteOffset,r);case"DOUBLE":return new Float64Array(n.buffer,n.byteOffset,r);case"VARCHAR":return new Float64Array(n.buffer,n.byteOffset,r);default:return new Array(0)}}function Dc(s,e,t){let r=s.HEAPU8.subarray(e,e+t);return new Uint8Array(r.buffer,r.byteOffset,t)}function ua(s,e,t){let r=s.HEAPU8.subarray(e,e+t*8);return new Float64Array(r.buffer,r.byteOffset,t)}function kc(s,e,t,r,n,a,o,l){try{let c=s._udfFunctions.get(r);if(!c){So(e,t,"Unknown UDF with id: "+r);return}let u=Ic.decode(e.HEAPU8.subarray(n,n+a)),_=JSON.parse(u),d=ua(e,o,l/8),m=y=>{var b;let E=null;switch(y.validityBuffer!==void 0&&(E=Dc(e,d[y.validityBuffer],_.rows)),y.physicalType){case"VARCHAR":{if(y.dataBuffer===null||y.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(y.lengthBuffer===null||y.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let T=wo(e,d[y.dataBuffer],y.physicalType,_.rows),v=[],I=ua(e,d[y.lengthBuffer],_.rows);for(let O=0;O<_.rows;++O){if(E!=null&&!E[O]){v.push(null);continue}let ie=e.HEAPU8.subarray(T[O],T[O]+I[O]),we=Ic.decode(ie);v.push(we)}return O=>v[O]}case"STRUCT":{let T={},v=[];for(let I=0;I<(((b=y.children)==null?void 0:b.length)||0);++I){let O=y.children[I],ie=m(O);v.push(we=>{T[O.name]=ie(we)})}return E!=null?I=>{if(!E[I])return null;for(let O of v)O(I);return T}:I=>{for(let O of v)O(I);return T}}default:{if(y.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+y.physicalType);let T=wo(e,d[y.dataBuffer],y.physicalType,_.rows);return E!=null?v=>E[v]?T[v]:null:v=>T[v]}}},p=[];for(let y=0;y<_.args.length;++y)p.push(m(_.args[y]));let h=_.rows*Ao(_.ret.physicalType),S=e._malloc(h),w=wo(e,S,_.ret.physicalType,_.rows),L=e._malloc(_.rows),P=Dc(e,L,_.rows);if(w.length==0||P.length==0){So(e,t,"Can't create physical arrays for result");return}let k=w;_.ret.physicalType=="VARCHAR"&&(k=new Array(_.rows));let C=[];for(let y=0;y<_.args.length;++y)C.push(null);for(let y=0;y<_.rows;++y){for(let b=0;b<_.args.length;++b)C[b]=p[b](y);let E=c.func(...C);k[y]=E,P[y]=E==null?0:1}let x=0;switch(_.ret.physicalType){case"VARCHAR":{let y=new Array(0);x=e._malloc(_.rows*Ao("DOUBLE"));let E=ua(e,x,_.rows),b=0;for(let O=0;O<_.rows;++O){let ie=Mc.encode(k[O]||"");y.push(ie),E[O]=ie.length,b+=ie.length}let T=e._malloc(b),v=e.HEAPU8.subarray(T,T+b),I=0;for(let O=0;O<_.rows;++O){w[O]=I;let ie=y[O];v.subarray(I,I+ie.length).set(ie),I+=ie.length}}}let g=3*8,A=e._malloc(g),F=ua(e,A,3);F[0]=S,F[1]=L,F[2]=x,e.HEAPF64[(t>>3)+0]=0,e.HEAPF64[(t>>3)+1]=A,e.HEAPF64[(t>>3)+2]=0}catch(c){So(e,t,c.toString())}}function bd(){let s=new TextDecoder;return e=>(typeof SharedArrayBuffer<"u"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),s.decode(e))}var vd=bd();function Et(s,e){console.error("FAIL WITH: ".concat(e)),s.ccall("duckdb_web_fail_with",null,["string"],[e])}function Xr(s,e,t){let r=s.HEAPU8.subarray(e,e+t),n=new Uint8Array(new ArrayBuffer(r.byteLength));return n.set(r),n}function X(s,e,t){return vd(s.HEAPU8.subarray(e,e+t))}function ue(s,e,t,r){let n=s.stackSave(),a=s.stackAlloc(3*8);t.unshift("number"),r.unshift(a),s.ccall(e,null,t,r);let o=s.HEAPF64[(a>>3)+0],l=s.HEAPF64[(a>>3)+1],c=s.HEAPF64[(a>>3)+2];return s.stackRestore(n),[o,l,c]}function pe(s){s.ccall("duckdb_web_clear_response",null,[],[])}var _a=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}};var Ln=new TextEncoder;var da=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]=ue(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==0)throw new Error(X(this.mod,r,n));pe(this.mod)}reset(){let[e,t,r]=ue(this.mod,"duckdb_web_reset",[],[]);if(e!==0)throw new Error(X(this.mod,t,r));pe(this.mod)}getVersion(){let[e,t,r]=ue(this.mod,"duckdb_web_get_version",[],[]);if(e!==0)throw new Error(X(this.mod,t,r));let n=X(this.mod,t,r);return pe(this.mod),n}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let t=Ln.encode(e),r=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(r,r+t.length).set(t);let[a,o,l]=ue(this.mod,"duckdb_web_tokenize_buffer",["number","number"],[r,t.length]);if(this.mod._free(r),a!==0)throw new Error(X(this.mod,o,l));let c=X(this.mod,o,l);return pe(this.mod),JSON.parse(c)}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=Ln.encode(t),n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[o,l,c]=ue(this.mod,"duckdb_web_query_run_buffer",["number","number","number"],[e,n,r.length]);if(this.mod._free(n),o!==0)throw new Error(X(this.mod,l,c));let u=Xr(this.mod,l,c);return pe(this.mod),u}startPendingQuery(e,t,r=!1){let n=Ln.encode(t),a=this.mod._malloc(n.length);this.mod.HEAPU8.subarray(a,a+n.length).set(n);let[l,c,u]=ue(this.mod,"duckdb_web_pending_query_start_buffer",["number","number","number","boolean"],[e,a,n.length,r]);if(this.mod._free(a),l!==0)throw new Error(X(this.mod,c,u));if(c==0)return null;let _=Xr(this.mod,c,u);return pe(this.mod),_}pollPendingQuery(e){let[t,r,n]=ue(this.mod,"duckdb_web_pending_query_poll",["number"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));if(r==0)return null;let a=Xr(this.mod,r,n);return pe(this.mod),a}cancelPendingQuery(e){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[e])}fetchQueryResults(e){let[t,r,n]=ue(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(Tc(t))return pe(this.mod),null;if(!Lc(t))throw new Error("Unexpected StatusCode from duckdb_web_query_fetch_results ("+t+") and with self reported error as"+X(this.mod,r,n));if(t!==0)throw new Error(X(this.mod,r,n));let a=Xr(this.mod,r,n);return pe(this.mod),a}getTableNames(e,t){let r=Ln.encode(t),n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[o,l,c]=ue(this.mod,"duckdb_web_get_tablenames_buffer",["number","number","number"],[e,n,r.length]);if(this.mod._free(n),o!==0)throw new Error(X(this.mod,l,c));let u=X(this.mod,l,c);return pe(this.mod),JSON.parse(u)}createScalarFunction(e,t,r,n){let a={functionId:this._nextUDFId,name:t,returnType:xn(r)},o={functionId:a.functionId,connectionId:e,name:t,returnType:r,func:n};this._nextUDFId+=1;let[l,c,u]=ue(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[e,JSON.stringify(a)]);if(l!==0)throw new Error(X(this.mod,c,u));if(pe(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(o.functionId,o),this.pthread)for(let _ of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])_.postMessage({cmd:"registerUDFFunction",udf:o})}createPrepared(e,t){let r=Ln.encode(t),n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[o,l,c]=ue(this.mod,"duckdb_web_prepared_create_buffer",["number","number","number"],[e,n,r.length]);if(this.mod._free(n),o!==0)throw new Error(X(this.mod,l,c));return pe(this.mod),l}closePrepared(e,t){let[r,n,a]=ue(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(r!==0)throw new Error(X(this.mod,n,a));pe(this.mod)}runPrepared(e,t,r){let[n,a,o]=ue(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(X(this.mod,a,o));let l=Xr(this.mod,a,o);return pe(this.mod),l}sendPrepared(e,t,r){let[n,a,o]=ue(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(r)]);if(n!==0)throw new Error(X(this.mod,a,o));let l=Xr(this.mod,a,o);return pe(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 o=r?JSON.stringify(r):"",[l,c,u]=ue(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,n,t.length,o]);if(l!==0)throw new Error(X(this.mod,c,u))}insertCSVFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let u in r.columns)r.columnsFlat.push(oa(u,r.columns[u]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[o,l,c]=ue(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,a]);if(o!==0)throw new Error(X(this.mod,l,c))}insertJSONFromPath(e,t,r){if(r.columns!==void 0){r.columnsFlat=[];for(let u in r.columns)r.columnsFlat.push(oa(u,r.columns[u]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let a=JSON.stringify(n),[o,l,c]=ue(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,a]);if(o!==0)throw new Error(X(this.mod,l,c))}globFiles(e){let[t,r,n]=ue(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));let a=X(this.mod,r,n);pe(this.mod);let o=JSON.parse(a);return o==null?[]:o}registerFileURL(e,t,r,n=!1){t===void 0&&(t=e);let[a,o,l]=ue(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t,r,n]);if(a!==0)throw new Error(X(this.mod,o,l));pe(this.mod)}registerFileText(e,t){let r=Ln.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[a,o,l]=ue(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,r,t.length]);if(a!==0)throw new Error(X(this.mod,o,l));pe(this.mod)}async prepareFileHandle(e,t){if(t===3&&this._runtime.prepareFileHandles){let r=await this._runtime.prepareFileHandles([e],3);for(let n of r){let{handle:a,path:o,fromCached:l}=n;!l&&a.getSize()&&await this.registerFileHandleAsync(o,a,3,!0)}return}throw new Error("prepareFileHandle: unsupported protocol ".concat(t))}async prepareDBFileHandle(e,t){if(t===3&&this._runtime.prepareDBFileHandle){let r=await this._runtime.prepareDBFileHandle(e,3);for(let n of r){let{handle:a,path:o,fromCached:l}=n;!l&&a.getSize()&&await this.registerFileHandleAsync(o,a,3,!0)}return}throw new Error("prepareDBFileHandle: unsupported protocol ".concat(t))}async prepareFileHandleAsync(e,t,r,n){if(r===3&&!(t instanceof FileSystemSyncAccessHandle)){if(t instanceof FileSystemFileHandle){let a=t;try{t=await a.createSyncAccessHandle()}catch(o){throw new Error(o.message+":"+e)}}else if(e!=null)try{t=await(await(await navigator.storage.getDirectory()).getFileHandle(e)).createSyncAccessHandle()}catch(a){throw new Error(a.message+":"+e)}}return t}async registerFileHandleAsync(e,t,r,n){let a=await this.prepareFileHandleAsync(e,t,r,n);this.registerFileHandle(e,a,r,n)}registerFileHandle(e,t,r,n){var c;let[a,o,l]=ue(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[e,e,r,n]);if(a!==0)throw new Error(X(this.mod,o,l));if(pe(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),(c=globalThis.DUCKDB_RUNTIME._preparedHandles)!=null&&c[e]&&delete globalThis.DUCKDB_RUNTIME._preparedHandles[e],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]=ue(this.mod,"duckdb_web_fs_drop_file",["string"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));pe(this.mod)}dropFiles(){let[e,t,r]=ue(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==0)throw new Error(X(this.mod,t,r));pe(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[r,n,a]=ue(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(r!==0)throw new Error(X(this.mod,n,a));pe(this.mod)}copyFileToBuffer(e){let[t,r,n]=ue(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));let a=this.mod.HEAPU8.subarray(r,r+n),o=new Uint8Array(a.length);return o.set(a),pe(this.mod),o}registerOPFSFileName(e){if(e.startsWith("opfs://"))return this.prepareFileHandle(e,3);throw new Error("Not an OPFS file name: "+e)}collectFileStatistics(e,t){let[r,n,a]=ue(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(r!==0)throw new Error(X(this.mod,n,a))}exportFileStatistics(e){let[t,r,n]=ue(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==0)throw new Error(X(this.mod,r,n));return new _a(this.mod.HEAPU8.subarray(r,r+n))}};var fa=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;default:break}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":{let t=e.data.path;t!=null&&t.startsWith("opfs://")&&(await this._bindings.prepareDBFileHandle(t,3),e.data.useDirectIO=!0),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],e.data[2]),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),r=t?[t.buffer]:[];this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_CHUNK",data:t},r);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":await this._bindings.registerFileHandleAsync(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"REGISTER_OPFS_FILE_NAME":this._bindings.registerOPFSFileName(e.data[0]),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)}}};var Uc=Bo(Cc());var pa=class extends da{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 a=(async()=>{var h;let o=new Request(this.mainModuleURL),l=await fetch(o),c=l.headers.get("content-length"),u=c&&parseInt(c,10)||0,_=new Date,d={startedAt:_,updatedAt:_,bytesTotal:u||0,bytesLoaded:0},m={transform(S,w){d.bytesLoaded+=S.byteLength;let L=new Date;if(L.getTime()-d.updatedAt.getTime()<20){d.updatedAt=L,w.enqueue(S);return}for(let P of r)P(d);w.enqueue(S)}},p=new TransformStream(m);return new Response((h=l.body)==null?void 0:h.pipeThrough(p),l)})();WebAssembly.instantiateStreaming(a,e).then(o=>{t(o.instance,o.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=c=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+c}),new Error(c.toString())},n.onprogress=c=>{l.bytesTotal=c.total,l.bytesLoaded=c.loaded;let u=new Date;if(u.getTime()-l.updatedAt.getTime()<20){l.updatedAt=u;return}for(let _ of r)_(l)},n.onload=()=>{WebAssembly.instantiate(n.response,e).then(c=>{t(c.instance,c.module)}).catch(c=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+c}),new Error(c)})},n.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let a=new Request(this.mainModuleURL),l=await(await fetch(a)).arrayBuffer();WebAssembly.instantiate(l,e).then(c=>{t(c.instance,c.module)})})();return[]}};var ma=class extends pa{constructor(e,t,r,n=null){super(e,t,r,n)}instantiateImpl(e){return(0,Uc.default)({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var Ir=Bo(Rc()),Gc=function(s,e,t){var r;if((r=s==null?void 0:s.endpoint)!=null&&r.startsWith("http")){let n="".concat(s==null?void 0:s.endpoint),a=n.indexOf("://")+3;return n.substring(a)}else return s!=null&&s.endpoint?"".concat(t,".").concat(s==null?void 0:s.endpoint):"".concat(t,".s3.amazonaws.com")};function wd(s,e,t){var a,o,l,c;let r=Hc(e),n=r.path;return Vc(s)&&(n="/".concat(r.bucket).concat(n)),{url:n,query:"",host:Gc(s,e,r.bucket),region:(a=s==null?void 0:s.region)!=null?a:"",service:"s3",method:t,accessKeyId:(o=s==null?void 0:s.accessKeyId)!=null?o:"",secretAccessKey:(l=s==null?void 0:s.secretAccessKey)!=null?l:"",sessionToken:(c=s==null?void 0:s.sessionToken)!=null?c:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function Ad(s,e=!1){let t="0123456789ABCDEF",r="";for(let n=0;n<s.length;n++){let a=s[n];a>="A"&&a<="Z"||a>="a"&&a<="z"||a>="0"&&a<="9"||a=="_"||a=="-"||a=="~"||a=="."?r+=a:a=="/"?e?r+="%2F":r+=a:(r+="%",r+=t[a.charCodeAt(0)>>4],r+=t[a.charCodeAt(0)&15])}return r}function Ed(s,e=null){var h;let t=(h=e==null?void 0:e.contentHash)!=null?h:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=new Map;r.set("x-amz-date",s.datetimeNow),r.set("x-amz-content-sha256",t),s.sessionToken&&r.set("x-amz-security-token",s.sessionToken);let n="";e!=null&&e.contentType&&(n+="content-type;"),n+="host;x-amz-content-sha256;x-amz-date",s.sessionToken&&(n+=";x-amz-security-token");let a=s.method+"\n"+Ad(s.url)+"\n"+s.query;e!=null&&e.contentType&&(a+="\ncontent-type:"+(e==null?void 0:e.contentType)),a+="\nhost:"+s.host+"\nx-amz-content-sha256:"+t+"\nx-amz-date:"+s.datetimeNow,s.sessionToken&&s.sessionToken.length>0&&(a+="\nx-amz-security-token:"+s.sessionToken),a+="\n\n"+n+"\n"+t;let o=(0,Ir.sha256)(a),l="AWS4-HMAC-SHA256\n"+s.datetimeNow+"\n"+s.dateNow+"/"+s.region+"/"+s.service+"/aws4_request\n"+o,c="AWS4"+s.secretAccessKey,u=Ir.sha256.hmac.arrayBuffer(c,s.dateNow),_=Ir.sha256.hmac.arrayBuffer(u,s.region),d=Ir.sha256.hmac.arrayBuffer(_,s.service),m=Ir.sha256.hmac.arrayBuffer(d,"aws4_request"),p=Ir.sha256.hmac(m,l);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+s.accessKeyId+"/"+s.dateNow+"/"+s.region+"/"+s.service+"/aws4_request, SignedHeaders="+n+", Signature="+p),r}var Fd=function(s,e,t,r=null,n=null){let a=wd(s,e,t),o={contentType:r,contentHash:n?Ir.sha256.hex(n):null};return Ed(a,o)};function Ft(s,e,t,r,n=null,a=null){(e!=null&&e.accessKeyId||e!=null&&e.sessionToken)&&(Fd(e,t,r,n,a).forEach((l,c)=>{s.setRequestHeader(c,l)}),n&&s.setRequestHeader("content-type",n))}function Hc(s){if(s.indexOf("s3://")!=0)throw new Error("URL needs to start with s3://");let e=s.indexOf("/",5);if(e==-1)throw new Error("URL needs to contain a '/' after the host");let t=s.substring(5,e);if(!t)throw new Error("URL needs to contain a bucket name");let r=s.substring(e);if(!r)throw new Error("URL needs to contain key");return{bucket:t,path:r}}function Vc(s){var e;return!!((e=s==null?void 0:s.endpoint)!=null&&e.startsWith("http"))}function xt(s,e){let t=Hc(e);return Vc(s)?"".concat(s==null?void 0:s.endpoint,"/").concat(t.bucket)+t.path:"https://"+Gc(s,e,t.bucket)+t.path}var xd=7,jc=/\/|\\/,q={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,_preparedHandles:{},_opfsRoot:null,getFileInfo(s,e){try{let t=q._fileInfoCache.get(e),[r,n,a]=ue(s,"duckdb_web_fs_get_file_info_by_id",["number","number"],[e,(t==null?void 0:t.cacheEpoch)||0]);if(r!==0)return null;if(a===0)return t;let o=X(s,n,a);pe(s);try{let l=JSON.parse(o);if(l==null)return null;let c={...l,blob:null};return q._fileInfoCache.set(e,c),!q._files.has(c.fileName)&&q._preparedHandles[c.fileName]&&(q._files.set(c.fileName,q._preparedHandles[c.fileName]),delete q._preparedHandles[c.fileName]),c}catch(l){return console.warn(l),null}}catch(t){return console.log(t),null}},getGlobalFileInfo(s){var e;try{let[t,r,n]=ue(s,"duckdb_web_get_global_file_info",["number"],[((e=q._globalFileInfo)==null?void 0:e.cacheEpoch)||0]);if(t!==0)return null;if(n===0)return q._globalFileInfo;let a=X(s,r,n);pe(s);let o=JSON.parse(a);return o==null?null:(q._globalFileInfo={...o,blob:null},q._globalFileInfo)}catch(t){return console.log(t),null}},async assignOPFSRoot(){q._opfsRoot||(q._opfsRoot=await navigator.storage.getDirectory())},async prepareFileHandles(s,e){if(e===3){await q.assignOPFSRoot();let t=async n=>{if(q._files.has(n))return{path:n,handle:q._files.get(n),fromCached:!0};let o=q._opfsRoot,l=n.slice(xd),c=l;if(jc.test(l)){let _=l.split(jc);if(c=_.pop(),!c)throw new Error("Invalid path ".concat(n));for(let d of _)o=await o.getDirectoryHandle(d,{create:!0})}let u=await o.getFileHandle(c,{create:!1}).catch(_=>{if((_==null?void 0:_.name)==="NotFoundError")return console.debug("File ".concat(n," does not exists yet, creating...")),o.getFileHandle(c,{create:!0});throw _});try{let _=await u.createSyncAccessHandle();return q._preparedHandles[n]=_,{path:n,handle:_,fromCached:!1}}catch(_){throw new Error(_.message+":"+name)}},r=[];for(let n of s){let a=await t(n);r.push(a)}return r}throw new Error("Unsupported protocol ".concat(e," for paths ").concat(s," with protocol ").concat(e))},async prepareDBFileHandle(s,e){if(e===3&&this.prepareFileHandles){let t=[s,"".concat(s,".wal")];return this.prepareFileHandles(t,e)}throw new Error("Unsupported protocol ".concat(e," for path ").concat(s," with protocol ").concat(e))},testPlatformFeature:(s,e)=>{switch(e){case 1:return typeof BigInt64Array<"u";default:return console.warn("test for unknown feature: ".concat(e)),!1}},getDefaultDataProtocol(s){return 2},openFile:(s,e,t)=>{var r,n,a;try{q._fileInfoCache.delete(e);let o=q.getFileInfo(s,e);switch(o==null?void 0:o.dataProtocol){case 4:case 5:{if(t&1&&t&2)throw new Error("Opening file ".concat(o.fileName," failed: cannot open file with both read and write flags set"));if(t&32)throw new Error("Opening file ".concat(o.fileName," failed: appending to HTTP/S3 files is not supported"));if(t&2){let u=new XMLHttpRequest;if(o.dataProtocol==5?(u.open("HEAD",xt(o.s3Config,o.dataUrl),!1),Ft(u,o.s3Config,o.dataUrl,"HEAD")):u.open("HEAD",o.dataUrl,!1),u.send(null),u.status!=200&&u.status!=404)throw new Error("Opening file ".concat(o.fileName," failed: Unexpected return status from server (").concat(u.status,")"));if(u.status==404&&!(t&8||t&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 _=s._malloc(1),d=new Uint8Array;s.HEAPU8.set(d,_);let m=s._malloc(2*8);return s.HEAPF64[(m>>3)+0]=1,s.HEAPF64[(m>>3)+1]=_,m}else if(!(t&1))throw new Error("Opening file ".concat(o.fileName," failed: unsupported file flags: ").concat(t));let l=null,c=null;if(o.reliableHeadRequests||!o.allowFullHttpReads)try{let u=new XMLHttpRequest;if(o.dataProtocol==5?(u.open("HEAD",xt(o.s3Config,o.dataUrl),!1),Ft(u,o.s3Config,o.dataUrl,"HEAD")):u.open("HEAD",o.dataUrl,!1),u.setRequestHeader("Range","bytes=0-"),u.send(null),l=u.getResponseHeader("Content-Length"),l!==null&&u.status==206){let _=s._malloc(16);return s.HEAPF64[(_>>3)+0]=+l,s.HEAPF64[(_>>3)+1]=0,_}}catch(u){c=u,console.warn("HEAD request with range header failed: ".concat(u))}if(o.allowFullHttpReads){{let _=new XMLHttpRequest;o.dataProtocol==5?(_.open("GET",xt(o.s3Config,o.dataUrl),!1),Ft(_,o.s3Config,o.dataUrl,"GET")):_.open("GET",o.dataUrl,!1),_.responseType="arraybuffer",_.setRequestHeader("Range","bytes=0-0"),_.send(null);let d=(r=_.getResponseHeader("Content-Range"))==null?void 0:r.split("/")[1],m=_.getResponseHeader("Content-Length"),p=null;if(d!==void 0)p=d;else if(!o.reliableHeadRequests){let h=new XMLHttpRequest;o.dataProtocol==5?(h.open("HEAD",xt(o.s3Config,o.dataUrl),!1),Ft(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&&(p=l)}if(_.status==206&&m!==null&&+m==1&&p!==null){let h=s._malloc(16);return s.HEAPF64[(h>>3)+0]=+p,s.HEAPF64[(h>>3)+1]=0,h}if(_.status==200&&m!==null&&l!==null&&+m==+l){console.warn("fall back to full HTTP read for: ".concat(o.dataUrl));let h=s._malloc(_.response.byteLength),S=new Uint8Array(_.response,0,_.response.byteLength);s.HEAPU8.set(S,h);let w=s._malloc(2*8);return s.HEAPF64[(w>>3)+0]=_.response.byteLength,s.HEAPF64[(w>>3)+1]=h,w}}console.warn("falling back to full HTTP read for: ".concat(o.dataUrl));let u=new XMLHttpRequest;if(o.dataProtocol==5?(u.open("GET",xt(o.s3Config,o.dataUrl),!1),Ft(u,o.s3Config,o.dataUrl,"GET")):u.open("GET",o.dataUrl,!1),u.responseType="arraybuffer",u.send(null),u.status==200){let _=s._malloc(u.response.byteLength),d=new Uint8Array(u.response,0,u.response.byteLength);s.HEAPU8.set(d,_);let m=s._malloc(2*8);return s.HEAPF64[(m>>3)+0]=u.response.byteLength,s.HEAPF64[(m>>3)+1]=_,m}}if(c!=null)throw new Error("Reading file ".concat(o.fileName," failed with error: ").concat(c));return 0}case 2:{let l=(n=q._files)==null?void 0:n.get(o.fileName);if(l){let _=s._malloc(16);return s.HEAPF64[(_>>3)+0]=l.size,s.HEAPF64[(_>>3)+1]=0,_}console.warn("Buffering missing file: ".concat(o.fileName));let c=s._malloc(2*8),u=s._malloc(1);return s.HEAPF64[(c>>3)+0]=1,s.HEAPF64[(c>>3)+1]=u,c}case 3:{let l=(a=q._files)==null?void 0:a.get(o.fileName);if(!l)throw new Error("No OPFS access handle registered with name: ".concat(o.fileName));t&16&&l.truncate(0);let c=s._malloc(2*8),u=l.getSize();return s.HEAPF64[(c>>3)+0]=u,s.HEAPF64[(c>>3)+1]=0,c}}}catch(o){console.error(o.toString()),Et(s,o.toString())}return 0},glob:(s,e,t)=>{var r;try{let n=X(s,e,t);if(n.startsWith("http")||n.startsWith("s3://")){let a=new XMLHttpRequest;if(n.startsWith("s3://")){let o=q.getGlobalFileInfo(s);a.open("HEAD",xt(o==null?void 0:o.s3Config,n),!1),Ft(a,o==null?void 0:o.s3Config,n,"HEAD")}else a.open("HEAD",n,!1);if(a.send(null),a.status!=200&&a.status!==206){if(!((r=q.getGlobalFileInfo(s))!=null&&r.allowFullHttpReads))return console.log("HEAD request failed: ".concat(n,", with full http reads are disabled")),0;let o=new XMLHttpRequest;if(n.startsWith("s3://")){let c=q.getGlobalFileInfo(s);o.open("GET",xt(c==null?void 0:c.s3Config,n),!1),Ft(o,c==null?void 0:c.s3Config,n,"HEAD")}else o.open("GET",n,!1);if(o.setRequestHeader("Range","bytes=0-0"),o.send(null),o.status!=200&&o.status!==206)return console.log("HEAD and GET requests failed: ".concat(n)),0;let l=o.getResponseHeader("Content-Length");l&&+l>1&&console.warn("Range request for ".concat(n," did not return a partial response: ").concat(o.status,' "').concat(o.statusText,'"'))}s.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}else for(let[a]of q._files.entries()||[])a.startsWith(n)&&s.ccall("duckdb_web_fs_glob_add_path",null,["string"],[a])}catch(n){return console.log(n),Et(s,n.toString()),0}},checkFile:(s,e,t)=>{try{let r=X(s,e,t);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let a=q.getGlobalFileInfo(s);n.open("HEAD",xt(a==null?void 0:a.s3Config,r),!1),Ft(n,a==null?void 0:a.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);return n.send(null),n.status==206||n.status==200}else return q._files.has(r)}catch(r){return console.log(r),!1}return!1},syncFile:(s,e)=>{},closeFile:(s,e)=>{var r;let t=q.getFileInfo(s,e);q._fileInfoCache.delete(e);try{switch(t==null?void 0:t.dataProtocol){case 0:case 4:case 5:break;case 1:case 2:return;case 3:{let n=(r=q._files)==null?void 0:r.get(t.fileName);if(!n)throw new Error("No OPFS access handle registered with name: ".concat(t.fileName));return n.flush()}}}catch(n){console.log(n),Et(s,n.toString())}},dropFile:(s,e,t)=>{var a;let r=X(s,e,t),n=(a=q._files)==null?void 0:a.get(r);if(n){if(q._files.delete(r),n instanceof FileSystemSyncAccessHandle)try{n.flush(),n.close()}catch(o){throw new Error("Cannot drop file with name: ".concat(r))}n instanceof Blob}},truncateFile:(s,e,t)=>{var n;let r=q.getFileInfo(s,e);switch(r==null?void 0:r.dataProtocol){case 4:Et(s,"Cannot truncate a http file");return;case 5:Et(s,"Cannot truncate an s3 file");return;case 0:case 1:case 2:Et(s,"truncateFile not implemented");return;case 3:{let a=(n=q._files)==null?void 0:n.get(r.fileName);if(!a)throw new Error("No OPFS access handle registered with name: ".concat(r.fileName));return a.truncate(t)}}return 0},readFile(s,e,t,r,n){var a;if(r==0)return 0;try{let o=q.getFileInfo(s,e);switch(o==null?void 0:o.dataProtocol){case 4:case 5:{if(!o.dataUrl)throw new Error("Missing data URL for file ".concat(e));try{let l=new XMLHttpRequest;if(o.dataProtocol==5?(l.open("GET",xt(o==null?void 0:o.s3Config,o.dataUrl),!1),Ft(l,o==null?void 0:o.s3Config,o.dataUrl,"GET")):l.open("GET",o.dataUrl,!1),l.responseType="arraybuffer",l.setRequestHeader("Range","bytes=".concat(n,"-").concat(n+r-1)),l.send(null),l.status==206||l.status==200&&r==l.response.byteLength&&n==0){let c=new Uint8Array(l.response,0,Math.min(l.response.byteLength,r));return s.HEAPU8.set(c,t),c.byteLength}else if(l.status==200){console.warn("Range request for ".concat(o.dataUrl," did not return a partial response: ").concat(l.status,' "').concat(l.statusText,'"'));let c=new Uint8Array(l.response,n,Math.min(l.response.byteLength-n,r));return s.HEAPU8.set(c,t),c.byteLength}else throw new Error("Range request for ".concat(o.dataUrl," did returned non-success status: ").concat(l.status,' "').concat(l.statusText,'"'))}catch(l){throw console.log(l),new Error("Range request for ".concat(o.dataUrl," failed with error: ").concat(l,'"'))}}case 2:{let l=(a=q._files)==null?void 0:a.get(o.fileName);if(!l)throw new Error("No HTML5 file registered with name: ".concat(o.fileName));let c=l.slice(n,n+r),u=new Uint8Array(new FileReaderSync().readAsArrayBuffer(c));return s.HEAPU8.set(u,t),u.byteLength}case 3:{let l=q._files.get(o.fileName);if(!l)throw new Error("No OPFS access handle registered with name: ".concat(o.fileName));let c=s.HEAPU8.subarray(t,t+r);return l.read(c,{at:n})}}return 0}catch(o){return console.log(o),Et(s,o.toString()),0}},writeFile:(s,e,t,r,n)=>{var o;let a=q.getFileInfo(s,e);switch(a==null?void 0:a.dataProtocol){case 4:return Et(s,"Cannot write to HTTP file"),0;case 5:{let l=s.HEAPU8.subarray(t,t+r),c=new XMLHttpRequest;return c.open("PUT",xt(a==null?void 0:a.s3Config,a.dataUrl),!1),Ft(c,a==null?void 0:a.s3Config,a.dataUrl,"PUT","",l),c.send(l),c.status!==200?(Et(s,"Failed writing file: HTTP "+c.status),0):r}case 2:return Et(s,"cannot write using the html5 file reader api"),0;case 3:{let l=(o=q._files)==null?void 0:o.get(a.fileName);if(!l)throw new Error("No OPFS access handle registered with name: ".concat(a.fileName));let c=s.HEAPU8.subarray(t,t+r);return l.write(c,{at:n})}}return 0},getLastFileModificationTime:(s,e)=>{var r;let t=q.getFileInfo(s,e);switch(t==null?void 0:t.dataProtocol){case 2:{if(!((r=q._files)==null?void 0:r.get(t.fileName)))throw Error("No handle available for file: ".concat(t.fileName));return 0}case 4:case 5:return new Date().getTime()}return 0},progressUpdate:(s,e,t)=>{postMessage&&postMessage({requestId:0,type:"PROGRESS_UPDATE",data:{status:s?"completed":"in-progress",percentage:e,repetitions:t}})},checkDirectory:(s,e,t)=>{let r=X(s,e,t);return console.log("checkDirectory: ".concat(r)),!1},createDirectory:(s,e,t)=>{let r=X(s,e,t);console.log("createDirectory: ".concat(r))},removeDirectory:(s,e,t)=>{let r=X(s,e,t);console.log("removeDirectory: ".concat(r))},listDirectoryEntries:(s,e,t)=>{let r=X(s,e,t);return console.log("listDirectoryEntries: ".concat(r)),!1},moveFile:(s,e,t,r,n)=>{var c,u;let a=X(s,e,t),o=X(s,r,n),l=(c=q._files)==null?void 0:c.get(a);l!==void 0&&(q._files.delete(l),q._files.set(o,l));for(let[_,d]of((u=q._fileInfoCache)==null?void 0:u.entries())||[])if(d.dataUrl==a){q._fileInfoCache.delete(_);break}return!0},removeFile:(s,e,t)=>{},callScalarUDF:(s,e,t,r,n,a,o)=>{kc(q,s,e,t,r,n,a,o)}};var Lo=class extends fa{postMessage(e,t){globalThis.postMessage(e,t)}async instantiate(e,t,r){return await new ma(this,q,e,t).instantiate(r)}};function Wc(){let s=new Lo;globalThis.onmessage=async e=>{await s.onMessage(e.data)}}Wc();return Xc(Ld);})();
2
2
  /*! Bundled license information:
3
3
 
4
4
  js-sha256/src/sha256.js: