@run-trace/duckdb-wasm 0.4.0 → 0.4.1

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,14 +0,0 @@
1
- "use strict";var duckdb=(()=>{var gv=Object.create;var _n=Object.defineProperty;var wv=Object.getOwnPropertyDescriptor;var Sv=Object.getOwnPropertyNames;var Iv=Object.getPrototypeOf,Tv=Object.prototype.hasOwnProperty;var ga=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var jv=(i,t,e)=>t in i?_n(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Zc=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var Er=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),$i=(i,t)=>{for(var e in t)_n(i,e,{get:t[e],enumerable:!0})},Qc=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Sv(t))!Tv.call(i,s)&&s!==e&&_n(i,s,{get:()=>t[s],enumerable:!(r=wv(t,s))||r.enumerable});return i};var tl=(i,t,e)=>(e=i!=null?gv(Iv(i)):{},Qc(t||!i||!i.__esModule?_n(e,"default",{value:i,enumerable:!0}):e,i)),Bv=i=>Qc(_n({},"__esModule",{value:!0}),i);var el=(i,t,e)=>(jv(i,typeof t!="symbol"?t+"":t,e),e);var Dv=function(i,t){this[0]=i,this[1]=t};var ur=i=>{var t=i[ga("asyncIterator")],e=!1,r,s={};return t==null?(t=i[ga("iterator")](),r=d=>s[d]=_=>t[d](_)):(t=t.call(i),r=d=>s[d]=_=>{if(e){if(e=!1,d==="throw")throw _;return _}return e=!0,{done:!1,value:new Dv(new Promise(b=>{var g=t[d](_);if(!(g instanceof Object))throw TypeError("Object expected");b(g)}),1)}}),s[ga("iterator")]=()=>s,r("next"),"throw"in t?r("throw"):s.throw=d=>{throw d},"return"in t&&r("return"),s};var eh=Er(()=>{});var ih=Er(()=>{});var nh=Er((rh,ca)=>{"use strict";var Bc=(()=>{var t;var i=typeof document<"u"?(t=document.currentScript)==null?void 0:t.src:void 0;return typeof __filename<"u"&&(i=i||__filename),async function(e={}){var r,s=e,d,_,b=new Promise((n,o)=>{d=n,_=o}),g=typeof window=="object",I=typeof WorkerGlobalScope<"u",B=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer",U=Object.assign({},s),C=[],R="./this.program",ft=(n,o)=>{throw o},yt="";function Wt(n){return s.locateFile?s.locateFile(n,yt):yt+n}var Rt,xt;if(B){var Tt=eh(),se=ih();yt=__dirname+"/",xt=n=>{n=xe(n)?new URL(n):n;var o=Tt.readFileSync(n);return o},Rt=async(n,o=!0)=>{n=xe(n)?new URL(n):n;var a=Tt.readFileSync(n,o?void 0:"utf8");return a},!s.thisProgram&&process.argv.length>1&&(R=process.argv[1].replace(/\\/g,"/")),C=process.argv.slice(2),ft=(n,o)=>{throw process.exitCode=n,o}}else(g||I)&&(I?yt=self.location.href:typeof document<"u"&&document.currentScript&&(yt=document.currentScript.src),i&&(yt=i),yt.startsWith("blob:")?yt="":yt=yt.slice(0,yt.replace(/[?#].*/,"").lastIndexOf("/")+1),I&&(xt=n=>{var o=new XMLHttpRequest;return o.open("GET",n,!1),o.responseType="arraybuffer",o.send(null),new Uint8Array(o.response)}),Rt=async n=>{var o=await fetch(n,{credentials:"same-origin"});if(o.ok)return o.arrayBuffer();throw new Error(o.status+" : "+o.url)});var Zt=s.print||console.log.bind(console),x=s.printErr||console.error.bind(console);Object.assign(s,U),U=null,s.arguments&&(C=s.arguments),s.thisProgram&&(R=s.thisProgram);var N=s.wasmBinary,K,E=!1,H;function O(n,o){n||ke(o)}var q,k,Y,it,L,mt,Ze,St,Qe=!1,xe=n=>n.startsWith("file://");function Pi(){var n=K.buffer;s.HEAP8=q=new Int8Array(n),s.HEAP16=Y=new Int16Array(n),s.HEAPU8=k=new Uint8Array(n),s.HEAPU16=it=new Uint16Array(n),s.HEAP32=L=new Int32Array(n),s.HEAPU32=mt=new Uint32Array(n),s.HEAPF32=Ze=new Float32Array(n),s.HEAPF64=St=new Float64Array(n)}function cn(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Bh(s.preRun.shift());Ac(kc)}function ln(){Qe=!0,$.vh()}function un(){}function ph(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)jh(s.postRun.shift());Ac(xc)}var cr=0,hn=null;function _h(n){var o;cr++,(o=s.monitorRunDependencies)==null||o.call(s,cr)}function yh(n){var a;if(cr--,(a=s.monitorRunDependencies)==null||a.call(s,cr),cr==0&&hn){var o=hn;hn=null,o()}}function ke(n){var a;(a=s.onAbort)==null||a.call(s,n),n="Aborted("+n+")",x(n),E=!0,n+=". Build with -sASSERTIONS for more info.";var o=new WebAssembly.RuntimeError(n);throw _(o),o}var dn;function mh(){return Wt("./duckdb-mvp.wasm")}function bh(n){if(n==dn&&N)return new Uint8Array(N);if(xt)return xt(n);throw"both async and sync fetching of the wasm failed"}async function vh(n){if(!N)try{var o=await Rt(n);return new Uint8Array(o)}catch(a){}return bh(n)}async function gh(n,o){try{var a=await vh(n),c=await WebAssembly.instantiate(a,o);return c}catch(l){x("failed to asynchronously prepare wasm: ".concat(l)),ke(l)}}async function wh(n,o,a){if(!n&&typeof WebAssembly.instantiateStreaming=="function"&&!B)try{var c=fetch(o,{credentials:"same-origin"}),l=await WebAssembly.instantiateStreaming(c,a);return l}catch(u){x("wasm streaming compile failed: ".concat(u)),x("falling back to ArrayBuffer instantiation")}return gh(o,a)}function Sh(){return{a:jf}}async function Ih(){function n(u,h){return $=u.exports,$=bv($),K=$.uh,Pi(),Xc=$.xh,yh("wasm-instantiate"),$}_h("wasm-instantiate");function o(u){return n(u.instance)}var a=Sh();if(s.instantiateWasm)return new Promise((u,h)=>{s.instantiateWasm(a,(f,p)=>{n(f,p),u(f.exports)})});dn!=null||(dn=mh());try{var c=await wh(N,dn,a),l=o(c);return l}catch(u){return _(u),Promise.reject(u)}}var Qt,di,Th={10165216:(n,o,a,c)=>{var l=jt(n);if(typeof XMLHttpRequest>"u")return 0;let u=new XMLHttpRequest;u.open(jt(c),l,!1),u.responseType="arraybuffer";for(var h=0,v=o;h<v*2;){var f=L[a/4+h>>>0],p=L[a/4+h+1>>>0];try{var y=encodeURI(jt(f));y==="Host"&&(y="X-Host-Override"),y==="User-Agent"&&(y="X-user-agent"),y==="Authorization"?u.setRequestHeader(y,jt(p)):u.setRequestHeader(y,encodeURI(jt(p)))}catch(G){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",G)}h+=2}try{u.send(null)}catch(G){return 0}if(u.status>=400)return 0;for(var m=u.response,v=m.byteLength,T=Wi(v+4),D=new Uint8Array(m),F=0;F<v;F++)s.HEAPU8[F+T+4]=D[F];var A=new Uint8Array(4);return A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,s.HEAPU8.set(A,T),T},10166623:(n,o,a,c,l,u)=>{var h=jt(n);if(typeof XMLHttpRequest>"u")return 0;let f=new XMLHttpRequest;f.open(jt(c),h,!1),f.responseType="arraybuffer";for(var p=0,A=o;p<A*2;){var y=L[a/4+p>>>0],m=L[a/4+p+1>>>0];try{var v=encodeURI(jt(y));v==="Host"&&(v="X-Host-Override"),v==="User-Agent"&&(v="X-user-agent"),v==="Authorization"?f.setRequestHeader(v,jt(m)):f.setRequestHeader(v,encodeURI(jt(m)))}catch(Vt){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",Vt)}p+=2}try{for(var T=new Uint8Array(u),D=0;D<u;D++)T[D]=s.HEAPU8[D+l];f.send(T)}catch(Vt){return 0}if(f.status>=400)return 0;for(var F=Uint8Array.from(Array.from(f.getResponseHeader("Etag")).map(Vt=>Vt.charCodeAt(0))),A=F.byteLength,G=Wi(A+4),gt=new Uint8Array(F),D=0;D<A;D++)s.HEAPU8[D+G+4]=gt[D];var ut=new Uint8Array(4);return ut[0]=A%256,A-=ut[0],A/=256,ut[1]=A%256,A-=ut[1],A/=256,ut[2]=A%256,A-=ut[2],A/=256,ut[3]=A%256,A-=ut[3],A/=256,s.HEAPU8.set(ut,G),G},10168243:(n,o,a,c)=>{var l=jt(n);if(typeof XMLHttpRequest>"u")return 0;let u=new XMLHttpRequest;u.open(jt(c),l,!1),u.responseType="arraybuffer";for(var h=0,v=o;h<v*2;){var f=L[a/4+h>>>0],p=L[a/4+h+1>>>0];console.log("HEAD",jt(f),jt(p));try{var y=encodeURI(jt(f));y==="Host"&&(y="X-Host-Override"),y==="User-Agent"&&(y="X-user-agent"),y==="Authorization"?u.setRequestHeader(y,jt(p)):u.setRequestHeader(y,encodeURI(jt(p)))}catch(ut){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",ut)}h+=2}try{u.send(null)}catch(ut){return 0}if(u.status>=400)return 0;for(var m=u.response,v=m.byteLength,T=Wi(v+8),D=new Uint8Array(m),F=0;F<v;F++)s.HEAPU8[F+T+8]=D[F];var A=new Uint8Array(4);A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,s.HEAPU8.set(A,T+4);var G=Uint8Array.from(Array.from(u.getAllResponseHeaders()).map(ut=>ut.charCodeAt(0)));v=G.byteLength;for(var gt=Wi(v+8),F=0;F<v;F++)s.HEAPU8[F+gt+8]=G[F];return A=new Uint8Array(4),A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,s.HEAPU8.set(A,gt+4),v=gt,A=new Uint8Array(4),A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,s.HEAPU8.set(A,T),T},10170588:(n,o,a,c)=>{var l=jt(n);if(typeof XMLHttpRequest>"u")return 0;let u=new XMLHttpRequest;u.open(jt(c),l,!1),u.responseType="arraybuffer";for(var h=0,v=o;h<v*2;){var f=L[a/4+h>>>0],p=L[a/4+h+1>>>0];try{var y=encodeURI(jt(f));y==="Host"&&(y="X-Host-Override"),y==="User-Agent"&&(y="X-user-agent"),y==="Authorization"?u.setRequestHeader(y,jt(p)):u.setRequestHeader(y,encodeURI(jt(p)))}catch(G){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",G)}h+=2}try{u.send(null)}catch(G){return 0}if(u.status>=400)return 0;for(var m=u.response,v=m.byteLength,T=Wi(v+4),D=new Uint8Array(m),F=0;F<v;F++)s.HEAPU8[F+T+4]=D[F];var A=new Uint8Array(4);return A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,s.HEAPU8.set(A,T),T},10171995:(n,o,a,c,l,u)=>{var h=jt(n);if(typeof XMLHttpRequest>"u")return 0;let f=new XMLHttpRequest;f.open(jt(c),h,!1),f.responseType="arraybuffer";for(var p=0,A=o;p<A*2;){var y=L[a/4+p>>>0],m=L[a/4+p+1>>>0];try{var v=encodeURI(jt(y));v==="Host"&&(v="X-Host-Override"),v==="User-Agent"&&(v="X-user-agent"),v==="Authorization"?f.setRequestHeader(v,jt(m)):f.setRequestHeader(v,encodeURI(jt(m)))}catch(Vt){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",Vt)}p+=2}try{for(var T=new Uint8Array(u),D=0;D<u;D++)T[D]=s.HEAPU8[D+l];f.send(T)}catch(Vt){return 0}if(f.status>=400)return 0;for(var F=f.response,A=F.byteLength,G=Wi(A+4),gt=new Uint8Array(F),D=0;D<A;D++)s.HEAPU8[D+G+4]=gt[D];var ut=new Uint8Array(4);return ut[0]=A%256,A-=ut[0],A/=256,ut[1]=A%256,A-=ut[1],A/=256,ut[2]=A%256,A-=ut[2],A/=256,ut[3]=A%256,A-=ut[3],A/=256,s.HEAPU8.set(ut,G),G}};class Fc{constructor(o){el(this,"name","ExitStatus");this.message="Program terminated with exit(".concat(o,")"),this.status=o}}var Ac=n=>{for(;n.length>0;)n.shift()(s)},xc=[],jh=n=>xc.unshift(n),kc=[],Bh=n=>kc.unshift(n),Dh=s.noExitRuntime||!0,w=n=>Af(n),S=()=>kf(),Vi=[],_s=0,Hi=(n,o)=>o+2097152>>>0<4194305-!!n?(n>>>0)+o*4294967296:NaN;function Fh(n){n>>>=0;var o=new ys(n);return o.get_caught()||(o.set_caught(!0),_s--),o.set_rethrown(!1),Vi.push(o),___cxa_increment_exception_refcount(n),___cxa_get_exception_ptr(n)}function Ah(){if(!Vi.length)return 0;var n=Vi[Vi.length-1];return ___cxa_increment_exception_refcount(n.excPtr),n.excPtr}var fi=0,xh=()=>{_setThrew(0,0);var n=Vi.pop();___cxa_decrement_exception_refcount(n.excPtr),fi=0};class ys{constructor(o){this.excPtr=o,this.ptr=o-24}set_type(o){mt[this.ptr+4>>>2>>>0]=o}get_type(){return mt[this.ptr+4>>>2>>>0]}set_destructor(o){mt[this.ptr+8>>>2>>>0]=o}get_destructor(){return mt[this.ptr+8>>>2>>>0]}set_caught(o){o=o?1:0,q[this.ptr+12>>>0]=o}get_caught(){return q[this.ptr+12>>>0]!=0}set_rethrown(o){o=o?1:0,q[this.ptr+13>>>0]=o}get_rethrown(){return q[this.ptr+13>>>0]!=0}init(o,a){this.set_adjusted_ptr(0),this.set_type(o),this.set_destructor(a)}set_adjusted_ptr(o){mt[this.ptr+16>>>2>>>0]=o}get_adjusted_ptr(){return mt[this.ptr+16>>>2>>>0]}}function kh(n){throw n>>>=0,fi||(fi=n),fi}var fn=n=>Df(n),ms=n=>{var o=fi;if(!o)return fn(0),0;var a=new ys(o);a.set_adjusted_ptr(o);var c=a.get_type();if(!c)return fn(0),o;for(var l of n){if(l===0||l===c)break;var u=a.ptr+16;if(___cxa_can_catch(l,c,u))return fn(l),o}return fn(c),o};function Eh(){return ms([])}function Uh(n){return n>>>=0,ms([n])}function Oh(n,o){return n>>>=0,o>>>=0,ms([n,o])}function Ch(n,o,a){return n>>>=0,o>>>=0,a>>>=0,ms([n,o,a])}var Ec=()=>{var n=Vi.pop();n||ke("no exception to throw");var o=n.excPtr;throw n.get_rethrown()||(Vi.push(n),n.set_rethrown(!0),n.set_caught(!1),_s++),fi=o,fi};function Mh(n){if(n>>>=0,!!n){var o=new ys(n);Vi.push(o),o.set_rethrown(!0),Ec()}}function Rh(n,o,a){n>>>=0,o>>>=0,a>>>=0;var c=new ys(n);throw c.init(o,a),fi=n,_s++,fi}var Lh=()=>_s;function Uc(){ke("missing function: $SOCKFS")}Uc.stub=!0;function da(){ke("missing function: $FS")}da.stub=!0;var kr=n=>{var o=Uc.getSocket(n);if(!o)throw new da.ErrnoError(8);return o},fa=n=>(n&255)+"."+(n>>8&255)+"."+(n>>16&255)+"."+(n>>24&255),Oc=n=>{var o="",a=0,c=0,l=0,u=0,h=0,f=0,p=[n[0]&65535,n[0]>>16,n[1]&65535,n[1]>>16,n[2]&65535,n[2]>>16,n[3]&65535,n[3]>>16],y=!0,m="";for(f=0;f<5;f++)if(p[f]!==0){y=!1;break}if(y){if(m=fa(p[6]|p[7]<<16),p[5]===-1)return o="::ffff:",o+=m,o;if(p[5]===0)return o="::",m==="0.0.0.0"&&(m=""),m==="0.0.0.1"&&(m="1"),o+=m,o}for(a=0;a<8;a++)p[a]===0&&(a-l>1&&(h=0),l=a,h++),h>c&&(c=h,u=a-c+1);for(a=0;a<8;a++){if(c>1&&p[a]===0&&a>=u&&a<u+c){a===u&&(o+=":",u===0&&(o+=":"));continue}o+=Number(_ntohs(p[a]&65535)).toString(16),o+=a<7?":":""}return o},Cc=(n,o)=>{var a=Y[n>>>1>>>0],c=_ntohs(it[n+2>>>1>>>0]),l;switch(a){case 2:if(o!==16)return{errno:28};l=L[n+4>>>2>>>0],l=fa(l);break;case 10:if(o!==28)return{errno:28};l=[L[n+8>>>2>>>0],L[n+12>>>2>>>0],L[n+16>>>2>>>0],L[n+20>>>2>>>0]],l=Oc(l);break;default:return{errno:5}}return{family:a,addr:l,port:c}},bs=n=>{for(var o=n.split("."),a=0;a<4;a++){var c=Number(o[a]);if(isNaN(c))return null;o[a]=c}return(o[0]|o[1]<<8|o[2]<<16|o[3]<<24)>>>0},vs=n=>parseInt(n),pa=n=>{var o,a,c,l,u=/^((?=.*::)(?!.*::.+::)(::)?([\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,h=[];if(!u.test(n))return null;if(n==="::")return[0,0,0,0,0,0,0,0];for(n.startsWith("::")?n=n.replace("::","Z:"):n=n.replace("::",":Z:"),n.indexOf(".")>0?(n=n.replace(new RegExp("[.]","g"),":"),o=n.split(":"),o[o.length-4]=vs(o[o.length-4])+vs(o[o.length-3])*256,o[o.length-3]=vs(o[o.length-2])+vs(o[o.length-1])*256,o=o.slice(0,o.length-2)):o=n.split(":"),c=0,l=0,a=0;a<o.length;a++)if(typeof o[a]=="string")if(o[a]==="Z"){for(l=0;l<8-o.length+1;l++)h[a+l]=0;c=l-1}else h[a+c]=_htons(parseInt(o[a],16));else h[a+c]=o[a];return[h[1]<<16|h[0],h[3]<<16|h[2],h[5]<<16|h[4],h[7]<<16|h[6]]},_e={address_map:{id:1,addrs:{},names:{}},lookup_name(n){var o=bs(n);if(o!==null||(o=pa(n),o!==null))return n;var a;if(_e.address_map.addrs[n])a=_e.address_map.addrs[n];else{var c=_e.address_map.id++;O(c<65535,"exceeded max address mappings of 65535"),a="172.29."+(c&255)+"."+(c&65280),_e.address_map.names[a]=n,_e.address_map.addrs[n]=a}return a},lookup_addr(n){return _e.address_map.names[n]?_e.address_map.names[n]:null}},Mc=(n,o)=>{var a=Cc(n,o);if(a.errno)throw new da.ErrnoError(a.errno);return a.addr=_e.lookup_addr(a.addr)||a.addr,a};function Nh(n,o,a,c,l,u){o>>>=0,a>>>=0;var h=kr(n),f=Mc(o,a);return h.sock_ops.bind(h,f.addr,f.port),0}function Ph(n,o,a,c,l,u){o>>>=0,a>>>=0;var h=kr(n),f=Mc(o,a);return h.sock_ops.connect(h,f.addr,f.port),0}var Vh=(n,o,a)=>{};function Hh(n,o,a,c){o>>>=0}var Rc=typeof TextDecoder<"u"?new TextDecoder:void 0,Lc=(n,o=0,a=NaN)=>{o>>>=0;for(var c=o+a,l=o;n[l]&&!(l>=c);)++l;if(l-o>16&&n.buffer&&Rc)return Rc.decode(n.subarray(o,l));for(var u="";o<l;){var h=n[o++];if(!(h&128)){u+=String.fromCharCode(h);continue}var f=n[o++]&63;if((h&224)==192){u+=String.fromCharCode((h&31)<<6|f);continue}var p=n[o++]&63;if((h&240)==224?h=(h&15)<<12|f<<6|p:h=(h&7)<<18|f<<12|p<<6|n[o++]&63,h<65536)u+=String.fromCharCode(h);else{var y=h-65536;u+=String.fromCharCode(55296|y>>10,56320|y&1023)}}return u},jt=(n,o)=>(n>>>=0,n?Lc(k,n,o):""),_a={varargs:void 0,getStr(n){var o=jt(n);return o}};function zh(n,o,a){return a>>>=0,_a.varargs=a,0}function Wh(n,o){o>>>=0}function $h(n,o,a){var c=Hi(o,a)}var Nc=n=>{for(var o=0,a=0;a<n.length;++a){var c=n.charCodeAt(a);c<=127?o++:c<=2047?o+=2:c>=55296&&c<=57343?(o+=4,++a):o+=3}return o};s.lengthBytesUTF8=Nc;var Gh=(n,o,a,c)=>{if(a>>>=0,!(c>0))return 0;for(var l=a,u=a+c-1,h=0;h<n.length;++h){var f=n.charCodeAt(h);if(f>=55296&&f<=57343){var p=n.charCodeAt(++h);f=65536+((f&1023)<<10)|p&1023}if(f<=127){if(a>=u)break;o[a++>>>0]=f}else if(f<=2047){if(a+1>=u)break;o[a++>>>0]=192|f>>6,o[a++>>>0]=128|f&63}else if(f<=65535){if(a+2>=u)break;o[a++>>>0]=224|f>>12,o[a++>>>0]=128|f>>6&63,o[a++>>>0]=128|f&63}else{if(a+3>=u)break;o[a++>>>0]=240|f>>18,o[a++>>>0]=128|f>>12&63,o[a++>>>0]=128|f>>6&63,o[a++>>>0]=128|f&63}}return o[a>>>0]=0,a-l},zi=(n,o,a)=>Gh(n,k,o,a);s.stringToUTF8=zi;function Kh(n,o){n>>>=0,o>>>=0}function qh(n,o,a){o>>>=0,a>>>=0}var Pc=(n,o)=>{k.fill(0,n,n+o)},gs=(n,o,a,c,l)=>{switch(o){case 2:a=bs(a),Pc(n,16),l&&(L[l>>>2>>>0]=16),Y[n>>>1>>>0]=o,L[n+4>>>2>>>0]=a,Y[n+2>>>1>>>0]=_htons(c);break;case 10:a=pa(a),Pc(n,28),l&&(L[l>>>2>>>0]=28),L[n>>>2>>>0]=o,L[n+8>>>2>>>0]=a[0],L[n+12>>>2>>>0]=a[1],L[n+16>>>2>>>0]=a[2],L[n+20>>>2>>>0]=a[3],Y[n+2>>>1>>>0]=_htons(c);break;default:return 5}return 0};function Yh(n,o,a,c,l,u){o>>>=0,a>>>=0;var h=kr(n);if(!h.daddr)return-53;var f=gs(o,h.family,_e.lookup_name(h.daddr),h.dport,a);return 0}function Jh(n,o,a,c,l,u){o>>>=0,a>>>=0;var h=kr(n),f=gs(o,h.family,_e.lookup_name(h.saddr||"0.0.0.0"),h.sport,a);return 0}function Xh(n,o,a,c,l,u){c>>>=0,l>>>=0;var h=kr(n);return o===1&&a===4?(L[c>>>2>>>0]=h.error,L[l>>>2>>>0]=4,h.error=null,0):-50}function Zh(n,o,a){return a>>>=0,_a.varargs=a,0}function Qh(n,o){n>>>=0,o>>>=0}function td(n,o,a){o>>>=0}function ed(n,o,a,c){o>>>=0,a>>>=0}function id(n,o,a,c){o>>>=0,c>>>=0,_a.varargs=c}function rd(n,o,a){n>>>=0}function nd(n,o,a,c){o>>>=0,a>>>=0,c>>>=0}function sd(n,o,a,c,l,u){o>>>=0,a>>>=0,l>>>=0,u>>>=0;var h=kr(n),f=h.sock_ops.recvmsg(h,a);if(!f)return 0;if(l)var p=gs(l,h.family,_e.lookup_name(f.addr),f.port,u);return k.set(f.buffer,o>>>0),f.buffer.byteLength}function od(n,o,a,c){o>>>=0,c>>>=0}function ad(n){n>>>=0}function cd(n,o,a,c,l,u){o>>>=0,a>>>=0,l>>>=0,u>>>=0}var ld=(n,o,a)=>{};function ud(n,o){n>>>=0,o>>>=0}function hd(n,o,a){n>>>=0,o>>>=0,a>>>=0}function dd(n,o,a){o>>>=0}var fd=()=>ke(""),pd=()=>{throw 1/0};function Vc(){ke("missing function: _emval_call_method")}Vc.stub=!0;function Hc(){ke("missing function: _emval_decref")}Hc.stub=!0;function zc(){ke("missing function: _emval_get_global")}zc.stub=!0;function Wc(){ke("missing function: _emval_get_method_caller")}Wc.stub=!0;function $c(){ke("missing function: _emval_run_destructors")}$c.stub=!0;var _d=n=>n%4===0&&(n%100!==0||n%400===0),yd=[0,31,60,91,121,152,182,213,244,274,305,335],md=[0,31,59,90,120,151,181,212,243,273,304,334],bd=n=>{var o=_d(n.getFullYear()),a=o?yd:md,c=a[n.getMonth()]+n.getDate()-1;return c};function vd(n,o,a){var c=Hi(n,o);a>>>=0;var l=new Date(c*1e3);L[a>>>2>>>0]=l.getSeconds(),L[a+4>>>2>>>0]=l.getMinutes(),L[a+8>>>2>>>0]=l.getHours(),L[a+12>>>2>>>0]=l.getDate(),L[a+16>>>2>>>0]=l.getMonth(),L[a+20>>>2>>>0]=l.getFullYear()-1900,L[a+24>>>2>>>0]=l.getDay();var u=bd(l)|0;L[a+28>>>2>>>0]=u,L[a+36>>>2>>>0]=-(l.getTimezoneOffset()*60);var h=new Date(l.getFullYear(),0,1),f=new Date(l.getFullYear(),6,1).getTimezoneOffset(),p=h.getTimezoneOffset(),y=(f!=p&&l.getTimezoneOffset()==Math.min(p,f))|0;L[a+32>>>2>>>0]=y}function gd(n,o,a,c,l,u,h,f){n>>>=0;var p=Hi(l,u);return h>>>=0,f>>>=0,-52}function wd(n,o,a,c,l,u,h){n>>>=0,o>>>=0;var f=Hi(u,h)}var Sd=function(n,o,a,c){n>>>=0,o>>>=0,a>>>=0,c>>>=0;var l=new Date().getFullYear(),u=new Date(l,0,1),h=new Date(l,6,1),f=u.getTimezoneOffset(),p=h.getTimezoneOffset(),y=Math.max(f,p);mt[n>>>2>>>0]=y*60,L[o>>>2>>>0]=+(f!=p);var m=D=>{var F=D>=0?"-":"+",A=Math.abs(D),G=String(Math.floor(A/60)).padStart(2,"0"),gt=String(A%60).padStart(2,"0");return"UTC".concat(F).concat(G).concat(gt)},v=m(f),T=m(p);p<f?(zi(v,a,17),zi(T,c,17)):(zi(v,c,17),zi(T,a,17))},Gc=()=>performance.now(),Kc=()=>Date.now(),Id=1,Td=n=>n>=0&&n<=3;function jd(n,o,a,c){var l=Hi(o,a);if(c>>>=0,!Td(n))return 28;var u;if(n===0)u=Kc();else if(Id)u=Gc();else return 52;var h=Math.round(u*1e3*1e3);return di=[h>>>0,(Qt=h,+Math.abs(Qt)>=1?Qt>0?+Math.floor(Qt/4294967296)>>>0:~~+Math.ceil((Qt-+(~~Qt>>>0))/4294967296)>>>0:0)],L[c>>>2>>>0]=di[0],L[c+4>>>2>>>0]=di[1],0}function Bd(n,o){return n>>>=0,globalThis.DUCKDB_RUNTIME.createDirectory(s,n,o)}function Dd(n,o){return n>>>=0,globalThis.DUCKDB_RUNTIME.checkDirectory(s,n,o)}function Fd(n,o){return n>>>=0,globalThis.DUCKDB_RUNTIME.listDirectoryEntries(s,n,o)}function Ad(n,o){return n>>>=0,globalThis.DUCKDB_RUNTIME.removeDirectory(s,n,o)}function xd(n){return globalThis.DUCKDB_RUNTIME.closeFile(s,n)}function kd(n,o){return n>>>=0,globalThis.DUCKDB_RUNTIME.dropFile(s,n,o)}function Ed(n,o){return n>>>=0,globalThis.DUCKDB_RUNTIME.checkFile(s,n,o)}function Ud(n,o,a,c){return n>>>=0,a>>>=0,globalThis.DUCKDB_RUNTIME.moveFile(s,n,o,a,c)}function Od(n,o){return globalThis.DUCKDB_RUNTIME.openFile(s,n,o)}function Cd(n,o,a,c){return o>>>=0,globalThis.DUCKDB_RUNTIME.readFile(s,n,o,a,c)}function Md(n,o){return globalThis.DUCKDB_RUNTIME.truncateFile(s,n,o)}function Rd(n,o,a,c){return o>>>=0,globalThis.DUCKDB_RUNTIME.writeFile(s,n,o,a,c)}function Ld(n){return globalThis.DUCKDB_RUNTIME.getDefaultDataProtocol(n)}function Nd(n,o){return n>>>=0,globalThis.DUCKDB_RUNTIME.glob(s,n,o)}function Pd(n){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(s,n)}function Vd(n,o,a,c,l,u){return n>>>=0,a>>>=0,l>>>=0,globalThis.DUCKDB_RUNTIME.callScalarUDF(s,n,o,a,c,l,u)}var ya=[],Hd=(n,o)=>{ya.length=0;for(var a;a=k[n++>>>0];){var c=a!=105;c&=a!=112,o+=c&&o%8?4:0,ya.push(a==112?mt[o>>>2>>>0]:a==105?L[o>>>2>>>0]:St[o>>>3>>>0]),o+=c?8:4}return ya},zd=(n,o,a)=>{var c=Hd(o,a);return Th[n](...c)};function Wd(n,o,a){return n>>>=0,o>>>=0,a>>>=0,zd(n,o,a)}var qc=()=>4294901760;function $d(){return qc()}var Gd=(n,o)=>Math.ceil(n/o)*o,Kd=n=>{var o=K.buffer,a=(n-o.byteLength+65535)/65536|0;try{return K.grow(a),Pi(),1}catch(c){}};function qd(n){n>>>=0;var o=k.length,a=qc();if(n>a)return!1;for(var c=1;c<=4;c*=2){var l=o*(1+.2/c);l=Math.min(l,n+100663296);var u=Math.min(a,Gd(Math.max(n,l),65536)),h=Kd(u);if(h)return!0}return!1}var ma={},Yd=()=>R||"./this.program",pn=()=>{if(!pn.strings){var n=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",o={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:n,_:Yd()};for(var a in ma)ma[a]===void 0?delete o[a]:o[a]=ma[a];var c=[];for(var a in o)c.push("".concat(a,"=").concat(o[a]));pn.strings=c}return pn.strings},Jd=(n,o)=>{for(var a=0;a<n.length;++a)q[o++>>>0]=n.charCodeAt(a);q[o>>>0]=0},Xd=function(n,o){n>>>=0,o>>>=0;var a=0;return pn().forEach((c,l)=>{var u=o+a;mt[n+l*4>>>2>>>0]=u,Jd(c,u),a+=c.length+1}),0},Zd=function(n,o){n>>>=0,o>>>=0;var a=pn();mt[n>>>2>>>0]=a.length;var c=0;return a.forEach(l=>c+=l.length+1),mt[o>>>2>>>0]=c,0},Qd=0,tf=()=>Dh||Qd>0,ef=n=>{var o;H=n,tf()||((o=s.onExit)==null||o.call(s,n),E=!0),ft(n,new Fc(n))},Yc=(n,o)=>{H=n,ef(n)},rf=Yc,nf=n=>52;function sf(n,o){o>>>=0;var a=0,c=0,l=0;{var u=2;n==0?a=2:(n==1||n==2)&&(a=64),l=1}return q[o>>>0]=u,Y[o+2>>>1>>>0]=l,di=[a>>>0,(Qt=a,+Math.abs(Qt)>=1?Qt>0?+Math.floor(Qt/4294967296)>>>0:~~+Math.ceil((Qt-+(~~Qt>>>0))/4294967296)>>>0:0)],L[o+8>>>2>>>0]=di[0],L[o+12>>>2>>>0]=di[1],di=[c>>>0,(Qt=c,+Math.abs(Qt)>=1?Qt>0?+Math.floor(Qt/4294967296)>>>0:~~+Math.ceil((Qt-+(~~Qt>>>0))/4294967296)>>>0:0)],L[o+16>>>2>>>0]=di[0],L[o+20>>>2>>>0]=di[1],0}function of(n,o,a,c,l,u){o>>>=0,a>>>=0;var h=Hi(c,l);return u>>>=0,52}function af(n,o,a,c,l,u){o>>>=0,a>>>=0;var h=Hi(c,l);return u>>>=0,52}function cf(n,o,a,c){return o>>>=0,a>>>=0,c>>>=0,52}function lf(n,o,a,c,l){var u=Hi(o,a);return l>>>=0,70}var uf=n=>52,hf=[null,[],[]],df=(n,o)=>{var a=hf[n];o===0||o===10?((n===1?Zt:x)(Lc(a)),a.length=0):a.push(o)};function ff(n,o,a,c){o>>>=0,a>>>=0,c>>>=0;for(var l=0,u=0;u<a;u++){var h=mt[o>>>2>>>0],f=mt[o+4>>>2>>>0];o+=8;for(var p=0;p<f;p++)df(n,k[h+p>>>0]);l+=f}return mt[c>>>2>>>0]=l,0}function pf(n,o,a,c){n>>>=0,o>>>=0,a>>>=0,c>>>=0;var l=0,u=0,h=0,f=0,p=0,y=0,m;function v(T,D,F,A,G,gt){var ut,Vt,$t,ti;return Vt=T===10?28:16,G=T===10?Oc(G):fa(G),ut=Wi(Vt),ti=gs(ut,T,G,gt),O(!ti),$t=Wi(32),L[$t+4>>>2>>>0]=T,L[$t+8>>>2>>>0]=D,L[$t+12>>>2>>>0]=F,mt[$t+24>>>2>>>0]=A,mt[$t+20>>>2>>>0]=ut,T===10?L[$t+16>>>2>>>0]=28:L[$t+16>>>2>>>0]=16,L[$t+28>>>2>>>0]=0,$t}if(a&&(h=L[a>>>2>>>0],f=L[a+4>>>2>>>0],p=L[a+8>>>2>>>0],y=L[a+12>>>2>>>0]),p&&!y&&(y=p===2?17:6),!p&&y&&(p=y===17?2:1),y===0&&(y=6),p===0&&(p=1),!n&&!o)return-2;if(h&-1088||a!==0&&L[a>>>2>>>0]&2&&!n)return-1;if(h&32)return-2;if(p!==0&&p!==1&&p!==2)return-7;if(f!==0&&f!==2&&f!==10)return-6;if(o&&(o=jt(o),u=parseInt(o,10),isNaN(u)))return h&1024?-2:-8;if(!n)return f===0&&(f=2),h&1||(f===2?l=_htonl(2130706433):l=[0,0,0,_htonl(1)]),m=v(f,p,y,null,l,u),mt[c>>>2>>>0]=m,0;if(n=jt(n),l=bs(n),l!==null)if(f===0||f===2)f=2;else if(f===10&&h&8)l=[0,0,_htonl(65535),l],f=10;else return-2;else if(l=pa(n),l!==null)if(f===0||f===10)f=10;else return-2;return l!=null?(m=v(f,p,y,n,l,u),mt[c>>>2>>>0]=m,0):h&4?-2:(n=_e.lookup_name(n),l=bs(n),f===0?f=2:f===10&&(l=[0,0,_htonl(65535),l]),m=v(f,p,y,null,l,u),mt[c>>>2>>>0]=m,0)}function _f(n,o,a,c,l,u,h){n>>>=0,a>>>=0,l>>>=0;var f=Cc(n,o);if(f.errno)return-6;var p=f.port,y=f.addr,m=!1;if(a&&c){var v;if(h&1||!(v=_e.lookup_addr(y))){if(h&8)return-2}else y=v;var T=zi(y,a,c);T+1>=c&&(m=!0)}if(l&&u){p=""+p;var T=zi(p,l,u);T+1>=u&&(m=!0)}return m?-12:0}function yf(n){return n>>>=0,n}var mf=()=>{if(B){var n=["crypto"].map(Zc).pop();return o=>n.randomFillSync(o)}return o=>crypto.getRandomValues(o)},Jc=n=>{(Jc=mf())(n)};function bf(n,o){return n>>>=0,o>>>=0,Jc(k.subarray(n>>>0,n+o>>>0)),0}var vf=n=>{if(n instanceof Fc||n=="unwind")return H;ft(1,n)},ws=[],Xc,M=n=>{var o=ws[n];return o||(n>=ws.length&&(ws.length=n+1),ws[n]=o=Xc.get(n)),o},gf=n=>{var o=s["_"+n];return o},wf=(n,o)=>{q.set(n,o>>>0)},Ss=n=>xf(n);s.stackAlloc=Ss;var Sf=n=>{var o=Nc(n)+1,a=Ss(o);return zi(n,a,o),a},If=(n,o,a,c,l)=>{var u={string:F=>{var A=0;return F!=null&&F!==0&&(A=Sf(F)),A},array:F=>{var A=Ss(F.length);return wf(F,A),A}};function h(F){return o==="string"?jt(F):o==="boolean"?!!F:F}var f=gf(n),p=[],y=0;if(c)for(var m=0;m<c.length;m++){var v=u[a[m]];v?(y===0&&(y=S()),p[m]=v(c[m])):p[m]=c[m]}var T=f(...p);function D(F){return y!==0&&w(y),h(F)}return T=D(T),T},Tf=n=>Ff(),jf={q:Fh,Sb:Ah,u:xh,a:Eh,k:Uh,B:Oh,ka:Ch,Ma:Ec,Hb:Mh,s:Rh,K:Lh,c:kh,fb:Nh,kb:Ph,Kg:Vh,mh:Hh,aa:zh,lh:Wh,Zb:$h,nh:Kh,gh:qh,eb:Yh,db:Jh,ib:Xh,xa:Zh,ih:Qh,hh:td,jh:ed,Ka:id,jb:rd,dh:nd,gb:sd,eh:od,Za:ad,hb:cd,Ja:ld,kh:ud,oh:hd,_a:dd,sh:fd,Lg:pd,Hg:Vc,Fg:Hc,Jg:zc,Ig:Wc,Gg:$c,cc:vd,Pc:gd,Qc:wd,hd:Sd,og:jd,Xg:Bd,Yg:Dd,Vg:Fd,Wg:Ad,Wa:xd,$g:kd,Tg:Ed,Ug:Ud,_g:Od,sa:Cd,Zg:Md,Xa:Rd,ah:Ld,Sg:Nd,Va:Pd,bh:Vd,oa:Wd,Ua:Kc,lb:$d,Ca:Gc,th:qd,Md:Xd,Xd:Zd,Y:rf,la:nf,mf:sf,$b:of,_b:af,Na:cf,Cg:lf,fh:uf,ya:ff,Ia:pf,Ha:_f,P:Zp,I:Dp,ea:Mp,D:cp,Ga:bp,_:wp,Ta:Xp,ma:Hf,Pa:a_,ga:Tp,ba:Ap,Qa:i_,T:xp,pc:gb,jc:Bb,Hf:cy,qb:fv,Ic:eb,Pd:Zm,hc:Fb,ic:Db,V:_p,Oa:Vf,ta:Jp,qc:vb,If:ay,p:qf,E:fp,ph:Hp,rh:Np,S:Ep,fa:lp,wa:Pp,R:dp,qh:Vp,$a:Lp,Z:Rp,d:Of,N:Op,G:Cp,Ya:Wp,C:vp,pa:$p,ja:Gp,xc:db,Da:zp,na:Kp,b:Mf,Ba:s_,xd:_0,Ue:qy,g:Rf,ab:kp,Aa:c_,za:l_,j:Pf,La:ep,Qg:r_,ia:o_,o:Lf,bb:jp,v:Jf,w:$f,H:ap,Q:op,X:Gf,ha:Xf,r:Kf,A:rp,Og:u_,U:mp,x:yp,tb:uv,Nd:t0,wd:y0,Ge:cm,ud:b0,yd:p0,Id:n0,Ud:Km,vd:m0,vb:cv,ce:Lm,Hd:s0,zd:f0,Yd:Wm,He:am,Vd:Gm,_d:Hm,Ld:e0,Te:Yy,qf:jy,Lf:ny,te:wm,we:bm,fd:E0,Ag:y_,of:Dy,Mf:ry,Gf:ly,nf:Fy,Ae:pm,zg:m_,td:v0,sd:g0,ke:xm,qg:B_,rf:Ty,ze:_m,re:Im,fe:Cm,rd:w0,qd:S0,ld:D0,Rc:q0,Re:Xy,Jd:r0,Wd:$m,Vf:q_,pg:D_,kg:k_,Ef:hy,Uf:Y_,sb:hv,Ib:Jb,Fb:Zb,Wc:z0,Qb:Hb,Tb:Pb,Pb:zb,ng:F_,wf:vy,vf:gy,Ke:nm,se:Sm,pb:pv,tc:yb,Kb:qb,vg:w_,ub:lv,ue:gm,lg:x_,Tf:J_,Wf:K_,Pe:Qy,De:hm,Jc:tb,kd:F0,Gb:Xb,Jb:Yb,Nf:iy,$c:L0,hg:O_,Oe:tm,Mc:X0,yc:hb,Ne:em,Le:rm,uc:_b,vc:pb,rc:bb,Rf:Z_,bg:P_,ve:vm,lc:Tb,dd:O0,Df:dy,Je:sm,xf:by,Ve:Gy,We:$y,wg:g_,tg:I_,Qf:Q_,Eg:f_,Qe:Zy,lf:Ay,Ed:c0,wc:fb,Ye:zy,zc:ub,Gd:o0,Xe:Wy,Bd:h0,Bc:cb,Ec:sb,Tc:G0,kf:xy,df:My,Sd:Ym,Td:qm,Fc:nb,$e:Py,xe:mm,hf:Ey,Jf:oy,Bf:py,Xb:Mb,Ac:lb,Yb:Cb,cf:Ry,Ad:d0,Cc:ab,yf:my,Oc:Y0,Db:tv,le:Am,Xc:H0,zb:nv,mb:mv,Qd:Xm,Eb:Qb,nb:yv,sg:T_,ad:R0,mc:Ib,ob:_v,bd:M0,gc:Ab,Gc:rb,Yc:V0,sc:mb,l:Ef,Ng:h_,Rg:Qp,Sa:t_,h:Cf,F:sp,Ea:Fp,J:Sp,ua:Yp,Ra:e_,Mg:d_,W:np,M:Bp,va:qp,e:Uf,ra:Wf,cb:Ip,f:Nf,Pg:n_,i:zf,m:ip,n:tp,y:Yf,t:up,O:pp,L:Zf,$:hp,Fa:gp,ca:Up,qa:Qf,fg:M_,jf:ky,pf:By,Hc:ib,Nc:J0,me:Fm,zf:yy,Be:fm,Ie:om,sf:Iy,Zc:P0,af:Ny,he:Um,Vb:Lb,ug:S_,Af:_y,Cd:u0,Nb:$b,dc:Eb,ec:kb,_c:N0,gd:k0,qe:Tm,Kd:i0,Sc:K0,Zd:zm,be:Nm,Cb:ev,gg:C_,yg:b_,da:Ky,rb:dv,Pf:ty,tf:Sy,uf:wy,Dc:ob,bc:Ub,ae:Pm,ef:Cy,ne:Dm,ge:Om,Rd:Jm,ie:Em,Ob:Wb,_f:z_,Vc:W0,Uc:$0,Dd:l0,ag:V_,wb:av,cg:N_,od:T0,xg:v_,Kc:Q0,Yf:$_,Bg:__,ig:U_,ed:U0,Kf:sy,pe:jm,oe:Bm,Rb:Vb,Ub:Nb,id:x0,eg:R_,Mb:Gb,$d:Vm,md:B0,pd:I0,bf:Ly,Dg:p_,je:km,Fd:a0,jd:A0,Zf:W_,$f:H_,Bb:iv,nd:j0,Ab:rv,rg:j_,jg:E_,Xf:G_,Me:im,mg:A_,Fe:lm,Ee:um,ye:ym,yb:sv,xb:ov,Lb:Kb,de:Rm,Sf:X_,kc:jb,oc:wb,dg:L_,Od:Qm,Wb:Rb,Se:Jy,_e:Vy,ee:Mm,nc:Sb,Of:ey,Ze:Hy,Ff:uy,ac:Ob,cd:C0,Cf:fy,Ce:dm,fc:xb,Lc:Z0,gf:Uy,ff:Oy,z:yf,ch:bf},$=await Ih(),Bf=s._main=$.wh,rS=s._duckdb_web_fs_glob_add_path=$.yh,nS=s._duckdb_web_clear_response=$.zh,sS=s._duckdb_web_fail_with=$.Ah,oS=s._duckdb_web_reset=$.Bh,aS=s._duckdb_web_connect=$.Ch,cS=s._duckdb_web_disconnect=$.Dh,lS=s._duckdb_web_flush_files=$.Eh,uS=s._duckdb_web_flush_file=$.Fh,hS=s._duckdb_web_open=$.Gh,dS=s._duckdb_web_get_global_file_info=$.Hh,fS=s._duckdb_web_collect_file_stats=$.Ih,pS=s._duckdb_web_export_file_stats=$.Jh,_S=s._duckdb_web_fs_drop_file=$.Kh,yS=s._duckdb_web_fs_drop_files=$.Lh,mS=s._duckdb_web_fs_glob_file_infos=$.Mh,bS=s._duckdb_web_fs_get_file_info_by_id=$.Nh,vS=s._duckdb_web_fs_get_file_info_by_name=$.Oh,gS=s._duckdb_web_fs_register_file_url=$.Ph,wS=s._duckdb_web_fs_register_file_buffer=$.Qh,SS=s._duckdb_web_copy_file_to_buffer=$.Rh,IS=s._duckdb_web_copy_file_to_path=$.Sh,TS=s._duckdb_web_get_version=$.Th,jS=s._duckdb_web_get_feature_flags=$.Uh,BS=s._duckdb_web_tokenize=$.Vh,DS=s._duckdb_web_tokenize_buffer=$.Wh,FS=s._duckdb_web_udf_scalar_create=$.Xh,AS=s._duckdb_web_prepared_create=$.Yh,xS=s._duckdb_web_prepared_create_buffer=$.Zh,kS=s._duckdb_web_prepared_close=$._h,ES=s._duckdb_web_prepared_run=$.$h,US=s._duckdb_web_prepared_send=$.ai,OS=s._duckdb_web_query_run=$.bi,CS=s._duckdb_web_query_run_buffer=$.ci,MS=s._duckdb_web_pending_query_start=$.di,RS=s._duckdb_web_pending_query_start_buffer=$.ei,LS=s._duckdb_web_pending_query_poll=$.fi,NS=s._duckdb_web_pending_query_cancel=$.gi,PS=s._duckdb_web_query_fetch_results=$.hi,VS=s._duckdb_web_get_tablenames=$.ii,HS=s._duckdb_web_get_tablenames_buffer=$.ji,zS=s._duckdb_web_insert_arrow_from_ipc_stream=$.ki,WS=s._duckdb_web_insert_csv_from_path=$.li,$S=s._duckdb_web_insert_json_from_path=$.mi,Wi=s._malloc=$.qi,GS=s._free=$.ri,KS=s._calloc=$.si,Df=$.ui,Ff=$.vi,Af=$.wi,xf=$.xi,kf=$.yi;function Ef(n){var o=S();try{M(n)()}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Uf(n,o,a){var c=S();try{M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Of(n,o){var a=S();try{return M(n)(o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function Cf(n,o){var a=S();try{M(n)(o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function Mf(n,o,a){var c=S();try{return M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Rf(n,o,a,c){var l=S();try{return M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Lf(n,o,a,c,l,u){var h=S();try{return M(n)(o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function Nf(n,o,a,c){var l=S();try{M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Pf(n,o,a,c,l){var u=S();try{return M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function Vf(n,o,a,c){var l=S();try{return M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Hf(n,o,a,c){var l=S();try{return M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function zf(n,o,a,c,l){var u=S();try{M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function Wf(n,o,a,c){var l=S();try{M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function $f(n,o,a,c,l,u,h,f){var p=S();try{return M(n)(o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Gf(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return M(n)(o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Kf(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{return M(n)(o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function qf(n){var o=S();try{return M(n)()}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Yf(n,o,a,c,l,u,h,f){var p=S();try{M(n)(o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Jf(n,o,a,c,l,u,h){var f=S();try{return M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function Xf(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return M(n)(o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function Zf(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{M(n)(o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Qf(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A){var G=S();try{M(n)(o,a,c,l,u,h,f,p,y,m,v,T,D,F,A)}catch(gt){if(w(G),gt!==gt+0)throw gt;_setThrew(1,0)}}function tp(n,o,a,c,l,u,h){var f=S();try{M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function ep(n,o,a,c,l,u){var h=S();try{return M(n)(o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function ip(n,o,a,c,l,u){var h=S();try{M(n)(o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function rp(n,o,a,c,l,u,h,f,p,y,m,v,T,D){var F=S();try{return M(n)(o,a,c,l,u,h,f,p,y,m,v,T,D)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function np(n,o,a){var c=S();try{M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function sp(n,o,a){var c=S();try{M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function op(n,o,a,c,l,u,h,f,p,y){var m=S();try{return M(n)(o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function ap(n,o,a,c,l,u,h,f,p){var y=S();try{return M(n)(o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function cp(n,o){var a=S();try{return M(n)(o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function lp(n,o,a,c,l){var u=S();try{return M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function up(n,o,a,c,l,u,h,f,p){var y=S();try{M(n)(o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function hp(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{M(n)(o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function dp(n,o){var a=S();try{return M(n)(o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function fp(n,o){var a=S();try{return M(n)(o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function pp(n,o,a,c,l,u,h,f,p,y){var m=S();try{M(n)(o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function _p(n,o){var a=S();try{return M(n)(o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function yp(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt){var ut=S();try{return M(n)(o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt)}catch(Vt){if(w(ut),Vt!==Vt+0)throw Vt;_setThrew(1,0)}}function mp(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G){var gt=S();try{return M(n)(o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G)}catch(ut){if(w(gt),ut!==ut+0)throw ut;_setThrew(1,0)}}function bp(n,o,a,c){var l=S();try{return M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function vp(n,o,a,c,l){var u=S();try{return M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function gp(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{M(n)(o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function wp(n,o,a){var c=S();try{return M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Sp(n,o,a,c){var l=S();try{M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Ip(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{M(n)(o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Tp(n,o,a,c,l){var u=S();try{return M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function jp(n,o,a,c,l,u,h){var f=S();try{return M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function Bp(n,o,a,c){var l=S();try{M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Dp(n,o){var a=S();try{return M(n)(o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function Fp(n,o,a,c,l,u,h){var f=S();try{M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function Ap(n,o,a,c,l,u){var h=S();try{return M(n)(o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function xp(n,o,a,c,l,u,h){var f=S();try{return M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function kp(n,o,a,c,l){var u=S();try{return M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function Ep(n,o,a,c){var l=S();try{return M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Up(n,o,a,c,l,u,h,f,p,y,m,v,T,D){var F=S();try{M(n)(o,a,c,l,u,h,f,p,y,m,v,T,D)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function Op(n,o,a){var c=S();try{return M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Cp(n,o,a,c){var l=S();try{return M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Mp(n,o){var a=S();try{return M(n)(o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function Rp(n,o,a,c){var l=S();try{return M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Lp(n,o,a){var c=S();try{return M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Np(n,o,a){var c=S();try{return M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Pp(n,o,a,c,l,u){var h=S();try{return M(n)(o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function Vp(n,o,a){var c=S();try{return M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Hp(n,o,a){var c=S();try{return M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function zp(n,o,a){var c=S();try{return M(n)(o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Wp(n,o,a,c){var l=S();try{return M(n)(o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function $p(n,o,a,c,l,u){var h=S();try{return M(n)(o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function Gp(n,o,a,c,l,u,h){var f=S();try{return M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function Kp(n,o,a,c,l){var u=S();try{return M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function qp(n,o,a,c,l){var u=S();try{M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function Yp(n,o,a,c,l){var u=S();try{M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function Jp(n,o,a,c,l){var u=S();try{return M(n)(o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function Xp(n,o,a,c,l,u,h){var f=S();try{return M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function Zp(n){var o=S();try{return M(n)()}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Qp(n,o,a,c,l,u,h){var f=S();try{M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function t_(n,o,a,c,l,u,h,f){var p=S();try{M(n)(o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function e_(n,o,a,c,l,u,h){var f=S();try{M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function i_(n,o,a,c,l,u){var h=S();try{return M(n)(o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function r_(n,o,a,c,l,u,h){var f=S();try{return M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function n_(n,o,a,c,l,u){var h=S();try{M(n)(o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function s_(n,o,a,c,l,u,h){var f=S();try{return M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function o_(n,o,a,c,l,u,h,f){var p=S();try{return M(n)(o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function a_(n,o,a,c,l,u,h,f,p,y){var m=S();try{return M(n)(o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function c_(n,o,a,c,l,u,h,f,p){var y=S();try{return M(n)(o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function l_(n,o,a,c,l,u,h){var f=S();try{return M(n)(o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function u_(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A){var G=S();try{return M(n)(o,a,c,l,u,h,f,p,y,m,v,T,D,F,A)}catch(gt){if(w(G),gt!==gt+0)throw gt;_setThrew(1,0)}}function h_(n,o,a,c,l,u){var h=S();try{M(n)(o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function d_(n,o,a,c,l,u,h,f){var p=S();try{M(n)(o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function f_(n,o,a,c,l){var u=S();try{return dynCall_jiiii(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function p_(n,o,a,c,l,u,h){var f=S();try{dynCall_viijj(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function __(n,o,a,c,l,u,h){var f=S();try{dynCall_viijii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function y_(n,o,a,c,l,u,h){var f=S();try{return dynCall_iiiiij(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function m_(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iiiiijj(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function b_(n,o,a,c,l,u){var h=S();try{dynCall_viiij(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function v_(n,o,a,c,l){var u=S();try{dynCall_viij(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function g_(n,o){var a=S();try{return dynCall_ji(n,o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function w_(n,o,a,c){var l=S();try{return dynCall_iij(n,o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function S_(n,o,a,c,l,u,h){var f=S();try{dynCall_viiiij(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function I_(n,o,a){var c=S();try{return dynCall_jii(n,o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function T_(n,o,a){var c=S();try{return dynCall_jj(n,o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function j_(n,o,a,c){var l=S();try{dynCall_vij(n,o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function B_(n,o,a,c,l,u){var h=S();try{return dynCall_iiiij(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function D_(n,o,a,c,l){var u=S();try{return dynCall_iiij(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function F_(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iiijij(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function A_(n,o,a,c,l,u,h,f){var p=S();try{dynCall_vijiiii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function x_(n,o,a,c,l){var u=S();try{return dynCall_iiji(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function k_(n,o,a,c,l,u){var h=S();try{return dynCall_iiiji(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function E_(n,o,a,c,l){var u=S();try{dynCall_viji(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function U_(n,o,a,c,l,u,h,f){var p=S();try{dynCall_viijiii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function O_(n,o,a,c,l,u){var h=S();try{return dynCall_iijj(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function C_(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viiiijjjii(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function M_(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiiiiiij(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function R_(n,o,a,c,l,u,h,f){var p=S();try{dynCall_viijij(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function L_(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_vijijj(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function N_(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viiijjjj(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function P_(n,o,a,c){var l=S();try{return dynCall_iji(n,o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function V_(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiijjj(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function H_(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viijjji(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function z_(n,o,a,c,l,u,h,f){var p=S();try{dynCall_viiijj(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function W_(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viijjj(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function $_(n,o,a,c,l,u){var h=S();try{dynCall_viiji(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function G_(n,o,a,c,l,u){var h=S();try{dynCall_vijii(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function K_(n,o,a,c,l,u,h){var f=S();try{return dynCall_iijiii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function q_(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiiijjj(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Y_(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iiijiii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function J_(n,o,a,c,l,u){var h=S();try{return dynCall_iijii(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function X_(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_vijiiji(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Z_(n,o,a){var c=S();try{return dynCall_ij(n,o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Q_(n,o,a,c){var l=S();try{return dynCall_jiii(n,o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function ty(n,o,a,c,l,u,h){var f=S();try{dynCall_viiiji(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function ey(n,o,a,c,l,u,h,f){var p=S();try{dynCall_vijjj(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function iy(n,o,a,c,l,u,h){var f=S();try{return dynCall_iijij(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function ry(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iiiiijii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function ny(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiiiiijii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function sy(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viijiiiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function oy(n,o,a,c,l,u){var h=S();try{return dynCall_jiiji(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function ay(n,o,a,c,l,u){var h=S();try{return dynCall_fiiji(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function cy(n,o,a,c,l,u){var h=S();try{return dynCall_diiji(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function ly(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiiiijiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function uy(n,o,a){var c=S();try{dynCall_vj(n,o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function hy(n,o,a,c,l,u,h){var f=S();try{return dynCall_iiijii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function dy(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_ijjiii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function fy(n,o,a,c,l,u,h){var f=S();try{dynCall_vjiiii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function py(n,o,a,c,l,u,h){var f=S();try{return dynCall_jiijii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function _y(n,o,a,c,l,u,h,f){var p=S();try{dynCall_viiiiji(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function yy(n,o,a,c,l,u,h,f){var p=S();try{dynCall_viiiiij(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function my(n,o,a,c){var l=S();try{return dynCall_jij(n,o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function by(n){var o=S();try{return dynCall_j(n)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function vy(n,o,a,c,l,u,h){var f=S();try{return dynCall_iiijj(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function gy(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iiijji(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function wy(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viiijiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Sy(n,o,a,c,l,u,h,f){var p=S();try{dynCall_viiijii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Iy(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_viiiiijiii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Ty(n,o,a,c,l,u,h){var f=S();try{return dynCall_iiiiji(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function jy(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iiiiiiji(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function By(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viiiiiij(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Dy(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iiiiiji(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Fy(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiiiijiiii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Ay(n,o,a,c,l,u,h){var f=S();try{return dynCall_jiiiiii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function xy(n,o,a,c,l,u){var h=S();try{return dynCall_jiiij(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function ky(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viiiiiiijij(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function Ey(n,o,a,c,l){var u=S();try{return dynCall_jiij(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function Uy(n,o,a,c,l,u,h){var f=S();try{dynCall_vjjii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function Oy(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_vjjijij(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Cy(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viiijiijij(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function My(n,o,a,c,l,u,h){var f=S();try{return dynCall_jiiiji(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function Ry(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_jiijiij(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Ly(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viijijj(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Ny(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_viiiiijij(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Py(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_jiiijij(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Vy(n,o,a,c,l,u,h){var f=S();try{dynCall_vijji(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function Hy(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_vijjji(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function zy(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_jiiiiiji(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Wy(n,o,a,c,l,u,h){var f=S();try{return dynCall_jiiiij(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function $y(n,o){var a=S();try{return dynCall_jf(n,o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function Gy(n,o){var a=S();try{return dynCall_jd(n,o)}catch(c){if(w(a),c!==c+0)throw c;_setThrew(1,0)}}function Ky(n,o,a,c,l,u,h){var f=S();try{dynCall_viiijd(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function qy(n,o,a,c,l,u){var h=S();try{return dynCall_iiifj(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function Yy(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iiiiiij(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Jy(n,o,a,c,l,u){var h=S();try{dynCall_vijj(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function Xy(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iiiijj(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Zy(n,o,a,c,l,u){var h=S();try{return dynCall_jiiiii(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function Qy(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iijiiii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function tm(n,o,a,c,l,u,h){var f=S();try{return dynCall_iijji(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function em(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iijjiiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function im(n,o,a,c,l,u,h){var f=S();try{dynCall_vijiii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function rm(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iijjiiiii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function nm(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiijjiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function sm(n,o,a,c,l,u,h){var f=S();try{return dynCall_ijjj(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function om(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiiiijii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function am(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt,ut,Vt,$t,ti){var va=S();try{return dynCall_iiiiiiiijjjjjjii(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt,ut,Vt,$t,ti)}catch(lr){if(w(va),lr!==lr+0)throw lr;_setThrew(1,0)}}function cm(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iiiiiiiiiij(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function lm(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_vijiiiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function um(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_vijiiiiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function hm(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iijiiiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function dm(n,o,a,c,l,u,h,f){var p=S();try{dynCall_vjiiij(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function fm(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viiiiiji(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function pm(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iiiiijiiiii(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function _m(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iiiijii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function ym(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_vijiiiiiii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function mm(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_jiiijj(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function bm(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiiiiijji(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function vm(n,o,a,c,l){var u=S();try{return dynCall_ijii(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function gm(n,o,a,c,l){var u=S();try{return dynCall_iijf(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function wm(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G){var gt=S();try{return dynCall_iiiiiijiijjji(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G)}catch(ut){if(w(gt),ut!==ut+0)throw ut;_setThrew(1,0)}}function Sm(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{return dynCall_iiijjijiii(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function Im(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iiiijiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Tm(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiiijij(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function jm(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_viijiiiiii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Bm(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viijiiij(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Dm(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viiijiijj(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function Fm(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viiiiiijjj(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function Am(n,o,a,c,l,u,h){var f=S();try{return dynCall_jijij(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function xm(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiiiijjj(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function km(n,o,a,c,l,u,h,f){var p=S();try{dynCall_viijji(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Em(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_viiijijj(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Um(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viiiiijjij(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function Om(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viiijij(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Cm(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiiijiiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Mm(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_vijjiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Rm(n,o,a,c,l,u,h,f){var p=S();try{dynCall_vijiij(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Lm(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiiiiiiij(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Nm(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viiiijjij(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function Pm(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viiijiiijii(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function Vm(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viijijiiii(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function Hm(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiiiiiiji(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function zm(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_viiiijjii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Wm(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iiiiiiiijj(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function $m(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiiijjiii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Gm(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iiiiiiij(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Km(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{return dynCall_iiiiiiiiijii(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function qm(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_jiiijiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Ym(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_jiiijii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Jm(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiijiji(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Xm(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_jijjj(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Zm(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_dijjj(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Qm(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_vijijjd(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function t0(n,o,a,c,l,u,h,f,p,y,m,v,T,D){var F=S();try{return dynCall_iiiiiiiiiiiji(n,o,a,c,l,u,h,f,p,y,m,v,T,D)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function e0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iiiiiiijji(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function i0(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viiiijj(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function r0(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iiiijji(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function n0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iiiiiiiiiji(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function s0(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiiiiiiiji(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function o0(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_jiiiiijji(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function a0(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viijjii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function c0(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_jiiiiiii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function l0(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_viiijjiii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function u0(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viiiijii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function h0(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_jiiiiji(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function d0(n,o,a,c,l,u,h){var f=S();try{return dynCall_jiijj(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function f0(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{return dynCall_iiiiiiiijiii(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function p0(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiiiiiiiij(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function _0(n,o,a,c,l,u){var h=S();try{return dynCall_iiidj(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function y0(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A){var G=S();try{return dynCall_iiiiiiiiiiijiii(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A)}catch(gt){if(w(G),gt!==gt+0)throw gt;_setThrew(1,0)}}function m0(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt,ut){var Vt=S();try{return dynCall_iiiiiiiiijiiiiiiii(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt,ut)}catch($t){if(w(Vt),$t!==$t+0)throw $t;_setThrew(1,0)}}function b0(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{return dynCall_iiiiiiiiiiji(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function v0(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiiiijjii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function g0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iiiiijjij(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function w0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iiiijiiiij(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function S0(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiiijiiij(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function I0(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F){var A=S();try{dynCall_viijijijiji(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F)}catch(G){if(w(A),G!==G+0)throw G;_setThrew(1,0)}}function T0(n,o,a,c,l,u,h,f,p,y,m,v,T,D){var F=S();try{dynCall_viiijjjjii(n,o,a,c,l,u,h,f,p,y,m,v,T,D)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function j0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viijjjji(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function B0(n,o,a,c,l,u,h,f,p,y,m,v,T,D){var F=S();try{dynCall_viijijijij(n,o,a,c,l,u,h,f,p,y,m,v,T,D)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function D0(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F){var A=S();try{return dynCall_iiiijiijjiii(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F)}catch(G){if(w(A),G!==G+0)throw G;_setThrew(1,0)}}function F0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iijiiiiiij(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function A0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viijjiiij(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function x0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viijiijji(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function k0(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F){var A=S();try{dynCall_viiiijiijjii(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F)}catch(G){if(w(A),G!==G+0)throw G;_setThrew(1,0)}}function E0(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt,ut,Vt){var $t=S();try{return dynCall_iiiiiijjiiiiiiiji(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt,ut,Vt)}catch(ti){if(w($t),ti!==ti+0)throw ti;_setThrew(1,0)}}function U0(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viijiiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function O0(n,o,a,c,l,u){var h=S();try{return dynCall_ijji(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function C0(n,o,a,c,l){var u=S();try{dynCall_vjii(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function M0(n,o,a,c,l){var u=S();try{return dynCall_jjj(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function R0(n,o,a,c){var l=S();try{return dynCall_jji(n,o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function L0(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iijiji(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function N0(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F){var A=S();try{dynCall_viiiijiiiiiiii(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F)}catch(G){if(w(A),G!==G+0)throw G;_setThrew(1,0)}}function P0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viiiiijiiii(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function V0(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_jjjij(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function H0(n,o,a,c,l,u){var h=S();try{return dynCall_jijj(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function z0(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiijiiiji(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function W0(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viiijji(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function $0(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiijjii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function G0(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_jiiiijji(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function K0(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiiijji(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function q0(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iiiijij(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Y0(n,o,a,c,l){var u=S();try{return dynCall_jiji(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function J0(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viiiiiijij(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function X0(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_iijjii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Z0(n,o,a,c,l){var u=S();try{dynCall_vjj(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function Q0(n,o,a,c,l,u){var h=S();try{dynCall_viijd(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function tb(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iijiiiiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function eb(n,o,a,c){var l=S();try{return dynCall_dij(n,o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function ib(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiiiiiji(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function rb(n,o,a,c,l,u,h){var f=S();try{return dynCall_jjjii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function nb(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{return dynCall_jiiijiijiii(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function sb(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_jiiiijiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function ob(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiijiiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function ab(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_jiijjiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function cb(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_jiiiijii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function lb(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_jiijiiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function ub(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_jiiiiijiiii(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function hb(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iijjiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function db(n,o,a,c,l){var u=S();try{return dynCall_iidj(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function fb(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_jiiiiiiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function pb(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iijjjii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function _b(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iijjji(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function yb(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iiijjj(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function mb(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_jjjji(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function bb(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iijjjj(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function vb(n,o,a,c,l,u,h){var f=S();try{return dynCall_fiiiij(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function gb(n,o,a,c,l,u,h){var f=S();try{return dynCall_diiiij(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function wb(n,o,a,c,l,u,h,f){var p=S();try{dynCall_vijiji(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Sb(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_vijjij(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Ib(n,o,a,c,l,u){var h=S();try{return dynCall_jjij(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function Tb(n,o,a,c,l,u){var h=S();try{return dynCall_ijij(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function jb(n,o,a,c,l,u,h){var f=S();try{dynCall_vijij(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function Bb(n,o,a,c,l){var u=S();try{return dynCall_diij(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function Db(n,o,a,c,l,u){var h=S();try{return dynCall_djij(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function Fb(n,o,a){var c=S();try{return dynCall_dj(n,o,a)}catch(l){if(w(c),l!==l+0)throw l;_setThrew(1,0)}}function Ab(n,o,a,c,l,u){var h=S();try{return dynCall_jjjd(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function xb(n,o,a,c,l,u){var h=S();try{dynCall_vjij(n,o,a,c,l,u)}catch(f){if(w(h),f!==f+0)throw f;_setThrew(1,0)}}function kb(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viiiijiiiii(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function Eb(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_viiiijiiii(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Ub(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viiijiiiji(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function Ob(n,o,a,c){var l=S();try{dynCall_vji(n,o,a,c)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Cb(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_jiijiiiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Mb(n,o,a,c,l,u,h,f){var p=S();try{return dynCall_jiijiii(n,o,a,c,l,u,h,f)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Rb(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_vijijjji(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function Lb(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viiiiijjji(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function Nb(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_viijiijj(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Pb(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_iiijiij(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Vb(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viijiij(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Hb(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iiijiiijj(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function zb(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iiijiijj(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Wb(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viiijijjj(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function $b(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_viiiijiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Gb(n,o,a,c,l,u,h,f,p){var y=S();try{dynCall_viijiji(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Kb(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_vijiiiiji(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function qb(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiijjji(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Yb(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iijiijj(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Jb(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{return dynCall_iiijiiiijj(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function Xb(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{return dynCall_iijiiijj(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function Zb(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiijiiij(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Qb(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_jijjjj(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function tv(n,o,a,c,l,u,h){var f=S();try{return dynCall_jijiii(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function ev(n,o,a,c,l,u,h,f,p,y,m){var v=S();try{dynCall_viiiijjj(n,o,a,c,l,u,h,f,p,y,m)}catch(T){if(w(v),T!==T+0)throw T;_setThrew(1,0)}}function iv(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viijjjiii(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function rv(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viijjjjii(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function nv(n,o,a,c,l,u,h){var f=S();try{return dynCall_jijji(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function sv(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_vijiiiiiiii(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function ov(n,o,a,c,l,u,h,f,p,y){var m=S();try{dynCall_vijiiiij(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function av(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{dynCall_viiijjjiii(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function cv(n,o,a,c,l,u,h,f,p,y,m,v,T,D){var F=S();try{return dynCall_iiiiiiiiijji(n,o,a,c,l,u,h,f,p,y,m,v,T,D)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function lv(n,o,a,c,l){var u=S();try{return dynCall_iijd(n,o,a,c,l)}catch(h){if(w(u),h!==h+0)throw h;_setThrew(1,0)}}function uv(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt,ut,Vt,$t,ti){var va=S();try{return dynCall_iiiiiiiiiiiijjidjii(n,o,a,c,l,u,h,f,p,y,m,v,T,D,F,A,G,gt,ut,Vt,$t,ti)}catch(lr){if(w(va),lr!==lr+0)throw lr;_setThrew(1,0)}}function hv(n,o,a,c,l,u,h,f,p,y){var m=S();try{return dynCall_iiijiiiii(n,o,a,c,l,u,h,f,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function dv(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{dynCall_viiijdjji(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function fv(n,o,a,c,l,u,h){var f=S();try{return dynCall_diijj(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function pv(n,o,a,c,l,u,h,f,p,y,m,v){var T=S();try{return dynCall_iiijjijj(n,o,a,c,l,u,h,f,p,y,m,v)}catch(D){if(w(T),D!==D+0)throw D;_setThrew(1,0)}}function _v(n,o,a,c,l,u,h){var f=S();try{return dynCall_jjiji(n,o,a,c,l,u,h)}catch(p){if(w(f),p!==p+0)throw p;_setThrew(1,0)}}function yv(n,o,a,c,l,u,h,f,p,y,m,v,T){var D=S();try{return dynCall_jijjjjjd(n,o,a,c,l,u,h,f,p,y,m,v,T)}catch(F){if(w(D),F!==F+0)throw F;_setThrew(1,0)}}function mv(n,o,a,c,l,u,h,f,p){var y=S();try{return dynCall_jijjiii(n,o,a,c,l,u,h,f,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function bv(n){n=Object.assign({},n);var o=l=>u=>l(u)>>>0,a=l=>(u,h)=>l(u,h)>>>0,c=l=>()=>l()>>>0;return n.qi=o(n.qi),n.si=a(n.si),n.xi=o(n.xi),n.yi=c(n.yi),n.Ci=o(n.Ci),n}s.stackSave=S,s.stackRestore=w,s.stackAlloc=Ss,s.getTempRet0=Tf,s.setTempRet0=fn,s.ccall=If;function vv(){var n=Bf,o=0,a=0;try{var c=n(o,a);return Yc(c,!0),c}catch(l){return vf(l)}}function ba(){if(cr>0){hn=ba;return}if(cn(),cr>0){hn=ba;return}function n(){var a;if(s.calledRun=!0,!E){ln(),d(s),(a=s.onRuntimeInitialized)==null||a.call(s);var o=s.noInitialRun;o||vv(),ph()}}s.setStatus?(s.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>s.setStatus(""),1),n()},1)):n()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return ba(),r=b,r}})();typeof rh=="object"&&typeof ca=="object"?(ca.exports=Bc,ca.exports.default=Bc):typeof define=="function"&&define.amd&&define([],()=>Bc)});var oh=Er(()=>{});var ah=Er(()=>{});var ch=Er((Xk,ha)=>{(function(){"use strict";var i="input is invalid type",t=typeof window=="object",e=t?window:{};e.JS_SHA256_NO_WINDOW&&(t=!1);var r=!t&&typeof self=="object",s=!e.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node&&process.type!="renderer";s?e=global:r&&(e=self);var d=!e.JS_SHA256_NO_COMMON_JS&&typeof ha=="object"&&ha.exports,_=typeof define=="function"&&define.amd,b=!e.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",g="0123456789abcdef".split(""),I=[-2147483648,8388608,32768,128],B=[24,16,8,0],U=[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],C=["hex","array","digest","arrayBuffer"],R=[];(e.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(x){return Object.prototype.toString.call(x)==="[object Array]"}),b&&(e.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(x){return typeof x=="object"&&x.buffer&&x.buffer.constructor===ArrayBuffer});var ft=function(x,N){return function(K){return new Tt(N,!0).update(K)[x]()}},yt=function(x){var N=ft("hex",x);s&&(N=Wt(N,x)),N.create=function(){return new Tt(x)},N.update=function(H){return N.create().update(H)};for(var K=0;K<C.length;++K){var E=C[K];N[E]=ft(E,x)}return N},Wt=function(x,N){var K=oh(),E=ah().Buffer,H=N?"sha224":"sha256",O;E.from&&!e.JS_SHA256_NO_BUFFER_FROM?O=E.from:O=function(k){return new E(k)};var q=function(k){if(typeof k=="string")return K.createHash(H).update(k,"utf8").digest("hex");if(k==null)throw new Error(i);return k.constructor===ArrayBuffer&&(k=new Uint8Array(k)),Array.isArray(k)||ArrayBuffer.isView(k)||k.constructor===E?K.createHash(H).update(O(k)).digest("hex"):x(k)};return q},Rt=function(x,N){return function(K,E){return new se(K,N,!0).update(E)[x]()}},xt=function(x){var N=Rt("hex",x);N.create=function(H){return new se(H,x)},N.update=function(H,O){return N.create(H).update(O)};for(var K=0;K<C.length;++K){var E=C[K];N[E]=Rt(E,x)}return N};function Tt(x,N){N?(R[0]=R[16]=R[1]=R[2]=R[3]=R[4]=R[5]=R[6]=R[7]=R[8]=R[9]=R[10]=R[11]=R[12]=R[13]=R[14]=R[15]=0,this.blocks=R):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],x?(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=x}Tt.prototype.update=function(x){if(!this.finalized){var N,K=typeof x;if(K!=="string"){if(K==="object"){if(x===null)throw new Error(i);if(b&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!b||!ArrayBuffer.isView(x)))throw new Error(i)}else throw new Error(i);N=!0}for(var E,H=0,O,q=x.length,k=this.blocks;H<q;){if(this.hashed&&(this.hashed=!1,k[0]=this.block,this.block=k[16]=k[1]=k[2]=k[3]=k[4]=k[5]=k[6]=k[7]=k[8]=k[9]=k[10]=k[11]=k[12]=k[13]=k[14]=k[15]=0),N)for(O=this.start;H<q&&O<64;++H)k[O>>>2]|=x[H]<<B[O++&3];else for(O=this.start;H<q&&O<64;++H)E=x.charCodeAt(H),E<128?k[O>>>2]|=E<<B[O++&3]:E<2048?(k[O>>>2]|=(192|E>>>6)<<B[O++&3],k[O>>>2]|=(128|E&63)<<B[O++&3]):E<55296||E>=57344?(k[O>>>2]|=(224|E>>>12)<<B[O++&3],k[O>>>2]|=(128|E>>>6&63)<<B[O++&3],k[O>>>2]|=(128|E&63)<<B[O++&3]):(E=65536+((E&1023)<<10|x.charCodeAt(++H)&1023),k[O>>>2]|=(240|E>>>18)<<B[O++&3],k[O>>>2]|=(128|E>>>12&63)<<B[O++&3],k[O>>>2]|=(128|E>>>6&63)<<B[O++&3],k[O>>>2]|=(128|E&63)<<B[O++&3]);this.lastByteIndex=O,this.bytes+=O-this.start,O>=64?(this.block=k[16],this.start=O-64,this.hash(),this.hashed=!0):this.start=O}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Tt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var x=this.blocks,N=this.lastByteIndex;x[16]=this.block,x[N>>>2]|=I[N&3],this.block=x[16],N>=56&&(this.hashed||this.hash(),x[0]=this.block,x[16]=x[1]=x[2]=x[3]=x[4]=x[5]=x[6]=x[7]=x[8]=x[9]=x[10]=x[11]=x[12]=x[13]=x[14]=x[15]=0),x[14]=this.hBytes<<3|this.bytes>>>29,x[15]=this.bytes<<3,this.hash()}},Tt.prototype.hash=function(){var x=this.h0,N=this.h1,K=this.h2,E=this.h3,H=this.h4,O=this.h5,q=this.h6,k=this.h7,Y=this.blocks,it,L,mt,Ze,St,Qe,xe,Pi,cn,ln,un;for(it=16;it<64;++it)St=Y[it-15],L=(St>>>7|St<<25)^(St>>>18|St<<14)^St>>>3,St=Y[it-2],mt=(St>>>17|St<<15)^(St>>>19|St<<13)^St>>>10,Y[it]=Y[it-16]+L+Y[it-7]+mt<<0;for(un=N&K,it=0;it<64;it+=4)this.first?(this.is224?(Pi=300032,St=Y[0]-1413257819,k=St-150054599<<0,E=St+24177077<<0):(Pi=704751109,St=Y[0]-210244248,k=St-1521486534<<0,E=St+143694565<<0),this.first=!1):(L=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),mt=(H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7),Pi=x&N,Ze=Pi^x&K^un,xe=H&O^~H&q,St=k+mt+xe+U[it]+Y[it],Qe=L+Ze,k=E+St<<0,E=St+Qe<<0),L=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),mt=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),cn=E&x,Ze=cn^E&N^Pi,xe=k&H^~k&O,St=q+mt+xe+U[it+1]+Y[it+1],Qe=L+Ze,q=K+St<<0,K=St+Qe<<0,L=(K>>>2|K<<30)^(K>>>13|K<<19)^(K>>>22|K<<10),mt=(q>>>6|q<<26)^(q>>>11|q<<21)^(q>>>25|q<<7),ln=K&E,Ze=ln^K&x^cn,xe=q&k^~q&H,St=O+mt+xe+U[it+2]+Y[it+2],Qe=L+Ze,O=N+St<<0,N=St+Qe<<0,L=(N>>>2|N<<30)^(N>>>13|N<<19)^(N>>>22|N<<10),mt=(O>>>6|O<<26)^(O>>>11|O<<21)^(O>>>25|O<<7),un=N&K,Ze=un^N&E^ln,xe=O&q^~O&k,St=H+mt+xe+U[it+3]+Y[it+3],Qe=L+Ze,H=x+St<<0,x=St+Qe<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+x<<0,this.h1=this.h1+N<<0,this.h2=this.h2+K<<0,this.h3=this.h3+E<<0,this.h4=this.h4+H<<0,this.h5=this.h5+O<<0,this.h6=this.h6+q<<0,this.h7=this.h7+k<<0},Tt.prototype.hex=function(){this.finalize();var x=this.h0,N=this.h1,K=this.h2,E=this.h3,H=this.h4,O=this.h5,q=this.h6,k=this.h7,Y=g[x>>>28&15]+g[x>>>24&15]+g[x>>>20&15]+g[x>>>16&15]+g[x>>>12&15]+g[x>>>8&15]+g[x>>>4&15]+g[x&15]+g[N>>>28&15]+g[N>>>24&15]+g[N>>>20&15]+g[N>>>16&15]+g[N>>>12&15]+g[N>>>8&15]+g[N>>>4&15]+g[N&15]+g[K>>>28&15]+g[K>>>24&15]+g[K>>>20&15]+g[K>>>16&15]+g[K>>>12&15]+g[K>>>8&15]+g[K>>>4&15]+g[K&15]+g[E>>>28&15]+g[E>>>24&15]+g[E>>>20&15]+g[E>>>16&15]+g[E>>>12&15]+g[E>>>8&15]+g[E>>>4&15]+g[E&15]+g[H>>>28&15]+g[H>>>24&15]+g[H>>>20&15]+g[H>>>16&15]+g[H>>>12&15]+g[H>>>8&15]+g[H>>>4&15]+g[H&15]+g[O>>>28&15]+g[O>>>24&15]+g[O>>>20&15]+g[O>>>16&15]+g[O>>>12&15]+g[O>>>8&15]+g[O>>>4&15]+g[O&15]+g[q>>>28&15]+g[q>>>24&15]+g[q>>>20&15]+g[q>>>16&15]+g[q>>>12&15]+g[q>>>8&15]+g[q>>>4&15]+g[q&15];return this.is224||(Y+=g[k>>>28&15]+g[k>>>24&15]+g[k>>>20&15]+g[k>>>16&15]+g[k>>>12&15]+g[k>>>8&15]+g[k>>>4&15]+g[k&15]),Y},Tt.prototype.toString=Tt.prototype.hex,Tt.prototype.digest=function(){this.finalize();var x=this.h0,N=this.h1,K=this.h2,E=this.h3,H=this.h4,O=this.h5,q=this.h6,k=this.h7,Y=[x>>>24&255,x>>>16&255,x>>>8&255,x&255,N>>>24&255,N>>>16&255,N>>>8&255,N&255,K>>>24&255,K>>>16&255,K>>>8&255,K&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,H>>>24&255,H>>>16&255,H>>>8&255,H&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255,q>>>24&255,q>>>16&255,q>>>8&255,q&255];return this.is224||Y.push(k>>>24&255,k>>>16&255,k>>>8&255,k&255),Y},Tt.prototype.array=Tt.prototype.digest,Tt.prototype.arrayBuffer=function(){this.finalize();var x=new ArrayBuffer(this.is224?28:32),N=new DataView(x);return N.setUint32(0,this.h0),N.setUint32(4,this.h1),N.setUint32(8,this.h2),N.setUint32(12,this.h3),N.setUint32(16,this.h4),N.setUint32(20,this.h5),N.setUint32(24,this.h6),this.is224||N.setUint32(28,this.h7),x};function se(x,N,K){var E,H=typeof x;if(H==="string"){var O=[],q=x.length,k=0,Y;for(E=0;E<q;++E)Y=x.charCodeAt(E),Y<128?O[k++]=Y:Y<2048?(O[k++]=192|Y>>>6,O[k++]=128|Y&63):Y<55296||Y>=57344?(O[k++]=224|Y>>>12,O[k++]=128|Y>>>6&63,O[k++]=128|Y&63):(Y=65536+((Y&1023)<<10|x.charCodeAt(++E)&1023),O[k++]=240|Y>>>18,O[k++]=128|Y>>>12&63,O[k++]=128|Y>>>6&63,O[k++]=128|Y&63);x=O}else if(H==="object"){if(x===null)throw new Error(i);if(b&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!b||!ArrayBuffer.isView(x)))throw new Error(i)}else throw new Error(i);x.length>64&&(x=new Tt(N,!0).update(x).array());var it=[],L=[];for(E=0;E<64;++E){var mt=x[E]||0;it[E]=92^mt,L[E]=54^mt}Tt.call(this,N,K),this.update(L),this.oKeyPad=it,this.inner=!0,this.sharedMemory=K}se.prototype=new Tt,se.prototype.finalize=function(){if(Tt.prototype.finalize.call(this),this.inner){this.inner=!1;var x=this.array();Tt.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(x),Tt.prototype.finalize.call(this)}};var Zt=yt();Zt.sha256=Zt,Zt.sha224=yt(!0),Zt.sha256.hmac=xt(),Zt.sha224.hmac=xt(!0),d?ha.exports=Zt:(e.sha256=Zt.sha256,e.sha224=Zt.sha224,_&&define(function(){return Zt}))})()});var iS={};$i(iS,{registerWorker:()=>fh});function rl(i,t){var e={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&t.indexOf(r)<0&&(e[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(i);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(i,r[s])&&(e[r[s]]=i[r[s]]);return e}function P(i,t,e,r){function s(d){return d instanceof e?d:new e(function(_){_(d)})}return new(e||(e=Promise))(function(d,_){function b(B){try{I(r.next(B))}catch(U){_(U)}}function g(B){try{I(r.throw(B))}catch(U){_(U)}}function I(B){B.done?d(B.value):s(B.value).then(b,g)}I((r=r.apply(i,t||[])).next())})}function il(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],r=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function dt(i){return this instanceof dt?(this.v=i,this):new dt(i)}function ye(i,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e.apply(i,t||[]),s,d=[];return s={},_("next"),_("throw"),_("return"),s[Symbol.asyncIterator]=function(){return this},s;function _(C){r[C]&&(s[C]=function(R){return new Promise(function(ft,yt){d.push([C,R,ft,yt])>1||b(C,R)})})}function b(C,R){try{g(r[C](R))}catch(ft){U(d[0][3],ft)}}function g(C){C.value instanceof dt?Promise.resolve(C.value.v).then(I,B):U(d[0][2],C)}function I(C){b("next",C)}function B(C){b("throw",C)}function U(C,R){C(R),d.shift(),d.length&&b(d[0][0],d[0][1])}}function Ur(i){var t,e;return t={},r("next"),r("throw",function(s){throw s}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(s,d){t[s]=i[s]?function(_){return(e=!e)?{value:dt(i[s](_)),done:!1}:d?d(_):_}:d}}function Ee(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=i[Symbol.asyncIterator],e;return t?t.call(i):(i=typeof il=="function"?il(i):i[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(d){e[d]=i[d]&&function(_){return new Promise(function(b,g){_=i[d](_),s(b,g,_.done,_.value)})}}function s(d,_,b,g){Promise.resolve(g).then(function(I){d({value:I,done:b})},_)}}var Ba={};$i(Ba,{compareArrayLike:()=>ja,joinUint8Arrays:()=>me,memcpy:()=>bn,rebaseValueOffsets:()=>xs,toArrayBufferView:()=>pt,toArrayBufferViewAsyncIterator:()=>Ce,toArrayBufferViewIterator:()=>ii,toBigInt64Array:()=>As,toBigUint64Array:()=>Mv,toFloat32Array:()=>Rv,toFloat32ArrayAsyncIterator:()=>Qv,toFloat32ArrayIterator:()=>$v,toFloat64Array:()=>Lv,toFloat64ArrayAsyncIterator:()=>tg,toFloat64ArrayIterator:()=>Gv,toInt16Array:()=>Uv,toInt16ArrayAsyncIterator:()=>Yv,toInt16ArrayIterator:()=>Vv,toInt32Array:()=>hr,toInt32ArrayAsyncIterator:()=>Jv,toInt32ArrayIterator:()=>Hv,toInt8Array:()=>Ev,toInt8ArrayAsyncIterator:()=>qv,toInt8ArrayIterator:()=>Pv,toUint16Array:()=>Ov,toUint16ArrayAsyncIterator:()=>Xv,toUint16ArrayIterator:()=>zv,toUint32Array:()=>Cv,toUint32ArrayAsyncIterator:()=>Zv,toUint32ArrayIterator:()=>Wv,toUint8Array:()=>rt,toUint8ArrayAsyncIterator:()=>Ta,toUint8ArrayIterator:()=>Ia,toUint8ClampedArray:()=>Nv,toUint8ClampedArrayAsyncIterator:()=>eg,toUint8ClampedArrayIterator:()=>Kv});var Fv=new TextDecoder("utf-8"),yn=i=>Fv.decode(i),Av=new TextEncoder,ei=i=>Av.encode(i);var xv=i=>typeof i=="number",nl=i=>typeof i=="boolean",qt=i=>typeof i=="function",oe=i=>i!=null&&Object(i)===i,Ue=i=>oe(i)&&qt(i.then);var Oe=i=>oe(i)&&qt(i[Symbol.iterator]),Ie=i=>oe(i)&&qt(i[Symbol.asyncIterator]),Is=i=>oe(i)&&oe(i.schema);var Ts=i=>oe(i)&&"done"in i&&"value"in i;var js=i=>oe(i)&&qt(i.stat)&&xv(i.fd);var Bs=i=>oe(i)&&mn(i.body),Ds=i=>"_getDOMStream"in i&&"_getNodeStream"in i,sl=i=>oe(i)&&qt(i.abort)&&qt(i.getWriter)&&!Ds(i),mn=i=>oe(i)&&qt(i.cancel)&&qt(i.getReader)&&!Ds(i),ol=i=>oe(i)&&qt(i.end)&&qt(i.write)&&nl(i.writable)&&!Ds(i),Fs=i=>oe(i)&&qt(i.read)&&qt(i.pipe)&&nl(i.readable)&&!Ds(i),al=i=>oe(i)&&qt(i.clear)&&qt(i.bytes)&&qt(i.position)&&qt(i.setPosition)&&qt(i.capacity)&&qt(i.getBufferIdentifier)&&qt(i.createLong);var Sa=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function kv(i){let t=i[0]?[i[0]]:[],e,r,s,d;for(let _,b,g=0,I=0,B=i.length;++g<B;){if(_=t[I],b=i[g],!_||!b||_.buffer!==b.buffer||b.byteOffset<_.byteOffset){b&&(t[++I]=b);continue}if({byteOffset:e,byteLength:s}=_,{byteOffset:r,byteLength:d}=b,e+s<r||r+d<e){b&&(t[++I]=b);continue}t[I]=new Uint8Array(_.buffer,e,r-e+d)}return t}function bn(i,t,e=0,r=t.byteLength){let s=i.byteLength,d=new Uint8Array(i.buffer,i.byteOffset,s),_=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,s));return d.set(_,e),i}function me(i,t){let e=kv(i),r=e.reduce((B,U)=>B+U.byteLength,0),s,d,_,b=0,g=-1,I=Math.min(t||Number.POSITIVE_INFINITY,r);for(let B=e.length;++g<B;){if(s=e[g],d=s.subarray(0,Math.min(s.length,I-b)),I<=b+d.length){d.length<s.length?e[g]=s.subarray(d.length):d.length===s.length&&g++,_?bn(_,d,b):_=d;break}bn(_||(_=new Uint8Array(I)),d,b),b+=d.length}return[_||new Uint8Array(0),e.slice(g),r-(_?_.byteLength:0)]}function pt(i,t){let e=Ts(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=ei(e)),e instanceof ArrayBuffer?new i(e):e instanceof Sa?new i(e):al(e)?pt(i,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new i(0):new i(e.buffer,e.byteOffset,e.byteLength/i.BYTES_PER_ELEMENT):i.from(e)):new i(0)}var Ev=i=>pt(Int8Array,i),Uv=i=>pt(Int16Array,i),hr=i=>pt(Int32Array,i),As=i=>pt(BigInt64Array,i),rt=i=>pt(Uint8Array,i),Ov=i=>pt(Uint16Array,i),Cv=i=>pt(Uint32Array,i),Mv=i=>pt(BigUint64Array,i),Rv=i=>pt(Float32Array,i),Lv=i=>pt(Float64Array,i),Nv=i=>pt(Uint8ClampedArray,i),wa=i=>(i.next(),i);function*ii(i,t){let e=function*(s){yield s},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Sa?e(t):Oe(t)?t:e(t);return yield*ur(wa(function*(s){let d=null;do d=s.next(yield pt(i,d));while(!d.done)}(r[Symbol.iterator]()))),new i}var Pv=i=>ii(Int8Array,i),Vv=i=>ii(Int16Array,i),Hv=i=>ii(Int32Array,i),Ia=i=>ii(Uint8Array,i),zv=i=>ii(Uint16Array,i),Wv=i=>ii(Uint32Array,i),$v=i=>ii(Float32Array,i),Gv=i=>ii(Float64Array,i),Kv=i=>ii(Uint8ClampedArray,i);function Ce(i,t){return ye(this,arguments,function*(){if(Ue(t))return yield dt(yield dt(yield*ur(Ur(Ee(Ce(i,yield dt(t)))))));let r=function(_){return ye(this,arguments,function*(){yield yield dt(yield dt(_))})},s=function(_){return ye(this,arguments,function*(){yield dt(yield*ur(Ur(Ee(wa(function*(b){let g=null;do g=b.next(yield g==null?void 0:g.value);while(!g.done)}(_[Symbol.iterator]()))))))})},d=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Sa?r(t):Oe(t)?s(t):Ie(t)?t:r(t);return yield dt(yield*ur(Ur(Ee(wa(function(_){return ye(this,arguments,function*(){let b=null;do b=yield dt(_.next(yield yield dt(pt(i,b))));while(!b.done)})}(d[Symbol.asyncIterator]())))))),yield dt(new i)})}var qv=i=>Ce(Int8Array,i),Yv=i=>Ce(Int16Array,i),Jv=i=>Ce(Int32Array,i),Ta=i=>Ce(Uint8Array,i),Xv=i=>Ce(Uint16Array,i),Zv=i=>Ce(Uint32Array,i),Qv=i=>Ce(Float32Array,i),tg=i=>Ce(Float64Array,i),eg=i=>Ce(Uint8ClampedArray,i);function xs(i,t,e){if(i!==0){e=e.slice(0,t);for(let r=-1,s=e.length;++r<s;)e[r]+=i}return e.subarray(0,t)}function ja(i,t){let e=0,r=i.length;if(r!==t.length)return!1;if(r>0)do if(i[e]!==t[e])return!1;while(++e<r);return!0}var te={fromIterable(i){return ks(ig(i))},fromAsyncIterable(i){return ks(rg(i))},fromDOMStream(i){return ks(ng(i))},fromNodeStream(i){return ks(sg(i))},toDOMStream(i,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(i,t){throw new Error('"toNodeStream" not available in this environment')}},ks=i=>(i.next(),i);function*ig(i){let t,e=!1,r=[],s,d,_,b=0;function g(){return d==="peek"?me(r,_)[0]:([s,r,b]=me(r,_),s)}({cmd:d,size:_}=(yield null)||{cmd:"read",size:0});let I=Ia(i)[Symbol.iterator]();try{do if({done:t,value:s}=Number.isNaN(_-b)?I.next():I.next(_-b),!t&&s.byteLength>0&&(r.push(s),b+=s.byteLength),t||_<=b)do({cmd:d,size:_}=yield g());while(_<b);while(!t)}catch(B){(e=!0)&&typeof I.throw=="function"&&I.throw(B)}finally{e===!1&&typeof I.return=="function"&&I.return(null)}return null}function rg(i){return ye(this,arguments,function*(){let e,r=!1,s=[],d,_,b,g=0;function I(){return _==="peek"?me(s,b)[0]:([d,s,g]=me(s,b),d)}({cmd:_,size:b}=(yield yield dt(null))||{cmd:"read",size:0});let B=Ta(i)[Symbol.asyncIterator]();try{do if({done:e,value:d}=Number.isNaN(b-g)?yield dt(B.next()):yield dt(B.next(b-g)),!e&&d.byteLength>0&&(s.push(d),g+=d.byteLength),e||b<=g)do({cmd:_,size:b}=yield yield dt(I()));while(b<g);while(!e)}catch(U){(r=!0)&&typeof B.throw=="function"&&(yield dt(B.throw(U)))}finally{r===!1&&typeof B.return=="function"&&(yield dt(B.return(new Uint8Array(0))))}return yield dt(null)})}function ng(i){return ye(this,arguments,function*(){let e=!1,r=!1,s=[],d,_,b,g=0;function I(){return _==="peek"?me(s,b)[0]:([d,s,g]=me(s,b),d)}({cmd:_,size:b}=(yield yield dt(null))||{cmd:"read",size:0});let B=new Fa(i);try{do if({done:e,value:d}=Number.isNaN(b-g)?yield dt(B.read()):yield dt(B.read(b-g)),!e&&d.byteLength>0&&(s.push(rt(d)),g+=d.byteLength),e||b<=g)do({cmd:_,size:b}=yield yield dt(I()));while(b<g);while(!e)}catch(U){(r=!0)&&(yield dt(B.cancel(U)))}finally{r===!1?yield dt(B.cancel()):i.locked&&B.releaseLock()}return yield dt(null)})}var Fa=class{constructor(t){this.source=t,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(t){return P(this,void 0,void 0,function*(){let{reader:e,source:r}=this;e&&(yield e.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return P(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let e=yield this.reader.read();return!e.done&&(e.value=rt(e)),e})}},Da=(i,t)=>{let e=s=>r([t,s]),r;return[t,e,new Promise(s=>(r=s)&&i.once(t,e))]};function sg(i){return ye(this,arguments,function*(){let e=[],r="error",s=!1,d=null,_,b,g=0,I=[],B;function U(){return _==="peek"?me(I,b)[0]:([B,I,g]=me(I,b),B)}if({cmd:_,size:b}=(yield yield dt(null))||{cmd:"read",size:0},i.isTTY)return yield yield dt(new Uint8Array(0)),yield dt(null);try{e[0]=Da(i,"end"),e[1]=Da(i,"error");do{if(e[2]=Da(i,"readable"),[r,d]=yield dt(Promise.race(e.map(R=>R[2]))),r==="error")break;if((s=r==="end")||(Number.isFinite(b-g)?(B=rt(i.read(b-g)),B.byteLength<b-g&&(B=rt(i.read()))):B=rt(i.read()),B.byteLength>0&&(I.push(B),g+=B.byteLength)),s||b<=g)do({cmd:_,size:b}=yield yield dt(U()));while(b<g)}while(!s)}finally{yield dt(C(e,r==="error"?d:null))}return yield dt(null);function C(R,ft){return B=I=null,new Promise((yt,Wt)=>{for(let[Rt,xt]of R)i.off(Rt,xt);try{let Rt=i.destroy;Rt&&Rt.call(i,ft),ft=void 0}catch(Rt){ft=Rt||ft}finally{ft!=null?Wt(ft):yt()}})}})}var Bt;(function(i){i[i.V1=0]="V1",i[i.V2=1]="V2",i[i.V3=2]="V3",i[i.V4=3]="V4",i[i.V5=4]="V5"})(Bt||(Bt={}));var Et;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Et||(Et={}));var kt;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(kt||(kt={}));var Ht;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(Ht||(Ht={}));var z;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(z||(z={}));var Yt;(function(i){i[i.YEAR_MONTH=0]="YEAR_MONTH",i[i.DAY_TIME=1]="DAY_TIME",i[i.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Yt||(Yt={}));var ri=new Int32Array(2),Es=new Float32Array(ri.buffer),Us=new Float64Array(ri.buffer),Or=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var vn;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(vn||(vn={}));var be=class i{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new i(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return ri[0]=this.readInt32(t),Es[0]}readFloat64(t){return ri[Or?0:1]=this.readInt32(t),ri[Or?1:0]=this.readInt32(t+4),Us[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){Es[0]=e,this.writeInt32(t,ri[0])}writeFloat64(t,e){Us[0]=e,this.writeInt32(t,ri[Or?0:1]),this.writeInt32(t+4,ri[Or?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<4;e++)t+=String.fromCharCode(this.readInt8(this.position_+4+e));return t}__offset(t,e){let r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);let r=this.readInt32(t);t+=4;let s=this.bytes_.subarray(t,t+r);return e===vn.UTF8_BYTES?s:this.text_decoder_.decode(s)}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0}createScalarList(t,e){let r=[];for(let s=0;s<e;++s){let d=t(s);d!==null&&r.push(d)}return r}createObjList(t,e){let r=[];for(let s=0;s<e;++s){let d=t(s);d!==null&&r.push(d.unpack())}return r}};var dr=class i{constructor(t){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 e;t?e=t:e=1024,this.bb=be.allocate(e),this.space=e}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(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<r+t+e;){let s=this.bb.capacity();this.bb=i.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(r)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,r){(this.force_defaults||e!==r)&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,r){e!=r&&(this.nested(e),this.slot(t))}nested(t){if(t!=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(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let r=e<<1,s=be.allocate(r);return s.setPosition(r-e),s.bytes().set(t.bytes(),r-e),s}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=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 t=this.offset(),e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);let r=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);let s=2;this.addInt16(t-this.object_start);let d=(r+s)*2;this.addInt16(d);let _=0,b=this.space;t:for(e=0;e<this.vtables.length;e++){let g=this.bb.capacity()-this.vtables[e];if(d==this.bb.readInt16(g)){for(let I=2;I<d;I+=2)if(this.bb.readInt16(b+I)!=this.bb.readInt16(g+I))continue t;_=this.vtables[e];break}}return _?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,_-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,r){let s=r?4:0;if(e){let d=e;if(this.prep(this.minalign,8+s),d.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let _=3;_>=0;_--)this.writeInt8(d.charCodeAt(_))}this.prep(this.minalign,4+s),this.addOffset(t),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){let r=this.bb.capacity()-t,s=r-this.bb.readInt32(r);if(!(e<this.bb.readInt16(s)&&this.bb.readInt16(s+e)!=0))throw new TypeError("FlatBuffers: field "+e+" must be set")}startVector(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(4,t*e),this.prep(r,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(t==null)return 0;let e;return t instanceof Uint8Array?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let e=[];for(let r=0;r<t.length;++r){let s=t[r];if(s!==null)e.push(this.createObjectOffset(s));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var gn;(function(i){i[i.BUFFER=0]="BUFFER"})(gn||(gn={}));var wn;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(wn||(wn={}));var Cs=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBodyCompression(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):wn.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):gn.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,wn.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,gn.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,r){return i.startBodyCompression(t),i.addCodec(t,e),i.addMethod(t,r),i.endBodyCompression(t)}};var Cr=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,e,r){return t.prep(8,16),t.writeInt64(BigInt(r!=null?r:0)),t.writeInt64(BigInt(e!=null?e:0)),t.offset()}};var Mr=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,e,r){return t.prep(8,16),t.writeInt64(BigInt(r!=null?r:0)),t.writeInt64(BigInt(e!=null?e:0)),t.offset()}};var ve=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Mr).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new Cr).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let e=this.bb.__offset(this.bb_pos,10);return e?(t||new Cs).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}};var pi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryBatch(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new ve).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}};var Gi;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(Gi||(Gi={}));var Sn;(function(i){i[i.DenseArray=0]="DenseArray"})(Sn||(Sn={}));var Re=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,e){t.addFieldInt32(0,e,0)}static addIsSigned(t,e){t.addFieldInt8(1,+e,0)}static endInt(t){return t.endObject()}static createInt(t,e,r){return i.startInt(t),i.addBitWidth(t,e),i.addIsSigned(t,r),i.endInt(t)}};var ni=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryEncoding(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Re).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):Sn.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,Sn.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var Jt=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKeyValue(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}key(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,e){t.addFieldOffset(0,e,0)}static addValue(t,e){t.addFieldOffset(1,e,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,e,r){return i.startKeyValue(t),i.addKey(t,e),i.addValue(t,r),i.endKeyValue(t)}};var In=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBinary(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return i.startBinary(t),i.endBinary(t)}};var Tn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBool(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return i.startBool(t),i.endBool(t)}};var Ki=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDate(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ht.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Ht.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return i.startDate(t),i.addUnit(t,e),i.endDate(t)}};var si=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDecimal(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,e){t.addFieldInt32(0,e,0)}static addScale(t,e){t.addFieldInt32(1,e,0)}static addBitWidth(t,e){t.addFieldInt32(2,e,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,e,r,s){return i.startDecimal(t),i.addPrecision(t,e),i.addScale(t,r),i.addBitWidth(t,s),i.endDecimal(t)}};var qi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDuration(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):z.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,z.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,e){return i.startDuration(t),i.addUnit(t,e),i.endDuration(t)}};var Yi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeBinary(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,e){return i.startFixedSizeBinary(t),i.addByteWidth(t,e),i.endFixedSizeBinary(t)}};var Ji=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeList(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,e){return i.startFixedSizeList(t),i.addListSize(t,e),i.endFixedSizeList(t)}};var Xi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFloatingPoint(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):kt.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,kt.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return i.startFloatingPoint(t),i.addPrecision(t,e),i.endFloatingPoint(t)}};var Zi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInterval(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Yt.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Yt.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return i.startInterval(t),i.addUnit(t,e),i.endInterval(t)}};var jn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeBinary(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return i.startLargeBinary(t),i.endLargeBinary(t)}};var Bn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeUtf8(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return i.startLargeUtf8(t),i.endLargeUtf8(t)}};var Dn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsList(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return i.startList(t),i.endList(t)}};var Qi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMap(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,e){t.addFieldInt8(0,+e,0)}static endMap(t){return t.endObject()}static createMap(t,e){return i.startMap(t),i.addKeysSorted(t,e),i.endMap(t)}};var Fn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNull(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return i.startNull(t),i.endNull(t)}};var An=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsStruct_(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return i.startStruct_(t),i.endStruct_(t)}};var _i=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTime(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):z.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,z.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,r){return i.startTime(t),i.addUnit(t,e),i.addBitWidth(t,r),i.endTime(t)}};var yi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTimestamp(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):z.SECOND}timezone(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,z.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,r){return i.startTimestamp(t),i.addUnit(t,e),i.addTimezone(t,r),i.endTimestamp(t)}};var Le=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUnion(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Et.Sparse}typeIds(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,e){t.addFieldInt16(0,e,Et.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,r){return i.startUnion(t),i.addMode(t,e),i.addTypeIds(t,r),i.endUnion(t)}};var xn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return i.startUtf8(t),i.endUtf8(t)}};var Ut;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.FloatingPoint=3]="FloatingPoint",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct_=13]="Struct_",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.LargeBinary=19]="LargeBinary",i[i.LargeUtf8=20]="LargeUtf8",i[i.LargeList=21]="LargeList",i[i.RunEndEncoded=22]="RunEndEncoded"})(Ut||(Ut={}));var ne=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):Ut.NONE}type(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){let e=this.bb.__offset(this.bb_pos,12);return e?(t||new ni).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){let r=this.bb.__offset(this.bb_pos,14);return r?(e||new i).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,16);return r?(e||new Jt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,Ut.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}};var ue=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Gi.Little}fields(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new ne).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new Jt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,Gi.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,r,s,d){return i.startSchema(t),i.addEndianness(t,e),i.addFields(t,r),i.addCustomMetadata(t,s),i.addFeatures(t,d),i.endSchema(t)}};var bt;(function(i){i[i.NONE=0]="NONE",i[i.Schema=1]="Schema",i[i.DictionaryBatch=2]="DictionaryBatch",i[i.RecordBatch=3]="RecordBatch",i[i.Tensor=4]="Tensor",i[i.SparseTensor=5]="SparseTensor"})(bt||(bt={}));var j;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.Float=3]="Float",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct=13]="Struct",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.LargeBinary=19]="LargeBinary",i[i.LargeUtf8=20]="LargeUtf8",i[i.Dictionary=-1]="Dictionary",i[i.Int8=-2]="Int8",i[i.Int16=-3]="Int16",i[i.Int32=-4]="Int32",i[i.Int64=-5]="Int64",i[i.Uint8=-6]="Uint8",i[i.Uint16=-7]="Uint16",i[i.Uint32=-8]="Uint32",i[i.Uint64=-9]="Uint64",i[i.Float16=-10]="Float16",i[i.Float32=-11]="Float32",i[i.Float64=-12]="Float64",i[i.DateDay=-13]="DateDay",i[i.DateMillisecond=-14]="DateMillisecond",i[i.TimestampSecond=-15]="TimestampSecond",i[i.TimestampMillisecond=-16]="TimestampMillisecond",i[i.TimestampMicrosecond=-17]="TimestampMicrosecond",i[i.TimestampNanosecond=-18]="TimestampNanosecond",i[i.TimeSecond=-19]="TimeSecond",i[i.TimeMillisecond=-20]="TimeMillisecond",i[i.TimeMicrosecond=-21]="TimeMicrosecond",i[i.TimeNanosecond=-22]="TimeNanosecond",i[i.DenseUnion=-23]="DenseUnion",i[i.SparseUnion=-24]="SparseUnion",i[i.IntervalDayTime=-25]="IntervalDayTime",i[i.IntervalYearMonth=-26]="IntervalYearMonth",i[i.DurationSecond=-27]="DurationSecond",i[i.DurationMillisecond=-28]="DurationMillisecond",i[i.DurationMicrosecond=-29]="DurationMicrosecond",i[i.DurationNanosecond=-30]="DurationNanosecond"})(j||(j={}));var je;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(je||(je={}));var qa={};$i(qa,{clampRange:()=>On,createElementComparator:()=>rr,wrapIndex:()=>fr});var Aa={};$i(Aa,{valueToString:()=>Ne});function Ne(i){if(i===null)return"null";if(i===void 0)return"undefined";switch(typeof i){case"number":return"".concat(i);case"bigint":return"".concat(i);case"string":return'"'.concat(i,'"')}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?"[".concat([...i].map(t=>Ne(t)),"]"):"[".concat(i,"]"):ArrayBuffer.isView(i)?"[".concat(i,"]"):JSON.stringify(i,(t,e)=>typeof e=="bigint"?"".concat(e):e)}var Ua={};$i(Ua,{BN:()=>En,bigNumToBigInt:()=>ll,bigNumToNumber:()=>Ea,bigNumToString:()=>Nr,isArrowBigNumSymbol:()=>cl});function wt(i){if(typeof i=="bigint"&&(i<Number.MIN_SAFE_INTEGER||i>Number.MAX_SAFE_INTEGER))throw new TypeError("".concat(i," is not safe to convert to a number."));return Number(i)}function xa(i,t){return wt(i/t)+wt(i%t)/wt(t)}var cl=Symbol.for("isArrowBigNum");function Pe(i,...t){return t.length===0?Object.setPrototypeOf(pt(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}Pe.prototype[cl]=!0;Pe.prototype.toJSON=function(){return'"'.concat(Nr(this),'"')};Pe.prototype.valueOf=function(i){return Ea(this,i)};Pe.prototype.toString=function(){return Nr(this)};Pe.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return Ea(this);case"string":return Nr(this);case"default":return ll(this)}return Nr(this)};function Rr(...i){return Pe.apply(this,i)}function Lr(...i){return Pe.apply(this,i)}function kn(...i){return Pe.apply(this,i)}Object.setPrototypeOf(Rr.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Lr.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(kn.prototype,Object.create(Uint32Array.prototype));Object.assign(Rr.prototype,Pe.prototype,{constructor:Rr,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Lr.prototype,Pe.prototype,{constructor:Lr,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(kn.prototype,Pe.prototype,{constructor:kn,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var og=BigInt(4294967296)*BigInt(4294967296),ag=og-BigInt(1);function Ea(i,t){let{buffer:e,byteOffset:r,byteLength:s,signed:d}=i,_=new BigUint64Array(e,r,s/8),b=d&&_.at(-1)&BigInt(1)<<BigInt(63),g=BigInt(0),I=0;if(b){for(let B of _)g|=(B^ag)*(BigInt(1)<<BigInt(64*I++));g*=BigInt(-1),g-=BigInt(1)}else for(let B of _)g|=B*(BigInt(1)<<BigInt(64*I++));if(typeof t=="number"){let B=BigInt(Math.pow(10,t)),U=g/B,C=g%B;return wt(U)+wt(C)/wt(B)}return wt(g)}function Nr(i){if(i.byteLength===8){let d=new i.BigIntArray(i.buffer,i.byteOffset,1);return"".concat(d[0])}if(!i.signed)return ka(i);let t=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return ka(i);t=t.slice();let r=1;for(let d=0;d<t.length;d++){let _=t[d],b=~_+r;t[d]=b,r&=_===0?1:0}let s=ka(t);return"-".concat(s)}function ll(i){return i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:Nr(i)}function ka(i){let t="",e=new Uint32Array(2),r=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),s=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),d=-1,_=r.length-1;do{for(e[0]=r[d=0];d<_;)r[d++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+r[d];r[d]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t="".concat(e[0]).concat(t)}while(s[0]||s[1]||s[2]||s[3]);return t!=null?t:"0"}var En=class i{static new(t,e){switch(e){case!0:return new Rr(t);case!1:return new Lr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Rr(t)}return t.byteLength===16?new kn(t):new Lr(t)}static signed(t){return new Rr(t)}static unsigned(t){return new Lr(t)}static decimal(t){return new kn(t)}constructor(t,e){return i.new(t,e)}};var ul,hl,dl,fl,pl,_l,yl,ml,bl,vl,gl,wl,Sl,Il,Tl,jl,Bl,Dl,Fl,Al,xl,kl,V=class i{static isNull(t){return(t==null?void 0:t.typeId)===j.Null}static isInt(t){return(t==null?void 0:t.typeId)===j.Int}static isFloat(t){return(t==null?void 0:t.typeId)===j.Float}static isBinary(t){return(t==null?void 0:t.typeId)===j.Binary}static isLargeBinary(t){return(t==null?void 0:t.typeId)===j.LargeBinary}static isUtf8(t){return(t==null?void 0:t.typeId)===j.Utf8}static isLargeUtf8(t){return(t==null?void 0:t.typeId)===j.LargeUtf8}static isBool(t){return(t==null?void 0:t.typeId)===j.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===j.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===j.Date}static isTime(t){return(t==null?void 0:t.typeId)===j.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===j.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===j.Interval}static isDuration(t){return(t==null?void 0:t.typeId)===j.Duration}static isList(t){return(t==null?void 0:t.typeId)===j.List}static isStruct(t){return(t==null?void 0:t.typeId)===j.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===j.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===j.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===j.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===j.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===j.Dictionary}static isDenseUnion(t){return i.isUnion(t)&&t.mode===Et.Dense}static isSparseUnion(t){return i.isUnion(t)&&t.mode===Et.Sparse}constructor(t){this.typeId=t}};ul=Symbol.toStringTag;V[ul]=(i=>(i.children=null,i.ArrayType=Array,i.OffsetArrayType=Int32Array,i[Symbol.toStringTag]="DataType"))(V.prototype);var ae=class extends V{constructor(){super(j.Null)}toString(){return"Null"}};hl=Symbol.toStringTag;ae[hl]=(i=>i[Symbol.toStringTag]="Null")(ae.prototype);var Xt=class extends V{constructor(t,e){super(j.Int),this.isSigned=t,this.bitWidth=e}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)}};dl=Symbol.toStringTag;Xt[dl]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Xt.prototype);var Ms=class extends Xt{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Rs=class extends Xt{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},oi=class extends Xt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Ls=class extends Xt{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Ns=class extends Xt{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Ps=class extends Xt{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Vs=class extends Xt{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Hs=class extends Xt{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Ms.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Rs.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(oi.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Ls.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ns.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Ps.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Vs.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Hs.prototype,"ArrayType",{value:BigUint64Array});var Be=class extends V{constructor(t){super(j.Float),this.precision=t}get ArrayType(){switch(this.precision){case kt.HALF:return Uint16Array;case kt.SINGLE:return Float32Array;case kt.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}};fl=Symbol.toStringTag;Be[fl]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(Be.prototype);var zs=class extends Be{constructor(){super(kt.HALF)}},Ws=class extends Be{constructor(){super(kt.SINGLE)}},$s=class extends Be{constructor(){super(kt.DOUBLE)}};Object.defineProperty(zs.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ws.prototype,"ArrayType",{value:Float32Array});Object.defineProperty($s.prototype,"ArrayType",{value:Float64Array});var mi=class extends V{constructor(){super(j.Binary)}toString(){return"Binary"}};pl=Symbol.toStringTag;mi[pl]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(mi.prototype);var bi=class extends V{constructor(){super(j.LargeBinary)}toString(){return"LargeBinary"}};_l=Symbol.toStringTag;bi[_l]=(i=>(i.ArrayType=Uint8Array,i.OffsetArrayType=BigInt64Array,i[Symbol.toStringTag]="LargeBinary"))(bi.prototype);var vi=class extends V{constructor(){super(j.Utf8)}toString(){return"Utf8"}};yl=Symbol.toStringTag;vi[yl]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(vi.prototype);var gi=class extends V{constructor(){super(j.LargeUtf8)}toString(){return"LargeUtf8"}};ml=Symbol.toStringTag;gi[ml]=(i=>(i.ArrayType=Uint8Array,i.OffsetArrayType=BigInt64Array,i[Symbol.toStringTag]="LargeUtf8"))(gi.prototype);var wi=class extends V{constructor(){super(j.Bool)}toString(){return"Bool"}};bl=Symbol.toStringTag;wi[bl]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(wi.prototype);var Si=class extends V{constructor(t,e,r=128){super(j.Decimal),this.scale=t,this.precision=e,this.bitWidth=r}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}};vl=Symbol.toStringTag;Si[vl]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Si.prototype);var Ii=class extends V{constructor(t){super(j.Date),this.unit=t}toString(){return"Date".concat((this.unit+1)*32,"<").concat(Ht[this.unit],">")}get ArrayType(){return this.unit===Ht.DAY?Int32Array:BigInt64Array}};gl=Symbol.toStringTag;Ii[gl]=(i=>(i.unit=null,i[Symbol.toStringTag]="Date"))(Ii.prototype);var Ti=class extends V{constructor(t,e){super(j.Time),this.unit=t,this.bitWidth=e}toString(){return"Time".concat(this.bitWidth,"<").concat(z[this.unit],">")}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}};wl=Symbol.toStringTag;Ti[wl]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(Ti.prototype);var ji=class extends V{constructor(t,e){super(j.Timestamp),this.unit=t,this.timezone=e}toString(){return"Timestamp<".concat(z[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}};Sl=Symbol.toStringTag;ji[Sl]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Timestamp"))(ji.prototype);var Bi=class extends V{constructor(t){super(j.Interval),this.unit=t}toString(){return"Interval<".concat(Yt[this.unit],">")}};Il=Symbol.toStringTag;Bi[Il]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(Bi.prototype);var Di=class extends V{constructor(t){super(j.Duration),this.unit=t}toString(){return"Duration<".concat(z[this.unit],">")}};Tl=Symbol.toStringTag;Di[Tl]=(i=>(i.unit=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Duration"))(Di.prototype);var Ve=class extends V{constructor(t){super(j.List),this.children=[t]}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}};jl=Symbol.toStringTag;Ve[jl]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(Ve.prototype);var Ct=class extends V{constructor(t){super(j.Struct),this.children=t}toString(){return"Struct<{".concat(this.children.map(t=>"".concat(t.name,":").concat(t.type)).join(", "),"}>")}};Bl=Symbol.toStringTag;Ct[Bl]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(Ct.prototype);var He=class extends V{constructor(t,e,r){super(j.Union),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((s,d,_)=>(s[d]=_)&&s||s,Object.create(null))}toString(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map(t=>"".concat(t.type)).join(" | "),">")}};Dl=Symbol.toStringTag;He[Dl]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(He.prototype);var Fi=class extends V{constructor(t){super(j.FixedSizeBinary),this.byteWidth=t}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}};Fl=Symbol.toStringTag;Fi[Fl]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Fi.prototype);var ze=class extends V{constructor(t,e){super(j.FixedSizeList),this.listSize=t,this.children=[e]}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,">")}};Al=Symbol.toStringTag;ze[Al]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(ze.prototype);var We=class extends V{constructor(t,e=!1){var r,s,d;if(super(j.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((r=t==null?void 0:t.type)===null||r===void 0)&&r.children)){let _=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[0];_&&(_.name="key");let b=(d=t==null?void 0:t.type)===null||d===void 0?void 0:d.children[1];b&&(b.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(t=>"".concat(t.name,":").concat(t.type)).join(", "),"}>")}};xl=Symbol.toStringTag;We[xl]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(We.prototype);var cg=(i=>()=>++i)(-1),ge=class extends V{constructor(t,e,r,s){super(j.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=s||!1,this.id=r==null?cg():wt(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,">")}};kl=Symbol.toStringTag;ge[kl]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(ge.prototype);function we(i){let t=i;switch(i.typeId){case j.Decimal:return i.bitWidth/32;case j.Interval:return 1+t.unit;case j.FixedSizeList:return t.listSize;case j.FixedSizeBinary:return t.byteWidth;default:return 1}}var J=class{visitMany(t,...e){return t.map((r,s)=>this.visit(r,...e.map(d=>d[s])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return lg(this,t,e)}getVisitFnByTypeId(t,e=!0){return Pr(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function lg(i,t,e=!0){return typeof t=="number"?Pr(i,t,e):typeof t=="string"&&t in j?Pr(i,j[t],e):t&&t instanceof V?Pr(i,El(t),e):t!=null&&t.type&&t.type instanceof V?Pr(i,El(t.type),e):Pr(i,j.NONE,e)}function Pr(i,t,e=!0){let r=null;switch(t){case j.Null:r=i.visitNull;break;case j.Bool:r=i.visitBool;break;case j.Int:r=i.visitInt;break;case j.Int8:r=i.visitInt8||i.visitInt;break;case j.Int16:r=i.visitInt16||i.visitInt;break;case j.Int32:r=i.visitInt32||i.visitInt;break;case j.Int64:r=i.visitInt64||i.visitInt;break;case j.Uint8:r=i.visitUint8||i.visitInt;break;case j.Uint16:r=i.visitUint16||i.visitInt;break;case j.Uint32:r=i.visitUint32||i.visitInt;break;case j.Uint64:r=i.visitUint64||i.visitInt;break;case j.Float:r=i.visitFloat;break;case j.Float16:r=i.visitFloat16||i.visitFloat;break;case j.Float32:r=i.visitFloat32||i.visitFloat;break;case j.Float64:r=i.visitFloat64||i.visitFloat;break;case j.Utf8:r=i.visitUtf8;break;case j.LargeUtf8:r=i.visitLargeUtf8;break;case j.Binary:r=i.visitBinary;break;case j.LargeBinary:r=i.visitLargeBinary;break;case j.FixedSizeBinary:r=i.visitFixedSizeBinary;break;case j.Date:r=i.visitDate;break;case j.DateDay:r=i.visitDateDay||i.visitDate;break;case j.DateMillisecond:r=i.visitDateMillisecond||i.visitDate;break;case j.Timestamp:r=i.visitTimestamp;break;case j.TimestampSecond:r=i.visitTimestampSecond||i.visitTimestamp;break;case j.TimestampMillisecond:r=i.visitTimestampMillisecond||i.visitTimestamp;break;case j.TimestampMicrosecond:r=i.visitTimestampMicrosecond||i.visitTimestamp;break;case j.TimestampNanosecond:r=i.visitTimestampNanosecond||i.visitTimestamp;break;case j.Time:r=i.visitTime;break;case j.TimeSecond:r=i.visitTimeSecond||i.visitTime;break;case j.TimeMillisecond:r=i.visitTimeMillisecond||i.visitTime;break;case j.TimeMicrosecond:r=i.visitTimeMicrosecond||i.visitTime;break;case j.TimeNanosecond:r=i.visitTimeNanosecond||i.visitTime;break;case j.Decimal:r=i.visitDecimal;break;case j.List:r=i.visitList;break;case j.Struct:r=i.visitStruct;break;case j.Union:r=i.visitUnion;break;case j.DenseUnion:r=i.visitDenseUnion||i.visitUnion;break;case j.SparseUnion:r=i.visitSparseUnion||i.visitUnion;break;case j.Dictionary:r=i.visitDictionary;break;case j.Interval:r=i.visitInterval;break;case j.IntervalDayTime:r=i.visitIntervalDayTime||i.visitInterval;break;case j.IntervalYearMonth:r=i.visitIntervalYearMonth||i.visitInterval;break;case j.Duration:r=i.visitDuration;break;case j.DurationSecond:r=i.visitDurationSecond||i.visitDuration;break;case j.DurationMillisecond:r=i.visitDurationMillisecond||i.visitDuration;break;case j.DurationMicrosecond:r=i.visitDurationMicrosecond||i.visitDuration;break;case j.DurationNanosecond:r=i.visitDurationNanosecond||i.visitDuration;break;case j.FixedSizeList:r=i.visitFixedSizeList;break;case j.Map:r=i.visitMap;break}if(typeof r=="function")return r;if(!e)return()=>null;throw new Error("Unrecognized type '".concat(j[t],"'"))}function El(i){switch(i.typeId){case j.Null:return j.Null;case j.Int:{let{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?j.Int8:j.Uint8;case 16:return e?j.Int16:j.Uint16;case 32:return e?j.Int32:j.Uint32;case 64:return e?j.Int64:j.Uint64}return j.Int}case j.Float:switch(i.precision){case kt.HALF:return j.Float16;case kt.SINGLE:return j.Float32;case kt.DOUBLE:return j.Float64}return j.Float;case j.Binary:return j.Binary;case j.LargeBinary:return j.LargeBinary;case j.Utf8:return j.Utf8;case j.LargeUtf8:return j.LargeUtf8;case j.Bool:return j.Bool;case j.Decimal:return j.Decimal;case j.Time:switch(i.unit){case z.SECOND:return j.TimeSecond;case z.MILLISECOND:return j.TimeMillisecond;case z.MICROSECOND:return j.TimeMicrosecond;case z.NANOSECOND:return j.TimeNanosecond}return j.Time;case j.Timestamp:switch(i.unit){case z.SECOND:return j.TimestampSecond;case z.MILLISECOND:return j.TimestampMillisecond;case z.MICROSECOND:return j.TimestampMicrosecond;case z.NANOSECOND:return j.TimestampNanosecond}return j.Timestamp;case j.Date:switch(i.unit){case Ht.DAY:return j.DateDay;case Ht.MILLISECOND:return j.DateMillisecond}return j.Date;case j.Interval:switch(i.unit){case Yt.DAY_TIME:return j.IntervalDayTime;case Yt.YEAR_MONTH:return j.IntervalYearMonth}return j.Interval;case j.Duration:switch(i.unit){case z.SECOND:return j.DurationSecond;case z.MILLISECOND:return j.DurationMillisecond;case z.MICROSECOND:return j.DurationMicrosecond;case z.NANOSECOND:return j.DurationNanosecond}return j.Duration;case j.Map:return j.Map;case j.List:return j.List;case j.Struct:return j.Struct;case j.Union:switch(i.mode){case Et.Dense:return j.DenseUnion;case Et.Sparse:return j.SparseUnion}return j.Union;case j.FixedSizeBinary:return j.FixedSizeBinary;case j.FixedSizeList:return j.FixedSizeList;case j.Dictionary:return j.Dictionary}throw new Error("Unrecognized type '".concat(j[i.typeId],"'"))}J.prototype.visitInt8=null;J.prototype.visitInt16=null;J.prototype.visitInt32=null;J.prototype.visitInt64=null;J.prototype.visitUint8=null;J.prototype.visitUint16=null;J.prototype.visitUint32=null;J.prototype.visitUint64=null;J.prototype.visitFloat16=null;J.prototype.visitFloat32=null;J.prototype.visitFloat64=null;J.prototype.visitDateDay=null;J.prototype.visitDateMillisecond=null;J.prototype.visitTimestampSecond=null;J.prototype.visitTimestampMillisecond=null;J.prototype.visitTimestampMicrosecond=null;J.prototype.visitTimestampNanosecond=null;J.prototype.visitTimeSecond=null;J.prototype.visitTimeMillisecond=null;J.prototype.visitTimeMicrosecond=null;J.prototype.visitTimeNanosecond=null;J.prototype.visitDenseUnion=null;J.prototype.visitSparseUnion=null;J.prototype.visitIntervalDayTime=null;J.prototype.visitIntervalYearMonth=null;J.prototype.visitDuration=null;J.prototype.visitDurationSecond=null;J.prototype.visitDurationMillisecond=null;J.prototype.visitDurationMicrosecond=null;J.prototype.visitDurationNanosecond=null;var Oa={};$i(Oa,{float64ToUint16:()=>Un,uint16ToFloat64:()=>Gs});var Ul=new Float64Array(1),Vr=new Uint32Array(Ul.buffer);function Gs(i){let t=(i&31744)>>10,e=(i&1023)/1024,r=Math.pow(-1,(i&32768)>>15);switch(t){case 31:return r*(e?Number.NaN:1/0);case 0:return r*(e?6103515625e-14*e:0)}return r*Math.pow(2,t-15)*(1+e)}function Un(i){if(i!==i)return 32256;Ul[0]=i;let t=(Vr[1]&2147483648)>>16&65535,e=Vr[1]&2146435072,r=0;return e>=1089470464?Vr[0]>0?e=31744:(e=(e&2080374784)>>16,r=(Vr[1]&1048575)>>10):e<=1056964608?(r=1048576+(Vr[1]&1048575),r=1048576+(r<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,r=(Vr[1]&1048575)+512>>10),t|e|r&65535}var et=class extends J{};function at(i){return(t,e,r)=>{if(t.setValid(e,r!=null))return i(t,e,r)}}var ug=(i,t,e)=>{i[t]=Math.floor(e/864e5)},Ol=(i,t,e,r)=>{if(e+1<t.length){let s=wt(t[e]),d=wt(t[e+1]);i.set(r.subarray(0,d-s),s)}},hg=({offset:i,values:t},e,r)=>{let s=i+e;r?t[s>>3]|=1<<s%8:t[s>>3]&=~(1<<s%8)},Ai=({values:i},t,e)=>{i[t]=e},Ca=({values:i},t,e)=>{i[t]=e},Cl=({values:i},t,e)=>{i[t]=Un(e)},dg=(i,t,e)=>{switch(i.type.precision){case kt.HALF:return Cl(i,t,e);case kt.SINGLE:case kt.DOUBLE:return Ca(i,t,e)}},Ks=({values:i},t,e)=>{ug(i,t,e.valueOf())},qs=({values:i},t,e)=>{i[t]=BigInt(e)},Ma=({stride:i,values:t},e,r)=>{t.set(r.subarray(0,i),i*e)},Ml=({values:i,valueOffsets:t},e,r)=>Ol(i,t,e,r),Rl=({values:i,valueOffsets:t},e,r)=>Ol(i,t,e,ei(r)),Ra=(i,t,e)=>{i.type.unit===Ht.DAY?Ks(i,t,e):qs(i,t,e)},Ys=({values:i},t,e)=>{i[t]=BigInt(e/1e3)},Js=({values:i},t,e)=>{i[t]=BigInt(e)},Xs=({values:i},t,e)=>{i[t]=BigInt(e*1e3)},Zs=({values:i},t,e)=>{i[t]=BigInt(e*1e6)},La=(i,t,e)=>{switch(i.type.unit){case z.SECOND:return Ys(i,t,e);case z.MILLISECOND:return Js(i,t,e);case z.MICROSECOND:return Xs(i,t,e);case z.NANOSECOND:return Zs(i,t,e)}},Qs=({values:i},t,e)=>{i[t]=e},to=({values:i},t,e)=>{i[t]=e},eo=({values:i},t,e)=>{i[t]=e},io=({values:i},t,e)=>{i[t]=e},Na=(i,t,e)=>{switch(i.type.unit){case z.SECOND:return Qs(i,t,e);case z.MILLISECOND:return to(i,t,e);case z.MICROSECOND:return eo(i,t,e);case z.NANOSECOND:return io(i,t,e)}},Pa=({values:i,stride:t},e,r)=>{i.set(r.subarray(0,t),t*e)},fg=(i,t,e)=>{let r=i.children[0],s=i.valueOffsets,d=ee.getVisitFn(r);if(Array.isArray(e))for(let _=-1,b=s[t],g=s[t+1];b<g;)d(r,b++,e[++_]);else for(let _=-1,b=s[t],g=s[t+1];b<g;)d(r,b++,e.get(++_))},pg=(i,t,e)=>{let r=i.children[0],{valueOffsets:s}=i,d=ee.getVisitFn(r),{[t]:_,[t+1]:b}=s,g=e instanceof Map?e.entries():Object.entries(e);for(let I of g)if(d(r,_,I),++_>=b)break},_g=(i,t)=>(e,r,s,d)=>r&&e(r,i,t[d]),yg=(i,t)=>(e,r,s,d)=>r&&e(r,i,t.get(d)),mg=(i,t)=>(e,r,s,d)=>r&&e(r,i,t.get(s.name)),bg=(i,t)=>(e,r,s,d)=>r&&e(r,i,t[s.name]),vg=(i,t,e)=>{let r=i.type.children.map(d=>ee.getVisitFn(d.type)),s=e instanceof Map?mg(t,e):e instanceof vt?yg(t,e):Array.isArray(e)?_g(t,e):bg(t,e);i.type.children.forEach((d,_)=>s(r[_],i.children[_],d,_))},gg=(i,t,e)=>{i.type.mode===Et.Dense?Ll(i,t,e):Nl(i,t,e)},Ll=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[r];ee.visit(s,i.valueOffsets[t],e)},Nl=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[r];ee.visit(s,t,e)},wg=(i,t,e)=>{var r;(r=i.dictionary)===null||r===void 0||r.set(i.values[t],e)},Va=(i,t,e)=>{i.type.unit===Yt.DAY_TIME?ro(i,t,e):no(i,t,e)},ro=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},no=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},so=({values:i},t,e)=>{i[t]=e},oo=({values:i},t,e)=>{i[t]=e},ao=({values:i},t,e)=>{i[t]=e},co=({values:i},t,e)=>{i[t]=e},Ha=(i,t,e)=>{switch(i.type.unit){case z.SECOND:return so(i,t,e);case z.MILLISECOND:return oo(i,t,e);case z.MICROSECOND:return ao(i,t,e);case z.NANOSECOND:return co(i,t,e)}},Sg=(i,t,e)=>{let{stride:r}=i,s=i.children[0],d=ee.getVisitFn(s);if(Array.isArray(e))for(let _=-1,b=t*r;++_<r;)d(s,b+_,e[_]);else for(let _=-1,b=t*r;++_<r;)d(s,b+_,e.get(_))};et.prototype.visitBool=at(hg);et.prototype.visitInt=at(Ai);et.prototype.visitInt8=at(Ai);et.prototype.visitInt16=at(Ai);et.prototype.visitInt32=at(Ai);et.prototype.visitInt64=at(Ai);et.prototype.visitUint8=at(Ai);et.prototype.visitUint16=at(Ai);et.prototype.visitUint32=at(Ai);et.prototype.visitUint64=at(Ai);et.prototype.visitFloat=at(dg);et.prototype.visitFloat16=at(Cl);et.prototype.visitFloat32=at(Ca);et.prototype.visitFloat64=at(Ca);et.prototype.visitUtf8=at(Rl);et.prototype.visitLargeUtf8=at(Rl);et.prototype.visitBinary=at(Ml);et.prototype.visitLargeBinary=at(Ml);et.prototype.visitFixedSizeBinary=at(Ma);et.prototype.visitDate=at(Ra);et.prototype.visitDateDay=at(Ks);et.prototype.visitDateMillisecond=at(qs);et.prototype.visitTimestamp=at(La);et.prototype.visitTimestampSecond=at(Ys);et.prototype.visitTimestampMillisecond=at(Js);et.prototype.visitTimestampMicrosecond=at(Xs);et.prototype.visitTimestampNanosecond=at(Zs);et.prototype.visitTime=at(Na);et.prototype.visitTimeSecond=at(Qs);et.prototype.visitTimeMillisecond=at(to);et.prototype.visitTimeMicrosecond=at(eo);et.prototype.visitTimeNanosecond=at(io);et.prototype.visitDecimal=at(Pa);et.prototype.visitList=at(fg);et.prototype.visitStruct=at(vg);et.prototype.visitUnion=at(gg);et.prototype.visitDenseUnion=at(Ll);et.prototype.visitSparseUnion=at(Nl);et.prototype.visitDictionary=at(wg);et.prototype.visitInterval=at(Va);et.prototype.visitIntervalDayTime=at(ro);et.prototype.visitIntervalYearMonth=at(no);et.prototype.visitDuration=at(Ha);et.prototype.visitDurationSecond=at(so);et.prototype.visitDurationMillisecond=at(oo);et.prototype.visitDurationMicrosecond=at(ao);et.prototype.visitDurationNanosecond=at(co);et.prototype.visitFixedSizeList=at(Sg);et.prototype.visitMap=at(pg);var ee=new et;var $e=Symbol.for("parent"),Hr=Symbol.for("rowIndex"),tr=class{constructor(t,e){return this[$e]=t,this[Hr]=e,new Proxy(this,new Wa)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Hr],e=this[$e],r=e.type.children,s={};for(let d=-1,_=r.length;++d<_;)s[r[d].name]=Gt.visit(e.children[d],t);return s}toString(){return"{".concat([...this].map(([t,e])=>"".concat(Ne(t),": ").concat(Ne(e))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new za(this[$e],this[Hr])}},za=class{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,Gt.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(tr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[$e]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Hr]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Wa=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[$e].type.children.map(e=>e.name)}has(t,e){return t[$e].type.children.findIndex(r=>r.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[$e].type.children.findIndex(r=>r.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[$e].type.children.findIndex(s=>s.name===e);if(r!==-1){let s=Gt.visit(t[$e].children[r],t[Hr]);return Reflect.set(t,e,s),s}}set(t,e,r){let s=t[$e].type.children.findIndex(d=>d.name===e);return s!==-1?(ee.visit(t[$e].children[s],t[Hr],r),Reflect.set(t,e,r)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,r):!1}};var X=class extends J{};function nt(i){return(t,e)=>t.getValid(e)?i(t,e):null}var Ig=(i,t)=>864e5*i[t],Tg=(i,t)=>null,Pl=(i,t,e)=>{if(e+1>=t.length)return null;let r=wt(t[e]),s=wt(t[e+1]);return i.subarray(r,s)},jg=({offset:i,values:t},e)=>{let r=i+e;return(t[r>>3]&1<<r%8)!==0},Vl=({values:i},t)=>Ig(i,t),Hl=({values:i},t)=>wt(i[t]),er=({stride:i,values:t},e)=>t[i*e],Bg=({stride:i,values:t},e)=>Gs(t[i*e]),zl=({values:i},t)=>i[t],Dg=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),Wl=({values:i,valueOffsets:t},e)=>Pl(i,t,e),$l=({values:i,valueOffsets:t},e)=>{let r=Pl(i,t,e);return r!==null?yn(r):null},Fg=({values:i},t)=>i[t],Ag=({type:i,values:t},e)=>i.precision!==kt.HALF?t[e]:Gs(t[e]),xg=(i,t)=>i.type.unit===Ht.DAY?Vl(i,t):Hl(i,t),Gl=({values:i},t)=>1e3*wt(i[t]),Kl=({values:i},t)=>wt(i[t]),ql=({values:i},t)=>xa(i[t],BigInt(1e3)),Yl=({values:i},t)=>xa(i[t],BigInt(1e6)),kg=(i,t)=>{switch(i.type.unit){case z.SECOND:return Gl(i,t);case z.MILLISECOND:return Kl(i,t);case z.MICROSECOND:return ql(i,t);case z.NANOSECOND:return Yl(i,t)}},Jl=({values:i},t)=>i[t],Xl=({values:i},t)=>i[t],Zl=({values:i},t)=>i[t],Ql=({values:i},t)=>i[t],Eg=(i,t)=>{switch(i.type.unit){case z.SECOND:return Jl(i,t);case z.MILLISECOND:return Xl(i,t);case z.MICROSECOND:return Zl(i,t);case z.NANOSECOND:return Ql(i,t)}},Ug=({values:i,stride:t},e)=>En.decimal(i.subarray(t*e,t*(e+1))),Og=(i,t)=>{let{valueOffsets:e,stride:r,children:s}=i,{[t*r]:d,[t*r+1]:_}=e,g=s[0].slice(d,_-d);return new vt([g])},Cg=(i,t)=>{let{valueOffsets:e,children:r}=i,{[t]:s,[t+1]:d}=e,_=r[0];return new ai(_.slice(s,d-s))},Mg=(i,t)=>new tr(i,t),Rg=(i,t)=>i.type.mode===Et.Dense?tu(i,t):eu(i,t),tu=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Gt.visit(r,i.valueOffsets[t])},eu=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Gt.visit(r,t)},Lg=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},Ng=(i,t)=>i.type.unit===Yt.DAY_TIME?iu(i,t):ru(i,t),iu=({values:i},t)=>i.subarray(2*t,2*(t+1)),ru=({values:i},t)=>{let e=i[t],r=new Int32Array(2);return r[0]=Math.trunc(e/12),r[1]=Math.trunc(e%12),r},nu=({values:i},t)=>i[t],su=({values:i},t)=>i[t],ou=({values:i},t)=>i[t],au=({values:i},t)=>i[t],Pg=(i,t)=>{switch(i.type.unit){case z.SECOND:return nu(i,t);case z.MILLISECOND:return su(i,t);case z.MICROSECOND:return ou(i,t);case z.NANOSECOND:return au(i,t)}},Vg=(i,t)=>{let{stride:e,children:r}=i,d=r[0].slice(t*e,e);return new vt([d])};X.prototype.visitNull=nt(Tg);X.prototype.visitBool=nt(jg);X.prototype.visitInt=nt(Fg);X.prototype.visitInt8=nt(er);X.prototype.visitInt16=nt(er);X.prototype.visitInt32=nt(er);X.prototype.visitInt64=nt(zl);X.prototype.visitUint8=nt(er);X.prototype.visitUint16=nt(er);X.prototype.visitUint32=nt(er);X.prototype.visitUint64=nt(zl);X.prototype.visitFloat=nt(Ag);X.prototype.visitFloat16=nt(Bg);X.prototype.visitFloat32=nt(er);X.prototype.visitFloat64=nt(er);X.prototype.visitUtf8=nt($l);X.prototype.visitLargeUtf8=nt($l);X.prototype.visitBinary=nt(Wl);X.prototype.visitLargeBinary=nt(Wl);X.prototype.visitFixedSizeBinary=nt(Dg);X.prototype.visitDate=nt(xg);X.prototype.visitDateDay=nt(Vl);X.prototype.visitDateMillisecond=nt(Hl);X.prototype.visitTimestamp=nt(kg);X.prototype.visitTimestampSecond=nt(Gl);X.prototype.visitTimestampMillisecond=nt(Kl);X.prototype.visitTimestampMicrosecond=nt(ql);X.prototype.visitTimestampNanosecond=nt(Yl);X.prototype.visitTime=nt(Eg);X.prototype.visitTimeSecond=nt(Jl);X.prototype.visitTimeMillisecond=nt(Xl);X.prototype.visitTimeMicrosecond=nt(Zl);X.prototype.visitTimeNanosecond=nt(Ql);X.prototype.visitDecimal=nt(Ug);X.prototype.visitList=nt(Og);X.prototype.visitStruct=nt(Mg);X.prototype.visitUnion=nt(Rg);X.prototype.visitDenseUnion=nt(tu);X.prototype.visitSparseUnion=nt(eu);X.prototype.visitDictionary=nt(Lg);X.prototype.visitInterval=nt(Ng);X.prototype.visitIntervalDayTime=nt(iu);X.prototype.visitIntervalYearMonth=nt(ru);X.prototype.visitDuration=nt(Pg);X.prototype.visitDurationSecond=nt(nu);X.prototype.visitDurationMillisecond=nt(su);X.prototype.visitDurationMicrosecond=nt(ou);X.prototype.visitDurationNanosecond=nt(au);X.prototype.visitFixedSizeList=nt(Vg);X.prototype.visitMap=nt(Cg);var Gt=new X;var ir=Symbol.for("keys"),Wr=Symbol.for("vals"),zr=Symbol.for("kKeysAsStrings"),$a=Symbol.for("_kKeysAsStrings"),ai=class{constructor(t){return this[ir]=new vt([t.children[0]]).memoize(),this[Wr]=t.children[1],new Proxy(this,new Ka)}get[zr](){return this[$a]||(this[$a]=Array.from(this[ir].toArray(),String))}[Symbol.iterator](){return new Ga(this[ir],this[Wr])}get size(){return this[ir].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[ir],e=this[Wr],r={};for(let s=-1,d=t.length;++s<d;)r[t.get(s)]=Gt.visit(e,s);return r}toString(){return"{".concat([...this].map(([t,e])=>"".concat(Ne(t),": ").concat(Ne(e))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Ga=class{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),Gt.visit(this.vals,t)]})}},Ka=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[zr]}has(t,e){return t[zr].includes(e)}getOwnPropertyDescriptor(t,e){if(t[zr].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[zr].indexOf(e);if(r!==-1){let s=Gt.visit(Reflect.get(t,Wr),r);return Reflect.set(t,e,s),s}}set(t,e,r){let s=t[zr].indexOf(e);return s!==-1?(ee.visit(Reflect.get(t,Wr),s,r),Reflect.set(t,e,r)):Reflect.has(t,e)?Reflect.set(t,e,r):!1}};Object.defineProperties(ai.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ir]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Wr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[$a]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var cu;function On(i,t,e,r){let{length:s=0}=i,d=typeof t!="number"?0:t,_=typeof e!="number"?s:e;return d<0&&(d=(d%s+s)%s),_<0&&(_=(_%s+s)%s),_<d&&(cu=d,d=_,_=cu),_>s&&(_=s),r?r(i,d,_):[d,_]}var fr=(i,t)=>i<0?t+i:i,lu=i=>i!==i;function rr(i){if(typeof i!=="object"||i===null)return lu(i)?lu:e=>e===i;if(i instanceof Date){let e=i.valueOf();return r=>r instanceof Date?r.valueOf()===e:!1}return ArrayBuffer.isView(i)?e=>e?ja(i,e):!1:i instanceof Map?zg(i):Array.isArray(i)?Hg(i):i instanceof vt?Wg(i):$g(i,!0)}function Hg(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=rr(i[e]);return lo(t)}function zg(i){let t=-1,e=[];for(let r of i.values())e[++t]=rr(r);return lo(e)}function Wg(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=rr(i.get(e));return lo(t)}function $g(i,t=!1){let e=Object.keys(i);if(!t&&e.length===0)return()=>!1;let r=[];for(let s=-1,d=e.length;++s<d;)r[s]=rr(i[e[s]]);return lo(r,e)}function lo(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return Gg(i,e);case Map:return uu(i,e,e.keys());case ai:case tr:case Object:case void 0:return uu(i,e,t||Object.keys(e))}return e instanceof vt?Kg(i,e):!1}}function Gg(i,t){let e=i.length;if(t.length!==e)return!1;for(let r=-1;++r<e;)if(!i[r](t[r]))return!1;return!0}function Kg(i,t){let e=i.length;if(t.length!==e)return!1;for(let r=-1;++r<e;)if(!i[r](t.get(r)))return!1;return!0}function uu(i,t,e){let r=e[Symbol.iterator](),s=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),d=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),_=0,b=i.length,g=d.next(),I=r.next(),B=s.next();for(;_<b&&!I.done&&!B.done&&!g.done&&!(I.value!==B.value||!i[_](g.value));++_,I=r.next(),B=s.next(),g=d.next());return _===b&&I.done&&B.done&&g.done?!0:(r.return&&r.return(),s.return&&s.return(),d.return&&d.return(),!1)}var Ya={};$i(Ya,{BitIterator:()=>pr,getBit:()=>hu,getBool:()=>ho,packBools:()=>yr,popcnt_array:()=>du,popcnt_bit_range:()=>Cn,popcnt_uint32:()=>uo,setBool:()=>qg,truncateBitmap:()=>_r});function ho(i,t,e,r){return(e&1<<r)!==0}function hu(i,t,e,r){return(e&1<<r)>>r}function qg(i,t,e){return e?!!(i[t>>3]|=1<<t%8)||!0:!(i[t>>3]&=~(1<<t%8))&&!1}function _r(i,t,e){let r=e.byteLength+7&-8;if(i>0||e.byteLength<r){let s=new Uint8Array(r);return s.set(i%8===0?e.subarray(i>>3):yr(new pr(e,i,t,null,ho)).subarray(0,r)),s}return e}function yr(i){let t=[],e=0,r=0,s=0;for(let _ of i)_&&(s|=1<<r),++r===8&&(t[e++]=s,s=r=0);(e===0||r>0)&&(t[e++]=s);let d=new Uint8Array(t.length+7&-8);return d.set(t),d}var pr=class{constructor(t,e,r,s,d){this.bytes=t,this.length=r,this.context=s,this.get=d,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[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 Cn(i,t,e){if(e-t<=0)return 0;if(e-t<8){let d=0;for(let _ of new pr(i,t,e-t,i,hu))d+=_;return d}let r=e>>3<<3,s=t+(t%8===0?0:8-t%8);return Cn(i,t,s)+Cn(i,r,e)+du(i,s>>3,r-s>>3)}function du(i,t,e){let r=0,s=Math.trunc(t),d=new DataView(i.buffer,i.byteOffset,i.byteLength),_=e===void 0?i.byteLength:s+e;for(;_-s>=4;)r+=uo(d.getUint32(s)),s+=4;for(;_-s>=2;)r+=uo(d.getUint16(s)),s+=2;for(;_-s>=1;)r+=uo(d.getUint8(s)),s+=1;return r}function uo(i){let t=Math.trunc(i);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var Yg=-1,It=class i{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return V.isSparseUnion(t)?this.children.some(e=>e.nullable):V.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:e,values:r,nullBitmap:s,typeIds:d}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),s&&(t+=s.byteLength),d&&(t+=d.byteLength),this.children.reduce((_,b)=>_+b.byteLength,t)}get nullCount(){if(V.isUnion(this.type))return this.children.reduce((r,s)=>r+s.nullCount,0);let t=this._nullCount,e;return t<=Yg&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Cn(e,this.offset,this.offset+this.length)),t}constructor(t,e,r,s,d,_=[],b){this.type=t,this.children=_,this.dictionary=b,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let g;d instanceof i?(this.stride=d.stride,this.values=d.values,this.typeIds=d.typeIds,this.nullBitmap=d.nullBitmap,this.valueOffsets=d.valueOffsets):(this.stride=we(t),d&&((g=d[0])&&(this.valueOffsets=g),(g=d[1])&&(this.values=g),(g=d[2])&&(this.nullBitmap=g),(g=d[3])&&(this.typeIds=g)))}getValid(t){let{type:e}=this;if(V.isUnion(e)){let r=e,s=this.children[r.typeIdToChildIndex[this.typeIds[t]]],d=r.mode===Et.Dense?this.valueOffsets[t]:t;return s.getValid(d)}if(this.nullable&&this.nullCount>0){let r=this.offset+t;return(this.nullBitmap[r>>3]&1<<r%8)!==0}return!0}setValid(t,e){let r,{type:s}=this;if(V.isUnion(s)){let d=s,_=this.children[d.typeIdToChildIndex[this.typeIds[t]]],b=d.mode===Et.Dense?this.valueOffsets[t]:t;r=_.getValid(b),_.setValid(b,e)}else{let{nullBitmap:d}=this,{offset:_,length:b}=this,g=_+t,I=1<<g%8,B=g>>3;(!d||d.byteLength<=B)&&(d=new Uint8Array((_+b+63&-64)>>3).fill(255),this.nullCount>0?(d.set(_r(_,b,this.nullBitmap),0),Object.assign(this,{nullBitmap:d})):Object.assign(this,{nullBitmap:d,_nullCount:0}));let U=d[B];r=(U&I)!==0,d[B]=e?U|I:U&~I}return r!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,r=this.length,s=this._nullCount,d=this,_=this.children){return new i(t,e,r,s,d,_,this.dictionary)}slice(t,e){let{stride:r,typeId:s,children:d}=this,_=+(this._nullCount===0)-1,b=s===16?r:1,g=this._sliceBuffers(t,e,r,s);return this.clone(this.type,this.offset+t,e,_,g,d.length===0||this.valueOffsets?d:this._sliceChildren(d,b*t,b*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===j.Null)return this.clone(this.type,0,t,0);let{length:e,nullCount:r}=this,s=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);s[e>>3]=(1<<e-(e&-8))-1,r>0&&s.set(_r(this.offset,e,this.nullBitmap),0);let d=this.buffers;return d[je.VALIDITY]=s,this.clone(this.type,0,t,r+(t-e),d)}_sliceBuffers(t,e,r,s){let d,{buffers:_}=this;return(d=_[je.TYPE])&&(_[je.TYPE]=d.subarray(t,t+e)),(d=_[je.OFFSET])&&(_[je.OFFSET]=d.subarray(t,t+e+1))||(d=_[je.DATA])&&(_[je.DATA]=s===6?d:d.subarray(r*t,r*(t+e))),_}_sliceChildren(t,e,r){return t.map(s=>s.slice(e,r))}};It.prototype.children=Object.freeze([]);var Ja=class i extends J{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:e,["offset"]:r=0,["length"]:s=0}=t;return new It(e,r,s,s)}visitBool(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length>>3,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitInt(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitFloat(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitUtf8(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.data),d=rt(t.nullBitmap),_=hr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new It(e,r,b,g,[_,s,d])}visitLargeUtf8(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.data),d=rt(t.nullBitmap),_=As(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new It(e,r,b,g,[_,s,d])}visitBinary(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.data),d=rt(t.nullBitmap),_=hr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new It(e,r,b,g,[_,s,d])}visitLargeBinary(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.data),d=rt(t.nullBitmap),_=As(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new It(e,r,b,g,[_,s,d])}visitFixedSizeBinary(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitDate(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitTimestamp(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitTime(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitDecimal(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitList(t){let{["type"]:e,["offset"]:r=0,["child"]:s}=t,d=rt(t.nullBitmap),_=hr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new It(e,r,b,g,[_,void 0,d],[s])}visitStruct(t){let{["type"]:e,["offset"]:r=0,["children"]:s=[]}=t,d=rt(t.nullBitmap),{length:_=s.reduce((g,{length:I})=>Math.max(g,I),0),nullCount:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,void 0,d],s)}visitUnion(t){let{["type"]:e,["offset"]:r=0,["children"]:s=[]}=t,d=pt(e.ArrayType,t.typeIds),{["length"]:_=d.length,["nullCount"]:b=-1}=t;if(V.isSparseUnion(e))return new It(e,r,_,b,[void 0,void 0,void 0,d],s);let g=hr(t.valueOffsets);return new It(e,r,_,b,[g,void 0,void 0,d],s)}visitDictionary(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.indices.ArrayType,t.data),{["dictionary"]:_=new vt([new i().visit({type:e.dictionary})])}=t,{["length"]:b=d.length,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new It(e,r,b,g,[void 0,d,s],[],_)}visitInterval(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitDuration(t){let{["type"]:e,["offset"]:r=0}=t,s=rt(t.nullBitmap),d=pt(e.ArrayType,t.data),{["length"]:_=d.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,d,s])}visitFixedSizeList(t){let{["type"]:e,["offset"]:r=0,["child"]:s=new i().visit({type:e.valueType})}=t,d=rt(t.nullBitmap),{["length"]:_=s.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new It(e,r,_,b,[void 0,void 0,d],[s])}visitMap(t){let{["type"]:e,["offset"]:r=0,["child"]:s=new i().visit({type:e.childType})}=t,d=rt(t.nullBitmap),_=hr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new It(e,r,b,g,[_,void 0,d],[s])}},Jg=new Ja;function ct(i){return Jg.visit(i)}var Mn=class{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}};function fu(i){return i.some(t=>t.nullable)}function fo(i){return i.reduce((t,e)=>t+e.nullCount,0)}function po(i){return i.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(i.length+1))}function _o(i,t,e,r){let s=[];for(let d=-1,_=i.length;++d<_;){let b=i[d],g=t[d],{length:I}=b;if(g>=r)break;if(e>=g+I)continue;if(g>=e&&g+I<=r){s.push(b);continue}let B=Math.max(0,e-g),U=Math.min(r-g,I);s.push(b.slice(B,U-B))}return s.length===0&&s.push(i[0].slice(0,0)),s}function Xa(i,t,e,r){let s=0,d=0,_=t.length-1;do{if(s>=_-1)return e<t[_]?r(i,s,e-t[s]):null;d=s+Math.trunc((_-s)*.5),e<t[d]?_=d:s=d}while(s<_)}function Rn(i,t){return i.getValid(t)}function $r(i){function t(e,r,s){return i(e[r],s)}return function(e){let r=this.data;return Xa(r,this._offsets,e,t)}}function yo(i){let t;function e(r,s,d){return i(r[s],d,t)}return function(r,s){let d=this.data;t=s;let _=Xa(d,this._offsets,r,e);return t=void 0,_}}function mo(i){let t;function e(r,s,d){let _=d,b=0,g=0;for(let I=s-1,B=r.length;++I<B;){let U=r[I];if(~(b=i(U,t,_)))return g+b;_=0,g+=U.length}return-1}return function(r,s){t=r;let d=this.data,_=typeof s!="number"?e(d,0,0):Xa(d,this._offsets,s,e);return t=void 0,_}}var Z=class extends J{};function Xg(i,t){return t===null&&i.length>0?0:-1}function Zg(i,t){let{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let r=0;for(let s of new pr(e,i.offset+(t||0),i.length,e,ho)){if(!s)return r;++r}return-1}function lt(i,t,e){if(t===void 0)return-1;if(t===null)switch(i.typeId){case j.Union:break;case j.Dictionary:break;default:return Zg(i,e)}let r=Gt.getVisitFn(i),s=rr(t);for(let d=(e||0)-1,_=i.length;++d<_;)if(s(r(i,d)))return d;return-1}function pu(i,t,e){let r=Gt.getVisitFn(i),s=rr(t);for(let d=(e||0)-1,_=i.length;++d<_;)if(s(r(i,d)))return d;return-1}Z.prototype.visitNull=Xg;Z.prototype.visitBool=lt;Z.prototype.visitInt=lt;Z.prototype.visitInt8=lt;Z.prototype.visitInt16=lt;Z.prototype.visitInt32=lt;Z.prototype.visitInt64=lt;Z.prototype.visitUint8=lt;Z.prototype.visitUint16=lt;Z.prototype.visitUint32=lt;Z.prototype.visitUint64=lt;Z.prototype.visitFloat=lt;Z.prototype.visitFloat16=lt;Z.prototype.visitFloat32=lt;Z.prototype.visitFloat64=lt;Z.prototype.visitUtf8=lt;Z.prototype.visitLargeUtf8=lt;Z.prototype.visitBinary=lt;Z.prototype.visitLargeBinary=lt;Z.prototype.visitFixedSizeBinary=lt;Z.prototype.visitDate=lt;Z.prototype.visitDateDay=lt;Z.prototype.visitDateMillisecond=lt;Z.prototype.visitTimestamp=lt;Z.prototype.visitTimestampSecond=lt;Z.prototype.visitTimestampMillisecond=lt;Z.prototype.visitTimestampMicrosecond=lt;Z.prototype.visitTimestampNanosecond=lt;Z.prototype.visitTime=lt;Z.prototype.visitTimeSecond=lt;Z.prototype.visitTimeMillisecond=lt;Z.prototype.visitTimeMicrosecond=lt;Z.prototype.visitTimeNanosecond=lt;Z.prototype.visitDecimal=lt;Z.prototype.visitList=lt;Z.prototype.visitStruct=lt;Z.prototype.visitUnion=lt;Z.prototype.visitDenseUnion=pu;Z.prototype.visitSparseUnion=pu;Z.prototype.visitDictionary=lt;Z.prototype.visitInterval=lt;Z.prototype.visitIntervalDayTime=lt;Z.prototype.visitIntervalYearMonth=lt;Z.prototype.visitDuration=lt;Z.prototype.visitDurationSecond=lt;Z.prototype.visitDurationMillisecond=lt;Z.prototype.visitDurationMicrosecond=lt;Z.prototype.visitDurationNanosecond=lt;Z.prototype.visitFixedSizeList=lt;Z.prototype.visitMap=lt;var mr=new Z;var Q=class extends J{};function st(i){let{type:t}=i;if(i.nullCount===0&&i.stride===1&&(V.isInt(t)&&t.bitWidth!==64||V.isTime(t)&&t.bitWidth!==64||V.isFloat(t)&&t.precision!==kt.HALF))return new Mn(i.data.length,r=>{let s=i.data[r];return s.values.subarray(0,s.length)[Symbol.iterator]()});let e=0;return new Mn(i.data.length,r=>{let d=i.data[r].length,_=i.slice(e,e+d);return e+=d,new Za(_)})}var Za=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};Q.prototype.visitNull=st;Q.prototype.visitBool=st;Q.prototype.visitInt=st;Q.prototype.visitInt8=st;Q.prototype.visitInt16=st;Q.prototype.visitInt32=st;Q.prototype.visitInt64=st;Q.prototype.visitUint8=st;Q.prototype.visitUint16=st;Q.prototype.visitUint32=st;Q.prototype.visitUint64=st;Q.prototype.visitFloat=st;Q.prototype.visitFloat16=st;Q.prototype.visitFloat32=st;Q.prototype.visitFloat64=st;Q.prototype.visitUtf8=st;Q.prototype.visitLargeUtf8=st;Q.prototype.visitBinary=st;Q.prototype.visitLargeBinary=st;Q.prototype.visitFixedSizeBinary=st;Q.prototype.visitDate=st;Q.prototype.visitDateDay=st;Q.prototype.visitDateMillisecond=st;Q.prototype.visitTimestamp=st;Q.prototype.visitTimestampSecond=st;Q.prototype.visitTimestampMillisecond=st;Q.prototype.visitTimestampMicrosecond=st;Q.prototype.visitTimestampNanosecond=st;Q.prototype.visitTime=st;Q.prototype.visitTimeSecond=st;Q.prototype.visitTimeMillisecond=st;Q.prototype.visitTimeMicrosecond=st;Q.prototype.visitTimeNanosecond=st;Q.prototype.visitDecimal=st;Q.prototype.visitList=st;Q.prototype.visitStruct=st;Q.prototype.visitUnion=st;Q.prototype.visitDenseUnion=st;Q.prototype.visitSparseUnion=st;Q.prototype.visitDictionary=st;Q.prototype.visitInterval=st;Q.prototype.visitIntervalDayTime=st;Q.prototype.visitIntervalYearMonth=st;Q.prototype.visitDuration=st;Q.prototype.visitDurationSecond=st;Q.prototype.visitDurationMillisecond=st;Q.prototype.visitDurationMicrosecond=st;Q.prototype.visitDurationNanosecond=st;Q.prototype.visitFixedSizeList=st;Q.prototype.visitMap=st;var Gr=new Q;var _u,yu={},mu={},vt=class i{constructor(t){var e,r,s;let d=t[0]instanceof i?t.flatMap(b=>b.data):t;if(d.length===0||d.some(b=>!(b instanceof It)))throw new TypeError("Vector constructor expects an Array of Data instances.");let _=(e=d[0])===null||e===void 0?void 0:e.type;switch(d.length){case 0:this._offsets=[0];break;case 1:{let{get:b,set:g,indexOf:I}=yu[_.typeId],B=d[0];this.isValid=U=>Rn(B,U),this.get=U=>b(B,U),this.set=(U,C)=>g(B,U,C),this.indexOf=U=>I(B,U),this._offsets=[0,B.length];break}default:Object.setPrototypeOf(this,mu[_.typeId]),this._offsets=po(d);break}this.data=d,this.type=_,this.stride=we(_),this.numChildren=(s=(r=_.children)===null||r===void 0?void 0:r.length)!==null&&s!==void 0?s:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return fu(this.data)}get nullCount(){return fo(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}get VectorName(){return"".concat(j[this.type.typeId],"Vector")}isValid(t){return!1}get(t){return null}at(t){return this.get(fr(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return Gr.visit(this)}concat(...t){return new i(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new i(On(this,t,e,({data:r,_offsets:s},d,_)=>_o(r,s,d,_)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:r,stride:s,ArrayType:d}=this;switch(t.typeId){case j.Int:case j.Float:case j.Decimal:case j.Time:case j.Timestamp:switch(e.length){case 0:return new d;case 1:return e[0].values.subarray(0,r*s);default:return e.reduce((_,{values:b,length:g})=>(_.array.set(b.subarray(0,g*s),_.offset),_.offset+=g*s,_),{array:new d(r*s),offset:0}).array}}return[...this]}toString(){return"[".concat([...this].join(","),"]")}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new i(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return V.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(V.isDictionary(this.type)){let t=new bo(this.data[0].dictionary),e=this.data.map(r=>{let s=r.clone();return s.dictionary=t,s});return new i(e)}return new bo(this)}unmemoize(){if(V.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),e=this.data.map(r=>{let s=r.clone();return s.dictionary=t,s});return new i(e)}return this}};_u=Symbol.toStringTag;vt[_u]=(i=>{i.type=V.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;let t=Object.keys(j).map(e=>j[e]).filter(e=>typeof e=="number"&&e!==j.NONE);for(let e of t){let r=Gt.getVisitFnByTypeId(e),s=ee.getVisitFnByTypeId(e),d=mr.getVisitFnByTypeId(e);yu[e]={get:r,set:s,indexOf:d},mu[e]=Object.create(i,{isValid:{value:$r(Rn)},get:{value:$r(Gt.getVisitFnByTypeId(e))},set:{value:yo(ee.getVisitFnByTypeId(e))},indexOf:{value:mo(mr.getVisitFnByTypeId(e))}})}return"Vector"})(vt.prototype);var bo=class i extends vt{constructor(t){super(t.data);let e=this.get,r=this.set,s=this.slice,d=new Array(this.length);Object.defineProperty(this,"get",{value(_){let b=d[_];if(b!==void 0)return b;let g=e.call(this,_);return d[_]=g,g}}),Object.defineProperty(this,"set",{value(_,b){r.call(this,_,b),d[_]=b}}),Object.defineProperty(this,"slice",{value:(_,b)=>new i(s.call(this,_,b))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new vt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function bu(i){if(!i||i.length<=0)return function(s){return!0};let t="",e=i.filter(r=>r===r);return e.length>0&&(t="\n switch (x) {".concat(e.map(r=>"\n case ".concat(Qg(r),":")).join(""),"\n return false;\n }")),i.length!==e.length&&(t="if (x !== x) return false;\n".concat(t)),new Function("x","".concat(t,"\nreturn true;"))}function Qg(i){return typeof i!="bigint"?Ne(i):"".concat(Ne(i),"n")}function Qa(i,t){let e=Math.ceil(i)*t-1;return(e-e%64+64||64)/t}function vu(i,t=0){return i.length>=t?i.subarray(0,t):bn(new i.constructor(t),i,0)}var Ge=class{constructor(t,e=0,r=1){this.length=Math.ceil(e/r),this.buffer=new t(this.length),this.stride=r,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}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(t,e){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let e=this.stride,r=this.length*e,s=this.buffer.length;r>=s&&this._resize(s===0?Qa(r*1,this.BYTES_PER_ELEMENT):Qa(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Qa(t*this.stride,this.BYTES_PER_ELEMENT);let e=vu(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=vu(this.buffer,t)}},xi=class extends Ge{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,e){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=e,this}},Kr=class extends xi{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,e){let{buffer:r}=this.reserve(t-this.length+1),s=t>>3,d=t%8,_=r[s]>>d&1;return e?_===0&&(r[s]|=1<<d,++this.numValid):_===1&&(r[s]&=~(1<<d),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},qr=class extends xi{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,e){let r=this.length-1,s=this.reserve(t-r+1).buffer;return r<t++&&r>=0&&s.fill(s[r],r,t),s[t]=s[t-1]+e,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}};var Lt=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:e}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=e,this.stride=we(t),this._nulls=new Kr,e&&e.length>0&&(this._isValid=bu(e))}toVector(){return new vt([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:e,_values:r,_nulls:s,_typeIds:d,children:_}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),s&&(t+=s.byteLength),d&&(t+=d.byteLength),_.reduce((b,g)=>b+g.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((e,r)=>e+r.reservedByteLength,t)}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(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,e){return this.setValid(t,this.isValid(e))&&this.setValue(t,e),this}setValue(t,e){this._setValue(this,t,e)}setValid(t,e){return this.length=this._nulls.set(t,+e).length,e}addChild(t,e="".concat(this.numChildren)){throw new Error('Cannot append children to non-nested type "'.concat(this.type,'"'))}getChildAt(t){return this.children[t]||null}flush(){let t,e,r,s,{type:d,length:_,nullCount:b,_typeIds:g,_offsets:I,_values:B,_nulls:U}=this;(e=g==null?void 0:g.flush(_))?s=I==null?void 0:I.flush(_):(s=I==null?void 0:I.flush(_))?t=B==null?void 0:B.flush(I.last()):t=B==null?void 0:B.flush(_),b>0&&(r=U==null?void 0:U.flush(_));let C=this.children.map(R=>R.flush());return this.clear(),ct({type:d,length:_,nullCount:b,children:C,child:C[0],data:t,typeIds:e,nullBitmap:r,valueOffsets:s})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,e,r,s;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(e=this._values)===null||e===void 0||e.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(s=this._typeIds)===null||s===void 0||s.clear();for(let d of this.children)d.clear();return this}};Lt.prototype.length=1;Lt.prototype.stride=1;Lt.prototype.children=null;Lt.prototype.finished=!1;Lt.prototype.nullValues=null;Lt.prototype._isValid=()=>!0;var Kt=class extends Lt{constructor(t){super(t),this._values=new xi(this.ArrayType,0,this.stride)}setValue(t,e){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,e)}},he=class extends Lt{constructor(t){super(t),this._pendingLength=0,this._offsets=new qr(t.type)}setValue(t,e){let r=this._pending||(this._pending=new Map),s=r.get(t);s&&(this._pendingLength-=s.length),this._pendingLength+=e instanceof ai?e[ir].length:e.length,r.set(t,e)}setValid(t,e){return super.setValid(t,e)?!0:((this._pending||(this._pending=new Map)).set(t,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 t=this._pending,e=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,e),this}};var br=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,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(t,e,r,s){return t.prep(8,24),t.writeInt64(BigInt(s!=null?s:0)),t.pad(4),t.writeInt32(r),t.writeInt64(BigInt(e!=null?e:0)),t.offset()}};var Se=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Bt.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new ue).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new br).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){let r=this.bb.__offset(this.bb_pos,10);return r?(e||new br).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new Jt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,Bt.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}};var Ft=class i{constructor(t=[],e,r,s=Bt.V5){this.fields=t||[],this.metadata=e||new Map,r||(r=tc(this.fields)),this.dictionaries=r,this.metadataVersion=s}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return"Schema<{ ".concat(this.fields.map((t,e)=>"".concat(e,": ").concat(t)).join(", ")," }>")}select(t){let e=new Set(t),r=this.fields.filter(s=>e.has(s.name));return new i(r,this.metadata)}selectAt(t){let e=t.map(r=>this.fields[r]).filter(Boolean);return new i(e,this.metadata)}assign(...t){let e=t[0]instanceof i?t[0]:Array.isArray(t[0])?new i(t[0]):new i(t),r=[...this.fields],s=vo(vo(new Map,this.metadata),e.metadata),d=e.fields.filter(b=>{let g=r.findIndex(I=>I.name===b.name);return~g?(r[g]=b.clone({metadata:vo(vo(new Map,r[g].metadata),b.metadata)}))&&!1:!0}),_=tc(d,new Map);return new i([...r,...d],s,new Map([...this.dictionaries,..._]))}};Ft.prototype.fields=null;Ft.prototype.metadata=null;Ft.prototype.dictionaries=null;var _t=class i{static new(...t){let[e,r,s,d]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],r===void 0&&(r=t[0].type),s===void 0&&(s=t[0].nullable),d===void 0&&(d=t[0].metadata)),new i("".concat(e),r,s,d)}constructor(t,e,r=!1,s){this.name=t,this.type=e,this.nullable=r,this.metadata=s||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return"".concat(this.name,": ").concat(this.type)}clone(...t){let[e,r,s,d]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,r=this.type,s=this.nullable,d=this.metadata]=t:{name:e=this.name,type:r=this.type,nullable:s=this.nullable,metadata:d=this.metadata}=t[0],i.new(e,r,s,d)}};_t.prototype.type=null;_t.prototype.name=null;_t.prototype.nullable=null;_t.prototype.metadata=null;function vo(i,t){return new Map([...i||new Map,...t||new Map])}function tc(i,t=new Map){for(let e=-1,r=i.length;++e<r;){let d=i[e].type;if(V.isDictionary(d)){if(!t.has(d.id))t.set(d.id,d.dictionary);else if(t.get(d.id)!==d.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}d.children&&d.children.length>0&&tc(d.children,t)}return t}var tw=dr,ew=be,ki=class{static decode(t){t=new ew(rt(t));let e=Se.getRootAsFooter(t),r=Ft.decode(e.schema(),new Map,e.version());return new ec(r,e)}static encode(t){let e=new tw,r=Ft.encode(e,t.schema);Se.startRecordBatchesVector(e,t.numRecordBatches);for(let _ of[...t.recordBatches()].slice().reverse())Ei.encode(e,_);let s=e.endVector();Se.startDictionariesVector(e,t.numDictionaries);for(let _ of[...t.dictionaryBatches()].slice().reverse())Ei.encode(e,_);let d=e.endVector();return Se.startFooter(e),Se.addSchema(e,r),Se.addVersion(e,Bt.V5),Se.addRecordBatches(e,s),Se.addDictionaries(e,d),Se.finishFooterBuffer(e,Se.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=Bt.V5,r,s){this.schema=t,this.version=e,r&&(this._recordBatches=r),s&&(this._dictionaryBatches=s)}*recordBatches(){for(let t,e=-1,r=this.numRecordBatches;++e<r;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,r=this.numDictionaries;++e<r;)(t=this.getDictionaryBatch(e))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}};var ec=class extends ki{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,e){super(t,e.version()),this._footer=e}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let e=this._footer.recordBatches(t);if(e)return Ei.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let e=this._footer.dictionaries(t);if(e)return Ei.decode(e)}return null}},Ei=class i{static decode(t){return new i(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){let{metaDataLength:r}=e,s=BigInt(e.offset),d=BigInt(e.bodyLength);return br.createBlock(t,s,r,d)}constructor(t,e,r){this.metaDataLength=t,this.offset=wt(r),this.bodyLength=wt(e)}};var Mt=Object.freeze({done:!0,value:void 0}),Ln=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},vr=class{tee(){return this._getDOMStream().tee()}pipe(t,e){return this._getNodeStream().pipe(t,e)}pipeTo(t,e){return this._getDOMStream().pipeTo(t,e)}pipeThrough(t,e){return this._getDOMStream().pipeThrough(t,e)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},go=class extends vr{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return P(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(Mt);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return te.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return te.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return P(this,void 0,void 0,function*(){return yield this.abort(t),Mt})}return(t){return P(this,void 0,void 0,function*(){return yield this.close(),Mt})}read(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){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((e,r)=>{this.resolvers.push({resolve:e,reject:r})}):Promise.resolve(Mt)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var ci=class extends go{write(t){if((t=rt(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?yn(this.toUint8Array(!0)):this.toUint8Array(!1).then(yn)}toUint8Array(t=!1){return t?me(this._values)[0]:P(this,void 0,void 0,function*(){var e,r,s,d;let _=[],b=0;try{for(var g=!0,I=Ee(this),B;B=yield I.next(),e=B.done,!e;g=!0){d=B.value,g=!1;let U=d;_.push(U),b+=U.byteLength}}catch(U){r={error:U}}finally{try{!g&&!e&&(s=I.return)&&(yield s.call(I))}finally{if(r)throw r.error}}return me(_,b)[0]})}},li=class{constructor(t){t&&(this.source=new ic(te.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},De=class i{constructor(t){t instanceof i?this.source=t.source:t instanceof ci?this.source=new Ui(te.fromAsyncIterable(t)):Fs(t)?this.source=new Ui(te.fromNodeStream(t)):mn(t)?this.source=new Ui(te.fromDOMStream(t)):Bs(t)?this.source=new Ui(te.fromDOMStream(t.body)):Oe(t)?this.source=new Ui(te.fromIterable(t)):Ue(t)?this.source=new Ui(te.fromAsyncIterable(t)):Ie(t)&&(this.source=new Ui(te.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},ic=class{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||Mt)}return(t){return Object.create(this.source.return&&this.source.return(t)||Mt)}},Ui=class{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return P(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return P(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return P(this,arguments,void 0,function*(e,r="read"){return yield this.source.next({cmd:r,size:e})})}throw(t){return P(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||Mt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return P(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||Mt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}};var Nn=class extends li{constructor(t,e){super(),this.position=0,this.buffer=rt(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){let{buffer:e,byteOffset:r}=this.readAt(t,4);return new DataView(e,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:e,size:r,position:s}=this;return e&&s<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,s+Math.min(r-s,t)),e.subarray(s,this.position)):null}readAt(t,e){let r=this.buffer,s=Math.min(this.size,t+e);return r?r.subarray(t,s):new Uint8Array(e)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},nr=class extends De{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=P(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return P(this,void 0,void 0,function*(){let{buffer:e,byteOffset:r}=yield this.readAt(t,4);return new DataView(e,r).getInt32(0,!0)})}seek(t){return P(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return P(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:e,size:r,position:s}=this;if(e&&s<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let d=s,_=0,b=0,g=Math.min(r,d+Math.min(r-d,t)),I=new Uint8Array(Math.max(0,(this.position=g)-d));for(;(d+=b)<g&&(_+=b)<I.byteLength;)({bytesRead:b}=yield e.read(I,_,I.byteLength-_,d));return I}return null})}readAt(t,e){return P(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:s}=this;if(r&&t+e<s){let d=Math.min(s,t+e),_=new Uint8Array(d-t);return(yield r.read(_,0,e,t)).buffer}return new Uint8Array(e)})}close(){return P(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return P(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return P(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var nc={};$i(nc,{BaseInt64:()=>Pn,Int128:()=>Vn,Int64:()=>Oi,Uint64:()=>Pt});function Yr(i){return i<0&&(i=4294967295+i+1),"0x".concat(i.toString(16))}var Jr=8,rc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Pn=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),s=e[3]*r[3];this.buffer[0]=s&65535;let d=s>>>16;return s=e[2]*r[3],d+=s,s=e[3]*r[2]>>>0,d+=s,this.buffer[0]+=d<<16,this.buffer[1]=d>>>0<s?65536:0,this.buffer[1]+=d>>>16,this.buffer[1]+=e[1]*r[3]+e[2]*r[2]+e[3]*r[1],this.buffer[1]+=e[0]*r[3]+e[1]*r[2]+e[2]*r[1]+e[3]*r[0]<<16,this}_plus(t){let e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return"".concat(Yr(this.buffer[1])," ").concat(Yr(this.buffer[0]))}},Pt=class i extends Pn{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return i.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return i.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.length,s=new i(e);for(let d=0;d<r;){let _=Jr<r-d?Jr:r-d,b=new i(new Uint32Array([Number.parseInt(t.slice(d,d+_),10),0])),g=new i(new Uint32Array([rc[_],0]));s.times(g),s.plus(b),d+=_}return s}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,s=t.length;++r<s;)i.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new i(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new i(new Uint32Array(t.buffer)).plus(e)}},Oi=class i extends Pn{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let e=this.buffer[1]<<0,r=t.buffer[1]<<0;return e<r||e===r&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return i.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return i.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.startsWith("-"),s=t.length,d=new i(e);for(let _=r?1:0;_<s;){let b=Jr<s-_?Jr:s-_,g=new i(new Uint32Array([Number.parseInt(t.slice(_,_+b),10),0])),I=new i(new Uint32Array([rc[b],0]));d.times(I),d.plus(g),_+=b}return r?d.negate():d}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,s=t.length;++r<s;)i.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new i(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new i(new Uint32Array(t.buffer)).plus(e)}},Vn=class i{constructor(t){this.buffer=t}high(){return new Oi(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Oi(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(t){let e=new Pt(new Uint32Array([this.buffer[3],0])),r=new Pt(new Uint32Array([this.buffer[2],0])),s=new Pt(new Uint32Array([this.buffer[1],0])),d=new Pt(new Uint32Array([this.buffer[0],0])),_=new Pt(new Uint32Array([t.buffer[3],0])),b=new Pt(new Uint32Array([t.buffer[2],0])),g=new Pt(new Uint32Array([t.buffer[1],0])),I=new Pt(new Uint32Array([t.buffer[0],0])),B=Pt.multiply(d,I);this.buffer[0]=B.low();let U=new Pt(new Uint32Array([B.high(),0]));return B=Pt.multiply(s,I),U.plus(B),B=Pt.multiply(d,g),U.plus(B),this.buffer[1]=U.low(),this.buffer[3]=U.lessThan(B)?1:0,this.buffer[2]=U.high(),new Pt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Pt.multiply(r,I)).plus(Pt.multiply(s,g)).plus(Pt.multiply(d,b)),this.buffer[3]+=Pt.multiply(e,I).plus(Pt.multiply(r,g)).plus(Pt.multiply(s,b)).plus(Pt.multiply(d,_)).low(),this}plus(t){let e=new Uint32Array(4);return e[3]=this.buffer[3]+t.buffer[3]>>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]<this.buffer[0]>>>0&&++e[1],e[1]<this.buffer[1]>>>0&&++e[2],e[2]<this.buffer[2]>>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return"".concat(Yr(this.buffer[3])," ").concat(Yr(this.buffer[2])," ").concat(Yr(this.buffer[1])," ").concat(Yr(this.buffer[0]))}static multiply(t,e){return new i(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new i(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return i.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return i.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){let r=t.startsWith("-"),s=t.length,d=new i(e);for(let _=r?1:0;_<s;){let b=Jr<s-_?Jr:s-_,g=new i(new Uint32Array([Number.parseInt(t.slice(_,_+b),10),0,0,0])),I=new i(new Uint32Array([rc[b],0,0,0]));d.times(I),d.plus(g),_+=b}return r?d.negate():d}static convertArray(t){let e=new Uint32Array(t.length*4);for(let r=-1,s=t.length;++r<s;)i.from(t[r],new Uint32Array(e.buffer,e.byteOffset+4*4*r,4));return e}};var Hn=class extends J{constructor(t,e,r,s,d=Bt.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=r,this.dictionaries=s,this.metadataVersion=d}visit(t){return super.visit(t instanceof _t?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return ct({type:t,length:e})}visitBool(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return this.metadataVersion<Bt.V5&&this.readNullBitmap(t,r),t.mode===Et.Sparse?this.visitSparseUnion(t,{length:e,nullCount:r}):this.visitDenseUnion(t,{length:e,nullCount:r})}visitDenseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDuration(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:r}=this.nextFieldNode()){return ct({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e,r=this.nextBufferRange()){return e>0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+e)}readDictionary(t){return this.dictionaries.get(t.id)}},wo=class extends Hn{constructor(t,e,r,s,d){super(new Uint8Array(0),e,r,s,d),this.sources=t}readNullBitmap(t,e,{offset:r}=this.nextBufferRange()){return e<=0?new Uint8Array(0):yr(this.sources[r])}readOffsets(t,{offset:e}=this.nextBufferRange()){return pt(Uint8Array,pt(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return pt(Uint8Array,pt(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:r}=this;return V.isTimestamp(t)?pt(Uint8Array,Oi.convertArray(r[e])):(V.isInt(t)||V.isTime(t))&&t.bitWidth===64||V.isDuration(t)?pt(Uint8Array,Oi.convertArray(r[e])):V.isDate(t)&&t.unit===Ht.MILLISECOND?pt(Uint8Array,Oi.convertArray(r[e])):V.isDecimal(t)?pt(Uint8Array,Vn.convertArray(r[e])):V.isBinary(t)||V.isLargeBinary(t)||V.isFixedSizeBinary(t)?iw(r[e]):V.isBool(t)?yr(r[e]):V.isUtf8(t)||V.isLargeUtf8(t)?ei(r[e].join("")):pt(Uint8Array,pt(t.ArrayType,r[e].map(s=>+s)))}};function iw(i){let t=i.join(""),e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r>>1]=Number.parseInt(t.slice(r,r+2),16);return e}var Xr=class extends he{constructor(t){super(t),this._values=new Ge(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,rt(e))}_flushPending(t,e){let r=this._offsets,s=this._values.reserve(e).buffer,d=0;for(let[_,b]of t)if(b===void 0)r.set(_,0);else{let g=b.length;s.set(b,d),r.set(_,g),d+=g}}};var Zr=class extends he{constructor(t){super(t),this._values=new Ge(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,rt(e))}_flushPending(t,e){let r=this._offsets,s=this._values.reserve(e).buffer,d=0;for(let[_,b]of t)if(b===void 0)r.set(_,BigInt(0));else{let g=b.length;s.set(b,d),r.set(_,BigInt(g)),d+=g}}};var So=class extends Lt{constructor(t){super(t),this._values=new Kr}setValue(t,e){this._values.set(t,+e)}};var gr=class extends Kt{};gr.prototype._setValue=Ra;var zn=class extends gr{};zn.prototype._setValue=Ks;var Wn=class extends gr{};Wn.prototype._setValue=qs;var $n=class extends Kt{};$n.prototype._setValue=Pa;var Io=class extends Lt{constructor({type:t,nullValues:e,dictionaryHashFunction:r}){super({type:new ge(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=wr({type:this.type.indices,nullValues:e}),this.dictionary=wr({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,e){let r=this.indices;return e=r.setValid(t,e),this.length=r.length,e}setValue(t,e){let r=this._keysToIndices,s=this.valueToKey(e),d=r[s];return d===void 0&&(r[s]=d=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,d)}flush(){let t=this.type,e=this._dictionary,r=this.dictionary.toVector(),s=this.indices.flush().clone(t);return s.dictionary=e?e.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=s.dictionary,this.clear(),s}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(t){return typeof t=="string"?t:"".concat(t)}};var Gn=class extends Kt{};Gn.prototype._setValue=Ma;var To=class extends Lt{setValue(t,e){let[r]=this.children,s=t*this.stride;for(let d=-1,_=e.length;++d<_;)r.set(s+d,e[d])}addChild(t,e="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(t);return this.type=new ze(this.type.listSize,new _t(e,t.type,!0)),r}};var Sr=class extends Kt{setValue(t,e){this._values.set(t,e)}},jo=class extends Sr{setValue(t,e){super.setValue(t,Un(e))}},Bo=class extends Sr{},Do=class extends Sr{};var Ir=class extends Kt{};Ir.prototype._setValue=Va;var Kn=class extends Ir{};Kn.prototype._setValue=ro;var qn=class extends Ir{};qn.prototype._setValue=no;var Ci=class extends Kt{};Ci.prototype._setValue=Ha;var Yn=class extends Ci{};Yn.prototype._setValue=so;var Jn=class extends Ci{};Jn.prototype._setValue=oo;var Xn=class extends Ci{};Xn.prototype._setValue=ao;var Zn=class extends Ci{};Zn.prototype._setValue=co;var Fe=class extends Kt{setValue(t,e){this._values.set(t,e)}},Fo=class extends Fe{},Ao=class extends Fe{},xo=class extends Fe{},ko=class extends Fe{},Eo=class extends Fe{},Uo=class extends Fe{},Oo=class extends Fe{},Co=class extends Fe{};var Mo=class extends he{constructor(t){super(t),this._offsets=new qr(t.type)}addChild(t,e="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Ve(new _t(e,t.type,!0)),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[s,d]of t)if(typeof d>"u")e.set(s,0);else{let _=d,b=_.length,g=e.set(s,b).buffer[s];for(let I=-1;++I<b;)r.set(g+I,_[I])}}};var Ro=class extends he{set(t,e){return super.set(t,e)}setValue(t,e){let r=e instanceof Map?e:new Map(Object.entries(e)),s=this._pending||(this._pending=new Map),d=s.get(t);d&&(this._pendingLength-=d.size),this._pendingLength+=r.size,s.set(t,r)}addChild(t,e="".concat(this.numChildren)){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new We(new _t(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[s,d]of t)if(d===void 0)e.set(s,0);else{let{[s]:_,[s+1]:b}=e.set(s,d.size).buffer;for(let g of d.entries())if(r.set(_,g),++_>=b)break}}};var Lo=class extends Lt{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}};var No=class extends Lt{setValue(t,e){let{children:r,type:s}=this;switch(Array.isArray(e)||e.constructor){case!0:return s.children.forEach((d,_)=>r[_].set(t,e[_]));case Map:return s.children.forEach((d,_)=>r[_].set(t,e.get(d.name)));default:return s.children.forEach((d,_)=>r[_].set(t,e[d.name]))}}setValid(t,e){return super.setValid(t,e)||this.children.forEach(r=>r.setValid(t,e)),e}addChild(t,e="".concat(this.numChildren)){let r=this.children.push(t);return this.type=new Ct([...this.type.children,new _t(e,t.type,!0)]),r}};var Mi=class extends Kt{};Mi.prototype._setValue=La;var Qn=class extends Mi{};Qn.prototype._setValue=Ys;var ts=class extends Mi{};ts.prototype._setValue=Js;var es=class extends Mi{};es.prototype._setValue=Xs;var is=class extends Mi{};is.prototype._setValue=Zs;var Ri=class extends Kt{};Ri.prototype._setValue=Na;var rs=class extends Ri{};rs.prototype._setValue=Qs;var ns=class extends Ri{};ns.prototype._setValue=to;var ss=class extends Ri{};ss.prototype._setValue=eo;var os=class extends Ri{};os.prototype._setValue=io;var Qr=class extends Lt{constructor(t){super(t),this._typeIds=new xi(Int8Array,0,1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,e){return this.set(this.length,t,e)}set(t,e,r){return r===void 0&&(r=this._valueToChildTypeId(this,e,t)),this.setValue(t,e,r),this}setValue(t,e,r){this._typeIds.set(t,r);let s=this.type.typeIdToChildIndex[r],d=this.children[s];d==null||d.set(t,e)}addChild(t,e="".concat(this.children.length)){let r=this.children.push(t),{type:{children:s,mode:d,typeIds:_}}=this,b=[...s,new _t(e,t.type)];return this.type=new He(d,[..._,r],b),r}_valueToChildTypeId(t,e,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.")}},Po=class extends Qr{},Vo=class extends Qr{constructor(t){super(t),this._offsets=new xi(Int32Array)}setValue(t,e,r){let s=this._typeIds.set(t,r).buffer[t],d=this.getChildAt(this.type.typeIdToChildIndex[s]),_=this._offsets.set(t,d.length).buffer[t];d==null||d.set(_,e)}};var as=class extends he{constructor(t){super(t),this._values=new Ge(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,ei(e))}_flushPending(t,e){}};as.prototype._flushPending=Xr.prototype._flushPending;var cs=class extends he{constructor(t){super(t),this._values=new Ge(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,ei(e))}_flushPending(t,e){}};cs.prototype._flushPending=Zr.prototype._flushPending;var sc=class extends J{visitNull(){return Lo}visitBool(){return So}visitInt(){return Fe}visitInt8(){return Fo}visitInt16(){return Ao}visitInt32(){return xo}visitInt64(){return ko}visitUint8(){return Eo}visitUint16(){return Uo}visitUint32(){return Oo}visitUint64(){return Co}visitFloat(){return Sr}visitFloat16(){return jo}visitFloat32(){return Bo}visitFloat64(){return Do}visitUtf8(){return as}visitLargeUtf8(){return cs}visitBinary(){return Xr}visitLargeBinary(){return Zr}visitFixedSizeBinary(){return Gn}visitDate(){return gr}visitDateDay(){return zn}visitDateMillisecond(){return Wn}visitTimestamp(){return Mi}visitTimestampSecond(){return Qn}visitTimestampMillisecond(){return ts}visitTimestampMicrosecond(){return es}visitTimestampNanosecond(){return is}visitTime(){return Ri}visitTimeSecond(){return rs}visitTimeMillisecond(){return ns}visitTimeMicrosecond(){return ss}visitTimeNanosecond(){return os}visitDecimal(){return $n}visitList(){return Mo}visitStruct(){return No}visitUnion(){return Qr}visitDenseUnion(){return Vo}visitSparseUnion(){return Po}visitDictionary(){return Io}visitInterval(){return Ir}visitIntervalDayTime(){return Kn}visitIntervalYearMonth(){return qn}visitDuration(){return Ci}visitDurationSecond(){return Yn}visitDurationMillisecond(){return Jn}visitDurationMicrosecond(){return Xn}visitDurationNanosecond(){return Zn}visitFixedSizeList(){return To}visitMap(){return Ro}},gu=new sc;var tt=class extends J{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((r,s)=>this.compareFields(r,e[s]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}};function ce(i,t){return t instanceof i.constructor}function Tr(i,t){return i===t||ce(i,t)}function Li(i,t){return i===t||ce(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function Ho(i,t){return i===t||ce(i,t)&&i.precision===t.precision}function rw(i,t){return i===t||ce(i,t)&&i.byteWidth===t.byteWidth}function oc(i,t){return i===t||ce(i,t)&&i.unit===t.unit}function ls(i,t){return i===t||ce(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function us(i,t){return i===t||ce(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function nw(i,t){return i===t||ce(i,t)&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}function sw(i,t){return i===t||ce(i,t)&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}function ac(i,t){return i===t||ce(i,t)&&i.mode===t.mode&&i.typeIds.every((e,r)=>e===t.typeIds[r])&&ui.compareManyFields(i.children,t.children)}function ow(i,t){return i===t||ce(i,t)&&i.id===t.id&&i.isOrdered===t.isOrdered&&ui.visit(i.indices,t.indices)&&ui.visit(i.dictionary,t.dictionary)}function cc(i,t){return i===t||ce(i,t)&&i.unit===t.unit}function hs(i,t){return i===t||ce(i,t)&&i.unit===t.unit}function aw(i,t){return i===t||ce(i,t)&&i.listSize===t.listSize&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}function cw(i,t){return i===t||ce(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}tt.prototype.visitNull=Tr;tt.prototype.visitBool=Tr;tt.prototype.visitInt=Li;tt.prototype.visitInt8=Li;tt.prototype.visitInt16=Li;tt.prototype.visitInt32=Li;tt.prototype.visitInt64=Li;tt.prototype.visitUint8=Li;tt.prototype.visitUint16=Li;tt.prototype.visitUint32=Li;tt.prototype.visitUint64=Li;tt.prototype.visitFloat=Ho;tt.prototype.visitFloat16=Ho;tt.prototype.visitFloat32=Ho;tt.prototype.visitFloat64=Ho;tt.prototype.visitUtf8=Tr;tt.prototype.visitLargeUtf8=Tr;tt.prototype.visitBinary=Tr;tt.prototype.visitLargeBinary=Tr;tt.prototype.visitFixedSizeBinary=rw;tt.prototype.visitDate=oc;tt.prototype.visitDateDay=oc;tt.prototype.visitDateMillisecond=oc;tt.prototype.visitTimestamp=ls;tt.prototype.visitTimestampSecond=ls;tt.prototype.visitTimestampMillisecond=ls;tt.prototype.visitTimestampMicrosecond=ls;tt.prototype.visitTimestampNanosecond=ls;tt.prototype.visitTime=us;tt.prototype.visitTimeSecond=us;tt.prototype.visitTimeMillisecond=us;tt.prototype.visitTimeMicrosecond=us;tt.prototype.visitTimeNanosecond=us;tt.prototype.visitDecimal=Tr;tt.prototype.visitList=nw;tt.prototype.visitStruct=sw;tt.prototype.visitUnion=ac;tt.prototype.visitDenseUnion=ac;tt.prototype.visitSparseUnion=ac;tt.prototype.visitDictionary=ow;tt.prototype.visitInterval=cc;tt.prototype.visitIntervalDayTime=cc;tt.prototype.visitIntervalYearMonth=cc;tt.prototype.visitDuration=hs;tt.prototype.visitDurationSecond=hs;tt.prototype.visitDurationMillisecond=hs;tt.prototype.visitDurationMicrosecond=hs;tt.prototype.visitDurationNanosecond=hs;tt.prototype.visitFixedSizeList=aw;tt.prototype.visitMap=cw;var ui=new tt;function jr(i,t){return ui.compareSchemas(i,t)}function wu(i,t){return ui.compareFields(i,t)}function Su(i,t){return ui.visit(i,t)}function wr(i){let t=i.type,e=new(gu.getVisitFn(t)())(i);if(t.children&&t.children.length>0){let r=i.children||[],s={nullValues:i.nullValues},d=Array.isArray(r)?(_,b)=>r[b]||s:({name:_})=>r[_]||s;for(let[_,b]of t.children.entries()){let{type:g}=b,I=d(b,_);e.children.push(wr(Object.assign(Object.assign({},I),{type:g})))}}return e}function zo(i,t){return lw(i,t.map(e=>e.data.concat()))}function lw(i,t){let e=[...i.fields],r=[],s={numBatches:t.reduce((U,C)=>Math.max(U,C.length),0)},d=0,_=0,b=-1,g=t.length,I,B=[];for(;s.numBatches-- >0;){for(_=Number.POSITIVE_INFINITY,b=-1;++b<g;)B[b]=I=t[b].shift(),_=Math.min(_,I?I.length:_);Number.isFinite(_)&&(B=uw(e,_,B,t,s),_>0&&(r[d++]=ct({type:new Ct(e),length:_,nullCount:0,children:B.slice()})))}return[i=i.assign(e),r.map(U=>new zt(i,U))]}function uw(i,t,e,r,s){var d;let _=(t+63&-64)>>3;for(let b=-1,g=r.length;++b<g;){let I=e[b],B=I==null?void 0:I.length;if(B>=t)B===t?e[b]=I:(e[b]=I.slice(0,t),s.numBatches=Math.max(s.numBatches,r[b].unshift(I.slice(t,B-t))));else{let U=i[b];i[b]=U.clone({nullable:!0}),e[b]=(d=I==null?void 0:I._changeLengthAndBackfillNullBitmap(t))!==null&&d!==void 0?d:ct({type:U.type,length:t,nullCount:t,nullBitmap:new Uint8Array(_)})}}return e}var Iu,le=class i{constructor(...t){var e,r;if(t.length===0)return this.batches=[],this.schema=new Ft([]),this._offsets=[0],this;let s,d;t[0]instanceof Ft&&(s=t.shift()),t.at(-1)instanceof Uint32Array&&(d=t.pop());let _=g=>{if(g){if(g instanceof zt)return[g];if(g instanceof i)return g.batches;if(g instanceof It){if(g.type instanceof Ct)return[new zt(new Ft(g.type.children),g)]}else{if(Array.isArray(g))return g.flatMap(I=>_(I));if(typeof g[Symbol.iterator]=="function")return[...g].flatMap(I=>_(I));if(typeof g=="object"){let I=Object.keys(g),B=I.map(R=>new vt([g[R]])),U=s!=null?s:new Ft(I.map((R,ft)=>new _t(String(R),B[ft].type,B[ft].nullable))),[,C]=zo(U,B);return C.length===0?[new zt(g)]:C}}}return[]},b=t.flatMap(g=>_(g));if(s=(r=s!=null?s:(e=b[0])===null||e===void 0?void 0:e.schema)!==null&&r!==void 0?r:new Ft([]),!(s instanceof Ft))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let g of b){if(!(g instanceof zt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!jr(s,g.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=s,this.batches=b,this._offsets=d!=null?d:po(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=fo(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(fr(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?Gr.visit(new vt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return"[\n ".concat(this.toArray().join(",\n "),"\n]")}concat(...t){let e=this.schema,r=this.data.concat(t.flatMap(({data:s})=>s));return new i(e,r.map(s=>new zt(e,s)))}slice(t,e){let r=this.schema;[t,e]=On({length:this.numRows},t,e);let s=_o(this.data,this._offsets,t,e);return new i(r,s.map(d=>new zt(r,d)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let e=this.data.map(r=>r.children[t]);if(e.length===0){let{type:r}=this.schema.fields[t],s=ct({type:r,length:0,nullCount:0});e.push(s._changeLengthAndBackfillNullBitmap(this.numRows))}return new vt(e)}return null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(s=>s.name===t),e)}setChildAt(t,e){let r=this.schema,s=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new vt([ct({type:new ae,length:this.numRows})]));let d=r.fields.slice(),_=d[t].clone({type:e.type}),b=this.schema.fields.map((g,I)=>this.getChildAt(I));[d[t],b[t]]=[_,e],[r,s]=zo(r,b)}return new i(r,s)}select(t){let e=this.schema.fields.reduce((r,s,d)=>r.set(s.name,d),new Map);return this.selectAt(t.map(r=>e.get(r)).filter(r=>r>-1))}selectAt(t){let e=this.schema.selectAt(t),r=this.batches.map(s=>s.selectAt(t));return new i(e,r)}assign(t){let e=this.schema.fields,[r,s]=t.schema.fields.reduce((b,g,I)=>{let[B,U]=b,C=e.findIndex(R=>R.name===g.name);return~C?U[C]=I:B.push(I),b},[[],[]]),d=this.schema.assign(t.schema),_=[...e.map((b,g)=>[g,s[g]]).map(([b,g])=>g===void 0?this.getChildAt(b):t.getChildAt(g)),...r.map(b=>t.getChildAt(b))].filter(Boolean);return new i(...zo(d,_))}};Iu=Symbol.toStringTag;le[Iu]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=$r(Rn),i.get=$r(Gt.getVisitFn(j.Struct)),i.set=yo(ee.getVisitFn(j.Struct)),i.indexOf=mo(mr.getVisitFn(j.Struct)),"Table"))(le.prototype);var ju,zt=class i{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Ft))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=ct({nullCount:0,type:new Ct(this.schema.fields),children:this.schema.fields.map(e=>ct({type:e.type,nullCount:0}))})]=t,!(this.data instanceof It))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Tu(this.schema,this.data.children);break}case 1:{let[e]=t,{fields:r,children:s,length:d}=Object.keys(e).reduce((g,I,B)=>(g.children[B]=e[I],g.length=Math.max(g.length,e[I].length),g.fields[B]=_t.new({name:I,type:e[I].type,nullable:!0}),g),{length:0,fields:new Array,children:new Array}),_=new Ft(r),b=ct({type:new Ct(r),length:d,children:s,nullCount:0});[this.schema,this.data]=Tu(_,b.children,d);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=Bu(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return Gt.visit(this.data,t)}at(t){return this.get(fr(t,this.numRows))}set(t,e){return ee.visit(this.data,t,e)}indexOf(t,e){return mr.visit(this.data,t,e)}[Symbol.iterator](){return Gr.visit(new vt([this.data]))}toArray(){return[...this]}concat(...t){return new le(this.schema,[this,...t])}slice(t,e){let[r]=new vt([this.data]).slice(t,e).data;return new i(this.schema,r)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new vt([this.data.children[t]]):null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(s=>s.name===t),e)}setChildAt(t,e){let r=this.schema,s=this.data;if(t>-1&&t<this.numCols){e||(e=new vt([ct({type:new ae,length:this.numRows})]));let d=r.fields.slice(),_=s.children.slice(),b=d[t].clone({type:e.type});[d[t],_[t]]=[b,e.data[0]],r=new Ft(d,new Map(this.schema.metadata)),s=ct({type:new Ct(d),children:_})}return new i(r,s)}select(t){let e=this.schema.select(t),r=new Ct(e.fields),s=[];for(let d of t){let _=this.schema.fields.findIndex(b=>b.name===d);~_&&(s[_]=this.data.children[_])}return new i(e,ct({type:r,length:this.numRows,children:s}))}selectAt(t){let e=this.schema.selectAt(t),r=t.map(d=>this.data.children[d]).filter(Boolean),s=ct({type:new Ct(e.fields),length:this.numRows,children:r});return new i(e,s)}};ju=Symbol.toStringTag;zt[ju]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(zt.prototype);function Tu(i,t,e=t.reduce((r,s)=>Math.max(r,s.length),0)){var r;let s=[...i.fields],d=[...t],_=(e+63&-64)>>3;for(let[b,g]of i.fields.entries()){let I=t[b];(!I||I.length!==e)&&(s[b]=g.clone({nullable:!0}),d[b]=(r=I==null?void 0:I._changeLengthAndBackfillNullBitmap(e))!==null&&r!==void 0?r:ct({type:g.type,length:e,nullCount:e,nullBitmap:new Uint8Array(_)}))}return[i.assign(s),ct({type:new Ct(s),length:e,children:d})]}function Bu(i,t,e=new Map){var r,s;if(((r=i==null?void 0:i.length)!==null&&r!==void 0?r:0)>0&&(i==null?void 0:i.length)===(t==null?void 0:t.length))for(let d=-1,_=i.length;++d<_;){let{type:b}=i[d],g=t[d];for(let I of[g,...((s=g==null?void 0:g.dictionary)===null||s===void 0?void 0:s.data)||[]])Bu(b.children,I==null?void 0:I.children,e);if(V.isDictionary(b)){let{id:I}=b;if(!e.has(I))g!=null&&g.dictionary&&e.set(I,g.dictionary);else if(e.get(I)!==g.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return e}var Br=class extends zt{constructor(t){let e=t.fields.map(s=>ct({type:s.type})),r=ct({type:new Ct(t.fields),nullCount:0,children:e});super(t,r)}};var Ke=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Bt.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):bt.NONE}header(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new Jt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,Bt.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,bt.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,r,s,d,_){return i.startMessage(t),i.addVersion(t,e),i.addHeaderType(t,r),i.addHeader(t,s),i.addBodyLength(t,d),i.addCustomMetadata(t,_),i.endMessage(t)}};var lc=class extends J{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return Fn.startNull(e),Fn.endNull(e)}visitInt(t,e){return Re.startInt(e),Re.addBitWidth(e,t.bitWidth),Re.addIsSigned(e,t.isSigned),Re.endInt(e)}visitFloat(t,e){return Xi.startFloatingPoint(e),Xi.addPrecision(e,t.precision),Xi.endFloatingPoint(e)}visitBinary(t,e){return In.startBinary(e),In.endBinary(e)}visitLargeBinary(t,e){return jn.startLargeBinary(e),jn.endLargeBinary(e)}visitBool(t,e){return Tn.startBool(e),Tn.endBool(e)}visitUtf8(t,e){return xn.startUtf8(e),xn.endUtf8(e)}visitLargeUtf8(t,e){return Bn.startLargeUtf8(e),Bn.endLargeUtf8(e)}visitDecimal(t,e){return si.startDecimal(e),si.addScale(e,t.scale),si.addPrecision(e,t.precision),si.addBitWidth(e,t.bitWidth),si.endDecimal(e)}visitDate(t,e){return Ki.startDate(e),Ki.addUnit(e,t.unit),Ki.endDate(e)}visitTime(t,e){return _i.startTime(e),_i.addUnit(e,t.unit),_i.addBitWidth(e,t.bitWidth),_i.endTime(e)}visitTimestamp(t,e){let r=t.timezone&&e.createString(t.timezone)||void 0;return yi.startTimestamp(e),yi.addUnit(e,t.unit),r!==void 0&&yi.addTimezone(e,r),yi.endTimestamp(e)}visitInterval(t,e){return Zi.startInterval(e),Zi.addUnit(e,t.unit),Zi.endInterval(e)}visitDuration(t,e){return qi.startDuration(e),qi.addUnit(e,t.unit),qi.endDuration(e)}visitList(t,e){return Dn.startList(e),Dn.endList(e)}visitStruct(t,e){return An.startStruct_(e),An.endStruct_(e)}visitUnion(t,e){Le.startTypeIdsVector(e,t.typeIds.length);let r=Le.createTypeIdsVector(e,t.typeIds);return Le.startUnion(e),Le.addMode(e,t.mode),Le.addTypeIds(e,r),Le.endUnion(e)}visitDictionary(t,e){let r=this.visit(t.indices,e);return ni.startDictionaryEncoding(e),ni.addId(e,BigInt(t.id)),ni.addIsOrdered(e,t.isOrdered),r!==void 0&&ni.addIndexType(e,r),ni.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return Yi.startFixedSizeBinary(e),Yi.addByteWidth(e,t.byteWidth),Yi.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Ji.startFixedSizeList(e),Ji.addListSize(e,t.listSize),Ji.endFixedSizeList(e)}visitMap(t,e){return Qi.startMap(e),Qi.addKeysSorted(e,t.keysSorted),Qi.endMap(e)}},Wo=new lc;function xu(i,t=new Map){return new Ft(dw(i,t),$o(i.metadata),t)}function uc(i){return new ie(i.count,Eu(i.columns),Uu(i.columns))}function ku(i){return new fe(uc(i.data),i.id,i.isDelta)}function dw(i,t){return(i.fields||[]).filter(Boolean).map(e=>_t.fromJSON(e,t))}function Du(i,t){return(i.children||[]).filter(Boolean).map(e=>_t.fromJSON(e,t))}function Eu(i){return(i||[]).reduce((t,e)=>[...t,new Ae(e.count,fw(e.VALIDITY)),...Eu(e.children)],[])}function Uu(i,t=[]){for(let e=-1,r=(i||[]).length;++e<r;){let s=i[e];s.VALIDITY&&t.push(new de(t.length,s.VALIDITY.length)),s.TYPE_ID&&t.push(new de(t.length,s.TYPE_ID.length)),s.OFFSET&&t.push(new de(t.length,s.OFFSET.length)),s.DATA&&t.push(new de(t.length,s.DATA.length)),t=Uu(s.children,t)}return t}function fw(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function Ou(i,t){let e,r,s,d,_,b;return!t||!(d=i.dictionary)?(_=Au(i,Du(i,t)),s=new _t(i.name,_,i.nullable,$o(i.metadata))):t.has(e=d.id)?(r=(r=d.indexType)?Fu(r):new oi,b=new ge(t.get(e),r,e,d.isOrdered),s=new _t(i.name,b,i.nullable,$o(i.metadata))):(r=(r=d.indexType)?Fu(r):new oi,t.set(e,_=Au(i,Du(i,t))),b=new ge(_,r,e,d.isOrdered),s=new _t(i.name,b,i.nullable,$o(i.metadata))),s||null}function $o(i=[]){return new Map(i.map(({key:t,value:e})=>[t,e]))}function Fu(i){return new Xt(i.isSigned,i.bitWidth)}function Au(i,t){let e=i.type.name;switch(e){case"NONE":return new ae;case"null":return new ae;case"binary":return new mi;case"largebinary":return new bi;case"utf8":return new vi;case"largeutf8":return new gi;case"bool":return new wi;case"list":return new Ve((t||[])[0]);case"struct":return new Ct(t||[]);case"struct_":return new Ct(t||[])}switch(e){case"int":{let r=i.type;return new Xt(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=i.type;return new Be(kt[r.precision])}case"decimal":{let r=i.type;return new Si(r.scale,r.precision,r.bitWidth)}case"date":{let r=i.type;return new Ii(Ht[r.unit])}case"time":{let r=i.type;return new Ti(z[r.unit],r.bitWidth)}case"timestamp":{let r=i.type;return new ji(z[r.unit],r.timezone)}case"interval":{let r=i.type;return new Bi(Yt[r.unit])}case"duration":{let r=i.type;return new Di(z[r.unit])}case"union":{let r=i.type,[s,...d]=(r.mode+"").toLowerCase(),_=s.toUpperCase()+d.join("");return new He(Et[_],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=i.type;return new Fi(r.byteWidth)}case"fixedsizelist":{let r=i.type;return new ze(r.listSize,(t||[])[0])}case"map":{let r=i.type;return new We((t||[])[0],r.keysSorted)}}throw new Error('Unrecognized type: "'.concat(e,'"'))}var pw=dr,_w=be,pe=class i{static fromJSON(t,e){let r=new i(0,Bt.V5,e);return r._createHeader=yw(t,e),r}static decode(t){t=new _w(rt(t));let e=Ke.getRootAsMessage(t),r=e.bodyLength(),s=e.version(),d=e.headerType(),_=new i(r,s,d);return _._createHeader=mw(e,d),_}static encode(t){let e=new pw,r=-1;return t.isSchema()?r=Ft.encode(e,t.header()):t.isRecordBatch()?r=ie.encode(e,t.header()):t.isDictionaryBatch()&&(r=fe.encode(e,t.header())),Ke.startMessage(e),Ke.addVersion(e,Bt.V5),Ke.addHeader(e,r),Ke.addHeaderType(e,t.headerType),Ke.addBodyLength(e,BigInt(t.bodyLength)),Ke.finishMessageBuffer(e,Ke.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Ft)return new i(0,Bt.V5,bt.Schema,t);if(t instanceof ie)return new i(e,Bt.V5,bt.RecordBatch,t);if(t instanceof fe)return new i(e,Bt.V5,bt.DictionaryBatch,t);throw new Error("Unrecognized Message header: ".concat(t))}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===bt.Schema}isRecordBatch(){return this.headerType===bt.RecordBatch}isDictionaryBatch(){return this.headerType===bt.DictionaryBatch}constructor(t,e,r,s){this._version=e,this._headerType=r,this.body=new Uint8Array(0),s&&(this._createHeader=()=>s),this._bodyLength=wt(t)}},ie=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,r){this._nodes=e,this._buffers=r,this._length=wt(t)}},fe=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(t,e,r=!1){this._data=t,this._isDelta=r,this._id=wt(e)}},de=class{constructor(t,e){this.offset=wt(t),this.length=wt(e)}},Ae=class{constructor(t,e){this.length=wt(t),this.nullCount=wt(e)}};function yw(i,t){return()=>{switch(t){case bt.Schema:return Ft.fromJSON(i);case bt.RecordBatch:return ie.fromJSON(i);case bt.DictionaryBatch:return fe.fromJSON(i)}throw new Error("Unrecognized Message type: { name: ".concat(bt[t],", type: ").concat(t," }"))}}function mw(i,t){return()=>{switch(t){case bt.Schema:return Ft.decode(i.header(new ue),new Map,i.version());case bt.RecordBatch:return ie.decode(i.header(new ve),i.version());case bt.DictionaryBatch:return fe.decode(i.header(new pi),i.version())}throw new Error("Unrecognized Message type: { name: ".concat(bt[t],", type: ").concat(t," }"))}}_t.encode=Fw;_t.decode=Bw;_t.fromJSON=Ou;Ft.encode=Dw;Ft.decode=bw;Ft.fromJSON=xu;ie.encode=Aw;ie.decode=vw;ie.fromJSON=uc;fe.encode=xw;fe.decode=gw;fe.fromJSON=ku;Ae.encode=kw;Ae.decode=Sw;de.encode=Ew;de.decode=ww;function bw(i,t=new Map,e=Bt.V5){let r=jw(i,t);return new Ft(r,Go(i),t,e)}function vw(i,t=Bt.V5){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new ie(i.length(),Iw(i),Tw(i,t))}function gw(i,t=Bt.V5){return new fe(ie.decode(i.data(),t),i.id(),i.isDelta())}function ww(i){return new de(i.offset(),i.length())}function Sw(i){return new Ae(i.length(),i.nullCount())}function Iw(i){let t=[];for(let e,r=-1,s=-1,d=i.nodesLength();++r<d;)(e=i.nodes(r))&&(t[++s]=Ae.decode(e));return t}function Tw(i,t){let e=[];for(let r,s=-1,d=-1,_=i.buffersLength();++s<_;)(r=i.buffers(s))&&(t<Bt.V4&&(r.bb_pos+=8*(s+1)),e[++d]=de.decode(r));return e}function jw(i,t){let e=[];for(let r,s=-1,d=-1,_=i.fieldsLength();++s<_;)(r=i.fields(s))&&(e[++d]=_t.decode(r,t));return e}function Cu(i,t){let e=[];for(let r,s=-1,d=-1,_=i.childrenLength();++s<_;)(r=i.children(s))&&(e[++d]=_t.decode(r,t));return e}function Bw(i,t){let e,r,s,d,_,b;return!t||!(b=i.dictionary())?(s=Ru(i,Cu(i,t)),r=new _t(i.name(),s,i.nullable(),Go(i))):t.has(e=wt(b.id()))?(d=(d=b.indexType())?Mu(d):new oi,_=new ge(t.get(e),d,e,b.isOrdered()),r=new _t(i.name(),_,i.nullable(),Go(i))):(d=(d=b.indexType())?Mu(d):new oi,t.set(e,s=Ru(i,Cu(i,t))),_=new ge(s,d,e,b.isOrdered()),r=new _t(i.name(),_,i.nullable(),Go(i))),r||null}function Go(i){let t=new Map;if(i)for(let e,r,s=-1,d=Math.trunc(i.customMetadataLength());++s<d;)(e=i.customMetadata(s))&&(r=e.key())!=null&&t.set(r,e.value());return t}function Mu(i){return new Xt(i.isSigned(),i.bitWidth())}function Ru(i,t){let e=i.typeType();switch(e){case Ut.NONE:return new ae;case Ut.Null:return new ae;case Ut.Binary:return new mi;case Ut.LargeBinary:return new bi;case Ut.Utf8:return new vi;case Ut.LargeUtf8:return new gi;case Ut.Bool:return new wi;case Ut.List:return new Ve((t||[])[0]);case Ut.Struct_:return new Ct(t||[])}switch(e){case Ut.Int:{let r=i.type(new Re);return new Xt(r.isSigned(),r.bitWidth())}case Ut.FloatingPoint:{let r=i.type(new Xi);return new Be(r.precision())}case Ut.Decimal:{let r=i.type(new si);return new Si(r.scale(),r.precision(),r.bitWidth())}case Ut.Date:{let r=i.type(new Ki);return new Ii(r.unit())}case Ut.Time:{let r=i.type(new _i);return new Ti(r.unit(),r.bitWidth())}case Ut.Timestamp:{let r=i.type(new yi);return new ji(r.unit(),r.timezone())}case Ut.Interval:{let r=i.type(new Zi);return new Bi(r.unit())}case Ut.Duration:{let r=i.type(new qi);return new Di(r.unit())}case Ut.Union:{let r=i.type(new Le);return new He(r.mode(),r.typeIdsArray()||[],t||[])}case Ut.FixedSizeBinary:{let r=i.type(new Yi);return new Fi(r.byteWidth())}case Ut.FixedSizeList:{let r=i.type(new Ji);return new ze(r.listSize(),(t||[])[0])}case Ut.Map:{let r=i.type(new Qi);return new We((t||[])[0],r.keysSorted())}}throw new Error('Unrecognized type: "'.concat(Ut[e],'" (').concat(e,")"))}function Dw(i,t){let e=t.fields.map(d=>_t.encode(i,d));ue.startFieldsVector(i,e.length);let r=ue.createFieldsVector(i,e),s=t.metadata&&t.metadata.size>0?ue.createCustomMetadataVector(i,[...t.metadata].map(([d,_])=>{let b=i.createString("".concat(d)),g=i.createString("".concat(_));return Jt.startKeyValue(i),Jt.addKey(i,b),Jt.addValue(i,g),Jt.endKeyValue(i)})):-1;return ue.startSchema(i),ue.addFields(i,r),ue.addEndianness(i,Uw?Gi.Little:Gi.Big),s!==-1&&ue.addCustomMetadata(i,s),ue.endSchema(i)}function Fw(i,t){let e=-1,r=-1,s=-1,d=t.type,_=t.typeId;V.isDictionary(d)?(_=d.dictionary.typeId,s=Wo.visit(d,i),r=Wo.visit(d.dictionary,i)):r=Wo.visit(d,i);let b=(d.children||[]).map(B=>_t.encode(i,B)),g=ne.createChildrenVector(i,b),I=t.metadata&&t.metadata.size>0?ne.createCustomMetadataVector(i,[...t.metadata].map(([B,U])=>{let C=i.createString("".concat(B)),R=i.createString("".concat(U));return Jt.startKeyValue(i),Jt.addKey(i,C),Jt.addValue(i,R),Jt.endKeyValue(i)})):-1;return t.name&&(e=i.createString(t.name)),ne.startField(i),ne.addType(i,r),ne.addTypeType(i,_),ne.addChildren(i,g),ne.addNullable(i,!!t.nullable),e!==-1&&ne.addName(i,e),s!==-1&&ne.addDictionary(i,s),I!==-1&&ne.addCustomMetadata(i,I),ne.endField(i)}function Aw(i,t){let e=t.nodes||[],r=t.buffers||[];ve.startNodesVector(i,e.length);for(let _ of e.slice().reverse())Ae.encode(i,_);let s=i.endVector();ve.startBuffersVector(i,r.length);for(let _ of r.slice().reverse())de.encode(i,_);let d=i.endVector();return ve.startRecordBatch(i),ve.addLength(i,BigInt(t.length)),ve.addNodes(i,s),ve.addBuffers(i,d),ve.endRecordBatch(i)}function xw(i,t){let e=ie.encode(i,t.data);return pi.startDictionaryBatch(i),pi.addId(i,BigInt(t.id)),pi.addIsDelta(i,t.isDelta),pi.addData(i,e),pi.endDictionaryBatch(i)}function kw(i,t){return Mr.createFieldNode(i,BigInt(t.length),BigInt(t.nullCount))}function Ew(i,t){return Cr.createBuffer(i,BigInt(t.offset),BigInt(t.length))}var Uw=(()=>{let i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})();var dc=i=>"Expected ".concat(bt[i]," Message in stream, but was null or length 0."),fc=i=>"Header pointer of flatbuffer-encoded ".concat(bt[i]," Message is null or length 0."),Lu=(i,t)=>"Expected to read ".concat(i," metadata bytes, but only read ").concat(t,"."),Nu=(i,t)=>"Expected to read ".concat(i," bytes for message body, but only read ").concat(t,"."),tn=class{constructor(t){this.source=t instanceof li?t:new li(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?Mt:t.value===-1&&(t=this.readMetadataLength()).done?Mt:(t=this.readMetadata(t.value)).done?Mt:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(dc(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=rt(this.source.read(t));if(e.byteLength<t)throw new Error(Nu(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){let e=bt.Schema,r=this.readMessage(e),s=r==null?void 0:r.header();if(t&&!s)throw new Error(fc(e));return s}readMetadataLength(){let t=this.source.read(Ko),e=t&&new be(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}}readMetadata(t){let e=this.source.read(t);if(!e)return Mt;if(e.byteLength<t)throw new Error(Lu(t,e.byteLength));return{done:!1,value:pe.decode(e)}}},ds=class{constructor(t,e){this.source=t instanceof De?t:js(t)?new nr(t,e):new De(t)}[Symbol.asyncIterator](){return this}next(){return P(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?Mt:t.value===-1&&(t=yield this.readMetadataLength()).done?Mt:(t=yield this.readMetadata(t.value)).done?Mt:t})}throw(t){return P(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return P(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return P(this,void 0,void 0,function*(){let e;if((e=yield this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(dc(t));return e.value})}readMessageBody(t){return P(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let e=rt(yield this.source.read(t));if(e.byteLength<t)throw new Error(Nu(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(){return P(this,arguments,void 0,function*(t=!1){let e=bt.Schema,r=yield this.readMessage(e),s=r==null?void 0:r.header();if(t&&!s)throw new Error(fc(e));return s})}readMetadataLength(){return P(this,void 0,void 0,function*(){let t=yield this.source.read(Ko),e=t&&new be(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(t){return P(this,void 0,void 0,function*(){let e=yield this.source.read(t);if(!e)return Mt;if(e.byteLength<t)throw new Error(Lu(t,e.byteLength));return{done:!1,value:pe.decode(e)}})}},fs=class extends tn{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Ln?t:new Ln(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:pe.fromJSON(t.schema,bt.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:pe.fromJSON(e,bt.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:pe.fromJSON(e,bt.RecordBatch)}}return this._body=[],Mt}readMessageBody(t){return e(this._body);function e(r){return(r||[]).reduce((s,d)=>[...s,...d.VALIDITY&&[d.VALIDITY]||[],...d.TYPE_ID&&[d.TYPE_ID]||[],...d.OFFSET&&[d.OFFSET]||[],...d.DATA&&[d.DATA]||[],...e(d.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(dc(t));return e.value}readSchema(){let t=bt.Schema,e=this.readMessage(t),r=e==null?void 0:e.header();if(!e||!r)throw new Error(fc(t));return r}},Ko=4,hc="ARROW1",en=new Uint8Array(hc.length);for(let i=0;i<hc.length;i+=1)en[i]=hc.codePointAt(i);function qo(i,t=0){for(let e=-1,r=en.length;++e<r;)if(en[e]!==i[t+e])return!1;return!0}var rn=en.length,pc=rn+Ko,Pu=rn*2+Ko;var re=class i extends vr{constructor(t){super(),this._impl=t}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(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let e=this._impl.open(t);return Ue(e)?e.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return te.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return te.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof i?t:Is(t)?Cw(t):js(t)?Lw(t):Ue(t)?P(this,void 0,void 0,function*(){return yield i.from(yield t)}):Bs(t)||mn(t)||Fs(t)||Ie(t)?Rw(new De(t)):Mw(new li(t))}static readAll(t){return t instanceof i?t.isSync()?Vu(t):Hu(t):Is(t)||ArrayBuffer.isView(t)||Oe(t)||Ts(t)?Vu(t):Hu(t)}},hi=class extends re{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return ye(this,arguments,function*(){yield dt(yield*ur(Ur(Ee(this[Symbol.iterator]()))))})}},sr=class extends re{constructor(t){super(t),this._impl=t}readAll(){return P(this,void 0,void 0,function*(){var t,e,r,s;let d=new Array;try{for(var _=!0,b=Ee(this),g;g=yield b.next(),t=g.done,!t;_=!0){s=g.value,_=!1;let I=s;d.push(I)}}catch(I){e={error:I}}finally{try{!_&&!t&&(r=b.return)&&(yield r.call(b))}finally{if(e)throw e.error}}return d})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},or=class extends hi{constructor(t){super(t),this._impl=t}},ps=class extends sr{constructor(t){super(t),this._impl=t}},Yo=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){let r=this._loadVectors(t,e,this.schema.fields),s=ct({type:new Ct(this.schema.fields),length:t.length,children:r});return new zt(this.schema,s)}_loadDictionaryBatch(t,e){let{id:r,isDelta:s}=t,{dictionaries:d,schema:_}=this,b=d.get(r),g=_.dictionaries.get(r),I=this._loadVectors(t.data,e,[g]);return(b&&s?b.concat(new vt(I)):new vt(I)).memoize()}_loadVectors(t,e,r){return new Hn(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},nn=class extends Yo{constructor(t,e){super(e),this._reader=Is(t)?new fs(this._handle=t):new tn(this._handle=t)}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(t){return this.closed||(this.autoDestroy=zu(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):Mt}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Mt}next(){if(this.closed)return Mt;let t,{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),s=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,s)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),s=e.readMessageBody(t.bodyLength),d=this._loadDictionaryBatch(r,s);this.dictionaries.set(r.id,d)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Br(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},sn=class extends Yo{constructor(t,e){super(e),this._reader=new ds(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return P(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return P(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=zu(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return P(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Mt})}return(t){return P(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Mt})}next(){return P(this,void 0,void 0,function*(){if(this.closed)return Mt;let t,{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),s=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,s)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),s=yield e.readMessageBody(t.bodyLength),d=this._loadDictionaryBatch(r,s);this.dictionaries.set(r.id,d)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Br(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return P(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},Jo=class extends nn{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof Nn?t:new Nn(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();let r=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){let s=this._reader.readMessage(bt.RecordBatch);if(s!=null&&s.isRecordBatch()){let d=s.header(),_=this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(d,_)}}return null}_readDictionaryBatch(t){var e;let r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){let s=this._reader.readMessage(bt.DictionaryBatch);if(s!=null&&s.isDictionaryBatch()){let d=s.header(),_=this._reader.readMessageBody(s.bodyLength),b=this._loadDictionaryBatch(d,_);this.dictionaries.set(d.id,b)}}}_readFooter(){let{_handle:t}=this,e=t.size-pc,r=t.readInt32(e),s=t.readAt(e-r,r);return ki.decode(s)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(this._recordBatchIndex);if(r&&this._handle.seek(r.offset))return this._reader.readMessage(t)}return null}},_c=class extends sn{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...e){let r=typeof e[0]!="number"?e.shift():void 0,s=e[0]instanceof Map?e.shift():void 0;super(t instanceof nr?t:new nr(t,r),s)}isFile(){return!0}isAsync(){return!0}open(t){let e=Object.create(null,{open:{get:()=>super.open}});return P(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 e.open.call(this,t)})}readRecordBatch(t){return P(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());let r=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(r&&(yield this._handle.seek(r.offset))){let s=yield this._reader.readMessage(bt.RecordBatch);if(s!=null&&s.isRecordBatch()){let d=s.header(),_=yield this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(d,_)}}return null})}_readDictionaryBatch(t){return P(this,void 0,void 0,function*(){var e;let r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let s=yield this._reader.readMessage(bt.DictionaryBatch);if(s!=null&&s.isDictionaryBatch()){let d=s.header(),_=yield this._reader.readMessageBody(s.bodyLength),b=this._loadDictionaryBatch(d,_);this.dictionaries.set(d.id,b)}}})}_readFooter(){return P(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-pc,r=yield t.readInt32(e),s=yield t.readAt(e-r,r);return ki.decode(s)})}_readNextMessageAndValidate(t){return P(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let e=this._footer.getRecordBatch(this._recordBatchIndex);if(e&&(yield this._handle.seek(e.offset)))return yield this._reader.readMessage(t)}return null})}},yc=class extends nn{constructor(t,e){super(t,e)}_loadVectors(t,e,r){return new wo(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function zu(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*Vu(i){let t=re.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function Hu(i){return ye(this,arguments,function*(){let e=yield dt(re.from(i));try{if(!(yield dt(e.open({autoDestroy:!1}))).closed)do yield yield dt(e);while(!(yield dt(e.reset().open())).closed)}finally{yield dt(e.cancel())}})}function Cw(i){return new hi(new yc(i))}function Mw(i){let t=i.peek(rn+7&-8);return t&&t.byteLength>=4?qo(t)?new or(new Jo(i.read())):new hi(new nn(i)):new hi(new nn(function*(){}()))}function Rw(i){return P(this,void 0,void 0,function*(){let t=yield i.peek(rn+7&-8);return t&&t.byteLength>=4?qo(t)?new or(new Jo(yield i.read())):new sr(new sn(i)):new sr(new sn(function(){return ye(this,arguments,function*(){})}()))})}function Lw(i){return P(this,void 0,void 0,function*(){let{size:t}=yield i.stat(),e=new nr(i,t);return t>=Pu&&qo(yield e.readAt(0,rn+7&-8))?new ps(new _c(e)):new sr(new sn(e))})}var Nt=class i extends J{static assemble(...t){let e=s=>s.flatMap(d=>Array.isArray(d)?e(d):d instanceof zt?d.data.children:d.data),r=new i;return r.visitMany(e(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof vt)return this.visitMany(t.data),this;let{type:e}=t;if(!V.isDictionary(e)){let{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(V.isUnion(e))this.nodes.push(new Ae(r,0));else{let{nullCount:s}=t;V.isNull(e)||qe.call(this,s<=0?new Uint8Array(0):_r(t.offset,r,t.nullBitmap)),this.nodes.push(new Ae(r,s))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function qe(i){let t=i.byteLength+7&-8;return this.buffers.push(i),this.bufferRegions.push(new de(this._byteLength,t)),this._byteLength+=t,this}function Nw(i){var t;let{type:e,length:r,typeIds:s,valueOffsets:d}=i;if(qe.call(this,s),e.mode===Et.Sparse)return mc.call(this,i);if(e.mode===Et.Dense){if(i.offset<=0)return qe.call(this,d),mc.call(this,i);{let _=new Int32Array(r),b=Object.create(null),g=Object.create(null);for(let I,B,U=-1;++U<r;)(I=s[U])!==void 0&&((B=b[I])===void 0&&(B=b[I]=d[U]),_[U]=d[U]-B,g[I]=((t=g[I])!==null&&t!==void 0?t:0)+1);qe.call(this,_),this.visitMany(i.children.map((I,B)=>{let U=e.typeIds[B],C=b[U],R=g[U];return I.slice(C,Math.min(r,R))}))}}return this}function Pw(i){let t;return i.nullCount>=i.length?qe.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?qe.call(this,_r(i.offset,i.length,t)):qe.call(this,yr(i.values))}function Ni(i){return qe.call(this,i.values.subarray(0,i.length*i.stride))}function Xo(i){let{length:t,values:e,valueOffsets:r}=i,s=wt(r[0]),d=wt(r[t]),_=Math.min(d-s,e.byteLength-s);return qe.call(this,xs(-s,t+1,r)),qe.call(this,e.subarray(s,s+_)),this}function bc(i){let{length:t,valueOffsets:e}=i;if(e){let{[0]:r,[t]:s}=e;return qe.call(this,xs(-r,t+1,e)),this.visit(i.children[0].slice(r,s-r))}return this.visit(i.children[0])}function mc(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}Nt.prototype.visitBool=Pw;Nt.prototype.visitInt=Ni;Nt.prototype.visitFloat=Ni;Nt.prototype.visitUtf8=Xo;Nt.prototype.visitLargeUtf8=Xo;Nt.prototype.visitBinary=Xo;Nt.prototype.visitLargeBinary=Xo;Nt.prototype.visitFixedSizeBinary=Ni;Nt.prototype.visitDate=Ni;Nt.prototype.visitTimestamp=Ni;Nt.prototype.visitTime=Ni;Nt.prototype.visitDecimal=Ni;Nt.prototype.visitList=bc;Nt.prototype.visitStruct=mc;Nt.prototype.visitUnion=Nw;Nt.prototype.visitInterval=Ni;Nt.prototype.visitDuration=Ni;Nt.prototype.visitFixedSizeList=bc;Nt.prototype.visitMap=bc;var Dr=class extends vr{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new ci,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,oe(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Ue(t)?t.then(e=>this.writeAll(e)):Ie(t)?gc(this,t):vc(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof ci?this._sink=t:(this._sink=new ci,t&&sl(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&ol(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!jr(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof le&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof zt&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!jr(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof zt?t instanceof Br||this._writeRecordBatch(t):t instanceof le?this.writeAll(t.batches):Oe(t)&&this.writeAll(t)}_writeMessage(t,e=8){let r=e-1,s=pe.encode(t),d=s.byteLength,_=this._writeLegacyIpcFormat?4:8,b=d+_+r&~r,g=b-d-_;return t.headerType===bt.RecordBatch?this._recordBatchBlocks.push(new Ei(b,t.bodyLength,this._position)):t.headerType===bt.DictionaryBatch&&this._dictionaryBlocks.push(new Ei(b,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(b-_)),d>0&&this._write(s),this._writePadding(g)}_write(t){if(this._started){let e=rt(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(pe.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(en)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:r,bufferRegions:s,buffers:d}=Nt.assemble(t),_=new ie(t.numRows,r,s),b=pe.from(_,e);return this._writeDictionaries(t)._writeMessage(b)._writeBodyBuffers(d)}_writeDictionaryBatch(t,e,r=!1){let{byteLength:s,nodes:d,bufferRegions:_,buffers:b}=Nt.assemble(new vt([t])),g=new ie(t.length,d,_),I=new fe(g,e,r),B=pe.from(I,s);return this._writeMessage(B)._writeBodyBuffers(b)}_writeBodyBuffers(t){let e,r,s;for(let d=-1,_=t.length;++d<_;)(e=t[d])&&(r=e.byteLength)>0&&(this._write(e),(s=(r+7&-8)-r)>0&&this._writePadding(s));return this}_writeDictionaries(t){var e,r;for(let[s,d]of t.dictionaries){let _=(e=d==null?void 0:d.data)!==null&&e!==void 0?e:[],b=this._seenDictionaries.get(s),g=(r=this._dictionaryDeltaOffsets.get(s))!==null&&r!==void 0?r:0;if(!b||b.data[0]!==_[0])for(let[I,B]of _.entries())this._writeDictionaryBatch(B,s,I>0);else if(g<_.length)for(let I of _.slice(g))this._writeDictionaryBatch(I,s,!0);this._seenDictionaries.set(s,d),this._dictionaryDeltaOffsets.set(s,_.length)}return this}},Fr=class i extends Dr{static writeAll(t,e){let r=new i(e);return Ue(t)?t.then(s=>r.writeAll(s)):Ie(t)?gc(r,t):vc(r,t)}},Ar=class i extends Dr{static writeAll(t){let e=new i;return Ue(t)?t.then(r=>e.writeAll(r)):Ie(t)?gc(e,t):vc(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,r=!1){if(!r&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,r)}_writeFooter(t){let e=ki.encode(new ki(t,Bt.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}};function vc(i,t){let e=t;t instanceof le&&(e=t.batches,i.reset(void 0,t.schema));for(let r of e)i.write(r);return i.finish()}function gc(i,t){return P(this,void 0,void 0,function*(){var e,r,s,d,_,b,g;try{for(e=!0,r=Ee(t);s=yield r.next(),d=s.done,!d;e=!0){g=s.value,e=!1;let I=g;i.write(I)}}catch(I){_={error:I}}finally{try{!e&&!d&&(b=r.return)&&(yield b.call(r))}finally{if(_)throw _.error}}return i.finish()})}function Wu(i,t){if(Ie(i))return Hw(i,t);if(Oe(i))return Vw(i,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function Vw(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,s=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(_){d(_,e||(e=i[Symbol.iterator]()))},pull(_){e?d(_,e):_.close()},cancel(){(e!=null&&e.return&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:r?s:void 0},t));function d(_,b){let g,I=null,B=_.desiredSize||null;for(;!(I=b.next(r?B:null)).done;)if(ArrayBuffer.isView(I.value)&&(g=rt(I.value))&&(B!=null&&r&&(B=B-g.byteLength+1),I.value=g),_.enqueue(I.value),B!=null&&--B<=0)return;_.close()}}function Hw(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,s=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(_){return P(this,void 0,void 0,function*(){yield d(_,e||(e=i[Symbol.asyncIterator]()))})},pull(_){return P(this,void 0,void 0,function*(){e?yield d(_,e):_.close()})},cancel(){return P(this,void 0,void 0,function*(){(e!=null&&e.return&&(yield e.return())||!0)&&(e=null)})}}),Object.assign({highWaterMark:r?s:void 0},t));function d(_,b){return P(this,void 0,void 0,function*(){let g,I=null,B=_.desiredSize||null;for(;!(I=yield b.next(r?B:null)).done;)if(ArrayBuffer.isView(I.value)&&(g=rt(I.value))&&(B!=null&&r&&(B=B-g.byteLength+1),I.value=g),_.enqueue(I.value),B!=null&&--B<=0)return;_.close()})}}function Ku(i){return new wc(i)}var wc=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:e,["writableStrategy"]:r,["queueingStrategy"]:s="count"}=t,d=rl(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=wr(d),this._getSize=s!=="bytes"?$u:Gu;let{["highWaterMark"]:_=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:b=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:g=>{this._maybeFlush(this._builder,this._controller=g)},start:g=>{this._maybeFlush(this._builder,this._controller=g)}},{highWaterMark:_,size:s!=="bytes"?$u:Gu}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:b,size:g=>this._writeValueAndReturnChunkSize(g)})}_writeValueAndReturnChunkSize(t){let e=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-e}_maybeFlush(t,e){e!=null&&(this._bufferedSize>=e.desiredSize&&++this._numChunks&&this._enqueue(e,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(e,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(e,null)))}_enqueue(t,e){this._bufferedSize=0,this._controller=null,e==null?t.close():t.enqueue(e)}},$u=i=>{var t;return(t=i==null?void 0:i.length)!==null&&t!==void 0?t:0},Gu=i=>{var t;return(t=i==null?void 0:i.byteLength)!==null&&t!==void 0?t:0};function Zo(i,t){let e=new ci,r=null,s=new ReadableStream({cancel(){return P(this,void 0,void 0,function*(){yield e.close()})},start(b){return P(this,void 0,void 0,function*(){yield _(b,r||(r=yield d()))})},pull(b){return P(this,void 0,void 0,function*(){r?yield _(b,r):b.close()})}});return{writable:new WritableStream(e,Object.assign({highWaterMark:Math.pow(2,14)},i)),readable:s};function d(){return P(this,void 0,void 0,function*(){return yield(yield re.from(e)).open(t)})}function _(b,g){return P(this,void 0,void 0,function*(){let I=b.desiredSize,B=null;for(;!(B=yield g.next()).done;)if(b.enqueue(B.value),I!=null&&--I<=0)return;b.close()})}}function Qo(i,t){let e=new this(i),r=new De(e),s=new ReadableStream({cancel(){return P(this,void 0,void 0,function*(){yield r.cancel()})},pull(_){return P(this,void 0,void 0,function*(){yield d(_)})},start(_){return P(this,void 0,void 0,function*(){yield d(_)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,i),readable:s};function d(_){return P(this,void 0,void 0,function*(){let b=null,g=_.desiredSize;for(;b=yield r.read(g||null);)if(_.enqueue(b),g!=null&&(g-=b.byteLength)<=0)return;_.close()})}}function ta(i,t="stream"){return(t==="stream"?Fr:Ar).writeAll(i).toUint8Array(!0)}var Gw=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ua),nc),Ya),Oa),Ba),qa),Aa),{compareSchemas:jr,compareFields:wu,compareTypes:Su});te.toDOMStream=Wu;Lt.throughDOM=Ku;re.throughDOM=Zo;or.throughDOM=Zo;hi.throughDOM=Zo;Dr.throughDOM=Qo;Ar.throughDOM=Qo;Fr.throughDOM=Qo;function on(i){switch(i.typeId){case j.Binary:return{sqlType:"binary"};case j.Bool:return{sqlType:"bool"};case j.Date:return{sqlType:"date"};case j.DateDay:return{sqlType:"date32[d]"};case j.DateMillisecond:return{sqlType:"date64[ms]"};case j.Decimal:{let t=i;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case j.Float:return{sqlType:"float"};case j.Float16:return{sqlType:"float16"};case j.Float32:return{sqlType:"float32"};case j.Float64:return{sqlType:"float64"};case j.Int:return{sqlType:"int32"};case j.Int16:return{sqlType:"int16"};case j.Int32:return{sqlType:"int32"};case j.Int64:return{sqlType:"int64"};case j.Uint16:return{sqlType:"uint16"};case j.Uint32:return{sqlType:"uint32"};case j.Uint64:return{sqlType:"uint64"};case j.Uint8:return{sqlType:"uint8"};case j.IntervalDayTime:return{sqlType:"interval[dt]"};case j.IntervalYearMonth:return{sqlType:"interval[m]"};case j.List:return{sqlType:"list",valueType:on(i.valueType)};case j.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:i.byteWidth};case j.Null:return{sqlType:"null"};case j.Utf8:return{sqlType:"utf8"};case j.Struct:return{sqlType:"struct",fields:i.children.map(e=>ea(e.name,e.type))};case j.Map:{let t=i;return{sqlType:"map",keyType:on(t.keyType),valueType:on(t.valueType)}}case j.Time:return{sqlType:"time[s]"};case j.TimeMicrosecond:return{sqlType:"time[us]"};case j.TimeMillisecond:return{sqlType:"time[ms]"};case j.TimeNanosecond:return{sqlType:"time[ns]"};case j.TimeSecond:return{sqlType:"time[s]"};case j.Timestamp:return{sqlType:"timestamp",timezone:i.timezone||void 0};case j.TimestampSecond:return{sqlType:"timestamp[s]",timezone:i.timezone||void 0};case j.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:i.timezone||void 0};case j.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:i.timezone||void 0};case j.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:i.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(i.toString()))}function ea(i,t){let e=on(t);return e.name=i,e}var ia=class{constructor(t,e){this._bindings=t,this._conn=e}close(){this._bindings.disconnect(this._conn)}useUnsafe(t){return t(this._bindings,this._conn)}query(t){let e=this._bindings.runQuery(this._conn,t),r=re.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new le(r)}async send(t,e=!1){let r=this._bindings.startPendingQuery(this._conn,t,e);for(;r==null;)r=await new Promise((_,b)=>{try{_(this._bindings.pollPendingQuery(this._conn))}catch(g){console.log(g),g.message.includes("worker is not set!")?b(new Error("Worker has been terminated")):b(g)}});let s=new ra(this._bindings,this._conn,r),d=re.from(s);return console.assert(d.isSync()),console.assert(d.isStream()),d}cancelSent(){return this._bindings.cancelPendingQuery(this._conn)}getTableNames(t){return this._bindings.getTableNames(this._conn,t)}prepare(t){let e=this._bindings.createPrepared(this._conn,t);return new Sc(this._bindings,this._conn,e)}createScalarFunction(t,e,r){this._bindings.createScalarFunction(this._conn,t,e,r)}insertArrowTable(t,e){let r=ta(t,"stream");this.insertArrowFromIPCStream(r,e)}insertArrowFromIPCStream(t,e){this._bindings.insertArrowFromIPCStream(this._conn,t,e)}insertCSVFromPath(t,e){this._bindings.insertCSVFromPath(this._conn,t,e)}insertJSONFromPath(t,e){this._bindings.insertJSONFromPath(this._conn,t,e)}},ra=class{constructor(t,e,r){this.bindings=t;this.conn=e;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 t=null;do t=this.bindings.fetchQueryResults(this.conn);while(t==null);return this._depleted=t.length==0,{done:this._depleted,value:t}}[Symbol.iterator](){return this}},Sc=class{constructor(t,e,r){this.bindings=t,this.connectionId=e,this.statementId=r}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...t){let e=this.bindings.runPrepared(this.connectionId,this.statementId,t),r=re.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new le(r)}send(...t){let e=this.bindings.sendPrepared(this.connectionId,this.statementId,t),r=new ra(this.bindings,this.connectionId,e),s=re.from(r);return console.assert(s.isSync()),console.assert(s.isStream()),s}};function Yu(i){return i<=255}function Ju(i){return i===256}var Qu=new TextEncoder,Xu=new TextDecoder("utf-8");function Ic(i,t,e){let r=Qu.encode(e),s=i._malloc(r.byteLength),d=i.HEAPU8.subarray(s,s+r.byteLength);d.set(r),i.HEAPF64[(t>>3)+0]=1,i.HEAPF64[(t>>3)+1]=s,i.HEAPF64[(t>>3)+2]=d.byteLength}function jc(i){switch(i){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 Tc(i,t,e,r){let s=i.HEAPU8.subarray(t,t+r*jc(e));switch(e){case"UINT8":return new Uint8Array(s.buffer,s.byteOffset,r);case"INT8":return new Int8Array(s.buffer,s.byteOffset,r);case"INT32":return new Int32Array(s.buffer,s.byteOffset,r);case"FLOAT":return new Float32Array(s.buffer,s.byteOffset,r);case"DOUBLE":return new Float64Array(s.buffer,s.byteOffset,r);case"VARCHAR":return new Float64Array(s.buffer,s.byteOffset,r);default:return new Array(0)}}function Zu(i,t,e){let r=i.HEAPU8.subarray(t,t+e);return new Uint8Array(r.buffer,r.byteOffset,e)}function na(i,t,e){let r=i.HEAPU8.subarray(t,t+e*8);return new Float64Array(r.buffer,r.byteOffset,e)}function th(i,t,e,r,s,d,_,b){try{let g=i._udfFunctions.get(r);if(!g){Ic(t,e,"Unknown UDF with id: "+r);return}let I=Xu.decode(t.HEAPU8.subarray(s,s+d)),B=JSON.parse(I),U=na(t,_,b/8),C=E=>{var O;let H=null;switch(E.validityBuffer!==void 0&&(H=Zu(t,U[E.validityBuffer],B.rows)),E.physicalType){case"VARCHAR":{if(E.dataBuffer===null||E.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(E.lengthBuffer===null||E.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let q=Tc(t,U[E.dataBuffer],E.physicalType,B.rows),k=[],Y=na(t,U[E.lengthBuffer],B.rows);for(let it=0;it<B.rows;++it){if(H!=null&&!H[it]){k.push(null);continue}let L=t.HEAPU8.subarray(q[it],q[it]+Y[it]),mt=Xu.decode(L);k.push(mt)}return it=>k[it]}case"STRUCT":{let q={},k=[];for(let Y=0;Y<(((O=E.children)==null?void 0:O.length)||0);++Y){let it=E.children[Y],L=C(it);k.push(mt=>{q[it.name]=L(mt)})}return H!=null?Y=>{if(!H[Y])return null;for(let it of k)it(Y);return q}:Y=>{for(let it of k)it(Y);return q}}default:{if(E.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+E.physicalType);let q=Tc(t,U[E.dataBuffer],E.physicalType,B.rows);return H!=null?k=>H[k]?q[k]:null:k=>q[k]}}},R=[];for(let E=0;E<B.args.length;++E)R.push(C(B.args[E]));let ft=B.rows*jc(B.ret.physicalType),yt=t._malloc(ft),Wt=Tc(t,yt,B.ret.physicalType,B.rows),Rt=t._malloc(B.rows),xt=Zu(t,Rt,B.rows);if(Wt.length==0||xt.length==0){Ic(t,e,"Can't create physical arrays for result");return}let Tt=Wt;B.ret.physicalType=="VARCHAR"&&(Tt=new Array(B.rows));let se=[];for(let E=0;E<B.args.length;++E)se.push(null);for(let E=0;E<B.rows;++E){for(let O=0;O<B.args.length;++O)se[O]=R[O](E);let H=g.func(...se);Tt[E]=H,xt[E]=H==null?0:1}let Zt=0;switch(B.ret.physicalType){case"VARCHAR":{let E=new Array(0);Zt=t._malloc(B.rows*jc("DOUBLE"));let H=na(t,Zt,B.rows),O=0;for(let it=0;it<B.rows;++it){let L=Qu.encode(Tt[it]||"");E.push(L),H[it]=L.length,O+=L.length}let q=t._malloc(O),k=t.HEAPU8.subarray(q,q+O),Y=0;for(let it=0;it<B.rows;++it){Wt[it]=Y;let L=E[it];k.subarray(Y,Y+L.length).set(L),Y+=L.length}}}let x=3*8,N=t._malloc(x),K=na(t,N,3);K[0]=yt,K[1]=Rt,K[2]=Zt,t.HEAPF64[(e>>3)+0]=0,t.HEAPF64[(e>>3)+1]=N,t.HEAPF64[(e>>3)+2]=0}catch(g){Ic(t,e,g.toString())}}function qw(){let i=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),i.decode(t))}var Yw=qw();function Ye(i,t){console.error("FAIL WITH: ".concat(t)),i.ccall("duckdb_web_fail_with",null,["string"],[t])}function xr(i,t,e){let r=new Uint8Array(i.HEAPU8.buffer,t>>>0,e),s=new Uint8Array(new ArrayBuffer(r.byteLength));return s.set(r),s}function ht(i,t,e){return Yw(new Uint8Array(i.HEAPU8.buffer,t>>>0,e))}function At(i,t,e,r){let s=i.stackSave(),d=i.stackAlloc(3*8);e.unshift("number"),r.unshift(d),i.ccall(t,null,e,r);let _=i.HEAPF64[(d>>3)+0],b=i.HEAPF64[(d>>3)+1],g=i.HEAPF64[(d>>3)+2];return i.stackRestore(s),[_,b,g]}function Ot(i){i.ccall("duckdb_web_clear_response",null,[],[])}var sa=class{constructor(t){let e=new Float64Array(t.buffer,t.byteOffset,t.byteLength/8),r=new Uint8Array(new ArrayBuffer(t.byteLength));r.set(t.subarray(7*8)),this.totalFileReadsCold=e[0],this.totalFileReadsAhead=e[1],this.totalFileReadsCached=e[2],this.totalFileWrites=e[3],this.totalPageAccesses=e[4],this.totalPageLoads=e[5],this.blockSize=e[6],this.blockStats=r}getBlockStats(t,e){return e=e||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},e.file_writes=this.blockStats[t*3+0]&15,e.file_reads_cold=this.blockStats[t*3+0]>>4,e.file_reads_ahead=this.blockStats[t*3+1]&15,e.file_reads_cached=this.blockStats[t*3+1]>>4,e.page_accesses=this.blockStats[t*3+1]&15,e.page_loads=this.blockStats[t*3+1]>>4,e}};var an=new TextEncoder;var oa=class{constructor(t,e){this._instance=null;this._initPromise=null;this._initPromiseResolver=()=>{};this.onInstantiationProgress=[];this._logger=t,this._runtime=e,this._nextUDFId=1}get logger(){return this._logger}get mod(){return this._instance}get pthread(){return this.mod.PThread||null}async instantiate(t=e=>{}){return this._instance!=null?this:(this._initPromise!=null&&(this.onInstantiationProgress.push(t),await this._initPromise),this._initPromise=new Promise(e=>{this._initPromiseResolver=e}),this.onInstantiationProgress=[t],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(e=>e!=t),globalThis.DUCKDB_BINDINGS=this,this)}open(t){let[e,r,s]=At(this.mod,"duckdb_web_open",["string"],[JSON.stringify(t)]);if(e!==0)throw new Error(ht(this.mod,r,s));Ot(this.mod)}reset(){let[t,e,r]=At(this.mod,"duckdb_web_reset",[],[]);if(t!==0)throw new Error(ht(this.mod,e,r));Ot(this.mod)}getVersion(){let[t,e,r]=At(this.mod,"duckdb_web_get_version",[],[]);if(t!==0)throw new Error(ht(this.mod,e,r));let s=ht(this.mod,e,r);return Ot(this.mod),s}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(t){let e=an.encode(t),r=this.mod._malloc(e.length)>>>0;new Uint8Array(this.mod.HEAPU8.buffer,r,e.length).set(e);let[d,_,b]=At(this.mod,"duckdb_web_tokenize_buffer",["number","number"],[r,e.length]);if(this.mod._free(r),d!==0)throw new Error(ht(this.mod,_,b));let g=ht(this.mod,_,b);return Ot(this.mod),JSON.parse(g)}connect(){let t=this.mod.ccall("duckdb_web_connect","number",[],[]);return new ia(this,t)}disconnect(t){if(this.mod.ccall("duckdb_web_disconnect",null,["number"],[t]),this.pthread)for(let e of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])e.postMessage({cmd:"dropUDFFunctions",connectionId:t})}runQuery(t,e){let r=an.encode(e),s=this.mod._malloc(r.length)>>>0;new Uint8Array(this.mod.HEAPU8.buffer,s,r.length).set(r);let[_,b,g]=At(this.mod,"duckdb_web_query_run_buffer",["number","number","number"],[t,s,r.length]);if(this.mod._free(s),_!==0)throw new Error(ht(this.mod,b,g));let I=xr(this.mod,b,g);return Ot(this.mod),I}startPendingQuery(t,e,r=!1){let s=an.encode(e),d=this.mod._malloc(s.length)>>>0;new Uint8Array(this.mod.HEAPU8.buffer,d,s.length).set(s);let[b,g,I]=At(this.mod,"duckdb_web_pending_query_start_buffer",["number","number","number","boolean"],[t,d,s.length,r]);if(this.mod._free(d),b!==0)throw new Error(ht(this.mod,g,I));if(g==0)return null;let B=xr(this.mod,g,I);return Ot(this.mod),B}pollPendingQuery(t){let[e,r,s]=At(this.mod,"duckdb_web_pending_query_poll",["number"],[t]);if(e!==0)throw new Error(ht(this.mod,r,s));if(r==0)return null;let d=xr(this.mod,r,s);return Ot(this.mod),d}cancelPendingQuery(t){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[t])}fetchQueryResults(t){let[e,r,s]=At(this.mod,"duckdb_web_query_fetch_results",["number"],[t]);if(Ju(e))return Ot(this.mod),null;if(!Yu(e))throw new Error("Unexpected StatusCode from duckdb_web_query_fetch_results ("+e+") and with self reported error as"+ht(this.mod,r,s));if(e!==0)throw new Error(ht(this.mod,r,s));let d=xr(this.mod,r,s);return Ot(this.mod),d}getTableNames(t,e){let r=an.encode(e),s=this.mod._malloc(r.length)>>>0;new Uint8Array(this.mod.HEAPU8.buffer,s,r.length).set(r);let[_,b,g]=At(this.mod,"duckdb_web_get_tablenames_buffer",["number","number","number"],[t,s,r.length]);if(this.mod._free(s),_!==0)throw new Error(ht(this.mod,b,g));let I=ht(this.mod,b,g);return Ot(this.mod),JSON.parse(I)}createScalarFunction(t,e,r,s){let d={functionId:this._nextUDFId,name:e,returnType:on(r)},_={functionId:d.functionId,connectionId:t,name:e,returnType:r,func:s};this._nextUDFId+=1;let[b,g,I]=At(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[t,JSON.stringify(d)]);if(b!==0)throw new Error(ht(this.mod,g,I));if(Ot(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(_.functionId,_),this.pthread)for(let B of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])B.postMessage({cmd:"registerUDFFunction",udf:_})}createPrepared(t,e){let r=an.encode(e),s=this.mod._malloc(r.length)>>>0;new Uint8Array(this.mod.HEAPU8.buffer,s,r.length).set(r);let[_,b,g]=At(this.mod,"duckdb_web_prepared_create_buffer",["number","number","number"],[t,s,r.length]);if(this.mod._free(s),_!==0)throw new Error(ht(this.mod,b,g));return Ot(this.mod),b}closePrepared(t,e){let[r,s,d]=At(this.mod,"duckdb_web_prepared_close",["number","number"],[t,e]);if(r!==0)throw new Error(ht(this.mod,s,d));Ot(this.mod)}runPrepared(t,e,r){let[s,d,_]=At(this.mod,"duckdb_web_prepared_run",["number","number","string"],[t,e,JSON.stringify(r)]);if(s!==0)throw new Error(ht(this.mod,d,_));let b=xr(this.mod,d,_);return Ot(this.mod),b}sendPrepared(t,e,r){let[s,d,_]=At(this.mod,"duckdb_web_prepared_send",["number","number","string"],[t,e,JSON.stringify(r)]);if(s!==0)throw new Error(ht(this.mod,d,_));let b=xr(this.mod,d,_);return Ot(this.mod),b}insertArrowFromIPCStream(t,e,r){if(e.length==0)return;let s=this.mod._malloc(e.length)>>>0;new Uint8Array(this.mod.HEAPU8.buffer,s,e.length).set(e);let _=r?JSON.stringify(r):"",[b,g,I]=At(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[t,s,e.length,_]);if(this.mod._free(s),b!==0)throw new Error(ht(this.mod,g,I))}insertCSVFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let I in r.columns)r.columnsFlat.push(ea(I,r.columns[I]))}let s={...r};s.columns=s.columnsFlat,delete s.columnsFlat;let d=JSON.stringify(s),[_,b,g]=At(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[t,e,d]);if(_!==0)throw new Error(ht(this.mod,b,g))}insertJSONFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let I in r.columns)r.columnsFlat.push(ea(I,r.columns[I]))}let s={...r};s.columns=s.columnsFlat,delete s.columnsFlat;let d=JSON.stringify(s),[_,b,g]=At(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[t,e,d]);if(_!==0)throw new Error(ht(this.mod,b,g))}globFiles(t){let[e,r,s]=At(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,s));let d=ht(this.mod,r,s);Ot(this.mod);let _=JSON.parse(d);return _==null?[]:_}registerFileURL(t,e,r,s=!1){e===void 0&&(e=t);let[d,_,b]=At(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[t,e,r,s]);if(d!==0)throw new Error(ht(this.mod,_,b));Ot(this.mod)}registerFileText(t,e){let r=an.encode(e);this.registerFileBuffer(t,r)}registerFileBuffer(t,e){let r=this.mod._malloc(e.length)>>>0;new Uint8Array(this.mod.HEAPU8.buffer,r,e.length).set(e);let[d,_,b]=At(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[t,r,e.length]);if(d!==0)throw new Error(ht(this.mod,_,b));Ot(this.mod)}async prepareFileHandle(t,e){if(e===3&&this._runtime.prepareFileHandles){let r=await this._runtime.prepareFileHandles([t],3);for(let s of r){let{handle:d,path:_,fromCached:b}=s;!b&&d.getSize()&&await this.registerFileHandleAsync(_,d,3,!0)}return}throw new Error("prepareFileHandle: unsupported protocol ".concat(e))}async prepareDBFileHandle(t,e){if(e===3&&this._runtime.prepareDBFileHandle){let r=await this._runtime.prepareDBFileHandle(t,3);for(let s of r){let{handle:d,path:_,fromCached:b}=s;!b&&d.getSize()&&await this.registerFileHandleAsync(_,d,3,!0)}return}throw new Error("prepareDBFileHandle: unsupported protocol ".concat(e))}async prepareFileHandleAsync(t,e,r,s){if(r===3&&!(e instanceof FileSystemSyncAccessHandle)){if(e instanceof FileSystemFileHandle){let d=e;try{e=await d.createSyncAccessHandle()}catch(_){throw new Error(_.message+":"+t)}}else if(t!=null)try{e=await(await(await navigator.storage.getDirectory()).getFileHandle(t)).createSyncAccessHandle()}catch(d){throw new Error(d.message+":"+t)}}return e}async registerFileHandleAsync(t,e,r,s){let d=await this.prepareFileHandleAsync(t,e,r,s);this.registerFileHandle(t,d,r,s)}registerFileHandle(t,e,r,s){var g;let[d,_,b]=At(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[t,t,r,s]);if(d!==0)throw new Error(ht(this.mod,_,b));if(Ot(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(t,e),(g=globalThis.DUCKDB_RUNTIME._preparedHandles)!=null&&g[t]&&delete globalThis.DUCKDB_RUNTIME._preparedHandles[t],this.pthread){for(let I of this.pthread.runningWorkers)I.postMessage({cmd:"registerFileHandle",fileName:t,fileHandle:e});for(let I of this.pthread.unusedWorkers)I.postMessage({cmd:"dropFileHandle",fileName:t})}}dropFile(t){let[e,r,s]=At(this.mod,"duckdb_web_fs_drop_file",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,s));Ot(this.mod)}dropFiles(t){let e=[],r=-1;try{for(let b of t!=null?t:[])if(b!=null&&b.length>0){let g=this.mod.lengthBytesUTF8(b)+1,I=this.mod._malloc(g);if(!I)throw new Error("Failed to allocate memory for string: ".concat(b));this.mod.stringToUTF8(b,I,g),e.push(I)}if(r=this.mod._malloc(e.length*4),!r)throw new Error("Failed to allocate memory for pointers array");for(let b=0;b<e.length;b++)this.mod.HEAP32[(r>>2)+b]=e[b];let[s,d,_]=At(this.mod,"duckdb_web_fs_drop_files",["number","number"],[r,e.length]);if(s!==0)throw new Error(ht(this.mod,d,_));Ot(this.mod)}finally{for(let s of e)this.mod._free(s);r>0&&this.mod._free(r)}}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(t,e){let[r,s,d]=At(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[t,e]);if(r!==0)throw new Error(ht(this.mod,s,d));Ot(this.mod)}copyFileToBuffer(t){let[e,r,s]=At(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,s));let d=new Uint8Array(this.mod.HEAPU8.buffer,r>>>0,s),_=new Uint8Array(d.length);return _.set(d),Ot(this.mod),_}async registerOPFSFileName(t){if(t.startsWith("opfs://"))return this.prepareFileHandle(t,3);throw new Error("Not an OPFS file name: "+t)}collectFileStatistics(t,e){let[r,s,d]=At(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[t,e]);if(r!==0)throw new Error(ht(this.mod,s,d))}exportFileStatistics(t){let[e,r,s]=At(this.mod,"duckdb_web_export_file_stats",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,s));return new sa(new Uint8Array(this.mod.HEAPU8.buffer,r>>>0,s))}};var aa=class{constructor(){this._bindings=null;this._nextMessageId=0}log(t){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:"LOG",data:t},[])}sendOK(t){this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"OK",data:null},[])}failWith(t,e){let r={name:e.name,message:e.message,stack:e.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"ERROR",data:r},[])}async onMessage(t){switch(t.type){case"PING":this.sendOK(t);return;case"INSTANTIATE":this._bindings!=null&&this.failWith(t,new Error("duckdb already initialized"));try{this._bindings=await this.instantiate(t.data[0],t.data[1],e=>{this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"INSTANTIATE_PROGRESS",data:e},[])}),this.sendOK(t)}catch(e){console.log(e),this._bindings=null,this.failWith(t,e)}return;default:break}if(!this._bindings)return this.failWith(t,new Error("duckdb is not initialized"));try{switch(t.type){case"GET_VERSION":this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"VERSION_STRING",data:this._bindings.getVersion()},[]);break;case"GET_FEATURE_FLAGS":this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"FEATURE_FLAGS",data:this._bindings.getFeatureFlags()},[]);break;case"RESET":this._bindings.reset(),this.sendOK(t);break;case"OPEN":{let e=t.data.path,r=!!(this._bindings.getFeatureFlags()&32);e!=null&&e.startsWith("opfs://")&&!r&&(await this._bindings.prepareDBFileHandle(e,3),t.data.useDirectIO=!0),this._bindings.open(t.data),this.sendOK(t);break}case"DROP_FILE":this._bindings.dropFile(t.data),this.sendOK(t);break;case"DROP_FILES":this._bindings.dropFiles(t.data),this.sendOK(t);break;case"FLUSH_FILES":this._bindings.flushFiles(),this.sendOK(t);break;case"CONNECT":{let e=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"CONNECTION_INFO",data:e.useUnsafe((r,s)=>s)},[]);break}case"DISCONNECT":this._bindings.disconnect(t.data),this.sendOK(t);break;case"CREATE_PREPARED":{let e=this._bindings.createPrepared(t.data[0],t.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"PREPARED_STATEMENT_ID",data:e},[]);break}case"CLOSE_PREPARED":{this._bindings.closePrepared(t.data[0],t.data[1]),this.sendOK(t);break}case"RUN_PREPARED":{let e=this._bindings.runPrepared(t.data[0],t.data[1],t.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT",data:e},[e.buffer]);break}case"RUN_QUERY":{let e=this._bindings.runQuery(t.data[0],t.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT",data:e},[e.buffer]);break}case"SEND_PREPARED":{let e=this._bindings.sendPrepared(t.data[0],t.data[1],t.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_HEADER",data:e},[e.buffer]);break}case"START_PENDING_QUERY":{let e=this._bindings.startPendingQuery(t.data[0],t.data[1],t.data[2]),r=[];e&&r.push(e.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:e},r);break}case"POLL_PENDING_QUERY":{let e=this._bindings.pollPendingQuery(t.data),r=[];e&&r.push(e.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:e},r);break}case"CANCEL_PENDING_QUERY":{let e=this._bindings.cancelPendingQuery(t.data);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"SUCCESS",data:e},[]);break}case"FETCH_QUERY_RESULTS":{let e=this._bindings.fetchQueryResults(t.data),r=e?[e.buffer]:[];this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_CHUNK",data:e},r);break}case"GET_TABLE_NAMES":{let e=this._bindings.getTableNames(t.data[0],t.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"TABLE_NAMES",data:e},[]);break}case"GLOB_FILE_INFOS":{let e=this._bindings.globFiles(t.data);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"FILE_INFOS",data:e},[]);break}case"REGISTER_FILE_URL":this._bindings.registerFileURL(t.data[0],t.data[1],t.data[2],t.data[3]),this.sendOK(t);break;case"REGISTER_FILE_BUFFER":this._bindings.registerFileBuffer(t.data[0],t.data[1]),this.sendOK(t);break;case"REGISTER_FILE_HANDLE":await this._bindings.registerFileHandleAsync(t.data[0],t.data[1],t.data[2],t.data[3]),this.sendOK(t);break;case"COPY_FILE_TO_PATH":this._bindings.copyFileToPath(t.data[0],t.data[1]),this.sendOK(t);break;case"COPY_FILE_TO_BUFFER":{let e=this._bindings.copyFileToBuffer(t.data);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"FILE_BUFFER",data:e},[]);break}case"COLLECT_FILE_STATISTICS":this._bindings.collectFileStatistics(t.data[0],t.data[1]),this.sendOK(t);break;case"REGISTER_OPFS_FILE_NAME":{!!(this._bindings.getFeatureFlags()&32)||await this._bindings.registerOPFSFileName(t.data[0]),this.sendOK(t);break}case"EXPORT_FILE_STATISTICS":{this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"FILE_STATISTICS",data:this._bindings.exportFileStatistics(t.data)},[]);break}case"INSERT_ARROW_FROM_IPC_STREAM":{this._bindings.insertArrowFromIPCStream(t.data[0],t.data[1],t.data[2]),this.sendOK(t);break}case"IMPORT_CSV_FROM_PATH":{this._bindings.insertCSVFromPath(t.data[0],t.data[1],t.data[2]),this.sendOK(t);break}case"IMPORT_JSON_FROM_PATH":{this._bindings.insertJSONFromPath(t.data[0],t.data[1],t.data[2]),this.sendOK(t);break}case"TOKENIZE":{let e=this._bindings.tokenize(t.data);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"SCRIPT_TOKENS",data:e},[]);break}}}catch(e){return console.log(e),this.failWith(t,e)}}};var sh=tl(nh());var la=class extends oa{constructor(t,e,r,s){super(t,e),this.mainModuleURL=r,this.pthreadWorkerURL=s}locateFile(t,e){if(t.endsWith(".wasm"))return this.mainModuleURL;if(t.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(e," path=").concat(t))}instantiateWasm(t,e){globalThis.DUCKDB_RUNTIME=this._runtime;let r=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"){let d=(async()=>{var ft;let _=new Request(this.mainModuleURL),b=await fetch(_),g=b.headers.get("content-length"),I=g&&parseInt(g,10)||0,B=new Date,U={startedAt:B,updatedAt:B,bytesTotal:I||0,bytesLoaded:0},C={transform(yt,Wt){U.bytesLoaded+=yt.byteLength;let Rt=new Date;if(Rt.getTime()-U.updatedAt.getTime()<20){U.updatedAt=Rt,Wt.enqueue(yt);return}for(let xt of r)xt(U);Wt.enqueue(yt)}},R=new TransformStream(C);return new Response((ft=b.body)==null?void 0:ft.pipeThrough(R),b)})();WebAssembly.instantiateStreaming(d,t).then(_=>{e(_.instance,_.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let s=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(s),t).then(d=>{e(d.instance,d.module)})}else if(typeof XMLHttpRequest=="function"){let s=new XMLHttpRequest,d=this.mainModuleURL,_=new Date,b={startedAt:_,updatedAt:_,bytesTotal:0,bytesLoaded:0};s.open("GET",d),s.responseType="arraybuffer",s.onerror=g=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+g}),new Error(g.toString())},s.onprogress=g=>{b.bytesTotal=g.total,b.bytesLoaded=g.loaded;let I=new Date;if(I.getTime()-b.updatedAt.getTime()<20){b.updatedAt=I;return}for(let B of r)B(b)},s.onload=()=>{WebAssembly.instantiate(s.response,t).then(g=>{e(g.instance,g.module)}).catch(g=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+g}),new Error(g)})},s.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let d=new Request(this.mainModuleURL),b=await(await fetch(d)).arrayBuffer();WebAssembly.instantiate(b,t).then(g=>{e(g.instance,g.module)})})();return[]}};var ua=class extends la{constructor(t,e,r,s=null){super(t,e,r,s)}instantiateImpl(t){return(0,sh.default)({...t,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var ar=tl(ch()),lh=function(i,t,e){var r;return(r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")?new URL(i.endpoint).host:i!=null&&i.endpoint?"".concat(e,".").concat(i==null?void 0:i.endpoint):"".concat(e,".s3.amazonaws.com")};function Xw(i,t,e){var d,_,b,g;let r=uh(t),s=r.path;if(hh(i)){let I="";if(i!=null&&i.endpoint){let B=new URL(i.endpoint);B.pathname!=="/"&&(I=B.pathname)}s="".concat(I,"/").concat(r.bucket).concat(s)}return{url:s,query:"",host:lh(i,t,r.bucket),region:(d=i==null?void 0:i.region)!=null?d:"",service:"s3",method:e,accessKeyId:(_=i==null?void 0:i.accessKeyId)!=null?_:"",secretAccessKey:(b=i==null?void 0:i.secretAccessKey)!=null?b:"",sessionToken:(g=i==null?void 0:i.sessionToken)!=null?g:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function Zw(i,t=!1){let e="0123456789ABCDEF",r="";for(let s=0;s<i.length;s++){let d=i[s];d>="A"&&d<="Z"||d>="a"&&d<="z"||d>="0"&&d<="9"||d=="_"||d=="-"||d=="~"||d=="."?r+=d:d=="/"?t?r+="%2F":r+=d:(r+="%",r+=e[d.charCodeAt(0)>>4],r+=e[d.charCodeAt(0)&15])}return r}function Qw(i,t=null){var ft;let e=(ft=t==null?void 0:t.contentHash)!=null?ft:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=new Map;r.set("x-amz-date",i.datetimeNow),r.set("x-amz-content-sha256",e),i.sessionToken&&r.set("x-amz-security-token",i.sessionToken);let s="";t!=null&&t.contentType&&(s+="content-type;"),s+="host;x-amz-content-sha256;x-amz-date",i.sessionToken&&(s+=";x-amz-security-token");let d=i.method+"\n"+Zw(i.url)+"\n"+i.query;t!=null&&t.contentType&&(d+="\ncontent-type:"+(t==null?void 0:t.contentType)),d+="\nhost:"+i.host+"\nx-amz-content-sha256:"+e+"\nx-amz-date:"+i.datetimeNow,i.sessionToken&&i.sessionToken.length>0&&(d+="\nx-amz-security-token:"+i.sessionToken),d+="\n\n"+s+"\n"+e;let _=(0,ar.sha256)(d),b="AWS4-HMAC-SHA256\n"+i.datetimeNow+"\n"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request\n"+_,g="AWS4"+i.secretAccessKey,I=ar.sha256.hmac.arrayBuffer(g,i.dateNow),B=ar.sha256.hmac.arrayBuffer(I,i.region),U=ar.sha256.hmac.arrayBuffer(B,i.service),C=ar.sha256.hmac.arrayBuffer(U,"aws4_request"),R=ar.sha256.hmac(C,b);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+i.accessKeyId+"/"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request, SignedHeaders="+s+", Signature="+R),r}var tS=function(i,t,e,r=null,s=null){let d=Xw(i,t,e),_={contentType:r,contentHash:s?ar.sha256.hex(s):null};return Qw(d,_)};function Je(i,t,e,r,s=null,d=null){(t!=null&&t.accessKeyId||t!=null&&t.sessionToken)&&(tS(t,e,r,s,d).forEach((b,g)=>{i.setRequestHeader(g,b)}),s&&i.setRequestHeader("content-type",s))}function uh(i){if(i.indexOf("s3://")!=0)throw new Error("URL needs to start with s3://");let t=i.indexOf("/",5);if(t==-1)throw new Error("URL needs to contain a '/' after the host");let e=i.substring(5,t);if(!e)throw new Error("URL needs to contain a bucket name");let r=i.substring(t);if(!r)throw new Error("URL needs to contain key");return{bucket:e,path:r}}function hh(i){var t;return!!((t=i==null?void 0:i.endpoint)!=null&&t.startsWith("http"))}function Xe(i,t){let e=uh(t);return hh(i)?"".concat(i==null?void 0:i.endpoint,"/").concat(e.bucket)+e.path:"https://"+lh(i,t,e.bucket)+e.path}var eS=7,dh=/\/|\\/,ot={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,_preparedHandles:{},_opfsRoot:null,getFileInfo(i,t){try{let e=ot._fileInfoCache.get(t),[r,s,d]=At(i,"duckdb_web_fs_get_file_info_by_id",["number","number"],[t,(e==null?void 0:e.cacheEpoch)||0]);if(r!==0)return null;if(d===0)return e;let _=ht(i,s,d);Ot(i);try{let b=JSON.parse(_);if(b==null)return null;let g={...b,blob:null};return ot._fileInfoCache.set(t,g),!ot._files.has(g.fileName)&&ot._preparedHandles[g.fileName]&&(ot._files.set(g.fileName,ot._preparedHandles[g.fileName]),delete ot._preparedHandles[g.fileName]),g}catch(b){return console.warn(b),null}}catch(e){return console.log(e),null}},getGlobalFileInfo(i){var t;try{let[e,r,s]=At(i,"duckdb_web_get_global_file_info",["number"],[((t=ot._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(e!==0)return null;if(s===0)return ot._globalFileInfo;let d=ht(i,r,s);Ot(i);let _=JSON.parse(d);return _==null?null:(ot._globalFileInfo={..._,blob:null},ot._globalFileInfo)}catch(e){return console.log(e),null}},async assignOPFSRoot(){ot._opfsRoot||(ot._opfsRoot=await navigator.storage.getDirectory())},async prepareFileHandles(i,t){if(t===3){await ot.assignOPFSRoot();let e=async s=>{if(ot._files.has(s))return{path:s,handle:ot._files.get(s),fromCached:!0};let _=ot._opfsRoot,b=s.slice(eS),g=b;if(dh.test(b)){let B=b.split(dh);if(B.length===0)throw new Error("Invalid path ".concat(b));if(g=B[B.length-1],!g)throw new Error("Invalid path ".concat(b,". File Not Found."));B.pop();for(let U of B)_=await _.getDirectoryHandle(U,{create:!0})}let I=await _.getFileHandle(g,{create:!1}).catch(B=>{if((B==null?void 0:B.name)==="NotFoundError")return console.debug("File ".concat(s," does not exists yet, creating...")),_.getFileHandle(g,{create:!0});throw B});try{let B=await I.createSyncAccessHandle();return ot._preparedHandles[s]=B,{path:s,handle:B,fromCached:!1}}catch(B){throw new Error(B.message+":"+name)}},r=[];for(let s of i){let d=await e(s);r.push(d)}return r}throw new Error("Unsupported protocol ".concat(t," for paths ").concat(i," with protocol ").concat(t))},async prepareDBFileHandle(i,t){if(t===3&&this.prepareFileHandles){let e=[i,"".concat(i,".wal")];return this.prepareFileHandles(e,t)}throw new Error("Unsupported protocol ".concat(t," for path ").concat(i," with protocol ").concat(t))},testPlatformFeature:(i,t)=>{switch(t){case 1:return typeof BigInt64Array<"u";default:return console.warn("test for unknown feature: ".concat(t)),!1}},getDefaultDataProtocol(i){return 2},openFile:(i,t,e)=>{var r,s,d,_,b,g;try{ot._fileInfoCache.delete(t);let I=ot.getFileInfo(i,t);switch(I==null?void 0:I.dataProtocol){case 4:case 5:{if(e&1&&e&2)throw new Error("Opening file ".concat(I.fileName," failed: cannot open file with both read and write flags set"));if(e&32)throw new Error("Opening file ".concat(I.fileName," failed: appending to HTTP/S3 files is not supported"));if(e&2){let C=new XMLHttpRequest;if(I.dataProtocol==5?(C.open("HEAD",Xe(I.s3Config,I.dataUrl),!1),Je(C,I.s3Config,I.dataUrl,"HEAD")):C.open("HEAD",I.dataUrl,!1),C.send(null),C.status!=200&&C.status!=404)throw new Error("Opening file ".concat(I.fileName," failed: Unexpected return status from server (").concat(C.status,")"));if(C.status==404&&!(e&8||e&16))throw new Error("Opening file ".concat(I.fileName," failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag."));let R=i._malloc(1),ft=new Uint8Array;i.HEAPU8.set(ft,R);let yt=i._malloc(3*8);return i.HEAPF64[(yt>>3)+0]=1,i.HEAPF64[(yt>>3)+1]=R,i.HEAPF64[(yt>>3)+2]=new Date().getTime()/1e3,yt}else if(!(e&1))throw new Error("Opening file ".concat(I.fileName," failed: unsupported file flags: ").concat(e));let B=null,U=null;if(!I.forceFullHttpReads&&(I.reliableHeadRequests||!I.allowFullHttpReads))try{let C=new XMLHttpRequest;I.dataProtocol==5?(C.open("HEAD",Xe(I.s3Config,I.dataUrl),!1),Je(C,I.s3Config,I.dataUrl,"HEAD")):C.open("HEAD",I.dataUrl,!1),C.setRequestHeader("Range","bytes=0-"),C.send(null),B=null;try{B=C.getResponseHeader("Content-Length")}catch(R){console.warn("Failed to get Content-Length on request")}if(B!==null&&C.status==206){let R=i._malloc(24);i.HEAPF64[(R>>3)+0]=+B,i.HEAPF64[(R>>3)+1]=0;let ft=0;try{ft=new Date((r=C.getResponseHeader("Last-Modified"))!=null?r:"").getTime()/1e3}catch(yt){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(R>>3)+2]=+ft,R}}catch(C){U=C,console.warn("HEAD request with range header failed: ".concat(C))}if(I.allowFullHttpReads){if(!I.forceFullHttpReads){let R=new XMLHttpRequest;I.dataProtocol==5?(R.open("GET",Xe(I.s3Config,I.dataUrl),!1),Je(R,I.s3Config,I.dataUrl,"GET")):R.open("GET",I.dataUrl,!1),R.responseType="arraybuffer",R.setRequestHeader("Range","bytes=0-0"),R.send(null);let ft=null;try{ft=R.getResponseHeader("Content-Length")}catch(xt){console.warn("Failed to get Content-Length on request")}let yt=ft==null?void 0:ft.split("/")[1],Wt=ft,Rt=null;if(yt!==void 0)Rt=yt;else if(!I.reliableHeadRequests){let xt=new XMLHttpRequest;I.dataProtocol==5?(xt.open("HEAD",Xe(I.s3Config,I.dataUrl),!1),Je(xt,I.s3Config,I.dataUrl,"HEAD")):xt.open("HEAD",I.dataUrl,!1),xt.setRequestHeader("Range","bytes=0-"),xt.send(null),B=null;try{B=xt.getResponseHeader("Content-Length")}catch(Tt){console.warn("Failed to get Content-Length on request")}B!==null&&+B>1&&(Rt=B)}if(R.status==206&&Wt!==null&&+Wt==1&&Rt!==null){let xt=i._malloc(24);i.HEAPF64[(xt>>3)+0]=+Rt,i.HEAPF64[(xt>>3)+1]=0;let Tt=0;try{Tt=new Date((s=R.getResponseHeader("Last-Modified"))!=null?s:"").getTime()/1e3}catch(se){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(xt>>3)+2]=+Tt,xt}if(R.status==200&&Wt!==null&&B!==null&&+Wt==+B){console.warn("fall back to full HTTP read for: ".concat(I.dataUrl));let xt=i._malloc(R.response.byteLength),Tt=new Uint8Array(R.response,0,R.response.byteLength);i.HEAPU8.set(Tt,xt);let se=i._malloc(3*8);i.HEAPF64[(se>>3)+0]=R.response.byteLength,i.HEAPF64[(se>>3)+1]=xt;let Zt=0;try{Zt=new Date((d=R.getResponseHeader("Last-Modified"))!=null?d:"").getTime()/1e3}catch(x){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(se>>3)+2]=+Zt,se}console.warn("falling back to full HTTP read for: ".concat(I.dataUrl))}let C=new XMLHttpRequest;if(I.dataProtocol==5?(C.open("GET",Xe(I.s3Config,I.dataUrl),!1),Je(C,I.s3Config,I.dataUrl,"GET")):C.open("GET",I.dataUrl,!1),C.responseType="arraybuffer",C.send(null),C.status==200){let R=i._malloc(C.response.byteLength),ft=new Uint8Array(C.response,0,C.response.byteLength);i.HEAPU8.set(ft,R);let yt=i._malloc(3*8);i.HEAPF64[(yt>>3)+0]=C.response.byteLength,i.HEAPF64[(yt>>3)+1]=R;let Wt=0;try{Wt=new Date((_=C.getResponseHeader("Last-Modified"))!=null?_:"").getTime()/1e3}catch(Rt){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(yt>>3)+2]=+Wt,yt}}if(U!=null)throw new Error("Reading file ".concat(I.fileName," failed with error: ").concat(U));return 0}case 2:{let B=(b=ot._files)==null?void 0:b.get(I.fileName);if(B){let R=i._malloc(24);return i.HEAPF64[(R>>3)+0]=B.size,i.HEAPF64[(R>>3)+1]=0,i.HEAPF64[(R>>3)+2]=0,R}if(e&128)return 0;console.warn("Buffering missing file: ".concat(I.fileName));let U=i._malloc(3*8),C=i._malloc(1);return i.HEAPF64[(U>>3)+0]=1,i.HEAPF64[(U>>3)+1]=C,i.HEAPF64[(U>>3)+2]=0,U}case 3:{let B=(g=ot._files)==null?void 0:g.get(I.fileName);if(!B)throw new Error("No OPFS access handle registered with name: ".concat(I.fileName));e&16&&B.truncate(0);let U=i._malloc(3*8),C=B.getSize();return i.HEAPF64[(U>>3)+0]=C,i.HEAPF64[(U>>3)+1]=0,i.HEAPF64[(U>>3)+2]=0,U}}}catch(I){console.error(I.toString()),Ye(i,I.toString())}return 0},glob:(i,t,e)=>{var r;try{let s=ht(i,t,e);if(s.startsWith("http")||s.startsWith("s3://")){let d=new XMLHttpRequest;if(s.startsWith("s3://")){let _=ot.getGlobalFileInfo(i);d.open("HEAD",Xe(_==null?void 0:_.s3Config,s),!1),Je(d,_==null?void 0:_.s3Config,s,"HEAD")}else d.open("HEAD",s,!1);if(d.send(null),d.status!=200&&d.status!==206){if(!((r=ot.getGlobalFileInfo(i))!=null&&r.allowFullHttpReads))return console.log("HEAD request failed: ".concat(s,", with full http reads are disabled")),0;let _=new XMLHttpRequest;if(s.startsWith("s3://")){let g=ot.getGlobalFileInfo(i);_.open("GET",Xe(g==null?void 0:g.s3Config,s),!1),Je(_,g==null?void 0:g.s3Config,s,"HEAD")}else _.open("GET",s,!1);if(_.setRequestHeader("Range","bytes=0-0"),_.send(null),_.status!=200&&_.status!==206)return console.log("HEAD and GET requests failed: ".concat(s)),0;let b=null;try{b=_.getResponseHeader("Content-Length")}catch(g){console.warn("Failed to get Content-Length on request")}b&&+b>1&&console.warn("Range request for ".concat(s," did not return a partial response: ").concat(_.status,' "').concat(_.statusText,'"'))}i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[s])}else for(let[d]of ot._files.entries()||[])d.startsWith(s)&&i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[d])}catch(s){return console.log(s),Ye(i,s.toString()),0}},checkFile:(i,t,e)=>{try{let r=ht(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let s=new XMLHttpRequest;if(r.startsWith("s3://")){let d=ot.getGlobalFileInfo(i);s.open("HEAD",Xe(d==null?void 0:d.s3Config,r),!1),Je(s,d==null?void 0:d.s3Config,r,"HEAD")}else s.open("HEAD",r,!1);return s.send(null),s.status==206||s.status==200}else return ot._files.has(r)}catch(r){return console.log(r),!1}return!1},syncFile:(i,t)=>{},closeFile:(i,t)=>{var r;let e=ot.getFileInfo(i,t);ot._fileInfoCache.delete(t);try{switch(e==null?void 0:e.dataProtocol){case 0:case 4:case 5:break;case 1:case 2:return;case 3:{let s=(r=ot._files)==null?void 0:r.get(e.fileName);if(!s)throw new Error("No OPFS access handle registered with name: ".concat(e.fileName));return s.flush()}}}catch(s){console.log(s),Ye(i,s.toString())}},dropFile:(i,t,e)=>{var d;let r=ht(i,t,e),s=(d=ot._files)==null?void 0:d.get(r);if(s){if(ot._files.delete(r),s instanceof FileSystemSyncAccessHandle)try{s.flush(),s.close()}catch(_){throw new Error("Cannot drop file with name: ".concat(r))}s instanceof Blob}},truncateFile:(i,t,e)=>{var s;let r=ot.getFileInfo(i,t);switch(r==null?void 0:r.dataProtocol){case 4:Ye(i,"Cannot truncate a http file");return;case 5:Ye(i,"Cannot truncate an s3 file");return;case 0:case 1:case 2:Ye(i,"truncateFile not implemented");return;case 3:{let d=(s=ot._files)==null?void 0:s.get(r.fileName);if(!d)throw new Error("No OPFS access handle registered with name: ".concat(r.fileName));return d.truncate(e)}}return 0},readFile(i,t,e,r,s){var d;if(r==0)return 0;try{let _=ot.getFileInfo(i,t);switch(_==null?void 0:_.dataProtocol){case 4:case 5:{if(!_.dataUrl)throw new Error("Missing data URL for file ".concat(t));try{let b=new XMLHttpRequest;if(_.dataProtocol==5?(b.open("GET",Xe(_==null?void 0:_.s3Config,_.dataUrl),!1),Je(b,_==null?void 0:_.s3Config,_.dataUrl,"GET")):b.open("GET",_.dataUrl,!1),b.responseType="arraybuffer",b.setRequestHeader("Range","bytes=".concat(s,"-").concat(s+r-1)),b.send(null),b.status==206||b.status==200&&r==b.response.byteLength&&s==0){let g=new Uint8Array(b.response,0,Math.min(b.response.byteLength,r));return i.HEAPU8.set(g,e),g.byteLength}else if(b.status==200){console.warn("Range request for ".concat(_.dataUrl," did not return a partial response: ").concat(b.status,' "').concat(b.statusText,'"'));let g=new Uint8Array(b.response,s,Math.min(b.response.byteLength-s,r));return i.HEAPU8.set(g,e),g.byteLength}else throw new Error("Range request for ".concat(_.dataUrl," did returned non-success status: ").concat(b.status,' "').concat(b.statusText,'"'))}catch(b){throw console.log(b),new Error("Range request for ".concat(_.dataUrl," failed with error: ").concat(b,'"'))}}case 2:{let b=(d=ot._files)==null?void 0:d.get(_.fileName);if(!b)throw new Error("No HTML5 file registered with name: ".concat(_.fileName));let g=b.slice(s,s+r),I=new Uint8Array(new FileReaderSync().readAsArrayBuffer(g));return i.HEAPU8.set(I,e),I.byteLength}case 3:{let b=ot._files.get(_.fileName);if(!b)throw new Error("No OPFS access handle registered with name: ".concat(_.fileName));let g=i.HEAPU8.subarray(e,e+r);return b.read(g,{at:s})}}return 0}catch(_){return console.log(_),Ye(i,_.toString()),0}},writeFile:(i,t,e,r,s)=>{var _;let d=ot.getFileInfo(i,t);switch(d==null?void 0:d.dataProtocol){case 4:return Ye(i,"Cannot write to HTTP file"),0;case 5:{let b=i.HEAPU8.subarray(e,e+r),g=new XMLHttpRequest;return g.open("PUT",Xe(d==null?void 0:d.s3Config,d.dataUrl),!1),Je(g,d==null?void 0:d.s3Config,d.dataUrl,"PUT","",b),g.send(b),g.status!==200?(Ye(i,"Failed writing file: HTTP "+g.status),0):r}case 2:return Ye(i,"cannot write using the html5 file reader api"),0;case 3:{let b=(_=ot._files)==null?void 0:_.get(d.fileName);if(!b)throw new Error("No OPFS access handle registered with name: ".concat(d.fileName));let g=i.HEAPU8.subarray(e,e+r);return b.write(g,{at:s})}}return 0},getLastFileModificationTime:(i,t)=>{var r;let e=ot.getFileInfo(i,t);switch(e==null?void 0:e.dataProtocol){case 2:{if(!((r=ot._files)==null?void 0:r.get(e.fileName)))throw Error("No handle available for file: ".concat(e.fileName));return 0}case 4:case 5:return new Date().getTime()/1e3}return 0},progressUpdate:(i,t,e)=>{postMessage&&postMessage({requestId:0,type:"PROGRESS_UPDATE",data:{status:i?"completed":"in-progress",percentage:t,repetitions:e}})},checkDirectory:(i,t,e)=>{let r=ht(i,t,e);return console.log("checkDirectory: ".concat(r)),!1},createDirectory:(i,t,e)=>{let r=ht(i,t,e);console.log("createDirectory: ".concat(r))},removeDirectory:(i,t,e)=>{let r=ht(i,t,e);console.log("removeDirectory: ".concat(r))},listDirectoryEntries:(i,t,e)=>{let r=ht(i,t,e);return console.log("listDirectoryEntries: ".concat(r)),!1},moveFile:(i,t,e,r,s)=>{var g,I;let d=ht(i,t,e),_=ht(i,r,s),b=(g=ot._files)==null?void 0:g.get(d);b!==void 0&&(ot._files.delete(b),ot._files.set(_,b));for(let[B,U]of((I=ot._fileInfoCache)==null?void 0:I.entries())||[])if(U.dataUrl==d){ot._fileInfoCache.delete(B);break}return!0},removeFile:(i,t,e)=>{},callScalarUDF:(i,t,e,r,s,d,_)=>{th(ot,i,t,e,r,s,d,_)}};var Dc=class extends aa{postMessage(t,e){globalThis.postMessage(t,e)}async instantiate(t,e,r){return await new ua(this,ot,t,e).instantiate(r)}};function fh(){let i=new Dc;globalThis.onmessage=async t=>{await i.onMessage(t.data)}}fh();return Bv(iS);})();
2
- /*! Bundled license information:
3
-
4
- js-sha256/src/sha256.js:
5
- (**
6
- * [js-sha256]{@link https://github.com/emn178/js-sha256}
7
- *
8
- * @version 0.11.1
9
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
10
- * @copyright Chen, Yi-Cyuan 2014-2025
11
- * @license MIT
12
- *)
13
- */
14
- //# sourceMappingURL=duckdb-browser-mvp.worker.js.map